share/hedgewars/Data/Maps/Basketball/map.lua
changeset 2999 30c4d62cd0c3
child 3000 2b9405b6dc5d
equal deleted inserted replaced
2998:5b74906c14bb 2999:30c4d62cd0c3
       
     1 -- Hedgewars - Basketball for 2 Players
       
     2 
       
     3 local caption = {
       
     4 	["en"] = "Hedgewars-Basketball",
       
     5 	["de"] = "Hedgewars-Basketball"
       
     6 	}
       
     7 
       
     8 local subcaption = {
       
     9 	["en"] = "Not So Friendly Match",
       
    10 	["de"] = "Kein-so-Freundschaftsspiel"
       
    11 	}
       
    12 
       
    13 local goal = {
       
    14 	["en"] = "Bat your opponents through the|baskets and out of the map!",
       
    15 	["de"] = "Schlage deine Widersacher durch|die Körbe und aus der Karte hinaus!"
       
    16 	}
       
    17 
       
    18 local scored = {
       
    19 	["en"] = " scored a point!",
       
    20 	["de"] = " erhält einen Punkt!"
       
    21 	}
       
    22 
       
    23 local sscore = {
       
    24 	["en"] = "Score",
       
    25 	["de"] = "Punktestand"
       
    26 	}
       
    27 
       
    28 local team = {
       
    29 	["en"] = "Team"
       
    30 	}
       
    31 
       
    32 local drowning = {
       
    33 	["en"] = "is out and",
       
    34 	["de"] = "ist draußen und"
       
    35 	}
       
    36 
       
    37 local function loc(text)
       
    38 	if text == nil then return "**missing**"
       
    39 	elseif text[L] == nil then return text["en"]
       
    40 	else return text[L]
       
    41 	end
       
    42 end
       
    43 
       
    44 ---------------------------------------------------------------
       
    45 
       
    46 local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0}
       
    47 
       
    48 function onGameInit()
       
    49 	GameFlags = gfSolidLand + gfBorder + gfInvulnerable + gfRandomOrder + gfLowGravity
       
    50 	TurnTime = 20000
       
    51 	CaseFreq = 0
       
    52 	LandAdds = 0
       
    53 	Explosives = 0
       
    54 	Delay = 0
       
    55 end
       
    56 
       
    57 function onGameStart()
       
    58 	ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0);
       
    59 end
       
    60 
       
    61 function onGameTick()
       
    62 end
       
    63 
       
    64 function onAmmoStoreInit()
       
    65 	SetAmmo(amBaseballBat, 9, 0, 0)
       
    66 end
       
    67 
       
    68 function onGearAdd(gear)
       
    69 end
       
    70 
       
    71 function onGearDelete(gear)
       
    72 	if GetGearType(gear) == gtHedgehog then
       
    73 		local clan = GetHogClan(gear)
       
    74 		score[clan] = score[clan] + 1
       
    75 		local s = loc(sscore) .. ": " .. score[0]
       
    76 		for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
       
    77 		ShowMission(loc(caption), loc(subcaption), GetHogName(gear) .. " " .. loc(drowning) .. "|" .. loc(team) .. " " .. (clan + 1) .. " " .. loc(scored) .. "| |" .. s, -amBaseballBat, 0)
       
    78 	end
       
    79 end