author | Wuzzy <Wuzzy2@mail.ru> |
Thu, 26 Oct 2017 04:10:57 +0200 | |
changeset 12770 | cf1377ab2f89 |
parent 12739 | 2f873afda0e2 |
child 13065 | a297e06d1607 |
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 |
|
11687 | 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 |
7889 | 9 |
|
10 |
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
|
11 |
{"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
|
12 |
{"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
|
13 |
{"Anachron", "war_americanww2helmet",false}, |
7889 | 14 |
{"Bufon", "ShaggyYeti",false}, |
15 |
{"burp", "lambda",false}, |
|
16 |
{"Blue", "cap_blue",false}, |
|
17 |
{"bender", "NoHat",false}, |
|
18 |
{"Castell", "NoHat",false}, |
|
19 |
{"cekoto", "NoHat",false}, |
|
20 |
{"CheezeMonkey", "NoHat",false}, |
|
21 |
{"claymore", "NoHat",false}, |
|
22 |
{"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
|
23 |
{"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
|
24 |
{"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
|
25 |
{"Displacer", "fr_lemon",false}, |
7889 | 26 |
{"doomy ", "NoHat",false}, |
27 |
{"Falkenauge", "NoHat",false}, |
|
28 |
{"FadeOne", "NoHat",false}, |
|
29 |
{"hayaa", "NoHat",false}, |
|
30 |
{"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
|
31 |
{"Henek", "WizardHat",false}, |
7889 | 32 |
{"HedgeKing", "NoHat",false}, |
33 |
{"Izack1535", "NoHat",false}, |
|
34 |
{"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
|
35 |
{"KoBeWi", "NoHat",false}, |
7889 | 36 |
{"Komplex", "NoHat",false}, |
37 |
{"koda", "poke_mudkip",false}, |
|
38 |
{"Lalo", "NoHat",false}, |
|
39 |
{"Logan", "NoHat",false}, |
|
40 |
{"lollkiller", "NoHat",false}, |
|
41 |
{"Luelle", "NoHat",false}, |
|
42 |
{"mikade", "Skull",false}, |
|
43 |
{"Mushi", "sm_daisy",false}, |
|
44 |
{"Naboo", "NoHat",false}, |
|
45 |
{"nemo", "bb_bub",false}, |
|
46 |
{"practice", "NoHat",false}, |
|
47 |
{"Prof. Panic", "NoHat",false}, |
|
48 |
{"Randy", "zoo_Sheep",false}, |
|
49 |
{"rhino", "NinjaTriangle",false}, |
|
50 |
{"Radissthor", "NoHat",false}, |
|
51 |
{"Sami", "sm_peach",false}, |
|
52 |
{"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
|
53 |
{"Solar", "pinksunhat",false}, |
12770
cf1377ab2f89
Add sparkle's name to Rope Knock Challenge
Wuzzy <Wuzzy2@mail.ru>
parents:
12739
diff
changeset
|
54 |
{"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
|
55 |
{"szczur", "mp3",false}, |
7889 | 56 |
{"sdw195", "NoHat",false}, |
57 |
{"sphrix", "TeamTopHat",false}, |
|
58 |
{"sheepluva", "zoo_Sheep",false}, |
|
59 |
{"Smaxx", "NoHat",false}, |
|
60 |
{"shadowzero", "NoHat",false}, |
|
61 |
{"Star and Moon", "SparkleSuperFun",false}, |
|
62 |
{"The 24", "NoHat",false}, |
|
63 |
{"TLD", "NoHat",false}, |
|
64 |
{"Tiyuri", "sf_ryu",false}, |
|
65 |
{"unC0Rr", "cyborg1",false}, |
|
66 |
{"Waldsau", "cyborg1",false}, |
|
67 |
{"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
|
68 |
{"Wuzzy", "fr_orange",false}, |
7889 | 69 |
{"Xeli", "android",false} |
70 |
||
71 |
} |
|
72 |
||
73 |
function GenericEnd() |
|
11687 | 74 |
EndGame() |
7889 | 75 |
end |
76 |
||
77 |
function GameOverMan() |
|
78 |
missionWon = false |
|
11687 | 79 |
ShowMission(loc("Rope-knocking Challenge"), loc("Challenge over!"), loc("Oh no! Just try again!"), -amSkip, 0) |
80 |
SendStat(siGameResult, loc("Challenge over!")) |
|
81 |
local score = math.ceil((hogsKilled / 16)*6000) |
|
82 |
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
|
83 |
SendStat(siPointType, loc("points")) |
11687 | 84 |
SendStat(siPlayerKills, tostring(score), loc("Wannabe Shoppsta")) |
7889 | 85 |
PlaySound(sndHellish) |
86 |
end |
|
87 |
||
88 |
function GG() |
|
89 |
missionWon = true |
|
11687 | 90 |
local completeTime = (TurnTime - finishTime) / 1000 |
91 |
ShowMission(loc("Rope-knocking Challenge"), loc("Challenge completed!"), loc("Congratulations!") .. "|" .. string.format(loc("Completion time: %.2fs"), completeTime), 0, 0) |
|
7889 | 92 |
PlaySound(sndHomerun) |
11687 | 93 |
SendStat(siGameResult, loc("Challenge completed!")) |
94 |
local hogScore = math.ceil((hogsKilled / 16)*6000) |
|
95 |
local timeScore = math.ceil((finishTime/TurnTime)*6000) |
|
96 |
local score = hogScore + timeScore |
|
97 |
SendStat(siCustomAchievement, string.format(loc("You have killed %d of 16 hedgehogs (+%d points)."), hogsKilled, hogScore)) |
|
98 |
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
|
99 |
SendStat(siPointType, loc("points")) |
11687 | 100 |
SendStat(siPlayerKills, tostring(score), loc("Wannabe Shoppsta")) |
7889 | 101 |
end |
102 |
||
103 |
function AssignCharacter(p) |
|
104 |
||
105 |
done = false |
|
106 |
sanityCheck = 0 |
|
107 |
||
108 |
while(done == false) do |
|
109 |
||
110 |
i = 1+ GetRandom(#HogData) |
|
111 |
if HogData[i][3] == false then |
|
112 |
HogData[i][3] = true |
|
113 |
done = true |
|
114 |
SetHogName(hhs[p], HogData[i][1]) |
|
115 |
SetHogHat(hhs[p], HogData[i][2]) |
|
116 |
elseif HogData[i][3] == true then |
|
117 |
sanityCheck = sanityCheck +1 |
|
118 |
if sanityCheck == 100 then |
|
119 |
done = true |
|
120 |
SetHogName(hhs[p], "Newbie") |
|
121 |
SetHogHat(hhs[p], "NoHat") |
|
122 |
end |
|
123 |
end |
|
124 |
||
125 |
end |
|
126 |
||
127 |
end |
|
128 |
||
129 |
function onGameInit() |
|
130 |
||
131 |
--Seed = 1 |
|
132 |
GameFlags = gfBorder + gfSolidLand |
|
133 |
||
134 |
TurnTime = 180 * 1000 |
|
135 |
Delay = 500 |
|
136 |
Map = "Ropes" |
|
137 |
Theme = "Eyes" |
|
138 |
||
12224
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
11968
diff
changeset
|
139 |
-- Disable Sudden Death |
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
11968
diff
changeset
|
140 |
WaterRise = 0 |
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
11968
diff
changeset
|
141 |
HealthDecrease = 0 |
d62d6f8ebef1
Disable Sudden Death consistently in all missions which don't require it
Wuzzy <almikes@aol.com>
parents:
11968
diff
changeset
|
142 |
|
7889 | 143 |
CaseFreq = 0 |
144 |
MinesNum = 0 |
|
145 |
Explosives = 0 |
|
146 |
||
12586
7510fe66bfbb
Change graves of teams in missions for greater variety
Wuzzy <almikes@aol.com>
parents:
12224
diff
changeset
|
147 |
AddTeam(loc("Wannabe Shoppsta"), 0x11F12B, "money", "Island", "Default", "cm_shoppa") |
7889 | 148 |
hhs[0] = AddHog(loc("Ace"), 0, 1, "Gasmask") |
149 |
SetGearPosition(player, 1380, 1500) |
|
150 |
||
11687 | 151 |
AddTeam(loc("Unsuspecting Louts"), 0xDD0000, "Simple", "Island", "Default", "cm_face") |
7889 | 152 |
for i = 1, 8 do |
153 |
hhs[i] = AddHog("generic", 0, 1, "NoHat") |
|
154 |
end |
|
155 |
||
11687 | 156 |
AddTeam(loc("Unlucky Sods"), 0xDD0000, "Simple", "Island", "Default", "cm_balrog") |
7889 | 157 |
for i = 9, 16 do |
158 |
hhs[i] = AddHog("generic", 0, 1, "NoHat") |
|
159 |
end |
|
160 |
||
161 |
end |
|
162 |
||
163 |
||
164 |
||
165 |
function onGameStart() |
|
11687 | 166 |
SendHealthStatsOff() |
7889 | 167 |
|
168 |
ShowMission ( |
|
11687 | 169 |
loc("Rope-knocking Challenge"), |
170 |
loc("Challenge"), |
|
7889 | 171 |
loc("Use the rope to knock your enemies to their doom.") .. "|" .. |
11687 | 172 |
loc("Finish this challenge as fast as possible to earn bonus points."), |
173 |
-amRope, 4000) |
|
7889 | 174 |
|
11687 | 175 |
PlaceGirder(46,1783, 0) |
7889 | 176 |
|
177 |
SetGearPosition(hhs[0], 2419, 1769) |
|
178 |
SetGearPosition(hhs[1], 3350, 570) |
|
179 |
SetGearPosition(hhs[2], 3039, 1300) |
|
180 |
SetGearPosition(hhs[3], 2909, 430) |
|
181 |
SetGearPosition(hhs[4], 2150, 879) |
|
182 |
SetGearPosition(hhs[5], 1735, 1136) |
|
183 |
SetGearPosition(hhs[6], 1563, 553) |
|
184 |
SetGearPosition(hhs[7], 679, 859) |
|
185 |
SetGearPosition(hhs[8], 1034, 251) |
|
186 |
SetGearPosition(hhs[9], 255, 67) |
|
187 |
SetGearPosition(hhs[10], 2671, 7) |
|
188 |
SetGearPosition(hhs[11], 2929, 244) |
|
189 |
SetGearPosition(hhs[12], 1946, 221) |
|
190 |
SetGearPosition(hhs[13], 3849, 1067) |
|
191 |
SetGearPosition(hhs[14], 3360, 659) |
|
192 |
SetGearPosition(hhs[15], 3885, 285) |
|
193 |
SetGearPosition(hhs[16], 935, 1160) |
|
194 |
||
195 |
for i = 1, 16 do |
|
196 |
AssignCharacter(i) |
|
197 |
end |
|
198 |
||
199 |
end |
|
200 |
||
201 |
function onGameTick() |
|
202 |
||
203 |
if (TurnTimeLeft == 1) and (missionWon == nil) then |
|
204 |
GameOverMan() |
|
205 |
end |
|
206 |
||
207 |
if missionWon ~= nil then |
|
208 |
||
209 |
endTimer = endTimer - 1 |
|
210 |
if endTimer == 1 then |
|
211 |
GenericEnd() |
|
212 |
end |
|
213 |
||
214 |
if missionWon == true then |
|
11687 | 215 |
AddCaption(loc("Victory!"), 0xFFFFFFFF,capgrpGameState) |
7889 | 216 |
else |
11687 | 217 |
AddCaption(loc("Challenge over!"), 0xFFFFFFFF,capgrpGameState) |
7889 | 218 |
end |
219 |
||
220 |
end |
|
221 |
||
222 |
end |
|
223 |
||
224 |
function onGearDamage(gear, damage) |
|
225 |
||
12739
2f873afda0e2
Rope Knock Challenge: Don't count hog kills after hero hurt itself
Wuzzy <Wuzzy2@mail.ru>
parents:
12738
diff
changeset
|
226 |
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
|
227 |
ouchies = true |
2f873afda0e2
Rope Knock Challenge: Don't count hog kills after hero hurt itself
Wuzzy <Wuzzy2@mail.ru>
parents:
12738
diff
changeset
|
228 |
end |
2f873afda0e2
Rope Knock Challenge: Don't count hog kills after hero hurt itself
Wuzzy <Wuzzy2@mail.ru>
parents:
12738
diff
changeset
|
229 |
|
2f873afda0e2
Rope Knock Challenge: Don't count hog kills after hero hurt itself
Wuzzy <Wuzzy2@mail.ru>
parents:
12738
diff
changeset
|
230 |
if gear ~= hhs[0] and GetGearType(gear) == gtHedgehog and missionWon == nil and ouchies == false then |
7889 | 231 |
|
232 |
AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) |
|
233 |
DeleteGear(gear) |
|
234 |
PlaySound(sndExplosion) |
|
11687 | 235 |
AddCaption(string.format(knockTaunt(), GetHogName(gear)), 0xFFFFFFFF, capgrpMessage) |
7889 | 236 |
|
237 |
hogsKilled = hogsKilled +1 |
|
238 |
if hogsKilled == 15 then |
|
239 |
PlaySound(sndRideOfTheValkyries) |
|
240 |
elseif hogsKilled == 16 then |
|
11687 | 241 |
finishTime = TurnTimeLeft |
7889 | 242 |
GG() |
243 |
end |
|
244 |
||
245 |
end |
|
246 |
||
247 |
end |
|
248 |
||
11687 | 249 |
function knockTaunt() |
250 |
local r = math.random(0,23) |
|
251 |
local taunt |
|
252 |
if r == 0 then taunt = loc("%s has been knocked out.") |
|
253 |
elseif r == 1 then taunt = loc("%s hit the ground.") |
|
254 |
elseif r == 2 then taunt = loc("%s splatted.") |
|
255 |
elseif r == 3 then taunt = loc("%s was smashed.") |
|
256 |
elseif r == 4 then taunt = loc("%s felt unstable.") |
|
257 |
elseif r == 5 then taunt = loc("%s exploded.") |
|
258 |
elseif r == 6 then taunt = loc("%s fell from a high cliff.") |
|
259 |
elseif r == 7 then taunt = loc("%s goes the way of the lemming.") |
|
260 |
elseif r == 8 then taunt = loc("%s was knocked away.") |
|
261 |
elseif r == 9 then taunt = loc("%s was really unlucky.") |
|
262 |
elseif r == 10 then taunt = loc("%s felt victim to rope-knocking.") |
|
263 |
elseif r == 11 then taunt = loc("%s had no chance.") |
|
264 |
elseif r == 12 then taunt = loc("%s was a good target.") |
|
265 |
elseif r == 13 then taunt = loc("%s spawned at a really bad position.") |
|
266 |
elseif r == 14 then taunt = loc("%s was doomed from the beginning.") |
|
267 |
elseif r == 15 then taunt = loc("%s has fallen victim to gravity.") |
|
268 |
elseif r == 16 then taunt = loc("%s hates Newton.") -- Isaac Newton |
|
269 |
elseif r == 17 then taunt = loc("%s had it coming.") |
|
270 |
elseif r == 18 then taunt = loc("%s is eliminated!") |
|
271 |
elseif r == 19 then taunt = loc("%s fell too fast.") |
|
272 |
elseif r == 20 then taunt = loc("%s flew like a rock.") |
|
273 |
elseif r == 21 then taunt = loc("%s stumpled.") |
|
274 |
elseif r == 22 then taunt = loc("%s was shoved away.") |
|
275 |
elseif r == 23 then taunt = loc("%s didn't expect that.") |
|
276 |
end |
|
277 |
return taunt |
|
278 |
end |
|
279 |
||
7889 | 280 |
function onGearDelete(gear) |
281 |
||
282 |
if (gear == hhs[0]) and (missionWon == nil) then |
|
283 |
GameOverMan() |
|
284 |
end |
|
285 |
||
286 |
end |
|
287 |
||
288 |
function onAmmoStoreInit() |
|
289 |
SetAmmo(amRope, 9, 0, 0, 0) |
|
290 |
end |
|
11689 | 291 |
|
292 |
function onNewTurn() |
|
293 |
SetWeapon(amRope) |
|
294 |
end |