mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-27 22:42:29 +00:00
- changed spectral missiles to use FriendPlayer instead of health to distinguish between player spawned and monster spawned versions. Also moved most of this into the basic missile spawning functions instead of littering all spectral missile spawning functions with these initializations.
SVN r3651 (trunk)
This commit is contained in:
parent
ddf1af455b
commit
0f8e2441a1
9 changed files with 68 additions and 31 deletions
|
@ -196,11 +196,6 @@ bool AArtiPoisonBagShooter::Use (bool pickup)
|
|||
{
|
||||
mo->tracer = Owner->target;
|
||||
}
|
||||
// set the health value so that the missile works properly
|
||||
if (mo->flags4 & MF4_SPECTRAL)
|
||||
{
|
||||
mo->health = -2;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Spectre3Attack)
|
|||
|
||||
foo->velz = -12*FRACUNIT;
|
||||
foo->target = self;
|
||||
foo->health = -2;
|
||||
foo->FriendPlayer = 0;
|
||||
foo->tracer = self->target;
|
||||
|
||||
self->angle -= ANGLE_180 / 20 * 10;
|
||||
|
|
|
@ -29,7 +29,6 @@ void A_SpectralMissile (AActor *self, const char *missilename)
|
|||
if (missile != NULL)
|
||||
{
|
||||
missile->tracer = self->target;
|
||||
missile->health = -2;
|
||||
P_CheckMissileSpawn(missile);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpotLightning)
|
|||
{
|
||||
spot->threshold = 25;
|
||||
spot->target = self;
|
||||
spot->health = -2;
|
||||
spot->FriendPlayer = 0;
|
||||
spot->tracer = self->target;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightningTail)
|
|||
AActor *foo = Spawn("SpectralLightningHTail", self->x - self->velx, self->y - self->vely, self->z, ALLOW_REPLACE);
|
||||
|
||||
foo->angle = self->angle;
|
||||
foo->health = self->health;
|
||||
foo->FriendPlayer = self->FriendPlayer;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_SpectralBigBallLightning)
|
||||
|
@ -69,13 +69,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning)
|
|||
|
||||
flash->target = self->target;
|
||||
flash->velz = -18*FRACUNIT;
|
||||
flash->health = self->health;
|
||||
flash->FriendPlayer = self->FriendPlayer;
|
||||
|
||||
flash = Spawn(NAME_SpectralLightningV2, self->x, self->y, ONCEILINGZ, ALLOW_REPLACE);
|
||||
|
||||
flash->target = self->target;
|
||||
flash->velz = -18*FRACUNIT;
|
||||
flash->health = self->health;
|
||||
flash->FriendPlayer = self->FriendPlayer;
|
||||
}
|
||||
|
||||
// In Strife, this number is stored in the data segment, but it doesn't seem to be
|
||||
|
|
|
@ -530,15 +530,15 @@ AActor *P_SpawnSubMissile (AActor *source, const PClass *type, AActor *target)
|
|||
{
|
||||
if (source->flags & MF_MISSILE && source->flags4 & MF4_SPECTRAL)
|
||||
{
|
||||
other->health = source->health;
|
||||
other->FriendPlayer = source->FriendPlayer;
|
||||
}
|
||||
else if (target->player != NULL)
|
||||
{
|
||||
other->health = -1;
|
||||
other->FriendPlayer = int(target->player - players) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
other->health = -2;
|
||||
other->FriendPlayer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -925,7 +925,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil1)
|
|||
}
|
||||
if (spot != NULL)
|
||||
{
|
||||
spot->health = -1;
|
||||
spot->FriendPlayer = int(player-players)+1;
|
||||
spot->target = self;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -981,12 +981,12 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
{
|
||||
if (player != NULL)
|
||||
{
|
||||
if (!deathmatch && inflictor->health == -1)
|
||||
if (!deathmatch && inflictor->FriendPlayer > 0)
|
||||
return;
|
||||
}
|
||||
else if (target->flags4 & MF4_SPECTRAL)
|
||||
{
|
||||
if (inflictor->health == -2 && !target->IsHostile(inflictor))
|
||||
if (inflictor->FriendPlayer == 0 && !target->IsHostile(inflictor))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5295,6 +5295,18 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
|||
|
||||
th->angle = R_PointToAngle2 (0, 0, th->velx, th->vely);
|
||||
|
||||
if (th->flags4 & MF4_SPECTRAL)
|
||||
{
|
||||
if (owner->player != NULL)
|
||||
{
|
||||
th->FriendPlayer = int(owner->player - players) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
th->FriendPlayer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return (!checkspawn || P_CheckMissileSpawn (th)) ? th : NULL;
|
||||
}
|
||||
|
||||
|
@ -5319,6 +5331,19 @@ AActor * P_OldSpawnMissile(AActor * source, AActor * owner, AActor * dest, const
|
|||
dist = 1;
|
||||
|
||||
th->velz = (dest->z - source->z) / dist;
|
||||
|
||||
if (th->flags4 & MF4_SPECTRAL)
|
||||
{
|
||||
if (owner->player != NULL)
|
||||
{
|
||||
th->FriendPlayer = int(owner->player - players) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
th->FriendPlayer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
P_CheckMissileSpawn(th);
|
||||
return th;
|
||||
}
|
||||
|
@ -5401,6 +5426,19 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
|
|||
mo->velx = FixedMul (speed, finecosine[angle]);
|
||||
mo->vely = FixedMul (speed, finesine[angle]);
|
||||
mo->velz = velz;
|
||||
|
||||
if (mo->flags4 & MF4_SPECTRAL)
|
||||
{
|
||||
if (owner->player != NULL)
|
||||
{
|
||||
mo->FriendPlayer = int(owner->player - players) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
mo->FriendPlayer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return (!checkspawn || P_CheckMissileSpawn(mo)) ? mo : NULL;
|
||||
}
|
||||
|
||||
|
@ -5512,8 +5550,16 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z,
|
|||
MissileActor->velz = (fixed_t)vec.Z;
|
||||
|
||||
if (MissileActor->flags4 & MF4_SPECTRAL)
|
||||
MissileActor->health = -1;
|
||||
|
||||
{
|
||||
if (source->player != NULL)
|
||||
{
|
||||
MissileActor->FriendPlayer = int(source->player - players) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
MissileActor->FriendPlayer = 0;
|
||||
}
|
||||
}
|
||||
if (P_CheckMissileSpawn (MissileActor))
|
||||
{
|
||||
return MissileActor;
|
||||
|
|
|
@ -333,11 +333,6 @@ static void DoAttack (AActor *self, bool domelee, bool domissile,
|
|||
{
|
||||
missile->tracer=self->target;
|
||||
}
|
||||
// set the health value so that the missile works properly
|
||||
if (missile->flags4&MF4_SPECTRAL)
|
||||
{
|
||||
missile->health=-2;
|
||||
}
|
||||
P_CheckMissileSpawn(missile);
|
||||
}
|
||||
}
|
||||
|
@ -967,10 +962,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile)
|
|||
// automatic handling of seeker missiles
|
||||
missile->tracer=self->target;
|
||||
}
|
||||
// set the health value so that the missile works properly
|
||||
// we must redo the spectral check here because the owner is set after spawning so the FriendPlayer value may be wrong
|
||||
if (missile->flags4&MF4_SPECTRAL)
|
||||
{
|
||||
missile->health=-2;
|
||||
if (missile->target != NULL && missile->target->player != NULL)
|
||||
{
|
||||
missile->FriendPlayer = int(missile->target->player - players) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
missile->FriendPlayer = 0;
|
||||
}
|
||||
}
|
||||
P_CheckMissileSpawn(missile);
|
||||
}
|
||||
|
@ -1121,11 +1123,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomComboAttack)
|
|||
{
|
||||
missile->tracer=self->target;
|
||||
}
|
||||
// set the health value so that the missile works properly
|
||||
if (missile->flags4&MF4_SPECTRAL)
|
||||
{
|
||||
missile->health=-2;
|
||||
}
|
||||
P_CheckMissileSpawn(missile);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue