share/hedgewars/Data/Maps/CTF_Blizzard/map.lua
author Wuzzy <Wuzzy2@mail.ru>
Thu, 24 May 2018 15:20:29 +0200
changeset 13405 6476721e1a38
parent 13122 cd1561b0337f
child 13635 fe7d2bbf5f3f
permissions -rw-r--r--
Feedback dialog: Disable "send system information" checkbox by default Background: Explicit user consent.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
     1
-------------------------------
5821
afb988c1a2fe Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents: 5328
diff changeset
     2
-- CTF_BLIZZARD 0.9
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
5821
afb988c1a2fe Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents: 5328
diff changeset
    71
------------
4871
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
5821
afb988c1a2fe Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents: 5328
diff changeset
    78
------------
4953
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
5821
afb988c1a2fe Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents: 5328
diff changeset
    87
-----------
afb988c1a2fe Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents: 5328
diff changeset
    88
-- 0.9
afb988c1a2fe Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents: 5328
diff changeset
    89
------------
afb988c1a2fe Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents: 5328
diff changeset
    90
afb988c1a2fe Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents: 5328
diff changeset
    91
-- add support for more players
afb988c1a2fe Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents: 5328
diff changeset
    92
-- re-enable sudden death, but set water rise to 0
afb988c1a2fe Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents: 5328
diff changeset
    93
9093
4114ce5d885d fix locale load
nemo
parents: 8349
diff changeset
    94
HedgewarsScriptLoad("/Scripts/Locale.lua")
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    95
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
----------lots of bad variables and things
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    98
----------because someone is too lazy
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
    99
----------to read about tables properly
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   100
------------------ "Oh well, they probably have the memory"
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   101
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   102
local actionReset = 0 -- used in CheckTeleporters()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   103
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   104
local roundsCounter = 0	-- used to determine when to spawn more crates
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   105
						-- currently every 6 TURNS, should this work
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   106
						-- on ROUNDS instead?
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   107
local effectTimer = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   108
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   109
local ropeGear = nil
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   110
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   111
--------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   112
-- hog and team tracking variales
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   113
--------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   114
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   115
local numhhs = 0 -- store number of hedgehogs
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   116
local hhs = {} -- store hedgehog gears
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   117
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   118
local teamNameArr = {}	-- store the list of teams
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   119
local teamSize = {}	-- store how many hogs per team
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   120
local teamIndex = {} -- at what point in the hhs{} does each team begin
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   121
local clanTeams = {} -- list of teams per clan
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   122
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   123
-------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   124
-- flag variables
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   125
-------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   126
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   127
local fGear = {}	-- pointer to the case gears that represent the flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   128
local fThief = {}	-- pointer to the hogs who stole the flags
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   129
local fIsMissing = {}	-- have the flags been destroyed or captured
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   130
local fNeedsRespawn = {}	-- do the flags need to be respawned
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   131
local fCaptures = {}	-- the team "scores" how many captures
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   132
local fSpawnX = {}		-- spawn X for flags
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   133
local fSpawnY = {}		-- spawn Y for flags
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   134
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   135
local fThiefX = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   136
local fThiefY = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   137
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   138
local fSpawnC = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   139
local fCirc = {} -- flag/carrier marker circles
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   140
local fCol = {} -- colour of the clans
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   141
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   142
local vCircX = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   143
local vCircY = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   144
local vCircMinA = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   145
local vCircMaxA = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   146
local vCircType = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   147
local vCircPulse = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   148
local vCircFuckAll = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   149
local vCircRadius = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   150
local vCircWidth = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   151
local vCircCol = {}
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
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   154
--------------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   155
--zone and teleporter variables
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
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   158
local redTel
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   159
local orangeTel
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   160
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   161
local zXMin = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   162
local zWidth = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   163
local zYMin = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   164
local zHeight = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   165
local zOccupied = {}
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   166
local zCount = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   167
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
-- zone methods
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   170
------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   171
-- see on gameTick also
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   172
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   173
function ManageTeleporterEffects()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   174
	effectTimer = effectTimer + 1
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   175
	if effectTimer > 50 then
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   176
		effectTimer = 0
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   177
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   178
		for i = 0,1 do
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   179
			local eX = 10 + zXMin[i] + GetRandom(zWidth[i]-10)
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   180
			local eY = 50 + zYMin[i] + GetRandom(zHeight[i]-110)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   181
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   182
			-- steam and smoke and DUST look good, smokering looks trippy
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   183
			-- smoketrace and eviltrace are not effected by wind?
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   184
			-- chunk is a LR falling gear
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   185
			local tempE = AddVisualGear(eX, eY, vgtDust, 0, false)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   186
			if tempE ~= 0 then
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   187
				SetVisualGearValues(tempE, eX, eY, nil, nil, nil, nil, nil, nil, nil, fCol[i])
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
		end
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   190
	end
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   191
end
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
function CreateZone(xMin, yMin, width, height)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   194
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   195
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   196
	zXMin[zCount] = xMin
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   197
	zYMin[zCount] = yMin
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   198
	zWidth[zCount] = width
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   199
	zHeight[zCount] = height
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   200
	zOccupied[zCount] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   201
	zCount = zCount + 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   202
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   203
	return (zCount-1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   204
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   205
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   206
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   207
function GearIsInZone(gear, zI)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   208
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   209
	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
   210
		zOccupied[zI] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   211
	else
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   212
		zOccupied[zI] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   213
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   214
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   215
	return zOccupied[zI]
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
end
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
--flag methods
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
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   223
function CheckScore(teamID)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   224
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   225
	local alt
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   226
	if teamID == 0 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   227
		alt = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   228
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   229
	elseif teamID == 1 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   230
		alt = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   231
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   232
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   233
	if fCaptures[teamID] == 3 then
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   234
		for i = 0, (numhhs-1) do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   235
			if GetHogClan(hhs[i]) == alt then
7838
5c2337f8dbb2 Issue #443 - change in syntax for effects
nemo
parents: 5821
diff changeset
   236
				SetEffect(hhs[i], heResurrectable, 0)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   237
				SetHealth(hhs[i],0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   238
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   239
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   240
		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
   241
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   242
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   243
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   244
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   245
function HandleRespawns()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   246
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   247
	for i = 0, 1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   248
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   249
		if fNeedsRespawn[i] == true then
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   250
			fGear[i] = SpawnFakeAmmoCrate(fSpawnX[i],fSpawnY[i],false,false)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   251
			--fGear[i] = SpawnHealthCrate(fSpawnX[i],fSpawnY[i])
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   252
			fNeedsRespawn[i] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   253
			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
   254
			AddCaption(loc("Flag respawned!"))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   255
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   256
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   257
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   258
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   259
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   260
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   261
function FlagDeleted(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   262
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   263
	local wtf, bbq
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   264
	PlaySound(sndShotgunReload)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   265
	if (gear == fGear[0]) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   266
		wtf = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   267
		bbq = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   268
	elseif (gear == fGear[1]) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   269
		wtf = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   270
		bbq = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   271
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   272
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   273
	if CurrentHedgehog ~= nil then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   274
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
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   286
				fCaptures[wtf] = fCaptures[wtf] +1
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   287
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   288
				AddCaption(string.format(loc("%s has scored!"), GetHogTeamName(CurrentHedgehog)), 0xFFFFFFFF, capgrpGameState)
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   289
				for i=1, #clanTeams[wtf] do
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   290
					SetTeamLabel(clanTeams[wtf][i], fCaptures[wtf])
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   291
				end
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   292
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   293
				PlaySound(sndHomerun)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   294
				fThief[bbq] = nil -- player no longer has the enemy flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   295
				CheckScore(wtf)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   296
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   297
			--if the player is returning the flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   298
			elseif GetHogClan(CurrentHedgehog) == wtf then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   299
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   300
				fNeedsRespawn[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   301
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   302
				-- 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
   303
				if fIsMissing[wtf] == true then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   304
					HandleRespawns() -- this will set fIsMissing[wtf] to false :)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   305
					AddCaption(loc("Flag returned!"))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   306
				elseif fIsMissing[wtf] == false then
12431
9f3387907e06 Fix even more bad/broken loc()'s in scripts (hopefully the last one)
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
   307
					AddCaption(loc("That was pointless. The flag will respawn next round."))
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   308
				end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   309
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   310
			--if the player is taking the enemy flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   311
			elseif GetHogClan(CurrentHedgehog) == bbq then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   312
				fIsMissing[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   313
				for i = 0,numhhs-1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   314
					if CurrentHedgehog == hhs[i] then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   315
						fThief[wtf] = hhs[i]
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   316
					end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   317
				end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   318
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   319
				AddCaption(loc("Flag captured!"))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   320
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   321
			else --below line doesnt usually get called
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   322
				AddCaption("Hmm... that wasn't supposed to happen...")
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
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   325
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   326
		-- if flag has been destroyed, probably
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   327
		else
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 GetY(fGear[wtf]) > 2025 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   330
				fGear[wtf] = nil
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   331
				fIsMissing[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   332
				fNeedsRespawn[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   333
				HandleRespawns()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   334
			else
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   335
				fGear[wtf] = nil
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   336
				fIsMissing[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   337
				fNeedsRespawn[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   338
				AddCaption(loc("Boom!") .. " " .. loc("The flag will respawn next round."))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   339
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   340
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   341
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   342
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   343
	-- if flag has been destroyed deep underwater and player is now nil
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   344
	-- probably only gets called if the flag thief drowns himself
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   345
	-- otherwise the above one will work fine
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   346
	else
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   347
		fGear[wtf] = nil
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   348
		fIsMissing[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   349
		fNeedsRespawn[wtf] = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   350
		AddCaption(loc("The flag will respawn next round."))
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   351
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   352
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   353
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   354
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   355
function FlagThiefDead(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   356
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   357
	local wtf, bbq
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   358
	if (gear == fThief[0]) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   359
		wtf = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   360
		bbq = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   361
	elseif (gear == fThief[1]) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   362
		wtf = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   363
		bbq = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   364
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   365
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   366
	if fThief[wtf] ~= nil then
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   367
		
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   368
		if fThiefY[wtf] > 2040 then
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   369
			fGear[wtf] = SpawnFakeAmmoCrate(fThiefX[wtf],(fThiefY[wtf]+10),false,false)
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   370
		else
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   371
			fGear[wtf] = SpawnFakeAmmoCrate(fThiefX[wtf],(fThiefY[wtf]-50),false,false)
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   372
		end
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   373
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   374
		AddVisualGear(fThiefX[wtf], fThiefY[wtf], vgtBigExplosion, 0, false)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   375
		fThief[wtf] = nil
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   376
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   377
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   378
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   379
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   380
function HandleCircles()
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   381
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   382
	for i = 0, 1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   383
		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
   384
			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
   385
		elseif (fIsMissing[i] == true) and (fNeedsRespawn[i] == false) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   386
			if fThief[i] ~= nil then -- draw circle round flag carrier
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   387
				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
   388
			elseif fThief[i] == nil then -- draw cirle round dropped flag
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   389
				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
   390
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   391
		end
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   392
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   393
		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
   394
			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
   395
		end
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
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   398
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   399
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   400
------------------------
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   401
-- general methods
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   402
------------------------
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
function CheckDistance(gear1, gear2)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   405
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   406
	local g1X, g1Y = GetGearPosition(gear1)
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   407
	local g2X, g2Y = GetGearPosition(gear2)
4786
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
	g1X = g1X - g2X
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   410
	g1Y = g1Y - g2Y
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   411
	local dist = (g1X*g1X) + (g1Y*g1Y)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   412
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   413
	return dist
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
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   416
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   417
function CheckTeleporters()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   418
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   419
	local teleportActive = false
4786
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
	if (GearIsInZone(CurrentHedgehog, redTel) == true) and (GetHogClan(CurrentHedgehog) == 0) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   422
		teleportActive = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   423
		destinationX = 1402
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   424
		destinationY = 321
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   425
	elseif (GearIsInZone(CurrentHedgehog, orangeTel) == true) and (GetHogClan(CurrentHedgehog) == 1) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   426
		teleportActive = true
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   427
		destinationX = 2692
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   428
		destinationY = 321
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   429
	end
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 teleportActive == true then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   432
		if actionReset == 0 then
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   433
			if ropeGear ~= nil then
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   434
				if GetGearElasticity(ropeGear) ~= 0 then
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   435
					SetGearMessage(CurrentHedgehog, gmAttack)
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   436
				end
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   437
			end
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   438
		elseif actionReset == 10 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   439
			SetGearMessage(CurrentHedgehog, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   440
		elseif actionReset == 20 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   441
			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   442
			SetGearPosition(CurrentHedgehog,destinationX,destinationY)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   443
			AddVisualGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), vgtBigExplosion, 0, false)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   444
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   445
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   446
		actionReset = actionReset + 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   447
		if actionReset >= 30 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   448
			actionReset = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   449
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   450
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   451
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   452
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   453
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   454
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   455
function RebuildTeamInfo()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   456
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   457
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   458
	-- make a list of individual team names
5821
afb988c1a2fe Allow limited form of SuddenDeath (WaterRise = 0) in both CTF modes
mikade
parents: 5328
diff changeset
   459
	for i = 0, (TeamsCount-1) do
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   460
		teamNameArr[i] = GetTeamName(i)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   461
		teamSize[i] = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   462
		teamIndex[i] = 0
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   463
		SetTeamLabel(teamNameArr[i], "0")
4786
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
	-- find out how many hogs per team, and the index of the first hog in hhs
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   467
	for i = 0, TeamsCount-1 do
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   468
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   469
		for z = 0, numhhs-1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   470
			if GetHogTeamName(hhs[z]) == teamNameArr[i] then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   471
				if teamSize[i] == 0 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   472
					teamIndex[i] = z -- should give starting index
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   473
				end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   474
				teamSize[i] = teamSize[i] + 1
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   475
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   476
				local clan = GetHogClan(hhs[z])
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   477
				-- Also remember the clan to which the team belongs to
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   478
				if not clanTeams[clan] then
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   479
					clanTeams[clan] = {}
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   480
				end
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   481
				table.insert(clanTeams[clan], teamNameArr[i])
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   482
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   483
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   484
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   485
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   486
	end
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
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   489
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   490
function HandleCrateDrops()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   491
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   492
	roundsCounter = roundsCounter +1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   493
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   494
	if roundsCounter == 5 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   495
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   496
		roundsCounter = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   497
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   498
		r = GetRandom(8)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   499
		if r == 0 then
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12431
diff changeset
   500
			SpawnSupplyCrate(0,0,amSwitch)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   501
		elseif r == 1 then
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12431
diff changeset
   502
			SpawnSupplyCrate(0,0,amTeleport)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   503
		elseif r == 2 then
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12431
diff changeset
   504
			SpawnSupplyCrate(0,0,amJetpack)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   505
		elseif r == 3 then
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12431
diff changeset
   506
			SpawnSupplyCrate(0,0,amExtraTime)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   507
		elseif r == 4 then
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12431
diff changeset
   508
			SpawnSupplyCrate(0,0,amGirder)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   509
		elseif r == 5 then
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12431
diff changeset
   510
			SpawnSupplyCrate(0,0,amDynamite)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   511
		elseif r == 6 then
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12431
diff changeset
   512
			SpawnSupplyCrate(0,0,amFlamethrower)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   513
		elseif r == 7 then
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12431
diff changeset
   514
			SpawnSupplyCrate(0,0,amPortalGun)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   515
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   516
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
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   519
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   520
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
-- game methods
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
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   525
function onGameInit()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   526
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   527
	-- Things we don't modify here will use their default values.
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   528
	GameFlags = gfDivideTeams -- Game settings and rules
13122
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   529
	TurnTime = 30000 -- The time the player has to move each round (in ms)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   530
	CaseFreq = 0 -- The frequency of crate drops
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   531
	MinesNum = 0 -- The number of mines being placed
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   532
	Explosives = 0 -- The number of explosives being placed
12084
8f222872d432 Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents: 12082
diff changeset
   533
	-- Disable Sudden Death
8f222872d432 Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents: 12082
diff changeset
   534
	WaterRise = 0
8f222872d432 Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents: 12082
diff changeset
   535
	HealthDecrease = 0
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   536
	Map = "Blizzard" -- The map to be played
13122
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   537
	Theme = "Snow" -- The theme to be used
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   538
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   539
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   540
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   541
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   542
function onGameStart()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   543
12082
ce3860c82c8b Rewrite 2nd line of mission panel of most missions for consistency
Wuzzy <almikes@aol.com>
parents: 9093
diff changeset
   544
	ShowMission(loc("CTF_Blizzard"), loc("Capture The Flag"), 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
   545
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   546
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   547
	-- initialize teleporters
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   548
	redTel = CreateZone(342,1316,42,449)	-- red teleporter
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   549
	orangeTel = CreateZone(3719,1330,45,449)	-- orange teleporter
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
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   552
	--new improved placement schematics aw yeah
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   553
	RebuildTeamInfo()
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   554
	local team1Placed = 0
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   555
	local team2Placed = 0
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   556
	for i = 0, (TeamsCount-1) do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   557
		for g = teamIndex[i], (teamIndex[i]+teamSize[i]-1) do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   558
			if GetHogClan(hhs[g]) == 0 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   559
				SetGearPosition(hhs[g],1403+ ((team1Placed+1)*50),1570)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   560
				team1Placed = team1Placed +1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   561
				if team1Placed > 6 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   562
					team1Placed = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   563
				end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   564
			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
   565
				SetGearPosition(hhs[g],2691- ((team2Placed+1)*50),1570)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   566
				team2Placed = team2Placed +1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   567
				if team2Placed > 6 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   568
					team2Placed = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   569
				end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   570
			end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   571
		end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   572
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   573
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
	--spawn starting ufos and or super weapons
12938
e65aa3c3d4e6 Refactor scripts to use SpawnSupplyCrate (where it makes sense)
Wuzzy <Wuzzy2@mail.ru>
parents: 12431
diff changeset
   577
	SpawnSupplyCrate(2048,1858,amJetpack)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   578
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   579
	--set flag spawn points and spawn the flags
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   580
	fSpawnX[0] = 957
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   581
	fSpawnY[0] = 1747
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   582
	fSpawnX[1] = 3123
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   583
	fSpawnY[1] = 1747
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   584
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   585
	for i = 0, 1 do
13024
880662cf41ee Add team score next to team bars for CTF_Blizard, Control, CTF, Mutant, Space Invasion
Wuzzy <Wuzzy2@mail.ru>
parents: 12938
diff changeset
   586
		fGear[i] = SpawnFakeAmmoCrate(fSpawnX[i],fSpawnY[i],false,false)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   587
		fCirc[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true)
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   588
		fCol[i] = GetClanColor(i)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   589
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   590
		fSpawnC[i] = AddVisualGear(fSpawnX[i],fSpawnY[i],vgtCircle,0,true)
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   591
		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
   592
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   593
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   594
		fIsMissing[i] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   595
		fNeedsRespawn[i] = false
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   596
		fCaptures[i] = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   597
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   598
		vCircMinA[i] = 20
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   599
		vCircMaxA[i] = 255
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   600
		vCircType[i] = 1
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   601
		vCircPulse[i] = 10
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   602
		vCircFuckAll[i] = 0
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   603
		vCircRadius[i] = 150
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   604
		vCircWidth[i] = 5
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   605
		vCircCol[i] = fCol[i]
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   606
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   607
		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
   608
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   609
	end
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
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   612
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   613
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   614
function onNewTurn()
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
	HandleRespawns()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   617
	HandleCrateDrops()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   618
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   619
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   620
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   621
function onGameTick()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   622
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   623
	-- onRessurect calls AFTER you have resurrected,
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   624
	-- so keeping track of x,y a few milliseconds before
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   625
	-- is useful
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   626
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   627
	for i = 0,1 do
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   628
		if fThief[i] ~= nil then
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   629
			fThiefX[i] = GetX(fThief[i])
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   630
			fThiefY[i] = GetY(fThief[i])
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   631
		end
13121
3b7cd18c4a06 CTF_Blizzard: Dump dead code / out-commented code
Wuzzy <Wuzzy2@mail.ru>
parents: 13024
diff changeset
   632
	end
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   633
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   634
	-- things we wanna check often
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   635
	if (CurrentHedgehog ~= nil) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   636
		CheckTeleporters()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   637
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   638
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   639
	HandleCircles()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   640
	ManageTeleporterEffects()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   641
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   642
end
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
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   645
function onAmmoStoreInit()
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   646
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   647
	SetAmmo(amDrill,9,0,0,0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   648
	SetAmmo(amMortar,9,0,0,0)
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
	SetAmmo(amGrenade,9,0,0,0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   651
	SetAmmo(amClusterBomb,4,0,0,0)
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
	SetAmmo(amShotgun, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   654
	SetAmmo(amFlamethrower, 1, 0, 0, 1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   655
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   656
	SetAmmo(amFirePunch, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   657
	SetAmmo(amBaseballBat, 2, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   658
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   659
	SetAmmo(amDynamite,2,0,0,1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   660
	SetAmmo(amSMine,4,0,0,0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   661
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   662
	SetAmmo(amBlowTorch, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   663
	SetAmmo(amPickHammer, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   664
	SetAmmo(amGirder, 2, 0, 0, 2)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   665
	SetAmmo(amPortalGun, 2, 0, 0, 2)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   666
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   667
	SetAmmo(amParachute, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   668
	SetAmmo(amRope, 9, 0, 0, 0)
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   669
	SetAmmo(amTeleport, 0, 0, 0, 1)
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   670
	SetAmmo(amJetpack, 1, 0, 0, 1)
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
	SetAmmo(amSwitch, 2, 0, 0, 1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   673
	SetAmmo(amExtraTime,1,0,0,1)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   674
	SetAmmo(amLowGravity,1,0,0,0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   675
	SetAmmo(amSkip, 9, 0, 0, 0)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   676
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   677
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   678
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   679
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   680
function onGearResurrect(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   681
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   682
	-- mark the flag thief as dead if he needed a respawn
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   683
	for i = 0,1 do
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   684
		if gear == fThief[i] then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   685
			FlagThiefDead(gear)
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
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   689
	-- 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
   690
	if GetHogClan(gear) == 0 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   691
		FindPlace(gear, false, 0, 2048)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   692
	elseif GetHogClan(gear) == 1 then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   693
		FindPlace(gear, false, 2048, LAND_WIDTH)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   694
	end
4843
673f74c89687 merge in script tweaks
mikade
parents: 4786
diff changeset
   695
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   696
	AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   697
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   698
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   699
13122
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   700
local excessHogsWarning = false
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   701
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   702
function onGearAdd(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   703
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   704
	if GetGearType(gear) == gtHedgehog then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   705
13122
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   706
		if GetHogClan(gear) > 1 then
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   707
			DeleteGear(gear)
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   708
			if not excessHogsWarning then
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   709
				WriteLnToChat(loc("Only two clans allowed! Excess hedgehogs will be removed."))
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   710
				excessHogsWarning = true
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   711
			end
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   712
		else
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   713
			hhs[numhhs] = gear
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   714
			numhhs = numhhs + 1
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   715
			SetEffect(gear, heResurrectable, 1)
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   716
		end
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   717
13122
cd1561b0337f CTF_Blizzard: Force clan limit of 2. Auto-remove excess hogs
Wuzzy <Wuzzy2@mail.ru>
parents: 13121
diff changeset
   718
	elseif GetGearType(gear) == gtRope then
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   719
		ropeGear = gear
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   720
	end
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   721
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   722
end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   723
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   724
function onGearDelete(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   725
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   726
	if (gear == fGear[0]) or (gear == fGear[1]) then
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   727
		FlagDeleted(gear)
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   728
	end
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   729
4871
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   730
	if GetGearType(gear) == gtRope then
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   731
		ropeGear = nil
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   732
	end
4a99a45ea886 bugfix for flag spawn, teleporter + rope
mikade
parents: 4843
diff changeset
   733
4953
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   734
	if GetGearType(gear) == gtHedgehog then
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   735
		for i = 0, (numhhs-1) do
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   736
			if gear == hhs[i] then
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   737
				
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   738
				for k = 0,1 do
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   739
					if gear == fThief[k] then
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   740
						FlagThiefDead(gear)
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   741
					end
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   742
				end				
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   743
				hhs[i] = nil	
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   744
			end		
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   745
		end
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   746
	end
ebd3dae634ca Fixed scoring exploit on Control and removed user branding from the map
mikade
parents: 4871
diff changeset
   747
4786
71fb9189d91c French translation finally gets some love
ourobolos
parents: 4764
diff changeset
   748
end