From: Stas'M Date: Thu, 31 Jan 2019 20:04:01 +0000 (+0300) Subject: Flammenwerfer: Burn in hell demons! X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=8bc91b0c803ac0934ca9e32ca05d9294d7b2a913;p=d2df-sdl.git Flammenwerfer: Burn in hell demons! --- diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index 12488d6..83714cb 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -2469,6 +2469,14 @@ begin st := g_Obj_Move(@FObj, fall, True, True); positionChanged(); // this updates spatial accelerators +// Åñëè ãîðèì - ïîäæèãàåì äðóãèõ ìîíñòðîâ: + 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); + // Âûëåòåë çà êàðòó - óäàëÿåì è çàïóñêàåì òðèããåðû: if WordBool(st and MOVE_FALLOUT) or (FObj.X < -1000) or (FObj.X > gMapInfo.Width+1000) or (FObj.Y < -1000) then @@ -4638,6 +4646,8 @@ end; procedure TMonster.CatchFire(Attacker: Word); begin + if FFireTime <= 0 then + g_Sound_PlayExAt('SOUND_IGNITE', FObj.X, FObj.Y); FFireTime := 100; FFireAttacker := Attacker; if g_Game_IsNet and g_Game_IsServer then MH_SEND_MonsterState(FUID); diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index a060162..6e825fe 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -2116,7 +2116,7 @@ function MC_RECV_PlayerStats(var M: TMsg): Word; var PID: Word; Pl: TPlayer; - I: Integer; + I, OldFire: Integer; OldJet, Flam: Boolean; NewTeam: Byte; begin @@ -2192,7 +2192,10 @@ begin FNoRespawn := M.ReadByte() <> 0; OldJet := FJetpack; FJetpack := M.ReadByte() <> 0; + OldFire := FFireTime; FFireTime := M.ReadLongInt(); + if (OldFire <= 0) and (FFireTime > 0) then + g_Sound_PlayExAt('SOUND_IGNITE', Obj.X, Obj.Y); Flam := M.ReadByte() <> 0; if OldJet and not FJetpack then JetpackOff @@ -2632,7 +2635,7 @@ end; procedure MC_RECV_MonsterState(var M: TMsg); var - ID: Integer; + ID, OldFire: Integer; MState, MFAnm: Byte; Mon: TMonster; AnimRevert: Boolean; @@ -2653,7 +2656,10 @@ begin MonsterAmmo := M.ReadLongInt(); MonsterPain := M.ReadLongInt(); AnimRevert := M.ReadByte() <> 0; + OldFire := FFireTime; FFireTime := M.ReadLongInt(); + if (OldFire <= 0) and (FFireTime > 0) then + g_Sound_PlayExAt('SOUND_IGNITE', Obj.X, Obj.Y); RevertAnim(AnimRevert); if MonsterState <> MState then diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 5d1f863..9605c6d 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -3163,6 +3163,8 @@ end; procedure TPlayer.CatchFire(Attacker: Word); begin + if FFireTime <= 0 then + g_Sound_PlayExAt('SOUND_IGNITE', FObj.X, FObj.Y); FFireTime := 100; FFireAttacker := Attacker; if g_Game_IsNet and g_Game_IsServer then diff --git a/src/game/g_weapons.pas b/src/game/g_weapons.pas index 5505731..21b2061 100644 --- a/src/game/g_weapons.pas +++ b/src/game/g_weapons.pas @@ -1117,6 +1117,7 @@ begin g_Sound_CreateWADEx('SOUND_WEAPON_FIRECGUN', GameWAD+':SOUNDS\FIRECGUN'); g_Sound_CreateWADEx('SOUND_WEAPON_FIREBFG', GameWAD+':SOUNDS\FIREBFG'); g_Sound_CreateWADEx('SOUND_FIRE', GameWAD+':SOUNDS\FIRE'); + g_Sound_CreateWADEx('SOUND_IGNITE', GameWAD+':SOUNDS\IGNITE'); g_Sound_CreateWADEx('SOUND_WEAPON_STARTFIREBFG', GameWAD+':SOUNDS\STARTFIREBFG'); g_Sound_CreateWADEx('SOUND_WEAPON_EXPLODEROCKET', GameWAD+':SOUNDS\EXPLODEROCKET'); g_Sound_CreateWADEx('SOUND_WEAPON_EXPLODEBFG', GameWAD+':SOUNDS\EXPLODEBFG'); @@ -1186,6 +1187,7 @@ begin g_Sound_Delete('SOUND_WEAPON_FIRECGUN'); g_Sound_Delete('SOUND_WEAPON_FIREBFG'); g_Sound_Delete('SOUND_FIRE'); + g_Sound_Delete('SOUND_IGNITE'); g_Sound_Delete('SOUND_WEAPON_STARTFIREBFG'); g_Sound_Delete('SOUND_WEAPON_EXPLODEROCKET'); g_Sound_Delete('SOUND_WEAPON_EXPLODEBFG');