share/hedgewars/Data/Maps/Knockball/map.lua
author nemo
Thu, 01 Apr 2010 16:34:20 +0000
changeset 3238 e99a43a2405b
parent 3223 f0e590790f3b
child 3240 e3b52d10b4c2
permissions -rw-r--r--
Somehow, these files are not using local encoding
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3238
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
     1
-- Hedgewars - Knockball for 2+ Players
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
     2
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
     3
local caption = {
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
     4
	["en"] = "Hedgewars-Knockball",
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
     5
	["de"] = "Hedgewars-Knockball",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
     6
	["es"] = "Hedgewars-Knockball",
3238
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
     7
	["pl"] = "Hedgewars-Knockball"
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
     8
	}
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
     9
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    10
local subcaption = {
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    11
	["en"] = "Not So Friendly Match",
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    12
	["de"] = "Kein-so-Freundschaftsspiel",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
    13
	["es"] = "Partido no-tan-amistoso",
3238
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    14
	["pl"] = "Mecz Nie-Taki-Towarzyski"
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    15
	}
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    16
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    17
local goal = {
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    18
	["en"] = "Bat balls at your enemies and|push them into the sea!",
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    19
	["de"] = "Schlage Bälle auf deine Widersacher|und lass sie ins Meer fallen!",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
    20
	["es"] = "¡Batea pelotas hacia tus enemigos|y hazlos caer al agua!",
3238
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    21
	["pl"] = "Uderzaj piłkami w swoich przeciwników|i strącaj ich do wody!"
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    22
	}
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    23
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    24
local scored = {
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    25
	["en"] = "%s is out and Team %d|scored a point!| |Score:",
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    26
	["de"] = "%s ist draußen und Team %d|erhält einen Punkt!| |Punktestand:",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
    27
	["es"] = "¡%s cayó y Equipo %d|anotó un tanto!| |Puntuación:",
3238
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    28
	["pl"] = "%s utonął i drużyna %d|zdobyła punkt!| |Punktacja:"
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    29
	}
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    30
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    31
local failed = {
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    32
	["en"] = "%s is out and Team %d|scored a penalty!| |Score:",
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    33
	["de"] = "%s ist draußen und Team %d|erhält eine Strafe!| |Punktestand:",
3223
f0e590790f3b credits updated, adding Palewolf, sheepluva and prg as devs and replaced my previous openal stuff with something more current
koda
parents: 3197
diff changeset
    34
	["es"] = "¡%s cayó y Equipo %d|anotó una falta!| |Puntuación:",
3238
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    35
	["pl"] = "%s utonął i drużyna %d|dostała punkt karny!| |Punktacja:"
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    36
	}
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    37
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    38
local function loc(text)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    39
	if text == nil then return "**missing**"
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    40
	elseif text[L] == nil then return text["en"]
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    41
	else return text[L]
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    42
	end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    43
end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    44
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    45
---------------------------------------------------------------
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    46
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    47
local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0}
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    48
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    49
local ball = nil
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    50
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    51
function onGameInit()
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    52
	GameFlags = gfSolidLand + gfInvulnerable + gfDivideTeams
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    53
	TurnTime = 20000
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    54
	CaseFreq = 0
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    55
	LandAdds = 0
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    56
	Explosives = 0
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    57
	Delay = 500
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    58
	SuddenDeathTurns = 99999 -- "disable" sudden death
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    59
end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    60
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    61
function onGameStart()
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    62
	ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0);
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    63
end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    64
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    65
function onGameTick()
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    66
	if ball ~= nil and GetFollowGear() ~= nil then FollowGear(ball) end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    67
end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    68
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    69
function onAmmoStoreInit()
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    70
	SetAmmo(amBaseballBat, 9, 0, 0)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    71
	SetAmmo(amSkip, 9, 0, 0)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    72
end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    73
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    74
function onGearAdd(gear)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    75
	if GetGearType(gear) == gtShover then
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    76
		ball = AddGear(GetX(gear), GetY(gear), gtBall, 0, 0, 0, 0)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    77
		if ball ~= nil then
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    78
			CopyPV2(gear, ball)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    79
			SetState(ball, 0x200) -- temporary - might change!
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    80
			SetTag(ball, 8) -- baseball skin
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    81
			FollowGear(ball)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    82
		end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    83
	end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    84
end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    85
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    86
function onGearDelete(gear)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    87
	if gear == ball then
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    88
		ball = nil
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    89
	elseif (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    90
		local clan = GetHogClan(CurrentHedgehog)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    91
		local s
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    92
		if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    93
			score[clan] = score[clan] + 1
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    94
			s = string.format(loc(scored), GetHogName(gear), clan + 1)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    95
		else
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    96
			score[clan] = score[clan] - 1
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    97
			s = string.format(loc(failed), GetHogName(gear), clan + 1)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    98
		end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
    99
		s = s .. " " .. score[0]
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
   100
		for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
   101
		ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0)
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
   102
	end
e99a43a2405b Somehow, these files are not using local encoding
nemo
parents: 3223
diff changeset
   103
end