share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
author mikade <redgrinner@gmail.com>
Wed, 13 May 2015 23:01:00 +0900
changeset 10945 2570fcfddf2a
parent 10943 d90706a2183e
child 10946 c6cf08ee999e
permissions -rw-r--r--
hopefully fix some placements
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
     1
------------------------------------------
10943
d90706a2183e migrate maps, new map, minor fixes
mikade <redgrinner@gmail.com>
parents: 10940
diff changeset
     2
-- TECH RACER v0.5
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
     3
-----------------------------------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
     4
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
     5
--------------
10940
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
     6
-- TO DO
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
     7
--------------
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
     8
-- allow scrolling of maps
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
     9
-- place waypoints for the registered maps automatically.
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    10
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    11
--------------
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    12
--0.2
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    13
--------------
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    14
-- should work better "out the box"
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    15
-- changed map generation
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    16
-- put a hog limiter in place
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    17
-- removed parsecommand
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    18
-- fix one of the test maps
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    19
-- hopefully added some support for future official challenges etc
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    20
-- changed theme
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    21
-- minor cleanups?
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    22
10914
69a0ad28ae8e new test for lols
mikade <redgrinner@gmail.com>
parents: 10897
diff changeset
    23
--------------
69a0ad28ae8e new test for lols
mikade <redgrinner@gmail.com>
parents: 10897
diff changeset
    24
--0.3
69a0ad28ae8e new test for lols
mikade <redgrinner@gmail.com>
parents: 10897
diff changeset
    25
--------------
69a0ad28ae8e new test for lols
mikade <redgrinner@gmail.com>
parents: 10897
diff changeset
    26
-- ehh, scrap everything? those old maps probably still desync so they can die for now
10918
1b878d1d32ce fix techracer map 3
mikade <redgrinner@gmail.com>
parents: 10915
diff changeset
    27
-- hopefully fix map 3
1b878d1d32ce fix techracer map 3
mikade <redgrinner@gmail.com>
parents: 10915
diff changeset
    28
-- add two new crappy map to test an idea.
10914
69a0ad28ae8e new test for lols
mikade <redgrinner@gmail.com>
parents: 10897
diff changeset
    29
10940
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    30
--------------
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    31
--0.4
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    32
--------------
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    33
-- updated version text (lol)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    34
-- some preliminary support for hand-drawn map loading
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    35
-- some support for being really lazy
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    36
-- an extra map or two
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    37
-- param for infinite UFO fuel
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    38
-- param for number of rounds
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    39
10943
d90706a2183e migrate maps, new map, minor fixes
mikade <redgrinner@gmail.com>
parents: 10940
diff changeset
    40
--------------
d90706a2183e migrate maps, new map, minor fixes
mikade <redgrinner@gmail.com>
parents: 10940
diff changeset
    41
--0.5
d90706a2183e migrate maps, new map, minor fixes
mikade <redgrinner@gmail.com>
parents: 10940
diff changeset
    42
--------------
d90706a2183e migrate maps, new map, minor fixes
mikade <redgrinner@gmail.com>
parents: 10940
diff changeset
    43
-- migrated maps to an external script
d90706a2183e migrate maps, new map, minor fixes
mikade <redgrinner@gmail.com>
parents: 10940
diff changeset
    44
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    45
-----------------------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    46
-- SCRIPT BEGINS
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    47
-----------------------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    48
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    49
HedgewarsScriptLoad("/Scripts/Locale.lua")
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
    50
HedgewarsScriptLoad("/Scripts/OfficialChallenges.lua")
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    51
HedgewarsScriptLoad("/Scripts/Tracker.lua")
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    52
HedgewarsScriptLoad("/Scripts/Params.lua")
10943
d90706a2183e migrate maps, new map, minor fixes
mikade <redgrinner@gmail.com>
parents: 10940
diff changeset
    53
HedgewarsScriptLoad("/Scripts/TechMaps.lua")
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    54
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    55
------------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    56
-- Got Variables?
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    57
------------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
    58
10940
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    59
local atkArray =
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    60
				{
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    61
				{amBazooka, 	"amBazooka",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    62
				{amBee, 		"amBee",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    63
				{amMortar, 		"amMortar",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    64
				{amDrill, 		"amDrill",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    65
				{amSnowball, 	"amSnowball",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    66
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    67
				{amGrenade,		"amGrenade",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    68
				{amClusterBomb,	"amClusterBomb",	0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    69
				{amMolotov, 	"amMolotov",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    70
				{amWatermelon, 	"amWatermelon",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    71
				{amHellishBomb,	"amHellishBomb",	0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    72
				{amGasBomb, 	"amGasBomb",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    73
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    74
				{amShotgun,		"amShotgun",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    75
				{amDEagle,		"amDEagle",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    76
				{amFlamethrower,"amFlamethrower",	0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    77
				{amSniperRifle,	"amSniperRifle",	0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    78
				{amSineGun, 	"amSineGun",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    79
				{amIceGun, 		"amIceGun",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    80
				{amLandGun,		"amLandGun",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    81
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    82
				{amFirePunch, 	"amFirePunch",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    83
				{amWhip,		"amWhip",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    84
				{amBaseballBat, "amBaseballBat",	0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    85
				{amKamikaze, 	"amKamikaze",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    86
				{amSeduction, 	"amSeduction",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    87
				{amHammer,		"amHammer",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    88
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    89
				{amMine, 		"amMine",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    90
				{amDynamite, 	"amDynamite",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    91
				{amCake, 		"amCake",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    92
				{amBallgun, 	"amBallgun",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    93
				{amRCPlane,		"amRCPlane",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    94
				{amSMine,		"amSMine",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    95
				{amAirMine,		"amAirMine",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    96
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    97
				{amAirAttack,	"amAirAttack",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    98
				{amMineStrike,	"amMineStrike",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
    99
				{amDrillStrike,	"amDrillStrike",	0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   100
				{amAirMine,		"amAirMine",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   101
				{amNapalm, 		"amNapalm",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   102
				{amPiano,		"amPiano",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   103
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   104
				{amKnife,		"amKnife",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   105
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   106
				{amBirdy,		"amBirdy",			0}
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   107
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   108
				}
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   109
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   110
local utilArray =
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   111
				{
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   112
				{amBlowTorch, 		"amBlowTorch",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   113
				{amPickHammer,		"amPickHammer",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   114
				{amGirder, 			"amGirder",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   115
				{amRubber, 			"amRubber",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   116
				{amPortalGun,		"amPortalGun",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   117
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   118
				{amRope, 			"amRope",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   119
				{amParachute, 		"amParachute",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   120
				{amTeleport,		"amTeleport",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   121
				{amJetpack,			"amJetpack",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   122
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   123
				{amInvulnerable,	"amInvulnerable",	0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   124
				{amLaserSight,		"amLaserSight",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   125
				{amVampiric,		"amVampiric",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   126
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   127
				{amLowGravity, 		"amLowGravity",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   128
				{amExtraDamage, 	"amExtraDamage",	0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   129
				{amExtraTime,		"amExtraTime",		0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   130
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   131
				{amResurrector, 	"amResurrector",	0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   132
				{amTardis, 			"amTardis",			0},
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   133
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   134
				{amSwitch,			"amSwitch",			0}
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   135
				}
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   136
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   137
local activationStage = 0
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   138
local jet = nil
10930
1974f4aa8ec6 one more map, extra param
mikade <redgrinner@gmail.com>
parents: 10918
diff changeset
   139
local infUFO = nil
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   140
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   141
local fMod = 1000000 -- 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   142
local roundLimit = 3
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   143
local roundNumber = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   144
local firstClan = 10
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   145
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   146
local fastX = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   147
local fastY = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   148
local fastCount = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   149
local fastIndex = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   150
local fastColour
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   151
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   152
local currX = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   153
local currY = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   154
local currCount = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   155
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   156
local specialPointsX = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   157
local specialPointsY = {}
10940
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   158
local specialPointsFlag = {}
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   159
local specialPointsCount = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   160
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   161
mapID = 22
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   162
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   163
--------------------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   164
-- hog and team tracking variales
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   165
--------------------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   166
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   167
local numhhs = 0 -- store number of hedgehogs
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   168
local hhs = {} -- store hedgehog gears
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   169
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   170
local numTeams --  store the number of teams in the game
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   171
local teamNameArr = {}  -- store the list of teams
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   172
local teamClan = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   173
local teamSize = {}     -- store how many hogs per team
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   174
local teamIndex = {} -- at what point in the hhs{} does each team begin
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   175
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   176
local teamComment = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   177
local teamScore = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   178
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   179
-------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   180
-- racer vars
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   181
--------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   182
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   183
local cGear = nil
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   184
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   185
local bestClan = nil
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   186
local bestTime = nil
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   187
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   188
local gameBegun = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   189
local gameOver = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   190
local racerActive = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   191
local trackTime = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   192
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   193
local wpCirc = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   194
local wpX = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   195
local wpY = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   196
local wpCol = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   197
local wpActive = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   198
local wpRad = 450 --75
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   199
local wpCount = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   200
local wpLimit = 8
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   201
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   202
local usedWeapons = {}
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   203
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   204
local roundN
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   205
local lastRound
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   206
local RoundHasChanged
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   207
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   208
-------------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   209
-- general methods
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   210
-------------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   211
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   212
--function onPrecise()
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   213
--end
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   214
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   215
function RebuildTeamInfo()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   216
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   217
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   218
        -- make a list of individual team names
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   219
        for i = 0, (TeamsCount-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   220
                teamNameArr[i] = " " -- = i
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   221
                teamSize[i] = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   222
                teamIndex[i] = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   223
                teamScore[i] = 100000
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   224
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   225
        numTeams = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   226
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   227
        for i = 0, (numhhs-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   228
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   229
                z = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   230
                unfinished = true
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   231
                while(unfinished == true) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   232
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   233
                        newTeam = true
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   234
                        tempHogTeamName = GetHogTeamName(hhs[i]) -- this is the new name
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   235
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   236
                        if tempHogTeamName == teamNameArr[z] then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   237
                                newTeam = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   238
                                unfinished = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   239
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   240
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   241
                        z = z + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   242
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   243
                        if z == TeamsCount then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   244
                                unfinished = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   245
                                if newTeam == true then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   246
                                        teamNameArr[numTeams] = tempHogTeamName
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   247
                                        numTeams = numTeams + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   248
                                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   249
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   250
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   251
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   252
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   253
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   254
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   255
        -- find out how many hogs per team, and the index of the first hog in hhs
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   256
        for i = 0, (numTeams-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   257
                for z = 0, (numhhs-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   258
                        if GetHogTeamName(hhs[z]) == teamNameArr[i] then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   259
                                teamClan[i] = GetHogClan(hhs[z])
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   260
                                if teamSize[i] == 0 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   261
                                        teamIndex[i] = z -- should give starting index
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   262
                                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   263
                                teamSize[i] = teamSize[i] + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   264
                                --add a pointer so this hog appears at i in hhs
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   265
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   266
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   267
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   268
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   269
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   270
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   271
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   272
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   273
-----------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   274
-- RACER METHODS
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   275
-----------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   276
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   277
function CheckWaypoints()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   278
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   279
        trackFinished = true
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   280
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   281
        for i = 0, (wpCount-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   282
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   283
                g1X, g1Y = GetGearPosition(CurrentHedgehog)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   284
                g2X, g2Y = wpX[i], wpY[i]
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   285
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   286
                g1X = g1X - g2X
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   287
                g1Y = g1Y - g2Y
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   288
                dist = (g1X*g1X) + (g1Y*g1Y)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   289
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   290
                --if i == 0 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   291
                --      AddCaption(dist .. "/" .. (wpRad*wpRad) )
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   292
                --end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   293
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   294
                NR = (48/100*wpRad)/2
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   295
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   296
                if dist < (NR*NR) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   297
                --if dist < (wpRad*wpRad) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   298
                        --AddCaption("howdy")
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   299
                        wpActive[i] = true
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   300
                        wpCol[i] = GetClanColor(GetHogClan(CurrentHedgehog)) -- new                             --GetClanColor(1)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   301
                        SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i])
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   302
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   303
                        wpRem = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   304
                        for k = 0, (wpCount-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   305
                                if wpActive[k] == false then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   306
                                        wpRem = wpRem + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   307
                                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   308
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   309
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   310
                        AddCaption(loc("Way-Points Remaining") .. ": " .. wpRem,0xffba00ff,capgrpAmmoinfo)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   311
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   312
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   313
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   314
                if wpActive[i] == false then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   315
                        trackFinished = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   316
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   317
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   318
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   319
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   320
        return(trackFinished)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   321
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   322
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   323
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   324
function AdjustScores()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   325
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   326
        if bestTime == nil then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   327
                bestTime = 100000
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   328
                bestClan = 10
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   329
                bestTimeComment = "N/A"
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   330
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   331
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   332
        newScore = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   333
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   334
        -- update this clan's time if the new track is better
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   335
        for i = 0, (numTeams-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   336
                if teamClan[i] == GetHogClan(CurrentHedgehog) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   337
                        if trackTime < teamScore[i] then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   338
                                teamScore[i] = trackTime
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   339
                                newScore = true
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   340
                        else
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   341
                                newScore = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   342
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   343
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   344
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   345
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   346
        --bestTime = 100000
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   347
        --bestClan = 10
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   348
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   349
        -- find the best time out of those so far
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   350
        for i = 0, (numTeams-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   351
                if teamScore[i] < bestTime then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   352
                        bestTime = teamScore[i]
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   353
                        bestClan = teamClan[i]
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   354
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   355
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   356
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   357
        if bestTime ~= 100000 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   358
                bestTimeComment = (bestTime/1000) ..loc("s")
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   359
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   360
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   361
        if newScore == true then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   362
                if trackTime == bestTime then -- best time of the race
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   363
                        ShowMission(loc("RACER"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   364
                        loc("TRACK COMPLETED"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   365
                        loc("NEW RACE RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" ..
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   366
                        loc("WINNING TIME: ") .. bestTimeComment, 0, 4000)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   367
                        PlaySound(sndHomerun)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   368
                else    -- best time for the clan
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   369
                        ShowMission(loc("RACER"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   370
                        loc("TRACK COMPLETED"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   371
                        loc("NEW CLAN RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" ..
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   372
                        loc("WINNING TIME: ") .. bestTimeComment, 4, 4000)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   373
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   374
        else -- not any kind of new score
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   375
                ShowMission(loc("RACER"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   376
                loc("TRACK COMPLETED"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   377
                loc("TIME: ") .. (trackTime/1000) ..loc("s") .. "|" ..
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   378
                loc("WINNING TIME: ") .. bestTimeComment, -amSkip, 4000)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   379
                PlaySound(sndHellish)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   380
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   381
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   382
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   383
        --------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   384
        --new
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   385
        --------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   386
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   387
        if bestTime == trackTime then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   388
                --AddCaption("wooooooooooooooooooooooooooooo")
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   389
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   390
                fastColour = GetClanColor(GetHogClan(CurrentHedgehog))
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   391
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   392
                for i = 0, (currCount-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   393
                        fastX[i] = currX[i]
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   394
                        fastY[i] = currY[i]
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   395
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   396
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   397
                fastCount = currCount
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   398
                fastIndex = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   399
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   400
                --currCount = 0 -- is this needed?
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   401
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   402
        else
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   403
                currCount = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   404
                fastIndex = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   405
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   406
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   407
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   408
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   409
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   410
function onNewRound()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   411
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   412
        roundNumber = roundNumber + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   413
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   414
        totalComment = ""
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   415
        for i = 0, (TeamsCount-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   416
                        if teamNameArr[i] ~= " " then                           -- teamScore[teamClan[i]]
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   417
                                teamComment[i] = teamNameArr[i] .. ": " .. (teamScore[i]/1000) .. loc("s|")
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   418
                                totalComment = totalComment .. teamComment[i]
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   419
                        elseif teamNameArr[i] == " " then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   420
                                teamComment[i] = "|"
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   421
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   422
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   423
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   424
        ShowMission(    loc("RACER"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   425
                                        loc("STATUS UPDATE"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   426
                                        loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" ..
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   427
                                        loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   428
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   429
        -- end game if its at round limit
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   430
        if roundNumber >= roundLimit then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   431
                for i = 0, (numhhs-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   432
                        if GetHogClan(hhs[i]) ~= bestClan then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   433
                                SetEffect(hhs[i], heResurrectable, 0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   434
                                SetHealth(hhs[i],0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   435
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   436
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   437
                gameOver = true
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   438
                TurnTimeLeft = 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   439
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   440
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   441
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   442
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   443
function CheckForNewRound()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   444
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   445
        -------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   446
        ------ new
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   447
        -------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   448
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   449
        --[[turnN = turnN + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   450
        if gameBegun == false then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   451
                if turnN == 2 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   452
                        for i = 0, (numhhs-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   453
                                if hhs[i] ~= nil then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   454
                                        SetEffect(hhs[i], heResurrectable, 0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   455
                                        SetHealth(hhs[i],0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   456
                                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   457
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   458
                        gameOver = true
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   459
                        TurnTimeLeft = 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   460
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   461
        else
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   462
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   463
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   464
        end]]
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   465
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   466
        --[[if roundBegun == true then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   467
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   468
                if RoundHasChanged == true then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   469
                        roundN = roundN + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   470
                        RoundHasChanged = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   471
                        onNewRound()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   472
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   473
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   474
                if lastRound ~= TotalRounds then -- new round, but not really
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   475
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   476
                        if RoundHasChanged == false then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   477
                                RoundHasChanged = true
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   478
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   479
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   480
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   481
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   482
                AddCaption("RoundN:" .. roundN .. "; " .. "TR: " .. TotalRounds)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   483
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   484
                lastRound = TotalRounds
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   485
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   486
        end]]
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   487
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   488
        ------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   489
        ----- old
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   490
        ------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   491
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   492
        if GetHogClan(CurrentHedgehog) == firstClan then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   493
                onNewRound()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   494
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   495
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   496
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   497
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   498
function DisableTumbler()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   499
        currCount = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   500
        fastIndex = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   501
        TurnTimeLeft = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   502
        racerActive = false -- newadd
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   503
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   504
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   505
function HandleGhost()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   506
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   507
        -- get the current xy of the racer at this point
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   508
        currX[currCount] = GetX(CurrentHedgehog)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   509
        currY[currCount] = GetY(CurrentHedgehog)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   510
        currCount = currCount + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   511
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   512
        -- draw a ping of smoke where the fastest player was at this point
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   513
        if (fastCount ~= 0) and (fastIndex < fastCount) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   514
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   515
                fastIndex = fastIndex + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   516
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   517
                tempE = AddVisualGear(fastX[fastIndex], fastY[fastIndex], vgtSmoke, 0, false)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   518
                g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   519
                SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, fastColour )
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   520
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   521
                --AddCaption("fC: " .. fastIndex .. " / " .. fastCount)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   522
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   523
        else
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   524
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   525
                --AddCaption("excep fC: " .. fastIndex .. " / " .. fastCount)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   526
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   527
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   528
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   529
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   530
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   531
function BoomGirder(x,y,rot)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   532
	girTime = 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   533
	if rot < 4 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   534
				AddGear(x, y, gtGrenade, 0, 0, 0, girTime)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   535
	elseif rot == 4 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   536
				g = AddGear(x-45, y, gtGrenade, 0, 0, 0, girTime) -- needed?
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   537
				g = AddGear(x-30, y, gtGrenade, 0, 0, 0, girTime)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   538
				g = AddGear(x, y, gtGrenade, 0, 0, 0, girTime) -- needed?
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   539
				g = AddGear(x+30, y, gtGrenade, 0, 0, 0, girTime)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   540
				g = AddGear(x+45, y, gtGrenade, 0, 0, 0, girTime) -- needed?
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   541
	elseif rot == 5 then ------- diag
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   542
				g = AddGear(x+45, y+45, gtGrenade, 0, 0, 0, girTime) --n
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   543
				g = AddGear(x+30, y+30, gtGrenade, 0, 0, 0, girTime)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   544
				g = AddGear(x, y, gtGrenade, 0, 0, 0, girTime) -- needed?
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   545
				g = AddGear(x-30, y-30, gtGrenade, 0, 0, 0, girTime)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   546
				g = AddGear(x-45, y-45, gtGrenade, 0, 0, 0, girTime) --n
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   547
	elseif rot == 6 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   548
				g = AddGear(x, y-45, gtGrenade, 0, 0, 0, girTime) -- needed?
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   549
				g = AddGear(x, y+30, gtGrenade, 0, 0, 0, girTime)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   550
				g = AddGear(x, y, gtGrenade, 0, 0, 0, girTime) -- needed?
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   551
				g = AddGear(x, y-30, gtGrenade, 0, 0, 0, girTime)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   552
				g = AddGear(x, y+45, gtGrenade, 0, 0, 0, girTime) -- needed?
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   553
	elseif rot == 7 then -------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   554
				g = AddGear(x+45, y-45, gtGrenade, 0, 0, 0, girTime) --n
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   555
				g = AddGear(x+30, y-30, gtGrenade, 0, 0, 0, girTime)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   556
				g = AddGear(x, y, gtGrenade, 0, 0, 0, girTime) -- needed?
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   557
				g = AddGear(x-30, y+30, gtGrenade, 0, 0, 0, girTime)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   558
				g = AddGear(x-45, y+45, gtGrenade, 0, 0, 0, girTime) --n
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   559
	end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   560
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   561
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   562
function RemoveGear(gear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   563
	if (isATrackedGear(gear) == true) and (GetGearType(gear) ~= gtHedgehog) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   564
		DeleteGear(gear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   565
	end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   566
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   567
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   568
function ClearMap()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   569
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   570
	runOnGears(RemoveGear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   571
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   572
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   573
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   574
function HandleFreshMapCreation()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   575
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   576
	-- the boom stage, boom girders, reset ammo, and delete other map objects
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   577
	if activationStage == 1 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   578
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   579
		ClearMap()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   580
		activationStage = activationStage + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   581
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   582
	-- the creation stage, place girders and needed gears, grant ammo
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   583
	elseif activationStage == 2 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   584
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   585
		-- these are from onParameters()
10943
d90706a2183e migrate maps, new map, minor fixes
mikade <redgrinner@gmail.com>
parents: 10940
diff changeset
   586
		if (mapID == nil) or (mapID == 0) then
d90706a2183e migrate maps, new map, minor fixes
mikade <redgrinner@gmail.com>
parents: 10940
diff changeset
   587
			LoadMap(2000)
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   588
		else
10943
d90706a2183e migrate maps, new map, minor fixes
mikade <redgrinner@gmail.com>
parents: 10940
diff changeset
   589
			LoadMap(mapID)
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   590
		end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   591
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   592
		activationStage = 200
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   593
		--runOnHogs(RestoreHog)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   594
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   595
	end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   596
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   597
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   598
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   599
function TryRepositionHogs()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   600
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   601
        if MapHasBorder() == true then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   602
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   603
                for i = 0, (numhhs-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   604
                        if hhs[i] ~= nil then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   605
                                SetGearPosition(hhs[i],GetX(hhs[i]), TopY-10)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   606
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   607
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   608
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   609
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   610
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   611
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   612
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   613
----------------------------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   614
-- GAME METHODS / EVENT HANDLERS
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   615
----------------------------------
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   616
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   617
function onParameters()
10940
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   618
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   619
	parseParams()
10943
d90706a2183e migrate maps, new map, minor fixes
mikade <redgrinner@gmail.com>
parents: 10940
diff changeset
   620
	mapID = tonumber(params["m"])
10930
1974f4aa8ec6 one more map, extra param
mikade <redgrinner@gmail.com>
parents: 10918
diff changeset
   621
	infUFO = params["ufo"]
10940
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   622
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   623
	roundLimit = tonumber(params["rounds"])
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   624
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   625
	if (roundLimit == 0) or (roundLimit == nil) then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   626
		roundLimit = 3
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   627
	end
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   628
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   629
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   630
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   631
function onPreviewInit()
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   632
	onGameInit()
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   633
end
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   634
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   635
function onGameInit()
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   636
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   637
		Theme = "Cave"
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   638
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   639
		MapGen = mgDrawn
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   640
		TemplateFilter = 0
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   641
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   642
		EnableGameFlags(gfInfAttack, gfDisableWind)
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   643
		DisableGameFlags(gfSolidLand)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   644
		CaseFreq = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   645
        TurnTime = 90000
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   646
        WaterRise = 0
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   647
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   648
		for x = 1, 16 do
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   649
			AddPoint(x*100,100,5)
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   650
		end
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   651
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   652
		FlushPoints()
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   653
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   654
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   655
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   656
function limitHogs(gear)
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   657
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   658
	cnthhs = cnthhs + 1
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   659
	if cnthhs > 1 then
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   660
		DeleteGear(gear)
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   661
    end
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   662
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   663
end
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   664
10940
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   665
function onSpecialPoint(x,y,flag)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   666
    specialPointsX[specialPointsCount] = x
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   667
    specialPointsY[specialPointsCount] = y
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   668
	specialPointsFlag[specialPointsCount] = flag
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   669
    specialPointsCount = specialPointsCount + 1
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   670
end
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   671
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   672
function InterpretPoints()
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   673
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   674
	-- flags run from 0 to 127
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   675
	for i = 0, (specialPointsCount-1) do
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   676
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   677
		-- Mines
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   678
		if specialPointsFlag[i] == 1 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   679
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 1)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   680
		elseif specialPointsFlag[i] == 2 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   681
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 1000)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   682
		elseif specialPointsFlag[i] == 3 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   683
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 2000)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   684
		elseif specialPointsFlag[i] == 4 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   685
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 3000)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   686
		elseif specialPointsFlag[i] == 5 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   687
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 4000)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   688
		elseif specialPointsFlag[i] == 6 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   689
			SetTimer(AddGear(specialPointsX[i], specialPointsY[i], gtMine, 0, 0, 0, 0), 5000)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   690
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   691
		-- Sticky Mines
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   692
		elseif specialPointsFlag[i] == 7 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   693
			AddGear(specialPointsX[i], specialPointsY[i], gtSMine, 0, 0, 0, 0)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   694
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   695
		-- Air Mines
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   696
		elseif specialPointsFlag[i] == 8 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   697
			AddGear(specialPointsX[i], specialPointsY[i], gtAirMine, 0, 0, 0, 0)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   698
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   699
		-- Health Crates
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   700
		elseif specialPointsFlag[i] == 9 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   701
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),25)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   702
		elseif specialPointsFlag[i] == 10 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   703
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),50)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   704
		elseif specialPointsFlag[i] == 11 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   705
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),75)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   706
		elseif specialPointsFlag[i] == 12 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   707
			SetHealth(SpawnHealthCrate(specialPointsX[i],specialPointsY[i]),100)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   708
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   709
		-- Cleaver
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   710
		elseif specialPointsFlag[i] == 13 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   711
			AddGear(specialPointsX[i], specialPointsY[i], gtKnife, 0, 0, 0, 0)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   712
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   713
		-- Target
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   714
		elseif specialPointsFlag[i] == 14 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   715
			AddGear(specialPointsX[i], specialPointsY[i], gtTarget, 0, 0, 0, 0)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   716
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   717
		--Barrels
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   718
		elseif specialPointsFlag[i] == 15 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   719
			SetHealth(AddGear(specialPointsX[i], specialPointsY[i], gtExplosives, 0, 0, 0, 0),1)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   720
		elseif specialPointsFlag[i] == 16 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   721
			SetHealth(AddGear(specialPointsX[i], specialPointsY[i], gtExplosives, 0, 0, 0, 0),25)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   722
		elseif specialPointsFlag[i] == 17 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   723
			SetHealth(AddGear(specialPointsX[i], specialPointsY[i], gtExplosives, 0, 0, 0, 0),50)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   724
		elseif specialPointsFlag[i] == 18 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   725
			SetHealth(AddGear(specialPointsX[i], specialPointsY[i], gtExplosives, 0, 0, 0, 0),75)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   726
		elseif specialPointsFlag[i] == 19 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   727
			SetHealth(AddGear(specialPointsX[i], specialPointsY[i], gtExplosives, 0, 0, 0, 0),100)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   728
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   729
		-- There are about 58+- weps / utils
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   730
		-- Weapon Crates
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   731
		elseif (specialPointsFlag[i] >= 20) and (specialPointsFlag[i] < (#atkArray+20)) then
10945
2570fcfddf2a hopefully fix some placements
mikade <redgrinner@gmail.com>
parents: 10943
diff changeset
   732
			SpawnAmmoCrate(specialPointsX[i],specialPointsY[i],atkArray[specialPointsFlag[i]-19][1])
2570fcfddf2a hopefully fix some placements
mikade <redgrinner@gmail.com>
parents: 10943
diff changeset
   733
10940
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   734
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   735
		-- Utility Crates
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   736
		elseif (specialPointsFlag[i] >= (#atkArray+20)) and (specialPointsFlag[i] < (#atkArray+20+#utilArray)) then
10945
2570fcfddf2a hopefully fix some placements
mikade <redgrinner@gmail.com>
parents: 10943
diff changeset
   737
			SpawnUtilityCrate(specialPointsX[i],specialPointsY[i],utilArray[specialPointsFlag[i]-19-#atkArray][1])
10940
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   738
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   739
		--79-82 (reserved for future wep crates)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   740
		--89,88,87,86 and 85,84,83,82 (reserved for the 2 custom sprites and their landflags)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   741
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   742
		--90-99 reserved for scripted structures
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   743
		--[[elseif specialPointsFlag[i] == 90 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   744
			--PlaceStruc("generator")
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   745
		elseif specialPointsFlag[i] == 91 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   746
			--PlaceStruc("healingstation")
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   747
		elseif specialPointsFlag[i] == 92 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   748
			--PlaceStruc("respawner")
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   749
		elseif specialPointsFlag[i] == 93 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   750
			--PlaceStruc("teleportationnode")
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   751
		elseif specialPointsFlag[i] == 94 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   752
			--PlaceStruc("biofilter")
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   753
		elseif specialPointsFlag[i] == 95 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   754
			--PlaceStruc("supportstation")
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   755
		elseif specialPointsFlag[i] == 96 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   756
			--PlaceStruc("constructionstation")
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   757
		elseif specialPointsFlag[i] == 97 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   758
			--PlaceStruc("reflectorshield")
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   759
		elseif specialPointsFlag[i] == 98 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   760
			--PlaceStruc("weaponfilter")]]
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   761
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   762
		-- Normal Girders
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   763
		elseif specialPointsFlag[i] == 100 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   764
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 0, 4294967295, nil, nil, nil, lfNormal)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   765
		elseif specialPointsFlag[i] == 101 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   766
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 1, 4294967295, nil, nil, nil, lfNormal)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   767
		elseif specialPointsFlag[i] == 102 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   768
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 2, 4294967295, nil, nil, nil, lfNormal)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   769
		elseif specialPointsFlag[i] == 103 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   770
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 3, 4294967295, nil, nil, nil, lfNormal)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   771
		elseif specialPointsFlag[i] == 104 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   772
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 4, 4294967295, nil, nil, nil, lfNormal)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   773
		elseif specialPointsFlag[i] == 105 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   774
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 5, 4294967295, nil, nil, nil, lfNormal)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   775
		elseif specialPointsFlag[i] == 106 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   776
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 6, 4294967295, nil, nil, nil, lfNormal)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   777
		elseif specialPointsFlag[i] == 107 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   778
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 7, 4294967295, nil, nil, nil, lfNormal)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   779
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   780
		-- Invulnerable Girders
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   781
		elseif specialPointsFlag[i] == 108 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   782
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 0, 2516582650, nil, nil, nil, lfIndestructible)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   783
		elseif specialPointsFlag[i] == 109 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   784
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 1, 2516582650, nil, nil, nil, lfIndestructible)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   785
		elseif specialPointsFlag[i] == 110 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   786
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 2, 2516582650, nil, nil, nil, lfIndestructible)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   787
		elseif specialPointsFlag[i] == 111 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   788
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 3, 2516582650, nil, nil, nil, lfIndestructible)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   789
		elseif specialPointsFlag[i] == 112 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   790
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 4, 2516582650, nil, nil, nil, lfIndestructible)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   791
		elseif specialPointsFlag[i] == 113 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   792
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 5, 2516582650, nil, nil, nil, lfIndestructible)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   793
		elseif specialPointsFlag[i] == 114 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   794
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 6, 2516582650, nil, nil, nil, lfIndestructible)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   795
		elseif specialPointsFlag[i] == 115 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   796
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 7, 2516582650, nil, nil, nil, lfIndestructible)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   797
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   798
		-- Icy Girders
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   799
		elseif specialPointsFlag[i] == 116 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   800
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 0, 16448250, nil, nil, nil, lfIce)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   801
		elseif specialPointsFlag[i] == 117 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   802
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 1, 16448250, nil, nil, nil, lfIce)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   803
		elseif specialPointsFlag[i] == 118 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   804
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 2, 16448250, nil, nil, nil, lfIce)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   805
		elseif specialPointsFlag[i] == 119 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   806
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 3, 16448250, nil, nil, nil, lfIce)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   807
		elseif specialPointsFlag[i] == 120 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   808
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 4, 16448250, nil, nil, nil, lfIce)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   809
		elseif specialPointsFlag[i] == 121 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   810
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 5, 16448250, nil, nil, nil, lfIce)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   811
		elseif specialPointsFlag[i] == 121 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   812
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 6, 16448250, nil, nil, nil, lfIce)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   813
		elseif specialPointsFlag[i] == 123 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   814
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmGirder, 7, 16448250, nil, nil, nil, lfIce)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   815
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   816
		-- Rubber Bands
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   817
		elseif specialPointsFlag[i] == 124 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   818
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmRubber, 0, 4294967295, nil, nil, nil, lfBouncy)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   819
		elseif specialPointsFlag[i] == 125 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   820
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmRubber, 1, 4294967295, nil, nil, nil, lfBouncy)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   821
		elseif specialPointsFlag[i] == 126 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   822
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmRubber, 2, 4294967295, nil, nil, nil, lfBouncy)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   823
		elseif specialPointsFlag[i] == 127 then
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   824
			PlaceSprite(specialPointsX[i], specialPointsY[i], sprAmRubber, 3, 4294967295, nil, nil, nil, lfBouncy)
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   825
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   826
		-- Waypoints
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   827
		else -- 0 / no value
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   828
			PlaceWayPoint(specialPointsX[i], specialPointsY[i])
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   829
		end
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   830
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   831
	end
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   832
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   833
end
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   834
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   835
function onGameStart()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   836
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   837
		trackTeams()
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   838
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   839
		roundN = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   840
        lastRound = TotalRounds
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   841
        RoundHasChanged = false -- true
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   842
10940
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   843
        InterpretPoints()
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   844
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   845
        RebuildTeamInfo()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   846
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   847
		for i=0 , TeamsCount - 1 do
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   848
			cnthhs = 0
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   849
			runOnHogsInTeam(limitHogs, teamNameArr[i])
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   850
		end
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   851
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   852
        ShowMission     (
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   853
                                loc("RACER"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   854
                                loc("a Hedgewars mini-game"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   855
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   856
                                loc("Build a track and race.") .. "|" ..
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   857
                                loc("Round Limit:") .. " " .. roundLimit .. "|" ..
10940
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   858
								loc("You can further customize the race by changing the scheme script paramater.") .. "|" ..
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   859
								--loc("For example, the below line would play map 4, with infinite fuel for the flying saucer, and four rounds.") .. "|" ..
096be1230a46 Added param for rounds in techracer.
mikade <redgrinner@gmail.com>
parents: 10934
diff changeset
   860
								--"m=4, ufo=true, rounds=4" .. "|" ..
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   861
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   862
                                "", 4, 4000
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   863
                                )
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   864
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   865
        TryRepositionHogs()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   866
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   867
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   868
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   869
function PlaceWayPoint(x,y)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   870
    if not racerActive then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   871
        if wpCount == 0 or wpX[wpCount - 1] ~= x or wpY[wpCount - 1] ~= y then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   872
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   873
            wpX[wpCount] = x
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   874
            wpY[wpCount] = y
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   875
            wpCol[wpCount] = 0xffffffff
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   876
            wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   877
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   878
            SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 20, 100, 1, 10, 0, wpRad, 5, wpCol[wpCount])
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   879
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   880
            wpCount = wpCount + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   881
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   882
            AddCaption(loc("Waypoint placed.") .. " " .. loc("Available points remaining: ") .. (wpLimit-wpCount))
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   883
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   884
    end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   885
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   886
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   887
function onNewTurn()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   888
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   889
        CheckForNewRound()
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   890
        TryRepositionHogs()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   891
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   892
        racerActive = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   893
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   894
		activationStage = 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   895
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   896
		--AddAmmo(CurrentHedgehog, amBazooka, 100)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   897
		--AddAmmo(CurrentHedgehog, amJetpack, 100)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   898
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   899
		--ClearMap()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   900
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   901
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   902
        trackTime = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   903
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   904
        currCount = 0 -- hopefully this solves problem
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   905
        AddAmmo(CurrentHedgehog, amAirAttack, 0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   906
        gTimer = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   907
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   908
        -- Set the waypoints to unactive on new round
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   909
        for i = 0,(wpCount-1) do
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   910
                wpActive[i] = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   911
                wpCol[i] = 0xffffffff
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   912
                SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i])
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   913
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   914
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   915
        -- Handle Starting Stage of Game
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   916
        if (gameOver == false) and (gameBegun == false) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   917
                if wpCount >= 3 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   918
                        gameBegun = true
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   919
						--activationStage = 200
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   920
                        roundNumber = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   921
                        firstClan = GetHogClan(CurrentHedgehog)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   922
                        ShowMission(loc("RACER"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   923
                        loc("GAME BEGUN!!!"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   924
                        loc("Complete the track as fast as you can!"), 2, 4000)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   925
                else
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   926
                        ShowMission(loc("RACER"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   927
                        loc("NOT ENOUGH WAYPOINTS"),
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   928
                        loc("Place more waypoints using the 'Air Attack' weapon."), 2, 4000)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   929
                        AddAmmo(CurrentHedgehog, amAirAttack, 4000)
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
   930
						SetWeapon(amAirAttack)
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   931
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   932
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   933
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   934
        if gameOver == true then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   935
                gameBegun = false
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   936
                racerActive = false -- newadd
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   937
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   938
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   939
        AddAmmo(CurrentHedgehog, amTardis, 0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   940
        AddAmmo(CurrentHedgehog, amDrillStrike, 0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   941
        AddAmmo(CurrentHedgehog, amMineStrike, 0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   942
        AddAmmo(CurrentHedgehog, amNapalm, 0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   943
        AddAmmo(CurrentHedgehog, amPiano, 0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   944
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   945
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   946
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   947
function onGameTick20()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   948
10930
1974f4aa8ec6 one more map, extra param
mikade <redgrinner@gmail.com>
parents: 10918
diff changeset
   949
		if (jet ~= nil) and (infUFO == "true") then
10934
mikade <redgrinner@gmail.com>
parents: 10932
diff changeset
   950
			SetHealth(jet, 2000)
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   951
		end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   952
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   953
        -- airstrike detected, convert this into a potential waypoint spot
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   954
        if cGear ~= nil then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   955
                x,y = GetGearPosition(cGear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   956
        if x > -9000 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   957
            x,y = GetGearTarget(cGear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   958
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   959
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   960
            if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   961
                AddCaption(loc("Please place the way-point in the open, within the map boundaries."))
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   962
                PlaySound(sndDenied)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   963
            elseif (y > WaterLine-50) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   964
                AddCaption(loc("Please place the way-point further from the waterline."))
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   965
                PlaySound(sndDenied)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   966
            else
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   967
                PlaceWayPoint(x, y)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   968
                if wpCount == wpLimit then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   969
                    AddCaption(loc("Race complexity limit reached."))
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   970
                    DisableTumbler()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   971
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   972
            end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   973
        else
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   974
            DeleteGear(cGear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   975
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   976
        SetGearPosition(cGear, -10000, 0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   977
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   978
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   979
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   980
		if activationStage < 10 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   981
				HandleFreshMapCreation()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   982
		end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   983
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   984
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   985
        -- start the player tumbling with a boom once their turn has actually begun
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   986
        if racerActive == false then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   987
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   988
                if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   989
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   990
                        -- if the gamehas started put the player in the middle of the first
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   991
                        --waypoint that was placed
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   992
                        --if activationStage == 200 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   993
						if gameBegun == true then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   994
                                AddCaption(loc("Good to go!"))
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   995
                                racerActive = true
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   996
                                trackTime = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   997
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   998
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
   999
								SetGearPosition(CurrentHedgehog, wpX[0], wpY[0])
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1000
                                --AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtGrenade, 0, 0, 0, 1)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1001
                                --SetGearVelocity(CurrentHedgehog,1000000,1000000)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1002
								SetGearMessage(CurrentHedgehog,gmLeft)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1003
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1004
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1005
								FollowGear(CurrentHedgehog)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1006
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1007
                                HideMission()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1008
								activationStage = 201
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1009
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1010
						else
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1011
                                -- still in placement mode
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1012
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1013
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1014
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1015
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1016
        elseif (activationStage == 201) and (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1017
			SetGearMessage(CurrentHedgehog,0)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1018
			activationStage = 202
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1019
		end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1020
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1021
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1022
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1023
        -- has the player started his tumbling spree?
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1024
        if (CurrentHedgehog ~= nil) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1025
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1026
                --airstrike conversion used to be here
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1027
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1028
                -- if the RACE has started, show tracktimes and keep tabs on waypoints
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1029
                if (racerActive == true) and (activationStage == 202) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1030
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1031
                        --ghost
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1032
                        if GameTime%40 == 0 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1033
                                HandleGhost()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1034
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1035
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1036
                        trackTime = trackTime + 20
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1037
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1038
                        if GameTime%100 == 0 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1039
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1040
                if trackTime%1000 == 0 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1041
                    AddCaption((trackTime/1000)..'.0',GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1042
                else
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1043
                    AddCaption(trackTime/1000,GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1044
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1045
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1046
                                if (CheckWaypoints() == true) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1047
                                        AdjustScores()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1048
                                        DisableTumbler()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1049
                                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1050
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1051
                        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1052
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1053
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1054
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1055
                -- if the player has expended his tunbling time, stop him tumbling
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1056
                if TurnTimeLeft <= 20 then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1057
                        DisableTumbler()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1058
                end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1059
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1060
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1061
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1062
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1063
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1064
function onGearResurrect(gear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1065
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1066
        AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1067
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1068
        if gear == CurrentHedgehog then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1069
                DisableTumbler()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1070
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1071
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1072
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1073
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1074
function isATrackedGear(gear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1075
	if 	(GetGearType(gear) == gtHedgehog) or
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1076
		(GetGearType(gear) == gtGrenade) or
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1077
		(GetGearType(gear) == gtTarget) or
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1078
		(GetGearType(gear) == gtFlame) or
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1079
		(GetGearType(gear) == gtExplosives) or
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1080
		(GetGearType(gear) == gtMine) or
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1081
		(GetGearType(gear) == gtSMine) or
10915
c7524efcb3b7 ups, forgot we need to make TechRacer aware of airmines
mikade <redgrinner@gmail.com>
parents: 10914
diff changeset
  1082
		(GetGearType(gear) == gtAirMine) or
10554
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1083
		(GetGearType(gear) == gtCase)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1084
	then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1085
		return(true)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1086
	else
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1087
		return(false)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1088
	end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1089
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1090
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1091
function onGearAdd(gear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1092
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1093
        if isATrackedGear(gear) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1094
			trackGear(gear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1095
		end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1096
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1097
		if GetGearType(gear) == gtHedgehog then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1098
                hhs[numhhs] = gear
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1099
                numhhs = numhhs + 1
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1100
                SetEffect(gear, heResurrectable, 1)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1101
        end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1102
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1103
        if GetGearType(gear) == gtAirAttack then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1104
                cGear = gear
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1105
        elseif GetGearType(gear) == gtJetpack then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1106
			jet = gear
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1107
		end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1108
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1109
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1110
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1111
function onGearDelete(gear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1112
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1113
        if isATrackedGear(gear) then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1114
			trackDeletion(gear)
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1115
		elseif GetGearType(gear) == gtAirAttack then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1116
                cGear = nil
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1117
        elseif GetGearType(gear) == gtJetpack then
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1118
			jet = nil
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1119
		end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1120
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1121
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1122
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1123
function onAttack()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1124
    at = GetCurAmmoType()
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1125
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1126
    usedWeapons[at] = 0
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1127
end
48e9b1099ff4 Added TechRacer (still needs a lot of love), updated changelog
mikade <redgrinner@gmail.com>
parents:
diff changeset
  1128
10596
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1129
function onAchievementsDeclaration()
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1130
    usedWeapons[amSkip] = nil
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1131
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1132
    usedRope = usedWeapons[amRope] ~= nil
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1133
    usedPortal = usedWeapons[amPortalGun] ~= nil
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1134
    usedSaucer = usedWeapons[amJetpack] ~= nil
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1135
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1136
    usedWeapons[amRope] = nil
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1137
    usedWeapons[amPortalGun] = nil
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1138
    usedWeapons[amJetpack] = nil
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1139
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1140
    usedOther = next(usedWeapons) ~= nil
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1141
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1142
    if usedOther then -- smth besides skip, rope, portal or saucer used
75b5b674387a some friendly updates to TechRacer
mikade <redgrinner@gmail.com>
parents: 10554
diff changeset
  1143
        raceType = "unknown race"
75b5b674387a some frien