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