share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
author unc0rr
Sun, 28 Feb 2016 00:00:46 +0300
changeset 11581 fd02a080d962
parent 11569 294ce0fa65d0
child 11582 e54f8e0ca3bb
permissions -rw-r--r--
- Fix room config being sent unmodified - Fix server ghost color
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
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    64
--------------
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    65
--0.9
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    66
--------------
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    67
-- added variable portal limiter (and effects) from Escape script
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    68
-- allow variable ufoFuel (nil is default, 2000 is infinite)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    69
-- disallow specifying fuel in params (do this in TechMaps or HedgeEditor please)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    70
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
    71
-----------------------------
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
    72
-- 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
    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
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
    76
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
    77
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
    78
HedgewarsScriptLoad("/Scripts/Params.lua")
10961
b30f29396f0c Also preview waypoints
nemo
parents: 10959
diff changeset
    79
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
    80
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
------------------
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
-- 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
    83
------------------
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
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
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
    86
				{
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
				{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
    88
				{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
    89
				{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
    90
				{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
    91
				{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
    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
				{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
    94
				{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
    95
				{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
    96
				{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
    97
				{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
    98
				{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
    99
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
				{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
   101
				{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
   102
				{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
   103
				{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
   104
				{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
   105
				{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
   106
				{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
   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
				{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
   109
				{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
   110
				{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
   111
				{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
   112
				{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
   113
				{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
   114
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
				{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
   116
				{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
   117
				{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
   118
				{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
   119
				{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
   120
				{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
   121
				{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
   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
				{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
   124
				{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
   125
				{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
   126
				{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
   127
				{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
   128
				{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
   129
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
				{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
   131
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
				{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
   133
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
				}
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
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
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
   137
				{
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
				{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
   139
				{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
   140
				{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
   141
				{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
   142
				{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
   143
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
				{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
   145
				{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
   146
				{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
   147
				{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
   148
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
				{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
   150
				{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
   151
				{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
   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
				{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
   154
				{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
   155
				{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
   156
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
				{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
   158
				{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
   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
				{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
   161
				}
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
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 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
   164
local jet = nil
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   165
portalDistance = 5000 -- 15
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   166
ufoFuel = 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
   167
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
   168
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
   169
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
   170
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
   171
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 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
   173
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
   174
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
   175
local fastIndex = 0
11581
fd02a080d962 - Fix room config being sent unmodified
unc0rr
parents: 11569
diff changeset
   176
local fastColour = 0xffffffff
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
   177
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 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
   179
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
   180
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
   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
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
   183
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
   184
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
   185
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
   186
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   187
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
   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
--------------------------
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
-- 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
   191
--------------------------
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
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 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
   194
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
   195
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 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
   197
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
   198
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
   199
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
   200
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
   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 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
   203
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
   204
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
-------
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
-- 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
   207
--------
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
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 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
   210
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
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
   212
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
   213
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 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
   215
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
   216
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
   217
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
   218
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 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
   220
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
   221
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
   222
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
   223
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
   224
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
   225
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
   226
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
   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
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
   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
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
   231
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
   232
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
   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
-------------------
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
-- 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
   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
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
--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
   239
--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
   240
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
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
   242
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
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
        -- 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
   245
        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
   246
                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
   247
                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
   248
                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
   249
                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
   250
        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
   251
        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
   252
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
        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
   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
                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
   256
                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
   257
                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
   258
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
                        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
   260
                        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
   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 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
   263
                                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
   264
                                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
   265
                        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
   266
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
                        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
   268
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
                        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
   270
                                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
   271
                                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
   272
                                        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
   273
                                        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
   274
                                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
   275
                        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
   276
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
                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
   278
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
        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
   280
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
        -- 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
   282
        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
   283
                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
   284
                        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
   285
                                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
   286
                                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
   287
                                        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
   288
                                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
   289
                                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
   290
                                --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
   291
                        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
   292
                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
   293
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
        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
   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
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
   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
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
-- 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
   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
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
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
   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
        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
   306
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
        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
   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
                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
   310
                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
   311
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
                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
   313
                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
   314
                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
   315
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 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
   317
                --      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
   318
                --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
   319
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
                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
   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
                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
   323
                --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
   324
                        --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
   325
                        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
   326
                        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
   327
                        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
   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
                        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
   330
                        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
   331
                                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
   332
                                        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
   333
                                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
   334
                        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
   335
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
                        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
   337
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
                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
   339
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
                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
   341
                        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
   342
                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
   343
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
        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
   345
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
        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
   347
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
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
   349
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
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
   351
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
        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
   353
                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
   354
                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
   355
                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
   356
        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
   357
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 = 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
   359
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
        -- 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
   361
        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
   362
                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
   363
                        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
   364
                                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
   365
                                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
   366
                        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
   367
                                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
   368
                        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
   369
                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
   370
        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
   371
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
        --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
   373
        --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
   374
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
        -- 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
   376
        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
   377
                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
   378
                        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
   379
                        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
   380
                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
   381
        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
   382
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
        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
   384
                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
   385
        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
   386
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
        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
   388
                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
   389
                        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
   390
                        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
   391
                        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
   392
                        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
   393
                        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
   394
                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
   395
                        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
   396
                        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
   397
                        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
   398
                        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
   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
        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
   401
                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
   402
                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
   403
                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
   404
                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
   405
                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
   406
        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
   407
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
        --------
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
        --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
   411
        --------
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
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
        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
   414
                --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
   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
                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
   417
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
                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
   419
                        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
   420
                        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
   421
                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
   422
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
                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
   424
                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
   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
                --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
   427
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
        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
   429
                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
   430
                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
   431
        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
   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
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
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
   435
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
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
   437
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
        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
   439
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
        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
   441
        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
   442
                        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
   443
                                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
   444
                                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
   445
                        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
   446
                                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
   447
                        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
   448
        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
   449
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
        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
   451
                                        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
   452
                                        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
   453
                                        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
   454
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 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
   456
        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
   457
                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
   458
                        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
   459
                                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
   460
                                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
   461
                        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
   462
                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
   463
                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
   464
                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
   465
        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
   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
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
   468
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
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
   470
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
        -------------
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
        ------ 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
   473
        -------------
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
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
        --[[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
   476
        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
   477
                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
   478
                        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
   479
                                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
   480
                                        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
   481
                                        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
   482
                                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
   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
                        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
   485
                        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
   486
                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
   487
        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
   488
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
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
        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
   491
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
        --[[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
   493
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
                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
   495
                        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
   496
                        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
   497
                        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
   498
                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
   499
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
                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
   501
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
                        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
   503
                                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
   504
                        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
   505
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
                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
   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
                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
   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
                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
   511
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
        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
   513
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
        ----- 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
   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
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
        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
   519
                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
   520
        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
   521
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 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
   525
        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
   526
        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
   527
        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
   528
        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
   529
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
   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
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
   532
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
        -- 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
   534
        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
   535
        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
   536
        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
   537
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
        -- 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
   539
        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
   540
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
                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
   542
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
                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
   544
                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
   545
                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
   546
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
                --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
   548
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
        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
   550
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
                --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
   552
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
        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
   554
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
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
   556
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
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
   558
	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
   559
	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
   560
				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
   561
	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
   562
				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
   563
				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
   564
				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
   565
				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
   566
				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
   567
	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
   568
				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
   569
				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
   570
				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
   571
				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
   572
				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
   573
	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
   574
				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
   575
				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
   576
				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
   577
				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
   578
				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
   579
	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
   580
				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
   581
				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
   582
				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
   583
				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
   584
				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
   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
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
   587
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
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
   589
	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
   590
		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
   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
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
   593
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
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
   595
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
	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
   597
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
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
   599
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
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
   601
	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
   602
        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
   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
            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
   605
            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
   606
            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
   607
            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
   608
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
            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
   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
            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
   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
            --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
   614
        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
   615
    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
   616
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
   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
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
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
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
   621
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
	-- 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
   623
	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
   624
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
		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
   626
		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
   627
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
	-- 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
   629
	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
   630
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
		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
   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
		-- 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
   634
		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
   635
			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
   636
		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
   637
			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
   638
		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
   639
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
		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
   641
			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
   642
		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
   643
		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
   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
		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
   646
			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
   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
		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
   650
		--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
   651
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
	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
   653
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
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
   655
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
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
   657
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
        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
   659
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
                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
   661
                        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
   662
                                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
   663
                        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
   664
                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
   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
        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
   667
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
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
   669
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
----------------------------------
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
-- 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
   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
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
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
   675
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
	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
   677
	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
   678
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   679
	--ufoFuel = tonumber(params["ufoFuel"])
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
   680
	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
   681
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   682
	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
   683
		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
   684
	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
   685
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   686
	if mapID == nil then
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   687
		mapID = 2 + GetRandom(7)
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   688
	end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   689
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
   690
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
   691
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   692
function onGameInit()
11545
86528b0cd491 detectMap() rewrite with more sane approach, also check waypoints placement to avoid cheating
unc0rr
parents: 11542
diff changeset
   693
    if mapID == nil then
86528b0cd491 detectMap() rewrite with more sane approach, also check waypoints placement to avoid cheating
unc0rr
parents: 11542
diff changeset
   694
        mapID = 2 + GetRandom(7)
86528b0cd491 detectMap() rewrite with more sane approach, also check waypoints placement to avoid cheating
unc0rr
parents: 11542
diff changeset
   695
    end
11012
91cc6aef818c tentative/lazy fixes for unC0Rr's evil
mikade <redgrinner@gmail.com>
parents: 10979
diff changeset
   696
11546
59bf29b4f523 Tech racer maps detection
unc0rr
parents: 11545
diff changeset
   697
    addHashData(mapID)
59bf29b4f523 Tech racer maps detection
unc0rr
parents: 11545
diff changeset
   698
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
   699
		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
   700
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
		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
   702
		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
   703
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   704
		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
   705
		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
   706
		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
   707
        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
   708
        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
   709
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
		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
   711
			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
   712
		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
   713
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
		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
   715
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
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
   717
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
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
   719
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
	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
   721
	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
   722
		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
   723
    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
   724
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
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
   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
function onSpecialPoint(x,y,flag)
11563
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   728
    if flag == 99 then
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   729
        fastX[fastCount] = x
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   730
        fastY[fastCount] = y
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   731
        fastCount = fastCount + 1
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   732
    else
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   733
        addHashData(x)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   734
        addHashData(y)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   735
        addHashData(flag)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   736
        specialPointsX[specialPointsCount] = x
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   737
        specialPointsY[specialPointsCount] = y
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   738
        specialPointsFlag[specialPointsCount] = flag
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   739
        specialPointsCount = specialPointsCount + 1
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   740
    end
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
   741
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
   742
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
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
   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
	-- 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
   746
	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
   747
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
		-- 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
   749
		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
   750
			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
   751
		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
   752
			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
   753
		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
   754
			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
   755
		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
   756
			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
   757
		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
   758
			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
   759
		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
   760
			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
   761
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
		-- 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
   763
		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
   764
			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
   765
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
		-- 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
   767
		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
   768
			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
   769
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
		-- 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
   771
		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
   772
			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
   773
		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
   774
			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
   775
		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
   776
			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
   777
		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
   778
			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
   779
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
		-- 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
   781
		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
   782
			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
   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
		-- 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
   785
		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
   786
			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
   787
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
		--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
   789
		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
   790
			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
   791
		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
   792
			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
   793
		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
   794
			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
   795
		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
   796
			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
   797
		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
   798
			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
   799
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
		-- 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
   801
		-- 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
   802
		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
   803
			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
   804
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
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
		-- 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
   807
		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
   808
			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
   809
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
		--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
   811
		--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
   812
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
		--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
   814
		--[[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
   815
			--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
   816
		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
   817
			--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
   818
		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
   819
			--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
   820
		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
   821
			--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
   822
		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
   823
			--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
   824
		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
   825
			--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
   826
		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
   827
			--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
   828
		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
   829
			--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
   830
		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
   831
			--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
   832
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   833
		elseif specialPointsFlag[i] == 98 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   834
			portalDistance = specialPointsX[i]
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   835
			ufoFuel = specialPointsY[i]
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   836
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
   837
		-- 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
   838
		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
   839
			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
   840
		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
   841
			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
   842
		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
   843
			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
   844
		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
   845
			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
   846
		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
   847
			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
   848
		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
   849
			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
   850
		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
   851
			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
   852
		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
   853
			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
   854
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
		-- 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
   856
		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
   857
			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
   858
		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
   859
			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
   860
		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
   861
			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
   862
		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
   863
			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
   864
		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
   865
			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
   866
		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
   867
			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
   868
		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
   869
			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
   870
		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
   871
			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
   872
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
		-- 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
   874
		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
   875
			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
   876
		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
   877
			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
   878
		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
   879
			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
   880
		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
   881
			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
   882
		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
   883
			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
   884
		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
   885
			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
   886
		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
   887
			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
   888
		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
   889
			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
   890
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
		-- 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
   892
		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
   893
			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
   894
		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
   895
			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
   896
		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
   897
			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
   898
		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
   899
			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
   900
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
		-- 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
   902
		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
   903
			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
   904
		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
   905
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
	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
   907
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
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
   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
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
   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
		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
   913
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
		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
   915
        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
   916
        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
   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
	    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
   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
		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
   921
			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
   922
			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
   923
		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
   924
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
        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
   926
                                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
   927
                                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
   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
                                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
   930
                                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
   931
								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
   932
								--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
   933
								--"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
   934
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
                                "", 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
   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
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
        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
   939
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
		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
   941
		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
   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
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
   944
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
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
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
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
   948
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
        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
   950
        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
   951
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
        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
   953
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 = 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
   955
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
		--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
   957
		--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
   958
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
		--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
   960
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
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
        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
   963
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
        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
   965
    --    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
   966
        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
   967
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
        -- 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
   969
        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
   970
                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
   971
                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
   972
                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
   973
        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
   974
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
        -- 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
   976
        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
   977
               -- 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
   978
                        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
   979
						--  --[[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
   980
                        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
   981
                        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
   982
                        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
   983
                        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
   984
                        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
   985
                --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
   986
                --        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
   987
                --        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
   988
                --        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
   989
                --        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
   990
				--		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
   991
               -- 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
   992
        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
   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
        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
   995
                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
   996
                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
   997
        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
   998
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
        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
  1000
        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
  1001
        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
  1002
        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
  1003
        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
  1004
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
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
  1006
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
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
  1008
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1009
		if (jet ~= nil) and (ufoFuel ~= 0) then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1010
			if ufoFuel == 2000 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1011
				SetHealth(jet, 2000)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1012
			end
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
  1013
		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
  1014
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1015
		runOnGears(PortalEffects)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1016
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
  1017
        -- 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
  1018
        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
  1019
                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
  1020
        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
  1021
            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
  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
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
            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
  1025
                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
  1026
                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
  1027
            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
  1028
                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
  1029
                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
  1030
            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
  1031
                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
  1032
                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
  1033
                    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
  1034
                    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
  1035
                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
  1036
            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
  1037
        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
  1038
            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
  1039
        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
  1040
        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
  1041
        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
  1042
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
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
		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
  1045
				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
  1046
		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
  1047
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
        -- 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
  1050
        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
  1051
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
                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
  1053
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
                        -- 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
  1055
                        --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
  1056
                        --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
  1057
						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
  1058
                                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
  1059
                                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
  1060
                                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
  1061
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
								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
  1064
                                --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
  1065
                                --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
  1066
								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
  1067
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
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
								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
  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
                                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
  1072
								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
  1073
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
						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
  1075
                                -- 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
  1076
                        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
  1077
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
                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
  1079
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
        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
  1081
			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
  1082
			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
  1083
		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
  1084
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
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
        -- 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
  1088
        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
  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
                --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
  1091
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
                -- 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
  1093
                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
  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
                        --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
  1096
                        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
  1097
                                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
  1098
                        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
  1099
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
                        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
  1101
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
                        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
  1103
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
                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
  1105
                    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
  1106
                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
  1107
                    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
  1108
                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
  1109
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 (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
  1111
                                        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
  1112
                                        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
  1113
                                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
  1114
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
                        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
  1116
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
                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
  1118
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
                -- 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
  1120
                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
  1121
                        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
  1122
                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
  1123
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
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
  1127
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1128
-- handle short range portal gun
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1129
function PortalEffects(gear)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1130
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1131
	if GetGearType(gear) == gtPortal then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1132
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1133
		tag = GetTag(gear)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1134
		if tag == 0 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1135
			col = 0xfab02aFF -- orange ball
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1136
		elseif tag == 1 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1137
			col = 0x00FF00FF -- orange portal
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1138
		elseif tag == 2 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1139
			col = 0x364df7FF  -- blue ball
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1140
		elseif tag == 3 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1141
			col = 0xFFFF00FF  -- blue portal
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1142
		end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1143
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1144
		if (tag == 0) or (tag == 2) then -- i.e ball form
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1145
			tempE = AddVisualGear(GetX(gear), GetY(gear), vgtDust, 0, true)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1146
			g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1147
			SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, 1, g9, col )
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1148
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1149
			remLife = getGearValue(gear,"life")
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1150
			remLife = remLife - 1
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1151
			setGearValue(gear, "life", remLife)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1152
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1153
			if remLife == 0 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1154
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1155
				tempE = AddVisualGear(GetX(gear)+15, GetY(gear), vgtSmoke, 0, true)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1156
				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1157
				SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, col )
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1158
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1159
				tempE = AddVisualGear(GetX(gear)-15, GetY(gear), vgtSmoke, 0, true)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1160
				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1161
				SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, col )
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1162
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1163
				tempE = AddVisualGear(GetX(gear), GetY(gear)+15, vgtSmoke, 0, true)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1164
				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1165
				SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, col )
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1166
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1167
				tempE = AddVisualGear(GetX(gear), GetY(gear)-15, vgtSmoke, 0, true)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1168
				g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1169
				SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, col )
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1170
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1171
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1172
				PlaySound(sndVaporize)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1173
				DeleteGear(gear)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1174
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1175
			end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1176
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1177
		end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1178
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1179
	end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1180
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1181
end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1182
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
  1183
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
  1184
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
        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
  1186
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
        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
  1188
                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
  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
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
  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
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
  1194
	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
  1195
		(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
  1196
		(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
  1197
		(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
  1198
		(GetGearType(gear) == gtExplosives) or
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1199
		(GetGearType(gear) == gtPortal) or
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
  1200
		(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
  1201
		(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
  1202
		(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
  1203
		(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
  1204
	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
  1205
		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
  1206
	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
  1207
		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
  1208
	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
  1209
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
  1210
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1211
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
  1212
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1213
       if isATrackedGear(gear) then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1214
		trackGear(gear)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1215
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1216
		if GetGearType(gear) == gtPortal then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1217
			setGearValue(gear,"life",portalDistance)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1218
		elseif GetGearType(gear) == gtHedgehog then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1219
            hhs[numhhs] = gear
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1220
            numhhs = numhhs + 1
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1221
            SetEffect(gear, heResurrectable, 1)
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
  1222
		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
  1223
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1224
	end
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
  1225
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1226
	if GetGearType(gear) == gtAirAttack then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1227
       cGear = gear
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1228
	elseif GetGearType(gear) == gtJetpack then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1229
		jet = gear
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1230
		if (ufoFuel ~= 0) then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1231
			SetHealth(jet, ufoFuel)
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
  1232
		end
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1233
	end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1234
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
  1235
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1236
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
  1237
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1238
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
  1239
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1240
        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
  1241
			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
  1242
		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
  1243
                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
  1244
        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
  1245
			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
  1246
		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
  1247
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1248
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
  1249
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1250
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
  1251
    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
  1252
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1253
    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
  1254
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
  1255
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1256
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
  1257
    usedWeapons[amSkip] = nil
11563
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
  1258
    usedWeapons[amExtraTime] = 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
  1259
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1260
    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
  1261
    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
  1262
    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
  1263
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1264
    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
  1265
    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
  1266
    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
  1267
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1268
    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
  1269
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1270
    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
  1271
        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
  1272
    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
  1273
        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
  1274
    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
  1275
        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
  1276
    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
  1277
        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
  1278
    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
  1279
        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
  1280
    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
  1281
        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
  1282
    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
  1283
11542
64a5ab2c4f00 Attempt to implement hash for special points to detect tech racer maps
unC0Rr
parents: 11012
diff changeset
  1284
    map = detectMapWithDigest()
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
  1285
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1286
    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
  1287
        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
  1288
            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
  1289
        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
  1290
    end
11569
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1291
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1292
    if fastCount > 0 then
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1293
        StartGhostPoints(fastCount)
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1294
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1295
        for i = 0, (fastCount - 1) do
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1296
            DumpPoint(fastX[i], fastY[i])
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1297
        end
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1298
    end
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1299
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
  1300
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
  1301
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1302
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
  1303
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1304
	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
  1305
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1306
	for i = 1, #atkArray do
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1307
		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
  1308
	end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1309
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1310
	for i = 1, #utilArray do
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1311
		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
  1312
	end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1313
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1314
end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1315