share/hedgewars/Data/Missions/Training/Basic_Training_-_Grenade.lua
author Wuzzy <Wuzzy2@mail.ru>
Wed, 15 May 2019 03:25:20 +0200
changeset 14956 c173fae0a223
parent 14933 4c5fb1ee75b7
child 15073 6f51c75994a4
permissions -rw-r--r--
Hide player ranks in training missions
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
     1
--[[
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
     2
	Basic Grenade Training
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
     3
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
     4
	This training mission teaches players how to use the grenade.
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
     5
	Lesson plan:
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
     6
	- Selecting grenade
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
     7
	- Aiming and shooting
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
     8
	- Timer
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
     9
	- No wind
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    10
	- Bounciness
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    11
]]
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
    12
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7877
diff changeset
    13
HedgewarsScriptLoad("/Scripts/Locale.lua")
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
    14
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    15
local hog			-- Hog gear
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    16
local weaponSelected = false	-- Player has selected the weapon
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    17
local gamePhase = 0		-- Used to track progress
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    18
local targetsLeft = 0		-- # of targets left in this round
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    19
local targetGears = {}		-- list of target gears
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    20
local gameOver = false		-- If true, game has ended
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    21
local shotsFired = 0		-- Total # of grenades fired
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    22
local maxTargets = 0		-- Target counter, used together with flawless
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    23
local flawless = true		-- track flawless victory (100% accuracy, no hurt, no death)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    24
local missedTauntTimer = -1	-- Wait timer for playing sndMissed. -1 = no-op
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    25
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    26
function onGameInit()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    27
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    28
	ClearGameFlags()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    29
	EnableGameFlags(gfDisableWind, gfOneClanMode, gfInfAttack, gfSolidLand, gfArtillery)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    30
	Map = "Mushrooms"
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    31
	Seed = 0
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    32
	Theme = "Nature"
13755
110d6c1e817f Lua: Rename globals: NoPointX→NO_CURSOR, cMaxTurnTime→MAX_TURN_TIME, cMaxHogHealth→MAX_HOG_HEALTH
Wuzzy <Wuzzy2@mail.ru>
parents: 13669
diff changeset
    33
	TurnTime = MAX_TURN_TIME
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    34
	Explosives = 0
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    35
	MinesNum = 0
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    36
	CaseFreq = 0
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    37
	WaterRise = 0
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    38
	HealthDecrease = 0
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    39
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    40
	------ TEAM LIST ------
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    41
14485
208359558642 Use player-chosen team identity for training and a few challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 14469
diff changeset
    42
	AddMissionTeam(-1)
208359558642 Use player-chosen team identity for training and a few challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 14469
diff changeset
    43
	hog = AddMissionHog(1)
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    44
	SetGearPosition(hog, 570, 157)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    45
	SetEffect(hog, heResurrectable, 1)
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
    46
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    47
	SendHealthStatsOff()
14956
c173fae0a223 Hide player ranks in training missions
Wuzzy <Wuzzy2@mail.ru>
parents: 14933
diff changeset
    48
	SendRankingStatsOff()
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    49
end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    50
13635
fe7d2bbf5f3f Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents: 13588
diff changeset
    51
function onGearResurrect(gear, vGear)
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    52
	if gear == hog then
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    53
		flawless = false
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    54
		SetGearPosition(hog, 570, 157)
13635
fe7d2bbf5f3f Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents: 13588
diff changeset
    55
		if vGear then
fe7d2bbf5f3f Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents: 13588
diff changeset
    56
			SetVisualGearValues(vGear, GetX(hog), GetY(hog))
fe7d2bbf5f3f Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents: 13588
diff changeset
    57
		end
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    58
		AddCaption(loc("Your hedgehog has been revived!"))
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    59
	end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    60
end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    61
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    62
local function placeGirders()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    63
	PlaceGirder(918, 248, 1)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    64
	PlaceGirder(888, 129, 6)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    65
	PlaceGirder(844, 35, 1)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    66
	PlaceGirder(932, 37, 3)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    67
	PlaceGirder(926, 148, 6)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    68
	PlaceGirder(73, 812, 5)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    69
	PlaceGirder(189, 930, 5)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    70
	PlaceGirder(15, 669, 6)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    71
	PlaceGirder(15, 507, 6)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    72
	PlaceGirder(15, 344, 6)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    73
	PlaceGirder(62, 27, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    74
	PlaceGirder(229, 115, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    75
	PlaceGirder(1195, 250, 7)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    76
	PlaceGirder(1285, 205, 1)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    77
	PlaceGirder(1358, 201, 3)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    78
	PlaceGirder(1756, 415, 6)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    79
	PlaceGirder(1893, 95, 6)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    80
	PlaceGirder(1005, 333, 5)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    81
	PlaceGirder(1860, 187, 0)
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
    82
end
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
    83
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    84
local function spawnTargets()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    85
	-- Warm-up
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    86
	if gamePhase == 0 then
14545
ed90b5e2545b Swap 2 targets in grenade training to make the start a bit easier
Wuzzy <Wuzzy2@mail.ru>
parents: 14544
diff changeset
    87
		AddGear(945, 498, gtTarget, 0, 0, 0, 0)
13295
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
    88
	-- Timer
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
    89
	elseif gamePhase == 2 then
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    90
		AddGear(233, 97, gtTarget, 0, 0, 0, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    91
		AddGear(333, 255, gtTarget, 0, 0, 0, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    92
		AddGear(753, 225, gtTarget, 0, 0, 0, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    93
	-- No Wind
13295
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
    94
	elseif gamePhase == 3 then
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
    95
		AddGear(15, 240, gtTarget, 0, 0, 0, 0)
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    96
		AddGear(61, 9, gtTarget, 0, 0, 0, 0)
14545
ed90b5e2545b Swap 2 targets in grenade training to make the start a bit easier
Wuzzy <Wuzzy2@mail.ru>
parents: 14544
diff changeset
    97
		AddGear(882, 39, gtTarget, 0, 0, 0, 0)
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
    98
	-- Bounciness
13295
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
    99
	elseif gamePhase == 4 then
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   100
		AddGear(1318, 208, gtTarget, 0, 0, 0, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   101
		AddGear(1697, 250, gtTarget, 0, 0, 0, 0)
14544
c36d67d6366d Update grenade training to support bounciness in Touch
Wuzzy <Wuzzy2@mail.ru>
parents: 14485
diff changeset
   102
		AddGear(323, 960, gtTarget, 0, 0, 0, 0)
c36d67d6366d Update grenade training to support bounciness in Touch
Wuzzy <Wuzzy2@mail.ru>
parents: 14485
diff changeset
   103
		AddGear(1852, 100, gtTarget, 0, 0, 0, 0)
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   104
	-- Grand Final
13295
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
   105
	elseif gamePhase == 5 then
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   106
		AddGear(186, 473, gtTarget, 0, 0, 0, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   107
		AddGear(950, 250, gtTarget, 0, 0, 0, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   108
		AddGear(1102, 345, gtTarget, 0, 0, 0, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   109
		AddGear(1556, 297, gtTarget, 0, 0, 0, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   110
	end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   111
end
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   112
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   113
function onGameStart()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   114
	placeGirders()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   115
	spawnTargets()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   116
	ShowMission(loc("Basic Grenade Training"), loc("Basic Training"), loc("Destroy all the targets!"), -amGrenade, 0)
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   117
end
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   118
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   119
function newGamePhase()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   120
	-- Spawn targets, update wind and ammo, show instructions
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   121
	local ctrl = ""
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   122
	if gamePhase == 0 then
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   123
		if INTERFACE == "desktop" then
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   124
			ctrl = loc("Open ammo menu: [Right click]").."|"..
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   125
			loc("Select weapon: [Left click]")
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   126
		else
14393
cf49fac6e88a Make better re-use of some mission strings
Wuzzy <Wuzzy2@mail.ru>
parents: 14387
diff changeset
   127
			ctrl = loc("Open ammo menu: Tap the [Suitcase]")
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   128
		end
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   129
		ShowMission(loc("Basic Grenade Training"), loc("Select Weapon"), loc("To begin with the training, select the grenade from the ammo menu!").."|"..
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   130
		ctrl, 2, 5000)
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   131
	elseif gamePhase == 1 then
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   132
		if INTERFACE == "desktop" then
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   133
			ctrl = loc("Attack: [Space]").."|"..
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   134
			loc("Aim: [Up]/[Down]").."|"..
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   135
			loc("Change direction: [Left]/[Right]")
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   136
		elseif INTERFACE == "touch" then
14393
cf49fac6e88a Make better re-use of some mission strings
Wuzzy <Wuzzy2@mail.ru>
parents: 14387
diff changeset
   137
			ctrl = loc("Attack: Tap the [Bomb]").."|"..
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   138
			loc("Aim: [Up]/[Down]").."|"..
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   139
			loc("Change direction: [Left]/[Right]")
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   140
		end
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   141
		ShowMission(loc("Basic Grenade Training"), loc("Warming Up"),
13295
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
   142
		loc("Throw a grenade to destroy the target!").."|"..
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   143
		loc("Hold the Attack key pressed for more power.").."|"..
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   144
		ctrl.."|"..
13361
ced5dc3079a3 Minor improvements in tutorial mission texts to make stuff clearer
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   145
		loc("Note: Walking is disabled in this mission."), 2, 20000)
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   146
		spawnTargets()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   147
	elseif gamePhase == 2 then
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   148
		if INTERFACE == "desktop" then
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   149
			ctrl = loc("Set detonation timer: [1]-[5]")
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   150
		elseif INTERFACE == "touch" then
14393
cf49fac6e88a Make better re-use of some mission strings
Wuzzy <Wuzzy2@mail.ru>
parents: 14387
diff changeset
   151
			ctrl = loc("Change detonation timer: Tap the [Clock]")
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   152
		end
13295
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
   153
		ShowMission(loc("Basic Grenade Training"), loc("Timer"),
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
   154
		loc("You can change the detonation timer of grenades.").."|"..
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
   155
		loc("Grenades explode after 1 to 5 seconds (you decide).").."|"..
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   156
		ctrl, 2, 15000)
13295
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
   157
		spawnTargets()
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
   158
	elseif gamePhase == 3 then
13359
f9a15dcd857c Fix a couple of English typos
Wuzzy <Wuzzy2@mail.ru>
parents: 13295
diff changeset
   159
		ShowMission(loc("Basic Grenade Training"), loc("No Wind Influence"), loc("Unlike bazookas, grenades are not influenced by wind.").."|"..
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   160
		loc("Destroy the targets!"), 2, 6000)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   161
		SetWind(50)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   162
		spawnTargets()
13295
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
   163
	elseif gamePhase == 4 then
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   164
		local caption = loc("Bounciness")
14544
c36d67d6366d Update grenade training to support bounciness in Touch
Wuzzy <Wuzzy2@mail.ru>
parents: 14485
diff changeset
   165
		ctrl = loc("You can set the bounciness of grenades (and grenade-like weapons).").."|"..
c36d67d6366d Update grenade training to support bounciness in Touch
Wuzzy <Wuzzy2@mail.ru>
parents: 14485
diff changeset
   166
		loc("Grenades with high bounciness bounce a lot and behave chaotic.").."|"..
c36d67d6366d Update grenade training to support bounciness in Touch
Wuzzy <Wuzzy2@mail.ru>
parents: 14485
diff changeset
   167
		loc("With low bounciness, it barely bounces at all, but it is much more predictable.").."|"..
c36d67d6366d Update grenade training to support bounciness in Touch
Wuzzy <Wuzzy2@mail.ru>
parents: 14485
diff changeset
   168
		loc("Try out different bounciness levels to reach difficult targets.").."|"
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   169
		if INTERFACE == "desktop" then
14544
c36d67d6366d Update grenade training to support bounciness in Touch
Wuzzy <Wuzzy2@mail.ru>
parents: 14485
diff changeset
   170
			ctrl = ctrl .. loc("Set bounciness: [Left Shift] + [1]-[5]")
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   171
		elseif INTERFACE == "touch" then
14544
c36d67d6366d Update grenade training to support bounciness in Touch
Wuzzy <Wuzzy2@mail.ru>
parents: 14485
diff changeset
   172
			ctrl = ctrl .. loc("Change bounciness: Tap [B]")
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   173
		end
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   174
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   175
		ShowMission(loc("Basic Grenade Training"), caption, ctrl, 2, 20000)
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   176
		spawnTargets()
13295
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
   177
	elseif gamePhase == 5 then
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   178
		if INTERFACE == "desktop" then
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   179
			ctrl = loc("Precise Aim: [Left Shift] + [Up]/[Down]")
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   180
			-- FIXME: No precise aim in touch interface yet :(
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   181
		end
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   182
		ShowMission(loc("Basic Grenade Training"), loc("Final Targets"), loc("Good job! Now destroy the final targets to finish the training.").."|"..
14387
f9d4b8222903 Add tutorial texts for Touch interface
Wuzzy <Wuzzy2@mail.ru>
parents: 13755
diff changeset
   183
		ctrl,
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   184
		2, 7000)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   185
		spawnTargets()
13295
a3b07219a091 Grenade Training: Add warm-up sequence, introduce timer in separate mission panel
Wuzzy <Wuzzy2@mail.ru>
parents: 13170
diff changeset
   186
	elseif gamePhase == 6 then
14469
ead8928a59f8 Report mission victory for most missions
Wuzzy <Wuzzy2@mail.ru>
parents: 14393
diff changeset
   187
		SaveMissionVar("Won", "true")
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   188
		ShowMission(loc("Basic Grenade Training"), loc("Training complete!"), loc("Congratulations!"), 0, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   189
		SetInputMask(0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   190
		AddAmmo(CurrentHedgehog, amGrenade, 0)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   191
		if shotsFired > maxTargets then
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   192
			flawless = false
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   193
		end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   194
		if flawless then
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   195
			PlaySound(sndFlawless, hog)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   196
		else
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   197
			PlaySound(sndVictory, hog)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   198
		end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   199
		SendStat(siCustomAchievement, loc("Good job!"))
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   200
		SendStat(siGameResult, loc("You have completed the Basic Grenade Training!"))
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   201
		EndGame()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   202
		gameOver = true
14933
4c5fb1ee75b7 Add winner animation for missions that didn't have it
Wuzzy <Wuzzy2@mail.ru>
parents: 14545
diff changeset
   203
		SetState(hog, gstWinner)
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   204
	end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   205
	gamePhase = gamePhase + 1
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   206
end
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   207
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   208
function onNewTurn()
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   209
	if gamePhase == 0 then
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   210
		newGamePhase()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   211
	end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   212
end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   213
13170
89a6b862e692 Bazooka/Grenade Training: Make weapon selection detection future-proof
Wuzzy <Wuzzy2@mail.ru>
parents: 13080
diff changeset
   214
function onGameTick20()
89a6b862e692 Bazooka/Grenade Training: Make weapon selection detection future-proof
Wuzzy <Wuzzy2@mail.ru>
parents: 13080
diff changeset
   215
	if not weaponSelected and gamePhase == 1 and GetCurAmmoType() == amGrenade then
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   216
		newGamePhase()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   217
		weaponSelected = true
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   218
	end
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   219
end
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   220
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   221
function onHogAttack(ammoType)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   222
	if ammoType == amGrenade then
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   223
		HideMission()
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   224
	end
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   225
end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   226
13508
c5d7376fa58a Bazooka/Grende training: Hide mission panel on pressing attack key
Wuzzy <Wuzzy2@mail.ru>
parents: 13361
diff changeset
   227
function onAttack()
c5d7376fa58a Bazooka/Grende training: Hide mission panel on pressing attack key
Wuzzy <Wuzzy2@mail.ru>
parents: 13361
diff changeset
   228
	if GetCurAmmoType() == amGrenade then
c5d7376fa58a Bazooka/Grende training: Hide mission panel on pressing attack key
Wuzzy <Wuzzy2@mail.ru>
parents: 13361
diff changeset
   229
		HideMission()
c5d7376fa58a Bazooka/Grende training: Hide mission panel on pressing attack key
Wuzzy <Wuzzy2@mail.ru>
parents: 13361
diff changeset
   230
	end
c5d7376fa58a Bazooka/Grende training: Hide mission panel on pressing attack key
Wuzzy <Wuzzy2@mail.ru>
parents: 13361
diff changeset
   231
end
c5d7376fa58a Bazooka/Grende training: Hide mission panel on pressing attack key
Wuzzy <Wuzzy2@mail.ru>
parents: 13361
diff changeset
   232
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   233
function onGearAdd(gear)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   234
	if GetGearType(gear) == gtTarget then
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   235
		targetsLeft = targetsLeft + 1
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   236
		maxTargets = maxTargets + 1
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   237
		targetGears[gear] = true
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   238
	elseif GetGearType(gear) == gtGrenade then
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   239
		shotsFired = shotsFired + 1
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   240
	end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   241
end
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   242
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   243
function onGearDelete(gear)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   244
	if GetGearType(gear) == gtTarget then
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   245
		targetsLeft = targetsLeft - 1
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   246
		targetGears[gear] = nil
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   247
		if targetsLeft <= 0 then
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   248
			newGamePhase()
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   249
		end
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   250
	end
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   251
end
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   252
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   253
function onGearDamage(gear)
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   254
	if gear == hog then
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   255
		flawless = false
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   256
	end
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   257
end
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   258
13080
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   259
function onAmmoStoreInit()
730db0a3eb43 Completely redo Basic Grenade Training
Wuzzy <Wuzzy2@mail.ru>
parents: 12229
diff changeset
   260
	SetAmmo(amGrenade, 9, 0, 0, 0)
7094
f5a5578be66b A few scripts to try out. 2x challenge, 1x GSoC training, 1x user mission.
mikade <redgrinner@gmail.com>
parents:
diff changeset
   261
end