- Removed FourthWeaponClass and based Hexen's fourth weapons on the generic weapon

pieces.
- Added DECORATE conversions for Hexen's Fighter weapons by Karate Chris.
- Added aWeaponGiver class to generalize the standing AssaultGun.
- converted a_Strifeweapons.cpp to DECORATE, except for the Sigil.


SVN r1129 (trunk)
This commit is contained in:
Christoph Oelckers 2008-08-08 10:24:08 +00:00
commit b695330e90
29 changed files with 1106 additions and 583 deletions

View file

@ -13,6 +13,7 @@
#include "cmdlib.h"
#include "templates.h"
#include "sbar.h"
#include "thingdef/thingdef.h"
#define BONUSADD 6
@ -579,6 +580,40 @@ FState *AWeapon::GetAltAtkState (bool hold)
return state;
}
/* Weapon giver ***********************************************************/
class AWeaponGiver : public AWeapon
{
DECLARE_STATELESS_ACTOR(AWeaponGiver, AWeapon)
public:
bool TryPickup(AActor *toucher);
};
IMPLEMENT_ABSTRACT_ACTOR(AWeaponGiver)
bool AWeaponGiver::TryPickup(AActor *toucher)
{
FDropItem *di = GetDropItems(GetClass());
if (di != NULL)
{
const PClass *ti = PClass::FindClass(di->Name);
if (ti->IsDescendantOf(RUNTIME_CLASS(AWeapon)))
{
AWeapon *weap = static_cast<AWeapon*>(Spawn(di->Name, 0, 0, 0, NO_REPLACE));
if (weap != NULL)
{
bool res = weap->TryPickup(toucher);
if (!res) weap->Destroy();
else GoAwayAndDie();
return res;
}
}
}
return false;
}
/* Weapon slots ***********************************************************/
FWeaponSlots LocalWeapons;