share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua
branch0.9.18
changeset 7895 ac1610a7b7fa
parent 7893 50e8f6714b22
child 7936 9f44e39d856c
equal deleted inserted replaced
7893:50e8f6714b22 7895:ac1610a7b7fa
     1 --kolla stavning
       
     2 --[[
     1 --[[
     3 -fixed so you cant be sabotaged on your selecting continent turn
     2 Continental Supplies version 1.1a
     4 -moved translations to default locale file.
     3 
     5 
     4 Copyright (C) 2012 Vatten
     6 -NA
     5 
     7 	-moved lipstick bullet and pinata bullet to sniperrifle - pinatabullet deals ~23 on direct hit
     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:
     8 	-added eagle eye on shotgun (teleport)
     7 
     9 -SA
     8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    10 	-reduced duration on birdy from 2 to 1
     9 
    11 	-reduced duration on bee  from 2 to 1
    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.
    12 	-fixed anno 1032
       
    13 	-reduced  donut ring with 25% on anno 1032
       
    14 	-reduced push power
       
    15 	-reduced birdy from unlimited to 5
       
    16 	-unlimited bees
       
    17 -EU
       
    18 	-increased jetpack from 2 to 3
       
    19 	added medicine on molotov
       
    20 -AF
       
    21 	-fixed Hedgehog projectile
       
    22 	-reduced drillstrike from 2 to 1
       
    23 	-increased sticky bomb from 6 to 7
       
    24 -AS
       
    25 	-reduced damage on parabomb from 27 to 22
       
    26 	-increased duration on hellish from 4 to 5
       
    27 	-per round limit on rope to 3
       
    28 -AUS
       
    29 	-fixed baseballbat (mine) range and awareness
       
    30 -AN
       
    31 	-reduced teleport from 3 to 2
       
    32 	-changed portalgun so you will only be able to use it 1s per turn
       
    33 -KER
       
    34 	-reduced damage on sabotage from 40% to 0%
       
    35 	-renamed sabotage so it will sabotage all hogs in the circle + fire up a flare (bomb) + more bombs depending on the amount of hogs
       
    36 	-increased range on flare (sabotage) with 50%
       
    37 	-changed scream of walrus so it will deal 20 dmg and 10% of your hogs health
       
    38 	-sabotage will now visually "boil"
       
    39 	-added 4 freezers
       
    40 -ZE
       
    41 	-fixed random system alot.
       
    42 	-you will get 3-1 weapons
       
    43 	-you can now watch your weapon under your turn
       
    44 ]]
    11 ]]
    45 
       
    46 --Based on Hadashi:s idea, then largely modified
       
    47 --Made By Vatten 2012
       
    48 
    12 
    49 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
    13 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
    50 loadfile(GetDataPath() .. "Scripts/Utils.lua")()
    14 loadfile(GetDataPath() .. "Scripts/Utils.lua")()
    51 loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
    15 loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
    52 
       
    53 --0.9.17
       
    54 --[[
       
    55 function div(val1,val2)
       
    56 	return val1/val2
       
    57 end
       
    58 
       
    59 function ddiv(val1,val2)
       
    60 	return div(val1*100,val2)*0.01
       
    61 end
       
    62 ]]
       
    63 
    16 
    64 function int_sqrt(num)
    17 function int_sqrt(num)
    65 	temp=num
    18 	temp=num
    66 	while(temp*temp-div(temp,2)>num)
    19 	while(temp*temp-div(temp,2)>num)
    67 	do
    20 	do
    68 		temp=div((temp+div(num,temp)),2)
    21 		temp=div((temp+div(num,temp)),2)
    69 	end
    22 	end
    70 	return math.abs(temp)
    23 	return math.abs(temp)
    71 end
    24 end
    72 
    25 
    73 function hypotenusa(xx,yy)
    26 function norm(xx,yy)
    74 	--return math.abs(yy)/math.sin(math.atan(math.abs(yy)/math.abs(xx)))
       
    75 	--AddCaption(int_sqrt((xx^2)+(yy^2)))
       
    76 	return int_sqrt((xx^2)+(yy^2))
    27 	return int_sqrt((xx^2)+(yy^2))
       
    28 end
       
    29 
       
    30 function positive(num)
       
    31 	if(num<0)
       
    32 	then
       
    33 		return -1
       
    34 	else
       
    35 		return 1
       
    36 	end
    77 end
    37 end
    78 
    38 
    79 local teams_ok = {}
    39 local teams_ok = {}
    80 local wepcode_teams={}
    40 local wepcode_teams={}
    81 local swapweps=false
    41 local swapweps=false
   125 }
    85 }
   126 
    86 
   127 local weaponsets = 
    87 local weaponsets = 
   128 {
    88 {
   129 {loc("North America"),"Area: 24,709,000 km2, Population: 528,720,588",loc("Special Weapons:").."|"..loc("Shotgun")..": "..weapontexts[13].."|"..loc("Sniper Rifle")..": "..weapontexts[1].."|"..loc("Sniper Rifle")..": "..weapontexts[2],amSniperRifle,
    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,
   130 {{amShotgun,100},{amDEagle,100},{amLaserSight,4},{amSniperRifle,100},{amCake,1},{amAirAttack,3},{amSwitch,6}}},
    90 {{amShotgun,100},{amDEagle,100},{amLaserSight,4},{amSniperRifle,100},{amCake,1},{amAirAttack,2},{amSwitch,6}}},
   131 
    91 
   132 {loc("South America"),"Area: 17,840,000 km2, Population: 387,489,196 ",loc("Special Weapons:").."|"..loc("GasBomb")..": "..weapontexts[3],amGasBomb,
    92 {loc("South America"),"Area: 17,840,000 km2, Population: 387,489,196 ",loc("Special Weapons:").."|"..loc("GasBomb")..": "..weapontexts[3],amGasBomb,
   133 {{amBirdy,5},{amHellishBomb,1},{amBee,100},{amWhip,100},{amGasBomb,100},{amFlamethrower,100},{amNapalm,2},{amExtraDamage,3}}},
    93 {{amBirdy,5},{amHellishBomb,1},{amBee,100},{amWhip,100},{amGasBomb,100},{amFlamethrower,100},{amNapalm,1},{amExtraDamage,2}}},
   134 
    94 
   135 {loc("Europe"),"Area: 10,180,000 km2, Population: 739,165,030",loc("Special Weapons:").."|"..loc("Molotov")..": "..weapontexts[14],amBazooka,
    95 {loc("Europe"),"Area: 10,180,000 km2, Population: 739,165,030",loc("Special Weapons:").."|"..loc("Molotov")..": "..weapontexts[14],amBazooka,
   136 {{amBazooka,100},{amGrenade,100},{amMortar,100},{amClusterBomb,5},{amMolotov,5},{amVampiric,4},{amPiano,1},{amResurrector,2},{amJetpack,2}}},
    96 {{amBazooka,100},{amGrenade,100},{amMortar,100},{amClusterBomb,5},{amMolotov,5},{amVampiric,4},{amPiano,1},{amResurrector,2},{amJetpack,2}}},
   137 
    97 
   138 {loc("Africa"),"Area: 30,221,532 km2, Population: 1,032,532,974",loc("Special Weapons:").."|"..loc("Seduction")..": "..weapontexts[4].."|"..loc("Sticky Mine")..": "..weapontexts[11].."|"..loc("Sticky Mine")..": "..weapontexts[12],amSMine,
    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,
   139 {{amSMine,6},{amWatermelon,1},{amDrillStrike,1},{amExtraTime,2},{amDrill,100},{amLandGun,3},{amSeduction,100}}},
    99 {{amSMine,6},{amWatermelon,1},{amDrillStrike,1},{amExtraTime,2},{amDrill,100},{amLandGun,3},{amSeduction,100}}},
   140 
   100 
   141 {loc("Asia"),"Area: 44,579,000 km2, Population: 3,879,000,000",loc("- Will refresh Rope each turn to 3.").."|"..loc("Special Weapons:").."|"..loc("Parachute")..": "..weapontexts[6],amRope,
   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,
   142 {{amKamikaze,4},{amRope,100},{amFirePunch,100},{amParachute,1},{amKnife,3}}},
   102 {{amKamikaze,4},{amRope,100},{amFirePunch,100},{amParachute,1},{amKnife,4},{amDynamite,1}}},
   143 
   103 
   144 {loc("Australia"),"Area:  8,468,300 km2, Population: 31,260,000",loc("Special Weapons:").."|"..loc("Baseballbat")..": "..weapontexts[5],amBaseballBat,
   104 {loc("Australia"),"Area:  8,468,300 km2, Population: 31,260,000",loc("Special Weapons:").."|"..loc("Baseballbat")..": "..weapontexts[5],amBaseballBat,
   145 {{amBaseballBat,100},{amMine,100},{amLowGravity,6},{amBlowTorch,100},{amRCPlane,2},{amTardis,100}}},
   105 {{amBaseballBat,100},{amMine,100},{amLowGravity,6},{amBlowTorch,100},{amRCPlane,2},{amTardis,100}}},
   146 
   106 
   147 {loc("Antarctica"),"Area: 14,000,000 km2, Population: ~1,000",loc("- Will refresh portalgun each turn."),amTeleport,
   107 {loc("Antarctica"),"Area: 14,000,000 km2, Population: ~1,000",loc("- Will refresh portalgun each turn."),amTeleport,
   148 {{amSnowball,4},{amTeleport,2},{amInvulnerable,6},{amPickHammer,100},{amSineGun,6},{amGirder,4},{amPortalGun,1},{amDynamite,1}}},
   108 {{amSnowball,4},{amTeleport,2},{amInvulnerable,6},{amPickHammer,100},{amSineGun,100},{amGirder,4},{amPortalGun,1}}},
   149 
   109 
   150 {loc("Kerguelen"),"Area: 1,100,000 km2, Population: ~70",loc("Special Weapons:").."|"..loc("Structure")..": "..weapontexts[7].."|"..loc("Structure")..": "..weapontexts[8].." ("..loc("Duration")..": 2)|"..loc("Structure")..": "..weapontexts[9].."|"..loc("Structure")..": "..weapontexts[10],amStructure,
   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,
   151 {{amHammer,100},{amMineStrike,2},{amBallgun,1},{amStructure,100},{amIceGun,4}}},
   111 {{amHammer,100},{amMineStrike,2},{amBallgun,1},{amStructure,100}}},
   152 --{{amHammer,100},{amMineStrike,2},{amBallgun,1},{amStructure,100}}},
   112 --no ,{amIceGun,4} for 0.9.18
   153 
   113 
   154 {loc("Zealandia"),"Area: 3,500,000 km2, Population: 4,650,000",loc("- Will Get 1-3 random weapons"),amInvulnerable,
   114 {loc("Zealandia"),"Area: 3,500,000 km2, Population: 4,650,000",loc("- Will Get 1-3 random weapons"),amInvulnerable,
   155 {{amBazooka,1},{amBlowTorch,1},{amSwitch,1}}}
   115 {{amBazooka,1},{amBlowTorch,1},{amSwitch,1}}}
   156 }
   116 }
   157 
   117 
   162 	{amBazooka, 0, 1, 0, 1, 0},
   122 	{amBazooka, 0, 1, 0, 1, 0},
   163 	{amMineStrike, 0, 1, 5, 1, 2},
   123 	{amMineStrike, 0, 1, 5, 1, 2},
   164 	{amGrenade, 0, 1, 0, 1, 0},
   124 	{amGrenade, 0, 1, 0, 1, 0},
   165 	{amPiano, 0, 1, 5, 1, 1},
   125 	{amPiano, 0, 1, 5, 1, 1},
   166 	{amClusterBomb, 0, 1, 0, 1, 0},
   126 	{amClusterBomb, 0, 1, 0, 1, 0},
   167 	{amBee, 0, 1, 1, 1, 0},
   127 	{amBee, 0, 1, 0, 1, 0},
   168 	{amShotgun, 0, 0, 0, 1, 1},
   128 	{amShotgun, 0, 0, 0, 1, 1},
   169 	{amMine, 0, 1, 0, 1, 0},
   129 	{amMine, 0, 1, 0, 1, 0},
   170 	{amSniperRifle, 0, 1, 0, 1, 1},
   130 	{amSniperRifle, 0, 1, 0, 1, 1},
   171 	{amDEagle, 0, 1, 0, 1, 0},
   131 	{amDEagle, 0, 1, 0, 1, 0},
   172 	{amDynamite, 0, 1, 0, 1, 1},
   132 	{amDynamite, 0, 1, 5, 1, 1},
   173 	{amFirePunch, 0, 1, 0, 1, 0},
   133 	{amFirePunch, 0, 1, 0, 1, 0},
   174 	{amHellishBomb, 0, 1, 5, 1, 2},
   134 	{amHellishBomb, 0, 1, 5, 1, 2},
   175 	{amWhip, 0, 1, 0, 1, 0},
   135 	{amWhip, 0, 1, 0, 1, 0},
   176 	{amNapalm, 0, 1, 5, 1, 2},
   136 	{amNapalm, 0, 1, 5, 1, 2},
   177 	{amPickHammer, 0, 1, 0, 1, 0},
   137 	{amPickHammer, 0, 1, 0, 1, 0},
   205 	{amInvulnerable, 0, 1, 0, 1, 0},
   165 	{amInvulnerable, 0, 1, 0, 1, 0},
   206 	{amExtraTime, 0, 1, 0, 1, 0},
   166 	{amExtraTime, 0, 1, 0, 1, 0},
   207 	{amLaserSight, 0, 1, 0, 1, 0},
   167 	{amLaserSight, 0, 1, 0, 1, 0},
   208 	{amVampiric, 0, 1, 0, 1, 0},
   168 	{amVampiric, 0, 1, 0, 1, 0},
   209 	{amJetpack, 0, 1, 0, 1, 1},
   169 	{amJetpack, 0, 1, 0, 1, 1},
   210 	{amPortalGun, 0, 1, 3, 1, 1},
   170 	{amPortalGun, 0, 1, 2, 1, 1},
   211 	{amResurrector, 0, 1, 3, 1, 0},
   171 	{amResurrector, 0, 1, 3, 1, 0},
   212 	{amTeleport, 0, 1, 0, 1, 0},
   172 	{amTeleport, 0, 1, 0, 1, 0},
   213 	{amLandGun, 0, 1, 0, 1, 0},
   173 	{amLandGun, 0, 1, 0, 1, 0},
   214 	{amTardis, 0, 1, 0, 1, 0},
   174 	{amTardis, 0, 1, 0, 1, 0},
   215 	{amIceGun, 0, 1, 0, 1, 0},
   175 	{amIceGun, 0, 1, 0, 1, 0},
   285 	end
   245 	end
   286 end
   246 end
   287 
   247 
   288 --zealandia
   248 --zealandia
   289 function get_random_weapon(hog)
   249 function get_random_weapon(hog)
   290 	local random_weapon = 0
   250 	if(GetGearType(hog) == gtHedgehog)
   291 	local old_rand_weap = 0
   251 	then
   292 	local rand_weaponset_power = 0
   252 		local random_weapon = 0
   293 	
   253 		local old_rand_weap = 0
   294 	if(continent[GetHogTeamName(hog)]==9 and (getTeamValue(GetHogTeamName(hog), "rand-done-turn")==false or getTeamValue(GetHogTeamName(hog), "rand-done-turn")==nil))
   254 		local rand_weaponset_power = 0
   295 	then
   255 		
   296 		cleanweps(hog)
   256 		if(continent[GetHogTeamName(hog)]==9 and (getTeamValue(GetHogTeamName(hog), "rand-done-turn")==false or getTeamValue(GetHogTeamName(hog), "rand-done-turn")==nil))
   297 	
   257 		then
   298 		random_weapon = GetRandom(table.getn(weapons_dmg))+1
   258 			cleanweps(hog)
   299 		while(weapons_dmg[random_weapon][4]>TotalRounds)
   259 		
   300 		do
       
   301 			if(random_weapon>=table.getn(weapons_dmg))
       
   302 			then
       
   303 				random_weapon=0
       
   304 			end
       
   305 			random_weapon = random_weapon+1
       
   306 		end
       
   307 		validate_weapon(hog, weapons_dmg[random_weapon][1],1)
       
   308 		rand_weaponset_power=weapons_dmg[random_weapon][6]
       
   309 		old_rand_weap = random_weapon
       
   310 		
       
   311 		if(rand_weaponset_power <2)
       
   312 		then
       
   313 			random_weapon = GetRandom(table.getn(weapons_supp))+1
       
   314 			while(weapons_supp[random_weapon][4]>TotalRounds or rand_weaponset_power+weapons_supp[random_weapon][6]>2)
       
   315 			do
       
   316 				if(random_weapon>=table.getn(weapons_supp))
       
   317 				then
       
   318 					random_weapon=0
       
   319 				end
       
   320 				random_weapon = random_weapon+1
       
   321 			end
       
   322 			validate_weapon(hog, weapons_supp[random_weapon][1],1)
       
   323 			rand_weaponset_power=rand_weaponset_power+weapons_supp[random_weapon][6]
       
   324 		end
       
   325 		--check again if  the power is enough
       
   326 		if(rand_weaponset_power <1)
       
   327 		then
       
   328 			random_weapon = GetRandom(table.getn(weapons_dmg))+1
   260 			random_weapon = GetRandom(table.getn(weapons_dmg))+1
   329 			while(weapons_dmg[random_weapon][4]>TotalRounds or old_rand_weap == random_weapon or weapons_dmg[random_weapon][6]>0)
   261 			while(weapons_dmg[random_weapon][4]>TotalRounds)
   330 			do
   262 			do
   331 				if(random_weapon>=table.getn(weapons_dmg))
   263 				if(random_weapon>=table.getn(weapons_dmg))
   332 				then
   264 				then
   333 					random_weapon=0
   265 					random_weapon=0
   334 				end
   266 				end
   335 				random_weapon = random_weapon+1
   267 				random_weapon = random_weapon+1
   336 			end
   268 			end
   337 			validate_weapon(hog, weapons_dmg[random_weapon][1],1)
   269 			validate_weapon(hog, weapons_dmg[random_weapon][1],1)
   338 		end
   270 			rand_weaponset_power=weapons_dmg[random_weapon][6]
       
   271 			old_rand_weap = random_weapon
   339 			
   272 			
   340 		setTeamValue(GetHogTeamName(hog), "rand-done-turn", true)
   273 			if(rand_weaponset_power <2)
   341 		
   274 			then
   342 		if(GetHogTeamName(hog)==GetHogTeamName(CurrentHedgehog))
   275 				random_weapon = GetRandom(table.getn(weapons_supp))+1
   343 		then
   276 				while(weapons_supp[random_weapon][4]>TotalRounds or rand_weaponset_power+weapons_supp[random_weapon][6]>2)
   344 			temp_val=false
   277 				do
       
   278 					if(random_weapon>=table.getn(weapons_supp))
       
   279 					then
       
   280 						random_weapon=0
       
   281 					end
       
   282 					random_weapon = random_weapon+1
       
   283 				end
       
   284 				validate_weapon(hog, weapons_supp[random_weapon][1],1)
       
   285 				rand_weaponset_power=rand_weaponset_power+weapons_supp[random_weapon][6]
       
   286 			end
       
   287 			--check again if  the power is enough
       
   288 			if(rand_weaponset_power <1)
       
   289 			then
       
   290 				random_weapon = GetRandom(table.getn(weapons_dmg))+1
       
   291 				while(weapons_dmg[random_weapon][4]>TotalRounds or old_rand_weap == random_weapon or weapons_dmg[random_weapon][6]>0)
       
   292 				do
       
   293 					if(random_weapon>=table.getn(weapons_dmg))
       
   294 					then
       
   295 						random_weapon=0
       
   296 					end
       
   297 					random_weapon = random_weapon+1
       
   298 				end
       
   299 				validate_weapon(hog, weapons_dmg[random_weapon][1],1)
       
   300 			end
       
   301 				
       
   302 			setTeamValue(GetHogTeamName(hog), "rand-done-turn", true)
       
   303 			
       
   304 			if(GetHogTeamName(hog)==GetHogTeamName(CurrentHedgehog))
       
   305 			then
       
   306 				temp_val=false
       
   307 			end
   345 		end
   308 		end
   346 	end
   309 	end
   347 end
   310 end
   348 
   311 
   349 
   312 
   353 	load_weaponset(CurrentHedgehog,continent[GetHogTeamName(CurrentHedgehog)])
   316 	load_weaponset(CurrentHedgehog,continent[GetHogTeamName(CurrentHedgehog)])
   354 	if(skipafter==true)
   317 	if(skipafter==true)
   355 	then
   318 	then
   356 		ParseCommand("setweap " .. string.char(amSkip))
   319 		ParseCommand("setweap " .. string.char(amSkip))
   357 	end
   320 	end
   358 	
   321 
   359 	--AddCaption(loc("You have recieved weapons from ") .. weaponsets[continent[GetHogTeamName(CurrentHedgehog)]][1] .. "!")
       
   360 	show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],0)
   322 	show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],0)
   361 end
   323 end
   362 
   324 
   363 function show_damage_tag(hog,damage)
   325 function show_damage_tag(hog,damage)
   364 	healthtag=AddVisualGear(GetX(hog), GetY(hog), vgtHealthTag, damage, false)
   326 	healthtag=AddVisualGear(GetX(hog), GetY(hog), vgtHealthTag, damage, false)
   365 	v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 = GetVisualGearValues(healthtag)
   327 	v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 = GetVisualGearValues(healthtag)
   366 	SetVisualGearValues(healthtag, v1, v2, v3, v4, v5, v6, v7, v8, v9, GetClanColor(GetHogClan(hog)))
   328 	SetVisualGearValues(healthtag, v1, v2, v3, v4, v5, v6, v7, v8, v9, GetClanColor(GetHogClan(hog)))
   367 end
   329 end
   368 
   330 
   369 function fire_gear(hedgehog,geartype,vx,vy,timer)
   331 function fire_gear(hedgehog,geartype,vx,vy,timer)
   370 	return AddGear(div((GetGearRadius(hedgehog)*2*vx),hypotenusa(vx,vy))+GetX(hedgehog), div((GetGearRadius(hedgehog)*2*vy),hypotenusa(vx,vy))+GetY(hedgehog), geartype, 0, vx, vy, timer)
   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)
   371 end
   333 end
   372 
   334 
   373 --==========================run throw all hog/gear weapons ==========================
   335 --==========================run throw all hog/gear weapons ==========================
   374 function weapon_aust_check(hog)
   336 function weapon_aust_check(hog)
   375 	if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 50, false)==true and hog ~= CurrentHedgehog)
   337 	if(GetGearType(hog) == gtHedgehog)
   376 	then
   338 	then
   377 		temp_val=1
   339 		if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 50, false)==true and hog ~= CurrentHedgehog)
       
   340 		then
       
   341 			temp_val=1
       
   342 		end
   378 	end
   343 	end
   379 end
   344 end
   380 
   345 
   381 function weapon_duststorm(hog)
   346 function weapon_duststorm(hog)
   382 	local dmg=20
   347 	if(GetGearType(hog) == gtHedgehog)
   383 	if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 250, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
   348 	then
   384 	then
   349 		local dmg=20
   385 		if(GetHealth(hog) > dmg)
   350 		if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 250, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
   386 		then
   351 		then
   387 			SetHealth(hog, GetHealth(hog)-dmg)
   352 			if(GetHealth(hog) > dmg)
   388 		else
   353 			then
   389 			SetHealth(hog, 0)
   354 				SetHealth(hog, GetHealth(hog)-dmg)
   390 		end
   355 			else
   391 		show_damage_tag(hog,dmg)
   356 				SetHealth(hog, 0)
       
   357 			end
       
   358 			show_damage_tag(hog,dmg)
       
   359 		end
   392 	end
   360 	end
   393 end
   361 end
   394 
   362 
   395 function weapon_scream_walrus(hog)
   363 function weapon_scream_walrus(hog)
   396 	if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 120, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
   364 	if(GetGearType(hog) == gtHedgehog)
   397 	then
   365 	then
   398 		if(GetHealth(hog)>(20+GetHealth(CurrentHedgehog)*0.1))
   366 		if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 120, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
   399 		then
   367 		then
   400 			SetHealth(hog, GetHealth(hog)-(20+GetHealth(CurrentHedgehog)*0.1))
   368 			if(GetHealth(hog)>(20+GetHealth(CurrentHedgehog)*0.1))
   401 			temp_val=temp_val+10+GetHealth(CurrentHedgehog)*0.05
   369 			then
   402 		else
   370 				SetHealth(hog, GetHealth(hog)-(20+GetHealth(CurrentHedgehog)*0.1))
   403 			SetHealth(hog, 0)
   371 				temp_val=temp_val+10+GetHealth(CurrentHedgehog)*0.05
   404 			temp_val=temp_val+(GetHealth(hog)*0.5)+(GetHealth(CurrentHedgehog)*0.05)
   372 			else
   405 		end
   373 				SetHealth(hog, 0)
   406 		show_damage_tag(hog,(20+GetHealth(CurrentHedgehog)*0.1))
   374 				temp_val=temp_val+(GetHealth(hog)*0.5)+(GetHealth(CurrentHedgehog)*0.05)
   407 		AddVisualGear(GetX(hog), GetY(hog), vgtExplosion, 0, false)
   375 			end
   408 		AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
   376 			show_damage_tag(hog,(20+GetHealth(CurrentHedgehog)*0.1))
       
   377 			AddVisualGear(GetX(hog), GetY(hog), vgtExplosion, 0, false)
       
   378 			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
       
   379 		end
   409 	end
   380 	end
   410 end
   381 end
   411 
   382 
   412 function weapon_swap_kerg(hog)
   383 function weapon_swap_kerg(hog)
   413 	if(kergulenSpecial ~= -1 and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 450, false))
   384 	if(GetGearType(hog) == gtHedgehog)
   414 	then
   385 	then
   415 		local thisX=GetX(CurrentHedgehog)
   386 		if(kergulenSpecial ~= -1 and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 450, false))
   416 		local thisY=GetY(CurrentHedgehog)
   387 		then
   417 		SetGearPosition(CurrentHedgehog, GetX(hog), GetY(hog))
   388 			local thisX=GetX(CurrentHedgehog)
   418 		SetGearPosition(hog, thisX, thisY)
   389 			local thisY=GetY(CurrentHedgehog)
   419 		kergulenSpecial=-1
   390 			SetGearPosition(CurrentHedgehog, GetX(hog), GetY(hog))
       
   391 			SetGearPosition(hog, thisX, thisY)
       
   392 			kergulenSpecial=-1
       
   393 		end
   420 	end
   394 	end
   421 end
   395 end
   422 
   396 
   423 function weapon_flare(hog)
   397 function weapon_flare(hog)
   424 	if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 45, false))
   398 	if(GetGearType(hog) == gtHedgehog)
   425 	then
   399 	then
   426 		if(GetX(hog)<=GetX(CurrentHedgehog))
   400 		if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 45, false))
   427 		then
   401 		then
   428 			dirker=1
   402 			if(GetX(hog)<=GetX(CurrentHedgehog))
   429 		else
   403 			then
   430 			dirker=-1
   404 				dirker=1
   431 		end
   405 			else
   432 		AddVisualGear(GetX(hog), GetY(hog), vgtFire, 0, false)
   406 				dirker=-1
   433 		SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog), GetY(CurrentHedgehog)-5)
   407 			end
   434 		SetGearVelocity(CurrentHedgehog, 100000*dirker, -300000)
   408 			AddVisualGear(GetX(hog), GetY(hog), vgtFire, 0, false)
   435 		AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, -10000*dirker, -1000000, 35)
   409 			SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog), GetY(CurrentHedgehog)-5)
   436 		PlaySound(sndHellishImpact2)
   410 			SetGearVelocity(CurrentHedgehog, 100000*dirker, -300000)
       
   411 			AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, -10000*dirker, -1000000, 35)
       
   412 			PlaySound(sndHellishImpact2)
       
   413 		end
   437 	end
   414 	end
   438 end
   415 end
   439 
   416 
   440 function weapon_sabotage(hog)
   417 function weapon_sabotage(hog)
   441 	if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 100, false))
   418 	if(GetGearType(hog) == gtHedgehog)
   442 	then
   419 	then
   443 		disable_moving[hog]=true
   420 		if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 100, false))
   444 		AddGear(GetX(hog), GetY(hog), gtCluster, 0, 0, 0, 10)
   421 		then
   445 		PlaySound(sndNooo,hog)
   422 			disable_moving[hog]=true
       
   423 			AddGear(GetX(hog), GetY(hog), gtCluster, 0, 0, 0, 10)
       
   424 			PlaySound(sndNooo,hog)
       
   425 		end
   446 	end
   426 	end
   447 end
   427 end
   448 
   428 
   449 function weapon_anno_south(hog)
   429 function weapon_anno_south(hog)
   450 	local power_radius_outer=250
   430 	local power_radius_outer=250
   451 	local power_radius_inner=40
   431 	local power_radius_inner=40
   452 	local power_sa=6000
   432 	local power_sa=500000
   453 	if(gearIsInCircle(hog,GetX(temp_val), GetY(temp_val), power_radius_outer, false) and gearIsInCircle(hog,GetX(temp_val), GetY(temp_val), power_radius_inner, false)==false)
   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)
   454 	then
   434 	then
   455 		if(hog == CurrentHedgehog)
   435 		if(hog == CurrentHedgehog)
   456 		then
   436 		then
   457 			SetState(CurrentHedgehog, gstMoving)
   437 			SetState(CurrentHedgehog, gstMoving)
   458 		end
   438 		end
   459 		SetGearPosition(hog, GetX(hog),GetY(hog)-3)
   439 		SetGearPosition(hog, GetX(hog),GetY(hog)-3)
   460 		SetGearVelocity(hog, div((power_radius_outer-hypotenusa(math.abs(GetX(hog)-GetX(temp_val)),math.abs(GetY(hog)-GetY(temp_val))))*power_sa*(GetX(hog)-GetX(temp_val)),power_radius_outer), div((power_radius_outer-hypotenusa(math.abs(GetX(hog)-GetX(temp_val)),math.abs(GetY(hog)-GetY(temp_val))))*power_sa*(GetY(hog)-GetY(temp_val)),power_radius_outer))
   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))
   461 	end
   441 	end
   462 end
   442 end
   463 
   443 
   464 function weapon_cries_a(hog)
   444 function weapon_cries_a(hog)
   465 	if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 500, false))
   445 	if(GetGearType(hog) == gtHedgehog)
   466 	then
   446 	then
   467 		kergulenSpecial=-1
   447 		if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 500, false))
       
   448 		then
       
   449 			kergulenSpecial=-1
       
   450 		end
   468 	end
   451 	end
   469 end
   452 end
   470 
   453 
   471 function weapon_cries_b(hog)
   454 function weapon_cries_b(hog)
   472 	if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
   455 	if(GetGearType(hog) == gtHedgehog)
   473 	then
   456 	then
   474 		SetHealth(hog, GetHealth(hog)-1)
   457 		if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
   475 		show_damage_tag(hog,1)
   458 		then
   476 		AddVisualGear(GetX(hog), GetY(hog)-30, vgtEvilTrace, 0, false)
   459 			SetHealth(hog, GetHealth(hog)-1)
       
   460 			show_damage_tag(hog,1)
       
   461 			AddVisualGear(GetX(hog), GetY(hog)-30, vgtEvilTrace, 0, false)
       
   462 		end
   477 	end
   463 	end
   478 end
   464 end
   479 
   465 
   480 function weapon_lipstick(hog)
   466 function weapon_lipstick(hog)
   481 	if(gearIsInCircle(temp_val,GetX(hog), GetY(hog), 20, false))
   467 	if(GetGearType(hog) == gtHedgehog)
   482 	then
   468 	then
   483 		SetEffect(hog, hePoisoned, 1)
   469 		if(gearIsInCircle(temp_val,GetX(hog), GetY(hog), 20, false))
   484 		PlaySound(sndBump)
   470 		then
       
   471 			SetEffect(hog, hePoisoned, 1)
       
   472 			PlaySound(sndBump)
       
   473 		end
   485 	end
   474 	end
   486 end
   475 end
   487 
   476 
   488 function weapon_health(hog)
   477 function weapon_health(hog)
   489 	if(gearIsInCircle(temp_val,GetX(hog), GetY(hog), 100, false))
   478 	if(GetGearType(hog) == gtHedgehog)
   490 	then
   479 	then
   491 		SetHealth(hog, GetHealth(hog)+25)
   480 		if(gearIsInCircle(temp_val,GetX(hog), GetY(hog), 100, false))
   492 		SetEffect(hog, hePoisoned, false)
   481 		then
       
   482 			SetHealth(hog, GetHealth(hog)+25)
       
   483 			SetEffect(hog, hePoisoned, false)
       
   484 		end
   493 	end
   485 	end
   494 end
   486 end
   495 --============================================================================
   487 --============================================================================
   496 
   488 
   497 --set each weapons settings
   489 --set each weapons settings
   509 		SetAmmo(w[1], w[2], w[3], w[4], w[5])
   501 		SetAmmo(w[1], w[2], w[3], w[4], w[5])
   510 	end
   502 	end
   511 end
   503 end
   512 
   504 
   513 function onGameStart()
   505 function onGameStart()
   514 	trackTeams()
   506 	--trackTeams()
   515 
   507 
   516 	ShowMission(loc("Continental supplies").." 1.1a",loc("Let a Continent provide your weapons!"),
   508 	ShowMission(loc("Continental supplies").." 1.1a",loc("Let a Continent provide your weapons!"),
   517 	loc("- Per team weapons|- 9 weaponschemes|- Unique new weapons| |Select continent first round with the Weapon Menu or by ([switch/tab]=Increase,[presice/left shift]=Decrease) on Skip|Some weapons have a second option. Find them with [switch/tab]"), -amLowGravity, 0)
   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)
   518 end
   510 end
   519 
   511 
   553 		else
   545 		else
   554 			swapweps=false
   546 			swapweps=false
   555 			if(continent[GetHogTeamName(CurrentHedgehog)]==0)
   547 			if(continent[GetHogTeamName(CurrentHedgehog)]==0)
   556 			then
   548 			then
   557 				continent[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.getn(weaponsets))+1
   549 				continent[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.getn(weaponsets))+1
   558 				setweapons(true)
   550 				setweapons(false)
   559 			end
   551 			end
   560 			show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],-1)
   552 			show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],-1)
   561 		end
   553 		end
   562 	end
   554 	end
   563 	
   555 	
   570 		AddAmmo(CurrentHedgehog,amParachute,0)
   562 		AddAmmo(CurrentHedgehog,amParachute,0)
   571 		AddAmmo(CurrentHedgehog,amParachute,1)
   563 		AddAmmo(CurrentHedgehog,amParachute,1)
   572 	end
   564 	end
   573 	
   565 	
   574 	temp_val=true
   566 	temp_val=true
   575 	runOnHogs(get_random_weapon)
   567 	runOnGears(get_random_weapon)
   576 	
   568 	
   577 	if(temp_val==true and continent[GetHogTeamName(CurrentHedgehog)]==9 and getTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn")==true)
   569 	if(temp_val==true and continent[GetHogTeamName(CurrentHedgehog)]==9 and getTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn")==true)
   578 	then
   570 	then
   579 		setTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn", false)
   571 		setTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn", false)
   580 	end
   572 	end
   586 	
   578 	
   587 	--place mine (australia)
   579 	--place mine (australia)
   588 	if(GetCurAmmoType() == amBaseballBat and australianSpecial==true)
   580 	if(GetCurAmmoType() == amBaseballBat and australianSpecial==true)
   589 	then
   581 	then
   590 		temp_val=0
   582 		temp_val=0
   591 		runOnHogs(weapon_aust_check)
   583 		runOnGears(weapon_aust_check)
   592 		
   584 		
   593 		if(temp_val==0)
   585 		if(temp_val==0)
   594 		then
   586 		then
   595 			austmine=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+5, gtMine, 0, 0, 0, 0)
   587 			austmine=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+5, gtMine, 0, 0, 0, 0)
   596 			SetHealth(austmine, 100)
   588 			SetHealth(austmine, 100)
   843 	end
   835 	end
   844 	
   836 	
   845 	if(disable_moving[CurrentHedgehog]==true)
   837 	if(disable_moving[CurrentHedgehog]==true)
   846 	then
   838 	then
   847 	
   839 	
   848 		if(TurnTimeLeft<=3000)
   840 		if(TurnTimeLeft<=150)
   849 		then
   841 		then
   850 			disable_moving[CurrentHedgehog]=false
   842 			disable_moving[CurrentHedgehog]=false
   851 			SetHogLevel(CurrentHedgehog,0)
   843 			SetHogLevel(CurrentHedgehog,0)
   852 		elseif(disallowattack>=300 and disallowattack >= 400)
   844 		elseif(disallowattack>=15 and disallowattack >= 20)
   853 		then
   845 		then
   854 			disallowattack=0
   846 			disallowattack=0
   855 			SetHogLevel(CurrentHedgehog,1)
   847 			SetHogLevel(CurrentHedgehog,1)
   856 			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
   848 			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
   857 		elseif(GetHogLevel(CurrentHedgehog)==1)
   849 		elseif(GetHogLevel(CurrentHedgehog)==1)
   873 	--african special
   865 	--african special
   874 	if(africanSpecial == 1 and GetCurAmmoType() == amSeduction)
   866 	if(africanSpecial == 1 and GetCurAmmoType() == amSeduction)
   875 	then
   867 	then
   876 		SetState(CurrentHedgehog, gstAttacked)
   868 		SetState(CurrentHedgehog, gstAttacked)
   877 		
   869 		
   878 		runOnHogs(weapon_duststorm)
   870 		runOnGears(weapon_duststorm)
   879 
   871 
   880 		--visual stuff
   872 		--visual stuff
   881 		visual_gear_explosion(250,GetX(CurrentHedgehog), GetY(CurrentHedgehog),vgtSmoke,vgtSmokeWhite)
   873 		visual_gear_explosion(250,GetX(CurrentHedgehog), GetY(CurrentHedgehog),vgtSmoke,vgtSmokeWhite)
   882 		PlaySound(sndParachute)
   874 		PlaySound(sndParachute)
   883 	end
   875 	end
   887 	then
   879 	then
   888 		SetState(CurrentHedgehog, gstAttacked)
   880 		SetState(CurrentHedgehog, gstAttacked)
   889 		if(kergulenSpecial == 1)
   881 		if(kergulenSpecial == 1)
   890 		then
   882 		then
   891 			temp_val=0
   883 			temp_val=0
   892 			runOnHogs(weapon_scream_walrus)
   884 			runOnGears(weapon_scream_walrus)
   893 			SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+temp_val)
   885 			SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+temp_val)
   894 			PlaySound(sndHellish)
   886 			PlaySound(sndHellish)
   895 			
   887 			
   896 		elseif(kergulenSpecial == 2 and TotalRounds>=1)
   888 		elseif(kergulenSpecial == 2 and TotalRounds>=1)
   897 		then
   889 		then
   898 			runOnHogs(weapon_swap_kerg)
   890 			runOnGears(weapon_swap_kerg)
   899 			PlaySound(sndPiano3)
   891 			PlaySound(sndPiano3)
   900 		elseif(kergulenSpecial == 3)
   892 		elseif(kergulenSpecial == 3)
   901 		then
   893 		then
   902 			runOnHogs(weapon_flare)
   894 			runOnGears(weapon_flare)
   903 			PlaySound(sndThrowRelease)
   895 			PlaySound(sndThrowRelease)
   904 			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
   896 			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
   905 			AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, 0, -1000000, 30)
   897 			AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, 0, -1000000, 30)
   906 				
   898 				
   907 		elseif(kergulenSpecial == 4)
   899 		elseif(kergulenSpecial == 4)
   908 		then
   900 		then
   909 			runOnHogs(weapon_cries_a)
   901 			runOnGears(weapon_cries_a)
   910 			if(kergulenSpecial~=-1)
   902 			if(kergulenSpecial~=-1)
   911 			then
   903 			then
   912 				AddGear(0, 0, gtWaterUp, 0, 0,0,0)
   904 				AddGear(0, 0, gtWaterUp, 0, 0,0,0)
   913 				PlaySound(sndWarp)
   905 				PlaySound(sndWarp)
   914 				PlaySound(sndMolotov)
   906 				PlaySound(sndMolotov)
   915 				
   907 				
   916 				runOnHogs(weapon_cries_b)
   908 				runOnGears(weapon_cries_b)
   917 			else
   909 			else
   918 				HogSay(CurrentHedgehog, loc("Hogs in sight!"), SAY_SAY)
   910 				HogSay(CurrentHedgehog, loc("Hogs in sight!"), SAY_SAY)
   919 			end
   911 			end
   920 		elseif(kergulenSpecial == 5)
   912 		elseif(kergulenSpecial == 5)
   921 		then
   913 		then
   922 			runOnHogs(weapon_sabotage)
   914 			runOnGears(weapon_sabotage)
   923 		end
   915 		end
   924 		DeleteVisualGear(visualcircle)
   916 		DeleteVisualGear(visualcircle)
   925 		visualcircle=nil
   917 		visualcircle=nil
   926 	end
   918 	end
   927 
   919 
   928 	--Australian special
   920 	--Australian special
   929 	if(GetGearType(austmine) == gtMine and austmine ~= nil)
   921 	if(GetGearType(austmine) == gtMine and austmine ~= nil)
   930 	then
   922 	then
   931 		temp_val=0
   923 		temp_val=0
   932 		runOnHogs(weapon_aust_check)
   924 		runOnGears(weapon_aust_check)
   933 		
   925 		
   934 		if(gearIsInCircle(austmine,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 30, false)==false or temp_val==1)
   926 		if(gearIsInCircle(austmine,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 30, false)==false or temp_val==1)
   935 		then
   927 		then
   936 			AddVisualGear(GetX(austmine), GetY(austmine), vgtDust, 0, false)
   928 			AddVisualGear(GetX(austmine), GetY(austmine), vgtDust, 0, false)
   937 			DeleteGear(austmine)
   929 			DeleteGear(austmine)
   951 end
   943 end
   952 
   944 
   953 function onGearAdd(gearUid)
   945 function onGearAdd(gearUid)
   954 	swapweps=false
   946 	swapweps=false
   955 	
   947 	
   956 	trackGear(gearUid)
   948 	if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives) 
       
   949 	then
       
   950 		trackGear(gearUid)
       
   951 	end
   957 	
   952 	
   958 	--remove gasclouds on gasbombspecial
   953 	--remove gasclouds on gasbombspecial
   959 	if(GetGearType(gearUid)==gtPoisonCloud and samericanSpecial == true)
   954 	if(GetGearType(gearUid)==gtPoisonCloud and samericanSpecial == true)
   960 	then
   955 	then
   961 		DeleteGear(gearUid)
   956 		DeleteGear(gearUid)
   967 		then
   962 		then
   968 			SetState(CurrentHedgehog, gstHHDriven+gstMoving)
   963 			SetState(CurrentHedgehog, gstHHDriven+gstMoving)
   969 			SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog),GetY(CurrentHedgehog)-3)
   964 			SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog),GetY(CurrentHedgehog)-3)
   970 			SetGearVelocity(CurrentHedgehog, vx, vy)
   965 			SetGearVelocity(CurrentHedgehog, vx, vy)
   971 			DeleteGear(gearUid)
   966 			DeleteGear(gearUid)
   972 			--africaspecial2=0
   967 			
   973 			--SetEffect(CurrentHedgehog, heInvulnerable, true)
       
   974 		elseif(africaspecial2 == 2)
   968 		elseif(africaspecial2 == 2)
   975 		then
   969 		then
   976 			fire_gear(CurrentHedgehog,gtNapalmBomb, vx, vy, 0)
   970 			fire_gear(CurrentHedgehog,gtNapalmBomb, vx, vy, 0)
   977 			DeleteGear(gearUid)
   971 			DeleteGear(gearUid)
   978 			--africaspecial2=0
       
   979 		end
   972 		end
   980 
   973 
   981 	elseif(GetGearType(gearUid)==gtSniperRifleShot)
   974 	elseif(GetGearType(gearUid)==gtSniperRifleShot)
   982 	then
   975 	then
   983 		sniper_s_in_use=true
   976 		sniper_s_in_use=true
  1011 	end
  1004 	end
  1012 end
  1005 end
  1013 
  1006 
  1014 function onGearDelete(gearUid)
  1007 function onGearDelete(gearUid)
  1015 
  1008 
  1016 	trackDeletion(gearUid)
  1009 	if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives) 
       
  1010 	then
       
  1011 		trackDeletion(gearUid)
       
  1012 	end
  1017 	--north american specials
  1013 	--north american specials
  1018 	if(GetGearType(gearUid)==gtSniperRifleShot )
  1014 	if(GetGearType(gearUid)==gtSniperRifleShot )
  1019 	then
  1015 	then
  1020 		sniper_s_in_use=false
  1016 		sniper_s_in_use=false
  1021 		if(namericanSpecial==2)
  1017 		if(namericanSpecial==2)
  1022 		then
  1018 		then
  1023 			temp_val=gearUid
  1019 			temp_val=gearUid
  1024 			runOnHogs(weapon_lipstick)
  1020 			runOnGears(weapon_lipstick)
  1025 			
  1021 			
  1026 		elseif(namericanSpecial==3)
  1022 		elseif(namericanSpecial==3)
  1027 		then
  1023 		then
  1028 			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
  1024 			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
  1029 			
  1025 			
  1031 			SetGearMessage(pinata,1)
  1027 			SetGearMessage(pinata,1)
  1032 		end
  1028 		end
  1033 		
  1029 		
  1034 	elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==1 and namericanSpecial==3)
  1030 	elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==1 and namericanSpecial==3)
  1035 	then
  1031 	then
  1036 		AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 24)
  1032 		AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 20)
  1037 	
  1033 	
  1038 	elseif(GetGearType(gearUid)==gtShotgunShot and shotgun_s==true)
  1034 	elseif(GetGearType(gearUid)==gtShotgunShot and shotgun_s==true)
  1039 	then
  1035 	then
  1040 		SetState(CurrentHedgehog, gstMoving)
  1036 		SetState(CurrentHedgehog, gstMoving)
  1041 		SetGearPosition(CurrentHedgehog, GetX(gearUid), GetY(gearUid)+7)
  1037 		SetGearPosition(CurrentHedgehog, GetX(gearUid), GetY(gearUid)+7)