mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-12-15 23:21:46 +00:00
8a50004f55
- added call wrappers and script hooks for all relevant virtuals in AInventory. - made GetSpeedFactor and GetNoTeleportFreeze entirely scripted because they are too trivial - also do them iteratively, just like HandlePickup, because it's just a better way to do this stuff.
47 lines
1.2 KiB
C++
47 lines
1.2 KiB
C++
#pragma once
|
|
#include "a_pickups.h"
|
|
|
|
// Ammo: Something a weapon needs to operate
|
|
class PClassAmmo : public PClassInventory
|
|
{
|
|
DECLARE_CLASS(PClassAmmo, PClassInventory)
|
|
protected:
|
|
virtual void DeriveData(PClass *newclass);
|
|
public:
|
|
PClassAmmo();
|
|
|
|
int DropAmount; // Specifies the amount for a dropped ammo item.
|
|
};
|
|
|
|
class AAmmo : public AInventory
|
|
{
|
|
DECLARE_CLASS_WITH_META(AAmmo, AInventory, PClassAmmo)
|
|
public:
|
|
|
|
virtual void Serialize(FSerializer &arc) override;
|
|
virtual AInventory *CreateCopy (AActor *other) override;
|
|
virtual bool HandlePickup (AInventory *item) override;
|
|
virtual AInventory *CreateTossable () override;
|
|
PClassActor *GetParentAmmo () const;
|
|
|
|
int BackpackAmount, BackpackMaxAmount;
|
|
};
|
|
|
|
|
|
// A backpack gives you one clip of each ammo and doubles your
|
|
// normal maximum ammo amounts.
|
|
class ABackpackItem : public AInventory
|
|
{
|
|
DECLARE_CLASS (ABackpackItem, AInventory)
|
|
public:
|
|
|
|
virtual void Serialize(FSerializer &arc) override;
|
|
virtual bool HandlePickup (AInventory *item) override;
|
|
virtual AInventory *CreateCopy (AActor *other) override;
|
|
virtual AInventory *CreateTossable () override;
|
|
virtual void DetachFromOwner () override;
|
|
|
|
bool bDepleted;
|
|
};
|
|
|
|
|