- 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
parent 6ab69165c7
commit b695330e90
29 changed files with 1109 additions and 586 deletions

View file

@ -1,3 +1,10 @@
August 8, 2008 (Changes by Graf Zahl)
- 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.
August 7, 2008 (Changes by Graf Zahl)
- Converted the rest of a_strifestuff.cpp to DECORATE.
- Fixed: AStalker::CheckMeleeRange did not perform all checks of AActor::CheckMeleeRange.

View file

@ -544,7 +544,6 @@ add_executable( zdoom WIN32
g_hexen/a_spike.cpp
g_hexen/a_summon.cpp
g_hexen/a_teleportother.cpp
g_hexen/a_weaponpieces.cpp
g_hexen/a_wraith.cpp
g_hexen/hexen_sbar.cpp
g_raven/a_artitele.cpp

View file

@ -221,7 +221,6 @@ WEAPON(CFlameAttack)
WEAPON(CFlameRotate)
ACTOR(CFlamePuff)
WEAPON(CFlameMissile)
ACTOR(DropWraithvergePieces)
WEAPON(CHolyAttack)
WEAPON(CHolyAttack2)
WEAPON(CHolyPalette)
@ -243,7 +242,6 @@ ACTOR(LightningRemove)
ACTOR(FreeTargMobj)
ACTOR(LastZap)
ACTOR(ZapMimic)
ACTOR(DropBloodscourgePieces)
WEAPON(MStaffAttack)
WEAPON(MStaffPalette)
ACTOR(MStaffTrack)
@ -264,7 +262,7 @@ WEAPON(FAxeCheckUpG)
WEAPON(FAxeCheckReadyG)
WEAPON(FHammerAttack)
WEAPON(FHammerThrow)
ACTOR(DropQuietusPieces)
ACTOR(DropWeaponPieces)
WEAPON(FSwordAttack)
WEAPON(FSwordFlames)
ACTOR(Summon)
@ -324,6 +322,20 @@ ACTOR(StalkerChaseDecide)
ACTOR(StalkerWalk)
ACTOR(StalkerAttack)
ACTOR(StalkerDrop)
ACTOR(JabDagger)
ACTOR(ClearFlash)
ACTOR(ShowElectricFlash)
ACTOR(FireArrow)
ACTOR(FireMiniMissile)
ACTOR(FireFlamer)
ACTOR(FlameDie)
ACTOR(FireMauler1)
ACTOR(FireMauler2Pre)
ACTOR(FireMauler2)
ACTOR(MaulerTorpedoWave)
ACTOR(BurnArea)
ACTOR(Burnination)
ACTOR(FireGrenade)
// Special code pointers for Strife's player - not to be used elsewhere!
ACTOR(ItBurnsItBurns)

View file

@ -228,7 +228,6 @@ public:
int inventorytics;
BYTE CurrentPlayerClass; // class # for this player instance
int pieces; // Fourth Weapon pieces
bool backpack;
int frags[MAXPLAYERS]; // kills of other players

View file

@ -6,6 +6,7 @@
#include "p_enemy.h"
#include "a_hexenglobal.h"
#include "gstrings.h"
#include "a_weaponpiece.h"
#define BLAST_FULLSTRENGTH 255
@ -30,72 +31,41 @@ void SpawnSpiritTail (AActor *spirit);
//==========================================================================
class AClericWeaponPiece : public AFourthWeaponPiece
class AClericWeaponPiece : public AWeaponPiece
{
DECLARE_CLASS (AClericWeaponPiece, AFourthWeaponPiece)
public:
void BeginPlay ();
DECLARE_CLASS (AClericWeaponPiece, AWeaponPiece)
protected:
bool MatchPlayerClass (AActor *toucher);
bool TryPickup (AActor *toucher);
};
IMPLEMENT_CLASS (AClericWeaponPiece)
bool AClericWeaponPiece::MatchPlayerClass (AActor *toucher)
bool AClericWeaponPiece::TryPickup (AActor *toucher)
{
return !toucher->IsKindOf (PClass::FindClass(NAME_FighterPlayer)) &&
!toucher->IsKindOf (PClass::FindClass(NAME_MagePlayer));
if (!toucher->IsKindOf (PClass::FindClass(NAME_MagePlayer)) &&
!toucher->IsKindOf (PClass::FindClass(NAME_FighterPlayer)))
{
return Super::TryPickup(toucher);
}
else
{ // Wrong class, but try to pick up for ammo
if (ShouldStay())
{
// Can't pick up weapons for other classes in coop netplay
return false;
}
//==========================================================================
AWeapon * Defaults=(AWeapon*)GetDefaultByType(WeaponClass);
class ACWeaponPiece1 : public AClericWeaponPiece
bool gaveSome = !!(toucher->GiveAmmo (Defaults->AmmoType1, Defaults->AmmoGive1) +
toucher->GiveAmmo (Defaults->AmmoType2, Defaults->AmmoGive2));
if (gaveSome)
{
DECLARE_CLASS (ACWeaponPiece1, AClericWeaponPiece)
public:
void BeginPlay ();
};
IMPLEMENT_CLASS (ACWeaponPiece1)
void ACWeaponPiece1::BeginPlay ()
{
Super::BeginPlay ();
PieceValue = WPIECE1<<3;
GoAwayAndDie ();
}
//==========================================================================
class ACWeaponPiece2 : public AClericWeaponPiece
{
DECLARE_CLASS (ACWeaponPiece2, AClericWeaponPiece)
public:
void BeginPlay ();
};
IMPLEMENT_CLASS (ACWeaponPiece2)
void ACWeaponPiece2::BeginPlay ()
{
Super::BeginPlay ();
PieceValue = WPIECE2<<3;
return gaveSome;
}
//==========================================================================
class ACWeaponPiece3 : public AClericWeaponPiece
{
DECLARE_CLASS (ACWeaponPiece3, AClericWeaponPiece)
public:
void BeginPlay ();
};
IMPLEMENT_CLASS (ACWeaponPiece3)
void ACWeaponPiece3::BeginPlay ()
{
Super::BeginPlay ();
PieceValue = WPIECE3<<3;
}
// Cleric's Wraithverge (Holy Symbol?) --------------------------------------
@ -619,42 +589,6 @@ void A_CHolyCheckScream (AActor *actor)
}
}
void AClericWeaponPiece::BeginPlay ()
{
Super::BeginPlay ();
FourthWeaponClass = RUNTIME_CLASS(ACWeapWraithverge);
}
//============================================================================
//
// A_DropWraithvergePieces
//
//============================================================================
void A_DropWraithvergePieces (AActor *actor)
{
static const PClass *pieces[3] =
{
RUNTIME_CLASS(ACWeaponPiece1),
RUNTIME_CLASS(ACWeaponPiece2),
RUNTIME_CLASS(ACWeaponPiece3)
};
for (int i = 0, j = 0, fineang = 0; i < 3; ++i)
{
AActor *piece = Spawn (pieces[j], actor->x, actor->y, actor->z, ALLOW_REPLACE);
if (piece != NULL)
{
piece->momx = actor->momx + finecosine[fineang];
piece->momy = actor->momy + finesine[fineang];
piece->momz = actor->momz;
piece->flags |= MF_DROPPED;
fineang += FINEANGLES/3;
j = (j == 0) ? (pr_wraithvergedrop() & 1) + 1 : 3-j;
}
}
}
//============================================================================
//
// A_ClericAttack

View file

@ -9,83 +9,82 @@
#include "p_pspr.h"
#include "gstrings.h"
#include "a_hexenglobal.h"
#include "a_weaponpiece.h"
#include "thingdef/thingdef.h"
static FRandom pr_quietusdrop ("QuietusDrop");
static FRandom pr_fswordflame ("FSwordFlame");
void A_FSwordAttack (AActor *actor);
void A_DropQuietusPieces (AActor *);
void A_FSwordFlames (AActor *);
//==========================================================================
class AFighterWeaponPiece : public AFourthWeaponPiece
class AFighterWeaponPiece : public AWeaponPiece
{
DECLARE_STATELESS_ACTOR (AFighterWeaponPiece, AFourthWeaponPiece)
public:
void BeginPlay ();
DECLARE_CLASS (AFighterWeaponPiece, AWeaponPiece)
protected:
bool MatchPlayerClass (AActor *toucher);
bool TryPickup (AActor *toucher);
};
IMPLEMENT_CLASS (AFighterWeaponPiece)
bool AFighterWeaponPiece::MatchPlayerClass (AActor *toucher)
bool AFighterWeaponPiece::TryPickup (AActor *toucher)
{
return !toucher->IsKindOf (PClass::FindClass(NAME_ClericPlayer)) &&
!toucher->IsKindOf (PClass::FindClass(NAME_MagePlayer));
if (!toucher->IsKindOf (PClass::FindClass(NAME_ClericPlayer)) &&
!toucher->IsKindOf (PClass::FindClass(NAME_MagePlayer)))
{
return Super::TryPickup(toucher);
}
else
{ // Wrong class, but try to pick up for ammo
if (ShouldStay())
{
// Can't pick up weapons for other classes in coop netplay
return false;
}
//==========================================================================
AWeapon * Defaults=(AWeapon*)GetDefaultByType(WeaponClass);
class AFWeaponPiece1 : public AFighterWeaponPiece
bool gaveSome = !!(toucher->GiveAmmo (Defaults->AmmoType1, Defaults->AmmoGive1) +
toucher->GiveAmmo (Defaults->AmmoType2, Defaults->AmmoGive2));
if (gaveSome)
{
DECLARE_CLASS (AFWeaponPiece1, AFighterWeaponPiece)
public:
void BeginPlay ();
};
IMPLEMENT_CLASS (AFWeaponPiece1)
void AFWeaponPiece1::BeginPlay ()
{
Super::BeginPlay ();
PieceValue = WPIECE1;
GoAwayAndDie ();
}
return gaveSome;
}
}
//==========================================================================
//============================================================================
//
// A_DropQuietusPieces
//
//============================================================================
class AFWeaponPiece2 : public AFighterWeaponPiece
void A_DropWeaponPieces (AActor *actor)
{
DECLARE_CLASS (AFWeaponPiece2, AFighterWeaponPiece)
public:
void BeginPlay ();
};
int index=CheckIndex(3);
if (index<0) return;
IMPLEMENT_CLASS (AFWeaponPiece2)
void AFWeaponPiece2::BeginPlay ()
for (int i = 0, j = 0, fineang = 0; i < 3; ++i)
{
Super::BeginPlay ();
PieceValue = WPIECE2;
const PClass *cls = PClass::FindClass((ENamedName)StateParameters[index+j]);
if (cls)
{
AActor *piece = Spawn (cls, actor->x, actor->y, actor->z, ALLOW_REPLACE);
if (piece != NULL)
{
piece->momx = actor->momx + finecosine[fineang];
piece->momy = actor->momy + finesine[fineang];
piece->momz = actor->momz;
piece->flags |= MF_DROPPED;
fineang += FINEANGLES/3;
j = (j == 0) ? (pr_quietusdrop() & 1) + 1 : 3-j;
}
}
}
}
//==========================================================================
class AFWeaponPiece3 : public AFighterWeaponPiece
{
DECLARE_CLASS (AFWeaponPiece3, AFighterWeaponPiece)
public:
void BeginPlay ();
};
IMPLEMENT_CLASS (AFWeaponPiece3)
void AFWeaponPiece3::BeginPlay ()
{
Super::BeginPlay ();
PieceValue = WPIECE3;
}
// Fighter Sword Missile ----------------------------------------------------
@ -154,42 +153,6 @@ void A_FSwordFlames (AActor *actor)
}
}
//============================================================================
//
// A_DropQuietusPieces
//
//============================================================================
void A_DropQuietusPieces (AActor *actor)
{
static const PClass *pieces[3] =
{
RUNTIME_CLASS(AFWeaponPiece1),
RUNTIME_CLASS(AFWeaponPiece2),
RUNTIME_CLASS(AFWeaponPiece3)
};
for (int i = 0, j = 0, fineang = 0; i < 3; ++i)
{
AActor *piece = Spawn (pieces[j], actor->x, actor->y, actor->z, ALLOW_REPLACE);
if (piece != NULL)
{
piece->momx = actor->momx + finecosine[fineang];
piece->momy = actor->momy + finesine[fineang];
piece->momz = actor->momz;
piece->flags |= MF_DROPPED;
fineang += FINEANGLES/3;
j = (j == 0) ? (pr_quietusdrop() & 1) + 1 : 3-j;
}
}
}
void AFighterWeaponPiece::BeginPlay ()
{
Super::BeginPlay ();
FourthWeaponClass = PClass::FindClass ("FWeapQuietus");
}
//============================================================================
//
// A_FighterAttack

View file

@ -38,24 +38,6 @@ public:
bool IsOkayToAttack (AActor *link);
};
class AFourthWeaponPiece : public AInventory
{
DECLARE_STATELESS_ACTOR (AFourthWeaponPiece, AInventory)
HAS_OBJECT_POINTERS
public:
void Serialize (FArchive &arc);
bool TryPickup (AActor *toucher);
const char *PickupMessage ();
bool ShouldStay ();
void PlayPickupSound (AActor *toucher);
protected:
virtual bool MatchPlayerClass (AActor *toucher);
const PClass *FourthWeaponClass;
int PieceValue;
TObjPtr<AInventory> TempFourthWeapon;
bool PrivateShouldStay ();
};
class AFighterWeapon : public AWeapon
{
DECLARE_STATELESS_ACTOR (AFighterWeapon, AWeapon);

View file

@ -6,6 +6,7 @@
#include "p_enemy.h"
#include "a_hexenglobal.h"
#include "gstrings.h"
#include "a_weaponpiece.h"
static FRandom pr_mstafftrack ("MStaffTrack");
static FRandom pr_bloodscourgedrop ("BloodScourgeDrop");
@ -20,72 +21,41 @@ static divline_t BlockCheckLine;
//==========================================================================
class AMageWeaponPiece : public AFourthWeaponPiece
class AMageWeaponPiece : public AWeaponPiece
{
DECLARE_CLASS (AMageWeaponPiece, AFourthWeaponPiece)
public:
void BeginPlay ();
DECLARE_CLASS (AMageWeaponPiece, AWeaponPiece)
protected:
bool MatchPlayerClass (AActor *toucher);
bool TryPickup (AActor *toucher);
};
IMPLEMENT_CLASS (AMageWeaponPiece)
bool AMageWeaponPiece::MatchPlayerClass (AActor *toucher)
bool AMageWeaponPiece::TryPickup (AActor *toucher)
{
return !toucher->IsKindOf (PClass::FindClass(NAME_FighterPlayer)) &&
!toucher->IsKindOf (PClass::FindClass(NAME_ClericPlayer));
if (!toucher->IsKindOf (PClass::FindClass(NAME_ClericPlayer)) &&
!toucher->IsKindOf (PClass::FindClass(NAME_FighterPlayer)))
{
return Super::TryPickup(toucher);
}
else
{ // Wrong class, but try to pick up for ammo
if (ShouldStay())
{
// Can't pick up weapons for other classes in coop netplay
return false;
}
//==========================================================================
AWeapon * Defaults=(AWeapon*)GetDefaultByType(WeaponClass);
class AMWeaponPiece1 : public AMageWeaponPiece
bool gaveSome = !!(toucher->GiveAmmo (Defaults->AmmoType1, Defaults->AmmoGive1) +
toucher->GiveAmmo (Defaults->AmmoType2, Defaults->AmmoGive2));
if (gaveSome)
{
DECLARE_CLASS (AMWeaponPiece1, AMageWeaponPiece)
public:
void BeginPlay ();
};
IMPLEMENT_CLASS (AMWeaponPiece1)
void AMWeaponPiece1::BeginPlay ()
{
Super::BeginPlay ();
PieceValue = WPIECE1<<6;
GoAwayAndDie ();
}
//==========================================================================
class AMWeaponPiece2 : public AMageWeaponPiece
{
DECLARE_CLASS (AMWeaponPiece2, AMageWeaponPiece)
public:
void BeginPlay ();
};
IMPLEMENT_CLASS (AMWeaponPiece2)
void AMWeaponPiece2::BeginPlay ()
{
Super::BeginPlay ();
PieceValue = WPIECE2<<6;
return gaveSome;
}
//==========================================================================
class AMWeaponPiece3 : public AMageWeaponPiece
{
DECLARE_CLASS (AMWeaponPiece3, AMageWeaponPiece)
public:
void BeginPlay ();
};
IMPLEMENT_CLASS (AMWeaponPiece3)
void AMWeaponPiece3::BeginPlay ()
{
Super::BeginPlay ();
PieceValue = WPIECE3<<6;
}
// The Mages's Staff (Bloodscourge) -----------------------------------------
@ -283,42 +253,6 @@ void A_MStaffTrack (AActor *actor)
P_SeekerMissile (actor, ANGLE_1*2, ANGLE_1*10);
}
//============================================================================
//
// A_DropBloodscourgePieces
//
//============================================================================
void A_DropBloodscourgePieces (AActor *actor)
{
static const PClass *pieces[3] =
{
RUNTIME_CLASS(AMWeaponPiece1),
RUNTIME_CLASS(AMWeaponPiece2),
RUNTIME_CLASS(AMWeaponPiece3)
};
for (int i = 0, j = 0, fineang = 0; i < 3; ++i)
{
AActor *piece = Spawn (pieces[j], actor->x, actor->y, actor->z, ALLOW_REPLACE);
if (piece != NULL)
{
piece->momx = actor->momx + finecosine[fineang];
piece->momy = actor->momy + finesine[fineang];
piece->momz = actor->momz;
piece->flags |= MF_DROPPED;
fineang += FINEANGLES/3;
j = (j == 0) ? (pr_bloodscourgedrop() & 1) + 1 : 3-j;
}
}
}
void AMageWeaponPiece::BeginPlay ()
{
Super::BeginPlay ();
FourthWeaponClass = RUNTIME_CLASS(AMWeapBloodscourge);
}
//============================================================================
//
// FrontBlockCheck

View file

@ -1,178 +0,0 @@
#include "actor.h"
#include "gi.h"
#include "m_random.h"
#include "s_sound.h"
#include "d_player.h"
#include "a_action.h"
#include "p_local.h"
#include "p_enemy.h"
#include "a_action.h"
#include "p_pspr.h"
#include "gstrings.h"
#include "a_hexenglobal.h"
#include "sbar.h"
IMPLEMENT_POINTY_CLASS (AFourthWeaponPiece)
DECLARE_POINTER (TempFourthWeapon)
END_POINTERS
BEGIN_STATELESS_DEFAULTS (AFourthWeaponPiece, Hexen, -1, 0)
PROP_Inventory_PickupSound ("misc/w_pkup")
PROP_Inventory_PickupMessage("$TXT_WEAPONPIECE")
END_DEFAULTS
void AFourthWeaponPiece::Serialize (FArchive &arc)
{
Super::Serialize (arc);
arc << FourthWeaponClass << PieceValue << TempFourthWeapon;
}
const char *AFourthWeaponPiece::PickupMessage ()
{
if (TempFourthWeapon != NULL)
{
return TempFourthWeapon->PickupMessage ();
}
else
{
return Super::PickupMessage ();
}
}
bool AFourthWeaponPiece::MatchPlayerClass (AActor *toucher)
{
return true;
}
void AFourthWeaponPiece::PlayPickupSound (AActor *toucher)
{
if (TempFourthWeapon != NULL)
{
// Play the build-sound full volume for all players
S_Sound (toucher, CHAN_ITEM, "WeaponBuild", 1, ATTN_NONE);
}
else
{
Super::PlayPickupSound (toucher);
}
}
//==========================================================================
//
// TryPickupWeaponPiece
//
//==========================================================================
bool AFourthWeaponPiece::TryPickup (AActor *toucher)
{
bool shouldStay;
bool checkAssembled;
bool gaveWeapon;
int gaveMana;
const PClass *mana1 = PClass::FindClass(NAME_Mana1);
const PClass *mana2 = PClass::FindClass(NAME_Mana2);
checkAssembled = true;
gaveWeapon = false;
gaveMana = 0;
shouldStay = PrivateShouldStay ();
if (!MatchPlayerClass (toucher))
{ // Wrong class, but try to pick up for mana
if (shouldStay)
{ // Can't pick up wrong-class weapons in coop netplay
return false;
}
checkAssembled = false;
gaveMana = toucher->GiveAmmo (mana1, 20) +
toucher->GiveAmmo (mana2, 20);
if (!gaveMana)
{ // Didn't need the mana, so don't pick it up
return false;
}
}
else if (shouldStay)
{ // Cooperative net-game
if (toucher->player->pieces & PieceValue)
{ // Already has the piece
return false;
}
toucher->GiveAmmo (mana1, 20);
toucher->GiveAmmo (mana2, 20);
}
else
{ // Deathmatch or singleplayer game
gaveMana = toucher->GiveAmmo (mana1, 20) +
toucher->GiveAmmo (mana2, 20);
if (toucher->player->pieces & PieceValue)
{ // Already has the piece, check if mana needed
if (!gaveMana)
{ // Didn't need the mana, so don't pick it up
return false;
}
checkAssembled = false;
}
}
// Check if fourth weapon assembled
if (checkAssembled)
{
toucher->player->pieces |= PieceValue;
for (int i = 0; i < 9; i += 3)
{
int mask = (WPIECE1|WPIECE2|WPIECE3) << i;
if (PieceValue & mask)
{
if (toucher->CheckLocalView (consoleplayer))
{
StatusBar->SetInteger (0, i);
}
if ((toucher->player->pieces & mask) == mask)
{
gaveWeapon = (FourthWeaponClass != NULL);
}
break;
}
}
}
if (gaveWeapon)
{
TempFourthWeapon = static_cast<AInventory *>(Spawn (FourthWeaponClass, x, y, z, NO_REPLACE));
if (TempFourthWeapon != NULL)
{
gaveWeapon = TempFourthWeapon->TryPickup (toucher);
if (!gaveWeapon)
{
TempFourthWeapon->GoAwayAndDie ();
}
}
else
{
gaveWeapon = false;
}
}
if (gaveWeapon || gaveMana || checkAssembled)
{
GoAwayAndDie ();
}
return gaveWeapon || gaveMana || checkAssembled;
}
bool AFourthWeaponPiece::ShouldStay ()
{
return PrivateShouldStay ();
}
bool AFourthWeaponPiece::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;
}

View file

@ -15,6 +15,7 @@
#include "a_hexenglobal.h"
#include "a_keys.h"
#include "r_translate.h"
#include "a_weaponpiece.h"
class FManaBar : public FTexture
@ -316,34 +317,22 @@ public:
{
if (player->mo->IsKindOf (PClass::FindClass(NAME_MagePlayer)))
{
FourthWeaponShift = 6;
FourthWeaponClass = 2;
LifeBarClass = 2;
}
else if (player->mo->IsKindOf (PClass::FindClass(NAME_ClericPlayer)))
{
FourthWeaponShift = 3;
FourthWeaponClass = 1;
LifeBarClass = 1;
}
else
{
FourthWeaponShift = 0;
FourthWeaponClass = 0;
LifeBarClass = 0;
}
}
}
void SetInteger (int pname, int param)
{
if (pname == 0)
{
FourthWeaponShift = param;
FourthWeaponClass = param / 3;
}
}
private:
//---------------------------------------------------------------------------
//
@ -502,11 +491,7 @@ private:
}
// Weapon Pieces
if (oldpieces != CPlayer->pieces)
{
DrawWeaponPieces();
oldpieces = CPlayer->pieces;
}
}
//---------------------------------------------------------------------------
@ -849,13 +834,28 @@ private:
void DrawWeaponPieces ()
{
static ENamedName FourthWeaponNames[] = { NAME_FWeapQuietus, NAME_CWeapWraithverge, NAME_MWeapBloodscourge };
for(AInventory *inv = CPlayer->mo->Inventory; inv != NULL; inv = inv->Inventory)
{
if (inv->IsA(RUNTIME_CLASS(AWeaponHolder)))
{
AWeaponHolder *hold = static_cast<AWeaponHolder*>(inv);
if (hold->PieceWeapon->TypeName == FourthWeaponNames[FourthWeaponClass])
{
// Weapon Pieces
if (oldpieces != hold->PieceMask)
{
oldpieces = hold->PieceMask;
static int PieceX[3][3] =
{
{ 190, 225, 234 },
{ 190, 212, 225 },
{ 190, 205, 224 },
};
int pieces = (CPlayer->pieces >> FourthWeaponShift) & 7;
int pieces = oldpieces;
int weapClass = FourthWeaponClass;
if (pieces == 7)
@ -877,6 +877,16 @@ private:
DrawImage (ClassImages[weapClass][imgPIECE3], PieceX[weapClass][2], 0);
}
}
return;
}
}
}
if (oldpieces != 0)
{
DrawImage (ClassImages[FourthWeaponClass][imgWEAPONSLOT], 190, 0);
oldpieces = 0;
}
}
//---------------------------------------------------------------------------
//
@ -1144,7 +1154,6 @@ private:
int HealthMarker;
char ArtifactFlash;
char FourthWeaponShift;
char FourthWeaponClass;
char LifeBarClass;

View file

@ -1249,7 +1249,7 @@ bool AInventory::TryPickup (AActor *toucher)
{
// Add the item to the inventory. It is not already there, or HandlePickup
// would have already taken care of it.
AInventory *copy = CreeCopy (toucher);
AInventory *copy = CreateCopy (toucher);
if (copy == NULL)
{
return false;

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;

View file

@ -24,7 +24,7 @@ void A_ReaverRanged (AActor *self)
{
angle_t angle = bangle + (pr_reaverattack.Random2() << 20);
int damage = ((pr_reaverattack() & 7) + 1) * 3;
P_LineAttack (self, angle, MISSILERANGE, pitch, damage, NAME_None, RUNTIME_CLASS(AStrifePuff));
P_LineAttack (self, angle, MISSILERANGE, pitch, damage, NAME_None, NAME_StrifePuff);
}
}
}

View file

@ -28,7 +28,7 @@ void A_ShootGun (AActor *self)
pitch = P_AimLineAttack (self, self->angle, MISSILERANGE);
P_LineAttack (self, self->angle + (pr_shootgun.Random2() << 19),
MISSILERANGE, pitch,
3*(pr_shootgun() % 5 + 1), NAME_None, RUNTIME_CLASS(AStrifePuff));
3*(pr_shootgun() % 5 + 1), NAME_None, NAME_StrifePuff);
}
// Teleporter Beacon --------------------------------------------------------

View file

@ -7,21 +7,6 @@
// Base class for every humanoid in Strife that can go into
// a fire or electric death.
class AStrifeHumanoid : public AActor
{
DECLARE_ACTOR (AStrifeHumanoid, AActor)
};
class AStrifePuff : public AActor
{
DECLARE_ACTOR (AStrifePuff, AActor)
};
class AFlameMissile : public AActor
{
DECLARE_ACTOR (AFlameMissile, AActor)
};
class ADegninOre : public AInventory
{
DECLARE_ACTOR (ADegninOre, AInventory)
@ -68,7 +53,7 @@ public:
class ASigil : public AWeapon
{
DECLARE_ACTOR (ASigil, AStrifeWeapon)
DECLARE_ACTOR (ASigil, AWeapon)
public:
bool HandlePickup (AInventory *item);
AInventory *CreateCopy (AActor *other);

View file

@ -5,6 +5,7 @@
#include "s_sound.h"
#include "p_enemy.h"
#include "templates.h"
#include "thingdef/thingdef.h"
// Note: Strife missiles do 1-4 times their damage amount.
// Doom missiles do 1-8 times their damage amount, so to
@ -262,7 +263,7 @@ void P_StrifeGunShot (AActor *mo, bool accurate, angle_t pitch)
angle += pr_sgunshot.Random2() << (20 - mo->player->accuracy * 5 / 100);
}
P_LineAttack (mo, angle, PLAYERMISSILERANGE, pitch, damage, NAME_None, RUNTIME_CLASS(AStrifePuff));
P_LineAttack (mo, angle, PLAYERMISSILERANGE, pitch, damage, NAME_None, NAME_StrifePuff);
}
//============================================================================
@ -322,7 +323,7 @@ void A_FireMiniMissile (AActor *self)
savedangle = self->angle;
self->angle += pr_minimissile.Random2() << (19 - player->accuracy * 5 / 100);
player->mo->PlayAttacking2 ();
P_SpawnPlayerMissile (self, RUNTIME_CLASS(AMiniMissile));
P_SpawnPlayerMissile (self, PClass::FindClass("MiniMissile"));
self->angle = savedangle;
}
@ -337,8 +338,8 @@ void A_RocketInFlight (AActor *self)
AActor *trail;
S_Sound (self, CHAN_VOICE, "misc/missileinflight", 1, ATTN_NORM);
P_SpawnPuff (self, RUNTIME_CLASS(AMiniMissilePuff), self->x, self->y, self->z, self->angle - ANGLE_180, 2, PF_HITTHING);
trail = Spawn<ARocketTrail> (self->x - self->momx, self->y - self->momy, self->z, ALLOW_REPLACE);
P_SpawnPuff (self, PClass::FindClass("MiniMissilePuff"), self->x, self->y, self->z, self->angle - ANGLE_180, 2, PF_HITTHING);
trail = Spawn("RocketTrail", self->x - self->momx, self->y - self->momy, self->z, ALLOW_REPLACE);
if (trail != NULL)
{
trail->momz = FRACUNIT;
@ -381,7 +382,7 @@ void A_FireFlamer (AActor *self)
}
self->angle += pr_flamethrower.Random2() << 18;
self = P_SpawnPlayerMissile (self, RUNTIME_CLASS(AFlameMissile));
self = P_SpawnPlayerMissile (self, PClass::FindClass("FlameMissile"));
if (self != NULL)
{
self->momz += 5*FRACUNIT;
@ -428,7 +429,7 @@ void A_FireMauler1 (AActor *self)
// it should use a different puff. ZDoom's default range is longer
// than this, so let's not handicap it by being too faithful to the
// original.
P_LineAttack (self, angle, PLAYERMISSILERANGE, pitch, damage, NAME_Disintegrate, RUNTIME_CLASS(AMaulerPuff));
P_LineAttack (self, angle, PLAYERMISSILERANGE, pitch, damage, NAME_Disintegrate, NAME_MaulerPuff);
}
}
@ -471,7 +472,7 @@ void A_FireMauler2 (AActor *self)
}
self->player->mo->PlayAttacking2 ();
}
P_SpawnPlayerMissile (self, RUNTIME_CLASS(AMaulerTorpedo));
P_SpawnPlayerMissile (self, PClass::FindClass("MaulerTorpedo"));
P_DamageMobj (self, self, NULL, 20, self->DamageType);
P_ThrustMobj (self, self->angle + ANGLE_180, 0x7D000);
}
@ -488,20 +489,21 @@ AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target);
void A_MaulerTorpedoWave (AActor *self)
{
AActor *wavedef = GetDefaultByName("MaulerTorpedoWave");
fixed_t savedz;
self->angle += ANGLE_180;
// If the torpedo hit the ceiling, it should still spawn the wave
savedz = self->z;
if (self->ceilingz - self->z < GetDefault<AMaulerTorpedoWave>()->height)
if (wavedef && self->ceilingz - self->z < wavedef->height)
{
self->z = self->ceilingz - GetDefault<AMaulerTorpedoWave>()->height;
self->z = self->ceilingz - wavedef->height;
}
for (int i = 0; i < 80; ++i)
{
self->angle += ANGLE_45/10;
P_SpawnSubMissile (self, RUNTIME_CLASS(AMaulerTorpedoWave), self->target);
P_SpawnSubMissile (self, PClass::FindClass("MaulerTorpedoWave"), self->target);
}
self->z = savedz;
}
@ -546,6 +548,15 @@ AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target)
return NULL;
}
class APhosphorousFire : public AActor
{
DECLARE_CLASS (APhosphorousFire, AActor)
public:
int DoSpecialDamage (AActor *target, int damage);
};
IMPLEMENT_CLASS (APhosphorousFire)
int APhosphorousFire::DoSpecialDamage (AActor *target, int damage)
{
if (target->flags & MF_NOBLOOD)
@ -623,7 +634,7 @@ void A_Burnination (AActor *self)
void A_FireGrenade (AActor *self)
{
PClass *grenadetype;
const PClass *grenadetype;
player_t *player = self->player;
AActor *grenade;
angle_t an;

View file

@ -27,6 +27,6 @@ void A_TemplarAttack (AActor *self)
damage = (pr_templar() & 4) * 2;
angle = self->angle + (pr_templar.Random2() << 19);
pitchdiff = pr_templar.Random2() * 332063;
P_LineAttack (self, angle, MISSILERANGE+64*FRACUNIT, pitch+pitchdiff, damage, NAME_Disintegrate, "MaulerPuff");
P_LineAttack (self, angle, MISSILERANGE+64*FRACUNIT, pitch+pitchdiff, damage, NAME_Disintegrate, NAME_MaulerPuff);
}
}

View file

@ -53,6 +53,8 @@ xx(DoorMetal2)
xx(Wind)
xx(BulletPuff)
xx(StrifePuff)
xx(MaulerPuff)
// Special bosses A_BossDeath knows about
xx(Fatso)
@ -106,6 +108,11 @@ xx(Cell)
xx(Mana1)
xx(Mana2)
// Hexen's fourth weapons
xx(FWeapQuietus)
xx(CWeapWraithverge)
xx(MWeapBloodscourge)
// Ammo and weapon names for the Strife status bar
xx(ClipOfBullets)
xx(PoisonBolts)

View file

@ -573,7 +573,7 @@ void FBehavior::StaticLoadDefaultModules ()
FBehavior *FBehavior::StaticLoadModule (int lumpnum, FileReader *fr, int len)
{
if (lumpnum == -1) return NULL;
if (lumpnum == -1 && fr == NULL) return NULL;
for (unsigned int i = 0; i < StaticModules.Size(); ++i)
{

View file

@ -1148,7 +1148,7 @@ void P_ConversationCommand (int player, BYTE **stream)
level.total_items--;
item->flags &= ~MF_COUNTITEM;
}
if (item->IsA(RUNTIME_CLASS(AFlameThrower)))
if (item->GetClass()->TypeName == NAME_FlameThrower)
{
// The flame thrower gives less ammo when given in a dialog
static_cast<AWeapon*>(item)->AmmoGive1 = 40;

View file

@ -220,7 +220,6 @@ player_t::player_t()
health(0),
inventorytics(0),
CurrentPlayerClass(0),
pieces(0),
backpack(0),
fragcount(0),
lastkilltime(0),
@ -2421,7 +2420,6 @@ void player_t::Serialize (FArchive &arc)
<< centering
<< health
<< inventorytics
<< pieces
<< backpack
<< fragcount
<< spreecount

View file

@ -75,7 +75,7 @@
// SAVESIG should match SAVEVER.
// MINSAVEVER is the minimum level snapshot version that can be loaded.
#define MINSAVEVER 1114
#define MINSAVEVER 1129
#if SVN_REVISION_NUMBER < MINSAVEVER
// Never write a savegame with a version lower than what we need

View file

@ -1,19 +1,21 @@
// Cleric Weapon Piece ------------------------------------------------------
ACTOR ClericWeaponPiece : FourthWeaponPiece native
ACTOR ClericWeaponPiece : WeaponPiece native
{
Game Hexen
Inventory.PickupMessage "$TXT_WRAITHVERGE_PIECE"
}
// Cleric Weapon Piece 1 ----------------------------------------------------
ACTOR CWeaponPiece1 : ClericWeaponPiece 18 native
ACTOR CWeaponPiece1 : ClericWeaponPiece 18
{
Game Hexen
SpawnID 33
+FLOATBOB
Inventory.PickupMessage "$TXT_WRAITHVERGE_PIECE"
WeaponPiece.Number 1
WeaponPiece.Weapon CWeapWraithverge
States
{
Spawn:
@ -24,11 +26,12 @@ ACTOR CWeaponPiece1 : ClericWeaponPiece 18 native
// Cleric Weapon Piece 2 ----------------------------------------------------
ACTOR CWeaponPiece2 : ClericWeaponPiece 19 native
ACTOR CWeaponPiece2 : CWeaponPiece1 19
{
Game Hexen
SpawnID 34
+FLOATBOB
WeaponPiece.Number 2
States
{
Spawn:
@ -39,11 +42,12 @@ ACTOR CWeaponPiece2 : ClericWeaponPiece 19 native
// Cleric Weapon Piece 3 ----------------------------------------------------
ACTOR CWeaponPiece3 : ClericWeaponPiece 20 native
ACTOR CWeaponPiece3 : CWeaponPiece1 20
{
Game Hexen
SpawnID 35
+FLOATBOB
WeaponPiece.Number 3
States
{
Spawn:
@ -56,13 +60,11 @@ ACTOR CWeaponPiece3 : ClericWeaponPiece 20 native
ACTOR WraithvergeDrop
{
action native A_DropWraithvergePieces();
States
{
Spawn:
TNT1 A 1
TNT1 A 1 A_DropWraithvergePieces
TNT1 A 1 A_DropWeaponPieces("CWeaponPiece1", "CWeaponPiece2", "CWeaponPiece3")
Stop
}
}
@ -71,16 +73,18 @@ ACTOR WraithvergeDrop
ACTOR CWeapWraithverge : ClericWeapon native
{
Health 3
Weapon.SelectionOrder 3000
+WEAPON.PRIMARY_USES_BOTH
Weapon.AmmoUse1 18
Weapon.AmmoUse2 18
Weapon.AmmoGive1 0
Weapon.AmmoGive2 0
Weapon.AmmoGive1 20
Weapon.AmmoGive2 20
Weapon.KickBack 150
Weapon.AmmoType1 "Mana1"
Weapon.AmmoType2 "Mana2"
Inventory.PickupMessage "$TXT_WEAPON_C4"
Inventory.PickupSound "WeaponBuild"
action native A_CHolyAttack();
action native A_CHolyPalette();

View file

@ -1,17 +1,19 @@
// Fighter Weapon Piece -----------------------------------------------------
ACTOR FighterWeaponPiece : FourthWeaponPiece native
ACTOR FighterWeaponPiece : WeaponPiece native
{
Inventory.PickupMessage "$TXT_QUIETUS_PIECE"
}
// Fighter Weapon Piece 1 ---------------------------------------------------
ACTOR FWeaponPiece1 : FighterWeaponPiece 12 native
ACTOR FWeaponPiece1 : FighterWeaponPiece 12
{
Game Hexen
SpawnID 29
Inventory.PickupMessage "$TXT_QUIETUS_PIECE"
WeaponPiece.Number 1
WeaponPiece.Weapon FWeapQuietus
+FLOATBOB
States
{
@ -23,10 +25,11 @@ ACTOR FWeaponPiece1 : FighterWeaponPiece 12 native
// Fighter Weapon Piece 2 ---------------------------------------------------
ACTOR FWeaponPiece2 : FighterWeaponPiece 13 native
ACTOR FWeaponPiece2 : FWeaponPiece1 13
{
Game Hexen
SpawnID 30
WeaponPiece.Number 2
+FLOATBOB
States
{
@ -38,10 +41,11 @@ ACTOR FWeaponPiece2 : FighterWeaponPiece 13 native
// Fighter Weapon Piece 3 ---------------------------------------------------
ACTOR FWeaponPiece3 : FighterWeaponPiece 16 native
ACTOR FWeaponPiece3 : FWeaponPiece1 16
{
Game Hexen
SpawnID 31
WeaponPiece.Number 3
+FLOATBOB
States
{
@ -55,13 +59,11 @@ ACTOR FWeaponPiece3 : FighterWeaponPiece 16 native
ACTOR QuietusDrop
{
action native A_DropQuietusPieces();
States
{
Spawn:
TNT1 A 1
TNT1 A 1 A_DropQuietusPieces
TNT1 A 1 A_DropWeaponPieces("FWeaponPiece1", "FWeaponPiece2", "FWeaponPiece3")
Stop
}
}
@ -70,17 +72,19 @@ ACTOR QuietusDrop
ACTOR FWeapQuietus : FighterWeapon
{
Health 3
Weapon.SelectionOrder 2900
+WEAPON.PRIMARY_USES_BOTH
Weapon.AmmoUse1 14
Weapon.AmmoUse2 14
Weapon.AmmoGive1 0
Weapon.AmmoGive2 0
Weapon.AmmoGive1 20
Weapon.AmmoGive2 20
Weapon.KickBack 150
Weapon.YAdjust 10
Weapon.AmmoType1 "Mana1"
Weapon.AmmoType2 "Mana2"
Inventory.PickupMessage "$TXT_WEAPON_F4"
Inventory.PickupSound "WeaponBuild"
action native A_FSwordAttack();

View file

@ -1,18 +1,20 @@
// Mage Weapon Piece --------------------------------------------------------
ACTOR MageWeaponPiece : FourthWeaponPiece native
ACTOR MageWeaponPiece : WeaponPiece native
{
Inventory.PickupMessage "$TXT_BLOODSCOURGE_PIECE"
}
// Mage Weapon Piece 1 ------------------------------------------------------
ACTOR MWeaponPiece1 : MageWeaponPiece 21 native
ACTOR MWeaponPiece1 : MageWeaponPiece 21
{
Game Hexen
SpawnID 37
+FLOATBOB
Inventory.PickupMessage "$TXT_BLOODSCOURGE_PIECE"
WeaponPiece.Number 1
WeaponPiece.Weapon MWeapBloodscourge
States
{
Spawn:
@ -23,11 +25,12 @@ ACTOR MWeaponPiece1 : MageWeaponPiece 21 native
// Mage Weapon Piece 2 ------------------------------------------------------
ACTOR MWeaponPiece2 : MageWeaponPiece 22 native
ACTOR MWeaponPiece2 : MWeaponPiece1 22
{
Game Hexen
SpawnID 38
+FLOATBOB
WeaponPiece.Number 2
States
{
Spawn:
@ -38,11 +41,12 @@ ACTOR MWeaponPiece2 : MageWeaponPiece 22 native
// Mage Weapon Piece 3 ------------------------------------------------------
ACTOR MWeaponPiece3 : MageWeaponPiece 23 native
ACTOR MWeaponPiece3 : MWeaponPiece1 23
{
Game Hexen
SpawnID 39
+FLOATBOB
WeaponPiece.Number 3
States
{
Spawn:
@ -55,13 +59,11 @@ ACTOR MWeaponPiece3 : MageWeaponPiece 23 native
ACTOR BloodscourgeDrop
{
action native A_DropBloodscourgePieces();
States
{
Spawn:
TNT1 A 1
TNT1 A 1 A_DropBloodscourgePieces
TNT1 A 1 A_DropWeaponPieces("MWeaponPiece1", "MWeaponPiece2", "MWeaponPiece3")
Stop
}
}
@ -70,15 +72,19 @@ ACTOR BloodscourgeDrop
ACTOR MWeapBloodscourge : MageWeapon native
{
Health 3
Weapon.SelectionOrder 3100
Weapon.AmmoUse1 15
Weapon.AmmoUse2 15
Weapon.AmmoGive1 20
Weapon.AmmoGive2 20
Weapon.KickBack 150
Weapon.YAdjust 20
Weapon.AmmoType1 "Mana1"
Weapon.AmmoType2 "Mana2"
+WEAPON.PRIMARY_USES_BOTH
Inventory.PickupMessage "$TXT_WEAPON_M4"
Inventory.PickupSound "WeaponBuild"
action native A_MStaffAttack();
action native A_MStaffPalette();

View file

@ -186,6 +186,7 @@ class Actor extends Thinker
action native A_DropFire();
action native A_GiveQuestItem(eval int itemno);
action native A_RemoveForcefield();
action native A_DropWeaponPieces(class<Actor> p1, class<Actor> p2, class<Actor> p3);
}
class Inventory extends Actor

View file

@ -0,0 +1,814 @@
ACTOR StrifeWeapon : DoomWeapon
{
}
// Same as the bullet puff for Doom -----------------------------------------
ACTOR StrifePuff
{
+NOBLOCKMAP
+NOGRAVITY
+ALLOWPARTICLES
RenderStyle Translucent
Alpha 0.25
states
{
Spawn:
POW3 ABCDEFGH 3
Stop
Crash:
PUFY A 4 Bright
PUFY BCD 4
Stop
}
}
// A spark when you hit something that doesn't bleed ------------------------
// Only used by the dagger.
ACTOR StrifeSpark : StrifePuff
{
RenderStyle Add
States
{
Crash:
POW2 ABCD 4
Stop
}
}
// Punch Dagger -------------------------------------------------------------
ACTOR PunchDagger : StrifeWeapon
{
Weapon.SelectionOrder 3900
+WEAPON.NOALERT
action native A_JabDagger ();
States
{
Ready:
PNCH A 1 A_WeaponReady
Loop
Deselect:
PNCH A 1 A_Lower
Loop
Select:
PNCH A 1 A_Raise
Loop
Fire:
PNCH B 4
PNCH C 4 A_JabDagger
PNCH D 5
PNCH C 4
PNCH B 5 A_ReFire
Goto Ready
}
}
// The base for Strife projectiles that die with ZAP1 -----------------------
ACTOR StrifeZap1
{
+NOBLOCKMAP
+NOGRAVITY
+DROPOFF
States
{
Spawn:
Death:
ZAP1 A 3 A_AlertMonsters
ZAP1 BCDEFE 3
ZAP1 DCB 2
ZAP1 A 1
Stop
}
}
// Electric Bolt ------------------------------------------------------------
ACTOR ElectricBolt : StrifeZap1
{
ConversationID 102,-1,-1
Speed 30
Radius 10
Height 10
Damage 10
Projectile
+STRIFEDAMAGE
MaxStepHeight 4
SeeSound "misc/swish"
ActiveSound "misc/swish"
DeathSound "weapons/xbowhit"
States
{
Spawn:
AROW A 10 A_LoopActiveSound
Loop
}
}
// Poison Bolt --------------------------------------------------------------
ACTOR PoisonBolt native
{
ConversationID 102,-1,-1
Speed 30
Radius 10
Height 10
Damage 500
Projectile
+STRIFEDAMAGE
MaxStepHeight 4
SeeSound "misc/swish"
ActiveSound "misc/swish"
States
{
Spawn:
ARWP A 10 A_LoopActiveSound
Loop
Death:
AROW A 1
Stop
}
}
// Strife's Crossbow --------------------------------------------------------
ACTOR StrifeCrossbow : StrifeWeapon 2001
{
Game Strife
+FLOORCLIP
ConversationID 194, 188, 192
Weapon.SelectionOrder 1200
+WEAPON.NOALERT
Weapon.AmmoUse1 1
Weapon.AmmoGive1 8
Weapon.AmmoType1 "ElectricBolts"
Weapon.SisterWeapon "StrifeCrossbow2"
Inventory.PickupMessage "$TXT_STRIFECROSSBOW"
Inventory.Icon "CBOWA0"
Tag "crossbow"
action native A_ClearFlash ();
action native A_ShowElectricFlash ();
action native A_FireArrow (class<Actor> proj);
states
{
Spawn:
CBOW A -1
Stop
Ready:
XBOW A 0 A_ShowElectricFlash
XBOW A 1 A_WeaponReady
Wait
Deselect:
XBOW A 1 A_Lower
Loop
Select:
XBOW A 1 A_Raise
Loop
Fire:
XBOW A 3 A_ClearFlash
XBOW B 6 A_FireArrow("ElectricBolt")
XBOW C 4
XBOW D 6
XBOW E 3
XBOW F 5
XBOW G 0 A_ShowElectricFlash
XBOW G 5 A_CheckReload
Goto Ready
Flash:
XBOW KLM 5
Loop
}
}
ACTOR StrifeCrossbow2 : StrifeCrossbow
{
Weapon.SelectionOrder 2700
Weapon.AmmoUse1 1
Weapon.AmmoGive1 0
Weapon.AmmoType1 "PoisonBolts"
Weapon.SisterWeapon "StrifeCrossbow"
States
{
Ready:
XBOW H 1 A_WeaponReady
Loop
Deselect:
XBOW H 1 A_Lower
Loop
Select:
XBOW H 1 A_Raise
Loop
Fire:
XBOW H 3
XBOW B 6 A_FireArrow("PoisonBolt")
XBOW C 4
XBOW D 6
XBOW E 3
XBOW I 5
XBOW J 5 A_CheckReload
Goto Ready
Flash:
Stop
}
}
// Assault Gun --------------------------------------------------------------
actor AssaultGun : StrifeWeapon 2002
{
Game Strife
ConversationID 188, 182, 186
+FLOORCLIP
Weapon.SelectionOrder 600
Weapon.AmmoUse1 1
Weapon.AmmoGive1 20
Weapon.AmmoType1 "ClipOfBullets"
Inventory.Icon "RIFLA0"
Tag "assault_gun"
Inventory.PickupMessage "$TXT_ASSAULTGUN"
States
{
Spawn:
RIFL A -1
Stop
Ready:
RIFG A 1 A_WeaponReady
Loop
Deselect:
RIFG B 1 A_Lower
Loop
Select:
RIFG A 1 A_Raise
Loop
Fire:
RIFF AB 3 A_FireAssaultGun
RIFG D 3 A_FireAssaultGun
RIFG C 0 A_ReFire
RIFG B 2 A_Light0
Goto Ready
}
}
// Standing variant of the assault gun --------------------------------------
ACTOR AssaultGunStanding : WeaponGiver 2006
{
Game Strife
ConversationID 189, 183, 187
DropItem "AssaultGun"
Inventory.PickupMessage "$TXT_ASSAULTGUN"
States
{
Spawn:
RIFL B -1
Stop
}
}
// Mini-Missile Launcher ----------------------------------------------------
ACTOR MiniMissileLauncher : StrifeWeapon 2003
{
Game Strife
ConversationID 192, 186, 190
+FLOORCLIP
Weapon.SelectionOrder 1800
Weapon.AmmoUse1 1
Weapon.AmmoGive1 8
Weapon.AmmoType1 "MiniMissiles"
Inventory.Icon "MMSLA0"
Tag "mini_missile_launcher"
Inventory.PickupMessage "$TXT_MMLAUNCHER"
action native A_FireMiniMissile ();
States
{
Spawn:
MMSL A -1
Stop
Ready:
MMIS A 1 A_WeaponReady
Loop
Deselect:
MMIS A 1 A_Lower
Loop
Select:
MMIS A 1 A_Raise
Loop
Fire:
MMIS A 4 A_FireMiniMissile
MMIS B 4 A_Light1
MMIS C 5 Bright
MMIS D 2 Bright A_Light2
MMIS E 2 Bright
MMIS F 2 Bright A_Light0
MMIS F 0 A_ReFire
Goto Ready
}
}
// Rocket Trail -------------------------------------------------------------
ACTOR RocketTrail
{
ConversationID 51,-1,-1
+NOBLOCKMAP
+NOGRAVITY
RenderStyle Translucent
Alpha 0.25
SeeSound "misc/missileinflight"
States
{
Spawn:
PUFY BCBCD 4
Stop
}
}
// Rocket Puff --------------------------------------------------------------
ACTOR MiniMissilePuff
{
-ALLOWPARTICLES
States
{
Spawn:
Goto Crash
}
}
// Mini Missile -------------------------------------------------------------
ACTOR MiniMissile
{
ConversationID 99,-1,-1
Speed 20
Radius 10
Height 14
Damage 10
Projectile
+STRIFEDAMAGE
MaxStepHeight 4
SeeSound "weapons/minimissile"
DeathSound "weapons/minimissilehit"
States
{
Spawn:
MICR A 6 Bright A_RocketInFlight
Loop
Death:
SMIS A 0 Bright A_SetTranslucent(1,1)
SMIS A 0 Bright A_StopSoundEx("Voice")
SMIS A 5 Bright A_Explode(64,64,1,1)
SMIS B 5 Bright
SMIS C 4 Bright
SMIS DEFG 2 Bright
Stop
}
}
// Flame Thrower ------------------------------------------------------------
ACTOR FlameThrower : StrifeWeapon 2005
{
Game Strife
ConversationID 190, 184, 188
+FLOORCLIP
Weapon.SelectionOrder 2100
Weapon.Kickback 0
Weapon.AmmoUse1 1
Weapon.AmmoGive1 100
Weapon.UpSound "weapons/flameidle"
Weapon.ReadySound "weapons/flameidle"
Weapon.AmmoType1 "EnergyPod"
Inventory.Icon "FLAMA0"
Tag "flame_thrower"
Inventory.PickupMessage "$TXT_FLAMER"
action native A_FireFlamer ();
States
{
Spawn:
FLAM A -1
Stop
Ready:
FLMT AB 3 A_WeaponReady
Loop
Deselect:
FLMT A 1 A_Lower
Loop
Select:
FLMT A 1 A_Raise
Loop
Fire:
FLMF A 2 A_FireFlamer
FLMF B 3 A_ReFire
Goto Ready
}
}
// Flame Thrower Projectile -------------------------------------------------
ACTOR FlameMissile
{
Speed 15
Height 11
Radius 8
Mass 10
Damage 4
DamageType Fire
ReactionTime 8
Projectile
-NOGRAVITY
+STRIFEDAMAGE
MaxStepHeight 4
RenderStyle Add
SeeSound "weapons/flamethrower"
action native A_FlameDie ();
States
{
Spawn:
FRBL AB 3 Bright
FRBL C 3 Bright A_Countdown
Loop
Death:
FRBL D 5 Bright A_FlameDie
FRBL EFGHI 5 Bright
Stop
}
}
// Mauler -------------------------------------------------------------------
// The scatter version
ACTOR Mauler : StrifeWeapon 2004
{
Game Strife
ConversationID 193, 187, 191
+FLOORCLIP
Weapon.SelectionOrder 300
Weapon.AmmoUse1 20
Weapon.AmmoGive1 40
Weapon.AmmoType1 "EnergyPod"
Weapon.SisterWeapon "Mauler2"
Inventory.Icon "TRPDA0"
Tag "mauler"
Inventory.PickupMessage "$TXT_MAULER"
action native A_FireMauler1 ();
States
{
Ready:
MAUL FGHA 6 A_WeaponReady
Loop
Deselect:
MAUL A 1 A_Lower
Loop
Select:
MAUL A 1 A_Raise
Loop
Fire:
BLSF A 5 Bright A_FireMauler1
MAUL B 3 Bright A_Light1
MAUL C 2 A_Light2
MAUL DE 2
MAUL A 7 A_Light0
MAUL H 7
MAUL G 7 A_CheckReload
Goto Ready
Spawn:
TRPD A -1
Stop
}
}
// Mauler Torpedo version ---------------------------------------------------
ACTOR Mauler2 : Mauler
{
Weapon.SelectionOrder 3300
Weapon.AmmoUse1 30
Weapon.AmmoGive1 0
Weapon.AmmoType1 "EnergyPod"
Weapon.SisterWeapon "Mauler"
action native A_FireMauler2Pre ();
action native A_FireMauler2 ();
States
{
Ready:
MAUL IJKL 7 A_WeaponReady
Loop
Deselect:
MAUL I 1 A_Lower
Loop
Select:
MAUL I 1 A_Raise
Loop
Fire:
MAUL I 20 A_FireMauler2Pre
MAUL J 10 A_Light1
BLSF A 10 Bright A_FireMauler2
MAUL B 3 Bright A_Light2
MAUL C 2
MAUL D 2 A_Light0
MAUL E 2 A_ReFire
Goto Ready
}
}
// Mauler "Bullet" Puff -----------------------------------------------------
ACTOR MaulerPuff
{
+NOBLOCKMAP
+NOGRAVITY
+PUFFONACTORS
RenderStyle Add
DamageType Disintegrate
states
{
Spawn:
MPUF AB 5
POW1 ABCDE 4
Stop
}
}
// The Mauler's Torpedo -----------------------------------------------------
ACTOR MaulerTorpedo
{
Speed 20
Height 8
Radius 13
Damage 1
DamageType Disintegrate
Projectile
+STRIFEDAMAGE
MaxStepHeight 4
RenderStyle Add
SeeSound "weapons/mauler2fire"
DeathSound "weapons/mauler2hit"
action native A_MaulerTorpedoWave ();
States
{
Spawn:
TORP ABCD 4 Bright
Loop
Death:
THIT AB 8 Bright
THIT C 8 Bright A_MaulerTorpedoWave
THIT DE 8 Bright
Stop
}
}
// The mini torpedoes shot by the big torpedo --------------------------------
ACTOR MaulerTorpedoWave
{
Speed 35
Radius 13
Height 13
Damage 10
DamageType Disintegrate
Projectile
+STRIFEDAMAGE
MaxStepHeight 4
RenderStyle Add
States
{
Spawn:
TWAV ABC 9 Bright
Stop
}
}
// High-Explosive Grenade ---------------------------------------------------
ACTOR HEGrenade
{
ConversationID 106,-1,-1
Speed 15
Radius 13
Height 13
Mass 20
Damage 1
Reactiontime 30
Projectile
-NOGRAVITY
+STRIFEDAMAGE
+NOBOUNCESOUND
+BOUNCEONACTORS
+EXPLODEONWATER
+DOOMBOUNCE
MaxStepHeight 4
BounceFactor 0.5
BounceCount 2
SeeSound "weapons/hegrenadeshoot"
DeathSound "weapons/hegrenadebang"
States
{
Spawn:
GRAP AB 3 A_Countdown
Loop
Death:
BNG4 A 0 Bright A_NoGravity
BNG4 A 0 Bright A_SetTranslucent(1,1)
BNG4 A 2 Bright A_Explode(192,192,1,1)
BNG4 BCDEFGHIJKLMN 3 Bright
Stop
}
}
// White Phosphorous Grenade ------------------------------------------------
ACTOR PhosphorousGrenade
{
ConversationID 107,-1,-1
Speed 15
Radius 13
Height 13
Mass 20
Damage 1
Reactiontime 40
Projectile
-NOGRAVITY
+STRIFEDAMAGE
+NOBOUNCESOUND
+BOUNCEONACTORS
+EXPLODEONWATER
+DOOMBOUNCE
MaxStepHeight 4
BounceFactor 0.5
BounceCount 2
SeeSound "weapons/phgrenadeshoot"
DeathSound "weapons/phgrenadebang"
States
{
Spawn:
GRIN AB 3 A_Countdown
Loop
Death:
BNG3 A 1 A_SpawnItemEx("PhosphorousFire")
Stop
}
}
// Fire from the Phoshorous Grenade -----------------------------------------
ACTOR PhosphorousFire native
{
Reactiontime 120
DamageType Fire
+NOBLOCKMAP
+FLOORCLIP
+NOTELEPORT
+NODAMAGETHRUST
RenderStyle Add
action native A_Burnarea ();
action native A_Burnination ();
states
{
Spawn:
BNG3 B 2 Bright A_Burnarea
BNG3 C 2 Bright A_Countdown
FLBE A 2 Bright A_Burnination
FLBE B 2 Bright A_Countdown
FLBE C 2 Bright A_Burnarea
FLBE D 3 Bright A_Countdown
FLBE E 3 Bright A_Burnarea
FLBE F 3 Bright A_Countdown
FLBE G 3 Bright A_Burnination
Goto Spawn+5
Death:
FLBE H 2 Bright
FLBE I 2 Bright A_Burnination
FLBE JK 2 Bright
Stop
}
}
// High-Explosive Grenade Launcher ------------------------------------------
ACTOR StrifeGrenadeLauncher : StrifeWeapon 154
{
Game Strife
ConversationID 195, 189, 193
+FLOORCLIP
Weapon.SelectionOrder 2400
Weapon.AmmoUse1 1
Weapon.AmmoGive1 12
Weapon.AmmoType1 "HEGrenadeRounds"
Weapon.SisterWeapon "StrifeGrenadeLauncher2"
Inventory.Icon "GRNDA0"
Tag "Grenade_launcher"
Inventory.PickupMessage "$TXT_GLAUNCHER"
action native A_FireGrenade (class<Actor> grenadetype, eval int angleofs, state flash);
States
{
Spawn:
GRND A -1
Stop
Ready:
GREN A 1 A_WeaponReady
Loop
Deselect:
GREN A 1 A_Lower
Loop
Select:
GREN A 1 A_Raise
Loop
Fire:
GREN A 5 A_FireGrenade("HEGrenade", -90, "Flash")
GREN B 10
GREN A 5 A_FireGrenade("HEGrenade", 90, "Flash2")
GREN C 10
GREN A 0 A_ReFire
Goto Ready
Flash:
GREF A 5 Bright A_Light1
Goto LightDone
Flash2:
GREF B 5 Bright A_Light2
Goto LightDone
}
}
// White Phosphorous Grenade Launcher ---------------------------------------
ACTOR StrifeGrenadeLauncher2 : StrifeGrenadeLauncher
{
Weapon.SelectionOrder 3200
Weapon.AmmoUse1 1
Weapon.AmmoGive1 0
Weapon.AmmoType1 "PhosphorusGrenadeRounds"
Weapon.SisterWeapon "StrifeGrenadeLauncher"
States
{
Ready:
GREN D 1 A_WeaponReady
Loop
Deselect:
GREN D 1 A_Lower
Loop
Select:
GREN D 1 A_Raise
Loop
Fire:
GREN D 5 A_FireGrenade("PhosphorousGrenade", -90, "Flash")
GREN E 10
GREN D 5 A_FireGrenade("PhosphorousGrenade", 90, "Flash2")
GREN F 10
GREN A 0 A_ReFire
Goto Ready
Flash:
GREF C 5 Bright A_Light1
Goto LightDone
Flash2:
GREF D 5 Bright A_Light2
Goto LightDone
}
}

View file

@ -108,6 +108,7 @@
#include "actors/strife/strifehumanoid.txt"
#include "actors/strife/strifeplayer.txt"
#include "actors/strife/strifeweapons.txt"
#include "actors/strife/spectral.txt"
#include "actors/strife/acolyte.txt"
#include "actors/strife/alienspectres.txt"

View file

@ -2408,10 +2408,6 @@
RelativePath=".\src\g_hexen\a_teleportother.cpp"
>
</File>
<File
RelativePath="src\g_hexen\a_weaponpieces.cpp"
>
</File>
<File
RelativePath=".\src\g_hexen\a_wraith.cpp"
>