share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
author mikade
Wed, 14 Sep 2011 18:05:54 +0200
changeset 5900 37516a3bdb0e
parent 5894 86c59c34cdd5
child 5901 a00e567005be
permissions -rw-r--r--
Revert currently unneccessary changes to uScript. Don't allow way-points to be placed in land or outside of border boundaries
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
     1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
     2
------------------------------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
     3
-- RACER 0.1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
     4
-- map-independant racing script
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
     5
-- by mikade
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
     6
-----------------------------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
     7
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
     8
-----------------------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
     9
--0.1: took all the code from crazy racer and scrapped most of it
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    10
-----------------------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    11
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    12
-- Removed tumbler system
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    13
-- Removed extra adds like boosters etc
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    14
-- Added experimental waypoint placement system
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    15
-- More user feedback
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    16
-- Reduced race complexity limit to 5 waypoints
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    17
-- stop placement at complexity limit reached and end turn
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    18
-- guys dont keep racing after dying
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    19
-- invulnerable feasibility
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    20
-- reverted time keeping method
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    21
-- reduced feedback display time
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    22
-- colour-coded addcaptions
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    23
-- cleaned up code
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    24
-- support for more players properly added
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    25
-- tardis fix
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    26
-- remove airstrikes
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    27
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    28
-- i think the remainder 0 .456 sec of the tracktime isnt getting reset on newturn
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    29
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    30
-- update feedback
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    31
5894
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
    32
-------
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
    33
-- 0.2
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
    34
-------
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
    35
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
    36
-- allow gameflags
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
    37
-- extend time to 90s
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
    38
-- remove other air-attack based weps
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
    39
-- turn off water rise for sd
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
    40
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
    41
-------
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
    42
-- 0.3
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
    43
-------
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
    44
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
    45
-- prevent WP being placed in land
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
    46
-- prevent waypoints being placed outside border
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
    47
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    48
-----------------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    49
-- SCRIPT BEGINS
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    50
-----------------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    51
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    52
loadfile(GetDataPath() .. "Scripts/Locale.lua")()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    53
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    54
------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    55
-- Got Variables?
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    56
------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    57
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    58
local fMod = 1000000 -- 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    59
local roundLimit = 3
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    60
local roundNumber = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    61
local firstClan = 10
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    62
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    63
local fastX = {}
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    64
local fastY = {}
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    65
local fastCount = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    66
local fastIndex = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    67
local fastColour
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    68
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    69
local currX = {}
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    70
local currY = {}
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    71
local currCount = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    72
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    73
--------------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    74
-- hog and team tracking variales
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    75
--------------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    76
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    77
local numhhs = 0 -- store number of hedgehogs
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    78
local hhs = {} -- store hedgehog gears
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    79
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    80
local numTeams --  store the number of teams in the game
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    81
local teamNameArr = {}	-- store the list of teams
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    82
local teamClan = {}
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    83
local teamSize = {}	-- store how many hogs per team
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    84
local teamIndex = {} -- at what point in the hhs{} does each team begin
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    85
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    86
local teamComment = {}
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    87
local teamScore = {}
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    88
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    89
-------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    90
-- racer vars
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    91
--------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    92
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    93
local cGear = nil
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    94
local gTimer = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    95
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    96
local bestClan = nil
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    97
local bestTime = nil
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    98
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
    99
local gameBegun = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   100
local gameOver = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   101
local racerActive = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   102
local trackTime = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   103
local wpCheckCounter = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   104
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   105
local wpCirc = {}
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   106
local wpX = {}
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   107
local wpY = {}
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   108
local wpCol = {}
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   109
local wpActive = {}
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   110
local wpRad = 450 --75
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   111
local wpCount = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   112
local wpLimit = 5
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   113
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   114
-------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   115
-- general methods
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   116
-------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   117
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   118
function RebuildTeamInfo()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   119
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   120
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   121
	-- make a list of individual team names
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   122
	for i = 0, (TeamsCount-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   123
		teamNameArr[i] = " " -- = i
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   124
		teamSize[i] = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   125
		teamIndex[i] = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   126
		teamScore[i] = 100000
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   127
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   128
	numTeams = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   129
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   130
	for i = 0, (numhhs-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   131
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   132
		z = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   133
		unfinished = true
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   134
		while(unfinished == true) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   135
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   136
			newTeam = true
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   137
			tempHogTeamName = GetHogTeamName(hhs[i]) -- this is the new name
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   138
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   139
			if tempHogTeamName == teamNameArr[z] then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   140
				newTeam = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   141
				unfinished = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   142
			end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   143
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   144
			z = z + 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   145
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   146
			if z == TeamsCount then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   147
				unfinished = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   148
				if newTeam == true then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   149
					teamNameArr[numTeams] = tempHogTeamName
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   150
					numTeams = numTeams + 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   151
				end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   152
			end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   153
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   154
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   155
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   156
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   157
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   158
	-- find out how many hogs per team, and the index of the first hog in hhs
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   159
	for i = 0, (numTeams-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   160
		for z = 0, (numhhs-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   161
			if GetHogTeamName(hhs[z]) == teamNameArr[i] then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   162
				teamClan[i] = GetHogClan(hhs[z])
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   163
				if teamSize[i] == 0 then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   164
					teamIndex[i] = z -- should give starting index
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   165
				end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   166
				teamSize[i] = teamSize[i] + 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   167
				--add a pointer so this hog appears at i in hhs
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   168
			end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   169
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   170
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   171
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   172
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   173
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   174
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   175
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   176
-----------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   177
-- RACER METHODS
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   178
-----------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   179
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   180
function CheckWaypoints()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   181
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   182
	trackFinished = true
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   183
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   184
	for i = 0, (wpCount-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   185
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   186
		g1X, g1Y = GetGearPosition(CurrentHedgehog)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   187
		g2X, g2Y = wpX[i], wpY[i]
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   188
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   189
		g1X = g1X - g2X
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   190
		g1Y = g1Y - g2Y
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   191
		dist = (g1X*g1X) + (g1Y*g1Y)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   192
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   193
		--if i == 0 then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   194
		--	AddCaption(dist .. "/" .. (wpRad*wpRad) )
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   195
		--end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   196
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   197
		NR = (48/100*wpRad)/2
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   198
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   199
		if dist < (NR*NR) then
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   200
		--if dist < (wpRad*wpRad) then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   201
			--AddCaption("howdy")
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   202
			wpActive[i] = true
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   203
			wpCol[i] = GetClanColor(GetHogClan(CurrentHedgehog)) -- new				--GetClanColor(1)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   204
			SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i])
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   205
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   206
			wpRem = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   207
			for k = 0, (wpCount-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   208
				if wpActive[k] == false then
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   209
					wpRem = wpRem + 1
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   210
				end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   211
			end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   212
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   213
			AddCaption(loc("Way-Points Remaining") .. ": " .. wpRem,0xffba00ff,capgrpAmmoinfo)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   214
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   215
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   216
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   217
		if wpActive[i] == false then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   218
			trackFinished = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   219
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   220
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   221
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   222
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   223
	return(trackFinished)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   224
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   225
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   226
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   227
function AdjustScores()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   228
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   229
	if bestTime == nil then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   230
		bestTime = 100000
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   231
		bestClan = 10
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   232
		bestTimeComment = "N/A"
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   233
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   234
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   235
	newScore = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   236
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   237
	-- update this clan's time if the new track is better
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   238
	for i = 0, (numTeams-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   239
		if teamClan[i] == GetHogClan(CurrentHedgehog) then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   240
			if trackTime < teamScore[i] then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   241
				teamScore[i] = trackTime
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   242
				newScore = true
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   243
			else
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   244
				newScore = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   245
			end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   246
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   247
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   248
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   249
	--bestTime = 100000
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   250
	--bestClan = 10
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   251
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   252
	-- find the best time out of those so far
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   253
	for i = 0, (numTeams-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   254
		if teamScore[i] < bestTime then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   255
			bestTime = teamScore[i]
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   256
			bestClan = teamClan[i]
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   257
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   258
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   259
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   260
	if bestTime ~= 100000 then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   261
		bestTimeComment = (bestTime/1000) ..loc("s")
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   262
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   263
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   264
	if newScore == true then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   265
		if trackTime == bestTime then -- best time of the race
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   266
			ShowMission(loc("RACER"),
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   267
			loc("TRACK COMPLETED"),
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   268
			loc("NEW RACE RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" ..
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   269
			loc("WINNING TIME: ") .. bestTimeComment, 0, 4000)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   270
		else	-- best time for the clan
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   271
			ShowMission(loc("RACER"),
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   272
			loc("TRACK COMPLETED"),
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   273
			loc("NEW CLAN RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" ..
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   274
			loc("WINNING TIME: ") .. bestTimeComment, 4, 4000)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   275
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   276
	else -- not any kind of new score
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   277
		ShowMission(loc("RACER"),
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   278
		loc("TRACK COMPLETED"),
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   279
		loc("TIME: ") .. (trackTime/1000) ..loc("s") .. "|" ..
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   280
		loc("WINNING TIME: ") .. bestTimeComment, -amSkip, 4000)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   281
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   282
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   283
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   284
	--------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   285
	--new
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   286
	--------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   287
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   288
	if bestTime == trackTime then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   289
		--AddCaption("wooooooooooooooooooooooooooooo")
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   290
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   291
		fastColour = GetClanColor(GetHogClan(CurrentHedgehog))
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   292
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   293
		for i = 0, (currCount-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   294
			fastX[i] = currX[i]
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   295
			fastY[i] = currY[i]
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   296
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   297
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   298
		fastCount = currCount
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   299
		fastIndex = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   300
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   301
		--currCount = 0 -- is this needed?
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   302
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   303
	else
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   304
		currCount = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   305
		fastIndex = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   306
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   307
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   308
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   309
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   310
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   311
function CheckForNewRound()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   312
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   313
	if GetHogClan(CurrentHedgehog) == firstClan then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   314
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   315
		roundNumber = roundNumber + 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   316
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   317
		totalComment = ""
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   318
		for i = 0, (TeamsCount-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   319
				if teamNameArr[i] ~= " " then				-- teamScore[teamClan[i]]
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   320
					teamComment[i] = teamNameArr[i] .. ": " .. (teamScore[i]/1000) .. loc("s|")
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   321
					totalComment = totalComment .. teamComment[i]
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   322
				elseif teamNameArr[i] == " " then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   323
					teamComment[i] = "|"
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   324
				end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   325
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   326
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   327
		ShowMission(	loc("RACER"),
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   328
				loc("STATUS UPDATE"),
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   329
				loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" ..
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   330
				loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   331
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   332
		-- end game if its at round limit
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   333
		if roundNumber == roundLimit then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   334
			for i = 0, (numhhs-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   335
				if GetHogClan(hhs[i]) ~= bestClan then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   336
					SetEffect(hhs[i], heResurrectable, false)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   337
					SetHealth(hhs[i],0)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   338
				end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   339
			end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   340
			gameOver = true
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   341
			TurnTimeLeft = 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   342
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   343
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   344
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   345
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   346
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   347
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   348
function DisableTumbler()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   349
	currCount = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   350
	fastIndex = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   351
	TurnTimeLeft = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   352
	racerActive = false -- newadd
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   353
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   354
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   355
function HandleGhost()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   356
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   357
	-- get the current xy of the racer at this point
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   358
	currX[currCount] = GetX(CurrentHedgehog)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   359
	currY[currCount] = GetY(CurrentHedgehog)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   360
	currCount = currCount + 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   361
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   362
	-- draw a ping of smoke where the fastest player was at this point
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   363
	if (fastCount ~= 0) and (fastIndex < fastCount) then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   364
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   365
		fastIndex = fastIndex + 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   366
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   367
		tempE = AddVisualGear(fastX[fastIndex], fastY[fastIndex], vgtSmoke, 0, false)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   368
		g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   369
		SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, fastColour )
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   370
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   371
		--AddCaption("fC: " .. fastIndex .. " / " .. fastCount)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   372
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   373
	else
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   374
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   375
		--AddCaption("excep fC: " .. fastIndex .. " / " .. fastCount)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   376
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   377
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   378
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   379
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   380
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   381
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   382
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   383
----------------------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   384
-- GAME METHODS / EVENT HANDLERS
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   385
----------------------------------
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   386
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   387
function onGameInit()
5894
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
   388
	GameFlags = GameFlags + gfInfAttack + gfInvulnerable
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   389
	CaseFreq = 0
5894
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
   390
	TurnTime = 90000
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
   391
	WaterRise = 0
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   392
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   393
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   394
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   395
function onGameStart()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   396
	RebuildTeamInfo()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   397
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   398
	ShowMission	(
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   399
				loc("RACER"),
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   400
				loc("a Hedgewars mini-game"),
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   401
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   402
				loc("Build a track and race.") .. "|" ..
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   403
				loc("Round Limit:") .. " " .. roundLimit .. "|" ..
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   404
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   405
				"", 4, 4000
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   406
				)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   407
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   408
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   409
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   410
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   411
function PlaceWayPoint(x,y)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   412
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   413
	if (wpCount < wpLimit) then -- seems to not work with a hedgehog nil chek
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   414
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   415
		wpX[wpCount] = x
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   416
		wpY[wpCount] = y
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   417
		wpCol[wpCount] = 0xffffffff
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   418
		wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true)
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   419
																		--100
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   420
		SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 20, 100, 1, 10, 0, wpRad, 5, wpCol[wpCount])
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   421
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   422
		wpCount = wpCount + 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   423
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   424
		AddCaption(loc("Waypoint placed.") .. " " .. loc("Available points remaining: ") .. (wpLimit-wpCount))
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   425
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   426
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   427
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   428
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   429
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   430
function onNewTurn()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   431
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   432
	CheckForNewRound()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   433
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   434
	racerActive = false
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   435
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   436
	trackTime = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   437
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   438
	currCount = 0 -- hopefully this solves problem
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   439
	AddAmmo(CurrentHedgehog, amAirAttack, 0)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   440
	gTimer = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   441
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   442
	-- Set the waypoints to unactive on new round
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   443
	for i = 0,(wpCount-1) do
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   444
		wpActive[i] = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   445
		wpCol[i] = 0xffffffff
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   446
		SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i])
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   447
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   448
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   449
	-- Handle Starting Stage of Game
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   450
	if (gameOver == false) and (gameBegun == false) then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   451
		if wpCount >= 3 then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   452
			gameBegun = true
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   453
			roundNumber = 0
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   454
			firstClan = GetHogClan(CurrentHedgehog)
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   455
			ShowMission(loc("RACER"),
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   456
			loc("GAME BEGUN!!!"),
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   457
			loc("Complete the track as fast as you can!"), 2, 4000)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   458
		else
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   459
			ShowMission(loc("RACER"),
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   460
			loc("NOT ENOUGH WAYPOINTS"),
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   461
			loc("Place more waypoints using the 'Air Attack' weapon."), 2, 4000)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   462
			AddAmmo(CurrentHedgehog, amAirAttack, 4000)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   463
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   464
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   465
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   466
	if gameOver == true then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   467
		gameBegun = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   468
		racerActive = false -- newadd
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   469
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   470
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   471
	AddAmmo(CurrentHedgehog, amTardis, 0)
5894
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
   472
	AddAmmo(CurrentHedgehog, amDrillStrike, 0)
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
   473
	AddAmmo(CurrentHedgehog, amMineStrike, 0)
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
   474
	AddAmmo(CurrentHedgehog, amNapalm, 0)
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
   475
	AddAmmo(CurrentHedgehog, amPiano, 0)
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   476
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   477
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   478
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   479
function onGameTick()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   480
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   481
	-- airstrike detected, convert this into a potential waypoint spot
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   482
	if cGear ~= nil then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   483
		x,y = GetGearTarget(cGear)
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   484
		
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   485
		DeleteGear(cGear)
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   486
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   487
		if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   488
			AddCaption(loc("Please place the way-point in the open."))
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   489
		else
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   490
			PlaceWayPoint(x, y)
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   491
			if wpCount == wpLimit then
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   492
				AddCaption(loc("Race complexity limit reached."))
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   493
				DisableTumbler()
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   494
			end
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   495
		end
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   496
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   497
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   498
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   499
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   500
	-- start the player tumbling with a boom once their turn has actually begun
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   501
	if racerActive == false then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   502
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   503
		if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   504
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   505
			-- if the gamehas started put the player in the middle of the first
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   506
			--waypoint that was placed
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   507
			if gameBegun == true then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   508
				AddCaption(loc("Good to go!"))
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   509
				racerActive = true
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   510
				trackTime = 0
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   511
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   512
				SetGearPosition(CurrentHedgehog, wpX[0], wpY[0])
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   513
				AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtGrenade, 0, 0, 0, 1)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   514
				FollowGear(CurrentHedgehog)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   515
				ShowMission("...", "...", "...", 2, 1)
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   516
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   517
			else
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   518
				-- still in placement mode
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   519
			end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   520
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   521
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   522
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   523
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   524
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   525
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   526
	-- has the player started his tumbling spree?
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   527
	if (CurrentHedgehog ~= nil) then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   528
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   529
		--airstrike conversion used to be here
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   530
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   531
		-- if the RACE has started, show tracktimes and keep tabs on waypoints
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   532
		if (racerActive == true) and (gameBegun == true) then
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   533
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   534
			--ghost
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   535
			gTimer = gTimer + 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   536
			if gTimer == 15 then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   537
				gTimer = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   538
				HandleGhost()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   539
			end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   540
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   541
			trackTime = trackTime + 1
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   542
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   543
			wpCheckCounter = wpCheckCounter + 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   544
			if (wpCheckCounter == 100) then
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   545
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   546
				wpCheckCounter = 0
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   547
				AddCaption(trackTime/1000,GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   548
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   549
				if (CheckWaypoints() == true) then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   550
					AdjustScores()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   551
					racerActive = false
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   552
					DisableTumbler()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   553
				end
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   554
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   555
			end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   556
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   557
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   558
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   559
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   560
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   561
		-- if the player has expended his tunbling time, stop him tumbling
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   562
		if TurnTimeLeft <= 1 then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   563
			DisableTumbler()
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   564
		end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   565
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   566
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   567
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   568
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   569
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   570
function onGearResurrect(gear)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   571
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   572
	AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   573
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   574
	-- if the player stops and "dies" or flies into water, stop him racing
5894
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
   575
	--[[if gear == CurrentHedgehog then
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   576
		DisableTumbler()
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   577
		ShowMission(loc("RACER"),
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   578
		loc("TRACK FAILED!"),
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   579
		loc("WINNING TIME: ") .. bestTimeComment, -amSkip, 4000)
5894
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
   580
	end]]
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   581
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   582
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   583
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   584
function onGearAdd(gear)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   585
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   586
	if GetGearType(gear) == gtHedgehog then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   587
		hhs[numhhs] = gear
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   588
		numhhs = numhhs + 1
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   589
		SetEffect(gear, heResurrectable, true)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   590
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   591
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   592
	if GetGearType(gear) == gtAirAttack then
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   593
		cGear = gear
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   594
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   595
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   596
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   597
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   598
function onGearDelete(gear)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   599
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   600
	if CurrentHedgehog ~= nil then
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   601
		FollowGear(CurrentHedgehog)
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   602
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   603
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   604
	if GetGearType(gear) == gtAirAttack then
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   605
		cGear = nil
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   606
	end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   607
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   608
end
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   609
5894
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
   610
--[[function onAmmoStoreInit()
5900
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   611
	SetAmmo(amRope, 9, 0, 0, 0)
37516a3bdb0e Revert currently unneccessary changes to uScript.
mikade
parents: 5894
diff changeset
   612
	SetAmmo(amJetpack, 9, 0, 0, 0)
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   613
	SetAmmo(amSkip, 9, 0, 0, 0)
5894
86c59c34cdd5 Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents: 5845
diff changeset
   614
end]]
5845
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   615
b20a1e0a0e7e Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff changeset
   616