mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- scriptified the weapon piece functions.
- fixed: ClearInventory did not process depleted items properly. - changed HexenArmor from UNDROPPABLE to UNTOSSABLE because this allowed to remove some special handling in ClearInventory. The only other place which checks this flag also checks UNTOSSABLE.
This commit is contained in:
parent
d8acf774a6
commit
30a8541a15
12 changed files with 290 additions and 313 deletions
|
@ -3183,7 +3183,7 @@ bool ADehackedPickup::ShouldRespawn ()
|
|||
void ADehackedPickup::PlayPickupSound (AActor *toucher)
|
||||
{
|
||||
if (RealPickup != nullptr)
|
||||
RealPickup->PlayPickupSound (toucher);
|
||||
RealPickup->CallPlayPickupSound (toucher);
|
||||
}
|
||||
|
||||
void ADehackedPickup::DoPickupSpecial (AActor *toucher)
|
||||
|
|
|
@ -79,71 +79,6 @@ void PClassInventory::Finalize(FStateDefinitions &statedef)
|
|||
((AActor*)Defaults)->flags |= MF_SPECIAL;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// PROC A_RestoreSpecialThing1
|
||||
//
|
||||
// Make a special thing visible again.
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AInventory, A_RestoreSpecialThing1)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AInventory);
|
||||
|
||||
self->renderflags &= ~RF_INVISIBLE;
|
||||
if (self->DoRespawn ())
|
||||
{
|
||||
S_Sound (self, CHAN_VOICE, "misc/spawn", 1, ATTN_IDLE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// PROC A_RestoreSpecialThing2
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AInventory, A_RestoreSpecialThing2)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AInventory);
|
||||
|
||||
self->flags |= MF_SPECIAL;
|
||||
if (!(self->GetDefault()->flags & MF_NOGRAVITY))
|
||||
{
|
||||
self->flags &= ~MF_NOGRAVITY;
|
||||
}
|
||||
self->SetState (self->SpawnState);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// PROC A_RestoreSpecialDoomThing
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AInventory, A_RestoreSpecialDoomThing)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AInventory);
|
||||
|
||||
self->renderflags &= ~RF_INVISIBLE;
|
||||
self->flags |= MF_SPECIAL;
|
||||
if (!(self->GetDefault()->flags & MF_NOGRAVITY))
|
||||
{
|
||||
self->flags &= ~MF_NOGRAVITY;
|
||||
}
|
||||
if (self->DoRespawn ())
|
||||
{
|
||||
self->SetState (self->SpawnState);
|
||||
S_Sound (self, CHAN_VOICE, "misc/spawn", 1, ATTN_IDLE);
|
||||
Spawn ("ItemFog", self->Pos(), ALLOW_REPLACE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int AInventory::StaticLastMessageTic;
|
||||
FString AInventory::StaticLastMessage;
|
||||
|
||||
|
@ -907,7 +842,7 @@ void AInventory::Touch (AActor *toucher)
|
|||
// real player to make noise.
|
||||
if (player != NULL)
|
||||
{
|
||||
PlayPickupSound (player->mo);
|
||||
CallPlayPickupSound (player->mo);
|
||||
if (!(ItemFlags & IF_NOSCREENFLASH))
|
||||
{
|
||||
player->bonuscount = BONUSADD;
|
||||
|
@ -915,7 +850,7 @@ void AInventory::Touch (AActor *toucher)
|
|||
}
|
||||
else
|
||||
{
|
||||
PlayPickupSound (toucher);
|
||||
CallPlayPickupSound (toucher);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1272,6 +1207,11 @@ bool AInventory::DoRespawn ()
|
|||
return true;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AInventory, DoRespawn)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(AInventory);
|
||||
ACTION_RETURN_BOOL(self->DoRespawn());
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
|
|
|
@ -78,181 +78,6 @@ void AWeaponPiece::Serialize(FSerializer &arc)
|
|||
("piecevalue", PieceValue, def->PieceValue);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// TryPickupWeaponPiece
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
bool AWeaponPiece::TryPickupRestricted (AActor *&toucher)
|
||||
{
|
||||
// Wrong class, but try to pick up for ammo
|
||||
if (CallShouldStay())
|
||||
{ // Can't pick up weapons for other classes in coop netplay
|
||||
return false;
|
||||
}
|
||||
|
||||
AWeapon * Defaults=(AWeapon*)GetDefaultByType(WeaponClass);
|
||||
|
||||
bool gaveSome = !!(toucher->GiveAmmo (Defaults->AmmoType1, Defaults->AmmoGive1) +
|
||||
toucher->GiveAmmo (Defaults->AmmoType2, Defaults->AmmoGive2));
|
||||
|
||||
if (gaveSome)
|
||||
{
|
||||
GoAwayAndDie ();
|
||||
}
|
||||
return gaveSome;
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// TryPickupWeaponPiece
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
bool AWeaponPiece::TryPickup (AActor *&toucher)
|
||||
{
|
||||
AInventory * inv;
|
||||
AWeaponHolder * hold=NULL;
|
||||
bool shouldStay = PrivateShouldStay ();
|
||||
int gaveAmmo;
|
||||
AWeapon * Defaults=(AWeapon*)GetDefaultByType(WeaponClass);
|
||||
|
||||
FullWeapon=NULL;
|
||||
for(inv=toucher->Inventory;inv;inv=inv->Inventory)
|
||||
{
|
||||
if (inv->IsKindOf(RUNTIME_CLASS(AWeaponHolder)))
|
||||
{
|
||||
hold=static_cast<AWeaponHolder*>(inv);
|
||||
|
||||
if (hold->PieceWeapon==WeaponClass) break;
|
||||
hold=NULL;
|
||||
}
|
||||
}
|
||||
if (!hold)
|
||||
{
|
||||
hold=static_cast<AWeaponHolder*>(Spawn(RUNTIME_CLASS(AWeaponHolder)));
|
||||
hold->BecomeItem();
|
||||
hold->AttachToOwner(toucher);
|
||||
hold->PieceMask=0;
|
||||
hold->PieceWeapon=WeaponClass;
|
||||
}
|
||||
|
||||
|
||||
if (shouldStay)
|
||||
{
|
||||
// Cooperative net-game
|
||||
if (hold->PieceMask & PieceValue)
|
||||
{
|
||||
// Already has the piece
|
||||
return false;
|
||||
}
|
||||
toucher->GiveAmmo (Defaults->AmmoType1, Defaults->AmmoGive1);
|
||||
toucher->GiveAmmo (Defaults->AmmoType2, Defaults->AmmoGive2);
|
||||
}
|
||||
else
|
||||
{ // Deathmatch or singleplayer game
|
||||
gaveAmmo = toucher->GiveAmmo (Defaults->AmmoType1, Defaults->AmmoGive1) +
|
||||
toucher->GiveAmmo (Defaults->AmmoType2, Defaults->AmmoGive2);
|
||||
|
||||
if (hold->PieceMask & PieceValue)
|
||||
{
|
||||
// Already has the piece, check if mana needed
|
||||
if (!gaveAmmo) return false;
|
||||
GoAwayAndDie();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
hold->PieceMask |= PieceValue;
|
||||
|
||||
// Check if weapon assembled
|
||||
if (hold->PieceMask== (1<<Defaults->health)-1)
|
||||
{
|
||||
if (!toucher->FindInventory (WeaponClass))
|
||||
{
|
||||
FullWeapon= static_cast<AWeapon*>(Spawn(WeaponClass));
|
||||
|
||||
// The weapon itself should not give more ammo to the player!
|
||||
FullWeapon->AmmoGive1=0;
|
||||
FullWeapon->AmmoGive2=0;
|
||||
FullWeapon->AttachToOwner(toucher);
|
||||
FullWeapon->AmmoGive1=Defaults->AmmoGive1;
|
||||
FullWeapon->AmmoGive2=Defaults->AmmoGive2;
|
||||
}
|
||||
}
|
||||
GoAwayAndDie();
|
||||
return true;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
bool AWeaponPiece::ShouldStay ()
|
||||
{
|
||||
return PrivateShouldStay ();
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
bool AWeaponPiece::PrivateShouldStay ()
|
||||
{
|
||||
// We want a weapon piece to behave like a weapon, so follow the exact
|
||||
// same logic as weapons when deciding whether or not to stay.
|
||||
if (((multiplayer &&
|
||||
(!deathmatch && !alwaysapplydmflags)) || (dmflags & DF_WEAPONS_STAY)) &&
|
||||
!(flags&MF_DROPPED))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// PickupMessage
|
||||
//
|
||||
// Returns the message to print when this actor is picked up.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
FString AWeaponPiece::PickupMessage ()
|
||||
{
|
||||
if (FullWeapon)
|
||||
{
|
||||
return FullWeapon->PickupMessage();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Super::PickupMessage();
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// DoPlayPickupSound
|
||||
//
|
||||
// Plays a sound when this actor is picked up.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void AWeaponPiece::PlayPickupSound (AActor *toucher)
|
||||
{
|
||||
if (FullWeapon)
|
||||
{
|
||||
FullWeapon->PlayPickupSound(toucher);
|
||||
}
|
||||
else
|
||||
{
|
||||
Super::PlayPickupSound(toucher);
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_FIELD(AWeaponPiece, PieceValue);
|
||||
DEFINE_FIELD(AWeaponPiece, WeaponClass);
|
||||
DEFINE_FIELD(AWeaponPiece, FullWeapon);
|
||||
|
|
|
@ -11,11 +11,6 @@ protected:
|
|||
public:
|
||||
|
||||
virtual void Serialize(FSerializer &arc) override;
|
||||
virtual bool TryPickup (AActor *&toucher) override;
|
||||
virtual bool TryPickupRestricted (AActor *&toucher) override;
|
||||
virtual bool ShouldStay () override;
|
||||
virtual FString PickupMessage () override;
|
||||
virtual void PlayPickupSound (AActor *toucher) override;
|
||||
|
||||
int PieceValue;
|
||||
PClassActor *WeaponClass;
|
||||
|
|
|
@ -3691,3 +3691,5 @@ SBarInfoCommand *SBarInfoCommandFlowControl::NextCommand(FScanner &sc)
|
|||
sc.MustGetToken('}');
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1211,12 +1211,7 @@ void AActor::ClearInventory()
|
|||
if (!(inv->ItemFlags & IF_UNDROPPABLE))
|
||||
{
|
||||
inv->DepleteOrDestroy();
|
||||
}
|
||||
else if (inv->GetClass() == RUNTIME_CLASS(AHexenArmor))
|
||||
{
|
||||
AHexenArmor *harmor = static_cast<AHexenArmor *> (inv);
|
||||
harmor->Slots[3] = harmor->Slots[2] = harmor->Slots[1] = harmor->Slots[0] = 0;
|
||||
invp = &inv->Inventory;
|
||||
if (!(inv->ObjectFlags & OF_EuthanizeMe)) invp = &inv->Inventory; // was only depleted so advance the pointer manually.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "zscript/inventory/inventory.txt"
|
||||
#include "zscript/inventory/inv_misc.txt"
|
||||
#include "zscript/inventory/weapons.txt"
|
||||
#include "zscript/inventory/weaponpiece.txt"
|
||||
#include "zscript/inventory/armor.txt"
|
||||
#include "zscript/inventory/ammo.txt"
|
||||
#include "zscript/inventory/health.txt"
|
||||
|
|
|
@ -66,7 +66,7 @@ class HexenArmor : Armor native
|
|||
Default
|
||||
{
|
||||
+Inventory.KEEPDEPLETED
|
||||
+Inventory.UNDROPPABLE
|
||||
+Inventory.UNTOSSABLE
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,44 +47,12 @@ class Inventory : Actor native
|
|||
virtual native bool DrawPowerup(int x, int y);
|
||||
virtual native void AbsorbDamage (int damage, Name damageType, out int newdamage);
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AInventory :: Travelled
|
||||
//
|
||||
// Called when an item in somebody's inventory is carried over to another
|
||||
// map, in case it needs to do special reinitialization.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
virtual void Travelled() {}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AInventory :: DoEffect
|
||||
//
|
||||
// Handles any effect an item might apply to its owner
|
||||
// Normally only used by subclasses of Powerup
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
virtual void DoEffect() {}
|
||||
|
||||
virtual double GetSpeedFactor() { return 1; }
|
||||
virtual bool GetNoTeleportFreeze() { return false; }
|
||||
virtual void ModifyDamage(int damage, Name damageType, out int newdamage, bool passive) {}
|
||||
virtual void AlterWeaponSprite(VisStyle vis, in out int changed) {}
|
||||
virtual void OwnerDied() {}
|
||||
|
||||
native bool DoRespawn();
|
||||
native bool GoAway();
|
||||
native void GoAwayAndDie();
|
||||
native void BecomeItem();
|
||||
native void BecomePickup();
|
||||
|
||||
// These are regular functions for the item itself.
|
||||
private native void A_RestoreSpecialDoomThing();
|
||||
private native void A_RestoreSpecialThing1();
|
||||
private native void A_RestoreSpecialThing2();
|
||||
|
||||
// In this case the caller function is more than a simple wrapper around the virtual method and
|
||||
// is what must be actually called to pick up an item.
|
||||
virtual protected native bool TryPickup(in out Actor toucher);
|
||||
|
@ -112,6 +80,92 @@ class Inventory : Actor native
|
|||
TNT1 A 1;
|
||||
Stop;
|
||||
}
|
||||
|
||||
// These are regular functions for the item itself.
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// PROC A_RestoreSpecialThing1
|
||||
//
|
||||
// Make a special thing visible again.
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void A_RestoreSpecialThing1()
|
||||
{
|
||||
bInvisible = false;
|
||||
if (DoRespawn ())
|
||||
{
|
||||
A_PlaySound ("misc/spawn", CHAN_VOICE);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// PROC A_RestoreSpecialThing2
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void A_RestoreSpecialThing2()
|
||||
{
|
||||
bSpecial = true;
|
||||
if (!Default.bNoGravity)
|
||||
{
|
||||
bNoGravity = false;
|
||||
}
|
||||
SetState (SpawnState);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// PROC A_RestoreSpecialDoomThing
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void A_RestoreSpecialDoomThing()
|
||||
{
|
||||
bInvisible = false;
|
||||
bSpecial = true;
|
||||
if (!Default.bNoGravity)
|
||||
{
|
||||
bNoGravity = false;
|
||||
}
|
||||
if (DoRespawn ())
|
||||
{
|
||||
SetState (SpawnState);
|
||||
A_PlaySound ("misc/spawn", CHAN_VOICE);
|
||||
Spawn ("ItemFog", Pos, ALLOW_REPLACE);
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AInventory :: Travelled
|
||||
//
|
||||
// Called when an item in somebody's inventory is carried over to another
|
||||
// map, in case it needs to do special reinitialization.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
virtual void Travelled() {}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// AInventory :: DoEffect
|
||||
//
|
||||
// Handles any effect an item might apply to its owner
|
||||
// Normally only used by subclasses of Powerup
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
virtual void DoEffect() {}
|
||||
|
||||
virtual double GetSpeedFactor() { return 1; }
|
||||
virtual bool GetNoTeleportFreeze() { return false; }
|
||||
virtual void ModifyDamage(int damage, Name damageType, out int newdamage, bool passive) {}
|
||||
virtual void AlterWeaponSprite(VisStyle vis, in out int changed) {}
|
||||
virtual void OwnerDied() {}
|
||||
|
||||
}
|
||||
|
||||
class StateProvider : Inventory native
|
||||
|
|
186
wadsrc/static/zscript/inventory/weaponpiece.txt
Normal file
186
wadsrc/static/zscript/inventory/weaponpiece.txt
Normal file
|
@ -0,0 +1,186 @@
|
|||
class WeaponHolder : Inventory native
|
||||
{
|
||||
native int PieceMask;
|
||||
native Class<Actor> PieceWeapon;
|
||||
|
||||
Default
|
||||
{
|
||||
+NOBLOCKMAP
|
||||
+NOSECTOR
|
||||
+INVENTORY.UNDROPPABLE
|
||||
}
|
||||
}
|
||||
|
||||
class WeaponPiece : Inventory native
|
||||
{
|
||||
Default
|
||||
{
|
||||
+WEAPONSPAWN;
|
||||
}
|
||||
|
||||
native int PieceValue;
|
||||
native Class<Weapon> WeaponClass;
|
||||
native Weapon FullWeapon;
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// TryPickupWeaponPiece
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
override bool TryPickupRestricted (in out Actor toucher)
|
||||
{
|
||||
// Wrong class, but try to pick up for ammo
|
||||
if (ShouldStay())
|
||||
{ // Can't pick up weapons for other classes in coop netplay
|
||||
return false;
|
||||
}
|
||||
|
||||
let Defaults = GetDefaultByType(WeaponClass);
|
||||
|
||||
bool gaveSome = !!(toucher.GiveAmmo (Defaults.AmmoType1, Defaults.AmmoGive1) +
|
||||
toucher.GiveAmmo (Defaults.AmmoType2, Defaults.AmmoGive2));
|
||||
|
||||
if (gaveSome)
|
||||
{
|
||||
GoAwayAndDie ();
|
||||
}
|
||||
return gaveSome;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// TryPickupWeaponPiece
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
override bool TryPickup (in out Actor toucher)
|
||||
{
|
||||
Inventory item;
|
||||
WeaponHolder hold = NULL;
|
||||
bool shouldStay = ShouldStay ();
|
||||
int gaveAmmo;
|
||||
let Defaults = GetDefaultByType(WeaponClass);
|
||||
|
||||
FullWeapon = NULL;
|
||||
for(item=toucher.Inv; item; item=item.Inv)
|
||||
{
|
||||
hold = WeaponHolder(item);
|
||||
if (hold != null)
|
||||
{
|
||||
if (hold.PieceWeapon == WeaponClass)
|
||||
{
|
||||
break;
|
||||
}
|
||||
hold = NULL;
|
||||
}
|
||||
}
|
||||
if (!hold)
|
||||
{
|
||||
hold = WeaponHolder(Spawn("WeaponHolder"));
|
||||
hold.BecomeItem();
|
||||
hold.AttachToOwner(toucher);
|
||||
hold.PieceMask = 0;
|
||||
hold.PieceWeapon = WeaponClass;
|
||||
}
|
||||
|
||||
if (shouldStay)
|
||||
{
|
||||
// Cooperative net-game
|
||||
if (hold.PieceMask & PieceValue)
|
||||
{
|
||||
// Already has the piece
|
||||
return false;
|
||||
}
|
||||
toucher.GiveAmmo (Defaults.AmmoType1, Defaults.AmmoGive1);
|
||||
toucher.GiveAmmo (Defaults.AmmoType2, Defaults.AmmoGive2);
|
||||
}
|
||||
else
|
||||
{ // Deathmatch or singleplayer game
|
||||
gaveAmmo = toucher.GiveAmmo (Defaults.AmmoType1, Defaults.AmmoGive1) +
|
||||
toucher.GiveAmmo (Defaults.AmmoType2, Defaults.AmmoGive2);
|
||||
|
||||
if (hold.PieceMask & PieceValue)
|
||||
{
|
||||
// Already has the piece, check if mana needed
|
||||
if (!gaveAmmo) return false;
|
||||
GoAwayAndDie();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
hold.PieceMask |= PieceValue;
|
||||
|
||||
// Check if weapon assembled
|
||||
if (hold.PieceMask == (1 << Defaults.health) - 1)
|
||||
{
|
||||
if (!toucher.FindInventory (WeaponClass))
|
||||
{
|
||||
FullWeapon= Weapon(Spawn(WeaponClass));
|
||||
|
||||
// The weapon itself should not give more ammo to the player.
|
||||
FullWeapon.AmmoGive1 = 0;
|
||||
FullWeapon.AmmoGive2 = 0;
|
||||
FullWeapon.AttachToOwner(toucher);
|
||||
FullWeapon.AmmoGive1 = Defaults.AmmoGive1;
|
||||
FullWeapon.AmmoGive2 = Defaults.AmmoGive2;
|
||||
}
|
||||
}
|
||||
GoAwayAndDie();
|
||||
return true;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
override bool ShouldStay ()
|
||||
{
|
||||
// We want a weapon piece to behave like a weapon, so follow the exact
|
||||
// same logic as weapons when deciding whether or not to stay.
|
||||
return (((multiplayer &&
|
||||
(!deathmatch && !alwaysapplydmflags)) || sv_weaponstay) && !bDropped);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// PickupMessage
|
||||
//
|
||||
// Returns the message to print when this actor is picked up.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
override String PickupMessage ()
|
||||
{
|
||||
if (FullWeapon)
|
||||
{
|
||||
return FullWeapon.PickupMessage();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Super.PickupMessage();
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// DoPlayPickupSound
|
||||
//
|
||||
// Plays a sound when this actor is picked up.
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
override void PlayPickupSound (Actor toucher)
|
||||
{
|
||||
if (FullWeapon)
|
||||
{
|
||||
FullWeapon.PlayPickupSound(toucher);
|
||||
}
|
||||
else
|
||||
{
|
||||
Super.PlayPickupSound(toucher);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -104,27 +104,6 @@ class WeaponGiver : Weapon native
|
|||
}
|
||||
}
|
||||
|
||||
class WeaponHolder : Inventory native
|
||||
{
|
||||
native int PieceMask;
|
||||
native Class<Actor> PieceWeapon;
|
||||
|
||||
Default
|
||||
{
|
||||
+NOBLOCKMAP
|
||||
+NOSECTOR
|
||||
+INVENTORY.UNDROPPABLE
|
||||
}
|
||||
}
|
||||
|
||||
class WeaponPiece : Inventory native
|
||||
{
|
||||
Default
|
||||
{
|
||||
+WEAPONSPAWN;
|
||||
}
|
||||
}
|
||||
|
||||
struct WeaponSlots native
|
||||
{
|
||||
native bool, int, int LocateWeapon(class<Weapon> weap);
|
||||
|
|
|
@ -399,4 +399,4 @@ extend class PlayerPawn
|
|||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue