share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua
author Periklis Ntanasis <pntanasis@gmail.com>
Sat, 10 Aug 2013 03:56:50 +0300
branchspacecampaign
changeset 9504 cdba61cfba93
parent 8618 7e71dba4e7f3
child 9805 1795c34ab8db
permissions -rw-r--r--
event for escape win
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
     1
--[[
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
     2
Version 1.1c
7895
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
8043
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7936
diff changeset
    13
HedgewarsScriptLoad("/Scripts/Locale.lua")
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7936
diff changeset
    14
HedgewarsScriptLoad("/Scripts/Utils.lua")
da083f8d95e6 We need custom script loading function in lua now
unc0rr
parents: 7936
diff changeset
    15
HedgewarsScriptLoad("/Scripts/Tracker.lua")
7893
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)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    18
	local temp=num
7893
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
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    23
	
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    24
	return math.abs(temp)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    25
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    26
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
    27
function norm(xx,yy)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    28
	--to fix overflows
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    29
	if(((math.abs(xx)^2)+(math.abs(yy)^2))>2^26)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    30
	then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    31
		local bitr=2^13
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    32
		return int_sqrt((div(math.abs(xx),bitr)^2)+(div(math.abs(yy),bitr)^2))*bitr
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    33
	else
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    34
		return int_sqrt((math.abs(xx)^2)+(math.abs(yy)^2))
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    35
	end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    36
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    37
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
    38
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
    39
	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
    40
	then
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
    41
		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
    42
	else
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
    43
		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
    44
	end
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
    45
end
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
    46
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    47
local teams_ok = {}
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    48
local wepcode_teams={}
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    49
local swapweps=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    50
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    51
--variables for seeing if you have swaped around on a weapon
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    52
local australianSpecial=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    53
local africanSpecial=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    54
local africaspecial2=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    55
local asianSpecial=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    56
local samericanSpecial=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    57
local namericanSpecial=1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    58
local sniper_s_in_use=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    59
local kergulenSpecial=1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    60
local shotgun_s=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    61
local europe_s=0
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    62
local VampOn=0
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    63
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    64
local austmine=nil
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    65
local inpara=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    66
local asianflame=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    67
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    68
local visualcircle=nil
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    69
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    70
local temp_val=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    71
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    72
--for sabotage
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    73
local disallowattack=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    74
local disable_moving={}
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    75
local disableoffsetai=0
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    76
local onsabotageai=false
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    77
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    78
local continent = {}
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    79
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    80
local generalinfo=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]")
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    81
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    82
local weapontexts = {
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    83
loc("Green lipstick bullet: [Is poisonous]"),
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    84
loc("Piñata bullet: [Contains some sweet candy!]"),
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    85
loc("Anno 1032: [The explosion will make a strong push ~ wide range, wont affect hogs close to the target]"),
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    86
loc("Dust storm: [Deals 15 damage to all enemies in the circle]"),
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    87
loc("Fire a mine: [Does what it says ~ Cant be dropped close to an enemy ~ 1 sec]"),
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    88
loc("Drop a bomb: [drop some heroic wind that will turn into a bomb on impact ~ once per turn]"),
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    89
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
    90
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
    91
loc("Flare: [fire up some bombs depending on hogs depending on hogs in the circle"),
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
    92
loc("Lonely Cries: [Rise the water if no hog is in the circle and deal 7 damage to all enemy hogs]"),
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    93
loc("Hedgehog projectile: [fire your hog like a Sticky Bomb]"),
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    94
loc("Napalm rocket: [Fire a bomb with napalm!]"),
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    95
loc("Eagle Eye: [Blink to the impact ~ one shot]"),
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    96
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
    97
loc("Sabotage: [Sabotage all hogs in the circle and deal ~10 dmg]")
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    98
}
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
    99
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   100
local weaponsets = 
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   101
{
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   102
{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
   103
{{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
   104
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   105
{loc("South America"),"Area: 17,840,000 km2, Population: 387,489,196 ",loc("Special Weapons:").."|"..loc("GasBomb")..": "..weapontexts[3],amGasBomb,
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   106
{{amBirdy,6},{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
   107
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   108
{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
   109
{{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
   110
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   111
{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,
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   112
{{amSMine,100},{amWatermelon,1},{amDrillStrike,1},{amExtraTime,2},{amDrill,100},{amLandGun,3},{amSeduction,100}}},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   113
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   114
{loc("Asia"),"Area: 44,579,000 km2, Population: 3,879,000,000",loc("- Will give you a parachute each turn.").."|"..loc("Special Weapons:").."|"..loc("Parachute")..": "..weapontexts[6],amRope,
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   115
{{amKamikaze,4},{amRope,100},{amFirePunch,100},{amParachute,1},{amKnife,2},{amDynamite,1}}},
7893
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
{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
   118
{{amBaseballBat,100},{amMine,100},{amLowGravity,6},{amBlowTorch,100},{amRCPlane,2},{amTardis,100}}},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   119
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   120
{loc("Antarctica"),"Area: 14,000,000 km2, Population: ~1,000",loc("- Will give you a portalgun every second turn."),amTeleport,
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   121
{{amSnowball,4},{amTeleport,2},{amInvulnerable,6},{amPickHammer,100},{amSineGun,100},{amGirder,3},{amPortalGun,2}}},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   122
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   123
{loc("Kerguelen"),"Area: 1,100,000 km2, Population: ~70",loc("Special Weapons:").."|"..loc("Hammer")..": "..weapontexts[7].."|"..loc("Hammer")..": "..weapontexts[8].." ("..loc("Duration")..": 2)|"..loc("Hammer")..": "..weapontexts[9].."|"..loc("Hammer")..": "..weapontexts[10].."|"..loc("Hammer")..": "..weapontexts[15],amHammer,
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   124
{{amHammer,100},{amMineStrike,2},{amBallgun,1},{amIceGun,2}}},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   125
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   126
{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
   127
{{amBazooka,1},{amBlowTorch,1},{amSwitch,1}}}
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   128
}
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   129
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   130
local weaponsetssounds=
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   131
{
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   132
{sndShotgunFire,sndCover},
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   133
{sndEggBreak,sndLaugh},
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   134
{sndExplosion,sndEnemyDown},
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   135
{sndMelonImpact,sndHello},
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   136
{sndRopeAttach,sndComeonthen},
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   137
{sndBaseballBat,sndNooo},
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   138
{sndSineGun,sndOops},
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   139
{sndPiano5,sndStupid},
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   140
{sndSplash,sndFirstBlood}
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   141
}
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   142
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   143
--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
   144
local weapons_dmg = {
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   145
	{amKamikaze, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   146
	{amSineGun, 0, 1, 0, 1, 1},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   147
	{amBazooka, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   148
	{amMineStrike, 0, 1, 5, 1, 2},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   149
	{amGrenade, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   150
	{amPiano, 0, 1, 5, 1, 1},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   151
	{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
   152
	{amBee, 0, 1, 0, 1, 0},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   153
	{amShotgun, 0, 0, 0, 1, 1},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   154
	{amMine, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   155
	{amSniperRifle, 0, 1, 0, 1, 1},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   156
	{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
   157
	{amDynamite, 0, 1, 5, 1, 1},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   158
	{amFirePunch, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   159
	{amHellishBomb, 0, 1, 5, 1, 2},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   160
	{amWhip, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   161
	{amNapalm, 0, 1, 5, 1, 2},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   162
	{amPickHammer, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   163
	{amBaseballBat, 0, 1, 0, 1, 1},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   164
	{amMortar, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   165
	{amCake, 0, 1, 4, 1, 2},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   166
	{amSeduction, 0, 0, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   167
	{amWatermelon, 0, 1, 5, 1, 2},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   168
	{amDrill, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   169
	{amBallgun, 0, 1, 5, 1, 2},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   170
	{amMolotov, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   171
	{amBirdy, 0, 1, 1, 1, 1},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   172
	{amBlowTorch, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   173
	{amRCPlane, 0, 1, 5, 1, 2},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   174
	{amGasBomb, 0, 0, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   175
	{amAirAttack, 0, 1, 4, 1, 1},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   176
	{amFlamethrower, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   177
	{amSMine, 0, 1, 0, 1, 1},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   178
	{amHammer, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   179
	{amDrillStrike, 0, 1, 4, 1, 2},
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   180
	{amSnowball, 0, 1, 0, 1, 0}
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   181
	--{amStructure, 0, 0, 0, 1, 1}
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   182
}
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   183
local weapons_supp = {
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   184
	{amParachute, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   185
	{amGirder, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   186
	{amSwitch, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   187
	{amLowGravity, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   188
	{amExtraDamage, 0, 1, 2, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   189
	{amRope, 0, 1, 0, 1, 1},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   190
	{amInvulnerable, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   191
	{amExtraTime, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   192
	{amLaserSight, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   193
	{amVampiric, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   194
	{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
   195
	{amPortalGun, 0, 1, 2, 1, 1},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   196
	{amResurrector, 0, 1, 3, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   197
	{amTeleport, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   198
	{amLandGun, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   199
	{amTardis, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   200
	{amIceGun, 0, 1, 0, 1, 0},
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   201
	{amKnife, 0, 1, 0, 1, 0}
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   202
}
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   203
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   204
--will check after borders and stuff
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   205
function validate_weapon(hog,weapon,amount)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   206
	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
   207
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   208
		AddAmmo(hog, weapon,amount)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   209
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   210
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   211
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   212
--reset all weapons for a team
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   213
function cleanweps(hog)
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
	local i=1
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   216
	--+1 for skip +1 for freezer
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   217
	while(i<=table.maxn(weapons_supp)+table.maxn(weapons_dmg)+2)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   218
	do
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   219
		AddAmmo(hog,i,0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   220
		i=i+1
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
	
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   223
	AddAmmo(hog,amSkip,100)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   224
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   225
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   226
--get the weapons from a weaponset
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   227
function load_weaponset(hog, num)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   228
	for v,w in pairs(weaponsets[num][5]) 
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   229
	do
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   230
		validate_weapon(hog, w[1],w[2])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   231
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   232
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   233
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   234
--list up all weapons from the icons for each continent
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   235
function load_continent_selection(hog)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   236
	for v,w in pairs(weaponsets) 
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   237
	do
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   238
		validate_weapon(hog, weaponsets[v][4],1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   239
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   240
	AddAmmo(hog,amSwitch) --random continent
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   241
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   242
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   243
--shows the continent info
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   244
function show_continent_info(continent,time,generalinf)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   245
	local geninftext=""
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   246
	local ns=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   247
	if(time==-1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   248
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   249
		time=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   250
		ns=true
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   251
	end
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   252
	if(generalinf)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   253
	then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   254
		geninftext="| |"..loc("General information")..": |"..generalinfo
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   255
	end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   256
	ShowMission(weaponsets[continent][1],weaponsets[continent][2],weaponsets[continent][3]..geninftext, -weaponsets[continent][4], time)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   257
	if(ns)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   258
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   259
		HideMission()
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   260
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   261
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   262
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   263
--will show a circle of gears (eye candy)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   264
function visual_gear_explosion(range,xpos,ypos,gear1,gear2)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   265
	local degr=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   266
	local lap=30
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   267
	while(lap<range)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   268
	do
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   269
		while(degr < 6.2831)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   270
		do
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   271
			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
   272
			if(gear2~=false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   273
			then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   274
				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
   275
			end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   276
			degr=degr+((3.1415*3)*0.125) --1/8 = 0.125
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   277
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   278
		lap=lap+30
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   279
		degr=degr-6.2831
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   280
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   281
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   282
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   283
--zealandia (generates weapons from the weaponinfo above
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   284
function get_random_weapon(hog)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   285
	if(GetGearType(hog) == gtHedgehog and continent[GetHogTeamName(hog)]==9 and getTeamValue(GetHogTeamName(hog), "rand-done-turn")==nil)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   286
	then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   287
		cleanweps(hog)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   288
	
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   289
		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
   290
		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
   291
		local rand_weaponset_power = 0
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   292
		
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   293
		local numberof_weapons_supp=table.maxn(weapons_supp)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   294
		local numberof_weapons_dmg=table.maxn(weapons_dmg)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   295
		
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   296
		local rand1=GetRandom(table.maxn(weapons_supp))+1
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   297
		local rand2=GetRandom(table.maxn(weapons_dmg))+1
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   298
		
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   299
		random_weapon = GetRandom(table.maxn(weapons_dmg))+1
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   300
		
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   301
		while(weapons_dmg[random_weapon][4]>TotalRounds)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   302
		do
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   303
			if(random_weapon>=numberof_weapons_dmg)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   304
			then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   305
				random_weapon=0
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   306
			end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   307
			random_weapon = random_weapon+1
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   308
		end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   309
		validate_weapon(hog, weapons_dmg[random_weapon][1],1)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   310
		rand_weaponset_power=weapons_dmg[random_weapon][6]
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   311
		old_rand_weap = random_weapon
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   312
		
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   313
		if(rand_weaponset_power <2)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   314
		then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   315
			random_weapon = rand1
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   316
			while(weapons_supp[random_weapon][4]>TotalRounds or rand_weaponset_power+weapons_supp[random_weapon][6]>2)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   317
			do
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   318
				if(random_weapon>=numberof_weapons_supp)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   319
				then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   320
					random_weapon=0
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   321
				end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   322
				random_weapon = random_weapon+1
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   323
			end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   324
			validate_weapon(hog, weapons_supp[random_weapon][1],1)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   325
			rand_weaponset_power=rand_weaponset_power+weapons_supp[random_weapon][6]
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   326
		end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   327
		--check again if  the power is enough
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   328
		if(rand_weaponset_power <1)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   329
		then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   330
			random_weapon = rand2
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   331
			while(weapons_dmg[random_weapon][4]>TotalRounds or old_rand_weap == random_weapon or weapons_dmg[random_weapon][6]>0)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   332
			do
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   333
				if(random_weapon>=numberof_weapons_dmg)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   334
				then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   335
					random_weapon=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   336
				end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   337
				random_weapon = random_weapon+1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   338
			end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   339
			validate_weapon(hog, weapons_dmg[random_weapon][1],1)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   340
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   341
			
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   342
		setTeamValue(GetHogTeamName(hog), "rand-done-turn", true)
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
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   346
--this will take that hogs settings for the weapons and add them
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   347
function setweapons()
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   348
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   349
	cleanweps(CurrentHedgehog)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   350
	load_weaponset(CurrentHedgehog,continent[GetHogTeamName(CurrentHedgehog)])
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   351
	
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   352
	visualstuff=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-5, vgtDust,0, false)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   353
	v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 = GetVisualGearValues(visualstuff)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   354
	SetVisualGearValues(visualstuff, v1, v2, v3, v4, v5, v6, v7, 2, v9, GetClanColor(GetHogClan(CurrentHedgehog)))
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   355
	
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   356
	show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],0,false)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   357
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   358
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   359
--show health tag (will mostly be used when a hog is damaged)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   360
function show_damage_tag(hog,damage)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   361
	healthtag=AddVisualGear(GetX(hog), GetY(hog), vgtHealthTag, damage, false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   362
	v1, v2, v3, v4, v5, v6, v7, v8, v9, v10 = GetVisualGearValues(healthtag)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   363
	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
   364
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   365
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   366
--will use int_sqrt
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   367
function fire_gear(hedgehog,geartype,vx,vy,timer)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   368
	local hypo=norm(vx,vy)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   369
	return AddGear(div((GetGearRadius(hedgehog)*2*vx),hypo)+GetX(hedgehog), div((GetGearRadius(hedgehog)*2*vy),hypo)+GetY(hedgehog), geartype, 0, vx, vy, timer)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   370
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   371
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   372
--==========================run throw all hog/gear weapons ==========================
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   373
--will check if the mine is nicely placed 
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   374
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
   375
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   376
	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
   377
		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
   378
		then
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   379
			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
   380
		end
7893
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
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   383
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   384
--african special on sedunction
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   385
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
   386
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   387
	then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   388
		local dmg=15
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   389
		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
   390
		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
   391
			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
   392
			then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   393
				temp_val=temp_val+div(dmg*VampOn,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
   394
				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
   395
			else
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   396
				temp_val=temp_val+div(GetHealth(hog)*VampOn,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
   397
				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
   398
			end
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   399
			show_damage_tag(hog,dmg)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   400
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   401
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   402
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   403
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   404
--kerguelen special on structure 
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   405
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
   406
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   407
	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
   408
		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
   409
		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
   410
			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
   411
			then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   412
				temp_val=temp_val+10+(GetHealth(CurrentHedgehog)*0.05)+div((20+GetHealth(CurrentHedgehog)*0.1)*VampOn,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
   413
				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
   414
			else
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   415
				temp_val=temp_val+(GetHealth(hog)*0.5)+(GetHealth(CurrentHedgehog)*0.05)+div((GetHealth(hog)+(GetHealth(CurrentHedgehog)*0.1))*VampOn,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
   416
				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
   417
			end
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   418
			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
   419
			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
   420
			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   421
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   422
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   423
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   424
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   425
--kerguelen special swap hog
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   426
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
   427
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   428
	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
   429
		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
   430
		then
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   431
			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
   432
			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
   433
			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
   434
			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
   435
			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
   436
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   437
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   438
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   439
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   440
--kerguelen special on structure
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   441
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
   442
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   443
	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
   444
		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
   445
		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
   446
			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
   447
			then
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   448
				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
   449
			else
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   450
				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
   451
			end
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   452
			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
   453
			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
   454
			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
   455
			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
   456
			PlaySound(sndHellishImpact2)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   457
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   458
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   459
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   460
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   461
--kerguelen special will apply sabotage
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   462
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
   463
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   464
	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
   465
		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
   466
		then
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   467
			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
   468
			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
   469
			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
   470
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   471
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   472
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   473
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   474
--south american special (used fire gear)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   475
function weapon_anno_south(hog)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   476
	local power_radius_outer=230
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   477
	local power_radius_inner=45
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
	local power_sa=500000
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   479
	local hypo=0
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   480
	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
   481
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   482
		if(hog == CurrentHedgehog)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   483
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   484
			SetState(CurrentHedgehog, gstMoving)
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
		SetGearPosition(hog, GetX(hog),GetY(hog)-3)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   487
		hypo=norm(math.abs(GetX(hog)-GetX(temp_val)),math.abs(GetY(hog)-GetY(temp_val)))
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   488
		SetGearVelocity(hog, div((power_radius_outer-hypo)*power_sa*positive(GetX(hog)-GetX(temp_val)),power_radius_outer), div((power_radius_outer-hypo)*power_sa*positive(GetY(hog)-GetY(temp_val)),power_radius_outer))
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   489
	end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   490
end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   491
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   492
--first part on kerguelen special (lonely cries)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   493
function weapon_cries_a(hog)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   494
	if(GetGearType(hog) == gtHedgehog and hog ~= CurrentHedgehog and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 500, false))
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   495
	then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   496
		kergulenSpecial=-1
7893
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
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   499
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   500
--second part on kerguelen special (lonely cries)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   501
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
   502
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   503
	then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   504
		local dmg=7
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   505
		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
   506
		then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   507
			if(GetHealth(hog) > dmg)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   508
			then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   509
				temp_val=temp_val+div(dmg*VampOn,100)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   510
				SetHealth(hog, GetHealth(hog)-dmg)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   511
			else
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   512
				temp_val=temp_val+div(GetHealth(hog)*VampOn,100)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   513
				SetHealth(hog, 0)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   514
			end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   515
			show_damage_tag(hog,dmg)
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   516
			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
   517
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   518
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   519
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   520
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   521
--north american special on sniper
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   522
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
   523
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   524
	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
   525
		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
   526
		then
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   527
			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
   528
			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
   529
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   530
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   531
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   532
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   533
--european special on molotov (used fire gear)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   534
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
   535
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   536
	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
   537
		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
   538
		then
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   539
			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
   540
			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
   541
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   542
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   543
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   544
--============================================================================
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   545
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   546
--set each weapons settings
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   547
function onAmmoStoreInit()
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   548
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   549
	SetAmmo(amSkip, 9, 0, 0, 0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   550
	
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   551
	for v,w in pairs(weapons_dmg) 
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   552
	do
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   553
		SetAmmo(w[1], w[2], w[3], w[4], w[5])
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
	for v,w in pairs(weapons_supp) 
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   557
	do
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   558
		SetAmmo(w[1], w[2], w[3], w[4], w[5])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   559
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   560
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   561
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   562
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
   563
	--trackTeams()
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   564
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   565
	ShowMission(loc("Continental supplies").." 1.1c",loc("Let a Continent provide your weapons!"),
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   566
	loc(generalinfo), -amLowGravity, 0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   567
end
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
--what happen when a turn starts
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   570
function onNewTurn()
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   571
	
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   572
	--will refresh the info on each tab weapon
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   573
	australianSpecial=true
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   574
	asianSpecial=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   575
	austmine=nil
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   576
	africanSpecial=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   577
	samericanSpecial=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   578
	africaspecial2=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   579
	kergulenSpecial=1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   580
	namericanSpecial=1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   581
	asianflame=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   582
	shotgun_s=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   583
	sniper_s_in_use=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   584
	europe_s=0
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   585
	VampOn=0
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   586
	
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   587
	temp_val=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   588
	
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   589
	--for sabotage
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   590
	disallowattack=0
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   591
	if(disable_moving[CurrentHedgehog]==true)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   592
	then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   593
		disableoffsetai=GetHogLevel(CurrentHedgehog)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   594
	end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   595
	
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   596
	--when all hogs are "placed"
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   597
	if(GetCurAmmoType()~=amTeleport)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   598
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   599
		--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
   600
		if(teams_ok[GetHogTeamName(CurrentHedgehog)] == nil)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   601
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   602
			disable_moving[CurrentHedgehog]=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   603
			AddCaption("["..loc("Select continent!").."]")
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   604
			load_continent_selection(CurrentHedgehog)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   605
			continent[GetHogTeamName(CurrentHedgehog)]=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   606
			swapweps=true
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   607
			teams_ok[GetHogTeamName(CurrentHedgehog)] = 2
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   608
		else
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   609
			--if its not the initialization turn
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   610
			swapweps=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   611
			if(continent[GetHogTeamName(CurrentHedgehog)]==0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   612
			then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   613
				continent[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.maxn(weaponsets))+1
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   614
				setweapons()
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   615
			end
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   616
			show_continent_info(continent[GetHogTeamName(CurrentHedgehog)],-1,true)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   617
			
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   618
			--give zeelandia-teams new weapons so they can plan for the next turn
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   619
			runOnGears(get_random_weapon)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   620
			
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   621
			--some specials for some continents (temp_val is from get random weapons)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   622
			if(continent[GetHogTeamName(CurrentHedgehog)]==9)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   623
			then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   624
				setTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn", nil)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   625
			elseif(continent[GetHogTeamName(CurrentHedgehog)]==7)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   626
			then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   627
				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick")==nil)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   628
				then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   629
					setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick", 1)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   630
				end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   631
				
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   632
				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick")>=2)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   633
				then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   634
					AddAmmo(CurrentHedgehog,amPortalGun)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   635
					setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick", 0)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   636
				end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   637
				setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick", getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica-turntick")+1)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   638
				
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   639
			elseif(continent[GetHogTeamName(CurrentHedgehog)]==5)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   640
			then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   641
				AddAmmo(CurrentHedgehog,amParachute)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   642
			end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   643
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   644
	end
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
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   647
--what happens when you press "tab" (common button)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   648
function onSwitch()
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   649
	
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   650
	--place mine (australia)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   651
	if(GetCurAmmoType() == amBaseballBat and australianSpecial==true)
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
		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
   654
		runOnGears(weapon_aust_check)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   655
		
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   656
		if(temp_val==0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   657
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   658
			austmine=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+5, gtMine, 0, 0, 0, 0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   659
			SetHealth(austmine, 100)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   660
			SetTimer(austmine, 1000)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   661
			australianSpecial=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   662
			swapweps=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   663
		else
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   664
			PlaySound(sndDenied)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   665
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   666
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   667
	
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   668
	--Asian special
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   669
	if(asianSpecial==false and inpara~=false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   670
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   671
		asiabomb=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+3, gtSnowball, 0, 0, 0, 0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   672
		SetGearMessage(asiabomb, 1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   673
		asianSpecial=true
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   674
		swapweps=false
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
	
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   677
	--africa
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   678
	if(GetCurAmmoType() == amSeduction)
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(africanSpecial==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
			africanSpecial = 1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   683
			AddCaption(weapontexts[4])
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
			africanSpecial = 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
	--south america
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   690
	if(GetCurAmmoType() == amGasBomb)
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
		if(samericanSpecial==false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   693
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   694
			samericanSpecial = true
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   695
			AddCaption(weapontexts[3])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   696
		else
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   697
			samericanSpecial = false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   698
			AddCaption(loc("NORMAL"))
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
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   701
	--africa
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   702
	if(GetCurAmmoType() == amSMine)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   703
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   704
		if(africaspecial2==0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   705
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   706
			africaspecial2 = 1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   707
			AddCaption(weapontexts[11])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   708
		elseif(africaspecial2 == 1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   709
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   710
			africaspecial2 = 2
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   711
			AddCaption(weapontexts[12])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   712
		elseif(africaspecial2 == 2)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   713
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   714
			africaspecial2 = 0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   715
			AddCaption(loc("NORMAL"))
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   716
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   717
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   718
	
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   719
	--north america (sniper)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   720
	if(GetCurAmmoType() == amSniperRifle and sniper_s_in_use==false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   721
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   722
		if(namericanSpecial==3)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   723
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   724
			namericanSpecial = 1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   725
			AddCaption(loc("NORMAL"))
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   726
		elseif(namericanSpecial==1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   727
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   728
			namericanSpecial = 2
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   729
			AddCaption("#"..weapontexts[1])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   730
		elseif(namericanSpecial==2)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   731
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   732
			namericanSpecial = 3
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   733
			AddCaption("##"..weapontexts[2])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   734
		end
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
	
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   737
	--north america (shotgun)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   738
	if(GetCurAmmoType() == amShotgun and shotgun_s~=nil)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   739
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   740
		if(shotgun_s==false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   741
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   742
			shotgun_s = true
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   743
			AddCaption(weapontexts[13])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   744
		else
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   745
			shotgun_s = false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   746
			AddCaption(loc("NORMAL"))
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   747
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   748
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   749
	
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   750
	--europe
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   751
	if(GetCurAmmoType() == amMolotov)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   752
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   753
		if(europe_s==0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   754
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   755
			europe_s = 1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   756
			AddCaption(weapontexts[14])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   757
		else
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   758
			europe_s = 0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   759
			AddCaption(loc("NORMAL"))
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   760
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   761
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   762
	
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   763
	--swap forward in the weaponmenu (1.0 style)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   764
	if(swapweps==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing))
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   765
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   766
		continent[GetHogTeamName(CurrentHedgehog)]=continent[GetHogTeamName(CurrentHedgehog)]+1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   767
		
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   768
		if(continent[GetHogTeamName(CurrentHedgehog)]> table.maxn(weaponsets))
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   769
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   770
			continent[GetHogTeamName(CurrentHedgehog)]=1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   771
		end
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   772
		setweapons()
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   773
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   774
	
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   775
	--kerguelen
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   776
	if(GetCurAmmoType() == amHammer)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   777
	then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   778
		if(kergulenSpecial==6)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   779
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   780
			kergulenSpecial = 1
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   781
			AddCaption("Normal")
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   782
		elseif(kergulenSpecial==1)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   783
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   784
			kergulenSpecial = 2
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   785
			AddCaption("#"..weapontexts[7])
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   786
		elseif(kergulenSpecial==2 and TotalRounds>=1)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   787
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   788
			kergulenSpecial = 3
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   789
			AddCaption("##"..weapontexts[8])
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   790
		elseif(kergulenSpecial==3 or (kergulenSpecial==2 and TotalRounds<1))
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   791
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   792
			kergulenSpecial = 4
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   793
			AddCaption("###"..weapontexts[9])
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   794
		elseif(kergulenSpecial==4)
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
			kergulenSpecial = 5
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   797
			AddCaption("####"..weapontexts[10])
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   798
		elseif(kergulenSpecial==5)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   799
		then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   800
			kergulenSpecial = 6
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   801
			AddCaption("#####"..weapontexts[15])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   802
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   803
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   804
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   805
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   806
function onPrecise()
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   807
	--swap backwards in the weaponmenu (1.0 style)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   808
	if(swapweps==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing))
7893
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
		continent[GetHogTeamName(CurrentHedgehog)]=continent[GetHogTeamName(CurrentHedgehog)]-1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   811
		
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   812
		if(continent[GetHogTeamName(CurrentHedgehog)]<=0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   813
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   814
			continent[GetHogTeamName(CurrentHedgehog)]=9
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   815
		end
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   816
		setweapons()
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   817
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   818
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   819
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   820
function onGameTick20()
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   821
	--if you picked a weaponset from the weaponmenu (icon)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   822
	if(continent[GetHogTeamName(CurrentHedgehog)]==0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   823
	then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   824
		if(GetCurAmmoType()==amSwitch)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   825
		then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   826
			continent[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.maxn(weaponsets))+1
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   827
			setweapons()
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   828
			PlaySound(sndMineTick)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   829
		else
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   830
			for v,w in pairs(weaponsets) 
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   831
			do
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   832
				if(GetCurAmmoType()==weaponsets[v][4])
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   833
				then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   834
					continent[GetHogTeamName(CurrentHedgehog)]=v
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   835
					setweapons()
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   836
					PlaySound(weaponsetssounds[v][1])
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   837
					PlaySound(weaponsetssounds[v][2],CurrentHedgehog)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   838
				end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   839
			end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   840
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   841
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   842
	
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   843
	--show the kerguelen ring
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   844
	if(kergulenSpecial > 1 and GetCurAmmoType() == amHammer)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   845
	then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   846
		if(visualcircle==nil)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   847
		then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   848
			visualcircle=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 0, false)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   849
		end
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   850
		
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   851
		if(kergulenSpecial == 2) --walrus scream
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   852
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   853
			SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 120, 4, 0xff0000ee)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   854
		elseif(kergulenSpecial == 3) --swap hog
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   855
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   856
			SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 450, 3, 0xffff00ee)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   857
		elseif(kergulenSpecial == 4) --flare
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   858
		then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   859
			SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 45, 6, 0x00ff00ee)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   860
		elseif(kergulenSpecial == 5) --cries
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   861
		then
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   862
			SetVisualGearValues(visualcircle, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 1, 0x0000ffee)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   863
		elseif(kergulenSpecial == 6) --sabotage
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   864
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   865
			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
   866
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   867
	
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   868
	elseif(visualcircle~=nil)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   869
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   870
		DeleteVisualGear(visualcircle)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   871
		visualcircle=nil
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   872
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   873
	
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   874
	--sabotage
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   875
	if(disable_moving[CurrentHedgehog]==true)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   876
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   877
	
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   878
		if(TurnTimeLeft<=150)
7893
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
			disable_moving[CurrentHedgehog]=false
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   881
			SetHogLevel(CurrentHedgehog,disableoffsetai)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   882
			onsabotageai=false
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   883
		elseif(disallowattack>=15 and disallowattack >= 20)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   884
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   885
			disallowattack=0
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   886
			onsabotageai=true
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   887
			SetHogLevel(CurrentHedgehog,1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   888
			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   889
		elseif(onsabotageai==true)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   890
		then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   891
			SetHogLevel(CurrentHedgehog,disableoffsetai)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   892
			onsabotageai=false
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   893
		else
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   894
			disallowattack=disallowattack+1
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   895
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   896
	
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   897
	end
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
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   900
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   901
--if you used hogswitch or any similar weapon, dont enable any weaponchange
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   902
function onAttack()
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   903
	swapweps=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   904
	
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   905
	--african special
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   906
	if(africanSpecial == 1 and GetCurAmmoType() == amSeduction)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   907
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   908
		SetState(CurrentHedgehog, gstAttacked)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   909
		
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   910
		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
   911
		runOnGears(weapon_duststorm)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   912
		SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+temp_val)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   913
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   914
		--visual stuff
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   915
		visual_gear_explosion(250,GetX(CurrentHedgehog), GetY(CurrentHedgehog),vgtSmoke,vgtSmokeWhite)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   916
		PlaySound(sndParachute)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   917
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   918
	--Kerguelen specials
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   919
	elseif(GetCurAmmoType() == amHammer and kergulenSpecial > 1)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   920
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   921
		SetState(CurrentHedgehog, gstAttacked)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   922
		--scream
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   923
		if(kergulenSpecial == 2)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   924
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   925
			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
   926
			runOnGears(weapon_scream_walrus)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   927
			SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+temp_val)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   928
			PlaySound(sndHellish)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   929
		
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   930
		--swap
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   931
		elseif(kergulenSpecial == 3 and TotalRounds>=1)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   932
		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
   933
			runOnGears(weapon_swap_kerg)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   934
			PlaySound(sndPiano3)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   935
			
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   936
		--flare
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   937
		elseif(kergulenSpecial == 4)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   938
		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
   939
			runOnGears(weapon_flare)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   940
			PlaySound(sndThrowRelease)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   941
			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   942
			AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, 0, -1000000, 34)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   943
		
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   944
		--cries
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   945
		elseif(kergulenSpecial == 5)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   946
		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
   947
			runOnGears(weapon_cries_a)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   948
			if(kergulenSpecial~=-1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   949
			then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   950
				AddGear(0, 0, gtWaterUp, 0, 0,0,0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   951
				PlaySound(sndWarp)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   952
				PlaySound(sndMolotov)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   953
				
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   954
				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
   955
				runOnGears(weapon_cries_b)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   956
				SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+temp_val)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   957
			else
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   958
				HogSay(CurrentHedgehog, loc("Hogs in sight!"), SAY_SAY)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   959
			end
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   960
		
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   961
		--sabotage
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   962
		elseif(kergulenSpecial == 6)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   963
		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
   964
			runOnGears(weapon_sabotage)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   965
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   966
		DeleteVisualGear(visualcircle)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   967
		visualcircle=nil
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   968
		
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   969
	elseif(GetCurAmmoType() == amVampiric)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   970
	then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   971
		VampOn=75
7893
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
	--Australian special
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   974
	if(GetGearType(austmine) == gtMine and austmine ~= nil)
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
		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
   977
		runOnGears(weapon_aust_check)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   978
		
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   979
		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
   980
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   981
			AddVisualGear(GetX(austmine), GetY(austmine), vgtDust, 0, false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   982
			DeleteGear(austmine)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   983
			PlaySound(sndDenied)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   984
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   985
		
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   986
		austmine=nil
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   987
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   988
	
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   989
	--stop sabotage (avoiding a bug)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   990
	if(disable_moving[CurrentHedgehog]==true)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   991
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   992
		disable_moving[CurrentHedgehog]=false
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   993
		onsabotageai=false
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   994
		SetHogLevel(CurrentHedgehog,disableoffsetai)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   995
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   996
	
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   997
	australianSpecial=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   998
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   999
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1000
function onGearAdd(gearUid)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1001
	swapweps=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1002
	
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1003
	--track the gears im using
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
  1004
	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
  1005
	then
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
  1006
		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
  1007
	end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1008
	
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1009
	--remove gasclouds on gasbombspecial
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1010
	if(GetGearType(gearUid)==gtPoisonCloud and samericanSpecial == true)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1011
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1012
		DeleteGear(gearUid)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1013
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1014
	elseif(GetGearType(gearUid)==gtSMine)
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
		vx,vy=GetGearVelocity(gearUid)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1017
		if(africaspecial2 == 1)
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
			SetState(CurrentHedgehog, gstHHDriven+gstMoving)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1020
			SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog),GetY(CurrentHedgehog)-3)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1021
			SetGearVelocity(CurrentHedgehog, vx, vy)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1022
			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
  1023
			
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1024
		elseif(africaspecial2 == 2)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1025
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1026
			fire_gear(CurrentHedgehog,gtNapalmBomb, vx, vy, 0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1027
			DeleteGear(gearUid)
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)==gtSniperRifleShot)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1031
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1032
		sniper_s_in_use=true
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1033
		if(namericanSpecial~=1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1034
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1035
			SetHealth(gearUid, 1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1036
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1037
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1038
	elseif(GetGearType(gearUid)==gtShotgunShot)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1039
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1040
		if(shotgun_s==true)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1041
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1042
			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1043
			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1044
			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1045
			PlaySound(sndBirdyLay)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1046
		else
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1047
			shotgun_s=nil
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1048
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1049
		
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1050
	elseif(GetGearType(gearUid)==gtMolotov and europe_s==1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1051
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1052
		vx,vy=GetGearVelocity(gearUid)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1053
		e_health=fire_gear(CurrentHedgehog,gtCluster, vx, vy, 1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1054
		SetGearMessage(e_health, 2)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1055
		DeleteGear(gearUid)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1056
		
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1057
	elseif(GetGearType(gearUid)==gtParachute)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1058
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1059
		inpara=gearUid
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1060
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1061
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1062
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1063
function onGearDelete(gearUid)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1064
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
  1065
	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
  1066
	then
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
  1067
		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
  1068
	end
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1069
	
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1070
	--north american lipstick
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1071
	if(GetGearType(gearUid)==gtSniperRifleShot )
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1072
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1073
		sniper_s_in_use=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1074
		if(namericanSpecial==2)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1075
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1076
			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
  1077
			runOnGears(weapon_lipstick)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1078
			
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1079
		elseif(namericanSpecial==3)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1080
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1081
			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1082
			
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1083
			pinata=AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 5)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1084
			SetGearMessage(pinata,1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1085
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1086
		
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1087
	--north american pinata
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1088
	elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==1 and namericanSpecial==3)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1089
	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
  1090
		AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 20)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1091
	
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1092
	--north american eagle eye
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1093
	elseif(GetGearType(gearUid)==gtShotgunShot and shotgun_s==true)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1094
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1095
		SetState(CurrentHedgehog, gstMoving)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1096
		SetGearPosition(CurrentHedgehog, GetX(gearUid), GetY(gearUid)+7)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1097
		PlaySound(sndWarp)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1098
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1099
	--south american special
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1100
	elseif(GetGearType(gearUid)==gtGasBomb and samericanSpecial == true)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1101
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1102
		temp_val=gearUid
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1103
		runOnGears(weapon_anno_south)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1104
		AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1105
	
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1106
	--asian special
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1107
	elseif(GetGearType(gearUid)==gtSnowball and GetGearMessage(gearUid)==1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1108
	then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1109
		AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 22)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1110
	
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1111
	--europe special
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1112
	elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==2)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1113
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1114
		temp_val=gearUid
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1115
		runOnGears(weapon_health)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1116
		visual_gear_explosion(100,GetX(gearUid), GetY(gearUid),vgtSmokeWhite,vgtSmokeWhite)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1117
		AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1118
		PlaySound(sndGraveImpact)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1119
	
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1120
	--asia (using para)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1121
	elseif(GetGearType(gearUid)==gtParachute)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1122
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1123
		inpara=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1124
	end
7936
9f44e39d856c Script typos
nemo
parents: 7895
diff changeset
  1125
end
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1126
--[[
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1127
sources (populations & area):
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1128
Wikipedia
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1129
Own calculations
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1130
if you think they are wrong, then please tell me :)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1131
]]