author | szczur |
Wed, 29 May 2013 13:03:23 -0400 | |
changeset 9079 | 387e440093b7 |
parent 8618 | 7e71dba4e7f3 |
child 9805 | 1795c34ab8db |
permissions | -rw-r--r-- |
7893 | 1 |
--[[ |
8618 | 2 |
Version 1.1c |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
3 |
|
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
4 |
Copyright (C) 2012 Vatten |
7893 | 5 |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
6 |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
7 |
|
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
8 |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
9 |
|
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
10 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
7893 | 11 |
]] |
12 |
||
8043 | 13 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
14 |
HedgewarsScriptLoad("/Scripts/Utils.lua") |
|
15 |
HedgewarsScriptLoad("/Scripts/Tracker.lua") |
|
7893 | 16 |
|
17 |
function int_sqrt(num) |
|
8618 | 18 |
local temp=num |
7893 | 19 |
while(temp*temp-div(temp,2)>num) |
20 |
do |
|
21 |
temp=div((temp+div(num,temp)),2) |
|
22 |
end |
|
8618 | 23 |
|
7893 | 24 |
return math.abs(temp) |
25 |
end |
|
26 |
||
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
27 |
function norm(xx,yy) |
8618 | 28 |
--to fix overflows |
29 |
if(((math.abs(xx)^2)+(math.abs(yy)^2))>2^26) |
|
30 |
then |
|
31 |
local bitr=2^13 |
|
32 |
return int_sqrt((div(math.abs(xx),bitr)^2)+(div(math.abs(yy),bitr)^2))*bitr |
|
33 |
else |
|
34 |
return int_sqrt((math.abs(xx)^2)+(math.abs(yy)^2)) |
|
35 |
end |
|
7893 | 36 |
end |
37 |
||
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
38 |
function positive(num) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
39 |
if(num<0) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
40 |
then |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
41 |
return -1 |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
42 |
else |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
43 |
return 1 |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
44 |
end |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
45 |
end |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
46 |
|
7893 | 47 |
local teams_ok = {} |
48 |
local wepcode_teams={} |
|
49 |
local swapweps=false |
|
50 |
||
8618 | 51 |
--variables for seeing if you have swaped around on a weapon |
7893 | 52 |
local australianSpecial=false |
53 |
local africanSpecial=0 |
|
54 |
local africaspecial2=0 |
|
55 |
local asianSpecial=false |
|
56 |
local samericanSpecial=false |
|
57 |
local namericanSpecial=1 |
|
58 |
local sniper_s_in_use=false |
|
59 |
local kergulenSpecial=1 |
|
60 |
local shotgun_s=false |
|
61 |
local europe_s=0 |
|
8618 | 62 |
local VampOn=0 |
7893 | 63 |
|
64 |
local austmine=nil |
|
65 |
local inpara=false |
|
66 |
local asianflame=0 |
|
67 |
||
8618 | 68 |
local visualcircle=nil |
69 |
||
7893 | 70 |
local temp_val=0 |
71 |
||
8618 | 72 |
--for sabotage |
7893 | 73 |
local disallowattack=0 |
74 |
local disable_moving={} |
|
8618 | 75 |
local disableoffsetai=0 |
76 |
local onsabotageai=false |
|
7893 | 77 |
|
78 |
local continent = {} |
|
79 |
||
8618 | 80 |
local generalinfo=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]") |
81 |
||
7893 | 82 |
local weapontexts = { |
83 |
loc("Green lipstick bullet: [Is poisonous]"), |
|
84 |
loc("Piñata bullet: [Contains some sweet candy!]"), |
|
85 |
loc("Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"), |
|
8618 | 86 |
loc("Dust storm: [Deals 15 damage to all enemies in the circle]"), |
7893 | 87 |
loc("Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"), |
8618 | 88 |
loc("Drop a bomb: [drop some heroic wind that will turn into a bomb on impact ~ once per turn]"), |
7893 | 89 |
loc("Scream from a Walrus: [Deal 20 damage + 10% of your hogs health to all hogs around you and get half back]"), |
90 |
loc("Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"), |
|
91 |
loc("Flare: [fire up some bombs depending on hogs depending on hogs in the circle"), |
|
8618 | 92 |
loc("Lonely Cries: [Rise the water if no hog is in the circle and deal 7 damage to all enemy hogs]"), |
7893 | 93 |
loc("Hedgehog projectile: [fire your hog like a Sticky Bomb]"), |
94 |
loc("Napalm rocket: [Fire a bomb with napalm!]"), |
|
95 |
loc("Eagle Eye: [Blink to the impact ~ one shot]"), |
|
96 |
loc("Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"), |
|
97 |
loc("Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]") |
|
98 |
} |
|
99 |
||
100 |
local weaponsets = |
|
101 |
{ |
|
102 |
{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, |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
103 |
{{amShotgun,100},{amDEagle,100},{amLaserSight,4},{amSniperRifle,100},{amCake,1},{amAirAttack,2},{amSwitch,6}}}, |
7893 | 104 |
|
105 |
{loc("South America"),"Area: 17,840,000 km2, Population: 387,489,196 ",loc("Special Weapons:").."|"..loc("GasBomb")..": "..weapontexts[3],amGasBomb, |
|
8618 | 106 |
{{amBirdy,6},{amHellishBomb,1},{amBee,100},{amWhip,100},{amGasBomb,100},{amFlamethrower,100},{amNapalm,1},{amExtraDamage,2}}}, |
7893 | 107 |
|
108 |
{loc("Europe"),"Area: 10,180,000 km2, Population: 739,165,030",loc("Special Weapons:").."|"..loc("Molotov")..": "..weapontexts[14],amBazooka, |
|
109 |
{{amBazooka,100},{amGrenade,100},{amMortar,100},{amClusterBomb,5},{amMolotov,5},{amVampiric,4},{amPiano,1},{amResurrector,2},{amJetpack,2}}}, |
|
110 |
||
111 |
{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, |
|
8618 | 112 |
{{amSMine,100},{amWatermelon,1},{amDrillStrike,1},{amExtraTime,2},{amDrill,100},{amLandGun,3},{amSeduction,100}}}, |
7893 | 113 |
|
8618 | 114 |
{loc("Asia"),"Area: 44,579,000 km2, Population: 3,879,000,000",loc("- Will give you a parachute each turn.").."|"..loc("Special Weapons:").."|"..loc("Parachute")..": "..weapontexts[6],amRope, |
115 |
{{amKamikaze,4},{amRope,100},{amFirePunch,100},{amParachute,1},{amKnife,2},{amDynamite,1}}}, |
|
7893 | 116 |
|
117 |
{loc("Australia"),"Area: 8,468,300 km2, Population: 31,260,000",loc("Special Weapons:").."|"..loc("Baseballbat")..": "..weapontexts[5],amBaseballBat, |
|
118 |
{{amBaseballBat,100},{amMine,100},{amLowGravity,6},{amBlowTorch,100},{amRCPlane,2},{amTardis,100}}}, |
|
119 |
||
8618 | 120 |
{loc("Antarctica"),"Area: 14,000,000 km2, Population: ~1,000",loc("- Will give you a portalgun every second turn."),amTeleport, |
121 |
{{amSnowball,4},{amTeleport,2},{amInvulnerable,6},{amPickHammer,100},{amSineGun,100},{amGirder,3},{amPortalGun,2}}}, |
|
7893 | 122 |
|
8618 | 123 |
{loc("Kerguelen"),"Area: 1,100,000 km2, Population: ~70",loc("Special Weapons:").."|"..loc("Hammer")..": "..weapontexts[7].."|"..loc("Hammer")..": "..weapontexts[8].." ("..loc("Duration")..": 2)|"..loc("Hammer")..": "..weapontexts[9].."|"..loc("Hammer")..": "..weapontexts[10].."|"..loc("Hammer")..": "..weapontexts[15],amHammer, |
124 |
{{amHammer,100},{amMineStrike,2},{amBallgun,1},{amIceGun,2}}}, |
|
7893 | 125 |
|
126 |
{loc("Zealandia"),"Area: 3,500,000 km2, Population: 4,650,000",loc("- Will Get 1-3 random weapons"),amInvulnerable, |
|
127 |
{{amBazooka,1},{amBlowTorch,1},{amSwitch,1}}} |
|
128 |
} |
|
129 |
||
8618 | 130 |
local weaponsetssounds= |
131 |
{ |
|
132 |
{sndShotgunFire,sndCover}, |
|
133 |
{sndEggBreak,sndLaugh}, |
|
134 |
{sndExplosion,sndEnemyDown}, |
|
135 |
{sndMelonImpact,sndHello}, |
|
136 |
{sndRopeAttach,sndComeonthen}, |
|
137 |
{sndBaseballBat,sndNooo}, |
|
138 |
{sndSineGun,sndOops}, |
|
139 |
{sndPiano5,sndStupid}, |
|
140 |
{sndSplash,sndFirstBlood} |
|
141 |
} |
|
142 |
||
7893 | 143 |
--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) |
144 |
local weapons_dmg = { |
|
145 |
{amKamikaze, 0, 1, 0, 1, 0}, |
|
146 |
{amSineGun, 0, 1, 0, 1, 1}, |
|
147 |
{amBazooka, 0, 1, 0, 1, 0}, |
|
148 |
{amMineStrike, 0, 1, 5, 1, 2}, |
|
149 |
{amGrenade, 0, 1, 0, 1, 0}, |
|
150 |
{amPiano, 0, 1, 5, 1, 1}, |
|
151 |
{amClusterBomb, 0, 1, 0, 1, 0}, |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
152 |
{amBee, 0, 1, 0, 1, 0}, |
7893 | 153 |
{amShotgun, 0, 0, 0, 1, 1}, |
154 |
{amMine, 0, 1, 0, 1, 0}, |
|
155 |
{amSniperRifle, 0, 1, 0, 1, 1}, |
|
156 |
{amDEagle, 0, 1, 0, 1, 0}, |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
157 |
{amDynamite, 0, 1, 5, 1, 1}, |
7893 | 158 |
{amFirePunch, 0, 1, 0, 1, 0}, |
159 |
{amHellishBomb, 0, 1, 5, 1, 2}, |
|
160 |
{amWhip, 0, 1, 0, 1, 0}, |
|
161 |
{amNapalm, 0, 1, 5, 1, 2}, |
|
162 |
{amPickHammer, 0, 1, 0, 1, 0}, |
|
163 |
{amBaseballBat, 0, 1, 0, 1, 1}, |
|
164 |
{amMortar, 0, 1, 0, 1, 0}, |
|
165 |
{amCake, 0, 1, 4, 1, 2}, |
|
166 |
{amSeduction, 0, 0, 0, 1, 0}, |
|
167 |
{amWatermelon, 0, 1, 5, 1, 2}, |
|
168 |
{amDrill, 0, 1, 0, 1, 0}, |
|
169 |
{amBallgun, 0, 1, 5, 1, 2}, |
|
170 |
{amMolotov, 0, 1, 0, 1, 0}, |
|
171 |
{amBirdy, 0, 1, 1, 1, 1}, |
|
172 |
{amBlowTorch, 0, 1, 0, 1, 0}, |
|
173 |
{amRCPlane, 0, 1, 5, 1, 2}, |
|
174 |
{amGasBomb, 0, 0, 0, 1, 0}, |
|
175 |
{amAirAttack, 0, 1, 4, 1, 1}, |
|
176 |
{amFlamethrower, 0, 1, 0, 1, 0}, |
|
177 |
{amSMine, 0, 1, 0, 1, 1}, |
|
178 |
{amHammer, 0, 1, 0, 1, 0}, |
|
179 |
{amDrillStrike, 0, 1, 4, 1, 2}, |
|
8618 | 180 |
{amSnowball, 0, 1, 0, 1, 0} |
181 |
--{amStructure, 0, 0, 0, 1, 1} |
|
7893 | 182 |
} |
183 |
local weapons_supp = { |
|
184 |
{amParachute, 0, 1, 0, 1, 0}, |
|
185 |
{amGirder, 0, 1, 0, 1, 0}, |
|
186 |
{amSwitch, 0, 1, 0, 1, 0}, |
|
187 |
{amLowGravity, 0, 1, 0, 1, 0}, |
|
188 |
{amExtraDamage, 0, 1, 2, 1, 0}, |
|
189 |
{amRope, 0, 1, 0, 1, 1}, |
|
190 |
{amInvulnerable, 0, 1, 0, 1, 0}, |
|
191 |
{amExtraTime, 0, 1, 0, 1, 0}, |
|
192 |
{amLaserSight, 0, 1, 0, 1, 0}, |
|
193 |
{amVampiric, 0, 1, 0, 1, 0}, |
|
194 |
{amJetpack, 0, 1, 0, 1, 1}, |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
195 |
{amPortalGun, 0, 1, 2, 1, 1}, |
7893 | 196 |
{amResurrector, 0, 1, 3, 1, 0}, |
197 |
{amTeleport, 0, 1, 0, 1, 0}, |
|
198 |
{amLandGun, 0, 1, 0, 1, 0}, |
|
199 |
{amTardis, 0, 1, 0, 1, 0}, |
|
200 |
{amIceGun, 0, 1, 0, 1, 0}, |
|
201 |
{amKnife, 0, 1, 0, 1, 0} |
|
202 |
} |
|
8618 | 203 |
|
204 |
--will check after borders and stuff |
|
7893 | 205 |
function validate_weapon(hog,weapon,amount) |
206 |
if(MapHasBorder() == false or (MapHasBorder() == true and weapon ~= amAirAttack and weapon ~= amMineStrike and weapon ~= amNapalm and weapon ~= amDrillStrike and weapon ~= amPiano)) |
|
207 |
then |
|
208 |
AddAmmo(hog, weapon,amount) |
|
209 |
end |
|
210 |
end |
|
211 |
||
212 |
--reset all weapons for a team |
|
213 |
function cleanweps(hog) |
|
214 |
||
215 |
local i=1 |
|
8618 | 216 |
--+1 for skip +1 for freezer |
217 |
while(i<=table.maxn(weapons_supp)+table.maxn(weapons_dmg)+2) |
|
7893 | 218 |
do |
219 |
AddAmmo(hog,i,0) |
|
220 |
i=i+1 |
|
221 |
end |
|
222 |
||
223 |
AddAmmo(hog,amSkip,100) |
|
224 |
end |
|
225 |
||
8618 | 226 |
--get the weapons from a weaponset |
7893 | 227 |
function load_weaponset(hog, num) |
228 |
for v,w in pairs(weaponsets[num][5]) |
|
229 |
do |
|
230 |
validate_weapon(hog, w[1],w[2]) |
|
231 |
end |
|
232 |
end |
|
233 |
||
8618 | 234 |
--list up all weapons from the icons for each continent |
7893 | 235 |
function load_continent_selection(hog) |
236 |
for v,w in pairs(weaponsets) |
|
237 |
do |
|
238 |
validate_weapon(hog, weaponsets[v][4],1) |
|
239 |
end |
|
240 |
AddAmmo(hog,amSwitch) --random continent |
|
241 |
end |
|
242 |
||
8618 | 243 |
--shows the continent info |
244 |
function show_continent_info(continent,time,generalinf) |
|
245 |
local geninftext="" |
|
7893 | 246 |
local ns=false |
247 |
if(time==-1) |
|
248 |
then |
|
249 |
time=0 |
|
250 |
ns=true |
|
251 |
end |
|
8618 | 252 |
if(generalinf) |
253 |
then |
|
254 |
geninftext="| |"..loc("General information")..": |"..generalinfo |
|
255 |
end |
|
256 |
ShowMission(weaponsets[continent][1],weaponsets[continent][2],weaponsets[continent][3]..geninftext, -weaponsets[continent][4], time) |
|
7893 | 257 |
if(ns) |
258 |
then |
|
259 |
HideMission() |
|
260 |
end |
|
261 |
end |
|
262 |
||
8618 | 263 |
--will show a circle of gears (eye candy) |
7893 | 264 |
function visual_gear_explosion(range,xpos,ypos,gear1,gear2) |
265 |
local degr=0 |
|
266 |
local lap=30 |
|
267 |
while(lap<range) |
|
268 |
do |
|
269 |
while(degr < 6.2831) |
|
270 |
do |
|
271 |
AddVisualGear(xpos+math.cos(degr+0.1)*(lap+5), ypos+math.sin(degr+0.1)*(lap+5), gear1, 0, false) |
|
272 |
if(gear2~=false) |
|
273 |
then |
|
274 |
AddVisualGear(xpos+math.cos(degr)*lap, ypos+math.sin(degr)*lap, gear2, 0, false) |
|
275 |
end |
|
276 |
degr=degr+((3.1415*3)*0.125) --1/8 = 0.125 |
|
277 |
end |
|
278 |
lap=lap+30 |
|
279 |
degr=degr-6.2831 |
|
280 |
end |
|
281 |
end |
|
282 |
||
8618 | 283 |
--zealandia (generates weapons from the weaponinfo above |
7893 | 284 |
function get_random_weapon(hog) |
8618 | 285 |
if(GetGearType(hog) == gtHedgehog and continent[GetHogTeamName(hog)]==9 and getTeamValue(GetHogTeamName(hog), "rand-done-turn")==nil) |
7893 | 286 |
then |
8618 | 287 |
cleanweps(hog) |
288 |
||
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
289 |
local random_weapon = 0 |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
290 |
local old_rand_weap = 0 |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
291 |
local rand_weaponset_power = 0 |
7893 | 292 |
|
8618 | 293 |
local numberof_weapons_supp=table.maxn(weapons_supp) |
294 |
local numberof_weapons_dmg=table.maxn(weapons_dmg) |
|
295 |
||
296 |
local rand1=GetRandom(table.maxn(weapons_supp))+1 |
|
297 |
local rand2=GetRandom(table.maxn(weapons_dmg))+1 |
|
298 |
||
299 |
random_weapon = GetRandom(table.maxn(weapons_dmg))+1 |
|
300 |
||
301 |
while(weapons_dmg[random_weapon][4]>TotalRounds) |
|
302 |
do |
|
303 |
if(random_weapon>=numberof_weapons_dmg) |
|
304 |
then |
|
305 |
random_weapon=0 |
|
306 |
end |
|
307 |
random_weapon = random_weapon+1 |
|
308 |
end |
|
309 |
validate_weapon(hog, weapons_dmg[random_weapon][1],1) |
|
310 |
rand_weaponset_power=weapons_dmg[random_weapon][6] |
|
311 |
old_rand_weap = random_weapon |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
312 |
|
8618 | 313 |
if(rand_weaponset_power <2) |
314 |
then |
|
315 |
random_weapon = rand1 |
|
316 |
while(weapons_supp[random_weapon][4]>TotalRounds or rand_weaponset_power+weapons_supp[random_weapon][6]>2) |
|
7893 | 317 |
do |
8618 | 318 |
if(random_weapon>=numberof_weapons_supp) |
319 |
then |
|
320 |
random_weapon=0 |
|
321 |
end |
|
322 |
random_weapon = random_weapon+1 |
|
323 |
end |
|
324 |
validate_weapon(hog, weapons_supp[random_weapon][1],1) |
|
325 |
rand_weaponset_power=rand_weaponset_power+weapons_supp[random_weapon][6] |
|
326 |
end |
|
327 |
--check again if the power is enough |
|
328 |
if(rand_weaponset_power <1) |
|
329 |
then |
|
330 |
random_weapon = rand2 |
|
331 |
while(weapons_dmg[random_weapon][4]>TotalRounds or old_rand_weap == random_weapon or weapons_dmg[random_weapon][6]>0) |
|
332 |
do |
|
333 |
if(random_weapon>=numberof_weapons_dmg) |
|
7893 | 334 |
then |
335 |
random_weapon=0 |
|
336 |
end |
|
337 |
random_weapon = random_weapon+1 |
|
338 |
end |
|
339 |
validate_weapon(hog, weapons_dmg[random_weapon][1],1) |
|
8618 | 340 |
end |
7893 | 341 |
|
8618 | 342 |
setTeamValue(GetHogTeamName(hog), "rand-done-turn", true) |
7893 | 343 |
end |
344 |
end |
|
345 |
||
8618 | 346 |
--this will take that hogs settings for the weapons and add them |
347 |
function setweapons() |
|
7893 | 348 |
|
349 |
cleanweps(CurrentHedgehog) |
|
350 |
load_weaponset(CurrentHedgehog,continent[GetHogTeamName(CurrentHedgehog)]) |
|
8618 | 351 |
|
352 |
visualstuff=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-5, vgtDust,0, false) |
|
353 |
v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 = GetVisualGearValues(visualstuff) |
|
354 |
SetVisualGearValues(visualstuff, v1, v2, v3, v4, v5, v6, v7, 2, v9, GetClanColor(GetHogClan(CurrentHedgehog))) |
|
355 |
||
356 |
show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],0,false) |
|
7893 | 357 |
end |
358 |
||
8618 | 359 |
--show health tag (will mostly be used when a hog is damaged) |
7893 | 360 |
function show_damage_tag(hog,damage) |
361 |
healthtag=AddVisualGear(GetX(hog), GetY(hog), vgtHealthTag, damage, false) |
|
362 |
v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 = GetVisualGearValues(healthtag) |
|
363 |
SetVisualGearValues(healthtag, v1, v2, v3, v4, v5, v6, v7, v8, v9, GetClanColor(GetHogClan(hog))) |
|
364 |
end |
|
365 |
||
8618 | 366 |
--will use int_sqrt |
7893 | 367 |
function fire_gear(hedgehog,geartype,vx,vy,timer) |
8618 | 368 |
local hypo=norm(vx,vy) |
369 |
return AddGear(div((GetGearRadius(hedgehog)*2*vx),hypo)+GetX(hedgehog), div((GetGearRadius(hedgehog)*2*vy),hypo)+GetY(hedgehog), geartype, 0, vx, vy, timer) |
|
7893 | 370 |
end |
371 |
||
372 |
--==========================run throw all hog/gear weapons ========================== |
|
8618 | 373 |
--will check if the mine is nicely placed |
7893 | 374 |
function weapon_aust_check(hog) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
375 |
if(GetGearType(hog) == gtHedgehog) |
7893 | 376 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
377 |
if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 50, false)==true and hog ~= CurrentHedgehog) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
378 |
then |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
379 |
temp_val=1 |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
380 |
end |
7893 | 381 |
end |
382 |
end |
|
383 |
||
8618 | 384 |
--african special on sedunction |
7893 | 385 |
function weapon_duststorm(hog) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
386 |
if(GetGearType(hog) == gtHedgehog) |
7893 | 387 |
then |
8618 | 388 |
local dmg=15 |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
389 |
if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 250, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog)) |
7893 | 390 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
391 |
if(GetHealth(hog) > dmg) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
392 |
then |
8618 | 393 |
temp_val=temp_val+div(dmg*VampOn,100) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
394 |
SetHealth(hog, GetHealth(hog)-dmg) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
395 |
else |
8618 | 396 |
temp_val=temp_val+div(GetHealth(hog)*VampOn,100) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
397 |
SetHealth(hog, 0) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
398 |
end |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
399 |
show_damage_tag(hog,dmg) |
7893 | 400 |
end |
401 |
end |
|
402 |
end |
|
403 |
||
8618 | 404 |
--kerguelen special on structure |
7893 | 405 |
function weapon_scream_walrus(hog) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
406 |
if(GetGearType(hog) == gtHedgehog) |
7893 | 407 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
408 |
if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 120, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog)) |
7893 | 409 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
410 |
if(GetHealth(hog)>(20+GetHealth(CurrentHedgehog)*0.1)) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
411 |
then |
8618 | 412 |
temp_val=temp_val+10+(GetHealth(CurrentHedgehog)*0.05)+div((20+GetHealth(CurrentHedgehog)*0.1)*VampOn,100) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
413 |
SetHealth(hog, GetHealth(hog)-(20+GetHealth(CurrentHedgehog)*0.1)) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
414 |
else |
8618 | 415 |
temp_val=temp_val+(GetHealth(hog)*0.5)+(GetHealth(CurrentHedgehog)*0.05)+div((GetHealth(hog)+(GetHealth(CurrentHedgehog)*0.1))*VampOn,100) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
416 |
SetHealth(hog, 0) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
417 |
end |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
418 |
show_damage_tag(hog,(20+GetHealth(CurrentHedgehog)*0.1)) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
419 |
AddVisualGear(GetX(hog), GetY(hog), vgtExplosion, 0, false) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
420 |
AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false) |
7893 | 421 |
end |
422 |
end |
|
423 |
end |
|
424 |
||
8618 | 425 |
--kerguelen special swap hog |
7893 | 426 |
function weapon_swap_kerg(hog) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
427 |
if(GetGearType(hog) == gtHedgehog) |
7893 | 428 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
429 |
if(kergulenSpecial ~= -1 and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 450, false)) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
430 |
then |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
431 |
local thisX=GetX(CurrentHedgehog) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
432 |
local thisY=GetY(CurrentHedgehog) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
433 |
SetGearPosition(CurrentHedgehog, GetX(hog), GetY(hog)) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
434 |
SetGearPosition(hog, thisX, thisY) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
435 |
kergulenSpecial=-1 |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
436 |
end |
7893 | 437 |
end |
438 |
end |
|
439 |
||
8618 | 440 |
--kerguelen special on structure |
7893 | 441 |
function weapon_flare(hog) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
442 |
if(GetGearType(hog) == gtHedgehog) |
7893 | 443 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
444 |
if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 45, false)) |
7893 | 445 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
446 |
if(GetX(hog)<=GetX(CurrentHedgehog)) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
447 |
then |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
448 |
dirker=1 |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
449 |
else |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
450 |
dirker=-1 |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
451 |
end |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
452 |
AddVisualGear(GetX(hog), GetY(hog), vgtFire, 0, false) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
453 |
SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog), GetY(CurrentHedgehog)-5) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
454 |
SetGearVelocity(CurrentHedgehog, 100000*dirker, -300000) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
455 |
AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, -10000*dirker, -1000000, 35) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
456 |
PlaySound(sndHellishImpact2) |
7893 | 457 |
end |
458 |
end |
|
459 |
end |
|
460 |
||
8618 | 461 |
--kerguelen special will apply sabotage |
7893 | 462 |
function weapon_sabotage(hog) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
463 |
if(GetGearType(hog) == gtHedgehog) |
7893 | 464 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
465 |
if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 100, false)) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
466 |
then |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
467 |
disable_moving[hog]=true |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
468 |
AddGear(GetX(hog), GetY(hog), gtCluster, 0, 0, 0, 10) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
469 |
PlaySound(sndNooo,hog) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
470 |
end |
7893 | 471 |
end |
472 |
end |
|
473 |
||
8618 | 474 |
--south american special (used fire gear) |
7893 | 475 |
function weapon_anno_south(hog) |
8618 | 476 |
local power_radius_outer=230 |
477 |
local power_radius_inner=45 |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
478 |
local power_sa=500000 |
8618 | 479 |
local hypo=0 |
7893 | 480 |
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) |
481 |
then |
|
482 |
if(hog == CurrentHedgehog) |
|
483 |
then |
|
484 |
SetState(CurrentHedgehog, gstMoving) |
|
485 |
end |
|
486 |
SetGearPosition(hog, GetX(hog),GetY(hog)-3) |
|
8618 | 487 |
hypo=norm(math.abs(GetX(hog)-GetX(temp_val)),math.abs(GetY(hog)-GetY(temp_val))) |
488 |
SetGearVelocity(hog, div((power_radius_outer-hypo)*power_sa*positive(GetX(hog)-GetX(temp_val)),power_radius_outer), div((power_radius_outer-hypo)*power_sa*positive(GetY(hog)-GetY(temp_val)),power_radius_outer)) |
|
489 |
end |
|
490 |
end |
|
491 |
||
492 |
--first part on kerguelen special (lonely cries) |
|
493 |
function weapon_cries_a(hog) |
|
494 |
if(GetGearType(hog) == gtHedgehog and hog ~= CurrentHedgehog and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 500, false)) |
|
495 |
then |
|
496 |
kergulenSpecial=-1 |
|
7893 | 497 |
end |
498 |
end |
|
499 |
||
8618 | 500 |
--second part on kerguelen special (lonely cries) |
7893 | 501 |
function weapon_cries_b(hog) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
502 |
if(GetGearType(hog) == gtHedgehog) |
7893 | 503 |
then |
8618 | 504 |
local dmg=7 |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
505 |
if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog)) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
506 |
then |
8618 | 507 |
if(GetHealth(hog) > dmg) |
508 |
then |
|
509 |
temp_val=temp_val+div(dmg*VampOn,100) |
|
510 |
SetHealth(hog, GetHealth(hog)-dmg) |
|
511 |
else |
|
512 |
temp_val=temp_val+div(GetHealth(hog)*VampOn,100) |
|
513 |
SetHealth(hog, 0) |
|
514 |
end |
|
515 |
show_damage_tag(hog,dmg) |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
516 |
AddVisualGear(GetX(hog), GetY(hog)-30, vgtEvilTrace, 0, false) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
517 |
end |
7893 | 518 |
end |
519 |
end |
|
520 |
||
8618 | 521 |
--north american special on sniper |
7893 | 522 |
function weapon_lipstick(hog) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
523 |
if(GetGearType(hog) == gtHedgehog) |
7893 | 524 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
525 |
if(gearIsInCircle(temp_val,GetX(hog), GetY(hog), 20, false)) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
526 |
then |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
527 |
SetEffect(hog, hePoisoned, 1) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
528 |
PlaySound(sndBump) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
529 |
end |
7893 | 530 |
end |
531 |
end |
|
532 |
||
8618 | 533 |
--european special on molotov (used fire gear) |
7893 | 534 |
function weapon_health(hog) |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
535 |
if(GetGearType(hog) == gtHedgehog) |
7893 | 536 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
537 |
if(gearIsInCircle(temp_val,GetX(hog), GetY(hog), 100, false)) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
538 |
then |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
539 |
SetHealth(hog, GetHealth(hog)+25) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
540 |
SetEffect(hog, hePoisoned, false) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
541 |
end |
7893 | 542 |
end |
543 |
end |
|
544 |
--============================================================================ |
|
545 |
||
546 |
--set each weapons settings |
|
547 |
function onAmmoStoreInit() |
|
548 |
||
549 |
SetAmmo(amSkip, 9, 0, 0, 0) |
|
550 |
||
551 |
for v,w in pairs(weapons_dmg) |
|
552 |
do |
|
553 |
SetAmmo(w[1], w[2], w[3], w[4], w[5]) |
|
554 |
end |
|
555 |
||
556 |
for v,w in pairs(weapons_supp) |
|
557 |
do |
|
558 |
SetAmmo(w[1], w[2], w[3], w[4], w[5]) |
|
559 |
end |
|
560 |
end |
|
561 |
||
562 |
function onGameStart() |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
563 |
--trackTeams() |
7893 | 564 |
|
8618 | 565 |
ShowMission(loc("Continental supplies").." 1.1c",loc("Let a Continent provide your weapons!"), |
566 |
loc(generalinfo), -amLowGravity, 0) |
|
7893 | 567 |
end |
568 |
||
569 |
--what happen when a turn starts |
|
570 |
function onNewTurn() |
|
8618 | 571 |
|
572 |
--will refresh the info on each tab weapon |
|
7893 | 573 |
australianSpecial=true |
574 |
asianSpecial=false |
|
575 |
austmine=nil |
|
576 |
africanSpecial=0 |
|
577 |
samericanSpecial=false |
|
578 |
africaspecial2=0 |
|
579 |
kergulenSpecial=1 |
|
580 |
namericanSpecial=1 |
|
581 |
asianflame=0 |
|
582 |
shotgun_s=false |
|
583 |
sniper_s_in_use=false |
|
584 |
europe_s=0 |
|
8618 | 585 |
VampOn=0 |
7893 | 586 |
|
587 |
temp_val=0 |
|
588 |
||
8618 | 589 |
--for sabotage |
7893 | 590 |
disallowattack=0 |
8618 | 591 |
if(disable_moving[CurrentHedgehog]==true) |
592 |
then |
|
593 |
disableoffsetai=GetHogLevel(CurrentHedgehog) |
|
594 |
end |
|
595 |
||
7893 | 596 |
--when all hogs are "placed" |
597 |
if(GetCurAmmoType()~=amTeleport) |
|
598 |
then |
|
599 |
--will run once when the game really starts (after placing hogs and so on |
|
600 |
if(teams_ok[GetHogTeamName(CurrentHedgehog)] == nil) |
|
601 |
then |
|
602 |
disable_moving[CurrentHedgehog]=false |
|
603 |
AddCaption("["..loc("Select continent!").."]") |
|
604 |
load_continent_selection(CurrentHedgehog) |
|
605 |
continent[GetHogTeamName(CurrentHedgehog)]=0 |
|
606 |
swapweps=true |
|
607 |
teams_ok[GetHogTeamName(CurrentHedgehog)] = 2 |
|
608 |
else |
|
8618 | 609 |
--if its not the initialization turn |
7893 | 610 |
swapweps=false |
611 |
if(continent[GetHogTeamName(CurrentHedgehog)]==0) |
|
612 |
then |
|
8618 | 613 |
continent[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.maxn(weaponsets))+1 |
614 |
setweapons() |
|
7893 | 615 |
end |
8618 | 616 |
show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],-1,true) |
617 |
||
618 |
--give zeelandia-teams new weapons so they can plan for the next turn |
|
619 |
runOnGears(get_random_weapon) |
|
620 |
||
621 |
--some specials for some continents (temp_val is from get random weapons) |
|
622 |
if(continent[GetHogTeamName(CurrentHedgehog)]==9) |
|
623 |
then |
|
624 |
setTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn", nil) |
|
625 |
elseif(continent[GetHogTeamName(CurrentHedgehog)]==7) |
|
626 |
then |
|
627 |
if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick")==nil) |
|
628 |
then |
|
629 |
setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick", 1) |
|
630 |
end |
|
631 |
||
632 |
if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick")>=2) |
|
633 |
then |
|
634 |
AddAmmo(CurrentHedgehog,amPortalGun) |
|
635 |
setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick", 0) |
|
636 |
end |
|
637 |
setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick", getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick")+1) |
|
638 |
||
639 |
elseif(continent[GetHogTeamName(CurrentHedgehog)]==5) |
|
640 |
then |
|
641 |
AddAmmo(CurrentHedgehog,amParachute) |
|
642 |
end |
|
7893 | 643 |
end |
644 |
end |
|
645 |
end |
|
646 |
||
647 |
--what happens when you press "tab" (common button) |
|
648 |
function onSwitch() |
|
649 |
||
650 |
--place mine (australia) |
|
651 |
if(GetCurAmmoType() == amBaseballBat and australianSpecial==true) |
|
652 |
then |
|
653 |
temp_val=0 |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
654 |
runOnGears(weapon_aust_check) |
7893 | 655 |
|
656 |
if(temp_val==0) |
|
657 |
then |
|
658 |
austmine=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+5, gtMine, 0, 0, 0, 0) |
|
659 |
SetHealth(austmine, 100) |
|
660 |
SetTimer(austmine, 1000) |
|
661 |
australianSpecial=false |
|
662 |
swapweps=false |
|
663 |
else |
|
664 |
PlaySound(sndDenied) |
|
665 |
end |
|
666 |
end |
|
667 |
||
668 |
--Asian special |
|
669 |
if(asianSpecial==false and inpara~=false) |
|
670 |
then |
|
671 |
asiabomb=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+3, gtSnowball, 0, 0, 0, 0) |
|
672 |
SetGearMessage(asiabomb, 1) |
|
673 |
asianSpecial=true |
|
674 |
swapweps=false |
|
675 |
end |
|
676 |
||
677 |
--africa |
|
678 |
if(GetCurAmmoType() == amSeduction) |
|
679 |
then |
|
680 |
if(africanSpecial==0) |
|
681 |
then |
|
682 |
africanSpecial = 1 |
|
683 |
AddCaption(weapontexts[4]) |
|
684 |
else |
|
685 |
africanSpecial = 0 |
|
686 |
AddCaption(loc("NORMAL")) |
|
687 |
end |
|
688 |
end |
|
689 |
--south america |
|
690 |
if(GetCurAmmoType() == amGasBomb) |
|
691 |
then |
|
692 |
if(samericanSpecial==false) |
|
693 |
then |
|
694 |
samericanSpecial = true |
|
695 |
AddCaption(weapontexts[3]) |
|
696 |
else |
|
697 |
samericanSpecial = false |
|
698 |
AddCaption(loc("NORMAL")) |
|
699 |
end |
|
700 |
end |
|
701 |
--africa |
|
702 |
if(GetCurAmmoType() == amSMine) |
|
703 |
then |
|
704 |
if(africaspecial2==0) |
|
705 |
then |
|
706 |
africaspecial2 = 1 |
|
707 |
AddCaption(weapontexts[11]) |
|
708 |
elseif(africaspecial2 == 1) |
|
709 |
then |
|
710 |
africaspecial2 = 2 |
|
711 |
AddCaption(weapontexts[12]) |
|
712 |
elseif(africaspecial2 == 2) |
|
713 |
then |
|
714 |
africaspecial2 = 0 |
|
715 |
AddCaption(loc("NORMAL")) |
|
716 |
end |
|
717 |
end |
|
718 |
||
8618 | 719 |
--north america (sniper) |
7893 | 720 |
if(GetCurAmmoType() == amSniperRifle and sniper_s_in_use==false) |
721 |
then |
|
722 |
if(namericanSpecial==3) |
|
723 |
then |
|
724 |
namericanSpecial = 1 |
|
725 |
AddCaption(loc("NORMAL")) |
|
726 |
elseif(namericanSpecial==1) |
|
727 |
then |
|
728 |
namericanSpecial = 2 |
|
729 |
AddCaption("#"..weapontexts[1]) |
|
730 |
elseif(namericanSpecial==2) |
|
731 |
then |
|
732 |
namericanSpecial = 3 |
|
733 |
AddCaption("##"..weapontexts[2]) |
|
734 |
end |
|
735 |
end |
|
736 |
||
8618 | 737 |
--north america (shotgun) |
7893 | 738 |
if(GetCurAmmoType() == amShotgun and shotgun_s~=nil) |
739 |
then |
|
740 |
if(shotgun_s==false) |
|
741 |
then |
|
742 |
shotgun_s = true |
|
743 |
AddCaption(weapontexts[13]) |
|
744 |
else |
|
745 |
shotgun_s = false |
|
746 |
AddCaption(loc("NORMAL")) |
|
747 |
end |
|
748 |
end |
|
749 |
||
8618 | 750 |
--europe |
7893 | 751 |
if(GetCurAmmoType() == amMolotov) |
752 |
then |
|
753 |
if(europe_s==0) |
|
754 |
then |
|
755 |
europe_s = 1 |
|
756 |
AddCaption(weapontexts[14]) |
|
757 |
else |
|
758 |
europe_s = 0 |
|
759 |
AddCaption(loc("NORMAL")) |
|
760 |
end |
|
761 |
end |
|
762 |
||
8618 | 763 |
--swap forward in the weaponmenu (1.0 style) |
764 |
if(swapweps==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing)) |
|
7893 | 765 |
then |
766 |
continent[GetHogTeamName(CurrentHedgehog)]=continent[GetHogTeamName(CurrentHedgehog)]+1 |
|
767 |
||
8618 | 768 |
if(continent[GetHogTeamName(CurrentHedgehog)]> table.maxn(weaponsets)) |
7893 | 769 |
then |
770 |
continent[GetHogTeamName(CurrentHedgehog)]=1 |
|
771 |
end |
|
8618 | 772 |
setweapons() |
7893 | 773 |
end |
774 |
||
8618 | 775 |
--kerguelen |
776 |
if(GetCurAmmoType() == amHammer) |
|
7893 | 777 |
then |
8618 | 778 |
if(kergulenSpecial==6) |
7893 | 779 |
then |
780 |
kergulenSpecial = 1 |
|
8618 | 781 |
AddCaption("Normal") |
782 |
elseif(kergulenSpecial==1) |
|
7893 | 783 |
then |
784 |
kergulenSpecial = 2 |
|
8618 | 785 |
AddCaption("#"..weapontexts[7]) |
786 |
elseif(kergulenSpecial==2 and TotalRounds>=1) |
|
7893 | 787 |
then |
788 |
kergulenSpecial = 3 |
|
8618 | 789 |
AddCaption("##"..weapontexts[8]) |
790 |
elseif(kergulenSpecial==3 or (kergulenSpecial==2 and TotalRounds<1)) |
|
7893 | 791 |
then |
792 |
kergulenSpecial = 4 |
|
8618 | 793 |
AddCaption("###"..weapontexts[9]) |
7893 | 794 |
elseif(kergulenSpecial==4) |
795 |
then |
|
796 |
kergulenSpecial = 5 |
|
8618 | 797 |
AddCaption("####"..weapontexts[10]) |
798 |
elseif(kergulenSpecial==5) |
|
799 |
then |
|
800 |
kergulenSpecial = 6 |
|
7893 | 801 |
AddCaption("#####"..weapontexts[15]) |
802 |
end |
|
803 |
end |
|
804 |
end |
|
805 |
||
806 |
function onPrecise() |
|
8618 | 807 |
--swap backwards in the weaponmenu (1.0 style) |
808 |
if(swapweps==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing)) |
|
7893 | 809 |
then |
810 |
continent[GetHogTeamName(CurrentHedgehog)]=continent[GetHogTeamName(CurrentHedgehog)]-1 |
|
811 |
||
812 |
if(continent[GetHogTeamName(CurrentHedgehog)]<=0) |
|
813 |
then |
|
814 |
continent[GetHogTeamName(CurrentHedgehog)]=9 |
|
815 |
end |
|
8618 | 816 |
setweapons() |
7893 | 817 |
end |
818 |
end |
|
819 |
||
820 |
function onGameTick20() |
|
8618 | 821 |
--if you picked a weaponset from the weaponmenu (icon) |
822 |
if(continent[GetHogTeamName(CurrentHedgehog)]==0) |
|
7893 | 823 |
then |
8618 | 824 |
if(GetCurAmmoType()==amSwitch) |
7893 | 825 |
then |
8618 | 826 |
continent[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.maxn(weaponsets))+1 |
827 |
setweapons() |
|
828 |
PlaySound(sndMineTick) |
|
829 |
else |
|
830 |
for v,w in pairs(weaponsets) |
|
831 |
do |
|
832 |
if(GetCurAmmoType()==weaponsets[v][4]) |
|
833 |
then |
|
834 |
continent[GetHogTeamName(CurrentHedgehog)]=v |
|
835 |
setweapons() |
|
836 |
PlaySound(weaponsetssounds[v][1]) |
|
837 |
PlaySound(weaponsetssounds[v][2],CurrentHedgehog) |
|
838 |
end |
|
839 |
end |
|
7893 | 840 |
end |
841 |
end |
|
842 |
||
8618 | 843 |
--show the kerguelen ring |
844 |
if(kergulenSpecial > 1 and GetCurAmmoType() == amHammer) |
|
7893 | 845 |
then |
8618 | 846 |
if(visualcircle==nil) |
847 |
then |
|
848 |
visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 0, false) |
|
7893 | 849 |
end |
8618 | 850 |
|
851 |
if(kergulenSpecial == 2) --walrus scream |
|
7893 | 852 |
then |
853 |
SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 120, 4, 0xff0000ee) |
|
8618 | 854 |
elseif(kergulenSpecial == 3) --swap hog |
7893 | 855 |
then |
856 |
SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 450, 3, 0xffff00ee) |
|
8618 | 857 |
elseif(kergulenSpecial == 4) --flare |
7893 | 858 |
then |
8618 | 859 |
SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 45, 6, 0x00ff00ee) |
860 |
elseif(kergulenSpecial == 5) --cries |
|
861 |
then |
|
7893 | 862 |
SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 1, 0x0000ffee) |
8618 | 863 |
elseif(kergulenSpecial == 6) --sabotage |
7893 | 864 |
then |
865 |
SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 100, 10, 0xeeeeeeee) |
|
866 |
end |
|
867 |
||
868 |
elseif(visualcircle~=nil) |
|
869 |
then |
|
870 |
DeleteVisualGear(visualcircle) |
|
871 |
visualcircle=nil |
|
872 |
end |
|
873 |
||
8618 | 874 |
--sabotage |
7893 | 875 |
if(disable_moving[CurrentHedgehog]==true) |
876 |
then |
|
877 |
||
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
878 |
if(TurnTimeLeft<=150) |
7893 | 879 |
then |
880 |
disable_moving[CurrentHedgehog]=false |
|
8618 | 881 |
SetHogLevel(CurrentHedgehog,disableoffsetai) |
882 |
onsabotageai=false |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
883 |
elseif(disallowattack>=15 and disallowattack >= 20) |
7893 | 884 |
then |
885 |
disallowattack=0 |
|
8618 | 886 |
onsabotageai=true |
7893 | 887 |
SetHogLevel(CurrentHedgehog,1) |
888 |
AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false) |
|
8618 | 889 |
elseif(onsabotageai==true) |
7893 | 890 |
then |
8618 | 891 |
SetHogLevel(CurrentHedgehog,disableoffsetai) |
892 |
onsabotageai=false |
|
7893 | 893 |
else |
894 |
disallowattack=disallowattack+1 |
|
895 |
end |
|
896 |
||
897 |
end |
|
898 |
||
899 |
end |
|
900 |
||
901 |
--if you used hogswitch or any similar weapon, dont enable any weaponchange |
|
902 |
function onAttack() |
|
903 |
swapweps=false |
|
904 |
||
905 |
--african special |
|
906 |
if(africanSpecial == 1 and GetCurAmmoType() == amSeduction) |
|
907 |
then |
|
908 |
SetState(CurrentHedgehog, gstAttacked) |
|
909 |
||
8618 | 910 |
temp_val=0 |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
911 |
runOnGears(weapon_duststorm) |
8618 | 912 |
SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+temp_val) |
7893 | 913 |
|
914 |
--visual stuff |
|
915 |
visual_gear_explosion(250,GetX(CurrentHedgehog), GetY(CurrentHedgehog),vgtSmoke,vgtSmokeWhite) |
|
916 |
PlaySound(sndParachute) |
|
8618 | 917 |
|
7893 | 918 |
--Kerguelen specials |
8618 | 919 |
elseif(GetCurAmmoType() == amHammer and kergulenSpecial > 1) |
7893 | 920 |
then |
921 |
SetState(CurrentHedgehog, gstAttacked) |
|
8618 | 922 |
--scream |
923 |
if(kergulenSpecial == 2) |
|
7893 | 924 |
then |
925 |
temp_val=0 |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
926 |
runOnGears(weapon_scream_walrus) |
7893 | 927 |
SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+temp_val) |
928 |
PlaySound(sndHellish) |
|
8618 | 929 |
|
930 |
--swap |
|
931 |
elseif(kergulenSpecial == 3 and TotalRounds>=1) |
|
7893 | 932 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
933 |
runOnGears(weapon_swap_kerg) |
7893 | 934 |
PlaySound(sndPiano3) |
8618 | 935 |
|
936 |
--flare |
|
937 |
elseif(kergulenSpecial == 4) |
|
7893 | 938 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
939 |
runOnGears(weapon_flare) |
7893 | 940 |
PlaySound(sndThrowRelease) |
941 |
AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false) |
|
8618 | 942 |
AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, 0, -1000000, 34) |
943 |
||
944 |
--cries |
|
945 |
elseif(kergulenSpecial == 5) |
|
7893 | 946 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
947 |
runOnGears(weapon_cries_a) |
7893 | 948 |
if(kergulenSpecial~=-1) |
949 |
then |
|
950 |
AddGear(0, 0, gtWaterUp, 0, 0,0,0) |
|
951 |
PlaySound(sndWarp) |
|
952 |
PlaySound(sndMolotov) |
|
953 |
||
8618 | 954 |
temp_val=0 |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
955 |
runOnGears(weapon_cries_b) |
8618 | 956 |
SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+temp_val) |
7893 | 957 |
else |
958 |
HogSay(CurrentHedgehog, loc("Hogs in sight!"), SAY_SAY) |
|
959 |
end |
|
8618 | 960 |
|
961 |
--sabotage |
|
962 |
elseif(kergulenSpecial == 6) |
|
7893 | 963 |
then |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
964 |
runOnGears(weapon_sabotage) |
7893 | 965 |
end |
966 |
DeleteVisualGear(visualcircle) |
|
967 |
visualcircle=nil |
|
8618 | 968 |
|
969 |
elseif(GetCurAmmoType() == amVampiric) |
|
970 |
then |
|
971 |
VampOn=75 |
|
7893 | 972 |
end |
973 |
--Australian special |
|
974 |
if(GetGearType(austmine) == gtMine and austmine ~= nil) |
|
975 |
then |
|
976 |
temp_val=0 |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
977 |
runOnGears(weapon_aust_check) |
7893 | 978 |
|
979 |
if(gearIsInCircle(austmine,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 30, false)==false or temp_val==1) |
|
980 |
then |
|
981 |
AddVisualGear(GetX(austmine), GetY(austmine), vgtDust, 0, false) |
|
982 |
DeleteGear(austmine) |
|
983 |
PlaySound(sndDenied) |
|
984 |
end |
|
985 |
||
986 |
austmine=nil |
|
987 |
end |
|
988 |
||
8618 | 989 |
--stop sabotage (avoiding a bug) |
7893 | 990 |
if(disable_moving[CurrentHedgehog]==true) |
991 |
then |
|
992 |
disable_moving[CurrentHedgehog]=false |
|
8618 | 993 |
onsabotageai=false |
994 |
SetHogLevel(CurrentHedgehog,disableoffsetai) |
|
7893 | 995 |
end |
996 |
||
997 |
australianSpecial=false |
|
998 |
end |
|
999 |
||
1000 |
function onGearAdd(gearUid) |
|
1001 |
swapweps=false |
|
1002 |
||
8618 | 1003 |
--track the gears im using |
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
1004 |
if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
1005 |
then |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
1006 |
trackGear(gearUid) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
1007 |
end |
7893 | 1008 |
|
1009 |
--remove gasclouds on gasbombspecial |
|
1010 |
if(GetGearType(gearUid)==gtPoisonCloud and samericanSpecial == true) |
|
1011 |
then |
|
1012 |
DeleteGear(gearUid) |
|
1013 |
||
1014 |
elseif(GetGearType(gearUid)==gtSMine) |
|
1015 |
then |
|
1016 |
vx,vy=GetGearVelocity(gearUid) |
|
1017 |
if(africaspecial2 == 1) |
|
1018 |
then |
|
1019 |
SetState(CurrentHedgehog, gstHHDriven+gstMoving) |
|
1020 |
SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog),GetY(CurrentHedgehog)-3) |
|
1021 |
SetGearVelocity(CurrentHedgehog, vx, vy) |
|
1022 |
DeleteGear(gearUid) |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
1023 |
|
7893 | 1024 |
elseif(africaspecial2 == 2) |
1025 |
then |
|
1026 |
fire_gear(CurrentHedgehog,gtNapalmBomb, vx, vy, 0) |
|
1027 |
DeleteGear(gearUid) |
|
1028 |
end |
|
1029 |
||
1030 |
elseif(GetGearType(gearUid)==gtSniperRifleShot) |
|
1031 |
then |
|
1032 |
sniper_s_in_use=true |
|
1033 |
if(namericanSpecial~=1) |
|
1034 |
then |
|
1035 |
SetHealth(gearUid, 1) |
|
1036 |
end |
|
1037 |
||
1038 |
elseif(GetGearType(gearUid)==gtShotgunShot) |
|
1039 |
then |
|
1040 |
if(shotgun_s==true) |
|
1041 |
then |
|
1042 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false) |
|
1043 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false) |
|
1044 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false) |
|
1045 |
PlaySound(sndBirdyLay) |
|
1046 |
else |
|
1047 |
shotgun_s=nil |
|
1048 |
end |
|
1049 |
||
1050 |
elseif(GetGearType(gearUid)==gtMolotov and europe_s==1) |
|
1051 |
then |
|
1052 |
vx,vy=GetGearVelocity(gearUid) |
|
1053 |
e_health=fire_gear(CurrentHedgehog,gtCluster, vx, vy, 1) |
|
1054 |
SetGearMessage(e_health, 2) |
|
1055 |
DeleteGear(gearUid) |
|
1056 |
||
1057 |
elseif(GetGearType(gearUid)==gtParachute) |
|
1058 |
then |
|
1059 |
inpara=gearUid |
|
1060 |
end |
|
1061 |
end |
|
1062 |
||
1063 |
function onGearDelete(gearUid) |
|
1064 |
||
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
1065 |
if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
1066 |
then |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
1067 |
trackDeletion(gearUid) |
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
1068 |
end |
8618 | 1069 |
|
1070 |
--north american lipstick |
|
7893 | 1071 |
if(GetGearType(gearUid)==gtSniperRifleShot ) |
1072 |
then |
|
1073 |
sniper_s_in_use=false |
|
1074 |
if(namericanSpecial==2) |
|
1075 |
then |
|
1076 |
temp_val=gearUid |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
1077 |
runOnGears(weapon_lipstick) |
7893 | 1078 |
|
1079 |
elseif(namericanSpecial==3) |
|
1080 |
then |
|
1081 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false) |
|
1082 |
||
1083 |
pinata=AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 5) |
|
1084 |
SetGearMessage(pinata,1) |
|
1085 |
end |
|
1086 |
||
8618 | 1087 |
--north american pinata |
7893 | 1088 |
elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==1 and namericanSpecial==3) |
1089 |
then |
|
7895
ac1610a7b7fa
apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents:
7893
diff
changeset
|
1090 |
AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 20) |
7893 | 1091 |
|
8618 | 1092 |
--north american eagle eye |
7893 | 1093 |
elseif(GetGearType(gearUid)==gtShotgunShot and shotgun_s==true) |
1094 |
then |
|
1095 |
SetState(CurrentHedgehog, gstMoving) |
|
1096 |
SetGearPosition(CurrentHedgehog, GetX(gearUid), GetY(gearUid)+7) |
|
1097 |
PlaySound(sndWarp) |
|
1098 |
||
1099 |
--south american special |
|
1100 |
elseif(GetGearType(gearUid)==gtGasBomb and samericanSpecial == true) |
|
1101 |
then |
|
1102 |
temp_val=gearUid |
|
1103 |
runOnGears(weapon_anno_south) |
|
1104 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false) |
|
8618 | 1105 |
|
1106 |
--asian special |
|
7893 | 1107 |
elseif(GetGearType(gearUid)==gtSnowball and GetGearMessage(gearUid)==1) |
1108 |
then |
|
8618 | 1109 |
AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 22) |
1110 |
||
1111 |
--europe special |
|
7893 | 1112 |
elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==2) |
1113 |
then |
|
1114 |
temp_val=gearUid |
|
1115 |
runOnGears(weapon_health) |
|
1116 |
visual_gear_explosion(100,GetX(gearUid), GetY(gearUid),vgtSmokeWhite,vgtSmokeWhite) |
|
1117 |
AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false) |
|
1118 |
PlaySound(sndGraveImpact) |
|
8618 | 1119 |
|
1120 |
--asia (using para) |
|
7893 | 1121 |
elseif(GetGearType(gearUid)==gtParachute) |
1122 |
then |
|
1123 |
inpara=false |
|
1124 |
end |
|
7936 | 1125 |
end |
8618 | 1126 |
--[[ |
1127 |
sources (populations & area): |
|
1128 |
Wikipedia |
|
1129 |
Own calculations |
|
1130 |
if you think they are wrong, then please tell me :) |
|
1131 |
]] |