share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
author Wuzzy <Wuzzy2@mail.ru>
Sat, 17 Feb 2018 11:25:43 +0100
changeset 13032 625d5a45f267
parent 13029 a568bc16a99a
child 13220 bc95df84395f
permissions -rw-r--r--
Racer/TechRacer: Show best times next to team bars
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
12393
0eb1457f7b94 Add big fat developer warning to all racing scripts about compability
Wuzzy <almikes@aol.com>
parents: 12338
diff changeset
     5
-- DEVELOPER WARNING - FOR OFFICIAL DEVELOPMENT --
0eb1457f7b94 Add big fat developer warning to all racing scripts about compability
Wuzzy <almikes@aol.com>
parents: 12338
diff changeset
     6
-- Be careful when editig this script, do not introduce changes lightly!
0eb1457f7b94 Add big fat developer warning to all racing scripts about compability
Wuzzy <almikes@aol.com>
parents: 12338
diff changeset
     7
-- This script is used for time records on the official Hedgewars server.
0eb1457f7b94 Add big fat developer warning to all racing scripts about compability
Wuzzy <almikes@aol.com>
parents: 12338
diff changeset
     8
-- Introducing breaking changes means we have to invalidate past time records!
0eb1457f7b94 Add big fat developer warning to all racing scripts about compability
Wuzzy <almikes@aol.com>
parents: 12338
diff changeset
     9
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
    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
-- 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
    12
--------------
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
    13
-- 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
    14
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
--------------
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
--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
    17
--------------
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
-- 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
    19
-- 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
    20
-- 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
    21
-- 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
    22
-- 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
    23
-- 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
    24
-- 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
    25
-- 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
    26
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
--------------
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
--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
    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
-- 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
    31
-- 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
    32
-- 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
    33
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
--------------
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
--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
    36
--------------
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
-- 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
    38
-- 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
    39
-- 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
    40
-- 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
    41
-- 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
    42
-- 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
    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.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
    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
-- 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
    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.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
    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
-- 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
    53
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
--------------
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
--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
    56
--------------
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
    57
-- 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
    58
-- (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
    59
-- 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
    60
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
    61
--------------
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
    62
--0.8
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
    63
--------------
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
    64
-- 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
    65
-- generate map previews for level
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
    66
-- 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
    67
-- 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
    68
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    69
--------------
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    70
--0.9
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    71
--------------
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    72
-- added variable portal limiter (and effects) from Escape script
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    73
-- allow variable ufoFuel (nil is default, 2000 is infinite)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
    74
-- 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
    75
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
    76
-----------------------------
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
    77
-- 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
    78
-----------------------------
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
    79
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
    80
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
    81
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
    82
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
    83
HedgewarsScriptLoad("/Scripts/Params.lua")
10961
b30f29396f0c Also preview waypoints
nemo
parents: 10959
diff changeset
    84
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
    85
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
    86
------------------
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
-- 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
    88
------------------
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
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
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
    91
				{
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
				{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
    93
				{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
    94
				{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
    95
				{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
    96
				{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
    97
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
				{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
    99
				{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
   100
				{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
   101
				{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
   102
				{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
   103
				{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
   104
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
				{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
   106
				{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
   107
				{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
   108
				{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
   109
				{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
   110
				{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
   111
				{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
   112
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
				{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
   114
				{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
   115
				{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
   116
				{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
   117
				{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
   118
				{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
   119
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
				{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
   121
				{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
   122
				{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
   123
				{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
   124
				{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
   125
				{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
   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
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
				{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
   129
				{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
   130
				{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
   131
				{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
   132
				{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
   133
				{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
   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
				{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
   136
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   137
				{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
   138
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
				}
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
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
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
   142
				{
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
				{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
   144
				{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
   145
				{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
   146
				{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
   147
				{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
   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
				{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
   150
				{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
   151
				{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
   152
				{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
   153
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
				{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
   155
				{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
   156
				{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
   157
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
				{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
   159
				{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
   160
				{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
   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
				{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
   163
				{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
   164
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   165
				{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
   166
				}
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
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 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
   169
local jet = nil
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   170
portalDistance = 5000 -- 15
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   171
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
   172
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
   173
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
   174
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
   175
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
   176
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   177
local 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
   178
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
   179
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
   180
local fastIndex = 0
11586
fd02a080d962 - Fix room config being sent unmodified
unc0rr
parents: 11574
diff changeset
   181
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
   182
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   183
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
   184
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
   185
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
   186
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   187
local 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
   188
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
   189
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
   190
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
   191
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   192
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
   193
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   194
--------------------------
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   195
-- 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
   196
--------------------------
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   197
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   198
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
   199
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
   200
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   201
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
   202
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
   203
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
   204
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
   205
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
   206
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   207
local 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
   208
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
   209
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
-- 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
   212
--------
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 cGear = nil
13029
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
   215
local cameraGear = 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
   216
11942
8fd4926e1e9e TechRacer: Cleanup mess regarding teams which did not finish
Wuzzy <almikes@aol.com>
parents: 11941
diff changeset
   217
local bestClan = 10
8fd4926e1e9e TechRacer: Cleanup mess regarding teams which did not finish
Wuzzy <almikes@aol.com>
parents: 11941
diff changeset
   218
local 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
   219
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 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
   221
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
   222
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
   223
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
   224
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 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
   226
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
   227
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
   228
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
   229
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
   230
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
   231
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
   232
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
   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
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
   235
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   236
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
   237
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
   238
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
   239
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
-- 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
   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
--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
   245
--end
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
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
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
   248
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   249
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
        -- 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
   251
        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
   252
                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
   253
                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
   254
                teamIndex[i] = 0
11596
7c9243584a72 Fix TechRacer not recoding finish if time was >= 100s by raising this limit ten times.
unc0rr
parents: 11590
diff changeset
   255
                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
   256
        end
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
        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
   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
        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
   260
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
                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
   262
                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
   263
                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
   264
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
                        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
   266
                        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
   267
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
                        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
   269
                                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
   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
                        end
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
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
                        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
   274
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
                        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
   276
                                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
   277
                                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
   278
                                        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
   279
                                        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
   280
                                end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   281
                        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   282
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
                end
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
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   285
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   286
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   287
        -- 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
   288
        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
   289
                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
   290
                        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
   291
                                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
   292
                                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
   293
                                        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
   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
                                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
   296
                                --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
   297
                        end
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
                end
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
        end
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
end
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
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
-----------------
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
-- 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
   307
-----------------
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
12971
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   309
-- Returns min opacity, max opacity and flashing speed (`FrameTicks`)
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   310
-- for the waypoint visual gears
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   311
function FlashingHelper(wpIndex)
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   312
        local minO, maxO, flashing
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   313
        if wpIndex == 0 then
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   314
                -- Notable flashing of first waypoint
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   315
                minO, maxO = 92, 255
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   316
                flashing = 2
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   317
        else
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   318
                -- Slow pulsation
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   319
                minO, maxO = 164, 224
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   320
                flashing = 10
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   321
        end
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   322
	return minO, maxO, flashing
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   323
end
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   324
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
   325
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
   326
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
        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
   328
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   329
        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
   330
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   331
                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
   332
                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
   333
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
                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
   335
                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
   336
                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
   337
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   338
                --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
   339
                --      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
   340
                --end
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
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
                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
   343
12969
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   344
                if dist < (NR*NR) and not gameOver 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
   345
                --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
   346
                        --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
   347
                        wpCol[i] = GetClanColor(GetHogClan(CurrentHedgehog)) -- new                             --GetClanColor(1)
12967
52c12029c7bd Increase opacity of Racer/TechRacer waypoints
Wuzzy <Wuzzy2@mail.ru>
parents: 12429
diff changeset
   348
                        SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 64, 64, 1, 10, 0, wpRad, 5, wpCol[i])
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
   349
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   350
                        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
   351
                        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
   352
                                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
   353
                                        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
   354
                                end
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
                        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   356
11938
20b755da986f TechRacer: Don't mess with ammo caption while in waypoint.
Wuzzy <almikes@aol.com>
parents: 11937
diff changeset
   357
                        if not wpActive[i] then
11941
c750c21e4a44 Fix some incorrect TechRacer messages
Wuzzy <almikes@aol.com>
parents: 11940
diff changeset
   358
                                local wpMessage = ""
c750c21e4a44 Fix some incorrect TechRacer messages
Wuzzy <almikes@aol.com>
parents: 11940
diff changeset
   359
                                if wpRem-1 == 0 then
c750c21e4a44 Fix some incorrect TechRacer messages
Wuzzy <almikes@aol.com>
parents: 11940
diff changeset
   360
                                        wpMessage = loc("Track completed!")
c750c21e4a44 Fix some incorrect TechRacer messages
Wuzzy <almikes@aol.com>
parents: 11940
diff changeset
   361
                                else
c750c21e4a44 Fix some incorrect TechRacer messages
Wuzzy <almikes@aol.com>
parents: 11940
diff changeset
   362
                                        wpMessage = string.format(loc("Waypoints remaining: %d"), wpRem-1)
c750c21e4a44 Fix some incorrect TechRacer messages
Wuzzy <almikes@aol.com>
parents: 11940
diff changeset
   363
                                end
c750c21e4a44 Fix some incorrect TechRacer messages
Wuzzy <almikes@aol.com>
parents: 11940
diff changeset
   364
                                AddCaption(wpMessage, 0xffba00ff, capgrpGameState)
11938
20b755da986f TechRacer: Don't mess with ammo caption while in waypoint.
Wuzzy <almikes@aol.com>
parents: 11937
diff changeset
   365
                        end
20b755da986f TechRacer: Don't mess with ammo caption while in waypoint.
Wuzzy <almikes@aol.com>
parents: 11937
diff changeset
   366
20b755da986f TechRacer: Don't mess with ammo caption while in waypoint.
Wuzzy <almikes@aol.com>
parents: 11937
diff changeset
   367
                        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
   368
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   369
                end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   370
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
                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
   372
                        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
   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
        end
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
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
        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
   378
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
end
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
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
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
   382
11942
8fd4926e1e9e TechRacer: Cleanup mess regarding teams which did not finish
Wuzzy <almikes@aol.com>
parents: 11941
diff changeset
   383
	local bestTimeComment = loc("Did not finish")
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
   384
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
        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
   386
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   387
        -- 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
   388
        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
   389
                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
   390
                        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
   391
                                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
   392
                                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
   393
                        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
   394
                                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
   395
                        end
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
                end
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
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   398
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   399
        -- 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
   400
        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
   401
                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
   402
                        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
   403
                        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
   404
                end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   405
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   406
11596
7c9243584a72 Fix TechRacer not recoding finish if time was >= 100s by raising this limit ten times.
unc0rr
parents: 11590
diff changeset
   407
        if bestTime ~= 1000000 then
11942
8fd4926e1e9e TechRacer: Cleanup mess regarding teams which did not finish
Wuzzy <almikes@aol.com>
parents: 11941
diff changeset
   408
                bestTimeComment = string.format(loc("%.1fs"), (bestTime/1000))
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
   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
        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
   412
                if trackTime == bestTime then -- best time of the race
11937
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   413
                        ShowMission(loc("TechRacer"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   414
                        loc("Track completed!"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   415
                        string.format(loc("New race record: %.1fs"), (trackTime/1000)) .. "|" ..
11942
8fd4926e1e9e TechRacer: Cleanup mess regarding teams which did not finish
Wuzzy <almikes@aol.com>
parents: 11941
diff changeset
   416
                        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
   417
                        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
   418
                else    -- best time for the clan
11937
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   419
                        ShowMission(loc("TechRacer"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   420
                        loc("Track completed!"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   421
                        string.format(loc("New clan record: %.1fs"), (trackTime/1000)) .. "|" ..
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   422
                        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
   423
                end
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
        else -- not any kind of new score
11937
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   425
                ShowMission(loc("TechRacer"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   426
                loc("Track completed!"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   427
                string.format(loc("Time: %.1fs"), (trackTime/1000)) .. "|" ..
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   428
                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
   429
                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
   430
        end
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
13032
625d5a45f267 Racer/TechRacer: Show best times next to team bars
Wuzzy <Wuzzy2@mail.ru>
parents: 13029
diff changeset
   432
        for i = 0, (TeamsCount-1) do
625d5a45f267 Racer/TechRacer: Show best times next to team bars
Wuzzy <Wuzzy2@mail.ru>
parents: 13029
diff changeset
   433
                if teamNameArr[i] ~= " " and teamScore[i] ~= 1000000 then
625d5a45f267 Racer/TechRacer: Show best times next to team bars
Wuzzy <Wuzzy2@mail.ru>
parents: 13029
diff changeset
   434
                        SetTeamLabel(teamNameArr[i], string.format(loc("%.1fs"), teamScore[i]/1000))
625d5a45f267 Racer/TechRacer: Show best times next to team bars
Wuzzy <Wuzzy2@mail.ru>
parents: 13029
diff changeset
   435
                end
625d5a45f267 Racer/TechRacer: Show best times next to team bars
Wuzzy <Wuzzy2@mail.ru>
parents: 13029
diff changeset
   436
        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
   437
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   438
        --------
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
        --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
   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
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   442
        if 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
   443
                --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
   444
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
                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
   446
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
                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
   448
                        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
   449
                        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
   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
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
                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
   453
                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
   454
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   455
                --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
   456
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
        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
   458
                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
   459
                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
   460
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   461
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   462
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
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   464
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   465
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
   466
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   467
        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
   468
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   469
        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
   470
        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
   471
                        if teamNameArr[i] ~= " " then                           -- teamScore[teamClan[i]]
11942
8fd4926e1e9e TechRacer: Cleanup mess regarding teams which did not finish
Wuzzy <almikes@aol.com>
parents: 11941
diff changeset
   472
				if teamScore[i] ~= 1000000 then
8fd4926e1e9e TechRacer: Cleanup mess regarding teams which did not finish
Wuzzy <almikes@aol.com>
parents: 11941
diff changeset
   473
                                	teamComment[i] = string.format(loc("%s: %.1fs"), teamNameArr[i], (teamScore[i]/1000)) .. "|"
8fd4926e1e9e TechRacer: Cleanup mess regarding teams which did not finish
Wuzzy <almikes@aol.com>
parents: 11941
diff changeset
   474
				else
8fd4926e1e9e TechRacer: Cleanup mess regarding teams which did not finish
Wuzzy <almikes@aol.com>
parents: 11941
diff changeset
   475
                                	teamComment[i] = string.format(loc("%s: Did not finish"), teamNameArr[i]) .. "|"
8fd4926e1e9e TechRacer: Cleanup mess regarding teams which did not finish
Wuzzy <almikes@aol.com>
parents: 11941
diff changeset
   476
				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
   477
                                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
   478
                        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
   479
                                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
   480
                        end
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
        end
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
11937
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   483
        ShowMission(    loc("TechRacer"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   484
                                        loc("Status update"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   485
                                        string.format(loc("Rounds complete: %d/%d"), roundNumber, roundLimit) .. "|" .. " " .. "|" ..
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
   486
                                        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
   487
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
        -- 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
   489
        if roundNumber >= roundLimit then
11940
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   490
                -- Sort the scores for the ranking list
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   491
                local unfinishedArray = {}
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   492
                local sortedTeams = {}
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   493
                local k = 1
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   494
                for i = 0, TeamsCount-1 do
11942
8fd4926e1e9e TechRacer: Cleanup mess regarding teams which did not finish
Wuzzy <almikes@aol.com>
parents: 11941
diff changeset
   495
                        if teamScore[i] ~= 1000000 and teamNameArr[i] ~= " " then
11940
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   496
                               sortedTeams[k] = {}
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   497
                               sortedTeams[k].name = teamNameArr[i]
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   498
                               sortedTeams[k].score = teamScore[i]
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   499
                               k = k + 1
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   500
                        else
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   501
                               table.insert(unfinishedArray, string.format(loc("%s did not finish the race."), teamNameArr[i]))
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
   502
                        end
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
                end
11940
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   504
                table.sort(sortedTeams, function(team1, team2) return team1.score < team2.score end)
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   505
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   506
                -- Write all the stats!
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   507
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   508
                for i = 1, #sortedTeams do
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   509
                        SendStat(siPointType, loc("milliseconds"))
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   510
                        SendStat(siPlayerKills, sortedTeams[i].score, sortedTeams[i].name)
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   511
                end
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   512
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   513
                if #sortedTeams >= 1 then
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   514
                        SendStat(siGameResult, string.format(loc("%s wins!"), sortedTeams[1].name))
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   515
                        SendStat(siCustomAchievement, string.format(loc("%s wins with a best time of %.1fs."), sortedTeams[1].name, (sortedTeams[1].score/1000)))
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   516
                        for i=1,#unfinishedArray do
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   517
                                 SendStat(siCustomAchievement, unfinishedArray[i])
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   518
                        end
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   519
                else
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   520
                        SendStat(siGameResult, loc("Round draw"))
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   521
                        SendStat(siCustomAchievement, loc("Nobody managed to finish the race. What a shame!"))
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   522
                        SendStat(siCustomAchievement, loc("Maybe you should try an easier TechRacer map."))
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   523
                end
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
   524
12338
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
   525
		-- Kill all the losers
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
   526
		for i = 0, (numhhs-1) do
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
   527
			if GetHogClan(hhs[i]) ~= bestClan then
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
   528
				SetEffect(hhs[i], heResurrectable, 0)
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
   529
				SetHealth(hhs[i],0)
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
   530
			end
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
   531
		end
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
   532
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
   533
		gameOver = true
12969
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   534
                for i=0, wpCount-1 do
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   535
                         -- Fade out waypoints
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   536
                         SetVisualGearValues(wpCirc[i], nil, nil, 0, 0, nil, 6)
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   537
                end
12338
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
   538
		EndTurn(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
   539
        end
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
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   542
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   543
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
   544
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
        ------ 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
   547
        -------------
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   548
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
        --[[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
   550
        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
   551
                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
   552
                        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
   553
                                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
   554
                                        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
   555
                                        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
   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
                        end
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
                        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
   559
                        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
   560
                end
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
        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
   562
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
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
        end]]
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
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
        --[[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
   567
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
                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
   569
                        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
   570
                        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
   571
                        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
   572
                end
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
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
                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
   575
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
                        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
   577
                                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
   578
                        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   579
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
                end
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
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
                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
   583
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
                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
   585
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   586
        end]]
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   587
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   588
        ------------
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
        ----- 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
   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
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 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
   593
                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
   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
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
end
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
12292
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
   598
function DisableTumbler(endTurn)
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
   599
        if endTurn == nil then endTurn = true end
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
   600
        if racerActive then
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
   601
                currCount = 0
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
   602
                fastIndex = 0
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
   603
                racerActive = false -- newadd
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
   604
                if endTurn then
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
   605
                         EndTurn(true)
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
   606
                end
12969
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   607
		if trackFinished and not gameOver then
12968
544c4302efe4 Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents: 12967
diff changeset
   608
                         for i=0, wpCount-1 do
544c4302efe4 Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents: 12967
diff changeset
   609
                       	         SetVisualGearValues(wpCirc[i], nil, nil, 255, 255, nil, 2)
544c4302efe4 Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents: 12967
diff changeset
   610
                         end
12969
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   611
                elseif not gameOver then
12968
544c4302efe4 Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents: 12967
diff changeset
   612
                         for i=0, wpCount-1 do
544c4302efe4 Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents: 12967
diff changeset
   613
                       	         SetVisualGearValues(wpCirc[i], nil, nil, 32, 32, nil, 1)
544c4302efe4 Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents: 12967
diff changeset
   614
                         end
544c4302efe4 Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents: 12967
diff changeset
   615
                end
12292
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
   616
        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
   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
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
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
   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
        -- 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
   622
        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
   623
        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
   624
        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
   625
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   626
        -- 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
   627
        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
   628
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
                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
   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
                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
   632
                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
   633
                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
   634
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
                --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
   636
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
        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
   638
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
                --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
   640
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
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   644
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   645
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
   646
	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
   647
	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
   648
				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
   649
	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
   650
				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
   651
				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
   652
				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
   653
				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
   654
				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
   655
	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
   656
				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
   657
				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
   658
				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
   659
				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
   660
				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
   661
	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
   662
				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
   663
				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
   664
				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
   665
				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
   666
				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
   667
	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
   668
				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
   669
				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
   670
				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
   671
				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
   672
				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
   673
	end
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
end
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
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
   677
	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
   678
		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
   679
	end
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
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   681
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   682
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
   683
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
	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
   685
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
end
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
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
function CallBob(x,y)
12969
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   689
	if not racerActive and not gameOver 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
   690
        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
   691
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   692
            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
   693
            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
   694
            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
   695
            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
   696
12971
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   697
            local minO, maxO, flashing = FlashingHelper(wpCount)
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   698
            -- Make first waypoint flash very noticably before the hog starts racing
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
   699
            SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], minO, maxO, 1, flashing, 0, wpRad, 5, wpCol[wpCount])
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
   700
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   701
            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
   702
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   703
            --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
   704
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   705
    end
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
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   707
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   708
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   709
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   710
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
   711
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
	-- 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
   713
	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
   714
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   715
		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
   716
		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
   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
	-- 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
   719
	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
   720
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
		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
   722
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
		-- 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
   724
		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
   725
			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
   726
		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
   727
			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
   728
		end
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
12969
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   730
                if gameOver then
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   731
		        for i = 0,(wpCount-1) do
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   732
                                SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 164, 224, 1, 10, 0, wpRad, 5, wpCol[wpCount])
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   733
                        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
   734
12969
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   735
                else
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   736
		        for i = 0,(wpCount-1) do
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   737
		        	DeleteVisualGear(wpCirc[i])
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   738
		        end
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   739
		        wpCount = 0
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   740
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   741
		        for i = 1, techCount-1 do
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   742
			        CallBob(techX[i],techY[i])
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   743
		        end
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
   744
                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
   745
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   746
		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
   747
		--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
   748
12394
605a7c85a798 Mention overwritten fuel in ammo description of UFO in TechRacer
Wuzzy <almikes@aol.com>
parents: 12393
diff changeset
   749
		if ufoFuel == 2000 then
605a7c85a798 Mention overwritten fuel in ammo description of UFO in TechRacer
Wuzzy <almikes@aol.com>
parents: 12393
diff changeset
   750
			SetAmmoDescriptionAppendix(amJetpack, loc("On this map you get infinite fuel."))
605a7c85a798 Mention overwritten fuel in ammo description of UFO in TechRacer
Wuzzy <almikes@aol.com>
parents: 12393
diff changeset
   751
		elseif ufoFuel ~= nil and ufoFuel ~= 0 then
605a7c85a798 Mention overwritten fuel in ammo description of UFO in TechRacer
Wuzzy <almikes@aol.com>
parents: 12393
diff changeset
   752
			SetAmmoDescriptionAppendix(amJetpack, string.format(loc("On this map you get %d%% fuel."), div(ufoFuel, 20)))
605a7c85a798 Mention overwritten fuel in ammo description of UFO in TechRacer
Wuzzy <almikes@aol.com>
parents: 12393
diff changeset
   753
		end
605a7c85a798 Mention overwritten fuel in ammo description of UFO in TechRacer
Wuzzy <almikes@aol.com>
parents: 12393
diff changeset
   754
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
   755
	end
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
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
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   758
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   759
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
   760
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
        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
   762
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   763
                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
   764
                        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
   765
                                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
   766
                        end
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
                end
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
        end
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
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
end
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
----------------------------------
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
-- 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
   775
----------------------------------
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
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
   778
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   779
	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
   780
	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
   781
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   782
	--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
   783
	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
   784
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   785
	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
   786
		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
   787
	end
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
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   789
	if mapID == nil then
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   790
		mapID = 2 + GetRandom(7)
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   791
	end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   792
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
   793
end
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
function onGameInit()
11550
86528b0cd491 detectMap() rewrite with more sane approach, also check waypoints placement to avoid cheating
unc0rr
parents: 11547
diff changeset
   796
    if mapID == nil then
86528b0cd491 detectMap() rewrite with more sane approach, also check waypoints placement to avoid cheating
unc0rr
parents: 11547
diff changeset
   797
        mapID = 2 + GetRandom(7)
86528b0cd491 detectMap() rewrite with more sane approach, also check waypoints placement to avoid cheating
unc0rr
parents: 11547
diff changeset
   798
    end
11012
91cc6aef818c tentative/lazy fixes for unC0Rr's evil
mikade <redgrinner@gmail.com>
parents: 10979
diff changeset
   799
11551
59bf29b4f523 Tech racer maps detection
unc0rr
parents: 11550
diff changeset
   800
    addHashData(mapID)
59bf29b4f523 Tech racer maps detection
unc0rr
parents: 11550
diff changeset
   801
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
   802
		Theme = "Cave"
11939
c17e5ac9f76d Force TechRacer maps when image map is selected. Fixes Google Code issue #882
Wuzzy <almikes@aol.com>
parents: 11938
diff changeset
   803
		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
   804
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   805
		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
   806
		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
   807
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
   808
		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
   809
		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
   810
		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
   811
        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
   812
        WaterRise = 0
12084
8f222872d432 Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents: 11942
diff changeset
   813
        HealthDecrease = 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
   814
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
		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
   816
			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
   817
		end
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
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
		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
   820
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
end
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
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
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
   824
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
	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
   826
	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
   827
		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
   828
    end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   829
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   830
end
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
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
function onSpecialPoint(x,y,flag)
11568
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   833
    if flag == 99 then
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   834
        fastX[fastCount] = x
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   835
        fastY[fastCount] = y
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   836
        fastCount = fastCount + 1
11588
309faab3b6a5 Syntax fix
unC0Rr
parents: 11587
diff changeset
   837
    elseif flag == 0 then
11587
e54f8e0ca3bb Fix wp issue, hopefully
unC0Rr
parents: 11586
diff changeset
   838
        techX[techCount], techY[techCount] = x, y
e54f8e0ca3bb Fix wp issue, hopefully
unC0Rr
parents: 11586
diff changeset
   839
        techCount = techCount + 1
11568
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   840
    else
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   841
        addHashData(x)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   842
        addHashData(y)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   843
        addHashData(flag)
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   844
        specialPointsX[specialPointsCount] = x
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   845
        specialPointsY[specialPointsCount] = y
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   846
        specialPointsFlag[specialPointsCount] = flag
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   847
        specialPointsCount = specialPointsCount + 1
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
   848
    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
   849
end
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
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
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
   852
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
	-- 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
   854
	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
   855
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
		-- 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
   857
		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
   858
			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
   859
		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
   860
			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
   861
		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
   862
			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
   863
		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
   864
			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
   865
		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
   866
			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
   867
		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
   868
			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
   869
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
		-- 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
   871
		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
   872
			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
   873
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
		-- 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
   875
		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
   876
			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
   877
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
		-- 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
   879
		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
   880
			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
   881
		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
   882
			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
   883
		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
   884
			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
   885
		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
   886
			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
   887
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
		-- 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
   889
		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
   890
			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
   891
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
		-- 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
   893
		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
   894
			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
   895
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
		--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
   897
		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
   898
			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
   899
		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
   900
			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
   901
		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
   902
			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
   903
		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
   904
			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
   905
		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
   906
			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
   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
		-- 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
   909
		-- 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
   910
		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
   911
			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
   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
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
		-- 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
   915
		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
   916
			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
   917
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   918
		--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
   919
		--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
   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
		--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
   922
		--[[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
   923
			--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
   924
		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
   925
			--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
   926
		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
   927
			--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
   928
		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
   929
			--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
   930
		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
   931
			--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
   932
		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
   933
			--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
   934
		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
   935
			--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
   936
		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
   937
			--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
   938
		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
   939
			--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
   940
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   941
		elseif specialPointsFlag[i] == 98 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   942
			portalDistance = specialPointsX[i]
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   943
			ufoFuel = specialPointsY[i]
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
   944
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
   945
		-- 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
   946
		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
   947
			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
   948
		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
   949
			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
   950
		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
   951
			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
   952
		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
   953
			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
   954
		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
   955
			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
   956
		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
   957
			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
   958
		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
   959
			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
   960
		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
   961
			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
   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
		-- 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
   964
		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
   965
			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
   966
		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
   967
			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
   968
		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
   969
			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
   970
		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
   971
			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
   972
		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
   973
			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
   974
		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
   975
			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
   976
		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
   977
			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
   978
		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
   979
			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
   980
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
		-- 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
   982
		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
   983
			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
   984
		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
   985
			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
   986
		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
   987
			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
   988
		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
   989
			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
   990
		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
   991
			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
   992
		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
   993
			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
   994
		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
   995
			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
   996
		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
   997
			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
   998
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
   999
		-- 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
  1000
		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
  1001
			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
  1002
		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
  1003
			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
  1004
		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
  1005
			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
  1006
		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
  1007
			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
  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
		-- 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
  1010
		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
  1011
			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
  1012
		end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1013
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1014
	end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1015
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1016
end
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
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
function onGameStart()
12338
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
  1019
	SendGameResultOff()
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
  1020
	SendRankingStatsOff()
6bdabf67a012 Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents: 12292
diff changeset
  1021
	SendAchievementsStatsOff()
11940
e1bae42efacd TechRacer: Show racing times and ranking in stats screen
Wuzzy <almikes@aol.com>
parents: 11939
diff changeset
  1022
	SendHealthStatsOff()
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
  1023
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1024
		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
  1025
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
		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
  1027
        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
  1028
        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
  1029
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
	    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
  1031
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1032
		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
  1033
			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
  1034
			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
  1035
		end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1036
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1037
        ShowMission     (
11937
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
  1038
                                loc("TechRacer"),
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
  1039
                                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
  1040
11937
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
  1041
                        	loc("Complete the track as fast as you can!") .. "|" ..
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
  1042
                                loc("Round limit:") .. " " .. roundLimit .. "|" ..
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
  1043
				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
  1044
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1045
                                "", 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
  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
        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
  1049
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
		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
  1051
		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
  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
end
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
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1055
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1056
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1057
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
  1058
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
        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
  1060
        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
  1061
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1062
        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
  1063
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
		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
  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
		--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
  1067
		--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
  1068
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1069
		--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
  1070
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1071
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
        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
  1073
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1074
        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
  1075
    --    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
  1076
        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
  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
        -- Set the waypoints to unactive on new round
12969
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
  1079
        if not gameOver then
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
  1080
                for i = 0,(wpCount-1) do
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
  1081
                        wpActive[i] = false
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
  1082
                        wpCol[i] = 0xffffffff
12971
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
  1083
                        local minO, maxO, flashing = FlashingHelper(i)
b543d767fed3 Make first waypoint flash TechRacer, before hog starts racing
Wuzzy <Wuzzy2@mail.ru>
parents: 12969
diff changeset
  1084
                        SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], minO, maxO, 1, flashing, 0, wpRad, 5, wpCol[i])
12969
a5c5fe878a4e Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents: 12968
diff changeset
  1085
                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
  1086
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1087
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1088
        -- 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
  1089
        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
  1090
               -- 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
  1091
                        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
  1092
						--  --[[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
  1093
                        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
  1094
                        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
  1095
                --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
  1096
                --        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
  1097
                --        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
  1098
                --        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
  1099
                --        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
  1100
				--		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
  1101
               -- end
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
        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
  1105
                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
  1106
                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
  1107
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1108
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1109
        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
  1110
        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
  1111
        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
  1112
        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
  1113
        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
  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
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
  1118
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1119
		if (jet ~= nil) and (ufoFuel ~= 0) then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1120
			if ufoFuel == 2000 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1121
				SetHealth(jet, 2000)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1122
			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
  1123
		end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1124
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1125
		runOnGears(PortalEffects)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1126
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
  1127
        -- 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
  1128
        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
  1129
                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
  1130
        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
  1131
            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
  1132
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1133
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1134
            if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then
11937
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
  1135
                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
  1136
                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
  1137
            elseif (y > WaterLine-50) then
11937
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
  1138
                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
  1139
                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
  1140
            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
  1141
                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
  1142
                if wpCount == wpLimit then
11937
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
  1143
                    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
  1144
                    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
  1145
                end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1146
            end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1147
        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
  1148
            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
  1149
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1150
        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
  1151
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1152
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1153
13029
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1154
	if activationStage < 10 then
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1155
		HandleFreshMapCreation()
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1156
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1157
                if not gameOver and gameBegun and not racerActive then
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1158
			if cameraGear then
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1159
				DeleteGear(cameraGear)
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1160
			end
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1161
			-- Move camera to first waypoint.
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1162
			-- We use a dummy gear to feed FollowGear. It does not affect the race.
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1163
			cameraGear = AddGear(wpX[0], wpY[0], gtGenericFaller, 0, 0, 0, 5000)
13032
625d5a45f267 Racer/TechRacer: Show best times next to team bars
Wuzzy <Wuzzy2@mail.ru>
parents: 13029
diff changeset
  1164
			SetState(cameraGear, bor(GetState(cameraGear), gstNoGravity+gstInvisible))
13029
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1165
			FollowGear(cameraGear)
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1166
                end
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1167
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1168
	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
  1169
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1170
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1171
        -- 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
  1172
        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
  1173
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1174
                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
  1175
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1176
                        -- 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
  1177
                        --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
  1178
                        --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
  1179
						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
  1180
                                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
  1181
                                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
  1182
                                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
  1183
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
								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
  1186
                                --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
  1187
                                --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
  1188
								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
  1189
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1190
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1191
								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
  1192
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1193
                                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
  1194
								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
  1195
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
						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
  1197
                                -- 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
  1198
                        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1199
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1200
                end
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
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
        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
  1203
			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
  1204
			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
  1205
		end
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
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
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
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
        -- 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
  1210
        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
  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
                --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
  1213
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1214
                -- 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
  1215
                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
  1216
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1217
                        --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
  1218
                        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
  1219
                                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
  1220
                        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1221
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1222
                        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
  1223
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
                        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
  1225
11937
f1c7dba0f316 Clean up TechRacer strings
Wuzzy <almikes@aol.com>
parents: 11596
diff changeset
  1226
                		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
  1227
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1228
                                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
  1229
                                        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
  1230
                                        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
  1231
                                end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1232
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
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1234
12292
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
  1235
                        -- If hedgehog is not controlled anymore, stop racing mode
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
  1236
                        if band(GetState(CurrentHedgehog), gstHHDriven) == 0 then
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
  1237
                                DisableTumbler(false)
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
  1238
                        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
  1239
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1240
                end
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
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
        end
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
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
end
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
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1246
-- handle short range portal gun
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1247
function PortalEffects(gear)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1248
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1249
	if GetGearType(gear) == gtPortal then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1250
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1251
		tag = GetTag(gear)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1252
		if tag == 0 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1253
			col = 0xfab02aFF -- orange ball
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1254
		elseif tag == 1 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1255
			col = 0x00FF00FF -- orange portal
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1256
		elseif tag == 2 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1257
			col = 0x364df7FF  -- blue ball
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1258
		elseif tag == 3 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1259
			col = 0xFFFF00FF  -- blue portal
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1260
		end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1261
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1262
		if (tag == 0) or (tag == 2) then -- i.e ball form
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1263
			tempE = AddVisualGear(GetX(gear), GetY(gear), vgtDust, 0, true)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1264
			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
  1265
			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
  1266
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1267
			remLife = getGearValue(gear,"life")
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1268
			remLife = remLife - 1
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1269
			setGearValue(gear, "life", remLife)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1270
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1271
			if remLife == 0 then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1272
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1273
				tempE = AddVisualGear(GetX(gear)+15, GetY(gear), vgtSmoke, 0, true)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1274
				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
  1275
				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
  1276
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1277
				tempE = AddVisualGear(GetX(gear)-15, GetY(gear), vgtSmoke, 0, true)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1278
				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
  1279
				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
  1280
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1281
				tempE = AddVisualGear(GetX(gear), GetY(gear)+15, vgtSmoke, 0, true)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1282
				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
  1283
				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
  1284
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1285
				tempE = AddVisualGear(GetX(gear), GetY(gear)-15, vgtSmoke, 0, true)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1286
				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
  1287
				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
  1288
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1289
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1290
				PlaySound(sndVaporize)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1291
				DeleteGear(gear)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1292
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1293
			end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1294
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1295
		end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1296
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1297
	end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1298
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1299
end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
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
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
  1302
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1303
        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
  1304
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1305
        if gear == CurrentHedgehog then
12292
faf1b93422ba Use new EndTurn in a couple of scripts, esp. to fix timeout taunts in Racer
Wuzzy <almikes@aol.com>
parents: 12084
diff changeset
  1306
               DisableTumbler(false)
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
  1307
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1308
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1309
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1310
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1311
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
  1312
	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
  1313
		(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
  1314
		(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
  1315
		(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
  1316
		(GetGearType(gear) == gtExplosives) or
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1317
		(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
  1318
		(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
  1319
		(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
  1320
		(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
  1321
		(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
  1322
	then
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1323
		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
  1324
	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
  1325
		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
  1326
	end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1327
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1328
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1329
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
  1330
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1331
       if isATrackedGear(gear) then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1332
		trackGear(gear)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1333
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1334
		if GetGearType(gear) == gtPortal then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1335
			setGearValue(gear,"life",portalDistance)
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1336
		elseif GetGearType(gear) == gtHedgehog then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1337
            hhs[numhhs] = gear
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1338
            numhhs = numhhs + 1
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1339
            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
  1340
		end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1341
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1342
	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
  1343
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1344
	if GetGearType(gear) == gtAirAttack then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1345
       cGear = gear
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1346
	elseif GetGearType(gear) == gtJetpack then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1347
		jet = gear
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1348
		if (ufoFuel ~= 0) then
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1349
			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
  1350
		end
10979
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1351
	end
a332a60df7ce - some new mission icons
mikade <redgrinner@gmail.com>
parents: 10968
diff changeset
  1352
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
  1353
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1354
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1355
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1356
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
  1357
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1358
        if isATrackedGear(gear) then
13029
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1359
		trackDeletion(gear)
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1360
	elseif GetGearType(gear) == gtAirAttack 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
  1361
                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
  1362
        elseif GetGearType(gear) == gtJetpack then
13029
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1363
		jet = nil
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1364
	elseif gear == cameraGear then
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1365
		cameraGear = nil
a568bc16a99a Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents: 12971
diff changeset
  1366
	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
  1367
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1368
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1369
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1370
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
  1371
    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
  1372
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1373
    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
  1374
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1375
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1376
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
  1377
    usedWeapons[amSkip] = nil
11568
7e5d6ce6fe14 Treat #99 point type as a ghost trace
unc0rr
parents: 11551
diff changeset
  1378
    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
  1379
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1380
    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
  1381
    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
  1382
    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
  1383
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1384
    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
  1385
    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
  1386
    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
  1387
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1388
    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
  1389
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1390
    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
  1391
        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
  1392
    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
  1393
        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
  1394
    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
  1395
        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
  1396
    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
  1397
        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
  1398
    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
  1399
        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
  1400
    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
  1401
        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
  1402
    end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1403
11547
64a5ab2c4f00 Attempt to implement hash for special points to detect tech racer maps
unC0Rr
parents: 11012
diff changeset
  1404
    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
  1405
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1406
    for i = 0, (numTeams-1) do
11596
7c9243584a72 Fix TechRacer not recoding finish if time was >= 100s by raising this limit ten times.
unc0rr
parents: 11590
diff changeset
  1407
        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
  1408
            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
  1409
        end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1410
    end
11574
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11568
diff changeset
  1411
11590
026c329b1a13 Don't dump ghost points if map isn't detected
unc0rr
parents: 11588
diff changeset
  1412
    if map ~= nil and fastCount > 0 then
11574
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11568
diff changeset
  1413
        StartGhostPoints(fastCount)
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11568
diff changeset
  1414
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11568
diff changeset
  1415
        for i = 0, (fastCount - 1) do
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11568
diff changeset
  1416
            DumpPoint(fastX[i], fastY[i])
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11568
diff changeset
  1417
        end
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11568
diff changeset
  1418
    end
294ce0fa65d0 Dump best time ghost on console
unc0rr
parents: 11568
diff changeset
  1419
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
  1420
end
1225f42f61e2 Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
nemo
parents: 10950
diff changeset
  1421
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1422
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
  1423
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1424
	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
  1425
10967
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1426
	for i = 1, #atkArray do
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1427
		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
  1428
	end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1429
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1430
	for i = 1, #utilArray do
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1431
		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
  1432
	end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1433
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1434
end
1434cec96ca3 - preview generation for rubbers, air-mines, crates, barrels
mikade <redgrinner@gmail.com>
parents: 10961
diff changeset
  1435