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