mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-24 21:21:04 +00:00
- 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:
parent
fb5f4a132b
commit
0d5e3cf97e
17 changed files with 128 additions and 28 deletions
|
@ -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)
|
||||
- Fixed: The yellow color range contained gaps in its definition which
|
||||
resulted in incorrect colors.
|
||||
|
|
|
@ -284,6 +284,7 @@ enum
|
|||
MF5_BLOODSPLATTER = 0x00000100, // Blood splatter like in Raven's games.
|
||||
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_PIERCEARMOR = 0x00000800, // Armor doesn't protect against damage from this actor
|
||||
|
||||
// --- mobj.renderflags ---
|
||||
|
||||
|
@ -415,6 +416,7 @@ enum
|
|||
AMETA_PoisonDamage, // Amount of poison damage
|
||||
AMETA_FastSpeed, // Speed in fast mode
|
||||
AMETA_RDFactor, // Radius damage factor
|
||||
AMETA_CameraHeight, // Height of camera when used as such
|
||||
};
|
||||
|
||||
// Map Object definition.
|
||||
|
|
|
@ -811,3 +811,13 @@ CCMD(changesky)
|
|||
}
|
||||
R_InitSkyMap ();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
//
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
CCMD(unfreeze)
|
||||
{
|
||||
if (who != NULL) who->player->cheats &= ~(CF_FROZEN|CF_TOTALLYFROZEN);
|
||||
}
|
||||
|
|
|
@ -2064,7 +2064,7 @@ void ABlasterFX1::Tick ()
|
|||
{
|
||||
if (!P_TryMove (this, x + xfrac, y + yfrac, true))
|
||||
{ // Blocked move
|
||||
P_ExplodeMissile (this, BlockingLine);
|
||||
P_ExplodeMissile (this, BlockingLine, BlockingMobj);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2073,13 +2073,13 @@ void ABlasterFX1::Tick ()
|
|||
{ // Hit the floor
|
||||
z = floorz;
|
||||
P_HitFloor (this);
|
||||
P_ExplodeMissile (this, NULL);
|
||||
P_ExplodeMissile (this, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
if (z + height > ceilingz)
|
||||
{ // Hit the ceiling
|
||||
z = ceilingz - height;
|
||||
P_ExplodeMissile (this, NULL);
|
||||
P_ExplodeMissile (this, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
if (changexy && (pr_bfx1t() < 64))
|
||||
|
|
|
@ -320,7 +320,7 @@ void ACFlameMissile::Tick ()
|
|||
{
|
||||
if (!P_TryMove (this, x+xfrac, y+yfrac, true))
|
||||
{ // Blocked move
|
||||
P_ExplodeMissile (this, BlockingLine);
|
||||
P_ExplodeMissile (this, BlockingLine, BlockingMobj);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -329,13 +329,13 @@ void ACFlameMissile::Tick ()
|
|||
{ // Hit the floor
|
||||
z = floorz;
|
||||
P_HitFloor (this);
|
||||
P_ExplodeMissile (this, NULL);
|
||||
P_ExplodeMissile (this, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
if (z+height > ceilingz)
|
||||
{ // Hit the ceiling
|
||||
z = ceilingz-height;
|
||||
P_ExplodeMissile (this, NULL);
|
||||
P_ExplodeMissile (this, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
if (changexy)
|
||||
|
|
|
@ -409,7 +409,7 @@ void A_LightningClip (AActor *actor)
|
|||
{
|
||||
if(target->health <= 0)
|
||||
{
|
||||
P_ExplodeMissile(actor, NULL);
|
||||
P_ExplodeMissile(actor, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -534,7 +534,7 @@ void A_ZapMimic (AActor *actor)
|
|||
{
|
||||
if (mo->state >= mo->DeathState)
|
||||
{
|
||||
P_ExplodeMissile (actor, NULL);
|
||||
P_ExplodeMissile (actor, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -577,6 +577,6 @@ void A_LightningRemove (AActor *actor)
|
|||
if (mo)
|
||||
{
|
||||
mo->lastenemy = NULL;
|
||||
P_ExplodeMissile (mo, NULL);
|
||||
P_ExplodeMissile (mo, NULL, NULL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ void AMageWandMissile::Tick ()
|
|||
LastRipped = NULL; // [RH] Do rip damage each step, like Hexen
|
||||
if (!P_TryMove (this, x+xfrac,y+yfrac, true))
|
||||
{ // Blocked move
|
||||
P_ExplodeMissile (this, BlockingLine);
|
||||
P_ExplodeMissile (this, BlockingLine, BlockingMobj);
|
||||
DoRipping = false;
|
||||
return;
|
||||
}
|
||||
|
@ -151,14 +151,14 @@ void AMageWandMissile::Tick ()
|
|||
{ // Hit the floor
|
||||
z = floorz;
|
||||
P_HitFloor (this);
|
||||
P_ExplodeMissile (this, NULL);
|
||||
P_ExplodeMissile (this, NULL, NULL);
|
||||
DoRipping = false;
|
||||
return;
|
||||
}
|
||||
if (z+height > ceilingz)
|
||||
{ // Hit the ceiling
|
||||
z = ceilingz-height;
|
||||
P_ExplodeMissile (this, NULL);
|
||||
P_ExplodeMissile (this, NULL, NULL);
|
||||
DoRipping = false;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -799,7 +799,7 @@ void A_Countdown (AActor *self)
|
|||
{
|
||||
if (--self->reactiontime <= 0)
|
||||
{
|
||||
P_ExplodeMissile (self, NULL);
|
||||
P_ExplodeMissile (self, NULL, NULL);
|
||||
self->flags &= ~MF_SKULLFLY;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4420,6 +4420,21 @@ int DLevelScript::RunScript ()
|
|||
}
|
||||
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:
|
||||
if (activationline)
|
||||
{
|
||||
|
@ -4900,6 +4915,19 @@ int DLevelScript::RunScript ()
|
|||
sp -= 2;
|
||||
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]
|
||||
if (STACK(1) < 0 || STACK(1) >= MAXPLAYERS || !playeringame[STACK(1)])
|
||||
{
|
||||
|
|
|
@ -536,6 +536,8 @@ public:
|
|||
PCD_SECTORDAMAGE,
|
||||
PCD_REPLACETEXTURES,
|
||||
/*330*/ PCD_NEGATEBINARY,
|
||||
PCD_GETACTORPITCH,
|
||||
PCD_SETACTORPITCH,
|
||||
|
||||
PCODE_COMMAND_COUNT
|
||||
};
|
||||
|
|
|
@ -348,7 +348,7 @@ void AActor::Die (AActor *source, AActor *inflictor)
|
|||
|
||||
if (flags & MF_MISSILE)
|
||||
{ // [RH] When missiles die, they just explode
|
||||
P_ExplodeMissile (this, NULL);
|
||||
P_ExplodeMissile (this, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
// [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;
|
||||
// [RH] Andy Baker's Stealth monsters
|
||||
if (target->flags & MF_STEALTH)
|
||||
|
|
|
@ -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_RipperBlood (AActor *mo, AActor *bleeder);
|
||||
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_SpawnMissileZ (AActor* source, fixed_t z, AActor* dest, const PClass *type);
|
||||
|
|
|
@ -2807,7 +2807,18 @@ void P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
@ -1018,7 +1018,17 @@ void P_ExplodeMissile (AActor *mo, line_t *line)
|
|||
}
|
||||
mo->momx = mo->momy = mo->momz = 0;
|
||||
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)
|
||||
{
|
||||
return;
|
||||
|
@ -1131,7 +1141,7 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
|||
// Landed in some sort of liquid
|
||||
if (flags5 & MF5_EXPLODEONWATER)
|
||||
{
|
||||
P_ExplodeMissile(this, NULL);
|
||||
P_ExplodeMissile(this, NULL, NULL);
|
||||
return true;
|
||||
}
|
||||
if (!(flags3 & MF3_CANBOUNCEWATER))
|
||||
|
@ -1144,7 +1154,7 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
|||
// The amount of bounces is limited
|
||||
if (bouncecount>0 && --bouncecount==0)
|
||||
{
|
||||
P_ExplodeMissile(this, NULL);
|
||||
P_ExplodeMissile(this, NULL, NULL);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1589,7 +1599,7 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
}
|
||||
else
|
||||
{ // Struck a player/creature
|
||||
P_ExplodeMissile (mo, NULL);
|
||||
P_ExplodeMissile (mo, NULL, BlockingMobj);
|
||||
DoRipping = false;
|
||||
return;
|
||||
}
|
||||
|
@ -1656,7 +1666,7 @@ explode:
|
|||
DoRipping = false;
|
||||
return;
|
||||
}
|
||||
P_ExplodeMissile (mo, BlockingLine);
|
||||
P_ExplodeMissile (mo, BlockingLine, BlockingMobj);
|
||||
DoRipping = false;
|
||||
return;
|
||||
}
|
||||
|
@ -1926,7 +1936,7 @@ void P_ZMovement (AActor *mo)
|
|||
return;
|
||||
}
|
||||
P_HitFloor (mo);
|
||||
P_ExplodeMissile (mo, NULL);
|
||||
P_ExplodeMissile (mo, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -2026,7 +2036,7 @@ void P_ZMovement (AActor *mo)
|
|||
mo->Destroy ();
|
||||
return;
|
||||
}
|
||||
P_ExplodeMissile (mo, NULL);
|
||||
P_ExplodeMissile (mo, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -4230,7 +4240,7 @@ bool P_CheckMissileSpawn (AActor* th)
|
|||
}
|
||||
else
|
||||
{
|
||||
P_ExplodeMissile (th, NULL);
|
||||
P_ExplodeMissile (th, NULL, NULL);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1032,7 +1032,7 @@ void R_SetupFrame (AActor *actor)
|
|||
{
|
||||
iview->nviewx = camera->x;
|
||||
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;
|
||||
r_showviewer = false;
|
||||
}
|
||||
|
|
|
@ -220,6 +220,7 @@ static flagdef ActorFlags[]=
|
|||
DEFINE_FLAG(MF5, BLOODSPLATTER, AActor, flags5),
|
||||
DEFINE_FLAG(MF5, OLDRADIUSDMG, AActor, flags5),
|
||||
DEFINE_FLAG(MF5, DEHEXPLOSION, AActor, flags5),
|
||||
DEFINE_FLAG(MF5, PIERCEARMOR, AActor, flags5),
|
||||
|
||||
// Effect flags
|
||||
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
||||
|
@ -508,6 +509,7 @@ ACTOR(SkullPop)
|
|||
ACTOR(CheckFloor)
|
||||
ACTOR(CheckSkullDone)
|
||||
ACTOR(RadiusThrust)
|
||||
ACTOR(Stop)
|
||||
|
||||
|
||||
#include "d_dehackedactions.h"
|
||||
|
@ -717,6 +719,7 @@ AFuncDesc AFTable[]=
|
|||
FUNC(A_Burst, "M")
|
||||
FUNC(A_RadiusThrust, "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));
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
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)
|
||||
{
|
||||
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) },
|
||||
{ "burn", ActorBurnState, RUNTIME_CLASS(AActor) },
|
||||
{ "burnheight", ActorBurnHeight, RUNTIME_CLASS(AActor) },
|
||||
{ "cameraheight", ActorCameraheight, RUNTIME_CLASS(AActor) },
|
||||
{ "clearflags", ActorClearFlags, RUNTIME_CLASS(AActor) },
|
||||
{ "conversationid", ActorConversationID, RUNTIME_CLASS(AActor) },
|
||||
{ "crash", ActorCrashState, RUNTIME_CLASS(AActor) },
|
||||
|
|
|
@ -1677,7 +1677,7 @@ void A_CountdownArg(AActor * self)
|
|||
{
|
||||
if (self->flags&MF_MISSILE)
|
||||
{
|
||||
P_ExplodeMissile(self, NULL);
|
||||
P_ExplodeMissile(self, NULL, NULL);
|
||||
}
|
||||
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!
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_Stop
|
||||
// resets all momentum of the actor to 0
|
||||
//
|
||||
//===========================================================================
|
||||
void A_Stop (AActor *self)
|
||||
{
|
||||
self->momx = self->momy = self->momz = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue