share/hedgewars/Data/Maps/Knockball/map.lua
author koda
Thu, 02 Dec 2010 00:25:26 +0100
changeset 4445 40f7924beb43
parent 4350 cdb3d7a39fa2
child 4502 759c1a3bb156
permissions -rw-r--r--
add a higher resolution preview image, could be nice to add a hover effect on normal preview that displays this bigger version
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",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3263
diff changeset
     7
	["pl"] = "Hedgewars-Knockball",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
     8
	["pt_PT"] = "Hedgewars-Knockball",
3465
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
     9
	["sk"] = "Hedgewars-Knockball",
4188
e1bf1b5a301e pt_BR, the return. also fix line ending screwups
arrom
parents: 4162
diff changeset
    10
	["sv"] = "Hedgewars-Knockball",
e1bf1b5a301e pt_BR, the return. also fix line ending screwups
arrom
parents: 4162
diff changeset
    11
	["pt_BR"] = "Hedgewars-Knockball"
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    12
	}
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    13
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    14
local subcaption = {
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    15
	["en"] = "Not So Friendly Match",
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    16
	["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
    17
	["es"] = "Partido no-tan-amistoso",
4270
d1673536b6e5 last-minute pl updates
szczur
parents: 4188
diff changeset
    18
	["pl"] = "Mecz Nie-Do-Końca Towarzyski",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    19
	["pt_PT"] = "Partida não muito amigável",
4350
cdb3d7a39fa2 updated/added slovak translations of lua files
jose1711
parents: 4270
diff changeset
    20
	["sk"] = "Nie tak celkom priateľský zápas",
4188
e1bf1b5a301e pt_BR, the return. also fix line ending screwups
arrom
parents: 4162
diff changeset
    21
	["sv"] = "En inte så vänlig match",
e1bf1b5a301e pt_BR, the return. also fix line ending screwups
arrom
parents: 4162
diff changeset
    22
	["pt_BR"] = "Partida não muito amigável"
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    23
	}
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    24
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    25
local goal = {
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    26
	["en"] = "Bat balls at your enemies and|push them into the sea!",
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    27
	["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
    28
	["es"] = "¡Batea pelotas hacia tus enemigos|y hazlos caer al agua!",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3263
diff changeset
    29
	["pl"] = "Uderzaj piłkami w swoich przeciwników|i strącaj ich do wody!",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    30
	["pt_PT"] = "Bate bolas contra os teus|enimigos e empurra-os ao mar!",
3465
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    31
	["sk"] = "Loptami triafajte vašich nepriateľov|a zhoďte ich tak do mora!",
4188
e1bf1b5a301e pt_BR, the return. also fix line ending screwups
arrom
parents: 4162
diff changeset
    32
	["sv"] = "Slå bollar mot dina fiender|och slå ner dem i havet",
e1bf1b5a301e pt_BR, the return. also fix line ending screwups
arrom
parents: 4162
diff changeset
    33
	["pt_BR"] = "Rebata as bolas em direção ao seus|e derrube-os no mar!"
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    34
	}
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    35
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    36
local scored = {
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    37
	["en"] = "%s is out and Team %d|scored a point!| |Score:",
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    38
	["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
    39
	["es"] = "¡%s cayó y Equipo %d|anotó un tanto!| |Puntuación:",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3263
diff changeset
    40
	["pl"] = "%s utonął i drużyna %d|zdobyła punkt!| |Punktacja:",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    41
	["pt_PT"] = "%s está fora e a equipa %d|soma um ponto!| |Pontuação:",
3465
b290993c0810 unbreak stuff
koda
parents: 3346
diff changeset
    42
	["sk"] = "%s je mimo hru a tím %d|získal bod!| |Skóre:",
4188
e1bf1b5a301e pt_BR, the return. also fix line ending screwups
arrom
parents: 4162
diff changeset
    43
	["sv"] = "%s är ute och lag %d|fick ett poäng!| |Poängställning:",
e1bf1b5a301e pt_BR, the return. also fix line ending screwups
arrom
parents: 4162
diff changeset
    44
	["pt_BR"] = "%s está fora e a Equipe %d|marcou um ponto!| |Pontuação:"
3263
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 failed = {
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    48
	["en"] = "%s is out and Team %d|scored a penalty!| |Score:",
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    49
	["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
    50
	["es"] = "¡%s cayó y Equipo %d|anotó una falta!| |Puntuación:",
3264
3cf9d915cdb9 inu adds portugese translation
nemo
parents: 3263
diff changeset
    51
	["pl"] = "%s utonął i drużyna %d|dostała punkt karny!| |Punktacja:",
3266
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    52
	["pt_PT"] = "%s está fora e a equipa %d|perde um ponto!| |Pontuação:",
aef4b9316060 Slovak translation from jose1711
nemo
parents: 3264
diff changeset
    53
	["sk"] = "%s je mimo hru a tím %d|dostal trestný bod!| |Skóre:",
4188
e1bf1b5a301e pt_BR, the return. also fix line ending screwups
arrom
parents: 4162
diff changeset
    54
	["sv"] = "%s är ute och lag %d|fick ett straff!| |Poängställning:",
e1bf1b5a301e pt_BR, the return. also fix line ending screwups
arrom
parents: 4162
diff changeset
    55
	["pt_BR"] = "%s está fora e a Equipe %d|sofreu uma penalidade!| |Pontuação:"
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    56
	}
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    57
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    58
local function loc(text)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    59
	if text == nil then return "**missing**"
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    60
	elseif text[L] == nil then return text["en"]
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    61
	else return text[L]
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    62
	end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    63
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    64
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    65
---------------------------------------------------------------
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    66
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    67
local score = {[0] = 0, [1] = 0, [2] = 0, [3] = 0, [4] = 0, [5] = 0}
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    68
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    69
local ball = nil
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    70
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    71
local started = false
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    72
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    73
function onGameInit()
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    74
	GameFlags = gfSolidLand + gfInvulnerable + gfDivideTeams
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    75
	TurnTime = 20000
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    76
	CaseFreq = 0
4162
923db448ad16 update and fix some lua stuff
Henek
parents: 3465
diff changeset
    77
	MinesNum = 0
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    78
	Explosives = 0
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    79
	Delay = 500
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    80
	SuddenDeathTurns = 99999 -- "disable" sudden death
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    81
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    82
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    83
function onGameStart()
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    84
	ShowMission(loc(caption), loc(subcaption), loc(goal), -amBaseballBat, 0)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    85
	started = true
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    86
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    87
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    88
function onGameTick()
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    89
	if ball ~= nil and GetFollowGear() ~= nil then FollowGear(ball) end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    90
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    91
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    92
function onAmmoStoreInit()
3346
967fd96f7373 Engine/Frontend:
smxx
parents: 3266
diff changeset
    93
	SetAmmo(amBaseballBat, 9, 0, 0, 0)
967fd96f7373 Engine/Frontend:
smxx
parents: 3266
diff changeset
    94
	SetAmmo(amSkip, 9, 0, 0, 0)
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    95
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    96
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    97
function onGearAdd(gear)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    98
	if GetGearType(gear) == gtShover then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    99
		ball = AddGear(GetX(gear), GetY(gear), gtBall, 0, 0, 0, 0)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   100
		if ball ~= nil then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   101
			CopyPV2(gear, ball)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   102
			SetState(ball, 0x200) -- temporary - might change!
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   103
			SetTag(ball, 8) -- baseball skin
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   104
			FollowGear(ball)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   105
		end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   106
	end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   107
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   108
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   109
function onGearDelete(gear)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   110
	if not started then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   111
		return
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   112
	end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   113
	if gear == ball then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   114
		ball = nil
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   115
	elseif (GetGearType(gear) == gtHedgehog) and CurrentHedgehog ~= nil then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   116
		local clan = GetHogClan(CurrentHedgehog)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   117
		local s
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   118
		if clan ~= nil then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   119
			if GetHogClan(CurrentHedgehog) ~= GetHogClan(gear) then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   120
				score[clan] = score[clan] + 1
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   121
				s = string.format(loc(scored), GetHogName(gear), clan + 1)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   122
			else
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   123
				score[clan] = score[clan] - 1
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   124
				s = string.format(loc(failed), GetHogName(gear), clan + 1)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   125
			end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   126
			s = s .. " " .. score[0]
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   127
			for i = 1, ClansCount - 1 do s = s .. " - " .. score[i] end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   128
			ShowMission(loc(caption), loc(subcaption), s, -amBaseballBat, 0)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   129
		end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   130
	end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
   131
end