X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fgame%2Fg_triggers.pas;h=8fb459082acf0a7267aadf2e46efa42c02775478;hb=24295447a0cdc2b569448cc3902a9ab6e40a6b19;hp=ec3bb7144f67e6ae7f1c2f05c62890134968af8a;hpb=e0ef894b62b50d6a7bd7e1dfa42ee3f1a839403a;p=d2df-sdl.git diff --git a/src/game/g_triggers.pas b/src/game/g_triggers.pas index ec3bb71..8fb4590 100644 --- a/src/game/g_triggers.pas +++ b/src/game/g_triggers.pas @@ -144,7 +144,7 @@ begin with gWalls[PanelID] do begin if g_CollidePlayer(X, Y, Width, Height) or - g_CollideMonster(X, Y, Width, Height) then Exit; + g_Mons_IsAnyAliveAt(X, Y, Width, Height) then Exit; if not Enabled then begin @@ -181,7 +181,7 @@ begin with gWalls[gDoorMap[c, b]] do begin if g_CollidePlayer(X, Y, Width, Height) or - g_CollideMonster(X, Y, Width, Height) then Exit; + g_Mons_IsAnyAliveAt(X, Y, Width, Height) then Exit; end; if not NoSound then @@ -648,7 +648,7 @@ begin dx := dx + Random(Data.ShotAccuracy) - Random(Data.ShotAccuracy); dy := dy + Random(Data.ShotAccuracy) - Random(Data.ShotAccuracy); - + tr_SpawnShot(Data.ShotType, wx, wy, dx, dy, Data.ShotSound, TargetUID); end else @@ -755,7 +755,7 @@ begin UID_MONSTER: begin - m := g_Monsters_Get(ActivateUID); + m := g_Monsters_ByUID(ActivateUID); if m = nil then Exit; @@ -801,7 +801,7 @@ begin UID_MONSTER: begin - m := g_Monsters_Get(ActivateUID); + m := g_Monsters_ByUID(ActivateUID); if m = nil then Exit; @@ -1373,14 +1373,14 @@ begin if Data.ItemMax > 0 then begin - it := g_ItemByIdx(iid); + it := g_Items_ByIdx(iid); it.SpawnTrigger := ID; Inc(SpawnedCount); end; case Data.ItemEffect of EFFECT_TELEPORT: begin - it := g_ItemByIdx(iid); + it := g_Items_ByIdx(iid); if g_Frames_Get(FramesID, 'FRAMES_TELEPORT') then begin Anim := TAnimation.Create(FramesID, False, 3); @@ -1395,7 +1395,7 @@ begin NET_GFX_TELE); end; EFFECT_RESPAWN: begin - it := g_ItemByIdx(iid); + it := g_Items_ByIdx(iid); if g_Frames_Get(FramesID, 'FRAMES_ITEM_RESPAWN') then begin Anim := TAnimation.Create(FramesID, False, 4); @@ -1410,7 +1410,7 @@ begin NET_GFX_RESPAWN); end; EFFECT_FIRE: begin - it := g_ItemByIdx(iid); + it := g_Items_ByIdx(iid); if g_Frames_Get(FramesID, 'FRAMES_FIRE') then begin Anim := TAnimation.Create(FramesID, False, 4); @@ -1880,7 +1880,7 @@ begin UID_MONSTER: begin - m := g_Monsters_Get(ActivateUID); + m := g_Monsters_ByUID(ActivateUID); if m = nil then Exit; @@ -2196,7 +2196,7 @@ var a, b, i: Integer; Affected: array of Integer; - function monsNear (monidx: Integer; mon: TMonster): Boolean; + {function monsNear (monidx: Integer; mon: TMonster): Boolean; begin result := false; // don't stop if mon.Collide(gTriggers[a].X, gTriggers[a].Y, gTriggers[a].Width, gTriggers[a].Height) then @@ -2204,6 +2204,13 @@ var gTriggers[a].ActivateUID := mon.UID; ActivateTrigger(gTriggers[a], ACTIVATE_MONSTERCOLLIDE); end; + end;} + + function monsNear (monidx: Integer; mon: TMonster): Boolean; + begin + result := false; // don't stop + gTriggers[a].ActivateUID := mon.UID; + ActivateTrigger(gTriggers[a], ACTIVATE_MONSTERCOLLIDE); end; begin @@ -2440,13 +2447,14 @@ begin if ByteBool(ActivateType and ACTIVATE_MONSTERCOLLIDE) and (TimeOut = 0) and (Keys = 0) then // Åñëè íå íóæíû êëþ÷è begin - g_Mons_ForEach(monsNear); + //g_Mons_ForEach(monsNear); + g_Mons_ForEachAt(gTriggers[a].X, gTriggers[a].Y, gTriggers[a].Width, gTriggers[a].Height, monsNear); end; // "Ìîíñòðîâ íåò" if ByteBool(ActivateType and ACTIVATE_NOMONSTER) and (TimeOut = 0) and (Keys = 0) then - if not g_CollideMonster(X, Y, Width, Height) then + if not g_Mons_IsAnyAliveAt(X, Y, Width, Height) then begin gTriggers[a].ActivateUID := 0; ActivateTrigger(gTriggers[a], ACTIVATE_NOMONSTER);