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