share/hedgewars/Data/Maps/Knockball/map.lua
author nemo
Fri, 02 Apr 2010 18:35:53 +0000
changeset 3263 fd1588933051
parent 3257 fff80d469185
child 3264 3cf9d915cdb9
permissions -rw-r--r--
Fix line endings. Again.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     1
-- Hedgewars - Knockball for 2+ Players
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     2
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     3
local caption = {
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     4
	["en"] = "Hedgewars-Knockball",
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
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",
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     7
	["pl"] = "Hedgewars-Knockball"
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     8
	}
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     9
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    10
local subcaption = {
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    11
	["en"] = "Not So Friendly Match",
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
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",
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    14
	["pl"] = "Mecz Nie-Taki-Towarzyski"
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    15
	}
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    16
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    17
local goal = {
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    18
	["en"] = "Bat balls at your enemies and|push them into the sea!",
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
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!",
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    21
	["pl"] = "Uderzaj piłkami w swoich przeciwników|i strącaj ich do wody!"
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    22
	}
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    23
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    24
local scored = {
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    25
	["en"] = "%s is out and Team %d|scored a point!| |Score:",
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
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:",
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    28
	["pl"] = "%s utonął i drużyna %d|zdobyła punkt!| |Punktacja:"
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    29
	}
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    30
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    31
local failed = {
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    32
	["en"] = "%s is out and Team %d|scored a penalty!| |Score:",
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
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:",
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    35
	["pl"] = "%s utonął i drużyna %d|dostała punkt karny!| |Punktacja:"
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    36
	}
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    37
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    38
local function loc(text)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    39
	if text == nil then return "**missing**"
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    40
	elseif text[L] == nil then return text["en"]
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    41
	else return text[L]
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    42
	end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    43
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    44
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    45
---------------------------------------------------------------
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    46
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    47
local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0}
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    48
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    49
local ball = nil
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    50
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    51
local started = false
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    52
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    53
function onGameInit()
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    54
	GameFlags = gfSolidLand + gfInvulnerable + gfDivideTeams
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    55
	TurnTime = 20000
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    56
	CaseFreq = 0
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    57
	LandAdds = 0
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    58
	Explosives = 0
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    59
	Delay = 500
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    60
	SuddenDeathTurns = 99999 -- "disable" sudden death
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    61
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    62
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    63
function onGameStart()
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    64
	ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    65
	started = true
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    66
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    67
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    68
function onGameTick()
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    69
	if ball ~= nil and GetFollowGear() ~= nil then FollowGear(ball) end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    70
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    71
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    72
function onAmmoStoreInit()
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    73
	SetAmmo(amBaseballBat, 9, 0, 0)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    74
	SetAmmo(amSkip, 9, 0, 0)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    75
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    76
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    77
function onGearAdd(gear)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    78
	if GetGearType(gear) == gtShover then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    79
		ball = AddGear(GetX(gear), GetY(gear), gtBall, 0, 0, 0, 0)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    80
		if ball ~= nil then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    81
			CopyPV2(gear, ball)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    82
			SetState(ball, 0x200) -- temporary - might change!
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    83
			SetTag(ball, 8) -- baseball skin
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    84
			FollowGear(ball)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    85
		end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    86
	end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    87
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    88
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    89
function onGearDelete(gear)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    90
	if not started then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    91
		return
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    92
	end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    93
	if gear == ball then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    94
		ball = nil
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    95
	elseif (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    96
		local clan = GetHogClan(CurrentHedgehog)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    97
		local s
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    98
		if clan ~= nil then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    99
			if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   100
				score[clan] = score[clan] + 1
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   101
				s = string.format(loc(scored), GetHogName(gear), clan + 1)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   102
			else
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   103
				score[clan] = score[clan] - 1
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   104
				s = string.format(loc(failed), GetHogName(gear), clan + 1)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   105
			end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   106
			s = s .. " " .. score[0]
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   107
			for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   108
			ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   109
		end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   110
	end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   111
end