share/hedgewars/Data/Maps/CTF_Blizzard/map.lua
author mikade
Tue, 22 Feb 2011 18:51:22 +0200
changeset 4953 ebd3dae634ca
parent 4871 4a99a45ea886
child 5325 261b79ba22b1
permissions -rw-r--r--
Fixed scoring exploit on Control and removed user branding from the map Changed hog positioning code on CTF_Blizzard so that each side is positioned in the same manner, and gets to move in the same order Fixed version control fail in CTF_Blizzard
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
     1
--------------------------------
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
     2
-- CTF_BLIZZARD 0.8
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
     3
--------------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
     4
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
     5
---------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
     6
-- 0.2
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
     7
---------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
     8
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
     9
-- disabled super weapons
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    10
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    11
-- theme modifications
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    12
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    13
-- improved hog placement system: teams can now be put
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    14
-- in any order and be of any size
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    15
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    16
---------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    17
-- 0.3
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    18
---------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    19
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    20
-- In this version:
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    21
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    22
-- changed starting weapons
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    23
-- changed crate drop contents and rate of drops
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    24
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    25
-- completely removed super weapons and super weapon scripts
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    26
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    27
-- removed custom respawning
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    28
-- removed set respawn points
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    29
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    30
-- added AIRespawn-esque respawning
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    31
-- added simple left vs right respawn points
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    32
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    33
-- added non-lethal poison to flag carriers as an indicator
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    34
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    35
-- improved flag mechanics and player-flag feedback
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    36
-- flag now instantly respawns if you kill enemy hog and return it,
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    37
-- or if the flag falls in water, _BUT_ not if it is blown up
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    38
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    39
---------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    40
-- 0.4
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    41
---------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    42
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    43
-- tweaked crate drop rates and crate contents
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    44
-- improved the teleporters, they should now be able to handle rope... hopefully
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    45
-- updated SetEffect calls to be in line with 0.9.15 definitions
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    46
-- added visual gears when hogs respawn
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    47
-- added visual gears when hogs teleport
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    48
-- added visual gear to track flag and flag carriers
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    49
-- removed poisoning of flag carriers
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    50
-- removed health adjustments for flag carriers due to aforementioned poisons
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    51
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    52
---------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    53
-- 0.5
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    54
---------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    55
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    56
-- added translation support, hopefully
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    57
-- added ctf rules
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    58
-- added effects to the teleporters
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    59
-- added aura round spawning area
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    60
-- changed the aura around the flag carrier / flag to an aura and added some support for this
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    61
-- changed things so the seed is no longer always the same...
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    62
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
    63
---------
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
    64
-- 0.6
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
    65
---------
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
    66
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
    67
-- removed branding and version number
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
    68
-- removed teleport from starting weapons
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
    69
-- increased captures to 3
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    70
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
    71
-----------
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
    72
-- 0.7
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
    73
------------
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
    74
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
    75
-- hopefully fixed a bug with the teleporters
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
    76
-- added a fix for crate possibly getting imbedded in land when it was near the water line
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
    77
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
    78
-----------
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
    79
-- 0.8
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
    80
------------
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
    81
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
    82
-- fixed version control fail with missing check on onGearDelete
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
    83
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
    84
-- changed hog placements code so that they start in the same place for both teams
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
    85
-- and hogs move in the same order, not backwards to each other.
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
    86
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    87
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    88
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    89
---------------------------------------------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    90
----------lots of bad variables and things
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    91
----------because someone is too lazy
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    92
----------to read about tables properly
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    93
------------------ "Oh well, they probably have the memory"
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    94
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    95
local actionReset = 0 -- used in CheckTeleporters()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    96
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    97
local roundsCounter = 0	-- used to determine when to spawn more crates
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    98
						-- currently every 6 TURNS, should this work
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    99
						-- on ROUNDS instead?
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   100
local effectTimer = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   101
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   102
local ropeGear = nil
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   103
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   104
--------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   105
-- hog and team tracking variales
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   106
--------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   107
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   108
local numhhs = 0 -- store number of hedgehogs
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   109
local hhs = {} -- store hedgehog gears
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   110
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   111
local numTeams --  store the number of teams in the game
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   112
local teamNameArr = {}	-- store the list of teams
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   113
local teamSize = {}	-- store how many hogs per team
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   114
local teamIndex = {} -- at what point in the hhs{} does each team begin
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   115
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   116
-------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   117
-- flag variables
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   118
-------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   119
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   120
local fGear = {}	-- pointer to the case gears that represent the flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   121
local fThief = {}	-- pointer to the hogs who stole the flags
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   122
local fIsMissing = {}	-- have the flags been destroyed or captured
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   123
local fNeedsRespawn = {}	-- do the flags need to be respawned
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   124
local fCaptures = {}	-- the team "scores" how many captures
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   125
local fSpawnX = {}		-- spawn X for flags
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   126
local fSpawnY = {}		-- spawn Y for flags
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   127
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   128
local fThiefX = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   129
local fThiefY = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   130
local FTTC = 0 -- flag thief tracker counter
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   131
--local fThiefsHealed = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   132
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   133
local fSpawnC = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   134
local fCirc = {} -- flag/carrier marker circles
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   135
local fCol = {} -- colour of the clans
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   136
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   137
local vCircX = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   138
local vCircY = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   139
local vCircMinA = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   140
local vCircMaxA = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   141
local vCircType = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   142
local vCircPulse = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   143
local vCircFuckAll = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   144
local vCircRadius = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   145
local vCircWidth = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   146
local vCircCol = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   147
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   148
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   149
--------------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   150
--zone and teleporter variables
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   151
--------------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   152
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   153
local redTel
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   154
local orangeTel
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   155
--local areaArr = {} -- no longer used
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   156
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   157
local zXMin = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   158
local zWidth = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   159
local zYMin = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   160
local zHeight = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   161
local zOccupied = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   162
local zCount = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   163
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   164
------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   165
-- zone methods
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   166
------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   167
-- see on gameTick also
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   168
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   169
function ManageTeleporterEffects()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   170
	effectTimer = effectTimer + 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   171
	if effectTimer > 50 then -- 100
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   172
		effectTimer = 0
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   173
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   174
		for i = 0,1 do
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   175
			eX = 10 + zXMin[i] + GetRandom(zWidth[i]-10)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   176
			eY = 50 + zYMin[i] + GetRandom(zHeight[i]-110)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   177
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   178
	-- steam and smoke and DUST look good, smokering looks trippy
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   179
	-- smoketrace and eviltrace are not effected by wind?
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   180
	-- chunk is a LR falling gear
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   181
			tempE = AddVisualGear(eX, eY, vgtDust, 0, false)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   182
			if tempE ~= 0 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   183
				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   184
				SetVisualGearValues(tempE, eX, eY, g3, g4, g5, g6, g7, g8, g9, fCol[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   185
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   186
		end
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   187
	end
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   188
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   189
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   190
function CreateZone(xMin, yMin, width, height)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   191
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   192
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   193
	zXMin[zCount] = xMin
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   194
	zYMin[zCount] = yMin
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   195
	zWidth[zCount] = width
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   196
	zHeight[zCount] = height
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   197
	zOccupied[zCount] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   198
	zCount = zCount + 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   199
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   200
	return (zCount-1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   201
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   202
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   203
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   204
function GearIsInZone(gear, zI)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   205
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   206
	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
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   207
		zOccupied[zI] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   208
	else
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   209
		zOccupied[zI] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   210
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   211
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   212
	return zOccupied[zI]
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   213
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   214
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   215
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   216
------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   217
--flag methods
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   218
------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   219
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   220
function CheckScore(teamID)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   221
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   222
	if teamID == 0 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   223
		alt = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   224
		winner = "Red"
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   225
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   226
	elseif teamID == 1 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   227
		alt = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   228
		winner = "Blue"
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   229
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   230
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   231
	if fCaptures[teamID] == 3 then
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   232
		for i = 0, (numhhs-1) do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   233
			if GetHogClan(hhs[i]) == alt then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   234
				SetEffect(hhs[i], heResurrectable, false)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   235
				SetHealth(hhs[i],0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   236
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   237
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   238
		--ShowMission("GAME OVER!", "Victory for the " .. winner .. " Team!", "Hooray!", 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   239
		ShowMission(loc("GAME OVER!"), loc("Victory for the ") .. GetHogTeamName(CurrentHedgehog), loc("Hooray!"), 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   240
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   241
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   242
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   243
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   244
function HandleRespawns()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   245
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   246
	for i = 0, 1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   247
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   248
		if fNeedsRespawn[i] == true then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   249
			fGear[i] = SpawnAmmoCrate(fSpawnX[i],fSpawnY[i],amSkip)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   250
			--fGear[i] = SpawnHealthCrate(fSpawnX[i],fSpawnY[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   251
			fNeedsRespawn[i] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   252
			fIsMissing[i] = false -- new, this should solve problems of a respawned flag being "returned" when a player tries to score
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   253
			AddCaption(loc("Flag respawned!"))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   254
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   255
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   256
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   257
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   258
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   259
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   260
function FlagDeleted(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   261
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   262
	if (gear == fGear[0]) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   263
		wtf = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   264
		bbq = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   265
	elseif (gear == fGear[1]) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   266
		wtf = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   267
		bbq = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   268
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   269
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   270
	--ShowMission("OH HAI!", "FlagDeleted was called", "Oh noes!", -amBazooka, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   271
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   272
	if CurrentHedgehog ~= nil then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   273
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   274
		--ShowMission("GUESS WAT?", "I'm not nil", "Oh noes!", -amBazooka, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   275
		--if the player picks up the flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   276
		if CheckDistance(CurrentHedgehog, fGear[wtf]) < 1600 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   277
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   278
			fGear[wtf] = nil -- the flag has now disappeared and we shouldnt be pointing to it
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   279
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   280
			-- player has successfully captured the enemy flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   281
			if (GetHogClan(CurrentHedgehog) == wtf) and (CurrentHedgehog == fThief[bbq]) and (fIsMissing[wtf] == false) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   282
				fIsMissing[wtf] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   283
				fNeedsRespawn[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   284
				fIsMissing[bbq] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   285
				fNeedsRespawn[bbq] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   286
				fCaptures[wtf] = fCaptures[wtf] +1					--fCaptures[wtf]
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   287
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   288
				--ShowMission(loc("You have SCORED!!"), "Red Team: " .. fCaptures[0], "Blue Team: " .. fCaptures[1], -amBazooka, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   289
				ShowMission(loc("You have SCORED!!"), GetHogTeamName(CurrentHedgehog) .. ": " .. fCaptures[wtf], loc("Opposing Team: ") .. fCaptures[bbq], 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   290
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   291
				PlaySound(sndVictory)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   292
				--SetEffect(fThief[bbq], hePoisoned, false)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   293
				fThief[bbq] = nil -- player no longer has the enemy flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   294
				CheckScore(wtf)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   295
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   296
			--if the player is returning the flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   297
			elseif GetHogClan(CurrentHedgehog) == wtf then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   298
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   299
				fNeedsRespawn[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   300
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   301
				-- NEW ADDIITON, does this work? Should make it possible to return your flag and then score in the same turn
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   302
				if fIsMissing[wtf] == true then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   303
					HandleRespawns() -- this will set fIsMissing[wtf] to false :)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   304
					AddCaption(loc("Flag returned!"))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   305
				elseif fIsMissing[wtf] == false then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   306
					AddCaption(loc("That was pointless.") .. loc("The flag will respawn next round."))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   307
				end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   308
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   309
				--fIsMissing[wtf] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   310
				--ShowMission("Flag returned!", "Hooray", "", -amBazooka, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   311
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   312
			--if the player is taking the enemy flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   313
			elseif GetHogClan(CurrentHedgehog) == bbq then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   314
				fIsMissing[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   315
				for i = 0,numhhs-1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   316
					if CurrentHedgehog == hhs[i] then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   317
						fThief[wtf] = hhs[i]
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   318
						--SetEffect(fThief[wtf], hePoisoned, true)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   319
					end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   320
				end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   321
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   322
				AddCaption(loc("Flag captured!"))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   323
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   324
			else --below line doesnt usually get called
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   325
				AddCaption("Hmm... that wasn't supposed to happen...")
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   326
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   327
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   328
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   329
		-- if flag has been destroyed, probably
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   330
		else
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   331
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   332
			if GetY(fGear[wtf]) > 2025 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   333
				fGear[wtf] = nil
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   334
				fIsMissing[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   335
				fNeedsRespawn[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   336
				HandleRespawns()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   337
			else
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   338
				fGear[wtf] = nil
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   339
				fIsMissing[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   340
				fNeedsRespawn[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   341
				AddCaption(loc("Boom!") .. " " .. loc("The flag will respawn next round."))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   342
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   343
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   344
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   345
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   346
	-- if flag has been destroyed deep underwater and player is now nil
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   347
	-- probably only gets called if the flag thief drowns himself
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   348
	-- otherwise the above one will work fine
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   349
	else
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   350
		--ShowMission("NIL PLAYER!", "Oh snap", "Oh noes!", -amBazooka, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   351
		fGear[wtf] = nil
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   352
		fIsMissing[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   353
		fNeedsRespawn[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   354
		AddCaption(loc("The flag will respawn next round."))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   355
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   356
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   357
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   358
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   359
function FlagThiefDead(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   360
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   361
	if (gear == fThief[0]) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   362
		wtf = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   363
		bbq = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   364
	elseif (gear == fThief[1]) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   365
		wtf = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   366
		bbq = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   367
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   368
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   369
	if fThief[wtf] ~= nil then
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   370
		
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   371
		if fThiefY[wtf] > 2040 then
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   372
			fGear[wtf] = SpawnAmmoCrate(fThiefX[wtf],(fThiefY[wtf]+10),amSkip)
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   373
		else
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   374
			fGear[wtf] = SpawnAmmoCrate(fThiefX[wtf],(fThiefY[wtf]-50),amSkip)
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   375
		end
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   376
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   377
		AddVisualGear(fThiefX[wtf], fThiefY[wtf], vgtBigExplosion, 0, false)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   378
		fThief[wtf] = nil
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   379
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   380
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   381
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   382
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   383
function HandleCircles()
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   384
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   385
	for i = 0, 1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   386
		if fIsMissing[i] == false then -- draw a circle at the flag's spawning place
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   387
			--SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], 20, 200, 0, 0, 100, 33, 2, fCol[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   388
			SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   389
		elseif (fIsMissing[i] == true) and (fNeedsRespawn[i] == false) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   390
			if fThief[i] ~= nil then -- draw circle round flag carrier
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   391
				--SetVisualGearValues(fCirc[i], fThiefX[i], fThiefY[i], 20, 200, 0, 0, 100, 33, 2, fCol[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   392
				SetVisualGearValues(fCirc[i], fThiefX[i], fThiefY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   393
			elseif fThief[i] == nil then -- draw cirle round dropped flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   394
				--SetVisualGearValues(fCirc[i], GetX(fGear[i]), GetY(fGear[i]), 20, 200, 0, 0, 100, 33, 2, fCol[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   395
				SetVisualGearValues(fCirc[i], GetX(fGear[i]),GetY(fGear[i]), vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   396
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   397
		end
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   398
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   399
		if fNeedsRespawn[i] == true then -- if the flag has been destroyed, no need for a circle
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   400
			SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], 20, 200, 0, 0, 100, 0, 0, fCol[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   401
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   402
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   403
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   404
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   405
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   406
------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   407
-- general methods
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   408
------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   409
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   410
function CheckDistance(gear1, gear2)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   411
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   412
	g1X, g1Y = GetGearPosition(gear1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   413
	g2X, g2Y = GetGearPosition(gear2)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   414
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   415
	g1X = g1X - g2X
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   416
	g1Y = g1Y - g2Y
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   417
	z = (g1X*g1X) + (g1Y*g1Y)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   418
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   419
	--dist = math.sqrt(z)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   420
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   421
	dist = z
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   422
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   423
	return dist
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   424
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   425
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   426
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   427
function CheckTeleporters()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   428
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   429
	teleportActive = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   430
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   431
	if (GearIsInZone(CurrentHedgehog, redTel) == true) and (GetHogClan(CurrentHedgehog) == 0) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   432
		teleportActive = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   433
		destinationX = 1402
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   434
		destinationY = 321
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   435
	elseif (GearIsInZone(CurrentHedgehog, orangeTel) == true) and (GetHogClan(CurrentHedgehog) == 1) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   436
		teleportActive = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   437
		destinationX = 2692
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   438
		destinationY = 321
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   439
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   440
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   441
	if teleportActive == true then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   442
		if actionReset == 0 then
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   443
			if ropeGear ~= nil then
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   444
				if GetGearElasticity(ropeGear) ~= 0 then
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   445
					SetGearMessage(CurrentHedgehog, gmAttack)
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   446
				end
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   447
			end
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   448
			--AddCaption(actionReset .. ";" .. "attack")
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   449
		elseif actionReset == 10 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   450
			SetGearMessage(CurrentHedgehog, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   451
			--AddCaption(actionReset .. ";" .. "reset")
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   452
		elseif actionReset == 20 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   453
			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   454
			SetGearPosition(CurrentHedgehog,destinationX,destinationY)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   455
			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   456
			--AddCaption(actionReset .. ";" .. "teleport")
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   457
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   458
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   459
		actionReset = actionReset + 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   460
		if actionReset >= 30 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   461
			actionReset = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   462
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   463
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   464
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   465
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   466
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   467
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   468
function RebuildTeamInfo()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   469
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   470
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   471
	-- make a list of individual team names
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   472
	for i = 0, 5 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   473
		teamNameArr[i] = i
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   474
		teamSize[i] = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   475
		teamIndex[i] = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   476
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   477
	numTeams = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   478
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   479
	for i = 0, (numhhs-1) do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   480
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   481
		z = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   482
		unfinished = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   483
		while(unfinished == true) do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   484
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   485
			newTeam = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   486
			tempHogTeamName = GetHogTeamName(hhs[i]) -- this is the new name
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   487
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   488
			if tempHogTeamName == teamNameArr[z] then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   489
				newTeam = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   490
				unfinished = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   491
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   492
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   493
			z = z + 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   494
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   495
			if z == TeamsCount then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   496
				unfinished = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   497
				if newTeam == true then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   498
					teamNameArr[numTeams] = tempHogTeamName
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   499
					numTeams = numTeams + 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   500
				end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   501
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   502
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   503
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   504
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   505
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   506
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   507
	-- find out how many hogs per team, and the index of the first hog in hhs
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   508
	for i = 0, numTeams-1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   509
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   510
		for z = 0, numhhs-1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   511
			if GetHogTeamName(hhs[z]) == teamNameArr[i] then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   512
				if teamSize[i] == 0 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   513
					teamIndex[i] = z -- should give starting index
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   514
				end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   515
				teamSize[i] = teamSize[i] + 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   516
				--add a pointer so this hog appears at i in hhs
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   517
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   518
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   519
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   520
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   521
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   522
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   523
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   524
function HandleCrateDrops()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   525
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   526
	roundsCounter = roundsCounter +1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   527
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   528
	if roundsCounter == 5 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   529
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   530
		roundsCounter = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   531
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   532
		r = GetRandom(8)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   533
		if r == 0 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   534
			SpawnUtilityCrate(0,0,amSwitch)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   535
		elseif r == 1 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   536
			SpawnUtilityCrate(0,0,amTeleport)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   537
		elseif r == 2 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   538
			SpawnUtilityCrate(0,0,amJetpack)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   539
		elseif r == 3 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   540
			SpawnUtilityCrate(0,0,amExtraTime)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   541
		elseif r == 4 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   542
			SpawnUtilityCrate(0,0,amGirder)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   543
		elseif r == 5 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   544
			SpawnAmmoCrate(0,0,amDynamite)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   545
		elseif r == 6 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   546
			SpawnAmmoCrate(0,0,amFlamethrower)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   547
		elseif r == 7 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   548
			SpawnUtilityCrate(0,0,amPortalGun)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   549
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   550
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   551
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   552
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   553
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   554
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   555
------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   556
-- game methods
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   557
------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   558
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   559
function onGameInit()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   560
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   561
	-- Things we don't modify here will use their default values.
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   562
	GameFlags = gfDivideTeams -- Game settings and rules
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   563
	TurnTime = 30000 -- (was 30) The time the player has to move each round (in ms)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   564
	CaseFreq = 0 -- The frequency of crate drops
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   565
	MinesNum = 0 -- The number of mines being placed
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   566
	MinesTime  = 2000
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   567
	Explosives = 0 -- The number of explosives being placed
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   568
	Delay = 10 -- The delay between each round
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   569
	SuddenDeathTurns = 99 -- suddendeath is off, effectively
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   570
	Map = "Blizzard" -- The map to be played
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   571
	Theme = "Snow" -- The theme to be used "Nature"
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   572
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   573
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   574
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   575
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   576
function onGameStart()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   577
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   578
	--ShowMission(loc(caption), loc(subcaption), loc(goal), 0, 0)
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   579
	ShowMission(loc("CTF_BLIZZARD"), "", loc(" - Return the enemy flag to your base to score | - First team to 3 captures wins | - You may only score when your flag is in your base | - Hogs will drop the flag if killed, or drowned | - Dropped flags may be returned or recaptured | - Hogs respawn when killed"), 0, 0)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   580
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   581
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   582
	-- initialize teleporters
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   583
	redTel = CreateZone(342,1316,42,449)	-- red teleporter
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   584
	orangeTel = CreateZone(3719,1330,45,449)	-- orange teleporter
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   585
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   586
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   587
	--new improved placement schematics aw yeah
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   588
	RebuildTeamInfo()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   589
	--ShowMission("Team Info Rebuilt", "Here you go:", "TeamCount: " .. TeamsCount .. "|" .. teamNameArr[0] .. ": " .. teamSize[0] .. " Hogs|" .. teamNameArr[1] .. ": " .. teamSize[1] .. " Hogs|" .. teamNameArr[2] .. ": " .. teamSize[2] .. " Hogs|", 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   590
	team1Placed = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   591
	team2Placed = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   592
	for i = 0, (TeamsCount-1) do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   593
		for g = teamIndex[i], (teamIndex[i]+teamSize[i]-1) do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   594
			if GetHogClan(hhs[g]) == 0 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   595
				SetGearPosition(hhs[g],1403+ ((team1Placed+1)*50),1570)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   596
				team1Placed = team1Placed +1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   597
				if team1Placed > 6 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   598
					team1Placed = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   599
				end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   600
			elseif GetHogClan(hhs[g]) == 1 then
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   601
				SetGearPosition(hhs[g],2691- ((team2Placed+1)*50),1570)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   602
				team2Placed = team2Placed +1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   603
				if team2Placed > 6 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   604
					team2Placed = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   605
				end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   606
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   607
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   608
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   609
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   610
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   611
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   612
	--spawn starting ufos and or super weapons
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   613
	SpawnAmmoCrate(2048,1858,amJetpack)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   614
	--SpawnUtilityCrate(2048,1858,amExtraTime)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   615
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   616
	--set flag spawn points and spawn the flags
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   617
	fSpawnX[0] = 957
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   618
	fSpawnY[0] = 1747
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   619
	fSpawnX[1] = 3123
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   620
	fSpawnY[1] = 1747
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   621
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   622
	for i = 0, 1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   623
		fGear[i] = SpawnAmmoCrate(fSpawnX[i],fSpawnY[i],amSkip)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   624
		fCirc[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true)
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   625
		fCol[i] = GetClanColor(i)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   626
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   627
		fSpawnC[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true)
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   628
		SetVisualGearValues(fSpawnC[i], fSpawnX[i],fSpawnY[i], 10, 200, 1, 10, 0, 300, 5, fCol[i])
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   629
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   630
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   631
		fIsMissing[i] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   632
		fNeedsRespawn[i] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   633
		fCaptures[i] = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   634
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   635
		vCircMinA[i] = 20
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   636
		vCircMaxA[i] = 255
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   637
		vCircType[i] = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   638
		vCircPulse[i] = 10
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   639
		vCircFuckAll[i] = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   640
		vCircRadius[i] = 150
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   641
		vCircWidth[i] = 5
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   642
		vCircCol[i] = fCol[i]
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   643
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   644
		SetVisualGearValues(fCirc[i], fSpawnX[i],fSpawnY[i], vCircMinA[i], vCircMaxA[i], vCircType[i], vCircPulse[i], vCircFuckAll[i], vCircRadius[i], vCircWidth[i], vCircCol[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   645
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   646
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   647
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   648
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   649
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   650
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   651
function onNewTurn()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   652
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   653
	if lastTeam ~= GetHogTeamName(CurrentHedgehog) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   654
		lastTeam = GetHogTeamName(CurrentHedgehog)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   655
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   656
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   657
	for i = 0, 1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   658
		if fThief[i] ~= nil then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   659
			--adjust = 5 + GetHealth(fThief[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   660
			--SetHealth(fThief[i], adjust)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   661
			--AddCaption('Helped out the flag poisoned flag thiefs')
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   662
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   663
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   664
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   665
	--AddCaption("Handling respawns")
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   666
	HandleRespawns()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   667
	HandleCrateDrops()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   668
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   669
	--myC = AddVisualGear(GetX(CurrentHedgehog),GetY(CurrentHedgehog),vgtCircle,0,true)
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   670
	--SetVisualGearValues(myC, GetX(CurrentHedgehog),GetY(CurrentHedgehog), 20, 200, 0, 0, 100, 50, 3, GetClanColor(GetHogClan(CurrentHedgehog)))
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   671
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   672
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   673
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   674
function onGameTick()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   675
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   676
	-- onRessurect calls AFTER you have resurrected,
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   677
	-- so keeping track of x,y a few milliseconds before
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   678
	-- is useful
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   679
	--FTTC = FTTC + 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   680
	--if FTTC == 100 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   681
	--	FTTC = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   682
		for i = 0,1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   683
			if fThief[i] ~= nil then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   684
				fThiefX[i] = GetX(fThief[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   685
				fThiefY[i] = GetY(fThief[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   686
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   687
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   688
	--end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   689
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   690
	-- things we wanna check often
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   691
	if (CurrentHedgehog ~= nil) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   692
		--AddCaption(GetX(CurrentHedgehog) .. "; " .. GetY(CurrentHedgehog))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   693
		--AddCaption("Checking Teleporters")
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   694
		CheckTeleporters()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   695
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   696
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   697
	HandleCircles()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   698
	ManageTeleporterEffects()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   699
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   700
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   701
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   702
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   703
function onAmmoStoreInit()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   704
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   705
	SetAmmo(amDrill,9,0,0,0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   706
	SetAmmo(amMortar,9,0,0,0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   707
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   708
	SetAmmo(amGrenade,9,0,0,0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   709
	SetAmmo(amClusterBomb,4,0,0,0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   710
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   711
	--SetAmmo(amDEagle, 4, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   712
	SetAmmo(amShotgun, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   713
	SetAmmo(amFlamethrower, 1, 0, 0, 1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   714
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   715
	SetAmmo(amFirePunch, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   716
	SetAmmo(amBaseballBat, 2, 0, 0, 0)
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   717
	--SetAmmo(amKamikaze, 2, 0, 0, 0)
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   718
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   719
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   720
	SetAmmo(amDynamite,2,0,0,1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   721
	SetAmmo(amSMine,4,0,0,0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   722
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   723
	SetAmmo(amBlowTorch, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   724
	SetAmmo(amPickHammer, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   725
	SetAmmo(amGirder, 2, 0, 0, 2)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   726
	SetAmmo(amPortalGun, 2, 0, 0, 2)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   727
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   728
	SetAmmo(amParachute, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   729
	SetAmmo(amRope, 9, 0, 0, 0)
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   730
	SetAmmo(amTeleport, 0, 0, 0, 1)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   731
	SetAmmo(amJetpack, 1, 0, 0, 1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   732
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   733
	SetAmmo(amSwitch, 2, 0, 0, 1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   734
	SetAmmo(amExtraTime,1,0,0,1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   735
	SetAmmo(amLowGravity,1,0,0,0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   736
	SetAmmo(amSkip, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   737
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   738
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   739
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   740
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   741
function onGearResurrect(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   742
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   743
	--AddCaption("A gear has been resurrected!")
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   744
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   745
	-- mark the flag thief as dead if he needed a respawn
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   746
	for i = 0,1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   747
		if gear == fThief[i] then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   748
			FlagThiefDead(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   749
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   750
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   751
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   752
	-- place hogs belonging to each clan either left or right side of map
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   753
	if GetHogClan(gear) == 0 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   754
		FindPlace(gear, false, 0, 2048)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   755
	elseif GetHogClan(gear) == 1 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   756
		FindPlace(gear, false, 2048, LAND_WIDTH)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   757
	end
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   758
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   759
	AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   760
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   761
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   762
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   763
function onGearDamage(gear, damage)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   764
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   765
	-- >_< damn, occurs too fast, before the hog has finished moving / updated his health
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   766
	--if GetGearType(gear) == gtHedgehog then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   767
	--	if damage > GetHealth(gear) then
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   768
	--		AddVisualGear(GetX(gear), GetY(gear), vgtExplosion, 0, false)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   769
	--	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   770
	--end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   771
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   772
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   773
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   774
function onGearAdd(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   775
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   776
	if GetGearType(gear) == gtHedgehog then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   777
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   778
		hhs[numhhs] = gear
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   779
		numhhs = numhhs + 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   780
		SetEffect(gear, heResurrectable, true)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   781
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   782
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   783
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   784
	if GetGearType(gear) == gtRope then
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   785
		ropeGear = gear
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   786
	end
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   787
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   788
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   789
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   790
function onGearDelete(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   791
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   792
	if (gear == fGear[0]) or (gear == fGear[1]) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   793
		FlagDeleted(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   794
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   795
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   796
	if GetGearType(gear) == gtRope then
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   797
		ropeGear = nil
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   798
	end
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   799
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   800
	if GetGearType(gear) == gtHedgehog then
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   801
		for i = 0, (numhhs-1) do
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   802
			if gear == hhs[i] then
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   803
				
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   804
				for k = 0,1 do
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   805
					if gear == fThief[k] then
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   806
						FlagThiefDead(gear)
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   807
					end
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   808
				end				
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   809
				hhs[i] = nil	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   810
			end		
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   811
		end
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   812
	end
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   813
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   814
end