2006-02-24 04:48:15 +00:00
|
|
|
#include "info.h"
|
|
|
|
#include "a_pickups.h"
|
|
|
|
#include "a_artifacts.h"
|
|
|
|
#include "gstrings.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "gi.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
|
|
|
|
// Boost Armor Artifact (Dragonskin Bracers) --------------------------------
|
|
|
|
|
|
|
|
class AArtiBoostArmor : public AInventory
|
|
|
|
{
|
2008-08-03 19:42:24 +00:00
|
|
|
DECLARE_CLASS (AArtiBoostArmor, AInventory)
|
2006-02-24 04:48:15 +00:00
|
|
|
public:
|
|
|
|
bool Use (bool pickup);
|
|
|
|
};
|
|
|
|
|
2008-08-03 19:42:24 +00:00
|
|
|
IMPLEMENT_CLASS (AArtiBoostArmor)
|
2006-02-24 04:48:15 +00:00
|
|
|
|
|
|
|
bool AArtiBoostArmor::Use (bool pickup)
|
|
|
|
{
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
if (gameinfo.gametype == GAME_Hexen)
|
|
|
|
{
|
|
|
|
AHexenArmor *armor;
|
|
|
|
|
|
|
|
for (int i = 0; i < 4; ++i)
|
|
|
|
{
|
2006-07-16 09:10:45 +00:00
|
|
|
armor = Spawn<AHexenArmor> (0,0,0, NO_REPLACE);
|
2006-02-24 04:48:15 +00:00
|
|
|
armor->flags |= MF_DROPPED;
|
|
|
|
armor->health = i;
|
|
|
|
armor->Amount = 1;
|
2008-09-13 22:08:41 +00:00
|
|
|
if (!armor->CallTryPickup (Owner))
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
armor->Destroy ();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return count != 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-07-16 09:10:45 +00:00
|
|
|
ABasicArmorBonus *armor = Spawn<ABasicArmorBonus> (0,0,0, NO_REPLACE);
|
2006-02-24 04:48:15 +00:00
|
|
|
armor->flags |= MF_DROPPED;
|
|
|
|
armor->SaveAmount = 50;
|
|
|
|
armor->MaxSaveAmount = 300;
|
2008-09-13 22:08:41 +00:00
|
|
|
if (!armor->CallTryPickup (Owner))
|
2006-02-24 04:48:15 +00:00
|
|
|
{
|
|
|
|
armor->Destroy ();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|