share/hedgewars/Data/Scripts/Multiplayer/Highlander.lua
author nemo
Mon, 22 Oct 2012 22:30:03 -0400
changeset 7791 b937274608ba
parent 7139 a47fd17ba463
child 8043 da083f8d95e6
permissions -rw-r--r--
Completely arbitrary tweaking of tunnel values (avoids a nil) - still needs smooth curves (probably a target dx/dy to aim for, and slow alterations) and taking less CPU. Also disable unused function in Highlander
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
     1
--------------------------------
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
     2
-- HIGHLANDER / HOGS OF WAR
6820
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
     3
-- version 0.3c
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
     4
-- by mikade
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
     5
--------------------------------
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
     6
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
     7
-----------
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
     8
--0.1
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
     9
-----------
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    10
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    11
-- concept test
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    12
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    13
-----------
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    14
--0.2
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    15
-----------
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    16
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    17
-- remove tardis till Henek fixes his tracker
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    18
-- change wep crates to health crates
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    19
-- reset arb turntimevalue
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    20
-- include randomOrder
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    21
-- Until fixed .17 methods come out, remove switches and resurrector
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    22
-- on request, removed kamikaze and piano weapons
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    23
-- provisional fixing of bugs that can't actually be fixed yet
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    24
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    25
-----------
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    26
--0.3
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    27
-----------
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    28
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    29
-- meh, update incorrect display
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    30
-- may change this in the future to have switches
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    31
-- but for now people are used to it without, so~
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    32
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    33
-- mudball is now counted as a utility
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    34
6378
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    35
-----------
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    36
--0.3b
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    37
-----------
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    38
6378
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    39
-- cleaned up code and got rid of unneccessary vars
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    40
-- mudball is a weapon again
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    41
-- landgun is now a utility
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    42
-- extra time, vampirism utility removed
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    43
-- hammer wep removed
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    44
-- all hogs have kamikaze
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    45
6820
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    46
-----------
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    47
--0.3c
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    48
-----------
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    49
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    50
-- restructured some code
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    51
-- added napalm (whoops) to list of possible weapons you can get
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    52
-- hogs no longer recieve airstrike-related weps on border maps
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    53
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    54
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    55
loadfile(GetDataPath() .. "Scripts/Tracker.lua")()
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    56
6820
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    57
local airWeapons = 	{amAirAttack, amMineStrike, amNapalm, amDrillStrike --[[,amPiano]]}
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    58
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    59
local atkArray = 	{
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    60
					amBazooka, amBee, amMortar, amDrill, --[[amSnowball,]]
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    61
					amGrenade, amClusterBomb, amMolotov, amWatermelon, amHellishBomb, amGasBomb,
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    62
					amShotgun, amDEagle, amFlamethrower, amSniperRifle, amSineGun,
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    63
					amFirePunch, amWhip, amBaseballBat, --[[amKamikaze,]] amSeduction, --[[amHammer,]]
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    64
					amMine, amDynamite, amCake, amBallgun, amRCPlane, amSMine,
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    65
					amRCPlane, amSMine,
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    66
					amBirdy
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    67
					}
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    68
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    69
local utilArray = 	{
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    70
					amBlowTorch, amPickHammer, amGirder, amPortalGun,
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    71
					amRope, amParachute, amTeleport, amJetpack,
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    72
					amInvulnerable, amLaserSight, --[[amVampiric,]]
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    73
					amLowGravity, amExtraDamage, --[[amExtraTime,]]
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    74
					amLandGun
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    75
					--[[,amTardis, amResurrector, amSwitch]]
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    76
					}
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    77
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    78
local wepArray = 	{}
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    79
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    80
local currName
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    81
local lastName
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    82
local started = false
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    83
local switchStage = 0
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    84
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    85
function StartingSetUp(gear)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    86
6820
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
    87
	for i = 1, #wepArray do
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    88
		setGearValue(gear,wepArray[i],0)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    89
	end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    90
6378
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    91
	setGearValue(gear,amKamikaze,1)
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    92
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    93
	i = 1 + GetRandom(#atkArray)
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    94
	setGearValue(gear,atkArray[i],1)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    95
6378
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
    96
	i = 1 + GetRandom(#utilArray)
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    97
	setGearValue(gear,utilArray[i],1)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    98
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
    99
	SetHealth(gear, 100)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   100
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   101
end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   102
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   103
--[[function SaveWeapons(gear)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   104
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   105
	-
6378
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
   106
	for i = 1, (#wepArray) do
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   107
		setGearValue(gear, wepArray[i], GetAmmoCount(gear, wepArray[i]) )
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   108
		 --AddAmmo(gear, wepArray[i], getGearValue(gear,wepArray[i]) )
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   109
	end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   110
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   111
end]]
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   112
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   113
function ConvertValues(gear)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   114
6820
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   115
	for i = 1, #wepArray do
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   116
		AddAmmo(gear, wepArray[i], getGearValue(gear,wepArray[i]) )
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   117
	end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   118
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   119
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   120
end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   121
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   122
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   123
function TransferWeps(gear)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   124
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   125
	if CurrentHedgehog ~= nil then
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   126
6820
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   127
		for i = 1, #wepArray do
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   128
			val = getGearValue(gear,wepArray[i])
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   129
			if val ~= 0 then
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   130
				setGearValue(CurrentHedgehog, wepArray[i], val)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   131
				AddAmmo(CurrentHedgehog, wepArray[i], val)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   132
			end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   133
		end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   134
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   135
	end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   136
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   137
end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   138
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   139
function onGameInit()
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   140
	GameFlags = gfInfAttack + gfRandomOrder
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   141
	HealthCaseProb = 100
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   142
end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   143
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   144
function onGameStart()
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   145
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   146
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   147
	ShowMission	(
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   148
				loc("HIGHLANDER"),
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   149
				loc("Not all hogs are born equal."),
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   150
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   151
				"- " .. loc("Eliminate enemy hogs and take their weapons.") .. "|" ..
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   152
				"- " .. loc("Per-Hog Ammo") .. "|" ..
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   153
				"- " .. loc("Weapons reset.") .. "|" ..
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   154
				"- " .. loc("Unlimited Attacks") .. "|" ..
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   155
				"", 4, 4000
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   156
				)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   157
6820
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   158
	if MapHasBorder() == false then
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   159
        for i, w in pairs(airWeapons) do
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   160
            table.insert(atkArray, w)
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   161
        end
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   162
    end
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   163
6820
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   164
	for i, w in pairs(atkArray) do
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   165
        table.insert(wepArray, w)
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   166
	end
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   167
6820
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   168
	for i, w in pairs(utilArray) do
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   169
        table.insert(wepArray, w)
7db9e89b3f80 - don't give hogs air weps when border is enabled
mikade <redgrinner@gmail.com>
parents: 6378
diff changeset
   170
	end
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   171
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   172
	runOnGears(StartingSetUp)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   173
	runOnGears(ConvertValues)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   174
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   175
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   176
end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   177
7791
b937274608ba Completely arbitrary tweaking of tunnel values (avoids a nil) - still needs smooth curves (probably a target dx/dy to aim for, and slow alterations) and taking less CPU. Also disable unused function in Highlander
nemo
parents: 7139
diff changeset
   178
--function onNewTurn()
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   179
--
7791
b937274608ba Completely arbitrary tweaking of tunnel values (avoids a nil) - still needs smooth curves (probably a target dx/dy to aim for, and slow alterations) and taking less CPU. Also disable unused function in Highlander
nemo
parents: 7139
diff changeset
   180
--end
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   181
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   182
7139
a47fd17ba463 Also change Highlander and Racer
nemo
parents: 6820
diff changeset
   183
function onGameTick20()
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   184
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   185
	if (CurrentHedgehog ~= nil) then
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   186
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   187
		currName = GetHogName(CurrentHedgehog)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   188
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   189
		if (currName ~= lastName) then
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   190
			AddCaption(loc("Switched to ") .. currName .. "!")
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   191
			ConvertValues(CurrentHedgehog)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   192
		end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   193
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   194
		lastName = currName
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   195
	end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   196
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   197
end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   198
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   199
--[[function onHogHide(gear)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   200
	-- waiting for Henek
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   201
end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   202
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   203
function onHogRestore(gear)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   204
	-- waiting for Henek
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   205
end]]
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   206
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   207
function onGearAdd(gear)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   208
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   209
	--if GetGearType(gear) == gtSwitcher then
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   210
	--	SaveWeapons(CurrentHedgehog)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   211
	--end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   212
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   213
	if (GetGearType(gear) == gtHedgehog) then
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   214
		trackGear(gear)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   215
	end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   216
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   217
end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   218
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   219
function onGearDelete(gear)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   220
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   221
	if (GetGearType(gear) == gtHedgehog) then --or (GetGearType(gear) == gtResurrector) then
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   222
		TransferWeps(gear)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   223
		trackDeletion(gear)
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   224
	end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   225
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   226
end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   227
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   228
function onAmmoStoreInit()
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   229
	SetAmmo(amSkip, 9, 0, 0, 0)
6378
b812bfcfeb49 Make Highlander moar awesome.
mikade
parents: 6349
diff changeset
   230
	SetAmmo(amKamikaze, 9, 0, 0, 0)
6349
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   231
	--SetAmmo(amSwitch, 9, 0, 0, 0) -------1
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   232
end
b10715d6b986 Correct outdated feedback.
mikade
parents:
diff changeset
   233