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