share/hedgewars/Data/Scripts/Multiplayer/Racer.lua
author Wuzzy <almikes@aol.com>
Wed, 13 Apr 2016 14:00:53 +0200
changeset 11926 ace20b1d8d53
parent 11925 7123bfc9643c
child 11927 72593678e8d6
permissions -rw-r--r--
Add “rounds” script parameter for Racer
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
     1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
     2
------------------------------------------
11647
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
     3
-- RACER 0.8
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
     4
-- map-independant racing script
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
     5
-- by mikade
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
     6
-----------------------------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
     7
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
     8
-----------------------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
     9
--0.1: took all the code from crazy racer and scrapped most of it
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    10
-----------------------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    11
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    12
-- Removed tumbler system
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    13
-- Removed extra adds like boosters etc
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    14
-- Added experimental waypoint placement system
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    15
-- More user feedback
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    16
-- Reduced race complexity limit to 5 waypoints
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    17
-- stop placement at complexity limit reached and end turn
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    18
-- guys dont keep racing after dying
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    19
-- invulnerable feasibility
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    20
-- reverted time keeping method
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    21
-- reduced feedback display time
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    22
-- colour-coded addcaptions
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    23
-- cleaned up code
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    24
-- support for more players properly added
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    25
-- tardis fix
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    26
-- remove airstrikes
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    27
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    28
-- i think the remainder 0 .456 sec of the tracktime isnt getting reset on newturn
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    29
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    30
-- update feedback
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    31
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    32
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    33
-- 0.2
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    34
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    35
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    36
-- allow gameflags
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    37
-- extend time to 90s
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    38
-- remove other air-attack based weps
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    39
-- turn off water rise for sd
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    40
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    41
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    42
-- 0.3
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    43
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    44
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    45
-- prevent WP being placed in land
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    46
-- prevent waypoints being placed outside border
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    47
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    48
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    49
-- 0.4
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    50
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    51
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    52
-- update user feedback
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    53
-- add more sounds
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    54
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    55
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    56
-- 0.5
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    57
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    58
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    59
-- fix ghost disappearing if hog falls in water or somehow dies
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    60
-- lengthen ghost tracking interval to improve performance on slower machines
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    61
-- increase waypoint limit to 8
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    62
-- allow for persistent showmission information
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    63
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    64
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    65
-- 0.6
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    66
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    67
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    68
-- remove hogs from racing area as per request
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    69
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    70
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    71
-- 0.7
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    72
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    73
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    74
-- switch to first available weapon if starting race with no weapon selected
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    75
11647
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
    76
-------
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
    77
-- 0.8
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
    78
-------
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
    79
-- allow different boost directions
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
    80
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    81
-----------------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    82
-- SCRIPT BEGINS
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    83
-----------------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    84
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    85
HedgewarsScriptLoad("/Scripts/Locale.lua")
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    86
HedgewarsScriptLoad("/Scripts/OfficialChallenges.lua")
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    87
HedgewarsScriptLoad("/Scripts/Params.lua")
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    88
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    89
------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    90
-- Got Variables?
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    91
------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    92
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    93
local fMod = 1000000 -- 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    94
local roundLimit = 3
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    95
local roundNumber = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    96
local firstClan = 10
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    97
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    98
local fastX = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
    99
local fastY = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   100
local fastCount = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   101
local fastIndex = 0
11581
fd02a080d962 - Fix room config being sent unmodified
unc0rr
parents: 11569
diff changeset
   102
local fastColour = 0xffffffff
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   103
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   104
local currX = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   105
local currY = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   106
local currCount = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   107
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   108
local specialPointsX = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   109
local specialPointsY = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   110
local specialPointsCount = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   111
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   112
local TeamRope = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   113
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   114
--------------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   115
-- hog and team tracking variales
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   116
--------------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   117
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   118
local numhhs = 0 -- store number of hedgehogs
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   119
local hhs = {} -- store hedgehog gears
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   120
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   121
local numTeams --  store the number of teams in the game
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   122
local teamNameArr = {}  -- store the list of teams
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   123
local teamClan = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   124
local teamSize = {}     -- store how many hogs per team
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   125
local teamIndex = {} -- at what point in the hhs{} does each team begin
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   126
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   127
local teamComment = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   128
local teamScore = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   129
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   130
-------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   131
-- racer vars
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   132
--------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   133
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   134
local cGear = nil
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   135
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   136
local bestClan = nil
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   137
local bestTime = nil
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   138
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   139
local gameBegun = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   140
local gameOver = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   141
local racerActive = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   142
local trackTime = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   143
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   144
local wpCirc = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   145
local wpX = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   146
local wpY = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   147
local wpCol = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   148
local wpActive = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   149
local wpRad = 450 --75
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   150
local wpCount = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   151
local wpLimit = 8
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   152
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   153
local usedWeapons = {}
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   154
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   155
local roundN
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   156
local lastRound
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   157
local RoundHasChanged
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   158
11647
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   159
local boostX = 0
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   160
local boostY = 0
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   161
local boostValue = 1
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   162
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   163
-------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   164
-- general methods
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   165
-------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   166
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   167
function onParameters()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   168
    parseParams()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   169
    if params["teamrope"] ~= nil then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   170
        TeamRope = true
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   171
    end
11926
ace20b1d8d53 Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents: 11925
diff changeset
   172
    if params["rounds"] ~= nil then
ace20b1d8d53 Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents: 11925
diff changeset
   173
        roundLimit = math.max(1, math.floor(tonumber(params["rounds"])))
ace20b1d8d53 Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents: 11925
diff changeset
   174
        if type(roundLimit) ~= "number" then
ace20b1d8d53 Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents: 11925
diff changeset
   175
             roundLimit = 3
ace20b1d8d53 Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents: 11925
diff changeset
   176
        end
ace20b1d8d53 Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents: 11925
diff changeset
   177
    end
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   178
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   179
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   180
function RebuildTeamInfo()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   181
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   182
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   183
        -- make a list of individual team names
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   184
        for i = 0, (TeamsCount-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   185
                teamNameArr[i] = " " -- = i
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   186
                teamSize[i] = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   187
                teamIndex[i] = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   188
                teamScore[i] = 100000
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   189
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   190
        numTeams = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   191
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   192
        for i = 0, (numhhs-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   193
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   194
                z = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   195
                unfinished = true
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   196
                while(unfinished == true) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   197
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   198
                        newTeam = true
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   199
                        tempHogTeamName = GetHogTeamName(hhs[i]) -- this is the new name
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   200
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   201
                        if tempHogTeamName == teamNameArr[z] then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   202
                                newTeam = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   203
                                unfinished = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   204
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   205
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   206
                        z = z + 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   207
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   208
                        if z == TeamsCount then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   209
                                unfinished = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   210
                                if newTeam == true then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   211
                                        teamNameArr[numTeams] = tempHogTeamName
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   212
                                        numTeams = numTeams + 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   213
                                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   214
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   215
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   216
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   217
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   218
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   219
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   220
        -- find out how many hogs per team, and the index of the first hog in hhs
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   221
        for i = 0, (numTeams-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   222
                for z = 0, (numhhs-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   223
                        if GetHogTeamName(hhs[z]) == teamNameArr[i] then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   224
                                teamClan[i] = GetHogClan(hhs[z])
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   225
                                if teamSize[i] == 0 then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   226
                                        teamIndex[i] = z -- should give starting index
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   227
                                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   228
                                teamSize[i] = teamSize[i] + 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   229
                                --add a pointer so this hog appears at i in hhs
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   230
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   231
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   232
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   233
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   234
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   235
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   236
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   237
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   238
-----------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   239
-- RACER METHODS
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   240
-----------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   241
11647
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   242
function onLeft()
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   243
	boostX = boostX +boostValue
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   244
end
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   245
function onLeftUp()
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   246
	boostX = boostX -boostValue
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   247
end
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   248
function onRight()
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   249
	boostX = boostX -boostValue
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   250
end
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   251
function onRightUp()
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   252
	boostX = boostX +boostValue
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   253
end
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   254
function onUp()
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   255
	boostY = boostY +boostValue
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   256
end
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   257
function onUpUp()
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   258
	boostY = boostY -boostValue
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   259
end
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   260
function onDown()
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   261
	boostY = boostY -boostValue
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   262
end
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   263
function onDownUp()
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   264
	boostY = boostY +boostValue
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   265
end
b4d621700bbb Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents: 11585
diff changeset
   266
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   267
function CheckWaypoints()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   268
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   269
        trackFinished = true
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   270
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   271
        for i = 0, (wpCount-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   272
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   273
                g1X, g1Y = GetGearPosition(CurrentHedgehog)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   274
                g2X, g2Y = wpX[i], wpY[i]
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   275
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   276
                g1X = g1X - g2X
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   277
                g1Y = g1Y - g2Y
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   278
                dist = (g1X*g1X) + (g1Y*g1Y)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   279
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   280
                --if i == 0 then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   281
                --      AddCaption(dist .. "/" .. (wpRad*wpRad) )
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   282
                --end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   283
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   284
                NR = (48/100*wpRad)/2
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   285
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   286
                if dist < (NR*NR) then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   287
                --if dist < (wpRad*wpRad) then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   288
                        --AddCaption("howdy")
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   289
                        wpCol[i] = GetClanColor(GetHogClan(CurrentHedgehog)) -- new                             --GetClanColor(1)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   290
                        SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i])
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   291
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   292
                        wpRem = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   293
                        for k = 0, (wpCount-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   294
                                if wpActive[k] == false then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   295
                                        wpRem = wpRem + 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   296
                                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   297
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   298
11925
7123bfc9643c Racer: Don't mess with ammo display when touching waypoint
Wuzzy <almikes@aol.com>
parents: 11924
diff changeset
   299
                        if wpActive[i] == false then
7123bfc9643c Racer: Don't mess with ammo display when touching waypoint
Wuzzy <almikes@aol.com>
parents: 11924
diff changeset
   300
                                AddCaption(string.format(loc("Waypoints remaining: %d"), wpRem-1),0xffba00ff,capgrpGameState)
7123bfc9643c Racer: Don't mess with ammo display when touching waypoint
Wuzzy <almikes@aol.com>
parents: 11924
diff changeset
   301
                        end
7123bfc9643c Racer: Don't mess with ammo display when touching waypoint
Wuzzy <almikes@aol.com>
parents: 11924
diff changeset
   302
                        wpActive[i] = true
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   303
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   304
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   305
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   306
                if wpActive[i] == false then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   307
                        trackFinished = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   308
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   309
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   310
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   311
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   312
        return(trackFinished)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   313
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   314
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   315
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   316
function AdjustScores()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   317
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   318
        if bestTime == nil then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   319
                bestTime = 100000
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   320
                bestClan = 10
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   321
                bestTimeComment = "N/A"
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   322
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   323
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   324
        newScore = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   325
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   326
        -- update this clan's time if the new track is better
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   327
        for i = 0, (numTeams-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   328
                if teamClan[i] == GetHogClan(CurrentHedgehog) then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   329
                        if trackTime < teamScore[i] then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   330
                                teamScore[i] = trackTime
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   331
                                newScore = true
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   332
                        else
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   333
                                newScore = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   334
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   335
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   336
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   337
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   338
        --bestTime = 100000
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   339
        --bestClan = 10
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   340
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   341
        -- find the best time out of those so far
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   342
        for i = 0, (numTeams-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   343
                if teamScore[i] < bestTime then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   344
                        bestTime = teamScore[i]
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   345
                        bestClan = teamClan[i]
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   346
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   347
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   348
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   349
        if bestTime ~= 100000 then
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   350
                bestTimeComment = string.format(loc("%.1fs"), (bestTime/1000))
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   351
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   352
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   353
        if newScore == true then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   354
                if trackTime == bestTime then -- best time of the race
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   355
                        ShowMission(loc("Racer"),
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   356
                        loc("Track completed!"),
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   357
                        string.format(loc("New race record: %.1fs"), (trackTime/1000)) .. "|" ..
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   358
                        string.format(loc("Winning time: %s"), bestTimeComment), 0, 4000)
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   359
                        PlaySound(sndHomerun)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   360
                else    -- best time for the clan
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   361
                        ShowMission(loc("Racer"),
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   362
                        loc("Track completed!"),
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   363
                        string.format(loc("New clan record: %.1fs"), (trackTime/1000)) .. "|" ..
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   364
                        string.format(loc("Winning time: %s"), bestTimeComment), 4, 4000)
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   365
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   366
        else -- not any kind of new score
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   367
                ShowMission(loc("Racer"),
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   368
                loc("Track completed!"),
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   369
                string.format(loc("Time: %.1fs"), (trackTime/1000)) .. "|" ..
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   370
                string.format(loc("Winning time: %s"), bestTimeComment), -amSkip, 4000)
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   371
                PlaySound(sndHellish)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   372
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   373
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   374
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   375
        --------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   376
        --new
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   377
        --------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   378
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   379
        if bestTime == trackTime then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   380
                --AddCaption("wooooooooooooooooooooooooooooo")
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   381
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   382
                fastColour = GetClanColor(GetHogClan(CurrentHedgehog))
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   383
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   384
                for i = 0, (currCount-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   385
                        fastX[i] = currX[i]
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   386
                        fastY[i] = currY[i]
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   387
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   388
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   389
                fastCount = currCount
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   390
                fastIndex = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   391
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   392
                --currCount = 0 -- is this needed?
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   393
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   394
        else
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   395
                currCount = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   396
                fastIndex = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   397
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   398
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   399
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   400
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   401
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   402
function onNewRound()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   403
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   404
        roundNumber = roundNumber + 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   405
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   406
        totalComment = ""
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   407
        for i = 0, (TeamsCount-1) do
11923
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   408
                        if teamNameArr[i] ~= " " and teamScore[i] ~= -1 then
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   409
                                teamComment[i] = string.format(loc("%s: %.1fs"), teamNameArr[i], (teamScore[i]/1000)) .. "|"
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   410
                        else
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   411
                                teamComment[i] = string.format(loc("%s: N/A"), teamNameArr[i]) .. "|"
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   412
                        end
11923
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   413
                        totalComment = totalComment .. teamComment[i]
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   414
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   415
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   416
        ShowMission(    loc("Racer"),
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   417
                                        loc("Status update"),
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   418
                                        string.format(loc("Rounds complete: %d/%d"), roundNumber, roundLimit) .. "|" .. " " .. "|" ..
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   419
                                        loc("Best team times: ") .. "|" .. totalComment, 0, 4000)
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   420
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   421
        -- end game if its at round limit
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   422
        if roundNumber >= roundLimit then
11923
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   423
                gameOver = true
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   424
                TurnTimeLeft = 10000000
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   425
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   426
                -- Sort the scores for the ranking list
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   427
                local unfinishedArray = {}
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   428
                local sortedTeams = {}
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   429
                local k = 1
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   430
                for i = 0, TeamsCount-1 do
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   431
                        if teamScore[i] ~= 100000 and teamNameArr[i] ~= " " then
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   432
                               sortedTeams[k] = {}
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   433
                               sortedTeams[k].name = teamNameArr[i]
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   434
                               sortedTeams[k].score = teamScore[i]
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   435
                               k = k + 1
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   436
                        else
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   437
                               table.insert(unfinishedArray, string.format(loc("%s did not finish the race."), teamNameArr[i]))
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   438
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   439
                end
11923
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   440
                table.sort(sortedTeams, function(team1, team2) return team1.score < team2.score end)
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   441
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   442
                -- Write all the stats!
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   443
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   444
                for i = 1, #sortedTeams do
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   445
                        SendStat(siPointType, loc("milliseconds"))
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   446
                        SendStat(siPlayerKills, sortedTeams[i].score, sortedTeams[i].name)
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   447
                end
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   448
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   449
                if #sortedTeams >= 1 then
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   450
                        SendStat(siGameResult, string.format(loc("%s wins!"), sortedTeams[1].name))
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   451
                        SendStat(siGameResult, string.format(loc("%s wins!"), sortedTeams[1].name))
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   452
                        SendStat(siCustomAchievement, string.format(loc("%s wins with a best time of %.1fs."), sortedTeams[1].name, (sortedTeams[1].score/1000)))
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   453
                        for i=1,#unfinishedArray do
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   454
                                 SendStat(siCustomAchievement, unfinishedArray[i])
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   455
                        end
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   456
                else
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   457
                        SendStat(siGameResult, loc("Round draw"))
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   458
                        SendStat(siCustomAchievement, loc("Nobody managed to finish the race. What a shame!"))
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   459
                        SendStat(siCustomAchievement, loc("Maybe you should try easier waypoints next time."))
11923
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   460
                end
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   461
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   462
                -- Game over
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   463
                EndGame()
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   464
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   465
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   466
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   467
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   468
function CheckForNewRound()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   469
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   470
        -------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   471
        ------ new
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   472
        -------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   473
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   474
        --[[turnN = turnN + 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   475
        if gameBegun == false then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   476
                if turnN == 2 then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   477
                        for i = 0, (numhhs-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   478
                                if hhs[i] ~= nil then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   479
                                        SetEffect(hhs[i], heResurrectable, 0)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   480
                                        SetHealth(hhs[i],0)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   481
                                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   482
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   483
                        gameOver = true
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   484
                        TurnTimeLeft = 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   485
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   486
        else
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   487
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   488
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   489
        end]]
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   490
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   491
        --[[if roundBegun == true then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   492
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   493
                if RoundHasChanged == true then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   494
                        roundN = roundN + 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   495
                        RoundHasChanged = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   496
                        onNewRound()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   497
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   498
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   499
                if lastRound ~= TotalRounds then -- new round, but not really
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   500
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   501
                        if RoundHasChanged == false then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   502
                                RoundHasChanged = true
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   503
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   504
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   505
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   506
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   507
                AddCaption("RoundN:" .. roundN .. "; " .. "TR: " .. TotalRounds)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   508
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   509
                lastRound = TotalRounds
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   510
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   511
        end]]
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   512
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   513
        ------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   514
        ----- old
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   515
        ------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   516
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   517
        if GetHogClan(CurrentHedgehog) == firstClan then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   518
                onNewRound()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   519
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   520
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   521
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   522
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   523
function DisableTumbler()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   524
        currCount = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   525
        fastIndex = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   526
        TurnTimeLeft = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   527
        racerActive = false -- newadd
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   528
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   529
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   530
function HandleGhost()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   531
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   532
        -- get the current xy of the racer at this point
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   533
        currX[currCount] = GetX(CurrentHedgehog)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   534
        currY[currCount] = GetY(CurrentHedgehog)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   535
        currCount = currCount + 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   536
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   537
        -- draw a ping of smoke where the fastest player was at this point
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   538
        if (fastCount ~= 0) and (fastIndex < fastCount) then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   539
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   540
                fastIndex = fastIndex + 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   541
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   542
                tempE = AddVisualGear(fastX[fastIndex], fastY[fastIndex], vgtSmoke, 0, false)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   543
                g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   544
                SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, fastColour )
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   545
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   546
                --AddCaption("fC: " .. fastIndex .. " / " .. fastCount)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   547
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   548
        else
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   549
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   550
                --AddCaption("excep fC: " .. fastIndex .. " / " .. fastCount)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   551
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   552
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   553
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   554
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   555
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   556
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   557
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   558
function TryRepositionHogs()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   559
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   560
	if MapHasBorder() == true then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   561
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   562
		for i = 0, (numhhs-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   563
			if hhs[i] ~= nil then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   564
				SetGearPosition(hhs[i],GetX(hhs[i]), TopY-10)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   565
			end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   566
		end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   567
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   568
	end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   569
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   570
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   571
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   572
----------------------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   573
-- GAME METHODS / EVENT HANDLERS
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   574
----------------------------------
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   575
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   576
function onGameInit()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   577
        EnableGameFlags(gfInfAttack, gfInvulnerable)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   578
        CaseFreq = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   579
        TurnTime = 90000
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   580
        WaterRise = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   581
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   582
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   583
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   584
function onGameStart()
11923
85cbb2368269 Implement stats screen for Racer
Wuzzy <almikes@aol.com>
parents: 11648
diff changeset
   585
        SendHealthStatsOff()
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   586
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   587
        roundN = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   588
        lastRound = TotalRounds
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   589
        RoundHasChanged = false -- true
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   590
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   591
        for i = 0, (specialPointsCount-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   592
                PlaceWayPoint(specialPointsX[i], specialPointsY[i])
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   593
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   594
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   595
        RebuildTeamInfo()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   596
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   597
        ShowMission     (
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   598
                                loc("Racer"),
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   599
                                loc("A Hedgewars mini-game"),
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   600
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   601
                                loc("Build a track and race.") .. "|" ..
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   602
                                string.format(loc("Round limit: %d"), roundLimit) .. "|" ..
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   603
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   604
                                "", 4, 4000
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   605
                                )
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   606
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   607
        TryRepositionHogs()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   608
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   609
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   610
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   611
function PlaceWayPoint(x,y)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   612
    if not racerActive then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   613
        if wpCount == 0 or wpX[wpCount - 1] ~= x or wpY[wpCount - 1] ~= y then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   614
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   615
            wpX[wpCount] = x
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   616
            wpY[wpCount] = y
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   617
            wpCol[wpCount] = 0xffffffff
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   618
            wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true)
11563
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   619
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   620
            SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 20, 100, 1, 10, 0, wpRad, 5, wpCol[wpCount])
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   621
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   622
            wpCount = wpCount + 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   623
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   624
            AddCaption(string.format(loc("Waypoint placed. Available points remaining: %d"), wpLimit-wpCount))
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   625
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   626
    end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   627
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   628
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   629
function onSpecialPoint(x,y,flag)
11563
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   630
    if flag == 99 then
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   631
        fastX[fastCount] = x
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   632
        fastY[fastCount] = y
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   633
        fastCount = fastCount + 1
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   634
    else
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   635
        addHashData(x)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   636
        addHashData(y)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   637
        addHashData(flag)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   638
        specialPointsX[specialPointsCount] = x
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   639
        specialPointsY[specialPointsCount] = y
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   640
        specialPointsCount = specialPointsCount + 1
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   641
    end
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   642
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   643
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   644
function onNewTurn()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   645
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   646
        CheckForNewRound()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   647
        TryRepositionHogs()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   648
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   649
        racerActive = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   650
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   651
        trackTime = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   652
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   653
        currCount = 0 -- hopefully this solves problem
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   654
        AddAmmo(CurrentHedgehog, amAirAttack, 0)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   655
        gTimer = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   656
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   657
        -- Set the waypoints to unactive on new round
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   658
        for i = 0,(wpCount-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   659
                wpActive[i] = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   660
                wpCol[i] = 0xffffffff
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   661
                SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i])
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   662
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   663
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   664
        -- Handle Starting Stage of Game
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   665
        if (gameOver == false) and (gameBegun == false) then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   666
                if wpCount >= 3 then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   667
                        gameBegun = true
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   668
                        roundNumber = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   669
                        firstClan = GetHogClan(CurrentHedgehog)
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   670
                        ShowMission(loc("Racer"),
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   671
                        loc("A Hedgewars mini-game"),
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   672
                        loc("Complete the track as fast as you can!"), 2, 4000)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   673
                else
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   674
                        ShowMission(loc("Racer"),
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   675
                        loc("Waypoint placement phase"),
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   676
                        loc("Place more waypoints using the 'Air Attack' weapon."), 2, 4000)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   677
                        AddAmmo(CurrentHedgehog, amAirAttack, 4000)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   678
                        SetWeapon(amAirAttack)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   679
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   680
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   681
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   682
        if gameOver == true then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   683
                gameBegun = false
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   684
                racerActive = false -- newadd
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   685
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   686
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   687
        AddAmmo(CurrentHedgehog, amTardis, 0)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   688
        AddAmmo(CurrentHedgehog, amDrillStrike, 0)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   689
        AddAmmo(CurrentHedgehog, amMineStrike, 0)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   690
        AddAmmo(CurrentHedgehog, amNapalm, 0)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   691
        AddAmmo(CurrentHedgehog, amPiano, 0)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   692
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   693
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   694
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   695
function onGameTick20()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   696
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   697
        -- airstrike detected, convert this into a potential waypoint spot
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   698
        if cGear ~= nil then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   699
                x,y = GetGearPosition(cGear)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   700
                if x > -9000 then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   701
                        x,y = GetGearTarget(cGear)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   702
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   703
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   704
                        if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   705
                                AddCaption(loc("Please place the waypoint in the air, within the map boundaries"))
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   706
                                PlaySound(sndDenied)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   707
                        elseif (y > WaterLine-50) then
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   708
                                AddCaption(loc("Please place the waypoint further away from the waterline"))
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   709
                                PlaySound(sndDenied)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   710
                        else
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   711
                                PlaceWayPoint(x, y)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   712
                                if wpCount == wpLimit then
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   713
                                        AddCaption(loc("Race complexity limit reached"))
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   714
                                        DisableTumbler()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   715
                                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   716
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   717
                else
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   718
                        DeleteGear(cGear)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   719
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   720
        SetGearPosition(cGear, -10000, 0)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   721
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   722
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   723
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   724
        -- start the player tumbling with a boom once their turn has actually begun
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   725
        if racerActive == false then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   726
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   727
                if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   728
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   729
                        -- if the gamehas started put the player in the middle of the first
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   730
                        --waypoint that was placed
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   731
                        if gameBegun == true then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   732
                                AddCaption(loc("Good to go!"))
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   733
                                racerActive = true
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   734
                                trackTime = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   735
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   736
                                SetGearPosition(CurrentHedgehog, wpX[0], wpY[0])
11648
mikade <redgrinner@gmail.com>
parents: 11647
diff changeset
   737
                                AddGear(GetX(CurrentHedgehog)+boostX, GetY(CurrentHedgehog)+boostY, gtGrenade, 0, 0, 0, 1)
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   738
                                FollowGear(CurrentHedgehog)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   739
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   740
                                HideMission()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   741
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   742
                                -- don't start empty-handed
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   743
                                if (GetCurAmmoType() == amNothing) then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   744
                                        SetNextWeapon()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   745
                                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   746
                        else
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   747
                                -- still in placement mode
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   748
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   749
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   750
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   751
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   752
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   753
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   754
        -- has the player started his tumbling spree?
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   755
        if (CurrentHedgehog ~= nil) then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   756
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   757
                --airstrike conversion used to be here
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   758
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   759
                -- if the RACE has started, show tracktimes and keep tabs on waypoints
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   760
                if (racerActive == true) and (gameBegun == true) then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   761
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   762
                        --ghost
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   763
                        if GameTime%40 == 0 then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   764
                                HandleGhost()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   765
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   766
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   767
                        trackTime = trackTime + 20
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   768
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   769
                        if GameTime%100 == 0 then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   770
11924
ce277e51b603 Racer: Clean up strings
Wuzzy <almikes@aol.com>
parents: 11923
diff changeset
   771
                                AddCaption(string.format(loc("Time: %.1fs"), (trackTime/1000)),GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   772
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   773
                                if (CheckWaypoints() == true) then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   774
                                        AdjustScores()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   775
                                        DisableTumbler()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   776
                                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   777
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   778
                        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   779
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   780
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   781
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   782
                -- if the player has expended his tunbling time, stop him tumbling
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   783
                if TurnTimeLeft <= 20 then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   784
                        DisableTumbler()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   785
                end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   786
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   787
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   788
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   789
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   790
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   791
function onGearResurrect(gear)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   792
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   793
        AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   794
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   795
        if gear == CurrentHedgehog then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   796
                DisableTumbler()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   797
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   798
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   799
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   800
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   801
function onGearAdd(gear)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   802
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   803
        if GetGearType(gear) == gtHedgehog then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   804
                hhs[numhhs] = gear
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   805
                numhhs = numhhs + 1
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   806
                SetEffect(gear, heResurrectable, 1)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   807
        elseif GetGearType(gear) == gtAirAttack then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   808
                cGear = gear
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   809
        elseif GetGearType(gear) == gtRope and TeamRope then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   810
            SetTag(gear,1)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   811
            SetGearValues(gear,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,GetClanColor(GetHogClan(CurrentHedgehog)))
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   812
        elseif GetGearType(gear) == gtAirMine then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   813
            DeleteGear(gear)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   814
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   815
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   816
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   817
function onGearDelete(gear)
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   818
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   819
        if GetGearType(gear) == gtAirAttack then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   820
                cGear = nil
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   821
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   822
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   823
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   824
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   825
function onAttack()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   826
    at = GetCurAmmoType()
11563
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   827
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   828
    usedWeapons[at] = 0
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   829
end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   830
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   831
function onAchievementsDeclaration()
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   832
    usedWeapons[amSkip] = nil
11563
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   833
    usedWeapons[amExtraTime] = nil
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   834
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   835
    usedRope = usedWeapons[amRope] ~= nil
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   836
    usedPortal = usedWeapons[amPortalGun] ~= nil
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   837
    usedSaucer = usedWeapons[amJetpack] ~= nil
11563
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   838
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   839
    usedWeapons[amNothing] = nil
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   840
    usedWeapons[amRope] = nil
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   841
    usedWeapons[amPortalGun] = nil
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   842
    usedWeapons[amJetpack] = nil
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   843
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   844
    usedOther = next(usedWeapons) ~= nil
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   845
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   846
    if usedOther then -- smth besides nothing, skip, rope, portal or saucer used
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   847
        raceType = "unknown race"
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   848
    elseif usedRope and not usedPortal and not usedSaucer then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   849
        raceType = "rope race"
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   850
    elseif not usedRope and usedPortal and not usedSaucer then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   851
        raceType = "portal race"
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   852
    elseif not usedRope and not usedPortal and usedSaucer then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   853
        raceType = "saucer race"
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   854
    elseif (usedRope or usedPortal or usedSaucer or usedOther) == false then -- no weapons used at all?
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   855
        raceType = "no tools race"
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   856
    else -- at least two of rope, portal and saucer used
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   857
        raceType = "mixed race"
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   858
    end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   859
11545
86528b0cd491 detectMap() rewrite with more sane approach, also check waypoints placement to avoid cheating
unc0rr
parents: 11542
diff changeset
   860
    map = detectMapWithDigest()
11563
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11545
diff changeset
   861
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   862
    for i = 0, (numTeams-1) do
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   863
        if teamScore[i] < 100000 then
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   864
            DeclareAchievement(raceType, teamNameArr[i], map, teamScore[i])
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   865
        end
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   866
    end
11569
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
   867
11585
026c329b1a13 Don't dump ghost points if map isn't detected
unc0rr
parents: 11581
diff changeset
   868
    if map ~= nil and fastCount > 0 then
11569
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
   869
        StartGhostPoints(fastCount)
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
   870
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
   871
        for i = 0, (fastCount - 1) do
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
   872
            DumpPoint(fastX[i], fastY[i])
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
   873
        end
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
   874
    end
10856
d080b8d4c114 team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents: 10847
diff changeset
   875
end