- Added custom fail messages to the puzzle items.

SVN r299 (trunk)
This commit is contained in:
Christoph Oelckers 2006-08-18 22:22:39 +00:00
parent aef5df6628
commit ab947ce16b
4 changed files with 19 additions and 2 deletions

View file

@ -1,3 +1,6 @@
August 19, 2006 (Changes by Graf Zahl)
- Added custom fail messages to the puzzle items.
August 17, 2006 (Changes by Graf Zahl)
- Added a check to the map loader to check whether the map label
is in the same WAD as the following lump.

View file

@ -39,7 +39,10 @@ bool APuzzleItem::Use (bool pickup)
}
// [RH] Always play the sound if the use fails.
S_Sound (Owner, CHAN_VOICE, "*puzzfail", 1, ATTN_IDLE);
C_MidPrintBold (GStrings("TXT_USEPUZZLEFAILED"));
const char *message = GetClass()->Meta.GetMetaString (AIMETA_PuzzFailMessage);
if (message != NULL && *message=='$') message = GStrings[message + 1];
if (message == NULL) message = GStrings("TXT_USEPUZZLEFAILED");
C_MidPrintBold (message);
return false;
}

View file

@ -76,6 +76,7 @@ enum
AIMETA_DropAmount, // specifies the amount for a dropped ammo item
AIMETA_LowHealth,
AIMETA_LowHealthMessage,
AIMETA_PuzzFailMessage,
};
enum

View file

@ -3278,7 +3278,7 @@ static void InventoryUsesound (AInventory *defaults, Baggage &bag)
//==========================================================================
//
//==========================================================================
static void InventoryGiveQuest (APuzzleItem *defaults, Baggage &bag)
static void InventoryGiveQuest (AInventory *defaults, Baggage &bag)
{
SC_MustGetNumber();
bag.Info->Class->Meta.SetMetaInt(AIMETA_GiveQuest, sc_Number);
@ -3305,6 +3305,15 @@ static void PuzzleitemNumber (APuzzleItem *defaults, Baggage &bag)
defaults->PuzzleItemNumber=sc_Number;
}
//==========================================================================
//
//==========================================================================
static void PuzzleitemFailMsg (APuzzleItem *defaults, Baggage &bag)
{
SC_MustGetString();
bag.Info->Class->Meta.SetMetaString(AIMETA_PuzzFailMessage, sc_String);
}
//==========================================================================
//
//==========================================================================
@ -3837,6 +3846,7 @@ static const ActorProps props[] =
{ "powerup.duration", (apf)PowerupDuration, RUNTIME_CLASS(APowerupGiver) },
{ "powerup.type", (apf)PowerupType, RUNTIME_CLASS(APowerupGiver) },
{ "projectile", ActorProjectile, RUNTIME_CLASS(AActor) },
{ "puzzleitem.failmessage", (apf)PuzzleitemFailMsg, RUNTIME_CLASS(APuzzleItem) },
{ "puzzleitem.number", (apf)PuzzleitemNumber, RUNTIME_CLASS(APuzzleItem) },
{ "radius", ActorRadius, RUNTIME_CLASS(AActor) },
{ "radiusdamagefactor", ActorRadiusDamageFactor, RUNTIME_CLASS(AActor) },