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