45 return 1 |
45 return 1 |
46 end |
46 end |
47 end |
47 end |
48 |
48 |
49 --Will end the turn + give escape time |
49 --Will end the turn + give escape time |
50 function EndTurn(seconds) |
50 function EndTurnCS(seconds) |
51 SetState(CurrentHedgehog,bor(GetState(CurrentHedgehog),gstAttacked)) |
51 --set escape time |
52 --set espace time |
|
53 TurnTimeLeft = GetAwayTime*10*seconds |
52 TurnTimeLeft = GetAwayTime*10*seconds |
|
53 if TurnTimeLeft > 0 then |
|
54 Retreat(TurnTimeLeft, false) |
|
55 end |
54 end |
56 end |
55 |
57 |
56 --show health tag (will mostly be used when a hog is damaged) |
58 --show health tag (will mostly be used when a hog is damaged) |
57 function ShowDamageTag(hog,damage) |
59 function ShowDamageTag(hog,damage) |
58 healthtag=AddVisualGear(GetX(hog), GetY(hog), vgtHealthTag, damage, false) |
60 local healthtag=AddVisualGear(GetX(hog), GetY(hog), vgtHealthTag, damage, false) |
59 v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 = GetVisualGearValues(healthtag) |
61 SetVisualGearValues(healthtag, nil, nil, nil, nil, nil, nil, nil, nil, nil, GetClanColor(GetHogClan(hog))) |
60 SetVisualGearValues(healthtag, v1, v2, v3, v4, v5, v6, v7, v8, v9, GetClanColor(GetHogClan(hog))) |
|
61 end |
62 end |
62 |
63 |
63 --will use IntegerSqrt |
64 --will use IntegerSqrt |
64 function FireGear(hedgehog,geartype,vx,vy,timer) |
65 function FireGear(hedgehog,geartype,vx,vy,timer) |
65 local hypo=Norm(vx,vy) |
66 local hypo=Norm(vx,vy) |
66 return AddGear(div((GetGearRadius(hedgehog)*2*vx),hypo)+GetX(hedgehog), div((GetGearRadius(hedgehog)*2*vy),hypo)+GetY(hedgehog), geartype, 0, vx, vy, timer) |
67 return AddGear(div((GetGearRadius(hedgehog)*2*vx),hypo)+GetX(hedgehog), div((GetGearRadius(hedgehog)*2*vy),hypo)+GetY(hedgehog), geartype, 0, vx, vy, timer) |
67 end |
68 end |
68 |
69 |
69 --====MISC GLOBALS==== |
70 function CollectMultiAmmo(hog, ammoList, noAddAmmo) |
|
71 local x, y = GetGearPosition(hog) |
|
72 x = x + 2 |
|
73 y = y + 32 |
|
74 local ammoStr = "" |
|
75 local ammoLength = 0 |
|
76 for _, _ in pairs(ammoList) do |
|
77 ammoLength = ammoLength + 1 |
|
78 end |
|
79 local a = 1 |
|
80 for ammo, count in pairs(ammoList) do |
|
81 if not noAddAmmo then |
|
82 local oldCount = GetAmmoCount(hog, ammo) |
|
83 local newCount = oldCount + count |
|
84 -- Make sure that finite ammo stays finite |
|
85 if count < 100 and oldCount < 100 and newCount >= 100 then |
|
86 newCount = 99 |
|
87 end |
|
88 AddAmmo(hog, ammo, newCount) |
|
89 end |
|
90 if IsHogLocal(hog) then |
|
91 x = x + 2 |
|
92 y = y + 32 |
|
93 local vgear = AddVisualGear(x, y, vgtAmmo, 0, true) |
|
94 if vgear ~= nil then |
|
95 local vgtFrame = ammo |
|
96 SetVisualGearValues(vgear, nil, nil, nil, nil, nil, vgtFrame) |
|
97 end |
|
98 |
|
99 ammoStr = ammoStr .. string.format(loc("%s (+%d)"), GetAmmoName(ammo), count) |
|
100 if a < ammoLength then |
|
101 ammoStr = ammoStr .. " • " |
|
102 end |
|
103 end |
|
104 a = a + 1 |
|
105 end |
|
106 if ammoLength > 0 then |
|
107 PlaySound(sndShotgunReload) |
|
108 -- Show collected ammo |
|
109 if IsHogLocal(hog) then |
|
110 AddCaption(ammoStr, GetClanColor(GetHogClan(hog)), capgrpAmmoinfo) |
|
111 end |
|
112 end |
|
113 end |
|
114 |
|
115 function SetAttackState(state) |
|
116 if state==true then |
|
117 SetInputMask(bor(GetInputMask(), gmAttack)) |
|
118 else |
|
119 SetInputMask(band(GetInputMask(), bnot(gmAttack))) |
|
120 end |
|
121 end |
|
122 |
|
123 --====MISC_TIMER GLOBALS==== |
|
124 local CS = {} |
70 |
125 |
71 --for selecting continent |
126 --for selecting continent |
72 local GLOBAL_INIT_TEAMS = {} |
127 |
73 local GLOBAL_SELECT_CONTINENT_CHECK=false |
128 CS.INIT_TEAMS = {} |
74 local GLOBAL_START_TIME=0 |
129 CS.GAME_STARTED = false |
75 local GLOBAL_HOG_HEALTH=100 |
130 CS.SELECT_CONTINENT_CHECK=false |
76 local GLOBAL_TEAM_CONTINENT = {} |
131 CS.START_TIME=0 |
|
132 CS.HOG_HEALTH=100 |
|
133 CS.TEAM_CONTINENT = {} |
77 |
134 |
78 --variables for seeing if you have swaped around on a weapon |
135 --variables for seeing if you have swaped around on a weapon |
79 local GLOBAL_AUSTRALIAN_SPECIAL=0 |
136 CS.AUSTRALIAN_SPECIAL=0 |
80 local GLOBAL_AFRICAN_SPECIAL_SEDUCTION=0 |
137 CS.AFRICAN_SPECIAL_SEDUCTION=0 |
81 local GLOBAL_AFRICAN_SPECIAL_STICKY=0 |
138 CS.AFRICAN_SPECIAL_STICKY=0 |
82 local GLOBAL_SOUTH_AMERICAN_SPECIAL=false |
139 CS.SOUTH_AMERICAN_SPECIAL=false |
83 local GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER=1 |
140 CS.NORTH_AMERICAN_SPECIAL_SNIPER=1 |
84 local GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=false |
141 CS.NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=false |
85 local GLOBAL_KERGUELEN_SPECIAL=1 |
142 CS.KERGUELEN_SPECIAL=1 |
86 local GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN=false |
143 CS.NORTH_AMERICAN_SPECIAL_SHOTGUN=false |
87 local GLOBAL_EUROPE_SPECIAL=0 |
144 CS.EUROPE_SPECIAL=0 |
88 local GLOBAL_ANTARCTICA_SPECIAL=0 |
145 CS.ANTARCTICA_SPECIAL=0 |
89 local GLOBAL_SEDUCTION_INCREASER=0 |
146 CS.SEDUCTION_INCREASER=0 |
90 |
147 |
91 --detection if something is activated |
148 --detection if something is activated |
92 local GLOBAL_SWITCH_HOG_IS_ON=false |
149 CS.SWITCH_HOG_IS_ON=false |
93 local GLOBAL_VAMPIRIC_IS_ON=0 |
150 CS.VAMPIRIC_IS_ON=0 |
94 local GLOBAL_EXTRA_DAMAGE_IS_ON=100 |
151 CS.EXTRA_DAMAGE_IS_ON=100 |
95 local GLOBAL_PARACHUTE_IS_ON=false |
152 CS.PARACHUTE_IS_ON=false |
|
153 CS.PRECISE=false |
|
154 |
|
155 CS.CONTINENT_LABEL_TIMER=-1 |
|
156 CS.SPEECH_TIMER=-1 |
|
157 CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER=-1 |
|
158 CS.CONFIRM_CONTINENT_SELECTION=-1 |
96 |
159 |
97 --the visual circle for kerguelen |
160 --the visual circle for kerguelen |
98 local GLOBAL_VISUAL_CIRCLE=nil |
161 CS.VISUAL_CIRCLE=nil |
99 |
162 |
100 --the global temp value |
163 --the global temporary value |
101 local GLOBAL_TEMP_VALUE=0 |
164 CS.TEMP_VALUE=0 |
|
165 |
|
166 --true if player used any sticky mine mine mode besides hedgehog projectile in this turn |
|
167 CS.AFRICAN_SPECIAL_NON_PROJECTILE_USED=false |
|
168 |
|
169 -- “constants” |
|
170 CS.SABOTAGE_GRAVITY=350 |
|
171 CS.SABOTAGE_GRAVITY_LOW=175 |
|
172 CS.SABOTAGE_DAMAGE=2 |
|
173 CS.SABOTAGE_FREQUENCY=100 |
102 |
174 |
103 --for sabotage |
175 --for sabotage |
104 local GLOBAL_SABOTAGE_COUNTER=0 |
176 CS.SABOTAGE_COUNTER=0 |
105 local GLOBAL_SABOTAGE_HOGS={} |
177 CS.SABOTAGE_HOGS={} |
106 local GLOBAL_SABOTAGE_FREQUENCY=0 |
178 CS.SABOTAGE_FREQUENCY_NOW=0 |
107 |
|
108 local GLOBAL_CRATE_TEST=-1 |
|
109 |
179 |
110 --for sundaland |
180 --for sundaland |
111 local GLOBAL_SUNDALAND_END_HOG_CONTINENT_NAME |
181 CS.SUNDALAND_END_HOG_CONTINENT_NAME=nil |
112 |
182 |
113 local OPTION_NO_SPECIALS=false |
183 --misc. |
|
184 CS.OPTION_NO_SPECIALS=false |
114 |
185 |
115 --====GENERAL GLOBALS (useful for handling continents)==== |
186 --====GENERAL GLOBALS (useful for handling continents)==== |
116 |
187 |
117 local GLOBAL_SNIPER_SPECIAL_INFO = loc("Green lipstick bullet: [Poisonous, deals no damage]") |
188 CS.SNIPER_SPECIAL_NAME = loc("Green Lipstick Bullet") |
118 local GLOBAL_BASEBALLBAT_BOOMERANG_INFO = loc("Bouncy boomerang: [Launch your bouncy boomerang ~ Turns into a present on explosion]") |
189 CS.BASEBALLBAT_BOOMERANG_NAME = loc("Bouncy Boomerang") |
119 local GLOBAL_CHEESE_SPECIAL_INFO = loc("Anno 1032: [The explosion will make a strong push ~ No poison]") |
190 CS.CHEESE_SPECIAL_NAME = loc("Anno 1032") |
120 local GLOBAL_SEDUCTION_SPECIAL_INFO = loc("Dust storm: [Deals 15 + %s damage to all enemies in the circle]") |
191 CS.SEDUCTION_SPECIAL_NAME = loc("Dust Storm") |
121 local GLOBAL_INVULNERABLE_SPECIAL_INFO = loc("Temporarily increase the damage of duststorm with +7%s, Removes 1 Invurnurable%s") |
192 CS.BASEBALLBAT_CRICKET_NAME = loc("Cricket Time") |
122 local GLOBAL_BASEBALLBAT_CRICKET_INFO = loc("Cricket time: [Fire away a 1 sec mine! ~ Cannot be fired close to another hog]") |
193 CS.PARACHUTE_SPECIAL_NAME = loc("Heroic Wind") |
123 local GLOBAL_PARACHUTE_SPECIAL_INFO = loc("Drop a bomb: [Drop some heroic wind that will turn into a bomb on impact ~ wont end turn]") |
194 CS.HAMMER_ROAR_NAME = loc("Penguin Roar") |
124 local GLOBAL_HAMMER_ROAR_INFO = loc("Penguin roar: [Deal 15 damage + 10% of your hog’s health to all hogs around you and get 2/3 back]") |
195 CS.HAMMER_SWAP_NAME = loc("Disguise as a Rockhopper Penguin") |
125 local GLOBAL_HAMMER_SWAP_INFO = loc("Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]") |
196 CS.HAMMER_LONELY_NAME = loc("Lonely Cries") |
126 local GLOBAL_HAMMER_LONELY_INFO = loc("Lonely Cries: [Rise the water if no hog is in the circle and deal 6 damage to all enemy hogs.]") |
197 CS.STICKY_PROJECTILE_NAME = loc("Hedgehog Projectile") |
127 local GLOBAL_STICKY_PROJECTILE_INFO = loc("Hedgehog projectile: [Fire your hog like a Sticky Bomb]") |
198 CS.STICKY_NAPALM_NAME = loc("Napalm Rocket") |
128 local GLOBAL_STICKY_NAPALM_INFO = loc("Napalm rocket: [Fire a bomb with napalm!]") |
199 CS.SHOTGUN_SPECIAL_NAME = loc("Eagle Eye") |
129 local GLOBAL_SHOTGUN_SPECIAL_INFO = loc("Eagle Eye: [Blink to the impact ~ One shot]") |
200 CS.MOLOTOV_SPECIAL_NAME = loc("Medicine") |
130 local GLOBAL_MOLOTOV_SPECIAL_INFO = loc("Medicine: [Fire some exploding medicine that will heal 15 hp to all hogs effected by the explosion]") |
201 CS.HAMMER_SABOTAGE_NAME = loc("Flare") |
131 local GLOBAL_HAMMER_SABOTAGE_INFO = loc("Flare: [Sabotage all hogs in the circle (dmg over time and high gravity) and fire one cluster above you]") |
202 CS.PICKHAMMER_SPECIAL_NAME = loc("Upside-Down World") |
132 local GLOBAL_PICKHAMMER_SPECIAL_INFO = loc("World wrap: [Will teleport you to the top of the map, expect fall damage]") |
203 |
133 |
204 CS.SNIPER_SPECIAL_DESC = loc("Poisonous, deals no damage.") |
134 local GLOBAL_ALL_SPECIALS_INFO = loc("Weapons with specials: ")..loc("Shotgun")..", "..loc("Sniper Rifle")..", "..loc("GasBomb")..", "..loc("Molotov")..", "..loc("Parachute")..", "..loc("Seduction")..", "..loc("Sticky Mine").." (2),"..loc("Baseballbat (2)")..", "..loc("Hammer (4)") |
205 CS.BASEBALLBAT_BOOMERANG_DESC = loc("Launch a bouncy ball which explodes into a crate.") |
135 |
206 CS.CHEESE_SPECIAL_DESC = loc("Strong knockback, but no poison.") |
136 local GLOBAL_SELECT_WEP_INFORMATION=loc("Select your continent with: the \"Up\" or \"Down\" keys, or by selecting a representative weapon.") |
207 CS.SEDUCTION_SPECIAL_DESC = loc("Deals 15 damage to all enemies in the circle.") |
137 local GLOBAL_GENERAL_INFORMATION="- "..loc("Per team weapons").."|- "..loc("10 weapon schemes").."|- "..loc("Unique new weapons").."| |"..GLOBAL_SELECT_WEP_INFORMATION.."|"..loc("Note: Some weapons have a second option (See continent information). Find and use them with the \"")..loc("switch").."\" "..loc("key").." (↹).|"..GLOBAL_ALL_SPECIALS_INFO.."|"..loc("Tip: See the \"esc\" key (this menu) if you want to see the currently playing teams continent, or that continents specials." .. "|") |
208 CS.BASEBALLBAT_CRICKET_DESC = loc("Throw a 1 second mine!") |
138 |
209 CS.PARACHUTE_SPECIAL_DESC = loc("Drop a ball of dirt which turns into a|cluster on impact. Doesn’t end turn.") |
139 local GLOBAL_CONTINENT_INFORMATION = |
210 CS.HAMMER_ROAR_DESC = loc("Deal 15 damage + 10% of your hog’s health to all hogs around you and get 2/3 back.") |
|
211 CS.HAMMER_SWAP_DESC = loc("Swap place with a random enemy in the circle.") |
|
212 CS.HAMMER_LONELY_DESC = loc("Rise the water if nobody else is in the circle and deal 6 damage to all enemy hogs.") |
|
213 CS.STICKY_PROJECTILE_DESC = loc("Fire your hedgehog like a sticky mine.") |
|
214 CS.STICKY_NAPALM_DESC = loc("Fire a rocket with napalm.") |
|
215 CS.SHOTGUN_SPECIAL_DESC = loc("Teleport to the impact location.") |
|
216 CS.MOLOTOV_SPECIAL_DESC = loc("Fire some exploding medicine that will heal 15 health to all hogs in its effect radius.") |
|
217 CS.HAMMER_SABOTAGE_DESC = loc("Sabotage all hogs in the circle and fire a cluster above you.|Sabotaged hogs lose health and have to deal with a very high gravity during their turn.") |
|
218 CS.PICKHAMMER_SPECIAL_DESC = loc("Teleport to the top of the map, expect fall damage!") |
|
219 |
|
220 CS.INVULNERABLE_SPECIAL_CAPTION = loc("15+%d damage, %d invulnerable left") |
|
221 -- Make info |
|
222 local minfo = function(name, desc) |
|
223 return string.format(loc("%s: %s"), name, desc) |
|
224 end |
|
225 CS.SNIPER_SPECIAL_INFO = minfo(CS.SNIPER_SPECIAL_NAME, CS.SNIPER_SPECIAL_DESC) |
|
226 CS.BASEBALLBAT_BOOMERANG_INFO = minfo(CS.BASEBALLBAT_BOOMERANG_NAME, CS.BASEBALLBAT_BOOMERANG_DESC) |
|
227 CS.CHEESE_SPECIAL_INFO = minfo(CS.CHEESE_SPECIAL_NAME, CS.CHEESE_SPECIAL_DESC) |
|
228 CS.SEDUCTION_SPECIAL_INFO = minfo(CS.SEDUCTION_SPECIAL_NAME, CS.SEDUCTION_SPECIAL_DESC) |
|
229 CS.INVULNERABLE_SPECIAL_INFO = loc("Increase the dust storm damage by sacrificing|your invulnerable ammo.") |
|
230 CS.INVULNERABLE_SPECIAL_CTRL = loc("Up/Down: Adjust dust storm damage") |
|
231 CS.BASEBALLBAT_CRICKET_INFO = minfo(CS.BASEBALLBAT_CRICKET_NAME, CS.BASEBALLBAT_CRICKET_DESC) |
|
232 CS.PARACHUTE_SPECIAL_INFO = minfo(CS.PARACHUTE_SPECIAL_NAME, CS.PARACHUTE_SPECIAL_DESC) |
|
233 CS.HAMMER_ROAR_INFO = minfo(CS.HAMMER_ROAR_NAME, CS.HAMMER_ROAR_DESC) |
|
234 CS.HAMMER_SWAP_INFO = minfo(CS.HAMMER_SWAP_NAME, CS.HAMMER_SWAP_DESC) |
|
235 CS.HAMMER_LONELY_INFO = minfo(CS.HAMMER_LONELY_NAME, CS.HAMMER_LONELY_DESC) |
|
236 CS.STICKY_PROJECTILE_INFO = minfo(CS.STICKY_PROJECTILE_NAME, CS.STICKY_PROJECTILE_DESC) |
|
237 CS.STICKY_NAPALM_INFO = minfo(CS.STICKY_NAPALM_NAME, CS.STICKY_NAPALM_DESC) |
|
238 CS.SHOTGUN_SPECIAL_INFO = minfo(CS.SHOTGUN_SPECIAL_NAME, CS.SHOTGUN_SPECIAL_DESC) |
|
239 CS.MOLOTOV_SPECIAL_INFO = minfo(CS.MOLOTOV_SPECIAL_NAME, CS.MOLOTOV_SPECIAL_DESC) |
|
240 CS.HAMMER_SABOTAGE_INFO = minfo(CS.HAMMER_SABOTAGE_NAME, CS.HAMMER_SABOTAGE_DESC) |
|
241 CS.PICKHAMMER_SPECIAL_INFO = minfo(CS.PICKHAMMER_SPECIAL_NAME, CS.PICKHAMMER_SPECIAL_DESC) |
|
242 |
|
243 CS.SELECT_WEP_INFORMATION=loc("Select your continent with [Up]/[Down] or by selecting a representative weapon.").."|".. |
|
244 loc("Press [Attack] to confirm.") |
|
245 CS.SELECT_WEP_INFORMATION_SHORT=loc("%s, select your continent!") |
|
246 |
|
247 function GeneralInformation() |
|
248 local select_wep, quit_hint |
|
249 if not CS.GAME_STARTED then |
|
250 select_wep = "| |"..CS.SELECT_WEP_INFORMATION |
|
251 quit_hint = "|"..loc("Hint: Use the quit key to see the team’s continent.") |
|
252 else |
|
253 select_wep = "" |
|
254 quit_hint = "" |
|
255 end |
|
256 local general_information = |
|
257 loc("Continents: Select a continent at the beginning.").."|".. |
|
258 loc("Supplies: Each continent gives you unique weapons, specials and health.").."|".. |
|
259 loc("Weapon specials: Some weapons have special modes (see weapon description).").. |
|
260 select_wep.. |
|
261 quit_hint |
|
262 return general_information |
|
263 end |
|
264 |
|
265 CS.CONTINENT_INFORMATION = |
140 { |
266 { |
141 {loc("North America"),"["..loc("Difficulty: ")..loc("EASY").."] ",loc("- You can switch between hogs at the start of your turns. (Not first one)").."|"..loc("Special Weapons:").."|"..loc("Shotgun")..": "..GLOBAL_SHOTGUN_SPECIAL_INFO.."|"..loc("Sniper Rifle")..": "..GLOBAL_SNIPER_SPECIAL_INFO,{amSniperRifle,1}, |
267 {loc("North America"), |
|
268 loc("The continent of firearms"), |
|
269 loc("The Union: You can select a hedgehog at the start of your turns.").."| |".. |
|
270 loc("Special weapons:").."|".. |
|
271 GetAmmoName(amShotgun)..": "..CS.SHOTGUN_SPECIAL_INFO.."|".. |
|
272 GetAmmoName(amSniperRifle)..": "..CS.SNIPER_SPECIAL_INFO, |
|
273 {amSniperRifle,1}, |
142 {{amShotgun,100},{amDEagle,100},{amLaserSight,2},{amSniperRifle,100},{amCake,1},{amAirAttack,2},{amSwitch,2}}, |
274 {{amShotgun,100},{amDEagle,100},{amLaserSight,2},{amSniperRifle,100},{amCake,1},{amAirAttack,2},{amSwitch,2}}, |
143 }, |
275 {sndShotgunFire,sndCover},100}, |
144 --{sndShotgunFire,sndCover},100}, |
276 |
145 |
277 {loc("South America"), |
146 {loc("South America"),"["..loc("Difficulty: ")..loc("MEDIUM").."] ",loc("Special Weapons:").."|"..loc("GasBomb")..": "..GLOBAL_CHEESE_SPECIAL_INFO,{amGasBomb,2}, |
278 loc("The continent of guerilla tactics"), |
|
279 "| |"..loc("Special weapons:").."|" |
|
280 ..GetAmmoName(amGasBomb)..": "..CS.CHEESE_SPECIAL_INFO, |
|
281 {amGasBomb,2}, |
147 {{amBirdy,100},{amHellishBomb,1},{amBee,100},{amGasBomb,100},{amFlamethrower,100},{amNapalm,2},{amExtraDamage,3}}, |
282 {{amBirdy,100},{amHellishBomb,1},{amBee,100},{amGasBomb,100},{amFlamethrower,100},{amNapalm,2},{amExtraDamage,3}}, |
148 {sndEggBreak,sndLaugh},125}, |
283 {sndEggBreak,sndLaugh},125}, |
149 |
284 |
150 {loc("Europe"),"["..loc("Difficulty: ")..loc("EASY").."] ",loc("Special Weapons:").."|"..loc("Molotov")..": "..GLOBAL_MOLOTOV_SPECIAL_INFO,{amBazooka,3}, |
285 {loc("Europe"), |
|
286 loc("The continent of medicine"), |
|
287 "| |"..loc("Special weapons:").."|" |
|
288 ..GetAmmoName(amMolotov)..": "..CS.MOLOTOV_SPECIAL_INFO, |
|
289 {amBazooka,3}, |
151 {{amBazooka,100},{amGrenade,100},{amMortar,100},{amMolotov,100},{amVampiric,4},{amPiano,1},{amResurrector,2},{amJetpack,4}}, |
290 {{amBazooka,100},{amGrenade,100},{amMortar,100},{amMolotov,100},{amVampiric,4},{amPiano,1},{amResurrector,2},{amJetpack,4}}, |
152 {sndExplosion,sndEnemyDown},100}, |
291 {sndExplosion,sndEnemyDown},100}, |
153 |
292 |
154 {loc("Africa"),"["..loc("Difficulty: ")..loc("MEDIUM").."] ",loc("Special Weapons:").."|"..loc("Seduction")..": "..string.format(GLOBAL_SEDUCTION_SPECIAL_INFO,loc("(*see below)")).."|- "..string.format(GLOBAL_INVULNERABLE_SPECIAL_INFO,"","").."|- "..loc("You can modify the damage/invulnerables with the up/down keys on dust storm.").."|"..loc("Sticky Mine")..": "..GLOBAL_STICKY_PROJECTILE_INFO.."|"..loc("Sticky Mine")..": "..GLOBAL_STICKY_NAPALM_INFO,{amSMine,4}, |
293 {loc("Africa"), |
|
294 loc("The continent of dust"), |
|
295 "| |"..loc("Special weapons:").."|".. |
|
296 GetAmmoName(amSeduction)..": "..CS.SEDUCTION_SPECIAL_INFO.."|".. |
|
297 CS.INVULNERABLE_SPECIAL_INFO.."|".. |
|
298 GetAmmoName(amSMine)..": "..CS.STICKY_PROJECTILE_INFO.."|".. |
|
299 GetAmmoName(amSMine)..": "..CS.STICKY_NAPALM_INFO, |
|
300 {amSMine,4}, |
155 {{amSMine,100},{amWatermelon,1},{amDrillStrike,1},{amDrill,100},{amInvulnerable,7},{amSeduction,100},{amLandGun,3}}, |
301 {{amSMine,100},{amWatermelon,1},{amDrillStrike,1},{amDrill,100},{amInvulnerable,7},{amSeduction,100},{amLandGun,3}}, |
156 {sndMelonImpact,sndCoward},125}, |
302 {sndMelonImpact,sndCoward},125}, |
157 |
303 |
158 {loc("Asia"),"["..loc("Difficulty: ")..loc("MEDIUM").."] ",loc("- Will give you a parachute every third turn.").."|"..loc("Special Weapons:").."|"..loc("Parachute")..": "..GLOBAL_PARACHUTE_SPECIAL_INFO,{amRope,5}, |
304 {loc("Asia"), |
|
305 loc("The continent of ninjas"), |
|
306 loc("Textile industry: Will give you a parachute every second turn.").."| |".. |
|
307 loc("Special weapons:").."|".. |
|
308 GetAmmoName(amParachute)..": "..CS.PARACHUTE_SPECIAL_INFO, |
|
309 {amRope,5}, |
159 {{amRope,100},{amFirePunch,100},{amParachute,1},{amKnife,2},{amDynamite,1}}, |
310 {{amRope,100},{amFirePunch,100},{amParachute,1},{amKnife,2},{amDynamite,1}}, |
160 {sndRopeAttach,sndComeonthen},50}, |
311 {sndRopeAttach,sndComeonthen},50}, |
161 |
312 |
162 {loc("Australia"),"["..loc("Difficulty: ")..loc("EASY").."] ",loc("Special Weapons:").."|"..loc("Baseballbat")..": "..GLOBAL_BASEBALLBAT_CRICKET_INFO.."|"..loc("Baseballbat")..": "..GLOBAL_BASEBALLBAT_BOOMERANG_INFO,{amBaseballBat,6}, |
313 {loc("Australia"), |
|
314 loc("The continent of sports"), |
|
315 "| |"..loc("Special weapons:").."|".. |
|
316 GetAmmoName(amBaseballBat)..": "..CS.BASEBALLBAT_CRICKET_INFO.."|".. |
|
317 GetAmmoName(amBaseballBat)..": "..CS.BASEBALLBAT_BOOMERANG_INFO.."|".. |
|
318 loc("Baseball bat specials cannot be used close to other hogs."), |
|
319 {amBaseballBat,6}, |
163 {{amBaseballBat,100},{amMine,100},{amLowGravity,4},{amBlowTorch,100},{amRCPlane,2},{amRubber,4}}, |
320 {{amBaseballBat,100},{amMine,100},{amLowGravity,4},{amBlowTorch,100},{amRCPlane,2},{amRubber,4}}, |
164 {sndBaseballBat,sndNooo},100}, |
321 {sndBaseballBat,sndNooo},100}, |
165 |
322 |
166 {loc("Antarctica"),"["..loc("Difficulty: ")..loc("HARD").."] ",loc("Antarctic summer: - Will give you girders=1,mudballs=1,sineguns=2,portals=1 every fourth turn.").."|"..loc("Special Weapons:").."|"..loc("Pick hammer")..": "..GLOBAL_PICKHAMMER_SPECIAL_INFO,{amIceGun,7}, |
323 {loc("Antarctica"), |
|
324 loc("The continent of ice and science"), |
|
325 loc("Antarctic summer: Every 4th turn you get 1 girder, 1 mudball, 2 sine guns and 1 portable portal device.").."| |".. |
|
326 loc("Special weapons:").."|".. |
|
327 GetAmmoName(amPickHammer)..": "..CS.PICKHAMMER_SPECIAL_INFO, |
|
328 {amIceGun,7}, |
167 {{amSnowball,2},{amPickHammer,100},{amSineGun,4},{amGirder,1},{amExtraTime,1},{amIceGun,1},{amPortalGun,2}}, |
329 {{amSnowball,2},{amPickHammer,100},{amSineGun,4},{amGirder,1},{amExtraTime,1},{amIceGun,1},{amPortalGun,2}}, |
168 {sndSineGun,sndOops},75}, |
330 {sndSineGun,sndOops},75}, |
169 |
331 |
170 {loc("Kerguelen"),"["..loc("Difficulty: ")..loc("EASY").."] ",loc("Special Weapons:").."|"..loc("Hammer")..": "..GLOBAL_HAMMER_ROAR_INFO.."|"..loc("Hammer")..": "..GLOBAL_HAMMER_SWAP_INFO.."|"..loc("Hammer")..": "..GLOBAL_HAMMER_LONELY_INFO.."|"..loc("Hammer")..": "..GLOBAL_HAMMER_SABOTAGE_INFO,{amHammer,8}, |
332 {loc("Kerguelen"), |
|
333 loc("The continent of cowards"), |
|
334 "| |"..loc("Special weapons:").."|".. |
|
335 GetAmmoName(amHammer)..": "..CS.HAMMER_ROAR_INFO.."|".. |
|
336 GetAmmoName(amHammer)..": "..CS.HAMMER_SWAP_INFO.."|".. |
|
337 GetAmmoName(amHammer)..": "..CS.HAMMER_LONELY_INFO.."|".. |
|
338 GetAmmoName(amHammer)..": "..CS.HAMMER_SABOTAGE_INFO, |
|
339 {amHammer,8}, |
171 {{amHammer,100},{amMineStrike,1},{amBallgun,1},{amTeleport,1}}, |
340 {{amHammer,100},{amMineStrike,1},{amBallgun,1},{amTeleport,1}}, |
172 {sndPiano5,sndStupid},75}, |
341 {sndPiano5,sndStupid},75}, |
173 |
342 |
174 {loc("Zealandia"),"["..loc("Difficulty: ")..loc("MEDIUM").."] ",loc("- Will Get 1-3 random weapons") .. "|" .. loc("- Massive weapon bonus on first turn|You will lose all your weapons each turn."),{amInvulnerable,9}, |
343 {loc("Zealandia"), |
|
344 loc("The forgotten continent"), |
|
345 loc("Surprise supplies: Get 1-3 random weapons each turn.") .. "|" .. |
|
346 loc("Treasure: Massive weapon bonus in first turn.").."|".. |
|
347 loc("Forgetfulness: You will lose all your weapons each turn."), |
|
348 {amInvulnerable,9}, |
175 {{amBazooka,1},{amGrenade,1},{amBlowTorch,1},{amSwitch,1},{amRope,1},{amDrill,1},{amDEagle,1},{amPickHammer,1},{amFirePunch,1},{amWhip,1},{amMortar,1},{amSnowball,1},{amExtraTime,1},{amInvulnerable,1},{amVampiric,1},{amFlamethrower,1},{amBee,1},{amClusterBomb,1},{amTeleport,1},{amLowGravity,1},{amJetpack,1},{amGirder,1},{amLandGun,1},{amBirdy,1},{amAirMine,1},{amTardis,1},{amLaserSight,1},{amAirMine,1}}, |
349 {{amBazooka,1},{amGrenade,1},{amBlowTorch,1},{amSwitch,1},{amRope,1},{amDrill,1},{amDEagle,1},{amPickHammer,1},{amFirePunch,1},{amWhip,1},{amMortar,1},{amSnowball,1},{amExtraTime,1},{amInvulnerable,1},{amVampiric,1},{amFlamethrower,1},{amBee,1},{amClusterBomb,1},{amTeleport,1},{amLowGravity,1},{amJetpack,1},{amGirder,1},{amLandGun,1},{amBirdy,1},{amAirMine,1},{amTardis,1},{amLaserSight,1},{amAirMine,1}}, |
176 {sndSplash,sndFirstBlood},100}, |
350 {sndSplash,sndFirstBlood},100}, |
177 |
351 |
178 {loc("Sundaland"),"["..loc("Difficulty: ")..loc("HARD").."] ",loc("- You will recieve 6 weapons on each kill! (Even on own hogs)"),{amTardis,10}, |
352 {loc("Sundaland"), |
179 {{amClusterBomb,5},{amTardis,100},{amWhip,100},{amKamikaze,100},{amAirMine,2},{amDuck,2}}, |
353 loc("The continent of greed"), |
|
354 loc("Bounty: Get 6 weapons for each kill (even on own hogs)."), |
|
355 {amTardis,10}, |
|
356 {{amClusterBomb,5},{amTardis,100},{amWhip,100},{amKamikaze,100},{amAirMine,2}}, |
180 {sndWarp,sndSameTeam},100} |
357 {sndWarp,sndSameTeam},100} |
181 |
358 |
182 } |
359 } |
183 |
360 |
184 --very strange bug |
|
185 GLOBAL_CONTINENT_INFORMATION[1][7]=100 |
|
186 GLOBAL_CONTINENT_INFORMATION[1][6]={sndShotgunFire,sndCover} |
|
187 |
|
188 --weapontype,ammo,?,duration,*times your choice,affect on random team (should be placed with 1,0,1,0,1 on the 6th option for better randomness) |
361 --weapontype,ammo,?,duration,*times your choice,affect on random team (should be placed with 1,0,1,0,1 on the 6th option for better randomness) |
189 local GLOBAL_WEAPONS_DAMAGE = { |
362 CS.WEAPONS_DAMAGE = { |
190 {amKamikaze, 0, 1, 0, 1, 0}, |
363 {amKamikaze, 0, 1, 0, 1, 0}, |
191 {amSineGun, 0, 1, 0, 1, 0}, |
364 {amSineGun, 0, 1, 0, 1, 0}, |
192 {amMineStrike, 0, 1, 6, 1, 1}, |
365 {amMineStrike, 0, 1, 6, 1, 1}, |
193 {amGrenade, 0, 1, 0, 1, 0}, |
366 {amGrenade, 0, 1, 0, 1, 0}, |
194 {amPiano, 0, 1, 7, 1, 0}, |
367 {amPiano, 0, 1, 7, 1, 0}, |
988 setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", 1) |
1266 setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", 1) |
989 end |
1267 end |
990 |
1268 |
991 if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick")>=2) |
1269 if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick")>=2) |
992 then |
1270 then |
993 AddAmmo(CurrentHedgehog,amParachute) |
1271 CollectMultiAmmo(CurrentHedgehog, {[amParachute] = 1}) |
994 setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", 0) |
1272 setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", 0) |
995 end |
1273 end |
996 setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", getTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick")+1) |
1274 setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", getTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick")+1) |
997 elseif(checkDefCont==1) |
1275 elseif(checkDefCont==1) |
998 then |
1276 then |
999 GLOBAL_TEMP_VALUE=0 |
1277 CS.TEMP_VALUE=0 |
1000 runOnGears(CountHogsInTeam) |
1278 runOnGears(CountHogsInTeam) |
1001 |
1279 |
1002 if(GLOBAL_TEMP_VALUE>1) |
1280 if(CS.TEMP_VALUE>1) |
1003 then |
1281 then |
1004 AddAmmo(CurrentHedgehog,amSwitch,GetAmmoCount(CurrentHedgehog, amSwitch)+1) |
1282 AddAmmo(CurrentHedgehog,amSwitch,GetAmmoCount(CurrentHedgehog, amSwitch)+1) |
1005 |
1283 |
1006 SetWeapon(amSwitch) |
1284 SetWeapon(amSwitch) |
1007 GLOBAL_TEMP_VALUE=87 |
1285 CS.TEMP_VALUE=87 |
1008 end |
1286 end |
1009 end |
1287 end |
1010 |
1288 |
1011 ShowContinentInfo(currCont,-1,true) |
1289 ShowContinentInfo(currCont,-1,true) |
1012 end |
1290 SetCSAmmoDescriptions("weapons") |
1013 end |
1291 end |
|
1292 end |
|
1293 end |
|
1294 |
|
1295 function ShowSpecialWeaponCaption(ammoType) |
|
1296 --place mine (australia) |
|
1297 if(ammoType == amBaseballBat) |
|
1298 then |
|
1299 if(CS.AUSTRALIAN_SPECIAL==1) |
|
1300 then |
|
1301 AddCaption(CS.BASEBALLBAT_CRICKET_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1302 elseif(CS.AUSTRALIAN_SPECIAL==2) |
|
1303 then |
|
1304 AddCaption(CS.BASEBALLBAT_BOOMERANG_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1305 else |
|
1306 AddCaption(GetAmmoName(amBaseballBat), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1307 end |
|
1308 |
|
1309 --africa |
|
1310 elseif(ammoType == amSeduction) |
|
1311 then |
|
1312 if(CS.AFRICAN_SPECIAL_SEDUCTION==1) |
|
1313 then |
|
1314 AddCaption(CS.SEDUCTION_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1315 AddCaption(string.format(CS.INVULNERABLE_SPECIAL_CAPTION, CS.SEDUCTION_INCREASER, GetAmmoCount(CurrentHedgehog,amInvulnerable)), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmostate) |
|
1316 else |
|
1317 AddCaption(GetAmmoName(amSeduction), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1318 end |
|
1319 |
|
1320 --south america |
|
1321 elseif(ammoType == amGasBomb) |
|
1322 then |
|
1323 if(CS.SOUTH_AMERICAN_SPECIAL==true) |
|
1324 then |
|
1325 AddCaption(CS.CHEESE_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1326 else |
|
1327 AddCaption(GetAmmoName(amGasBomb), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1328 end |
|
1329 |
|
1330 --africa |
|
1331 elseif(ammoType == amSMine) |
|
1332 then |
|
1333 if(CS.AFRICAN_SPECIAL_STICKY==1) |
|
1334 then |
|
1335 AddCaption(CS.STICKY_PROJECTILE_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1336 elseif(CS.AFRICAN_SPECIAL_STICKY == 2) |
|
1337 then |
|
1338 AddCaption(CS.STICKY_NAPALM_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1339 else |
|
1340 AddCaption(GetAmmoName(amSMine), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1341 end |
|
1342 |
|
1343 --north america (sniper) |
|
1344 elseif(ammoType == amSniperRifle and CS.NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON==false) |
|
1345 then |
|
1346 if(CS.NORTH_AMERICAN_SPECIAL_SNIPER==1) |
|
1347 then |
|
1348 AddCaption(GetAmmoName(amSniperRifle), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1349 elseif(CS.NORTH_AMERICAN_SPECIAL_SNIPER==2) |
|
1350 then |
|
1351 AddCaption(CS.SNIPER_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1352 end |
|
1353 |
|
1354 --north america (shotgun) |
|
1355 elseif(ammoType == amShotgun) |
|
1356 then |
|
1357 if(CS.NORTH_AMERICAN_SPECIAL_SHOTGUN==true) |
|
1358 then |
|
1359 AddCaption(CS.SHOTGUN_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1360 else |
|
1361 AddCaption(GetAmmoName(amShotgun), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1362 end |
|
1363 |
|
1364 --europe |
|
1365 elseif(ammoType == amMolotov) |
|
1366 then |
|
1367 if(CS.EUROPE_SPECIAL==1) |
|
1368 then |
|
1369 AddCaption(CS.MOLOTOV_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1370 else |
|
1371 AddCaption(GetAmmoName(amMolotov), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1372 end |
|
1373 |
|
1374 --antarctica |
|
1375 elseif(ammoType == amPickHammer) |
|
1376 then |
|
1377 if(CS.ANTARCTICA_SPECIAL==1) |
|
1378 then |
|
1379 AddCaption(CS.PICKHAMMER_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1380 else |
|
1381 AddCaption(GetAmmoName(amPickHammer), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1382 end |
|
1383 |
|
1384 --kerguelen |
|
1385 elseif(ammoType == amHammer) |
|
1386 then |
|
1387 if(CS.KERGUELEN_SPECIAL==1) |
|
1388 then |
|
1389 AddCaption(GetAmmoName(amHammer), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1390 elseif(CS.KERGUELEN_SPECIAL==2) |
|
1391 then |
|
1392 AddCaption(CS.HAMMER_ROAR_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1393 elseif(CS.KERGUELEN_SPECIAL==3) |
|
1394 then |
|
1395 AddCaption(CS.HAMMER_SWAP_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1396 elseif(CS.KERGUELEN_SPECIAL==5) |
|
1397 then |
|
1398 AddCaption(CS.HAMMER_LONELY_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1399 elseif(CS.KERGUELEN_SPECIAL==6) |
|
1400 then |
|
1401 AddCaption(CS.HAMMER_SABOTAGE_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1402 end |
|
1403 end |
|
1404 end |
|
1405 |
|
1406 function onPrecise() |
|
1407 CS.PRECISE = true |
|
1408 end |
|
1409 function onPreciseUp() |
|
1410 CS.PRECISE = false |
1014 end |
1411 end |
1015 |
1412 |
1016 --what happens when you press "tab" (common button) |
1413 --what happens when you press "tab" (common button) |
1017 function onSwitch() |
1414 function onSwitch() |
1018 |
1415 |
1019 if(GLOBAL_SWITCH_HOG_IS_ON==false) |
1416 if(CS.SWITCH_HOG_IS_ON==false) |
1020 then |
1417 then |
1021 if(OPTION_NO_SPECIALS==false and GLOBAL_SELECT_CONTINENT_CHECK==false) |
1418 if(CS.OPTION_NO_SPECIALS==false and CS.SELECT_CONTINENT_CHECK==false and |
|
1419 band(GetState(CurrentHedgehog), gstAttacked) == 0 and |
|
1420 band(GetState(CurrentHedgehog), gstHHDriven) ~= 0) |
1022 then |
1421 then |
1023 --place mine (australia) |
1422 --place mine (australia) |
1024 if(GetCurAmmoType() == amBaseballBat) |
1423 if(GetCurAmmoType() == amBaseballBat) |
1025 then |
1424 then |
1026 if(GLOBAL_AUSTRALIAN_SPECIAL==0) |
1425 CS.AUSTRALIAN_SPECIAL = CS.AUSTRALIAN_SPECIAL + 1 |
1027 then |
1426 CS.AUSTRALIAN_SPECIAL = CS.AUSTRALIAN_SPECIAL % 3 |
1028 GLOBAL_AUSTRALIAN_SPECIAL = 1 |
1427 |
1029 AddCaption(GLOBAL_BASEBALLBAT_CRICKET_INFO) |
1428 SetAttackState(CS.AUSTRALIAN_SPECIAL == 0) |
1030 elseif(GLOBAL_AUSTRALIAN_SPECIAL==1) |
|
1031 then |
|
1032 GLOBAL_AUSTRALIAN_SPECIAL = 2 |
|
1033 AddCaption(GLOBAL_BASEBALLBAT_BOOMERANG_INFO) |
|
1034 else |
|
1035 GLOBAL_AUSTRALIAN_SPECIAL = 0 |
|
1036 AddCaption(loc("DEFAULT")) |
|
1037 end |
|
1038 |
1429 |
1039 --Asian special |
1430 --Asian special |
1040 elseif(GLOBAL_PARACHUTE_IS_ON==1) |
1431 elseif(CS.PARACHUTE_IS_ON==1) |
1041 then |
1432 then |
1042 asiabomb=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+3, gtSnowball, 0, 0, 0, 0) |
1433 local asiabomb=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+3, gtSnowball, 0, 0, 0, 0) |
1043 SetGearMessage(asiabomb, 1) |
1434 SetGearMessage(asiabomb, 1) |
1044 |
1435 |
1045 GLOBAL_PARACHUTE_IS_ON=2 |
1436 CS.PARACHUTE_IS_ON=2 |
1046 GLOBAL_SELECT_CONTINENT_CHECK=false |
1437 CS.SELECT_CONTINENT_CHECK=false |
1047 |
1438 |
1048 --africa |
1439 --africa |
1049 elseif(GetCurAmmoType() == amSeduction) |
1440 elseif(GetCurAmmoType() == amSeduction) |
1050 then |
1441 then |
1051 if(GLOBAL_AFRICAN_SPECIAL_SEDUCTION==0) |
1442 if(CS.AFRICAN_SPECIAL_SEDUCTION==0) |
1052 then |
1443 then |
1053 GLOBAL_AFRICAN_SPECIAL_SEDUCTION = 1 |
1444 CS.AFRICAN_SPECIAL_SEDUCTION = 1 |
1054 |
|
1055 AddCaption(string.format(GLOBAL_SEDUCTION_SPECIAL_INFO,GLOBAL_SEDUCTION_INCREASER)) |
|
1056 else |
1445 else |
1057 GLOBAL_AFRICAN_SPECIAL_SEDUCTION = 0 |
1446 CS.AFRICAN_SPECIAL_SEDUCTION = 0 |
1058 AddCaption(loc("DEFAULT")) |
|
1059 end |
1447 end |
1060 |
1448 |
1061 --south america |
1449 --south america |
1062 elseif(GetCurAmmoType() == amGasBomb) |
1450 elseif(GetCurAmmoType() == amGasBomb) |
1063 then |
1451 then |
1064 if(GLOBAL_SOUTH_AMERICAN_SPECIAL==false) |
1452 if(CS.SOUTH_AMERICAN_SPECIAL==false) |
1065 then |
1453 then |
1066 GLOBAL_SOUTH_AMERICAN_SPECIAL = true |
1454 CS.SOUTH_AMERICAN_SPECIAL = true |
1067 AddCaption(GLOBAL_CHEESE_SPECIAL_INFO) |
|
1068 else |
1455 else |
1069 GLOBAL_SOUTH_AMERICAN_SPECIAL = false |
1456 CS.SOUTH_AMERICAN_SPECIAL = false |
1070 AddCaption(loc("DEFAULT")) |
|
1071 end |
1457 end |
1072 |
1458 |
1073 --africa |
1459 --africa |
1074 elseif(GetCurAmmoType() == amSMine) |
1460 elseif(GetCurAmmoType() == amSMine) |
1075 then |
1461 then |
1076 if(GLOBAL_AFRICAN_SPECIAL_STICKY==0) |
1462 CS.AFRICAN_SPECIAL_STICKY = CS.AFRICAN_SPECIAL_STICKY + 1 |
|
1463 CS.AFRICAN_SPECIAL_STICKY = CS.AFRICAN_SPECIAL_STICKY % 3 |
|
1464 SetSoundMask(sndLaugh, CS.AFRICAN_SPECIAL_STICKY ~= 0) |
|
1465 |
|
1466 --north america (sniper) |
|
1467 elseif(GetCurAmmoType() == amSniperRifle and CS.NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON==false) |
|
1468 then |
|
1469 if(CS.NORTH_AMERICAN_SPECIAL_SNIPER==2) |
1077 then |
1470 then |
1078 GLOBAL_AFRICAN_SPECIAL_STICKY = 1 |
1471 CS.NORTH_AMERICAN_SPECIAL_SNIPER = 1 |
1079 AddCaption(GLOBAL_STICKY_PROJECTILE_INFO) |
1472 elseif(CS.NORTH_AMERICAN_SPECIAL_SNIPER==1) |
1080 elseif(GLOBAL_AFRICAN_SPECIAL_STICKY == 1) |
|
1081 then |
1473 then |
1082 GLOBAL_AFRICAN_SPECIAL_STICKY = 2 |
1474 CS.NORTH_AMERICAN_SPECIAL_SNIPER = 2 |
1083 AddCaption(GLOBAL_STICKY_NAPALM_INFO) |
|
1084 elseif(GLOBAL_AFRICAN_SPECIAL_STICKY == 2) |
|
1085 then |
|
1086 GLOBAL_AFRICAN_SPECIAL_STICKY = 0 |
|
1087 AddCaption(loc("DEFAULT")) |
|
1088 end |
|
1089 |
|
1090 --north america (sniper) |
|
1091 elseif(GetCurAmmoType() == amSniperRifle and GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON==false) |
|
1092 then |
|
1093 if(GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER==2) |
|
1094 then |
|
1095 GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER = 1 |
|
1096 AddCaption(loc("DEFAULT")) |
|
1097 elseif(GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER==1) |
|
1098 then |
|
1099 GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER = 2 |
|
1100 AddCaption(GLOBAL_SNIPER_SPECIAL_INFO) |
|
1101 end |
1475 end |
1102 |
1476 |
1103 --north america (shotgun) |
1477 --north america (shotgun) |
1104 elseif(GetCurAmmoType() == amShotgun) |
1478 elseif(GetCurAmmoType() == amShotgun) |
1105 then |
1479 then |
1106 if(GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN==false) |
1480 if(CS.NORTH_AMERICAN_SPECIAL_SHOTGUN==false) |
1107 then |
1481 then |
1108 GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN = true |
1482 CS.NORTH_AMERICAN_SPECIAL_SHOTGUN = true |
1109 AddCaption(GLOBAL_SHOTGUN_SPECIAL_INFO) |
|
1110 else |
1483 else |
1111 GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN = false |
1484 CS.NORTH_AMERICAN_SPECIAL_SHOTGUN = false |
1112 AddCaption(loc("DEFAULT")) |
|
1113 end |
1485 end |
1114 |
1486 |
1115 --europe |
1487 --europe |
1116 elseif(GetCurAmmoType() == amMolotov) |
1488 elseif(GetCurAmmoType() == amMolotov) |
1117 then |
1489 then |
1118 if(GLOBAL_EUROPE_SPECIAL==0) |
1490 if(CS.EUROPE_SPECIAL==0) |
1119 then |
1491 then |
1120 GLOBAL_EUROPE_SPECIAL = 1 |
1492 CS.EUROPE_SPECIAL = 1 |
1121 AddCaption(GLOBAL_MOLOTOV_SPECIAL_INFO) |
|
1122 else |
1493 else |
1123 GLOBAL_EUROPE_SPECIAL = 0 |
1494 CS.EUROPE_SPECIAL = 0 |
1124 AddCaption(loc("DEFAULT")) |
|
1125 end |
1495 end |
1126 |
1496 |
1127 --antarctica |
1497 --antarctica |
1128 elseif(GetCurAmmoType() == amPickHammer) |
1498 elseif(GetCurAmmoType() == amPickHammer) |
1129 then |
1499 then |
1130 if(GLOBAL_ANTARCTICA_SPECIAL==0) |
1500 if(CS.ANTARCTICA_SPECIAL==0) |
1131 then |
1501 then |
1132 GLOBAL_ANTARCTICA_SPECIAL = 1 |
1502 CS.ANTARCTICA_SPECIAL = 1 |
1133 AddCaption(GLOBAL_PICKHAMMER_SPECIAL_INFO) |
|
1134 else |
1503 else |
1135 GLOBAL_ANTARCTICA_SPECIAL = 0 |
1504 CS.ANTARCTICA_SPECIAL = 0 |
1136 AddCaption(loc("DEFAULT")) |
|
1137 end |
1505 end |
1138 |
1506 |
1139 --kerguelen |
1507 --kerguelen |
1140 elseif(GetCurAmmoType() == amHammer) |
1508 elseif(GetCurAmmoType() == amHammer) |
1141 then |
1509 then |
1142 if(GLOBAL_KERGUELEN_SPECIAL==6) |
1510 if(CS.KERGUELEN_SPECIAL==6) |
1143 then |
1511 then |
1144 GLOBAL_KERGUELEN_SPECIAL = 1 |
1512 CS.KERGUELEN_SPECIAL = 1 |
1145 AddCaption("DEFAULT") |
1513 elseif(CS.KERGUELEN_SPECIAL==1) |
1146 elseif(GLOBAL_KERGUELEN_SPECIAL==1) |
|
1147 then |
1514 then |
1148 GLOBAL_KERGUELEN_SPECIAL = 2 |
1515 CS.KERGUELEN_SPECIAL = 2 |
1149 AddCaption("#"..GLOBAL_HAMMER_ROAR_INFO) |
1516 elseif(CS.KERGUELEN_SPECIAL==2) |
1150 elseif(GLOBAL_KERGUELEN_SPECIAL==2) |
|
1151 then |
1517 then |
1152 GLOBAL_KERGUELEN_SPECIAL = 3 |
1518 CS.KERGUELEN_SPECIAL = 3 |
1153 AddCaption("##"..GLOBAL_HAMMER_SWAP_INFO) |
1519 elseif(CS.KERGUELEN_SPECIAL==3) |
1154 elseif(GLOBAL_KERGUELEN_SPECIAL==3) |
|
1155 then |
1520 then |
1156 GLOBAL_KERGUELEN_SPECIAL = 5 |
1521 CS.KERGUELEN_SPECIAL = 5 |
1157 AddCaption("###"..GLOBAL_HAMMER_LONELY_INFO) |
1522 elseif(CS.KERGUELEN_SPECIAL==5) |
1158 elseif(GLOBAL_KERGUELEN_SPECIAL==5) |
|
1159 then |
1523 then |
1160 GLOBAL_KERGUELEN_SPECIAL = 6 |
1524 CS.KERGUELEN_SPECIAL = 6 |
1161 AddCaption("####"..GLOBAL_HAMMER_SABOTAGE_INFO) |
|
1162 end |
1525 end |
1163 end |
1526 SetAttackState(CS.KERGUELEN_SPECIAL == 1) |
|
1527 end |
|
1528 ShowSpecialWeaponCaption(GetCurAmmoType()) |
1164 end |
1529 end |
1165 --for selecting weaponset, this is mostly for old players. |
1530 --for selecting weaponset, this is mostly for old players. |
1166 if(GetHogLevel(CurrentHedgehog)==0 and GLOBAL_SELECT_CONTINENT_CHECK==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing)) |
1531 -- Switch: Next continent |
1167 then |
1532 -- Precise+Switch: Previous continent |
1168 GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]+1 |
1533 TrySelectNextContinent(CS.PRECISE) |
1169 |
|
1170 if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]> table.maxn(GLOBAL_CONTINENT_INFORMATION)) |
|
1171 then |
|
1172 GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=1 |
|
1173 end |
|
1174 SetContinentWeapons() |
|
1175 end |
|
1176 --if switching out from sabotage. |
1534 --if switching out from sabotage. |
1177 elseif(GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]~=nil and GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==2) |
1535 elseif(CS.SABOTAGE_HOGS[CurrentHedgehog]~=nil and CS.SABOTAGE_HOGS[CurrentHedgehog]==2) |
1178 then |
1536 then |
1179 GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=1 |
1537 CS.SABOTAGE_HOGS[CurrentHedgehog]=1 |
|
1538 end |
|
1539 end |
|
1540 |
|
1541 function TrySelectNextContinent(reverse) |
|
1542 local direction = 1 |
|
1543 if reverse then |
|
1544 direction = -1 |
|
1545 end |
|
1546 if(GetHogLevel(CurrentHedgehog)==0 and CS.SELECT_CONTINENT_CHECK==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing)) |
|
1547 then |
|
1548 CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)] + direction |
|
1549 |
|
1550 if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]> table.maxn(CS.CONTINENT_INFORMATION)) |
|
1551 then |
|
1552 CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=1 |
|
1553 end |
|
1554 if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]<=0) |
|
1555 then |
|
1556 CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=table.maxn(CS.CONTINENT_INFORMATION) |
|
1557 end |
|
1558 SetContinentWeapons() |
|
1559 |
|
1560 PlaySound(sndSwitchHog) |
1180 end |
1561 end |
1181 end |
1562 end |
1182 |
1563 |
1183 function onUp() |
1564 function onUp() |
1184 --swap forward in the weaponmenu (1.0 style) |
1565 --swap forward in the weaponmenu (1.0 style) |
1185 if(GetHogLevel(CurrentHedgehog)==0 and GLOBAL_SELECT_CONTINENT_CHECK==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing)) |
1566 TrySelectNextContinent(false) |
1186 then |
1567 |
1187 GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]+1 |
1568 if(GetCurAmmoType() == amSeduction and CS.AFRICAN_SPECIAL_SEDUCTION == 1 and GetAmmoCount(CurrentHedgehog,amInvulnerable)>0) |
1188 |
1569 then |
1189 if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]> table.maxn(GLOBAL_CONTINENT_INFORMATION)) |
1570 CS.SEDUCTION_INCREASER=CS.SEDUCTION_INCREASER+7 |
1190 then |
|
1191 GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=1 |
|
1192 end |
|
1193 SetContinentWeapons() |
|
1194 end |
|
1195 |
|
1196 if(GetCurAmmoType() == amSeduction and GLOBAL_AFRICAN_SPECIAL_SEDUCTION == 1 and GetAmmoCount(CurrentHedgehog,amInvulnerable)>0) |
|
1197 then |
|
1198 GLOBAL_SEDUCTION_INCREASER=GLOBAL_SEDUCTION_INCREASER+7 |
|
1199 |
1571 |
1200 RemoveWeapon(CurrentHedgehog,amInvulnerable) |
1572 RemoveWeapon(CurrentHedgehog,amInvulnerable) |
1201 |
1573 |
1202 AddCaption(string.format(GLOBAL_INVULNERABLE_SPECIAL_INFO," ("..(GLOBAL_SEDUCTION_INCREASER+15)..")"," ("..GetAmmoCount(CurrentHedgehog,amInvulnerable)..")")) |
1574 AddCaption(string.format(CS.INVULNERABLE_SPECIAL_CAPTION, CS.SEDUCTION_INCREASER, GetAmmoCount(CurrentHedgehog,amInvulnerable)), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmostate) |
1203 end |
1575 end |
1204 end |
1576 end |
1205 |
1577 |
1206 function onDown() |
1578 function onDown() |
1207 --swap backwards in the weaponmenu (1.0 style) |
1579 --swap backwards in the weaponmenu (1.0 style) |
1208 if(GetHogLevel(CurrentHedgehog)==0 and GLOBAL_SELECT_CONTINENT_CHECK==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing)) |
1580 TrySelectNextContinent(true) |
1209 then |
1581 |
1210 GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]-1 |
1582 if(GetCurAmmoType() == amSeduction and CS.AFRICAN_SPECIAL_SEDUCTION == 1 and CS.SEDUCTION_INCREASER>0) |
1211 |
1583 then |
1212 if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]<=0) |
1584 CS.SEDUCTION_INCREASER=CS.SEDUCTION_INCREASER-7 |
1213 then |
|
1214 GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=table.maxn(GLOBAL_CONTINENT_INFORMATION) |
|
1215 end |
|
1216 SetContinentWeapons() |
|
1217 end |
|
1218 |
|
1219 if(GetCurAmmoType() == amSeduction and GLOBAL_AFRICAN_SPECIAL_SEDUCTION == 1 and GLOBAL_SEDUCTION_INCREASER>0) |
|
1220 then |
|
1221 GLOBAL_SEDUCTION_INCREASER=GLOBAL_SEDUCTION_INCREASER-7 |
|
1222 |
1585 |
1223 AddAmmo(CurrentHedgehog,amInvulnerable,GetAmmoCount(CurrentHedgehog, amInvulnerable)+1) |
1586 AddAmmo(CurrentHedgehog,amInvulnerable,GetAmmoCount(CurrentHedgehog, amInvulnerable)+1) |
1224 |
1587 |
1225 AddCaption(string.format(GLOBAL_INVULNERABLE_SPECIAL_INFO," ("..(GLOBAL_SEDUCTION_INCREASER+15)..")"," ("..GetAmmoCount(CurrentHedgehog,amInvulnerable)..")")) |
1588 AddCaption(string.format(CS.INVULNERABLE_SPECIAL_CAPTION, CS.SEDUCTION_INCREASER, GetAmmoCount(CurrentHedgehog,amInvulnerable)), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmostate) |
|
1589 end |
|
1590 end |
|
1591 |
|
1592 -- Spawn sabotage smoke for inactive hogs (red smoke, more subtle than for active hogs) |
|
1593 function SabotageSmokeInactive(gear) |
|
1594 if GetGearType(gear) == gtHedgehog and gear ~= CurrentHedgehog and CS.SABOTAGE_HOGS[gear]~=nil and CS.SABOTAGE_HOGS[gear]>=1 then |
|
1595 local vg = AddVisualGear(GetX(gear), GetY(gear), vgtSmokeWhite, 0, false) |
|
1596 SetVisualGearValues(vg, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xFF8080B0) |
|
1597 end |
|
1598 end |
|
1599 |
|
1600 function ShowContinentLabel() |
|
1601 if CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)] == 0 then |
|
1602 AddCaption(loc("Random continent"), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1603 else |
|
1604 AddCaption(CS.CONTINENT_INFORMATION[CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]][1], GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo) |
|
1605 end |
|
1606 end |
|
1607 |
|
1608 function onGameTick() |
|
1609 -- This is a trick to show the continent label delayed by 1 tick |
|
1610 if CS.CONTINENT_LABEL_TIMER > 0 then |
|
1611 CS.CONTINENT_LABEL_TIMER = CS.CONTINENT_LABEL_TIMER - 1 |
|
1612 end |
|
1613 if CS.CONTINENT_LABEL_TIMER == 0 then |
|
1614 ShowContinentLabel() |
|
1615 CS.CONTINENT_LABEL_TIMER = -1 |
|
1616 end |
|
1617 |
|
1618 if CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER > 0 then |
|
1619 CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER = CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER - 1 |
|
1620 end |
|
1621 if CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER == 0 then |
|
1622 HandleSpecialWeaponMisc() |
|
1623 CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER = -1 |
|
1624 end |
|
1625 |
|
1626 -- See onAttack() |
|
1627 if CS.CONFIRM_CONTINENT_SELECTION > 0 then |
|
1628 CS.CONFIRM_CONTINENT_SELECTION = CS.CONFIRM_CONTINENT_SELECTION - 1 |
|
1629 end |
|
1630 if CS.CONFIRM_CONTINENT_SELECTION == 0 then |
|
1631 CS.SELECT_CONTINENT_CHECK=false |
|
1632 EndTurnCS(0) |
|
1633 PlaySound(sndPlaced) |
|
1634 ShowContinentLabel() |
|
1635 CS.CONFIRM_CONTINENT_SELECTION = -1 |
|
1636 end |
|
1637 |
|
1638 if GameTime % 600 == 0 then |
|
1639 runOnGears(SabotageSmokeInactive) |
1226 end |
1640 end |
1227 end |
1641 end |
1228 |
1642 |
1229 function onGameTick20() |
1643 function onGameTick20() |
1230 --if you picked a weaponset from the weaponmenu (icon) |
1644 --if you picked a weaponset from the weaponmenu (icon) |
1231 if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0) |
1645 if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0) |
1232 then |
1646 then |
1233 if(GetCurAmmoType()==amSwitch) |
1647 if(GetCurAmmoType()==amSwitch) |
1234 then |
1648 then |
1235 GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.maxn(GLOBAL_CONTINENT_INFORMATION))+1 |
1649 CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.maxn(CS.CONTINENT_INFORMATION))+1 |
1236 SetContinentWeapons() |
1650 SetContinentWeapons() |
|
1651 SetWeapon(amSkip) |
1237 PlaySound(sndMineTick) |
1652 PlaySound(sndMineTick) |
|
1653 CS.CONTINENT_LABEL_TIMER = 1 |
1238 else |
1654 else |
1239 for v,w in pairs(GLOBAL_CONTINENT_INFORMATION) |
1655 for v,w in pairs(CS.CONTINENT_INFORMATION) |
1240 do |
1656 do |
1241 if(GetCurAmmoType()==GLOBAL_CONTINENT_INFORMATION[v][4][1]) |
1657 if(GetCurAmmoType()==CS.CONTINENT_INFORMATION[v][4][1]) |
1242 then |
1658 then |
1243 GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=v |
1659 CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=v |
1244 SetContinentWeapons() |
1660 SetContinentWeapons() |
1245 PlaySound(GLOBAL_CONTINENT_INFORMATION[v][6][1]) |
1661 SetWeapon(amSkip) |
1246 PlaySound(GLOBAL_CONTINENT_INFORMATION[v][6][2],CurrentHedgehog) |
1662 PlaySound(CS.CONTINENT_INFORMATION[v][6][1]) |
|
1663 PlaySound(CS.CONTINENT_INFORMATION[v][6][2],CurrentHedgehog) |
|
1664 CS.CONTINENT_LABEL_TIMER = 1 |
|
1665 break |
1247 end |
1666 end |
1248 end |
1667 end |
1249 end |
1668 end |
1250 end |
1669 end |
1251 |
1670 |
1252 --show the kerguelen ring |
1671 --show the kerguelen ring |
1253 if(GLOBAL_KERGUELEN_SPECIAL > 1 and GetCurAmmoType() == amHammer) |
1672 if(CS.KERGUELEN_SPECIAL > 1 and GetCurAmmoType() == amHammer and |
1254 then |
1673 band(GetState(CurrentHedgehog), gstAttacked) == 0 and |
1255 if(GLOBAL_VISUAL_CIRCLE==nil) |
1674 band(GetState(CurrentHedgehog), gstHHDriven) ~= 0) |
1256 then |
1675 then |
1257 GLOBAL_VISUAL_CIRCLE=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 0, true) |
1676 if(CS.VISUAL_CIRCLE==nil) |
1258 end |
1677 then |
1259 |
1678 CS.VISUAL_CIRCLE=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 0, true) |
1260 if(GLOBAL_KERGUELEN_SPECIAL == 2) --walrus scream |
1679 end |
1261 then |
1680 |
1262 SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 120, 4, 0xff0000ee) |
1681 if(CS.KERGUELEN_SPECIAL == 2) --walrus scream |
1263 elseif(GLOBAL_KERGUELEN_SPECIAL == 3) --swap hog |
1682 then |
1264 then |
1683 SetVisualGearValues(CS.VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 120, 4, 0xff0000ee) |
1265 SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 390, 3, 0xffff00ee) |
1684 elseif(CS.KERGUELEN_SPECIAL == 3) --swap hog |
1266 elseif(GLOBAL_KERGUELEN_SPECIAL == 5) --cries |
1685 then |
1267 then |
1686 SetVisualGearValues(CS.VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 390, 3, 0xffff00ee) |
1268 |
1687 elseif(CS.KERGUELEN_SPECIAL == 5) --cries |
1269 GLOBAL_TEMP_VALUE=0 |
1688 then |
|
1689 |
|
1690 CS.TEMP_VALUE=0 |
1270 runOnGears(KerguelenSpecialBlueCheck) |
1691 runOnGears(KerguelenSpecialBlueCheck) |
1271 if(GLOBAL_TEMP_VALUE==0) |
1692 if(CS.TEMP_VALUE==0) |
1272 then |
1693 then |
1273 SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 1, 0x0000ffee) |
1694 SetVisualGearValues(CS.VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 1, 0x0000ffee) |
1274 else |
1695 else |
1275 SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 10, 0x0000ffee) |
1696 SetVisualGearValues(CS.VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 10, 0x0000ffee) |
1276 end |
1697 end |
1277 |
1698 |
1278 elseif(GLOBAL_KERGUELEN_SPECIAL == 6) --sabotage |
1699 elseif(CS.KERGUELEN_SPECIAL == 6) --sabotage |
1279 then |
1700 then |
1280 SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 80, 10, 0x00ff00ee) |
1701 SetVisualGearValues(CS.VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 80, 10, 0x00ff00ee) |
1281 end |
1702 end |
1282 |
1703 |
1283 elseif(GLOBAL_VISUAL_CIRCLE~=nil) |
1704 elseif(CS.VISUAL_CIRCLE~=nil) |
1284 then |
1705 then |
1285 DeleteVisualGear(GLOBAL_VISUAL_CIRCLE) |
1706 DeleteVisualGear(CS.VISUAL_CIRCLE) |
1286 GLOBAL_VISUAL_CIRCLE=nil |
1707 CS.VISUAL_CIRCLE=nil |
1287 end |
1708 end |
1288 |
1709 |
1289 --sabotage |
1710 --sabotage |
1290 if(GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]~=nil and GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]>=1) |
1711 if(CS.SABOTAGE_HOGS[CurrentHedgehog]~=nil and CS.SABOTAGE_HOGS[CurrentHedgehog]>=1) |
1291 then |
1712 then |
1292 --for sabotage |
1713 --for sabotage |
1293 if(GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==1) |
1714 if(CS.SABOTAGE_HOGS[CurrentHedgehog]==1) |
1294 then |
1715 then |
1295 AddCaption(loc("You are sabotaged, RUN!")) |
1716 AddCaption(loc("You are sabotaged, RUN!")) |
1296 |
1717 |
1297 PlaySound(sndHellish) |
1718 PlaySound(sndHellish) |
1298 --update the constant at the top also to something in between |
1719 --update the constant at the top also to something in between |
1299 GLOBAL_SABOTAGE_FREQUENCY=100 |
1720 CS.SABOTAGE_FREQUENCY_NOW=CS.SABOTAGE_FREQUENCY |
1300 SetGravity(350) |
1721 SetGravity(CS.SABOTAGE_GRAVITY) |
1301 |
1722 |
1302 GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=2 |
1723 CS.SABOTAGE_HOGS[CurrentHedgehog]=2 |
1303 end |
1724 end |
1304 |
1725 |
1305 if(GLOBAL_SABOTAGE_COUNTER % 20 == 0) |
1726 if(CS.SABOTAGE_COUNTER % 20 == 0) |
1306 then |
1727 then |
1307 AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false) |
1728 -- Sabotage effect (red smoke) |
|
1729 local vg = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false) |
|
1730 SetVisualGearValues(vg, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xFF4040FF) |
1308 end |
1731 end |
1309 |
1732 |
1310 if(TurnTimeLeft<(GetAwayTime*10) or band(GetState(CurrentHedgehog),gstAttacked)==1) |
1733 if(TurnTimeLeft<(GetAwayTime*10) or band(GetState(CurrentHedgehog),gstAttacked)==1) |
1311 then |
1734 then |
1312 GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=0 |
1735 CS.SABOTAGE_HOGS[CurrentHedgehog]=0 |
1313 elseif(GLOBAL_SABOTAGE_COUNTER >= GLOBAL_SABOTAGE_FREQUENCY) |
1736 elseif(CS.SABOTAGE_COUNTER >= CS.SABOTAGE_FREQUENCY_NOW) |
1314 then |
1737 then |
1315 |
1738 -- Sabotage decreases hog health regularily, |
1316 if(GetHealth(CurrentHedgehog)<=2) |
1739 -- but invulnerable protects. |
1317 then |
1740 -- Also do not decrease health while retreating or attacking. |
1318 SetHealth(CurrentHedgehog, 0) |
1741 if(GetEffect(CurrentHedgehog, heInvulnerable) == 0 and |
1319 GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=0 |
1742 band(GetState(CurrentHedgehog), gstHHDriven) ~= 0 and |
1320 else |
1743 band(GetState(CurrentHedgehog), gstAttacked+gstAttacking) == 0) |
1321 SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)-2) |
1744 then |
1322 end |
1745 if(GetHealth(CurrentHedgehog)<=CS.SABOTAGE_DAMAGE) |
1323 ShowDamageTag(CurrentHedgehog,2) |
1746 then |
1324 |
1747 -- All health lost! Sabotage is cruel. |
1325 GLOBAL_SABOTAGE_COUNTER=0 |
1748 PlaySound(sndPoisonMoan, CurrentHedgehog) |
|
1749 SetHealth(CurrentHedgehog, 0) |
|
1750 CS.SABOTAGE_HOGS[CurrentHedgehog]=0 |
|
1751 -- Take away control so the hog can die in peace. |
|
1752 SetState(CurrentHedgehog, band(GetState(CurrentHedgehog), bnot(gstHHDriven))) |
|
1753 else |
|
1754 local newHealth = GetHealth(CurrentHedgehog)-CS.SABOTAGE_DAMAGE |
|
1755 -- Start moaning if health is at a critical level |
|
1756 if newHealth <= 16 then |
|
1757 PlaySound(sndPoisonMoan, CurrentHedgehog) |
|
1758 elseif newHealth <= 32 then |
|
1759 PlaySound(sndPoisonCough, CurrentHedgehog) |
|
1760 end |
|
1761 SetHealth(CurrentHedgehog, newHealth) |
|
1762 end |
|
1763 ShowDamageTag(CurrentHedgehog,CS.SABOTAGE_DAMAGE) |
|
1764 end |
|
1765 |
|
1766 CS.SABOTAGE_COUNTER=0 |
1326 else |
1767 else |
1327 GLOBAL_SABOTAGE_COUNTER=GLOBAL_SABOTAGE_COUNTER+1 |
1768 CS.SABOTAGE_COUNTER=CS.SABOTAGE_COUNTER+1 |
1328 end |
1769 end |
1329 elseif(GetGravity()==350 and (GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==0 or GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==nil)) |
1770 elseif((GetGravity()==CS.SABOTAGE_GRAVITY or GetGravity()==CS.SABOTAGE_GRAVITY_LOW) and (CS.SABOTAGE_HOGS[CurrentHedgehog]==0 or CS.SABOTAGE_HOGS[CurrentHedgehog]==nil)) |
1330 then |
1771 then |
|
1772 -- Reset gravity |
1331 SetGravity(100) |
1773 SetGravity(100) |
1332 end |
1774 end |
1333 |
1775 |
1334 --enable switch (north america) |
1776 --enable switch (north america) |
1335 if(GetCurAmmoType() == amSwitch and GLOBAL_TEMP_VALUE==87) |
1777 if(GetCurAmmoType() == amSwitch and CS.TEMP_VALUE==87) |
1336 then |
1778 then |
1337 SetGearMessage(CurrentHedgehog,gmAttack) |
1779 SetGearMessage(CurrentHedgehog,gmAttack) |
1338 GLOBAL_TEMP_VALUE=0 |
1780 CS.TEMP_VALUE=0 |
1339 end |
1781 end |
|
1782 |
|
1783 if(CS.SPEECH_TIMER > 0) then |
|
1784 CS.SPEECH_TIMER = CS.SPEECH_TIMER - 20 |
|
1785 end |
|
1786 end |
|
1787 |
|
1788 function HandleSpecialWeaponMisc(ammoType) |
|
1789 if not ammoType then |
|
1790 ammoType = GetCurAmmoType() |
|
1791 end |
|
1792 ShowSpecialWeaponCaption(ammoType) |
|
1793 if ammoType == amSMine and CS.AFRICAN_SPECIAL_STICKY ~= 0 then |
|
1794 SetSoundMask(sndLaugh, true) |
|
1795 else |
|
1796 SetSoundMask(sndLaugh, false) |
|
1797 end |
|
1798 if (ammoType == amHammer and CS.KERGUELEN_SPECIAL > 1) or (ammoType == amBaseballBat and CS.AUSTRALIAN_SPECIAL ~= 0) then |
|
1799 SetAttackState(false) |
|
1800 else |
|
1801 SetAttackState(true) |
|
1802 end |
|
1803 |
1340 end |
1804 end |
1341 |
1805 |
1342 --some ppl complained :P |
1806 --some ppl complained :P |
1343 function onSlot(slot) |
1807 function onSlot(slot) |
1344 if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0) |
1808 if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0) |
1345 then |
1809 then |
1346 SetWeapon(amSkip) |
1810 SetWeapon(amSkip) |
|
1811 end |
|
1812 if CS.GAME_STARTED then |
|
1813 -- Delay calling HandleSpecialWeaponMisc because |
|
1814 -- the CurAmmoType is not updated yet. |
|
1815 CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER = 2 |
|
1816 end |
|
1817 end |
|
1818 |
|
1819 function onSetWeapon(ammoType) |
|
1820 if CS.GAME_STARTED then |
|
1821 HandleSpecialWeaponMisc(ammoType) |
1347 end |
1822 end |
1348 end |
1823 end |
1349 |
1824 |
1350 --if you used hogswitch or any similar weapon, dont enable any weaponchange |
1825 --if you used hogswitch or any similar weapon, dont enable any weaponchange |
1351 function onAttack() |
1826 function onAttack() |
1352 if(GLOBAL_SELECT_CONTINENT_CHECK==true) |
1827 if(CS.SELECT_CONTINENT_CHECK==true) |
1353 then |
1828 then |
1354 if(GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing) |
1829 if(GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing) |
1355 then |
1830 then |
1356 GLOBAL_SELECT_CONTINENT_CHECK=false |
1831 SetWeapon(amNothing) |
1357 EndTurn(0) |
1832 -- Delay the real continent selection so the SetWeapon |
|
1833 -- has time to take effect. |
|
1834 CS.CONFIRM_CONTINENT_SELECTION=2 |
1358 else |
1835 else |
1359 SetWeapon(amSkip) |
1836 SetWeapon(amSkip) |
1360 end |
1837 end |
1361 end |
1838 end |
1362 |
1839 |
1363 --african special |
1840 --african special |
1364 if(GLOBAL_AFRICAN_SPECIAL_SEDUCTION == 1 and GetCurAmmoType() == amSeduction and band(GetState(CurrentHedgehog),gstAttacked)==0) |
1841 if(CS.AFRICAN_SPECIAL_SEDUCTION == 1 and GetCurAmmoType() == amSeduction and band(GetState(CurrentHedgehog),gstAttacked)==0) |
1365 then |
1842 then |
1366 EndTurn(3) |
1843 EndTurnCS(3) |
1367 |
1844 |
1368 GLOBAL_TEMP_VALUE=0 |
1845 CS.TEMP_VALUE=0 |
1369 runOnGears(AfricaSpecialSeduction) |
1846 runOnGears(AfricaSpecialSeduction) |
1370 SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+GLOBAL_TEMP_VALUE) |
1847 SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+CS.TEMP_VALUE) |
1371 |
1848 |
1372 --visual stuff |
1849 --visual stuff |
1373 VisualExplosion(250,GetX(CurrentHedgehog), GetY(CurrentHedgehog),vgtSmoke,vgtSmokeWhite) |
1850 VisualExplosion(250,GetX(CurrentHedgehog), GetY(CurrentHedgehog),vgtSmoke,vgtSmokeWhite) |
1374 PlaySound(sndParachute) |
1851 PlaySound(sndParachute) |
1375 |
1852 |
1376 RemoveWeapon(CurrentHedgehog,amSeduction) |
1853 RemoveWeapon(CurrentHedgehog,amSeduction) |
1377 |
1854 |
1378 elseif(GLOBAL_ANTARCTICA_SPECIAL == 1 and GetCurAmmoType() == amPickHammer and band(GetState(CurrentHedgehog),gstAttacked)==0) |
1855 elseif(CS.ANTARCTICA_SPECIAL == 1 and GetCurAmmoType() == amPickHammer and band(GetState(CurrentHedgehog),gstAttacked)==0) |
1379 then |
1856 then |
1380 EndTurn(10) |
1857 EndTurnCS(10) |
1381 SetGearPosition(CurrentHedgehog,GetX(CurrentHedgehog),0) |
1858 SetGearPosition(CurrentHedgehog,GetX(CurrentHedgehog),0) |
1382 ParseCommand("hjump") |
1859 ParseCommand("hjump") |
1383 SetGearVelocity(CurrentHedgehog, 0, 100000000) |
1860 SetGearVelocity(CurrentHedgehog, 0, 100000000) |
1384 |
1861 |
1385 PlaySound(sndPiano8) |
1862 PlaySound(sndPiano8) |
|
1863 PlaySound(sndWarp) |
1386 |
1864 |
1387 RemoveWeapon(CurrentHedgehog,amPickHammer) |
1865 RemoveWeapon(CurrentHedgehog,amPickHammer) |
1388 |
1866 |
1389 --Kerguelen specials |
1867 --Kerguelen specials |
1390 elseif(GetCurAmmoType() == amHammer and GLOBAL_KERGUELEN_SPECIAL > 1 and band(GetState(CurrentHedgehog),gstAttacked)==0) |
1868 elseif(GetCurAmmoType() == amHammer and CS.KERGUELEN_SPECIAL > 1 and band(GetState(CurrentHedgehog),gstAttacked)==0) |
1391 then |
1869 then |
1392 local escapetime=3 |
1870 local escapetime=3 |
1393 |
1871 |
1394 --scream |
1872 --scream |
1395 if(GLOBAL_KERGUELEN_SPECIAL == 2) |
1873 if(CS.KERGUELEN_SPECIAL == 2) |
1396 then |
1874 then |
1397 GLOBAL_TEMP_VALUE=0 |
1875 CS.TEMP_VALUE=0 |
1398 runOnGears(KerguelenSpecialRed) |
1876 runOnGears(KerguelenSpecialRed) |
1399 HealHog(CurrentHedgehog, GLOBAL_TEMP_VALUE) |
1877 HealHog(CurrentHedgehog, CS.TEMP_VALUE) |
1400 PlaySound(sndHellish) |
1878 PlaySound(sndHellish) |
1401 |
1879 |
1402 --swap |
1880 --swap |
1403 elseif(GLOBAL_KERGUELEN_SPECIAL == 3) |
1881 elseif(CS.KERGUELEN_SPECIAL == 3) |
1404 then |
1882 then |
1405 GLOBAL_TEMP_VALUE=0 |
1883 CS.TEMP_VALUE=0 |
1406 runOnGears(KerguelenSpecialYellowCountHogs) |
1884 runOnGears(KerguelenSpecialYellowCountHogs) |
1407 if(GLOBAL_TEMP_VALUE>0) |
1885 if(CS.TEMP_VALUE>0) |
1408 then |
1886 then |
1409 GLOBAL_TEMP_VALUE=GetRandom(GLOBAL_TEMP_VALUE) |
1887 CS.TEMP_VALUE=GetRandom(CS.TEMP_VALUE) |
1410 runOnGears(KerguelenSpecialYellowSwap) |
1888 runOnGears(KerguelenSpecialYellowSwap) |
1411 PlaySound(sndPiano3) |
1889 PlaySound(sndPiano3) |
1412 else |
1890 else |
1413 PlaySound(sndPiano6) |
1891 PlaySound(sndPiano6) |
1414 end |
1892 end |
1415 |
1893 |
1416 --cries |
1894 --cries |
1417 elseif(GLOBAL_KERGUELEN_SPECIAL == 5) |
1895 elseif(CS.KERGUELEN_SPECIAL == 5) |
1418 then |
1896 then |
1419 GLOBAL_TEMP_VALUE=0 |
1897 CS.TEMP_VALUE=0 |
1420 runOnGears(KerguelenSpecialBlueCheck) |
1898 runOnGears(KerguelenSpecialBlueCheck) |
1421 if(GLOBAL_TEMP_VALUE==0) |
1899 if(CS.TEMP_VALUE==0) |
1422 then |
1900 then |
1423 AddGear(0, 0, gtWaterUp, 0, 0,0,0) |
1901 AddGear(0, 0, gtWaterUp, 0, 0,0,0) |
1424 PlaySound(sndWarp) |
1902 PlaySound(sndWarp) |
1425 PlaySound(sndMolotov) |
1903 PlaySound(sndMolotov) |
1426 |
1904 |
1427 runOnGears(KerguelenSpecialBlueActivate) |
1905 runOnGears(KerguelenSpecialBlueActivate) |
1428 SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+GLOBAL_TEMP_VALUE) |
1906 SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+CS.TEMP_VALUE) |
1429 else |
1907 else |
1430 HogSay(CurrentHedgehog, loc("Hogs in sight!"), SAY_SAY) |
1908 PlaySound(sndDenied) |
1431 end |
1909 escapetime = -1 |
1432 |
1910 if CS.SPEECH_TIMER <= 0 then |
1433 --sabotage |
1911 HogSay(CurrentHedgehog, loc("Hogs in sight!"), SAY_SAY) |
1434 elseif(GLOBAL_KERGUELEN_SPECIAL == 6) |
1912 CS.SPEECH_TIMER = 5000 |
1435 then |
1913 end |
1436 GLOBAL_TEMP_VALUE=0 |
1914 end |
|
1915 |
|
1916 --flare/sabotage |
|
1917 elseif(CS.KERGUELEN_SPECIAL == 6) |
|
1918 then |
|
1919 CS.TEMP_VALUE=0 |
1437 runOnGears(KerguelenSpecialGreen) |
1920 runOnGears(KerguelenSpecialGreen) |
1438 |
1921 |
1439 PlaySound(sndThrowRelease) |
1922 PlaySound(sndThrowRelease) |
1440 AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, 0, -1000000, 32) |
1923 AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, 0, -1000000, 32) |
1441 |
1924 |
1442 if(GLOBAL_TEMP_VALUE==1) |
1925 if(CS.TEMP_VALUE==1) |
1443 then |
1926 then |
1444 escapetime=10 |
1927 escapetime=10 |
1445 end |
1928 end |
1446 end |
1929 end |
1447 |
1930 |
1448 EndTurn(escapetime) |
1931 if escapetime >= 0 then |
1449 |
1932 EndTurnCS(escapetime) |
1450 DeleteVisualGear(GLOBAL_VISUAL_CIRCLE) |
1933 |
1451 GLOBAL_VISUAL_CIRCLE=nil |
1934 DeleteVisualGear(CS.VISUAL_CIRCLE) |
1452 GLOBAL_KERGUELEN_SPECIAL=0 |
1935 CS.VISUAL_CIRCLE=nil |
1453 |
1936 CS.KERGUELEN_SPECIAL=0 |
1454 RemoveWeapon(CurrentHedgehog,amHammer) |
1937 |
|
1938 RemoveWeapon(CurrentHedgehog,amHammer) |
|
1939 end |
|
1940 |
|
1941 elseif(GetCurAmmoType() == amBaseballBat) |
|
1942 then |
|
1943 if CS.AUSTRALIAN_SPECIAL ~= 0 |
|
1944 then |
|
1945 CS.TEMP_VALUE=0 |
|
1946 runOnGears(AustraliaSpecialCheckHogs) |
|
1947 if CS.TEMP_VALUE == 0 then |
|
1948 SetGearMessage(CurrentHedgehog, bor(GetGearMessage(CurrentHedgehog), gmAttack)) |
|
1949 else |
|
1950 PlaySound(sndDenied) |
|
1951 end |
|
1952 end |
1455 |
1953 |
1456 elseif(GetCurAmmoType() == amVampiric) |
1954 elseif(GetCurAmmoType() == amVampiric) |
1457 then |
1955 then |
1458 GLOBAL_VAMPIRIC_IS_ON=75 |
1956 CS.VAMPIRIC_IS_ON=75 |
1459 elseif(GetCurAmmoType() == amExtraDamage) |
1957 elseif(GetCurAmmoType() == amExtraDamage) |
1460 then |
1958 then |
1461 GLOBAL_EXTRA_DAMAGE_IS_ON=150 |
1959 CS.EXTRA_DAMAGE_IS_ON=150 |
|
1960 end |
|
1961 end |
|
1962 |
|
1963 function onHogAttack(ammoType) |
|
1964 -- When a sabotaged hog uses low gravity, overwrite the default low gravity, |
|
1965 -- otherwise it would be too easy. |
|
1966 if(ammoType == amLowGravity and CS.SABOTAGE_HOGS[CurrentHedgehog]~=nil and CS.SABOTAGE_HOGS[CurrentHedgehog]>=1) |
|
1967 then |
|
1968 SetGravity(CS.SABOTAGE_GRAVITY_LOW) |
1462 end |
1969 end |
1463 end |
1970 end |
1464 |
1971 |
1465 function onGearAdd(gearUid) |
1972 function onGearAdd(gearUid) |
1466 GLOBAL_SELECT_CONTINENT_CHECK=false |
1973 CS.SELECT_CONTINENT_CHECK=false |
1467 |
1974 |
1468 --track the gears im using |
1975 --track the gears im using |
1469 if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives) |
1976 if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives) |
1470 then |
1977 then |
1471 trackGear(gearUid) |
1978 trackGear(gearUid) |
1472 end |
1979 end |
1473 |
1980 |
1474 --remove gasclouds on gasbombspecial |
1981 --remove gasclouds on gasbombspecial |
1475 if(GetGearType(gearUid)==gtPoisonCloud and GLOBAL_SOUTH_AMERICAN_SPECIAL == true) |
1982 if(GetGearType(gearUid)==gtPoisonCloud and CS.SOUTH_AMERICAN_SPECIAL == true) |
1476 then |
1983 then |
1477 DeleteGear(gearUid) |
1984 DeleteGear(gearUid) |
1478 --african special |
1985 --african special |
1479 elseif(GetGearType(gearUid)==gtSMine) |
1986 elseif(GetGearType(gearUid)==gtSMine) |
1480 then |
1987 then |
1481 vx,vy=GetGearVelocity(gearUid) |
1988 local vx,vy=GetGearVelocity(gearUid) |
1482 if(GLOBAL_AFRICAN_SPECIAL_STICKY == 1) |
1989 if(CS.AFRICAN_SPECIAL_STICKY == 1) |
1483 then |
1990 then |
1484 SetState(CurrentHedgehog, gstHHDriven+gstMoving) |
1991 SetState(CurrentHedgehog, gstHHDriven+gstMoving) |
1485 SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog),GetY(CurrentHedgehog)-3) |
1992 SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog),GetY(CurrentHedgehog)-3) |
1486 SetGearVelocity(CurrentHedgehog, vx, vy) |
1993 SetGearVelocity(CurrentHedgehog, vx, vy) |
|
1994 PlaySound(sndJump2, CurrentHedgehog) |
1487 DeleteGear(gearUid) |
1995 DeleteGear(gearUid) |
1488 |
1996 if (not CS.AFRICAN_SPECIAL_NON_PROJECTILE_USED) then |
1489 elseif(GLOBAL_AFRICAN_SPECIAL_STICKY == 2) |
1997 SetSoundMask(sndMissed, true) |
|
1998 end |
|
1999 |
|
2000 elseif(CS.AFRICAN_SPECIAL_STICKY == 2) |
1490 then |
2001 then |
1491 FireGear(CurrentHedgehog,gtNapalmBomb, vx, vy, 0) |
2002 FireGear(CurrentHedgehog,gtNapalmBomb, vx, vy, 0) |
1492 DeleteGear(gearUid) |
2003 DeleteGear(gearUid) |
|
2004 CS.AFRICAN_SPECIAL_NON_PROJECTILE_USED=true |
|
2005 SetSoundMask(sndMissed, false) |
|
2006 else |
|
2007 CS.AFRICAN_SPECIAL_NON_PROJECTILE_USED=true |
|
2008 SetSoundMask(sndMissed, false) |
1493 end |
2009 end |
1494 --north american special |
2010 --north american special |
1495 elseif(GetGearType(gearUid)==gtSniperRifleShot) |
2011 elseif(GetGearType(gearUid)==gtSniperRifleShot) |
1496 then |
2012 then |
1497 GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=true |
2013 CS.NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=true |
1498 if(GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER~=1) |
2014 if(CS.NORTH_AMERICAN_SPECIAL_SNIPER~=1) |
1499 then |
2015 then |
1500 SetHealth(gearUid, 1) |
2016 SetHealth(gearUid, 1) |
|
2017 SetGearValues(gearUid, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0) |
1501 end |
2018 end |
1502 --north american special |
2019 --north american special |
1503 elseif(GetGearType(gearUid)==gtShotgunShot) |
2020 elseif(GetGearType(gearUid)==gtShotgunShot) |
1504 then |
2021 then |
1505 if(GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN==true) |
2022 if(CS.NORTH_AMERICAN_SPECIAL_SHOTGUN==true) |
1506 then |
2023 then |
1507 AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false) |
2024 AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false) |
1508 AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false) |
2025 AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false) |
1509 AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false) |
2026 AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false) |
1510 PlaySound(sndBirdyLay) |
2027 PlaySound(sndBirdyLay) |
1511 end |
2028 end |
1512 --european special |
2029 --european special |
1513 elseif(GetGearType(gearUid)==gtMolotov and GLOBAL_EUROPE_SPECIAL==1) |
2030 elseif(GetGearType(gearUid)==gtMolotov and CS.EUROPE_SPECIAL==1) |
1514 then |
2031 then |
1515 vx,vy=GetGearVelocity(gearUid) |
2032 local vx,vy=GetGearVelocity(gearUid) |
1516 e_health=FireGear(CurrentHedgehog,gtCluster, vx, vy, 1) |
2033 local e_health=FireGear(CurrentHedgehog,gtCluster, vx, vy, 1) |
1517 SetGearMessage(e_health, 2) |
2034 SetGearMessage(e_health, 2) |
1518 DeleteGear(gearUid) |
2035 DeleteGear(gearUid) |
1519 --australian specials |
2036 --australian specials |
1520 elseif(GetGearType(gearUid)==gtShover and GLOBAL_AUSTRALIAN_SPECIAL~=0) |
2037 elseif(GetGearType(gearUid)==gtShover and CS.AUSTRALIAN_SPECIAL~=0) |
1521 then |
2038 then |
1522 GLOBAL_TEMP_VALUE=0 |
2039 CS.TEMP_VALUE=0 |
1523 runOnGears(AustraliaSpecialCheckHogs) |
2040 runOnGears(AustraliaSpecialCheckHogs) |
1524 |
2041 |
1525 if(GLOBAL_TEMP_VALUE==0) |
2042 if(CS.TEMP_VALUE==0) |
1526 then |
2043 then |
1527 vx,vy=GetGearVelocity(gearUid) |
2044 local vx,vy=GetGearVelocity(gearUid) |
1528 |
2045 |
1529 if(GLOBAL_AUSTRALIAN_SPECIAL==1) |
2046 if(CS.AUSTRALIAN_SPECIAL==1) |
1530 then |
2047 then |
1531 local austmine=FireGear(CurrentHedgehog,gtMine, vx, vy, 0) |
2048 local austmine=FireGear(CurrentHedgehog,gtMine, vx, vy, 0) |
1532 SetHealth(austmine, 100) |
2049 SetHealth(austmine, 100) |
1533 SetTimer(austmine, 1000) |
2050 SetTimer(austmine, 1000) |
|
2051 PlaySound(sndLaugh, CurrentHedgehog) |
1534 else |
2052 else |
1535 local austmine=FireGear(CurrentHedgehog,gtBall, vx, vy, 1) |
2053 local austmine=FireGear(CurrentHedgehog,gtBall, vx, vy, 1) |
1536 --SetHealth(austmine, 1) |
|
1537 SetTimer(austmine, 1000) |
2054 SetTimer(austmine, 1000) |
1538 SetGearMessage(austmine, 3) |
2055 SetGearMessage(austmine, 3) |
1539 end |
2056 end |
1540 else |
2057 else |
1541 PlaySound(sndDenied) |
2058 PlaySound(sndDenied) |
1542 end |
2059 end |
1543 elseif(GetGearType(gearUid)==gtParachute) |
2060 elseif(GetGearType(gearUid)==gtParachute) |
1544 then |
2061 then |
1545 GLOBAL_PARACHUTE_IS_ON=1 |
2062 CS.PARACHUTE_IS_ON=1 |
1546 elseif(GetGearType(gearUid)==gtSwitcher) |
2063 elseif(GetGearType(gearUid)==gtSwitcher) |
1547 then |
2064 then |
1548 GLOBAL_SWITCH_HOG_IS_ON=true |
2065 CS.SWITCH_HOG_IS_ON=true |
1549 end |
2066 end |
1550 end |
2067 end |
1551 |
2068 |
1552 function onGearDamage(gearUid, damage) |
2069 function onGearDamage(gearUid, damage) |
1553 if (GetGearType(gearUid) == gtCase) |
2070 if(gearUid==CurrentHedgehog and CS.SABOTAGE_HOGS[CurrentHedgehog]==1) |
1554 then |
2071 then |
1555 GLOBAL_CRATE_TEST=gearUid |
2072 CS.SABOTAGE_HOGS[CurrentHedgehog]=0 |
1556 end |
|
1557 |
|
1558 if(gearUid==CurrentHedgehog and GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==1) |
|
1559 then |
|
1560 GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=0 |
|
1561 end |
2073 end |
1562 end |
2074 end |
1563 |
2075 |
1564 function onGearDelete(gearUid) |
2076 function onGearDelete(gearUid) |
1565 |
2077 |
1566 if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives) |
2078 if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives) |
1567 then |
2079 then |
1568 --sundaland special |
2080 --sundaland special |
1569 if(GetGearType(gearUid) == gtHedgehog and GLOBAL_TEAM_CONTINENT[GLOBAL_SUNDALAND_END_HOG_CONTINENT_NAME]==10) |
2081 if(GetGearType(gearUid) == gtHedgehog and CS.TEAM_CONTINENT[CS.SUNDALAND_END_HOG_CONTINENT_NAME]==10) |
1570 then |
2082 then |
1571 local currvalue=getTeamValue(GLOBAL_SUNDALAND_END_HOG_CONTINENT_NAME, "sundaland-count") |
2083 local currvalue=getTeamValue(CS.SUNDALAND_END_HOG_CONTINENT_NAME, "sundaland-count") |
1572 |
2084 |
1573 if(currvalue==nil) |
2085 if(currvalue==nil) |
1574 then |
2086 then |
1575 currvalue=0 |
2087 currvalue=0 |
1576 end |
2088 end |
1577 |
2089 |
1578 setTeamValue(GLOBAL_SUNDALAND_END_HOG_CONTINENT_NAME, "sundaland-count", currvalue+1) |
2090 setTeamValue(CS.SUNDALAND_END_HOG_CONTINENT_NAME, "sundaland-count", currvalue+1) |
1579 PlaySound(sndReinforce,CurrentHedgehog) |
|
1580 end |
2091 end |
1581 |
2092 |
1582 trackDeletion(gearUid) |
2093 trackDeletion(gearUid) |
1583 end |
2094 end |
1584 |
2095 |
1585 --if picking up a health crate |
2096 --if picking up a health crate, heal sabotage |
1586 if(GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]~=0 and GetGearType(gearUid) == gtCase and GetHealth(gearUid)~=0 and gearUid~=GLOBAL_CRATE_TEST and gearIsInCircle(CurrentHedgehog,GetX(gearUid), GetY(gearUid), 50, false)==true) |
2097 if(CS.SABOTAGE_HOGS[CurrentHedgehog]~=0 and GetGearType(gearUid) == gtCase and GetGearPos(gearUid)==2 and band(GetGearMessage(gearUid), gmDestroy) ~= 0) |
1587 then |
2098 then |
1588 GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=0 |
2099 CS.SABOTAGE_HOGS[CurrentHedgehog]=0 |
1589 end |
2100 end |
1590 |
2101 |
1591 --north american lipstick |
2102 --north american lipstick |
1592 if(GetGearType(gearUid)==gtSniperRifleShot ) |
2103 if(GetGearType(gearUid)==gtSniperRifleShot ) |
1593 then |
2104 then |
1594 GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=false |
2105 CS.NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=false |
1595 if(GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER==2) |
2106 if(CS.NORTH_AMERICAN_SPECIAL_SNIPER==2) |
1596 then |
2107 then |
1597 GLOBAL_TEMP_VALUE=gearUid |
2108 CS.TEMP_VALUE=gearUid |
1598 runOnGears(NorthAmericaSpecialSniper) |
2109 runOnGears(NorthAmericaSpecialSniper) |
1599 end |
2110 end |
1600 --north american eagle eye |
2111 --north american eagle eye |
1601 elseif(GetGearType(gearUid)==gtShotgunShot and GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN==true) |
2112 elseif(GetGearType(gearUid)==gtShotgunShot and CS.NORTH_AMERICAN_SPECIAL_SHOTGUN==true) |
1602 then |
2113 then |
1603 SetGearPosition(CurrentHedgehog, GetX(gearUid), GetY(gearUid)+7) |
2114 SetGearPosition(CurrentHedgehog, GetX(gearUid), GetY(gearUid)+7) |
1604 PlaySound(sndWarp) |
2115 PlaySound(sndWarp) |
1605 --south american special |
2116 --south american special |
1606 elseif(GetGearType(gearUid)==gtGasBomb and GLOBAL_SOUTH_AMERICAN_SPECIAL == true) |
2117 elseif(GetGearType(gearUid)==gtGasBomb and CS.SOUTH_AMERICAN_SPECIAL == true) |
1607 then |
2118 then |
1608 GLOBAL_TEMP_VALUE=gearUid |
2119 if band(GetState(gearUid), gstDrowning) == 0 then |
1609 runOnGears(SouthAmericaSpecialCheeseExplosion) |
2120 CS.TEMP_VALUE=gearUid |
1610 AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false) |
2121 runOnGears(SouthAmericaSpecialCheeseExplosion) |
|
2122 AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false) |
|
2123 end |
1611 |
2124 |
1612 --asian special |
2125 --asian special |
1613 elseif(GetGearType(gearUid)==gtSnowball and GetGearMessage(gearUid)==1) |
2126 elseif(GetGearType(gearUid)==gtSnowball and GetGearMessage(gearUid)==1) |
1614 then |
2127 then |
1615 AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 22) |
2128 AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 22) |
1616 |
2129 |
1617 --europe special |
2130 --europe special |
1618 elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==2) |
2131 elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==2) |
1619 then |
2132 then |
1620 GLOBAL_TEMP_VALUE=gearUid |
2133 if band(GetState(gearUid), gstDrowning) == 0 then |
1621 runOnGears(EuropeSpecialMolotovHit) |
2134 CS.TEMP_VALUE=gearUid |
1622 VisualExplosion(100,GetX(gearUid), GetY(gearUid),vgtSmokeWhite,vgtSmokeWhite) |
2135 runOnGears(EuropeSpecialMolotovHit) |
1623 AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false) |
2136 VisualExplosion(100,GetX(gearUid), GetY(gearUid),vgtSmokeWhite,vgtSmokeWhite) |
1624 PlaySound(sndGraveImpact) |
2137 AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false) |
|
2138 PlaySound(sndGraveImpact) |
|
2139 end |
1625 --australian special |
2140 --australian special |
1626 elseif(GetGearType(gearUid)==gtBall and GetGearMessage(gearUid)==3) |
2141 elseif(GetGearType(gearUid)==gtBall and GetGearMessage(gearUid)==3) |
1627 then |
2142 then |
1628 SpawnRandomCrate(GetX(gearUid), GetY(gearUid)) |
2143 SpawnRandomCrate(GetX(gearUid), GetY(gearUid)) |
1629 |
2144 |
1630 --asia (using para) |
2145 --asia (using para) |
1631 elseif(GetGearType(gearUid)==gtParachute) |
2146 elseif(GetGearType(gearUid)==gtParachute) |
1632 then |
2147 then |
1633 GLOBAL_PARACHUTE_IS_ON=false |
2148 CS.PARACHUTE_IS_ON=false |
1634 elseif(GetGearType(gearUid)==gtSwitcher) |
2149 elseif(GetGearType(gearUid)==gtSwitcher) |
1635 then |
2150 then |
1636 GLOBAL_SWITCH_HOG_IS_ON=false |
2151 CS.SWITCH_HOG_IS_ON=false |
1637 end |
2152 end |
1638 end |
2153 end |
1639 |
2154 |
1640 --[[ |
|
1641 sources (populations & area): |
|
1642 Own calculations from wikipedia. |
|
1643 Some are approximations. |
|
1644 ]] |
|
1645 |
|