share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
author Wuzzy <almikes@aol.com>
Wed, 13 Apr 2016 13:16:01 +0200
changeset 11934 c17e5ac9f76d
parent 11933 20b755da986f
child 11935 e1bae42efacd
permissions -rw-r--r--
Force TechRacer maps when image map is selected. Fixes Google Code issue #882 If you start a TechRacer map with an image map selected, the resulting map will likely to be completely unplayable. So this commit disables this.
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
11591
7c9243584a72 Fix TechRacer not recoding finish if time was >= 100s by raising this limit ten times.
unc0rr
parents: 11585
diff changeset
   249
                teamScore[i] = 1000000
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
   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
                        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
   326
                        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
   327
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
                        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
   329
                        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
   330
                                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
   331
                                        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
   332
                                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
   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
11933
20b755da986f TechRacer: Don't mess with ammo caption while in waypoint.
Wuzzy <almikes@aol.com>
parents: 11932
diff changeset
   335
                        if not wpActive[i] then
20b755da986f TechRacer: Don't mess with ammo caption while in waypoint.
Wuzzy <almikes@aol.com>
parents: 11932
diff changeset
   336
                                AddCaption(string.format(loc("Waypoints remaining: %d"), wpRem),0xffba00ff,capgrpGameState)
20b755da986f TechRacer: Don't mess with ammo caption while in waypoint.
Wuzzy <almikes@aol.com>
parents: 11932
diff changeset
   337
                        end
20b755da986f TechRacer: Don't mess with ammo caption while in waypoint.
Wuzzy <almikes@aol.com>
parents: 11932
diff changeset
   338
20b755da986f TechRacer: Don't mess with ammo caption while in waypoint.
Wuzzy <almikes@aol.com>
parents: 11932
diff changeset
   339
                        wpActive[i] = true
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
   340
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   341
                end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   342
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   343
                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
   344
                        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
   345
                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
   346
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
        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
   348
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
        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
   350
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   351
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
   352
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   353
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
   354
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   355
        if bestTime == nil then
11591
7c9243584a72 Fix TechRacer not recoding finish if time was >= 100s by raising this limit ten times.
unc0rr
parents: 11585
diff changeset
   356
                bestTime = 1000000
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
   357
                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
   358
                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
   359
        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
   360
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
        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
   362
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
        -- 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
   364
        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
   365
                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
   366
                        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
   367
                                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
   368
                                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
   369
                        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
   370
                                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
   371
                        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
   372
                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
   373
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   374
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
        --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
   376
        --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
   377
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
        -- 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
   379
        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
   380
                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
   381
                        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
   382
                        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
   383
                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
   384
        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
   385
11591
7c9243584a72 Fix TechRacer not recoding finish if time was >= 100s by raising this limit ten times.
unc0rr
parents: 11585
diff changeset
   386
        if bestTime ~= 1000000 then
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
   387
                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
   388
        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
   389
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
        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
   391
                if trackTime == bestTime then -- best time of the race
11932
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   392
                        ShowMission(loc("TechRacer"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   393
                        loc("Track completed!"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   394
                        string.format(loc("New race record: %.1fs"), (trackTime/1000)) .. "|" ..
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   395
                        string.format(loc("Winning time: %s") .. bestTimeComment), 0, 4000)
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
   396
                        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
   397
                else    -- best time for the clan
11932
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   398
                        ShowMission(loc("TechRacer"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   399
                        loc("Track completed!"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   400
                        string.format(loc("New clan record: %.1fs"), (trackTime/1000)) .. "|" ..
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   401
                        string.format(loc("Winning time: %s"), bestTimeComment), 4, 4000)
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
   402
                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
   403
        else -- not any kind of new score
11932
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   404
                ShowMission(loc("TechRacer"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   405
                loc("Track completed!"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   406
                string.format(loc("Time: %.1fs"), (trackTime/1000)) .. "|" ..
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   407
                string.format(loc("Winning time: %s"), bestTimeComment), -amSkip, 4000)
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
   408
                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
   409
        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
   410
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   411
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
        --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
   414
        --------
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
        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
   417
                --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
   418
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   419
                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
   420
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   421
                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
   422
                        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
   423
                        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
   424
                end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   425
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   426
                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
   427
                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
   428
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   429
                --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
   430
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   431
        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
   432
                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
   433
                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
   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
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
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
   438
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
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
   440
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
        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
   442
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   443
        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
   444
        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
   445
                        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
   446
                                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
   447
                                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
   448
                        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
   449
                                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
   450
                        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
   451
        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
   452
11932
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   453
        ShowMission(    loc("TechRacer"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   454
                                        loc("Status update"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   455
                                        string.format(loc("Rounds complete: %d/%d"), roundNumber, roundLimit) .. "|" .. " " .. "|" ..
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   456
                                        loc("Best team times: ") .. "|" .. totalComment, 0, 4000)
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
   457
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   458
        -- end 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
   459
        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
   460
                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
   461
                        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
   462
                                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
   463
                                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
   464
                        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
   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
                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
   467
                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
   468
        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
   469
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
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
   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
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
   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
        ------ 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
   476
        -------------
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
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
        --[[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
   479
        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
   480
                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
   481
                        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
   482
                                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
   483
                                        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
   484
                                        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
   485
                                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
   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
                        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
   488
                        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
   489
                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
   490
        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
   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
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
        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
   494
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   495
        --[[if 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
   496
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
                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
   498
                        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
   499
                        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
   500
                        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
   501
                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
   502
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   503
                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
   504
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   505
                        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
   506
                                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
   507
                        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
   508
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
                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
   510
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   511
                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
   512
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
                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
   514
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   515
        end]]
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   516
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   517
        ------------
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
        ----- 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
   519
        ------------
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
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
        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
   522
                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
   523
        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
   524
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
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
   526
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
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
   528
        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
   529
        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
   530
        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
   531
        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
   532
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
   533
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   534
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
   535
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   536
        -- 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
   537
        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
   538
        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
   539
        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
   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
        -- 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
   542
        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
   543
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   544
                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
   545
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   546
                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
   547
                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
   548
                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
   549
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   550
                --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
   551
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
        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
   553
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
                --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
   555
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
        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
   557
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
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
   559
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
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
   561
	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
   562
	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
   563
				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
   564
	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
   565
				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
   566
				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
   567
				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
   568
				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
   569
				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
   570
	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
   571
				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
   572
				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
   573
				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
   574
				g = AddGear(x-30, y-30, gtGrenade, 0, 0, 0, girTime)
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   575
				g = AddGear(x-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
   576
	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
   577
				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
   578
				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
   579
				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
   580
				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
   581
				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
   582
	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
   583
				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
   584
				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
   585
				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
   586
				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
   587
				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
   588
	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
   589
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
   590
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   591
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
   592
	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
   593
		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
   594
	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
   595
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
   596
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   597
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
   598
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
	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
   600
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
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
   602
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
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
   604
	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
   605
        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
   606
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
            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
   608
            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
   609
            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
   610
            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
   611
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   612
            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
   613
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
            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
   615
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
            --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
   617
        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
   618
    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
   619
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
   620
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   621
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
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
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
   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
	-- 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
   626
	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
   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
		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
   629
		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
   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
	-- 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
   632
	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
   633
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
		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
   635
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
		-- 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
   637
		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
   638
			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
   639
		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
   640
			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
   641
		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
   642
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
		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
   644
			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
   645
		end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   646
		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
   647
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
		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
   649
			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
   650
		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
   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
		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
   653
		--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
   654
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
	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
   656
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   657
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   658
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   659
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
   660
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   661
        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
   662
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   663
                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
   664
                        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
   665
                                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
   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
                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
   668
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   669
        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
   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
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
   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
-- 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
   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
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
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
   678
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   679
	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
   680
	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
   681
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   682
	--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
   683
	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
   684
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   685
	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
   686
		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
   687
	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
   688
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   689
	if mapID == nil then
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   690
		mapID = 2 + GetRandom(7)
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   691
	end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   692
10959
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   693
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
   694
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   695
function onGameInit()
11545
86528b0cd491 detectMap() rewrite with more sane approach, also check waypoints placement to avoid cheating
unc0rr
parents: 11542
diff changeset
   696
    if mapID == nil then
86528b0cd491 detectMap() rewrite with more sane approach, also check waypoints placement to avoid cheating
unc0rr
parents: 11542
diff changeset
   697
        mapID = 2 + GetRandom(7)
86528b0cd491 detectMap() rewrite with more sane approach, also check waypoints placement to avoid cheating
unc0rr
parents: 11542
diff changeset
   698
    end
11012
91cc6aef818c tentative/lazy fixes for unC0Rr's evil
mikade <redgrinner@gmail.com>
parents: 10979
diff changeset
   699
11546
59bf29b4f523 Tech racer maps detection
unc0rr
parents: 11545
diff changeset
   700
    addHashData(mapID)
59bf29b4f523 Tech racer maps detection
unc0rr
parents: 11545
diff changeset
   701
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
   702
		Theme = "Cave"
11934
c17e5ac9f76d Force TechRacer maps when image map is selected. Fixes Google Code issue #882
Wuzzy <almikes@aol.com>
parents: 11933
diff changeset
   703
		Map = ""
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
   704
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
		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
   706
		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
   707
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   708
		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
   709
		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
   710
		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
   711
        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
   712
        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
   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
		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
   715
			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
   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
		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
   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
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   721
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   722
function 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
   723
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   724
	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
   725
	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
   726
		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
   727
    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
   728
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   729
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
   730
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   731
function onSpecialPoint(x,y,flag)
11563
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   732
    if flag == 99 then
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   733
        fastX[fastCount] = x
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   734
        fastY[fastCount] = y
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   735
        fastCount = fastCount + 1
11583
309faab3b6a5 Syntax fix
unC0Rr
parents: 11582
diff changeset
   736
    elseif flag == 0 then
11582
e54f8e0ca3bb Fix wp issue, hopefully
unC0Rr
parents: 11581
diff changeset
   737
        techX[techCount], techY[techCount] = x, y
e54f8e0ca3bb Fix wp issue, hopefully
unC0Rr
parents: 11581
diff changeset
   738
        techCount = techCount + 1
11563
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   739
    else
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   740
        addHashData(x)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   741
        addHashData(y)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   742
        addHashData(flag)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   743
        specialPointsX[specialPointsCount] = x
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   744
        specialPointsY[specialPointsCount] = y
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   745
        specialPointsFlag[specialPointsCount] = flag
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   746
        specialPointsCount = specialPointsCount + 1
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
   747
    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
   748
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
   749
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
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
   751
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
	-- 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
   753
	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
   754
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
		-- 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
   756
		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
   757
			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
   758
		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
   759
			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
   760
		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
   761
			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
   762
		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
   763
			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
   764
		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
   765
			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
   766
		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
   767
			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
   768
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
		-- 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
   770
		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
   771
			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
   772
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
		-- 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
   774
		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
   775
			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
   776
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
		-- 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
   778
		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
   779
			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
   780
		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
   781
			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
   782
		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
   783
			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
   784
		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
   785
			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
   786
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
		-- 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
   788
		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
   789
			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
   790
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
		-- 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
   792
		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
   793
			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
   794
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
		--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
   796
		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
   797
			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
   798
		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
   799
			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
   800
		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
   801
			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
   802
		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
   803
			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
   804
		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
   805
			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
   806
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
		-- 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
   808
		-- 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
   809
		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
   810
			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
   811
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   812
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
		-- 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
   814
		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
   815
			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
   816
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
		--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
   818
		--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
   819
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
		--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
   821
		--[[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
   822
			--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
   823
		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
   824
			--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
   825
		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
   826
			--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
   827
		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
   828
			--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
   829
		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
   830
			--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
   831
		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
   832
			--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
   833
		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
   834
			--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
   835
		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
   836
			--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
   837
		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
   838
			--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
   839
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   840
		elseif specialPointsFlag[i] == 98 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   841
			portalDistance = specialPointsX[i]
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   842
			ufoFuel = specialPointsY[i]
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   843
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
   844
		-- 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
   845
		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
   846
			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
   847
		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
   848
			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
   849
		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
   850
			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
   851
		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
   852
			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
   853
		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
   854
			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
   855
		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
   856
			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
   857
		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
   858
			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
   859
		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
   860
			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
   861
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
		-- 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
   863
		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
   864
			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
   865
		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
   866
			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
   867
		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
   868
			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
   869
		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
   870
			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
   871
		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
   872
			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
   873
		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
   874
			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
   875
		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
   876
			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
   877
		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
   878
			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
   879
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
		-- 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
   881
		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
   882
			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
   883
		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
   884
			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
   885
		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
   886
			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
   887
		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
   888
			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
   889
		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
   890
			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
   891
		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
   892
			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
   893
		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
   894
			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
   895
		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
   896
			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
   897
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
		-- 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
   899
		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
   900
			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
   901
		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
   902
			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
   903
		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
   904
			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
   905
		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
   906
			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
   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
		-- 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
   909
		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
   910
			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
   911
		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
   912
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   913
	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
   914
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   915
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
   916
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
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
   918
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
		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
   920
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   921
		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
   922
        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
   923
        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
   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
	    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
   926
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   927
		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
   928
			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
   929
			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
   930
		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
   931
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
        ShowMission     (
11932
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   933
                                loc("TechRacer"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   934
                                loc("A Hedgewars mini-game"),
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
   935
11932
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   936
                        	loc("Complete the track as fast as you can!") .. "|" ..
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   937
                                loc("Round limit:") .. " " .. roundLimit .. "|" ..
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
   938
				loc("You can further customize the race by changing the scheme script paramater.") .. "|" ..
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
   939
								--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
   940
								--"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
   941
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
                                "", 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
   943
                                )
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
        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
   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
		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
   948
		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
   949
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   950
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
   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
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
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
   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
        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
   957
        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
   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
        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
   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
		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
   962
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
		--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
   964
		--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
   965
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
		--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
   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
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
        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
   970
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
        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
   972
    --    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
   973
        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
   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
        -- 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
   976
        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
   977
                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
   978
                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
   979
                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
   980
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   981
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   982
        -- 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
   983
        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
   984
               -- 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
   985
                        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
   986
						--  --[[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
   987
                        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
   988
                        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
   989
                --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
   990
                --        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
   991
                --        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
   992
                --        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
   993
                --        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
   994
				--		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
   995
               -- 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
   996
        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
   997
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
        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
   999
                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
  1000
                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
  1001
        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
  1002
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, 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
  1004
        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
  1005
        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
  1006
        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
  1007
        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
  1008
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1009
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
  1010
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1011
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
  1012
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1013
		if (jet ~= nil) and (ufoFuel ~= 0) then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1014
			if ufoFuel == 2000 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1015
				SetHealth(jet, 2000)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1016
			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
  1017
		end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1018
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1019
		runOnGears(PortalEffects)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1020
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
  1021
        -- 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
  1022
        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
  1023
                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
  1024
        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
  1025
            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
  1026
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
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1028
            if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then
11932
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
  1029
                AddCaption(loc("Please place the waypoint in the air and within the map boundaries"))
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
  1030
                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
  1031
            elseif (y > WaterLine-50) then
11932
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
  1032
                AddCaption(loc("Please place the waypoint further away from the waterline"))
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
  1033
                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
  1034
            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
  1035
                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
  1036
                if wpCount == wpLimit then
11932
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
  1037
                    AddCaption(loc("Race complexity limit reached"))
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
  1038
                    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
  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
            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
  1041
        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
  1042
            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
  1043
        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
  1044
        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
  1045
        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
  1046
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
		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
  1049
				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
  1050
		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
  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
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
        -- 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
  1054
        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
  1055
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1056
                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
  1057
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1058
                        -- 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
  1059
                        --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
  1060
                        --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
  1061
						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
  1062
                                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
  1063
                                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
  1064
                                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
  1065
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1066
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
								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
  1068
                                --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
  1069
                                --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
  1070
								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
  1071
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1072
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1073
								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
  1074
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1075
                                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
  1076
								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
  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
						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
  1079
                                -- 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
  1080
                        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
  1081
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
                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
  1083
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
        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
  1085
			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
  1086
			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
  1087
		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
  1088
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
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
        -- 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
  1092
        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
  1093
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
                --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
  1095
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 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
  1097
                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
  1098
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1099
                        --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
  1100
                        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
  1101
                                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
  1102
                        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
  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
                        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
  1105
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
                        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
  1107
11932
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
  1108
                		AddCaption(string.format(loc("Time: %.1fs"), (trackTime/1000)), GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2)
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
  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
11932
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11591
diff changeset
  1188
                AddCaption(loc("Race failed!"), GetClanColor(GetHogClan(gear)), capgrpMessage2)
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
  1189
                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
  1190
        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
  1191
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
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
  1193
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
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
  1195
	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
  1196
		(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
  1197
		(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
  1198
		(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
  1199
		(GetGearType(gear) == gtExplosives) or
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1200
		(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
  1201
		(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
  1202
		(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
  1203
		(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
  1204
		(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
  1205
	then
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
		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
  1207
	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
  1208
		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
  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
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
  1211
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
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
  1213
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1214
       if isATrackedGear(gear) then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1215
		trackGear(gear)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1216
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1217
		if GetGearType(gear) == gtPortal then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1218
			setGearValue(gear,"life",portalDistance)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1219
		elseif GetGearType(gear) == gtHedgehog then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1220
            hhs[numhhs] = gear
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1221
            numhhs = numhhs + 1
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1222
            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
  1223
		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
  1224
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1225
	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
  1226
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1227
	if GetGearType(gear) == gtAirAttack then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1228
       cGear = gear
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1229
	elseif GetGearType(gear) == gtJetpack then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1230
		jet = gear
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1231
		if (ufoFuel ~= 0) then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1232
			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
  1233
		end
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1234
	end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1235
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
  1236
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
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
  1238
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
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
  1240
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
        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
  1242
			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
  1243
		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
  1244
                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
  1245
        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
  1246
			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
  1247
		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
  1248
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
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
  1250
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
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
  1252
    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
  1253
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
    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
  1255
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
  1256
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
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
  1258
    usedWeapons[amSkip] = nil
11563
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11546
diff changeset
  1259
    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
  1260
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
    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
  1262
    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
  1263
    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
  1264
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[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
  1266
    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
  1267
    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
  1268
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
    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
  1270
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
    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
  1272
        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
  1273
    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
  1274
        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
  1275
    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
  1276
        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
  1277
    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
  1278
        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
  1279
    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
  1280
        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
  1281
    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
  1282
        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
  1283
    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
  1284
11542
64a5ab2c4f00 Attempt to implement hash for special points to detect tech racer maps
unC0Rr
parents: 11012
diff changeset
  1285
    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
  1286
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
    for i = 0, (numTeams-1) do
11591
7c9243584a72 Fix TechRacer not recoding finish if time was >= 100s by raising this limit ten times.
unc0rr
parents: 11585
diff changeset
  1288
        if teamScore[i] < 1000000 then
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
  1289
            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
  1290
        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
  1291
    end
11569
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1292
11585
026c329b1a13 Don't dump ghost points if map isn't detected
unc0rr
parents: 11583
diff changeset
  1293
    if map ~= nil and fastCount > 0 then
11569
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1294
        StartGhostPoints(fastCount)
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1295
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1296
        for i = 0, (fastCount - 1) do
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1297
            DumpPoint(fastX[i], fastY[i])
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
    end
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11563
diff changeset
  1300
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
  1301
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
  1302
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1303
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
  1304
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1305
	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
  1306
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1307
	for i = 1, #atkArray do
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1308
		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
  1309
	end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1310
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1311
	for i = 1, #utilArray do
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1312
		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
  1313
	end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1314
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1315
end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1316