7893
|
1 |
--kolla stavning
|
|
2 |
--[[
|
|
3 |
-fixed so you cant be sabotaged on your selecting continent turn
|
|
4 |
-moved translations to default locale file.
|
|
5 |
|
|
6 |
-NA
|
|
7 |
-moved lipstick bullet and pinata bullet to sniperrifle - pinatabullet deals ~23 on direct hit
|
|
8 |
-added eagle eye on shotgun (teleport)
|
|
9 |
-SA
|
|
10 |
-reduced duration on birdy from 2 to 1
|
|
11 |
-reduced duration on bee from 2 to 1
|
|
12 |
-fixed anno 1032
|
|
13 |
-reduced donut ring with 25% on anno 1032
|
|
14 |
-reduced push power
|
|
15 |
-reduced birdy from unlimited to 5
|
|
16 |
-unlimited bees
|
|
17 |
-EU
|
|
18 |
-increased jetpack from 2 to 3
|
|
19 |
added medicine on molotov
|
|
20 |
-AF
|
|
21 |
-fixed Hedgehog projectile
|
|
22 |
-reduced drillstrike from 2 to 1
|
|
23 |
-increased sticky bomb from 6 to 7
|
|
24 |
-AS
|
|
25 |
-reduced damage on parabomb from 27 to 22
|
|
26 |
-increased duration on hellish from 4 to 5
|
|
27 |
-per round limit on rope to 3
|
|
28 |
-AUS
|
|
29 |
-fixed baseballbat (mine) range and awareness
|
|
30 |
-AN
|
|
31 |
-reduced teleport from 3 to 2
|
|
32 |
-changed portalgun so you will only be able to use it 1s per turn
|
|
33 |
-KER
|
|
34 |
-reduced damage on sabotage from 40% to 0%
|
|
35 |
-renamed sabotage so it will sabotage all hogs in the circle + fire up a flare (bomb) + more bombs depending on the amount of hogs
|
|
36 |
-increased range on flare (sabotage) with 50%
|
|
37 |
-changed scream of walrus so it will deal 20 dmg and 10% of your hogs health
|
|
38 |
-sabotage will now visually "boil"
|
|
39 |
-added 4 freezers
|
|
40 |
-ZE
|
|
41 |
-fixed random system alot.
|
|
42 |
-you will get 3-1 weapons
|
|
43 |
-you can now watch your weapon under your turn
|
|
44 |
]]
|
|
45 |
|
|
46 |
--Based on Hadashi:s idea, then largely modified
|
|
47 |
--Made By Vatten 2012
|
|
48 |
|
|
49 |
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
|
|
50 |
loadfile(GetDataPath() .. "Scripts/Utils.lua")()
|
|
51 |
loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
|
|
52 |
|
|
53 |
--0.9.17
|
|
54 |
--[[
|
|
55 |
function div(val1,val2)
|
|
56 |
return val1/val2
|
|
57 |
end
|
|
58 |
|
|
59 |
function ddiv(val1,val2)
|
|
60 |
return div(val1*100,val2)*0.01
|
|
61 |
end
|
|
62 |
]]
|
|
63 |
|
|
64 |
function int_sqrt(num)
|
|
65 |
temp=num
|
|
66 |
while(temp*temp-div(temp,2)>num)
|
|
67 |
do
|
|
68 |
temp=div((temp+div(num,temp)),2)
|
|
69 |
end
|
|
70 |
return math.abs(temp)
|
|
71 |
end
|
|
72 |
|
|
73 |
function hypotenusa(xx,yy)
|
|
74 |
--return math.abs(yy)/math.sin(math.atan(math.abs(yy)/math.abs(xx)))
|
|
75 |
--AddCaption(int_sqrt((xx^2)+(yy^2)))
|
|
76 |
return int_sqrt((xx^2)+(yy^2))
|
|
77 |
end
|
|
78 |
|
|
79 |
local teams_ok = {}
|
|
80 |
local wepcode_teams={}
|
|
81 |
local swapweps=false
|
|
82 |
|
|
83 |
--run when game starts on real
|
|
84 |
local australianSpecial=false
|
|
85 |
local africanSpecial=0
|
|
86 |
local africaspecial2=0
|
|
87 |
local asianSpecial=false
|
|
88 |
local samericanSpecial=false
|
|
89 |
local namericanSpecial=1
|
|
90 |
local sniper_s_in_use=false
|
|
91 |
local kergulenSpecial=1
|
|
92 |
local shotgun_s=false
|
|
93 |
local europe_s=0
|
|
94 |
|
|
95 |
local austmine=nil
|
|
96 |
local inpara=false
|
|
97 |
local asianflame=0
|
|
98 |
|
|
99 |
local temp_val=0
|
|
100 |
|
|
101 |
--för sabotage
|
|
102 |
local disallowattack=0
|
|
103 |
local disallowleft=true
|
|
104 |
local disable_moving={}
|
|
105 |
|
|
106 |
--skall bytas till för alla teams
|
|
107 |
local continent = {}
|
|
108 |
|
|
109 |
local weapontexts = {
|
|
110 |
loc("Green lipstick bullet: [Is poisonous]"),
|
|
111 |
loc("Piñata bullet: [Contains some sweet candy!]"),
|
|
112 |
loc("Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"),
|
|
113 |
loc("Dust storm: [Deals 20 damage to all enemies in the circle]"),
|
|
114 |
loc("Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"),
|
|
115 |
loc("Drop a bomb: [drop some heroic wind that will turn into a bomb on impact]"),
|
|
116 |
loc("Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"),
|
|
117 |
loc("Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"),
|
|
118 |
loc("Flare: [fire up some bombs depending on hogs depending on hogs in the circle"),
|
|
119 |
loc("Lonely Cries: [Rise the water if no hog is in the circle and deal 1 damage to all hogs]"),
|
|
120 |
loc("Hedgehog projectile: [fire your hog like a Sticky Bomb]"),
|
|
121 |
loc("Napalm rocket: [Fire a bomb with napalm!]"),
|
|
122 |
loc("Eagle Eye: [Blink to the impact ~ one shot]"),
|
|
123 |
loc("Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"),
|
|
124 |
loc("Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]")
|
|
125 |
}
|
|
126 |
|
|
127 |
local weaponsets =
|
|
128 |
{
|
|
129 |
{loc("North America"),"Area: 24,709,000 km2, Population: 528,720,588",loc("Special Weapons:").."|"..loc("Shotgun")..": "..weapontexts[13].."|"..loc("Sniper Rifle")..": "..weapontexts[1].."|"..loc("Sniper Rifle")..": "..weapontexts[2],amSniperRifle,
|
|
130 |
{{amShotgun,100},{amDEagle,100},{amLaserSight,4},{amSniperRifle,100},{amCake,1},{amAirAttack,3},{amSwitch,6}}},
|
|
131 |
|
|
132 |
{loc("South America"),"Area: 17,840,000 km2, Population: 387,489,196 ",loc("Special Weapons:").."|"..loc("GasBomb")..": "..weapontexts[3],amGasBomb,
|
|
133 |
{{amBirdy,5},{amHellishBomb,1},{amBee,100},{amWhip,100},{amGasBomb,100},{amFlamethrower,100},{amNapalm,2},{amExtraDamage,3}}},
|
|
134 |
|
|
135 |
{loc("Europe"),"Area: 10,180,000 km2, Population: 739,165,030",loc("Special Weapons:").."|"..loc("Molotov")..": "..weapontexts[14],amBazooka,
|
|
136 |
{{amBazooka,100},{amGrenade,100},{amMortar,100},{amClusterBomb,5},{amMolotov,5},{amVampiric,4},{amPiano,1},{amResurrector,2},{amJetpack,2}}},
|
|
137 |
|
|
138 |
{loc("Africa"),"Area: 30,221,532 km2, Population: 1,032,532,974",loc("Special Weapons:").."|"..loc("Seduction")..": "..weapontexts[4].."|"..loc("Sticky Mine")..": "..weapontexts[11].."|"..loc("Sticky Mine")..": "..weapontexts[12],amSMine,
|
|
139 |
{{amSMine,6},{amWatermelon,1},{amDrillStrike,1},{amExtraTime,2},{amDrill,100},{amLandGun,3},{amSeduction,100}}},
|
|
140 |
|
|
141 |
{loc("Asia"),"Area: 44,579,000 km2, Population: 3,879,000,000",loc("- Will refresh Rope each turn to 3.").."|"..loc("Special Weapons:").."|"..loc("Parachute")..": "..weapontexts[6],amRope,
|
|
142 |
{{amKamikaze,4},{amRope,100},{amFirePunch,100},{amParachute,1},{amKnife,3}}},
|
|
143 |
|
|
144 |
{loc("Australia"),"Area: 8,468,300 km2, Population: 31,260,000",loc("Special Weapons:").."|"..loc("Baseballbat")..": "..weapontexts[5],amBaseballBat,
|
|
145 |
{{amBaseballBat,100},{amMine,100},{amLowGravity,6},{amBlowTorch,100},{amRCPlane,2},{amTardis,100}}},
|
|
146 |
|
|
147 |
{loc("Antarctica"),"Area: 14,000,000 km2, Population: ~1,000",loc("- Will refresh portalgun each turn."),amTeleport,
|
|
148 |
{{amSnowball,4},{amTeleport,2},{amInvulnerable,6},{amPickHammer,100},{amSineGun,6},{amGirder,4},{amPortalGun,1},{amDynamite,1}}},
|
|
149 |
|
|
150 |
{loc("Kerguelen"),"Area: 1,100,000 km2, Population: ~70",loc("Special Weapons:").."|"..loc("Structure")..": "..weapontexts[7].."|"..loc("Structure")..": "..weapontexts[8].." ("..loc("Duration")..": 2)|"..loc("Structure")..": "..weapontexts[9].."|"..loc("Structure")..": "..weapontexts[10],amStructure,
|
|
151 |
{{amHammer,100},{amMineStrike,2},{amBallgun,1},{amStructure,100},{amIceGun,4}}},
|
|
152 |
--{{amHammer,100},{amMineStrike,2},{amBallgun,1},{amStructure,100}}},
|
|
153 |
|
|
154 |
{loc("Zealandia"),"Area: 3,500,000 km2, Population: 4,650,000",loc("- Will Get 1-3 random weapons"),amInvulnerable,
|
|
155 |
{{amBazooka,1},{amBlowTorch,1},{amSwitch,1}}}
|
|
156 |
}
|
|
157 |
|
|
158 |
--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)
|
|
159 |
local weapons_dmg = {
|
|
160 |
{amKamikaze, 0, 1, 0, 1, 0},
|
|
161 |
{amSineGun, 0, 1, 0, 1, 1},
|
|
162 |
{amBazooka, 0, 1, 0, 1, 0},
|
|
163 |
{amMineStrike, 0, 1, 5, 1, 2},
|
|
164 |
{amGrenade, 0, 1, 0, 1, 0},
|
|
165 |
{amPiano, 0, 1, 5, 1, 1},
|
|
166 |
{amClusterBomb, 0, 1, 0, 1, 0},
|
|
167 |
{amBee, 0, 1, 1, 1, 0},
|
|
168 |
{amShotgun, 0, 0, 0, 1, 1},
|
|
169 |
{amMine, 0, 1, 0, 1, 0},
|
|
170 |
{amSniperRifle, 0, 1, 0, 1, 1},
|
|
171 |
{amDEagle, 0, 1, 0, 1, 0},
|
|
172 |
{amDynamite, 0, 1, 0, 1, 1},
|
|
173 |
{amFirePunch, 0, 1, 0, 1, 0},
|
|
174 |
{amHellishBomb, 0, 1, 5, 1, 2},
|
|
175 |
{amWhip, 0, 1, 0, 1, 0},
|
|
176 |
{amNapalm, 0, 1, 5, 1, 2},
|
|
177 |
{amPickHammer, 0, 1, 0, 1, 0},
|
|
178 |
{amBaseballBat, 0, 1, 0, 1, 1},
|
|
179 |
{amMortar, 0, 1, 0, 1, 0},
|
|
180 |
{amCake, 0, 1, 4, 1, 2},
|
|
181 |
{amSeduction, 0, 0, 0, 1, 0},
|
|
182 |
{amWatermelon, 0, 1, 5, 1, 2},
|
|
183 |
{amDrill, 0, 1, 0, 1, 0},
|
|
184 |
{amBallgun, 0, 1, 5, 1, 2},
|
|
185 |
{amMolotov, 0, 1, 0, 1, 0},
|
|
186 |
{amBirdy, 0, 1, 1, 1, 1},
|
|
187 |
{amBlowTorch, 0, 1, 0, 1, 0},
|
|
188 |
{amRCPlane, 0, 1, 5, 1, 2},
|
|
189 |
{amGasBomb, 0, 0, 0, 1, 0},
|
|
190 |
{amAirAttack, 0, 1, 4, 1, 1},
|
|
191 |
{amFlamethrower, 0, 1, 0, 1, 0},
|
|
192 |
{amSMine, 0, 1, 0, 1, 1},
|
|
193 |
{amHammer, 0, 1, 0, 1, 0},
|
|
194 |
{amDrillStrike, 0, 1, 4, 1, 2},
|
|
195 |
{amSnowball, 0, 1, 0, 1, 0},
|
|
196 |
{amStructure, 0, 0, 0, 1, 1}
|
|
197 |
}
|
|
198 |
local weapons_supp = {
|
|
199 |
{amParachute, 0, 1, 0, 1, 0},
|
|
200 |
{amGirder, 0, 1, 0, 1, 0},
|
|
201 |
{amSwitch, 0, 1, 0, 1, 0},
|
|
202 |
{amLowGravity, 0, 1, 0, 1, 0},
|
|
203 |
{amExtraDamage, 0, 1, 2, 1, 0},
|
|
204 |
{amRope, 0, 1, 0, 1, 1},
|
|
205 |
{amInvulnerable, 0, 1, 0, 1, 0},
|
|
206 |
{amExtraTime, 0, 1, 0, 1, 0},
|
|
207 |
{amLaserSight, 0, 1, 0, 1, 0},
|
|
208 |
{amVampiric, 0, 1, 0, 1, 0},
|
|
209 |
{amJetpack, 0, 1, 0, 1, 1},
|
|
210 |
{amPortalGun, 0, 1, 3, 1, 1},
|
|
211 |
{amResurrector, 0, 1, 3, 1, 0},
|
|
212 |
{amTeleport, 0, 1, 0, 1, 0},
|
|
213 |
{amLandGun, 0, 1, 0, 1, 0},
|
|
214 |
{amTardis, 0, 1, 0, 1, 0},
|
|
215 |
{amIceGun, 0, 1, 0, 1, 0},
|
|
216 |
{amKnife, 0, 1, 0, 1, 0}
|
|
217 |
}
|
|
218 |
|
|
219 |
function validate_weapon(hog,weapon,amount)
|
|
220 |
if(MapHasBorder() == false or (MapHasBorder() == true and weapon ~= amAirAttack and weapon ~= amMineStrike and weapon ~= amNapalm and weapon ~= amDrillStrike and weapon ~= amPiano))
|
|
221 |
then
|
|
222 |
AddAmmo(hog, weapon,amount)
|
|
223 |
end
|
|
224 |
end
|
|
225 |
|
|
226 |
--reset all weapons for a team
|
|
227 |
function cleanweps(hog)
|
|
228 |
|
|
229 |
local i=1
|
|
230 |
--+1 for skip
|
|
231 |
while(i<=table.getn(weapons_supp)+table.getn(weapons_dmg)+1)
|
|
232 |
do
|
|
233 |
AddAmmo(hog,i,0)
|
|
234 |
i=i+1
|
|
235 |
end
|
|
236 |
|
|
237 |
AddAmmo(hog,amSkip,100)
|
|
238 |
end
|
|
239 |
|
|
240 |
function load_weaponset(hog, num)
|
|
241 |
for v,w in pairs(weaponsets[num][5])
|
|
242 |
do
|
|
243 |
validate_weapon(hog, w[1],w[2])
|
|
244 |
end
|
|
245 |
end
|
|
246 |
|
|
247 |
function load_continent_selection(hog)
|
|
248 |
for v,w in pairs(weaponsets)
|
|
249 |
do
|
|
250 |
validate_weapon(hog, weaponsets[v][4],1)
|
|
251 |
end
|
|
252 |
AddAmmo(hog,amSwitch) --random continent
|
|
253 |
end
|
|
254 |
|
|
255 |
function show_continent_info(continent,time)
|
|
256 |
local ns=false
|
|
257 |
if(time==-1)
|
|
258 |
then
|
|
259 |
time=0
|
|
260 |
ns=true
|
|
261 |
end
|
|
262 |
ShowMission(weaponsets[continent][1],weaponsets[continent][2],weaponsets[continent][3], -weaponsets[continent][4], time)
|
|
263 |
if(ns)
|
|
264 |
then
|
|
265 |
HideMission()
|
|
266 |
end
|
|
267 |
end
|
|
268 |
|
|
269 |
function visual_gear_explosion(range,xpos,ypos,gear1,gear2)
|
|
270 |
local degr=0
|
|
271 |
local lap=30
|
|
272 |
while(lap<range)
|
|
273 |
do
|
|
274 |
while(degr < 6.2831)
|
|
275 |
do
|
|
276 |
AddVisualGear(xpos+math.cos(degr+0.1)*(lap+5), ypos+math.sin(degr+0.1)*(lap+5), gear1, 0, false)
|
|
277 |
if(gear2~=false)
|
|
278 |
then
|
|
279 |
AddVisualGear(xpos+math.cos(degr)*lap, ypos+math.sin(degr)*lap, gear2, 0, false)
|
|
280 |
end
|
|
281 |
degr=degr+((3.1415*3)*0.125) --1/8 = 0.125
|
|
282 |
end
|
|
283 |
lap=lap+30
|
|
284 |
degr=degr-6.2831
|
|
285 |
end
|
|
286 |
end
|
|
287 |
|
|
288 |
--zealandia
|
|
289 |
function get_random_weapon(hog)
|
|
290 |
local random_weapon = 0
|
|
291 |
local old_rand_weap = 0
|
|
292 |
local rand_weaponset_power = 0
|
|
293 |
|
|
294 |
if(continent[GetHogTeamName(hog)]==9 and (getTeamValue(GetHogTeamName(hog), "rand-done-turn")==false or getTeamValue(GetHogTeamName(hog), "rand-done-turn")==nil))
|
|
295 |
then
|
|
296 |
cleanweps(hog)
|
|
297 |
|
|
298 |
random_weapon = GetRandom(table.getn(weapons_dmg))+1
|
|
299 |
while(weapons_dmg[random_weapon][4]>TotalRounds)
|
|
300 |
do
|
|
301 |
if(random_weapon>=table.getn(weapons_dmg))
|
|
302 |
then
|
|
303 |
random_weapon=0
|
|
304 |
end
|
|
305 |
random_weapon = random_weapon+1
|
|
306 |
end
|
|
307 |
validate_weapon(hog, weapons_dmg[random_weapon][1],1)
|
|
308 |
rand_weaponset_power=weapons_dmg[random_weapon][6]
|
|
309 |
old_rand_weap = random_weapon
|
|
310 |
|
|
311 |
if(rand_weaponset_power <2)
|
|
312 |
then
|
|
313 |
random_weapon = GetRandom(table.getn(weapons_supp))+1
|
|
314 |
while(weapons_supp[random_weapon][4]>TotalRounds or rand_weaponset_power+weapons_supp[random_weapon][6]>2)
|
|
315 |
do
|
|
316 |
if(random_weapon>=table.getn(weapons_supp))
|
|
317 |
then
|
|
318 |
random_weapon=0
|
|
319 |
end
|
|
320 |
random_weapon = random_weapon+1
|
|
321 |
end
|
|
322 |
validate_weapon(hog, weapons_supp[random_weapon][1],1)
|
|
323 |
rand_weaponset_power=rand_weaponset_power+weapons_supp[random_weapon][6]
|
|
324 |
end
|
|
325 |
--check again if the power is enough
|
|
326 |
if(rand_weaponset_power <1)
|
|
327 |
then
|
|
328 |
random_weapon = GetRandom(table.getn(weapons_dmg))+1
|
|
329 |
while(weapons_dmg[random_weapon][4]>TotalRounds or old_rand_weap == random_weapon or weapons_dmg[random_weapon][6]>0)
|
|
330 |
do
|
|
331 |
if(random_weapon>=table.getn(weapons_dmg))
|
|
332 |
then
|
|
333 |
random_weapon=0
|
|
334 |
end
|
|
335 |
random_weapon = random_weapon+1
|
|
336 |
end
|
|
337 |
validate_weapon(hog, weapons_dmg[random_weapon][1],1)
|
|
338 |
end
|
|
339 |
|
|
340 |
setTeamValue(GetHogTeamName(hog), "rand-done-turn", true)
|
|
341 |
|
|
342 |
if(GetHogTeamName(hog)==GetHogTeamName(CurrentHedgehog))
|
|
343 |
then
|
|
344 |
temp_val=false
|
|
345 |
end
|
|
346 |
end
|
|
347 |
end
|
|
348 |
|
|
349 |
|
|
350 |
function setweapons(skipafter)
|
|
351 |
|
|
352 |
cleanweps(CurrentHedgehog)
|
|
353 |
load_weaponset(CurrentHedgehog,continent[GetHogTeamName(CurrentHedgehog)])
|
|
354 |
if(skipafter==true)
|
|
355 |
then
|
|
356 |
ParseCommand("setweap " .. string.char(amSkip))
|
|
357 |
end
|
|
358 |
|
|
359 |
--AddCaption(loc("You have recieved weapons from ") .. weaponsets[continent[GetHogTeamName(CurrentHedgehog)]][1] .. "!")
|
|
360 |
show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],0)
|
|
361 |
end
|
|
362 |
|
|
363 |
function show_damage_tag(hog,damage)
|
|
364 |
healthtag=AddVisualGear(GetX(hog), GetY(hog), vgtHealthTag, damage, false)
|
|
365 |
v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 = GetVisualGearValues(healthtag)
|
|
366 |
SetVisualGearValues(healthtag, v1, v2, v3, v4, v5, v6, v7, v8, v9, GetClanColor(GetHogClan(hog)))
|
|
367 |
end
|
|
368 |
|
|
369 |
function fire_gear(hedgehog,geartype,vx,vy,timer)
|
|
370 |
return AddGear(div((GetGearRadius(hedgehog)*2*vx),hypotenusa(vx,vy))+GetX(hedgehog), div((GetGearRadius(hedgehog)*2*vy),hypotenusa(vx,vy))+GetY(hedgehog), geartype, 0, vx, vy, timer)
|
|
371 |
end
|
|
372 |
|
|
373 |
--==========================run throw all hog/gear weapons ==========================
|
|
374 |
function weapon_aust_check(hog)
|
|
375 |
if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 50, false)==true and hog ~= CurrentHedgehog)
|
|
376 |
then
|
|
377 |
temp_val=1
|
|
378 |
end
|
|
379 |
end
|
|
380 |
|
|
381 |
function weapon_duststorm(hog)
|
|
382 |
local dmg=20
|
|
383 |
if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 250, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
|
|
384 |
then
|
|
385 |
if(GetHealth(hog) > dmg)
|
|
386 |
then
|
|
387 |
SetHealth(hog, GetHealth(hog)-dmg)
|
|
388 |
else
|
|
389 |
SetHealth(hog, 0)
|
|
390 |
end
|
|
391 |
show_damage_tag(hog,dmg)
|
|
392 |
end
|
|
393 |
end
|
|
394 |
|
|
395 |
function weapon_scream_walrus(hog)
|
|
396 |
if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 120, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
|
|
397 |
then
|
|
398 |
if(GetHealth(hog)>(20+GetHealth(CurrentHedgehog)*0.1))
|
|
399 |
then
|
|
400 |
SetHealth(hog, GetHealth(hog)-(20+GetHealth(CurrentHedgehog)*0.1))
|
|
401 |
temp_val=temp_val+10+GetHealth(CurrentHedgehog)*0.05
|
|
402 |
else
|
|
403 |
SetHealth(hog, 0)
|
|
404 |
temp_val=temp_val+(GetHealth(hog)*0.5)+(GetHealth(CurrentHedgehog)*0.05)
|
|
405 |
end
|
|
406 |
show_damage_tag(hog,(20+GetHealth(CurrentHedgehog)*0.1))
|
|
407 |
AddVisualGear(GetX(hog), GetY(hog), vgtExplosion, 0, false)
|
|
408 |
AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
|
|
409 |
end
|
|
410 |
end
|
|
411 |
|
|
412 |
function weapon_swap_kerg(hog)
|
|
413 |
if(kergulenSpecial ~= -1 and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 450, false))
|
|
414 |
then
|
|
415 |
local thisX=GetX(CurrentHedgehog)
|
|
416 |
local thisY=GetY(CurrentHedgehog)
|
|
417 |
SetGearPosition(CurrentHedgehog, GetX(hog), GetY(hog))
|
|
418 |
SetGearPosition(hog, thisX, thisY)
|
|
419 |
kergulenSpecial=-1
|
|
420 |
end
|
|
421 |
end
|
|
422 |
|
|
423 |
function weapon_flare(hog)
|
|
424 |
if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 45, false))
|
|
425 |
then
|
|
426 |
if(GetX(hog)<=GetX(CurrentHedgehog))
|
|
427 |
then
|
|
428 |
dirker=1
|
|
429 |
else
|
|
430 |
dirker=-1
|
|
431 |
end
|
|
432 |
AddVisualGear(GetX(hog), GetY(hog), vgtFire, 0, false)
|
|
433 |
SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog), GetY(CurrentHedgehog)-5)
|
|
434 |
SetGearVelocity(CurrentHedgehog, 100000*dirker, -300000)
|
|
435 |
AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, -10000*dirker, -1000000, 35)
|
|
436 |
PlaySound(sndHellishImpact2)
|
|
437 |
end
|
|
438 |
end
|
|
439 |
|
|
440 |
function weapon_sabotage(hog)
|
|
441 |
if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 100, false))
|
|
442 |
then
|
|
443 |
disable_moving[hog]=true
|
|
444 |
AddGear(GetX(hog), GetY(hog), gtCluster, 0, 0, 0, 10)
|
|
445 |
PlaySound(sndNooo,hog)
|
|
446 |
end
|
|
447 |
end
|
|
448 |
|
|
449 |
function weapon_anno_south(hog)
|
|
450 |
local power_radius_outer=250
|
|
451 |
local power_radius_inner=40
|
|
452 |
local power_sa=6000
|
|
453 |
if(gearIsInCircle(hog,GetX(temp_val), GetY(temp_val), power_radius_outer, false) and gearIsInCircle(hog,GetX(temp_val), GetY(temp_val), power_radius_inner, false)==false)
|
|
454 |
then
|
|
455 |
if(hog == CurrentHedgehog)
|
|
456 |
then
|
|
457 |
SetState(CurrentHedgehog, gstMoving)
|
|
458 |
end
|
|
459 |
SetGearPosition(hog, GetX(hog),GetY(hog)-3)
|
|
460 |
SetGearVelocity(hog, div((power_radius_outer-hypotenusa(math.abs(GetX(hog)-GetX(temp_val)),math.abs(GetY(hog)-GetY(temp_val))))*power_sa*(GetX(hog)-GetX(temp_val)),power_radius_outer), div((power_radius_outer-hypotenusa(math.abs(GetX(hog)-GetX(temp_val)),math.abs(GetY(hog)-GetY(temp_val))))*power_sa*(GetY(hog)-GetY(temp_val)),power_radius_outer))
|
|
461 |
end
|
|
462 |
end
|
|
463 |
|
|
464 |
function weapon_cries_a(hog)
|
|
465 |
if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 500, false))
|
|
466 |
then
|
|
467 |
kergulenSpecial=-1
|
|
468 |
end
|
|
469 |
end
|
|
470 |
|
|
471 |
function weapon_cries_b(hog)
|
|
472 |
if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
|
|
473 |
then
|
|
474 |
SetHealth(hog, GetHealth(hog)-1)
|
|
475 |
show_damage_tag(hog,1)
|
|
476 |
AddVisualGear(GetX(hog), GetY(hog)-30, vgtEvilTrace, 0, false)
|
|
477 |
end
|
|
478 |
end
|
|
479 |
|
|
480 |
function weapon_lipstick(hog)
|
|
481 |
if(gearIsInCircle(temp_val,GetX(hog), GetY(hog), 20, false))
|
|
482 |
then
|
|
483 |
SetEffect(hog, hePoisoned, 1)
|
|
484 |
PlaySound(sndBump)
|
|
485 |
end
|
|
486 |
end
|
|
487 |
|
|
488 |
function weapon_health(hog)
|
|
489 |
if(gearIsInCircle(temp_val,GetX(hog), GetY(hog), 100, false))
|
|
490 |
then
|
|
491 |
SetHealth(hog, GetHealth(hog)+25)
|
|
492 |
SetEffect(hog, hePoisoned, false)
|
|
493 |
end
|
|
494 |
end
|
|
495 |
--============================================================================
|
|
496 |
|
|
497 |
--set each weapons settings
|
|
498 |
function onAmmoStoreInit()
|
|
499 |
|
|
500 |
SetAmmo(amSkip, 9, 0, 0, 0)
|
|
501 |
|
|
502 |
for v,w in pairs(weapons_dmg)
|
|
503 |
do
|
|
504 |
SetAmmo(w[1], w[2], w[3], w[4], w[5])
|
|
505 |
end
|
|
506 |
|
|
507 |
for v,w in pairs(weapons_supp)
|
|
508 |
do
|
|
509 |
SetAmmo(w[1], w[2], w[3], w[4], w[5])
|
|
510 |
end
|
|
511 |
end
|
|
512 |
|
|
513 |
function onGameStart()
|
|
514 |
trackTeams()
|
|
515 |
|
|
516 |
ShowMission(loc("Continental supplies").." 1.1a",loc("Let a Continent provide your weapons!"),
|
|
517 |
loc("- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease) on Skip|Some weapons have a second option. Find them with [switch/tab]"), -amLowGravity, 0)
|
|
518 |
end
|
|
519 |
|
|
520 |
--what happen when a turn starts
|
|
521 |
function onNewTurn()
|
|
522 |
|
|
523 |
australianSpecial=true
|
|
524 |
asianSpecial=false
|
|
525 |
austmine=nil
|
|
526 |
africanSpecial=0
|
|
527 |
samericanSpecial=false
|
|
528 |
africaspecial2=0
|
|
529 |
kergulenSpecial=1
|
|
530 |
namericanSpecial=1
|
|
531 |
asianflame=0
|
|
532 |
shotgun_s=false
|
|
533 |
sniper_s_in_use=false
|
|
534 |
europe_s=0
|
|
535 |
|
|
536 |
temp_val=0
|
|
537 |
|
|
538 |
disallowattack=0
|
|
539 |
disallowleft=true
|
|
540 |
--when all hogs are "placed"
|
|
541 |
|
|
542 |
if(GetCurAmmoType()~=amTeleport)
|
|
543 |
then
|
|
544 |
--will run once when the game really starts (after placing hogs and so on
|
|
545 |
if(teams_ok[GetHogTeamName(CurrentHedgehog)] == nil)
|
|
546 |
then
|
|
547 |
disable_moving[CurrentHedgehog]=false
|
|
548 |
AddCaption("["..loc("Select continent!").."]")
|
|
549 |
load_continent_selection(CurrentHedgehog)
|
|
550 |
continent[GetHogTeamName(CurrentHedgehog)]=0
|
|
551 |
swapweps=true
|
|
552 |
teams_ok[GetHogTeamName(CurrentHedgehog)] = 2
|
|
553 |
else
|
|
554 |
swapweps=false
|
|
555 |
if(continent[GetHogTeamName(CurrentHedgehog)]==0)
|
|
556 |
then
|
|
557 |
continent[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.getn(weaponsets))+1
|
|
558 |
setweapons(true)
|
|
559 |
end
|
|
560 |
show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],-1)
|
|
561 |
end
|
|
562 |
end
|
|
563 |
|
|
564 |
if(continent[GetHogTeamName(CurrentHedgehog)]==7)
|
|
565 |
then
|
|
566 |
AddAmmo(CurrentHedgehog,amPortalGun,0)
|
|
567 |
AddAmmo(CurrentHedgehog,amPortalGun,1)
|
|
568 |
elseif(continent[GetHogTeamName(CurrentHedgehog)]==5)
|
|
569 |
then
|
|
570 |
AddAmmo(CurrentHedgehog,amParachute,0)
|
|
571 |
AddAmmo(CurrentHedgehog,amParachute,1)
|
|
572 |
end
|
|
573 |
|
|
574 |
temp_val=true
|
|
575 |
runOnHogs(get_random_weapon)
|
|
576 |
|
|
577 |
if(temp_val==true and continent[GetHogTeamName(CurrentHedgehog)]==9 and getTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn")==true)
|
|
578 |
then
|
|
579 |
setTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn", false)
|
|
580 |
end
|
|
581 |
|
|
582 |
end
|
|
583 |
|
|
584 |
--what happens when you press "tab" (common button)
|
|
585 |
function onSwitch()
|
|
586 |
|
|
587 |
--place mine (australia)
|
|
588 |
if(GetCurAmmoType() == amBaseballBat and australianSpecial==true)
|
|
589 |
then
|
|
590 |
temp_val=0
|
|
591 |
runOnHogs(weapon_aust_check)
|
|
592 |
|
|
593 |
if(temp_val==0)
|
|
594 |
then
|
|
595 |
austmine=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+5, gtMine, 0, 0, 0, 0)
|
|
596 |
SetHealth(austmine, 100)
|
|
597 |
SetTimer(austmine, 1000)
|
|
598 |
australianSpecial=false
|
|
599 |
swapweps=false
|
|
600 |
else
|
|
601 |
PlaySound(sndDenied)
|
|
602 |
end
|
|
603 |
end
|
|
604 |
|
|
605 |
--Asian special
|
|
606 |
if(asianSpecial==false and inpara~=false)
|
|
607 |
then
|
|
608 |
asiabomb=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+3, gtSnowball, 0, 0, 0, 0)
|
|
609 |
SetGearMessage(asiabomb, 1)
|
|
610 |
asianSpecial=true
|
|
611 |
swapweps=false
|
|
612 |
end
|
|
613 |
|
|
614 |
--africa
|
|
615 |
if(GetCurAmmoType() == amSeduction)
|
|
616 |
then
|
|
617 |
if(africanSpecial==0)
|
|
618 |
then
|
|
619 |
africanSpecial = 1
|
|
620 |
AddCaption(weapontexts[4])
|
|
621 |
else
|
|
622 |
africanSpecial = 0
|
|
623 |
AddCaption(loc("NORMAL"))
|
|
624 |
end
|
|
625 |
end
|
|
626 |
--south america
|
|
627 |
if(GetCurAmmoType() == amGasBomb)
|
|
628 |
then
|
|
629 |
if(samericanSpecial==false)
|
|
630 |
then
|
|
631 |
samericanSpecial = true
|
|
632 |
AddCaption(weapontexts[3])
|
|
633 |
else
|
|
634 |
samericanSpecial = false
|
|
635 |
AddCaption(loc("NORMAL"))
|
|
636 |
end
|
|
637 |
end
|
|
638 |
--africa
|
|
639 |
if(GetCurAmmoType() == amSMine)
|
|
640 |
then
|
|
641 |
if(africaspecial2==0)
|
|
642 |
then
|
|
643 |
africaspecial2 = 1
|
|
644 |
AddCaption(weapontexts[11])
|
|
645 |
elseif(africaspecial2 == 1)
|
|
646 |
then
|
|
647 |
africaspecial2 = 2
|
|
648 |
AddCaption(weapontexts[12])
|
|
649 |
elseif(africaspecial2 == 2)
|
|
650 |
then
|
|
651 |
africaspecial2 = 0
|
|
652 |
AddCaption(loc("NORMAL"))
|
|
653 |
end
|
|
654 |
end
|
|
655 |
|
|
656 |
--north america
|
|
657 |
if(GetCurAmmoType() == amSniperRifle and sniper_s_in_use==false)
|
|
658 |
then
|
|
659 |
if(namericanSpecial==3)
|
|
660 |
then
|
|
661 |
namericanSpecial = 1
|
|
662 |
AddCaption(loc("NORMAL"))
|
|
663 |
elseif(namericanSpecial==1)
|
|
664 |
then
|
|
665 |
namericanSpecial = 2
|
|
666 |
AddCaption("#"..weapontexts[1])
|
|
667 |
elseif(namericanSpecial==2)
|
|
668 |
then
|
|
669 |
namericanSpecial = 3
|
|
670 |
AddCaption("##"..weapontexts[2])
|
|
671 |
end
|
|
672 |
end
|
|
673 |
|
|
674 |
if(GetCurAmmoType() == amShotgun and shotgun_s~=nil)
|
|
675 |
then
|
|
676 |
if(shotgun_s==false)
|
|
677 |
then
|
|
678 |
shotgun_s = true
|
|
679 |
AddCaption(weapontexts[13])
|
|
680 |
else
|
|
681 |
shotgun_s = false
|
|
682 |
AddCaption(loc("NORMAL"))
|
|
683 |
end
|
|
684 |
end
|
|
685 |
|
|
686 |
if(GetCurAmmoType() == amMolotov)
|
|
687 |
then
|
|
688 |
if(europe_s==0)
|
|
689 |
then
|
|
690 |
europe_s = 1
|
|
691 |
AddCaption(weapontexts[14])
|
|
692 |
else
|
|
693 |
europe_s = 0
|
|
694 |
AddCaption(loc("NORMAL"))
|
|
695 |
end
|
|
696 |
end
|
|
697 |
|
|
698 |
if(swapweps==true and GetCurAmmoType() == amSkip)
|
|
699 |
then
|
|
700 |
continent[GetHogTeamName(CurrentHedgehog)]=continent[GetHogTeamName(CurrentHedgehog)]+1
|
|
701 |
|
|
702 |
if(continent[GetHogTeamName(CurrentHedgehog)]> table.getn(weaponsets))
|
|
703 |
then
|
|
704 |
continent[GetHogTeamName(CurrentHedgehog)]=1
|
|
705 |
end
|
|
706 |
setweapons(true)
|
|
707 |
end
|
|
708 |
|
|
709 |
if(GetCurAmmoType() == amStructure)
|
|
710 |
then
|
|
711 |
if(kergulenSpecial==5)
|
|
712 |
then
|
|
713 |
kergulenSpecial = 1
|
|
714 |
AddCaption("#"..weapontexts[7])
|
|
715 |
elseif(kergulenSpecial==1 and TotalRounds>=1)
|
|
716 |
then
|
|
717 |
kergulenSpecial = 2
|
|
718 |
AddCaption("##"..weapontexts[8])
|
|
719 |
elseif(kergulenSpecial==2 or (kergulenSpecial==1 and TotalRounds<1))
|
|
720 |
then
|
|
721 |
kergulenSpecial = 3
|
|
722 |
AddCaption("###"..weapontexts[9])
|
|
723 |
elseif(kergulenSpecial==3)
|
|
724 |
then
|
|
725 |
kergulenSpecial = 4
|
|
726 |
AddCaption("####"..weapontexts[10])
|
|
727 |
elseif(kergulenSpecial==4)
|
|
728 |
then
|
|
729 |
kergulenSpecial = 5
|
|
730 |
AddCaption("#####"..weapontexts[15])
|
|
731 |
end
|
|
732 |
end
|
|
733 |
end
|
|
734 |
|
|
735 |
function onPrecise()
|
|
736 |
if(swapweps==true and GetCurAmmoType() == amSkip)
|
|
737 |
then
|
|
738 |
continent[GetHogTeamName(CurrentHedgehog)]=continent[GetHogTeamName(CurrentHedgehog)]-1
|
|
739 |
|
|
740 |
if(continent[GetHogTeamName(CurrentHedgehog)]<=0)
|
|
741 |
then
|
|
742 |
continent[GetHogTeamName(CurrentHedgehog)]=9
|
|
743 |
end
|
|
744 |
setweapons(true)
|
|
745 |
end
|
|
746 |
end
|
|
747 |
|
|
748 |
function onSlot()
|
|
749 |
if(continent[GetHogTeamName(CurrentHedgehog)]==0) then
|
|
750 |
ParseCommand("setweap " .. string.char(amSkip))
|
|
751 |
end
|
|
752 |
end
|
|
753 |
|
|
754 |
function onGameTick20()
|
|
755 |
|
|
756 |
if(teams_ok[GetHogTeamName(CurrentHedgehog)] == 2)
|
|
757 |
then
|
|
758 |
if(GetCurAmmoType()~=amTeleport and swapweps==true and TurnTime-TurnTimeLeft>=100)
|
|
759 |
then
|
|
760 |
teams_ok[GetHogTeamName(CurrentHedgehog)] = true
|
|
761 |
ParseCommand("setweap " .. string.char(amSkip))
|
|
762 |
end
|
|
763 |
end
|
|
764 |
|
|
765 |
if(continent[GetHogTeamName(CurrentHedgehog)]==0)
|
|
766 |
then
|
|
767 |
if(GetCurAmmoType()==amSniperRifle) then
|
|
768 |
continent[GetHogTeamName(CurrentHedgehog)]=1
|
|
769 |
setweapons(false)
|
|
770 |
elseif(GetCurAmmoType()==amGasBomb) then
|
|
771 |
continent[GetHogTeamName(CurrentHedgehog)]=2
|
|
772 |
setweapons(false)
|
|
773 |
elseif(GetCurAmmoType()==amBazooka) then
|
|
774 |
continent[GetHogTeamName(CurrentHedgehog)]=3
|
|
775 |
setweapons(false)
|
|
776 |
elseif(GetCurAmmoType()==amSMine) then
|
|
777 |
continent[GetHogTeamName(CurrentHedgehog)]=4
|
|
778 |
setweapons(false)
|
|
779 |
elseif(GetCurAmmoType()==amRope) then
|
|
780 |
continent[GetHogTeamName(CurrentHedgehog)]=5
|
|
781 |
setweapons(false)
|
|
782 |
elseif(GetCurAmmoType()==amBaseballBat) then
|
|
783 |
continent[GetHogTeamName(CurrentHedgehog)]=6
|
|
784 |
setweapons(false)
|
|
785 |
elseif(GetCurAmmoType()==amTeleport) then
|
|
786 |
continent[GetHogTeamName(CurrentHedgehog)]=7
|
|
787 |
setweapons(false)
|
|
788 |
elseif(GetCurAmmoType()==amStructure) then
|
|
789 |
continent[GetHogTeamName(CurrentHedgehog)]=8
|
|
790 |
setweapons(false)
|
|
791 |
elseif(GetCurAmmoType()==amInvulnerable) then
|
|
792 |
continent[GetHogTeamName(CurrentHedgehog)]=9
|
|
793 |
setweapons(false)
|
|
794 |
elseif(GetCurAmmoType()==amSwitch) then
|
|
795 |
continent[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.getn(weaponsets))+1
|
|
796 |
setweapons(false)
|
|
797 |
end
|
|
798 |
end
|
|
799 |
|
|
800 |
if(kergulenSpecial ~= 0 and GetCurAmmoType() == amStructure)
|
|
801 |
then
|
|
802 |
if(kergulenSpecial == 1)
|
|
803 |
then
|
|
804 |
if(visualcircle==nil)
|
|
805 |
then
|
|
806 |
visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 120, false)
|
|
807 |
end
|
|
808 |
SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 120, 4, 0xff0000ee)
|
|
809 |
elseif(kergulenSpecial == 2)
|
|
810 |
then
|
|
811 |
if(visualcircle==nil)
|
|
812 |
then
|
|
813 |
visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 450, false)
|
|
814 |
end
|
|
815 |
SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 450, 3, 0xffff00ee)
|
|
816 |
elseif(kergulenSpecial == 3)
|
|
817 |
then
|
|
818 |
if(visualcircle==nil)
|
|
819 |
then
|
|
820 |
visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 45, false)
|
|
821 |
end
|
|
822 |
SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 45, 6, 0x00ff00ee)
|
|
823 |
elseif(kergulenSpecial == 4)
|
|
824 |
then
|
|
825 |
if(visualcircle==nil)
|
|
826 |
then
|
|
827 |
visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 500, false)
|
|
828 |
end
|
|
829 |
SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 1, 0x0000ffee)
|
|
830 |
elseif(kergulenSpecial == 5)
|
|
831 |
then
|
|
832 |
if(visualcircle==nil)
|
|
833 |
then
|
|
834 |
visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 100, false)
|
|
835 |
end
|
|
836 |
SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 100, 10, 0xeeeeeeee)
|
|
837 |
end
|
|
838 |
|
|
839 |
elseif(visualcircle~=nil)
|
|
840 |
then
|
|
841 |
DeleteVisualGear(visualcircle)
|
|
842 |
visualcircle=nil
|
|
843 |
end
|
|
844 |
|
|
845 |
if(disable_moving[CurrentHedgehog]==true)
|
|
846 |
then
|
|
847 |
|
|
848 |
if(TurnTimeLeft<=3000)
|
|
849 |
then
|
|
850 |
disable_moving[CurrentHedgehog]=false
|
|
851 |
SetHogLevel(CurrentHedgehog,0)
|
|
852 |
elseif(disallowattack>=300 and disallowattack >= 400)
|
|
853 |
then
|
|
854 |
disallowattack=0
|
|
855 |
SetHogLevel(CurrentHedgehog,1)
|
|
856 |
AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
|
|
857 |
elseif(GetHogLevel(CurrentHedgehog)==1)
|
|
858 |
then
|
|
859 |
SetHogLevel(CurrentHedgehog,0)
|
|
860 |
else
|
|
861 |
disallowattack=disallowattack+1
|
|
862 |
end
|
|
863 |
|
|
864 |
end
|
|
865 |
|
|
866 |
end
|
|
867 |
|
|
868 |
--if you used hogswitch or any similar weapon, dont enable any weaponchange
|
|
869 |
function onAttack()
|
|
870 |
swapweps=false
|
|
871 |
local around=false
|
|
872 |
|
|
873 |
--african special
|
|
874 |
if(africanSpecial == 1 and GetCurAmmoType() == amSeduction)
|
|
875 |
then
|
|
876 |
SetState(CurrentHedgehog, gstAttacked)
|
|
877 |
|
|
878 |
runOnHogs(weapon_duststorm)
|
|
879 |
|
|
880 |
--visual stuff
|
|
881 |
visual_gear_explosion(250,GetX(CurrentHedgehog), GetY(CurrentHedgehog),vgtSmoke,vgtSmokeWhite)
|
|
882 |
PlaySound(sndParachute)
|
|
883 |
end
|
|
884 |
|
|
885 |
--Kerguelen specials
|
|
886 |
if(GetCurAmmoType() == amStructure)
|
|
887 |
then
|
|
888 |
SetState(CurrentHedgehog, gstAttacked)
|
|
889 |
if(kergulenSpecial == 1)
|
|
890 |
then
|
|
891 |
temp_val=0
|
|
892 |
runOnHogs(weapon_scream_walrus)
|
|
893 |
SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+temp_val)
|
|
894 |
PlaySound(sndHellish)
|
|
895 |
|
|
896 |
elseif(kergulenSpecial == 2 and TotalRounds>=1)
|
|
897 |
then
|
|
898 |
runOnHogs(weapon_swap_kerg)
|
|
899 |
PlaySound(sndPiano3)
|
|
900 |
elseif(kergulenSpecial == 3)
|
|
901 |
then
|
|
902 |
runOnHogs(weapon_flare)
|
|
903 |
PlaySound(sndThrowRelease)
|
|
904 |
AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
|
|
905 |
AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, 0, -1000000, 30)
|
|
906 |
|
|
907 |
elseif(kergulenSpecial == 4)
|
|
908 |
then
|
|
909 |
runOnHogs(weapon_cries_a)
|
|
910 |
if(kergulenSpecial~=-1)
|
|
911 |
then
|
|
912 |
AddGear(0, 0, gtWaterUp, 0, 0,0,0)
|
|
913 |
PlaySound(sndWarp)
|
|
914 |
PlaySound(sndMolotov)
|
|
915 |
|
|
916 |
runOnHogs(weapon_cries_b)
|
|
917 |
else
|
|
918 |
HogSay(CurrentHedgehog, loc("Hogs in sight!"), SAY_SAY)
|
|
919 |
end
|
|
920 |
elseif(kergulenSpecial == 5)
|
|
921 |
then
|
|
922 |
runOnHogs(weapon_sabotage)
|
|
923 |
end
|
|
924 |
DeleteVisualGear(visualcircle)
|
|
925 |
visualcircle=nil
|
|
926 |
end
|
|
927 |
|
|
928 |
--Australian special
|
|
929 |
if(GetGearType(austmine) == gtMine and austmine ~= nil)
|
|
930 |
then
|
|
931 |
temp_val=0
|
|
932 |
runOnHogs(weapon_aust_check)
|
|
933 |
|
|
934 |
if(gearIsInCircle(austmine,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 30, false)==false or temp_val==1)
|
|
935 |
then
|
|
936 |
AddVisualGear(GetX(austmine), GetY(austmine), vgtDust, 0, false)
|
|
937 |
DeleteGear(austmine)
|
|
938 |
PlaySound(sndDenied)
|
|
939 |
end
|
|
940 |
|
|
941 |
austmine=nil
|
|
942 |
end
|
|
943 |
|
|
944 |
if(disable_moving[CurrentHedgehog]==true)
|
|
945 |
then
|
|
946 |
disable_moving[CurrentHedgehog]=false
|
|
947 |
SetHogLevel(CurrentHedgehog,0)
|
|
948 |
end
|
|
949 |
|
|
950 |
australianSpecial=false
|
|
951 |
end
|
|
952 |
|
|
953 |
function onGearAdd(gearUid)
|
|
954 |
swapweps=false
|
|
955 |
|
|
956 |
trackGear(gearUid)
|
|
957 |
|
|
958 |
--remove gasclouds on gasbombspecial
|
|
959 |
if(GetGearType(gearUid)==gtPoisonCloud and samericanSpecial == true)
|
|
960 |
then
|
|
961 |
DeleteGear(gearUid)
|
|
962 |
|
|
963 |
elseif(GetGearType(gearUid)==gtSMine)
|
|
964 |
then
|
|
965 |
vx,vy=GetGearVelocity(gearUid)
|
|
966 |
if(africaspecial2 == 1)
|
|
967 |
then
|
|
968 |
SetState(CurrentHedgehog, gstHHDriven+gstMoving)
|
|
969 |
SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog),GetY(CurrentHedgehog)-3)
|
|
970 |
SetGearVelocity(CurrentHedgehog, vx, vy)
|
|
971 |
DeleteGear(gearUid)
|
|
972 |
--africaspecial2=0
|
|
973 |
--SetEffect(CurrentHedgehog, heInvulnerable, true)
|
|
974 |
elseif(africaspecial2 == 2)
|
|
975 |
then
|
|
976 |
fire_gear(CurrentHedgehog,gtNapalmBomb, vx, vy, 0)
|
|
977 |
DeleteGear(gearUid)
|
|
978 |
--africaspecial2=0
|
|
979 |
end
|
|
980 |
|
|
981 |
elseif(GetGearType(gearUid)==gtSniperRifleShot)
|
|
982 |
then
|
|
983 |
sniper_s_in_use=true
|
|
984 |
if(namericanSpecial~=1)
|
|
985 |
then
|
|
986 |
SetHealth(gearUid, 1)
|
|
987 |
end
|
|
988 |
|
|
989 |
elseif(GetGearType(gearUid)==gtShotgunShot)
|
|
990 |
then
|
|
991 |
if(shotgun_s==true)
|
|
992 |
then
|
|
993 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
|
|
994 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
|
|
995 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
|
|
996 |
PlaySound(sndBirdyLay)
|
|
997 |
else
|
|
998 |
shotgun_s=nil
|
|
999 |
end
|
|
1000 |
|
|
1001 |
elseif(GetGearType(gearUid)==gtMolotov and europe_s==1)
|
|
1002 |
then
|
|
1003 |
vx,vy=GetGearVelocity(gearUid)
|
|
1004 |
e_health=fire_gear(CurrentHedgehog,gtCluster, vx, vy, 1)
|
|
1005 |
SetGearMessage(e_health, 2)
|
|
1006 |
DeleteGear(gearUid)
|
|
1007 |
|
|
1008 |
elseif(GetGearType(gearUid)==gtParachute)
|
|
1009 |
then
|
|
1010 |
inpara=gearUid
|
|
1011 |
end
|
|
1012 |
end
|
|
1013 |
|
|
1014 |
function onGearDelete(gearUid)
|
|
1015 |
|
|
1016 |
trackDeletion(gearUid)
|
|
1017 |
--north american specials
|
|
1018 |
if(GetGearType(gearUid)==gtSniperRifleShot )
|
|
1019 |
then
|
|
1020 |
sniper_s_in_use=false
|
|
1021 |
if(namericanSpecial==2)
|
|
1022 |
then
|
|
1023 |
temp_val=gearUid
|
|
1024 |
runOnHogs(weapon_lipstick)
|
|
1025 |
|
|
1026 |
elseif(namericanSpecial==3)
|
|
1027 |
then
|
|
1028 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
|
|
1029 |
|
|
1030 |
pinata=AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 5)
|
|
1031 |
SetGearMessage(pinata,1)
|
|
1032 |
end
|
|
1033 |
|
|
1034 |
elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==1 and namericanSpecial==3)
|
|
1035 |
then
|
|
1036 |
AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 24)
|
|
1037 |
|
|
1038 |
elseif(GetGearType(gearUid)==gtShotgunShot and shotgun_s==true)
|
|
1039 |
then
|
|
1040 |
SetState(CurrentHedgehog, gstMoving)
|
|
1041 |
SetGearPosition(CurrentHedgehog, GetX(gearUid), GetY(gearUid)+7)
|
|
1042 |
PlaySound(sndWarp)
|
|
1043 |
|
|
1044 |
--south american special
|
|
1045 |
elseif(GetGearType(gearUid)==gtGasBomb and samericanSpecial == true)
|
|
1046 |
then
|
|
1047 |
temp_val=gearUid
|
|
1048 |
runOnGears(weapon_anno_south)
|
|
1049 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
|
|
1050 |
|
|
1051 |
elseif(GetGearType(gearUid)==gtSnowball and GetGearMessage(gearUid)==1)
|
|
1052 |
then
|
|
1053 |
AddGear(GetX(gearUid), GetY(gearUid)+3, gtCluster, 0, 0, 0, 22)
|
|
1054 |
|
|
1055 |
elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==2)
|
|
1056 |
then
|
|
1057 |
temp_val=gearUid
|
|
1058 |
runOnGears(weapon_health)
|
|
1059 |
visual_gear_explosion(100,GetX(gearUid), GetY(gearUid),vgtSmokeWhite,vgtSmokeWhite)
|
|
1060 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
|
|
1061 |
PlaySound(sndGraveImpact)
|
|
1062 |
|
|
1063 |
elseif(GetGearType(gearUid)==gtParachute)
|
|
1064 |
then
|
|
1065 |
inpara=false
|
|
1066 |
end
|
|
1067 |
end |