X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fg_triggers.pas;h=174b47e6594ca44e0a0429705ebb039b4394af67;hp=19edc46fd96b97b9efec5d5f156af12da87ae73d;hb=ba8cb4548eeab44bfe9c6db0081de5a9ac9600dd;hpb=8eea4becb53e1531c8d539c37a2809a8de9965b2 diff --git a/src/game/g_triggers.pas b/src/game/g_triggers.pas index 19edc46..174b47e 100644 --- a/src/game/g_triggers.pas +++ b/src/game/g_triggers.pas @@ -1,4 +1,4 @@ -(* Copyright (C) DooM 2D:Forever Developers +(* Copyright (C) Doom 2D: Forever Developers * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -592,17 +592,17 @@ begin if (gLifts[PanelID].PanelType = PANEL_LIFTUP) or (gLifts[PanelID].PanelType = PANEL_LIFTDOWN) then begin case d of - 0: t := 0; - 1: t := 1; - else t := IfThen(gLifts[PanelID].LiftType = 1, 0, 1); + 0: t := LIFTTYPE_UP; + 1: t := LIFTTYPE_DOWN; + else t := IfThen(gLifts[PanelID].LiftType = LIFTTYPE_DOWN, LIFTTYPE_UP, LIFTTYPE_DOWN); end end else if (gLifts[PanelID].PanelType = PANEL_LIFTLEFT) or (gLifts[PanelID].PanelType = PANEL_LIFTRIGHT) then begin case d of - 0: t := 2; - 1: t := 3; - else t := IfThen(gLifts[PanelID].LiftType = 2, 3, 2); + 0: t := LIFTTYPE_LEFT; + 1: t := LIFTTYPE_RIGHT; + else t := IfThen(gLifts[PanelID].LiftType = LIFTTYPE_LEFT, LIFTTYPE_RIGHT, LIFTTYPE_LEFT); end; end; @@ -806,6 +806,12 @@ begin snd := 'SOUND_WEAPON_EXPLODEBFG'; end; + TRIGGER_SHOT_FLAME: + begin + g_Weapon_flame(wx, wy, dx, dy, 0, -1, True); + snd := 'SOUND_GAME_BURNING'; + end; + else exit; end; @@ -847,7 +853,7 @@ begin dx += Random(tgcAccuracy)-Random(tgcAccuracy); dy += Random(tgcAccuracy)-Random(tgcAccuracy); - tr_SpawnShot(tgcShotType, wx, wy, dx, dy, not tgcQuiet, TargetUID); + tr_SpawnShot(tgcShotType, wx, wy, dx, dy, tgcShotSound, TargetUID); end else begin @@ -1346,9 +1352,15 @@ begin Result := True; if gLMSRespawn = LMS_RESPAWN_NONE then begin - g_Player_Get(ActivateUID).GetSecret(); + p := g_Player_Get(ActivateUID); + p.GetSecret(); Inc(gCoopSecretsFound); - if g_Game_IsNet then MH_SEND_GameStats(); + if g_Game_IsNet then + begin + MH_SEND_GameStats(); + if p.FClientID >= 0 then + MH_SEND_GameEvent(NET_EV_SECRET, p.UID, ''); + end; end; end; @@ -1461,7 +1473,7 @@ begin for k := 1 to tgcMonsCount do begin if (actType = ACTIVATE_CUSTOM) and (tgcDelay > 0) then - SpawnCooldown := tgcDelay; + SpawnCooldown := -1; // Çàäåðæêà âûñòàâèòñÿ ìîíñòðîì ïðè óíè÷òîæåíèè if (tgcMax > 0) and (SpawnedCount >= tgcMax) then Break; @@ -1491,11 +1503,8 @@ begin gMonstersSpawned[High(gMonstersSpawned)] := mon.UID; end; - if tgcMax > 0 then - begin - mon.SpawnTrigger := ID; - Inc(SpawnedCount); - end; + mon.SpawnTrigger := ID; + if tgcMax > 0 then Inc(SpawnedCount); case tgcEffect of EFFECT_TELEPORT: begin @@ -1576,7 +1585,7 @@ begin for k := 1 to tgcItemCount do begin if (actType = ACTIVATE_CUSTOM) and (tgcDelay > 0) then - SpawnCooldown := tgcDelay; + SpawnCooldown := -1; // Çàäåðæêà âûñòàâèòñÿ èòåìîì ïðè óíè÷òîæåíèè if (tgcMax > 0) and (SpawnedCount >= tgcMax) then Break; @@ -1585,12 +1594,9 @@ begin Result := True; - if tgcMax > 0 then - begin - it := g_Items_ByIdx(iid); - it.SpawnTrigger := ID; - Inc(SpawnedCount); - end; + it := g_Items_ByIdx(iid); + it.SpawnTrigger := ID; + if tgcMax > 0 then Inc(SpawnedCount); case tgcEffect of EFFECT_TELEPORT: begin @@ -3062,11 +3068,20 @@ end; procedure g_Triggers_DecreaseSpawner(ID: DWORD); begin if (gTriggers <> nil) then - if gTriggers[ID].SpawnedCount > 0 then - Dec(gTriggers[ID].SpawnedCount); + begin + if gTriggers[ID].tgcMax > 0 then + begin + if gTriggers[ID].SpawnedCount > 0 then + Dec(gTriggers[ID].SpawnedCount); + end; + if gTriggers[ID].tgcDelay > 0 then + begin + if gTriggers[ID].SpawnCooldown < 0 then + gTriggers[ID].SpawnCooldown := gTriggers[ID].tgcDelay; + end; + end; end; - procedure g_Triggers_Free (); var a: Integer;