diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d53429d05..41419df79 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 diff --git a/src/g_hexen/a_boostarmor.cpp b/src/g_hexen/a_boostarmor.cpp deleted file mode 100644 index b910f63e7..000000000 --- a/src/g_hexen/a_boostarmor.cpp +++ /dev/null @@ -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(); - 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(); - armor->flags |= MF_DROPPED; - armor->SaveAmount = 50; - armor->MaxSaveAmount = 300; - if (!armor->CallTryPickup (Owner)) - { - armor->Destroy (); - return false; - } - else - { - return true; - } - } -} - diff --git a/src/g_hexen/a_hexenmisc.cpp b/src/g_hexen/a_hexenmisc.cpp index 2384a8518..fa8d151a7 100644 --- a/src/g_hexen/a_hexenmisc.cpp +++ b/src/g_hexen/a_hexenmisc.cpp @@ -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" diff --git a/wadsrc/static/zscript/hexen/boostarmor.txt b/wadsrc/static/zscript/hexen/boostarmor.txt index 4c14b69bc..f8c797c99 100644 --- a/wadsrc/static/zscript/hexen/boostarmor.txt +++ b/wadsrc/static/zscript/hexen/boostarmor.txt @@ -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; + } + } + } + + }