share/hedgewars/Data/Missions/Training/User_Mission_-_That_Sinking_Feeling.lua
author mikade <redgrinner@gmail.com>
Thu, 11 Dec 2014 20:38:03 +0900
changeset 10655 1c85a442bd56
parent 8043 da083f8d95e6
child 11009 5b37f240edf8
permissions -rw-r--r--
Wuzzy's changes to stats for some of the training missions.
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
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 5823
diff changeset
     3
HedgewarsScriptLoad("/Scripts/Locale.lua")
5278
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
5823
mikade
parents: 5278
diff changeset
    13
local frig = 0
mikade
parents: 5278
diff changeset
    14
local watGear = nil
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    15
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    16
-- allow skipping of the intro via hitting precise key
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    17
function onPrecise()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    18
	if introStage < 100 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    19
		introStage = 110
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    20
		genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    21
		FollowGear(CurrentHedgehog)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    22
		AddCaption(loc("Good luck out there!"))
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    23
		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
    24
	end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    25
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    26
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    27
function onGameInit()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    28
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    29
	Seed = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    30
	GameFlags = gfInfAttack + gfInvulnerable
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    31
	TurnTime = 90000
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    32
	CaseFreq = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    33
	MinesNum = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    34
	MinesTime  = 3000
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    35
	Explosives = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    36
	Delay = 10
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    37
	Map = "Islands"
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    38
	Theme = "City"
5823
mikade
parents: 5278
diff changeset
    39
	SuddenDeathTurns = 1
5278
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("Nameless Heroes"), 14483456, "Simple", "Island", "Default")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    42
	player = AddHog(loc("The Nameless One"), 0, 1, "NoHat")
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    43
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    44
	AddTeam(loc("Hapless Hogs"), 	1175851, "Simple", "Island", "Default")
5823
mikade
parents: 5278
diff changeset
    45
	hh[0] = AddHog(loc("Sinky"), 1, 100, "fr_lemon")
mikade
parents: 5278
diff changeset
    46
	hh[1] = AddHog(loc("Drowner"), 1, 100, "fr_orange")
mikade
parents: 5278
diff changeset
    47
	hh[2] = AddHog(loc("Heavy"), 1, 100, "dish_Teapot")
mikade
parents: 5278
diff changeset
    48
	hh[3] = AddHog(loc("Clumsy"), 1, 100, "dish_SauceBoatSilver")
mikade
parents: 5278
diff changeset
    49
	hh[4] = AddHog(loc("Silly"), 1, 100, "dish_Ladle")
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    50
	hh[5] = AddHog(loc("Careless"), 1, 100, "StrawHatEyes")
5823
mikade
parents: 5278
diff changeset
    51
	hh[6] = AddHog(loc("Sponge"), 1, 100, "sf_chunli")
mikade
parents: 5278
diff changeset
    52
	hh[7] = AddHog(loc("Deadweight"), 1, 100, "dish_Teacup")
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    53
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    54
	SetGearPosition(player, 3992, 733)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    55
	SetGearPosition(hh[0], 938, 1369)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    56
	SetGearPosition(hh[1], 1301, 1439)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    57
	SetGearPosition(hh[2], 2093, 447)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    58
	SetGearPosition(hh[3], 2971, 926)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    59
	SetGearPosition(hh[4], 719, 545)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    60
	SetGearPosition(hh[5], 1630, 821)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    61
	SetGearPosition(hh[6], 2191, 810)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    62
	SetGearPosition(hh[7], 3799, 945)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    63
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    64
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    65
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    66
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    67
function onGameStart()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    68
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    69
	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
    70
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    71
	HogTurnLeft(hh[0], false)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    72
	HogTurnLeft(hh[1], true)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    73
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    74
	SpawnUtilityCrate(148,265,amLowGravity)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    75
	SpawnUtilityCrate(2124,1516,amJetpack)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    76
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    77
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    78
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    79
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    80
function onNewTurn()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    81
	TurnTimeLeft = -1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    82
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    83
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    84
function onGameTick()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    85
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    86
	-- intro sequence
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    87
	if introStage < 100 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    88
5823
mikade
parents: 5278
diff changeset
    89
		frig = frig + 1
mikade
parents: 5278
diff changeset
    90
		if frig == 50 then
mikade
parents: 5278
diff changeset
    91
			frig = 0			
mikade
parents: 5278
diff changeset
    92
			AddCaption(loc("Press [Precise] to skip intro"))
mikade
parents: 5278
diff changeset
    93
			if watGear ~= nil then			
mikade
parents: 5278
diff changeset
    94
				FollowGear(watGear)
mikade
parents: 5278
diff changeset
    95
			end
mikade
parents: 5278
diff changeset
    96
		end
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
    97
5823
mikade
parents: 5278
diff changeset
    98
		
mikade
parents: 5278
diff changeset
    99
		--AddCaption(loc("Press [Precise] to skip intro"))
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   100
		genCounter = genCounter + 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   101
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   102
		if introStage == 0 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   103
5823
mikade
parents: 5278
diff changeset
   104
						
mikade
parents: 5278
diff changeset
   105
			--FollowGear(hh[0])
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   106
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   107
			if genCounter == 2000 then
5823
mikade
parents: 5278
diff changeset
   108
				watGear = hh[0]
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   109
				HogSay(hh[0], loc("This rain is really something..."), SAY_SAY,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   110
			elseif genCounter == 5000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   111
				introStage = 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   112
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   113
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   114
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   115
		elseif introStage == 1 then
5823
mikade
parents: 5278
diff changeset
   116
						
mikade
parents: 5278
diff changeset
   117
			--FollowGear(hh[1])
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   118
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   119
			if genCounter == 2000 then
5823
mikade
parents: 5278
diff changeset
   120
				watGear = hh[1]
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   121
				HogSay(hh[1], loc("Heh, it's not that bad."), SAY_SAY,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   122
			elseif genCounter == 5000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   123
				introStage = 2
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   124
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   125
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   126
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   127
		elseif introStage == 2 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   128
5823
mikade
parents: 5278
diff changeset
   129
			--FollowGear(hh[0])
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   130
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   131
			if genCounter == 2000 then
5823
mikade
parents: 5278
diff changeset
   132
				watGear = hh[0]
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   133
				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
   134
			elseif genCounter == 6000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   135
				introStage = 3
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   136
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   137
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   138
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   139
		elseif introStage == 3 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   140
5823
mikade
parents: 5278
diff changeset
   141
			--FollowGear(hh[1])
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   142
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   143
			if genCounter == 2000 then
5823
mikade
parents: 5278
diff changeset
   144
				watGear = hh[1]
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   145
				HogSay(hh[1], loc("Haha, now THAT would be something!"), SAY_SAY,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   146
			elseif genCounter == 6000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   147
				introStage = 4
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   148
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   149
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   150
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   151
		elseif introStage == 4 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   152
5823
mikade
parents: 5278
diff changeset
   153
			--FollowGear(hh[0])
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   154
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   155
			if genCounter == 2000 then
5823
mikade
parents: 5278
diff changeset
   156
				watGear = hh[0]
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   157
				HogSay(hh[0], loc("Hahahaha!"), SAY_SHOUT,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   158
				HogSay(hh[1], loc("Hahahaha!"), SAY_SHOUT,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   159
			elseif genCounter == 3000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   160
				introStage = 5
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   161
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   162
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   163
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   164
		elseif introStage == 5 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   165
5823
mikade
parents: 5278
diff changeset
   166
			--FollowGear(hh[1])
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   167
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   168
			if genCounter == 2000 then
5823
mikade
parents: 5278
diff changeset
   169
				watGear = hh[1]
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   170
				HogSay(hh[0], loc("..."), SAY_THINK,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   171
				HogSay(hh[1], loc("..."), SAY_THINK,2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   172
			elseif genCounter == 5000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   173
				introStage = 6
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   174
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   175
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   176
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   177
		elseif introStage == 6 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   178
5823
mikade
parents: 5278
diff changeset
   179
			--FollowGear(hh[0])
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   180
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   181
			if genCounter == 2000 then
5823
mikade
parents: 5278
diff changeset
   182
				watGear = hh[0]
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   183
				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
   184
			elseif genCounter == 6000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   185
				introStage = 7
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   186
				genCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   187
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   188
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   189
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   190
		elseif introStage == 7 then
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 genCounter == 2000 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   193
				introStage = 110
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   194
				FollowGear(CurrentHedgehog)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   195
				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
   196
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   197
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   198
		end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   199
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   200
	end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   201
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   202
	-- start the water rising when the intro is finished
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   203
	if introStage == 110 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   204
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   205
		waterCounter = waterCounter + 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   206
		if (waterCounter == 100) and (waterPix < 1615) then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   207
			waterCounter = 0
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   208
			SetTag(AddGear(0, 0, gtWaterUp, 0, 0, 0, 0), 1)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   209
			waterPix = waterPix +1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   210
			--AddCaption(waterPix)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   211
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   212
			if (waterPix >= 1615) and (GameOver == false) then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   213
				GameOver = true
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   214
				SetHealth(player, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   215
				TurnTimeLeft = 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   216
				ShowMission(loc("That Sinking Feeling"), loc("MISSION SUCCESS"), loc("You saved") .. " " .. hhCount .. " " .. loc("Hapless Hogs") .."!", 0, 0)
5823
mikade
parents: 5278
diff changeset
   217
mikade
parents: 5278
diff changeset
   218
				if hhCount == 8 then
mikade
parents: 5278
diff changeset
   219
					AddCaption(loc("Achievement Unlocked") .. ": " .. loc("Lively Lifeguard"),0xffba00ff,capgrpMessage2)
mikade
parents: 5278
diff changeset
   220
				end
mikade
parents: 5278
diff changeset
   221
5278
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   222
			end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   223
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   224
		end
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
	if TurnTimeLeft == 1 then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   229
		SetHealth(player, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   230
	end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   231
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   232
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   233
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   234
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   235
function onAmmoStoreInit()
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   236
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   237
	SetAmmo(amBazooka, 9, 0, 0, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   238
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   239
	SetAmmo(amRope, 9, 0, 0, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   240
	SetAmmo(amParachute, 9, 0, 0, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   241
	SetAmmo(amJetpack, 2, 0, 0, 2)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   242
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   243
	SetAmmo(amGirder, 9, 0, 0, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   244
	SetAmmo(amBaseballBat, 9, 0, 0, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   245
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   246
	SetAmmo(amTeleport, 1, 0, 0, 1)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   247
	SetAmmo(amPortalGun, 3, 0, 0, 1)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   248
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   249
	SetAmmo(amLowGravity, 0, 0, 0, 1)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   250
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   251
end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   252
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   253
function onGearDelete(gear)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   254
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   255
	if GetGearType(gear) == gtHedgehog then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   256
		if GetHogTeamName(gear) == "Hapless Hogs" then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   257
			hhCount = hhCount - 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   258
			AddCaption(hhCount .. loc(" Hapless Hogs left!"))
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   259
		end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   260
	end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   261
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   262
	if ((gear == player) or (hhCount == 0)) and (GameOver == false) then
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   263
		SetHealth(player, 0)
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   264
		TurnTimeLeft = 1
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   265
		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
   266
		GameOver = true
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   267
	end
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   268
1aadb3312828 New User Mission: That Sinking Feeling
mikade
parents:
diff changeset
   269
end