share/hedgewars/Data/Scripts/Multiplayer/Continental_supplies.lua
author Wuzzy <Wuzzy2@mail.ru>
Thu, 03 May 2018 15:18:28 +0200
changeset 13360 e27540ad33bd
parent 13359 7d772358dc22
child 13362 8a9a723eb185
permissions -rw-r--r--
Massive Continental supplies update List of changes: * Invulnerability protects from sabotage damage * Sabotage kills hog instantly when health reaches 0 * Reliably prevent using of Lonely Cries and baseball bat specials when usage not allowed * Don't explode Anno 1302 and Medicine if drowning * Don't play “Missed” and “Laugh” taunt when those don't make sense * Major rewrite of ALL strings for better usability * Add custom weapon tooltips * Major refactoring * Improve audiovisual effects * Show message when hog receives new continent ammo * Sabotaged hedgehogs also emit smoke when it's not their turn * Can switch continent in reverse order with [Precise]+[Switch] * Fix retreat timer not turning red for some weapons
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
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    50
function EndTurnCS(seconds)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    51
	--set escape time
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
    52
	TurnTimeLeft = GetAwayTime*10*seconds
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    53
	if TurnTimeLeft > 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    54
		Retreat(TurnTimeLeft, false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    55
	end
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
    56
 end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
    57
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
    58
 --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
    59
function ShowDamageTag(hog,damage)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    60
	local healthtag=AddVisualGear(GetX(hog), GetY(hog), vgtHealthTag, damage, false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    61
	SetVisualGearValues(healthtag, nil, nil, nil, nil, nil, nil, nil, nil, nil, GetClanColor(GetHogClan(hog)))
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
    62
end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
    63
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
    64
--will use IntegerSqrt
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
    65
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
    66
	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
    67
	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
    68
end
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
    69
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    70
function CollectMultiAmmo(hog, ammoList, noAddAmmo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    71
	local x, y = GetGearPosition(hog)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    72
	x = x + 2
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    73
	y = y + 32
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    74
	local ammoStr = ""
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    75
	local ammoLength = 0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    76
	for _, _ in pairs(ammoList) do
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    77
		ammoLength = ammoLength + 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    78
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    79
	local a = 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    80
	for ammo, count in pairs(ammoList) do
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    81
		if not noAddAmmo then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    82
			local oldCount = GetAmmoCount(hog, ammo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    83
			local newCount = oldCount + count
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    84
			-- Make sure that finite ammo stays finite
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    85
			if count < 100 and oldCount < 100 and newCount >= 100 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    86
				newCount = 99
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    87
			end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    88
			AddAmmo(hog, ammo, newCount)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    89
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    90
		if IsHogLocal(hog) then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    91
			x = x + 2
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    92
			y = y + 32
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    93
			local vgear = AddVisualGear(x, y, vgtAmmo, 0, true)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    94
			if vgear ~= nil then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    95
				local vgtFrame = ammo
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    96
				SetVisualGearValues(vgear, nil, nil, nil, nil, nil, vgtFrame)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    97
			end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    98
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
    99
			ammoStr = ammoStr .. string.format(loc("%s (+%d)"), GetAmmoName(ammo), count)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   100
			if a < ammoLength then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   101
				ammoStr = ammoStr .. " • "
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   102
			end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   103
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   104
		a = a + 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   105
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   106
	if ammoLength > 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   107
		PlaySound(sndShotgunReload)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   108
		-- Show collected ammo
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   109
		if IsHogLocal(hog) then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   110
			AddCaption(ammoStr, GetClanColor(GetHogClan(hog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   111
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   112
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   113
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   114
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   115
function SetAttackState(state)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   116
	if state==true then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   117
		SetInputMask(bor(GetInputMask(), gmAttack))
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   118
	else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   119
		SetInputMask(band(GetInputMask(), bnot(gmAttack)))
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   120
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   121
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   122
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   123
--====MISC_TIMER GLOBALS====
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   124
local CS = {}
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   125
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   126
--for selecting continent
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   127
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   128
CS.INIT_TEAMS = {}
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   129
CS.GAME_STARTED = false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   130
CS.SELECT_CONTINENT_CHECK=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   131
CS.START_TIME=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   132
CS.HOG_HEALTH=100
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   133
CS.TEAM_CONTINENT = {}
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   134
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   135
--variables for seeing if you have swaped around on a weapon
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   136
CS.AUSTRALIAN_SPECIAL=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   137
CS.AFRICAN_SPECIAL_SEDUCTION=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   138
CS.AFRICAN_SPECIAL_STICKY=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   139
CS.SOUTH_AMERICAN_SPECIAL=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   140
CS.NORTH_AMERICAN_SPECIAL_SNIPER=1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   141
CS.NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   142
CS.KERGUELEN_SPECIAL=1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   143
CS.NORTH_AMERICAN_SPECIAL_SHOTGUN=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   144
CS.EUROPE_SPECIAL=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   145
CS.ANTARCTICA_SPECIAL=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   146
CS.SEDUCTION_INCREASER=0
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   147
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   148
--detection if something is activated
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   149
CS.SWITCH_HOG_IS_ON=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   150
CS.VAMPIRIC_IS_ON=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   151
CS.EXTRA_DAMAGE_IS_ON=100
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   152
CS.PARACHUTE_IS_ON=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   153
CS.PRECISE=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   154
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   155
CS.CONTINENT_LABEL_TIMER=-1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   156
CS.SPEECH_TIMER=-1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   157
CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER=-1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   158
CS.CONFIRM_CONTINENT_SELECTION=-1
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   159
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   160
--the visual circle for kerguelen
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   161
CS.VISUAL_CIRCLE=nil
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   162
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   163
--the global temporary value
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   164
CS.TEMP_VALUE=0
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   165
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   166
--true if player used any sticky mine mine mode besides hedgehog projectile in this turn
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   167
CS.AFRICAN_SPECIAL_NON_PROJECTILE_USED=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   168
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   169
-- “constants”
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   170
CS.SABOTAGE_GRAVITY=350
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   171
CS.SABOTAGE_GRAVITY_LOW=175
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   172
CS.SABOTAGE_DAMAGE=2
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   173
CS.SABOTAGE_FREQUENCY=100
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   174
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   175
--for sabotage
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   176
CS.SABOTAGE_COUNTER=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   177
CS.SABOTAGE_HOGS={}
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   178
CS.SABOTAGE_FREQUENCY_NOW=0
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   179
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   180
--for sundaland
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   181
CS.SUNDALAND_END_HOG_CONTINENT_NAME=nil
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   182
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   183
--misc.
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   184
CS.OPTION_NO_SPECIALS=false
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   185
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   186
--====GENERAL GLOBALS (useful for handling continents)====
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   187
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   188
CS.SNIPER_SPECIAL_NAME = loc("Green Lipstick Bullet")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   189
CS.BASEBALLBAT_BOOMERANG_NAME = loc("Bouncy Boomerang")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   190
CS.CHEESE_SPECIAL_NAME = loc("Anno 1032")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   191
CS.SEDUCTION_SPECIAL_NAME = loc("Dust Storm")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   192
CS.BASEBALLBAT_CRICKET_NAME = loc("Cricket Time")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   193
CS.PARACHUTE_SPECIAL_NAME = loc("Heroic Wind")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   194
CS.HAMMER_ROAR_NAME = loc("Penguin Roar")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   195
CS.HAMMER_SWAP_NAME = loc("Disguise as a Rockhopper Penguin")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   196
CS.HAMMER_LONELY_NAME = loc("Lonely Cries")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   197
CS.STICKY_PROJECTILE_NAME = loc("Hedgehog Projectile")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   198
CS.STICKY_NAPALM_NAME = loc("Napalm Rocket")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   199
CS.SHOTGUN_SPECIAL_NAME = loc("Eagle Eye")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   200
CS.MOLOTOV_SPECIAL_NAME = loc("Medicine")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   201
CS.HAMMER_SABOTAGE_NAME = loc("Flare")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   202
CS.PICKHAMMER_SPECIAL_NAME = loc("Upside-Down World")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   203
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   204
CS.SNIPER_SPECIAL_DESC = loc("Poisonous, deals no damage.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   205
CS.BASEBALLBAT_BOOMERANG_DESC = loc("Launch a bouncy ball which explodes into a crate.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   206
CS.CHEESE_SPECIAL_DESC = loc("Strong knockback, but no poison.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   207
CS.SEDUCTION_SPECIAL_DESC = loc("Deals 15 damage to all enemies in the circle.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   208
CS.BASEBALLBAT_CRICKET_DESC = loc("Throw a 1 second mine!")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   209
CS.PARACHUTE_SPECIAL_DESC = loc("Drop a ball of dirt which turns into a|cluster on impact. Doesn’t end turn.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   210
CS.HAMMER_ROAR_DESC = loc("Deal 15 damage + 10% of your hog’s health to all hogs around you and get 2/3 back.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   211
CS.HAMMER_SWAP_DESC = loc("Swap place with a random enemy in the circle.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   212
CS.HAMMER_LONELY_DESC = loc("Rise the water if nobody else is in the circle and deal 6 damage to all enemy hogs.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   213
CS.STICKY_PROJECTILE_DESC = loc("Fire your hedgehog like a sticky mine.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   214
CS.STICKY_NAPALM_DESC = loc("Fire a rocket with napalm.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   215
CS.SHOTGUN_SPECIAL_DESC = loc("Teleport to the impact location.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   216
CS.MOLOTOV_SPECIAL_DESC = loc("Fire some exploding medicine that will heal 15 health to all hogs in its effect radius.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   217
CS.HAMMER_SABOTAGE_DESC = loc("Sabotage all hogs in the circle and fire a cluster above you.|Sabotaged hogs lose health and have to deal with a very high gravity during their turn.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   218
CS.PICKHAMMER_SPECIAL_DESC = loc("Teleport 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
   219
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   220
CS.INVULNERABLE_SPECIAL_CAPTION = loc("15+%d damage, %d invulnerable left")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   221
-- Make info
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   222
local minfo = function(name, desc)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   223
	return string.format(loc("%s: %s"), name, desc)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   224
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   225
CS.SNIPER_SPECIAL_INFO = minfo(CS.SNIPER_SPECIAL_NAME, CS.SNIPER_SPECIAL_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   226
CS.BASEBALLBAT_BOOMERANG_INFO = minfo(CS.BASEBALLBAT_BOOMERANG_NAME, CS.BASEBALLBAT_BOOMERANG_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   227
CS.CHEESE_SPECIAL_INFO = minfo(CS.CHEESE_SPECIAL_NAME, CS.CHEESE_SPECIAL_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   228
CS.SEDUCTION_SPECIAL_INFO = minfo(CS.SEDUCTION_SPECIAL_NAME, CS.SEDUCTION_SPECIAL_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   229
CS.INVULNERABLE_SPECIAL_INFO = loc("Increase the dust storm damage by sacrificing|your invulnerable ammo.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   230
CS.INVULNERABLE_SPECIAL_CTRL = loc("Up/Down: Adjust dust storm damage")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   231
CS.BASEBALLBAT_CRICKET_INFO = minfo(CS.BASEBALLBAT_CRICKET_NAME, CS.BASEBALLBAT_CRICKET_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   232
CS.PARACHUTE_SPECIAL_INFO = minfo(CS.PARACHUTE_SPECIAL_NAME, CS.PARACHUTE_SPECIAL_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   233
CS.HAMMER_ROAR_INFO = minfo(CS.HAMMER_ROAR_NAME, CS.HAMMER_ROAR_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   234
CS.HAMMER_SWAP_INFO = minfo(CS.HAMMER_SWAP_NAME, CS.HAMMER_SWAP_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   235
CS.HAMMER_LONELY_INFO = minfo(CS.HAMMER_LONELY_NAME, CS.HAMMER_LONELY_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   236
CS.STICKY_PROJECTILE_INFO = minfo(CS.STICKY_PROJECTILE_NAME, CS.STICKY_PROJECTILE_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   237
CS.STICKY_NAPALM_INFO = minfo(CS.STICKY_NAPALM_NAME, CS.STICKY_NAPALM_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   238
CS.SHOTGUN_SPECIAL_INFO = minfo(CS.SHOTGUN_SPECIAL_NAME, CS.SHOTGUN_SPECIAL_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   239
CS.MOLOTOV_SPECIAL_INFO = minfo(CS.MOLOTOV_SPECIAL_NAME, CS.MOLOTOV_SPECIAL_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   240
CS.HAMMER_SABOTAGE_INFO = minfo(CS.HAMMER_SABOTAGE_NAME, CS.HAMMER_SABOTAGE_DESC)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   241
CS.PICKHAMMER_SPECIAL_INFO = minfo(CS.PICKHAMMER_SPECIAL_NAME, CS.PICKHAMMER_SPECIAL_DESC)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   242
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   243
CS.SELECT_WEP_INFORMATION=loc("Select your continent with [Up]/[Down] or by selecting a representative weapon.").."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   244
	loc("Press [Attack] to confirm.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   245
CS.SELECT_WEP_INFORMATION_SHORT=loc("%s, select your continent!")
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   246
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   247
function GeneralInformation()
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   248
	local select_wep, quit_hint
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   249
	if not CS.GAME_STARTED then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   250
		select_wep = "| |"..CS.SELECT_WEP_INFORMATION
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   251
		quit_hint = "|"..loc("Hint: Use the quit key to see the team’s continent.")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   252
	else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   253
		select_wep = ""
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   254
		quit_hint = ""
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   255
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   256
	local general_information =
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   257
		loc("Continents: Select a continent at the beginning.").."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   258
		loc("Supplies: Each continent gives you unique weapons, specials and health.").."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   259
		loc("Weapon specials: Some weapons have special modes (see weapon description).")..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   260
		select_wep..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   261
		quit_hint
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   262
	return general_information
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   263
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   264
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   265
CS.CONTINENT_INFORMATION =
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   266
{
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   267
{loc("North America"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   268
loc("The continent of firearms"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   269
loc("The Union: You can select a hedgehog at the start of your turns.").."| |"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   270
loc("Special weapons:").."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   271
GetAmmoName(amShotgun)..": "..CS.SHOTGUN_SPECIAL_INFO.."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   272
GetAmmoName(amSniperRifle)..": "..CS.SNIPER_SPECIAL_INFO,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   273
{amSniperRifle,1},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   274
{{amShotgun,100},{amDEagle,100},{amLaserSight,2},{amSniperRifle,100},{amCake,1},{amAirAttack,2},{amSwitch,2}},
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   275
{sndShotgunFire,sndCover},100},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   276
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   277
{loc("South America"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   278
loc("The continent of guerilla tactics"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   279
"| |"..loc("Special weapons:").."|"
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   280
..GetAmmoName(amGasBomb)..": "..CS.CHEESE_SPECIAL_INFO,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   281
{amGasBomb,2},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   282
{{amBirdy,100},{amHellishBomb,1},{amBee,100},{amGasBomb,100},{amFlamethrower,100},{amNapalm,2},{amExtraDamage,3}},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   283
{sndEggBreak,sndLaugh},125},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   284
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   285
{loc("Europe"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   286
loc("The continent of medicine"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   287
"| |"..loc("Special weapons:").."|"
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   288
..GetAmmoName(amMolotov)..": "..CS.MOLOTOV_SPECIAL_INFO,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   289
{amBazooka,3},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   290
{{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
   291
{sndExplosion,sndEnemyDown},100},
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   292
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   293
{loc("Africa"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   294
loc("The continent of dust"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   295
"| |"..loc("Special weapons:").."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   296
GetAmmoName(amSeduction)..": "..CS.SEDUCTION_SPECIAL_INFO.."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   297
CS.INVULNERABLE_SPECIAL_INFO.."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   298
GetAmmoName(amSMine)..": "..CS.STICKY_PROJECTILE_INFO.."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   299
GetAmmoName(amSMine)..": "..CS.STICKY_NAPALM_INFO,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   300
{amSMine,4},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   301
{{amSMine,100},{amWatermelon,1},{amDrillStrike,1},{amDrill,100},{amInvulnerable,7},{amSeduction,100},{amLandGun,3}},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   302
{sndMelonImpact,sndCoward},125},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   303
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   304
{loc("Asia"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   305
loc("The continent of ninjas"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   306
loc("Textile industry: Will give you a parachute every second turn.").."| |"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   307
loc("Special weapons:").."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   308
GetAmmoName(amParachute)..": "..CS.PARACHUTE_SPECIAL_INFO,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   309
{amRope,5},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   310
{{amRope,100},{amFirePunch,100},{amParachute,1},{amKnife,2},{amDynamite,1}},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   311
{sndRopeAttach,sndComeonthen},50},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   312
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   313
{loc("Australia"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   314
loc("The continent of sports"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   315
"| |"..loc("Special weapons:").."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   316
GetAmmoName(amBaseballBat)..": "..CS.BASEBALLBAT_CRICKET_INFO.."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   317
GetAmmoName(amBaseballBat)..": "..CS.BASEBALLBAT_BOOMERANG_INFO.."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   318
loc("Baseball bat specials cannot be used close to other hogs."),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   319
{amBaseballBat,6},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   320
{{amBaseballBat,100},{amMine,100},{amLowGravity,4},{amBlowTorch,100},{amRCPlane,2},{amRubber,4}},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   321
{sndBaseballBat,sndNooo},100},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   322
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   323
{loc("Antarctica"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   324
loc("The continent of ice and science"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   325
loc("Antarctic summer: Every 4th turn you get 1 girder, 1 mudball, 2 sine guns and 1 portable portal device.").."| |"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   326
loc("Special weapons:").."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   327
GetAmmoName(amPickHammer)..": "..CS.PICKHAMMER_SPECIAL_INFO,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   328
{amIceGun,7},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   329
{{amSnowball,2},{amPickHammer,100},{amSineGun,4},{amGirder,1},{amExtraTime,1},{amIceGun,1},{amPortalGun,2}},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   330
{sndSineGun,sndOops},75},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   331
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   332
{loc("Kerguelen"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   333
loc("The continent of cowards"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   334
"| |"..loc("Special weapons:").."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   335
GetAmmoName(amHammer)..": "..CS.HAMMER_ROAR_INFO.."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   336
GetAmmoName(amHammer)..": "..CS.HAMMER_SWAP_INFO.."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   337
GetAmmoName(amHammer)..": "..CS.HAMMER_LONELY_INFO.."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   338
GetAmmoName(amHammer)..": "..CS.HAMMER_SABOTAGE_INFO,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   339
{amHammer,8},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   340
{{amHammer,100},{amMineStrike,1},{amBallgun,1},{amTeleport,1}},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   341
{sndPiano5,sndStupid},75},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   342
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   343
{loc("Zealandia"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   344
loc("The forgotten continent"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   345
loc("Surprise supplies: Get 1-3 random weapons each turn.") .. "|" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   346
loc("Treasure: Massive weapon bonus in first turn.").."|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   347
loc("Forgetfulness: You will lose all your weapons each turn."),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   348
{amInvulnerable,9},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   349
{{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
   350
{sndSplash,sndFirstBlood},100},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   351
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   352
{loc("Sundaland"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   353
loc("The continent of greed"),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   354
loc("Bounty: Get 6 weapons for each kill (even on own hogs)."),
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   355
{amTardis,10},
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   356
{{amClusterBomb,5},{amTardis,100},{amWhip,100},{amKamikaze,100},{amAirMine,2}},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   357
{sndWarp,sndSameTeam},100}
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   358
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   359
}
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   360
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   361
--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)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   362
CS.WEAPONS_DAMAGE = {
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   363
	{amKamikaze,    0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   364
	{amSineGun,     0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   365
	{amMineStrike,  0, 1, 6, 1, 1},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   366
	{amGrenade,     0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   367
	{amPiano,       0, 1, 7, 1, 0},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   368
	{amClusterBomb, 0, 1, 0, 1, 0},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   369
	{amBee,         0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   370
	{amShotgun,     0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   371
	{amSniperRifle, 0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   372
	{amDynamite,    0, 1, 6, 1, 1},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   373
	{amFirePunch,   0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   374
	{amHellishBomb, 0, 1, 6, 1, 2},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   375
	{amWhip,        0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   376
	{amNapalm,      0, 1, 6, 1, 1},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   377
	{amPickHammer,  0, 1, 0, 1, 0},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   378
	{amBaseballBat, 0, 1, 0, 1, 1},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   379
	{amMortar,      0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   380
	{amCake,        0, 1, 5, 1, 2},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   381
	{amSeduction,   0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   382
	{amWatermelon,  0, 1, 6, 1, 2},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   383
	{amDrill,       0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   384
	{amBallgun,     0, 1, 8, 1, 2},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   385
	{amDEagle,      0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   386
	{amMolotov,     0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   387
	{amHammer,      0, 1, 0, 1, 1},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   388
	{amBirdy,       0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   389
	{amRCPlane,     0, 1, 6, 1, 2},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   390
	{amMine,        0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   391
	{amGasBomb,     0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   392
	{amAirAttack,   0, 1, 5, 1, 1},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   393
	{amBlowTorch,   0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   394
	{amFlamethrower,0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   395
	{amSMine,       0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   396
	{amSnowball,    0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   397
	{amKnife,       0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   398
	{amDrillStrike, 0, 1, 5, 1, 1},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   399
	{amBazooka,     0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   400
	{amAirMine,     0, 1, 0, 1, 0},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   401
}
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   402
CS.WEAPONS_SUPPORT = {
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   403
	{amParachute,   0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   404
	{amGirder,      0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   405
	{amSwitch,      0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   406
	{amLowGravity,  0, 1, 0, 1, 0},
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   407
	{amExtraDamage, 0, 1, 2, 1, 0},
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   408
	{amRope,        0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   409
	{amInvulnerable,0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   410
	{amExtraTime,   0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   411
	{amLaserSight,  0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   412
	{amVampiric,    0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   413
	{amJetpack,     0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   414
	{amPortalGun,   0, 1, 3, 1, 1},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   415
	{amResurrector, 0, 1, 2, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   416
	{amTeleport,    0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   417
	{amLandGun,     0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   418
	{amTardis,      0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   419
	{amIceGun,      0, 1, 0, 1, 0},
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   420
	{amRubber,      0, 1, 0, 1, 0}
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   421
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   422
}
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   423
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   424
--check if weps valid
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   425
function wepNotValidBorder(weapon)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   426
	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
   427
	then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   428
		return true
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   429
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   430
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   431
	return false
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   432
end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   433
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   434
--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
   435
function ValidateWeapon(hog,weapon,amount)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   436
	if(wepNotValidBorder(weapon))
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   437
	then
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   438
		if(amount==1)
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   439
		then
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   440
			AddAmmo(hog, weapon)
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   441
		else
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   442
			AddAmmo(hog, weapon,amount)
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   443
		end
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   444
	end
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   445
end
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   446
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   447
function SpawnRandomCrate(x,y,strength)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   448
	local tot=table.maxn(CS.WEAPONS_SUPPORT)+table.maxn(CS.WEAPONS_DAMAGE)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   449
	local rand=GetRandom(tot)+1
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   450
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   451
	if(rand>table.maxn(CS.WEAPONS_SUPPORT))
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   452
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   453
		local weapon=rand-table.maxn(CS.WEAPONS_SUPPORT)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   454
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   455
		while(wepNotValidBorder(CS.WEAPONS_DAMAGE[weapon][1])==false)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   456
		do
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   457
			if(weapon>=table.maxn(CS.WEAPONS_DAMAGE))
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   458
			then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   459
				weapon=0
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   460
			end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   461
			weapon = weapon+1
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   462
		end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   463
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   464
		SpawnAmmoCrate(x, y, CS.WEAPONS_DAMAGE[weapon][1])
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   465
	else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   466
		SpawnUtilityCrate(x, y, CS.WEAPONS_SUPPORT[rand][1])
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   467
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   468
end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   469
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   470
--removes one weapon
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   471
function RemoveWeapon(hog,weapon)
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   472
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   473
	if(GetAmmoCount(hog, weapon)<100)
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   474
	then
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   475
		AddAmmo(hog,weapon,GetAmmoCount(hog, weapon)-1)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   476
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   477
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   478
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   479
--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
   480
function CleanWeapons(hog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   481
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   482
	for w=1, #CS.WEAPONS_SUPPORT do
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   483
		AddAmmo(hog, CS.WEAPONS_SUPPORT[w][1], 0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   484
	end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   485
	for w=1, #CS.WEAPONS_DAMAGE do
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   486
		AddAmmo(hog, CS.WEAPONS_DAMAGE[w][1], 0)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   487
	end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   488
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   489
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   490
--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
   491
function LoadWeaponset(hog, num)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   492
	for v,w in pairs(CS.CONTINENT_INFORMATION[num][5])
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   493
	do
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   494
		ValidateWeapon(hog, w[1],w[2])
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   495
	end
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   496
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   497
	CS.TEMP_VALUE=CS.CONTINENT_INFORMATION[num][7]
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   498
	runOnGears(SetHogHealth)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   499
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   500
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   501
--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
   502
function InitWeaponsMenu(hog)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   503
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   504
	if(GetHogLevel(hog)==0 or CS.CONTINENT_INFORMATION[1][6][1]==sndFrozenHogImpact)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   505
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   506
		for v,w in pairs(CS.CONTINENT_INFORMATION)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   507
		do
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   508
			ValidateWeapon(hog, CS.CONTINENT_INFORMATION[v][4][1], 100)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   509
		end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   510
		AddAmmo(hog, amSwitch, 100) --random continent
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   511
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   512
	--for the computers
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   513
	else
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   514
		--europe
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   515
		ValidateWeapon(hog, CS.CONTINENT_INFORMATION[3][4][1], 100)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   516
		--north america
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   517
		ValidateWeapon(hog, CS.CONTINENT_INFORMATION[1][4][1], 100)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   518
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   519
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   520
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   521
--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
   522
function ShowContinentInfo(continent,time,generalinf)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   523
	local geninftext=""
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   524
	local ns=false
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   525
	if(time==-1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   526
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   527
		time=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   528
		ns=true
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   529
	end
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   530
	if(generalinf)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   531
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   532
		geninftext="| |"..loc("General information:").."|"..GeneralInformation()
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   533
	else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   534
		geninftext="| |"..loc("Press [Attack] to select this continent!")
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   535
	end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   536
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   537
	ShowMission(CS.CONTINENT_INFORMATION[continent][1],
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   538
		CS.CONTINENT_INFORMATION[continent][2],
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   539
		string.format(loc("Initial health: %d"), CS.CONTINENT_INFORMATION[continent][7]) .. "|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   540
		CS.CONTINENT_INFORMATION[continent][3]..geninftext,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   541
		CS.CONTINENT_INFORMATION[continent][4][2], time)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   542
	if(ns)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   543
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   544
		HideMission()
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   545
	elseif not CS.GAME_STARTED then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   546
		AddCaption(CS.CONTINENT_INFORMATION[continent][1], GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   547
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   548
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   549
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   550
--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
   551
function VisualExplosion(range,xpos,ypos,gear1,gear2)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   552
	local degr=0
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   553
	local lap=30
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   554
	while(lap<range)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   555
	do
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   556
		while(degr < 6.2831)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   557
		do
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   558
			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
   559
			if(gear2~=false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   560
			then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   561
				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
   562
			end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   563
			degr=degr+((3.1415*3)*0.125) --1/8 = 0.125
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   564
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   565
		lap=lap+30
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   566
		degr=degr-6.2831
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   567
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   568
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   569
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   570
--give one random weapon
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   571
function GetRandomWeapon(hog, weptype, power, onlyonewep, getdelayedweps, mypower)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   572
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   573
	local wepout=nil
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   574
	local rand_weaponset_power=mypower
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   575
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   576
	if(rand_weaponset_power < power)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   577
	then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   578
		local numberofweapons=table.maxn(weptype)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   579
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   580
		local random_weapon = math.abs(GetRandom(numberofweapons)+1)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   581
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   582
		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
   583
				or (wepNotValidBorder(weptype[random_weapon][1])==false) or GetAmmoCount(hog,weptype[random_weapon][1])>=100
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   584
				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
   585
		do
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   586
			if(random_weapon>=numberofweapons)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   587
			then
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   588
				random_weapon=0
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   589
			end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   590
			random_weapon = random_weapon+1
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   591
		end
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   592
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   593
		wepout=weptype[random_weapon][1]
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   594
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   595
		ValidateWeapon(hog, wepout,1)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   596
		rand_weaponset_power=mypower+weptype[random_weapon][6]
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   597
	end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   598
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   599
	return rand_weaponset_power , wepout
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
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   602
--zealandia (generates weapons from the weaponinfo above) and sundaland
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   603
function RandomContinentsGetWeapons(hog)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   604
	if(GetGearType(hog) == gtHedgehog)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   605
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   606
		local currCont=CS.TEAM_CONTINENT[GetHogTeamName(hog)]
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   607
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   608
		if(currCont~=0)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   609
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   610
			local checkDefCont=CS.CONTINENT_INFORMATION[currCont][4][2]
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   611
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   612
			--for sunda
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   613
			local wepamount=getTeamValue(GetHogTeamName(hog), "sundaland-count")
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   614
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   615
			if(checkDefCont==9 and getTeamValue(GetHogTeamName(hog), "rand-done-turn")==false)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   616
			then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   617
				CleanWeapons(hog)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   618
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   619
				local rand_weaponset_power = 0
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   620
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   621
				rand_weaponset_power=GetRandomWeapon(hog,CS.WEAPONS_DAMAGE,100,true,false,rand_weaponset_power)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   622
				rand_weaponset_power=GetRandomWeapon(hog,CS.WEAPONS_SUPPORT,2,true,false,rand_weaponset_power)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   623
				rand_weaponset_power=GetRandomWeapon(hog,CS.WEAPONS_DAMAGE,1,true,false,rand_weaponset_power)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   624
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   625
				setTeamValue(GetHogTeamName(hog), "rand-done-turn", true)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   626
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   627
			elseif(checkDefCont==10 and wepamount~=nil)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   628
			then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   629
				local loci=0
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   630
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   631
				while(loci<wepamount)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   632
				do
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   633
					local _
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   634
					local wep = {}
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   635
					--6 random weapons
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   636
					_, wep[1] = GetRandomWeapon(hog,CS.WEAPONS_DAMAGE,100,false,true,0)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   637
					_, wep[2] = GetRandomWeapon(hog,CS.WEAPONS_DAMAGE,100,false,true,0)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   638
					_, wep[3] = GetRandomWeapon(hog,CS.WEAPONS_DAMAGE,2,false,true,1)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   639
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   640
					_, wep[4] = GetRandomWeapon(hog,CS.WEAPONS_SUPPORT,100,false,true,0)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   641
					_, wep[5] = GetRandomWeapon(hog,CS.WEAPONS_SUPPORT,100,false,true,0)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   642
					_, wep[6] = GetRandomWeapon(hog,CS.WEAPONS_SUPPORT,100,false,true,0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   643
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   644
					-- Don't give weapons directly, only insert them into the global temp. value
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   645
					-- We expect this function to be called by runOnGears for Sundaland.
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   646
					if CS.TEMP_VALUE[hog] == nil then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   647
						CS.TEMP_VALUE[hog] = {}
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   648
					end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   649
					for w=1, #wep do
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   650
						local ammoList = CS.TEMP_VALUE[hog]
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   651
						if ammoList[wep[w]] == nil then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   652
							ammoList[wep[w]] = 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   653
						else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   654
							ammoList[wep[w]] = math.min(99, ammoList[wep[w]] + 1)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   655
						end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   656
					end
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   657
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   658
					loci=loci+1
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   659
				end
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   660
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   661
				setTeamValue(GetHogTeamName(hog), "sundaland-count",nil)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   662
			end
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   663
		end
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   664
	end
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   665
end
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   666
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   667
--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
   668
function SetContinentWeapons()
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   669
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   670
	CleanWeapons(CurrentHedgehog)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   671
	LoadWeaponset(CurrentHedgehog,CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)])
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   672
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   673
	local visualstuff=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-5, vgtDust,0, false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   674
	SetVisualGearValues(visualstuff, nil, nil, nil, nil, nil, nil, nil, 2, nil, GetClanColor(GetHogClan(CurrentHedgehog)))
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   675
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   676
	SetCSAmmoDescriptions("weapons")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   677
	ShowContinentInfo(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)],5000,false)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   678
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   679
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   680
--count hogs in team
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   681
function CountHogsInTeam(hog)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   682
	if(GetHogTeamName(hog)==GetHogTeamName(CurrentHedgehog))
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   683
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   684
		CS.TEMP_VALUE=CS.TEMP_VALUE+1
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   685
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   686
end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   687
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   688
--==========================run throw all hog/gear weapons ==========================
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   689
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   690
function SetHogHealth(hog)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   691
	if(GetGearType(hog) == gtHedgehog and GetHogClan(hog) == GetHogClan(CurrentHedgehog))
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   692
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   693
		SetHealth(hog, div(CS.TEMP_VALUE*CS.HOG_HEALTH,100))
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   694
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   695
end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   696
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   697
--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
   698
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
   699
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   700
	then
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   701
		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
   702
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   703
			CS.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
   704
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   705
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   706
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   707
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   708
function HogOuch(hog, ouchType)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   709
	local r
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   710
	if ouchType == "moan" then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   711
		r = math.random(1, 2)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   712
		if r == 1 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   713
			PlaySound(sndPoisonMoan, hog, true)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   714
		else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   715
			PlaySound(sndPoisonCough, hog, true)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   716
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   717
	else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   718
		local r = math.random(1, 4)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   719
		PlaySound(_G["sndOw"..r], hog)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   720
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   721
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   722
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   723
--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
   724
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
   725
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   726
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   727
		local dmg=div((15+CS.SEDUCTION_INCREASER)*CS.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
   728
		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
   729
		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
   730
			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
   731
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   732
				CS.TEMP_VALUE=CS.TEMP_VALUE+div(dmg*CS.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
   733
				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
   734
			else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   735
				CS.TEMP_VALUE=CS.TEMP_VALUE+div(GetHealth(hog)*CS.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
   736
				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
   737
			end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   738
			HogOuch(hog)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   739
			ShowDamageTag(hog,dmg)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   740
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   741
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   742
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   743
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   744
--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
   745
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
   746
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   747
	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
   748
		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
   749
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   750
			local dmg=div((15+div(GetHealth(CurrentHedgehog)*10,100))*CS.EXTRA_DAMAGE_IS_ON,100)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   751
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   752
			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
   753
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   754
				CS.TEMP_VALUE=CS.TEMP_VALUE+div(dmg*2,3)+div(dmg*CS.VAMPIRIC_IS_ON*2,100*3)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   755
				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
   756
			else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   757
				CS.TEMP_VALUE=CS.TEMP_VALUE+(div(GetHealth(hog)*75,100))+(div(GetHealth(CurrentHedgehog)*10,100))+div((GetHealth(hog)+div(GetHealth(CurrentHedgehog)*10,100))*CS.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
   758
				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
   759
			end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   760
			HogOuch(hog)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   761
			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
   762
			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
   763
			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   764
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   765
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   766
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   767
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   768
--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
   769
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
   770
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   771
	then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   772
		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
   773
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   774
			CS.TEMP_VALUE=CS.TEMP_VALUE+1
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   775
		end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   776
	end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   777
end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   778
--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
   779
function KerguelenSpecialYellowSwap(hog)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   780
	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
   781
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   782
		if(CS.KERGUELEN_SPECIAL ~= -1 and GetHogClan(hog) ~= GetHogClan(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 420, false))
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   783
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   784
			if(CS.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
   785
			then
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   786
				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
   787
				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
   788
				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
   789
				SetGearPosition(hog, thisX, thisY)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   790
				CS.KERGUELEN_SPECIAL=-1
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   791
			else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   792
				CS.TEMP_VALUE=CS.TEMP_VALUE-1
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   793
			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
   794
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   795
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   796
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   797
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   798
--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
   799
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
   800
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   801
	then
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   802
		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
   803
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   804
			CS.TEMP_VALUE=1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   805
			CS.SABOTAGE_HOGS[hog]=1
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   806
			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
   807
			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
   808
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   809
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   810
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   811
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   812
--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
   813
function KerguelenSpecialBlueCheck(hog)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   814
	if(GetGearType(hog) == gtHedgehog and hog ~= CurrentHedgehog and GetHealth(CurrentHedgehog) and gearIsInCircle(hog,GetX(CurrentHedgehog), GetY(CurrentHedgehog), 500, false))
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   815
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   816
		CS.TEMP_VALUE=1
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   817
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   818
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   819
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   820
--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
   821
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
   822
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   823
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   824
		local dmg=div(6*CS.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
   825
		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
   826
		then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   827
			if(GetHealth(hog) > dmg)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   828
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   829
				CS.TEMP_VALUE=CS.TEMP_VALUE+div(dmg*CS.VAMPIRIC_IS_ON,100)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   830
				SetHealth(hog, GetHealth(hog)-dmg)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   831
			else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   832
				CS.TEMP_VALUE=CS.TEMP_VALUE+div(GetHealth(hog)*CS.VAMPIRIC_IS_ON,100)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   833
				SetHealth(hog, 0)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   834
			end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   835
			HogOuch(hog, "moan")
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   836
			ShowDamageTag(hog,dmg)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
   837
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   838
			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
   839
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   840
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   841
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   842
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   843
--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
   844
function SouthAmericaSpecialCheeseExplosion(hog)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   845
	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
   846
	then
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   847
		local power_radius_outer=230
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   848
		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
   849
		local hypo=0
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   850
		if(gearIsInCircle(hog,GetX(CS.TEMP_VALUE), GetY(CS.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
   851
		then
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   852
			if(hog == CurrentHedgehog)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   853
			then
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   854
				SetState(CurrentHedgehog, gstMoving)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   855
			end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   856
			SetGearPosition(hog, GetX(hog),GetY(hog)-3)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   857
			hypo=Norm(math.abs(GetX(hog)-GetX(CS.TEMP_VALUE)),math.abs(GetY(hog)-GetY(CS.TEMP_VALUE)))
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   858
			SetGearVelocity(hog, div((power_radius_outer-hypo)*power_sa*GetIfNegative(GetX(hog)-GetX(CS.TEMP_VALUE)),power_radius_outer), div((power_radius_outer-hypo)*power_sa*GetIfNegative(GetY(hog)-GetY(CS.TEMP_VALUE)),power_radius_outer))
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   859
		end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   860
	end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   861
end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   862
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   863
--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
   864
function NorthAmericaSpecialSniper(hog)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
   865
	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
   866
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   867
		if(gearIsInCircle(CS.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
   868
		then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   869
			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
   870
			PlaySound(sndBump)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   871
			SetSoundMask(sndMissed, true)
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   872
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   873
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   874
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   875
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
   876
--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
   877
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
   878
	if(GetGearType(hog) == gtHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   879
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   880
		if(gearIsInCircle(CS.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
   881
		then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   882
			local healthadd=15
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   883
			HealHog(hog, healthadd+(div(healthadd*CS.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
   884
			SetEffect(hog, hePoisoned, false)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   885
			CS.SABOTAGE_HOGS[hog]=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   886
			SetSoundMask(sndMissed, true)
7895
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
   887
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   888
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
   889
end
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   890
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   891
--a weaponset string to something readable by the script
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   892
function transferableParamToWeaponSet(string,icon)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   893
	local continentinfo={}
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   894
	local numb=0
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   895
	local wepcodes=0
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   896
	local where=0
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   897
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   898
	local x=0
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   899
	local i=1
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   900
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   901
	--default icon
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   902
	continentinfo[4]={}
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   903
	if(icon==1000)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   904
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   905
		local mid=table.maxn(CS.WEAPONS_DAMAGE)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   906
		local max=mid+table.maxn(CS.WEAPONS_SUPPORT)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   907
		local ic=(string.byte(string) % max)+1
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   908
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   909
		if(ic>mid)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   910
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   911
			ic=CS.WEAPONS_SUPPORT[ic-mid][1]
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   912
		else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   913
			ic=CS.WEAPONS_DAMAGE[ic][1]
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   914
		end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   915
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   916
		continentinfo[4][1]=ic
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   917
		continentinfo[4][2]=-ic
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   918
	else
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   919
		continentinfo[4][1]=icon
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   920
		continentinfo[4][2]=-icon
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   921
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   922
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   923
	continentinfo[6]={sndFrozenHogImpact,sndUhOh}
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   924
	continentinfo[7]=100
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   925
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   926
	for c in string:gmatch"."
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   927
	do
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   928
		--first part, eg name of the weaponset
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   929
		if(where==0)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   930
		then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   931
			if(string.byte(c)==126)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   932
			then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   933
				continentinfo[1]=string.sub(string,0,numb)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   934
				wepcodes=numb
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   935
				where=1
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   936
			end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   937
		--second part, subname of the weaponset
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   938
		elseif(where==1)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   939
		then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   940
			if(string.byte(c)==126)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   941
			then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   942
				continentinfo[2]=string.sub(string,wepcodes+2,numb)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   943
				continentinfo[5]={}
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   944
				wepcodes=numb
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   945
				where=2
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   946
			end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   947
		--insert all weapons
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   948
		elseif(where==2)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   949
		then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   950
			x=string.byte(c)-35
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   951
			if(x>90)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   952
			then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   953
				break
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   954
			elseif(x>80)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   955
			then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   956
				if(x-80<10)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   957
				then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   958
					i=x-80
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   959
				else
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   960
					i=100
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   961
				end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   962
			else
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   963
				table.insert(continentinfo[5],{x,i})
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   964
			end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   965
		end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   966
		numb=numb+1
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   967
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   968
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   969
	if(continentinfo[5]~=nil and continentinfo[5][1]~=nil)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   970
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   971
		continentinfo[3] =
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   972
			string.format(loc("%s was extracted from the scheme"), continentinfo[1])
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   973
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   974
		table.insert(CS.CONTINENT_INFORMATION, continentinfo)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   975
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   976
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   977
	return nil
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   978
end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   979
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   980
--add a weaponset from a hogname
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   981
function HogNameToWeaponset(hog)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   982
	if(GetGearType(hog) == gtHedgehog)
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
   983
	then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   984
		local string=GetHogName(hog)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   985
		local numb=0
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   986
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   987
		for c in string:gmatch"."
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   988
		do
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   989
			if(string.byte(c)==126)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   990
			then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   991
				local name=string.sub(string,0,numb)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   992
				SetHogName(hog,name)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   993
				local weaponcode=string.sub(string,numb+2)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   994
				local continentinfo=transferableParamToWeaponSet(weaponcode,1000)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   995
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   996
				if(continentinfo~=nil)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   997
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
   998
					table.insert(CS.CONTINENT_INFORMATION, continentinfo)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
   999
				end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1000
				return
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1001
			end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1002
			numb=numb+1
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1003
		end
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1004
	end
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1005
end
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1006
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1007
--============================================================================
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1008
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1009
--Parameters -> [options],[global-continent]
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1010
--wt=yes			allow to search for weaponsets on hog names
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1011
--spec=off		disable specials (will make stuff unbalanced)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1012
--cont=no		remove the pre-defined continents
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1013
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1014
--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
  1015
--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
  1016
--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
  1017
function onParameters()
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1018
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1019
	local searchfor="wt=yes"
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1020
	local match=string.find(ScriptParam,searchfor, 1)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1021
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1022
	if(match~=nil)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1023
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1024
		CS.TEMP_VALUE=1
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1025
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1026
		ScriptParam=string.gsub(ScriptParam,"(,?)"..searchfor.."(,?)","")
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1027
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1028
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1029
	searchfor="spec=off"
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1030
	match=string.find(ScriptParam,searchfor, 1)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1031
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1032
	if(match~=nil)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1033
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1034
		CS.OPTION_NO_SPECIALS=true
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1035
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1036
		ScriptParam=string.gsub(ScriptParam,"(,?)"..searchfor.."(,?)","")
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
	searchfor="cont=no"
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1040
	match=string.find(ScriptParam,searchfor, 1)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1041
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1042
	if(match~=nil)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1043
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1044
		CS.CONTINENT_INFORMATION={}
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1045
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1046
		ScriptParam=string.gsub(ScriptParam,"(,?)"..searchfor.."(,?)","")
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1047
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1048
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1049
	if(ScriptParam~=nil)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1050
	then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1051
		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
  1052
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1053
		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
  1054
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1055
			table.insert(CS.CONTINENT_INFORMATION, continentinfo)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1056
		end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1057
	end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1058
end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1059
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1060
--set each weapons settings
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1061
function onAmmoStoreInit()
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1062
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1063
	SetAmmo(amSkip, 9, 0, 0, 0)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1064
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1065
	for v,w in pairs(CS.WEAPONS_DAMAGE)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1066
	do
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1067
		SetAmmo(w[1], w[2], w[3], w[4], w[5])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1068
	end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1069
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1070
	for v,w in pairs(CS.WEAPONS_SUPPORT)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1071
	do
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1072
		SetAmmo(w[1], w[2], w[3], w[4], w[5])
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1073
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1074
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1075
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1076
function SetCSAmmoDescriptions(mode)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1077
	if mode == "continents" then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1078
		for c=1, #CS.CONTINENT_INFORMATION do
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1079
			local cont = CS.CONTINENT_INFORMATION[c]
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1080
			local hp = string.format(loc("Initial health: %d"), cont[7])
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1081
			SetAmmoTexts(cont[4][1], cont[1], cont[2], hp .."|" .. cont[3])
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1082
			SetAmmoDescriptionAppendix(cont[4][1], nil)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1083
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1084
		SetAmmoTexts(amSwitch, loc("Random continent"), loc("If you just don't care …"), loc("Select this item for a random continent."))
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1085
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1086
	elseif mode == "weapons" then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1087
		local specSelect = loc("Switch: Select weapon special")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1088
		local specHeader = loc("Available weapon specials:")
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1089
		local specText="|"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1090
			specSelect.."| |"..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1091
			specHeader.."|"
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1092
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1093
		SetAmmoDescriptionAppendix(amSniperRifle,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1094
			specText..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1095
			CS.SNIPER_SPECIAL_INFO)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1096
		SetAmmoDescriptionAppendix(amBaseballBat,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1097
			specText..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1098
			CS.BASEBALLBAT_BOOMERANG_INFO .. "|" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1099
			CS.BASEBALLBAT_CRICKET_INFO .. "|" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1100
			loc("These weapon specials cannot be used close to other hogs."))
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1101
		SetAmmoDescriptionAppendix(amGasBomb,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1102
			specText..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1103
			CS.CHEESE_SPECIAL_INFO)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1104
		SetAmmoDescriptionAppendix(amSeduction,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1105
			specSelect .. "|" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1106
			CS.INVULNERABLE_SPECIAL_CTRL .. "| |" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1107
			specHeader .. "|" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1108
			CS.SEDUCTION_SPECIAL_INFO .. "|" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1109
			CS.INVULNERABLE_SPECIAL_INFO)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1110
		SetAmmoDescriptionAppendix(amParachute,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1111
			loc("Switch: Drop ball of dirt from parachute (once)") .. "| |" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1112
			specHeader .. "|" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1113
			CS.PARACHUTE_SPECIAL_INFO)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1114
		SetAmmoDescriptionAppendix(amHammer,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1115
			specText..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1116
			CS.HAMMER_ROAR_INFO .. "|" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1117
			CS.HAMMER_SWAP_INFO .. "|" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1118
			CS.HAMMER_LONELY_INFO .. "|" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1119
			CS.HAMMER_SABOTAGE_INFO)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1120
		SetAmmoDescriptionAppendix(amSMine,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1121
			specText..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1122
			CS.STICKY_PROJECTILE_INFO .. "|" ..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1123
			CS.STICKY_NAPALM_INFO)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1124
		SetAmmoDescriptionAppendix(amShotgun,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1125
			specText..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1126
			CS.SHOTGUN_SPECIAL_INFO)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1127
		SetAmmoDescriptionAppendix(amMolotov,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1128
			specText..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1129
			CS.MOLOTOV_SPECIAL_INFO)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1130
		SetAmmoDescriptionAppendix(amPickHammer,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1131
			specText..
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1132
			CS.PICKHAMMER_SPECIAL_INFO)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1133
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1134
		for c=1, #CS.CONTINENT_INFORMATION do
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1135
			local cont = CS.CONTINENT_INFORMATION[c]
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1136
			SetAmmoTexts(cont[4][1], nil, nil, nil)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1137
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1138
		SetAmmoTexts(amSwitch, nil, nil, nil)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1139
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1140
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1141
	if mode == "continents" or not CS.GAME_STARTED then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1142
		SetAmmoTexts(amSkip, loc("Select continent"), loc("Continent selection"), loc("Select the current continent.") .. "|" .. loc("Choose your continent wisely, as your decision will be permanent.") .. "|" .. loc("Up/Down: Browse through continents") .. "|" .. loc("Attack: Select this continent"))
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1143
	else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1144
		SetAmmoTexts(amSkip, nil, nil, nil)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1145
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1146
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1147
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1148
--on game start
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1149
function onGameStart()
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1150
	ShowMission(loc("Continental supplies"),loc("Let a continent provide your weapons!"),GeneralInformation(), 0, 0)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1151
	SetCSAmmoDescriptions("continents")
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1152
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1153
	if(CS.TEMP_VALUE==1)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1154
	then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1155
		runOnGears(HogNameToWeaponset)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1156
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1157
end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1158
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1159
function onGameInit()
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1160
	SuddenDeathTurns= SuddenDeathTurns+1
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1161
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1162
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1163
--what happen when a turn starts
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1164
function onNewTurn()
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1165
	--will refresh the info on each tab weapon
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1166
	CS.AUSTRALIAN_SPECIAL=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1167
	CS.AFRICAN_SPECIAL_SEDUCTION=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1168
	CS.SEDUCTION_INCREASER=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1169
	CS.SOUTH_AMERICAN_SPECIAL=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1170
	CS.AFRICAN_SPECIAL_STICKY=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1171
	CS.KERGUELEN_SPECIAL=1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1172
	CS.NORTH_AMERICAN_SPECIAL_SNIPER=1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1173
	CS.NORTH_AMERICAN_SPECIAL_SHOTGUN=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1174
	CS.NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1175
	CS.EUROPE_SPECIAL=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1176
	CS.VAMPIRIC_IS_ON=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1177
	CS.EXTRA_DAMAGE_IS_ON=100
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1178
	CS.SABOTAGE_COUNTER=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1179
	CS.ANTARCTICA_SPECIAL=0
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1180
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1181
	CS.TEMP_VALUE=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1182
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1183
	CS.SUNDALAND_END_HOG_CONTINENT_NAME=GetHogTeamName(CurrentHedgehog)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1184
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1185
	if TotalRounds >= 1 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1186
		CS.GAME_STARTED = true
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1187
	end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1188
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1189
	SetSoundMask(sndLaugh, false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1190
	SetSoundMask(sndMissed, false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1191
	CS.AFRICAN_SPECIAL_NON_PROJECTILE_USED=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1192
	SetAttackState(true)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1193
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1194
	--when all hogs are "placed"
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1195
	if(GetCurAmmoType()~=amTeleport)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1196
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1197
		--will run once when the game really starts (after placing hogs and so on
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1198
		if(CS.INIT_TEAMS[GetHogTeamName(CurrentHedgehog)] == nil)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1199
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1200
			SetInputMask(band(GetInputMask(), gmWeapon))
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1201
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1202
			if(CS.START_TIME==0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1203
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1204
				CS.START_TIME=TurnTimeLeft
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1205
				CS.HOG_HEALTH=GetHealth(CurrentHedgehog)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1206
			end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1207
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1208
			TurnTimeLeft=100000
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1209
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1210
			AddCaption(string.format(CS.SELECT_WEP_INFORMATION_SHORT, GetHogTeamName(CurrentHedgehog)), 0xFFFFFFFF, capgrpGameState)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1211
			AddCaption(loc("No continent selected"), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1212
			CS.SELECT_CONTINENT_CHECK=true
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1213
			ShowMission(loc("Continental supplies"),loc("Let a continent provide your weapons!"),GeneralInformation(), 0, 0)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1214
			SetCSAmmoDescriptions("continents")
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1215
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1216
			InitWeaponsMenu(CurrentHedgehog)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1217
			CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1218
			CS.INIT_TEAMS[GetHogTeamName(CurrentHedgehog)] = 2
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1219
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1220
		else
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1221
			--if its not the initialization turn
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1222
			CS.SELECT_CONTINENT_CHECK=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1223
			SetInputMask(bor(GetInputMask(), bnot(gmWeapon)))
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1224
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1225
			if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1226
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1227
				CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.maxn(CS.CONTINENT_INFORMATION))+1
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1228
				SetContinentWeapons()
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1229
			end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1230
			local currCont=CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1231
			local checkDefCont=CS.CONTINENT_INFORMATION[currCont][4][2]
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1232
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1233
			--give zeelandia-teams new weapons so they can plan for the next turn
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1234
			-- Use temporary value to store list of collected weapons
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1235
			CS.TEMP_VALUE = {}
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1236
			runOnGears(RandomContinentsGetWeapons)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1237
			for hog, ammoList in pairs(CS.TEMP_VALUE) do
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1238
				CollectMultiAmmo(hog, ammoList, true)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1239
			end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1240
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1241
			--some specials for some continents (CS.TEMP_VALUE is from get random weapons)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1242
			if(checkDefCont==9)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1243
			then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1244
				setTeamValue(GetHogTeamName(CurrentHedgehog), "rand-done-turn", false)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1245
			elseif(checkDefCont==7)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1246
			then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1247
				--this will be set on the second turn
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1248
				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick")==nil)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1249
				then
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1250
					setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick", 1)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1251
				end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1252
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1253
				-- Antarctic summer
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1254
				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick")>=4)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1255
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1256
					CollectMultiAmmo(CurrentHedgehog, {[amPortalGun] = 1, [amSineGun] = 2, [amGirder] = 1, [amSnowball] = 1})
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1257
					setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick", 0)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1258
				end
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1259
				setTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick", getTeamValue(GetHogTeamName(CurrentHedgehog), "Antarctica2-turntick")+1)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1260
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1261
			elseif(checkDefCont==5)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1262
			then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1263
				--this will be set on the second turn
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1264
				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick")==nil)
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1265
				then
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1266
					setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", 1)
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1267
				end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1268
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1269
				if(getTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick")>=2)
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1270
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1271
					CollectMultiAmmo(CurrentHedgehog, {[amParachute] = 1})
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1272
					setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", 0)
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1273
				end
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1274
				setTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick", getTeamValue(GetHogTeamName(CurrentHedgehog), "Asia-turntick")+1)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1275
			elseif(checkDefCont==1)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1276
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1277
				CS.TEMP_VALUE=0
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1278
				runOnGears(CountHogsInTeam)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1279
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1280
				if(CS.TEMP_VALUE>1)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1281
				then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1282
					AddAmmo(CurrentHedgehog,amSwitch,GetAmmoCount(CurrentHedgehog, amSwitch)+1)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1283
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1284
					SetWeapon(amSwitch)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1285
					CS.TEMP_VALUE=87
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1286
				end
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1287
			end
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1288
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1289
			ShowContinentInfo(currCont,-1,true)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1290
			SetCSAmmoDescriptions("weapons")
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1291
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1292
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1293
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1294
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1295
function ShowSpecialWeaponCaption(ammoType)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1296
	--place mine (australia)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1297
	if(ammoType == amBaseballBat)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1298
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1299
		if(CS.AUSTRALIAN_SPECIAL==1)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1300
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1301
			AddCaption(CS.BASEBALLBAT_CRICKET_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1302
		elseif(CS.AUSTRALIAN_SPECIAL==2)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1303
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1304
			AddCaption(CS.BASEBALLBAT_BOOMERANG_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1305
		else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1306
			AddCaption(GetAmmoName(amBaseballBat), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1307
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1308
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1309
	--africa
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1310
	elseif(ammoType == amSeduction)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1311
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1312
		if(CS.AFRICAN_SPECIAL_SEDUCTION==1)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1313
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1314
			AddCaption(CS.SEDUCTION_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1315
			AddCaption(string.format(CS.INVULNERABLE_SPECIAL_CAPTION, CS.SEDUCTION_INCREASER, GetAmmoCount(CurrentHedgehog,amInvulnerable)), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmostate)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1316
		else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1317
			AddCaption(GetAmmoName(amSeduction), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1318
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1319
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1320
	--south america
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1321
	elseif(ammoType == amGasBomb)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1322
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1323
		if(CS.SOUTH_AMERICAN_SPECIAL==true)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1324
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1325
			AddCaption(CS.CHEESE_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1326
		else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1327
			AddCaption(GetAmmoName(amGasBomb), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1328
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1329
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1330
	--africa
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1331
	elseif(ammoType == amSMine)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1332
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1333
		if(CS.AFRICAN_SPECIAL_STICKY==1)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1334
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1335
			AddCaption(CS.STICKY_PROJECTILE_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1336
		elseif(CS.AFRICAN_SPECIAL_STICKY == 2)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1337
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1338
			AddCaption(CS.STICKY_NAPALM_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1339
		else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1340
			AddCaption(GetAmmoName(amSMine), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1341
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1342
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1343
	--north america (sniper)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1344
	elseif(ammoType == amSniperRifle and CS.NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON==false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1345
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1346
		if(CS.NORTH_AMERICAN_SPECIAL_SNIPER==1)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1347
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1348
			AddCaption(GetAmmoName(amSniperRifle), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1349
		elseif(CS.NORTH_AMERICAN_SPECIAL_SNIPER==2)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1350
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1351
			AddCaption(CS.SNIPER_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1352
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1353
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1354
	--north america (shotgun)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1355
	elseif(ammoType == amShotgun)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1356
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1357
		if(CS.NORTH_AMERICAN_SPECIAL_SHOTGUN==true)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1358
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1359
			AddCaption(CS.SHOTGUN_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1360
		else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1361
			AddCaption(GetAmmoName(amShotgun), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1362
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1363
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1364
	--europe
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1365
	elseif(ammoType == amMolotov)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1366
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1367
		if(CS.EUROPE_SPECIAL==1)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1368
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1369
			AddCaption(CS.MOLOTOV_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1370
		else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1371
			AddCaption(GetAmmoName(amMolotov), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1372
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1373
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1374
	--antarctica
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1375
	elseif(ammoType == amPickHammer)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1376
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1377
		if(CS.ANTARCTICA_SPECIAL==1)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1378
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1379
			AddCaption(CS.PICKHAMMER_SPECIAL_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1380
		else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1381
			AddCaption(GetAmmoName(amPickHammer), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1382
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1383
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1384
	--kerguelen
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1385
	elseif(ammoType == amHammer)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1386
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1387
		if(CS.KERGUELEN_SPECIAL==1)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1388
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1389
			AddCaption(GetAmmoName(amHammer), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1390
		elseif(CS.KERGUELEN_SPECIAL==2)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1391
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1392
			AddCaption(CS.HAMMER_ROAR_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1393
		elseif(CS.KERGUELEN_SPECIAL==3)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1394
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1395
			AddCaption(CS.HAMMER_SWAP_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1396
		elseif(CS.KERGUELEN_SPECIAL==5)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1397
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1398
			AddCaption(CS.HAMMER_LONELY_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1399
		elseif(CS.KERGUELEN_SPECIAL==6)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1400
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1401
			AddCaption(CS.HAMMER_SABOTAGE_NAME, GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1402
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1403
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1404
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1405
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1406
function onPrecise()
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1407
	CS.PRECISE = true
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1408
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1409
function onPreciseUp()
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1410
	CS.PRECISE = false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1411
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1412
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1413
--what happens when you press "tab" (common button)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1414
function onSwitch()
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1415
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1416
	if(CS.SWITCH_HOG_IS_ON==false)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1417
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1418
		if(CS.OPTION_NO_SPECIALS==false and CS.SELECT_CONTINENT_CHECK==false and
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1419
		band(GetState(CurrentHedgehog), gstAttacked) == 0 and
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1420
		band(GetState(CurrentHedgehog), gstHHDriven) ~= 0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1421
		then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1422
			--place mine (australia)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1423
			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
  1424
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1425
				CS.AUSTRALIAN_SPECIAL = CS.AUSTRALIAN_SPECIAL + 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1426
				CS.AUSTRALIAN_SPECIAL = CS.AUSTRALIAN_SPECIAL % 3
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1427
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1428
				SetAttackState(CS.AUSTRALIAN_SPECIAL == 0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1429
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1430
			--Asian special
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1431
			elseif(CS.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
  1432
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1433
				local asiabomb=AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)+3, gtSnowball, 0, 0, 0, 0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1434
				SetGearMessage(asiabomb, 1)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1435
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1436
				CS.PARACHUTE_IS_ON=2
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1437
				CS.SELECT_CONTINENT_CHECK=false
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1438
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1439
			--africa
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1440
			elseif(GetCurAmmoType() == amSeduction)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1441
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1442
				if(CS.AFRICAN_SPECIAL_SEDUCTION==0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1443
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1444
					CS.AFRICAN_SPECIAL_SEDUCTION = 1
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1445
				else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1446
					CS.AFRICAN_SPECIAL_SEDUCTION = 0
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1447
				end
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1448
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1449
			--south america
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1450
			elseif(GetCurAmmoType() == amGasBomb)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1451
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1452
				if(CS.SOUTH_AMERICAN_SPECIAL==false)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1453
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1454
					CS.SOUTH_AMERICAN_SPECIAL = true
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1455
				else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1456
					CS.SOUTH_AMERICAN_SPECIAL = false
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1457
				end
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1458
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1459
			--africa
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1460
			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
  1461
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1462
				CS.AFRICAN_SPECIAL_STICKY = CS.AFRICAN_SPECIAL_STICKY + 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1463
				CS.AFRICAN_SPECIAL_STICKY = CS.AFRICAN_SPECIAL_STICKY % 3
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1464
				SetSoundMask(sndLaugh, CS.AFRICAN_SPECIAL_STICKY ~= 0)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1465
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1466
			--north america (sniper)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1467
			elseif(GetCurAmmoType() == amSniperRifle and CS.NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON==false)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1468
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1469
				if(CS.NORTH_AMERICAN_SPECIAL_SNIPER==2)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1470
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1471
					CS.NORTH_AMERICAN_SPECIAL_SNIPER = 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1472
				elseif(CS.NORTH_AMERICAN_SPECIAL_SNIPER==1)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1473
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1474
					CS.NORTH_AMERICAN_SPECIAL_SNIPER = 2
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1475
				end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1476
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1477
			--north america (shotgun)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1478
			elseif(GetCurAmmoType() == amShotgun)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1479
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1480
				if(CS.NORTH_AMERICAN_SPECIAL_SHOTGUN==false)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1481
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1482
					CS.NORTH_AMERICAN_SPECIAL_SHOTGUN = true
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1483
				else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1484
					CS.NORTH_AMERICAN_SPECIAL_SHOTGUN = false
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1485
				end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1486
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1487
			--europe
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1488
			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
  1489
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1490
				if(CS.EUROPE_SPECIAL==0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1491
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1492
					CS.EUROPE_SPECIAL = 1
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1493
				else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1494
					CS.EUROPE_SPECIAL = 0
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1495
				end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1496
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1497
			--antarctica
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1498
			elseif(GetCurAmmoType() == amPickHammer)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1499
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1500
				if(CS.ANTARCTICA_SPECIAL==0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1501
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1502
					CS.ANTARCTICA_SPECIAL = 1
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1503
				else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1504
					CS.ANTARCTICA_SPECIAL = 0
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1505
				end
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1506
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1507
			--kerguelen
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1508
			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
  1509
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1510
				if(CS.KERGUELEN_SPECIAL==6)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1511
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1512
					CS.KERGUELEN_SPECIAL = 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1513
				elseif(CS.KERGUELEN_SPECIAL==1)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1514
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1515
					CS.KERGUELEN_SPECIAL = 2
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1516
				elseif(CS.KERGUELEN_SPECIAL==2)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1517
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1518
					CS.KERGUELEN_SPECIAL = 3
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1519
				elseif(CS.KERGUELEN_SPECIAL==3)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1520
				then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1521
					CS.KERGUELEN_SPECIAL = 5
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1522
				elseif(CS.KERGUELEN_SPECIAL==5)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1523
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1524
					CS.KERGUELEN_SPECIAL = 6
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1525
				end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1526
				SetAttackState(CS.KERGUELEN_SPECIAL == 1)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1527
			end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1528
			ShowSpecialWeaponCaption(GetCurAmmoType())
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1529
		end
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1530
		--for selecting weaponset, this is mostly for old players.
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1531
		-- Switch: Next continent
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1532
		-- Precise+Switch: Previous continent
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1533
		TrySelectNextContinent(CS.PRECISE)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1534
	--if switching out from sabotage.
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1535
	elseif(CS.SABOTAGE_HOGS[CurrentHedgehog]~=nil and CS.SABOTAGE_HOGS[CurrentHedgehog]==2)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1536
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1537
		CS.SABOTAGE_HOGS[CurrentHedgehog]=1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1538
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1539
end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1540
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1541
function TrySelectNextContinent(reverse)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1542
	local direction = 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1543
	if reverse then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1544
		direction = -1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1545
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1546
	if(GetHogLevel(CurrentHedgehog)==0 and CS.SELECT_CONTINENT_CHECK==true and (GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing))
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1547
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1548
		CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)] + direction
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1549
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1550
		if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]> table.maxn(CS.CONTINENT_INFORMATION))
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1551
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1552
			CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=1
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1553
		end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1554
		if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]<=0)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1555
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1556
			CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=table.maxn(CS.CONTINENT_INFORMATION)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1557
		end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1558
		SetContinentWeapons()
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1559
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1560
		PlaySound(sndSwitchHog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1561
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1562
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1563
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1564
function onUp()
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1565
	--swap forward in the weaponmenu (1.0 style)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1566
	TrySelectNextContinent(false)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1567
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1568
	if(GetCurAmmoType() == amSeduction and CS.AFRICAN_SPECIAL_SEDUCTION == 1 and GetAmmoCount(CurrentHedgehog,amInvulnerable)>0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1569
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1570
		CS.SEDUCTION_INCREASER=CS.SEDUCTION_INCREASER+7
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1571
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1572
		RemoveWeapon(CurrentHedgehog,amInvulnerable)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1573
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1574
		AddCaption(string.format(CS.INVULNERABLE_SPECIAL_CAPTION, CS.SEDUCTION_INCREASER, GetAmmoCount(CurrentHedgehog,amInvulnerable)), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmostate)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1575
	end
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1576
end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1577
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1578
function onDown()
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1579
	--swap backwards in the weaponmenu (1.0 style)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1580
	TrySelectNextContinent(true)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1581
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1582
	if(GetCurAmmoType() == amSeduction and CS.AFRICAN_SPECIAL_SEDUCTION == 1 and CS.SEDUCTION_INCREASER>0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1583
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1584
		CS.SEDUCTION_INCREASER=CS.SEDUCTION_INCREASER-7
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1585
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1586
		AddAmmo(CurrentHedgehog,amInvulnerable,GetAmmoCount(CurrentHedgehog, amInvulnerable)+1)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1587
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1588
		AddCaption(string.format(CS.INVULNERABLE_SPECIAL_CAPTION, CS.SEDUCTION_INCREASER, GetAmmoCount(CurrentHedgehog,amInvulnerable)), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmostate)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1589
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1590
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1591
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1592
-- Spawn sabotage smoke for inactive hogs (red smoke, more subtle than for active hogs)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1593
function SabotageSmokeInactive(gear)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1594
	if GetGearType(gear) == gtHedgehog and gear ~= CurrentHedgehog and CS.SABOTAGE_HOGS[gear]~=nil and CS.SABOTAGE_HOGS[gear]>=1 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1595
		local vg = AddVisualGear(GetX(gear), GetY(gear), vgtSmokeWhite, 0, false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1596
		SetVisualGearValues(vg, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xFF8080B0)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1597
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1598
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1599
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1600
function ShowContinentLabel()
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1601
	if CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)] == 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1602
		AddCaption(loc("Random continent"), GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1603
	else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1604
		AddCaption(CS.CONTINENT_INFORMATION[CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]][1], GetClanColor(GetHogClan(CurrentHedgehog)), capgrpAmmoinfo)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1605
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1606
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1607
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1608
function onGameTick()
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1609
	-- This is a trick to show the continent label delayed by 1 tick
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1610
	if CS.CONTINENT_LABEL_TIMER > 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1611
		CS.CONTINENT_LABEL_TIMER = CS.CONTINENT_LABEL_TIMER - 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1612
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1613
	if CS.CONTINENT_LABEL_TIMER == 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1614
		ShowContinentLabel()
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1615
		CS.CONTINENT_LABEL_TIMER = -1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1616
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1617
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1618
	if CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER > 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1619
		CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER = CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER - 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1620
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1621
	if CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER == 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1622
		HandleSpecialWeaponMisc()
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1623
		CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER = -1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1624
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1625
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1626
	-- See onAttack()
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1627
	if CS.CONFIRM_CONTINENT_SELECTION > 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1628
		CS.CONFIRM_CONTINENT_SELECTION = CS.CONFIRM_CONTINENT_SELECTION - 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1629
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1630
	if CS.CONFIRM_CONTINENT_SELECTION == 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1631
		CS.SELECT_CONTINENT_CHECK=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1632
		EndTurnCS(0)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1633
		PlaySound(sndPlaced)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1634
		ShowContinentLabel()
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1635
		CS.CONFIRM_CONTINENT_SELECTION = -1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1636
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1637
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1638
	if GameTime % 600 == 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1639
		runOnGears(SabotageSmokeInactive)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1640
	end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1641
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1642
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1643
function onGameTick20()
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1644
	--if you picked a weaponset from the weaponmenu (icon)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1645
	if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1646
	then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1647
		if(GetCurAmmoType()==amSwitch)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1648
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1649
			CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=GetRandom(table.maxn(CS.CONTINENT_INFORMATION))+1
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1650
			SetContinentWeapons()
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1651
			SetWeapon(amSkip)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1652
			PlaySound(sndMineTick)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1653
			CS.CONTINENT_LABEL_TIMER = 1
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1654
		else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1655
			for v,w in pairs(CS.CONTINENT_INFORMATION)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1656
			do
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1657
				if(GetCurAmmoType()==CS.CONTINENT_INFORMATION[v][4][1])
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1658
				then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1659
					CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]=v
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1660
					SetContinentWeapons()
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1661
					SetWeapon(amSkip)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1662
					PlaySound(CS.CONTINENT_INFORMATION[v][6][1])
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1663
					PlaySound(CS.CONTINENT_INFORMATION[v][6][2],CurrentHedgehog)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1664
					CS.CONTINENT_LABEL_TIMER = 1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1665
					break
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1666
				end
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1667
			end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1668
		end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1669
	end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1670
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1671
	--show the kerguelen ring
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1672
	if(CS.KERGUELEN_SPECIAL > 1 and GetCurAmmoType() == amHammer and
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1673
		band(GetState(CurrentHedgehog), gstAttacked) == 0 and
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1674
		band(GetState(CurrentHedgehog), gstHHDriven) ~= 0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1675
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1676
		if(CS.VISUAL_CIRCLE==nil)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1677
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1678
			CS.VISUAL_CIRCLE=AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtCircle, 0, true)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1679
		end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1680
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1681
		if(CS.KERGUELEN_SPECIAL == 2) --walrus scream
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1682
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1683
			SetVisualGearValues(CS.VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 120, 4, 0xff0000ee)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1684
		elseif(CS.KERGUELEN_SPECIAL == 3) --swap hog
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1685
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1686
			SetVisualGearValues(CS.VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 390, 3, 0xffff00ee)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1687
		elseif(CS.KERGUELEN_SPECIAL == 5) --cries
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1688
		then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1689
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1690
			CS.TEMP_VALUE=0
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1691
			runOnGears(KerguelenSpecialBlueCheck)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1692
			if(CS.TEMP_VALUE==0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1693
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1694
				SetVisualGearValues(CS.VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 1, 0x0000ffee)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1695
			else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1696
				SetVisualGearValues(CS.VISUAL_CIRCLE, GetX(CurrentHedgehog), GetY(CurrentHedgehog),20, 200, 0, 0, 100, 500, 10, 0x0000ffee)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1697
			end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1698
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1699
		elseif(CS.KERGUELEN_SPECIAL == 6) --sabotage
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1700
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1701
			SetVisualGearValues(CS.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
  1702
		end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1703
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1704
	elseif(CS.VISUAL_CIRCLE~=nil)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1705
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1706
		DeleteVisualGear(CS.VISUAL_CIRCLE)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1707
		CS.VISUAL_CIRCLE=nil
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1708
	end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1709
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1710
	--sabotage
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1711
	if(CS.SABOTAGE_HOGS[CurrentHedgehog]~=nil and CS.SABOTAGE_HOGS[CurrentHedgehog]>=1)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1712
	then
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1713
		--for sabotage
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1714
		if(CS.SABOTAGE_HOGS[CurrentHedgehog]==1)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1715
		then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1716
			AddCaption(loc("You are sabotaged, RUN!"))
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1717
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1718
			PlaySound(sndHellish)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1719
			--update the constant at the top also to something in between
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1720
			CS.SABOTAGE_FREQUENCY_NOW=CS.SABOTAGE_FREQUENCY
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1721
			SetGravity(CS.SABOTAGE_GRAVITY)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1722
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1723
			CS.SABOTAGE_HOGS[CurrentHedgehog]=2
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1724
		end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1725
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1726
		if(CS.SABOTAGE_COUNTER % 20 == 0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1727
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1728
			-- Sabotage effect (red smoke)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1729
			local vg = AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtSmokeWhite, 0, false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1730
			SetVisualGearValues(vg, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0xFF4040FF)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1731
		end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1732
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1733
		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
  1734
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1735
			CS.SABOTAGE_HOGS[CurrentHedgehog]=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1736
		elseif(CS.SABOTAGE_COUNTER >= CS.SABOTAGE_FREQUENCY_NOW)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1737
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1738
			-- Sabotage decreases hog health regularily,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1739
			-- but invulnerable protects.
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1740
			-- Also do not decrease health while retreating or attacking.
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1741
			if(GetEffect(CurrentHedgehog, heInvulnerable) == 0 and
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1742
			band(GetState(CurrentHedgehog), gstHHDriven) ~= 0 and
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1743
			band(GetState(CurrentHedgehog), gstAttacked+gstAttacking) == 0)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1744
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1745
				if(GetHealth(CurrentHedgehog)<=CS.SABOTAGE_DAMAGE)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1746
				then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1747
					-- All health lost! Sabotage is cruel.
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1748
					PlaySound(sndPoisonMoan, CurrentHedgehog)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1749
					SetHealth(CurrentHedgehog, 0)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1750
					CS.SABOTAGE_HOGS[CurrentHedgehog]=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1751
					-- Take away control so the hog can die in peace.
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1752
					SetState(CurrentHedgehog, band(GetState(CurrentHedgehog), bnot(gstHHDriven)))
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1753
				else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1754
					local newHealth = GetHealth(CurrentHedgehog)-CS.SABOTAGE_DAMAGE
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1755
					-- Start moaning if health is at a critical level
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1756
					if newHealth <= 16 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1757
						PlaySound(sndPoisonMoan, CurrentHedgehog)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1758
					elseif newHealth <= 32 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1759
						PlaySound(sndPoisonCough, CurrentHedgehog)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1760
					end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1761
					SetHealth(CurrentHedgehog, newHealth)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1762
				end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1763
				ShowDamageTag(CurrentHedgehog,CS.SABOTAGE_DAMAGE)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1764
			end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1765
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1766
			CS.SABOTAGE_COUNTER=0
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1767
		else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1768
			CS.SABOTAGE_COUNTER=CS.SABOTAGE_COUNTER+1
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1769
		end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1770
	elseif((GetGravity()==CS.SABOTAGE_GRAVITY or GetGravity()==CS.SABOTAGE_GRAVITY_LOW) and (CS.SABOTAGE_HOGS[CurrentHedgehog]==0 or CS.SABOTAGE_HOGS[CurrentHedgehog]==nil))
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1771
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1772
		-- Reset gravity
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1773
		SetGravity(100)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1774
	end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1775
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1776
	--enable switch (north america)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1777
	if(GetCurAmmoType() == amSwitch and CS.TEMP_VALUE==87)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1778
	then
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1779
		SetGearMessage(CurrentHedgehog,gmAttack)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1780
		CS.TEMP_VALUE=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1781
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1782
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1783
	if(CS.SPEECH_TIMER > 0) then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1784
		CS.SPEECH_TIMER = CS.SPEECH_TIMER - 20
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1785
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1786
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1787
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1788
function HandleSpecialWeaponMisc(ammoType)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1789
	if not ammoType then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1790
		ammoType = GetCurAmmoType()
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1791
	end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1792
	ShowSpecialWeaponCaption(ammoType)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1793
	if ammoType == amSMine and CS.AFRICAN_SPECIAL_STICKY ~= 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1794
		SetSoundMask(sndLaugh, true)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1795
	else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1796
		SetSoundMask(sndLaugh, false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1797
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1798
	if (ammoType == amHammer and CS.KERGUELEN_SPECIAL > 1) or (ammoType == amBaseballBat and CS.AUSTRALIAN_SPECIAL ~= 0) then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1799
		SetAttackState(false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1800
	else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1801
		SetAttackState(true)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1802
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1803
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1804
end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1805
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1806
--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
  1807
function onSlot(slot)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1808
	if(CS.TEAM_CONTINENT[GetHogTeamName(CurrentHedgehog)]==0)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1809
	then
12411
edeae7661dca Lua refactor: Replace ParseCommand('setweap… with SetWeapon
Wuzzy <almikes@aol.com>
parents: 11515
diff changeset
  1810
		SetWeapon(amSkip)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1811
	end
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1812
	if CS.GAME_STARTED then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1813
		-- Delay calling HandleSpecialWeaponMisc because
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1814
		-- the CurAmmoType is not updated yet.
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1815
		CS.HANDLE_SPECIAL_WEAPON_MISC_TIMER = 2
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1816
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1817
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1818
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1819
function onSetWeapon(ammoType)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1820
	if CS.GAME_STARTED then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1821
		HandleSpecialWeaponMisc(ammoType)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1822
	end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1823
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1824
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1825
--if you used hogswitch or any similar weapon, dont enable any weaponchange
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1826
function onAttack()
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1827
	if(CS.SELECT_CONTINENT_CHECK==true)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1828
	then
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1829
		if(GetCurAmmoType() == amSkip or GetCurAmmoType() == amNothing)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1830
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1831
			SetWeapon(amNothing)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1832
			-- Delay the real continent selection so the SetWeapon
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1833
			-- has time to take effect.
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1834
			CS.CONFIRM_CONTINENT_SELECTION=2
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1835
		else
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1836
			SetWeapon(amSkip)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1837
		end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1838
	end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1839
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1840
	--african special
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1841
	if(CS.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
  1842
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1843
		EndTurnCS(3)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1844
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1845
		CS.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
  1846
		runOnGears(AfricaSpecialSeduction)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1847
		SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+CS.TEMP_VALUE)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1848
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1849
		--visual stuff
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1850
		VisualExplosion(250,GetX(CurrentHedgehog), GetY(CurrentHedgehog),vgtSmoke,vgtSmokeWhite)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1851
		PlaySound(sndParachute)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1852
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1853
		RemoveWeapon(CurrentHedgehog,amSeduction)
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1854
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1855
	elseif(CS.ANTARCTICA_SPECIAL == 1 and GetCurAmmoType() == amPickHammer and band(GetState(CurrentHedgehog),gstAttacked)==0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1856
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1857
		EndTurnCS(10)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1858
		SetGearPosition(CurrentHedgehog,GetX(CurrentHedgehog),0)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1859
		ParseCommand("hjump")
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1860
		SetGearVelocity(CurrentHedgehog, 0, 100000000)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1861
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1862
		PlaySound(sndPiano8)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1863
		PlaySound(sndWarp)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1864
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1865
		RemoveWeapon(CurrentHedgehog,amPickHammer)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1866
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1867
	--Kerguelen specials
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1868
	elseif(GetCurAmmoType() == amHammer and CS.KERGUELEN_SPECIAL > 1 and band(GetState(CurrentHedgehog),gstAttacked)==0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1869
	then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1870
		local escapetime=3
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1871
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1872
		--scream
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1873
		if(CS.KERGUELEN_SPECIAL == 2)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1874
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1875
			CS.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
  1876
			runOnGears(KerguelenSpecialRed)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1877
			HealHog(CurrentHedgehog, CS.TEMP_VALUE)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1878
			PlaySound(sndHellish)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1879
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1880
		--swap
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1881
		elseif(CS.KERGUELEN_SPECIAL == 3)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1882
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1883
			CS.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
  1884
			runOnGears(KerguelenSpecialYellowCountHogs)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1885
			if(CS.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
  1886
			then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1887
				CS.TEMP_VALUE=GetRandom(CS.TEMP_VALUE)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1888
				runOnGears(KerguelenSpecialYellowSwap)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1889
				PlaySound(sndPiano3)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1890
			else
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1891
				PlaySound(sndPiano6)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1892
			end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1893
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1894
		--cries
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1895
		elseif(CS.KERGUELEN_SPECIAL == 5)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1896
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1897
			CS.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
  1898
			runOnGears(KerguelenSpecialBlueCheck)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1899
			if(CS.TEMP_VALUE==0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1900
			then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1901
				AddGear(0, 0, gtWaterUp, 0, 0,0,0)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1902
				PlaySound(sndWarp)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1903
				PlaySound(sndMolotov)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1904
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1905
				runOnGears(KerguelenSpecialBlueActivate)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1906
				SetHealth(CurrentHedgehog, GetHealth(CurrentHedgehog)+CS.TEMP_VALUE)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1907
			else
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1908
				PlaySound(sndDenied)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1909
				escapetime = -1
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1910
				if CS.SPEECH_TIMER <= 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1911
					HogSay(CurrentHedgehog, loc("Hogs in sight!"), SAY_SAY)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1912
					CS.SPEECH_TIMER = 5000
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1913
				end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1914
			end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1915
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1916
		--flare/sabotage
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1917
		elseif(CS.KERGUELEN_SPECIAL == 6)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1918
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1919
			CS.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
  1920
			runOnGears(KerguelenSpecialGreen)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1921
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1922
			PlaySound(sndThrowRelease)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1923
			AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog)-20, gtCluster, 0, 0, -1000000, 32)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1924
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1925
			if(CS.TEMP_VALUE==1)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1926
			then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  1927
				escapetime=10
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  1928
			end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1929
		end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1930
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1931
		if escapetime >= 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1932
			EndTurnCS(escapetime)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1933
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1934
			DeleteVisualGear(CS.VISUAL_CIRCLE)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1935
			CS.VISUAL_CIRCLE=nil
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1936
			CS.KERGUELEN_SPECIAL=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1937
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1938
			RemoveWeapon(CurrentHedgehog,amHammer)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1939
		end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1940
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1941
	elseif(GetCurAmmoType() == amBaseballBat)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1942
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1943
		if CS.AUSTRALIAN_SPECIAL ~= 0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1944
		then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1945
			CS.TEMP_VALUE=0
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1946
			runOnGears(AustraliaSpecialCheckHogs)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1947
			if CS.TEMP_VALUE == 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1948
				SetGearMessage(CurrentHedgehog, bor(GetGearMessage(CurrentHedgehog), gmAttack))
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1949
			else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1950
				PlaySound(sndDenied)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1951
			end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1952
		end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1953
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1954
	elseif(GetCurAmmoType() == amVampiric)
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1955
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1956
		CS.VAMPIRIC_IS_ON=75
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1957
	elseif(GetCurAmmoType() == amExtraDamage)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1958
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1959
		CS.EXTRA_DAMAGE_IS_ON=150
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1960
	end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1961
end
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1962
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1963
function onHogAttack(ammoType)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1964
	-- When a sabotaged hog uses low gravity, overwrite the default low gravity,
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1965
	-- otherwise it would be too easy.
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1966
	if(ammoType == amLowGravity and CS.SABOTAGE_HOGS[CurrentHedgehog]~=nil and CS.SABOTAGE_HOGS[CurrentHedgehog]>=1)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1967
	then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1968
		SetGravity(CS.SABOTAGE_GRAVITY_LOW)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1969
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1970
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1971
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1972
function onGearAdd(gearUid)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1973
	CS.SELECT_CONTINENT_CHECK=false
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1974
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  1975
	--track the gears im using
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1976
	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
  1977
	then
ac1610a7b7fa apparently an older version was provided earlier and this one is newer and theoretically desync free. untested.
Vatten
parents: 7893
diff changeset
  1978
		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
  1979
	end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1980
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1981
	--remove gasclouds on gasbombspecial
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1982
	if(GetGearType(gearUid)==gtPoisonCloud and CS.SOUTH_AMERICAN_SPECIAL == true)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1983
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1984
		DeleteGear(gearUid)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  1985
	--african special
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1986
	elseif(GetGearType(gearUid)==gtSMine)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1987
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1988
		local vx,vy=GetGearVelocity(gearUid)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1989
		if(CS.AFRICAN_SPECIAL_STICKY == 1)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1990
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1991
			SetState(CurrentHedgehog, gstHHDriven+gstMoving)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1992
			SetGearPosition(CurrentHedgehog, GetX(CurrentHedgehog),GetY(CurrentHedgehog)-3)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1993
			SetGearVelocity(CurrentHedgehog, vx, vy)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1994
			PlaySound(sndJump2, CurrentHedgehog)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  1995
			DeleteGear(gearUid)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1996
			if (not CS.AFRICAN_SPECIAL_NON_PROJECTILE_USED) then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1997
				SetSoundMask(sndMissed, true)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  1998
			end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  1999
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2000
		elseif(CS.AFRICAN_SPECIAL_STICKY == 2)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2001
		then
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2002
			FireGear(CurrentHedgehog,gtNapalmBomb, vx, vy, 0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2003
			DeleteGear(gearUid)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2004
			CS.AFRICAN_SPECIAL_NON_PROJECTILE_USED=true
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2005
			SetSoundMask(sndMissed, false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2006
		else
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2007
			CS.AFRICAN_SPECIAL_NON_PROJECTILE_USED=true
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2008
			SetSoundMask(sndMissed, false)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2009
		end
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2010
	--north american special
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2011
	elseif(GetGearType(gearUid)==gtSniperRifleShot)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2012
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2013
		CS.NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=true
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2014
		if(CS.NORTH_AMERICAN_SPECIAL_SNIPER~=1)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2015
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2016
			SetHealth(gearUid, 1)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2017
			SetGearValues(gearUid, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 0)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2018
		end
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2019
	--north american special
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2020
	elseif(GetGearType(gearUid)==gtShotgunShot)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2021
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2022
		if(CS.NORTH_AMERICAN_SPECIAL_SHOTGUN==true)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2023
		then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2024
			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2025
			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2026
			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtFeather, 0, false)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2027
			PlaySound(sndBirdyLay)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2028
		end
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2029
	--european special
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2030
	elseif(GetGearType(gearUid)==gtMolotov and CS.EUROPE_SPECIAL==1)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2031
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2032
		local vx,vy=GetGearVelocity(gearUid)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2033
		local e_health=FireGear(CurrentHedgehog,gtCluster, vx, vy, 1)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2034
		SetGearMessage(e_health, 2)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2035
		DeleteGear(gearUid)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2036
	--australian specials
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2037
	elseif(GetGearType(gearUid)==gtShover and CS.AUSTRALIAN_SPECIAL~=0)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2038
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2039
		CS.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
  2040
		runOnGears(AustraliaSpecialCheckHogs)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  2041
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2042
		if(CS.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
  2043
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2044
			local vx,vy=GetGearVelocity(gearUid)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  2045
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2046
			if(CS.AUSTRALIAN_SPECIAL==1)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2047
			then
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2048
				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
  2049
				SetHealth(austmine, 100)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2050
				SetTimer(austmine, 1000)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2051
				PlaySound(sndLaugh, CurrentHedgehog)
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2052
			else
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2053
				local austmine=FireGear(CurrentHedgehog,gtBall, vx, vy, 1)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2054
				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
  2055
				SetGearMessage(austmine, 3)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2056
			end
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2057
		else
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2058
			PlaySound(sndDenied)
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2059
		end
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2060
	elseif(GetGearType(gearUid)==gtParachute)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2061
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2062
		CS.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
  2063
	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
  2064
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2065
		CS.SWITCH_HOG_IS_ON=true
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2066
	end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2067
end
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2068
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2069
function onGearDamage(gearUid, damage)
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2070
	if(gearUid==CurrentHedgehog and CS.SABOTAGE_HOGS[CurrentHedgehog]==1)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2071
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2072
		CS.SABOTAGE_HOGS[CurrentHedgehog]=0
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2073
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2074
end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2075
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2076
function onGearDelete(gearUid)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2077
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  2078
	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
  2079
	then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2080
		--sundaland special
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2081
		if(GetGearType(gearUid) == gtHedgehog and CS.TEAM_CONTINENT[CS.SUNDALAND_END_HOG_CONTINENT_NAME]==10)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2082
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2083
			local currvalue=getTeamValue(CS.SUNDALAND_END_HOG_CONTINENT_NAME, "sundaland-count")
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  2084
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2085
			if(currvalue==nil)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  2086
			then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2087
				currvalue=0
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  2088
			end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  2089
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2090
			setTeamValue(CS.SUNDALAND_END_HOG_CONTINENT_NAME, "sundaland-count", currvalue+1)
9805
1795c34ab8db Updated continental to the latest
Vatten
parents: 8618
diff changeset
  2091
		end
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2092
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2093
		trackDeletion(gearUid)
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2094
	end
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2095
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2096
	--if picking up a health crate, heal sabotage
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2097
	if(CS.SABOTAGE_HOGS[CurrentHedgehog]~=0 and GetGearType(gearUid) == gtCase and GetGearPos(gearUid)==2 and band(GetGearMessage(gearUid), gmDestroy) ~= 0)
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2098
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2099
		CS.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
  2100
	end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  2101
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  2102
	--north american lipstick
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2103
	if(GetGearType(gearUid)==gtSniperRifleShot )
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2104
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2105
		CS.NORTH_AMERICAN_SPECIAL_SNIPER_IS_ON=false
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2106
		if(CS.NORTH_AMERICAN_SPECIAL_SNIPER==2)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2107
		then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2108
			CS.TEMP_VALUE=gearUid
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2109
			runOnGears(NorthAmericaSpecialSniper)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2110
		end
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  2111
	--north american eagle eye
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2112
	elseif(GetGearType(gearUid)==gtShotgunShot and CS.NORTH_AMERICAN_SPECIAL_SHOTGUN==true)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2113
	then
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2114
		SetGearPosition(CurrentHedgehog, GetX(gearUid), GetY(gearUid)+7)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2115
		PlaySound(sndWarp)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2116
	--south american special
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2117
	elseif(GetGearType(gearUid)==gtGasBomb and CS.SOUTH_AMERICAN_SPECIAL == true)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2118
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2119
		if band(GetState(gearUid), gstDrowning) == 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2120
			CS.TEMP_VALUE=gearUid
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2121
			runOnGears(SouthAmericaSpecialCheeseExplosion)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2122
			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2123
		end
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  2124
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  2125
	--asian special
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2126
	elseif(GetGearType(gearUid)==gtSnowball and GetGearMessage(gearUid)==1)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2127
	then
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  2128
		AddGear(GetX(gearUid), GetY(gearUid), gtCluster, 0, 0, 0, 22)
10965
fb2b006ba476 merge git head and hg head
sheepluva
parents: 10956
diff changeset
  2129
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  2130
	--europe special
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2131
	elseif(GetGearType(gearUid)==gtCluster and GetGearMessage(gearUid)==2)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2132
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2133
		if band(GetState(gearUid), gstDrowning) == 0 then
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2134
			CS.TEMP_VALUE=gearUid
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2135
			runOnGears(EuropeSpecialMolotovHit)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2136
			VisualExplosion(100,GetX(gearUid), GetY(gearUid),vgtSmokeWhite,vgtSmokeWhite)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2137
			AddVisualGear(GetX(gearUid), GetY(gearUid), vgtExplosion, 0, false)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2138
			PlaySound(sndGraveImpact)
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2139
		end
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2140
	--australian special
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2141
	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
  2142
	then
13359
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2143
		SpawnRandomCrate(GetX(gearUid), GetY(gearUid))
7d772358dc22 Updated Continental supplies
Vatten
parents: 12940
diff changeset
  2144
8618
7e71dba4e7f3 avoid floating point desync, other script tweaks
Vatten
parents: 8043
diff changeset
  2145
	--asia (using para)
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2146
	elseif(GetGearType(gearUid)==gtParachute)
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2147
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2148
		CS.PARACHUTE_IS_ON=false
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2149
	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
  2150
	then
13360
e27540ad33bd Massive Continental supplies update
Wuzzy <Wuzzy2@mail.ru>
parents: 13359
diff changeset
  2151
		CS.SWITCH_HOG_IS_ON=false
7893
50e8f6714b22 new script specialising in altering weapon behaviour
Vatten
parents:
diff changeset
  2152
	end
7936
9f44e39d856c Script typos
nemo
parents: 7895
diff changeset
  2153
end
10956
80c3314f8123 Changed to continental supplies from the DLC, because its better :P
caf2 <florian.evaldsson@telia.com>
parents: 10527
diff changeset
  2154