- Added damage factors that allows to make monsters more or less resistant

to specific damage types.
- Changed Dehacked parser to use the DECORATE symbol tables for code pointers
  instead of creating its own ones.
- Removed the HandleNoSector hack and changed A_Look so that it uses the sector's
  sound target for actors with MF_NOSECTOR regardless of compatibility settings.
- Moved initialization of weapon slots after the actor initialization.
  With default weapons exported to DECORATE it can't be done earlier.
- Converted Doom weapons to DECORATE.
- Changed backpack definition so that Doom's backpack is no longer the base
  class that implements its functionality. Now there is an abstract base class
  all backpack-like items derive from. Also moved the actual definition of Doom's
  backpack to DECORATE.


SVN r519 (trunk)
This commit is contained in:
Christoph Oelckers 2007-04-28 09:06:32 +00:00
commit ea4f160e35
29 changed files with 785 additions and 735 deletions

View file

@ -20,46 +20,6 @@ static FRandom pr_fireplasma ("FirePlasma");
static FRandom pr_firerail ("FireRail");
static FRandom pr_bfgspray ("BFGSpray");
// Fist ---------------------------------------------------------------------
void A_Punch (AActor *);
class AFist : public AWeapon
{
DECLARE_ACTOR (AFist, AWeapon)
};
FState AFist::States[] =
{
#define S_PUNCH 0
S_NORMAL (PUNG, 'A', 1, A_WeaponReady , &States[S_PUNCH]),
#define S_PUNCHDOWN (S_PUNCH+1)
S_NORMAL (PUNG, 'A', 1, A_Lower , &States[S_PUNCHDOWN]),
#define S_PUNCHUP (S_PUNCHDOWN+1)
S_NORMAL (PUNG, 'A', 1, A_Raise , &States[S_PUNCHUP]),
#define S_PUNCH1 (S_PUNCHUP+1)
S_NORMAL (PUNG, 'B', 4, NULL , &States[S_PUNCH1+1]),
S_NORMAL (PUNG, 'C', 4, A_Punch , &States[S_PUNCH1+2]),
S_NORMAL (PUNG, 'D', 5, NULL , &States[S_PUNCH1+3]),
S_NORMAL (PUNG, 'C', 4, NULL , &States[S_PUNCH1+4]),
S_NORMAL (PUNG, 'B', 5, A_ReFire , &States[S_PUNCH])
};
IMPLEMENT_ACTOR (AFist, Doom, -1, 0)
PROP_Weapon_SelectionOrder (3700)
PROP_Weapon_Flags (WIF_WIMPY_WEAPON|WIF_BOT_MELEE)
PROP_Weapon_UpState (S_PUNCHUP)
PROP_Weapon_DownState (S_PUNCHDOWN)
PROP_Weapon_ReadyState (S_PUNCH)
PROP_Weapon_AtkState (S_PUNCH1)
PROP_Weapon_Kickback (100)
PROP_Obituary("$OB_MPFIST")
END_DEFAULTS
//
// A_Punch
//
@ -101,57 +61,6 @@ void A_Punch (AActor *actor)
}
}
// Pistol -------------------------------------------------------------------
void A_FirePistol (AActor *);
class APistol : public AWeapon
{
DECLARE_ACTOR (APistol, AWeapon)
};
FState APistol::States[] =
{
#define S_PISTOL 0
S_NORMAL (PISG, 'A', 1, A_WeaponReady , &States[S_PISTOL]),
#define S_PISTOLDOWN (S_PISTOL+1)
S_NORMAL (PISG, 'A', 1, A_Lower , &States[S_PISTOLDOWN]),
#define S_PISTOLUP (S_PISTOLDOWN+1)
S_NORMAL (PISG, 'A', 1, A_Raise , &States[S_PISTOLUP]),
#define S_PISTOL1 (S_PISTOLUP+1)
S_NORMAL (PISG, 'A', 4, NULL , &States[S_PISTOL1+1]),
S_NORMAL (PISG, 'B', 6, A_FirePistol , &States[S_PISTOL1+2]),
S_NORMAL (PISG, 'C', 4, NULL , &States[S_PISTOL1+3]),
S_NORMAL (PISG, 'B', 5, A_ReFire , &States[S_PISTOL]),
#define S_PISTOLFLASH (S_PISTOL1+4)
S_BRIGHT (PISF, 'A', 7, A_Light1 , &AWeapon::States[S_LIGHTDONE]),
// This next state is here just in case people want to shoot plasma balls or railguns
// with the pistol using Dehacked.
S_BRIGHT (PISF, 'A', 7, A_Light1 , &AWeapon::States[S_LIGHTDONE])
};
IMPLEMENT_ACTOR (APistol, Doom, -1, 0)
PROP_Weapon_SelectionOrder (1900)
PROP_Weapon_Flags (WIF_WIMPY_WEAPON)
PROP_Weapon_AmmoUse1 (1)
PROP_Weapon_AmmoGive1 (20)
PROP_Weapon_UpState (S_PISTOLUP)
PROP_Weapon_DownState (S_PISTOLDOWN)
PROP_Weapon_ReadyState (S_PISTOL)
PROP_Weapon_AtkState (S_PISTOL1)
PROP_Weapon_FlashState (S_PISTOLFLASH)
PROP_Weapon_Kickback (100)
PROP_Weapon_MoveCombatDist (25000000)
PROP_Weapon_AmmoType1 ("Clip")
PROP_Obituary("$OB_MPPISTOL")
END_DEFAULTS
//
// A_FirePistol
//
@ -184,54 +93,6 @@ void A_FirePistol (AActor *actor)
P_GunShot (actor, accurate, PClass::FindClass(NAME_BulletPuff));
}
// Chainsaw -----------------------------------------------------------------
void A_Saw (AActor *);
class AChainsaw : public AWeapon
{
DECLARE_ACTOR (AChainsaw, AWeapon)
};
FState AChainsaw::States[] =
{
#define S_SAW 0
S_NORMAL (SAWG, 'C', 4, A_WeaponReady , &States[S_SAW+1]),
S_NORMAL (SAWG, 'D', 4, A_WeaponReady , &States[S_SAW+0]),
#define S_SAWDOWN (S_SAW+2)
S_NORMAL (SAWG, 'C', 1, A_Lower , &States[S_SAWDOWN]),
#define S_SAWUP (S_SAWDOWN+1)
S_NORMAL (SAWG, 'C', 1, A_Raise , &States[S_SAWUP]),
#define S_SAW1 (S_SAWUP+1)
S_NORMAL (SAWG, 'A', 4, A_Saw , &States[S_SAW1+1]),
S_NORMAL (SAWG, 'B', 4, A_Saw , &States[S_SAW1+2]),
S_NORMAL (SAWG, 'B', 0, A_ReFire , &States[S_SAW]),
#define S_CSAW (S_SAW1+3)
S_NORMAL (CSAW, 'A', -1, NULL , NULL)
};
IMPLEMENT_ACTOR (AChainsaw, Doom, 2005, 32)
PROP_RadiusFixed (20)
PROP_HeightFixed (16)
PROP_Flags (MF_SPECIAL)
PROP_SpawnState (S_CSAW)
PROP_Weapon_SelectionOrder (2200)
PROP_Weapon_Flags (WIF_BOT_MELEE)
PROP_Weapon_UpState (S_SAWUP)
PROP_Weapon_DownState (S_SAWDOWN)
PROP_Weapon_ReadyState (S_SAW)
PROP_Weapon_AtkState (S_SAW1)
PROP_Weapon_UpSound ("weapons/sawup")
PROP_Weapon_ReadySound ("weapons/sawidle")
PROP_Obituary("$OB_MPCHAINSAW")
PROP_Inventory_PickupMessage("$GOTCHAINSAW")
END_DEFAULTS
//
// A_Saw
//
@ -309,66 +170,6 @@ void A_Saw (AActor *actor)
actor->flags |= MF_JUSTATTACKED;
}
// Shotgun ------------------------------------------------------------------
void A_FireShotgun (AActor *);
class AShotgun : public AWeapon
{
DECLARE_ACTOR (AShotgun, AWeapon)
};
FState AShotgun::States[] =
{
#define S_SGUN 0
S_NORMAL (SHTG, 'A', 1, A_WeaponReady , &States[S_SGUN]),
#define S_SGUNDOWN (S_SGUN+1)
S_NORMAL (SHTG, 'A', 1, A_Lower , &States[S_SGUNDOWN]),
#define S_SGUNUP (S_SGUNDOWN+1)
S_NORMAL (SHTG, 'A', 1, A_Raise , &States[S_SGUNUP]),
#define S_SGUN1 (S_SGUNUP+1)
S_NORMAL (SHTG, 'A', 3, NULL , &States[S_SGUN1+1]),
S_NORMAL (SHTG, 'A', 7, A_FireShotgun , &States[S_SGUN1+2]),
S_NORMAL (SHTG, 'B', 5, NULL , &States[S_SGUN1+3]),
S_NORMAL (SHTG, 'C', 5, NULL , &States[S_SGUN1+4]),
S_NORMAL (SHTG, 'D', 4, NULL , &States[S_SGUN1+5]),
S_NORMAL (SHTG, 'C', 5, NULL , &States[S_SGUN1+6]),
S_NORMAL (SHTG, 'B', 5, NULL , &States[S_SGUN1+7]),
S_NORMAL (SHTG, 'A', 3, NULL , &States[S_SGUN1+8]),
S_NORMAL (SHTG, 'A', 7, A_ReFire , &States[S_SGUN]),
#define S_SGUNFLASH (S_SGUN1+9)
S_BRIGHT (SHTF, 'A', 4, A_Light1 , &States[S_SGUNFLASH+1]),
S_BRIGHT (SHTF, 'B', 3, A_Light2 , &AWeapon::States[S_LIGHTDONE]),
#define S_SHOT (S_SGUNFLASH+2)
S_NORMAL (SHOT, 'A', -1, NULL , NULL)
};
IMPLEMENT_ACTOR (AShotgun, Doom, 2001, 27)
PROP_RadiusFixed (20)
PROP_HeightFixed (16)
PROP_Flags (MF_SPECIAL)
PROP_SpawnState (S_SHOT)
PROP_Weapon_SelectionOrder (1300)
PROP_Weapon_AmmoUse1 (1)
PROP_Weapon_AmmoGive1 (8)
PROP_Weapon_UpState (S_SGUNUP)
PROP_Weapon_DownState (S_SGUNDOWN)
PROP_Weapon_ReadyState (S_SGUN)
PROP_Weapon_AtkState (S_SGUN1)
PROP_Weapon_FlashState (S_SGUNFLASH)
PROP_Weapon_Kickback (100)
PROP_Weapon_MoveCombatDist (24000000)
PROP_Weapon_AmmoType1 ("Shell")
PROP_Obituary("$OB_MPSHOTGUN")
PROP_Inventory_PickupMessage("$GOTSHOTGUN")
END_DEFAULTS
//
// A_FireShotgun
//
@ -398,74 +199,6 @@ void A_FireShotgun (AActor *actor)
P_GunShot (actor, false, PClass::FindClass(NAME_BulletPuff));
}
// Super Shotgun ------------------------------------------------------------
void A_FireShotgun2 (AActor *actor);
void A_OpenShotgun2 (AActor *actor);
void A_LoadShotgun2 (AActor *actor);
void A_CloseShotgun2 (AActor *actor);
class ASuperShotgun : public AWeapon
{
DECLARE_ACTOR (ASuperShotgun, AWeapon)
};
FState ASuperShotgun::States[] =
{
#define S_DSGUN 0
S_NORMAL (SHT2, 'A', 1, A_WeaponReady , &States[S_DSGUN]),
#define S_DSGUNDOWN (S_DSGUN+1)
S_NORMAL (SHT2, 'A', 1, A_Lower , &States[S_DSGUNDOWN]),
#define S_DSGUNUP (S_DSGUNDOWN+1)
S_NORMAL (SHT2, 'A', 1, A_Raise , &States[S_DSGUNUP]),
#define S_DSGUN1 (S_DSGUNUP+1)
S_NORMAL (SHT2, 'A', 3, NULL , &States[S_DSGUN1+1]),
S_NORMAL (SHT2, 'A', 7, A_FireShotgun2 , &States[S_DSGUN1+2]),
S_NORMAL (SHT2, 'B', 7, NULL , &States[S_DSGUN1+3]),
S_NORMAL (SHT2, 'C', 7, A_CheckReload , &States[S_DSGUN1+4]),
S_NORMAL (SHT2, 'D', 7, A_OpenShotgun2 , &States[S_DSGUN1+5]),
S_NORMAL (SHT2, 'E', 7, NULL , &States[S_DSGUN1+6]),
S_NORMAL (SHT2, 'F', 7, A_LoadShotgun2 , &States[S_DSGUN1+7]),
S_NORMAL (SHT2, 'G', 6, NULL , &States[S_DSGUN1+8]),
S_NORMAL (SHT2, 'H', 6, A_CloseShotgun2 , &States[S_DSGUN1+9]),
S_NORMAL (SHT2, 'A', 5, A_ReFire , &States[S_DSGUN]),
#define S_DSNR (S_DSGUN1+10)
S_NORMAL (SHT2, 'B', 7, NULL , &States[S_DSNR+1]),
S_NORMAL (SHT2, 'A', 3, NULL , &States[S_DSGUNDOWN]),
#define S_DSGUNFLASH (S_DSNR+2)
S_BRIGHT (SHT2, 'I', 4, A_Light1 , &States[S_DSGUNFLASH+1]),
S_BRIGHT (SHT2, 'J', 3, A_Light2 , &AWeapon::States[S_LIGHTDONE]),
#define S_SHOT2 (S_DSGUNFLASH+2)
S_NORMAL (SGN2, 'A', -1, NULL , NULL)
};
IMPLEMENT_ACTOR (ASuperShotgun, Doom, 82, 33)
PROP_RadiusFixed (20)
PROP_HeightFixed (16)
PROP_Flags (MF_SPECIAL)
PROP_SpawnState (S_SHOT2)
PROP_Weapon_SelectionOrder (400)
PROP_Weapon_AmmoUse1 (2)
PROP_Weapon_AmmoGive1 (8)
PROP_Weapon_UpState (S_DSGUNUP)
PROP_Weapon_DownState (S_DSGUNDOWN)
PROP_Weapon_ReadyState (S_DSGUN)
PROP_Weapon_AtkState (S_DSGUN1)
PROP_Weapon_FlashState (S_DSGUNFLASH)
PROP_Weapon_Kickback (100)
PROP_Weapon_MoveCombatDist (15000000)
PROP_Weapon_AmmoType1 ("Shell")
PROP_Obituary("$OB_MPSSHOTGUN")
PROP_Inventory_PickupMessage("$GOTSHOTGUN2")
END_DEFAULTS
//
// A_FireShotgun2
//
@ -530,59 +263,50 @@ void A_CloseShotgun2 (AActor *actor)
A_ReFire (actor);
}
// Chaingun -----------------------------------------------------------------
void A_FireCGun (AActor *);
//------------------------------------------------------------------------------------
//
// Setting a random flash like some of Doom's weapons can easily crash when the
// definition is overridden incorrectly so let's check that the state actually exists.
// Be aware though that this will not catch all DEHACKED related problems. But it will
// find all DECORATE related ones.
//
//------------------------------------------------------------------------------------
class AChaingun : public AWeapon
void P_SetSafeFlash(AWeapon * weapon, player_t * player, FState * flashstate, int index)
{
DECLARE_ACTOR (AChaingun, AWeapon)
};
FState AChaingun::States[] =
{
#define S_CHAIN 0
S_NORMAL (CHGG, 'A', 1, A_WeaponReady , &States[S_CHAIN]),
#define S_CHAINDOWN (S_CHAIN+1)
S_NORMAL (CHGG, 'A', 1, A_Lower , &States[S_CHAINDOWN]),
#define S_CHAINUP (S_CHAINDOWN+1)
S_NORMAL (CHGG, 'A', 1, A_Raise , &States[S_CHAINUP]),
#define S_CHAIN1 (S_CHAINUP+1)
S_NORMAL (CHGG, 'A', 4, A_FireCGun , &States[S_CHAIN1+1]),
S_NORMAL (CHGG, 'B', 4, A_FireCGun , &States[S_CHAIN1+2]),
S_NORMAL (CHGG, 'B', 0, A_ReFire , &States[S_CHAIN]),
#define S_CHAINFLASH (S_CHAIN1+3)
S_BRIGHT (CHGF, 'A', 5, A_Light1 , &AWeapon::States[S_LIGHTDONE]),
S_BRIGHT (CHGF, 'B', 5, A_Light2 , &AWeapon::States[S_LIGHTDONE]),
#define S_MGUN (S_CHAINFLASH+2)
S_NORMAL (MGUN, 'A', -1, NULL , NULL)
};
IMPLEMENT_ACTOR (AChaingun, Doom, 2002, 28)
PROP_RadiusFixed (20)
PROP_HeightFixed (16)
PROP_Flags (MF_SPECIAL)
PROP_SpawnState (S_MGUN)
PROP_Weapon_SelectionOrder (700)
PROP_Weapon_AmmoUse1 (1)
PROP_Weapon_AmmoGive1 (20)
PROP_Weapon_UpState (S_CHAINUP)
PROP_Weapon_DownState (S_CHAINDOWN)
PROP_Weapon_ReadyState (S_CHAIN)
PROP_Weapon_AtkState (S_CHAIN1)
PROP_Weapon_FlashState (S_CHAINFLASH)
PROP_Weapon_Kickback (100)
PROP_Weapon_MoveCombatDist (27000000)
PROP_Weapon_AmmoType1 ("Clip")
PROP_Obituary("$OB_MPCHAINGUN")
PROP_Inventory_PickupMessage("$GOTCHAINGUN")
END_DEFAULTS
const PClass * cls = weapon->GetClass();
while (cls != RUNTIME_CLASS(AWeapon))
{
FActorInfo * info = cls->ActorInfo;
if (flashstate >= info->OwnedStates && flashstate < info->OwnedStates + info->NumOwnedStates)
{
// The flash state belongs to this class.
// Now let's check if the actually wanted state does also
if (flashstate+index < info->OwnedStates + info->NumOwnedStates)
{
// we're ok so set the state
P_SetPsprite (player, ps_flash, flashstate + index);
return;
}
else
{
// oh, no! The state is beyond the end of the state table so use the original flash state.
P_SetPsprite (player, ps_flash, flashstate);
return;
}
}
// try again with parent class
cls = cls->ParentClass;
}
// if we get here the state doesn't seem to belong to any class in the inheritance chain
// This can happen with Dehacked if the flash states are remapped.
// The only way to check this would be to go through all Dehacked modifiable actors and
// find the correct one.
// For now let's assume that it will work.
P_SetPsprite (player, ps_flash, flashstate + index);
}
//
// A_FireCGun
@ -617,7 +341,7 @@ void A_FireCGun (AActor *actor)
theflash = 0;
}
P_SetPsprite (player, ps_flash, flash + theflash);
P_SetSafeFlash (weapon, player, flash, theflash);
}
}
@ -627,94 +351,6 @@ void A_FireCGun (AActor *actor)
P_GunShot (actor, !player->refire, PClass::FindClass(NAME_BulletPuff));
}
// Rocket launcher ---------------------------------------------------------
void A_FireMissile (AActor *);
void A_Explode (AActor *);
class ARocketLauncher : public AWeapon
{
DECLARE_ACTOR (ARocketLauncher, AWeapon)
};
FState ARocketLauncher::States[] =
{
#define S_MISSILE 0
S_NORMAL (MISG, 'A', 1, A_WeaponReady , &States[S_MISSILE]),
#define S_MISSILEDOWN (S_MISSILE+1)
S_NORMAL (MISG, 'A', 1, A_Lower , &States[S_MISSILEDOWN]),
#define S_MISSILEUP (S_MISSILEDOWN+1)
S_NORMAL (MISG, 'A', 1, A_Raise , &States[S_MISSILEUP]),
#define S_MISSILE1 (S_MISSILEUP+1)
S_NORMAL (MISG, 'B', 8, A_GunFlash , &States[S_MISSILE1+1]),
S_NORMAL (MISG, 'B', 12, A_FireMissile , &States[S_MISSILE1+2]),
S_NORMAL (MISG, 'B', 0, A_ReFire , &States[S_MISSILE]),
#define S_MISSILEFLASH (S_MISSILE1+3)
S_BRIGHT (MISF, 'A', 3, A_Light1 , &States[S_MISSILEFLASH+1]),
S_BRIGHT (MISF, 'B', 4, NULL , &States[S_MISSILEFLASH+2]),
S_BRIGHT (MISF, 'C', 4, A_Light2 , &States[S_MISSILEFLASH+3]),
S_BRIGHT (MISF, 'D', 4, A_Light2 , &AWeapon::States[S_LIGHTDONE]),
#define S_LAUN (S_MISSILEFLASH+4)
S_NORMAL (LAUN, 'A', -1, NULL , NULL)
};
IMPLEMENT_ACTOR (ARocketLauncher, Doom, 2003, 29)
PROP_RadiusFixed (20)
PROP_HeightFixed (16)
PROP_Flags (MF_SPECIAL)
PROP_SpawnState (S_LAUN)
PROP_Weapon_SelectionOrder (2500)
PROP_Weapon_Flags (WIF_NOAUTOFIRE|WIF_BOT_REACTION_SKILL_THING|WIF_BOT_EXPLOSIVE)
PROP_Weapon_AmmoUse1 (1)
PROP_Weapon_AmmoGive1 (2)
PROP_Weapon_UpState (S_MISSILEUP)
PROP_Weapon_DownState (S_MISSILEDOWN)
PROP_Weapon_ReadyState (S_MISSILE)
PROP_Weapon_AtkState (S_MISSILE1)
PROP_Weapon_FlashState (S_MISSILEFLASH)
PROP_Weapon_Kickback (100)
PROP_Weapon_MoveCombatDist (18350080)
PROP_Weapon_AmmoType1 ("RocketAmmo")
PROP_Weapon_ProjectileType ("Rocket")
PROP_Inventory_PickupMessage("$GOTLAUNCHER")
END_DEFAULTS
FState ARocket::States[] =
{
#define S_ROCKET 0
S_BRIGHT (MISL, 'A', 1, NULL , &States[S_ROCKET]),
#define S_EXPLODE (S_ROCKET+1)
S_BRIGHT (MISL, 'B', 8, A_Explode , &States[S_EXPLODE+1]),
S_BRIGHT (MISL, 'C', 6, NULL , &States[S_EXPLODE+2]),
S_BRIGHT (MISL, 'D', 4, NULL , NULL)
};
IMPLEMENT_ACTOR (ARocket, Doom, -1, 127)
PROP_RadiusFixed (11)
PROP_HeightFixed (8)
PROP_SpeedFixed (20)
PROP_Damage (20)
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF|MF_NOGRAVITY)
PROP_Flags2 (MF2_PCROSS|MF2_IMPACT|MF2_NOTELEPORT)
PROP_Flags4 (MF4_RANDOMIZE)
PROP_Flags5 (MF5_DEHEXPLOSION)
PROP_FXFlags (FX_ROCKET)
PROP_SpawnState (S_ROCKET)
PROP_DeathState (S_EXPLODE)
PROP_SeeSound ("weapons/rocklf")
PROP_DeathSound ("weapons/rocklx")
PROP_Obituary("$OB_MPROCKET")
END_DEFAULTS
//
// A_FireMissile
//
@ -732,96 +368,9 @@ void A_FireMissile (AActor *actor)
if (!weapon->DepleteAmmo (weapon->bAltFire))
return;
}
P_SpawnPlayerMissile (actor, RUNTIME_CLASS(ARocket));
P_SpawnPlayerMissile (actor, PClass::FindClass("Rocket"));
}
// Plasma rifle ------------------------------------------------------------
void A_FirePlasma (AActor *);
class APlasmaRifle : public AWeapon
{
DECLARE_ACTOR (APlasmaRifle, AWeapon)
};
FState APlasmaRifle::States[] =
{
#define S_PLASMA 0
S_NORMAL (PLSG, 'A', 1, A_WeaponReady , &States[S_PLASMA]),
#define S_PLASMADOWN (S_PLASMA+1)
S_NORMAL (PLSG, 'A', 1, A_Lower , &States[S_PLASMADOWN]),
#define S_PLASMAUP (S_PLASMADOWN+1)
S_NORMAL (PLSG, 'A', 1, A_Raise , &States[S_PLASMAUP]),
#define S_PLASMA1 (S_PLASMAUP+1)
S_NORMAL (PLSG, 'A', 3, A_FirePlasma , &States[S_PLASMA1+1]),
S_NORMAL (PLSG, 'B', 20, A_ReFire , &States[S_PLASMA]),
#define S_PLASMAFLASH (S_PLASMA1+2)
S_BRIGHT (PLSF, 'A', 4, A_Light1 , &AWeapon::States[S_LIGHTDONE]),
S_BRIGHT (PLSF, 'B', 4, A_Light1 , &AWeapon::States[S_LIGHTDONE]),
#define S_PLAS (S_PLASMAFLASH+2)
S_NORMAL (PLAS, 'A', -1, NULL , NULL)
};
IMPLEMENT_ACTOR (APlasmaRifle, Doom, 2004, 30)
PROP_RadiusFixed (20)
PROP_HeightFixed (16)
PROP_Flags (MF_SPECIAL)
PROP_SpawnState (S_PLAS)
PROP_Weapon_SelectionOrder (100)
PROP_Weapon_AmmoUse1 (1)
PROP_Weapon_AmmoGive1 (40)
PROP_Weapon_UpState (S_PLASMAUP)
PROP_Weapon_DownState (S_PLASMADOWN)
PROP_Weapon_ReadyState (S_PLASMA)
PROP_Weapon_AtkState (S_PLASMA1)
PROP_Weapon_FlashState (S_PLASMAFLASH)
PROP_Weapon_Kickback (100)
PROP_Weapon_MoveCombatDist (27000000)
PROP_Weapon_ProjectileType ("PlasmaBall")
PROP_Weapon_AmmoType1 ("Cell")
PROP_Inventory_PickupMessage("$GOTPLASMA")
END_DEFAULTS
FState APlasmaBall::States[] =
{
#define S_PLASBALL 0
S_BRIGHT (PLSS, 'A', 6, NULL , &States[S_PLASBALL+1]),
S_BRIGHT (PLSS, 'B', 6, NULL , &States[S_PLASBALL]),
#define S_PLASEXP (S_PLASBALL+2)
S_BRIGHT (PLSE, 'A', 4, NULL , &States[S_PLASEXP+1]),
S_BRIGHT (PLSE, 'B', 4, NULL , &States[S_PLASEXP+2]),
S_BRIGHT (PLSE, 'C', 4, NULL , &States[S_PLASEXP+3]),
S_BRIGHT (PLSE, 'D', 4, NULL , &States[S_PLASEXP+4]),
S_BRIGHT (PLSE, 'E', 4, NULL , NULL)
};
IMPLEMENT_ACTOR (APlasmaBall, Doom, -1, 51)
PROP_RadiusFixed (13)
PROP_HeightFixed (8)
PROP_SpeedFixed (25)
PROP_Damage (5)
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF|MF_NOGRAVITY)
PROP_Flags2 (MF2_PCROSS|MF2_IMPACT|MF2_NOTELEPORT)
PROP_Flags3 (MF3_WARNBOT)
PROP_Flags4 (MF4_RANDOMIZE)
PROP_RenderStyle (STYLE_Add)
PROP_Alpha (TRANSLUC75)
PROP_SpawnState (S_PLASBALL)
PROP_DeathState (S_PLASEXP)
PROP_SeeSound ("weapons/plasmaf")
PROP_DeathSound ("weapons/plasmax")
PROP_Obituary("$OB_MPPLASMARIFLE")
END_DEFAULTS
//
// A_FirePlasma
//
@ -842,11 +391,11 @@ void A_FirePlasma (AActor *actor)
FState *flash = weapon->FindState(NAME_Flash);
if (flash != NULL)
{
P_SetPsprite (player, ps_flash, flash + (pr_fireplasma()&1));
P_SetSafeFlash(weapon, player, flash, (pr_fireplasma()&1));
}
}
P_SpawnPlayerMissile (actor, RUNTIME_CLASS(APlasmaBall));
P_SpawnPlayerMissile (actor, PClass::FindClass("PlasmaBall"));
}
//
@ -873,7 +422,7 @@ void A_FireRailgun (AActor *actor)
FState *flash = weapon->FindState(NAME_Flash);
if (flash != NULL)
{
P_SetPsprite (player, ps_flash, flash + (pr_firerail()&1));
P_SetSafeFlash(weapon, player, flash, (pr_firerail()&1));
}
}
@ -900,118 +449,6 @@ void A_RailWait (AActor *actor)
// Okay, this was stupid. Just use a NULL function instead of this.
}
// BFG 9000 -----------------------------------------------------------------
void A_FireBFG (AActor *);
void A_BFGSpray (AActor *);
void A_BFGsound (AActor *);
class ABFG9000 : public AWeapon
{
DECLARE_ACTOR (ABFG9000, AWeapon)
};
class ABFGExtra : public AActor
{
DECLARE_ACTOR (ABFGExtra, AActor)
};
FState ABFG9000::States[] =
{
#define S_BFG 0
S_NORMAL (BFGG, 'A', 1, A_WeaponReady , &States[S_BFG]),
#define S_BFGDOWN (S_BFG+1)
S_NORMAL (BFGG, 'A', 1, A_Lower , &States[S_BFGDOWN]),
#define S_BFGUP (S_BFGDOWN+1)
S_NORMAL (BFGG, 'A', 1, A_Raise , &States[S_BFGUP]),
#define S_BFG1 (S_BFGUP+1)
S_NORMAL (BFGG, 'A', 20, A_BFGsound , &States[S_BFG1+1]),
S_NORMAL (BFGG, 'B', 10, A_GunFlash , &States[S_BFG1+2]),
S_NORMAL (BFGG, 'B', 10, A_FireBFG , &States[S_BFG1+3]),
S_NORMAL (BFGG, 'B', 20, A_ReFire , &States[S_BFG]),
#define S_BFGFLASH (S_BFG1+4)
S_BRIGHT (BFGF, 'A', 11, A_Light1 , &States[S_BFGFLASH+1]),
S_BRIGHT (BFGF, 'B', 6, A_Light2 , &AWeapon::States[S_LIGHTDONE]),
#define S_BFUG (S_BFGFLASH+2)
S_NORMAL (BFUG, 'A', -1, NULL , NULL)
};
IMPLEMENT_ACTOR (ABFG9000, Doom, 2006, 31)
PROP_RadiusFixed (20)
PROP_HeightFixed (20)
PROP_Flags (MF_SPECIAL)
PROP_SpawnState (S_BFUG)
PROP_Weapon_Flags (WIF_NOAUTOFIRE|WIF_BOT_REACTION_SKILL_THING|WIF_BOT_BFG)
PROP_Weapon_SelectionOrder (2800)
PROP_Weapon_AmmoUse1 (40)
PROP_Weapon_AmmoGive1 (40)
PROP_Weapon_UpState (S_BFGUP)
PROP_Weapon_DownState (S_BFGDOWN)
PROP_Weapon_ReadyState (S_BFG)
PROP_Weapon_AtkState (S_BFG1)
PROP_Weapon_FlashState (S_BFGFLASH)
PROP_Weapon_Kickback (100)
PROP_Weapon_MoveCombatDist (10000000)
PROP_Weapon_AmmoType1 ("Cell")
PROP_Weapon_ProjectileType ("BFGBall")
PROP_Inventory_PickupMessage("$GOTBFG9000")
END_DEFAULTS
FState ABFGBall::States[] =
{
#define S_BFGSHOT 0
S_BRIGHT (BFS1, 'A', 4, NULL , &States[S_BFGSHOT+1]),
S_BRIGHT (BFS1, 'B', 4, NULL , &States[S_BFGSHOT]),
#define S_BFGLAND (S_BFGSHOT+2)
S_BRIGHT (BFE1, 'A', 8, NULL , &States[S_BFGLAND+1]),
S_BRIGHT (BFE1, 'B', 8, NULL , &States[S_BFGLAND+2]),
S_BRIGHT (BFE1, 'C', 8, A_BFGSpray , &States[S_BFGLAND+3]),
S_BRIGHT (BFE1, 'D', 8, NULL , &States[S_BFGLAND+4]),
S_BRIGHT (BFE1, 'E', 8, NULL , &States[S_BFGLAND+5]),
S_BRIGHT (BFE1, 'F', 8, NULL , NULL)
};
IMPLEMENT_ACTOR (ABFGBall, Doom, -1, 128)
PROP_RadiusFixed (13)
PROP_HeightFixed (8)
PROP_SpeedFixed (25)
PROP_Damage (100)
PROP_Flags (MF_NOBLOCKMAP|MF_MISSILE|MF_DROPOFF|MF_NOGRAVITY)
PROP_Flags2 (MF2_PCROSS|MF2_IMPACT|MF2_NOTELEPORT)
PROP_Flags4 (MF4_RANDOMIZE)
PROP_RenderStyle (STYLE_Add)
PROP_Alpha (TRANSLUC75)
PROP_SpawnState (S_BFGSHOT)
PROP_DeathState (S_BFGLAND)
PROP_DeathSound ("weapons/bfgx")
PROP_Obituary("$OB_MPBFG_BOOM")
END_DEFAULTS
FState ABFGExtra::States[] =
{
S_BRIGHT (BFE2, 'A', 8, NULL , &States[1]),
S_BRIGHT (BFE2, 'B', 8, NULL , &States[2]),
S_BRIGHT (BFE2, 'C', 8, NULL , &States[3]),
S_BRIGHT (BFE2, 'D', 8, NULL , NULL)
};
IMPLEMENT_ACTOR (ABFGExtra, Doom, -1, 0)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY)
PROP_RenderStyle (STYLE_Add)
PROP_Alpha (TRANSLUC75)
PROP_SpawnState (0)
END_DEFAULTS
//
// A_FireBFG
//
@ -1040,7 +477,7 @@ void A_FireBFG (AActor *actor)
actor->pitch = 0;
player->userinfo.aimdist = ANGLE_1*35;
}
P_SpawnPlayerMissile (actor, RUNTIME_CLASS(ABFGBall));
P_SpawnPlayerMissile (actor, PClass::FindClass("BFGBall"));
actor->pitch = storedpitch;
player->userinfo.aimdist = storedaimdist;
}
@ -1073,7 +510,7 @@ void A_BFGSpray (AActor *mo)
}
if (spraytype == NULL)
{
spraytype = RUNTIME_CLASS(ABFGExtra);
spraytype = PClass::FindClass("BFGExtra");
}
// [RH] Don't crash if no target