mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 16:07:55 +00:00
760f70d3f1
so that all files are included by a central one instead of compiling each one separately. This speeds up the compilation process by 25% when doing a complete rebuild in Visual C. - Cleaned up more header dependencies. SVN r1226 (trunk)
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#include "info.h"
|
|
#include "a_pickups.h"
|
|
#include "a_artifacts.h"
|
|
#include "gstrings.h"
|
|
#include "p_local.h"
|
|
#include "s_sound.h"
|
|
#include "c_console.h"
|
|
#include "doomstat.h"
|
|
|
|
IMPLEMENT_CLASS (APuzzleItem)
|
|
|
|
void APuzzleItem::Serialize (FArchive &arc)
|
|
{
|
|
Super::Serialize (arc);
|
|
arc << PuzzleItemNumber;
|
|
}
|
|
|
|
bool APuzzleItem::HandlePickup (AInventory *item)
|
|
{
|
|
// Can't carry more than 1 of each puzzle item in coop netplay
|
|
if (multiplayer && !deathmatch && item->GetClass() == GetClass())
|
|
{
|
|
return true;
|
|
}
|
|
return Super::HandlePickup (item);
|
|
}
|
|
|
|
bool APuzzleItem::Use (bool pickup)
|
|
{
|
|
if (P_UsePuzzleItem (Owner, PuzzleItemNumber))
|
|
{
|
|
return true;
|
|
}
|
|
// [RH] Always play the sound if the use fails.
|
|
S_Sound (Owner, CHAN_VOICE, "*puzzfail", 1, ATTN_IDLE);
|
|
if (Owner != NULL && Owner->CheckLocalView (consoleplayer))
|
|
{
|
|
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;
|
|
}
|
|
|
|
bool APuzzleItem::ShouldStay ()
|
|
{
|
|
return !!multiplayer;
|
|
}
|
|
|