author | mikade |
Wed, 14 Sep 2011 18:40:10 +0200 | |
changeset 5902 | 486f84a45805 |
parent 5901 | a00e567005be |
child 5923 | ae8cfd039ab2 |
permissions | -rw-r--r-- |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
1 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
2 |
------------------------------------------ |
5901
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
3 |
-- RACER 0.4 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
4 |
-- map-independant racing script |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
5 |
-- by mikade |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
6 |
----------------------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
7 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
8 |
----------------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
9 |
--0.1: took all the code from crazy racer and scrapped most of it |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
10 |
----------------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
11 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
12 |
-- Removed tumbler system |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
13 |
-- Removed extra adds like boosters etc |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
14 |
-- Added experimental waypoint placement system |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
15 |
-- More user feedback |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
16 |
-- Reduced race complexity limit to 5 waypoints |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
17 |
-- stop placement at complexity limit reached and end turn |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
18 |
-- guys dont keep racing after dying |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
19 |
-- invulnerable feasibility |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
20 |
-- reverted time keeping method |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
21 |
-- reduced feedback display time |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
22 |
-- colour-coded addcaptions |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
23 |
-- cleaned up code |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
24 |
-- support for more players properly added |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
25 |
-- tardis fix |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
26 |
-- remove airstrikes |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
27 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
28 |
-- i think the remainder 0 .456 sec of the tracktime isnt getting reset on newturn |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
29 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
30 |
-- update feedback |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
31 |
|
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
32 |
------- |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
33 |
-- 0.2 |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
34 |
------- |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
35 |
|
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
36 |
-- allow gameflags |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
37 |
-- extend time to 90s |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
38 |
-- remove other air-attack based weps |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
39 |
-- turn off water rise for sd |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
40 |
|
5900 | 41 |
------- |
42 |
-- 0.3 |
|
43 |
------- |
|
44 |
||
45 |
-- prevent WP being placed in land |
|
46 |
-- prevent waypoints being placed outside border |
|
47 |
||
5901
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
48 |
------- |
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
49 |
-- 0.4 |
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
50 |
------- |
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
51 |
|
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
52 |
-- update user feedback |
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
53 |
-- add more sounds |
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
54 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
55 |
----------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
56 |
-- SCRIPT BEGINS |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
57 |
----------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
58 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
59 |
loadfile(GetDataPath() .. "Scripts/Locale.lua")() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
60 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
61 |
------------------ |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
62 |
-- Got Variables? |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
63 |
------------------ |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
64 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
65 |
local fMod = 1000000 -- 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
66 |
local roundLimit = 3 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
67 |
local roundNumber = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
68 |
local firstClan = 10 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
69 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
70 |
local fastX = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
71 |
local fastY = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
72 |
local fastCount = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
73 |
local fastIndex = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
74 |
local fastColour |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
75 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
76 |
local currX = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
77 |
local currY = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
78 |
local currCount = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
79 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
80 |
-------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
81 |
-- hog and team tracking variales |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
82 |
-------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
83 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
84 |
local numhhs = 0 -- store number of hedgehogs |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
85 |
local hhs = {} -- store hedgehog gears |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
86 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
87 |
local numTeams -- store the number of teams in the game |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
88 |
local teamNameArr = {} -- store the list of teams |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
89 |
local teamClan = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
90 |
local teamSize = {} -- store how many hogs per team |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
91 |
local teamIndex = {} -- at what point in the hhs{} does each team begin |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
92 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
93 |
local teamComment = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
94 |
local teamScore = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
95 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
96 |
------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
97 |
-- racer vars |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
98 |
-------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
99 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
100 |
local cGear = nil |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
101 |
local gTimer = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
102 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
103 |
local bestClan = nil |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
104 |
local bestTime = nil |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
105 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
106 |
local gameBegun = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
107 |
local gameOver = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
108 |
local racerActive = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
109 |
local trackTime = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
110 |
local wpCheckCounter = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
111 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
112 |
local wpCirc = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
113 |
local wpX = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
114 |
local wpY = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
115 |
local wpCol = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
116 |
local wpActive = {} |
5900 | 117 |
local wpRad = 450 --75 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
118 |
local wpCount = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
119 |
local wpLimit = 5 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
120 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
121 |
------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
122 |
-- general methods |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
123 |
------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
124 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
125 |
function RebuildTeamInfo() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
126 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
127 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
128 |
-- make a list of individual team names |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
129 |
for i = 0, (TeamsCount-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
130 |
teamNameArr[i] = " " -- = i |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
131 |
teamSize[i] = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
132 |
teamIndex[i] = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
133 |
teamScore[i] = 100000 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
134 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
135 |
numTeams = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
136 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
137 |
for i = 0, (numhhs-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
138 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
139 |
z = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
140 |
unfinished = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
141 |
while(unfinished == true) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
142 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
143 |
newTeam = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
144 |
tempHogTeamName = GetHogTeamName(hhs[i]) -- this is the new name |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
145 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
146 |
if tempHogTeamName == teamNameArr[z] then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
147 |
newTeam = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
148 |
unfinished = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
149 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
150 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
151 |
z = z + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
152 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
153 |
if z == TeamsCount then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
154 |
unfinished = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
155 |
if newTeam == true then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
156 |
teamNameArr[numTeams] = tempHogTeamName |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
157 |
numTeams = numTeams + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
158 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
159 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
160 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
161 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
162 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
163 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
164 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
165 |
-- find out how many hogs per team, and the index of the first hog in hhs |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
166 |
for i = 0, (numTeams-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
167 |
for z = 0, (numhhs-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
168 |
if GetHogTeamName(hhs[z]) == teamNameArr[i] then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
169 |
teamClan[i] = GetHogClan(hhs[z]) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
170 |
if teamSize[i] == 0 then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
171 |
teamIndex[i] = z -- should give starting index |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
172 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
173 |
teamSize[i] = teamSize[i] + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
174 |
--add a pointer so this hog appears at i in hhs |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
175 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
176 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
177 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
178 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
179 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
180 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
181 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
182 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
183 |
----------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
184 |
-- RACER METHODS |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
185 |
----------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
186 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
187 |
function CheckWaypoints() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
188 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
189 |
trackFinished = true |
5900 | 190 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
191 |
for i = 0, (wpCount-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
192 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
193 |
g1X, g1Y = GetGearPosition(CurrentHedgehog) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
194 |
g2X, g2Y = wpX[i], wpY[i] |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
195 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
196 |
g1X = g1X - g2X |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
197 |
g1Y = g1Y - g2Y |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
198 |
dist = (g1X*g1X) + (g1Y*g1Y) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
199 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
200 |
--if i == 0 then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
201 |
-- AddCaption(dist .. "/" .. (wpRad*wpRad) ) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
202 |
--end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
203 |
|
5900 | 204 |
NR = (48/100*wpRad)/2 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
205 |
|
5900 | 206 |
if dist < (NR*NR) then |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
207 |
--if dist < (wpRad*wpRad) then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
208 |
--AddCaption("howdy") |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
209 |
wpActive[i] = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
210 |
wpCol[i] = GetClanColor(GetHogClan(CurrentHedgehog)) -- new --GetClanColor(1) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
211 |
SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i]) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
212 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
213 |
wpRem = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
214 |
for k = 0, (wpCount-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
215 |
if wpActive[k] == false then |
5900 | 216 |
wpRem = wpRem + 1 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
217 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
218 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
219 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
220 |
AddCaption(loc("Way-Points Remaining") .. ": " .. wpRem,0xffba00ff,capgrpAmmoinfo) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
221 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
222 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
223 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
224 |
if wpActive[i] == false then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
225 |
trackFinished = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
226 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
227 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
228 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
229 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
230 |
return(trackFinished) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
231 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
232 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
233 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
234 |
function AdjustScores() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
235 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
236 |
if bestTime == nil then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
237 |
bestTime = 100000 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
238 |
bestClan = 10 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
239 |
bestTimeComment = "N/A" |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
240 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
241 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
242 |
newScore = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
243 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
244 |
-- update this clan's time if the new track is better |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
245 |
for i = 0, (numTeams-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
246 |
if teamClan[i] == GetHogClan(CurrentHedgehog) then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
247 |
if trackTime < teamScore[i] then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
248 |
teamScore[i] = trackTime |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
249 |
newScore = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
250 |
else |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
251 |
newScore = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
252 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
253 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
254 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
255 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
256 |
--bestTime = 100000 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
257 |
--bestClan = 10 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
258 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
259 |
-- find the best time out of those so far |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
260 |
for i = 0, (numTeams-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
261 |
if teamScore[i] < bestTime then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
262 |
bestTime = teamScore[i] |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
263 |
bestClan = teamClan[i] |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
264 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
265 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
266 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
267 |
if bestTime ~= 100000 then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
268 |
bestTimeComment = (bestTime/1000) ..loc("s") |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
269 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
270 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
271 |
if newScore == true then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
272 |
if trackTime == bestTime then -- best time of the race |
5900 | 273 |
ShowMission(loc("RACER"), |
274 |
loc("TRACK COMPLETED"), |
|
275 |
loc("NEW RACE RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" .. |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
276 |
loc("WINNING TIME: ") .. bestTimeComment, 0, 4000) |
5901
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
277 |
PlaySound(sndHomerun) |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
278 |
else -- best time for the clan |
5900 | 279 |
ShowMission(loc("RACER"), |
280 |
loc("TRACK COMPLETED"), |
|
281 |
loc("NEW CLAN RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" .. |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
282 |
loc("WINNING TIME: ") .. bestTimeComment, 4, 4000) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
283 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
284 |
else -- not any kind of new score |
5900 | 285 |
ShowMission(loc("RACER"), |
286 |
loc("TRACK COMPLETED"), |
|
287 |
loc("TIME: ") .. (trackTime/1000) ..loc("s") .. "|" .. |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
288 |
loc("WINNING TIME: ") .. bestTimeComment, -amSkip, 4000) |
5901
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
289 |
PlaySound(sndHellish) |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
290 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
291 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
292 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
293 |
-------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
294 |
--new |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
295 |
-------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
296 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
297 |
if bestTime == trackTime then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
298 |
--AddCaption("wooooooooooooooooooooooooooooo") |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
299 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
300 |
fastColour = GetClanColor(GetHogClan(CurrentHedgehog)) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
301 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
302 |
for i = 0, (currCount-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
303 |
fastX[i] = currX[i] |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
304 |
fastY[i] = currY[i] |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
305 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
306 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
307 |
fastCount = currCount |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
308 |
fastIndex = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
309 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
310 |
--currCount = 0 -- is this needed? |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
311 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
312 |
else |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
313 |
currCount = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
314 |
fastIndex = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
315 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
316 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
317 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
318 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
319 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
320 |
function CheckForNewRound() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
321 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
322 |
if GetHogClan(CurrentHedgehog) == firstClan then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
323 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
324 |
roundNumber = roundNumber + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
325 |
|
5900 | 326 |
totalComment = "" |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
327 |
for i = 0, (TeamsCount-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
328 |
if teamNameArr[i] ~= " " then -- teamScore[teamClan[i]] |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
329 |
teamComment[i] = teamNameArr[i] .. ": " .. (teamScore[i]/1000) .. loc("s|") |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
330 |
totalComment = totalComment .. teamComment[i] |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
331 |
elseif teamNameArr[i] == " " then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
332 |
teamComment[i] = "|" |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
333 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
334 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
335 |
|
5900 | 336 |
ShowMission( loc("RACER"), |
337 |
loc("STATUS UPDATE"), |
|
338 |
loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" .. |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
339 |
loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
340 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
341 |
-- end game if its at round limit |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
342 |
if roundNumber == roundLimit then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
343 |
for i = 0, (numhhs-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
344 |
if GetHogClan(hhs[i]) ~= bestClan then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
345 |
SetEffect(hhs[i], heResurrectable, false) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
346 |
SetHealth(hhs[i],0) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
347 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
348 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
349 |
gameOver = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
350 |
TurnTimeLeft = 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
351 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
352 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
353 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
354 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
355 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
356 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
357 |
function DisableTumbler() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
358 |
currCount = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
359 |
fastIndex = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
360 |
TurnTimeLeft = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
361 |
racerActive = false -- newadd |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
362 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
363 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
364 |
function HandleGhost() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
365 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
366 |
-- get the current xy of the racer at this point |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
367 |
currX[currCount] = GetX(CurrentHedgehog) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
368 |
currY[currCount] = GetY(CurrentHedgehog) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
369 |
currCount = currCount + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
370 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
371 |
-- draw a ping of smoke where the fastest player was at this point |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
372 |
if (fastCount ~= 0) and (fastIndex < fastCount) then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
373 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
374 |
fastIndex = fastIndex + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
375 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
376 |
tempE = AddVisualGear(fastX[fastIndex], fastY[fastIndex], vgtSmoke, 0, false) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
377 |
g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
378 |
SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, fastColour ) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
379 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
380 |
--AddCaption("fC: " .. fastIndex .. " / " .. fastCount) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
381 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
382 |
else |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
383 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
384 |
--AddCaption("excep fC: " .. fastIndex .. " / " .. fastCount) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
385 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
386 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
387 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
388 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
389 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
390 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
391 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
392 |
---------------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
393 |
-- GAME METHODS / EVENT HANDLERS |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
394 |
---------------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
395 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
396 |
function onGameInit() |
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
397 |
GameFlags = GameFlags + gfInfAttack + gfInvulnerable |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
398 |
CaseFreq = 0 |
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
399 |
TurnTime = 90000 |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
400 |
WaterRise = 0 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
401 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
402 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
403 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
404 |
function onGameStart() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
405 |
RebuildTeamInfo() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
406 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
407 |
ShowMission ( |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
408 |
loc("RACER"), |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
409 |
loc("a Hedgewars mini-game"), |
5900 | 410 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
411 |
loc("Build a track and race.") .. "|" .. |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
412 |
loc("Round Limit:") .. " " .. roundLimit .. "|" .. |
5900 | 413 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
414 |
"", 4, 4000 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
415 |
) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
416 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
417 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
418 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
419 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
420 |
function PlaceWayPoint(x,y) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
421 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
422 |
if (wpCount < wpLimit) then -- seems to not work with a hedgehog nil chek |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
423 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
424 |
wpX[wpCount] = x |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
425 |
wpY[wpCount] = y |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
426 |
wpCol[wpCount] = 0xffffffff |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
427 |
wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true) |
5900 | 428 |
--100 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
429 |
SetVisualGearValues(wpCirc[wpCount], wpX[wpCount], wpY[wpCount], 20, 100, 1, 10, 0, wpRad, 5, wpCol[wpCount]) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
430 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
431 |
wpCount = wpCount + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
432 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
433 |
AddCaption(loc("Waypoint placed.") .. " " .. loc("Available points remaining: ") .. (wpLimit-wpCount)) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
434 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
435 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
436 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
437 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
438 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
439 |
function onNewTurn() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
440 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
441 |
CheckForNewRound() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
442 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
443 |
racerActive = false |
5900 | 444 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
445 |
trackTime = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
446 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
447 |
currCount = 0 -- hopefully this solves problem |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
448 |
AddAmmo(CurrentHedgehog, amAirAttack, 0) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
449 |
gTimer = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
450 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
451 |
-- Set the waypoints to unactive on new round |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
452 |
for i = 0,(wpCount-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
453 |
wpActive[i] = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
454 |
wpCol[i] = 0xffffffff |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
455 |
SetVisualGearValues(wpCirc[i], wpX[i], wpY[i], 20, 100, 1, 10, 0, wpRad, 5, wpCol[i]) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
456 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
457 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
458 |
-- Handle Starting Stage of Game |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
459 |
if (gameOver == false) and (gameBegun == false) then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
460 |
if wpCount >= 3 then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
461 |
gameBegun = true |
5900 | 462 |
roundNumber = 0 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
463 |
firstClan = GetHogClan(CurrentHedgehog) |
5900 | 464 |
ShowMission(loc("RACER"), |
465 |
loc("GAME BEGUN!!!"), |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
466 |
loc("Complete the track as fast as you can!"), 2, 4000) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
467 |
else |
5900 | 468 |
ShowMission(loc("RACER"), |
469 |
loc("NOT ENOUGH WAYPOINTS"), |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
470 |
loc("Place more waypoints using the 'Air Attack' weapon."), 2, 4000) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
471 |
AddAmmo(CurrentHedgehog, amAirAttack, 4000) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
472 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
473 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
474 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
475 |
if gameOver == true then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
476 |
gameBegun = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
477 |
racerActive = false -- newadd |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
478 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
479 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
480 |
AddAmmo(CurrentHedgehog, amTardis, 0) |
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
481 |
AddAmmo(CurrentHedgehog, amDrillStrike, 0) |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
482 |
AddAmmo(CurrentHedgehog, amMineStrike, 0) |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
483 |
AddAmmo(CurrentHedgehog, amNapalm, 0) |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
484 |
AddAmmo(CurrentHedgehog, amPiano, 0) |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
485 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
486 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
487 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
488 |
function onGameTick() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
489 |
|
5900 | 490 |
-- airstrike detected, convert this into a potential waypoint spot |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
491 |
if cGear ~= nil then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
492 |
x,y = GetGearTarget(cGear) |
5900 | 493 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
494 |
DeleteGear(cGear) |
5900 | 495 |
|
496 |
if TestRectForObstacle(x-20, y-20, x+20, y+20, true) then |
|
5901
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
497 |
AddCaption(loc("Please place the way-point in the open, within the map boundaries.")) |
a00e567005be
Add sounds for incorrectly placed waypoint, fastest time, and no record of any kind.
mikade
parents:
5900
diff
changeset
|
498 |
PlaySound(sndDenied) |
5900 | 499 |
else |
500 |
PlaceWayPoint(x, y) |
|
501 |
if wpCount == wpLimit then |
|
502 |
AddCaption(loc("Race complexity limit reached.")) |
|
503 |
DisableTumbler() |
|
504 |
end |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
505 |
end |
5900 | 506 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
507 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
508 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
509 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
510 |
-- start the player tumbling with a boom once their turn has actually begun |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
511 |
if racerActive == false then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
512 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
513 |
if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then |
5900 | 514 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
515 |
-- if the gamehas started put the player in the middle of the first |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
516 |
--waypoint that was placed |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
517 |
if gameBegun == true then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
518 |
AddCaption(loc("Good to go!")) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
519 |
racerActive = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
520 |
trackTime = 0 |
5900 | 521 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
522 |
SetGearPosition(CurrentHedgehog, wpX[0], wpY[0]) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
523 |
AddGear(GetX(CurrentHedgehog), GetY(CurrentHedgehog), gtGrenade, 0, 0, 0, 1) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
524 |
FollowGear(CurrentHedgehog) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
525 |
ShowMission("...", "...", "...", 2, 1) |
5900 | 526 |
|
527 |
else |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
528 |
-- still in placement mode |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
529 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
530 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
531 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
532 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
533 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
534 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
535 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
536 |
-- has the player started his tumbling spree? |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
537 |
if (CurrentHedgehog ~= nil) then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
538 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
539 |
--airstrike conversion used to be here |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
540 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
541 |
-- if the RACE has started, show tracktimes and keep tabs on waypoints |
5900 | 542 |
if (racerActive == true) and (gameBegun == true) then |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
543 |
|
5900 | 544 |
--ghost |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
545 |
gTimer = gTimer + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
546 |
if gTimer == 15 then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
547 |
gTimer = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
548 |
HandleGhost() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
549 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
550 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
551 |
trackTime = trackTime + 1 |
5900 | 552 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
553 |
wpCheckCounter = wpCheckCounter + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
554 |
if (wpCheckCounter == 100) then |
5900 | 555 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
556 |
wpCheckCounter = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
557 |
AddCaption(trackTime/1000,GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2) |
5900 | 558 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
559 |
if (CheckWaypoints() == true) then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
560 |
AdjustScores() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
561 |
racerActive = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
562 |
DisableTumbler() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
563 |
end |
5900 | 564 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
565 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
566 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
567 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
568 |
|
5900 | 569 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
570 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
571 |
-- if the player has expended his tunbling time, stop him tumbling |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
572 |
if TurnTimeLeft <= 1 then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
573 |
DisableTumbler() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
574 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
575 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
576 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
577 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
578 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
579 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
580 |
function onGearResurrect(gear) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
581 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
582 |
AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
583 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
584 |
-- if the player stops and "dies" or flies into water, stop him racing |
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
585 |
--[[if gear == CurrentHedgehog then |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
586 |
DisableTumbler() |
5900 | 587 |
ShowMission(loc("RACER"), |
588 |
loc("TRACK FAILED!"), |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
589 |
loc("WINNING TIME: ") .. bestTimeComment, -amSkip, 4000) |
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
590 |
end]] |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
591 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
592 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
593 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
594 |
function onGearAdd(gear) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
595 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
596 |
if GetGearType(gear) == gtHedgehog then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
597 |
hhs[numhhs] = gear |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
598 |
numhhs = numhhs + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
599 |
SetEffect(gear, heResurrectable, true) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
600 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
601 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
602 |
if GetGearType(gear) == gtAirAttack then |
5900 | 603 |
cGear = gear |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
604 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
605 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
606 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
607 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
608 |
function onGearDelete(gear) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
609 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
610 |
if GetGearType(gear) == gtAirAttack then |
5900 | 611 |
cGear = nil |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
612 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
613 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
614 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
615 |
|
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
616 |
--[[function onAmmoStoreInit() |
5900 | 617 |
SetAmmo(amRope, 9, 0, 0, 0) |
618 |
SetAmmo(amJetpack, 9, 0, 0, 0) |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
619 |
SetAmmo(amSkip, 9, 0, 0, 0) |
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
620 |
end]] |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
621 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
622 |