share/hedgewars/Data/Maps/Control/map.lua
author nemo
Wed, 16 Sep 2015 08:58:51 -0400
changeset 11178 7b2b181f84f8
parent 9093 4114ce5d885d
child 11304 f243a0b202bc
permissions -rw-r--r--
remove racist trydo 😝
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     1
--------------------------------
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
     2
-- CONTROL 0.6
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
     3
--------------------------------
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     4
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     5
---------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     6
-- 0.2
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     7
---------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     8
-- fixed score display errrors
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
     9
-- added missing resurrection effects
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    10
-- moved hogs off control points if thats where they started
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    11
-- added sanity limit for the above
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    12
-- added tint tags to display clan score on each point as it scors
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    13
-- added gameflags filter
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    14
-- changed scoring rate
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    15
-- hogs now only score point DURING THEIR TURN
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    16
-- map now accepts custom weaponsets and themes 
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    17
-- changed win limit
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    18
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    19
---------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    20
-- 0.3
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    21
---------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    22
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    23
-- added translation support
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    24
4698
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
    25
--------
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
    26
-- 0.4
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
    27
--------
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
    28
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
    29
-- added scaling scoring based on clans: 300 points to win - 25 per team in game
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
    30
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
    31
--------
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
    32
-- 0.5
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
    33
--------
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
    34
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
    35
-- removed user branding
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
    36
-- fixed infinite attack time exploit
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
    37
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
    38
--------
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
    39
-- 0.6
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
    40
--------
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
    41
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
    42
-- timebox fix
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
    43
-- support for more players
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
    44
-- remove version numbers
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
    45
-- enable limited sudden death
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
    46
-- using skip go generates as many points as you would have gotten had you sat and waited
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
    47
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    48
-----------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    49
--script begins
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    50
-----------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    51
9093
4114ce5d885d fix locale load
nemo
parents: 8349
diff changeset
    52
HedgewarsScriptLoad("/Scripts/Locale.lua")
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    53
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    54
---------------------------------------------------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    55
----------lots of bad variables and things
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    56
----------because someone is too lazy
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    57
----------to read about tables properly
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    58
------------------ "Oh well, they probably have the memory"
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    59
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
    60
local TimeCounter = 0
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
    61
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    62
local gameWon = false
4698
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
    63
local pointLimit = 300
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    64
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    65
local vCirc = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    66
local vCircCount = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    67
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
    68
--local hGCount = 0
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    69
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    70
local vCircX = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    71
local vCircY = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    72
local vCircMinA = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    73
local vCircMaxA = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    74
local vCircType = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    75
local vCircPulse = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    76
local vCircFuckAll = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    77
local vCircRadius = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    78
local vCircWidth = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    79
local vCircCol = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    80
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    81
--------------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    82
-- hog and team tracking variales
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    83
--------------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    84
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    85
local numhhs = 0 -- store number of hedgehogs
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    86
local hhs = {} -- store hedgehog gears
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    87
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    88
local numTeams --  store the number of teams in the game
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    89
local teamNameArr = {}	-- store the list of teams
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    90
local teamClan = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    91
local teamSize = {}	-- store how many hogs per team
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    92
local teamIndex = {} -- at what point in the hhs{} does each team begin
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    93
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    94
local teamComment = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    95
local teamScore = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    96
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    97
--------------------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    98
--zone and teleporter variables
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
    99
--------------------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   100
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   101
local cPoint = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   102
local cOwnerClan = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   103
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   104
local zXMin = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   105
local zWidth = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   106
local zYMin = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   107
local zHeight = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   108
local zOccupied = {}
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   109
local zCount = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   110
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   111
------------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   112
-- zone methods
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   113
------------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   114
-- see on gameTick also
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   115
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   116
function CreateZone(xMin, yMin, width, height)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   117
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   118
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   119
	zXMin[zCount] = xMin
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   120
	zYMin[zCount] = yMin
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   121
	zWidth[zCount] = width
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   122
	zHeight[zCount] = height
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   123
	zOccupied[zCount] = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   124
	zCount = zCount + 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   125
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   126
	return (zCount-1)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   127
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   128
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   129
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   130
function GearIsInZone(gear, zI)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   131
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   132
	if (GetX(gear) > zXMin[zI]) and (GetX(gear) < (zXMin[zI]+zWidth[zI])) and (GetY(gear) > zYMin[zI]) and (GetY(gear) < (zYMin[zI]+zHeight[zI])) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   133
		zOccupied[zI] = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   134
	else
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   135
		zOccupied[zI] = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   136
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   137
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   138
	return zOccupied[zI]
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   139
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   140
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   141
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   142
function ZonesAreEmpty()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   143
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   144
	okay = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   145
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   146
	for i = 0,(zCount-1) do
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   147
				
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   148
		for k = 0, (numhhs-1) do
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   149
			if (hhs[k] ~= nil) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   150
			if (GearIsInZone(hhs[k],i)) == true then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   151
				FindPlace(hhs[k], false, 0, LAND_WIDTH, true)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   152
				okay = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   153
			end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   154
			end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   155
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   156
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   157
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   158
	return(okay)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   159
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   160
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   161
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   162
function CheckZones()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   163
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   164
	for i = 0,(zCount-1) do
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   165
		SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], 0xffffffff)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   166
		cOwnerClan[i] = nil
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   167
		for k = 0, (numhhs-1) do
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   168
			if (hhs[k] ~= nil) then --and (GetGearType(hhs[k]) ~= nil) then
5806
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   169
                if (GearIsInZone(hhs[k],i)) == true then
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   170
5806
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   171
                    if cOwnerClan[i] ~= nil then
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   172
                        if cOwnerClan[i] ~= GetHogClan(hhs[k]) then 
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   173
                            --if the hog now being compared is different to one that is also here and was previously compared
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   174
                            
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   175
                            SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], 0xffffffff)						
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   176
                            --SetVisualGearValues(vCirc[i], 2739, 1378, 20, 255, 1, 10, 0, 300, 5, 0xffffffff)
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   177
        
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   178
                            cOwnerClan[i] = 10 -- this means conflicted
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   179
                        end
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   180
                    elseif cOwnerClan[i] == nil then
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   181
                        cOwnerClan[i] = GetHogClan(hhs[k])
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   182
                        --SetVisualGearValues(vCirc[i], 2739, 1378, 20, 255, 1, 10, 0, 300, 5, GetClanColor( GetHogClan(hhs[k])) )
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   183
                        SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], GetClanColor( GetHogClan(hhs[k])))
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   184
        
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   185
                    end
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   186
5806
6778f0a7d896 remove debug message, clear a couple of global gear references if appropriate, fix control script
nemo
parents: 5325
diff changeset
   187
                end
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   188
           -- else hhs[k] = nil
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   189
			end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   190
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   191
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   192
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   193
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   194
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   195
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   196
function AwardPoints()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   197
		
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   198
	for i = 0,(zCount-1) do
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   199
		-- give score to all players controlling points		
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   200
		--if (cOwnerClan[i] ~= nil) and (cOwnerClan[i] ~= 10) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   201
		--	teamScore[cOwnerClan[i]] = teamScore[cOwnerClan[i]] + 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   202
		--end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   203
		
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   204
		-- only give score to the player currently in control		
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   205
		if CurrentHedgehog ~= nil then		
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   206
			if cOwnerClan[i] == GetHogClan(CurrentHedgehog) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   207
				teamScore[cOwnerClan[i]] = teamScore[cOwnerClan[i]] + 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   208
			end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   209
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   210
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   211
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   212
	-- i want to show all the tags at once as having the SAME score not 1,2,3,4 so alas, repeating the loop seems needed	
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   213
	for i = 0,(zCount-1) do			
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   214
		if CurrentHedgehog ~= nil then		
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   215
			if cOwnerClan[i] == GetHogClan(CurrentHedgehog) then
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   216
				g = AddVisualGear(vCircX[i], vCircY[i]-100, vgtHealthTag, 100, False)
4767
4ee4a49549e2 return nil values if an invalid visual gear is passed to the get, add a check in Control map lua
nemo
parents: 4698
diff changeset
   217
                if g ~= 0 then
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   218
				    SetVisualGearValues(g, vCircX[i], vCircY[i]-100, 0, 0, 0, 0, 0, teamScore[cOwnerClan[i]], 1500, GetClanColor(cOwnerClan[i]))
4767
4ee4a49549e2 return nil values if an invalid visual gear is passed to the get, add a check in Control map lua
nemo
parents: 4698
diff changeset
   219
                end
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   220
			end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   221
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   222
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   223
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   224
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   225
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   226
-----------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   227
-- general methods
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   228
------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   229
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   230
function RebuildTeamInfo()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   231
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   232
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   233
	-- make a list of individual team names
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   234
	for i = 0, (TeamsCount-1) do
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   235
		teamNameArr[i] = " " -- = i
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   236
		teamSize[i] = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   237
		teamIndex[i] = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   238
		teamScore[i] = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   239
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   240
	numTeams = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   241
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   242
	for i = 0, (numhhs-1) do
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   243
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   244
		z = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   245
		unfinished = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   246
		while(unfinished == true) do
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   247
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   248
			newTeam = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   249
			tempHogTeamName = GetHogTeamName(hhs[i]) -- this is the new name
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   250
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   251
			if tempHogTeamName == teamNameArr[z] then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   252
				newTeam = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   253
				unfinished = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   254
			end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   255
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   256
			z = z + 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   257
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   258
			if z == TeamsCount then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   259
				unfinished = false
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   260
				if newTeam == true then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   261
					teamNameArr[numTeams] = tempHogTeamName
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   262
					numTeams = numTeams + 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   263
				end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   264
			end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   265
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   266
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   267
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   268
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   269
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   270
	-- find out how many hogs per team, and the index of the first hog in hhs
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   271
	for i = 0, (numTeams-1) do
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   272
		for z = 0, (numhhs-1) do
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   273
			if GetHogTeamName(hhs[z]) == teamNameArr[i] then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   274
				teamClan[i] = GetHogClan(hhs[z])				
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   275
				if teamSize[i] == 0 then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   276
					teamIndex[i] = z -- should give starting index
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   277
				end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   278
				teamSize[i] = teamSize[i] + 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   279
				--add a pointer so this hog appears at i in hhs
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   280
			end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   281
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   282
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   283
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   284
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   285
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   286
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   287
------------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   288
-- game methods
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   289
------------------------
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   290
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   291
function onAttack()
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   292
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   293
	if CurrentHedgehog ~= nil then
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   294
		if GetCurAmmoType() == amSkip then
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   295
			z = (TurnTimeLeft / 2000) - (TurnTimeLeft / 2000)%2 
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   296
			--AddCaption("scored: " .. z,GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   297
			for i = 0, z do
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   298
				AwardPoints()
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   299
			end
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   300
		end
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   301
	end
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   302
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   303
end
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   304
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   305
function onGameInit()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   306
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   307
	-- Things we don't modify here will use their default values.
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   308
	--GameFlags = gfInfAttack + gfSolidLand -- Game settings and rules
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   309
	
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   310
	GameFlags = band(bor(GameFlags, gfInfAttack + gfSolidLand), bnot(gfKing + gfForts))
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   311
	WaterRise = 0
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   312
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   313
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   314
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   315
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   316
function onGameStart()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   317
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   318
	-- build zones
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   319
	cPoint[0] = CreateZone(571,47,120,80)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   320
	cPoint[1] = CreateZone(1029,643,120,80)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   321
	cPoint[2] = CreateZone(322,1524,120,80)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   322
	cPoint[3] = CreateZone(1883,38,120,80)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   323
	cPoint[4] = CreateZone(3821,46,120,80)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   324
	cPoint[5] = CreateZone(2679,1338,120,80)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   325
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   326
	vCircX[0], vCircY[0] = 631, 82
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   327
	vCircX[1], vCircY[1] = 1088, 684
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   328
	vCircX[2], vCircY[2] = 381, 1569
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   329
	vCircX[3], vCircY[3] = 1942, 77
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   330
	vCircX[4], vCircY[4] = 3883, 89
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   331
	vCircX[5], vCircY[5] = 2739, 1378
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   332
	
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   333
	for i = 0, 5 do	
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   334
		vCirc[i] = AddVisualGear(0,0,vgtCircle,0,true)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   335
		vCircMinA[i] = 20
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   336
		vCircMaxA[i] = 255
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   337
		vCircType[i] = 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   338
		vCircPulse[i] = 10
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   339
		vCircFuckAll[i] = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   340
		vCircRadius[i] = 300
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   341
		vCircWidth[i] = 5
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   342
		vCircCol[i] = 0xffffffff
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   343
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   344
		SetVisualGearValues(vCirc[i], vCircX[i], vCircY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i])
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   345
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   346
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   347
	--zxc = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   348
	--SetVisualGearValues(zxc, 1000,1000, 20, 255, 1,    10,                     0,         100,        1,      GetClanColor(0))
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   349
					--minO,max0 -glowyornot	--pulsate timer	 -- fuckall      -- radius -- width  -- colour
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   350
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   351
	--new improved placement schematics aw yeah
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   352
	RebuildTeamInfo()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   353
4698
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
   354
	for i = 0, (numTeams-1) do
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
   355
		pointLimit = pointLimit - 25
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
   356
	end
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   357
	
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   358
	-- reposition hogs if they are on control points until they are not or sanity limit kicks in
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   359
	reN = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   360
	--zz = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   361
	while (reN < 10) do
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   362
		if ZonesAreEmpty() == false then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   363
			reN = reN + 1	
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   364
			--zz = zz + 1	
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   365
			--SetGearPosition(hhs[0], 631, 82) -- put this in here to thwart attempts at repositioning and test sanity limit	
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   366
		else
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   367
			reN = 15		
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   368
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   369
		--AddCaption(zz) -- number of times it took to work
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   370
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   371
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   372
	ShowMission("CONTROL", 
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   373
	"", 
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   374
	loc("Control pillars to score points.") .. "|" .. 
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   375
	loc("Goal") .. ": " .. pointLimit .. " " .. loc("points"), 0, 0)
4698
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
   376
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
   377
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   378
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   379
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   380
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   381
function onNewTurn()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   382
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   383
	-- reset the time counter so that it will get set to TurnTimeLeft in onGameTick	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   384
	TimeCounter = 0
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   385
		
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   386
	if lastTeam ~= GetHogTeamName(CurrentHedgehog) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   387
		lastTeam = GetHogTeamName(CurrentHedgehog)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   388
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   389
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   390
	if gameWon == false then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   391
	
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   392
		for i = 0, (numTeams-1) do
4698
6f14ef3e40ae Updated maps CTF, Control and new unscripted map Blizzard
mikade
parents: 4662
diff changeset
   393
			if teamScore[i] >= pointLimit then --150
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   394
				gameWon = true
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   395
				winnerClan = i			
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   396
			end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   397
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   398
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   399
		if gameWon == true then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   400
			for i = 0, (numhhs-1) do
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   401
				if hhs[i] ~= nil then				
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   402
					if GetHogClan(hhs[i]) ~= winnerClan then
7838
5c2337f8dbb2 Issue #443 - change in syntax for effects
nemo
parents: 5842
diff changeset
   403
						SetEffect(hhs[i], heResurrectable, 0)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   404
						SetHealth(hhs[i],0)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   405
					end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   406
				end			
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   407
			end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   408
			TurnTimeLeft = 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   409
		end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   410
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   411
		totalComment = ""		
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   412
		for i = 0,(TeamsCount-1) do
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   413
				if teamNameArr[i] ~= " " then				-- i
5325
261b79ba22b1 Lua update. New phrases. Try to remove some duplicates by avoiding use of space and : in short common phrases. Removed localisation of some script names, since we can't localise that in frontend yet anyway, without screwing up multiplayer.
nemo
parents: 4953
diff changeset
   414
					teamComment[i] = teamNameArr[i] .. ": " .. teamScore[teamClan[i]] .. " " .. loc("points") .. "|"
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   415
					totalComment = totalComment .. teamComment[i]			
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   416
				elseif teamNameArr[i] == " " then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   417
					teamComment[i] = "|"
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   418
				end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   419
			end
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   420
			
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   421
			ShowMission("CONTROL", 
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   422
			loc("Team Scores") .. ":", 
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   423
			totalComment, 0, 1600)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   424
	
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   425
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   426
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   427
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   428
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   429
function onGameTick()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   430
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   431
	vCircCount = vCircCount + 1
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   432
	if (vCircCount >= 500) and (gameWon == false) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   433
		vCircCount = 0
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   434
		CheckZones()
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   435
	end	
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   436
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   437
	-- things we wanna check often
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   438
	if (CurrentHedgehog ~= nil) then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   439
	--	AddCaption(GetX(CurrentHedgehog) .. "; " .. GetY(CurrentHedgehog))
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   440
		--AddCaption(teamNameArr[0] .. " : " .. teamScore[0])
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   441
		--AddCaption(GetHogTeamName(CurrentHedgehog) .. " : " .. teamScore[GetHogClan(CurrentHedgehog)]) -- this end up 1?
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   442
		
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   443
		-- huh? the first clan added seems to be clan 1, not 0 ??
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   444
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   445
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   446
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   447
	-- set TimeCounter to starting time if it is uninitialised (from onNewTurn)	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   448
	if (TimeCounter == 0) and (TurnTimeLeft > 0) then
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   449
		TimeCounter = TurnTimeLeft	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   450
	end	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   451
	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   452
	-- has it ACTUALLY been 2 seconds since we last did this?	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   453
	if (TimeCounter - TurnTimeLeft) >= 2000 then
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   454
		TimeCounter = TurnTimeLeft
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   455
		
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   456
		if (gameWon == false) then
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   457
			AwardPoints()		
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   458
		end	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   459
	end	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   460
	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   461
	--AddCaption(TimeCounter)	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   462
	--hGCount = hGCount + 1
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   463
	--if (hGCount >= 2000) and (gameWon == false) then
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   464
	--	hGCount = 0
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   465
	--	AwardPoints()
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4767
diff changeset
   466
	--end
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   467
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   468
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   469
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   470
function onGearResurrect(gear)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   471
	AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   472
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   473
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   474
function InABetterPlaceNow(gear)
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   475
	for i = 0, (numhhs-1) do
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   476
		if gear == hhs[i] then
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   477
			hhs[i] = nil
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   478
		end
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   479
	end
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   480
end
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   481
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   482
function onHogHide(gear)
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   483
	 InABetterPlaceNow(gear)
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   484
end
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   485
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   486
function onHogRestore(gear)
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   487
	match = false
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   488
	for i = 0, (numhhs-1) do
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   489
		if (hhs[i] == nil) and (match == false) then
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   490
			hhs[i] = gear
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   491
			--AddCaption(GetHogName(gear) .. " has reappeared it seems!")
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   492
			--FollowGear(gear)
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   493
			match = true
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   494
		end
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   495
	end
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   496
end
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   497
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   498
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   499
function onGearAdd(gear)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   500
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   501
	if GetGearType(gear) == gtHedgehog then
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   502
		hhs[numhhs] = gear
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   503
		numhhs = numhhs + 1
7838
5c2337f8dbb2 Issue #443 - change in syntax for effects
nemo
parents: 5842
diff changeset
   504
		SetEffect(gear, heResurrectable, 1)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   505
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   506
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   507
end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   508
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   509
function onGearDelete(gear)
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   510
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   511
	if GetGearType(gear) == gtHedgehog then
5842
30e374a27269 fix timebox (differently), support for more players, remove version numbers,
mikade
parents: 5806
diff changeset
   512
		InABetterPlaceNow(gear)
4662
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   513
	end
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   514
63aafc9c2a81 Add a bunch of lua from mikade, update translation files
mikade+nemo
parents:
diff changeset
   515
end