mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-16 15:31:30 +00:00
1bd6ac028b
- Added a PickupMessage property to the internal actor parser, replaced most of the virtual PickupMessages with it and placed the code that reads the metadata into AInventory::PickupMessage. Now the PickupMessage method is truly virtual and I can do: Added a Health.LowMessage property to define double message items like Doom's medikit in DECORATE. - Since defining Mana3 as an ammo type and then overriding the TryPickup method means that this item defeats all ammo checks in the game it might as well be defined as a CustomInventory item. At least this fixes the amount given in easy and very hard skills. - Converted all ammo items to DECORATE. - Changed internal property setting of ammo types and sister weapons to use fuglyname as for DECORATE definitions. This allows to export the ammo definitions into DECORATE definitions without doing it for the weapons themselves. - Replaced obituary methods with actor properties. - Fixed: The secret map check didn't work for maps inside Zips. SVN r196 (trunk)
84 lines
1.9 KiB
C++
84 lines
1.9 KiB
C++
#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)
|
|
PROP_Flags (MF_SPECIAL)
|
|
PROP_Flags2 (MF2_FLOATBOB)
|
|
PROP_SpawnState (0)
|
|
PROP_Inventory_DefMaxAmount
|
|
PROP_Inventory_FlagsSet (IF_INVBAR|IF_PICKUPFLASH|IF_FANCYPICKUPSOUND)
|
|
PROP_Inventory_Icon ("ARTIBRAC")
|
|
PROP_Inventory_PickupSound ("misc/p_pkup")
|
|
PROP_Inventory_PickupMessage("$TXT_ARTIBOOSTARMOR")
|
|
END_DEFAULTS
|
|
|
|
bool AArtiBoostArmor::Use (bool pickup)
|
|
{
|
|
int count = 0;
|
|
|
|
if (gameinfo.gametype == GAME_Hexen)
|
|
{
|
|
AHexenArmor *armor;
|
|
|
|
for (int i = 0; i < 4; ++i)
|
|
{
|
|
armor = Spawn<AHexenArmor> (0,0,0);
|
|
armor->flags |= MF_DROPPED;
|
|
armor->health = i;
|
|
armor->Amount = 1;
|
|
if (!armor->TryPickup (Owner))
|
|
{
|
|
armor->Destroy ();
|
|
}
|
|
else
|
|
{
|
|
count++;
|
|
}
|
|
}
|
|
return count != 0;
|
|
}
|
|
else
|
|
{
|
|
ABasicArmorBonus *armor = Spawn<ABasicArmorBonus> (0,0,0);
|
|
armor->flags |= MF_DROPPED;
|
|
armor->SaveAmount = 50;
|
|
armor->MaxSaveAmount = 300;
|
|
if (!armor->TryPickup (Owner))
|
|
{
|
|
armor->Destroy ();
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
|