share/hedgewars/Data/Missions/Training/User_Mission_-_That_Sinking_Feeling.lua
author nemo
Sun, 26 Jun 2011 19:42:44 -0400
changeset 5325 261b79ba22b1
parent 5278 1aadb3312828
child 5823 f906f6645e02
permissions -rw-r--r--
Lua update. New phrases. Try to remove some duplicates by avoiding use of space and : in short common phrases. Removed localisation of some script names, since we can't localise that in frontend yet anyway, without screwing up multiplayer.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
     1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
     2
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
     3
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
     4
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
     5
local player
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
     6
local hh = {}
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
     7
local hhCount = 8
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
     8
local GameOver = false
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
     9
local introStage = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    10
local genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    11
local waterCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    12
local waterPix = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    13
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    14
-- allow skipping of the intro via hitting precise key
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    15
function onPrecise()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    16
	if introStage < 100 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    17
		introStage = 110
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    18
		genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    19
		FollowGear(CurrentHedgehog)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    20
		AddCaption(loc("Good luck out there!"))
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    21
		ShowMission(loc("That Sinking Feeling"), loc("User Challenge"), loc("Save as many hapless hogs as possible!"), 4, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    22
	end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    23
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    24
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    25
function onGameInit()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    26
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    27
	Seed = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    28
	GameFlags = gfInfAttack + gfInvulnerable
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    29
	TurnTime = 90000
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    30
	CaseFreq = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    31
	MinesNum = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    32
	MinesTime  = 3000
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    33
	Explosives = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    34
	Delay = 10
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    35
	Map = "Islands"
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    36
	Theme = "City"
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    37
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    38
	AddTeam(loc("Nameless Heroes"), 14483456, "Simple", "Island", "Default")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    39
	player = AddHog(loc("The Nameless One"), 0, 1, "NoHat")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    40
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    41
	AddTeam(loc("Hapless Hogs"), 	1175851, "Simple", "Island", "Default")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    42
	hh[0] = AddHog(loc("Sinky"), 1, 100, "lemon")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    43
	hh[1] = AddHog(loc("Drowner"), 1, 100, "orange")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    44
	hh[2] = AddHog(loc("Heavy"), 1, 100, "Teapot")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    45
	hh[3] = AddHog(loc("Clumsy"), 1, 100, "SauceBoatSilver")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    46
	hh[4] = AddHog(loc("Silly"), 1, 100, "Ladle")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    47
	hh[5] = AddHog(loc("Careless"), 1, 100, "StrawHatEyes")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    48
	hh[6] = AddHog(loc("Sponge"), 1, 100, "Chunli")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    49
	hh[7] = AddHog(loc("Deadweight"), 1, 100, "Teacup")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    50
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    51
	SetGearPosition(player, 3992, 733)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    52
	SetGearPosition(hh[0], 938, 1369)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    53
	SetGearPosition(hh[1], 1301, 1439)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    54
	SetGearPosition(hh[2], 2093, 447)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    55
	SetGearPosition(hh[3], 2971, 926)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    56
	SetGearPosition(hh[4], 719, 545)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    57
	SetGearPosition(hh[5], 1630, 821)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    58
	SetGearPosition(hh[6], 2191, 810)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    59
	SetGearPosition(hh[7], 3799, 945)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    60
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    61
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    62
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    63
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    64
function onGameStart()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    65
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    66
	ShowMission(loc("That Sinking Feeling"), loc("User Challenge"), loc("Save as many hapless hogs as possible!"), 4, 1)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    67
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    68
	HogTurnLeft(hh[0], false)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    69
	HogTurnLeft(hh[1], true)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    70
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    71
	SpawnUtilityCrate(148,265,amLowGravity)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    72
	SpawnUtilityCrate(2124,1516,amJetpack)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    73
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    74
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    75
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    76
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    77
function onNewTurn()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    78
	TurnTimeLeft = -1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    79
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    80
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    81
function onGameTick()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    82
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    83
	-- intro sequence
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    84
	if introStage < 100 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    85
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    86
		AddCaption(loc("Press [Precise] to skip intro"))
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    87
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    88
		genCounter = genCounter + 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    89
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    90
		if introStage == 0 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    91
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    92
			FollowGear(hh[0])
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    93
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    94
			if genCounter == 2000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    95
				HogSay(hh[0], loc("This rain is really something..."), SAY_SAY,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    96
			elseif genCounter == 5000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    97
				introStage = 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    98
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    99
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   100
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   101
		elseif introStage == 1 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   102
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   103
			FollowGear(hh[1])
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   104
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   105
			if genCounter == 2000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   106
				HogSay(hh[1], loc("Heh, it's not that bad."), SAY_SAY,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   107
			elseif genCounter == 5000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   108
				introStage = 2
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   109
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   110
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   111
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   112
		elseif introStage == 2 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   113
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   114
			FollowGear(hh[0])
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   115
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   116
			if genCounter == 2000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   117
				HogSay(hh[0], loc("You'd almost swear the water was rising!"), SAY_SHOUT,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   118
			elseif genCounter == 6000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   119
				introStage = 3
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   120
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   121
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   122
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   123
		elseif introStage == 3 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   124
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   125
			FollowGear(hh[1])
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   126
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   127
			if genCounter == 2000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   128
				HogSay(hh[1], loc("Haha, now THAT would be something!"), SAY_SAY,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   129
			elseif genCounter == 6000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   130
				introStage = 4
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   131
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   132
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   133
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   134
		elseif introStage == 4 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   135
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   136
			FollowGear(hh[0])
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   137
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   138
			if genCounter == 2000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   139
				HogSay(hh[0], loc("Hahahaha!"), SAY_SHOUT,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   140
				HogSay(hh[1], loc("Hahahaha!"), SAY_SHOUT,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   141
			elseif genCounter == 3000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   142
				introStage = 5
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   143
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   144
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   145
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   146
		elseif introStage == 5 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   147
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   148
			FollowGear(hh[1])
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   149
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   150
			if genCounter == 2000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   151
				HogSay(hh[0], loc("..."), SAY_THINK,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   152
				HogSay(hh[1], loc("..."), SAY_THINK,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   153
			elseif genCounter == 5000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   154
				introStage = 6
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   155
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   156
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   157
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   158
		elseif introStage == 6 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   159
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   160
			FollowGear(hh[0])
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   161
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   162
			if genCounter == 2000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   163
				HogSay(hh[0], loc("It's a good thing SUDDEN DEATH is 99 turns away..."), SAY_THINK,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   164
			elseif genCounter == 6000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   165
				introStage = 7
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   166
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   167
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   168
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   169
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   170
		elseif introStage == 7 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   171
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   172
			if genCounter == 2000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   173
				introStage = 110
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   174
				FollowGear(CurrentHedgehog)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   175
				ShowMission(loc("That Sinking Feeling"), loc("User Challenge"), loc("Save as many hapless hogs as possible!"), 4, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   176
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   177
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   178
		end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   179
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   180
	end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   181
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   182
	-- start the water rising when the intro is finished
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   183
	if introStage == 110 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   184
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   185
		waterCounter = waterCounter + 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   186
		if (waterCounter == 100) and (waterPix < 1615) then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   187
			waterCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   188
			SetTag(AddGear(0, 0, gtWaterUp, 0, 0, 0, 0), 1)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   189
			waterPix = waterPix +1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   190
			--AddCaption(waterPix)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   191
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   192
			if (waterPix >= 1615) and (GameOver == false) then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   193
				GameOver = true
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   194
				SetHealth(player, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   195
				TurnTimeLeft = 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   196
				ShowMission(loc("That Sinking Feeling"), loc("MISSION SUCCESS"), loc("You saved") .. " " .. hhCount .. " " .. loc("Hapless Hogs") .."!", 0, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   197
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   198
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   199
		end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   200
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   201
	end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   202
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   203
	if TurnTimeLeft == 1 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   204
		SetHealth(player, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   205
	end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   206
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   207
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   208
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   209
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   210
function onAmmoStoreInit()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   211
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   212
	SetAmmo(amBazooka, 9, 0, 0, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   213
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   214
	SetAmmo(amRope, 9, 0, 0, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   215
	SetAmmo(amParachute, 9, 0, 0, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   216
	SetAmmo(amJetpack, 2, 0, 0, 2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   217
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   218
	SetAmmo(amGirder, 9, 0, 0, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   219
	SetAmmo(amBaseballBat, 9, 0, 0, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   220
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   221
	SetAmmo(amTeleport, 1, 0, 0, 1)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   222
	SetAmmo(amPortalGun, 3, 0, 0, 1)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   223
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   224
	SetAmmo(amLowGravity, 0, 0, 0, 1)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   225
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   226
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   227
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   228
function onGearDelete(gear)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   229
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   230
	if GetGearType(gear) == gtHedgehog then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   231
		if GetHogTeamName(gear) == "Hapless Hogs" then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   232
			hhCount = hhCount - 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   233
			AddCaption(hhCount .. loc(" Hapless Hogs left!"))
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   234
		end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   235
	end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   236
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   237
	if ((gear == player) or (hhCount == 0)) and (GameOver == false) then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   238
		SetHealth(player, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   239
		TurnTimeLeft = 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   240
		ShowMission(loc("That Sinking Feeling"), loc("MISSION FAILED"), loc("Oh no! Just try again!"), -amSkip, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   241
		GameOver = true
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   242
	end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   243
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   244
end