From: binarymaster Date: Wed, 1 Mar 2017 21:49:13 +0000 (+0300) Subject: fix small spider pain sound and sensitivity X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=e706b4fd119a5f468477a139daa7a1ae87a9cd7e;p=d2df-sdl.git fix small spider pain sound and sensitivity --- diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index 85563aa..cde1aad 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -64,6 +64,7 @@ type FPain: Integer; FSleep: Integer; FPainSound: Boolean; + FPainTicks: Integer; FWaitAttackAnim: Boolean; FChainFire: Boolean; tx, ty: Integer; @@ -1268,6 +1269,7 @@ begin Exit; FPainSound := True; + FPainTicks := 20; case FMonsterType of MONSTER_IMP, MONSTER_ZOMBY, MONSTER_SERG, @@ -1275,7 +1277,7 @@ begin g_Sound_PlayExAt('SOUND_MONSTER_PAIN', FObj.X, FObj.Y); MONSTER_SOUL, MONSTER_BARON, MONSTER_CACO, MONSTER_KNIGHT, MONSTER_DEMON, MONSTER_SPIDER, - MONSTER_CYBER: + MONSTER_BSP, MONSTER_CYBER: g_Sound_PlayExAt('SOUND_MONSTER_PAIN2', FObj.X, FObj.Y); MONSTER_VILE: g_Sound_PlayExAt('SOUND_MONSTER_VILE_PAIN', FObj.X, FObj.Y); @@ -2015,7 +2017,10 @@ begin Exit; end; - FPainSound := False; + if FPainTicks > 0 then + Dec(FPainTicks) + else + FPainSound := False; // Äâèãàåìñÿ: st := g_Obj_Move(@FObj, fall, True, True); @@ -2138,6 +2143,8 @@ begin FPain := MONSTERTABLE[FMonsterType].Pain; if gSoundEffectsDF then PainSound(); end; + if (not gSoundEffectsDF) and (FPain >= MONSTERTABLE[FMonsterType].MinPain) then + PainSound(); // Ñíèæàåì áîëü ñî âðåìåíåì: FPain := FPain - 5; @@ -2948,7 +2955,10 @@ begin Exit; end; - FPainSound := False; + if FPainTicks > 0 then + Dec(FPainTicks) + else + FPainSound := False; // Äâèãàåìñÿ: st := g_Obj_Move(@FObj, fall, True, True); @@ -3053,8 +3063,10 @@ begin if FPain >= MONSTERTABLE[FMonsterType].Pain then begin FPain := MONSTERTABLE[FMonsterType].Pain; - PainSound(); + if gSoundEffectsDF then PainSound(); end; + if (not gSoundEffectsDF) and (FPain >= MONSTERTABLE[FMonsterType].MinPain) then + PainSound(); // Ñíèæàåì áîëü ñî âðåìåíåì: FPain := FPain - 5;