author | Xeli |
Sat, 03 Dec 2011 19:09:24 +0100 | |
changeset 6487 | bd3c736c1eac |
parent 6253 | d73317579ae4 |
child 7139 | a47fd17ba463 |
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 |
------------------------------------------ |
6253 | 3 |
-- RACER 0.5 |
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 |
|
6253 | 55 |
------- |
56 |
-- 0.5 |
|
57 |
------- |
|
58 |
||
59 |
-- fix ghost disappearing if hog falls in water or somehow dies |
|
60 |
-- lengthen ghost tracking interval to improve performance on slower machines |
|
61 |
-- increase waypoint limit to 8 |
|
62 |
-- allow for persistent showmission information |
|
63 |
||
5845
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 |
-- SCRIPT BEGINS |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
66 |
----------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
67 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
68 |
loadfile(GetDataPath() .. "Scripts/Locale.lua")() |
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 |
------------------ |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
71 |
-- Got Variables? |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
72 |
------------------ |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
73 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
74 |
local fMod = 1000000 -- 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
75 |
local roundLimit = 3 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
76 |
local roundNumber = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
77 |
local firstClan = 10 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
78 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
79 |
local fastX = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
80 |
local fastY = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
81 |
local fastCount = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
82 |
local fastIndex = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
83 |
local fastColour |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
84 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
85 |
local currX = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
86 |
local currY = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
87 |
local currCount = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
88 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
89 |
-------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
90 |
-- hog and team tracking variales |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
91 |
-------------------------- |
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 numhhs = 0 -- store number of hedgehogs |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
94 |
local hhs = {} -- store hedgehog gears |
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 |
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
|
97 |
local teamNameArr = {} -- store the list of teams |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
98 |
local teamClan = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
99 |
local teamSize = {} -- store how many hogs per team |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
100 |
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
|
101 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
102 |
local teamComment = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
103 |
local teamScore = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
104 |
|
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 |
-- racer vars |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
107 |
-------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
108 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
109 |
local cGear = nil |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
110 |
local gTimer = 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 bestClan = nil |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
113 |
local bestTime = nil |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
114 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
115 |
local gameBegun = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
116 |
local gameOver = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
117 |
local racerActive = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
118 |
local trackTime = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
119 |
local wpCheckCounter = 0 |
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 |
local wpCirc = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
122 |
local wpX = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
123 |
local wpY = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
124 |
local wpCol = {} |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
125 |
local wpActive = {} |
5900 | 126 |
local wpRad = 450 --75 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
127 |
local wpCount = 0 |
6253 | 128 |
local wpLimit = 8 |
129 |
||
130 |
local roundN |
|
131 |
local lastRound |
|
132 |
local RoundHasChanged |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
133 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
134 |
------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
135 |
-- general methods |
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 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
138 |
function RebuildTeamInfo() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
139 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
140 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
141 |
-- make a list of individual team names |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
142 |
for i = 0, (TeamsCount-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
143 |
teamNameArr[i] = " " -- = i |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
144 |
teamSize[i] = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
145 |
teamIndex[i] = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
146 |
teamScore[i] = 100000 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
147 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
148 |
numTeams = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
149 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
150 |
for i = 0, (numhhs-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
151 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
152 |
z = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
153 |
unfinished = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
154 |
while(unfinished == true) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
155 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
156 |
newTeam = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
157 |
tempHogTeamName = GetHogTeamName(hhs[i]) -- this is the new name |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
158 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
159 |
if tempHogTeamName == teamNameArr[z] then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
160 |
newTeam = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
161 |
unfinished = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
162 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
163 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
164 |
z = z + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
165 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
166 |
if z == TeamsCount then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
167 |
unfinished = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
168 |
if newTeam == true then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
169 |
teamNameArr[numTeams] = tempHogTeamName |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
170 |
numTeams = numTeams + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
171 |
end |
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 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
174 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
175 |
|
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 |
-- 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
|
179 |
for i = 0, (numTeams-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
180 |
for z = 0, (numhhs-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
181 |
if GetHogTeamName(hhs[z]) == teamNameArr[i] then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
182 |
teamClan[i] = GetHogClan(hhs[z]) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
183 |
if teamSize[i] == 0 then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
184 |
teamIndex[i] = z -- should give starting index |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
185 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
186 |
teamSize[i] = teamSize[i] + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
187 |
--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
|
188 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
189 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
190 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
191 |
end |
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 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
194 |
|
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 |
----------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
197 |
-- RACER METHODS |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
198 |
----------------- |
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 |
function CheckWaypoints() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
201 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
202 |
trackFinished = true |
5900 | 203 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
204 |
for i = 0, (wpCount-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
205 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
206 |
g1X, g1Y = GetGearPosition(CurrentHedgehog) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
207 |
g2X, g2Y = wpX[i], wpY[i] |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
208 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
209 |
g1X = g1X - g2X |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
210 |
g1Y = g1Y - g2Y |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
211 |
dist = (g1X*g1X) + (g1Y*g1Y) |
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 |
--if i == 0 then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
214 |
-- AddCaption(dist .. "/" .. (wpRad*wpRad) ) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
215 |
--end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
216 |
|
5900 | 217 |
NR = (48/100*wpRad)/2 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
218 |
|
5900 | 219 |
if dist < (NR*NR) then |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
220 |
--if dist < (wpRad*wpRad) then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
221 |
--AddCaption("howdy") |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
222 |
wpActive[i] = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
223 |
wpCol[i] = GetClanColor(GetHogClan(CurrentHedgehog)) -- new --GetClanColor(1) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
224 |
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
|
225 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
226 |
wpRem = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
227 |
for k = 0, (wpCount-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
228 |
if wpActive[k] == false then |
5900 | 229 |
wpRem = wpRem + 1 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
230 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
231 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
232 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
233 |
AddCaption(loc("Way-Points Remaining") .. ": " .. wpRem,0xffba00ff,capgrpAmmoinfo) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
234 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
235 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
236 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
237 |
if wpActive[i] == false then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
238 |
trackFinished = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
239 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
240 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
241 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
242 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
243 |
return(trackFinished) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
244 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
245 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
246 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
247 |
function AdjustScores() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
248 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
249 |
if bestTime == nil then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
250 |
bestTime = 100000 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
251 |
bestClan = 10 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
252 |
bestTimeComment = "N/A" |
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 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
255 |
newScore = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
256 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
257 |
-- 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
|
258 |
for i = 0, (numTeams-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
259 |
if teamClan[i] == GetHogClan(CurrentHedgehog) then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
260 |
if trackTime < teamScore[i] then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
261 |
teamScore[i] = trackTime |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
262 |
newScore = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
263 |
else |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
264 |
newScore = false |
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 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
267 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
268 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
269 |
--bestTime = 100000 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
270 |
--bestClan = 10 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
271 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
272 |
-- find the best time out of those so far |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
273 |
for i = 0, (numTeams-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
274 |
if teamScore[i] < bestTime then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
275 |
bestTime = teamScore[i] |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
276 |
bestClan = teamClan[i] |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
277 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
278 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
279 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
280 |
if bestTime ~= 100000 then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
281 |
bestTimeComment = (bestTime/1000) ..loc("s") |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
282 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
283 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
284 |
if newScore == true then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
285 |
if trackTime == bestTime then -- best time of the race |
5900 | 286 |
ShowMission(loc("RACER"), |
287 |
loc("TRACK COMPLETED"), |
|
288 |
loc("NEW RACE RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" .. |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
289 |
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
|
290 |
PlaySound(sndHomerun) |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
291 |
else -- best time for the clan |
5900 | 292 |
ShowMission(loc("RACER"), |
293 |
loc("TRACK COMPLETED"), |
|
294 |
loc("NEW CLAN RECORD: ") .. (trackTime/1000) ..loc("s") .. "|" .. |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
295 |
loc("WINNING TIME: ") .. bestTimeComment, 4, 4000) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
296 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
297 |
else -- not any kind of new score |
5900 | 298 |
ShowMission(loc("RACER"), |
299 |
loc("TRACK COMPLETED"), |
|
300 |
loc("TIME: ") .. (trackTime/1000) ..loc("s") .. "|" .. |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
301 |
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
|
302 |
PlaySound(sndHellish) |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
303 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
304 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
305 |
|
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 |
--new |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
308 |
-------- |
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 |
if bestTime == trackTime then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
311 |
--AddCaption("wooooooooooooooooooooooooooooo") |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
312 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
313 |
fastColour = GetClanColor(GetHogClan(CurrentHedgehog)) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
314 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
315 |
for i = 0, (currCount-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
316 |
fastX[i] = currX[i] |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
317 |
fastY[i] = currY[i] |
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 |
fastCount = currCount |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
321 |
fastIndex = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
322 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
323 |
--currCount = 0 -- is this needed? |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
324 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
325 |
else |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
326 |
currCount = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
327 |
fastIndex = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
328 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
329 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
330 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
331 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
332 |
|
6253 | 333 |
function onNewRound() |
334 |
||
335 |
roundNumber = roundNumber + 1 |
|
336 |
||
337 |
totalComment = "" |
|
338 |
for i = 0, (TeamsCount-1) do |
|
339 |
if teamNameArr[i] ~= " " then -- teamScore[teamClan[i]] |
|
340 |
teamComment[i] = teamNameArr[i] .. ": " .. (teamScore[i]/1000) .. loc("s|") |
|
341 |
totalComment = totalComment .. teamComment[i] |
|
342 |
elseif teamNameArr[i] == " " then |
|
343 |
teamComment[i] = "|" |
|
344 |
end |
|
345 |
end |
|
346 |
||
347 |
ShowMission( loc("RACER"), |
|
348 |
loc("STATUS UPDATE"), |
|
349 |
loc("Rounds Complete: ") .. roundNumber .. "/" .. roundLimit .. "|" .. " " .. "|" .. |
|
350 |
loc("Best Team Times: ") .. "|" .. totalComment, 0, 4000) |
|
351 |
||
352 |
-- end game if its at round limit |
|
353 |
if roundNumber == roundLimit then |
|
354 |
for i = 0, (numhhs-1) do |
|
355 |
if GetHogClan(hhs[i]) ~= bestClan then |
|
356 |
SetEffect(hhs[i], heResurrectable, false) |
|
357 |
SetHealth(hhs[i],0) |
|
358 |
end |
|
359 |
end |
|
360 |
gameOver = true |
|
361 |
TurnTimeLeft = 1 |
|
362 |
end |
|
363 |
||
364 |
end |
|
365 |
||
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
366 |
function CheckForNewRound() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
367 |
|
6253 | 368 |
------------- |
369 |
------ new |
|
370 |
------------- |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
371 |
|
6253 | 372 |
--[[turnN = turnN + 1 |
373 |
if gameBegun == false then |
|
374 |
if turnN == 2 then |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
375 |
for i = 0, (numhhs-1) do |
6253 | 376 |
if hhs[i] ~= nil then |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
377 |
SetEffect(hhs[i], heResurrectable, false) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
378 |
SetHealth(hhs[i],0) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
379 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
380 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
381 |
gameOver = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
382 |
TurnTimeLeft = 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
383 |
end |
6253 | 384 |
else |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
385 |
|
6253 | 386 |
|
387 |
end]] |
|
388 |
||
389 |
--[[if roundBegun == true then |
|
390 |
||
391 |
if RoundHasChanged == true then |
|
392 |
roundN = roundN + 1 |
|
393 |
RoundHasChanged = false |
|
394 |
onNewRound() |
|
395 |
end |
|
396 |
||
397 |
if lastRound ~= TotalRounds then -- new round, but not really |
|
398 |
||
399 |
if RoundHasChanged == false then |
|
400 |
RoundHasChanged = true |
|
401 |
end |
|
402 |
||
403 |
end |
|
404 |
||
405 |
AddCaption("RoundN:" .. roundN .. "; " .. "TR: " .. TotalRounds) |
|
406 |
||
407 |
lastRound = TotalRounds |
|
408 |
||
409 |
end]] |
|
410 |
||
411 |
------------ |
|
412 |
----- old |
|
413 |
------------ |
|
414 |
||
415 |
if GetHogClan(CurrentHedgehog) == firstClan then |
|
416 |
onNewRound() |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
417 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
418 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
419 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
420 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
421 |
function DisableTumbler() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
422 |
currCount = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
423 |
fastIndex = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
424 |
TurnTimeLeft = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
425 |
racerActive = false -- newadd |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
426 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
427 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
428 |
function HandleGhost() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
429 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
430 |
-- 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
|
431 |
currX[currCount] = GetX(CurrentHedgehog) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
432 |
currY[currCount] = GetY(CurrentHedgehog) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
433 |
currCount = currCount + 1 |
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 |
-- 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
|
436 |
if (fastCount ~= 0) and (fastIndex < fastCount) then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
437 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
438 |
fastIndex = fastIndex + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
439 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
440 |
tempE = AddVisualGear(fastX[fastIndex], fastY[fastIndex], vgtSmoke, 0, false) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
441 |
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
|
442 |
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
|
443 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
444 |
--AddCaption("fC: " .. fastIndex .. " / " .. fastCount) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
445 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
446 |
else |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
447 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
448 |
--AddCaption("excep fC: " .. fastIndex .. " / " .. fastCount) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
449 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
450 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
451 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
452 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
453 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
454 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
455 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
456 |
---------------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
457 |
-- GAME METHODS / EVENT HANDLERS |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
458 |
---------------------------------- |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
459 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
460 |
function onGameInit() |
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
461 |
GameFlags = GameFlags + gfInfAttack + gfInvulnerable |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
462 |
CaseFreq = 0 |
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
463 |
TurnTime = 90000 |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
464 |
WaterRise = 0 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
465 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
466 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
467 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
468 |
function onGameStart() |
6253 | 469 |
|
470 |
roundN = 0 |
|
471 |
lastRound = TotalRounds |
|
472 |
RoundHasChanged = false -- true |
|
473 |
||
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
474 |
RebuildTeamInfo() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
475 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
476 |
ShowMission ( |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
477 |
loc("RACER"), |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
478 |
loc("a Hedgewars mini-game"), |
5900 | 479 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
480 |
loc("Build a track and race.") .. "|" .. |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
481 |
loc("Round Limit:") .. " " .. roundLimit .. "|" .. |
5900 | 482 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
483 |
"", 4, 4000 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
484 |
) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
485 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
486 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
487 |
function PlaceWayPoint(x,y) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
488 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
489 |
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
|
490 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
491 |
wpX[wpCount] = x |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
492 |
wpY[wpCount] = y |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
493 |
wpCol[wpCount] = 0xffffffff |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
494 |
wpCirc[wpCount] = AddVisualGear(wpX[wpCount],wpY[wpCount],vgtCircle,0,true) |
5900 | 495 |
--100 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
496 |
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
|
497 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
498 |
wpCount = wpCount + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
499 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
500 |
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
|
501 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
502 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
503 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
504 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
505 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
506 |
function onNewTurn() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
507 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
508 |
CheckForNewRound() |
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 |
racerActive = false |
5900 | 511 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
512 |
trackTime = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
513 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
514 |
currCount = 0 -- hopefully this solves problem |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
515 |
AddAmmo(CurrentHedgehog, amAirAttack, 0) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
516 |
gTimer = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
517 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
518 |
-- Set the waypoints to unactive on new round |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
519 |
for i = 0,(wpCount-1) do |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
520 |
wpActive[i] = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
521 |
wpCol[i] = 0xffffffff |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
522 |
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
|
523 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
524 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
525 |
-- Handle Starting Stage of Game |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
526 |
if (gameOver == false) and (gameBegun == false) then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
527 |
if wpCount >= 3 then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
528 |
gameBegun = true |
5900 | 529 |
roundNumber = 0 |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
530 |
firstClan = GetHogClan(CurrentHedgehog) |
5900 | 531 |
ShowMission(loc("RACER"), |
532 |
loc("GAME BEGUN!!!"), |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
533 |
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
|
534 |
else |
5900 | 535 |
ShowMission(loc("RACER"), |
536 |
loc("NOT ENOUGH WAYPOINTS"), |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
537 |
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
|
538 |
AddAmmo(CurrentHedgehog, amAirAttack, 4000) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
539 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
540 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
541 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
542 |
if gameOver == true then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
543 |
gameBegun = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
544 |
racerActive = false -- newadd |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
545 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
546 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
547 |
AddAmmo(CurrentHedgehog, amTardis, 0) |
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
548 |
AddAmmo(CurrentHedgehog, amDrillStrike, 0) |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
549 |
AddAmmo(CurrentHedgehog, amMineStrike, 0) |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
550 |
AddAmmo(CurrentHedgehog, amNapalm, 0) |
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
551 |
AddAmmo(CurrentHedgehog, amPiano, 0) |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
552 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
553 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
554 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
555 |
function onGameTick() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
556 |
|
5900 | 557 |
-- 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
|
558 |
if cGear ~= nil then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
559 |
x,y = GetGearTarget(cGear) |
6253 | 560 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
561 |
DeleteGear(cGear) |
5900 | 562 |
|
563 |
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
|
564 |
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
|
565 |
PlaySound(sndDenied) |
5923 | 566 |
elseif (y > WaterLine-50) then |
567 |
AddCaption(loc("Please place the way-point further from the waterline.")) |
|
568 |
PlaySound(sndDenied) |
|
5900 | 569 |
else |
570 |
PlaceWayPoint(x, y) |
|
571 |
if wpCount == wpLimit then |
|
572 |
AddCaption(loc("Race complexity limit reached.")) |
|
573 |
DisableTumbler() |
|
574 |
end |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
575 |
end |
5900 | 576 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
577 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
578 |
|
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 |
-- 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
|
581 |
if racerActive == false then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
582 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
583 |
if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) then |
5900 | 584 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
585 |
-- 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
|
586 |
--waypoint that was placed |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
587 |
if gameBegun == true then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
588 |
AddCaption(loc("Good to go!")) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
589 |
racerActive = true |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
590 |
trackTime = 0 |
5900 | 591 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
592 |
SetGearPosition(CurrentHedgehog, wpX[0], wpY[0]) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
593 |
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
|
594 |
FollowGear(CurrentHedgehog) |
6253 | 595 |
|
596 |
HideMission() |
|
5900 | 597 |
|
598 |
else |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
599 |
-- still in placement mode |
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 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
603 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
604 |
|
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 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
607 |
-- has the player started his tumbling spree? |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
608 |
if (CurrentHedgehog ~= nil) then |
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 |
--airstrike conversion used to be here |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
611 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
612 |
-- if the RACE has started, show tracktimes and keep tabs on waypoints |
5900 | 613 |
if (racerActive == true) and (gameBegun == true) then |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
614 |
|
5900 | 615 |
--ghost |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
616 |
gTimer = gTimer + 1 |
6253 | 617 |
if gTimer == 40 then |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
618 |
gTimer = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
619 |
HandleGhost() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
620 |
end |
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 |
trackTime = trackTime + 1 |
5900 | 623 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
624 |
wpCheckCounter = wpCheckCounter + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
625 |
if (wpCheckCounter == 100) then |
5900 | 626 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
627 |
wpCheckCounter = 0 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
628 |
AddCaption(trackTime/1000,GetClanColor(GetHogClan(CurrentHedgehog)),capgrpMessage2) |
5900 | 629 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
630 |
if (CheckWaypoints() == true) then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
631 |
AdjustScores() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
632 |
racerActive = false |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
633 |
DisableTumbler() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
634 |
end |
5900 | 635 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
636 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
637 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
638 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
639 |
|
5900 | 640 |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
641 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
642 |
-- 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
|
643 |
if TurnTimeLeft <= 1 then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
644 |
DisableTumbler() |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
645 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
646 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
647 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
648 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
649 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
650 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
651 |
function onGearResurrect(gear) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
652 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
653 |
AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
654 |
|
6253 | 655 |
if gear == CurrentHedgehog then |
656 |
DisableTumbler() |
|
657 |
end |
|
658 |
||
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
659 |
-- 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
|
660 |
--[[if gear == CurrentHedgehog then |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
661 |
DisableTumbler() |
5900 | 662 |
ShowMission(loc("RACER"), |
663 |
loc("TRACK FAILED!"), |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
664 |
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
|
665 |
end]] |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
666 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
667 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
668 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
669 |
function onGearAdd(gear) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
670 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
671 |
if GetGearType(gear) == gtHedgehog then |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
672 |
hhs[numhhs] = gear |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
673 |
numhhs = numhhs + 1 |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
674 |
SetEffect(gear, heResurrectable, true) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
675 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
676 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
677 |
if GetGearType(gear) == gtAirAttack then |
5900 | 678 |
cGear = gear |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
679 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
680 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
681 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
682 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
683 |
function onGearDelete(gear) |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
684 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
685 |
if GetGearType(gear) == gtAirAttack then |
5900 | 686 |
cGear = nil |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
687 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
688 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
689 |
end |
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
690 |
|
5894
86c59c34cdd5
Balanced shield miser, multi-shot, and boss kills in SI. Added radar ping.
mikade
parents:
5845
diff
changeset
|
691 |
--[[function onAmmoStoreInit() |
5900 | 692 |
SetAmmo(amRope, 9, 0, 0, 0) |
693 |
SetAmmo(amJetpack, 9, 0, 0, 0) |
|
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
694 |
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
|
695 |
end]] |
5845
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
696 |
|
b20a1e0a0e7e
Substitute broken Tumbler-based GaudyRacer with generic, map independant Racer.
mikade
parents:
diff
changeset
|
697 |