author | unC0Rr |
Tue, 17 Dec 2024 15:44:21 +0100 | |
branch | transitional_engine |
changeset 16078 | db18f1a30b0c |
parent 16004 | 2146cb7be36f |
permissions | -rw-r--r-- |
4976 | 1 |
(* |
2 |
* Hedgewars, a free turn based strategy game |
|
11046 | 3 |
* Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com> |
4976 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
10015
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
4976 | 17 |
*) |
18 |
||
4413 | 19 |
{$INCLUDE "options.inc"} |
4976 | 20 |
|
4413 | 21 |
unit uCommandHandlers; |
22 |
||
23 |
interface |
|
24 |
||
25 |
procedure initModule; |
|
26 |
procedure freeModule; |
|
27 |
||
28 |
implementation |
|
12998
22e032ab1cb7
Toggle hog tag translucency with Precise + Change hog tags key
Wuzzy <Wuzzy2@mail.ru>
parents:
12997
diff
changeset
|
29 |
uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uWorld, uRandom, uCaptions |
15983
416bca0a172c
Properly close chat after quit command
Wuzzy <Wuzzy@disroot.org>
parents:
15897
diff
changeset
|
30 |
, uVisualGearsList, uGearsHedgehog, uChat |
7629 | 31 |
{$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF}; |
4413 | 32 |
|
13107
7b3bc9a4dfb9
uCommandHandlers: Remove unused variable
Wuzzy <Wuzzy2@mail.ru>
parents:
13077
diff
changeset
|
33 |
var cTagsMasks : array[0..15] of byte = (7, 0, 0, 0, 0, 4, 5, 6, 15, 8, 8, 8, 8, 12, 13, 14); |
12998
22e032ab1cb7
Toggle hog tag translucency with Precise + Change hog tags key
Wuzzy <Wuzzy2@mail.ru>
parents:
12997
diff
changeset
|
34 |
cTagsMasksNoHealth: array[0..15] of byte = (3, 0, 1, 2, 0, 0, 0, 0, 11, 8, 9, 10, 8, 8, 8, 8); |
7028 | 35 |
|
4531
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
36 |
procedure chGenCmd(var s: shortstring); |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
37 |
begin |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
38 |
case s[1] of |
11919
e0476802c8b5
When doing something, set ready time to 0 instead of 1
Wuzzy <almikes@aol.com>
parents:
11532
diff
changeset
|
39 |
'R': if ReadyTimeLeft > 0 then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
40 |
begin |
11919
e0476802c8b5
When doing something, set ready time to 0 instead of 1
Wuzzy <almikes@aol.com>
parents:
11532
diff
changeset
|
41 |
ReadyTimeLeft:= 0; |
7805 | 42 |
if not isExternalSource then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
43 |
SendIPC('c'+s); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
44 |
end |
4531
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
45 |
end |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
46 |
end; |
4ea193b0e378
Reenable ReadyTimer using a synced message NEEDS TESTING.
nemo
parents:
4528
diff
changeset
|
47 |
|
4413 | 48 |
procedure chQuit(var s: shortstring); |
49 |
begin |
|
4751 | 50 |
s:= s; // avoid compiler hint |
13077 | 51 |
if (GameState = gsGame) then |
15984
6a985a680c44
Don't destroy chat when window loses focus (bug 623)
Wuzzy <Wuzzy@disroot.org>
parents:
15983
diff
changeset
|
52 |
begin |
15983
416bca0a172c
Properly close chat after quit command
Wuzzy <Wuzzy@disroot.org>
parents:
15897
diff
changeset
|
53 |
CloseChat; |
5523 | 54 |
GameState:= gsConfirm; |
15984
6a985a680c44
Don't destroy chat when window loses focus (bug 623)
Wuzzy <Wuzzy@disroot.org>
parents:
15983
diff
changeset
|
55 |
end |
6a985a680c44
Don't destroy chat when window loses focus (bug 623)
Wuzzy <Wuzzy@disroot.org>
parents:
15983
diff
changeset
|
56 |
else |
10510 | 57 |
if GameState = gsConfirm then |
15984
6a985a680c44
Don't destroy chat when window loses focus (bug 623)
Wuzzy <Wuzzy@disroot.org>
parents:
15983
diff
changeset
|
58 |
begin |
13077 | 59 |
GameState:= gsGame; |
15984
6a985a680c44
Don't destroy chat when window loses focus (bug 623)
Wuzzy <Wuzzy@disroot.org>
parents:
15983
diff
changeset
|
60 |
RestoreChat; |
6a985a680c44
Don't destroy chat when window loses focus (bug 623)
Wuzzy <Wuzzy@disroot.org>
parents:
15983
diff
changeset
|
61 |
end; |
10392 | 62 |
updateCursorVisibility; |
4413 | 63 |
end; |
64 |
||
4744
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
65 |
procedure chForceQuit(var s: shortstring); |
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
66 |
begin |
ecc2c757d0df
general uKey refactor in preparaiton of two new shortcuts
koda
parents:
4661
diff
changeset
|
67 |
s:= s; // avoid compiler hint |
4751 | 68 |
GameState:= gsConfirm; |
69 |
ParseCommand('confirm', true); |
|
4413 | 70 |
end; |
71 |
||
72 |
procedure chConfirm(var s: shortstring); |
|
73 |
begin |
|
4751 | 74 |
s:= s; // avoid compiler hint |
75 |
if GameState = gsConfirm then |
|
7722 | 76 |
begin |
15299
16f389fcd462
Prevent saving of demo after /lua command was used
Wuzzy <Wuzzy2@mail.ru>
parents:
14917
diff
changeset
|
77 |
if (luaCmdUsed) then |
16f389fcd462
Prevent saving of demo after /lua command was used
Wuzzy <Wuzzy2@mail.ru>
parents:
14917
diff
changeset
|
78 |
SendIPC(_S'm'); |
7068 | 79 |
SendIPC(_S'Q'); |
4751 | 80 |
GameState:= gsExit |
7722 | 81 |
end |
4413 | 82 |
end; |
83 |
||
4751 | 84 |
procedure chHalt (var s: shortstring); |
4746
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
85 |
begin |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
86 |
s:= s; // avoid compiler hint |
15299
16f389fcd462
Prevent saving of demo after /lua command was used
Wuzzy <Wuzzy2@mail.ru>
parents:
14917
diff
changeset
|
87 |
if (luaCmdUsed) then |
16f389fcd462
Prevent saving of demo after /lua command was used
Wuzzy <Wuzzy2@mail.ru>
parents:
14917
diff
changeset
|
88 |
SendIPC(_S'm'); |
7068 | 89 |
SendIPC(_S'H'); |
4746
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
90 |
GameState:= gsExit |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
91 |
end; |
3ae448aebe7e
implemented actions for closing/enging program (needs testing over the net)
koda
parents:
4744
diff
changeset
|
92 |
|
4413 | 93 |
procedure chCheckProto(var s: shortstring); |
8370 | 94 |
var i: LongInt; |
4413 | 95 |
begin |
6001 | 96 |
if isDeveloperMode then |
97 |
begin |
|
8370 | 98 |
i:= StrToInt(s); |
11532 | 99 |
checkFails(i <= cNetProtoVersion, 'Protocol version mismatch: engine is too old (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true); |
100 |
checkFails(i >= cNetProtoVersion, 'Protocol version mismatch: engine is too new (got '+intToStr(i)+', expecting '+intToStr(cNetProtoVersion)+')', true); |
|
7058 | 101 |
end |
4413 | 102 |
end; |
103 |
||
104 |
procedure chTeamLocal(var s: shortstring); |
|
105 |
begin |
|
106 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
107 |
if not isDeveloperMode then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
108 |
exit; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
109 |
if CurrentTeam = nil then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
110 |
OutError(errmsgIncorrectUse + ' "/rdriven"', true); |
4413 | 111 |
CurrentTeam^.ExtDriven:= true |
112 |
end; |
|
113 |
||
114 |
procedure chScript(var s: shortstring); |
|
115 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
116 |
if s[1]='"' then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
117 |
Delete(s, 1, 1); |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
118 |
if s[byte(s[0])]='"' then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
119 |
Delete(s, byte(s[0]), 1); |
6254
e90fb60cb46d
Force a desync if there is a script name mismatch. This avoids playing until the game desyncs due to script differences.
nemo
parents:
6245
diff
changeset
|
120 |
cScriptName:= s; |
13723
61095cb5f58a
Critical error if loading a script has failed
Wuzzy <Wuzzy2@mail.ru>
parents:
13642
diff
changeset
|
121 |
ScriptLoad(s, true) |
4413 | 122 |
end; |
123 |
||
9902 | 124 |
procedure chScriptParam(var s: shortstring); |
125 |
begin |
|
9985
42cd42e44c9a
GravRacer, GravHigh, GravMutant, Grav... uhm... shoppamap? Easy! Gravity script could be combined with any other script now.
unc0rr
parents:
9902
diff
changeset
|
126 |
ScriptSetString('ScriptParam', s); |
42cd42e44c9a
GravRacer, GravHigh, GravMutant, Grav... uhm... shoppamap? Easy! Gravity script could be combined with any other script now.
unc0rr
parents:
9902
diff
changeset
|
127 |
ScriptCall('onParameters'); |
9902 | 128 |
end; |
129 |
||
4413 | 130 |
procedure chCurU_p(var s: shortstring); |
131 |
begin |
|
132 |
s:= s; // avoid compiler hint |
|
14917
63357ed39886
Precise + camera movement keys = move camera at slower
Wuzzy <Wuzzy2@mail.ru>
parents:
14916
diff
changeset
|
133 |
updateCursorMovementDelta((LocalMessage and gmPrecise) <> 0, -1, CursorMovementY); |
4413 | 134 |
end; |
135 |
||
136 |
procedure chCurU_m(var s: shortstring); |
|
137 |
begin |
|
138 |
s:= s; // avoid compiler hint |
|
13778
2e8b3081cf80
Only reset CursorMovement to 0 if command "-cur_*" is called with appropriate direction
Wuzzy <Wuzzy2@mail.ru>
parents:
13723
diff
changeset
|
139 |
if CursorMovementY < 0 then |
14917
63357ed39886
Precise + camera movement keys = move camera at slower
Wuzzy <Wuzzy2@mail.ru>
parents:
14916
diff
changeset
|
140 |
updateCursorMovementDelta((LocalMessage and gmPrecise) <> 0, 0, CursorMovementY); |
4413 | 141 |
end; |
142 |
||
143 |
procedure chCurD_p(var s: shortstring); |
|
144 |
begin |
|
145 |
s:= s; // avoid compiler hint |
|
14917
63357ed39886
Precise + camera movement keys = move camera at slower
Wuzzy <Wuzzy2@mail.ru>
parents:
14916
diff
changeset
|
146 |
updateCursorMovementDelta((LocalMessage and gmPrecise) <> 0, 1, CursorMovementY); |
4413 | 147 |
end; |
148 |
||
149 |
procedure chCurD_m(var s: shortstring); |
|
150 |
begin |
|
151 |
s:= s; // avoid compiler hint |
|
13778
2e8b3081cf80
Only reset CursorMovement to 0 if command "-cur_*" is called with appropriate direction
Wuzzy <Wuzzy2@mail.ru>
parents:
13723
diff
changeset
|
152 |
if CursorMovementY > 0 then |
14917
63357ed39886
Precise + camera movement keys = move camera at slower
Wuzzy <Wuzzy2@mail.ru>
parents:
14916
diff
changeset
|
153 |
updateCursorMovementDelta((LocalMessage and gmPrecise) <> 0, 0, CursorMovementY); |
4413 | 154 |
end; |
155 |
||
156 |
procedure chCurL_p(var s: shortstring); |
|
157 |
begin |
|
158 |
s:= s; // avoid compiler hint |
|
14917
63357ed39886
Precise + camera movement keys = move camera at slower
Wuzzy <Wuzzy2@mail.ru>
parents:
14916
diff
changeset
|
159 |
updateCursorMovementDelta((LocalMessage and gmPrecise) <> 0, -1, CursorMovementX); |
4413 | 160 |
end; |
161 |
||
162 |
procedure chCurL_m(var s: shortstring); |
|
163 |
begin |
|
164 |
s:= s; // avoid compiler hint |
|
13778
2e8b3081cf80
Only reset CursorMovement to 0 if command "-cur_*" is called with appropriate direction
Wuzzy <Wuzzy2@mail.ru>
parents:
13723
diff
changeset
|
165 |
if CursorMovementX < 0 then |
14917
63357ed39886
Precise + camera movement keys = move camera at slower
Wuzzy <Wuzzy2@mail.ru>
parents:
14916
diff
changeset
|
166 |
updateCursorMovementDelta((LocalMessage and gmPrecise) <> 0, 0, CursorMovementX); |
4413 | 167 |
end; |
168 |
||
169 |
procedure chCurR_p(var s: shortstring); |
|
170 |
begin |
|
171 |
s:= s; // avoid compiler hint |
|
14917
63357ed39886
Precise + camera movement keys = move camera at slower
Wuzzy <Wuzzy2@mail.ru>
parents:
14916
diff
changeset
|
172 |
updateCursorMovementDelta((LocalMessage and gmPrecise) <> 0, 1, CursorMovementX); |
4413 | 173 |
end; |
174 |
||
175 |
procedure chCurR_m(var s: shortstring); |
|
176 |
begin |
|
177 |
s:= s; // avoid compiler hint |
|
13778
2e8b3081cf80
Only reset CursorMovement to 0 if command "-cur_*" is called with appropriate direction
Wuzzy <Wuzzy2@mail.ru>
parents:
13723
diff
changeset
|
178 |
if CursorMovementX > 0 then |
14917
63357ed39886
Precise + camera movement keys = move camera at slower
Wuzzy <Wuzzy2@mail.ru>
parents:
14916
diff
changeset
|
179 |
updateCursorMovementDelta((LocalMessage and gmPrecise) <> 0, 0, CursorMovementX); |
4413 | 180 |
end; |
181 |
||
182 |
procedure chLeft_p(var s: shortstring); |
|
183 |
begin |
|
184 |
s:= s; // avoid compiler hint |
|
10392 | 185 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
186 |
exit; |
7805 | 187 |
if not isExternalSource then |
7068 | 188 |
SendIPC(_S'L'); |
4413 | 189 |
bShowFinger:= false; |
190 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
191 |
Message:= Message or (gmLeft and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
192 |
ScriptCall('onLeft'); |
4413 | 193 |
end; |
194 |
||
195 |
procedure chLeft_m(var s: shortstring); |
|
196 |
begin |
|
197 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
198 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
199 |
exit; |
7805 | 200 |
if not isExternalSource then |
7068 | 201 |
SendIPC(_S'l'); |
4413 | 202 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
203 |
Message:= Message and (not (gmLeft and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
204 |
ScriptCall('onLeftUp'); |
4413 | 205 |
end; |
206 |
||
207 |
procedure chRight_p(var s: shortstring); |
|
208 |
begin |
|
209 |
s:= s; // avoid compiler hint |
|
10392 | 210 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
211 |
exit; |
7805 | 212 |
if not isExternalSource then |
7068 | 213 |
SendIPC(_S'R'); |
4413 | 214 |
bShowFinger:= false; |
215 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
216 |
Message:= Message or (gmRight and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
217 |
ScriptCall('onRight'); |
4413 | 218 |
end; |
219 |
||
220 |
procedure chRight_m(var s: shortstring); |
|
221 |
begin |
|
222 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
223 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
224 |
exit; |
7805 | 225 |
if not isExternalSource then |
7068 | 226 |
SendIPC(_S'r'); |
4413 | 227 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
228 |
Message:= Message and (not (gmRight and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
229 |
ScriptCall('onRightUp'); |
4413 | 230 |
end; |
231 |
||
232 |
procedure chUp_p(var s: shortstring); |
|
233 |
begin |
|
234 |
s:= s; // avoid compiler hint |
|
10392 | 235 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
236 |
exit; |
7805 | 237 |
if not isExternalSource then |
7068 | 238 |
SendIPC(_S'U'); |
4413 | 239 |
bShowFinger:= false; |
240 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
241 |
Message:= Message or (gmUp and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
242 |
ScriptCall('onUp'); |
4413 | 243 |
end; |
244 |
||
245 |
procedure chUp_m(var s: shortstring); |
|
246 |
begin |
|
247 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
248 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
249 |
exit; |
7805 | 250 |
if not isExternalSource then |
7068 | 251 |
SendIPC(_S'u'); |
4413 | 252 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
253 |
Message:= Message and (not (gmUp and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
254 |
ScriptCall('onUpUp'); |
4413 | 255 |
end; |
256 |
||
257 |
procedure chDown_p(var s: shortstring); |
|
258 |
begin |
|
259 |
s:= s; // avoid compiler hint |
|
10392 | 260 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
261 |
exit; |
7805 | 262 |
if not isExternalSource then |
7068 | 263 |
SendIPC(_S'D'); |
4413 | 264 |
bShowFinger:= false; |
265 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
266 |
Message:= Message or (gmDown and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
267 |
ScriptCall('onDown'); |
4413 | 268 |
end; |
269 |
||
270 |
procedure chDown_m(var s: shortstring); |
|
271 |
begin |
|
272 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
273 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
274 |
exit; |
7805 | 275 |
if not isExternalSource then |
7068 | 276 |
SendIPC(_S'd'); |
4413 | 277 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
278 |
Message:= Message and (not (gmDown and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
279 |
ScriptCall('onDownUp'); |
4413 | 280 |
end; |
281 |
||
282 |
procedure chPrecise_p(var s: shortstring); |
|
283 |
begin |
|
284 |
s:= s; // avoid compiler hint |
|
10392 | 285 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
286 |
exit; |
7805 | 287 |
if not isExternalSource then |
7068 | 288 |
SendIPC(_S'Z'); |
4413 | 289 |
bShowFinger:= false; |
290 |
with CurrentHedgehog^.Gear^ do |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
291 |
Message:= Message or (gmPrecise and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
292 |
ScriptCall('onPrecise'); |
4413 | 293 |
end; |
294 |
||
295 |
procedure chPrecise_m(var s: shortstring); |
|
296 |
begin |
|
297 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
298 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
299 |
exit; |
7805 | 300 |
if not isExternalSource then |
7068 | 301 |
SendIPC(_S'z'); |
4413 | 302 |
with CurrentHedgehog^.Gear^ do |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
303 |
Message:= Message and (not (gmPrecise and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
304 |
ScriptCall('onPreciseUp'); |
4413 | 305 |
end; |
306 |
||
307 |
procedure chLJump(var s: shortstring); |
|
308 |
begin |
|
309 |
s:= s; // avoid compiler hint |
|
10392 | 310 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
311 |
exit; |
7805 | 312 |
if not isExternalSource then |
7068 | 313 |
SendIPC(_S'j'); |
4413 | 314 |
bShowFinger:= false; |
315 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
316 |
Message:= Message or (gmLJump and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
317 |
ScriptCall('onLJump'); |
4413 | 318 |
end; |
319 |
||
320 |
procedure chHJump(var s: shortstring); |
|
321 |
begin |
|
322 |
s:= s; // avoid compiler hint |
|
10392 | 323 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
324 |
exit; |
7805 | 325 |
if not isExternalSource then |
7068 | 326 |
SendIPC(_S'J'); |
4413 | 327 |
bShowFinger:= false; |
328 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
329 |
Message:= Message or (gmHJump and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
330 |
ScriptCall('onHJump'); |
4413 | 331 |
end; |
332 |
||
333 |
procedure chAttack_p(var s: shortstring); |
|
10672 | 334 |
var inbtwnTrgtAttks: Boolean; |
4413 | 335 |
begin |
336 |
s:= s; // avoid compiler hint |
|
10392 | 337 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
338 |
exit; |
4413 | 339 |
bShowFinger:= false; |
340 |
with CurrentHedgehog^.Gear^ do |
|
341 |
begin |
|
4900 | 342 |
AddFileLog('/+attack: hedgehog''s Gear^.State = '+inttostr(State)); |
4413 | 343 |
if ((State and gstHHDriven) <> 0) then |
344 |
begin |
|
10672 | 345 |
inbtwnTrgtAttks:= ((GameFlags and gfInfAttack) <> 0) and ((Ammoz[CurrentHedgehog^.CurAmmoType].Ammo.Propz and ammoprop_NeedTarget) <> 0); |
346 |
if (not inbtwnTrgtAttks) then |
|
347 |
FollowGear:= CurrentHedgehog^.Gear; |
|
7805 | 348 |
if not isExternalSource then |
7068 | 349 |
SendIPC(_S'A'); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
350 |
Message:= Message or (gmAttack and InputMask); |
10228 | 351 |
ScriptCall('onAttack'); // so if I fire airstrike, it doesn't count as attack? fine, fine |
4413 | 352 |
end |
353 |
end |
|
354 |
end; |
|
355 |
||
356 |
procedure chAttack_m(var s: shortstring); |
|
357 |
begin |
|
358 |
s:= s; // avoid compiler hint |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
359 |
if CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
360 |
exit; |
4413 | 361 |
with CurrentHedgehog^.Gear^ do |
362 |
begin |
|
7805 | 363 |
if not isExternalSource and |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
364 |
((Message and gmAttack) <> 0) then |
7068 | 365 |
SendIPC(_S'a'); |
6453
11c578d30bd3
Countless imporvements to the parser and countless help to the parser in sources.
unc0rr
parents:
6415
diff
changeset
|
366 |
Message:= Message and (not (gmAttack and InputMask)); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
367 |
ScriptCall('onAttackUp'); |
4413 | 368 |
end |
369 |
end; |
|
370 |
||
371 |
procedure chSwitch(var s: shortstring); |
|
372 |
begin |
|
373 |
s:= s; // avoid compiler hint |
|
10392 | 374 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
375 |
exit; |
7805 | 376 |
if not isExternalSource then |
7068 | 377 |
SendIPC(_S'S'); |
4413 | 378 |
bShowFinger:= false; |
379 |
with CurrentHedgehog^.Gear^ do |
|
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
380 |
Message:= Message or (gmSwitch and InputMask); |
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
381 |
ScriptCall('onSwitch'); |
4413 | 382 |
end; |
383 |
||
384 |
procedure chNextTurn(var s: shortstring); |
|
7671 | 385 |
var gi: PGear; |
4413 | 386 |
begin |
387 |
s:= s; // avoid compiler hint |
|
7103 | 388 |
|
11532 | 389 |
if checkFails(AllInactive, '/nextturn called when not all gears are inactive', true) then exit; |
4413 | 390 |
|
7389
15c3fb4882df
Sorry about the slight delay in pickup. You can blame a few lame cheaters. This is to make their cheating a bit harder.
nemo
parents:
7218
diff
changeset
|
391 |
CheckSum:= CheckSum xor GameTicks; |
7104 | 392 |
gi := GearsList; |
393 |
while gi <> nil do |
|
394 |
begin |
|
9797
1fdc1507e42d
remove state from check, just to see if this was why we just desynced
nemo
parents:
9796
diff
changeset
|
395 |
with gi^ do CheckSum:= CheckSum xor X.round xor X.frac xor dX.round xor dX.frac xor Y.round xor Y.frac xor dY.round xor dY.frac; |
7389
15c3fb4882df
Sorry about the slight delay in pickup. You can blame a few lame cheaters. This is to make their cheating a bit harder.
nemo
parents:
7218
diff
changeset
|
396 |
AddRandomness(CheckSum); |
7104 | 397 |
gi := gi^.NextGear |
398 |
end; |
|
7103 | 399 |
|
7805 | 400 |
if not isExternalSource then |
7103 | 401 |
begin |
402 |
s[0]:= #5; |
|
403 |
s[1]:= 'N'; |
|
7389
15c3fb4882df
Sorry about the slight delay in pickup. You can blame a few lame cheaters. This is to make their cheating a bit harder.
nemo
parents:
7218
diff
changeset
|
404 |
SDLNet_Write32(CheckSum, @s[2]); |
7103 | 405 |
SendIPC(s) |
406 |
end |
|
407 |
else |
|
11532 | 408 |
checkFails(CurrentTeam^.hasGone or (CheckSum = lastTurnChecksum), 'Desync detected', true); |
7831 | 409 |
|
7187
aff30d80bd7b
- Allow camera movement while current hedgehog is falling
unc0rr
parents:
7151
diff
changeset
|
410 |
AddFileLog('Next turn: time '+inttostr(GameTicks)); |
4413 | 411 |
end; |
412 |
||
413 |
procedure chTimer(var s: shortstring); |
|
414 |
begin |
|
7790 | 415 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
416 |
exit; |
4413 | 417 |
|
11532 | 418 |
if checkFails((s[0] = #1) and (s[1] >= '1') and (s[1] <= '5'), 'Malformed /timer', true) then exit; |
7790 | 419 |
|
7805 | 420 |
if not isExternalSource then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
421 |
SendIPC(s); |
4413 | 422 |
bShowFinger:= false; |
423 |
with CurrentHedgehog^.Gear^ do |
|
424 |
begin |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
425 |
Message:= Message or (gmTimer and InputMask); |
4661
f5d858e4b634
Whole ton of script callbacks on commands. Poor engine.
mikade
parents:
4611
diff
changeset
|
426 |
MsgParam:= byte(s[1]) - ord('0'); |
6818
136aa9c8c593
Add the parameters I missed the first time when I added these hooks.
mikade
parents:
6700
diff
changeset
|
427 |
ScriptCall('onTimer', MsgParam); |
4413 | 428 |
end |
429 |
end; |
|
430 |
||
13533
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
431 |
// Increment timer or bounciness |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
432 |
procedure chTimerU(var s: shortstring); |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
433 |
var t: LongWord; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
434 |
tb: Byte; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
435 |
begin |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
436 |
s:= s; // avoid compiler hint |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
437 |
if CheckNoTeamOrHH then |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
438 |
exit; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
439 |
// We grab the current timer first so we can increment it |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
440 |
if (CurrentHedgehog^.Gear^.Message and gmPrecise) = 0 then |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
441 |
t:= HHGetTimerMsg(CurrentHedgehog^.Gear) |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
442 |
else |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
443 |
// Use bounciness if Precise is pressed |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
444 |
t:= HHGetBouncinessMsg(CurrentHedgehog^.Gear); |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
445 |
if t <> MSGPARAM_INVALID then |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
446 |
begin |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
447 |
// Calculate new timer |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
448 |
Inc(t); |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
449 |
if t > 5 then |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
450 |
t:= 1; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
451 |
tb:= t mod 255; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
452 |
// Delegate the actual change to /timer |
13883 | 453 |
ParseCommand('timer ' + Char(tb + Ord('0')), true); |
13533
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
454 |
end; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
455 |
end; |
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
456 |
|
4413 | 457 |
procedure chSlot(var s: shortstring); |
458 |
var slot: LongWord; |
|
7068 | 459 |
ss: shortstring; |
4413 | 460 |
begin |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
461 |
if (s[0] <> #1) or CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
462 |
exit; |
4413 | 463 |
slot:= byte(s[1]) - 49; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
464 |
if slot > cMaxSlotIndex then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
465 |
exit; |
7805 | 466 |
if not isExternalSource then |
7068 | 467 |
begin |
468 |
ss[0]:= #1; |
|
469 |
ss[1]:= char(byte(s[1]) + 79); |
|
470 |
SendIPC(ss); |
|
471 |
end; |
|
4413 | 472 |
bShowFinger:= false; |
473 |
with CurrentHedgehog^.Gear^ do |
|
474 |
begin |
|
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
475 |
Message:= Message or (gmSlot and InputMask); |
8924 | 476 |
MsgParam:= slot; |
6818
136aa9c8c593
Add the parameters I missed the first time when I added these hooks.
mikade
parents:
6700
diff
changeset
|
477 |
ScriptCall('onSlot', MsgParam); |
4413 | 478 |
end |
479 |
end; |
|
480 |
||
481 |
procedure chSetWeapon(var s: shortstring); |
|
482 |
begin |
|
7790 | 483 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
484 |
exit; |
4413 | 485 |
|
14551
ec0afe1c6024
Add control (default: X) to unselect current weapon
Wuzzy <Wuzzy2@mail.ru>
parents:
14543
diff
changeset
|
486 |
(* Use "~" (ASCII character 126) as synonym for NUL byte (=amNothing). |
ec0afe1c6024
Add control (default: X) to unselect current weapon
Wuzzy <Wuzzy2@mail.ru>
parents:
14543
diff
changeset
|
487 |
This is done to allow to add "setweap ~" in QTfrontend/binds.cpp because |
ec0afe1c6024
Add control (default: X) to unselect current weapon
Wuzzy <Wuzzy2@mail.ru>
parents:
14543
diff
changeset
|
488 |
the NUL byte would terminate the strings in C++ otherwise. *) |
ec0afe1c6024
Add control (default: X) to unselect current weapon
Wuzzy <Wuzzy2@mail.ru>
parents:
14543
diff
changeset
|
489 |
if (s[1] = '~') then |
ec0afe1c6024
Add control (default: X) to unselect current weapon
Wuzzy <Wuzzy2@mail.ru>
parents:
14543
diff
changeset
|
490 |
s[1]:= #0; |
11532 | 491 |
if checkFails((s[0] = #1) and (s[1] <= char(High(TAmmoType))), 'Malformed /setweap', true) then exit; |
4413 | 492 |
|
7805 | 493 |
if not isExternalSource then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
494 |
SendIPC('w' + s); |
4413 | 495 |
|
496 |
with CurrentHedgehog^.Gear^ do |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
497 |
begin |
4522
0f590eefd531
Add an input mask for setting of gear messages. Intended for intercepting user messages. This is totally untested. I don't think it should desync but seriously needs a lot of testing. Esp the doPut behaviour.
nemo
parents:
4437
diff
changeset
|
498 |
Message:= Message or (gmWeapon and InputMask); |
4413 | 499 |
MsgParam:= byte(s[1]); |
6818
136aa9c8c593
Add the parameters I missed the first time when I added these hooks.
mikade
parents:
6700
diff
changeset
|
500 |
ScriptCall('onSetWeapon', MsgParam); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
501 |
end; |
4413 | 502 |
end; |
503 |
||
504 |
procedure chTaunt(var s: shortstring); |
|
505 |
begin |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
506 |
if (s[0] <> #1) or CheckNoTeamOrHH then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
507 |
exit; |
4413 | 508 |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
509 |
if TWave(s[1]) > High(TWave) then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
510 |
exit; |
4413 | 511 |
|
7805 | 512 |
if not isExternalSource then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
513 |
SendIPC('t' + s); |
4413 | 514 |
|
12815
92218a06c9ff
Don't send taunt message for automatically happening taunt animation
unc0rr
parents:
12490
diff
changeset
|
515 |
PlayTaunt(byte(s[1])) |
4413 | 516 |
end; |
517 |
||
518 |
procedure chPut(var s: shortstring); |
|
519 |
begin |
|
520 |
s:= s; // avoid compiler hint |
|
521 |
doPut(0, 0, false); |
|
522 |
end; |
|
523 |
||
524 |
procedure chCapture(var s: shortstring); |
|
525 |
begin |
|
526 |
s:= s; // avoid compiler hint |
|
10633
2f062fac5791
Add that "make screenshots of Land/LandPixels" thing for map creators
nemo
parents:
10603
diff
changeset
|
527 |
flagMakeCapture:= true; |
11025
999afa63035f
just disable landpixels w/ blurry land instead. the mask can be helpful for debugging at least.
nemo
parents:
11024
diff
changeset
|
528 |
flagDumpLand:= (LocalMessage and gmPrecise <> 0); |
4413 | 529 |
end; |
530 |
||
7629 | 531 |
procedure chRecord(var s: shortstring); |
532 |
begin |
|
533 |
s:= s; // avoid compiler hint |
|
534 |
{$IFDEF USE_VIDEO_RECORDING} |
|
535 |
if flagPrerecording then |
|
536 |
StopPreRecording() |
|
537 |
else |
|
538 |
BeginPreRecording(); |
|
539 |
{$ENDIF} |
|
540 |
end; |
|
541 |
||
4413 | 542 |
procedure chSetMap(var s: shortstring); |
543 |
begin |
|
5679
505c6448069b
accidentally reverted this when reverting the rest of the override changes.
nemo
parents:
5555
diff
changeset
|
544 |
if isDeveloperMode then |
6088 | 545 |
begin |
6339 | 546 |
if s = '' then |
8025 | 547 |
cPathz[ptMapCurrent]:= s |
6339 | 548 |
else |
8025 | 549 |
cPathz[ptMapCurrent]:= cPathz[ptMaps] + '/' + s; |
6088 | 550 |
InitStepsFlags:= InitStepsFlags or cifMap |
551 |
end; |
|
6828
6a5d33bff0b0
At mikade's request. give scripting access to the map name prior to override.
nemo
parents:
6818
diff
changeset
|
552 |
cMapName:= s; |
13723
61095cb5f58a
Critical error if loading a script has failed
Wuzzy <Wuzzy2@mail.ru>
parents:
13642
diff
changeset
|
553 |
ScriptLoad('Maps/' + s + '/map.lua', false) |
4413 | 554 |
end; |
555 |
||
556 |
procedure chSetTheme(var s: shortstring); |
|
557 |
begin |
|
558 |
if isDeveloperMode then |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
559 |
begin |
8025 | 560 |
cPathz[ptCurrTheme]:= cPathz[ptThemes] + '/' + s; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
561 |
Theme:= s; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
562 |
InitStepsFlags:= InitStepsFlags or cifTheme |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
563 |
end |
4413 | 564 |
end; |
565 |
||
566 |
procedure chSetSeed(var s: shortstring); |
|
567 |
begin |
|
568 |
if isDeveloperMode then |
|
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
569 |
begin |
8912 | 570 |
SetRandomSeed(s, true); |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
571 |
cSeed:= s; |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
572 |
InitStepsFlags:= InitStepsFlags or cifRandomize |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
573 |
end |
12847
1aba77b2e4ac
This is a desyncing change. But... We might need a new release anyway. ☹
nemo
parents:
12815
diff
changeset
|
574 |
end; |
4413 | 575 |
|
576 |
procedure chAmmoMenu(var s: shortstring); |
|
577 |
begin |
|
578 |
s:= s; // avoid compiler hint |
|
579 |
if CheckNoTeamOrHH then |
|
10439
7de934f2247c
allow toggling ammo menu while NoTeamOrHH, as suggested by unC0Rr
sheepluva
parents:
10392
diff
changeset
|
580 |
bShowAmmoMenu:= (not bShowAmmoMenu) |
4413 | 581 |
else |
582 |
begin |
|
583 |
with CurrentTeam^ do |
|
584 |
with Hedgehogs[CurrHedgehog] do |
|
585 |
begin |
|
586 |
bSelected:= false; |
|
587 |
||
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
588 |
if bShowAmmoMenu then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
589 |
bShowAmmoMenu:= false |
15929
128ace913837
Introduce hwengine-future library, use Land allocated in it
unC0Rr
parents:
15897
diff
changeset
|
590 |
else if ((Gear = nil) or ((Gear^.State and (gstAttacking or gstAttacked)) <> 0) |
7946
a99a79bbd857
Simplify ammo menu conditions so it shows up in more states. Should fix issue #465. The part w/ sliding in uworld is main #465 problem.
nemo
parents:
7831
diff
changeset
|
591 |
or ((Gear^.State and gstHHDriven) = 0)) then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
592 |
begin |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
593 |
end |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
594 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
595 |
bShowAmmoMenu:= true |
4413 | 596 |
end; |
597 |
end |
|
598 |
end; |
|
599 |
||
14702
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
600 |
procedure chVolUp_p(var s: shortstring); |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
601 |
begin |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
602 |
s:= s; // avoid compiler hint |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
603 |
cVolumeUpKey:= true; |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
604 |
updateVolumeDelta((LocalMessage and gmPrecise) <> 0); |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
605 |
end; |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
606 |
|
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
607 |
procedure chVolUp_m(var s: shortstring); |
4413 | 608 |
begin |
609 |
s:= s; // avoid compiler hint |
|
14702
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
610 |
cVolumeUpKey:= false; |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
611 |
updateVolumeDelta((LocalMessage and gmPrecise) <> 0); |
4413 | 612 |
end; |
613 |
||
14702
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
614 |
procedure chVolDown_p(var s: shortstring); |
4413 | 615 |
begin |
616 |
s:= s; // avoid compiler hint |
|
14702
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
617 |
cVolumeDownKey:= true; |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
618 |
updateVolumeDelta((LocalMessage and gmPrecise) <> 0); |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
619 |
end; |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
620 |
|
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
621 |
procedure chVolDown_m(var s: shortstring); |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
622 |
begin |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
623 |
s:= s; // avoid compiler hint |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
624 |
cVolumeDownKey:= false; |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
625 |
updateVolumeDelta((LocalMessage and gmPrecise) <> 0); |
4413 | 626 |
end; |
627 |
||
13039
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13013
diff
changeset
|
628 |
procedure chMute(var s: shortstring); |
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13013
diff
changeset
|
629 |
begin |
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13013
diff
changeset
|
630 |
s:= s; // avoid compiler hint |
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13013
diff
changeset
|
631 |
cMuteToggle:= true; |
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13013
diff
changeset
|
632 |
end; |
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13013
diff
changeset
|
633 |
|
4413 | 634 |
procedure chFindhh(var s: shortstring); |
635 |
begin |
|
636 |
s:= s; // avoid compiler hint |
|
10392 | 637 |
if CheckNoTeamOrHH then |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
638 |
exit; |
5247 | 639 |
|
7629 | 640 |
if autoCameraOn then |
5247 | 641 |
begin |
7629 | 642 |
FollowGear:= nil; |
13642
3d14950641a4
Refactor text color variable names, export 2 color values to Lua
Wuzzy <Wuzzy2@mail.ru>
parents:
13641
diff
changeset
|
643 |
AddCaption(trmsg[sidAutoCameraOff], capcolSetting, capgrpVolume); |
5247 | 644 |
autoCameraOn:= false |
645 |
end |
|
7629 | 646 |
else |
647 |
begin |
|
13642
3d14950641a4
Refactor text color variable names, export 2 color values to Lua
Wuzzy <Wuzzy2@mail.ru>
parents:
13641
diff
changeset
|
648 |
AddCaption(trmsg[sidAutoCameraOn], capcolSetting, capgrpVolume); |
5247 | 649 |
bShowFinger:= true; |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
650 |
if not CurrentHedgehog^.Unplaced then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6453
diff
changeset
|
651 |
FollowGear:= CurrentHedgehog^.Gear; |
5247 | 652 |
autoCameraOn:= true |
653 |
end |
|
4413 | 654 |
end; |
655 |
||
656 |
procedure chPause(var s: shortstring); |
|
657 |
begin |
|
10392 | 658 |
if (gameType <> gmtNet) or (s = 'server') then |
9670
1954f692e8c6
Quick and simple implementation of afk mode (toggled by /pause)
unc0rr
parents:
9489
diff
changeset
|
659 |
isPaused:= not isPaused |
1954f692e8c6
Quick and simple implementation of afk mode (toggled by /pause)
unc0rr
parents:
9489
diff
changeset
|
660 |
else |
9671 | 661 |
if (CurrentTeam^.ExtDriven) or (CurrentHedgehog^.BotLevel > 0) then |
662 |
isAFK:= not isAFK |
|
663 |
else |
|
664 |
isAFK:= false; // for real ninjas |
|
5524
40b7f95d9f18
Oh, and fix cursor visibility correlations between gsConfirm state and paused state
unc0rr
parents:
5523
diff
changeset
|
665 |
|
10392 | 666 |
updateCursorVisibility; |
4413 | 667 |
end; |
668 |
||
669 |
procedure chRotateMask(var s: shortstring); |
|
670 |
begin |
|
671 |
s:= s; // avoid compiler hint |
|
12490
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12488
diff
changeset
|
672 |
// this is just for me, 'cause I thought it'd be fun. using the old precise + switch to keep it out of people's way |
9693 | 673 |
if LocalMessage and (gmPrecise or gmSwitch) = (gmPrecise or gmSwitch) then |
674 |
begin |
|
675 |
if UIDisplay <> uiNone then |
|
676 |
UIDisplay:= uiNone |
|
677 |
else UIDisplay:= uiAll |
|
678 |
end |
|
12490
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12488
diff
changeset
|
679 |
else |
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12488
diff
changeset
|
680 |
begin |
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12488
diff
changeset
|
681 |
if UIDisplay <> uiNoTeams then |
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12488
diff
changeset
|
682 |
UIDisplay:= uiNoTeams |
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12488
diff
changeset
|
683 |
else UIDisplay:= uiAll |
b4eb289b5913
Backed out changeset c19e5ece5b3f
Wuzzy <almikes@aol.com>
parents:
12488
diff
changeset
|
684 |
end |
4413 | 685 |
end; |
686 |
||
12997
f06660523198
Add separate control for changing hedgehog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12990
diff
changeset
|
687 |
procedure chRotateTags(var s: shortstring); |
f06660523198
Add separate control for changing hedgehog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12990
diff
changeset
|
688 |
begin |
f06660523198
Add separate control for changing hedgehog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12990
diff
changeset
|
689 |
s:= s; // avoid compiler hint |
13000
c5529aabdda9
Flip Switch/Precise key combintions with change hog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12999
diff
changeset
|
690 |
// Rotate Tags key + Switch: Toggle translucency only |
c5529aabdda9
Flip Switch/Precise key combintions with change hog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12999
diff
changeset
|
691 |
if LocalMessage and gmSwitch = gmSwitch then |
12998
22e032ab1cb7
Toggle hog tag translucency with Precise + Change hog tags key
Wuzzy <Wuzzy2@mail.ru>
parents:
12997
diff
changeset
|
692 |
if ((cTagsMask and htTransparent) = 0) then |
13001
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13000
diff
changeset
|
693 |
begin |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13000
diff
changeset
|
694 |
cTagsMask:= cTagsMask or htTransparent; |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13000
diff
changeset
|
695 |
cPrevTagsMask:= cPrevTagsMask or htTransparent |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13000
diff
changeset
|
696 |
end |
12998
22e032ab1cb7
Toggle hog tag translucency with Precise + Change hog tags key
Wuzzy <Wuzzy2@mail.ru>
parents:
12997
diff
changeset
|
697 |
else |
13001
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13000
diff
changeset
|
698 |
begin |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13000
diff
changeset
|
699 |
cTagsMask:= cTagsMask and (not htTransparent); |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13000
diff
changeset
|
700 |
cPrevTagsMask:= cPrevTagsMask and (not htTransparent) |
876b1ef83191
Fix some consistency issues with change hog tags control
Wuzzy <Wuzzy2@mail.ru>
parents:
13000
diff
changeset
|
701 |
end |
13007
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13001
diff
changeset
|
702 |
// Rotate Tags key + Precise: Cycle through hog tags (keeping translucency) |
13000
c5529aabdda9
Flip Switch/Precise key combintions with change hog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12999
diff
changeset
|
703 |
else if LocalMessage and gmPrecise = gmPrecise then |
13007
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13001
diff
changeset
|
704 |
begin |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13001
diff
changeset
|
705 |
cPrevTagsMask:= cTagsMask; |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13001
diff
changeset
|
706 |
if ((GameFlags and gfInvulnerable) = 0) then |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13001
diff
changeset
|
707 |
cTagsMask:= cTagsMasks[cTagsMask] |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13001
diff
changeset
|
708 |
else |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13001
diff
changeset
|
709 |
cTagsMask:= cTagsMasksNoHealth[cTagsMask] |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13001
diff
changeset
|
710 |
end |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13001
diff
changeset
|
711 |
// Rotate Tags key only: Toggle all hog tags on and off |
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13001
diff
changeset
|
712 |
else |
12999
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12998
diff
changeset
|
713 |
if ((cTagsMask and (htTeamName or htName or htHealth)) = 0) then |
13013
4234a18a082c
Fix hittig precise+rottags the first time when all tags started off showing health tag in gfInvulnerable
Wuzzy <Wuzzy2@mail.ru>
parents:
13007
diff
changeset
|
714 |
begin |
4234a18a082c
Fix hittig precise+rottags the first time when all tags started off showing health tag in gfInvulnerable
Wuzzy <Wuzzy2@mail.ru>
parents:
13007
diff
changeset
|
715 |
cTagsMask:= cPrevTagsMask; |
4234a18a082c
Fix hittig precise+rottags the first time when all tags started off showing health tag in gfInvulnerable
Wuzzy <Wuzzy2@mail.ru>
parents:
13007
diff
changeset
|
716 |
if ((GameFlags and gfInvulnerable) <> 0) then |
4234a18a082c
Fix hittig precise+rottags the first time when all tags started off showing health tag in gfInvulnerable
Wuzzy <Wuzzy2@mail.ru>
parents:
13007
diff
changeset
|
717 |
cTagsMask:= cTagsMask and (not htHealth); |
4234a18a082c
Fix hittig precise+rottags the first time when all tags started off showing health tag in gfInvulnerable
Wuzzy <Wuzzy2@mail.ru>
parents:
13007
diff
changeset
|
718 |
end |
12999
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12998
diff
changeset
|
719 |
else |
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12998
diff
changeset
|
720 |
begin |
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12998
diff
changeset
|
721 |
cPrevTagsMask:= cTagsMask; |
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12998
diff
changeset
|
722 |
cTagsMask:= cTagsMask and (not (htTeamName or htName or htHealth)) |
13007
8a8aaaf97a95
The rottags key alone now toggles hog tags; preecise+rottags is used to cycle tags
Wuzzy <Wuzzy2@mail.ru>
parents:
13001
diff
changeset
|
723 |
end; |
12999
46ba3285449a
Switch + Change hog tags now turns on and off all tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12998
diff
changeset
|
724 |
end; |
12997
f06660523198
Add separate control for changing hedgehog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12990
diff
changeset
|
725 |
|
4413 | 726 |
procedure chSpeedup_p(var s: shortstring); |
727 |
begin |
|
728 |
s:= s; // avoid compiler hint |
|
7629 | 729 |
SpeedStart:= RealTicks; |
4413 | 730 |
isSpeed:= true |
731 |
end; |
|
732 |
||
733 |
procedure chSpeedup_m(var s: shortstring); |
|
734 |
begin |
|
735 |
s:= s; // avoid compiler hint |
|
736 |
isSpeed:= false |
|
737 |
end; |
|
738 |
||
739 |
procedure chZoomIn(var s: shortstring); |
|
740 |
begin |
|
741 |
s:= s; // avoid compiler hint |
|
14701
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
742 |
if (LocalMessage and gmPrecise <> 0) then |
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
743 |
ZoomValue:= ZoomValue + cZoomDeltaSmall |
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
744 |
else |
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
745 |
ZoomValue:= ZoomValue + cZoomDelta; |
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
746 |
if ZoomValue > cMinZoomLevel then |
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
747 |
ZoomValue:= cMinZoomLevel; |
4413 | 748 |
end; |
749 |
||
750 |
procedure chZoomOut(var s: shortstring); |
|
751 |
begin |
|
752 |
s:= s; // avoid compiler hint |
|
14701
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
753 |
if (LocalMessage and gmPrecise <> 0) then |
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
754 |
ZoomValue:= ZoomValue - cZoomDeltaSmall |
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
755 |
else |
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
756 |
ZoomValue:= ZoomValue - cZoomDelta; |
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
757 |
if ZoomValue < cMaxZoomLevel then |
d74517fdb34f
Properly enforce zoom bounds again when changing zoom
Wuzzy <Wuzzy2@mail.ru>
parents:
14700
diff
changeset
|
758 |
ZoomValue:= cMaxZoomLevel; |
4413 | 759 |
end; |
760 |
||
761 |
procedure chZoomReset(var s: shortstring); |
|
762 |
begin |
|
763 |
s:= s; // avoid compiler hint |
|
14699
c96889bf5796
Precise+resetzoom = 100% zoom (instead of UserZoom)
Wuzzy <Wuzzy2@mail.ru>
parents:
14698
diff
changeset
|
764 |
if (LocalMessage and gmPrecise <> 0) then |
c96889bf5796
Precise+resetzoom = 100% zoom (instead of UserZoom)
Wuzzy <Wuzzy2@mail.ru>
parents:
14698
diff
changeset
|
765 |
ZoomValue:= cDefaultZoomLevel |
c96889bf5796
Precise+resetzoom = 100% zoom (instead of UserZoom)
Wuzzy <Wuzzy2@mail.ru>
parents:
14698
diff
changeset
|
766 |
else |
c96889bf5796
Precise+resetzoom = 100% zoom (instead of UserZoom)
Wuzzy <Wuzzy2@mail.ru>
parents:
14698
diff
changeset
|
767 |
ZoomValue:= UserZoom; |
4413 | 768 |
end; |
769 |
||
6898 | 770 |
procedure chMapGen(var s: shortstring); |
771 |
begin |
|
10603
bda5c7caf396
switch mapgen to enum. should still try and make sure the values are backwards compatible if possible.
nemo
parents:
10510
diff
changeset
|
772 |
cMapGen:= TMapGen(StrToInt(s)) |
6898 | 773 |
end; |
774 |
||
775 |
procedure chTemplateFilter(var s: shortstring); |
|
776 |
begin |
|
7151 | 777 |
cTemplateFilter:= StrToInt(s) |
6898 | 778 |
end; |
779 |
||
10472
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
780 |
procedure chFeatureSize(var s: shortstring); |
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
781 |
begin |
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
782 |
cFeatureSize:= StrToInt(s) |
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
783 |
end; |
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
784 |
|
6898 | 785 |
procedure chInactDelay(var s: shortstring); |
786 |
begin |
|
7151 | 787 |
cInactDelay:= StrToInt(s) |
6898 | 788 |
end; |
789 |
||
790 |
procedure chReadyDelay(var s: shortstring); |
|
791 |
begin |
|
7151 | 792 |
cReadyDelay:= StrToInt(s) |
6898 | 793 |
end; |
794 |
||
795 |
procedure chCaseFactor(var s: shortstring); |
|
796 |
begin |
|
7151 | 797 |
cCaseFactor:= StrToInt(s) |
6898 | 798 |
end; |
799 |
||
800 |
procedure chHealthCaseProb(var s: shortstring); |
|
801 |
begin |
|
7151 | 802 |
cHealthCaseProb:= StrToInt(s) |
6898 | 803 |
end; |
804 |
||
805 |
procedure chHealthCaseAmount(var s: shortstring); |
|
806 |
begin |
|
7151 | 807 |
cHealthCaseAmount:= StrToInt(s) |
6898 | 808 |
end; |
809 |
||
810 |
procedure chSuddenDTurns(var s: shortstring); |
|
811 |
begin |
|
7151 | 812 |
cSuddenDTurns:= StrToInt(s) |
6898 | 813 |
end; |
814 |
||
815 |
procedure chWaterRise(var s: shortstring); |
|
816 |
begin |
|
7151 | 817 |
cWaterRise:= StrToInt(s) |
6898 | 818 |
end; |
819 |
||
820 |
procedure chHealthDecrease(var s: shortstring); |
|
821 |
begin |
|
7151 | 822 |
cHealthDecrease:= StrToInt(s) |
6898 | 823 |
end; |
824 |
||
14543
d0441c7e9000
Lua: Add InitHealth, read-only variable containing the initial hog health setting
Wuzzy <Wuzzy2@mail.ru>
parents:
14484
diff
changeset
|
825 |
procedure chInitHealth(var s: shortstring); |
d0441c7e9000
Lua: Add InitHealth, read-only variable containing the initial hog health setting
Wuzzy <Wuzzy2@mail.ru>
parents:
14484
diff
changeset
|
826 |
begin |
d0441c7e9000
Lua: Add InitHealth, read-only variable containing the initial hog health setting
Wuzzy <Wuzzy2@mail.ru>
parents:
14484
diff
changeset
|
827 |
cInitHealth:= StrToInt(s) |
d0441c7e9000
Lua: Add InitHealth, read-only variable containing the initial hog health setting
Wuzzy <Wuzzy2@mail.ru>
parents:
14484
diff
changeset
|
828 |
end; |
d0441c7e9000
Lua: Add InitHealth, read-only variable containing the initial hog health setting
Wuzzy <Wuzzy2@mail.ru>
parents:
14484
diff
changeset
|
829 |
|
6898 | 830 |
procedure chDamagePercent(var s: shortstring); |
831 |
begin |
|
7151 | 832 |
cDamagePercent:= StrToInt(s) |
6898 | 833 |
end; |
834 |
||
835 |
procedure chRopePercent(var s: shortstring); |
|
836 |
begin |
|
7151 | 837 |
cRopePercent:= StrToInt(s) |
6898 | 838 |
end; |
839 |
||
840 |
procedure chGetAwayTime(var s: shortstring); |
|
841 |
begin |
|
7151 | 842 |
cGetAwayTime:= StrToInt(s) |
6898 | 843 |
end; |
844 |
||
845 |
procedure chMineDudPercent(var s: shortstring); |
|
846 |
begin |
|
7151 | 847 |
cMineDudPercent:= StrToInt(s) |
6898 | 848 |
end; |
849 |
||
850 |
procedure chLandMines(var s: shortstring); |
|
851 |
begin |
|
7151 | 852 |
cLandMines:= StrToInt(s) |
6898 | 853 |
end; |
854 |
||
10818
f642a28cab0c
Add placement of airmines in engine outside of hog proximity. Has a bug, only protecting 1st team. Also fix a spelling error and rename gstHHChooseTarget to gstChooseTarget
nemo
parents:
10672
diff
changeset
|
855 |
procedure chAirMines(var s: shortstring); |
f642a28cab0c
Add placement of airmines in engine outside of hog proximity. Has a bug, only protecting 1st team. Also fix a spelling error and rename gstHHChooseTarget to gstChooseTarget
nemo
parents:
10672
diff
changeset
|
856 |
begin |
f642a28cab0c
Add placement of airmines in engine outside of hog proximity. Has a bug, only protecting 1st team. Also fix a spelling error and rename gstHHChooseTarget to gstChooseTarget
nemo
parents:
10672
diff
changeset
|
857 |
cAirMines:= StrToInt(s) |
f642a28cab0c
Add placement of airmines in engine outside of hog proximity. Has a bug, only protecting 1st team. Also fix a spelling error and rename gstHHChooseTarget to gstChooseTarget
nemo
parents:
10672
diff
changeset
|
858 |
end; |
f642a28cab0c
Add placement of airmines in engine outside of hog proximity. Has a bug, only protecting 1st team. Also fix a spelling error and rename gstHHChooseTarget to gstChooseTarget
nemo
parents:
10672
diff
changeset
|
859 |
|
15667 | 860 |
procedure chSentries(var s: shortstring); |
861 |
begin |
|
862 |
cSentries:= StrToInt(s) |
|
863 |
end; |
|
864 |
||
6898 | 865 |
procedure chExplosives(var s: shortstring); |
866 |
begin |
|
7151 | 867 |
cExplosives:= StrToInt(s) |
6898 | 868 |
end; |
869 |
||
870 |
procedure chGameFlags(var s: shortstring); |
|
871 |
begin |
|
7218
9ecd5bc9810b
Ensure that Clan ammo always takes precedence over Per Hog Ammo in the flags. It'd be best for the user sake if these buttons acted more like radio buttons.
nemo
parents:
7187
diff
changeset
|
872 |
GameFlags:= StrToInt(s); |
7629 | 873 |
if GameFlags and gfSharedAmmo <> 0 then GameFlags:= GameFlags and (not gfPerHogAmmo) |
6898 | 874 |
end; |
875 |
||
876 |
procedure chHedgehogTurnTime(var s: shortstring); |
|
877 |
begin |
|
7151 | 878 |
cHedgehogTurnTime:= StrToInt(s) |
6898 | 879 |
end; |
880 |
||
881 |
procedure chMinesTime(var s: shortstring); |
|
882 |
begin |
|
7151 | 883 |
cMinesTime:= StrToInt(s) |
6898 | 884 |
end; |
885 |
||
886 |
procedure chFastUntilLag(var s: shortstring); |
|
887 |
begin |
|
10862
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
888 |
fastUntilLag:= StrToInt(s) <> 0; |
15897
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
889 |
fastForward:= fastUntilLag; |
10862
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
890 |
|
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
891 |
if not fastUntilLag then |
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
892 |
begin |
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
893 |
// update health bars and the wind indicator |
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
894 |
AddVisualGear(0, 0, vgtTeamHealthSorter); |
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
895 |
AddVisualGear(0, 0, vgtSmoothWindBar) |
4575977d3ce0
Don't spawn team widget sorter on each frame when in lag. Issue 'spectate 0' instead, and only on first lag occasion.
unc0rr
parents:
10822
diff
changeset
|
896 |
end |
6898 | 897 |
end; |
4413 | 898 |
|
15897
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
899 |
procedure chFastForward(var cmd: shortstring); |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
900 |
var str0, str1, str2 : shortstring; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
901 |
h, m, s : integer; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
902 |
begin |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
903 |
if gameType <> gmtDemo then |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
904 |
exit; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
905 |
if CountChar(cmd, ':') > 2 then |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
906 |
exit; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
907 |
str0:= cmd; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
908 |
SplitByChar(str0, str1, ':'); |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
909 |
SplitByChar(str1, str2, ':'); |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
910 |
if str2 <> '' then |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
911 |
begin |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
912 |
h:= StrToInt(str0); |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
913 |
m:= StrToInt(str1); |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
914 |
s:= StrToInt(str2) |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
915 |
end |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
916 |
else if str1 <> '' then |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
917 |
begin |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
918 |
h:= 0; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
919 |
m:= StrToInt(str0); |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
920 |
s:= StrToInt(str1) |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
921 |
end |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
922 |
else |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
923 |
begin |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
924 |
h:= 0; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
925 |
m:= 0; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
926 |
s:= StrToInt(str0) |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
927 |
end; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
928 |
FFGameTick:= (s + m * 60 + h * 60 * 60) * 1000; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
929 |
if FFGameTick > GameTicks then |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
930 |
begin |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
931 |
fastUntilLag:= True; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
932 |
fastForward:= True; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
933 |
end |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
934 |
end; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
935 |
|
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
936 |
procedure chStopFastForward(var s: shortstring); |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
937 |
begin |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
938 |
if gameType <> gmtDemo then |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
939 |
exit; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
940 |
fastUntilLag:= False; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
941 |
fastForward:= False; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
942 |
AddVisualGear(0, 0, vgtTeamHealthSorter); |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
943 |
AddVisualGear(0, 0, vgtSmoothWindBar) |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
944 |
end; |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
945 |
|
7201
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
946 |
procedure chCampVar(var s:shortstring); |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
947 |
begin |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
948 |
CampaignVariable := s; |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
949 |
end; |
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
950 |
|
14484
bd1db668b7c0
Add Lua functions to save/get mission variables
Wuzzy <Wuzzy2@mail.ru>
parents:
13883
diff
changeset
|
951 |
procedure chMissVar(var s:shortstring); |
bd1db668b7c0
Add Lua functions to save/get mission variables
Wuzzy <Wuzzy2@mail.ru>
parents:
13883
diff
changeset
|
952 |
begin |
bd1db668b7c0
Add Lua functions to save/get mission variables
Wuzzy <Wuzzy2@mail.ru>
parents:
13883
diff
changeset
|
953 |
MissionVariable := s; |
bd1db668b7c0
Add Lua functions to save/get mission variables
Wuzzy <Wuzzy2@mail.ru>
parents:
13883
diff
changeset
|
954 |
end; |
bd1db668b7c0
Add Lua functions to save/get mission variables
Wuzzy <Wuzzy2@mail.ru>
parents:
13883
diff
changeset
|
955 |
|
9489 | 956 |
procedure chWorldEdge(var s: shortstring); |
957 |
begin |
|
958 |
WorldEdge:= TWorldEdge(StrToInt(s)) |
|
959 |
end; |
|
960 |
||
10237 | 961 |
procedure chAdvancedMapGenMode(var s:shortstring); |
962 |
begin |
|
10249 | 963 |
s:= s; // avoid compiler hint |
10237 | 964 |
cAdvancedMapGenMode:= true; |
965 |
end; |
|
966 |
||
13465
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
967 |
procedure chShowMission_p(var s: shortstring); |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
968 |
begin |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
969 |
s:= s; // avoid compiler hint |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
970 |
isShowMission:= true; |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
971 |
end; |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
972 |
|
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
973 |
procedure chShowMission_m(var s: shortstring); |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
974 |
begin |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
975 |
s:= s; // avoid compiler hint |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
976 |
isShowMission:= false; |
13467
854caa3c9212
Lua API: Add parameter forceDisplay to ShowMission to prevent manual hiding
Wuzzy <Wuzzy2@mail.ru>
parents:
13465
diff
changeset
|
977 |
if (not isForceMission) then |
854caa3c9212
Lua API: Add parameter forceDisplay to ShowMission to prevent manual hiding
Wuzzy <Wuzzy2@mail.ru>
parents:
13465
diff
changeset
|
978 |
HideMission(); |
13465
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
979 |
end; |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
980 |
|
14770
533ac9774279
Add key to display extra gear info tags
Wuzzy <Wuzzy2@mail.ru>
parents:
14702
diff
changeset
|
981 |
procedure chGearInfo(var s: shortstring); |
533ac9774279
Add key to display extra gear info tags
Wuzzy <Wuzzy2@mail.ru>
parents:
14702
diff
changeset
|
982 |
begin |
533ac9774279
Add key to display extra gear info tags
Wuzzy <Wuzzy2@mail.ru>
parents:
14702
diff
changeset
|
983 |
s:= s; // avoid compiler hint |
533ac9774279
Add key to display extra gear info tags
Wuzzy <Wuzzy2@mail.ru>
parents:
14702
diff
changeset
|
984 |
isShowGearInfo:= not isShowGearInfo; |
533ac9774279
Add key to display extra gear info tags
Wuzzy <Wuzzy2@mail.ru>
parents:
14702
diff
changeset
|
985 |
end; |
533ac9774279
Add key to display extra gear info tags
Wuzzy <Wuzzy2@mail.ru>
parents:
14702
diff
changeset
|
986 |
|
4413 | 987 |
procedure initModule; |
988 |
begin |
|
4528
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
989 |
//////// Begin top sorted by freq analysis not including chatmsg |
7407 | 990 |
RegisterVariable('+right' , @chRight_p , false, true); |
991 |
RegisterVariable('-right' , @chRight_m , false, true); |
|
992 |
RegisterVariable('+up' , @chUp_p , false, true); |
|
993 |
RegisterVariable('-up' , @chUp_m , false, true); |
|
994 |
RegisterVariable('+left' , @chLeft_p , false, true); |
|
995 |
RegisterVariable('-left' , @chLeft_m , false, true); |
|
7629 | 996 |
RegisterVariable('+attack' , @chAttack_p , false); |
7407 | 997 |
RegisterVariable('+down' , @chDown_p , false, true); |
998 |
RegisterVariable('-down' , @chDown_m , false, true); |
|
999 |
RegisterVariable('hjump' , @chHJump , false, true); |
|
1000 |
RegisterVariable('ljump' , @chLJump , false, true); |
|
7629 | 1001 |
RegisterVariable('nextturn', @chNextTurn , false); |
1002 |
RegisterVariable('-attack' , @chAttack_m , false); |
|
1003 |
RegisterVariable('slot' , @chSlot , false); |
|
7407 | 1004 |
RegisterVariable('setweap' , @chSetWeapon , false, true); |
4528
630f4ab0c926
Reorder top registered variables by frequency gathered from 60 or so games of varying length/type. Oh. And add green hair to joker.
nemo
parents:
4522
diff
changeset
|
1005 |
//////// End top by freq analysis |
7629 | 1006 |
RegisterVariable('gencmd' , @chGenCmd , false); |
6898 | 1007 |
RegisterVariable('script' , @chScript , false); |
9902 | 1008 |
RegisterVariable('scriptparam', @chScriptParam, false); |
6898 | 1009 |
RegisterVariable('proto' , @chCheckProto , true ); |
1010 |
RegisterVariable('spectate', @chFastUntilLag , false); |
|
1011 |
RegisterVariable('capture' , @chCapture , true ); |
|
1012 |
RegisterVariable('rotmask' , @chRotateMask , true ); |
|
12997
f06660523198
Add separate control for changing hedgehog tags
Wuzzy <Wuzzy2@mail.ru>
parents:
12990
diff
changeset
|
1013 |
RegisterVariable('rottags' , @chRotateTags , true ); |
6898 | 1014 |
RegisterVariable('rdriven' , @chTeamLocal , false); |
1015 |
RegisterVariable('map' , @chSetMap , false); |
|
1016 |
RegisterVariable('theme' , @chSetTheme , false); |
|
1017 |
RegisterVariable('seed' , @chSetSeed , false); |
|
1018 |
RegisterVariable('template_filter', @chTemplateFilter, false); |
|
1019 |
RegisterVariable('mapgen' , @chMapGen , false); |
|
1020 |
RegisterVariable('maze_size',@chTemplateFilter, false); |
|
10472
8d04cebedb16
Partially hook up feature size so horrorcat has something to test.
nemo
parents:
10455
diff
changeset
|
1021 |
RegisterVariable('feature_size',@chFeatureSize, false); |
6898 | 1022 |
RegisterVariable('delay' , @chInactDelay , false); |
1023 |
RegisterVariable('ready' , @chReadyDelay , false); |
|
1024 |
RegisterVariable('casefreq', @chCaseFactor , false); |
|
1025 |
RegisterVariable('healthprob', @chHealthCaseProb, false); |
|
1026 |
RegisterVariable('hcaseamount', @chHealthCaseAmount, false); |
|
1027 |
RegisterVariable('sd_turns', @chSuddenDTurns , false); |
|
1028 |
RegisterVariable('waterrise', @chWaterRise , false); |
|
1029 |
RegisterVariable('healthdec', @chHealthDecrease, false); |
|
14543
d0441c7e9000
Lua: Add InitHealth, read-only variable containing the initial hog health setting
Wuzzy <Wuzzy2@mail.ru>
parents:
14484
diff
changeset
|
1030 |
RegisterVariable('inithealth',@chInitHealth, false); |
6898 | 1031 |
RegisterVariable('damagepct',@chDamagePercent , false); |
1032 |
RegisterVariable('ropepct' , @chRopePercent , false); |
|
1033 |
RegisterVariable('getawaytime' , @chGetAwayTime , false); |
|
1034 |
RegisterVariable('minedudpct',@chMineDudPercent, false); |
|
1035 |
RegisterVariable('minesnum', @chLandMines , false); |
|
10822 | 1036 |
RegisterVariable('airmines', @chAirMines , false); |
15667 | 1037 |
RegisterVariable('sentries', @chSentries , false); |
6898 | 1038 |
RegisterVariable('explosives',@chExplosives , false); |
1039 |
RegisterVariable('gmflags' , @chGameFlags , false); |
|
1040 |
RegisterVariable('turntime', @chHedgehogTurnTime, false); |
|
1041 |
RegisterVariable('minestime',@chMinesTime , false); |
|
1042 |
RegisterVariable('quit' , @chQuit , true ); |
|
1043 |
RegisterVariable('forcequit', @chForceQuit , true ); |
|
1044 |
RegisterVariable('confirm' , @chConfirm , true ); |
|
1045 |
RegisterVariable('halt', @chHalt , true ); |
|
1046 |
RegisterVariable('+speedup', @chSpeedup_p , true ); |
|
1047 |
RegisterVariable('-speedup', @chSpeedup_m , true ); |
|
1048 |
RegisterVariable('zoomin' , @chZoomIn , true ); |
|
1049 |
RegisterVariable('zoomout' , @chZoomOut , true ); |
|
1050 |
RegisterVariable('zoomreset',@chZoomReset , true ); |
|
1051 |
RegisterVariable('ammomenu', @chAmmoMenu , true); |
|
7629 | 1052 |
RegisterVariable('+precise', @chPrecise_p , false, true); |
1053 |
RegisterVariable('-precise', @chPrecise_m , false, true); |
|
6898 | 1054 |
RegisterVariable('switch' , @chSwitch , false); |
7629 | 1055 |
RegisterVariable('timer' , @chTimer , false, true); |
6898 | 1056 |
RegisterVariable('taunt' , @chTaunt , false); |
1057 |
RegisterVariable('put' , @chPut , false); |
|
14702
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
1058 |
RegisterVariable('+volup' , @chVolUp_p , true ); |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
1059 |
RegisterVariable('-volup' , @chVolUp_m , true ); |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
1060 |
RegisterVariable('+voldown', @chVolDown_p , true ); |
bd43e703608b
Fix precise volume change being a bit buggy
Wuzzy <Wuzzy2@mail.ru>
parents:
14701
diff
changeset
|
1061 |
RegisterVariable('-voldown', @chVolDown_m , true ); |
13039
aed4b25ff242
Fix volume caption not being shown when hitting mute key
Wuzzy <Wuzzy2@mail.ru>
parents:
13013
diff
changeset
|
1062 |
RegisterVariable('mute' , @chMute , true ); |
7404 | 1063 |
RegisterVariable('findhh' , @chFindhh , true ); |
6898 | 1064 |
RegisterVariable('pause' , @chPause , true ); |
1065 |
RegisterVariable('+cur_u' , @chCurU_p , true ); |
|
1066 |
RegisterVariable('-cur_u' , @chCurU_m , true ); |
|
1067 |
RegisterVariable('+cur_d' , @chCurD_p , true ); |
|
1068 |
RegisterVariable('-cur_d' , @chCurD_m , true ); |
|
1069 |
RegisterVariable('+cur_l' , @chCurL_p , true ); |
|
1070 |
RegisterVariable('-cur_l' , @chCurL_m , true ); |
|
1071 |
RegisterVariable('+cur_r' , @chCurR_p , true ); |
|
1072 |
RegisterVariable('-cur_r' , @chCurR_m , true ); |
|
7201
dc17ffdf0702
The first campaign commit with a lot of changes...
belphegorr <szabibibi@gmail.com>
parents:
7187
diff
changeset
|
1073 |
RegisterVariable('campvar' , @chCampVar , true ); |
14484
bd1db668b7c0
Add Lua functions to save/get mission variables
Wuzzy <Wuzzy2@mail.ru>
parents:
13883
diff
changeset
|
1074 |
RegisterVariable('missvar' , @chMissVar , true ); |
7629 | 1075 |
RegisterVariable('record' , @chRecord , true ); |
9489 | 1076 |
RegisterVariable('worldedge',@chWorldEdge , false); |
10237 | 1077 |
RegisterVariable('advmapgen',@chAdvancedMapGenMode, false); |
15897
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
1078 |
RegisterVariable('ff' , @chFastForward , true); |
d7b53d08ad9c
Add FastForward/StopFastForward (/ff hh:mm:ss, /sff) chat commands to fast forward to a specific timestamp in a demo
S.D.
parents:
15667
diff
changeset
|
1079 |
RegisterVariable('sff' , @chStopFastForward, true); |
13465
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
1080 |
RegisterVariable('+mission', @chShowMission_p, true); |
08a3851aaf67
Add dedicated key to display mission panel: M
Wuzzy <Wuzzy2@mail.ru>
parents:
13107
diff
changeset
|
1081 |
RegisterVariable('-mission', @chShowMission_m, true); |
14770
533ac9774279
Add key to display extra gear info tags
Wuzzy <Wuzzy2@mail.ru>
parents:
14702
diff
changeset
|
1082 |
RegisterVariable('gearinfo', @chGearInfo , true ); |
13533
0c8001e43fd3
Add control to cycle through timer/bounciness values
Wuzzy <Wuzzy2@mail.ru>
parents:
13467
diff
changeset
|
1083 |
RegisterVariable('timer_u' , @chTimerU , true ); |
4413 | 1084 |
end; |
1085 |
||
1086 |
procedure freeModule; |
|
1087 |
begin |
|
1088 |
end; |
|
1089 |
||
1090 |
end. |