share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua
changeset 13359 7d772358dc22
parent 12940 39b7b3ed619e
child 13360 e27540ad33bd
equal deleted inserted replaced
13358:a79c1206bacd 13359:7d772358dc22
     1 --[[
     1 --[[
     2 	version 1.3n
       
     3 
       
     4 	The expat (MIT) license
       
     5 
       
     6 	Copyright (C) 2012 Vatten
     2 	Copyright (C) 2012 Vatten
     7 
     3 
     8 	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:
     4 	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:
     9 
     5 
    10 	The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
     6 	The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    11 
     7 
    12 	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.
     8 	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.
    13 ]]
     9 ]]
       
    10 -- fix selection increase delay (weapons to compesate)
    14 
    11 
    15 HedgewarsScriptLoad("/Scripts/Locale.lua")
    12 HedgewarsScriptLoad("/Scripts/Locale.lua")
    16 HedgewarsScriptLoad("/Scripts/Utils.lua")
    13 HedgewarsScriptLoad("/Scripts/Utils.lua")
    17 HedgewarsScriptLoad("/Scripts/Tracker.lua")
    14 HedgewarsScriptLoad("/Scripts/Tracker.lua")
    18 
    15 
    48 		return 1
    45 		return 1
    49 	end
    46 	end
    50 end
    47 end
    51 
    48 
    52 --Will end the turn + give escape time
    49 --Will end the turn + give escape time
    53 function EndTurn()
    50 function EndTurn(seconds)
    54 	SetState(CurrentHedgehog,bor(GetState(CurrentHedgehog),gstAttacked))
    51 	SetState(CurrentHedgehog,bor(GetState(CurrentHedgehog),gstAttacked))
    55 	--3 sec espace time
    52 	--set espace time
    56 	TurnTimeLeft = GetAwayTime*10*3
    53 	TurnTimeLeft = GetAwayTime*10*seconds
    57  end
    54  end
    58 
    55 
    59  --show health tag (will mostly be used when a hog is damaged)
    56  --show health tag (will mostly be used when a hog is damaged)
    60 function ShowDamageTag(hog,damage)
    57 function ShowDamageTag(hog,damage)
    61 	healthtag=AddVisualGear(GetX(hog), GetY(hog), vgtHealthTag, damage, false)
    58 	healthtag=AddVisualGear(GetX(hog), GetY(hog), vgtHealthTag, damage, false)
    67 function FireGear(hedgehog,geartype,vx,vy,timer)
    64 function FireGear(hedgehog,geartype,vx,vy,timer)
    68 	local hypo=Norm(vx,vy)
    65 	local hypo=Norm(vx,vy)
    69 	return AddGear(div((GetGearRadius(hedgehog)*2*vx),hypo)+GetX(hedgehog), div((GetGearRadius(hedgehog)*2*vy),hypo)+GetY(hedgehog), geartype, 0, vx, vy, timer)
    66 	return AddGear(div((GetGearRadius(hedgehog)*2*vx),hypo)+GetX(hedgehog), div((GetGearRadius(hedgehog)*2*vy),hypo)+GetY(hedgehog), geartype, 0, vx, vy, timer)
    70 end
    67 end
    71 
    68 
    72 --This function will set the gravity on a scale from 0->100, where 50 is the standard one.
       
    73  function SetGravityFromScale(grav)
       
    74 	if(grav>100)
       
    75 	then
       
    76 		grav=100
       
    77 	elseif(grav<0)
       
    78 	then
       
    79 		grav=0
       
    80 	end
       
    81 
       
    82 	if(grav>50)
       
    83 	then
       
    84 		SetGravity(100+((grav-50)*12))
       
    85 	else
       
    86 		SetGravity(25+grav+div(grav,2))
       
    87 	end
       
    88  end
       
    89 
       
    90 --====MISC GLOBALS====
    69 --====MISC GLOBALS====
    91 
    70 
    92 --for selecting continent
    71 --for selecting continent
    93 local GLOBAL_INIT_TEAMS = {}
    72 local GLOBAL_INIT_TEAMS = {}
    94 local GLOBAL_SELECT_CONTINENT_CHECK=false
    73 local GLOBAL_SELECT_CONTINENT_CHECK=false
       
    74 local GLOBAL_START_TIME=0
       
    75 local GLOBAL_HOG_HEALTH=100
    95 local GLOBAL_TEAM_CONTINENT = {}
    76 local GLOBAL_TEAM_CONTINENT = {}
    96 
    77 
    97 --variables for seeing if you have swaped around on a weapon
    78 --variables for seeing if you have swaped around on a weapon
    98 local GLOBAL_AUSTRALIAN_SPECIAL=0
    79 local GLOBAL_AUSTRALIAN_SPECIAL=0
    99 local GLOBAL_AFRICAN_SPECIAL_SEDUCTION=0
    80 local GLOBAL_AFRICAN_SPECIAL_SEDUCTION=0
   102 local GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER=1
    83 local GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER=1
   103 local GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=false
    84 local GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=false
   104 local GLOBAL_KERGUELEN_SPECIAL=1
    85 local GLOBAL_KERGUELEN_SPECIAL=1
   105 local GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN=false
    86 local GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN=false
   106 local GLOBAL_EUROPE_SPECIAL=0
    87 local GLOBAL_EUROPE_SPECIAL=0
       
    88 local GLOBAL_ANTARCTICA_SPECIAL=0
       
    89 local GLOBAL_SEDUCTION_INCREASER=0
   107 
    90 
   108 --detection if something is activated
    91 --detection if something is activated
   109 local GLOBAL_SWITCH_HOG_IS_ON=false
    92 local GLOBAL_SWITCH_HOG_IS_ON=false
   110 local GLOBAL_VAMPIRIC_IS_ON=0
    93 local GLOBAL_VAMPIRIC_IS_ON=0
   111 local GLOBAL_EXTRA_DAMAGE_IS_ON=100
    94 local GLOBAL_EXTRA_DAMAGE_IS_ON=100
   119 
   102 
   120 --for sabotage
   103 --for sabotage
   121 local GLOBAL_SABOTAGE_COUNTER=0
   104 local GLOBAL_SABOTAGE_COUNTER=0
   122 local GLOBAL_SABOTAGE_HOGS={}
   105 local GLOBAL_SABOTAGE_HOGS={}
   123 local GLOBAL_SABOTAGE_FREQUENCY=0
   106 local GLOBAL_SABOTAGE_FREQUENCY=0
   124 local GLOBAL_SABOTAGE_GRAVITY_SWITCH=true
   107 
       
   108 local GLOBAL_CRATE_TEST=-1
   125 
   109 
   126 --for sundaland
   110 --for sundaland
   127 local GLOBAL_SUNDALAND_END_HOG=0
   111 local GLOBAL_SUNDALAND_END_HOG_CONTINENT_NAME
       
   112 
       
   113 local OPTION_NO_SPECIALS=false
   128 
   114 
   129 --====GENERAL GLOBALS (useful for handling continents)====
   115 --====GENERAL GLOBALS (useful for handling continents)====
   130 
   116 
   131 local GLOBAL_GENERAL_INFORMATION="- "..loc("Per team weapons").."|- "..loc("10 weapon schemes").."|- "..loc("Unique new weapons").."| |"..loc("Select your continent/weaponset: With the \"Up\" or \"Down\" keys. You can also select one with the weapons menu.").."|"..string.format(loc("Note: Some weapons have a second option (See continent information). Find and use them with the \"%s\" key."), loc("switch")).."|"..loc("Tip: See the \"Esc\" key (this menu) if you want to see the currently playing teams continent, or that continents specials.")
   117 local GLOBAL_SNIPER_SPECIAL_INFO = loc("Green lipstick bullet: [Poisonous, deals no damage]")
   132 
   118 local GLOBAL_BASEBALLBAT_BOOMERANG_INFO = loc("Bouncy boomerang: [Launch your bouncy boomerang ~ Turns into a present on explosion]")
   133 local GLOBAL_SHOW_SMALL_INFO=0
   119 local GLOBAL_CHEESE_SPECIAL_INFO = loc("Anno 1032: [The explosion will make a strong push ~ No poison]")
   134 
   120 local GLOBAL_SEDUCTION_SPECIAL_INFO = loc("Dust storm: [Deals 15 + %s damage to all enemies in the circle]")
   135 local GLOBAL_WEAPON_TEXTS = {
   121 local GLOBAL_INVULNERABLE_SPECIAL_INFO = loc("Temporarily increase the damage of duststorm with +7%s, Removes 1 Invurnurable%s")
   136 loc("Green lipstick bullet: [Poisonous, deals no damage]"),
   122 local GLOBAL_BASEBALLBAT_CRICKET_INFO = loc("Cricket time: [Fire away a 1 sec mine! ~ Cannot be fired close to another hog]")
   137 loc("Cluck-cluck time: [Fire an egg ~ Sabotages and cures poison ~ Cannot be fired close to another hog]"),
   123 local GLOBAL_PARACHUTE_SPECIAL_INFO = loc("Drop a bomb: [Drop some heroic wind that will turn into a bomb on impact ~ wont end turn]")
   138 loc("Anno 1032: [The explosion will make a strong push ~ Wide range, wont affect hogs close to the target]"),
   124 local GLOBAL_HAMMER_ROAR_INFO = loc("Penguin roar: [Deal 15 damage + 10% of your hog’s health to all hogs around you and get 2/3 back]")
   139 loc("Dust storm: [Deals 15 damage to all enemies in the circle]"),
   125 local GLOBAL_HAMMER_SWAP_INFO = loc("Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]")
   140 loc("Cricket time: [Fire away a 1 sec mine! ~ Cannot be fired close to another hog]"),
   126 local GLOBAL_HAMMER_LONELY_INFO = loc("Lonely Cries: [Rise the water if no hog is in the circle and deal 6 damage to all enemy hogs.]")
   141 loc("Drop a bomb: [Drop some heroic wind that will turn into a bomb on impact]"),
   127 local GLOBAL_STICKY_PROJECTILE_INFO = loc("Hedgehog projectile: [Fire your hog like a Sticky Bomb]")
   142 loc("Penguin roar: [Deal 15 damage + 10% of your hog’s health to all hogs around you and get 2/3 back]"),
   128 local GLOBAL_STICKY_NAPALM_INFO = loc("Napalm rocket: [Fire a bomb with napalm!]")
   143 loc("Disguise as a Rockhopper Penguin: [Swap place with a random enemy hog in the circle]"),
   129 local GLOBAL_SHOTGUN_SPECIAL_INFO = loc("Eagle Eye: [Blink to the impact ~ One shot]")
   144 nil,
   130 local GLOBAL_MOLOTOV_SPECIAL_INFO = loc("Medicine: [Fire some exploding medicine that will heal 15 hp to all hogs effected by the explosion]")
   145 loc("Lonely Cries: [Rise the water if no hog is in the circle and deal 6 damage to all enemy hogs.]"),
   131 local GLOBAL_HAMMER_SABOTAGE_INFO = loc("Flare: [Sabotage all hogs in the circle (dmg over time and high gravity) and fire one cluster above you]")
   146 loc("Hedgehog projectile: [Fire your hog like a Sticky Bomb]"),
   132 local GLOBAL_PICKHAMMER_SPECIAL_INFO = loc("World wrap: [Will teleport you to the top of the map, expect fall damage]")
   147 loc("Napalm rocket: [Fire a bomb with napalm!]"),
   133 
   148 loc("Eagle Eye: [Blink to the impact ~ One shot]"),
   134 local GLOBAL_ALL_SPECIALS_INFO = loc("Weapons with specials: ")..loc("Shotgun")..", "..loc("Sniper Rifle")..", "..loc("GasBomb")..", "..loc("Molotov")..", "..loc("Parachute")..", "..loc("Seduction")..", "..loc("Sticky Mine").." (2),"..loc("Baseballbat (2)")..", "..loc("Hammer (4)")
   149 loc("Medicine: [Fire some exploding medicine that will heal all hogs effected by the explosion]"),
   135 
   150 loc("Sabotage/Flare: [Sabotage all hogs in the circle and deal ~1 dmg OR Fire a cluster up into the air]")
   136 local GLOBAL_SELECT_WEP_INFORMATION=loc("Select your continent with: the \"Up\" or \"Down\" keys, or by selecting a representative weapon.")
   151 }
   137 local GLOBAL_GENERAL_INFORMATION="- "..loc("Per team weapons").."|- "..loc("10 weapon schemes").."|- "..loc("Unique new weapons").."| |"..GLOBAL_SELECT_WEP_INFORMATION.."|"..loc("Note: Some weapons have a second option (See continent information). Find and use them with the \"")..loc("switch").."\" "..loc("key").." (↹).|"..GLOBAL_ALL_SPECIALS_INFO.."|"..loc("Tip: See the \"esc\" key (this menu) if you want to see the currently playing teams continent, or that continents specials." .. "|")
   152 
   138 
   153 local GLOBAL_CONTINENT_INFORMATION =
   139 local GLOBAL_CONTINENT_INFORMATION =
   154 {
   140 {
   155 {loc("North America"),"["..loc("Difficulty: ")..loc("EASY").."] "..loc("Area")..": 24,709,000 km2, "..loc("Population")..": 529,000,000",loc("- You can switch between hogs at the start of your turns. (Not first one)").."|"..loc("Special Weapons:").."|"..loc("Shotgun")..": "..GLOBAL_WEAPON_TEXTS[13].."|"..loc("Sniper Rifle")..": "..GLOBAL_WEAPON_TEXTS[1],amSniperRifle,
   141 {loc("North America"),"["..loc("Difficulty: ")..loc("EASY").."] ",loc("- You can switch between hogs at the start of your turns. (Not first one)").."|"..loc("Special Weapons:").."|"..loc("Shotgun")..": "..GLOBAL_SHOTGUN_SPECIAL_INFO.."|"..loc("Sniper Rifle")..": "..GLOBAL_SNIPER_SPECIAL_INFO,{amSniperRifle,1},
   156 {{amShotgun,100},{amDEagle,100},{amLaserSight,2},{amSniperRifle,100},{amCake,1},{amAirAttack,2},{amSwitch,2}}},
   142 {{amShotgun,100},{amDEagle,100},{amLaserSight,2},{amSniperRifle,100},{amCake,1},{amAirAttack,2},{amSwitch,2}},
   157 
   143 },
   158 {loc("South America"),"["..loc("Difficulty: ")..loc("MEDIUM").."] "..loc("Area")..": 17,840,000 km2, "..loc("Population")..": 387,000,000",loc("Special Weapons:").."|"..loc("GasBomb")..": "..GLOBAL_WEAPON_TEXTS[3],amGasBomb,
   144 --{sndShotgunFire,sndCover},100},
   159 {{amBirdy,100},{amHellishBomb,1},{amBee,100},{amGasBomb,100},{amFlamethrower,100},{amNapalm,1},{amExtraDamage,2}}},
   145 
   160 
   146 {loc("South America"),"["..loc("Difficulty: ")..loc("MEDIUM").."] ",loc("Special Weapons:").."|"..loc("GasBomb")..": "..GLOBAL_CHEESE_SPECIAL_INFO,{amGasBomb,2},
   161 {loc("Europe"),"["..loc("Difficulty: ")..loc("EASY").."] "..loc("Area")..": 10,180,000 km2, "..loc("Population")..": 740,000,000",loc("Special Weapons:").."|"..loc("Molotov")..": "..GLOBAL_WEAPON_TEXTS[14],amBazooka,
   147 {{amBirdy,100},{amHellishBomb,1},{amBee,100},{amGasBomb,100},{amFlamethrower,100},{amNapalm,2},{amExtraDamage,3}},
   162 {{amBazooka,100},{amGrenade,100},{amMortar,100},{amMolotov,100},{amVampiric,3},{amPiano,1},{amResurrector,2},{amJetpack,4}}},
   148 {sndEggBreak,sndLaugh},125},
   163 
   149 
   164 {loc("Africa"),"["..loc("Difficulty: ")..loc("MEDIUM").."] "..loc("Area")..": 30,222,000 km2, "..loc("Population")..": 1,033,000,000",loc("Special Weapons:").."|"..loc("Seduction")..": "..GLOBAL_WEAPON_TEXTS[4].."|"..loc("Sticky Mine")..": "..GLOBAL_WEAPON_TEXTS[11].."|"..loc("Sticky Mine")..": "..GLOBAL_WEAPON_TEXTS[12],amSMine,
   150 {loc("Europe"),"["..loc("Difficulty: ")..loc("EASY").."] ",loc("Special Weapons:").."|"..loc("Molotov")..": "..GLOBAL_MOLOTOV_SPECIAL_INFO,{amBazooka,3},
   165 {{amSMine,100},{amWatermelon,1},{amDrillStrike,1},{amDrill,100},{amInvulnerable,5},{amSeduction,100},{amLandGun,2}}},
   151 {{amBazooka,100},{amGrenade,100},{amMortar,100},{amMolotov,100},{amVampiric,4},{amPiano,1},{amResurrector,2},{amJetpack,4}},
   166 
   152 {sndExplosion,sndEnemyDown},100},
   167 {loc("Asia"),"["..loc("Difficulty: ")..loc("MEDIUM").."] "..loc("Area")..": 44,579,000 km2, "..loc("Population")..": 3,880,000,000",loc("- Will give you a parachute every second turn.").."|"..loc("Special Weapons:").."|"..loc("Parachute")..": "..GLOBAL_WEAPON_TEXTS[6],amRope,
   153 
   168 {{amRope,100},{amFirePunch,100},{amParachute,2},{amKnife,2},{amDynamite,1}}},
   154 {loc("Africa"),"["..loc("Difficulty: ")..loc("MEDIUM").."] ",loc("Special Weapons:").."|"..loc("Seduction")..": "..string.format(GLOBAL_SEDUCTION_SPECIAL_INFO,loc("(*see below)")).."|- "..string.format(GLOBAL_INVULNERABLE_SPECIAL_INFO,"","").."|- "..loc("You can modify the damage/invulnerables with the up/down keys on dust storm.").."|"..loc("Sticky Mine")..": "..GLOBAL_STICKY_PROJECTILE_INFO.."|"..loc("Sticky Mine")..": "..GLOBAL_STICKY_NAPALM_INFO,{amSMine,4},
   169 
   155 {{amSMine,100},{amWatermelon,1},{amDrillStrike,1},{amDrill,100},{amInvulnerable,7},{amSeduction,100},{amLandGun,3}},
   170 {loc("Australia"),"["..loc("Difficulty: ")..loc("EASY").."] "..loc("Area")..": 8,468,000 km2, "..loc("Population")..": 31,000,000",loc("Special Weapons:").."|"..loc("Baseballbat")..": "..GLOBAL_WEAPON_TEXTS[5].."|"..loc("Baseballbat")..": "..GLOBAL_WEAPON_TEXTS[2],amBaseballBat,
   156 {sndMelonImpact,sndCoward},125},
   171 {{amBaseballBat,100},{amMine,100},{amLowGravity,4},{amBlowTorch,100},{amRCPlane,2},{amTeleport,2},{amRubber,2}}},
   157 
   172 
   158 {loc("Asia"),"["..loc("Difficulty: ")..loc("MEDIUM").."] ",loc("- Will give you a parachute every third turn.").."|"..loc("Special Weapons:").."|"..loc("Parachute")..": "..GLOBAL_PARACHUTE_SPECIAL_INFO,{amRope,5},
   173 {loc("Antarctica"),"["..loc("Difficulty: ")..loc("HARD").."] "..loc("Area")..": 14,000,000 km2, "..loc("Population")..": ~1,000",loc("Antarctic summer: - Will give you one girder/mudball and two sineguns/portals every fourth turn."),amIceGun,
   159 {{amRope,100},{amFirePunch,100},{amParachute,1},{amKnife,2},{amDynamite,1}},
   174 {{amSnowball,2},{amIceGun,2},{amPickHammer,100},{amSineGun,5},{amGirder,2},{amExtraTime,1},{amPortalGun,2}}},
   160 {sndRopeAttach,sndComeonthen},50},
   175 
   161 
   176 {loc("Kerguelen"),"["..loc("Difficulty: ")..loc("EASY").."] "..loc("Area")..": 1,100,000 km2, "..loc("Population")..": ~100",loc("Special Weapons:").."|"..loc("Hammer")..": "..GLOBAL_WEAPON_TEXTS[7].."|"..loc("Hammer")..": "..GLOBAL_WEAPON_TEXTS[8].." ("..loc("Duration")..": 2)|"..loc("Hammer")..": "..GLOBAL_WEAPON_TEXTS[10].."|"..loc("Hammer")..": "..GLOBAL_WEAPON_TEXTS[15],amHammer,
   162 {loc("Australia"),"["..loc("Difficulty: ")..loc("EASY").."] ",loc("Special Weapons:").."|"..loc("Baseballbat")..": "..GLOBAL_BASEBALLBAT_CRICKET_INFO.."|"..loc("Baseballbat")..": "..GLOBAL_BASEBALLBAT_BOOMERANG_INFO,{amBaseballBat,6},
   177 {{amHammer,100},{amMineStrike,1},{amBallgun,1}}},
   163 {{amBaseballBat,100},{amMine,100},{amLowGravity,4},{amBlowTorch,100},{amRCPlane,2},{amRubber,4}},
   178 
   164 {sndBaseballBat,sndNooo},100},
   179 {loc("Zealandia"),"["..loc("Difficulty: ")..loc("MEDIUM").."] "..loc("Area")..": 3,500,000 km2, "..loc("Population")..": 5,000,000",loc("- Will get 1-3 random weapons") .. "|" .. loc("- Massive weapon bonus on first turn"),amInvulnerable,
   165 
   180 {{amBazooka,1},{amGrenade,1},{amBlowTorch,1},{amSwitch,100},{amRope,1},{amDrill,1},{amDEagle,1},{amPickHammer,1},{amFirePunch,1},{amWhip,1},{amMortar,1},{amSnowball,1},{amExtraTime,1},{amInvulnerable,1},{amVampiric,1},{amFlamethrower,1},{amBee,1},{amClusterBomb,1},{amTeleport,1},{amLowGravity,1},{amJetpack,1},{amGirder,1},{amLandGun,1},{amBirdy,1}}},
   166 {loc("Antarctica"),"["..loc("Difficulty: ")..loc("HARD").."] ",loc("Antarctic summer: - Will give you girders=1,mudballs=1,sineguns=2,portals=1 every fourth turn.").."|"..loc("Special Weapons:").."|"..loc("Pick hammer")..": "..GLOBAL_PICKHAMMER_SPECIAL_INFO,{amIceGun,7},
   181 
   167 {{amSnowball,2},{amPickHammer,100},{amSineGun,4},{amGirder,1},{amExtraTime,1},{amIceGun,1},{amPortalGun,2}},
   182 {loc("Sundaland"),"["..loc("Difficulty: ")..loc("HARD").."] "..loc("Area")..": 1,850,000 km2, "..loc("Population")..": 290,000,000",loc("- You will recieve 2-4 weapons on each kill! (Even on own hogs)"),amTardis,
   168 {sndSineGun,sndOops},75},
   183 {{amClusterBomb,4},{amTardis,4},{amWhip,100},{amKamikaze,4}}}
   169 
       
   170 {loc("Kerguelen"),"["..loc("Difficulty: ")..loc("EASY").."] ",loc("Special Weapons:").."|"..loc("Hammer")..": "..GLOBAL_HAMMER_ROAR_INFO.."|"..loc("Hammer")..": "..GLOBAL_HAMMER_SWAP_INFO.."|"..loc("Hammer")..": "..GLOBAL_HAMMER_LONELY_INFO.."|"..loc("Hammer")..": "..GLOBAL_HAMMER_SABOTAGE_INFO,{amHammer,8},
       
   171 {{amHammer,100},{amMineStrike,1},{amBallgun,1},{amTeleport,1}},
       
   172 {sndPiano5,sndStupid},75},
       
   173 
       
   174 {loc("Zealandia"),"["..loc("Difficulty: ")..loc("MEDIUM").."] ",loc("- Will Get 1-3 random weapons") .. "|" .. loc("- Massive weapon bonus on first turn|You will lose all your weapons each turn."),{amInvulnerable,9},
       
   175 {{amBazooka,1},{amGrenade,1},{amBlowTorch,1},{amSwitch,1},{amRope,1},{amDrill,1},{amDEagle,1},{amPickHammer,1},{amFirePunch,1},{amWhip,1},{amMortar,1},{amSnowball,1},{amExtraTime,1},{amInvulnerable,1},{amVampiric,1},{amFlamethrower,1},{amBee,1},{amClusterBomb,1},{amTeleport,1},{amLowGravity,1},{amJetpack,1},{amGirder,1},{amLandGun,1},{amBirdy,1},{amAirMine,1},{amTardis,1},{amLaserSight,1},{amAirMine,1}},
       
   176 {sndSplash,sndFirstBlood},100},
       
   177 
       
   178 {loc("Sundaland"),"["..loc("Difficulty: ")..loc("HARD").."] ",loc("- You will recieve 6 weapons on each kill! (Even on own hogs)"),{amTardis,10},
       
   179 {{amClusterBomb,5},{amTardis,100},{amWhip,100},{amKamikaze,100},{amAirMine,2},{amDuck,2}},
       
   180 {sndWarp,sndSameTeam},100}
   184 
   181 
   185 }
   182 }
   186 
   183 
   187 local GLOBAL_CONTINENT_SOUNDS=
   184 --very strange bug
   188 {
   185 GLOBAL_CONTINENT_INFORMATION[1][7]=100
   189 	{sndShotgunFire,sndCover},
   186 GLOBAL_CONTINENT_INFORMATION[1][6]={sndShotgunFire,sndCover}
   190 	{sndEggBreak,sndLaugh},
       
   191 	{sndExplosion,sndEnemyDown},
       
   192 	{sndMelonImpact,sndCoward},
       
   193 	{sndRopeAttach,sndComeonthen},
       
   194 	{sndBaseballBat,sndNooo},
       
   195 	{sndSineGun,sndOops},
       
   196 	{sndPiano5,sndStupid},
       
   197 	{sndSplash,sndFirstBlood},
       
   198 	{sndWarp,sndSameTeam},
       
   199 	{sndFrozenHogImpact,sndUhOh}
       
   200 }
       
   201 
   187 
   202 --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)
   188 --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)
   203 local GLOBAL_WEAPONS_DAMAGE = {
   189 local GLOBAL_WEAPONS_DAMAGE = {
   204 	{amKamikaze, 0, 1, 0, 1, 0},
   190 	{amKamikaze,    0, 1, 0, 1, 0},
   205 	{amSineGun, 0, 1, 0, 1, 1},
   191 	{amSineGun,     0, 1, 0, 1, 0},
   206 	{amBazooka, 0, 1, 0, 1, 0},
   192 	{amMineStrike,  0, 1, 6, 1, 1},
   207 	{amMineStrike, 0, 1, 5, 1, 2},
   193 	{amGrenade,     0, 1, 0, 1, 0},
   208 	{amGrenade, 0, 1, 0, 1, 0},
   194 	{amPiano,       0, 1, 7, 1, 0},
   209 	{amPiano, 0, 1, 5, 1, 0},
       
   210 	{amClusterBomb, 0, 1, 0, 1, 0},
   195 	{amClusterBomb, 0, 1, 0, 1, 0},
   211 	{amBee, 0, 1, 0, 1, 0},
   196 	{amBee,         0, 1, 0, 1, 0},
   212 	{amShotgun, 0, 0, 0, 1, 1},
   197 	{amShotgun,     0, 1, 0, 1, 0},
   213 	{amMine, 0, 1, 0, 1, 0},
   198 	{amSniperRifle, 0, 1, 0, 1, 0},
   214 	{amSniperRifle, 0, 1, 0, 1, 1},
   199 	{amDynamite,    0, 1, 6, 1, 1},
   215 	{amDEagle, 0, 1, 0, 1, 0},
   200 	{amFirePunch,   0, 1, 0, 1, 0},
   216 	{amDynamite, 0, 1, 5, 1, 1},
   201 	{amHellishBomb, 0, 1, 6, 1, 2},
   217 	{amFirePunch, 0, 1, 0, 1, 0},
   202 	{amWhip,        0, 1, 0, 1, 0},
   218 	{amHellishBomb, 0, 1, 5, 1, 2},
   203 	{amNapalm,      0, 1, 6, 1, 1},
   219 	{amWhip, 0, 1, 0, 1, 0},
   204 	{amPickHammer,  0, 1, 0, 1, 0},
   220 	{amNapalm, 0, 1, 5, 1, 2},
       
   221 	{amPickHammer, 0, 1, 0, 1, 0},
       
   222 	{amBaseballBat, 0, 1, 0, 1, 1},
   205 	{amBaseballBat, 0, 1, 0, 1, 1},
   223 	{amMortar, 0, 1, 0, 1, 0},
   206 	{amMortar,      0, 1, 0, 1, 0},
   224 	{amCake, 0, 1, 4, 1, 2},
   207 	{amCake,        0, 1, 5, 1, 2},
   225 	{amSeduction, 0, 0, 0, 1, 0},
   208 	{amSeduction,   0, 1, 0, 1, 0},
   226 	{amWatermelon, 0, 1, 5, 1, 2},
   209 	{amWatermelon,  0, 1, 6, 1, 2},
   227 	{amDrill, 0, 1, 0, 1, 0},
   210 	{amDrill,       0, 1, 0, 1, 0},
   228 	{amBallgun, 0, 1, 5, 1, 2},
   211 	{amBallgun,     0, 1, 8, 1, 2},
   229 	{amMolotov, 0, 1, 0, 1, 0},
   212 	{amDEagle,      0, 1, 0, 1, 0},
   230 	{amHammer, 0, 1, 0, 1, 2},
   213 	{amMolotov,     0, 1, 0, 1, 0},
   231 	{amBirdy, 0, 1, 0, 1, 0},
   214 	{amHammer,      0, 1, 0, 1, 1},
   232 	{amBlowTorch, 0, 1, 0, 1, 0},
   215 	{amBirdy,       0, 1, 0, 1, 0},
   233 	{amRCPlane, 0, 1, 5, 1, 2},
   216 	{amRCPlane,     0, 1, 6, 1, 2},
   234 	{amGasBomb, 0, 0, 0, 1, 0},
   217 	{amMine,        0, 1, 0, 1, 0},
   235 	{amAirAttack, 0, 1, 4, 1, 1},
   218 	{amGasBomb,     0, 1, 0, 1, 0},
   236 	{amFlamethrower, 0, 1, 0, 1, 0},
   219 	{amAirAttack,   0, 1, 5, 1, 1},
   237 	{amSMine, 0, 1, 0, 1, 1},
   220 	{amBlowTorch,   0, 1, 0, 1, 0},
   238 	{amDrillStrike, 0, 1, 4, 1, 2},
   221 	{amFlamethrower,0, 1, 0, 1, 0},
   239 	{amSnowball, 0, 1, 0, 1, 0}
   222 	{amSMine,       0, 1, 0, 1, 0},
       
   223 	{amSnowball,    0, 1, 0, 1, 0},
       
   224 	{amKnife,       0, 1, 0, 1, 0},
       
   225 	{amDrillStrike, 0, 1, 5, 1, 1},
       
   226 	{amBazooka,     0, 1, 0, 1, 0},
       
   227 	{amAirMine,     0, 1, 0, 1, 0},
       
   228 	{amDuck,        0, 1, 0, 1, 0}
   240 }
   229 }
   241 local GLOBAL_WEAPONS_SUPPORT = {
   230 local GLOBAL_WEAPONS_SUPPORT = {
   242 	{amParachute, 0, 1, 0, 1, 0},
   231 	{amParachute,   0, 1, 0, 1, 0},
   243 	{amGirder, 0, 1, 0, 1, 0},
   232 	{amGirder,      0, 1, 0, 1, 0},
   244 	{amSwitch, 0, 1, 0, 1, 0},
   233 	{amSwitch,      0, 1, 0, 1, 0},
   245 	{amLowGravity, 0, 1, 0, 1, 0},
   234 	{amLowGravity,  0, 1, 0, 1, 0},
   246 	{amExtraDamage, 0, 1, 2, 1, 0},
   235 	{amExtraDamage, 0, 1, 2, 1, 0},
   247 	{amRope, 0, 1, 0, 1, 1},
   236 	{amRope,        0, 1, 0, 1, 0},
   248 	{amInvulnerable, 0, 1, 0, 1, 0},
   237 	{amInvulnerable,0, 1, 0, 1, 0},
   249 	{amExtraTime, 0, 1, 0, 1, 0},
   238 	{amExtraTime,   0, 1, 0, 1, 0},
   250 	{amLaserSight, 0, 1, 0, 1, 0},
   239 	{amLaserSight,  0, 1, 0, 1, 0},
   251 	{amVampiric, 0, 1, 0, 1, 0},
   240 	{amVampiric,    0, 1, 0, 1, 0},
   252 	{amJetpack, 0, 1, 0, 1, 1},
   241 	{amJetpack,     0, 1, 0, 1, 0},
   253 	{amPortalGun, 0, 1, 2, 1, 1},
   242 	{amPortalGun,   0, 1, 3, 1, 1},
   254 	{amResurrector, 0, 1, 3, 1, 0},
   243 	{amResurrector, 0, 1, 2, 1, 0},
   255 	{amTeleport, 0, 1, 0, 1, 0},
   244 	{amTeleport,    0, 1, 0, 1, 0},
   256 	{amLandGun, 0, 1, 0, 1, 0},
   245 	{amLandGun,     0, 1, 0, 1, 0},
   257 	{amTardis, 0, 1, 0, 1, 0},
   246 	{amTardis,      0, 1, 0, 1, 0},
   258 	{amIceGun, 0, 1, 0, 1, 0},
   247 	{amIceGun,      0, 1, 0, 1, 0},
   259 	{amKnife, 0, 1, 0, 1, 0},
   248 	{amRubber,      0, 1, 0, 1, 0}
   260 	{amRubber, 0, 1, 0, 1, 0}
       
   261 
   249 
   262 }
   250 }
       
   251 
       
   252 --check if weps valid
       
   253 function wepNotValidBorder(weapon)
       
   254 	if(MapHasBorder() == false or (weapon ~= amAirAttack and weapon ~= amMineStrike and weapon ~= amNapalm and weapon ~= amDrillStrike and weapon ~= amPiano))
       
   255 	then
       
   256 		return true
       
   257 	end
       
   258 
       
   259 	return false
       
   260 end
   263 
   261 
   264 --will check after borders and stuff
   262 --will check after borders and stuff
   265 function ValidateWeapon(hog,weapon,amount)
   263 function ValidateWeapon(hog,weapon,amount)
   266 	if(MapHasBorder() == false or (MapHasBorder() == true and weapon ~= amAirAttack and weapon ~= amMineStrike and weapon ~= amNapalm and weapon ~= amDrillStrike and weapon ~= amPiano))
   264 	if(wepNotValidBorder(weapon))
   267 	then
   265 	then
   268 		if(amount==1)
   266 		if(amount==1)
   269 		then
   267 		then
   270 			AddAmmo(hog, weapon)
   268 			AddAmmo(hog, weapon)
   271 		else
   269 		else
   272 			AddAmmo(hog, weapon,amount)
   270 			AddAmmo(hog, weapon,amount)
   273 		end
   271 		end
       
   272 	end
       
   273 end
       
   274 
       
   275 function SpawnRandomCrate(x,y,strength)
       
   276 	local tot=table.maxn(GLOBAL_WEAPONS_SUPPORT)+table.maxn(GLOBAL_WEAPONS_DAMAGE)
       
   277 	local rand=GetRandom(tot)+1
       
   278 
       
   279 	if(rand>table.maxn(GLOBAL_WEAPONS_SUPPORT))
       
   280 	then
       
   281 		local weapon=rand-table.maxn(GLOBAL_WEAPONS_SUPPORT)
       
   282 
       
   283 		while(wepNotValidBorder(GLOBAL_WEAPONS_DAMAGE[weapon][1])==false)
       
   284 		do
       
   285 			if(weapon>=table.maxn(GLOBAL_WEAPONS_DAMAGE))
       
   286 			then
       
   287 				weapon=0
       
   288 			end
       
   289 			weapon = weapon+1
       
   290 		end
       
   291 
       
   292 		SpawnAmmoCrate(x, y, GLOBAL_WEAPONS_DAMAGE[weapon][1])
       
   293 	else
       
   294 		SpawnUtilityCrate(x, y, GLOBAL_WEAPONS_SUPPORT[rand][1])
   274 	end
   295 	end
   275 end
   296 end
   276 
   297 
   277 --removes one weapon
   298 --removes one weapon
   278 function RemoveWeapon(hog,weapon)
   299 function RemoveWeapon(hog,weapon)
   301 function LoadWeaponset(hog, num)
   322 function LoadWeaponset(hog, num)
   302 	for v,w in pairs(GLOBAL_CONTINENT_INFORMATION[num][5])
   323 	for v,w in pairs(GLOBAL_CONTINENT_INFORMATION[num][5])
   303 	do
   324 	do
   304 		ValidateWeapon(hog, w[1],w[2])
   325 		ValidateWeapon(hog, w[1],w[2])
   305 	end
   326 	end
       
   327 
       
   328 	GLOBAL_TEMP_VALUE=GLOBAL_CONTINENT_INFORMATION[num][7]
       
   329 	runOnGears(SetHogHealth)
   306 end
   330 end
   307 
   331 
   308 --list up all weapons from the icons for each continent
   332 --list up all weapons from the icons for each continent
   309 function InitWeaponsMenu(hog)
   333 function InitWeaponsMenu(hog)
   310 
   334 
   311 	if(GetHogLevel(hog)==0)
   335 	if(GetHogLevel(hog)==0 or GLOBAL_CONTINENT_INFORMATION[1][6][1]==sndFrozenHogImpact)
   312 	then
   336 	then
   313 		for v,w in pairs(GLOBAL_CONTINENT_INFORMATION)
   337 		for v,w in pairs(GLOBAL_CONTINENT_INFORMATION)
   314 		do
   338 		do
   315 			ValidateWeapon(hog, GLOBAL_CONTINENT_INFORMATION[v][4],1)
   339 			ValidateWeapon(hog, GLOBAL_CONTINENT_INFORMATION[v][4][1],1)
   316 		end
   340 		end
   317 		AddAmmo(hog,amSwitch) --random continent
   341 		AddAmmo(hog,amSwitch) --random continent
   318 
   342 
   319 	--for the computers
   343 	--for the computers
   320 	else
   344 	else
   321 		--europe
   345 		--europe
   322 		ValidateWeapon(hog, GLOBAL_CONTINENT_INFORMATION[3][4],1)
   346 		ValidateWeapon(hog, GLOBAL_CONTINENT_INFORMATION[3][4][1],1)
   323 		--north america
   347 		--north america
   324 		ValidateWeapon(hog, GLOBAL_CONTINENT_INFORMATION[1][4],1)
   348 		ValidateWeapon(hog, GLOBAL_CONTINENT_INFORMATION[1][4][1],1)
   325 	end
   349 	end
   326 end
   350 end
   327 
   351 
   328 --shows the continent info
   352 --shows the continent info
   329 function ShowContinentInfo(continent,time,generalinf)
   353 function ShowContinentInfo(continent,time,generalinf)
   337 	if(generalinf)
   361 	if(generalinf)
   338 	then
   362 	then
   339 		geninftext="| |"..loc("General information")..": |"..GLOBAL_GENERAL_INFORMATION
   363 		geninftext="| |"..loc("General information")..": |"..GLOBAL_GENERAL_INFORMATION
   340 	end
   364 	end
   341 
   365 
   342 	GLOBAL_SHOW_SMALL_INFO=div(time,40)
   366 	ShowMission(GLOBAL_CONTINENT_INFORMATION[continent][1],GLOBAL_CONTINENT_INFORMATION[continent][2]..loc(" Starting HP: ")..GLOBAL_CONTINENT_INFORMATION[continent][7],GLOBAL_CONTINENT_INFORMATION[continent][3]..geninftext, GLOBAL_CONTINENT_INFORMATION[continent][4][2], time)
   343 
       
   344 	ShowMission(GLOBAL_CONTINENT_INFORMATION[continent][1],GLOBAL_CONTINENT_INFORMATION[continent][2],GLOBAL_CONTINENT_INFORMATION[continent][3]..geninftext, -GLOBAL_CONTINENT_INFORMATION[continent][4], time)
       
   345 	if(ns)
   367 	if(ns)
   346 	then
   368 	then
   347 		HideMission()
   369 		HideMission()
   348 	end
   370 	end
   349 end
   371 end
   366 		lap=lap+30
   388 		lap=lap+30
   367 		degr=degr-6.2831
   389 		degr=degr-6.2831
   368 	end
   390 	end
   369 end
   391 end
   370 
   392 
   371 --zealandia (generates weapons from the weaponinfo above
   393 --give one random weapon
   372 function ZealandiaGetWeapons(hog)
   394 function GetRandomWeapon(hog, weptype, power, onlyonewep, getdelayedweps, mypower)
   373 	if(GetGearType(hog) == gtHedgehog and GLOBAL_TEAM_CONTINENT[GetHogTeamName(hog)]==9 and getTeamValue(GetHogTeamName(hog), "rand-done-turn")==nil)
   395 
   374 	then
   396 	local wepout=nil
   375 		CleanWeapons(hog)
   397 	local rand_weaponset_power=mypower
   376 
   398 
   377 		local random_weapon = 0
   399 	if(rand_weaponset_power < power)
   378 		local old_rand_weap = 0
   400 	then
   379 		local rand_weaponset_power = 0
   401 		local numberofweapons=table.maxn(weptype)
   380 
   402 
   381 		local numberofweaponssupp=table.maxn(GLOBAL_WEAPONS_SUPPORT)
   403 		local random_weapon = math.abs(GetRandom(numberofweapons)+1)
   382 		local numberofweaponsdmg=table.maxn(GLOBAL_WEAPONS_DAMAGE)
   404 
   383 
   405 		while((weptype[random_weapon][4]>TotalRounds and getdelayedweps==false) or rand_weaponset_power+weptype[random_weapon][6]>power
   384 		local rand1=math.abs(GetRandom(numberofweaponssupp)+1)
   406 				or (wepNotValidBorder(weptype[random_weapon][1])==false) or GetAmmoCount(hog,weptype[random_weapon][1])>=100
   385 		local rand2=math.abs(GetRandom(numberofweaponsdmg)+1)
   407 				or (GetAmmoCount(hog,weptype[random_weapon][1])>=1 and onlyonewep==true))
   386 
       
   387 		random_weapon = math.abs(GetRandom(table.maxn(GLOBAL_WEAPONS_DAMAGE))+1)
       
   388 
       
   389 		while(GLOBAL_WEAPONS_DAMAGE[random_weapon][4]>TotalRounds or (MapHasBorder() == true and (GLOBAL_WEAPONS_DAMAGE[random_weapon][1]== amAirAttack or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amMineStrike or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amNapalm or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amDrillStrike or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amPiano)))
       
   390 		do
   408 		do
   391 			if(random_weapon>=numberofweaponsdmg)
   409 			if(random_weapon>=numberofweapons)
   392 			then
   410 			then
   393 				random_weapon=0
   411 				random_weapon=0
   394 			end
   412 			end
   395 			random_weapon = random_weapon+1
   413 			random_weapon = random_weapon+1
   396 		end
   414 		end
   397 		ValidateWeapon(hog, GLOBAL_WEAPONS_DAMAGE[random_weapon][1],1)
   415 
   398 		rand_weaponset_power=GLOBAL_WEAPONS_DAMAGE[random_weapon][6]
   416 		wepout=weptype[random_weapon][1]
   399 		old_rand_weap = random_weapon
   417 
   400 
   418 		ValidateWeapon(hog, wepout,1)
   401 		if(rand_weaponset_power <2)
   419 		rand_weaponset_power=mypower+weptype[random_weapon][6]
   402 		then
   420 	end
   403 			random_weapon = rand1
   421 
   404 			while(GLOBAL_WEAPONS_SUPPORT[random_weapon][4]>TotalRounds or rand_weaponset_power+GLOBAL_WEAPONS_SUPPORT[random_weapon][6]>2)
   422 	return rand_weaponset_power , wepout
   405 			do
   423 end
   406 				if(random_weapon>=numberofweaponssupp)
   424 
   407 				then
   425 --zealandia (generates weapons from the weaponinfo above) and sundaland
   408 					random_weapon=0
   426 function RandomContinentsGetWeapons(hog)
   409 				end
   427 	if(GetGearType(hog) == gtHedgehog)
   410 				random_weapon = random_weapon+1
   428 	then
   411 			end
   429 		local currCont=GLOBAL_TEAM_CONTINENT[GetHogTeamName(hog)]
   412 			ValidateWeapon(hog, GLOBAL_WEAPONS_SUPPORT[random_weapon][1],1)
   430 
   413 			rand_weaponset_power=rand_weaponset_power+GLOBAL_WEAPONS_SUPPORT[random_weapon][6]
   431 		if(currCont~=0)
   414 		end
   432 		then
   415 		--check again if  the power is enough
   433 			local checkDefCont=GLOBAL_CONTINENT_INFORMATION[currCont][4][2]
   416 		if(rand_weaponset_power <1)
   434 
   417 		then
   435 			--for sunda
   418 			random_weapon = rand2
   436 			local wepamount=getTeamValue(GetHogTeamName(hog), "sundaland-count")
   419 			while(GLOBAL_WEAPONS_DAMAGE[random_weapon][4]>TotalRounds or old_rand_weap == random_weapon or GLOBAL_WEAPONS_DAMAGE[random_weapon][6]>0 or (MapHasBorder() == true and (GLOBAL_WEAPONS_DAMAGE[random_weapon][1]== amAirAttack or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amMineStrike or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amNapalm or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amDrillStrike or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amPiano)))
   437 
   420 			do
   438 			if(checkDefCont==9 and getTeamValue(GetHogTeamName(hog), "rand-done-turn")==false)
   421 				if(random_weapon>=numberofweaponsdmg)
   439 			then
   422 				then
   440 				CleanWeapons(hog)
   423 					random_weapon=0
   441 
   424 				end
   442 				local rand_weaponset_power = 0
   425 				random_weapon = random_weapon+1
   443 				local currwep
   426 			end
   444 
   427 			ValidateWeapon(hog, GLOBAL_WEAPONS_DAMAGE[random_weapon][1],1)
   445 				rand_weaponset_power, currwep=GetRandomWeapon(hog,GLOBAL_WEAPONS_DAMAGE,100,true,false,rand_weaponset_power)
   428 		end
   446 				rand_weaponset_power, currwep=GetRandomWeapon(hog,GLOBAL_WEAPONS_SUPPORT,2,true,false,rand_weaponset_power)
   429 
   447 				rand_weaponset_power, currwep=GetRandomWeapon(hog,GLOBAL_WEAPONS_DAMAGE,1,true,false,rand_weaponset_power)
   430 		setTeamValue(GetHogTeamName(hog), "rand-done-turn", true)
   448 
   431 	end
   449 				setTeamValue(GetHogTeamName(hog), "rand-done-turn", true)
   432 end
   450 
   433 
   451 			elseif(checkDefCont==10 and wepamount~=nil)
   434 --sundaland add weps
   452 			then
   435 function SundalandGetWeapons(hog)
   453 				local loci=0
   436 
   454 
   437 		local random_weapon = 0
   455 				while(loci<wepamount)
   438 		local old_rand_weap = 0
   456 				do
   439 		local rand_weaponset_power = 0
   457 					--6 random weapons
   440 
   458 					GetRandomWeapon(hog,GLOBAL_WEAPONS_DAMAGE,100,false,true,0)
   441 		local firstTurn=0
   459 					GetRandomWeapon(hog,GLOBAL_WEAPONS_DAMAGE,100,false,true,0)
   442 
   460 					GetRandomWeapon(hog,GLOBAL_WEAPONS_DAMAGE,2,false,true,1)
   443 		local numberofweaponssupp=table.maxn(GLOBAL_WEAPONS_SUPPORT)
   461 
   444 		local numberofweaponsdmg=table.maxn(GLOBAL_WEAPONS_DAMAGE)
   462 					GetRandomWeapon(hog,GLOBAL_WEAPONS_SUPPORT,100,false,true,0)
   445 
   463 					GetRandomWeapon(hog,GLOBAL_WEAPONS_SUPPORT,100,false,true,0)
   446 		local rand1=GetRandom(numberofweaponssupp)+1
   464 					GetRandomWeapon(hog,GLOBAL_WEAPONS_SUPPORT,100,false,true,0)
   447 		local rand2=GetRandom(numberofweaponsdmg)+1
   465 
   448 		local rand3=GetRandom(numberofweaponsdmg)+1
   466 					loci=loci+1
   449 
   467 				end
   450 		random_weapon = GetRandom(numberofweaponsdmg)+1
   468 
   451 
   469 				setTeamValue(GetHogTeamName(hog), "sundaland-count",nil)
   452 		if(TotalRounds<0)
   470 			end
   453 		then
   471 		end
   454 			firstTurn=-TotalRounds
   472 	end
   455 		end
   473 end
   456 
       
   457 		while(GLOBAL_WEAPONS_DAMAGE[random_weapon][4]>(TotalRounds+firstTurn) or (MapHasBorder() == true and (GLOBAL_WEAPONS_DAMAGE[random_weapon][1]== amAirAttack or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amMineStrike or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amNapalm or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amDrillStrike or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amPiano)))
       
   458 		do
       
   459 			if(random_weapon>=numberofweaponsdmg)
       
   460 			then
       
   461 				random_weapon=0
       
   462 			end
       
   463 			random_weapon = random_weapon+1
       
   464 		end
       
   465 		ValidateWeapon(hog, GLOBAL_WEAPONS_DAMAGE[random_weapon][1],1)
       
   466 		rand_weaponset_power=GLOBAL_WEAPONS_DAMAGE[random_weapon][6]
       
   467 		old_rand_weap = random_weapon
       
   468 
       
   469 		random_weapon = rand1
       
   470 		while(GLOBAL_WEAPONS_SUPPORT[random_weapon][4]>(TotalRounds+firstTurn) or rand_weaponset_power+GLOBAL_WEAPONS_SUPPORT[random_weapon][6]>2)
       
   471 		do
       
   472 			if(random_weapon>=numberofweaponssupp)
       
   473 			then
       
   474 				random_weapon=0
       
   475 			end
       
   476 			random_weapon = random_weapon+1
       
   477 		end
       
   478 		ValidateWeapon(hog, GLOBAL_WEAPONS_SUPPORT[random_weapon][1],1)
       
   479 		rand_weaponset_power=rand_weaponset_power+GLOBAL_WEAPONS_SUPPORT[random_weapon][6]
       
   480 
       
   481 		--check again if  the power is enough
       
   482 		if(rand_weaponset_power <2)
       
   483 		then
       
   484 			random_weapon = rand2
       
   485 			while(GLOBAL_WEAPONS_DAMAGE[random_weapon][4]>(TotalRounds+firstTurn) or old_rand_weap == random_weapon or GLOBAL_WEAPONS_DAMAGE[random_weapon][6]>0 or (MapHasBorder() == true and (GLOBAL_WEAPONS_DAMAGE[random_weapon][1]== amAirAttack or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amMineStrike or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amNapalm or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amDrillStrike or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amPiano)))
       
   486 			do
       
   487 				if(random_weapon>=numberofweaponsdmg)
       
   488 				then
       
   489 					random_weapon=0
       
   490 				end
       
   491 				random_weapon = random_weapon+1
       
   492 			end
       
   493 			ValidateWeapon(hog, GLOBAL_WEAPONS_DAMAGE[random_weapon][1],1)
       
   494 			rand_weaponset_power=GLOBAL_WEAPONS_DAMAGE[random_weapon][6]
       
   495 		end
       
   496 
       
   497 		if(rand_weaponset_power <1)
       
   498 		then
       
   499 			random_weapon = rand3
       
   500 			while(GLOBAL_WEAPONS_DAMAGE[random_weapon][4]>(TotalRounds+firstTurn) or old_rand_weap == random_weapon or GLOBAL_WEAPONS_DAMAGE[random_weapon][6]>0 or (MapHasBorder() == true and (GLOBAL_WEAPONS_DAMAGE[random_weapon][1]== amAirAttack or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amMineStrike or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amNapalm or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amDrillStrike or GLOBAL_WEAPONS_DAMAGE[random_weapon][1] == amPiano)))
       
   501 			do
       
   502 				if(random_weapon>=numberofweaponsdmg)
       
   503 				then
       
   504 					random_weapon=0
       
   505 				end
       
   506 				random_weapon = random_weapon+1
       
   507 			end
       
   508 			ValidateWeapon(hog, GLOBAL_WEAPONS_DAMAGE[random_weapon][1],1)
       
   509 		end
       
   510 
       
   511 		AddVisualGear(GetX(hog), GetY(hog)-30, vgtEvilTrace,0, false)
       
   512 		PlaySound(sndReinforce,hog)
       
   513 end
       
   514 
       
   515 
   474 
   516 --this will take that hogs settings for the weapons and add them
   475 --this will take that hogs settings for the weapons and add them
   517 function SetContinentWeapons()
   476 function SetContinentWeapons()
   518 
   477 
   519 	CleanWeapons(CurrentHedgehog)
   478 	CleanWeapons(CurrentHedgehog)
   524 	SetVisualGearValues(visualstuff, v1, v2, v3, v4, v5, v6, v7, 2, v9, GetClanColor(GetHogClan(CurrentHedgehog)))
   483 	SetVisualGearValues(visualstuff, v1, v2, v3, v4, v5, v6, v7, 2, v9, GetClanColor(GetHogClan(CurrentHedgehog)))
   525 
   484 
   526 	ShowContinentInfo(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)],3000,false)
   485 	ShowContinentInfo(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)],3000,false)
   527 end
   486 end
   528 
   487 
       
   488 --count hogs in team
       
   489 function CountHogsInTeam(hog)
       
   490 	if(GetHogTeamName(hog)==GetHogTeamName(CurrentHedgehog))
       
   491 	then
       
   492 		GLOBAL_TEMP_VALUE=GLOBAL_TEMP_VALUE+1
       
   493 	end
       
   494 end
       
   495 
   529 --==========================run throw all hog/gear weapons ==========================
   496 --==========================run throw all hog/gear weapons ==========================
       
   497 
       
   498 function SetHogHealth(hog)
       
   499 	if(GetGearType(hog) == gtHedgehog and GetHogClan(hog) == GetHogClan(CurrentHedgehog))
       
   500 	then
       
   501 		SetHealth(hog, div(GLOBAL_TEMP_VALUE*GLOBAL_HOG_HEALTH,100))
       
   502 	end
       
   503 end
       
   504 
   530 --will check if the mine is nicely placed
   505 --will check if the mine is nicely placed
   531 function AustraliaSpecialCheckHogs(hog)
   506 function AustraliaSpecialCheckHogs(hog)
   532 	if(GetGearType(hog) == gtHedgehog)
   507 	if(GetGearType(hog) == gtHedgehog)
   533 	then
   508 	then
   534 		if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 40, false)==true and hog ~= CurrentHedgehog)
   509 		if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 40, false)==true and hog ~= CurrentHedgehog)
   540 
   515 
   541 --african special on sedunction
   516 --african special on sedunction
   542 function AfricaSpecialSeduction(hog)
   517 function AfricaSpecialSeduction(hog)
   543 	if(GetGearType(hog) == gtHedgehog)
   518 	if(GetGearType(hog) == gtHedgehog)
   544 	then
   519 	then
   545 		local dmg=div(15*GLOBAL_EXTRA_DAMAGE_IS_ON,100)
   520 		local dmg=div((15+GLOBAL_SEDUCTION_INCREASER)*GLOBAL_EXTRA_DAMAGE_IS_ON,100)
   546 		if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 250, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
   521 		if(gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 250, false)==true and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog))
   547 		then
   522 		then
   548 			if(GetHealth(hog) > dmg)
   523 			if(GetHealth(hog) > dmg)
   549 			then
   524 			then
   550 				GLOBAL_TEMP_VALUE=GLOBAL_TEMP_VALUE+div(dmg*GLOBAL_VAMPIRIC_IS_ON,100)
   525 				GLOBAL_TEMP_VALUE=GLOBAL_TEMP_VALUE+div(dmg*GLOBAL_VAMPIRIC_IS_ON,100)
   583 
   558 
   584 --will count the hogs, used to get one random hog.
   559 --will count the hogs, used to get one random hog.
   585 function KerguelenSpecialYellowCountHogs(hog)
   560 function KerguelenSpecialYellowCountHogs(hog)
   586 	if(GetGearType(hog) == gtHedgehog)
   561 	if(GetGearType(hog) == gtHedgehog)
   587 	then
   562 	then
   588 		if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 420, false))
   563 		if(GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 390, false))
   589 		then
   564 		then
   590 			GLOBAL_TEMP_VALUE=GLOBAL_TEMP_VALUE+1
   565 			GLOBAL_TEMP_VALUE=GLOBAL_TEMP_VALUE+1
   591 		end
   566 		end
   592 	end
   567 	end
   593 end
   568 end
   625 	end
   600 	end
   626 end
   601 end
   627 
   602 
   628 --first part on kerguelen special (lonely cries)
   603 --first part on kerguelen special (lonely cries)
   629 function KerguelenSpecialBlueCheck(hog)
   604 function KerguelenSpecialBlueCheck(hog)
   630 	if(GetGearType(hog) == gtHedgehog and hog ~= CurrentHedgehog and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 550, false))
   605 	if(GetGearType(hog) == gtHedgehog and hog ~= CurrentHedgehog and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 500, false))
   631 	then
   606 	then
   632 		GLOBAL_KERGUELEN_SPECIAL=-1
   607 		GLOBAL_TEMP_VALUE=1
   633 	end
   608 	end
   634 end
   609 end
   635 
   610 
   636 --second part on kerguelen special (lonely cries)
   611 --second part on kerguelen special (lonely cries)
   637 function KerguelenSpecialBlueActivate(hog)
   612 function KerguelenSpecialBlueActivate(hog)
   653 			AddVisualGear(GetX(hog), GetY(hog)-30, vgtEvilTrace, 0, false)
   628 			AddVisualGear(GetX(hog), GetY(hog)-30, vgtEvilTrace, 0, false)
   654 		end
   629 		end
   655 	end
   630 	end
   656 end
   631 end
   657 
   632 
   658 --australia
       
   659 function AustraliaSpecialEggHit(hog)
       
   660 	if(GetGearType(hog) == gtHedgehog)
       
   661 	then
       
   662 		if(gearIsInCircle(hog,GetX(GLOBAL_TEMP_VALUE), GetY(GLOBAL_TEMP_VALUE), 18, false))
       
   663 		then
       
   664 			GLOBAL_SABOTAGE_HOGS[hog]=1
       
   665 			PlaySound(sndNooo,hog)
       
   666 			SetEffect(hog, hePoisoned, false)
       
   667 		end
       
   668 	end
       
   669 end
       
   670 
       
   671 --south american special (used fire gear)
   633 --south american special (used fire gear)
   672 function SouthAmericaSpecialCheeseExplosion(hog)
   634 function SouthAmericaSpecialCheeseExplosion(hog)
   673 	if(GetGearType(hog) == gtHedgehog or GetGearType(hog) == gtMine or GetGearType(hog) == gtExplosives)
   635 	if(GetGearType(hog) == gtHedgehog or GetGearType(hog) == gtMine or GetGearType(hog) == gtExplosives)
   674 	then
   636 	then
   675 		local power_radius_outer=230
   637 		local power_radius_outer=230
   676 		local power_radius_inner=45
   638 		local power_sa=700000
   677 		local power_sa=500000
       
   678 		local hypo=0
   639 		local hypo=0
   679 		if(gearIsInCircle(hog,GetX(GLOBAL_TEMP_VALUE), GetY(GLOBAL_TEMP_VALUE), power_radius_outer, false) and gearIsInCircle(hog,GetX(GLOBAL_TEMP_VALUE), GetY(GLOBAL_TEMP_VALUE), power_radius_inner, false)==false)
   640 		if(gearIsInCircle(hog,GetX(GLOBAL_TEMP_VALUE), GetY(GLOBAL_TEMP_VALUE), power_radius_outer, false))
   680 		then
   641 		then
   681 			if(hog == CurrentHedgehog)
   642 			if(hog == CurrentHedgehog)
   682 			then
   643 			then
   683 				SetState(CurrentHedgehog, gstMoving)
   644 				SetState(CurrentHedgehog, gstMoving)
   684 			end
   645 			end
   693 function NorthAmericaSpecialSniper(hog)
   654 function NorthAmericaSpecialSniper(hog)
   694 	if(GetGearType(hog) == gtHedgehog)
   655 	if(GetGearType(hog) == gtHedgehog)
   695 	then
   656 	then
   696 		if(gearIsInCircle(GLOBAL_TEMP_VALUE,GetX(hog), GetY(hog), 20, false))
   657 		if(gearIsInCircle(GLOBAL_TEMP_VALUE,GetX(hog), GetY(hog), 20, false))
   697 		then
   658 		then
   698 			SetEffect(hog, hePoisoned, 1)
   659 			SetEffect(hog, hePoisoned, 5)
   699 			PlaySound(sndBump)
   660 			PlaySound(sndBump)
   700 		end
   661 		end
   701 	end
   662 	end
   702 end
   663 end
   703 
   664 
   705 function EuropeSpecialMolotovHit(hog)
   666 function EuropeSpecialMolotovHit(hog)
   706 	if(GetGearType(hog) == gtHedgehog)
   667 	if(GetGearType(hog) == gtHedgehog)
   707 	then
   668 	then
   708 		if(gearIsInCircle(GLOBAL_TEMP_VALUE,GetX(hog), GetY(hog), 100, false))
   669 		if(gearIsInCircle(GLOBAL_TEMP_VALUE,GetX(hog), GetY(hog), 100, false))
   709 		then
   670 		then
   710 			HealHog(hog, 25 + (div(25*GLOBAL_VAMPIRIC_IS_ON,100)), hog == CurrentHedgehog)
   671 			local healthadd=15
       
   672 			HealHog(hog, healthadd+(div(healthadd*GLOBAL_VAMPIRIC_IS_ON,100)), hog == CurrentHedgehog)
   711 			SetEffect(hog, hePoisoned, false)
   673 			SetEffect(hog, hePoisoned, false)
   712 			GLOBAL_SABOTAGE_HOGS[hog]=0
   674 			GLOBAL_SABOTAGE_HOGS[hog]=0
   713 		end
   675 		end
   714 	end
   676 	end
   715 end
   677 end
   716 
   678 
   717 --for sundaland
   679 --a weaponset string to something readable by the script
   718 function SundalandFindOtherHogInTeam(hog)
   680 function transferableParamToWeaponSet(string,icon)
       
   681 	local continentinfo={}
       
   682 	local numb=0
       
   683 	local wepcodes=0
       
   684 	local where=0
       
   685 
       
   686 	local x=0
       
   687 	local i=1
       
   688 
       
   689 	--default icon
       
   690 	continentinfo[4]={}
       
   691 	if(icon==1000)
       
   692 	then
       
   693 		local mid=table.maxn(GLOBAL_WEAPONS_DAMAGE)
       
   694 		local max=mid+table.maxn(GLOBAL_WEAPONS_SUPPORT)
       
   695 		local ic=(string.byte(string) % max)+1
       
   696 
       
   697 		if(ic>mid)
       
   698 		then
       
   699 			ic=GLOBAL_WEAPONS_SUPPORT[ic-mid][1]
       
   700 		else
       
   701 			ic=GLOBAL_WEAPONS_DAMAGE[ic][1]
       
   702 		end
       
   703 
       
   704 		continentinfo[4][1]=ic
       
   705 		continentinfo[4][2]=-ic
       
   706 	else
       
   707 		continentinfo[4][1]=icon
       
   708 		continentinfo[4][2]=-icon
       
   709 	end
       
   710 
       
   711 	continentinfo[6]={sndFrozenHogImpact,sndUhOh}
       
   712 	continentinfo[7]=100
       
   713 
       
   714 	for c in string:gmatch"."
       
   715 	do
       
   716 		--first part, eg name of the weaponset
       
   717 		if(where==0)
       
   718 		then
       
   719 			if(string.byte(c)==126)
       
   720 			then
       
   721 				continentinfo[1]=string.sub(string,0,numb)
       
   722 				wepcodes=numb
       
   723 				where=1
       
   724 			end
       
   725 		--second part, subname of the weaponset
       
   726 		elseif(where==1)
       
   727 		then
       
   728 			if(string.byte(c)==126)
       
   729 			then
       
   730 				continentinfo[2]=string.sub(string,wepcodes+2,numb)
       
   731 				continentinfo[5]={}
       
   732 				wepcodes=numb
       
   733 				where=2
       
   734 			end
       
   735 		--insert all weapons
       
   736 		elseif(where==2)
       
   737 		then
       
   738 			x=string.byte(c)-35
       
   739 			if(x>90)
       
   740 			then
       
   741 				break
       
   742 			elseif(x>80)
       
   743 			then
       
   744 				if(x-80<10)
       
   745 				then
       
   746 					i=x-80
       
   747 				else
       
   748 					i=100
       
   749 				end
       
   750 			else
       
   751 				table.insert(continentinfo[5],{x,i})
       
   752 			end
       
   753 		end
       
   754 		numb=numb+1
       
   755 	end
       
   756 
       
   757 	if(continentinfo[5]~=nil and continentinfo[5][1]~=nil)
       
   758 	then
       
   759 		continentinfo[3]="- "..continentinfo[1]..loc(" was extracted from the scheme|- This continent will be able to use the specials from the other continents!")
       
   760 
       
   761 		table.insert(GLOBAL_CONTINENT_INFORMATION, continentinfo)
       
   762 	end
       
   763 
       
   764 	return nil
       
   765 end
       
   766 
       
   767 --add a weaponset from a hogname
       
   768 function HogNameToWeaponset(hog)
   719 	if(GetGearType(hog) == gtHedgehog)
   769 	if(GetGearType(hog) == gtHedgehog)
   720 	then
   770 	then
   721 		if(GetHogTeamName(GLOBAL_SUNDALAND_END_HOG)==GetHogTeamName(hog))
   771 		local string=GetHogName(hog)
   722 		then
   772 		local numb=0
   723 			GLOBAL_SUNDALAND_END_HOG=hog
   773 
   724 		end
   774 		for c in string:gmatch"."
   725 	end
   775 		do
   726 end
   776 			if(string.byte(c)==126)
       
   777 			then
       
   778 				local name=string.sub(string,0,numb)
       
   779 				SetHogName(hog,name)
       
   780 				local weaponcode=string.sub(string,numb+2)
       
   781 				local continentinfo=transferableParamToWeaponSet(weaponcode,1000)
       
   782 
       
   783 				if(continentinfo~=nil)
       
   784 				then
       
   785 					table.insert(GLOBAL_CONTINENT_INFORMATION, continentinfo)
       
   786 				end
       
   787 				return
       
   788 			end
       
   789 			numb=numb+1
       
   790 		end
       
   791 	end
       
   792 end
       
   793 
   727 --============================================================================
   794 --============================================================================
       
   795 
       
   796 --Parameters -> [options],[global-continent]
       
   797 --wt=yes			allow to search for weaponsets on hog names
       
   798 --spec=off		disable specials (will make stuff unbalanced)
       
   799 --cont=no		remove the pre-defined continents
   728 
   800 
   729 --for custom made continent, follows the same standards as the globalism one. You can make your continent with <Name>~<Information>~<Weapons>. Take the weapons generated from globalism, if you want a GUI :P
   801 --for custom made continent, follows the same standards as the globalism one. You can make your continent with <Name>~<Information>~<Weapons>. Take the weapons generated from globalism, if you want a GUI :P
   730 --weapons=<ammo><types>, ammo = ascii[116(1 ammo) to 125(inf ammo)] types = ascii[36(Grenade), 37(Clusterbomb) to 90(knife)] see http://hedgewars.org/kb/AmmoTypes
   802 --weapons=<ammo><types>, ammo = ascii[116(1 ammo) to 125(inf ammo)] types = ascii[36(Grenade), 37(Clusterbomb) to 90(knife)] see http://hedgewars.org/kb/AmmoTypes
   731 --ex "Own continent~this continent rocks!~tZ}$" will get 1 knife and inf grenades
   803 --ex "Own continent~this continent rocks!~tZ}$" will get 1 knife and inf grenades
   732 function onParameters()
   804 function onParameters()
   733 
   805 
       
   806 	local searchfor="wt=yes"
       
   807 	local match=string.find(ScriptParam,searchfor, 1)
       
   808 
       
   809 	if(match~=nil)
       
   810 	then
       
   811 		GLOBAL_TEMP_VALUE=1
       
   812 
       
   813 		ScriptParam=string.gsub(ScriptParam,"(,?)"..searchfor.."(,?)","")
       
   814 	end
       
   815 
       
   816 	searchfor="spec=off"
       
   817 	match=string.find(ScriptParam,searchfor, 1)
       
   818 
       
   819 	if(match~=nil)
       
   820 	then
       
   821 		OPTION_NO_SPECIALS=true
       
   822 
       
   823 		ScriptParam=string.gsub(ScriptParam,"(,?)"..searchfor.."(,?)","")
       
   824 	end
       
   825 
       
   826 	searchfor="cont=no"
       
   827 	match=string.find(ScriptParam,searchfor, 1)
       
   828 
       
   829 	if(match~=nil)
       
   830 	then
       
   831 		GLOBAL_CONTINENT_INFORMATION={}
       
   832 
       
   833 		ScriptParam=string.gsub(ScriptParam,"(,?)"..searchfor.."(,?)","")
       
   834 	end
       
   835 
   734 	if(ScriptParam~=nil)
   836 	if(ScriptParam~=nil)
   735 	then
   837 	then
   736 		local continentinfo={}
   838 		local continentinfo=transferableParamToWeaponSet(ScriptParam,amLowGravity)
   737 		local numb=0
   839 
   738 		local wepcodes=0
   840 		if(continentinfo~=nil)
   739 		local where=0
   841 		then
   740 
       
   741 		local x=0
       
   742 		local i=1
       
   743 
       
   744 		--default icon
       
   745 		continentinfo[4]=amLowGravity
       
   746 
       
   747 		for c in ScriptParam:gmatch"."
       
   748 		do
       
   749 			if(where==0)
       
   750 			then
       
   751 				if(string.byte(c)==126)
       
   752 				then
       
   753 					continentinfo[1]=string.sub(ScriptParam,0,numb)
       
   754 					wepcodes=numb
       
   755 					where=1
       
   756 				end
       
   757 			elseif(where==1)
       
   758 			then
       
   759 				if(string.byte(c)==126)
       
   760 				then
       
   761 					continentinfo[2]=string.sub(ScriptParam,wepcodes+2,numb)
       
   762 					continentinfo[5]={}
       
   763 					wepcodes=numb
       
   764 					where=2
       
   765 				end
       
   766 			elseif(where==2)
       
   767 			then
       
   768 				x=string.byte(c)-35
       
   769 				if(x>90)
       
   770 				then
       
   771 					break
       
   772 				elseif(x>80)
       
   773 				then
       
   774 					if(x-80<10)
       
   775 					then
       
   776 						i=x-80
       
   777 					else
       
   778 						i=100
       
   779 					end
       
   780 				else
       
   781 					table.insert(continentinfo[5],{x,i})
       
   782 				end
       
   783 			end
       
   784 			numb=numb+1
       
   785 		end
       
   786 
       
   787 		if(continentinfo[5]~=nil and continentinfo[5][1]~=nil)
       
   788 		then
       
   789 			continentinfo[3]="- "..continentinfo[1]..loc(" was extracted from the scheme|- This continent will be able to use the specials from the other continents!")
       
   790 
       
   791 			table.insert(GLOBAL_CONTINENT_INFORMATION, continentinfo)
   842 			table.insert(GLOBAL_CONTINENT_INFORMATION, continentinfo)
   792 		end
   843 		end
   793 	end
   844 	end
   794 end
   845 end
   795 
   846 
   809 	end
   860 	end
   810 end
   861 end
   811 
   862 
   812 --on game start
   863 --on game start
   813 function onGameStart()
   864 function onGameStart()
   814 	ShowMission(loc("Continental supplies"),loc("Let a continent provide your weapons!"),
   865 	ShowMission(loc("Continental supplies"),loc("Let a continent provide your weapons!"),GLOBAL_GENERAL_INFORMATION, -amLowGravity, 0)
   815 	GLOBAL_GENERAL_INFORMATION, -amLowGravity, 0)
   866 
       
   867 	local specText="| |"..loc("Additional feautures for this weapon: (Switch/Tab)").."|"
       
   868 
       
   869 	SetAmmoDescriptionAppendix(amSniperRifle,specText..GLOBAL_SNIPER_SPECIAL_INFO)
       
   870 	SetAmmoDescriptionAppendix(amBaseballBat,specText..GLOBAL_BASEBALLBAT_BOOMERANG_INFO .. "|" .. GLOBAL_BASEBALLBAT_CRICKET_INFO)
       
   871 	SetAmmoDescriptionAppendix(amGasBomb,specText..GLOBAL_CHEESE_SPECIAL_INFO)
       
   872 	SetAmmoDescriptionAppendix(amSeduction,specText..GLOBAL_SEDUCTION_SPECIAL_INFO)
       
   873 	SetAmmoDescriptionAppendix(amInvulnerable,specText..GLOBAL_INVULNERABLE_SPECIAL_INFO)
       
   874 	SetAmmoDescriptionAppendix(amParachute,specText..GLOBAL_PARACHUTE_SPECIAL_INFO)
       
   875 	SetAmmoDescriptionAppendix(amHammer,specText..GLOBAL_HAMMER_ROAR_INFO .. "|" .. GLOBAL_HAMMER_SWAP_INFO .. "|" .. GLOBAL_HAMMER_LONELY_INFO .. "|" .. GLOBAL_HAMMER_SABOTAGE_INFO)
       
   876 	SetAmmoDescriptionAppendix(amSMine,specText..GLOBAL_STICKY_PROJECTILE_INFO .. "|" .. GLOBAL_STICKY_NAPALM_INFO)
       
   877 	SetAmmoDescriptionAppendix(amShotgun,specText..GLOBAL_SHOTGUN_SPECIAL_INFO)
       
   878 	SetAmmoDescriptionAppendix(amMolotov,specText..GLOBAL_MOLOTOV_SPECIAL_INFO)
       
   879 	SetAmmoDescriptionAppendix(amPickHammer,specText..GLOBAL_PICKHAMMER_SPECIAL_INFO)
       
   880 
       
   881 	if(GLOBAL_TEMP_VALUE==1)
       
   882 	then
       
   883 		runOnGears(HogNameToWeaponset)
       
   884 	end
       
   885 end
       
   886 
       
   887 function onGameInit()
       
   888 	SuddenDeathTurns= SuddenDeathTurns+1
   816 end
   889 end
   817 
   890 
   818 --what happen when a turn starts
   891 --what happen when a turn starts
   819 function onNewTurn()
   892 function onNewTurn()
   820 
   893 
   821 	--will refresh the info on each tab weapon
   894 	--will refresh the info on each tab weapon
   822 	GLOBAL_AUSTRALIAN_SPECIAL=0
   895 	GLOBAL_AUSTRALIAN_SPECIAL=0
   823 	GLOBAL_AFRICAN_SPECIAL_SEDUCTION=0
   896 	GLOBAL_AFRICAN_SPECIAL_SEDUCTION=0
       
   897 	GLOBAL_SEDUCTION_INCREASER=0
   824 	GLOBAL_SOUTH_AMERICAN_SPECIAL=false
   898 	GLOBAL_SOUTH_AMERICAN_SPECIAL=false
   825 	GLOBAL_AFRICAN_SPECIAL_STICKY=0
   899 	GLOBAL_AFRICAN_SPECIAL_STICKY=0
   826 	GLOBAL_KERGUELEN_SPECIAL=1
   900 	GLOBAL_KERGUELEN_SPECIAL=1
   827 	GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER=1
   901 	GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER=1
   828 	GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN=false
   902 	GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN=false
   829 	GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=false
   903 	GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=false
   830 	GLOBAL_EUROPE_SPECIAL=0
   904 	GLOBAL_EUROPE_SPECIAL=0
   831 	GLOBAL_VAMPIRIC_IS_ON=0
   905 	GLOBAL_VAMPIRIC_IS_ON=0
   832 	GLOBAL_EXTRA_DAMAGE_IS_ON=100
   906 	GLOBAL_EXTRA_DAMAGE_IS_ON=100
       
   907 	GLOBAL_CRATE_TEST=-1
       
   908 	GLOBAL_SABOTAGE_COUNTER=0
       
   909 	GLOBAL_ANTARCTICA_SPECIAL=0
   833 
   910 
   834 	GLOBAL_TEMP_VALUE=0
   911 	GLOBAL_TEMP_VALUE=0
   835 
   912 
   836 	GLOBAL_SUNDALAND_END_HOG=CurrentHedgehog
   913 	GLOBAL_SUNDALAND_END_HOG_CONTINENT_NAME=GetHogTeamName(CurrentHedgehog)
   837 
   914 
   838 	--when all hogs are "placed"
   915 	--when all hogs are "placed"
   839 	if(GetCurAmmoType()~=amTeleport)
   916 	if(GetCurAmmoType()~=amTeleport)
   840 	then
   917 	then
   841 		--will run once when the game really starts (after placing hogs and so on
   918 		--will run once when the game really starts (after placing hogs and so on
   842 		if(GLOBAL_INIT_TEAMS[GetHogTeamName(CurrentHedgehog)] == nil)
   919 		if(GLOBAL_INIT_TEAMS[GetHogTeamName(CurrentHedgehog)] == nil)
   843 		then
   920 		then
   844 			AddCaption("["..loc("Select continent!").."]")
   921 			SetInputMask(band(0xFFFFFFFF,gmWeapon))
       
   922 
       
   923 			if(GLOBAL_START_TIME==0)
       
   924 			then
       
   925 				GLOBAL_START_TIME=TurnTimeLeft
       
   926 				GLOBAL_HOG_HEALTH=GetHealth(CurrentHedgehog)
       
   927 			end
       
   928 
       
   929 			TurnTimeLeft=100000
       
   930 
       
   931 			AddCaption(GLOBAL_SELECT_WEP_INFORMATION, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpMessage)
       
   932 			ShowMission(loc("Continental supplies"),loc("Let a continent provide your weapons!"),GLOBAL_GENERAL_INFORMATION, -amLowGravity, 0)
       
   933 			HideMission()
       
   934 
   845 			InitWeaponsMenu(CurrentHedgehog)
   935 			InitWeaponsMenu(CurrentHedgehog)
   846 			GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=0
   936 			GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=0
   847 			GLOBAL_SELECT_CONTINENT_CHECK=true
   937 			GLOBAL_SELECT_CONTINENT_CHECK=true
   848 			GLOBAL_INIT_TEAMS[GetHogTeamName(CurrentHedgehog)] = 2
   938 			GLOBAL_INIT_TEAMS[GetHogTeamName(CurrentHedgehog)] = 2
   849 
   939 
   850 			if(GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]~=nil and GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==1)
   940 --			if(GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==1)
   851 			then
   941 --			then
   852 				GLOBAL_SABOTAGE_COUNTER=-750
   942 --				GLOBAL_SABOTAGE_COUNTER=-750
   853 			end
   943 --			end
   854 		else
   944 		else
   855 			--if its not the initialization turn
   945 			--if its not the initialization turn
   856 			GLOBAL_SELECT_CONTINENT_CHECK=false
   946 			GLOBAL_SELECT_CONTINENT_CHECK=false
       
   947 			SetInputMask(0xFFFFFFFF)
       
   948 
   857 			if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0)
   949 			if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0)
   858 			then
   950 			then
   859 				GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.maxn(GLOBAL_CONTINENT_INFORMATION))+1
   951 				GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.maxn(GLOBAL_CONTINENT_INFORMATION))+1
   860 				SetContinentWeapons()
   952 				SetContinentWeapons()
   861 			end
   953 			end
   862 			ShowContinentInfo(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)],-1,true)
   954 			local currCont=GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]
       
   955 			local checkDefCont=GLOBAL_CONTINENT_INFORMATION[currCont][4][2]
   863 
   956 
   864 			--give zeelandia-teams new weapons so they can plan for the next turn
   957 			--give zeelandia-teams new weapons so they can plan for the next turn
   865 			runOnGears(ZealandiaGetWeapons)
   958 			runOnGears(RandomContinentsGetWeapons)
   866 
   959 
   867 			--some specials for some continents (GLOBAL_TEMP_VALUE is from get random weapons)
   960 			--some specials for some continents (GLOBAL_TEMP_VALUE is from get random weapons)
   868 			if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==9)
   961 			if(checkDefCont==9)
   869 			then
   962 			then
   870 				setTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn", nil)
   963 				setTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn", false)
   871 			elseif(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==7)
   964 			elseif(checkDefCont==7)
   872 			then
   965 			then
       
   966 				--this will be set on the second turn
   873 				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick")==nil)
   967 				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick")==nil)
   874 				then
   968 				then
   875 					setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick", 1)
   969 					setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick", 1)
   876 				end
   970 				end
   877 
   971 
   878 				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick")>=4)
   972 				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick")>=4)
   879 				then
   973 				then
   880 					AddAmmo(CurrentHedgehog,amPortalGun)
       
   881 					AddAmmo(CurrentHedgehog,amPortalGun)
   974 					AddAmmo(CurrentHedgehog,amPortalGun)
   882 					AddAmmo(CurrentHedgehog,amSineGun)
   975 					AddAmmo(CurrentHedgehog,amSineGun)
   883 					AddAmmo(CurrentHedgehog,amSineGun)
   976 					AddAmmo(CurrentHedgehog,amSineGun)
   884 					AddAmmo(CurrentHedgehog,amGirder)
   977 					AddAmmo(CurrentHedgehog,amGirder)
   885 					AddAmmo(CurrentHedgehog,amSnowball)
   978 					AddAmmo(CurrentHedgehog,amSnowball)
   886 					setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick", 0)
   979 					setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick", 0)
   887 				end
   980 				end
   888 				setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick", getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick")+1)
   981 				setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick", getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick")+1)
   889 
   982 
   890 			elseif(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==5)
   983 			elseif(checkDefCont==5)
   891 			then
   984 			then
       
   985 				--this will be set on the second turn
   892 				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick")==nil)
   986 				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick")==nil)
   893 				then
   987 				then
   894 					setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", 1)
   988 					setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", 1)
   895 				end
   989 				end
   896 
   990 
   898 				then
   992 				then
   899 					AddAmmo(CurrentHedgehog,amParachute)
   993 					AddAmmo(CurrentHedgehog,amParachute)
   900 					setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", 0)
   994 					setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", 0)
   901 				end
   995 				end
   902 				setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", getTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick")+1)
   996 				setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", getTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick")+1)
   903 			elseif(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==1)
   997 			elseif(checkDefCont==1)
   904 			then
   998 			then
   905 				AddAmmo(CurrentHedgehog,amSwitch,GetAmmoCount(CurrentHedgehog, amSwitch)+1)
   999 				GLOBAL_TEMP_VALUE=0
   906 
  1000 				runOnGears(CountHogsInTeam)
   907 				SetWeapon(amSwitch)
  1001 
   908 				GLOBAL_TEMP_VALUE=87
  1002 				if(GLOBAL_TEMP_VALUE>1)
   909 			end
  1003 				then
       
  1004 					AddAmmo(CurrentHedgehog,amSwitch,GetAmmoCount(CurrentHedgehog, amSwitch)+1)
       
  1005 
       
  1006 					SetWeapon(amSwitch)
       
  1007 					GLOBAL_TEMP_VALUE=87
       
  1008 				end
       
  1009 			end
       
  1010 
       
  1011 			ShowContinentInfo(currCont,-1,true)
   910 		end
  1012 		end
   911 	end
  1013 	end
   912 end
  1014 end
   913 
  1015 
   914 --what happens when you press "tab" (common button)
  1016 --what happens when you press "tab" (common button)
   915 function onSwitch()
  1017 function onSwitch()
   916 
  1018 
   917 	if(GLOBAL_SWITCH_HOG_IS_ON==false)
  1019 	if(GLOBAL_SWITCH_HOG_IS_ON==false)
   918 	then
  1020 	then
   919 		--place mine (australia)
  1021 		if(OPTION_NO_SPECIALS==false and GLOBAL_SELECT_CONTINENT_CHECK==false)
   920 		if(GetCurAmmoType() == amBaseballBat)
  1022 		then
   921 		then
  1023 			--place mine (australia)
   922 			if(GLOBAL_AUSTRALIAN_SPECIAL==0)
  1024 			if(GetCurAmmoType() == amBaseballBat)
   923 			then
  1025 			then
   924 				GLOBAL_AUSTRALIAN_SPECIAL = 1
  1026 				if(GLOBAL_AUSTRALIAN_SPECIAL==0)
   925 				AddCaption(GLOBAL_WEAPON_TEXTS[5])
  1027 				then
   926 			elseif(GLOBAL_AUSTRALIAN_SPECIAL==1)
  1028 					GLOBAL_AUSTRALIAN_SPECIAL = 1
   927 			then
  1029 					AddCaption(GLOBAL_BASEBALLBAT_CRICKET_INFO)
   928 				GLOBAL_AUSTRALIAN_SPECIAL = 2
  1030 				elseif(GLOBAL_AUSTRALIAN_SPECIAL==1)
   929 				AddCaption(GLOBAL_WEAPON_TEXTS[2])
  1031 				then
   930 			else
  1032 					GLOBAL_AUSTRALIAN_SPECIAL = 2
   931 				GLOBAL_AUSTRALIAN_SPECIAL = 0
  1033 					AddCaption(GLOBAL_BASEBALLBAT_BOOMERANG_INFO)
   932 				AddCaption(loc("NORMAL"))
  1034 				else
   933 			end
  1035 					GLOBAL_AUSTRALIAN_SPECIAL = 0
   934 
  1036 					AddCaption(loc("DEFAULT"))
   935 		--Asian special
  1037 				end
   936 		elseif(GLOBAL_PARACHUTE_IS_ON==1)
  1038 
   937 		then
  1039 			--Asian special
   938 			asiabomb=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+3, gtSnowball, 0, 0, 0, 0)
  1040 			elseif(GLOBAL_PARACHUTE_IS_ON==1)
   939 			SetGearMessage(asiabomb, 1)
  1041 			then
   940 
  1042 				asiabomb=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+3, gtSnowball, 0, 0, 0, 0)
   941 			GLOBAL_PARACHUTE_IS_ON=2
  1043 				SetGearMessage(asiabomb, 1)
   942 			GLOBAL_SELECT_CONTINENT_CHECK=false
  1044 
   943 
  1045 				GLOBAL_PARACHUTE_IS_ON=2
   944 		--africa
  1046 				GLOBAL_SELECT_CONTINENT_CHECK=false
   945 		elseif(GetCurAmmoType() == amSeduction)
  1047 
   946 		then
  1048 			--africa
   947 			if(GLOBAL_AFRICAN_SPECIAL_SEDUCTION==0)
  1049 			elseif(GetCurAmmoType() == amSeduction)
   948 			then
  1050 			then
   949 				GLOBAL_AFRICAN_SPECIAL_SEDUCTION = 1
  1051 				if(GLOBAL_AFRICAN_SPECIAL_SEDUCTION==0)
   950 				AddCaption(GLOBAL_WEAPON_TEXTS[4])
  1052 				then
   951 			else
  1053 					GLOBAL_AFRICAN_SPECIAL_SEDUCTION = 1
   952 				GLOBAL_AFRICAN_SPECIAL_SEDUCTION = 0
  1054 
   953 				AddCaption(loc("NORMAL"))
  1055 					AddCaption(string.format(GLOBAL_SEDUCTION_SPECIAL_INFO,GLOBAL_SEDUCTION_INCREASER))
   954 			end
  1056 				else
   955 
  1057 					GLOBAL_AFRICAN_SPECIAL_SEDUCTION = 0
   956 		--south america
  1058 					AddCaption(loc("DEFAULT"))
   957 		elseif(GetCurAmmoType() == amGasBomb)
  1059 				end
   958 		then
  1060 
   959 			if(GLOBAL_SOUTH_AMERICAN_SPECIAL==false)
  1061 			--south america
   960 			then
  1062 			elseif(GetCurAmmoType() == amGasBomb)
   961 				GLOBAL_SOUTH_AMERICAN_SPECIAL = true
  1063 			then
   962 				AddCaption(GLOBAL_WEAPON_TEXTS[3])
  1064 				if(GLOBAL_SOUTH_AMERICAN_SPECIAL==false)
   963 			else
  1065 				then
   964 				GLOBAL_SOUTH_AMERICAN_SPECIAL = false
  1066 					GLOBAL_SOUTH_AMERICAN_SPECIAL = true
   965 				AddCaption(loc("NORMAL"))
  1067 					AddCaption(GLOBAL_CHEESE_SPECIAL_INFO)
   966 			end
  1068 				else
   967 
  1069 					GLOBAL_SOUTH_AMERICAN_SPECIAL = false
   968 		--africa
  1070 					AddCaption(loc("DEFAULT"))
   969 		elseif(GetCurAmmoType() == amSMine)
  1071 				end
   970 		then
  1072 
   971 			if(GLOBAL_AFRICAN_SPECIAL_STICKY==0)
  1073 			--africa
   972 			then
  1074 			elseif(GetCurAmmoType() == amSMine)
   973 				GLOBAL_AFRICAN_SPECIAL_STICKY = 1
  1075 			then
   974 				AddCaption(GLOBAL_WEAPON_TEXTS[11])
  1076 				if(GLOBAL_AFRICAN_SPECIAL_STICKY==0)
   975 			elseif(GLOBAL_AFRICAN_SPECIAL_STICKY == 1)
  1077 				then
   976 			then
  1078 					GLOBAL_AFRICAN_SPECIAL_STICKY = 1
   977 				GLOBAL_AFRICAN_SPECIAL_STICKY = 2
  1079 					AddCaption(GLOBAL_STICKY_PROJECTILE_INFO)
   978 				AddCaption(GLOBAL_WEAPON_TEXTS[12])
  1080 				elseif(GLOBAL_AFRICAN_SPECIAL_STICKY == 1)
   979 			elseif(GLOBAL_AFRICAN_SPECIAL_STICKY == 2)
  1081 				then
   980 			then
  1082 					GLOBAL_AFRICAN_SPECIAL_STICKY = 2
   981 				GLOBAL_AFRICAN_SPECIAL_STICKY = 0
  1083 					AddCaption(GLOBAL_STICKY_NAPALM_INFO)
   982 				AddCaption(loc("NORMAL"))
  1084 				elseif(GLOBAL_AFRICAN_SPECIAL_STICKY == 2)
   983 			end
  1085 				then
   984 
  1086 					GLOBAL_AFRICAN_SPECIAL_STICKY = 0
   985 		--north america (sniper)
  1087 					AddCaption(loc("DEFAULT"))
   986 		elseif(GetCurAmmoType() == amSniperRifle and GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON==false)
  1088 				end
   987 		then
  1089 
   988 			if(GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER==2)
  1090 			--north america (sniper)
   989 			then
  1091 			elseif(GetCurAmmoType() == amSniperRifle and GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON==false)
   990 				GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER = 1
  1092 			then
   991 				AddCaption(loc("NORMAL"))
  1093 				if(GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER==2)
   992 			elseif(GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER==1)
  1094 				then
   993 			then
  1095 					GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER = 1
   994 				GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER = 2
  1096 					AddCaption(loc("DEFAULT"))
   995 				AddCaption(GLOBAL_WEAPON_TEXTS[1])
  1097 				elseif(GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER==1)
   996 			end
  1098 				then
   997 
  1099 					GLOBAL_NORTH_AMERICAN_SPECIAL_SNIPER = 2
   998 		--north america (shotgun)
  1100 					AddCaption(GLOBAL_SNIPER_SPECIAL_INFO)
   999 		elseif(GetCurAmmoType() == amShotgun and GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN~=nil)
  1101 				end
  1000 		then
  1102 
  1001 			if(GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN==false)
  1103 			--north america (shotgun)
  1002 			then
  1104 			elseif(GetCurAmmoType() == amShotgun)
  1003 				GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN = true
  1105 			then
  1004 				AddCaption(GLOBAL_WEAPON_TEXTS[13])
  1106 				if(GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN==false)
  1005 			else
  1107 				then
  1006 				GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN = false
  1108 					GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN = true
  1007 				AddCaption(loc("NORMAL"))
  1109 					AddCaption(GLOBAL_SHOTGUN_SPECIAL_INFO)
  1008 			end
  1110 				else
  1009 
  1111 					GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN = false
  1010 		--europe
  1112 					AddCaption(loc("DEFAULT"))
  1011 		elseif(GetCurAmmoType() == amMolotov)
  1113 				end
  1012 		then
  1114 
  1013 			if(GLOBAL_EUROPE_SPECIAL==0)
  1115 			--europe
  1014 			then
  1116 			elseif(GetCurAmmoType() == amMolotov)
  1015 				GLOBAL_EUROPE_SPECIAL = 1
  1117 			then
  1016 				AddCaption(GLOBAL_WEAPON_TEXTS[14])
  1118 				if(GLOBAL_EUROPE_SPECIAL==0)
  1017 			else
  1119 				then
  1018 				GLOBAL_EUROPE_SPECIAL = 0
  1120 					GLOBAL_EUROPE_SPECIAL = 1
  1019 				AddCaption(loc("NORMAL"))
  1121 					AddCaption(GLOBAL_MOLOTOV_SPECIAL_INFO)
  1020 			end
  1122 				else
  1021 
  1123 					GLOBAL_EUROPE_SPECIAL = 0
  1022 		--kerguelen
  1124 					AddCaption(loc("DEFAULT"))
  1023 		elseif(GetCurAmmoType() == amHammer)
  1125 				end
  1024 		then
  1126 
  1025 			if(GLOBAL_KERGUELEN_SPECIAL==6)
  1127 			--antarctica
  1026 			then
  1128 			elseif(GetCurAmmoType() == amPickHammer)
  1027 				GLOBAL_KERGUELEN_SPECIAL = 1
  1129 			then
  1028 				AddCaption("Normal")
  1130 				if(GLOBAL_ANTARCTICA_SPECIAL==0)
  1029 			elseif(GLOBAL_KERGUELEN_SPECIAL==1)
  1131 				then
  1030 			then
  1132 					GLOBAL_ANTARCTICA_SPECIAL = 1
  1031 				GLOBAL_KERGUELEN_SPECIAL = 2
  1133 					AddCaption(GLOBAL_PICKHAMMER_SPECIAL_INFO)
  1032 				AddCaption("#"..GLOBAL_WEAPON_TEXTS[7])
  1134 				else
  1033 			elseif(GLOBAL_KERGUELEN_SPECIAL==2 and TotalRounds>=1)
  1135 					GLOBAL_ANTARCTICA_SPECIAL = 0
  1034 			then
  1136 					AddCaption(loc("DEFAULT"))
  1035 				GLOBAL_KERGUELEN_SPECIAL = 3
  1137 				end
  1036 				AddCaption("##"..GLOBAL_WEAPON_TEXTS[8])
  1138 
  1037 			elseif(GLOBAL_KERGUELEN_SPECIAL==3 or (GLOBAL_KERGUELEN_SPECIAL==2 and TotalRounds<1))
  1139 			--kerguelen
  1038 			then
  1140 			elseif(GetCurAmmoType() == amHammer)
  1039 				GLOBAL_KERGUELEN_SPECIAL = 5
  1141 			then
  1040 				AddCaption("###"..GLOBAL_WEAPON_TEXTS[10])
  1142 				if(GLOBAL_KERGUELEN_SPECIAL==6)
  1041 			elseif(GLOBAL_KERGUELEN_SPECIAL==5)
  1143 				then
  1042 			then
  1144 					GLOBAL_KERGUELEN_SPECIAL = 1
  1043 				GLOBAL_KERGUELEN_SPECIAL = 6
  1145 					AddCaption("DEFAULT")
  1044 				AddCaption("####"..GLOBAL_WEAPON_TEXTS[15])
  1146 				elseif(GLOBAL_KERGUELEN_SPECIAL==1)
  1045 			end
  1147 				then
       
  1148 					GLOBAL_KERGUELEN_SPECIAL = 2
       
  1149 					AddCaption("#"..GLOBAL_HAMMER_ROAR_INFO)
       
  1150 				elseif(GLOBAL_KERGUELEN_SPECIAL==2)
       
  1151 				then
       
  1152 					GLOBAL_KERGUELEN_SPECIAL = 3
       
  1153 					AddCaption("##"..GLOBAL_HAMMER_SWAP_INFO)
       
  1154 				elseif(GLOBAL_KERGUELEN_SPECIAL==3)
       
  1155 				then
       
  1156 					GLOBAL_KERGUELEN_SPECIAL = 5
       
  1157 					AddCaption("###"..GLOBAL_HAMMER_LONELY_INFO)
       
  1158 				elseif(GLOBAL_KERGUELEN_SPECIAL==5)
       
  1159 				then
       
  1160 					GLOBAL_KERGUELEN_SPECIAL = 6
       
  1161 					AddCaption("####"..GLOBAL_HAMMER_SABOTAGE_INFO)
       
  1162 				end
       
  1163 			end
       
  1164 		end
  1046 		--for selecting weaponset, this is mostly for old players.
  1165 		--for selecting weaponset, this is mostly for old players.
  1047 		elseif(GetHogLevel(CurrentHedgehog)==0 and GLOBAL_SELECT_CONTINENT_CHECK==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing))
  1166 		if(GetHogLevel(CurrentHedgehog)==0 and GLOBAL_SELECT_CONTINENT_CHECK==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing))
  1048 		then
  1167 		then
  1049 			GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]+1
  1168 			GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]+1
  1050 
  1169 
  1051 			if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]> table.maxn(GLOBAL_CONTINENT_INFORMATION))
  1170 			if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]> table.maxn(GLOBAL_CONTINENT_INFORMATION))
  1052 			then
  1171 			then
  1071 		then
  1190 		then
  1072 			GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=1
  1191 			GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=1
  1073 		end
  1192 		end
  1074 		SetContinentWeapons()
  1193 		SetContinentWeapons()
  1075 	end
  1194 	end
       
  1195 
       
  1196 	if(GetCurAmmoType() == amSeduction and GLOBAL_AFRICAN_SPECIAL_SEDUCTION == 1 and GetAmmoCount(CurrentHedgehog,amInvulnerable)>0)
       
  1197 	then
       
  1198 		GLOBAL_SEDUCTION_INCREASER=GLOBAL_SEDUCTION_INCREASER+7
       
  1199 
       
  1200 		RemoveWeapon(CurrentHedgehog,amInvulnerable)
       
  1201 
       
  1202 		AddCaption(string.format(GLOBAL_INVULNERABLE_SPECIAL_INFO," ("..(GLOBAL_SEDUCTION_INCREASER+15)..")"," ("..GetAmmoCount(CurrentHedgehog,amInvulnerable)..")"))
       
  1203 	end
  1076 end
  1204 end
  1077 
  1205 
  1078 function onDown()
  1206 function onDown()
  1079 	--swap backwards in the weaponmenu (1.0 style)
  1207 	--swap backwards in the weaponmenu (1.0 style)
  1080 	if(GetHogLevel(CurrentHedgehog)==0 and GLOBAL_SELECT_CONTINENT_CHECK==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing))
  1208 	if(GetHogLevel(CurrentHedgehog)==0 and GLOBAL_SELECT_CONTINENT_CHECK==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing))
  1084 		if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]<=0)
  1212 		if(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]<=0)
  1085 		then
  1213 		then
  1086 			GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=table.maxn(GLOBAL_CONTINENT_INFORMATION)
  1214 			GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=table.maxn(GLOBAL_CONTINENT_INFORMATION)
  1087 		end
  1215 		end
  1088 		SetContinentWeapons()
  1216 		SetContinentWeapons()
       
  1217 	end
       
  1218 
       
  1219 	if(GetCurAmmoType() == amSeduction and GLOBAL_AFRICAN_SPECIAL_SEDUCTION == 1 and GLOBAL_SEDUCTION_INCREASER>0)
       
  1220 	then
       
  1221 		GLOBAL_SEDUCTION_INCREASER=GLOBAL_SEDUCTION_INCREASER-7
       
  1222 
       
  1223 		AddAmmo(CurrentHedgehog,amInvulnerable,GetAmmoCount(CurrentHedgehog, amInvulnerable)+1)
       
  1224 
       
  1225 		AddCaption(string.format(GLOBAL_INVULNERABLE_SPECIAL_INFO," ("..(GLOBAL_SEDUCTION_INCREASER+15)..")"," ("..GetAmmoCount(CurrentHedgehog,amInvulnerable)..")"))
  1089 	end
  1226 	end
  1090 end
  1227 end
  1091 
  1228 
  1092 function onGameTick20()
  1229 function onGameTick20()
  1093 	--if you picked a weaponset from the weaponmenu (icon)
  1230 	--if you picked a weaponset from the weaponmenu (icon)
  1099 			SetContinentWeapons()
  1236 			SetContinentWeapons()
  1100 			PlaySound(sndMineTick)
  1237 			PlaySound(sndMineTick)
  1101 		else
  1238 		else
  1102 			for v,w in pairs(GLOBAL_CONTINENT_INFORMATION)
  1239 			for v,w in pairs(GLOBAL_CONTINENT_INFORMATION)
  1103 			do
  1240 			do
  1104 				if(GetCurAmmoType()==GLOBAL_CONTINENT_INFORMATION[v][4])
  1241 				if(GetCurAmmoType()==GLOBAL_CONTINENT_INFORMATION[v][4][1])
  1105 				then
  1242 				then
  1106 					GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=v
  1243 					GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=v
  1107 					SetContinentWeapons()
  1244 					SetContinentWeapons()
  1108 					PlaySound(GLOBAL_CONTINENT_SOUNDS[v][1])
  1245 					PlaySound(GLOBAL_CONTINENT_INFORMATION[v][6][1])
  1109 					PlaySound(GLOBAL_CONTINENT_SOUNDS[v][2],CurrentHedgehog)
  1246 					PlaySound(GLOBAL_CONTINENT_INFORMATION[v][6][2],CurrentHedgehog)
  1110 				end
  1247 				end
  1111 			end
  1248 			end
  1112 		end
  1249 		end
  1113 	end
  1250 	end
  1114 
  1251 
  1123 		if(GLOBAL_KERGUELEN_SPECIAL == 2) --walrus scream
  1260 		if(GLOBAL_KERGUELEN_SPECIAL == 2) --walrus scream
  1124 		then
  1261 		then
  1125 			SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 120, 4, 0xff0000ee)
  1262 			SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 120, 4, 0xff0000ee)
  1126 		elseif(GLOBAL_KERGUELEN_SPECIAL == 3) --swap hog
  1263 		elseif(GLOBAL_KERGUELEN_SPECIAL == 3) --swap hog
  1127 		then
  1264 		then
  1128 			SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 420, 3, 0xffff00ee)
  1265 			SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 390, 3, 0xffff00ee)
  1129 		elseif(GLOBAL_KERGUELEN_SPECIAL == 5) --cries
  1266 		elseif(GLOBAL_KERGUELEN_SPECIAL == 5) --cries
  1130 		then
  1267 		then
  1131 			SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 550, 1, 0x0000ffee)
  1268 
       
  1269 			GLOBAL_TEMP_VALUE=0
       
  1270 			runOnGears(KerguelenSpecialBlueCheck)
       
  1271 			if(GLOBAL_TEMP_VALUE==0)
       
  1272 			then
       
  1273 				SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 1, 0x0000ffee)
       
  1274 			else
       
  1275 				SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 10, 0x0000ffee)
       
  1276 			end
       
  1277 
  1132 		elseif(GLOBAL_KERGUELEN_SPECIAL == 6) --sabotage
  1278 		elseif(GLOBAL_KERGUELEN_SPECIAL == 6) --sabotage
  1133 		then
  1279 		then
  1134 			SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 80, 10, 0x00ff00ee)
  1280 			SetVisualGearValues(GLOBAL_VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 80, 10, 0x00ff00ee)
  1135 		end
  1281 		end
  1136 
  1282 
  1144 	if(GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]~=nil and GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]>=1)
  1290 	if(GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]~=nil and GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]>=1)
  1145 	then
  1291 	then
  1146 		--for sabotage
  1292 		--for sabotage
  1147 		if(GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==1)
  1293 		if(GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==1)
  1148 		then
  1294 		then
  1149 			local RND=GetRandom(2)
  1295 			AddCaption(loc("You are sabotaged, RUN!"))
  1150 			if(RND==0)
  1296 
  1151 			then
       
  1152 				AddCaption(loc("You are sabotaged, RUN!"))
       
  1153 			else
       
  1154 				AddCaption(loc("WARNING: Sabotage detected!"))
       
  1155 			end
       
  1156 			PlaySound(sndHellish)
  1297 			PlaySound(sndHellish)
  1157 			GLOBAL_SABOTAGE_COUNTER=-50
       
  1158 			--update the constant at the top also to something in between
  1298 			--update the constant at the top also to something in between
  1159 			GLOBAL_SABOTAGE_FREQUENCY=(25*(RND))+70
  1299 			GLOBAL_SABOTAGE_FREQUENCY=100
  1160 			GLOBAL_SABOTAGE_GRAVITY_SWITCH=true
  1300 			SetGravity(350)
  1161 
  1301 
  1162 			GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=2
  1302 			GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=2
  1163 		end
  1303 		end
  1164 
  1304 
  1165 		if(GLOBAL_SABOTAGE_COUNTER >0)
  1305 		if(GLOBAL_SABOTAGE_COUNTER % 20 == 0)
  1166 		then
  1306 		then
  1167 			if(GLOBAL_SABOTAGE_GRAVITY_SWITCH)
  1307 			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
  1168 			then
       
  1169 				SetGravityFromScale(div(100*GLOBAL_SABOTAGE_COUNTER,GLOBAL_SABOTAGE_FREQUENCY))
       
  1170 			else
       
  1171 				SetGravityFromScale(100-div(100*GLOBAL_SABOTAGE_COUNTER,GLOBAL_SABOTAGE_FREQUENCY))
       
  1172 			end
       
  1173 
       
  1174 			if(GLOBAL_SABOTAGE_COUNTER % 20 == 0)
       
  1175 			then
       
  1176 				AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
       
  1177 			end
       
  1178 		end
  1308 		end
  1179 
  1309 
  1180 		if(TurnTimeLeft<(GetAwayTime*10) or band(GetState(CurrentHedgehog),gstAttacked)==1)
  1310 		if(TurnTimeLeft<(GetAwayTime*10) or band(GetState(CurrentHedgehog),gstAttacked)==1)
  1181 		then
  1311 		then
  1182 			GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=0
  1312 			GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=0
  1183 			SetGravity(100)
       
  1184 		elseif(GLOBAL_SABOTAGE_COUNTER >= GLOBAL_SABOTAGE_FREQUENCY)
  1313 		elseif(GLOBAL_SABOTAGE_COUNTER >= GLOBAL_SABOTAGE_FREQUENCY)
  1185 		then
  1314 		then
  1186 			if(GLOBAL_SABOTAGE_GRAVITY_SWITCH==true)
       
  1187 			then
       
  1188 				GLOBAL_SABOTAGE_GRAVITY_SWITCH=false
       
  1189 			else
       
  1190 				--AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-10, gtCluster, 0, 0, -160000, 30)
       
  1191 				GLOBAL_SABOTAGE_GRAVITY_SWITCH=true
       
  1192 			end
       
  1193 
  1315 
  1194 			if(GetHealth(CurrentHedgehog)<=2)
  1316 			if(GetHealth(CurrentHedgehog)<=2)
  1195 			then
  1317 			then
  1196 				SetHealth(CurrentHedgehog, 0)
  1318 				SetHealth(CurrentHedgehog, 0)
  1197 				GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=0
  1319 				GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=0
  1198 				SetGravity(100)
       
  1199 			else
  1320 			else
  1200 				SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)-2)
  1321 				SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)-2)
  1201 			end
  1322 			end
  1202 			ShowDamageTag(CurrentHedgehog,2)
  1323 			ShowDamageTag(CurrentHedgehog,2)
  1203 
  1324 
  1204 			GLOBAL_SABOTAGE_COUNTER=0
  1325 			GLOBAL_SABOTAGE_COUNTER=0
  1205 		else
  1326 		else
  1206 			GLOBAL_SABOTAGE_COUNTER=GLOBAL_SABOTAGE_COUNTER+1
  1327 			GLOBAL_SABOTAGE_COUNTER=GLOBAL_SABOTAGE_COUNTER+1
  1207 		end
  1328 		end
  1208 	end
  1329 	elseif(GetGravity()==350 and (GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==0 or GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==nil))
  1209 
  1330 	then
       
  1331 		SetGravity(100)
       
  1332 	end
       
  1333 
       
  1334 	--enable switch (north america)
  1210 	if(GetCurAmmoType() == amSwitch and GLOBAL_TEMP_VALUE==87)
  1335 	if(GetCurAmmoType() == amSwitch and GLOBAL_TEMP_VALUE==87)
  1211 	then
  1336 	then
  1212 		SetGearMessage(CurrentHedgehog,gmAttack)
  1337 		SetGearMessage(CurrentHedgehog,gmAttack)
  1213 		GLOBAL_TEMP_VALUE=0
  1338 		GLOBAL_TEMP_VALUE=0
  1214 	end
       
  1215 
       
  1216 	if(GLOBAL_SHOW_SMALL_INFO>0)
       
  1217 	then
       
  1218 		if(GLOBAL_SHOW_SMALL_INFO==1)
       
  1219 		then
       
  1220 			ShowContinentInfo(GLOBAL_TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)],-1,true)
       
  1221 		end
       
  1222 
       
  1223 		GLOBAL_SHOW_SMALL_INFO=GLOBAL_SHOW_SMALL_INFO-1
       
  1224 	end
  1339 	end
  1225 end
  1340 end
  1226 
  1341 
  1227 --some ppl complained :P
  1342 --some ppl complained :P
  1228 function onSlot(slot)
  1343 function onSlot(slot)
  1232 	end
  1347 	end
  1233 end
  1348 end
  1234 
  1349 
  1235 --if you used hogswitch or any similar weapon, dont enable any weaponchange
  1350 --if you used hogswitch or any similar weapon, dont enable any weaponchange
  1236 function onAttack()
  1351 function onAttack()
  1237 	GLOBAL_SELECT_CONTINENT_CHECK=false
  1352 	if(GLOBAL_SELECT_CONTINENT_CHECK==true)
       
  1353 	then
       
  1354 		if(GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing)
       
  1355 		then
       
  1356 			GLOBAL_SELECT_CONTINENT_CHECK=false
       
  1357 			EndTurn(0)
       
  1358 		else
       
  1359 			SetWeapon(amSkip)
       
  1360 		end
       
  1361 	end
  1238 
  1362 
  1239 	--african special
  1363 	--african special
  1240 	if(GLOBAL_AFRICAN_SPECIAL_SEDUCTION == 1 and GetCurAmmoType() == amSeduction and band(GetState(CurrentHedgehog),gstAttacked)==0)
  1364 	if(GLOBAL_AFRICAN_SPECIAL_SEDUCTION == 1 and GetCurAmmoType() == amSeduction and band(GetState(CurrentHedgehog),gstAttacked)==0)
  1241 	then
  1365 	then
  1242 		EndTurn()
  1366 		EndTurn(3)
  1243 
  1367 
  1244 		GLOBAL_TEMP_VALUE=0
  1368 		GLOBAL_TEMP_VALUE=0
  1245 		runOnGears(AfricaSpecialSeduction)
  1369 		runOnGears(AfricaSpecialSeduction)
  1246 		SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+GLOBAL_TEMP_VALUE)
  1370 		SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+GLOBAL_TEMP_VALUE)
  1247 
  1371 
  1249 		VisualExplosion(250,GetX(CurrentHedgehog), GetY(CurrentHedgehog),vgtSmoke,vgtSmokeWhite)
  1373 		VisualExplosion(250,GetX(CurrentHedgehog), GetY(CurrentHedgehog),vgtSmoke,vgtSmokeWhite)
  1250 		PlaySound(sndParachute)
  1374 		PlaySound(sndParachute)
  1251 
  1375 
  1252 		RemoveWeapon(CurrentHedgehog,amSeduction)
  1376 		RemoveWeapon(CurrentHedgehog,amSeduction)
  1253 
  1377 
       
  1378 	elseif(GLOBAL_ANTARCTICA_SPECIAL == 1 and GetCurAmmoType() == amPickHammer and band(GetState(CurrentHedgehog),gstAttacked)==0)
       
  1379 	then
       
  1380 		EndTurn(10)
       
  1381 		SetGearPosition(CurrentHedgehog,GetX(CurrentHedgehog),0)
       
  1382 		ParseCommand("hjump")
       
  1383 		SetGearVelocity(CurrentHedgehog, 0, 100000000)
       
  1384 
       
  1385 		PlaySound(sndPiano8)
       
  1386 
       
  1387 		RemoveWeapon(CurrentHedgehog,amPickHammer)
       
  1388 
  1254 	--Kerguelen specials
  1389 	--Kerguelen specials
  1255 	elseif(GetCurAmmoType() == amHammer and GLOBAL_KERGUELEN_SPECIAL > 1 and band(GetState(CurrentHedgehog),gstAttacked)==0)
  1390 	elseif(GetCurAmmoType() == amHammer and GLOBAL_KERGUELEN_SPECIAL > 1 and band(GetState(CurrentHedgehog),gstAttacked)==0)
  1256 	then
  1391 	then
       
  1392 		local escapetime=3
       
  1393 
  1257 		--scream
  1394 		--scream
  1258 		if(GLOBAL_KERGUELEN_SPECIAL == 2)
  1395 		if(GLOBAL_KERGUELEN_SPECIAL == 2)
  1259 		then
  1396 		then
  1260 			GLOBAL_TEMP_VALUE=0
  1397 			GLOBAL_TEMP_VALUE=0
  1261 			runOnGears(KerguelenSpecialRed)
  1398 			runOnGears(KerguelenSpecialRed)
  1262 			HealHog(CurrentHedgehog, GLOBAL_TEMP_VALUE)
  1399 			HealHog(CurrentHedgehog, GLOBAL_TEMP_VALUE)
  1263 			PlaySound(sndHellish)
  1400 			PlaySound(sndHellish)
  1264 
  1401 
  1265 		--swap
  1402 		--swap
  1266 		elseif(GLOBAL_KERGUELEN_SPECIAL == 3 and TotalRounds>=1)
  1403 		elseif(GLOBAL_KERGUELEN_SPECIAL == 3)
  1267 		then
  1404 		then
  1268 			GLOBAL_TEMP_VALUE=0
  1405 			GLOBAL_TEMP_VALUE=0
  1269 			runOnGears(KerguelenSpecialYellowCountHogs)
  1406 			runOnGears(KerguelenSpecialYellowCountHogs)
  1270 			if(GLOBAL_TEMP_VALUE>0)
  1407 			if(GLOBAL_TEMP_VALUE>0)
  1271 			then
  1408 			then
  1277 			end
  1414 			end
  1278 
  1415 
  1279 		--cries
  1416 		--cries
  1280 		elseif(GLOBAL_KERGUELEN_SPECIAL == 5)
  1417 		elseif(GLOBAL_KERGUELEN_SPECIAL == 5)
  1281 		then
  1418 		then
       
  1419 			GLOBAL_TEMP_VALUE=0
  1282 			runOnGears(KerguelenSpecialBlueCheck)
  1420 			runOnGears(KerguelenSpecialBlueCheck)
  1283 			if(GLOBAL_KERGUELEN_SPECIAL~=-1)
  1421 			if(GLOBAL_TEMP_VALUE==0)
  1284 			then
  1422 			then
  1285 				AddGear(0, 0, gtWaterUp, 0, 0,0,0)
  1423 				AddGear(0, 0, gtWaterUp, 0, 0,0,0)
  1286 				PlaySound(sndWarp)
  1424 				PlaySound(sndWarp)
  1287 				PlaySound(sndMolotov)
  1425 				PlaySound(sndMolotov)
  1288 
  1426 
  1289 				GLOBAL_TEMP_VALUE=0
       
  1290 				runOnGears(KerguelenSpecialBlueActivate)
  1427 				runOnGears(KerguelenSpecialBlueActivate)
  1291 				SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+GLOBAL_TEMP_VALUE)
  1428 				SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+GLOBAL_TEMP_VALUE)
  1292 			else
  1429 			else
  1293 				HogSay(CurrentHedgehog, loc("Hogs in sight!"), SAY_SAY)
  1430 				HogSay(CurrentHedgehog, loc("Hogs in sight!"), SAY_SAY)
  1294 			end
  1431 			end
  1296 		--sabotage
  1433 		--sabotage
  1297 		elseif(GLOBAL_KERGUELEN_SPECIAL == 6)
  1434 		elseif(GLOBAL_KERGUELEN_SPECIAL == 6)
  1298 		then
  1435 		then
  1299 			GLOBAL_TEMP_VALUE=0
  1436 			GLOBAL_TEMP_VALUE=0
  1300 			runOnGears(KerguelenSpecialGreen)
  1437 			runOnGears(KerguelenSpecialGreen)
  1301 			if(GLOBAL_TEMP_VALUE==0)
  1438 
  1302 			then
  1439 			PlaySound(sndThrowRelease)
  1303 				PlaySound(sndThrowRelease)
  1440 			AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, 0, -1000000, 32)
  1304 				AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, 0, -1000000, 32)
  1441 
  1305 			end
  1442 			if(GLOBAL_TEMP_VALUE==1)
  1306 		end
  1443 			then
  1307 
  1444 				escapetime=10
  1308 		EndTurn()
  1445 			end
       
  1446 		end
       
  1447 
       
  1448 		EndTurn(escapetime)
  1309 
  1449 
  1310 		DeleteVisualGear(GLOBAL_VISUAL_CIRCLE)
  1450 		DeleteVisualGear(GLOBAL_VISUAL_CIRCLE)
  1311 		GLOBAL_VISUAL_CIRCLE=nil
  1451 		GLOBAL_VISUAL_CIRCLE=nil
  1312 		GLOBAL_KERGUELEN_SPECIAL=0
  1452 		GLOBAL_KERGUELEN_SPECIAL=0
  1313 
  1453 
  1366 		then
  1506 		then
  1367 			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
  1507 			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
  1368 			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
  1508 			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
  1369 			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
  1509 			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
  1370 			PlaySound(sndBirdyLay)
  1510 			PlaySound(sndBirdyLay)
  1371 		else
       
  1372 			GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN=nil
       
  1373 		end
  1511 		end
  1374 	--european special
  1512 	--european special
  1375 	elseif(GetGearType(gearUid)==gtMolotov and GLOBAL_EUROPE_SPECIAL==1)
  1513 	elseif(GetGearType(gearUid)==gtMolotov and GLOBAL_EUROPE_SPECIAL==1)
  1376 	then
  1514 	then
  1377 		vx,vy=GetGearVelocity(gearUid)
  1515 		vx,vy=GetGearVelocity(gearUid)
  1392 			then
  1530 			then
  1393 				local austmine=FireGear(CurrentHedgehog,gtMine, vx, vy, 0)
  1531 				local austmine=FireGear(CurrentHedgehog,gtMine, vx, vy, 0)
  1394 				SetHealth(austmine, 100)
  1532 				SetHealth(austmine, 100)
  1395 				SetTimer(austmine, 1000)
  1533 				SetTimer(austmine, 1000)
  1396 			else
  1534 			else
  1397 				local austmine=FireGear(CurrentHedgehog,gtEgg, vx, vy, 10)
  1535 				local austmine=FireGear(CurrentHedgehog,gtBall, vx, vy, 1)
  1398 				--SetHealth(austmine, 2000)
  1536 				--SetHealth(austmine, 1)
  1399 				SetTimer(austmine, 6000)
  1537 				SetTimer(austmine, 1000)
  1400 				SetGearMessage(austmine, 3)
  1538 				SetGearMessage(austmine, 3)
  1401 			end
  1539 			end
  1402 		else
  1540 		else
  1403 			PlaySound(sndDenied)
  1541 			PlaySound(sndDenied)
  1404 		end
  1542 		end
  1409 	then
  1547 	then
  1410 		GLOBAL_SWITCH_HOG_IS_ON=true
  1548 		GLOBAL_SWITCH_HOG_IS_ON=true
  1411 	end
  1549 	end
  1412 end
  1550 end
  1413 
  1551 
       
  1552 function onGearDamage(gearUid, damage)
       
  1553 	if (GetGearType(gearUid) == gtCase)
       
  1554 	then
       
  1555 		GLOBAL_CRATE_TEST=gearUid
       
  1556 	end
       
  1557 
       
  1558 	if(gearUid==CurrentHedgehog and GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]==1)
       
  1559 	then
       
  1560 		GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=0
       
  1561 	end
       
  1562 end
       
  1563 
  1414 function onGearDelete(gearUid)
  1564 function onGearDelete(gearUid)
  1415 
  1565 
  1416 	if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives)
  1566 	if(GetGearType(gearUid) == gtHedgehog or GetGearType(gearUid) == gtMine or GetGearType(gearUid) == gtExplosives)
  1417 	then
  1567 	then
       
  1568 		--sundaland special
       
  1569 		if(GetGearType(gearUid) == gtHedgehog and GLOBAL_TEAM_CONTINENT[GLOBAL_SUNDALAND_END_HOG_CONTINENT_NAME]==10)
       
  1570 		then
       
  1571 			local currvalue=getTeamValue(GLOBAL_SUNDALAND_END_HOG_CONTINENT_NAME, "sundaland-count")
       
  1572 
       
  1573 			if(currvalue==nil)
       
  1574 			then
       
  1575 				currvalue=0
       
  1576 			end
       
  1577 
       
  1578 			setTeamValue(GLOBAL_SUNDALAND_END_HOG_CONTINENT_NAME, "sundaland-count", currvalue+1)
       
  1579 			PlaySound(sndReinforce,CurrentHedgehog)
       
  1580 		end
       
  1581 
  1418 		trackDeletion(gearUid)
  1582 		trackDeletion(gearUid)
  1419 
  1583 	end
  1420 		--sundaland special
  1584 
  1421 		if(GetGearType(gearUid) == gtHedgehog and GLOBAL_TEAM_CONTINENT[GetHogTeamName(GLOBAL_SUNDALAND_END_HOG)]==10)
  1585 	--if picking up a health crate
  1422 		then
  1586 	if(GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]~=0 and GetGearType(gearUid) == gtCase and GetHealth(gearUid)~=0 and gearUid~=GLOBAL_CRATE_TEST and gearIsInCircle(CurrentHedgehog,GetX(gearUid), GetY(gearUid), 50, false)==true)
  1423 			if(GLOBAL_SUNDALAND_END_HOG==CurrentHedgehog)
  1587 	then
  1424 			then
  1588 		GLOBAL_SABOTAGE_HOGS[CurrentHedgehog]=0
  1425 				runOnGears(SundalandFindOtherHogInTeam)
       
  1426 			end
       
  1427 
       
  1428 			SundalandGetWeapons(GLOBAL_SUNDALAND_END_HOG)
       
  1429 		end
       
  1430 	end
  1589 	end
  1431 
  1590 
  1432 	--north american lipstick
  1591 	--north american lipstick
  1433 	if(GetGearType(gearUid)==gtSniperRifleShot )
  1592 	if(GetGearType(gearUid)==gtSniperRifleShot )
  1434 	then
  1593 	then
  1439 			runOnGears(NorthAmericaSpecialSniper)
  1598 			runOnGears(NorthAmericaSpecialSniper)
  1440 		end
  1599 		end
  1441 	--north american eagle eye
  1600 	--north american eagle eye
  1442 	elseif(GetGearType(gearUid)==gtShotgunShot and GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN==true)
  1601 	elseif(GetGearType(gearUid)==gtShotgunShot and GLOBAL_NORTH_AMERICAN_SPECIAL_SHOTGUN==true)
  1443 	then
  1602 	then
  1444 		EndTurn()
       
  1445 		SetGearPosition(CurrentHedgehog, GetX(gearUid), GetY(gearUid)+7)
  1603 		SetGearPosition(CurrentHedgehog, GetX(gearUid), GetY(gearUid)+7)
  1446 		PlaySound(sndWarp)
  1604 		PlaySound(sndWarp)
  1447 	--south american special
  1605 	--south american special
  1448 	elseif(GetGearType(gearUid)==gtGasBomb and GLOBAL_SOUTH_AMERICAN_SPECIAL == true)
  1606 	elseif(GetGearType(gearUid)==gtGasBomb and GLOBAL_SOUTH_AMERICAN_SPECIAL == true)
  1449 	then
  1607 	then
  1463 		runOnGears(EuropeSpecialMolotovHit)
  1621 		runOnGears(EuropeSpecialMolotovHit)
  1464 		VisualExplosion(100,GetX(gearUid), GetY(gearUid),vgtSmokeWhite,vgtSmokeWhite)
  1622 		VisualExplosion(100,GetX(gearUid), GetY(gearUid),vgtSmokeWhite,vgtSmokeWhite)
  1465 		AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
  1623 		AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
  1466 		PlaySound(sndGraveImpact)
  1624 		PlaySound(sndGraveImpact)
  1467 	--australian special
  1625 	--australian special
  1468 	elseif(GetGearType(gearUid)==gtEgg and GetGearMessage(gearUid)==3)
  1626 	elseif(GetGearType(gearUid)==gtBall and GetGearMessage(gearUid)==3)
  1469 	then
  1627 	then
  1470 		GLOBAL_TEMP_VALUE=gearUid
  1628 		SpawnRandomCrate(GetX(gearUid), GetY(gearUid))
  1471 		runOnGears(AustraliaSpecialEggHit)
  1629 
  1472 		GLOBAL_TEMP_VALUE=0
       
  1473 	--asia (using para)
  1630 	--asia (using para)
  1474 	elseif(GetGearType(gearUid)==gtParachute)
  1631 	elseif(GetGearType(gearUid)==gtParachute)
  1475 	then
  1632 	then
  1476 		GLOBAL_PARACHUTE_IS_ON=false
  1633 		GLOBAL_PARACHUTE_IS_ON=false
  1477 	elseif(GetGearType(gearUid)==gtSwitcher)
  1634 	elseif(GetGearType(gearUid)==gtSwitcher)
  1483 --[[
  1640 --[[
  1484 	sources (populations & area):
  1641 	sources (populations & area):
  1485 	Own calculations from wikipedia.
  1642 	Own calculations from wikipedia.
  1486 	Some are approximations.
  1643 	Some are approximations.
  1487 ]]
  1644 ]]
       
  1645