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