share/hedgewars/Data/Missions/Challenge/User_Mission_-_Rope_Knock_Challenge.lua
author Wuzzy <Wuzzy2@mail.ru>
Mon, 10 Dec 2018 07:59:45 +0100
changeset 14401 6c21bd8547dd
parent 13977 e340ce5500d7
child 14464 ead8928a59f8
permissions -rw-r--r--
Remove incorrectly used Delay parameter in many scripts
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7889
diff changeset
     1
HedgewarsScriptLoad("/Scripts/Locale.lua")
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
     2
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
     3
local hhs = {}
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
     4
local missionWon = nil
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
     5
local endTimer = 1000
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
     6
local hogsKilled = 0
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
     7
local finishTime
12739
2f873afda0e2 Rope Knock Challenge: Don't count hog kills after hero hurt itself
Wuzzy <Wuzzy2@mail.ru>
parents: 12738
diff changeset
     8
local ouchies = false
13977
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
     9
local valkyriesTimer = -1
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    10
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    11
local HogData =	{
12738
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    12
					{"amn",			"NinjaFull",false},
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    13
					{"alfadur",		"NoHat",false},
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    14
					{"Anachron",		"war_americanww2helmet",false},
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    15
					{"Bufon", 			"ShaggyYeti",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    16
					{"burp", 			"lambda",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    17
					{"Blue", 			"cap_blue",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    18
					{"bender", 			"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    19
					{"Castell",			"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    20
					{"cekoto", 			"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    21
					{"CheezeMonkey",	"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    22
					{"claymore", 		"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    23
					{"CIA-144", 		"cyborg1",false},
12738
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    24
					{"cri.the.grinch",	"sf_blanka",false},
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    25
					{"eldiablo",		"Evil",false},
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    26
					{"Displacer",		"fr_lemon",false},
13093
403dbadfc8fb Rope Knock Challenge: Remove trailing space of name "doomy "
Wuzzy <Wuzzy2@mail.ru>
parents: 13067
diff changeset
    27
					{"doomy", 			"NoHat",false},
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    28
					{"Falkenauge", 		"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    29
					{"FadeOne", 		"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    30
					{"hayaa", 			"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    31
					{"Hermes", 			"laurel",false},
12738
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    32
					{"Henek", 		"WizardHat",false},
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    33
					{"HedgeKing",		"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    34
					{"Izack1535", 		"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    35
					{"Kiofspa", 		"NoHat",false},
12738
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    36
					{"KoBeWi",		"NoHat",false},
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    37
					{"Komplex", 		"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    38
					{"koda", 			"poke_mudkip",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    39
					{"Lalo", 			"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    40
					{"Logan", 			"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    41
					{"lollkiller", 		"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    42
					{"Luelle", 			"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    43
					{"mikade", 			"Skull",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    44
					{"Mushi", 			"sm_daisy",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    45
					{"Naboo", 			"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    46
					{"nemo", 			"bb_bub",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    47
					{"practice", 		"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    48
					{"Prof. Panic",  	"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    49
					{"Randy",			"zoo_Sheep",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    50
					{"rhino", 			"NinjaTriangle",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    51
					{"Radissthor",  	"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    52
					{"Sami",			"sm_peach",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    53
					{"soreau", 			"NoHat",false},
12738
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    54
					{"Solar",		"pinksunhat",false},
12770
cf1377ab2f89 Add sparkle's name to Rope Knock Challenge
Wuzzy <Wuzzy2@mail.ru>
parents: 12739
diff changeset
    55
					{"sparkle",		"NoHat",false},
12738
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    56
					{"szczur", 		"mp3",false},
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    57
					{"sdw195", 			"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    58
					{"sphrix", 			"TeamTopHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    59
					{"sheepluva",		"zoo_Sheep",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    60
					{"Smaxx", 			"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    61
					{"shadowzero", 		"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    62
					{"Star and Moon",	"SparkleSuperFun",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    63
					{"The 24",			"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    64
					{"TLD",				"NoHat",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    65
					{"Tiyuri", 			"sf_ryu",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    66
					{"unC0Rr", 			"cyborg1",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    67
					{"Waldsau", 		"cyborg1",false},
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    68
					{"wolfmarc", 		"knight",false},
12738
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    69
					{"Wuzzy",		"fr_orange",false},
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    70
					{"Xeli", 			"android",false}
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    71
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    72
				}
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    73
13065
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
    74
local playerTeamName = loc("Wannabe Shoppsta")
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
    75
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
    76
function GetKillScore()
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
    77
	return math.ceil((hogsKilled / 16)*6000)
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
    78
end
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
    79
13754
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
    80
function ProtectEnemies()
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
    81
	for i=1, 16 do
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
    82
		if hhs[i] and GetHealth(hhs[i]) then
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
    83
			SetEffect(hhs[i], heInvulnerable, 1)
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
    84
		end
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
    85
	end
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
    86
end
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
    87
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    88
function GameOverMan()
13977
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
    89
	StopMusicSound(sndRideOfTheValkyries)
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
    90
	valkyriesTimer = -1
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    91
	missionWon = false
13754
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
    92
	ProtectEnemies()
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
    93
	ShowMission(loc("Rope-knocking Challenge"), loc("Challenge over!"), loc("Oh no! Just try again!"), -amSkip, 0)
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
    94
	SendStat(siGameResult, loc("Challenge over!"))
13065
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
    95
	local score = GetKillScore()
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
    96
	SendStat(siCustomAchievement, string.format(loc("You have killed %d of 16 hedgehogs (+%d points)."), hogsKilled, score))
12738
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
    97
	SendStat(siPointType, loc("points"))
13065
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
    98
	SendStat(siPlayerKills, tostring(score), playerTeamName)
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
    99
	PlaySound(sndHellish)
13754
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
   100
	EndGame()
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   101
end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   102
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   103
function GG()
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   104
	missionWon = true
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   105
	local completeTime = (TurnTime - finishTime) / 1000
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   106
	ShowMission(loc("Rope-knocking Challenge"), loc("Challenge completed!"), loc("Congratulations!") .. "|" .. string.format(loc("Completion time: %.2fs"), completeTime), 0, 0)
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   107
	PlaySound(sndHomerun)
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   108
	SendStat(siGameResult, loc("Challenge completed!"))
13065
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
   109
	local hogScore = GetKillScore()
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   110
	local timeScore = math.ceil((finishTime/TurnTime)*6000)
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   111
	local score = hogScore + timeScore
13754
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
   112
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   113
	SendStat(siCustomAchievement, string.format(loc("You have killed %d of 16 hedgehogs (+%d points)."), hogsKilled, hogScore))
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   114
	SendStat(siCustomAchievement, string.format(loc("You have completed this challenge in %.2f s (+%d points)."), completeTime, timeScore))
12738
49c45424a333 Rope knock challenge: Add names of developers and Shoppa tournament players who ranked 1st/2nd/3rd
Wuzzy <Wuzzy2@mail.ru>
parents: 12586
diff changeset
   115
	SendStat(siPointType, loc("points"))
13065
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
   116
	SendStat(siPlayerKills, tostring(score), playerTeamName)
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
   117
	SetTeamLabel(playerTeamName, tostring(score))
13754
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
   118
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
   119
	if hhs[0] and GetHealth(hhs[0]) then
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
   120
		SetEffect(hhs[0], heInvulnerable, 1)
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
   121
	end
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
   122
	SetTurnTimeLeft(MAX_TURN_TIME)
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   123
end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   124
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   125
function AssignCharacter(p)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   126
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   127
	done = false
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   128
	sanityCheck = 0
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   129
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   130
	while(done == false) do
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   131
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   132
		i = 1+ GetRandom(#HogData)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   133
		if HogData[i][3] == false then
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   134
			HogData[i][3] = true
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   135
			done = true
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   136
			SetHogName(hhs[p], HogData[i][1])
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   137
			SetHogHat(hhs[p], HogData[i][2])
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   138
		elseif HogData[i][3] == true then
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   139
			sanityCheck = sanityCheck +1
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   140
			if sanityCheck == 100 then
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   141
				done = true
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   142
				SetHogName(hhs[p], "Newbie")
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   143
				SetHogHat(hhs[p], "NoHat")
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   144
			end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   145
		end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   146
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   147
	end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   148
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   149
end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   150
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   151
function onGameInit()
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   152
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   153
	--Seed = 1
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   154
	GameFlags = gfBorder + gfSolidLand
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   155
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   156
	TurnTime = 180 * 1000
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   157
	Map = "Ropes"
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   158
	Theme = "Eyes"
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   159
12224
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 11968
diff changeset
   160
	-- Disable Sudden Death
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 11968
diff changeset
   161
	WaterRise = 0
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 11968
diff changeset
   162
	HealthDecrease = 0
d62d6f8ebef1 Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents: 11968
diff changeset
   163
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   164
	CaseFreq = 0
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   165
	MinesNum = 0
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   166
	Explosives = 0
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   167
13583
141cdfe0f3ca Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
   168
	AddTeam(playerTeamName, -1, "money", "Island", "Default", "cm_shoppa")
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   169
	hhs[0] = AddHog(loc("Ace"), 0, 1, "Gasmask")
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   170
	SetGearPosition(player, 1380, 1500)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   171
13583
141cdfe0f3ca Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
   172
	AddTeam(loc("Unsuspecting Louts"), -2, "Simple", "Island", "Default", "cm_face")
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   173
	for i = 1, 8 do
13067
64aba90811a2 Change team colors in rope knock challenge to standard color scheme
Wuzzy <Wuzzy2@mail.ru>
parents: 13065
diff changeset
   174
		-- The name "generic" is a placeholder and will be replaced in AssignCharacter
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   175
		hhs[i] = AddHog("generic", 0, 1, "NoHat")
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   176
	end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   177
13583
141cdfe0f3ca Switch almost all Lua calls of AddTeam to using default clan colors instead of hardcoded color
Wuzzy <Wuzzy2@mail.ru>
parents: 13354
diff changeset
   178
	AddTeam(loc("Unlucky Sods"), -2, "Simple", "Island", "Default", "cm_balrog")
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   179
	for i = 9, 16 do
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   180
		hhs[i] = AddHog("generic", 0, 1, "NoHat")
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   181
	end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   182
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   183
end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   184
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   185
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   186
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   187
function onGameStart()
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   188
	SendHealthStatsOff()
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   189
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   190
	ShowMission     (
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   191
                        loc("Rope-knocking Challenge"),
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   192
                        loc("Challenge"),
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   193
                        loc("Use the rope to knock your enemies to their doom.") .. "|" ..
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   194
                        loc("Finish this challenge as fast as possible to earn bonus points."),
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   195
                        -amRope, 4000)
13065
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
   196
	SetTeamLabel(playerTeamName, "0")
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   197
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   198
	PlaceGirder(46,1783, 0)
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   199
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   200
	SetGearPosition(hhs[0], 2419, 1769)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   201
	SetGearPosition(hhs[1], 3350, 570)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   202
	SetGearPosition(hhs[2], 3039, 1300)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   203
	SetGearPosition(hhs[3], 2909, 430)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   204
	SetGearPosition(hhs[4], 2150, 879)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   205
	SetGearPosition(hhs[5], 1735, 1136)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   206
	SetGearPosition(hhs[6], 1563, 553)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   207
	SetGearPosition(hhs[7], 679, 859)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   208
	SetGearPosition(hhs[8], 1034, 251)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   209
	SetGearPosition(hhs[9], 255, 67)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   210
	SetGearPosition(hhs[10], 2671, 7)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   211
	SetGearPosition(hhs[11], 2929, 244)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   212
	SetGearPosition(hhs[12], 1946, 221)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   213
	SetGearPosition(hhs[13], 3849, 1067)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   214
	SetGearPosition(hhs[14], 3360, 659)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   215
	SetGearPosition(hhs[15], 3885, 285)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   216
	SetGearPosition(hhs[16], 935, 1160)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   217
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   218
	for i = 1, 16 do
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   219
		AssignCharacter(i)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   220
	end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   221
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   222
end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   223
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   224
function onGameTick()
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   225
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   226
	if (TurnTimeLeft == 1) and (missionWon == nil) then
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   227
		GameOverMan()
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   228
	end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   229
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   230
	if missionWon ~= nil then
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   231
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   232
		endTimer = endTimer - 1
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   233
		if endTimer == 1 then
13754
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
   234
			EndGame()
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   235
		end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   236
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   237
		if missionWon == true then
13643
690cc84e9fd6 Use capcolDefault in Lua scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13583
diff changeset
   238
			AddCaption(loc("Victory!"), capcolDefault, capgrpGameState)
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   239
		else
13643
690cc84e9fd6 Use capcolDefault in Lua scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13583
diff changeset
   240
			AddCaption(loc("Challenge over!"), capcolDefault, capgrpGameState)
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   241
		end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   242
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   243
	end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   244
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   245
end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   246
13977
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   247
function onGameTick20()
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   248
	if (valkyriesTimer > 0) then
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   249
		valkyriesTimer = valkyriesTimer - 20
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   250
		if valkyriesTimer <= 0 then
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   251
			StopMusicSound(sndRideOfTheValkyries)
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   252
		end
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   253
	end
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   254
end
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   255
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   256
function onGearDamage(gear, damage)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   257
12739
2f873afda0e2 Rope Knock Challenge: Don't count hog kills after hero hurt itself
Wuzzy <Wuzzy2@mail.ru>
parents: 12738
diff changeset
   258
	if gear == hhs[0] then
2f873afda0e2 Rope Knock Challenge: Don't count hog kills after hero hurt itself
Wuzzy <Wuzzy2@mail.ru>
parents: 12738
diff changeset
   259
		ouchies = true
13977
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   260
		StopMusicSound(sndRideOfTheValkyries)
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   261
		valkyriesTimer = -1
13754
5525f69bf76b Fix stats screwing up in Rope Knock Challenge if you lose
Wuzzy <Wuzzy2@mail.ru>
parents: 13643
diff changeset
   262
		ProtectEnemies()
12739
2f873afda0e2 Rope Knock Challenge: Don't count hog kills after hero hurt itself
Wuzzy <Wuzzy2@mail.ru>
parents: 12738
diff changeset
   263
	end
2f873afda0e2 Rope Knock Challenge: Don't count hog kills after hero hurt itself
Wuzzy <Wuzzy2@mail.ru>
parents: 12738
diff changeset
   264
2f873afda0e2 Rope Knock Challenge: Don't count hog kills after hero hurt itself
Wuzzy <Wuzzy2@mail.ru>
parents: 12738
diff changeset
   265
	if gear ~= hhs[0] and GetGearType(gear) == gtHedgehog and missionWon == nil and ouchies == false then
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   266
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   267
		AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   268
		DeleteGear(gear)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   269
		PlaySound(sndExplosion)
13643
690cc84e9fd6 Use capcolDefault in Lua scripts
Wuzzy <Wuzzy2@mail.ru>
parents: 13583
diff changeset
   270
		AddCaption(string.format(knockTaunt(), GetHogName(gear)), capcolDefault, capgrpMessage)
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   271
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   272
		hogsKilled = hogsKilled +1
13065
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
   273
		SetTeamLabel(playerTeamName, tostring(GetKillScore()))
a297e06d1607 Display score next to team bar in singleplayer challenges
Wuzzy <Wuzzy2@mail.ru>
parents: 12770
diff changeset
   274
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   275
		if hogsKilled == 15 then
13977
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   276
			PlayMusicSound(sndRideOfTheValkyries)
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   277
			-- Time in ms after which to return to normal music
e340ce5500d7 Properly play Valkyries music in Rope Knock Challenge (no more music overlap)
Wuzzy <Wuzzy2@mail.ru>
parents: 13754
diff changeset
   278
			valkyriesTimer = 20000
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   279
		elseif hogsKilled == 16 then
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   280
			finishTime = TurnTimeLeft
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   281
			GG()
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   282
		end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   283
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   284
	end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   285
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   286
end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   287
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   288
function knockTaunt()
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   289
	local r = math.random(0,23)
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   290
	local taunt
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   291
	if r == 0 then taunt =		loc("%s has been knocked out.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   292
	elseif r == 1 then taunt =	loc("%s hit the ground.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   293
	elseif r == 2 then taunt =	loc("%s splatted.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   294
	elseif r == 3 then taunt =	loc("%s was smashed.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   295
	elseif r == 4 then taunt =	loc("%s felt unstable.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   296
	elseif r == 5 then taunt =	loc("%s exploded.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   297
	elseif r == 6 then taunt =	loc("%s fell from a high cliff.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   298
	elseif r == 7 then taunt =	loc("%s goes the way of the lemming.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   299
	elseif r == 8 then taunt =	loc("%s was knocked away.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   300
	elseif r == 9 then taunt =	loc("%s was really unlucky.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   301
	elseif r == 10 then taunt =	loc("%s felt victim to rope-knocking.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   302
	elseif r == 11 then taunt =	loc("%s had no chance.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   303
	elseif r == 12 then taunt =	loc("%s was a good target.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   304
	elseif r == 13 then taunt =	loc("%s spawned at a really bad position.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   305
	elseif r == 14 then taunt =	loc("%s was doomed from the beginning.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   306
	elseif r == 15 then taunt =	loc("%s has fallen victim to gravity.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   307
	elseif r == 16 then taunt =	loc("%s hates Newton.")		-- Isaac Newton
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   308
	elseif r == 17 then taunt =	loc("%s had it coming.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   309
	elseif r == 18 then taunt =	loc("%s is eliminated!")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   310
	elseif r == 19 then taunt =	loc("%s fell too fast.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   311
	elseif r == 20 then taunt =	loc("%s flew like a rock.")
13354
f9a15dcd857c Fix a couple of English typos
Wuzzy <Wuzzy2@mail.ru>
parents: 13093
diff changeset
   312
	elseif r == 21 then taunt =	loc("%s stumbled.")
11687
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   313
	elseif r == 22 then taunt =	loc("%s was shoved away.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   314
	elseif r == 23 then taunt =	loc("%s didn't expect that.")
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   315
	end
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   316
	return taunt
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   317
end
594016813e06 Update Rope-Knocking Challenge
Wuzzy <almikes@aol.com>
parents: 10290
diff changeset
   318
7889
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   319
function onGearDelete(gear)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   320
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   321
	if (gear == hhs[0]) and (missionWon == nil) then
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   322
		GameOverMan()
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   323
	end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   324
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   325
end
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   326
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   327
function onAmmoStoreInit()
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   328
	SetAmmo(amRope, 9, 0, 0, 0)
57b117d441b9 consistent line endings
nemo
parents: 7095
diff changeset
   329
end
11689
c0ad9cf7db65 preselect weapons
sheepluva
parents: 11687
diff changeset
   330
c0ad9cf7db65 preselect weapons
sheepluva
parents: 11687
diff changeset
   331
function onNewTurn()
c0ad9cf7db65 preselect weapons
sheepluva
parents: 11687
diff changeset
   332
 	SetWeapon(amRope)
c0ad9cf7db65 preselect weapons
sheepluva
parents: 11687
diff changeset
   333
end