- Added MF5_PIERCEARMOR flag that allows damaging objects that aren't

affected by armor.
- Added an unfreeze CCMD so that frozen players can be unfrozen for testing.
- Added special death states for projectiles hitting actors.
- Added ACS SetActorPitch/GetActorPitch functions.
- Added cameraheight property for actors.


SVN r359 (trunk)
This commit is contained in:
Christoph Oelckers 2006-10-22 10:32:41 +00:00
parent fb5f4a132b
commit 0d5e3cf97e
17 changed files with 128 additions and 28 deletions

View file

@ -1,3 +1,11 @@
October 22, 2006 (Changes by Graf Zahl)
- Added MF5_PIERCEARMOR flag that allows damaging objects that aren't
affected by armor.
- Added an unfreeze CCMD so that frozen players can be unfrozen for testing.
- Added special death states for projectiles hitting actors.
- Added ACS SetActorPitch/GetActorPitch functions.
- Added cameraheight property for actors.
October 21, 2006 (Changes by Graf Zahl) October 21, 2006 (Changes by Graf Zahl)
- Fixed: The yellow color range contained gaps in its definition which - Fixed: The yellow color range contained gaps in its definition which
resulted in incorrect colors. resulted in incorrect colors.

View file

@ -284,6 +284,7 @@ enum
MF5_BLOODSPLATTER = 0x00000100, // Blood splatter like in Raven's games. MF5_BLOODSPLATTER = 0x00000100, // Blood splatter like in Raven's games.
MF5_OLDRADIUSDMG = 0x00000200, // Use old radius damage code (for barrels and boss brain) MF5_OLDRADIUSDMG = 0x00000200, // Use old radius damage code (for barrels and boss brain)
MF5_DEHEXPLOSION = 0x00000400, // Use the DEHACKED explosion options when this projectile explodes MF5_DEHEXPLOSION = 0x00000400, // Use the DEHACKED explosion options when this projectile explodes
MF5_PIERCEARMOR = 0x00000800, // Armor doesn't protect against damage from this actor
// --- mobj.renderflags --- // --- mobj.renderflags ---
@ -415,6 +416,7 @@ enum
AMETA_PoisonDamage, // Amount of poison damage AMETA_PoisonDamage, // Amount of poison damage
AMETA_FastSpeed, // Speed in fast mode AMETA_FastSpeed, // Speed in fast mode
AMETA_RDFactor, // Radius damage factor AMETA_RDFactor, // Radius damage factor
AMETA_CameraHeight, // Height of camera when used as such
}; };
// Map Object definition. // Map Object definition.

View file

@ -811,3 +811,13 @@ CCMD(changesky)
} }
R_InitSkyMap (); R_InitSkyMap ();
} }
//-----------------------------------------------------------------------------
//
//
//
//-----------------------------------------------------------------------------
CCMD(unfreeze)
{
if (who != NULL) who->player->cheats &= ~(CF_FROZEN|CF_TOTALLYFROZEN);
}

View file

@ -2064,7 +2064,7 @@ void ABlasterFX1::Tick ()
{ {
if (!P_TryMove (this, x + xfrac, y + yfrac, true)) if (!P_TryMove (this, x + xfrac, y + yfrac, true))
{ // Blocked move { // Blocked move
P_ExplodeMissile (this, BlockingLine); P_ExplodeMissile (this, BlockingLine, BlockingMobj);
return; return;
} }
} }
@ -2073,13 +2073,13 @@ void ABlasterFX1::Tick ()
{ // Hit the floor { // Hit the floor
z = floorz; z = floorz;
P_HitFloor (this); P_HitFloor (this);
P_ExplodeMissile (this, NULL); P_ExplodeMissile (this, NULL, NULL);
return; return;
} }
if (z + height > ceilingz) if (z + height > ceilingz)
{ // Hit the ceiling { // Hit the ceiling
z = ceilingz - height; z = ceilingz - height;
P_ExplodeMissile (this, NULL); P_ExplodeMissile (this, NULL, NULL);
return; return;
} }
if (changexy && (pr_bfx1t() < 64)) if (changexy && (pr_bfx1t() < 64))

View file

@ -320,7 +320,7 @@ void ACFlameMissile::Tick ()
{ {
if (!P_TryMove (this, x+xfrac, y+yfrac, true)) if (!P_TryMove (this, x+xfrac, y+yfrac, true))
{ // Blocked move { // Blocked move
P_ExplodeMissile (this, BlockingLine); P_ExplodeMissile (this, BlockingLine, BlockingMobj);
return; return;
} }
} }
@ -329,13 +329,13 @@ void ACFlameMissile::Tick ()
{ // Hit the floor { // Hit the floor
z = floorz; z = floorz;
P_HitFloor (this); P_HitFloor (this);
P_ExplodeMissile (this, NULL); P_ExplodeMissile (this, NULL, NULL);
return; return;
} }
if (z+height > ceilingz) if (z+height > ceilingz)
{ // Hit the ceiling { // Hit the ceiling
z = ceilingz-height; z = ceilingz-height;
P_ExplodeMissile (this, NULL); P_ExplodeMissile (this, NULL, NULL);
return; return;
} }
if (changexy) if (changexy)

View file

@ -409,7 +409,7 @@ void A_LightningClip (AActor *actor)
{ {
if(target->health <= 0) if(target->health <= 0)
{ {
P_ExplodeMissile(actor, NULL); P_ExplodeMissile(actor, NULL, NULL);
} }
else else
{ {
@ -534,7 +534,7 @@ void A_ZapMimic (AActor *actor)
{ {
if (mo->state >= mo->DeathState) if (mo->state >= mo->DeathState)
{ {
P_ExplodeMissile (actor, NULL); P_ExplodeMissile (actor, NULL, NULL);
} }
else else
{ {
@ -577,6 +577,6 @@ void A_LightningRemove (AActor *actor)
if (mo) if (mo)
{ {
mo->lastenemy = NULL; mo->lastenemy = NULL;
P_ExplodeMissile (mo, NULL); P_ExplodeMissile (mo, NULL, NULL);
} }
} }

View file

@ -141,7 +141,7 @@ void AMageWandMissile::Tick ()
LastRipped = NULL; // [RH] Do rip damage each step, like Hexen LastRipped = NULL; // [RH] Do rip damage each step, like Hexen
if (!P_TryMove (this, x+xfrac,y+yfrac, true)) if (!P_TryMove (this, x+xfrac,y+yfrac, true))
{ // Blocked move { // Blocked move
P_ExplodeMissile (this, BlockingLine); P_ExplodeMissile (this, BlockingLine, BlockingMobj);
DoRipping = false; DoRipping = false;
return; return;
} }
@ -151,14 +151,14 @@ void AMageWandMissile::Tick ()
{ // Hit the floor { // Hit the floor
z = floorz; z = floorz;
P_HitFloor (this); P_HitFloor (this);
P_ExplodeMissile (this, NULL); P_ExplodeMissile (this, NULL, NULL);
DoRipping = false; DoRipping = false;
return; return;
} }
if (z+height > ceilingz) if (z+height > ceilingz)
{ // Hit the ceiling { // Hit the ceiling
z = ceilingz-height; z = ceilingz-height;
P_ExplodeMissile (this, NULL); P_ExplodeMissile (this, NULL, NULL);
DoRipping = false; DoRipping = false;
return; return;
} }

View file

@ -799,7 +799,7 @@ void A_Countdown (AActor *self)
{ {
if (--self->reactiontime <= 0) if (--self->reactiontime <= 0)
{ {
P_ExplodeMissile (self, NULL); P_ExplodeMissile (self, NULL, NULL);
self->flags &= ~MF_SKULLFLY; self->flags &= ~MF_SKULLFLY;
} }
} }

View file

@ -4420,6 +4420,21 @@ int DLevelScript::RunScript ()
} }
break; break;
case PCD_GETACTORPITCH:
{
AActor *actor = SingleActorFromTID (STACK(1), activator);
if (actor == NULL)
{
STACK(1) = 0;
}
else
{
STACK(1) = actor->pitch >> 16;
}
}
break;
case PCD_GETLINEROWOFFSET: case PCD_GETLINEROWOFFSET:
if (activationline) if (activationline)
{ {
@ -4900,6 +4915,19 @@ int DLevelScript::RunScript ()
sp -= 2; sp -= 2;
break; break;
case PCD_SETACTORPITCH:
{
FActorIterator iterator (STACK(2));
AActor *actor;
while ( (actor = iterator.Next ()) )
{
actor->pitch = STACK(1) << 16;
}
}
sp -= 2;
break;
case PCD_PLAYERCLASS: // [GRB] case PCD_PLAYERCLASS: // [GRB]
if (STACK(1) < 0 || STACK(1) >= MAXPLAYERS || !playeringame[STACK(1)]) if (STACK(1) < 0 || STACK(1) >= MAXPLAYERS || !playeringame[STACK(1)])
{ {

View file

@ -536,6 +536,8 @@ public:
PCD_SECTORDAMAGE, PCD_SECTORDAMAGE,
PCD_REPLACETEXTURES, PCD_REPLACETEXTURES,
/*330*/ PCD_NEGATEBINARY, /*330*/ PCD_NEGATEBINARY,
PCD_GETACTORPITCH,
PCD_SETACTORPITCH,
PCODE_COMMAND_COUNT PCODE_COMMAND_COUNT
}; };

View file

@ -348,7 +348,7 @@ void AActor::Die (AActor *source, AActor *inflictor)
if (flags & MF_MISSILE) if (flags & MF_MISSILE)
{ // [RH] When missiles die, they just explode { // [RH] When missiles die, they just explode
P_ExplodeMissile (this, NULL); P_ExplodeMissile (this, NULL, NULL);
return; return;
} }
// [RH] Set the target to the thing that killed it. Strife apparently does this. // [RH] Set the target to the thing that killed it. Strife apparently does this.
@ -852,6 +852,11 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
} }
} }
if (inflictor != NULL)
{
if (inflictor->flags5 & MF5_PIERCEARMOR) flags |= DMG_NO_ARMOR;
}
MeansOfDeath = mod; MeansOfDeath = mod;
// [RH] Andy Baker's Stealth monsters // [RH] Andy Baker's Stealth monsters
if (target->flags & MF_STEALTH) if (target->flags & MF_STEALTH)

View file

@ -102,7 +102,7 @@ void P_BloodSplatter (fixed_t x, fixed_t y, fixed_t z, AActor *originator);
void P_BloodSplatter2 (fixed_t x, fixed_t y, fixed_t z, AActor *originator); void P_BloodSplatter2 (fixed_t x, fixed_t y, fixed_t z, AActor *originator);
void P_RipperBlood (AActor *mo, AActor *bleeder); void P_RipperBlood (AActor *mo, AActor *bleeder);
int P_GetThingFloorType (AActor *thing); int P_GetThingFloorType (AActor *thing);
void P_ExplodeMissile (AActor *missile, line_t *explodeline); void P_ExplodeMissile (AActor *missile, line_t *explodeline, AActor *target);
AActor *P_SpawnMissile (AActor* source, AActor* dest, const PClass *type); AActor *P_SpawnMissile (AActor* source, AActor* dest, const PClass *type);
AActor *P_SpawnMissileZ (AActor* source, fixed_t z, AActor* dest, const PClass *type); AActor *P_SpawnMissileZ (AActor* source, fixed_t z, AActor* dest, const PClass *type);

View file

@ -2807,7 +2807,18 @@ void P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
trace.Actor, srcangle, srcpitch); trace.Actor, srcangle, srcpitch);
} }
} }
if (damage) P_DamageMobj (trace.Actor, puff ? puff : t1, t1, damage, damageType); if (damage)
{
int flags = 0;
// Allow MF5_PIERCEARMOR on a weapon as well.
if (t1->player != NULL && t1->player->ReadyWeapon != NULL &&
t1->player->ReadyWeapon->flags5 & MF5_PIERCEARMOR)
{
flags |= DMG_NO_ARMOR;
}
P_DamageMobj (trace.Actor, puff ? puff : t1, t1, damage, damageType, flags);
}
} }
if (trace.CrossedWater) if (trace.CrossedWater)
{ {

View file

@ -1007,7 +1007,7 @@ bool AActor::Massacre ()
// //
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void P_ExplodeMissile (AActor *mo, line_t *line) void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
{ {
if (mo->flags3 & MF3_EXPLOCOUNT) if (mo->flags3 & MF3_EXPLOCOUNT)
{ {
@ -1018,7 +1018,17 @@ void P_ExplodeMissile (AActor *mo, line_t *line)
} }
mo->momx = mo->momy = mo->momz = 0; mo->momx = mo->momy = mo->momz = 0;
mo->effects = 0; // [RH] mo->effects = 0; // [RH]
mo->SetState (mo->DeathState);
FState *nextstate=NULL;
if (target != NULL && target->flags & MF_SHOOTABLE)
{
if (target->flags & MF_NOBLOOD) nextstate = mo->CrashState;
if (nextstate == NULL) nextstate = mo->XDeathState;
}
if (nextstate == NULL) nextstate = mo->DeathState;
mo->SetState (nextstate);
if (mo->ObjectFlags & OF_MassDestruction) if (mo->ObjectFlags & OF_MassDestruction)
{ {
return; return;
@ -1131,7 +1141,7 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
// Landed in some sort of liquid // Landed in some sort of liquid
if (flags5 & MF5_EXPLODEONWATER) if (flags5 & MF5_EXPLODEONWATER)
{ {
P_ExplodeMissile(this, NULL); P_ExplodeMissile(this, NULL, NULL);
return true; return true;
} }
if (!(flags3 & MF3_CANBOUNCEWATER)) if (!(flags3 & MF3_CANBOUNCEWATER))
@ -1144,7 +1154,7 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
// The amount of bounces is limited // The amount of bounces is limited
if (bouncecount>0 && --bouncecount==0) if (bouncecount>0 && --bouncecount==0)
{ {
P_ExplodeMissile(this, NULL); P_ExplodeMissile(this, NULL, NULL);
return true; return true;
} }
@ -1589,7 +1599,7 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
} }
else else
{ // Struck a player/creature { // Struck a player/creature
P_ExplodeMissile (mo, NULL); P_ExplodeMissile (mo, NULL, BlockingMobj);
DoRipping = false; DoRipping = false;
return; return;
} }
@ -1656,7 +1666,7 @@ explode:
DoRipping = false; DoRipping = false;
return; return;
} }
P_ExplodeMissile (mo, BlockingLine); P_ExplodeMissile (mo, BlockingLine, BlockingMobj);
DoRipping = false; DoRipping = false;
return; return;
} }
@ -1926,7 +1936,7 @@ void P_ZMovement (AActor *mo)
return; return;
} }
P_HitFloor (mo); P_HitFloor (mo);
P_ExplodeMissile (mo, NULL); P_ExplodeMissile (mo, NULL, NULL);
return; return;
} }
} }
@ -2026,7 +2036,7 @@ void P_ZMovement (AActor *mo)
mo->Destroy (); mo->Destroy ();
return; return;
} }
P_ExplodeMissile (mo, NULL); P_ExplodeMissile (mo, NULL, NULL);
return; return;
} }
} }
@ -4230,7 +4240,7 @@ bool P_CheckMissileSpawn (AActor* th)
} }
else else
{ {
P_ExplodeMissile (th, NULL); P_ExplodeMissile (th, NULL, NULL);
} }
return false; return false;
} }

View file

@ -1032,7 +1032,7 @@ void R_SetupFrame (AActor *actor)
{ {
iview->nviewx = camera->x; iview->nviewx = camera->x;
iview->nviewy = camera->y; iview->nviewy = camera->y;
iview->nviewz = camera->player ? camera->player->viewz : camera->z; iview->nviewz = camera->player ? camera->player->viewz : camera->z + camera->GetClass()->Meta.GetMetaFixed(AMETA_CameraHeight);
viewsector = camera->Sector; viewsector = camera->Sector;
r_showviewer = false; r_showviewer = false;
} }

View file

@ -220,6 +220,7 @@ static flagdef ActorFlags[]=
DEFINE_FLAG(MF5, BLOODSPLATTER, AActor, flags5), DEFINE_FLAG(MF5, BLOODSPLATTER, AActor, flags5),
DEFINE_FLAG(MF5, OLDRADIUSDMG, AActor, flags5), DEFINE_FLAG(MF5, OLDRADIUSDMG, AActor, flags5),
DEFINE_FLAG(MF5, DEHEXPLOSION, AActor, flags5), DEFINE_FLAG(MF5, DEHEXPLOSION, AActor, flags5),
DEFINE_FLAG(MF5, PIERCEARMOR, AActor, flags5),
// Effect flags // Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
@ -508,6 +509,7 @@ ACTOR(SkullPop)
ACTOR(CheckFloor) ACTOR(CheckFloor)
ACTOR(CheckSkullDone) ACTOR(CheckSkullDone)
ACTOR(RadiusThrust) ACTOR(RadiusThrust)
ACTOR(Stop)
#include "d_dehackedactions.h" #include "d_dehackedactions.h"
@ -717,6 +719,7 @@ AFuncDesc AFTable[]=
FUNC(A_Burst, "M") FUNC(A_Burst, "M")
FUNC(A_RadiusThrust, "xxy") FUNC(A_RadiusThrust, "xxy")
{"A_Explode", A_ExplodeParms, "xxy" }, {"A_Explode", A_ExplodeParms, "xxy" },
FUNC(A_Stop, NULL)
}; };
//========================================================================== //==========================================================================
@ -3016,12 +3019,21 @@ static void ActorRadiusDamageFactor (AActor *defaults, Baggage &bag)
bag.Info->Class->Meta.SetMetaFixed (AMETA_RDFactor, fixed_t(sc_Float*FRACUNIT)); bag.Info->Class->Meta.SetMetaFixed (AMETA_RDFactor, fixed_t(sc_Float*FRACUNIT));
} }
//==========================================================================
//
//==========================================================================
static void ActorCameraheight (AActor *defaults, Baggage &bag)
{
SC_MustGetFloat();
bag.Info->Class->Meta.SetMetaFixed (AMETA_CameraHeight, fixed_t(sc_Float*FRACUNIT));
}
//========================================================================== //==========================================================================
// //
//========================================================================== //==========================================================================
static void ActorClearFlags (AActor *defaults, Baggage &bag) static void ActorClearFlags (AActor *defaults, Baggage &bag)
{ {
defaults->flags=defaults->flags2=defaults->flags3=defaults->flags4=0; defaults->flags=defaults->flags2=defaults->flags3=defaults->flags4=defaults->flags5=0;
} }
//========================================================================== //==========================================================================
@ -3781,6 +3793,7 @@ static const ActorProps props[] =
{ "bouncefactor", ActorBounceFactor, RUNTIME_CLASS(AActor) }, { "bouncefactor", ActorBounceFactor, RUNTIME_CLASS(AActor) },
{ "burn", ActorBurnState, RUNTIME_CLASS(AActor) }, { "burn", ActorBurnState, RUNTIME_CLASS(AActor) },
{ "burnheight", ActorBurnHeight, RUNTIME_CLASS(AActor) }, { "burnheight", ActorBurnHeight, RUNTIME_CLASS(AActor) },
{ "cameraheight", ActorCameraheight, RUNTIME_CLASS(AActor) },
{ "clearflags", ActorClearFlags, RUNTIME_CLASS(AActor) }, { "clearflags", ActorClearFlags, RUNTIME_CLASS(AActor) },
{ "conversationid", ActorConversationID, RUNTIME_CLASS(AActor) }, { "conversationid", ActorConversationID, RUNTIME_CLASS(AActor) },
{ "crash", ActorCrashState, RUNTIME_CLASS(AActor) }, { "crash", ActorCrashState, RUNTIME_CLASS(AActor) },

View file

@ -1677,7 +1677,7 @@ void A_CountdownArg(AActor * self)
{ {
if (self->flags&MF_MISSILE) if (self->flags&MF_MISSILE)
{ {
P_ExplodeMissile(self, NULL); P_ExplodeMissile(self, NULL, NULL);
} }
else if (self->flags&MF_SHOOTABLE) else if (self->flags&MF_SHOOTABLE)
{ {
@ -1761,3 +1761,14 @@ void A_CheckFloor (AActor *self)
if (pStateCall != NULL) pStateCall->Result=false; // Jumps should never set the result for inventory state chains! if (pStateCall != NULL) pStateCall->Result=false; // Jumps should never set the result for inventory state chains!
} }
//===========================================================================
//
// A_Stop
// resets all momentum of the actor to 0
//
//===========================================================================
void A_Stop (AActor *self)
{
self->momx = self->momy = self->momz = 0;
}