- Fixed: The global WeaponSection string was never freed. It has been replaced

with an FString now.
- Fixed: The music strings in the default level info were never freed and
  caused memory leaks when used repeatedly.
- Fixed: The intermusic string in the level info was never freed.
- Fixed: The default fire obituary should only be printed if the damage
  came from the environment. If it comes from a monster the monster specific
  obituary should be used instead.
- Added custom damage types from the floating point test release.
- Changed Pain Elemental's massacre check. Now A_PainDie checks for the damage 
  type and doesn't spawn anything if it is NAME_Massacre. A_PainDie can also 
  be used by other actors so a more generalized approach is needed than hard
  coding it into the Pain Elemental.
- Converted a few of Doom's monsters to DECORATE because I couldn't test the
  first version of the custom state code with the corpses inheriting from them.
- Added custom states from last year's floating point test release and fixed
  some bugs I found in that code. Unfortunately it wasn't all salvageable
  and it was easier to recreate some parts from scratch.



SVN r368 (trunk)
This commit is contained in:
Christoph Oelckers 2006-10-31 14:53:21 +00:00
commit 063c85b157
118 changed files with 2103 additions and 1818 deletions

View file

@ -9,113 +9,6 @@
static FRandom pr_headattack ("HeadAttack");
void A_HeadAttack (AActor *);
class ACacodemon : public AActor
{
DECLARE_ACTOR (ACacodemon, AActor)
};
FState ACacodemon::States[] =
{
#define S_HEAD_STND 0
S_NORMAL (HEAD, 'A', 10, A_Look , &States[S_HEAD_STND]),
#define S_HEAD_RUN (S_HEAD_STND+1)
S_NORMAL (HEAD, 'A', 3, A_Chase , &States[S_HEAD_RUN+0]),
#define S_HEAD_ATK (S_HEAD_RUN+1)
S_NORMAL (HEAD, 'B', 5, A_FaceTarget , &States[S_HEAD_ATK+1]),
S_NORMAL (HEAD, 'C', 5, A_FaceTarget , &States[S_HEAD_ATK+2]),
S_BRIGHT (HEAD, 'D', 5, A_HeadAttack , &States[S_HEAD_RUN+0]),
#define S_HEAD_PAIN (S_HEAD_ATK+3)
S_NORMAL (HEAD, 'E', 3, NULL , &States[S_HEAD_PAIN+1]),
S_NORMAL (HEAD, 'E', 3, A_Pain , &States[S_HEAD_PAIN+2]),
S_NORMAL (HEAD, 'F', 6, NULL , &States[S_HEAD_RUN+0]),
#define S_HEAD_DIE (S_HEAD_PAIN+3)
S_NORMAL (HEAD, 'G', 8, NULL , &States[S_HEAD_DIE+1]),
S_NORMAL (HEAD, 'H', 8, A_Scream , &States[S_HEAD_DIE+2]),
S_NORMAL (HEAD, 'I', 8, NULL , &States[S_HEAD_DIE+3]),
S_NORMAL (HEAD, 'J', 8, NULL , &States[S_HEAD_DIE+4]),
S_NORMAL (HEAD, 'K', 8, A_NoBlocking , &States[S_HEAD_DIE+5]),
S_NORMAL (HEAD, 'L', -1, A_SetFloorClip , NULL),
#define S_HEAD_RAISE (S_HEAD_DIE+6)
S_NORMAL (HEAD, 'L', 8, A_UnSetFloorClip , &States[S_HEAD_RAISE+1]),
S_NORMAL (HEAD, 'K', 8, NULL , &States[S_HEAD_RAISE+2]),
S_NORMAL (HEAD, 'J', 8, NULL , &States[S_HEAD_RAISE+3]),
S_NORMAL (HEAD, 'I', 8, NULL , &States[S_HEAD_RAISE+4]),
S_NORMAL (HEAD, 'H', 8, NULL , &States[S_HEAD_RAISE+5]),
S_NORMAL (HEAD, 'G', 8, NULL , &States[S_HEAD_RUN+0])
};
IMPLEMENT_ACTOR (ACacodemon, Doom, 3005, 19)
PROP_SpawnHealth (400)
PROP_RadiusFixed (31)
PROP_HeightFixed (56)
PROP_Mass (400)
PROP_SpeedFixed (8)
PROP_PainChance (128)
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_FLOAT|MF_NOGRAVITY|MF_COUNTKILL)
PROP_Flags2 (MF2_MCROSS|MF2_PASSMOBJ|MF2_PUSHWALL)
PROP_SpawnState (S_HEAD_STND)
PROP_SeeState (S_HEAD_RUN)
PROP_PainState (S_HEAD_PAIN)
PROP_MissileState (S_HEAD_ATK)
PROP_DeathState (S_HEAD_DIE)
PROP_RaiseState (S_HEAD_RAISE)
PROP_SeeSound ("caco/sight")
PROP_PainSound ("caco/pain")
PROP_DeathSound ("caco/death")
PROP_ActiveSound ("caco/active")
PROP_AttackSound ("caco/melee")
PROP_Obituary("$OB_CACO")
PROP_HitObituary("$OB_CACOHIT")
END_DEFAULTS
class ACacodemonBall : public AActor
{
DECLARE_ACTOR (ACacodemonBall, AActor)
};
FState ACacodemonBall::States[] =
{
#define S_RBALL 0
S_BRIGHT (BAL2, 'A', 4, NULL , &States[S_RBALL+1]),
S_BRIGHT (BAL2, 'B', 4, NULL , &States[S_RBALL+0]),
#define S_RBALLX (S_RBALL+2)
S_BRIGHT (BAL2, 'C', 6, NULL , &States[S_RBALLX+1]),
S_BRIGHT (BAL2, 'D', 6, NULL , &States[S_RBALLX+2]),
S_BRIGHT (BAL2, 'E', 6, NULL , NULL)
};
IMPLEMENT_ACTOR (ACacodemonBall, Doom, -1, 126)
PROP_RadiusFixed (6)
PROP_HeightFixed (8)
PROP_SpeedFixed (10)
PROP_Damage (5)
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_SpawnState (S_RBALL)
PROP_DeathState (S_RBALLX)
PROP_SeeSound ("caco/attack")
PROP_DeathSound ("caco/shotx")
END_DEFAULTS
AT_SPEED_SET (CacodemonBall, speed)
{
SimpleSpeedSetter (ACacodemonBall, 10*FRACUNIT, 20*FRACUNIT, speed);
}
void A_HeadAttack (AActor *self)
{
if (!self->target)
@ -126,11 +19,11 @@ void A_HeadAttack (AActor *self)
{
int damage = (pr_headattack()%6+1)*10;
S_SoundID (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
P_DamageMobj (self->target, self, self, damage, NAME_Melee);
P_TraceBleed (damage, self->target, self);
return;
}
// launch a missile
P_SpawnMissile (self, self->target, RUNTIME_CLASS(ACacodemonBall));
P_SpawnMissile (self, self->target, PClass::FindClass("CacodemonBall"));
}