1 (* Copyright (C) DooM 2D:Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *)
16 {$INCLUDE ../shared/a_modes.inc}
19 interface
21 uses
22 e_log,
25 xprofiler;
28 type
30 public
31 const
32 // both for but and for bstate
39 // event types
44 public
54 public
55 const
56 // modifiers
61 // event types
65 public
80 function g_Holmes_mouseEvent (var ev: THMouseEvent): Boolean; // returns `true` if event was eaten
83 // hooks for player
88 var
92 implementation
94 uses
99 var
100 //globalInited: Boolean = false;
109 // ////////////////////////////////////////////////////////////////////////// //
110 {$INCLUDE g_holmes.inc}
112 // ////////////////////////////////////////////////////////////////////////// //
114 begin
115 e_WriteLog(Format('Inspector: videomode changed: %dx%d', [gScreenWidth, gScreenHeight]), MSG_NOTIFY);
116 // texture space is possibly lost here, idc
122 //createCursorTexture();
126 begin
132 begin
136 // ////////////////////////////////////////////////////////////////////////// //
137 var
146 begin
155 begin
171 begin
177 begin
181 //if pan.Enabled then g_Map_DisableWall(pan.arrIdx) else g_Map_EnableWall(pan.arrIdx);
185 begin
187 e_WriteLog(Format('monster #%d (UID:%u) (proxyid:%d)', [mon.arrIdx, mon.UID, mon.proxyId]), MSG_NOTIFY);
190 begin
191 //e_WriteLog(Format('mouse: x=%d; y=%d; but=%d; bstate=%d', [msx, msy, but, bstate]), MSG_NOTIFY);
196 begin
198 begin
199 // dump monsters in cell
203 end
204 else
205 begin
206 // toggle wall
209 exit;
213 begin
218 exit;
226 var
228 begin
231 begin
234 begin
237 begin
238 //e_DrawQuad(x, y, x+mapGrid.tileSize-1, y+mapGrid.tileSize-1, 96, 96, 96, 96);
248 begin
253 begin
254 //e_WriteLog(Format('h1: (%d,%d)', [cx, cy]), MSG_NOTIFY);
259 begin
262 //e_WriteLog(Format('h1: (%d,%d)', [cx, cy]), MSG_NOTIFY);
267 var
270 begin
275 begin
281 var
285 var
290 begin
292 begin
295 end
297 begin
300 end
301 else
302 begin
303 exit;
307 if (g_Map_traceToNearestWall(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, @ex, @ey) <> nil) then
308 begin
314 var
318 begin
324 {$IF DEFINED(D2F_DEBUG)}
325 //mapGrid.dbgRayTraceTileHitCB := hilightCell1;
326 {$ENDIF}
327 if (g_Map_traceToNearestWall(mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, @ex, @ey) <> nil) then
328 //if (mapGrid.traceRay(ex, ey, mx+mw div 2, my+mh div 2, emx+emw div 2, emy+emh div 2, hilightWallTrc, (GridTagWall or GridTagDoor)) <> nil) then
329 begin
332 {$IF DEFINED(D2F_DEBUG)}
333 //mapGrid.dbgRayTraceTileHitCB := nil;
334 {$ENDIF}
337 begin
340 //mx += mw div 2;
345 begin
346 //fillRect(mx-4, my-7*8-6, 110, 7*8+6, 0, 0, 94, 250);
351 // type
352 drawText6(mx, my, Format('%s(U:%u)', [monsTypeToString(mon.MonsterType), mon.UID]), 255, 127, 0); my -= 8;
353 // beh
354 drawText6(mx, my, Format('Beh: %s', [monsBehToString(mon.MonsterBehaviour)]), 255, 127, 0); my -= 8;
355 // state
356 drawText6(mx, my, Format('State:%s (%d)', [monsStateToString(mon.MonsterState), mon.MonsterSleep]), 255, 127, 0); my -= 8;
357 // health
359 // ammo
361 // target
368 {
369 property MonsterRemoved: Boolean read FRemoved write FRemoved;
370 property MonsterPain: Integer read FPain write FPain;
371 property MonsterAnim: Byte read FCurAnim write FCurAnim;
372 }
375 var
378 begin
379 //e_DrawPoint(4, plrMouseX, plrMouseY, 255, 0, 255);
382 //e_WriteLog(Format('(%d,%d)-(%d,%d)', [laserX0, laserY0, laserX1, laserY1]), MSG_NOTIFY);
392 begin
395 begin
402 //e_DrawPoint(16, laserX0, laserY0, 255, 255, 255);
408 // ////////////////////////////////////////////////////////////////////////// //
410 begin
421 begin
431 // press
433 begin
434 // M-M: one monster think step
436 begin
440 exit;
442 // M-I: toggle monster info
444 begin
447 exit;
449 // M-L: toggle monster LOS to player
451 begin
454 exit;
460 // ////////////////////////////////////////////////////////////////////////// //
462 begin
470 begin
474 //drawText6Prop(10, 10, 'Hi there, I''m Holmes!', 255, 255, 0);
475 //drawText8Prop(10, 20, 'Hi there, I''m Holmes!', 255, 255, 0);