From daf9eff73e0fcfea6b846daebd5732cceb699e43 Mon Sep 17 00:00:00 2001 From: Stas'M Date: Sun, 20 May 2018 02:43:27 +0300 Subject: [PATCH] Monsters: Check for blind area when shooting http://doom2d.org/forum/viewtopic.php?f=36&t=1885 --- src/game/g_monsters.pas | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index e496521..f64850d 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -3243,6 +3243,19 @@ _end: wx := FObj.X + wx; wy := FObj.Y + MONSTER_ANIMTABLE[FMonsterType].wY; + // Ìîíñòð íå ìîæåò öåëèòüñÿ â îáúåêò çà ñïèíîé, ñòðåëÿÿ âëåâî: + if (FDirection = TDirection.D_LEFT) and (tx > wx) then + begin + tx := wx - 32; + ty := wy + Random(11) - 5; + end; + // È àíàëîãè÷íî, ñòðåëÿÿ âïðàâî: + if (FDirection = TDirection.D_RIGHT) and (tx < wx) then + begin + tx := wx + 32; + ty := wy + Random(11) - 5; + end; + // Äåëàåì âûñòðåë íóæíûì îðóæèåì: case FMonsterType of MONSTER_IMP: -- 2.29.2