- scriptified ArtiBoostArmor.

This commit is contained in:
Christoph Oelckers 2016-11-26 10:08:25 +01:00
parent 4e802652c7
commit f508a57bb8
4 changed files with 46 additions and 67 deletions

View file

@ -855,7 +855,6 @@ set( NOT_COMPILED_SOURCE_FILES
${OTHER_SYSTEM_SOURCES}
sc_man_scanner.h
sc_man_scanner.re
g_hexen/a_boostarmor.cpp
g_hexen/a_clericflame.cpp
g_hexen/a_clericholy.cpp
g_hexen/a_clericmace.cpp

View file

@ -1,64 +0,0 @@
/*
#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_CLASS (AArtiBoostArmor, AInventory)
public:
bool Use (bool pickup);
};
IMPLEMENT_CLASS(AArtiBoostArmor, false, false)
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>();
armor->flags |= MF_DROPPED;
armor->health = i;
armor->Amount = 1;
if (!armor->CallTryPickup (Owner))
{
armor->Destroy ();
}
else
{
count++;
}
}
return count != 0;
}
else
{
ABasicArmorBonus *armor = Spawn<ABasicArmorBonus>();
armor->flags |= MF_DROPPED;
armor->SaveAmount = 50;
armor->MaxSaveAmount = 300;
if (!armor->CallTryPickup (Owner))
{
armor->Destroy ();
return false;
}
else
{
return true;
}
}
}

View file

@ -24,7 +24,6 @@
#include "serializer.h"
// Include all the Hexen stuff here to reduce compile time
#include "a_boostarmor.cpp"
#include "a_clericflame.cpp"
#include "a_clericholy.cpp"
#include "a_clericmace.cpp"

View file

@ -1,7 +1,7 @@
// Boost Armor Artifact (Dragonskin Bracers) --------------------------------
class ArtiBoostArmor : Inventory native
class ArtiBoostArmor : Inventory
{
Default
{
@ -21,4 +21,49 @@ class ArtiBoostArmor : Inventory native
BRAC ABCDEFGH 4 Bright;
Loop;
}
override bool Use (bool pickup)
{
int count = 0;
if (gametype() == GAME_Hexen)
{
HexenArmor armor;
for (int i = 0; i < 4; ++i)
{
armor = HexenArmor(Spawn("HexenArmor"));
armor.bDropped = true;
armor.health = i;
armor.Amount = 1;
if (!armor.CallTryPickup (Owner))
{
armor.Destroy ();
}
else
{
count++;
}
}
return count != 0;
}
else
{
BasicArmorBonus armor = BasicArmorBonus(Spawn("BasicArmorBonus"));
armor.bDropped = true;
armor.SaveAmount = 50;
armor.MaxSaveAmount = 300;
if (!armor.CallTryPickup (Owner))
{
armor.Destroy ();
return false;
}
else
{
return true;
}
}
}
}