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
|
|
|
|
{
|
|
|
|
DECLARE_ACTOR (AArtiBoostArmor, AInventory)
|
|
|
|
public:
|
|
|
|
bool Use (bool pickup);
|
|
|
|
};
|
|
|
|
|
|
|
|
FState AArtiBoostArmor::States[] =
|
|
|
|
{
|
|
|
|
#define S_ARTI_ARMOR1 0
|
|
|
|
S_BRIGHT (BRAC, 'A', 4, NULL , &States[1]),
|
|
|
|
S_BRIGHT (BRAC, 'B', 4, NULL , &States[2]),
|
|
|
|
S_BRIGHT (BRAC, 'C', 4, NULL , &States[3]),
|
|
|
|
S_BRIGHT (BRAC, 'D', 4, NULL , &States[4]),
|
|
|
|
S_BRIGHT (BRAC, 'E', 4, NULL , &States[5]),
|
|
|
|
S_BRIGHT (BRAC, 'F', 4, NULL , &States[6]),
|
|
|
|
S_BRIGHT (BRAC, 'G', 4, NULL , &States[7]),
|
|
|
|
S_BRIGHT (BRAC, 'H', 4, NULL , &States[0]),
|
|
|
|
};
|
|
|
|
|
|
|
|
IMPLEMENT_ACTOR (AArtiBoostArmor, Hexen, 8041, 22)
|
2006-11-14 16:54:02 +00:00
|
|
|
PROP_Flags (MF_SPECIAL|MF_COUNTITEM)
|
2006-02-24 04:48:15 +00:00
|
|
|
PROP_Flags2 (MF2_FLOATBOB)
|
|
|
|
PROP_SpawnState (0)
|
|
|
|
PROP_Inventory_DefMaxAmount
|
2008-02-16 10:23:12 +00:00
|
|
|
PROP_Inventory_PickupFlash (1)
|
|
|
|
PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND)
|
2006-02-24 04:48:15 +00:00
|
|
|
PROP_Inventory_Icon ("ARTIBRAC")
|
|
|
|
PROP_Inventory_PickupSound ("misc/p_pkup")
|
2006-06-17 20:29:41 +00:00
|
|
|
PROP_Inventory_PickupMessage("$TXT_ARTIBOOSTARMOR")
|
2006-02-24 04:48:15 +00:00
|
|
|
END_DEFAULTS
|
|
|
|
|
|
|
|
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;
|
|
|
|
if (!armor->TryPickup (Owner))
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
if (!armor->TryPickup (Owner))
|
|
|
|
{
|
|
|
|
armor->Destroy ();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|