mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-18 23:21:41 +00:00
- Remove extra *usefail definition for the pig player.
- Locks can now define more than one LockedSound by separating them with commas. The default setting for this property is now "*keytry", "misc/keytry". The first sound that is defined is the one that will be played for the lock. Thus, for standard locks, if the player class defines *keytry, that will be played. Otherwise, misc/keytry will be played as before. SVN r2827 (trunk)
This commit is contained in:
parent
df138fe4f9
commit
94ce4d5d69
2 changed files with 45 additions and 18 deletions
|
@ -45,9 +45,9 @@ struct Keygroup
|
||||||
struct Lock
|
struct Lock
|
||||||
{
|
{
|
||||||
TArray<Keygroup *> keylist;
|
TArray<Keygroup *> keylist;
|
||||||
|
TArray<FSoundID> locksound;
|
||||||
FString Message;
|
FString Message;
|
||||||
FString RemoteMsg;
|
FString RemoteMsg;
|
||||||
FSoundID locksound;
|
|
||||||
int rgb;
|
int rgb;
|
||||||
|
|
||||||
Lock()
|
Lock()
|
||||||
|
@ -230,7 +230,8 @@ static void ParseLock(FScanner &sc)
|
||||||
delete locks[keynum];
|
delete locks[keynum];
|
||||||
}
|
}
|
||||||
locks[keynum] = lock;
|
locks[keynum] = lock;
|
||||||
locks[keynum]->locksound = "misc/keytry";
|
locks[keynum]->locksound.Push("*keytry");
|
||||||
|
locks[keynum]->locksound.Push("misc/keytry");
|
||||||
ignorekey=false;
|
ignorekey=false;
|
||||||
}
|
}
|
||||||
else if (keynum != -1)
|
else if (keynum != -1)
|
||||||
|
@ -273,8 +274,21 @@ static void ParseLock(FScanner &sc)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4: // locksound
|
case 4: // locksound
|
||||||
sc.MustGetString();
|
lock->locksound.Clear();
|
||||||
lock->locksound = sc.String;
|
for (;;)
|
||||||
|
{
|
||||||
|
sc.MustGetString();
|
||||||
|
lock->locksound.Push(sc.String);
|
||||||
|
if (!sc.GetString())
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!sc.Compare(","))
|
||||||
|
{
|
||||||
|
sc.UnGet();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -398,27 +412,32 @@ void P_DeinitKeyMessages()
|
||||||
bool P_CheckKeys (AActor *owner, int keynum, bool remote)
|
bool P_CheckKeys (AActor *owner, int keynum, bool remote)
|
||||||
{
|
{
|
||||||
const char *failtext = NULL;
|
const char *failtext = NULL;
|
||||||
FSoundID failsound;
|
FSoundID *failsound;
|
||||||
|
int numfailsounds;
|
||||||
|
|
||||||
if (owner == NULL) return false;
|
if (owner == NULL) return false;
|
||||||
if (keynum<=0 || keynum>255) return true;
|
if (keynum<=0 || keynum>255) return true;
|
||||||
// Just a safety precaution. The messages should have been initialized upon game start.
|
// Just a safety precaution. The messages should have been initialized upon game start.
|
||||||
if (!keysdone) P_InitKeyMessages();
|
if (!keysdone) P_InitKeyMessages();
|
||||||
|
|
||||||
|
FSoundID failage[2] = { "*keytry", "misc/keytry" };
|
||||||
|
|
||||||
if (!locks[keynum])
|
if (!locks[keynum])
|
||||||
{
|
{
|
||||||
if (keynum==103 && gameinfo.gametype == GAME_Strife)
|
if (keynum == 103 && gameinfo.gametype == GAME_Strife)
|
||||||
failtext = "THIS AREA IS ONLY AVAILABLE IN THE RETAIL VERSION OF STRIFE";
|
failtext = "THIS AREA IS ONLY AVAILABLE IN THE RETAIL VERSION OF STRIFE";
|
||||||
else
|
else
|
||||||
failtext = "That doesn't seem to work";
|
failtext = "That doesn't seem to work";
|
||||||
|
|
||||||
failsound = "misc/keytry";
|
failsound = failage;
|
||||||
|
numfailsounds = countof(failage);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (locks[keynum]->check(owner)) return true;
|
if (locks[keynum]->check(owner)) return true;
|
||||||
failtext = remote? locks[keynum]->RemoteMsg : locks[keynum]->Message;
|
failtext = remote? locks[keynum]->RemoteMsg : locks[keynum]->Message;
|
||||||
failsound = locks[keynum]->locksound;
|
failsound = &locks[keynum]->locksound[0];
|
||||||
|
numfailsounds = locks[keynum]->locksound.Size();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we get here, that means the actor isn't holding an appropriate key.
|
// If we get here, that means the actor isn't holding an appropriate key.
|
||||||
|
@ -426,7 +445,16 @@ bool P_CheckKeys (AActor *owner, int keynum, bool remote)
|
||||||
if (owner == players[consoleplayer].camera)
|
if (owner == players[consoleplayer].camera)
|
||||||
{
|
{
|
||||||
PrintMessage(failtext);
|
PrintMessage(failtext);
|
||||||
S_Sound (owner, CHAN_VOICE, failsound, 1, ATTN_NORM);
|
|
||||||
|
// Play the first defined key sound.
|
||||||
|
for (int i = 0; i < numfailsounds; ++i)
|
||||||
|
{
|
||||||
|
if (failsound[i] != 0)
|
||||||
|
{
|
||||||
|
S_Sound (owner, CHAN_VOICE, failsound[i], 1, ATTN_NORM);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -890,15 +890,14 @@ $playeralias mage male *usefail PlayerMageFailedUse
|
||||||
$playeralias mage male *puzzfail PuzzleFailMage
|
$playeralias mage male *puzzfail PuzzleFailMage
|
||||||
$playersound mage male *jump mgjump
|
$playersound mage male *jump mgjump
|
||||||
|
|
||||||
$playeralias pig male *usefail PigActive1
|
$playeralias pig male *usefail PigActive1
|
||||||
$PlayerAlias Pig Male *UseFail PigActive1
|
$playeralias pig male *puzzfail PigActive2
|
||||||
$playeralias Pig Male *PuzzFail PigActive2
|
$playeralias pig male *grunt PigActive1
|
||||||
$PlayerAlias Pig Male *Grunt PigActive1
|
$playeralias pig male *land PigActive2
|
||||||
$PlayerAlias Pig Male *Land PigActive2
|
$playeralias pig male *jump PigActive1
|
||||||
$PlayerAlias Pig Male *Jump PigActive1
|
$playeralias pig male *poison PigActive2
|
||||||
$PlayerAlias Pig Male *Poison PigActive2
|
$playeralias pig male *falling PigPain
|
||||||
$PlayerAlias Pig Male *Falling PigPain
|
$playeralias pig male *splat PigDeath
|
||||||
$PlayerAlias Pig Male *Splat PigDeath
|
|
||||||
|
|
||||||
$alias world/drip Ambient10
|
$alias world/drip Ambient10
|
||||||
$alias world/watersplash WaterSplash
|
$alias world/watersplash WaterSplash
|
||||||
|
|
Loading…
Reference in a new issue