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