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