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