From: fgsfds Date: Fri, 9 Aug 2019 00:28:13 +0000 (+0300) Subject: Game: Monster burning propagation fix X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=5c84a2c9f706bc450a00bda4f7d2afc858ce75b0;p=d2df-sdl.git Game: Monster burning propagation fix --- diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index 83714cb..02bea1f 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -40,6 +40,8 @@ const MONSTATE_REVIVE = 10; MONSTATE_RUNOUT = 11; + MON_BURN_TIME = 100; + { in mapdef now BH_NORMAL = 0; BH_KILLER = 1; @@ -145,7 +147,7 @@ type function AnimIsReverse: Boolean; function shoot(o: PObj; immediately: Boolean): Boolean; function kick(o: PObj): Boolean; - procedure CatchFire(Attacker: Word); + procedure CatchFire(Attacker: Word; Timeout: Integer = MON_BURN_TIME); procedure OnFireFlame(Times: DWORD = 1); procedure positionChanged (); //WARNING! call this after monster position was changed, or coldet will not work right! @@ -2469,13 +2471,13 @@ begin st := g_Obj_Move(@FObj, fall, True, True); positionChanged(); // this updates spatial accelerators -// Åñëè ãîðèì - ïîäæèãàåì äðóãèõ ìîíñòðîâ: +// Åñëè ãîðèì - ïîäæèãàåì äðóãèõ ìîíñòðîâ, íî íå íà 100 òèêîâ êàæäûé ðàç: if FFireTime > 0 then for a := 0 to High(gMonsters) do if (gMonsters[a] <> nil) and (gMonsters[a].alive) and (gMonsters[a].FUID <> FUID) and g_Obj_Collide(@FObj, @gMonsters[a].Obj) then - gMonsters[a].CatchFire(FFireAttacker); + gMonsters[a].CatchFire(FFireAttacker, FFireTime); // Âûëåòåë çà êàðòó - óäàëÿåì è çàïóñêàåì òðèããåðû: if WordBool(st and MOVE_FALLOUT) or (FObj.X < -1000) or @@ -4644,11 +4646,12 @@ begin SetLength(FDieTriggers, 0); end; -procedure TMonster.CatchFire(Attacker: Word); +procedure TMonster.CatchFire(Attacker: Word; Timeout: Integer = MON_BURN_TIME); begin + if Timeout <= 0 then exit; if FFireTime <= 0 then g_Sound_PlayExAt('SOUND_IGNITE', FObj.X, FObj.Y); - FFireTime := 100; + FFireTime := Timeout; FFireAttacker := Attacker; if g_Game_IsNet and g_Game_IsServer then MH_SEND_MonsterState(FUID); end; diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 3549b11..b99c03d 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -97,6 +97,8 @@ const SUICIDE_DAMAGE = 112; WEAPON_DELAY = 5; + PLAYER_BURN_TIME = 110; + PLAYER1_DEF_COLOR: TRGB = (R:64; G:175; B:48); PLAYER2_DEF_COLOR: TRGB = (R:96; G:96; B:96); @@ -336,7 +338,7 @@ type procedure FlamerOff; procedure JetpackOn; procedure JetpackOff; - procedure CatchFire(Attacker: Word); + procedure CatchFire(Attacker: Word; Timeout: Integer = PLAYER_BURN_TIME); //WARNING! this does nothing for now, but still call it! procedure positionChanged (); //WARNING! call this after entity position was changed, or coldet will not work right! @@ -3189,13 +3191,15 @@ begin FJetSoundOff.PlayAt(FObj.X, FObj.Y); end; -procedure TPlayer.CatchFire(Attacker: Word); +procedure TPlayer.CatchFire(Attacker: Word; Timeout: Integer = PLAYER_BURN_TIME); begin + if Timeout <= 0 then + exit; if (FMegaRulez[MR_SUIT] > gTime) or (FMegaRulez[MR_INVUL] > gTime) then exit; // Íå çàãîðàåìñÿ êîãäà åñòü çàùèòà if FFireTime <= 0 then g_Sound_PlayExAt('SOUND_IGNITE', FObj.X, FObj.Y); - FFireTime := 110; + FFireTime := Timeout; FFireAttacker := Attacker; if g_Game_IsNet and g_Game_IsServer then MH_SEND_PlayerStats(FUID);