share/hedgewars/Data/Maps/Knockball/map.lua
author Wuzzy <almikes@aol.com>
Fri, 20 Oct 2017 21:55:18 +0200
changeset 12726 9852b8ba8d5a
parent 12087 c680b7db1e2e
child 14406 6c21bd8547dd
permissions -rw-r--r--
Run lupdate $ lupdate QTfrontend -ts share/hedgewars/Data/Locale/*.ts
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4506
37744d5c877e Finnished up the lua translations by adding training maps, campaign is ignored for now
Henek
parents: 4502
diff changeset
     1
-- Hedgewars - Knockball for 2+ Players
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     2
9093
4114ce5d885d fix locale load
nemo
parents: 8349
diff changeset
     3
HedgewarsScriptLoad("/Scripts/Locale.lua")
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     4
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     5
local ball = nil
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     6
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     7
function onGameInit()
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     8
	GameFlags = gfSolidLand + gfInvulnerable + gfDivideTeams
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
     9
	TurnTime = 20000
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    10
	CaseFreq = 0
4162
923db448ad16 update and fix some lua stuff
Henek
parents: 3465
diff changeset
    11
	MinesNum = 0
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    12
	Explosives = 0
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    13
	Delay = 500
12084
8f222872d432 Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents: 12082
diff changeset
    14
	-- Disable Sudden Death
8f222872d432 Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents: 12082
diff changeset
    15
	WaterRise = 0
8f222872d432 Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents: 12082
diff changeset
    16
	HealthDecrease = 0
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    17
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    18
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    19
function onGameStart()
12082
ce3860c82c8b Rewrite 2nd line of mission panel of most missions for consistency
Wuzzy <almikes@aol.com>
parents: 11202
diff changeset
    20
	ShowMission(loc("Knockball"), loc("Not So Friendly Match"), loc("Bat balls at your enemies and|push them into the sea!"), -amBaseballBat, 0)
12087
c680b7db1e2e Add custom ammo texts for Knockball
Wuzzy <almikes@aol.com>
parents: 12086
diff changeset
    21
	SetAmmoTexts(amBaseballBat, loc("Baseball Bat with Ball"), loc("Knockball weapon"), loc("Throw a baseball at your foes|and send them flying!") .. "|" .. loc("Attack: Throw ball"))
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    22
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    23
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    24
function onGameTick()
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    25
	if ball ~= nil and GetFollowGear() ~= nil then FollowGear(ball) end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    26
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    27
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    28
function onAmmoStoreInit()
3346
967fd96f7373 Engine/Frontend:
smxx
parents: 3266
diff changeset
    29
	SetAmmo(amBaseballBat, 9, 0, 0, 0)
967fd96f7373 Engine/Frontend:
smxx
parents: 3266
diff changeset
    30
	SetAmmo(amSkip, 9, 0, 0, 0)
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    31
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    32
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    33
function onGearAdd(gear)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    34
	if GetGearType(gear) == gtShover then
7777
e0be9fbc21b4 Fix knockball
nemo
parents: 4517
diff changeset
    35
		ball = AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtBall, 0, 0, 0, 0)
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    36
		if ball ~= nil then
4517
0618b31023dc added team flag to AddTeam and made AI team allowed to have custom flags. added GetGearVelocity and SetGearVelocity and removed CopyPV2. changed knockball to use use these functions instead.
Henek
parents: 4506
diff changeset
    37
			local dx, dy = GetGearVelocity(gear)
0618b31023dc added team flag to AddTeam and made AI team allowed to have custom flags. added GetGearVelocity and SetGearVelocity and removed CopyPV2. changed knockball to use use these functions instead.
Henek
parents: 4506
diff changeset
    38
			SetGearVelocity(ball, dx * 2, dy * 2)
3263
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    39
			SetState(ball, 0x200) -- temporary - might change!
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    40
			SetTag(ball, 8) -- baseball skin
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    41
			FollowGear(ball)
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
end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    45
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    46
function onGearDelete(gear)
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    47
	if gear == ball then
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    48
		ball = nil
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    49
	end
fd1588933051 Fix line endings. Again.
nemo
parents: 3257
diff changeset
    50
end
11202
cc308446f90d preselect baseball bat in Knockball and Basketball
sheepluva
parents: 9093
diff changeset
    51
cc308446f90d preselect baseball bat in Knockball and Basketball
sheepluva
parents: 9093
diff changeset
    52
function onNewTurn()
cc308446f90d preselect baseball bat in Knockball and Basketball
sheepluva
parents: 9093
diff changeset
    53
    SetWeapon(amBaseballBat)
cc308446f90d preselect baseball bat in Knockball and Basketball
sheepluva
parents: 9093
diff changeset
    54
end