- Took MF2_WINDTHRUST off AMorphedMonster. This is something that should not
be a default setting. - Moved a_artiegg.cpp to g_shared and renamed it to a_morph.cpp to better reflect its meaning. - Fixed: AMorphProjectile's PlayerClass and MonsterClass members must be serialized as FNames. Serializing them as ints is not safe because name indices are not guaranteed to be the same each time the game is started. Same for APlayerPawn's MorphWeapon member. - Converted EggFX, ArtiEgg, PorkFX and ArtiPork to DECORATE. - Added a new parameter to A_FireCustomMissile. Previously it always aimed straight ahead and altered the projectile's angle according to the resulting direction. If the 6th parameter is 1 now it will aim at the specified angle directly. - Changed custom morphing to be based on a new MorphProjectile class, not the Heretic specific EggFX. The EggFX properties are now prefixed with 'MorphProjectile.'. SVN r297 (trunk)
This commit is contained in:
parent
a6d656b108
commit
f66b7de8c8
17 changed files with 753 additions and 792 deletions
|
|
@ -824,7 +824,7 @@ void A_FireBullets (AActor *self)
|
|||
//==========================================================================
|
||||
void A_FireCustomMissile (AActor * self)
|
||||
{
|
||||
int index=CheckIndex(5);
|
||||
int index=CheckIndex(6);
|
||||
if (index<0 || !self->player) return;
|
||||
|
||||
ENamedName MissileName=(ENamedName)StateParameters[index];
|
||||
|
|
@ -832,6 +832,7 @@ void A_FireCustomMissile (AActor * self)
|
|||
bool UseAmmo=EvalExpressionN (StateParameters[index+2], self);
|
||||
int SpawnOfs_XY=EvalExpressionI (StateParameters[index+3], self);
|
||||
fixed_t SpawnHeight=fixed_t(EvalExpressionF (StateParameters[index+4], self) * FRACUNIT);
|
||||
BOOL AimAtAngle=EvalExpressionI (StateParameters[index+5], self);
|
||||
|
||||
player_t *player=self->player;
|
||||
AWeapon * weapon=player->ReadyWeapon;
|
||||
|
|
@ -848,19 +849,26 @@ void A_FireCustomMissile (AActor * self)
|
|||
fixed_t x = SpawnOfs_XY * finecosine[ang];
|
||||
fixed_t y = SpawnOfs_XY * finesine[ang];
|
||||
fixed_t z = SpawnHeight;
|
||||
fixed_t shootangle = self->angle;
|
||||
|
||||
AActor * misl=P_SpawnPlayerMissile (self, self->x+x, self->y+y, self->z+z, ti, self->angle);
|
||||
if (AimAtAngle) shootangle+=Angle;
|
||||
|
||||
AActor * misl=P_SpawnPlayerMissile (self, self->x+x, self->y+y, self->z+z, ti, shootangle);
|
||||
// automatic handling of seeker missiles
|
||||
if (misl)
|
||||
{
|
||||
vec3_t velocity = { misl->momx, misl->momy, 0 };
|
||||
fixed_t missilespeed=(fixed_t)VectorLength(velocity);
|
||||
|
||||
if (linetarget && misl->flags2&MF2_SEEKERMISSILE) misl->tracer=linetarget;
|
||||
misl->angle += Angle;
|
||||
angle_t an = misl->angle >> ANGLETOFINESHIFT;
|
||||
misl->momx = FixedMul (missilespeed, finecosine[an]);
|
||||
misl->momy = FixedMul (missilespeed, finesine[an]);
|
||||
if (!AimAtAngle)
|
||||
{
|
||||
// This original implementation is to aim straight ahead and then offset
|
||||
// the angle from the resulting direction.
|
||||
vec3_t velocity = { misl->momx, misl->momy, 0 };
|
||||
fixed_t missilespeed=(fixed_t)VectorLength(velocity);
|
||||
misl->angle += Angle;
|
||||
angle_t an = misl->angle >> ANGLETOFINESHIFT;
|
||||
misl->momx = FixedMul (missilespeed, finecosine[an]);
|
||||
misl->momy = FixedMul (missilespeed, finesine[an]);
|
||||
}
|
||||
if (misl->flags4&MF4_SPECTRAL) misl->health=-1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue