- added FailSound property to PuzzleItem

This commit is contained in:
Blue Shadow 2022-06-12 14:03:14 +03:00 committed by Christoph Oelckers
parent f1dec835d7
commit d862bf4347
1 changed files with 4 additions and 1 deletions

View File

@ -92,9 +92,11 @@ class PuzzleItem : Inventory
{
meta int PuzzleItemNumber;
meta String PuzzFailMessage;
meta Sound PuzzFailSound;
property Number: PuzzleItemNumber;
property FailMessage: PuzzFailMessage;
property FailSound: PuzzFailSound;
Default
{
@ -104,6 +106,7 @@ class PuzzleItem : Inventory
Inventory.UseSound "PuzzleSuccess";
Inventory.PickupSound "misc/i_pkup";
PuzzleItem.FailMessage("$TXT_USEPUZZLEFAILED");
PuzzleItem.FailSound "*puzzfail";
}
override bool HandlePickup (Inventory item)
@ -124,7 +127,7 @@ class PuzzleItem : Inventory
return true;
}
// [RH] Always play the sound if the use fails.
Owner.A_StartSound ("*puzzfail", CHAN_VOICE);
Owner.A_StartSound (PuzzFailSound, CHAN_VOICE);
if (Owner.CheckLocalView())
{
Console.MidPrint (null, PuzzFailMessage, true);