author | Wuzzy <Wuzzy2@mail.ru> |
Mon, 03 Sep 2018 00:03:06 +0200 | |
changeset 13748 | d7b72ea8d136 |
parent 13690 | 09ea1faf97ca |
child 13774 | e874bfe563c7 |
child 13844 | 2fceeea62b10 |
permissions | -rw-r--r-- |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
2 |
------------------------------------------ |
11652
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
3 |
-- RACER 0.8 |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
4 |
-- map-independant racing script |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
5 |
-- by mikade |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
6 |
----------------------------------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
7 |
|
12393
0eb1457f7b94
Add big fat developer warning to all racing scripts about compability
Wuzzy <almikes@aol.com>
parents:
12338
diff
changeset
|
8 |
-- 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
|
9 |
-- 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
|
10 |
-- 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
|
11 |
-- 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
|
12 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
13 |
----------------------------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
14 |
--0.1: took all the code from crazy racer and scrapped most of it |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
15 |
----------------------------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
16 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
17 |
-- Removed tumbler system |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
18 |
-- Removed extra adds like boosters etc |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
19 |
-- Added experimental waypoint placement system |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
20 |
-- More user feedback |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
21 |
-- Reduced race complexity limit to 5 waypoints |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
22 |
-- stop placement at complexity limit reached and end turn |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
23 |
-- guys dont keep racing after dying |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
24 |
-- invulnerable feasibility |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
25 |
-- reverted time keeping method |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
26 |
-- reduced feedback display time |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
27 |
-- colour-coded addcaptions |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
28 |
-- cleaned up code |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
29 |
-- support for more players properly added |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
30 |
-- tardis fix |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
31 |
-- remove airstrikes |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
32 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
33 |
-- i think the remainder 0 .456 sec of the tracktime isnt getting reset on newturn |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
34 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
35 |
-- update feedback |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
36 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
37 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
38 |
-- 0.2 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
39 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
40 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
41 |
-- allow gameflags |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
42 |
-- extend time to 90s |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
43 |
-- remove other air-attack based weps |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
44 |
-- turn off water rise for sd |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
45 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
46 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
47 |
-- 0.3 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
48 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
49 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
50 |
-- prevent WP being placed in land |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
51 |
-- prevent waypoints being placed outside border |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
52 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
53 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
54 |
-- 0.4 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
55 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
56 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
57 |
-- update user feedback |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
58 |
-- add more sounds |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
59 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
60 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
61 |
-- 0.5 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
62 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
63 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
64 |
-- fix ghost disappearing if hog falls in water or somehow dies |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
65 |
-- lengthen ghost tracking interval to improve performance on slower machines |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
66 |
-- increase waypoint limit to 8 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
67 |
-- allow for persistent showmission information |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
68 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
69 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
70 |
-- 0.6 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
71 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
72 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
73 |
-- remove hogs from racing area as per request |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
74 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
75 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
76 |
-- 0.7 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
77 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
78 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
79 |
-- switch to first available weapon if starting race with no weapon selected |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
80 |
|
11652
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
81 |
------- |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
82 |
-- 0.8 |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
83 |
------- |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
84 |
-- allow different boost directions |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
85 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
86 |
----------------------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
87 |
-- SCRIPT BEGINS |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
88 |
----------------------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
89 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
90 |
HedgewarsScriptLoad("/Scripts/Locale.lua") |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
91 |
HedgewarsScriptLoad("/Scripts/OfficialChallenges.lua") |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
92 |
HedgewarsScriptLoad("/Scripts/Params.lua") |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
93 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
94 |
------------------ |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
95 |
-- Got Variables? |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
96 |
------------------ |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
97 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
98 |
local fMod = 1000000 -- 1 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
99 |
local roundLimit = 3 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
100 |
local roundNumber = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
101 |
local firstClan = 10 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
102 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
103 |
local fastX = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
104 |
local fastY = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
105 |
local fastCount = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
106 |
local fastIndex = 0 |
11586 | 107 |
local fastColour = 0xffffffff |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
108 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
109 |
local currX = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
110 |
local currY = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
111 |
local currCount = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
112 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
113 |
local specialPointsX = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
114 |
local specialPointsY = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
115 |
local specialPointsCount = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
116 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
117 |
local TeamRope = false |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
118 |
|
13134
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
119 |
local waypointCursor = false |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
120 |
local waypointPreview = nil |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
121 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
122 |
-------------------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
123 |
-- hog and team tracking variales |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
124 |
-------------------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
125 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
126 |
local numhhs = 0 -- store number of hedgehogs |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
127 |
local hhs = {} -- store hedgehog gears |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
128 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
129 |
local numTeams -- store the number of teams in the game |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
130 |
local teamNameArr = {} -- store the list of teams |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
131 |
local teamClan = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
132 |
local teamSize = {} -- store how many hogs per team |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
133 |
local teamIndex = {} -- at what point in the hhs{} does each team begin |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
134 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
135 |
local teamComment = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
136 |
local teamScore = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
137 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
138 |
------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
139 |
-- racer vars |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
140 |
-------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
141 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
142 |
local cGear = nil |
13029
a568bc16a99a
Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents:
12972
diff
changeset
|
143 |
local cameraGear = nil -- gear created to center the cameera on |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
144 |
|
11935
4ed643879c0f
Racer: Clean up “did not finish” mess
Wuzzy <almikes@aol.com>
parents:
11934
diff
changeset
|
145 |
local bestClan = 10 |
4ed643879c0f
Racer: Clean up “did not finish” mess
Wuzzy <almikes@aol.com>
parents:
11934
diff
changeset
|
146 |
local bestTime = 1000000 |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
147 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
148 |
local gameBegun = false |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
149 |
local gameOver = false |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
150 |
local racerActive = false |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
151 |
local trackTime = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
152 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
153 |
local wpCirc = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
154 |
local wpX = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
155 |
local wpY = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
156 |
local wpCol = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
157 |
local wpActive = {} |
11934
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
158 |
local wpRad = 450 |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
159 |
local wpCount = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
160 |
local wpLimit = 8 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
161 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
162 |
local usedWeapons = {} |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
163 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
164 |
local roundN |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
165 |
local lastRound |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
166 |
local RoundHasChanged |
12412
8cc070640fd1
Fix skipping in Racer causing the next team to be skipped, too
Wuzzy <almikes@aol.com>
parents:
12411
diff
changeset
|
167 |
local turnSkipped = false |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
168 |
|
11652
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
169 |
local boostX = 0 |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
170 |
local boostY = 0 |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
171 |
local boostValue = 1 |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
172 |
|
12972
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
173 |
-- themes with bright background |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
174 |
local brightThemes = { |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
175 |
Bath = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
176 |
Bamboo = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
177 |
Beach = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
178 |
Blox = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
179 |
Compost = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
180 |
Desert = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
181 |
Fruit = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
182 |
Golf = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
183 |
Hoggywood = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
184 |
Jungle = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
185 |
Olympics = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
186 |
Sheep = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
187 |
} |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
188 |
-- themes with medium or heavily mixed brightness. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
189 |
-- only add themes here if both bright and dark waypoint |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
190 |
-- colors fail otherwise. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
191 |
local mediumThemes = { |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
192 |
Halloween = true, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
193 |
} |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
194 |
-- All themes not explicitly listed above are assumed to |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
195 |
-- be "dark" and work with the default bright waypoints. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
196 |
|
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
197 |
-- Waypoint colors in 3 color themes! |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
198 |
-- We do this so the waypoints are easy on the eyes, |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
199 |
-- at least in each of the default themes. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
200 |
|
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
201 |
-- Bright waypoints (default) |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
202 |
local waypointColourBright = 0xFFFFFFFF -- Primary colour of inactive waypoints |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
203 |
local waypointColourBrightAtPlacement = 0xAAAAAAFF -- Colour of non-highlighted waypoints while placing |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
204 |
-- Medium bright waypoints |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
205 |
local waypointColourMedium = 0x606060FF |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
206 |
local waypointColourMediumAtPlacement = 0x404040FF |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
207 |
-- Dark waypoints |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
208 |
local waypointColourDark = 0x000000FF |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
209 |
local waypointColourDarkAtPlacement = 0x303030FF |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
210 |
|
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
211 |
-- Waypoints touched by the players assume the clan color, which is unchanged. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
212 |
-- Touched waypoints are not important to be visible. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
213 |
|
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
214 |
-- Default waypoint colors (only use these color variables in the code below) |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
215 |
local waypointColour = waypointColourBright |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
216 |
local waypointColourAtPlacement = waypointColourBrightAtPlacement |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
217 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
218 |
------------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
219 |
-- general methods |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
220 |
------------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
221 |
|
12972
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
222 |
-- Returns brightness level of background from 1-3. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
223 |
-- 1 = brightest |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
224 |
function GetBackgroundBrightness() |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
225 |
-- This just looks at the theme names above. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
226 |
-- This code will fail for bright unofficial themes. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
227 |
-- TODO: Change how this thing works. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
228 |
-- Consider adding a function into the Lua API which looks |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
229 |
-- up the theme's sky color, so we could use thit instead. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
230 |
if brightThemes[Theme] then |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
231 |
return 1 |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
232 |
elseif mediumThemes[Theme] then |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
233 |
return 2 |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
234 |
else |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
235 |
return 3 |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
236 |
end |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
237 |
end |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
238 |
|
11934
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
239 |
--[[ |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
240 |
Parameters syntax: |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
241 |
|
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
242 |
teamrope=true |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
243 |
--> The team will be colored in the color of the team. |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
244 |
|
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
245 |
rounds=N |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
246 |
--> The game will be played with N rounds (default: 3) |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
247 |
|
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
248 |
waypointradius=N |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
249 |
--> The waypoints have a radius of N pixels (default: 450) |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
250 |
|
11991
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
251 |
maxwaypoints=N |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
252 |
--> The maximum number of waypoints to be placed (default: 8) |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
253 |
|
11934
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
254 |
]] |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
255 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
256 |
function onParameters() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
257 |
parseParams() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
258 |
if params["teamrope"] ~= nil then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
259 |
TeamRope = true |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
260 |
end |
11931
ace20b1d8d53
Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents:
11930
diff
changeset
|
261 |
if params["rounds"] ~= nil then |
ace20b1d8d53
Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents:
11930
diff
changeset
|
262 |
roundLimit = math.max(1, math.floor(tonumber(params["rounds"]))) |
ace20b1d8d53
Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents:
11930
diff
changeset
|
263 |
if type(roundLimit) ~= "number" then |
ace20b1d8d53
Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents:
11930
diff
changeset
|
264 |
roundLimit = 3 |
ace20b1d8d53
Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents:
11930
diff
changeset
|
265 |
end |
ace20b1d8d53
Add “rounds” script parameter for Racer
Wuzzy <almikes@aol.com>
parents:
11930
diff
changeset
|
266 |
end |
11934
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
267 |
if params["waypointradius"] ~= nil then |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
268 |
wpRad = math.max(40, math.floor(tonumber(params["waypointradius"]))) |
11990
b2783dd12f30
Fix incorrect type check of wpRad in Racer
Wuzzy <almikes@aol.com>
parents:
11989
diff
changeset
|
269 |
if type(wpRad) ~= "number" then |
11934
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
270 |
wpRad = 450 |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
271 |
end |
167de692f2d7
Add new Racer script parameter: waypointradius
Wuzzy <almikes@aol.com>
parents:
11933
diff
changeset
|
272 |
end |
11991
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
273 |
if params["maxwaypoints"] ~= nil then |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
274 |
wpLimit = math.max(2, math.floor(tonumber(params["maxwaypoints"]))) |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
275 |
if type(wpLimit) ~= "number" then |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
276 |
wpLimit = 8 |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
277 |
end |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
278 |
end |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
279 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
280 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
281 |
function RebuildTeamInfo() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
282 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
283 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
284 |
-- make a list of individual team names |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
285 |
for i = 0, (TeamsCount-1) do |
11933
42e90b244e11
Racer: Dump old commented-out code
Wuzzy <almikes@aol.com>
parents:
11932
diff
changeset
|
286 |
teamNameArr[i] = " " |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
287 |
teamSize[i] = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
288 |
teamIndex[i] = 0 |
11935
4ed643879c0f
Racer: Clean up “did not finish” mess
Wuzzy <almikes@aol.com>
parents:
11934
diff
changeset
|
289 |
teamScore[i] = 1000000 |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
290 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
291 |
numTeams = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
292 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
293 |
for i = 0, (numhhs-1) do |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
294 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
295 |
z = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
296 |
unfinished = true |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
297 |
while(unfinished == true) do |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
298 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
299 |
newTeam = true |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
300 |
tempHogTeamName = GetHogTeamName(hhs[i]) -- this is the new name |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
301 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
302 |
if tempHogTeamName == teamNameArr[z] then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
303 |
newTeam = false |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
304 |
unfinished = false |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
305 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
306 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
307 |
z = z + 1 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
308 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
309 |
if z == TeamsCount then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
310 |
unfinished = false |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
311 |
if newTeam == true then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
312 |
teamNameArr[numTeams] = tempHogTeamName |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
313 |
numTeams = numTeams + 1 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
314 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
315 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
316 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
317 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
318 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
319 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
320 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
321 |
-- find out how many hogs per team, and the index of the first hog in hhs |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
322 |
for i = 0, (numTeams-1) do |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
323 |
for z = 0, (numhhs-1) do |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
324 |
if GetHogTeamName(hhs[z]) == teamNameArr[i] then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
325 |
teamClan[i] = GetHogClan(hhs[z]) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
326 |
if teamSize[i] == 0 then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
327 |
teamIndex[i] = z -- should give starting index |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
328 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
329 |
teamSize[i] = teamSize[i] + 1 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
330 |
--add a pointer so this hog appears at i in hhs |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
331 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
332 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
333 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
334 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
335 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
336 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
337 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
338 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
339 |
----------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
340 |
-- RACER METHODS |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
341 |
----------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
342 |
|
11652
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
343 |
function onLeft() |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
344 |
boostX = boostX +boostValue |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
345 |
end |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
346 |
function onLeftUp() |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
347 |
boostX = boostX -boostValue |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
348 |
end |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
349 |
function onRight() |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
350 |
boostX = boostX -boostValue |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
351 |
end |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
352 |
function onRightUp() |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
353 |
boostX = boostX +boostValue |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
354 |
end |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
355 |
function onUp() |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
356 |
boostY = boostY +boostValue |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
357 |
end |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
358 |
function onUpUp() |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
359 |
boostY = boostY -boostValue |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
360 |
end |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
361 |
function onDown() |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
362 |
boostY = boostY -boostValue |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
363 |
end |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
364 |
function onDownUp() |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
365 |
boostY = boostY +boostValue |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
366 |
end |
b4d621700bbb
Allow variable boost directions in Racer
mikade <redgrinner@gmail.com>
parents:
11590
diff
changeset
|
367 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
368 |
function CheckWaypoints() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
369 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
370 |
trackFinished = true |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
371 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
372 |
for i = 0, (wpCount-1) do |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
373 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
374 |
g1X, g1Y = GetGearPosition(CurrentHedgehog) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
375 |
g2X, g2Y = wpX[i], wpY[i] |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
376 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
377 |
g1X = g1X - g2X |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
378 |
g1Y = g1Y - g2Y |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
379 |
dist = (g1X*g1X) + (g1Y*g1Y) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
380 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
381 |
NR = (48/100*wpRad)/2 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
382 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
383 |
if dist < (NR*NR) then |
11933
42e90b244e11
Racer: Dump old commented-out code
Wuzzy <almikes@aol.com>
parents:
11932
diff
changeset
|
384 |
wpCol[i] = GetClanColor(GetHogClan(CurrentHedgehog)) |
12967
52c12029c7bd
Increase opacity of Racer/TechRacer waypoints
Wuzzy <Wuzzy2@mail.ru>
parents:
12412
diff
changeset
|
385 |
SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 64, 64, 1, 10, 0, wpRad, 5, wpCol[i]) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
386 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
387 |
wpRem = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
388 |
for k = 0, (wpCount-1) do |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
389 |
if wpActive[k] == false then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
390 |
wpRem = wpRem + 1 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
391 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
392 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
393 |
|
11930
7123bfc9643c
Racer: Don't mess with ammo display when touching waypoint
Wuzzy <almikes@aol.com>
parents:
11929
diff
changeset
|
394 |
if wpActive[i] == false then |
11932
72593678e8d6
Racer: Show “Track completed!” message
Wuzzy <almikes@aol.com>
parents:
11931
diff
changeset
|
395 |
local wpMessage = "" |
72593678e8d6
Racer: Show “Track completed!” message
Wuzzy <almikes@aol.com>
parents:
11931
diff
changeset
|
396 |
if wpRem-1 == 0 then |
72593678e8d6
Racer: Show “Track completed!” message
Wuzzy <almikes@aol.com>
parents:
11931
diff
changeset
|
397 |
wpMessage = loc("Track completed!") |
72593678e8d6
Racer: Show “Track completed!” message
Wuzzy <almikes@aol.com>
parents:
11931
diff
changeset
|
398 |
else |
72593678e8d6
Racer: Show “Track completed!” message
Wuzzy <almikes@aol.com>
parents:
11931
diff
changeset
|
399 |
wpMessage = string.format(loc("Waypoints remaining: %d"), wpRem-1) |
72593678e8d6
Racer: Show “Track completed!” message
Wuzzy <almikes@aol.com>
parents:
11931
diff
changeset
|
400 |
end |
72593678e8d6
Racer: Show “Track completed!” message
Wuzzy <almikes@aol.com>
parents:
11931
diff
changeset
|
401 |
AddCaption(wpMessage, 0xffba00ff, capgrpGameState) |
11930
7123bfc9643c
Racer: Don't mess with ammo display when touching waypoint
Wuzzy <almikes@aol.com>
parents:
11929
diff
changeset
|
402 |
end |
7123bfc9643c
Racer: Don't mess with ammo display when touching waypoint
Wuzzy <almikes@aol.com>
parents:
11929
diff
changeset
|
403 |
wpActive[i] = true |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
404 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
405 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
406 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
407 |
if wpActive[i] == false then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
408 |
trackFinished = false |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
409 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
410 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
411 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
412 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
413 |
return(trackFinished) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
414 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
415 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
416 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
417 |
function AdjustScores() |
11935
4ed643879c0f
Racer: Clean up “did not finish” mess
Wuzzy <almikes@aol.com>
parents:
11934
diff
changeset
|
418 |
bestTimeComment = loc("Did not finish") |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
419 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
420 |
newScore = false |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
421 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
422 |
-- update this clan's time if the new track is better |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
423 |
for i = 0, (numTeams-1) do |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
424 |
if teamClan[i] == GetHogClan(CurrentHedgehog) then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
425 |
if trackTime < teamScore[i] then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
426 |
teamScore[i] = trackTime |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
427 |
newScore = true |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
428 |
else |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
429 |
newScore = false |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
430 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
431 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
432 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
433 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
434 |
-- find the best time out of those so far |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
435 |
for i = 0, (numTeams-1) do |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
436 |
if teamScore[i] < bestTime then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
437 |
bestTime = teamScore[i] |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
438 |
bestClan = teamClan[i] |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
439 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
440 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
441 |
|
11935
4ed643879c0f
Racer: Clean up “did not finish” mess
Wuzzy <almikes@aol.com>
parents:
11934
diff
changeset
|
442 |
if bestTime ~= 1000000 then |
11929 | 443 |
bestTimeComment = string.format(loc("%.1fs"), (bestTime/1000)) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
444 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
445 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
446 |
if newScore == true then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
447 |
if trackTime == bestTime then -- best time of the race |
11929 | 448 |
ShowMission(loc("Racer"), |
449 |
loc("Track completed!"), |
|
450 |
string.format(loc("New race record: %.1fs"), (trackTime/1000)) .. "|" .. |
|
451 |
string.format(loc("Winning time: %s"), bestTimeComment), 0, 4000) |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
452 |
PlaySound(sndHomerun) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
453 |
else -- best time for the clan |
11929 | 454 |
ShowMission(loc("Racer"), |
455 |
loc("Track completed!"), |
|
456 |
string.format(loc("New clan record: %.1fs"), (trackTime/1000)) .. "|" .. |
|
457 |
string.format(loc("Winning time: %s"), bestTimeComment), 4, 4000) |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
458 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
459 |
else -- not any kind of new score |
11929 | 460 |
ShowMission(loc("Racer"), |
461 |
loc("Track completed!"), |
|
462 |
string.format(loc("Time: %.1fs"), (trackTime/1000)) .. "|" .. |
|
463 |
string.format(loc("Winning time: %s"), bestTimeComment), -amSkip, 4000) |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
464 |
PlaySound(sndHellish) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
465 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
466 |
|
13032
625d5a45f267
Racer/TechRacer: Show best times next to team bars
Wuzzy <Wuzzy2@mail.ru>
parents:
13029
diff
changeset
|
467 |
for i = 0, (TeamsCount-1) do |
625d5a45f267
Racer/TechRacer: Show best times next to team bars
Wuzzy <Wuzzy2@mail.ru>
parents:
13029
diff
changeset
|
468 |
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
|
469 |
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
|
470 |
end |
625d5a45f267
Racer/TechRacer: Show best times next to team bars
Wuzzy <Wuzzy2@mail.ru>
parents:
13029
diff
changeset
|
471 |
end |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
472 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
473 |
if bestTime == trackTime then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
474 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
475 |
fastColour = GetClanColor(GetHogClan(CurrentHedgehog)) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
476 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
477 |
for i = 0, (currCount-1) do |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
478 |
fastX[i] = currX[i] |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
479 |
fastY[i] = currY[i] |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
480 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
481 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
482 |
fastCount = currCount |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
483 |
fastIndex = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
484 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
485 |
else |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
486 |
currCount = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
487 |
fastIndex = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
488 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
489 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
490 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
491 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
492 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
493 |
function onNewRound() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
494 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
495 |
roundNumber = roundNumber + 1 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
496 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
497 |
totalComment = "" |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
498 |
for i = 0, (TeamsCount-1) do |
11935
4ed643879c0f
Racer: Clean up “did not finish” mess
Wuzzy <almikes@aol.com>
parents:
11934
diff
changeset
|
499 |
if teamNameArr[i] ~= " " and teamScore[i] ~= 1000000 then |
11928 | 500 |
teamComment[i] = string.format(loc("%s: %.1fs"), teamNameArr[i], (teamScore[i]/1000)) .. "|" |
501 |
else |
|
11935
4ed643879c0f
Racer: Clean up “did not finish” mess
Wuzzy <almikes@aol.com>
parents:
11934
diff
changeset
|
502 |
teamComment[i] = string.format(loc("%s: Did not finish"), teamNameArr[i]) .. "|" |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
503 |
end |
11928 | 504 |
totalComment = totalComment .. teamComment[i] |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
505 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
506 |
|
11929 | 507 |
ShowMission( loc("Racer"), |
508 |
loc("Status update"), |
|
509 |
string.format(loc("Rounds complete: %d/%d"), roundNumber, roundLimit) .. "|" .. " " .. "|" .. |
|
510 |
loc("Best team times: ") .. "|" .. totalComment, 0, 4000) |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
511 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
512 |
-- end game if its at round limit |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
513 |
if roundNumber >= roundLimit then |
11928 | 514 |
-- Sort the scores for the ranking list |
515 |
local unfinishedArray = {} |
|
516 |
local sortedTeams = {} |
|
517 |
local k = 1 |
|
518 |
for i = 0, TeamsCount-1 do |
|
11935
4ed643879c0f
Racer: Clean up “did not finish” mess
Wuzzy <almikes@aol.com>
parents:
11934
diff
changeset
|
519 |
if teamScore[i] ~= 1000000 and teamNameArr[i] ~= " " then |
11928 | 520 |
sortedTeams[k] = {} |
521 |
sortedTeams[k].name = teamNameArr[i] |
|
522 |
sortedTeams[k].score = teamScore[i] |
|
523 |
k = k + 1 |
|
524 |
else |
|
525 |
table.insert(unfinishedArray, string.format(loc("%s did not finish the race."), teamNameArr[i])) |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
526 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
527 |
end |
11928 | 528 |
table.sort(sortedTeams, function(team1, team2) return team1.score < team2.score end) |
529 |
||
530 |
-- Write all the stats! |
|
531 |
||
532 |
for i = 1, #sortedTeams do |
|
533 |
SendStat(siPointType, loc("milliseconds")) |
|
534 |
SendStat(siPlayerKills, sortedTeams[i].score, sortedTeams[i].name) |
|
535 |
end |
|
536 |
||
537 |
if #sortedTeams >= 1 then |
|
538 |
SendStat(siGameResult, string.format(loc("%s wins!"), sortedTeams[1].name)) |
|
539 |
SendStat(siGameResult, string.format(loc("%s wins!"), sortedTeams[1].name)) |
|
540 |
SendStat(siCustomAchievement, string.format(loc("%s wins with a best time of %.1fs."), sortedTeams[1].name, (sortedTeams[1].score/1000))) |
|
541 |
for i=1,#unfinishedArray do |
|
542 |
SendStat(siCustomAchievement, unfinishedArray[i]) |
|
543 |
end |
|
544 |
else |
|
545 |
SendStat(siGameResult, loc("Round draw")) |
|
546 |
SendStat(siCustomAchievement, loc("Nobody managed to finish the race. What a shame!")) |
|
12411
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
547 |
if specialPointsCount > 0 then |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
548 |
SendStat(siCustomAchievement, loc("Maybe you should try an easier map next time.")) |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
549 |
else |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
550 |
SendStat(siCustomAchievement, loc("Maybe you should try easier waypoints next time.")) |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
551 |
end |
11928 | 552 |
end |
553 |
||
12338
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
554 |
-- Kill all the losers |
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
555 |
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
|
556 |
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
|
557 |
SetEffect(hhs[i], heResurrectable, 0) |
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
558 |
SetHealth(hhs[i],0) |
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
559 |
end |
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
560 |
end |
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
561 |
|
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
562 |
gameOver = true |
12969
a5c5fe878a4e
Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents:
12968
diff
changeset
|
563 |
for i=0, wpCount-1 do |
a5c5fe878a4e
Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents:
12968
diff
changeset
|
564 |
-- Fade out waypoints |
a5c5fe878a4e
Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents:
12968
diff
changeset
|
565 |
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
|
566 |
end |
12338
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
567 |
EndTurn(true) |
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
568 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
569 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
570 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
571 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
572 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
573 |
function CheckForNewRound() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
574 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
575 |
if GetHogClan(CurrentHedgehog) == firstClan then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
576 |
onNewRound() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
577 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
578 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
579 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
580 |
|
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
|
581 |
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
|
582 |
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
|
583 |
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
|
584 |
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
|
585 |
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
|
586 |
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
|
587 |
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
|
588 |
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
|
589 |
racerActive = false -- newadd |
12968
544c4302efe4
Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents:
12967
diff
changeset
|
590 |
|
12969
a5c5fe878a4e
Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents:
12968
diff
changeset
|
591 |
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
|
592 |
for i=0, wpCount-1 do |
544c4302efe4
Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents:
12967
diff
changeset
|
593 |
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
|
594 |
end |
12969
a5c5fe878a4e
Racer, TechRacer: Fade out waypoints at the end
Wuzzy <Wuzzy2@mail.ru>
parents:
12968
diff
changeset
|
595 |
elseif not gameOver then |
12968
544c4302efe4
Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents:
12967
diff
changeset
|
596 |
for i=0, wpCount-1 do |
544c4302efe4
Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents:
12967
diff
changeset
|
597 |
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
|
598 |
end |
544c4302efe4
Racer, TechRacer: Change waypoint opacity on victory or failure
Wuzzy <Wuzzy2@mail.ru>
parents:
12967
diff
changeset
|
599 |
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
|
600 |
end |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
601 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
602 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
603 |
function HandleGhost() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
604 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
605 |
-- get the current xy of the racer at this point |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
606 |
currX[currCount] = GetX(CurrentHedgehog) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
607 |
currY[currCount] = GetY(CurrentHedgehog) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
608 |
currCount = currCount + 1 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
609 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
610 |
-- draw a ping of smoke where the fastest player was at this point |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
611 |
if (fastCount ~= 0) and (fastIndex < fastCount) then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
612 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
613 |
fastIndex = fastIndex + 1 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
614 |
|
13690
09ea1faf97ca
Remove calls to GetVisualGearValues where it's not needed
Wuzzy <Wuzzy2@mail.ru>
parents:
13635
diff
changeset
|
615 |
local tempE = AddVisualGear(fastX[fastIndex], fastY[fastIndex], vgtSmoke, 0, false) |
09ea1faf97ca
Remove calls to GetVisualGearValues where it's not needed
Wuzzy <Wuzzy2@mail.ru>
parents:
13635
diff
changeset
|
616 |
SetVisualGearValues(tempE, nil, nil, nil, nil, nil, nil, nil, nil, nil, fastColour ) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
617 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
618 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
619 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
620 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
621 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
622 |
function TryRepositionHogs() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
623 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
624 |
if MapHasBorder() == true then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
625 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
626 |
for i = 0, (numhhs-1) do |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
627 |
if hhs[i] ~= nil then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
628 |
SetGearPosition(hhs[i],GetX(hhs[i]), TopY-10) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
629 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
630 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
631 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
632 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
633 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
634 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
635 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
636 |
---------------------------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
637 |
-- GAME METHODS / EVENT HANDLERS |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
638 |
---------------------------------- |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
639 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
640 |
function onGameInit() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
641 |
EnableGameFlags(gfInfAttack, gfInvulnerable) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
642 |
CaseFreq = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
643 |
TurnTime = 90000 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
644 |
WaterRise = 0 |
12084
8f222872d432
Disable SD for a couple of scripts and mission maps
Wuzzy <almikes@aol.com>
parents:
11991
diff
changeset
|
645 |
HealthDecrease = 0 |
11951
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
646 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
647 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
648 |
|
12411
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
649 |
function InstructionsBuild() |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
650 |
ShowMission( |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
651 |
loc("Racer"), |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
652 |
loc("A Hedgewars mini-game"), |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
653 |
loc("Build a track and race.") .. "|" .. |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
654 |
string.format(loc("Round limit: %d"), roundLimit), |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
655 |
4, 4000) |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
656 |
end |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
657 |
|
12412
8cc070640fd1
Fix skipping in Racer causing the next team to be skipped, too
Wuzzy <almikes@aol.com>
parents:
12411
diff
changeset
|
658 |
function InstructionsRace() |
12411
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
659 |
ShowMission(loc("Racer"), |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
660 |
loc("A Hedgewars mini-game"), |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
661 |
loc("Touch all waypoints as fast as you can!"), |
12412
8cc070640fd1
Fix skipping in Racer causing the next team to be skipped, too
Wuzzy <almikes@aol.com>
parents:
12411
diff
changeset
|
662 |
2, 4000) |
12411
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
663 |
end |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
664 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
665 |
function onGameStart() |
12338
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
666 |
SendGameResultOff() |
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
667 |
SendRankingStatsOff() |
11928 | 668 |
SendHealthStatsOff() |
12338
6bdabf67a012
Add back the missing winning animation for Racer and TechRecer
Wuzzy <almikes@aol.com>
parents:
12292
diff
changeset
|
669 |
SendAchievementsStatsOff() |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
670 |
|
13129
991db8fc45eb
Racer: No longer play Incoming or Missed sound
Wuzzy <Wuzzy2@mail.ru>
parents:
13108
diff
changeset
|
671 |
SetSoundMask(sndIncoming, true) |
991db8fc45eb
Racer: No longer play Incoming or Missed sound
Wuzzy <Wuzzy2@mail.ru>
parents:
13108
diff
changeset
|
672 |
SetSoundMask(sndMissed, true) |
991db8fc45eb
Racer: No longer play Incoming or Missed sound
Wuzzy <Wuzzy2@mail.ru>
parents:
13108
diff
changeset
|
673 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
674 |
roundN = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
675 |
lastRound = TotalRounds |
11933
42e90b244e11
Racer: Dump old commented-out code
Wuzzy <almikes@aol.com>
parents:
11932
diff
changeset
|
676 |
RoundHasChanged = false |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
677 |
|
12972
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
678 |
if GetBackgroundBrightness() == 1 then |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
679 |
-- Dark waypoint colour theme |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
680 |
waypointColour = waypointColourDark |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
681 |
waypointColourAtPlacement = waypointColourDarkAtPlacement |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
682 |
elseif GetBackgroundBrightness() == 2 then |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
683 |
-- Medium waypoint colour theme |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
684 |
waypointColour = waypointColourMedium |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
685 |
waypointColourAtPlacement = waypointColourMediumAtPlacement |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
686 |
end |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
687 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
688 |
for i = 0, (specialPointsCount-1) do |
12411
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
689 |
PlaceWayPoint(specialPointsX[i], specialPointsY[i], false) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
690 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
691 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
692 |
RebuildTeamInfo() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
693 |
|
12411
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
694 |
if specialPointsCount > 0 then |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
695 |
InstructionsRace() |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
696 |
else |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
697 |
InstructionsBuild() |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
698 |
end |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
699 |
|
11951
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
700 |
SetAmmoTexts(amAirAttack, loc("Place waypoint"), loc("Racer tool"), |
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
701 |
loc("Build an awesome race track by placing|waypoints which the hedgehogs have to|touch in any order to finish a round.") .. "|" .. |
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
702 |
loc("Hedgehogs will start in the first waypoint.") .. "|" .. |
11988
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
703 |
loc("Cursor: Place waypoint") .. "|" .. |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
704 |
loc("Precise: Remove previous waypoint")) |
11951
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
705 |
|
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
706 |
SetAmmoTexts(amSkip, loc("Finish waypoint placement"), loc("Racer tool"), |
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
707 |
loc("Happy with your race track?|Then stop building and start racing!") .. "|" .. |
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
708 |
loc("Or let the next player place waypoints|if less than 2 waypoints have been placed.") .. "|" .. |
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
709 |
loc("Attack: Activate")) |
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
710 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
711 |
TryRepositionHogs() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
712 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
713 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
714 |
|
12411
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
715 |
function PlaceWayPoint(x,y,placedByUser) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
716 |
if not racerActive then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
717 |
if wpCount == 0 or wpX[wpCount - 1] ~= x or wpY[wpCount - 1] ~= y then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
718 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
719 |
wpX[wpCount] = x |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
720 |
wpY[wpCount] = y |
12972
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
721 |
wpCol[wpCount] = waypointColour |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
722 |
wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true) |
11568 | 723 |
|
12970
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
724 |
local flashing, minO, maxO |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
725 |
if wpCount == 0 then |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
726 |
-- First waypoint flashes. Useful to know since this is the spawn position. |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
727 |
minO, maxO = 164, 255 |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
728 |
flashing = 5 |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
729 |
else |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
730 |
-- Other waypoints are not animated (before the race starts) |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
731 |
minO, maxO = 255, 255 |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
732 |
flashing = 0 |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
733 |
end |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
734 |
SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], minO, maxO, 1, flashing, 0, wpRad, 5, wpCol[wpCount]) |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
735 |
|
12972
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
736 |
-- Use alternate waypoint color for all waypoints but the last one. This gives a subtle “highlighting” effect. |
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
737 |
SetVisualGearValues(wpCirc[wpCount-1], nil, nil, nil, nil, nil, nil, nil, nil, nil, waypointColourAtPlacement) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
738 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
739 |
wpCount = wpCount + 1 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
740 |
|
12411
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
741 |
if placedByUser then |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
742 |
AddCaption(string.format(loc("Waypoint placed. Available points remaining: %d"), wpLimit-wpCount)) |
13129
991db8fc45eb
Racer: No longer play Incoming or Missed sound
Wuzzy <Wuzzy2@mail.ru>
parents:
13108
diff
changeset
|
743 |
PlaySound(sndPlaced) |
12411
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
744 |
end |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
745 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
746 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
747 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
748 |
|
11988
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
749 |
function onPrecise() |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
750 |
if not racerActive and CurrentHedgehog ~= nil and GetCurAmmoType() == amAirAttack then |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
751 |
DeletePreviousWayPoint() |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
752 |
end |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
753 |
end |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
754 |
|
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
755 |
function DeletePreviousWayPoint() |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
756 |
if wpCount > 0 then |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
757 |
wpCount = wpCount - 1 |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
758 |
wpX[wpCount] = nil |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
759 |
wpY[wpCount] = nil |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
760 |
wpCol[wpCount] = nil |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
761 |
DeleteVisualGear(wpCirc[wpCount]) |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
762 |
wpCirc[wpCount] = nil |
12972
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
763 |
SetVisualGearValues(wpCirc[wpCount-1], nil, nil, nil, nil, nil, nil, nil, nil, nil, waypointColour) |
11988
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
764 |
AddCaption(string.format(loc("Waypoint removed. Available points: %d"), wpLimit-wpCount)) |
13134
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
765 |
PlaySound(sndBump) |
11988
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
766 |
else |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
767 |
PlaySound(sndDenied) |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
768 |
AddCaption(loc("No waypoint to be removed!")) |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
769 |
end |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
770 |
end |
9e57915f5365
Allow to remove waypoints in Racer with precise key
Wuzzy <almikes@aol.com>
parents:
11951
diff
changeset
|
771 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
772 |
function onSpecialPoint(x,y,flag) |
11568 | 773 |
if flag == 99 then |
774 |
fastX[fastCount] = x |
|
775 |
fastY[fastCount] = y |
|
776 |
fastCount = fastCount + 1 |
|
777 |
else |
|
778 |
addHashData(x) |
|
779 |
addHashData(y) |
|
780 |
addHashData(flag) |
|
781 |
specialPointsX[specialPointsCount] = x |
|
782 |
specialPointsY[specialPointsCount] = y |
|
783 |
specialPointsCount = specialPointsCount + 1 |
|
784 |
end |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
785 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
786 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
787 |
function onNewTurn() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
788 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
789 |
CheckForNewRound() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
790 |
TryRepositionHogs() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
791 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
792 |
racerActive = false |
12412
8cc070640fd1
Fix skipping in Racer causing the next team to be skipped, too
Wuzzy <almikes@aol.com>
parents:
12411
diff
changeset
|
793 |
turnSkipped = false |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
794 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
795 |
trackTime = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
796 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
797 |
currCount = 0 -- hopefully this solves problem |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
798 |
AddAmmo(CurrentHedgehog, amAirAttack, 0) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
799 |
gTimer = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
800 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
801 |
-- Handle Starting Stage of Game |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
802 |
if (gameOver == false) and (gameBegun == false) then |
11936
a01a890093f3
Racer: Reduce minimum number of waypoints to 2, tweak descriptions
Wuzzy <almikes@aol.com>
parents:
11935
diff
changeset
|
803 |
if wpCount >= 2 then |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
804 |
gameBegun = true |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
805 |
roundNumber = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
806 |
firstClan = GetHogClan(CurrentHedgehog) |
12411
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
807 |
if specialPointsCount == 0 then |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
808 |
InstructionsRace() |
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
809 |
end |
11951
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
810 |
|
65e61f495129
Overwrite special ammo descriptions in Racer script
Wuzzy <almikes@aol.com>
parents:
11936
diff
changeset
|
811 |
SetAmmoTexts(amSkip, nil, nil, nil) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
812 |
else |
11991
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
813 |
local infoString |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
814 |
if wpLimit > 2 then |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
815 |
infoString = string.format(loc("Place 2-%d waypoints using the waypoint placement tool."), wpLimit) |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
816 |
else |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
817 |
infoString = loc("Place 2 waypoints using the waypoint placement tool.") |
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
818 |
end |
11929 | 819 |
ShowMission(loc("Racer"), |
11991
f97b1c7fa053
Allow to set Racer waypoint limit with script parameter “maxwaypoints”
Wuzzy <almikes@aol.com>
parents:
11990
diff
changeset
|
820 |
loc("Waypoint placement phase"), infoString, 2, 4000) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
821 |
AddAmmo(CurrentHedgehog, amAirAttack, 4000) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
822 |
SetWeapon(amAirAttack) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
823 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
824 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
825 |
|
12970
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
826 |
-- Set the waypoints to unactive on new round |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
827 |
if gameBegun and not gameOver then |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
828 |
for i = 0,(wpCount-1) do |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
829 |
wpActive[i] = false |
12972
e32fff07b8d7
Racer: Make waypoints dark in bright themes like Bath
Wuzzy <Wuzzy2@mail.ru>
parents:
12970
diff
changeset
|
830 |
wpCol[i] = waypointColour |
12970
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
831 |
local flashing, minO, maxO |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
832 |
if i == 0 then |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
833 |
-- Make first waypoint flash very noticably |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
834 |
minO, maxO = 92, 255 |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
835 |
flashing = 2 |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
836 |
else |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
837 |
minO, maxO = 164, 224 |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
838 |
flashing = 10 |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
839 |
end |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
840 |
SetVisualGearValues(wpCirc[i], nil, nil, minO, maxO, nil, flashing, nil, nil, nil, wpCol[i]) |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
841 |
end |
13029
a568bc16a99a
Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents:
12972
diff
changeset
|
842 |
|
a568bc16a99a
Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents:
12972
diff
changeset
|
843 |
if cameraGear then |
a568bc16a99a
Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents:
12972
diff
changeset
|
844 |
DeleteGear(cameraGear) |
a568bc16a99a
Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents:
12972
diff
changeset
|
845 |
end |
a568bc16a99a
Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents:
12972
diff
changeset
|
846 |
-- Move camera to first waypoint |
a568bc16a99a
Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents:
12972
diff
changeset
|
847 |
-- 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:
12972
diff
changeset
|
848 |
cameraGear = AddGear(wpX[0], wpY[0], gtGenericFaller, 0, 0, 0, 5000) |
a568bc16a99a
Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents:
12972
diff
changeset
|
849 |
SetState(cameraGear, bor(GetState(cameraGear), gstNoGravity+gstInvisible)) |
a568bc16a99a
Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents:
12972
diff
changeset
|
850 |
FollowGear(cameraGear) |
12970
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
851 |
end |
21eda4fe383c
Racer: Make first waypoint flash and highlight last waypoint while placing
Wuzzy <Wuzzy2@mail.ru>
parents:
12969
diff
changeset
|
852 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
853 |
if gameOver == true then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
854 |
gameBegun = false |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
855 |
racerActive = false -- newadd |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
856 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
857 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
858 |
AddAmmo(CurrentHedgehog, amTardis, 0) |
13108
cf2a58dccc4a
CTF: Remove tardis and resurrector
Wuzzy <Wuzzy2@mail.ru>
parents:
13032
diff
changeset
|
859 |
AddAmmo(CurrentHedgehog, amResurrector, 0) |
cf2a58dccc4a
CTF: Remove tardis and resurrector
Wuzzy <Wuzzy2@mail.ru>
parents:
13032
diff
changeset
|
860 |
AddAmmo(CurrentHedgehog, amInvulnerable, 0) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
861 |
AddAmmo(CurrentHedgehog, amDrillStrike, 0) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
862 |
AddAmmo(CurrentHedgehog, amMineStrike, 0) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
863 |
AddAmmo(CurrentHedgehog, amNapalm, 0) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
864 |
AddAmmo(CurrentHedgehog, amPiano, 0) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
865 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
866 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
867 |
function onGameTick20() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
868 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
869 |
-- airstrike detected, convert this into a potential waypoint spot |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
870 |
if cGear ~= nil then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
871 |
x,y = GetGearPosition(cGear) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
872 |
if x > -9000 then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
873 |
x,y = GetGearTarget(cGear) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
874 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
875 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
876 |
if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then |
11929 | 877 |
AddCaption(loc("Please place the waypoint in the air, within the map boundaries")) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
878 |
PlaySound(sndDenied) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
879 |
elseif (y > WaterLine-50) then |
11929 | 880 |
AddCaption(loc("Please place the waypoint further away from the waterline")) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
881 |
PlaySound(sndDenied) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
882 |
else |
12411
cd53f1bf52ff
Stop telling the player to build a track in Racer when it is already built
Wuzzy <almikes@aol.com>
parents:
12393
diff
changeset
|
883 |
PlaceWayPoint(x, y, true) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
884 |
if wpCount == wpLimit then |
11929 | 885 |
AddCaption(loc("Race complexity limit reached")) |
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
|
886 |
EndTurn(true) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
887 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
888 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
889 |
else |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
890 |
DeleteGear(cGear) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
891 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
892 |
SetGearPosition(cGear, -10000, 0) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
893 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
894 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
895 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
896 |
-- start the player tumbling with a boom once their turn has actually begun |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
897 |
if racerActive == false then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
898 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
899 |
if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
900 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
901 |
-- if the gamehas started put the player in the middle of the first |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
902 |
--waypoint that was placed |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
903 |
if gameBegun == true then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
904 |
AddCaption(loc("Good to go!")) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
905 |
racerActive = true |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
906 |
trackTime = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
907 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
908 |
SetGearPosition(CurrentHedgehog, wpX[0], wpY[0]) |
11653 | 909 |
AddGear(GetX(CurrentHedgehog)+boostX, GetY(CurrentHedgehog)+boostY, gtGrenade, 0, 0, 0, 1) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
910 |
FollowGear(CurrentHedgehog) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
911 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
912 |
HideMission() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
913 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
914 |
-- don't start empty-handed |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
915 |
if (GetCurAmmoType() == amNothing) then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
916 |
SetNextWeapon() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
917 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
918 |
else |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
919 |
-- still in placement mode |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
920 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
921 |
|
13134
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
922 |
end |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
923 |
if not racerActive and not gameBegun and GetCurAmmoType() == amAirAttack then |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
924 |
waypointCursor = true |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
925 |
else |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
926 |
waypointCursor = false |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
927 |
end |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
928 |
else |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
929 |
waypointCursor = false |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
930 |
end |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
931 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
932 |
-- has the player started his tumbling spree? |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
933 |
if (CurrentHedgehog ~= nil) then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
934 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
935 |
--airstrike conversion used to be here |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
936 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
937 |
-- if the RACE has started, show tracktimes and keep tabs on waypoints |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
938 |
if (racerActive == true) and (gameBegun == true) then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
939 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
940 |
--ghost |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
941 |
if GameTime%40 == 0 then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
942 |
HandleGhost() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
943 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
944 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
945 |
trackTime = trackTime + 20 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
946 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
947 |
if GameTime%100 == 0 then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
948 |
|
11929 | 949 |
AddCaption(string.format(loc("Time: %.1fs"), (trackTime/1000)),GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
950 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
951 |
if (CheckWaypoints() == true) then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
952 |
AdjustScores() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
953 |
DisableTumbler() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
954 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
955 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
956 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
957 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
958 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
959 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
960 |
-- if the player has expended his tunbling time, stop him tumbling |
12412
8cc070640fd1
Fix skipping in Racer causing the next team to be skipped, too
Wuzzy <almikes@aol.com>
parents:
12411
diff
changeset
|
961 |
if TurnTimeLeft <= 20 and not turnSkipped then |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
962 |
DisableTumbler() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
963 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
964 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
965 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
966 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
967 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
968 |
|
13134
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
969 |
function onGameTick() |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
970 |
if waypointCursor then |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
971 |
if not waypointPreview then |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
972 |
waypointPreview = AddVisualGear(CursorX, CursorY, vgtCircle, 0, true) |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
973 |
end |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
974 |
SetVisualGearValues(waypointPreview, CursorX, CursorY, 200, 200, 0, 0, 0, div(wpRad, 5), 5, waypointColourAtPlacement) |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
975 |
else |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
976 |
if waypointPreview then |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
977 |
DeleteVisualGear(waypointPreview) |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
978 |
waypointPreview = nil |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
979 |
end |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
980 |
end |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
981 |
end |
9a328734e469
Racer: Draw waypoint outline around cursor while in placement phase
Wuzzy <Wuzzy2@mail.ru>
parents:
13129
diff
changeset
|
982 |
|
13635
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13134
diff
changeset
|
983 |
function onGearResurrect(gear, vGear) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
984 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
985 |
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
|
986 |
DisableTumbler(false) |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
987 |
end |
13635
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13134
diff
changeset
|
988 |
if vGear then |
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13134
diff
changeset
|
989 |
DeleteVisualGear(vGear) |
fe7d2bbf5f3f
Fix resurrection animation appearing at wrong position for some missions and styles
Wuzzy <Wuzzy2@mail.ru>
parents:
13134
diff
changeset
|
990 |
end |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
991 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
992 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
993 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
994 |
function onGearAdd(gear) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
995 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
996 |
if GetGearType(gear) == gtHedgehog then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
997 |
hhs[numhhs] = gear |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
998 |
numhhs = numhhs + 1 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
999 |
SetEffect(gear, heResurrectable, 1) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1000 |
elseif GetGearType(gear) == gtAirAttack then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1001 |
cGear = gear |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1002 |
elseif GetGearType(gear) == gtRope and TeamRope then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1003 |
SetTag(gear,1) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1004 |
SetGearValues(gear,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil,GetClanColor(GetHogClan(CurrentHedgehog))) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1005 |
elseif GetGearType(gear) == gtAirMine then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1006 |
DeleteGear(gear) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1007 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1008 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1009 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1010 |
function onGearDelete(gear) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1011 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1012 |
if GetGearType(gear) == gtAirAttack then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1013 |
cGear = nil |
13029
a568bc16a99a
Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents:
12972
diff
changeset
|
1014 |
elseif gear == cameraGear then |
a568bc16a99a
Racer and TechRacer: Move cameera to first waypoint in Ready phase
Wuzzy <Wuzzy2@mail.ru>
parents:
12972
diff
changeset
|
1015 |
cameraGear = nil |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1016 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1017 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1018 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1019 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1020 |
function onAttack() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1021 |
at = GetCurAmmoType() |
11568 | 1022 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1023 |
usedWeapons[at] = 0 |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1024 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1025 |
|
12412
8cc070640fd1
Fix skipping in Racer causing the next team to be skipped, too
Wuzzy <almikes@aol.com>
parents:
12411
diff
changeset
|
1026 |
function onHogAttack(ammoType) |
8cc070640fd1
Fix skipping in Racer causing the next team to be skipped, too
Wuzzy <almikes@aol.com>
parents:
12411
diff
changeset
|
1027 |
if ammoType == amSkip then |
8cc070640fd1
Fix skipping in Racer causing the next team to be skipped, too
Wuzzy <almikes@aol.com>
parents:
12411
diff
changeset
|
1028 |
turnSkipped = true |
8cc070640fd1
Fix skipping in Racer causing the next team to be skipped, too
Wuzzy <almikes@aol.com>
parents:
12411
diff
changeset
|
1029 |
end |
8cc070640fd1
Fix skipping in Racer causing the next team to be skipped, too
Wuzzy <almikes@aol.com>
parents:
12411
diff
changeset
|
1030 |
end |
8cc070640fd1
Fix skipping in Racer causing the next team to be skipped, too
Wuzzy <almikes@aol.com>
parents:
12411
diff
changeset
|
1031 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1032 |
function onAchievementsDeclaration() |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1033 |
usedWeapons[amSkip] = nil |
11568 | 1034 |
usedWeapons[amExtraTime] = nil |
1035 |
||
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1036 |
usedRope = usedWeapons[amRope] ~= nil |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1037 |
usedPortal = usedWeapons[amPortalGun] ~= nil |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1038 |
usedSaucer = usedWeapons[amJetpack] ~= nil |
11568 | 1039 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1040 |
usedWeapons[amNothing] = nil |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1041 |
usedWeapons[amRope] = nil |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1042 |
usedWeapons[amPortalGun] = nil |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1043 |
usedWeapons[amJetpack] = nil |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1044 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1045 |
usedOther = next(usedWeapons) ~= nil |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1046 |
|
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1047 |
if usedOther then -- smth besides nothing, skip, rope, portal or saucer used |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1048 |
raceType = "unknown race" |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1049 |
elseif usedRope and not usedPortal and not usedSaucer then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1050 |
raceType = "rope race" |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1051 |
elseif not usedRope and usedPortal and not usedSaucer then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1052 |
raceType = "portal race" |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1053 |
elseif not usedRope and not usedPortal and usedSaucer then |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1054 |
raceType = "saucer race" |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1055 |
elseif (usedRope or usedPortal or usedSaucer or usedOther) == false then -- no weapons used at all? |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1056 |
raceType = "no tools race" |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1057 |
else -- at least two of rope, portal and saucer used |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1058 |
raceType = "mixed race" |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1059 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1060 |
|
11550
86528b0cd491
detectMap() rewrite with more sane approach, also check waypoints placement to avoid cheating
unc0rr
parents:
11547
diff
changeset
|
1061 |
map = detectMapWithDigest() |
11568 | 1062 |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1063 |
for i = 0, (numTeams-1) do |
11935
4ed643879c0f
Racer: Clean up “did not finish” mess
Wuzzy <almikes@aol.com>
parents:
11934
diff
changeset
|
1064 |
if teamScore[i] < 1000000 then |
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1065 |
DeclareAchievement(raceType, teamNameArr[i], map, teamScore[i]) |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1066 |
end |
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1067 |
end |
11574 | 1068 |
|
11590 | 1069 |
if map ~= nil and fastCount > 0 then |
11574 | 1070 |
StartGhostPoints(fastCount) |
1071 |
||
1072 |
for i = 0, (fastCount - 1) do |
|
1073 |
DumpPoint(fastX[i], fastY[i]) |
|
1074 |
end |
|
1075 |
end |
|
10856
d080b8d4c114
team coloured, just for the heck of it, based on a param. also del airmine, 'cause, probably not fun here. you're invuln anyway.
nemo
parents:
10847
diff
changeset
|
1076 |
end |