From: Ketmar Dark Date: Wed, 23 Aug 2017 19:06:13 +0000 (+0300) Subject: holmes now can work without lasersight X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=de7f5ee74b7584e08e587929069b17800b5d2eb6;p=d2df-sdl.git holmes now can work without lasersight --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 129370d..a2f74cd 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -2907,6 +2907,11 @@ begin p.viewPortW := sWidth; p.viewPortH := sHeight; + if (p = gPlayer1) then + begin + g_Holmes_plrView(p.viewPortX, p.viewPortY, p.viewPortW, p.viewPortH); + end; + renderMapInternal(-c, -d, a, b+p.IncCam, true); if p.FSpectator then diff --git a/src/game/g_holmes.pas b/src/game/g_holmes.pas index 87788a4..37ade09 100644 --- a/src/game/g_holmes.pas +++ b/src/game/g_holmes.pas @@ -427,6 +427,8 @@ end; function g_Holmes_KeyEvent (var ev: THKeyEvent): Boolean; +var + mon: TMonster; begin result := false; msB := ev.bstate; @@ -469,6 +471,17 @@ begin showAllMonsCells := not showAllMonsCells; exit; end; + // M-A: wake up monster + if (ev.scan = SDL_SCANCODE_A) and ((ev.kstate and THKeyEvent.ModAlt) <> 0) then + begin + result := true; + if (monMarkedUID <> -1) then + begin + mon := g_Monsters_ByUID(monMarkedUID); + if (mon <> nil) then mon.WakeUp(); + end; + exit; + end; end; end; @@ -491,6 +504,8 @@ begin //drawText8Prop(10, 20, 'Hi there, I''m Holmes!', 255, 255, 0); drawCursor(); + + laserSet := false; end; diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index 5fb769d..7b22e56 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -1929,6 +1929,7 @@ begin begin FObj.Rect.Y := FObj.Rect.Y + FObj.Rect.Height-12; FObj.Rect.Height := 12; + positionChanged(); end; // Óðîí áûë ñèëüíûì => ñëàáûå - â êàøó: diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 92aec40..ebbd204 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -2318,36 +2318,11 @@ end; procedure TPlayer.DrawAim(); procedure drawCast (sz: Integer; ax0, ay0, ax1, ay1: Integer); - - { - procedure drawTileGrid (); - var - x, y: Integer; - begin - y := mapGrid.gridY0; - while (y < mapGrid.gridY0+mapGrid.gridHeight) do - begin - x := mapGrid.gridX0; - while (x < mapGrid.gridX0+mapGrid.gridWidth) do - begin - if (x+mapGrid.tileSize > viewPortX) and (y+mapGrid.tileSize > viewPortY) and - (x < viewPortX+viewPortW) and (y < viewPortY+viewPortH) then - begin - e_DrawQuad(x, y, x+mapGrid.tileSize-1, y+mapGrid.tileSize-1, 96, 96, 96, 96); - end; - Inc(x, mapGrid.tileSize); - end; - Inc(y, mapGrid.tileSize); - end; - end; - } - var ex, ey: Integer; begin if isValidViewPort and (self = gPlayer1) then begin - g_Holmes_plrView(viewPortX, viewPortY, viewPortW, viewPortH); g_Holmes_plrLaser(ax0, ay0, ax1, ay1); end; @@ -2360,8 +2335,6 @@ procedure TPlayer.DrawAim(); begin e_DrawLine(sz, ax0, ay0, ex, ey, 0, 0, 255, 96); end; - - //drawTileGrid(); end; var