- Converted Heretic's and Hexen's players to DECORATE.

- Made Hexenarmor factors configurable by DECORATE.
- Added support for selecting the invulnerability mode per item as well.
- Made Invulnerability and Healing radius behavior selectable by player
  class instead of hard coding the special behavior to the Hexen classes.


SVN r379 (trunk)
This commit is contained in:
Christoph Oelckers 2006-11-07 10:20:09 +00:00
commit e5bce37755
32 changed files with 733 additions and 1033 deletions

View file

@ -9,138 +9,97 @@
#include "a_action.h"
#include "a_hexenglobal.h"
static FRandom pr_fpatk ("FPunchAttack");
void A_FSwordFlames (AActor *);
// Fighter Weapon Base Class ------------------------------------------------
// The fighter --------------------------------------------------------------
FState AFighterPlayer::States[] =
{
#define S_FPLAY 0
S_NORMAL (PLAY, 'A', -1, NULL , NULL),
#define S_FPLAY_RUN (S_FPLAY+1)
S_NORMAL (PLAY, 'A', 4, NULL , &States[S_FPLAY_RUN+1]),
S_NORMAL (PLAY, 'B', 4, NULL , &States[S_FPLAY_RUN+2]),
S_NORMAL (PLAY, 'C', 4, NULL , &States[S_FPLAY_RUN+3]),
S_NORMAL (PLAY, 'D', 4, NULL , &States[S_FPLAY_RUN+0]),
#define S_FPLAY_ATK (S_FPLAY_RUN+4)
S_NORMAL (PLAY, 'E', 8, NULL , &States[S_FPLAY_ATK+1]),
S_NORMAL (PLAY, 'F', 8, NULL , &States[S_FPLAY]),
#define S_FPLAY_PAIN (S_FPLAY_ATK+2)
S_NORMAL (PLAY, 'G', 4, NULL , &States[S_FPLAY_PAIN+1]),
S_NORMAL (PLAY, 'G', 4, A_Pain , &States[S_FPLAY]),
#define S_FPLAY_DIE (S_FPLAY_PAIN+2)
S_NORMAL (PLAY, 'H', 6, NULL , &States[S_FPLAY_DIE+1]),
S_NORMAL (PLAY, 'I', 6, A_PlayerScream , &States[S_FPLAY_DIE+2]),
S_NORMAL (PLAY, 'J', 6, NULL , &States[S_FPLAY_DIE+3]),
S_NORMAL (PLAY, 'K', 6, NULL , &States[S_FPLAY_DIE+4]),
S_NORMAL (PLAY, 'L', 6, A_NoBlocking , &States[S_FPLAY_DIE+5]),
S_NORMAL (PLAY, 'M', 6, NULL , &States[S_FPLAY_DIE+6]),
S_NORMAL (PLAY, 'N', -1, NULL/*A_AddPlayerCorpse*/, NULL),
#define S_FPLAY_XDIE (S_FPLAY_DIE+7)
S_NORMAL (PLAY, 'O', 5, A_PlayerScream , &States[S_FPLAY_XDIE+1]),
S_NORMAL (PLAY, 'P', 5, A_SkullPop , &States[S_FPLAY_XDIE+2]),
S_NORMAL (PLAY, 'R', 5, A_NoBlocking , &States[S_FPLAY_XDIE+3]),
S_NORMAL (PLAY, 'S', 5, NULL , &States[S_FPLAY_XDIE+4]),
S_NORMAL (PLAY, 'T', 5, NULL , &States[S_FPLAY_XDIE+5]),
S_NORMAL (PLAY, 'U', 5, NULL , &States[S_FPLAY_XDIE+6]),
S_NORMAL (PLAY, 'V', 5, NULL , &States[S_FPLAY_XDIE+7]),
S_NORMAL (PLAY, 'W', -1, NULL/*A_AddPlayerCorpse*/, NULL),
#define S_FPLAY_ICE (S_FPLAY_XDIE+8)
S_NORMAL (PLAY, 'X', 5, A_FreezeDeath , &States[S_FPLAY_ICE+1]),
S_NORMAL (PLAY, 'X', 1, A_FreezeDeathChunks , &States[S_FPLAY_ICE+1]),
#define S_PLAY_FDTH (S_FPLAY_ICE+2)
S_BRIGHT (FDTH, 'G', 5, NULL , &States[S_PLAY_FDTH+1]),
S_BRIGHT (FDTH, 'H', 4, A_PlayerScream , &States[S_PLAY_FDTH+2]),
S_BRIGHT (FDTH, 'I', 5, NULL , &States[S_PLAY_FDTH+3]),
S_BRIGHT (FDTH, 'J', 4, NULL , &States[S_PLAY_FDTH+4]),
S_BRIGHT (FDTH, 'K', 5, NULL , &States[S_PLAY_FDTH+5]),
S_BRIGHT (FDTH, 'L', 4, NULL , &States[S_PLAY_FDTH+6]),
S_BRIGHT (FDTH, 'M', 5, NULL , &States[S_PLAY_FDTH+7]),
S_BRIGHT (FDTH, 'N', 4, NULL , &States[S_PLAY_FDTH+8]),
S_BRIGHT (FDTH, 'O', 5, NULL , &States[S_PLAY_FDTH+9]),
S_BRIGHT (FDTH, 'P', 4, NULL , &States[S_PLAY_FDTH+10]),
S_BRIGHT (FDTH, 'Q', 5, NULL , &States[S_PLAY_FDTH+11]),
S_BRIGHT (FDTH, 'R', 4, NULL , &States[S_PLAY_FDTH+12]),
S_BRIGHT (FDTH, 'S', 5, A_NoBlocking , &States[S_PLAY_FDTH+13]),
S_BRIGHT (FDTH, 'T', 4, NULL , &States[S_PLAY_FDTH+14]),
S_BRIGHT (FDTH, 'U', 5, NULL , &States[S_PLAY_FDTH+15]),
S_BRIGHT (FDTH, 'V', 4, NULL , &States[S_PLAY_FDTH+16]),
S_NORMAL (ACLO, 'E', 35, A_CheckBurnGone , &States[S_PLAY_FDTH+16]),
S_NORMAL (ACLO, 'E', 8, NULL , NULL),
#define S_PLAY_F_FDTH (S_PLAY_FDTH+18)
S_BRIGHT (FDTH, 'A', 5, A_FireScream , &States[S_PLAY_F_FDTH+1]),
S_BRIGHT (FDTH, 'B', 4, NULL , &States[S_PLAY_FDTH]),
};
IMPLEMENT_ACTOR (AFighterPlayer, Hexen, -1, 0)
PROP_SpawnHealth (100)
PROP_RadiusFixed (16)
PROP_HeightFixed (64)
PROP_Mass (100)
PROP_PainChance (255)
PROP_SpeedFixed (1)
PROP_RadiusdamageFactor(FRACUNIT/4)
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_DROPOFF|MF_PICKUP|MF_NOTDMATCH|MF_FRIENDLY)
PROP_Flags2 (MF2_WINDTHRUST|MF2_FLOORCLIP|MF2_SLIDE|MF2_PASSMOBJ|MF2_TELESTOMP|MF2_PUSHWALL)
PROP_Flags3 (MF3_NOBLOCKMONST)
PROP_Flags4 (MF4_NOSKIN)
PROP_SpawnState (S_FPLAY)
PROP_SeeState (S_FPLAY_RUN)
PROP_PainState (S_FPLAY_PAIN)
PROP_MissileState (S_FPLAY_ATK)
PROP_MeleeState (S_FPLAY_ATK)
PROP_DeathState (S_FPLAY_DIE)
PROP_XDeathState (S_FPLAY_XDIE)
PROP_BDeathState (S_PLAY_F_FDTH)
PROP_IDeathState (S_FPLAY_ICE)
// [GRB]
PROP_PlayerPawn_JumpZ (FRACUNIT*39/4) // ~9.75
PROP_PlayerPawn_ViewHeight (48*FRACUNIT)
PROP_PlayerPawn_ForwardMove1 (FRACUNIT * 0x1d / 0x19)
PROP_PlayerPawn_ForwardMove2 (FRACUNIT * 0x3c / 0x32)
PROP_PlayerPawn_SideMove1 (FRACUNIT * 0x1b / 0x18)
PROP_PlayerPawn_SideMove2 (FRACUNIT * 0x3b / 0x28) // The fighter is a very fast strafer when running!
PROP_PlayerPawn_ColorRange (246, 254)
PROP_PlayerPawn_SpawnMask (MTF_FIGHTER)
PROP_PlayerPawn_DisplayName ("Fighter")
PROP_PlayerPawn_SoundClass ("fighter")
PROP_PlayerPawn_ScoreIcon ("FITEFACE")
PROP_PainSound ("PlayerFighterPain")
IMPLEMENT_STATELESS_ACTOR (AFighterWeapon, Hexen, -1, 0)
PROP_Weapon_Kickback (150)
END_DEFAULTS
void AFighterPlayer::GiveDefaultInventory ()
bool AFighterWeapon::TryPickup (AActor *toucher)
{
Super::GiveDefaultInventory ();
// The Doom and Hexen players are not excluded from pickup in case
// somebody wants to use these weapons with either of those games.
if (toucher->IsKindOf (PClass::FindClass(NAME_ClericPlayer)) ||
toucher->IsKindOf (PClass::FindClass(NAME_MagePlayer)))
{ // Wrong class, but try to pick up for mana
if (ShouldStay())
{ // Can't pick up weapons for other classes in coop netplay
return false;
}
if (!Inventory)
{
player->ReadyWeapon = player->PendingWeapon = static_cast<AWeapon *>
(GiveInventoryType (PClass::FindClass ("FWeapFist")));
bool gaveSome = (NULL != AddAmmo (toucher, AmmoType1, AmmoGive1));
gaveSome |= (NULL != AddAmmo (toucher, AmmoType2, AmmoGive2));
if (gaveSome)
{
GoAwayAndDie ();
}
return gaveSome;
}
GiveInventoryType (RUNTIME_CLASS(AHexenArmor));
AHexenArmor *armor = FindInventory<AHexenArmor>();
armor->Slots[4] = 15*FRACUNIT;
armor->SlotsIncrement[0] = 25*FRACUNIT;
armor->SlotsIncrement[1] = 20*FRACUNIT;
armor->SlotsIncrement[2] = 15*FRACUNIT;
armor->SlotsIncrement[3] = 5*FRACUNIT;
return Super::TryPickup (toucher);
}
// --- Fighter Weapons ------------------------------------------------------
// Cleric Weapon Base Class -------------------------------------------------
IMPLEMENT_STATELESS_ACTOR (AClericWeapon, Hexen, -1, 0)
PROP_Weapon_Kickback (150)
END_DEFAULTS
bool AClericWeapon::TryPickup (AActor *toucher)
{
// The Doom and Hexen players are not excluded from pickup in case
// somebody wants to use these weapons with either of those games.
if (toucher->IsKindOf (PClass::FindClass(NAME_FighterPlayer)) ||
toucher->IsKindOf (PClass::FindClass(NAME_MagePlayer)))
{ // Wrong class, but try to pick up for mana
if (ShouldStay())
{ // Can't pick up weapons for other classes in coop netplay
return false;
}
bool gaveSome = (NULL != AddAmmo (toucher, AmmoType1, AmmoGive1));
gaveSome |= (NULL != AddAmmo (toucher, AmmoType2, AmmoGive2));
if (gaveSome)
{
GoAwayAndDie ();
}
return gaveSome;
}
return Super::TryPickup (toucher);
}
// Mage Weapon Base Class ---------------------------------------------------
IMPLEMENT_STATELESS_ACTOR (AMageWeapon, Hexen, -1, 0)
PROP_Weapon_Kickback (150)
END_DEFAULTS
bool AMageWeapon::TryPickup (AActor *toucher)
{
// The Doom and Hexen players are not excluded from pickup in case
// somebody wants to use these weapons with either of those games.
if (toucher->IsKindOf (PClass::FindClass(NAME_FighterPlayer)) ||
toucher->IsKindOf (PClass::FindClass(NAME_ClericPlayer)))
{ // Wrong class, but try to pick up for mana
if (ShouldStay())
{ // Can't pick up weapons for other classes in coop netplay
return false;
}
bool gaveSome = (NULL != AddAmmo (toucher, AmmoType1, AmmoGive1));
gaveSome |= (NULL != AddAmmo (toucher, AmmoType2, AmmoGive2));
if (gaveSome)
{
GoAwayAndDie ();
}
return gaveSome;
}
return Super::TryPickup (toucher);
}
static FRandom pr_fpatk ("FPunchAttack");
//============================================================================
//
@ -345,58 +304,3 @@ punchdone:
return;
}
// Radius armor boost
bool AFighterPlayer::DoHealingRadius (APlayerPawn *other)
{
bool gotSome = false;
for (int i = 0; i < 4; ++i)
{
AHexenArmor *armor = Spawn<AHexenArmor> (0,0,0, NO_REPLACE);
armor->health = i;
armor->Amount = 1;
if (!armor->TryPickup (player->mo))
{
armor->Destroy ();
}
else
{
gotSome = true;
}
}
if (gotSome)
{
S_Sound (other, CHAN_AUTO, "MysticIncant", 1, ATTN_NORM);
return true;
}
return false;
}
// Fighter Weapon Base Class ------------------------------------------------
IMPLEMENT_STATELESS_ACTOR (AFighterWeapon, Hexen, -1, 0)
PROP_Weapon_Kickback (150)
END_DEFAULTS
bool AFighterWeapon::TryPickup (AActor *toucher)
{
// The Doom and Hexen players are not excluded from pickup in case
// somebody wants to use these weapons with either of those games.
if (toucher->IsKindOf (RUNTIME_CLASS(AClericPlayer)) ||
toucher->IsKindOf (RUNTIME_CLASS(AMagePlayer)))
{ // Wrong class, but try to pick up for mana
if (ShouldStay())
{ // Can't pick up weapons for other classes in coop netplay
return false;
}
bool gaveSome = (NULL != AddAmmo (toucher, AmmoType1, AmmoGive1));
gaveSome |= (NULL != AddAmmo (toucher, AmmoType2, AmmoGive2));
if (gaveSome)
{
GoAwayAndDie ();
}
return gaveSome;
}
return Super::TryPickup (toucher);
}