mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-18 15:11:46 +00:00
Merge branch 'master' of https://github.com/rheit/zdoom
This commit is contained in:
commit
f0192a2349
93 changed files with 939 additions and 934 deletions
|
@ -851,14 +851,14 @@ public:
|
||||||
fixed_t Distance2D(AActor *other, bool absolute = false)
|
fixed_t Distance2D(AActor *other, bool absolute = false)
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = absolute ? other->Pos() : other->PosRelative(this);
|
fixedvec3 otherpos = absolute ? other->Pos() : other->PosRelative(this);
|
||||||
return xs_RoundToInt(TVector2<double>(X() - otherpos.x, Y() - otherpos.y).Length());
|
return xs_RoundToInt(DVector2(X() - otherpos.x, Y() - otherpos.y).Length());
|
||||||
}
|
}
|
||||||
|
|
||||||
// a full 3D version of the above
|
// a full 3D version of the above
|
||||||
fixed_t Distance3D(AActor *other, bool absolute = false)
|
fixed_t Distance3D(AActor *other, bool absolute = false)
|
||||||
{
|
{
|
||||||
fixedvec3 otherpos = absolute ? other->Pos() : other->PosRelative(this);
|
fixedvec3 otherpos = absolute ? other->Pos() : other->PosRelative(this);
|
||||||
return xs_RoundToInt(TVector3<double>(X() - otherpos.x, Y() - otherpos.y, Z() - otherpos.z).Length());
|
return xs_RoundToInt(DVector3(X() - otherpos.x, Y() - otherpos.y, Z() - otherpos.z).Length());
|
||||||
}
|
}
|
||||||
|
|
||||||
angle_t AngleTo(AActor *other, bool absolute = false)
|
angle_t AngleTo(AActor *other, bool absolute = false)
|
||||||
|
@ -1000,7 +1000,7 @@ public:
|
||||||
FTextureID ceilingpic; // contacted sec ceilingpic
|
FTextureID ceilingpic; // contacted sec ceilingpic
|
||||||
fixed_t radius, height; // for movement checking
|
fixed_t radius, height; // for movement checking
|
||||||
fixed_t projectilepassheight; // height for clipping projectile movement against this actor
|
fixed_t projectilepassheight; // height for clipping projectile movement against this actor
|
||||||
fixed_t velx, vely, velz; // velocity
|
fixedvec3 vel;
|
||||||
SDWORD tics; // state tic counter
|
SDWORD tics; // state tic counter
|
||||||
FState *state;
|
FState *state;
|
||||||
VMFunction *Damage; // For missiles and monster railgun
|
VMFunction *Damage; // For missiles and monster railgun
|
||||||
|
|
|
@ -44,7 +44,7 @@ bool DBot::Reachable (AActor *rtarget)
|
||||||
fixed_t estimated_dist = player->mo->AproxDistance(rtarget);
|
fixed_t estimated_dist = player->mo->AproxDistance(rtarget);
|
||||||
bool reachable = true;
|
bool reachable = true;
|
||||||
|
|
||||||
FPathTraverse it(player->mo->X()+player->mo->velx, player->mo->Y()+player->mo->vely, rtarget->X(), rtarget->Y(), PT_ADDLINES|PT_ADDTHINGS);
|
FPathTraverse it(player->mo->X()+player->mo->vel.x, player->mo->Y()+player->mo->vel.y, rtarget->X(), rtarget->Y(), PT_ADDLINES|PT_ADDTHINGS);
|
||||||
intercept_t *in;
|
intercept_t *in;
|
||||||
while ((in = it.Next()))
|
while ((in = it.Next()))
|
||||||
{
|
{
|
||||||
|
@ -58,8 +58,8 @@ bool DBot::Reachable (AActor *rtarget)
|
||||||
frac = in->frac - FixedDiv (4*FRACUNIT, MAX_TRAVERSE_DIST);
|
frac = in->frac - FixedDiv (4*FRACUNIT, MAX_TRAVERSE_DIST);
|
||||||
dist = FixedMul (frac, MAX_TRAVERSE_DIST);
|
dist = FixedMul (frac, MAX_TRAVERSE_DIST);
|
||||||
|
|
||||||
hitx = it.Trace().x + FixedMul (player->mo->velx, frac);
|
hitx = it.Trace().x + FixedMul (player->mo->vel.x, frac);
|
||||||
hity = it.Trace().y + FixedMul (player->mo->vely, frac);
|
hity = it.Trace().y + FixedMul (player->mo->vel.y, frac);
|
||||||
|
|
||||||
if (in->isaline)
|
if (in->isaline)
|
||||||
{
|
{
|
||||||
|
@ -170,7 +170,7 @@ void DBot::Dofire (ticcmd_t *cmd)
|
||||||
|
|
||||||
no_fire = true;
|
no_fire = true;
|
||||||
//Distance to enemy.
|
//Distance to enemy.
|
||||||
dist = player->mo->AproxDistance(enemy, player->mo->velx - enemy->velx, player->mo->vely - enemy->vely);
|
dist = player->mo->AproxDistance(enemy, player->mo->vel.x - enemy->vel.x, player->mo->vel.y - enemy->vel.y);
|
||||||
|
|
||||||
//FIRE EACH TYPE OF WEAPON DIFFERENT: Here should all the different weapons go.
|
//FIRE EACH TYPE OF WEAPON DIFFERENT: Here should all the different weapons go.
|
||||||
if (player->ReadyWeapon->WeaponFlags & WIF_MELEEWEAPON)
|
if (player->ReadyWeapon->WeaponFlags & WIF_MELEEWEAPON)
|
||||||
|
@ -223,7 +223,7 @@ void DBot::Dofire (ticcmd_t *cmd)
|
||||||
shootmissile:
|
shootmissile:
|
||||||
dist = player->mo->AproxDistance (enemy);
|
dist = player->mo->AproxDistance (enemy);
|
||||||
m = dist / GetDefaultByType (player->ReadyWeapon->ProjectileType)->Speed;
|
m = dist / GetDefaultByType (player->ReadyWeapon->ProjectileType)->Speed;
|
||||||
bglobal.SetBodyAt (enemy->X() + enemy->velx*m*2, enemy->Y() + enemy->vely*m*2, enemy->Z(), 1);
|
bglobal.SetBodyAt (enemy->X() + enemy->vel.x*m*2, enemy->Y() + enemy->vel.y*m*2, enemy->Z(), 1);
|
||||||
angle = player->mo->AngleTo(bglobal.body1);
|
angle = player->mo->AngleTo(bglobal.body1);
|
||||||
if (Check_LOS (enemy, SHOOTFOV))
|
if (Check_LOS (enemy, SHOOTFOV))
|
||||||
no_fire = false;
|
no_fire = false;
|
||||||
|
@ -470,18 +470,18 @@ fixed_t FCajunMaster::FakeFire (AActor *source, AActor *dest, ticcmd_t *cmd)
|
||||||
float speed = (float)th->Speed;
|
float speed = (float)th->Speed;
|
||||||
|
|
||||||
fixedvec3 fixvel = source->Vec3To(dest);
|
fixedvec3 fixvel = source->Vec3To(dest);
|
||||||
TVector3<double> velocity(fixvel.x, fixvel.y, fixvel.z);
|
DVector3 velocity(fixvel.x, fixvel.y, fixvel.z);
|
||||||
velocity.MakeUnit();
|
velocity.MakeUnit();
|
||||||
th->velx = FLOAT2FIXED(velocity[0] * speed);
|
th->vel.x = FLOAT2FIXED(velocity[0] * speed);
|
||||||
th->vely = FLOAT2FIXED(velocity[1] * speed);
|
th->vel.y = FLOAT2FIXED(velocity[1] * speed);
|
||||||
th->velz = FLOAT2FIXED(velocity[2] * speed);
|
th->vel.z = FLOAT2FIXED(velocity[2] * speed);
|
||||||
|
|
||||||
fixed_t dist = 0;
|
fixed_t dist = 0;
|
||||||
|
|
||||||
while (dist < SAFE_SELF_MISDIST)
|
while (dist < SAFE_SELF_MISDIST)
|
||||||
{
|
{
|
||||||
dist += th->Speed;
|
dist += th->Speed;
|
||||||
th->Move(th->velx, th->vely, th->velz);
|
th->Move(th->vel.x, th->vel.y, th->vel.z);
|
||||||
if (!CleanAhead (th, th->X(), th->Y(), cmd))
|
if (!CleanAhead (th, th->X(), th->Y(), cmd))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -496,8 +496,8 @@ angle_t DBot::FireRox (AActor *enemy, ticcmd_t *cmd)
|
||||||
AActor *actor;
|
AActor *actor;
|
||||||
int m;
|
int m;
|
||||||
|
|
||||||
bglobal.SetBodyAt (player->mo->X() + FixedMul(player->mo->velx, 5*FRACUNIT),
|
bglobal.SetBodyAt (player->mo->X() + FixedMul(player->mo->vel.x, 5*FRACUNIT),
|
||||||
player->mo->Y() + FixedMul(player->mo->vely, 5*FRACUNIT),
|
player->mo->Y() + FixedMul(player->mo->vel.y, 5*FRACUNIT),
|
||||||
player->mo->Z() + (player->mo->height / 2), 2);
|
player->mo->Z() + (player->mo->height / 2), 2);
|
||||||
|
|
||||||
actor = bglobal.body2;
|
actor = bglobal.body2;
|
||||||
|
@ -508,8 +508,8 @@ angle_t DBot::FireRox (AActor *enemy, ticcmd_t *cmd)
|
||||||
//Predict.
|
//Predict.
|
||||||
m = (((dist+1)/FRACUNIT) / GetDefaultByName("Rocket")->Speed);
|
m = (((dist+1)/FRACUNIT) / GetDefaultByName("Rocket")->Speed);
|
||||||
|
|
||||||
bglobal.SetBodyAt (enemy->X() + FixedMul(enemy->velx, (m+2*FRACUNIT)),
|
bglobal.SetBodyAt (enemy->X() + FixedMul(enemy->vel.x, (m+2*FRACUNIT)),
|
||||||
enemy->Y() + FixedMul(enemy->vely, (m+2*FRACUNIT)), ONFLOORZ, 1);
|
enemy->Y() + FixedMul(enemy->vel.y, (m+2*FRACUNIT)), ONFLOORZ, 1);
|
||||||
|
|
||||||
//try the predicted location
|
//try the predicted location
|
||||||
if (P_CheckSight (actor, bglobal.body1, SF_IGNOREVISIBILITY)) //See the predicted location, so give a test missile
|
if (P_CheckSight (actor, bglobal.body1, SF_IGNOREVISIBILITY)) //See the predicted location, so give a test missile
|
||||||
|
|
|
@ -85,7 +85,7 @@ void DBot::ThinkForMove (ticcmd_t *cmd)
|
||||||
dist = dest ? player->mo->AproxDistance(dest) : 0;
|
dist = dest ? player->mo->AproxDistance(dest) : 0;
|
||||||
|
|
||||||
if (missile &&
|
if (missile &&
|
||||||
((!missile->velx || !missile->vely) || !Check_LOS(missile, SHOOTFOV*3/2)))
|
((!missile->vel.x || !missile->vel.y) || !Check_LOS(missile, SHOOTFOV*3/2)))
|
||||||
{
|
{
|
||||||
sleft = !sleft;
|
sleft = !sleft;
|
||||||
missile = NULL; //Probably ended its travel.
|
missile = NULL; //Probably ended its travel.
|
||||||
|
|
|
@ -408,10 +408,10 @@ public:
|
||||||
fixed_t bob; // bounded/scaled total velocity
|
fixed_t bob; // bounded/scaled total velocity
|
||||||
|
|
||||||
// killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
|
// killough 10/98: used for realistic bobbing (i.e. not simply overall speed)
|
||||||
// mo->velx and mo->vely represent true velocity experienced by player.
|
// mo->vel.x and mo->vel.y represent true velocity experienced by player.
|
||||||
// This only represents the thrust that the player applies himself.
|
// This only represents the thrust that the player applies himself.
|
||||||
// This avoids anomalies with such things as Boom ice and conveyors.
|
// This avoids anomalies with such things as Boom ice and conveyors.
|
||||||
fixed_t velx, vely; // killough 10/98
|
fixedvec2 vel;
|
||||||
|
|
||||||
bool centering;
|
bool centering;
|
||||||
BYTE turnticks;
|
BYTE turnticks;
|
||||||
|
|
|
@ -1334,11 +1334,11 @@ void FParser::SF_MobjMomx(void)
|
||||||
if(t_argc > 1)
|
if(t_argc > 1)
|
||||||
{
|
{
|
||||||
if(mo)
|
if(mo)
|
||||||
mo->velx = fixedvalue(t_argv[1]);
|
mo->vel.x = fixedvalue(t_argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
t_return.type = svt_fixed;
|
t_return.type = svt_fixed;
|
||||||
t_return.value.f = mo ? mo->velx : 0;
|
t_return.value.f = mo ? mo->vel.x : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1358,11 +1358,11 @@ void FParser::SF_MobjMomy(void)
|
||||||
if(t_argc > 1)
|
if(t_argc > 1)
|
||||||
{
|
{
|
||||||
if(mo)
|
if(mo)
|
||||||
mo->vely = fixedvalue(t_argv[1]);
|
mo->vel.y = fixedvalue(t_argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
t_return.type = svt_fixed;
|
t_return.type = svt_fixed;
|
||||||
t_return.value.f = mo ? mo->vely : 0;
|
t_return.value.f = mo ? mo->vel.y : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1382,11 +1382,11 @@ void FParser::SF_MobjMomz(void)
|
||||||
if(t_argc > 1)
|
if(t_argc > 1)
|
||||||
{
|
{
|
||||||
if(mo)
|
if(mo)
|
||||||
mo->velz = fixedvalue(t_argv[1]);
|
mo->vel.z = fixedvalue(t_argv[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
t_return.type = svt_fixed;
|
t_return.type = svt_fixed;
|
||||||
t_return.value.f = mo ? mo->velz : 0;
|
t_return.value.f = mo ? mo->vel.z : 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -154,7 +154,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileAttack)
|
||||||
}
|
}
|
||||||
if (!(target->flags7 & MF7_DONTTHRUST))
|
if (!(target->flags7 & MF7_DONTTHRUST))
|
||||||
{
|
{
|
||||||
target->velz = Scale(thrust, 1000, target->Mass);
|
target->vel.z = Scale(thrust, 1000, target->Mass);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ static void BrainishExplosion (fixed_t x, fixed_t y, fixed_t z)
|
||||||
if (boom != NULL)
|
if (boom != NULL)
|
||||||
{
|
{
|
||||||
boom->DeathSound = "misc/brainexplode";
|
boom->DeathSound = "misc/brainexplode";
|
||||||
boom->velz = pr_brainscream() << 9;
|
boom->vel.z = pr_brainscream() << 9;
|
||||||
|
|
||||||
PClassActor *cls = PClass::FindActor("BossBrain");
|
PClassActor *cls = PClass::FindActor("BossBrain");
|
||||||
if (cls != NULL)
|
if (cls != NULL)
|
||||||
|
@ -144,17 +144,17 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BrainSpit)
|
||||||
spit->master = self;
|
spit->master = self;
|
||||||
// [RH] Do this correctly for any trajectory. Doom would divide by 0
|
// [RH] Do this correctly for any trajectory. Doom would divide by 0
|
||||||
// if the target had the same y coordinate as the spitter.
|
// if the target had the same y coordinate as the spitter.
|
||||||
if ((spit->velx | spit->vely) == 0)
|
if ((spit->vel.x | spit->vel.y) == 0)
|
||||||
{
|
{
|
||||||
spit->special2 = 0;
|
spit->special2 = 0;
|
||||||
}
|
}
|
||||||
else if (abs(spit->vely) > abs(spit->velx))
|
else if (abs(spit->vel.y) > abs(spit->vel.x))
|
||||||
{
|
{
|
||||||
spit->special2 = (targ->Y() - self->Y()) / spit->vely;
|
spit->special2 = (targ->Y() - self->Y()) / spit->vel.y;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spit->special2 = (targ->X() - self->X()) / spit->velx;
|
spit->special2 = (targ->X() - self->X()) / spit->vel.x;
|
||||||
}
|
}
|
||||||
// [GZ] Calculates when the projectile will have reached destination
|
// [GZ] Calculates when the projectile will have reached destination
|
||||||
spit->special2 += level.maptime;
|
spit->special2 += level.maptime;
|
||||||
|
|
|
@ -49,8 +49,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack1)
|
||||||
{
|
{
|
||||||
missile->angle += FATSPREAD;
|
missile->angle += FATSPREAD;
|
||||||
an = missile->angle >> ANGLETOFINESHIFT;
|
an = missile->angle >> ANGLETOFINESHIFT;
|
||||||
missile->velx = FixedMul (missile->Speed, finecosine[an]);
|
missile->vel.x = FixedMul (missile->Speed, finecosine[an]);
|
||||||
missile->vely = FixedMul (missile->Speed, finesine[an]);
|
missile->vel.y = FixedMul (missile->Speed, finesine[an]);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -78,8 +78,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack2)
|
||||||
{
|
{
|
||||||
missile->angle -= FATSPREAD*2;
|
missile->angle -= FATSPREAD*2;
|
||||||
an = missile->angle >> ANGLETOFINESHIFT;
|
an = missile->angle >> ANGLETOFINESHIFT;
|
||||||
missile->velx = FixedMul (missile->Speed, finecosine[an]);
|
missile->vel.x = FixedMul (missile->Speed, finecosine[an]);
|
||||||
missile->vely = FixedMul (missile->Speed, finesine[an]);
|
missile->vel.y = FixedMul (missile->Speed, finesine[an]);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -104,8 +104,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3)
|
||||||
{
|
{
|
||||||
missile->angle -= FATSPREAD/2;
|
missile->angle -= FATSPREAD/2;
|
||||||
an = missile->angle >> ANGLETOFINESHIFT;
|
an = missile->angle >> ANGLETOFINESHIFT;
|
||||||
missile->velx = FixedMul (missile->Speed, finecosine[an]);
|
missile->vel.x = FixedMul (missile->Speed, finecosine[an]);
|
||||||
missile->vely = FixedMul (missile->Speed, finesine[an]);
|
missile->vel.y = FixedMul (missile->Speed, finesine[an]);
|
||||||
}
|
}
|
||||||
|
|
||||||
missile = P_SpawnMissile (self, self->target, spawntype);
|
missile = P_SpawnMissile (self, self->target, spawntype);
|
||||||
|
@ -113,8 +113,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3)
|
||||||
{
|
{
|
||||||
missile->angle += FATSPREAD/2;
|
missile->angle += FATSPREAD/2;
|
||||||
an = missile->angle >> ANGLETOFINESHIFT;
|
an = missile->angle >> ANGLETOFINESHIFT;
|
||||||
missile->velx = FixedMul (missile->Speed, finecosine[an]);
|
missile->vel.x = FixedMul (missile->Speed, finecosine[an]);
|
||||||
missile->vely = FixedMul (missile->Speed, finesine[an]);
|
missile->vel.y = FixedMul (missile->Speed, finesine[an]);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -178,9 +178,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom)
|
||||||
}
|
}
|
||||||
if (mo != NULL)
|
if (mo != NULL)
|
||||||
{ // Slow it down a bit
|
{ // Slow it down a bit
|
||||||
mo->velx = FixedMul(mo->velx, hrange);
|
mo->vel.x = FixedMul(mo->vel.x, hrange);
|
||||||
mo->vely = FixedMul(mo->vely, hrange);
|
mo->vel.y = FixedMul(mo->vel.y, hrange);
|
||||||
mo->velz = FixedMul(mo->velz, hrange);
|
mo->vel.z = FixedMul(mo->vel.z, hrange);
|
||||||
mo->flags &= ~MF_NOGRAVITY; // Make debris fall under gravity
|
mo->flags &= ~MF_NOGRAVITY; // Make debris fall under gravity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,14 +34,14 @@ void A_SkullAttack(AActor *self, fixed_t speed)
|
||||||
S_Sound (self, CHAN_VOICE, self->AttackSound, 1, ATTN_NORM);
|
S_Sound (self, CHAN_VOICE, self->AttackSound, 1, ATTN_NORM);
|
||||||
A_FaceTarget (self);
|
A_FaceTarget (self);
|
||||||
an = self->angle >> ANGLETOFINESHIFT;
|
an = self->angle >> ANGLETOFINESHIFT;
|
||||||
self->velx = FixedMul (speed, finecosine[an]);
|
self->vel.x = FixedMul (speed, finecosine[an]);
|
||||||
self->vely = FixedMul (speed, finesine[an]);
|
self->vel.y = FixedMul (speed, finesine[an]);
|
||||||
dist = self->AproxDistance (dest);
|
dist = self->AproxDistance (dest);
|
||||||
dist = dist / speed;
|
dist = dist / speed;
|
||||||
|
|
||||||
if (dist < 1)
|
if (dist < 1)
|
||||||
dist = 1;
|
dist = 1;
|
||||||
self->velz = (dest->Z() + (dest->height>>1) - self->Z()) / dist;
|
self->vel.z = (dest->Z() + (dest->height>>1) - self->Z()) / dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullAttack)
|
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullAttack)
|
||||||
|
|
|
@ -37,7 +37,7 @@ void A_PainShootSkull (AActor *self, angle_t angle, PClassActor *spawntype, int
|
||||||
{
|
{
|
||||||
if (self->flags & MF_FLOAT)
|
if (self->flags & MF_FLOAT)
|
||||||
{
|
{
|
||||||
self->velz -= 2*FRACUNIT;
|
self->vel.z -= 2*FRACUNIT;
|
||||||
self->flags |= MF_INFLOAT;
|
self->flags |= MF_INFLOAT;
|
||||||
self->flags4 |= MF4_VFRICTION;
|
self->flags4 |= MF4_VFRICTION;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkelMissile)
|
||||||
|
|
||||||
if (missile != NULL)
|
if (missile != NULL)
|
||||||
{
|
{
|
||||||
missile->SetOrigin(missile->Vec3Offset(missile->velx, missile->vely, 0), false);
|
missile->SetOrigin(missile->Vec3Offset(missile->vel.x, missile->vel.y, 0), false);
|
||||||
missile->tracer = self->target;
|
missile->tracer = self->target;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -66,9 +66,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
|
||||||
// spawn a puff of smoke behind the rocket
|
// spawn a puff of smoke behind the rocket
|
||||||
P_SpawnPuff (self, PClass::FindActor(NAME_BulletPuff), self->Pos(), self->angle, self->angle, 3);
|
P_SpawnPuff (self, PClass::FindActor(NAME_BulletPuff), self->Pos(), self->angle, self->angle, 3);
|
||||||
|
|
||||||
smoke = Spawn ("RevenantTracerSmoke", self->Vec3Offset(-self->velx, -self->vely, 0), ALLOW_REPLACE);
|
smoke = Spawn ("RevenantTracerSmoke", self->Vec3Offset(-self->vel.x, -self->vel.y, 0), ALLOW_REPLACE);
|
||||||
|
|
||||||
smoke->velz = FRACUNIT;
|
smoke->vel.z = FRACUNIT;
|
||||||
smoke->tics -= pr_tracer()&3;
|
smoke->tics -= pr_tracer()&3;
|
||||||
if (smoke->tics < 1)
|
if (smoke->tics < 1)
|
||||||
smoke->tics = 1;
|
smoke->tics = 1;
|
||||||
|
@ -99,8 +99,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
|
||||||
}
|
}
|
||||||
|
|
||||||
exact = self->angle>>ANGLETOFINESHIFT;
|
exact = self->angle>>ANGLETOFINESHIFT;
|
||||||
self->velx = FixedMul (self->Speed, finecosine[exact]);
|
self->vel.x = FixedMul (self->Speed, finecosine[exact]);
|
||||||
self->vely = FixedMul (self->Speed, finesine[exact]);
|
self->vel.y = FixedMul (self->Speed, finesine[exact]);
|
||||||
|
|
||||||
if (!(self->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
if (!(self->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
||||||
{
|
{
|
||||||
|
@ -119,10 +119,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
|
||||||
slope = (dest->Z() + self->height*2/3 - self->Z()) / dist;
|
slope = (dest->Z() + self->height*2/3 - self->Z()) / dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (slope < self->velz)
|
if (slope < self->vel.z)
|
||||||
self->velz -= FRACUNIT/8;
|
self->vel.z -= FRACUNIT/8;
|
||||||
else
|
else
|
||||||
self->velz += FRACUNIT/8;
|
self->vel.z += FRACUNIT/8;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,13 +41,13 @@ void AChickenPlayer::MorphPlayerThink ()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!(velx | vely) && pr_chickenplayerthink () < 160)
|
if (!(vel.x | vel.y) && pr_chickenplayerthink () < 160)
|
||||||
{ // Twitch view angle
|
{ // Twitch view angle
|
||||||
angle += pr_chickenplayerthink.Random2 () << 19;
|
angle += pr_chickenplayerthink.Random2 () << 19;
|
||||||
}
|
}
|
||||||
if ((Z() <= floorz) && (pr_chickenplayerthink() < 32))
|
if ((Z() <= floorz) && (pr_chickenplayerthink() < 32))
|
||||||
{ // Jump and noise
|
{ // Jump and noise
|
||||||
velz += JumpZ;
|
vel.z += JumpZ;
|
||||||
|
|
||||||
FState * painstate = FindState(NAME_Pain);
|
FState * painstate = FindState(NAME_Pain);
|
||||||
if (painstate != NULL) SetState (painstate);
|
if (painstate != NULL) SetState (painstate);
|
||||||
|
@ -107,9 +107,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Feathers)
|
||||||
{
|
{
|
||||||
mo = Spawn("Feather", self->PosPlusZ(20*FRACUNIT), NO_REPLACE);
|
mo = Spawn("Feather", self->PosPlusZ(20*FRACUNIT), NO_REPLACE);
|
||||||
mo->target = self;
|
mo->target = self;
|
||||||
mo->velx = pr_feathers.Random2() << 8;
|
mo->vel.x = pr_feathers.Random2() << 8;
|
||||||
mo->vely = pr_feathers.Random2() << 8;
|
mo->vel.y = pr_feathers.Random2() << 8;
|
||||||
mo->velz = FRACUNIT + (pr_feathers() << 9);
|
mo->vel.z = FRACUNIT + (pr_feathers() << 9);
|
||||||
mo->SetState (mo->SpawnState + (pr_feathers()&7));
|
mo->SetState (mo->SpawnState + (pr_feathers()&7));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -67,7 +67,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack)
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
AActor *mo;
|
AActor *mo;
|
||||||
fixed_t velz;
|
fixed_t vz;
|
||||||
angle_t angle;
|
angle_t angle;
|
||||||
|
|
||||||
if (!self->target)
|
if (!self->target)
|
||||||
|
@ -93,10 +93,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack)
|
||||||
mo = P_SpawnMissileZ (self, self->Z() + 48*FRACUNIT, self->target, fx);
|
mo = P_SpawnMissileZ (self, self->Z() + 48*FRACUNIT, self->target, fx);
|
||||||
if (mo != NULL)
|
if (mo != NULL)
|
||||||
{
|
{
|
||||||
velz = mo->velz;
|
vz = mo->vel.z;
|
||||||
angle = mo->angle;
|
angle = mo->angle;
|
||||||
P_SpawnMissileAngleZ (self, self->Z() + 48*FRACUNIT, fx, angle-ANGLE_1*3, velz);
|
P_SpawnMissileAngleZ (self, self->Z() + 48*FRACUNIT, fx, angle-ANGLE_1*3, vz);
|
||||||
P_SpawnMissileAngleZ (self, self->Z() + 48*FRACUNIT, fx, angle+ANGLE_1*3, velz);
|
P_SpawnMissileAngleZ (self, self->Z() + 48*FRACUNIT, fx, angle+ANGLE_1*3, vz);
|
||||||
}
|
}
|
||||||
if (self->health < self->SpawnHealth()/3)
|
if (self->health < self->SpawnHealth()/3)
|
||||||
{ // Maybe attack again
|
{ // Maybe attack again
|
||||||
|
@ -167,7 +167,7 @@ void P_DSparilTeleport (AActor *actor)
|
||||||
S_Sound (actor, CHAN_BODY, "misc/teleport", 1, ATTN_NORM);
|
S_Sound (actor, CHAN_BODY, "misc/teleport", 1, ATTN_NORM);
|
||||||
actor->SetZ(actor->floorz, false);
|
actor->SetZ(actor->floorz, false);
|
||||||
actor->angle = spot->angle;
|
actor->angle = spot->angle;
|
||||||
actor->velx = actor->vely = actor->velz = 0;
|
actor->vel.x = actor->vel.y = actor->vel.z = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,9 +257,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_BlueSpark)
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < 2; i++)
|
||||||
{
|
{
|
||||||
mo = Spawn("Sorcerer2FXSpark", self->Pos(), ALLOW_REPLACE);
|
mo = Spawn("Sorcerer2FXSpark", self->Pos(), ALLOW_REPLACE);
|
||||||
mo->velx = pr_bluespark.Random2() << 9;
|
mo->vel.x = pr_bluespark.Random2() << 9;
|
||||||
mo->vely = pr_bluespark.Random2() << 9;
|
mo->vel.y = pr_bluespark.Random2() << 9;
|
||||||
mo->velz = FRACUNIT + (pr_bluespark()<<8);
|
mo->vel.z = FRACUNIT + (pr_bluespark()<<8);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_GenWizard)
|
||||||
{ // [RH] Make the new wizards inherit D'Sparil's target
|
{ // [RH] Make the new wizards inherit D'Sparil's target
|
||||||
mo->CopyFriendliness (self->target, true);
|
mo->CopyFriendliness (self->target, true);
|
||||||
|
|
||||||
self->velx = self->vely = self->velz = 0;
|
self->vel.x = self->vel.y = self->vel.z = 0;
|
||||||
self->SetState (self->FindState(NAME_Death));
|
self->SetState (self->FindState(NAME_Death));
|
||||||
self->flags &= ~MF_MISSILE;
|
self->flags &= ~MF_MISSILE;
|
||||||
mo->master = self->target;
|
mo->master = self->target;
|
||||||
|
|
|
@ -47,14 +47,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_ImpExplode)
|
||||||
self->flags &= ~MF_NOGRAVITY;
|
self->flags &= ~MF_NOGRAVITY;
|
||||||
|
|
||||||
chunk = Spawn("HereticImpChunk1", self->Pos(), ALLOW_REPLACE);
|
chunk = Spawn("HereticImpChunk1", self->Pos(), ALLOW_REPLACE);
|
||||||
chunk->velx = pr_imp.Random2 () << 10;
|
chunk->vel.x = pr_imp.Random2 () << 10;
|
||||||
chunk->vely = pr_imp.Random2 () << 10;
|
chunk->vel.y = pr_imp.Random2 () << 10;
|
||||||
chunk->velz = 9*FRACUNIT;
|
chunk->vel.z = 9*FRACUNIT;
|
||||||
|
|
||||||
chunk = Spawn("HereticImpChunk2", self->Pos(), ALLOW_REPLACE);
|
chunk = Spawn("HereticImpChunk2", self->Pos(), ALLOW_REPLACE);
|
||||||
chunk->velx = pr_imp.Random2 () << 10;
|
chunk->vel.x = pr_imp.Random2 () << 10;
|
||||||
chunk->vely = pr_imp.Random2 () << 10;
|
chunk->vel.y = pr_imp.Random2 () << 10;
|
||||||
chunk->velz = 9*FRACUNIT;
|
chunk->vel.z = 9*FRACUNIT;
|
||||||
if (self->special1 == 666)
|
if (self->special1 == 666)
|
||||||
{ // Extreme death crash
|
{ // Extreme death crash
|
||||||
self->SetState (self->FindState("XCrash"));
|
self->SetState (self->FindState("XCrash"));
|
||||||
|
|
|
@ -61,9 +61,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PodPain)
|
||||||
{
|
{
|
||||||
goo = Spawn(gootype, self->PosPlusZ(48*FRACUNIT), ALLOW_REPLACE);
|
goo = Spawn(gootype, self->PosPlusZ(48*FRACUNIT), ALLOW_REPLACE);
|
||||||
goo->target = self;
|
goo->target = self;
|
||||||
goo->velx = pr_podpain.Random2() << 9;
|
goo->vel.x = pr_podpain.Random2() << 9;
|
||||||
goo->vely = pr_podpain.Random2() << 9;
|
goo->vel.y = pr_podpain.Random2() << 9;
|
||||||
goo->velz = FRACUNIT/2 + (pr_podpain() << 9);
|
goo->vel.z = FRACUNIT/2 + (pr_podpain() << 9);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_AccTeleGlitter)
|
||||||
|
|
||||||
if (++self->health > 35)
|
if (++self->health > 35)
|
||||||
{
|
{
|
||||||
self->velz += self->velz/2;
|
self->vel.z += self->vel.z/2;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -182,9 +182,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcanoBlast)
|
||||||
angle = pr_blast () << 24;
|
angle = pr_blast () << 24;
|
||||||
blast->angle = angle;
|
blast->angle = angle;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
blast->velx = FixedMul (1*FRACUNIT, finecosine[angle]);
|
blast->vel.x = FixedMul (1*FRACUNIT, finecosine[angle]);
|
||||||
blast->vely = FixedMul (1*FRACUNIT, finesine[angle]);
|
blast->vel.y = FixedMul (1*FRACUNIT, finesine[angle]);
|
||||||
blast->velz = (FRACUNIT*5/2) + (pr_blast() << 10);
|
blast->vel.z = (FRACUNIT*5/2) + (pr_blast() << 10);
|
||||||
S_Sound (blast, CHAN_BODY, "world/volcano/shoot", 1, ATTN_NORM);
|
S_Sound (blast, CHAN_BODY, "world/volcano/shoot", 1, ATTN_NORM);
|
||||||
P_CheckMissileSpawn (blast, self->radius);
|
P_CheckMissileSpawn (blast, self->radius);
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact)
|
||||||
self->flags |= MF_NOGRAVITY;
|
self->flags |= MF_NOGRAVITY;
|
||||||
self->gravity = FRACUNIT;
|
self->gravity = FRACUNIT;
|
||||||
self->AddZ(28*FRACUNIT);
|
self->AddZ(28*FRACUNIT);
|
||||||
//self->velz = 3*FRACUNIT;
|
//self->vel.z = 3*FRACUNIT;
|
||||||
}
|
}
|
||||||
P_RadiusAttack (self, self->target, 25, 25, NAME_Fire, RADF_HURTSOURCE);
|
P_RadiusAttack (self, self->target, 25, 25, NAME_Fire, RADF_HURTSOURCE);
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
|
@ -220,9 +220,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact)
|
||||||
angle = i*ANG90;
|
angle = i*ANG90;
|
||||||
tiny->angle = angle;
|
tiny->angle = angle;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
tiny->velx = FixedMul (FRACUNIT*7/10, finecosine[angle]);
|
tiny->vel.x = FixedMul (FRACUNIT*7/10, finecosine[angle]);
|
||||||
tiny->vely = FixedMul (FRACUNIT*7/10, finesine[angle]);
|
tiny->vel.y = FixedMul (FRACUNIT*7/10, finesine[angle]);
|
||||||
tiny->velz = FRACUNIT + (pr_volcimpact() << 9);
|
tiny->vel.z = FRACUNIT + (pr_volcimpact() << 9);
|
||||||
P_CheckMissileSpawn (tiny, self->radius);
|
P_CheckMissileSpawn (tiny, self->radius);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -150,7 +150,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
|
||||||
int i;
|
int i;
|
||||||
angle_t angle;
|
angle_t angle;
|
||||||
int damage;
|
int damage;
|
||||||
fixed_t velz;
|
fixed_t vz;
|
||||||
player_t *player;
|
player_t *player;
|
||||||
|
|
||||||
if (NULL == (player = self->player))
|
if (NULL == (player = self->player))
|
||||||
|
@ -165,10 +165,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
angle_t pitch = P_BulletSlope(self);
|
angle_t pitch = P_BulletSlope(self);
|
||||||
velz = FixedMul (GetDefaultByName("GoldWandFX2")->Speed,
|
vz = FixedMul (GetDefaultByName("GoldWandFX2")->Speed,
|
||||||
finetangent[FINEANGLES/4-((signed)pitch>>ANGLETOFINESHIFT)]);
|
finetangent[FINEANGLES/4-((signed)pitch>>ANGLETOFINESHIFT)]);
|
||||||
P_SpawnMissileAngle (self, PClass::FindActor("GoldWandFX2"), self->angle-(ANG45/8), velz);
|
P_SpawnMissileAngle (self, PClass::FindActor("GoldWandFX2"), self->angle-(ANG45/8), vz);
|
||||||
P_SpawnMissileAngle (self, PClass::FindActor("GoldWandFX2"), self->angle+(ANG45/8), velz);
|
P_SpawnMissileAngle (self, PClass::FindActor("GoldWandFX2"), self->angle+(ANG45/8), vz);
|
||||||
angle = self->angle-(ANG45/8);
|
angle = self->angle-(ANG45/8);
|
||||||
for(i = 0; i < 5; i++)
|
for(i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
|
@ -402,15 +402,15 @@ void FireMacePL1B (AActor *actor)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ball = Spawn("MaceFX2", actor->PosPlusZ(28*FRACUNIT - actor->floorclip), ALLOW_REPLACE);
|
ball = Spawn("MaceFX2", actor->PosPlusZ(28*FRACUNIT - actor->floorclip), ALLOW_REPLACE);
|
||||||
ball->velz = 2*FRACUNIT+/*((player->lookdir)<<(FRACBITS-5))*/
|
ball->vel.z = 2*FRACUNIT+/*((player->lookdir)<<(FRACBITS-5))*/
|
||||||
finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)];
|
finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)];
|
||||||
angle = actor->angle;
|
angle = actor->angle;
|
||||||
ball->target = actor;
|
ball->target = actor;
|
||||||
ball->angle = angle;
|
ball->angle = angle;
|
||||||
ball->AddZ(2*finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)]);
|
ball->AddZ(2*finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)]);
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
ball->velx = (actor->velx>>1) + FixedMul(ball->Speed, finecosine[angle]);
|
ball->vel.x = (actor->vel.x>>1) + FixedMul(ball->Speed, finecosine[angle]);
|
||||||
ball->vely = (actor->vely>>1) + FixedMul(ball->Speed, finesine[angle]);
|
ball->vel.y = (actor->vel.y>>1) + FixedMul(ball->Speed, finesine[angle]);
|
||||||
S_Sound (ball, CHAN_BODY, "weapons/maceshoot", 1, ATTN_NORM);
|
S_Sound (ball, CHAN_BODY, "weapons/maceshoot", 1, ATTN_NORM);
|
||||||
P_CheckMissileSpawn (ball, actor->radius);
|
P_CheckMissileSpawn (ball, actor->radius);
|
||||||
}
|
}
|
||||||
|
@ -481,16 +481,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_MacePL1Check)
|
||||||
#if 0
|
#if 0
|
||||||
// This is the original code, for reference.
|
// This is the original code, for reference.
|
||||||
angle_t angle = self->angle>>ANGLETOFINESHIFT;
|
angle_t angle = self->angle>>ANGLETOFINESHIFT;
|
||||||
self->velx = FixedMul(7*FRACUNIT, finecosine[angle]);
|
self->vel.x = FixedMul(7*FRACUNIT, finecosine[angle]);
|
||||||
self->vely = FixedMul(7*FRACUNIT, finesine[angle]);
|
self->vel.y = FixedMul(7*FRACUNIT, finesine[angle]);
|
||||||
#else
|
#else
|
||||||
double velscale = sqrt ((double)self->velx * (double)self->velx +
|
double velscale = sqrt ((double)self->vel.x * (double)self->vel.x +
|
||||||
(double)self->vely * (double)self->vely);
|
(double)self->vel.y * (double)self->vel.y);
|
||||||
velscale = 458752 / velscale;
|
velscale = 458752 / velscale;
|
||||||
self->velx = (int)(self->velx * velscale);
|
self->vel.x = (int)(self->vel.x * velscale);
|
||||||
self->vely = (int)(self->vely * velscale);
|
self->vel.y = (int)(self->vel.y * velscale);
|
||||||
#endif
|
#endif
|
||||||
self->velz -= self->velz >> 1;
|
self->vel.z -= self->vel.z >> 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -507,14 +507,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact)
|
||||||
if ((self->health != MAGIC_JUNK) && (self->flags & MF_INBOUNCE))
|
if ((self->health != MAGIC_JUNK) && (self->flags & MF_INBOUNCE))
|
||||||
{ // Bounce
|
{ // Bounce
|
||||||
self->health = MAGIC_JUNK;
|
self->health = MAGIC_JUNK;
|
||||||
self->velz = (self->velz * 192) >> 8;
|
self->vel.z = (self->vel.z * 192) >> 8;
|
||||||
self->BounceFlags = BOUNCE_None;
|
self->BounceFlags = BOUNCE_None;
|
||||||
self->SetState (self->SpawnState);
|
self->SetState (self->SpawnState);
|
||||||
S_Sound (self, CHAN_BODY, "weapons/macebounce", 1, ATTN_NORM);
|
S_Sound (self, CHAN_BODY, "weapons/macebounce", 1, ATTN_NORM);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Explode
|
{ // Explode
|
||||||
self->velx = self->vely = self->velz = 0;
|
self->vel.x = self->vel.y = self->vel.z = 0;
|
||||||
self->flags |= MF_NOGRAVITY;
|
self->flags |= MF_NOGRAVITY;
|
||||||
self->gravity = FRACUNIT;
|
self->gravity = FRACUNIT;
|
||||||
S_Sound (self, CHAN_BODY, "weapons/macehit", 1, ATTN_NORM);
|
S_Sound (self, CHAN_BODY, "weapons/macehit", 1, ATTN_NORM);
|
||||||
|
@ -542,13 +542,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2)
|
||||||
}
|
}
|
||||||
if (self->flags & MF_INBOUNCE)
|
if (self->flags & MF_INBOUNCE)
|
||||||
{
|
{
|
||||||
if (self->velz < 2*FRACUNIT)
|
if (self->vel.z < 2*FRACUNIT)
|
||||||
{
|
{
|
||||||
goto boom;
|
goto boom;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bounce
|
// Bounce
|
||||||
self->velz = (self->velz * 192) >> 8;
|
self->vel.z = (self->vel.z * 192) >> 8;
|
||||||
self->SetState (self->SpawnState);
|
self->SetState (self->SpawnState);
|
||||||
|
|
||||||
tiny = Spawn("MaceFX3", self->Pos(), ALLOW_REPLACE);
|
tiny = Spawn("MaceFX3", self->Pos(), ALLOW_REPLACE);
|
||||||
|
@ -556,9 +556,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2)
|
||||||
tiny->target = self->target;
|
tiny->target = self->target;
|
||||||
tiny->angle = angle;
|
tiny->angle = angle;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
tiny->velx = (self->velx>>1) + FixedMul(self->velz-FRACUNIT, finecosine[angle]);
|
tiny->vel.x = (self->vel.x>>1) + FixedMul(self->vel.z-FRACUNIT, finecosine[angle]);
|
||||||
tiny->vely = (self->vely>>1) + FixedMul(self->velz-FRACUNIT, finesine[angle]);
|
tiny->vel.y = (self->vel.y>>1) + FixedMul(self->vel.z-FRACUNIT, finesine[angle]);
|
||||||
tiny->velz = self->velz;
|
tiny->vel.z = self->vel.z;
|
||||||
P_CheckMissileSpawn (tiny, self->radius);
|
P_CheckMissileSpawn (tiny, self->radius);
|
||||||
|
|
||||||
tiny = Spawn("MaceFX3", self->Pos(), ALLOW_REPLACE);
|
tiny = Spawn("MaceFX3", self->Pos(), ALLOW_REPLACE);
|
||||||
|
@ -566,15 +566,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2)
|
||||||
tiny->target = self->target;
|
tiny->target = self->target;
|
||||||
tiny->angle = angle;
|
tiny->angle = angle;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
tiny->velx = (self->velx>>1) + FixedMul(self->velz-FRACUNIT, finecosine[angle]);
|
tiny->vel.x = (self->vel.x>>1) + FixedMul(self->vel.z-FRACUNIT, finecosine[angle]);
|
||||||
tiny->vely = (self->vely>>1) + FixedMul(self->velz-FRACUNIT, finesine[angle]);
|
tiny->vel.y = (self->vel.y>>1) + FixedMul(self->vel.z-FRACUNIT, finesine[angle]);
|
||||||
tiny->velz = self->velz;
|
tiny->vel.z = self->vel.z;
|
||||||
P_CheckMissileSpawn (tiny, self->radius);
|
P_CheckMissileSpawn (tiny, self->radius);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Explode
|
{ // Explode
|
||||||
boom:
|
boom:
|
||||||
self->velx = self->vely = self->velz = 0;
|
self->vel.x = self->vel.y = self->vel.z = 0;
|
||||||
self->flags |= MF_NOGRAVITY;
|
self->flags |= MF_NOGRAVITY;
|
||||||
self->BounceFlags = BOUNCE_None;
|
self->BounceFlags = BOUNCE_None;
|
||||||
self->gravity = FRACUNIT;
|
self->gravity = FRACUNIT;
|
||||||
|
@ -610,9 +610,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL2)
|
||||||
mo = P_SpawnPlayerMissile (self, 0,0,0, RUNTIME_CLASS(AMaceFX4), self->angle, &t);
|
mo = P_SpawnPlayerMissile (self, 0,0,0, RUNTIME_CLASS(AMaceFX4), self->angle, &t);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velx += self->velx;
|
mo->vel.x += self->vel.x;
|
||||||
mo->vely += self->vely;
|
mo->vel.y += self->vel.y;
|
||||||
mo->velz = 2*FRACUNIT+
|
mo->vel.z = 2*FRACUNIT+
|
||||||
clamp<fixed_t>(finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)], -5*FRACUNIT, 5*FRACUNIT);
|
clamp<fixed_t>(finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)], -5*FRACUNIT, 5*FRACUNIT);
|
||||||
if (t.linetarget && !t.unlinked)
|
if (t.linetarget && !t.unlinked)
|
||||||
{
|
{
|
||||||
|
@ -646,7 +646,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
|
||||||
}
|
}
|
||||||
if (self->flags & MF_INBOUNCE)
|
if (self->flags & MF_INBOUNCE)
|
||||||
{
|
{
|
||||||
if (self->velz < 2*FRACUNIT)
|
if (self->vel.z < 2*FRACUNIT)
|
||||||
{
|
{
|
||||||
goto boom;
|
goto boom;
|
||||||
}
|
}
|
||||||
|
@ -686,8 +686,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
|
||||||
{
|
{
|
||||||
self->angle = angle;
|
self->angle = angle;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
self->velx = FixedMul (self->Speed, finecosine[angle]);
|
self->vel.x = FixedMul (self->Speed, finecosine[angle]);
|
||||||
self->vely = FixedMul (self->Speed, finesine[angle]);
|
self->vel.y = FixedMul (self->Speed, finesine[angle]);
|
||||||
}
|
}
|
||||||
self->SetState (self->SpawnState);
|
self->SetState (self->SpawnState);
|
||||||
S_Sound (self, CHAN_BODY, "weapons/macestop", 1, ATTN_NORM);
|
S_Sound (self, CHAN_BODY, "weapons/macestop", 1, ATTN_NORM);
|
||||||
|
@ -695,7 +695,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
|
||||||
else
|
else
|
||||||
{ // Explode
|
{ // Explode
|
||||||
boom:
|
boom:
|
||||||
self->velx = self->vely = self->velz = 0;
|
self->vel.x = self->vel.y = self->vel.z = 0;
|
||||||
self->flags |= MF_NOGRAVITY;
|
self->flags |= MF_NOGRAVITY;
|
||||||
self->gravity = FRACUNIT;
|
self->gravity = FRACUNIT;
|
||||||
S_Sound (self, CHAN_BODY, "weapons/maceexplode", 1, ATTN_NORM);
|
S_Sound (self, CHAN_BODY, "weapons/maceexplode", 1, ATTN_NORM);
|
||||||
|
@ -826,8 +826,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnRippers)
|
||||||
ripper->target = self->target;
|
ripper->target = self->target;
|
||||||
ripper->angle = angle;
|
ripper->angle = angle;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
ripper->velx = FixedMul (ripper->Speed, finecosine[angle]);
|
ripper->vel.x = FixedMul (ripper->Speed, finecosine[angle]);
|
||||||
ripper->vely = FixedMul (ripper->Speed, finesine[angle]);
|
ripper->vel.y = FixedMul (ripper->Speed, finesine[angle]);
|
||||||
P_CheckMissileSpawn (ripper, self->radius);
|
P_CheckMissileSpawn (ripper, self->radius);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1094,8 +1094,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkullRodStorm)
|
||||||
mo->Translation = multiplayer ?
|
mo->Translation = multiplayer ?
|
||||||
TRANSLATION(TRANSLATION_RainPillar,self->special2) : 0;
|
TRANSLATION(TRANSLATION_RainPillar,self->special2) : 0;
|
||||||
mo->target = self->target;
|
mo->target = self->target;
|
||||||
mo->velx = 1; // Force collision detection
|
mo->vel.x = 1; // Force collision detection
|
||||||
mo->velz = -mo->Speed;
|
mo->vel.z = -mo->Speed;
|
||||||
mo->special2 = self->special2; // Transfer player number
|
mo->special2 = self->special2; // Transfer player number
|
||||||
P_CheckMissileSpawn (mo, self->radius);
|
P_CheckMissileSpawn (mo, self->radius);
|
||||||
if (self->special1 != -1 && !S_IsActorPlayingSomething (self, CHAN_BODY, -1))
|
if (self->special1 != -1 && !S_IsActorPlayingSomething (self, CHAN_BODY, -1))
|
||||||
|
@ -1254,8 +1254,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL1)
|
||||||
P_SpawnPlayerMissile (self, RUNTIME_CLASS(APhoenixFX1));
|
P_SpawnPlayerMissile (self, RUNTIME_CLASS(APhoenixFX1));
|
||||||
angle = self->angle + ANG180;
|
angle = self->angle + ANG180;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
self->velx += FixedMul (4*FRACUNIT, finecosine[angle]);
|
self->vel.x += FixedMul (4*FRACUNIT, finecosine[angle]);
|
||||||
self->vely += FixedMul (4*FRACUNIT, finesine[angle]);
|
self->vel.y += FixedMul (4*FRACUNIT, finesine[angle]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1277,15 +1277,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_PhoenixPuff)
|
||||||
puff = Spawn("PhoenixPuff", self->Pos(), ALLOW_REPLACE);
|
puff = Spawn("PhoenixPuff", self->Pos(), ALLOW_REPLACE);
|
||||||
angle = self->angle + ANG90;
|
angle = self->angle + ANG90;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
puff->velx = FixedMul (FRACUNIT*13/10, finecosine[angle]);
|
puff->vel.x = FixedMul (FRACUNIT*13/10, finecosine[angle]);
|
||||||
puff->vely = FixedMul (FRACUNIT*13/10, finesine[angle]);
|
puff->vel.y = FixedMul (FRACUNIT*13/10, finesine[angle]);
|
||||||
puff->velz = 0;
|
puff->vel.z = 0;
|
||||||
puff = Spawn("PhoenixPuff", self->Pos(), ALLOW_REPLACE);
|
puff = Spawn("PhoenixPuff", self->Pos(), ALLOW_REPLACE);
|
||||||
angle = self->angle - ANG90;
|
angle = self->angle - ANG90;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
puff->velx = FixedMul (FRACUNIT*13/10, finecosine[angle]);
|
puff->vel.x = FixedMul (FRACUNIT*13/10, finecosine[angle]);
|
||||||
puff->vely = FixedMul (FRACUNIT*13/10, finesine[angle]);
|
puff->vel.y = FixedMul (FRACUNIT*13/10, finesine[angle]);
|
||||||
puff->velz = 0;
|
puff->vel.z = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1356,9 +1356,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
|
||||||
mo = Spawn("PhoenixFX2", pos, ALLOW_REPLACE);
|
mo = Spawn("PhoenixFX2", pos, ALLOW_REPLACE);
|
||||||
mo->target = self;
|
mo->target = self;
|
||||||
mo->angle = angle;
|
mo->angle = angle;
|
||||||
mo->velx = self->velx + FixedMul (mo->Speed, finecosine[angle>>ANGLETOFINESHIFT]);
|
mo->vel.x = self->vel.x + FixedMul (mo->Speed, finecosine[angle>>ANGLETOFINESHIFT]);
|
||||||
mo->vely = self->vely + FixedMul (mo->Speed, finesine[angle>>ANGLETOFINESHIFT]);
|
mo->vel.y = self->vel.y + FixedMul (mo->Speed, finesine[angle>>ANGLETOFINESHIFT]);
|
||||||
mo->velz = FixedMul (mo->Speed, slope);
|
mo->vel.z = FixedMul (mo->Speed, slope);
|
||||||
if (!player->refire || !S_IsActorPlayingSomething (self, CHAN_WEAPON, -1))
|
if (!player->refire || !S_IsActorPlayingSomething (self, CHAN_WEAPON, -1))
|
||||||
{
|
{
|
||||||
S_Sound (self, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
|
S_Sound (self, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
|
||||||
|
@ -1403,7 +1403,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FlameEnd)
|
||||||
{
|
{
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
self->velz += FRACUNIT*3/2;
|
self->vel.z += FRACUNIT*3/2;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1417,7 +1417,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FloatPuff)
|
||||||
{
|
{
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
self->velz += FRACUNIT*18/10;
|
self->vel.z += FRACUNIT*18/10;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,8 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage, FName damagetype)
|
||||||
if (!(target->flags7 & MF7_DONTTHRUST))
|
if (!(target->flags7 & MF7_DONTTHRUST))
|
||||||
{
|
{
|
||||||
target->angle += pr_foo.Random2() << 20;
|
target->angle += pr_foo.Random2() << 20;
|
||||||
target->velx += pr_foo.Random2() << 10;
|
target->vel.x += pr_foo.Random2() << 10;
|
||||||
target->vely += pr_foo.Random2() << 10;
|
target->vel.y += pr_foo.Random2() << 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((level.time & 16) && !(target->flags2 & MF2_BOSS) && !(target->flags7 & MF7_DONTTHRUST))
|
if ((level.time & 16) && !(target->flags2 & MF2_BOSS) && !(target->flags7 & MF7_DONTTHRUST))
|
||||||
|
@ -42,10 +42,10 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage, FName damagetype)
|
||||||
{
|
{
|
||||||
randVal = 160;
|
randVal = 160;
|
||||||
}
|
}
|
||||||
target->velz += randVal << 11;
|
target->vel.z += randVal << 11;
|
||||||
if (target->velz > 12*FRACUNIT)
|
if (target->vel.z > 12*FRACUNIT)
|
||||||
{
|
{
|
||||||
target->velz = 12*FRACUNIT;
|
target->vel.z = 12*FRACUNIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(level.time & 7))
|
if (!(level.time & 7))
|
||||||
|
@ -115,9 +115,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
|
||||||
}
|
}
|
||||||
fire->target = baseFire->target;
|
fire->target = baseFire->target;
|
||||||
fire->angle = baseFire->angle;
|
fire->angle = baseFire->angle;
|
||||||
fire->velx = baseFire->velx;
|
fire->vel.x = baseFire->vel.x;
|
||||||
fire->vely = baseFire->vely;
|
fire->vel.y = baseFire->vel.y;
|
||||||
fire->velz = baseFire->velz;
|
fire->vel.z = baseFire->vel.z;
|
||||||
fire->Damage = NULL;
|
fire->Damage = NULL;
|
||||||
fire->health = (i+1) * 2;
|
fire->health = (i+1) * 2;
|
||||||
P_CheckMissileSpawn (fire, self->radius);
|
P_CheckMissileSpawn (fire, self->radius);
|
||||||
|
@ -151,7 +151,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_WhirlwindSeek)
|
||||||
self->health -= 3;
|
self->health -= 3;
|
||||||
if (self->health < 0)
|
if (self->health < 0)
|
||||||
{
|
{
|
||||||
self->velx = self->vely = self->velz = 0;
|
self->vel.x = self->vel.y = self->vel.z = 0;
|
||||||
self->SetState (self->FindState(NAME_Death));
|
self->SetState (self->FindState(NAME_Death));
|
||||||
self->flags &= ~MF_MISSILE;
|
self->flags &= ~MF_MISSILE;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -190,9 +190,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact)
|
||||||
shard->target = self->target;
|
shard->target = self->target;
|
||||||
shard->angle = angle;
|
shard->angle = angle;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
shard->velx = FixedMul (shard->Speed, finecosine[angle]);
|
shard->vel.x = FixedMul (shard->Speed, finecosine[angle]);
|
||||||
shard->vely = FixedMul (shard->Speed, finesine[angle]);
|
shard->vel.y = FixedMul (shard->Speed, finesine[angle]);
|
||||||
shard->velz = -FRACUNIT*6/10;
|
shard->vel.z = -FRACUNIT*6/10;
|
||||||
P_CheckMissileSpawn (shard, self->radius);
|
P_CheckMissileSpawn (shard, self->radius);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -28,8 +28,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_DripBlood)
|
||||||
fixed_t xo = (pr_dripblood.Random2() << 11);
|
fixed_t xo = (pr_dripblood.Random2() << 11);
|
||||||
fixed_t yo = (pr_dripblood.Random2() << 11);
|
fixed_t yo = (pr_dripblood.Random2() << 11);
|
||||||
mo = Spawn ("Blood", self->Vec3Offset(xo, yo, 0), ALLOW_REPLACE);
|
mo = Spawn ("Blood", self->Vec3Offset(xo, yo, 0), ALLOW_REPLACE);
|
||||||
mo->velx = pr_dripblood.Random2 () << 10;
|
mo->vel.x = pr_dripblood.Random2 () << 10;
|
||||||
mo->vely = pr_dripblood.Random2 () << 10;
|
mo->vel.y = pr_dripblood.Random2 () << 10;
|
||||||
mo->gravity = FRACUNIT/8;
|
mo->gravity = FRACUNIT/8;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,8 +88,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_WizAtk3)
|
||||||
mo = P_SpawnMissile (self, self->target, fx);
|
mo = P_SpawnMissile (self, self->target, fx);
|
||||||
if (mo != NULL)
|
if (mo != NULL)
|
||||||
{
|
{
|
||||||
P_SpawnMissileAngle(self, fx, mo->angle-(ANG45/8), mo->velz);
|
P_SpawnMissileAngle(self, fx, mo->angle-(ANG45/8), mo->vel.z);
|
||||||
P_SpawnMissileAngle(self, fx, mo->angle+(ANG45/8), mo->velz);
|
P_SpawnMissileAngle(self, fx, mo->angle+(ANG45/8), mo->vel.z);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,8 +83,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BatMove)
|
||||||
|
|
||||||
// Adjust velocity vector to new direction
|
// Adjust velocity vector to new direction
|
||||||
newangle >>= ANGLETOFINESHIFT;
|
newangle >>= ANGLETOFINESHIFT;
|
||||||
self->velx = FixedMul (self->Speed, finecosine[newangle]);
|
self->vel.x = FixedMul (self->Speed, finecosine[newangle]);
|
||||||
self->vely = FixedMul (self->Speed, finesine[newangle]);
|
self->vel.y = FixedMul (self->Speed, finesine[newangle]);
|
||||||
|
|
||||||
if (pr_batmove()<15)
|
if (pr_batmove()<15)
|
||||||
{
|
{
|
||||||
|
|
|
@ -146,8 +146,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopSpawnBlur)
|
||||||
|
|
||||||
if (!--self->special1)
|
if (!--self->special1)
|
||||||
{
|
{
|
||||||
self->velx = 0;
|
self->vel.x = 0;
|
||||||
self->vely = 0;
|
self->vel.y = 0;
|
||||||
if (pr_sblur() > 96)
|
if (pr_sblur() > 96)
|
||||||
{
|
{
|
||||||
self->SetState (self->SeeState);
|
self->SetState (self->SeeState);
|
||||||
|
@ -197,7 +197,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopPuff)
|
||||||
mo = Spawn ("BishopPuff", self->PosPlusZ(40*FRACUNIT), ALLOW_REPLACE);
|
mo = Spawn ("BishopPuff", self->PosPlusZ(40*FRACUNIT), ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velz = FRACUNIT/2;
|
mo->vel.z = FRACUNIT/2;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,8 +35,8 @@ void BlastActor (AActor *victim, fixed_t strength, fixed_t speed, AActor *Owner,
|
||||||
|
|
||||||
angle = Owner->AngleTo(victim);
|
angle = Owner->AngleTo(victim);
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
victim->velx = FixedMul (speed, finecosine[angle]);
|
victim->vel.x = FixedMul (speed, finecosine[angle]);
|
||||||
victim->vely = FixedMul (speed, finesine[angle]);
|
victim->vel.y = FixedMul (speed, finesine[angle]);
|
||||||
|
|
||||||
// Spawn blast puff
|
// Spawn blast puff
|
||||||
ang = victim->AngleTo(Owner);
|
ang = victim->AngleTo(Owner);
|
||||||
|
@ -48,21 +48,21 @@ void BlastActor (AActor *victim, fixed_t strength, fixed_t speed, AActor *Owner,
|
||||||
mo = Spawn (blasteffect, pos, ALLOW_REPLACE);
|
mo = Spawn (blasteffect, pos, ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velx = victim->velx;
|
mo->vel.x = victim->vel.x;
|
||||||
mo->vely = victim->vely;
|
mo->vel.y = victim->vel.y;
|
||||||
}
|
}
|
||||||
if (victim->flags & MF_MISSILE)
|
if (victim->flags & MF_MISSILE)
|
||||||
{
|
{
|
||||||
// [RH] Floor and ceiling huggers should not be blasted vertically.
|
// [RH] Floor and ceiling huggers should not be blasted vertically.
|
||||||
if (!(victim->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
if (!(victim->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
||||||
{
|
{
|
||||||
victim->velz = 8*FRACUNIT;
|
victim->vel.z = 8*FRACUNIT;
|
||||||
mo->velz = victim->velz;
|
mo->vel.z = victim->vel.z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
victim->velz = (1000 / victim->Mass) << FRACBITS;
|
victim->vel.z = (1000 / victim->Mass) << FRACBITS;
|
||||||
}
|
}
|
||||||
if (victim->player)
|
if (victim->player)
|
||||||
{
|
{
|
||||||
|
@ -99,9 +99,9 @@ DEFINE_ACTION_FUNCTION_PARAMS (AActor, A_Blast)
|
||||||
{
|
{
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
PARAM_INT_OPT (blastflags) { blastflags = 0; }
|
PARAM_INT_OPT (blastflags) { blastflags = 0; }
|
||||||
PARAM_INT_OPT (strength) { strength = 255; }
|
PARAM_FIXED_OPT (strength) { strength = 255*FRACUNIT; }
|
||||||
PARAM_FIXED_OPT (radius) { radius = 255*FRACUNIT; }
|
PARAM_FIXED_OPT (radius) { radius = 255*FRACUNIT; }
|
||||||
PARAM_FIXED_OPT (speed) { speed = 20; }
|
PARAM_FIXED_OPT (speed) { speed = 20*FRACUNIT; }
|
||||||
PARAM_CLASS_OPT (blasteffect, AActor) { blasteffect = PClass::FindActor("BlastEffect"); }
|
PARAM_CLASS_OPT (blasteffect, AActor) { blasteffect = PClass::FindActor("BlastEffect"); }
|
||||||
PARAM_SOUND_OPT (blastsound) { blastsound = "BlastRadius"; }
|
PARAM_SOUND_OPT (blastsound) { blastsound = "BlastRadius"; }
|
||||||
|
|
||||||
|
|
|
@ -99,9 +99,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlamePuff)
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
self->renderflags &= ~RF_INVISIBLE;
|
self->renderflags &= ~RF_INVISIBLE;
|
||||||
self->velx = 0;
|
self->vel.x = 0;
|
||||||
self->vely = 0;
|
self->vel.y = 0;
|
||||||
self->velz = 0;
|
self->vel.z = 0;
|
||||||
S_Sound (self, CHAN_BODY, "ClericFlameExplode", 1, ATTN_NORM);
|
S_Sound (self, CHAN_BODY, "ClericFlameExplode", 1, ATTN_NORM);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -139,8 +139,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile)
|
||||||
{
|
{
|
||||||
mo->angle = an<<ANGLETOFINESHIFT;
|
mo->angle = an<<ANGLETOFINESHIFT;
|
||||||
mo->target = self->target;
|
mo->target = self->target;
|
||||||
mo->velx = mo->special1 = FixedMul(FLAMESPEED, finecosine[an]);
|
mo->vel.x = mo->special1 = FixedMul(FLAMESPEED, finecosine[an]);
|
||||||
mo->vely = mo->special2 = FixedMul(FLAMESPEED, finesine[an]);
|
mo->vel.y = mo->special2 = FixedMul(FLAMESPEED, finesine[an]);
|
||||||
mo->tics -= pr_missile()&3;
|
mo->tics -= pr_missile()&3;
|
||||||
}
|
}
|
||||||
mo = Spawn ("CircleFlame", BlockingMobj->Vec3Offset(
|
mo = Spawn ("CircleFlame", BlockingMobj->Vec3Offset(
|
||||||
|
@ -151,8 +151,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile)
|
||||||
{
|
{
|
||||||
mo->angle = ANG180+(an<<ANGLETOFINESHIFT);
|
mo->angle = ANG180+(an<<ANGLETOFINESHIFT);
|
||||||
mo->target = self->target;
|
mo->target = self->target;
|
||||||
mo->velx = mo->special1 = FixedMul(-FLAMESPEED, finecosine[an]);
|
mo->vel.x = mo->special1 = FixedMul(-FLAMESPEED, finecosine[an]);
|
||||||
mo->vely = mo->special2 = FixedMul(-FLAMESPEED, finesine[an]);
|
mo->vel.y = mo->special2 = FixedMul(-FLAMESPEED, finesine[an]);
|
||||||
mo->tics -= pr_missile()&3;
|
mo->tics -= pr_missile()&3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,8 +174,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameRotate)
|
||||||
int an;
|
int an;
|
||||||
|
|
||||||
an = (self->angle+ANG90)>>ANGLETOFINESHIFT;
|
an = (self->angle+ANG90)>>ANGLETOFINESHIFT;
|
||||||
self->velx = self->special1+FixedMul(FLAMEROTSPEED, finecosine[an]);
|
self->vel.x = self->special1+FixedMul(FLAMEROTSPEED, finecosine[an]);
|
||||||
self->vely = self->special2+FixedMul(FLAMEROTSPEED, finesine[an]);
|
self->vel.y = self->special2+FixedMul(FLAMEROTSPEED, finesine[an]);
|
||||||
self->angle += ANG90/15;
|
self->angle += ANG90/15;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -419,8 +419,8 @@ static void CHolySeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax)
|
||||||
actor->angle -= delta;
|
actor->angle -= delta;
|
||||||
}
|
}
|
||||||
angle = actor->angle>>ANGLETOFINESHIFT;
|
angle = actor->angle>>ANGLETOFINESHIFT;
|
||||||
actor->velx = FixedMul (actor->Speed, finecosine[angle]);
|
actor->vel.x = FixedMul (actor->Speed, finecosine[angle]);
|
||||||
actor->vely = FixedMul (actor->Speed, finesine[angle]);
|
actor->vel.y = FixedMul (actor->Speed, finesine[angle]);
|
||||||
if (!(level.time&15)
|
if (!(level.time&15)
|
||||||
|| actor->Z() > target->Top()
|
|| actor->Z() > target->Top()
|
||||||
|| actor->Top() < target->Z())
|
|| actor->Top() < target->Z())
|
||||||
|
@ -444,7 +444,7 @@ static void CHolySeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax)
|
||||||
{
|
{
|
||||||
dist = 1;
|
dist = 1;
|
||||||
}
|
}
|
||||||
actor->velz = deltaZ / dist;
|
actor->vel.z = deltaZ / dist;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -491,9 +491,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolySeek)
|
||||||
self->health--;
|
self->health--;
|
||||||
if (self->health <= 0)
|
if (self->health <= 0)
|
||||||
{
|
{
|
||||||
self->velx >>= 2;
|
self->vel.x >>= 2;
|
||||||
self->vely >>= 2;
|
self->vel.y >>= 2;
|
||||||
self->velz = 0;
|
self->vel.z = 0;
|
||||||
self->SetState (self->FindState(NAME_Death));
|
self->SetState (self->FindState(NAME_Death));
|
||||||
self->tics -= pr_holyseek()&3;
|
self->tics -= pr_holyseek()&3;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -57,8 +57,8 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
|
||||||
actor->angle -= delta;
|
actor->angle -= delta;
|
||||||
}
|
}
|
||||||
angle = actor->angle>>ANGLETOFINESHIFT;
|
angle = actor->angle>>ANGLETOFINESHIFT;
|
||||||
actor->velx = FixedMul (actor->Speed, finecosine[angle]);
|
actor->vel.x = FixedMul (actor->Speed, finecosine[angle]);
|
||||||
actor->vely = FixedMul (actor->Speed, finesine[angle]);
|
actor->vel.y = FixedMul (actor->Speed, finesine[angle]);
|
||||||
dist = actor->AproxDistance (target) / actor->Speed;
|
dist = actor->AproxDistance (target) / actor->Speed;
|
||||||
if (actor->Top() < target->Z() ||
|
if (actor->Top() < target->Z() ||
|
||||||
target->Top() < actor->Z())
|
target->Top() < actor->Z())
|
||||||
|
@ -67,7 +67,7 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
|
||||||
{
|
{
|
||||||
dist = 1;
|
dist = 1;
|
||||||
}
|
}
|
||||||
actor->velz = (target->Z() - actor->Z())/dist;
|
actor->vel.z = (target->Z() - actor->Z())/dist;
|
||||||
}
|
}
|
||||||
if (target->flags&MF_SHOOTABLE && pr_dragonseek() < 64)
|
if (target->flags&MF_SHOOTABLE && pr_dragonseek() < 64)
|
||||||
{ // attack the destination mobj if it's attackable
|
{ // attack the destination mobj if it's attackable
|
||||||
|
|
|
@ -39,9 +39,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DropWeaponPieces)
|
||||||
AActor *piece = Spawn (cls, self->Pos(), ALLOW_REPLACE);
|
AActor *piece = Spawn (cls, self->Pos(), ALLOW_REPLACE);
|
||||||
if (piece != NULL)
|
if (piece != NULL)
|
||||||
{
|
{
|
||||||
piece->velx = self->velx + finecosine[fineang];
|
piece->vel.x = self->vel.x + finecosine[fineang];
|
||||||
piece->vely = self->vely + finesine[fineang];
|
piece->vel.y = self->vel.y + finesine[fineang];
|
||||||
piece->velz = self->velz;
|
piece->vel.z = self->vel.z;
|
||||||
piece->flags |= MF_DROPPED;
|
piece->flags |= MF_DROPPED;
|
||||||
fineang += FINEANGLES/3;
|
fineang += FINEANGLES/3;
|
||||||
j = (j == 0) ? (pr_quietusdrop() & 1) + 1 : 3-j;
|
j = (j == 0) ? (pr_quietusdrop() & 1) + 1 : 3-j;
|
||||||
|
|
|
@ -61,9 +61,9 @@ void A_FiredSpawnRock (AActor *actor)
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->target = actor;
|
mo->target = actor;
|
||||||
mo->velx = (pr_firedemonrock() - 128) <<10;
|
mo->vel.x = (pr_firedemonrock() - 128) <<10;
|
||||||
mo->vely = (pr_firedemonrock() - 128) <<10;
|
mo->vel.y = (pr_firedemonrock() - 128) <<10;
|
||||||
mo->velz = (pr_firedemonrock() << 10);
|
mo->vel.z = (pr_firedemonrock() << 10);
|
||||||
mo->special1 = 2; // Number bounces
|
mo->special1 = 2; // Number bounces
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,9 +102,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SmBounce)
|
||||||
|
|
||||||
// give some more velocity (x,y,&z)
|
// give some more velocity (x,y,&z)
|
||||||
self->SetZ(self->floorz + FRACUNIT);
|
self->SetZ(self->floorz + FRACUNIT);
|
||||||
self->velz = (2*FRACUNIT) + (pr_smbounce() << 10);
|
self->vel.z = (2*FRACUNIT) + (pr_smbounce() << 10);
|
||||||
self->velx = pr_smbounce()%3<<FRACBITS;
|
self->vel.x = pr_smbounce()%3<<FRACBITS;
|
||||||
self->vely = pr_smbounce()%3<<FRACBITS;
|
self->vel.y = pr_smbounce()%3<<FRACBITS;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredChase)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
self->special2 = 0;
|
self->special2 = 0;
|
||||||
self->velx = self->vely = 0;
|
self->vel.x = self->vel.y = 0;
|
||||||
dist = self->AproxDistance (target);
|
dist = self->AproxDistance (target);
|
||||||
if (dist < FIREDEMON_ATTACK_RANGE)
|
if (dist < FIREDEMON_ATTACK_RANGE)
|
||||||
{
|
{
|
||||||
|
@ -179,8 +179,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredChase)
|
||||||
else
|
else
|
||||||
ang -= ANGLE_90;
|
ang -= ANGLE_90;
|
||||||
ang >>= ANGLETOFINESHIFT;
|
ang >>= ANGLETOFINESHIFT;
|
||||||
self->velx = finecosine[ang] << 3; //FixedMul (8*FRACUNIT, finecosine[ang]);
|
self->vel.x = finecosine[ang] << 3; //FixedMul (8*FRACUNIT, finecosine[ang]);
|
||||||
self->vely = finesine[ang] << 3; //FixedMul (8*FRACUNIT, finesine[ang]);
|
self->vel.y = finesine[ang] << 3; //FixedMul (8*FRACUNIT, finesine[ang]);
|
||||||
self->special2 = 3; // strafe time
|
self->special2 = 3; // strafe time
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -235,16 +235,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_FiredSplotch)
|
||||||
mo = Spawn ("FireDemonSplotch1", self->Pos(), ALLOW_REPLACE);
|
mo = Spawn ("FireDemonSplotch1", self->Pos(), ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velx = (pr_firedemonsplotch() - 128) << 11;
|
mo->vel.x = (pr_firedemonsplotch() - 128) << 11;
|
||||||
mo->vely = (pr_firedemonsplotch() - 128) << 11;
|
mo->vel.y = (pr_firedemonsplotch() - 128) << 11;
|
||||||
mo->velz = (pr_firedemonsplotch() << 10) + FRACUNIT*3;
|
mo->vel.z = (pr_firedemonsplotch() << 10) + FRACUNIT*3;
|
||||||
}
|
}
|
||||||
mo = Spawn ("FireDemonSplotch2", self->Pos(), ALLOW_REPLACE);
|
mo = Spawn ("FireDemonSplotch2", self->Pos(), ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velx = (pr_firedemonsplotch() - 128) << 11;
|
mo->vel.x = (pr_firedemonsplotch() - 128) << 11;
|
||||||
mo->vely = (pr_firedemonsplotch() - 128) << 11;
|
mo->vel.y = (pr_firedemonsplotch() - 128) << 11;
|
||||||
mo->velz = (pr_firedemonsplotch() << 10) + FRACUNIT*3;
|
mo->vel.z = (pr_firedemonsplotch() << 10) + FRACUNIT*3;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,9 +120,9 @@ bool AArtiPoisonBag3::Use (bool pickup)
|
||||||
fixed_t speed = fixed_t(sqrt((double)mo->Speed*mo->Speed + (4.0*65536*4*65536)));
|
fixed_t speed = fixed_t(sqrt((double)mo->Speed*mo->Speed + (4.0*65536*4*65536)));
|
||||||
fixed_t xyscale = FixedMul(speed, finecosine[modpitch]);
|
fixed_t xyscale = FixedMul(speed, finecosine[modpitch]);
|
||||||
|
|
||||||
mo->velz = FixedMul(speed, finesine[modpitch]);
|
mo->vel.z = FixedMul(speed, finesine[modpitch]);
|
||||||
mo->velx = FixedMul(xyscale, finecosine[angle]) + (Owner->velx >> 1);
|
mo->vel.x = FixedMul(xyscale, finecosine[angle]) + (Owner->vel.x >> 1);
|
||||||
mo->vely = FixedMul(xyscale, finesine[angle]) + (Owner->vely >> 1);
|
mo->vel.y = FixedMul(xyscale, finesine[angle]) + (Owner->vel.y >> 1);
|
||||||
mo->AddZ(FixedMul(mo->Speed, finesine[orgpitch]));
|
mo->AddZ(FixedMul(mo->Speed, finesine[orgpitch]));
|
||||||
|
|
||||||
mo->target = Owner;
|
mo->target = Owner;
|
||||||
|
@ -306,7 +306,7 @@ IMPLEMENT_CLASS (APoisonCloud)
|
||||||
|
|
||||||
void APoisonCloud::BeginPlay ()
|
void APoisonCloud::BeginPlay ()
|
||||||
{
|
{
|
||||||
velx = 1; // missile objects must move to impact other objects
|
vel.x = 1; // missile objects must move to impact other objects
|
||||||
special1 = 24+(pr_poisoncloud()&7);
|
special1 = 24+(pr_poisoncloud()&7);
|
||||||
special2 = 0;
|
special2 = 0;
|
||||||
}
|
}
|
||||||
|
@ -451,16 +451,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckThrowBomb2)
|
||||||
{
|
{
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
// [RH] Check using actual velocity, although the velz < 2 check still stands
|
// [RH] Check using actual velocity, although the vel.z < 2 check still stands
|
||||||
//if (abs(self->velx) < FRACUNIT*3/2 && abs(self->vely) < FRACUNIT*3/2
|
//if (abs(self->vel.x) < FRACUNIT*3/2 && abs(self->vel.y) < FRACUNIT*3/2
|
||||||
// && self->velz < 2*FRACUNIT)
|
// && self->vel.z < 2*FRACUNIT)
|
||||||
if (self->velz < 2*FRACUNIT &&
|
if (self->vel.z < 2*FRACUNIT &&
|
||||||
TMulScale32 (self->velx, self->velx, self->vely, self->vely, self->velz, self->velz)
|
TMulScale32 (self->vel.x, self->vel.x, self->vel.y, self->vel.y, self->vel.z, self->vel.z)
|
||||||
< (3*3)/(2*2))
|
< (3*3)/(2*2))
|
||||||
{
|
{
|
||||||
self->SetState (self->SpawnState + 6);
|
self->SetState (self->SpawnState + 6);
|
||||||
self->SetZ(self->floorz);
|
self->SetZ(self->floorz);
|
||||||
self->velz = 0;
|
self->vel.z = 0;
|
||||||
self->BounceFlags = BOUNCE_None;
|
self->BounceFlags = BOUNCE_None;
|
||||||
self->flags &= ~MF_MISSILE;
|
self->flags &= ~MF_MISSILE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,15 +95,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_FlyBuzz)
|
||||||
}
|
}
|
||||||
if (self->args[0] & 2)
|
if (self->args[0] & 2)
|
||||||
{
|
{
|
||||||
self->velx += (pr_fly() - 128) << BOBTOFINESHIFT;
|
self->vel.x += (pr_fly() - 128) << BOBTOFINESHIFT;
|
||||||
self->vely += (pr_fly() - 128) << BOBTOFINESHIFT;
|
self->vel.y += (pr_fly() - 128) << BOBTOFINESHIFT;
|
||||||
}
|
}
|
||||||
int zrand = pr_fly();
|
int zrand = pr_fly();
|
||||||
if (targ->Z() + 5*FRACUNIT < self->Z() && zrand > 150)
|
if (targ->Z() + 5*FRACUNIT < self->Z() && zrand > 150)
|
||||||
{
|
{
|
||||||
zrand = -zrand;
|
zrand = -zrand;
|
||||||
}
|
}
|
||||||
self->velz = zrand << BOBTOFINESHIFT;
|
self->vel.z = zrand << BOBTOFINESHIFT;
|
||||||
if (pr_fly() < 40)
|
if (pr_fly() < 40)
|
||||||
{
|
{
|
||||||
S_Sound(self, CHAN_VOICE, self->ActiveSound, 0.5f, ATTN_STATIC);
|
S_Sound(self, CHAN_VOICE, self->ActiveSound, 0.5f, ATTN_STATIC);
|
||||||
|
|
|
@ -95,8 +95,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FogMove)
|
||||||
}
|
}
|
||||||
|
|
||||||
angle = self->angle>>ANGLETOFINESHIFT;
|
angle = self->angle>>ANGLETOFINESHIFT;
|
||||||
self->velx = FixedMul(speed, finecosine[angle]);
|
self->vel.x = FixedMul(speed, finecosine[angle]);
|
||||||
self->vely = FixedMul(speed, finesine[angle]);
|
self->vel.y = FixedMul(speed, finesine[angle]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,11 +176,11 @@ class ASorcFX1 : public AActor
|
||||||
public:
|
public:
|
||||||
bool FloorBounceMissile (secplane_t &plane)
|
bool FloorBounceMissile (secplane_t &plane)
|
||||||
{
|
{
|
||||||
fixed_t orgvelz = velz;
|
fixed_t orgvelz = vel.z;
|
||||||
|
|
||||||
if (!Super::FloorBounceMissile (plane))
|
if (!Super::FloorBounceMissile (plane))
|
||||||
{
|
{
|
||||||
velz = -orgvelz; // no energy absorbed
|
vel.z = -orgvelz; // no energy absorbed
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -677,7 +677,7 @@ void A_SorcOffense2(AActor *actor)
|
||||||
mo->special2 = 35*5/2; // 5 seconds
|
mo->special2 = 35*5/2; // 5 seconds
|
||||||
dist = mo->AproxDistance(dest) / mo->Speed;
|
dist = mo->AproxDistance(dest) / mo->Speed;
|
||||||
if(dist < 1) dist = 1;
|
if(dist < 1) dist = 1;
|
||||||
mo->velz = (dest->Z() - mo->Z()) / dist;
|
mo->vel.z = (dest->Z() - mo->Z()) / dist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -722,9 +722,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnFizzle)
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
rangle = (self->angle >> ANGLETOFINESHIFT) + ((pr_heresiarch()%5) << 1);
|
rangle = (self->angle >> ANGLETOFINESHIFT) + ((pr_heresiarch()%5) << 1);
|
||||||
mo->velx = FixedMul(pr_heresiarch()%speed, finecosine[rangle]);
|
mo->vel.x = FixedMul(pr_heresiarch()%speed, finecosine[rangle]);
|
||||||
mo->vely = FixedMul(pr_heresiarch()%speed, finesine[rangle]);
|
mo->vel.y = FixedMul(pr_heresiarch()%speed, finesine[rangle]);
|
||||||
mo->velz = FRACUNIT*2;
|
mo->vel.z = FRACUNIT*2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -944,9 +944,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallPop)
|
||||||
S_Sound (self, CHAN_BODY, "SorcererBallPop", 1, ATTN_NONE);
|
S_Sound (self, CHAN_BODY, "SorcererBallPop", 1, ATTN_NONE);
|
||||||
self->flags &= ~MF_NOGRAVITY;
|
self->flags &= ~MF_NOGRAVITY;
|
||||||
self->gravity = FRACUNIT/8;
|
self->gravity = FRACUNIT/8;
|
||||||
self->velx = ((pr_heresiarch()%10)-5) << FRACBITS;
|
self->vel.x = ((pr_heresiarch()%10)-5) << FRACBITS;
|
||||||
self->vely = ((pr_heresiarch()%10)-5) << FRACBITS;
|
self->vel.y = ((pr_heresiarch()%10)-5) << FRACBITS;
|
||||||
self->velz = (2+(pr_heresiarch()%3)) << FRACBITS;
|
self->vel.z = (2+(pr_heresiarch()%3)) << FRACBITS;
|
||||||
self->special2 = 4*FRACUNIT; // Initial bounce factor
|
self->special2 = 4*FRACUNIT; // Initial bounce factor
|
||||||
self->args[4] = BOUNCE_TIME_UNIT; // Bounce time unit
|
self->args[4] = BOUNCE_TIME_UNIT; // Bounce time unit
|
||||||
self->args[3] = 5; // Bounce time in seconds
|
self->args[3] = 5; // Bounce time in seconds
|
||||||
|
|
|
@ -66,9 +66,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_PotteryExplode)
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->SetState (mo->SpawnState + (pr_pottery()%5));
|
mo->SetState (mo->SpawnState + (pr_pottery()%5));
|
||||||
mo->velz = ((pr_pottery()&7)+5)*(3*FRACUNIT/4);
|
mo->vel.z = ((pr_pottery()&7)+5)*(3*FRACUNIT/4);
|
||||||
mo->velx = (pr_pottery.Random2())<<(FRACBITS-6);
|
mo->vel.x = (pr_pottery.Random2())<<(FRACBITS-6);
|
||||||
mo->vely = (pr_pottery.Random2())<<(FRACBITS-6);
|
mo->vel.y = (pr_pottery.Random2())<<(FRACBITS-6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
S_Sound (mo, CHAN_BODY, "PotteryExplode", 1, ATTN_NORM);
|
S_Sound (mo, CHAN_BODY, "PotteryExplode", 1, ATTN_NORM);
|
||||||
|
@ -180,9 +180,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseExplode)
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->SetState (mo->SpawnState + (pr_foo()%3));
|
mo->SetState (mo->SpawnState + (pr_foo()%3));
|
||||||
mo->velz = ((pr_foo()&7)+5)*(3*FRACUNIT/4);
|
mo->vel.z = ((pr_foo()&7)+5)*(3*FRACUNIT/4);
|
||||||
mo->velx = pr_foo.Random2()<<(FRACBITS-6);
|
mo->vel.x = pr_foo.Random2()<<(FRACBITS-6);
|
||||||
mo->vely = pr_foo.Random2()<<(FRACBITS-6);
|
mo->vel.y = pr_foo.Random2()<<(FRACBITS-6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Spawn a skull
|
// Spawn a skull
|
||||||
|
@ -190,9 +190,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_CorpseExplode)
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->SetState (mo->SpawnState + 3);
|
mo->SetState (mo->SpawnState + 3);
|
||||||
mo->velz = ((pr_foo()&7)+5)*(3*FRACUNIT/4);
|
mo->vel.z = ((pr_foo()&7)+5)*(3*FRACUNIT/4);
|
||||||
mo->velx = pr_foo.Random2()<<(FRACBITS-6);
|
mo->vel.x = pr_foo.Random2()<<(FRACBITS-6);
|
||||||
mo->vely = pr_foo.Random2()<<(FRACBITS-6);
|
mo->vel.y = pr_foo.Random2()<<(FRACBITS-6);
|
||||||
}
|
}
|
||||||
S_Sound (self, CHAN_BODY, self->DeathSound, 1, ATTN_IDLE);
|
S_Sound (self, CHAN_BODY, self->DeathSound, 1, ATTN_IDLE);
|
||||||
self->Destroy ();
|
self->Destroy ();
|
||||||
|
@ -242,7 +242,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafThrust)
|
||||||
|
|
||||||
if (pr_leafthrust() <= 96)
|
if (pr_leafthrust() <= 96)
|
||||||
{
|
{
|
||||||
self->velz += (pr_leafthrust()<<9)+FRACUNIT;
|
self->vel.z += (pr_leafthrust()<<9)+FRACUNIT;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -266,14 +266,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafCheck)
|
||||||
angle_t ang = self->target ? self->target->angle : self->angle;
|
angle_t ang = self->target ? self->target->angle : self->angle;
|
||||||
if (pr_leafcheck() > 64)
|
if (pr_leafcheck() > 64)
|
||||||
{
|
{
|
||||||
if (!self->velx && !self->vely)
|
if (!self->vel.x && !self->vel.y)
|
||||||
{
|
{
|
||||||
P_ThrustMobj (self, ang, (pr_leafcheck()<<9)+FRACUNIT);
|
P_ThrustMobj (self, ang, (pr_leafcheck()<<9)+FRACUNIT);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
self->SetState (self->SpawnState + 7);
|
self->SetState (self->SpawnState + 7);
|
||||||
self->velz = (pr_leafcheck()<<9)+FRACUNIT;
|
self->vel.z = (pr_leafcheck()<<9)+FRACUNIT;
|
||||||
P_ThrustMobj (self, ang, (pr_leafcheck()<<9)+2*FRACUNIT);
|
P_ThrustMobj (self, ang, (pr_leafcheck()<<9)+2*FRACUNIT);
|
||||||
self->flags |= MF_MISSILE;
|
self->flags |= MF_MISSILE;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -315,9 +315,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SoAExplode)
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->SetState (mo->SpawnState + i);
|
mo->SetState (mo->SpawnState + i);
|
||||||
mo->velz = ((pr_soaexplode()&7)+5)*FRACUNIT;
|
mo->vel.z = ((pr_soaexplode()&7)+5)*FRACUNIT;
|
||||||
mo->velx = pr_soaexplode.Random2()<<(FRACBITS-6);
|
mo->vel.x = pr_soaexplode.Random2()<<(FRACBITS-6);
|
||||||
mo->vely = pr_soaexplode.Random2()<<(FRACBITS-6);
|
mo->vel.y = pr_soaexplode.Random2()<<(FRACBITS-6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Spawn an item?
|
// Spawn an item?
|
||||||
|
|
|
@ -71,9 +71,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyChase)
|
||||||
60 * FRACUNIT), ALLOW_REPLACE);
|
60 * FRACUNIT), ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velx = self->velx;
|
mo->vel.x = self->vel.x;
|
||||||
mo->vely = self->vely;
|
mo->vel.y = self->vel.y;
|
||||||
mo->velz = self->velz;
|
mo->vel.z = self->vel.z;
|
||||||
mo->target = self;
|
mo->target = self;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,9 +110,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyDie)
|
||||||
{
|
{
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
self->velx = 0;
|
self->vel.x = 0;
|
||||||
self->vely = 0;
|
self->vel.y = 0;
|
||||||
self->velz = 0;
|
self->vel.z = 0;
|
||||||
self->height = self->GetDefault()->height;
|
self->height = self->GetDefault()->height;
|
||||||
CALL_ACTION(A_FreezeDeathChunks, self);
|
CALL_ACTION(A_FreezeDeathChunks, self);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -387,8 +387,8 @@ void A_KSpiritSeeker (AActor *actor, angle_t thresh, angle_t turnMax)
|
||||||
actor->angle -= delta;
|
actor->angle -= delta;
|
||||||
}
|
}
|
||||||
angle = actor->angle>>ANGLETOFINESHIFT;
|
angle = actor->angle>>ANGLETOFINESHIFT;
|
||||||
actor->velx = FixedMul (actor->Speed, finecosine[angle]);
|
actor->vel.x = FixedMul (actor->Speed, finecosine[angle]);
|
||||||
actor->vely = FixedMul (actor->Speed, finesine[angle]);
|
actor->vel.y = FixedMul (actor->Speed, finesine[angle]);
|
||||||
|
|
||||||
if (!(level.time&15)
|
if (!(level.time&15)
|
||||||
|| actor->Z() > target->Z()+(target->GetDefault()->height)
|
|| actor->Z() > target->Z()+(target->GetDefault()->height)
|
||||||
|
@ -412,7 +412,7 @@ void A_KSpiritSeeker (AActor *actor, angle_t thresh, angle_t turnMax)
|
||||||
{
|
{
|
||||||
dist = 1;
|
dist = 1;
|
||||||
}
|
}
|
||||||
actor->velz = deltaZ/dist;
|
actor->vel.z = deltaZ/dist;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -520,13 +520,13 @@ AActor *P_SpawnKoraxMissile (fixed_t x, fixed_t y, fixed_t z,
|
||||||
}
|
}
|
||||||
th->angle = an;
|
th->angle = an;
|
||||||
an >>= ANGLETOFINESHIFT;
|
an >>= ANGLETOFINESHIFT;
|
||||||
th->velx = FixedMul (th->Speed, finecosine[an]);
|
th->vel.x = FixedMul (th->Speed, finecosine[an]);
|
||||||
th->vely = FixedMul (th->Speed, finesine[an]);
|
th->vel.y = FixedMul (th->Speed, finesine[an]);
|
||||||
dist = dest->AproxDistance (th) / th->Speed;
|
dist = dest->AproxDistance (th) / th->Speed;
|
||||||
if (dist < 1)
|
if (dist < 1)
|
||||||
{
|
{
|
||||||
dist = 1;
|
dist = 1;
|
||||||
}
|
}
|
||||||
th->velz = (dest->Z()-z+(30*FRACUNIT))/dist;
|
th->vel.z = (dest->Z()-z+(30*FRACUNIT))/dist;
|
||||||
return (P_CheckMissileSpawn(th, source->radius) ? th : NULL);
|
return (P_CheckMissileSpawn(th, source->radius) ? th : NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,7 +134,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
|
||||||
{
|
{
|
||||||
mo->special1 = SHARDSPAWN_LEFT;
|
mo->special1 = SHARDSPAWN_LEFT;
|
||||||
mo->special2 = spermcount;
|
mo->special2 = spermcount;
|
||||||
mo->velz = self->velz;
|
mo->vel.z = self->vel.z;
|
||||||
mo->args[0] = (spermcount==3)?2:0;
|
mo->args[0] = (spermcount==3)?2:0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,7 +146,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
|
||||||
{
|
{
|
||||||
mo->special1 = SHARDSPAWN_RIGHT;
|
mo->special1 = SHARDSPAWN_RIGHT;
|
||||||
mo->special2 = spermcount;
|
mo->special2 = spermcount;
|
||||||
mo->velz = self->velz;
|
mo->vel.z = self->vel.z;
|
||||||
mo->args[0] = (spermcount==3)?2:0;
|
mo->args[0] = (spermcount==3)?2:0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,7 +156,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
|
||||||
0, (15+2*spermcount)<<FRACBITS, self->target);
|
0, (15+2*spermcount)<<FRACBITS, self->target);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velz = self->velz;
|
mo->vel.z = self->vel.z;
|
||||||
if (spermcount & 1) // Every other reproduction
|
if (spermcount & 1) // Every other reproduction
|
||||||
mo->special1 = SHARDSPAWN_UP | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT;
|
mo->special1 = SHARDSPAWN_UP | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT;
|
||||||
else
|
else
|
||||||
|
@ -171,7 +171,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
|
||||||
0, (15+2*spermcount)<<FRACBITS, self->target);
|
0, (15+2*spermcount)<<FRACBITS, self->target);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velz = self->velz;
|
mo->vel.z = self->vel.z;
|
||||||
if (spermcount & 1) // Every other reproduction
|
if (spermcount & 1) // Every other reproduction
|
||||||
mo->special1 = SHARDSPAWN_DOWN | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT;
|
mo->special1 = SHARDSPAWN_DOWN | SHARDSPAWN_LEFT | SHARDSPAWN_RIGHT;
|
||||||
else
|
else
|
||||||
|
|
|
@ -42,8 +42,8 @@ int ALightning::SpecialMissileHit (AActor *thing)
|
||||||
{
|
{
|
||||||
if (thing->Mass != INT_MAX)
|
if (thing->Mass != INT_MAX)
|
||||||
{
|
{
|
||||||
thing->velx += velx>>4;
|
thing->vel.x += vel.x>>4;
|
||||||
thing->vely += vely>>4;
|
thing->vel.y += vel.y>>4;
|
||||||
}
|
}
|
||||||
if ((!thing->player && !(thing->flags2&MF2_BOSS))
|
if ((!thing->player && !(thing->flags2&MF2_BOSS))
|
||||||
|| !(level.time&1))
|
|| !(level.time&1))
|
||||||
|
@ -196,8 +196,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
self->angle = self->AngleTo(target);
|
self->angle = self->AngleTo(target);
|
||||||
self->velx = 0;
|
self->vel.x = 0;
|
||||||
self->vely = 0;
|
self->vel.y = 0;
|
||||||
P_ThrustMobj (self, self->angle, self->Speed>>1);
|
P_ThrustMobj (self, self->angle, self->Speed>>1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -247,16 +247,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningZap)
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->lastenemy = self;
|
mo->lastenemy = self;
|
||||||
mo->velx = self->velx;
|
mo->vel.x = self->vel.x;
|
||||||
mo->vely = self->vely;
|
mo->vel.y = self->vel.y;
|
||||||
mo->target = self->target;
|
mo->target = self->target;
|
||||||
if (self->flags3 & MF3_FLOORHUGGER)
|
if (self->flags3 & MF3_FLOORHUGGER)
|
||||||
{
|
{
|
||||||
mo->velz = 20*FRACUNIT;
|
mo->vel.z = 20*FRACUNIT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mo->velz = -20*FRACUNIT;
|
mo->vel.z = -20*FRACUNIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((self->flags3 & MF3_FLOORHUGGER) && pr_zapf() < 160)
|
if ((self->flags3 & MF3_FLOORHUGGER) && pr_zapf() < 160)
|
||||||
|
@ -328,8 +328,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_ZapMimic)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
self->velx = mo->velx;
|
self->vel.x = mo->vel.x;
|
||||||
self->vely = mo->vely;
|
self->vel.y = mo->vel.y;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -356,7 +356,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LastZap)
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->SetState (mo->FindState (NAME_Death));
|
mo->SetState (mo->FindState (NAME_Death));
|
||||||
mo->velz = 40*FRACUNIT;
|
mo->vel.z = 40*FRACUNIT;
|
||||||
mo->Damage = NULL;
|
mo->Damage = NULL;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -35,7 +35,7 @@ void APigPlayer::MorphPlayerThink ()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!(velx | vely) && pr_pigplayerthink() < 64)
|
if(!(vel.x | vel.y) && pr_pigplayerthink() < 64)
|
||||||
{ // Snout sniff
|
{ // Snout sniff
|
||||||
if (player->ReadyWeapon != NULL)
|
if (player->ReadyWeapon != NULL)
|
||||||
{
|
{
|
||||||
|
@ -101,7 +101,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PigPain)
|
||||||
CALL_ACTION(A_Pain, self);
|
CALL_ACTION(A_Pain, self);
|
||||||
if (self->Z() <= self->floorz)
|
if (self->Z() <= self->floorz)
|
||||||
{
|
{
|
||||||
self->velz = FRACUNIT*7/2;
|
self->vel.z = FRACUNIT*7/2;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,8 +236,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SerpentSpawnGibs)
|
||||||
self->floorz+FRACUNIT, ALLOW_REPLACE);
|
self->floorz+FRACUNIT, ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velx = (pr_serpentgibs()-128)<<6;
|
mo->vel.x = (pr_serpentgibs()-128)<<6;
|
||||||
mo->vely = (pr_serpentgibs()-128)<<6;
|
mo->vel.y = (pr_serpentgibs()-128)<<6;
|
||||||
mo->floorclip = 6*FRACUNIT;
|
mo->floorclip = 6*FRACUNIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ bool AArtiDarkServant::Use (bool pickup)
|
||||||
{
|
{
|
||||||
mo->target = Owner;
|
mo->target = Owner;
|
||||||
mo->tracer = Owner;
|
mo->tracer = Owner;
|
||||||
mo->velz = 5*FRACUNIT;
|
mo->vel.z = 5*FRACUNIT;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,9 +57,9 @@ static void TeloSpawn (AActor *source, const char *type)
|
||||||
fx->special1 = TELEPORT_LIFE; // Lifetime countdown
|
fx->special1 = TELEPORT_LIFE; // Lifetime countdown
|
||||||
fx->angle = source->angle;
|
fx->angle = source->angle;
|
||||||
fx->target = source->target;
|
fx->target = source->target;
|
||||||
fx->velx = source->velx >> 1;
|
fx->vel.x = source->vel.x >> 1;
|
||||||
fx->vely = source->vely >> 1;
|
fx->vel.y = source->vel.y >> 1;
|
||||||
fx->velz = source->velz >> 1;
|
fx->vel.z = source->vel.z >> 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -135,10 +135,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithFX2)
|
||||||
{
|
{
|
||||||
angle = self->angle-(pr_wraithfx2()<<22);
|
angle = self->angle-(pr_wraithfx2()<<22);
|
||||||
}
|
}
|
||||||
mo->velz = 0;
|
mo->vel.z = 0;
|
||||||
mo->velx = FixedMul((pr_wraithfx2()<<7)+FRACUNIT,
|
mo->vel.x = FixedMul((pr_wraithfx2()<<7)+FRACUNIT,
|
||||||
finecosine[angle>>ANGLETOFINESHIFT]);
|
finecosine[angle>>ANGLETOFINESHIFT]);
|
||||||
mo->vely = FixedMul((pr_wraithfx2()<<7)+FRACUNIT,
|
mo->vel.y = FixedMul((pr_wraithfx2()<<7)+FRACUNIT,
|
||||||
finesine[angle>>ANGLETOFINESHIFT]);
|
finesine[angle>>ANGLETOFINESHIFT]);
|
||||||
mo->target = self;
|
mo->target = self;
|
||||||
mo->floorclip = 10*FRACUNIT;
|
mo->floorclip = 10*FRACUNIT;
|
||||||
|
|
|
@ -1244,9 +1244,9 @@ void G_FinishTravel ()
|
||||||
pawn->pitch = pawndup->pitch;
|
pawn->pitch = pawndup->pitch;
|
||||||
}
|
}
|
||||||
pawn->SetXYZ(pawndup->X(), pawndup->Y(), pawndup->Z());
|
pawn->SetXYZ(pawndup->X(), pawndup->Y(), pawndup->Z());
|
||||||
pawn->velx = pawndup->velx;
|
pawn->vel.x = pawndup->vel.x;
|
||||||
pawn->vely = pawndup->vely;
|
pawn->vel.y = pawndup->vel.y;
|
||||||
pawn->velz = pawndup->velz;
|
pawn->vel.z = pawndup->vel.z;
|
||||||
pawn->Sector = pawndup->Sector;
|
pawn->Sector = pawndup->Sector;
|
||||||
pawn->floorz = pawndup->floorz;
|
pawn->floorz = pawndup->floorz;
|
||||||
pawn->ceilingz = pawndup->ceilingz;
|
pawn->ceilingz = pawndup->ceilingz;
|
||||||
|
|
|
@ -211,8 +211,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
|
||||||
}
|
}
|
||||||
A_FaceTarget (self);
|
A_FaceTarget (self);
|
||||||
angle = self->angle>>ANGLETOFINESHIFT;
|
angle = self->angle>>ANGLETOFINESHIFT;
|
||||||
self->velx = FixedMul (MNTR_CHARGE_SPEED, finecosine[angle]);
|
self->vel.x = FixedMul (MNTR_CHARGE_SPEED, finecosine[angle]);
|
||||||
self->vely = FixedMul (MNTR_CHARGE_SPEED, finesine[angle]);
|
self->vel.y = FixedMul (MNTR_CHARGE_SPEED, finesine[angle]);
|
||||||
self->special1 = TICRATE/2; // Charge duration
|
self->special1 = TICRATE/2; // Charge duration
|
||||||
}
|
}
|
||||||
else if (target->Z() == target->floorz
|
else if (target->Z() == target->floorz
|
||||||
|
@ -260,7 +260,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurCharge)
|
||||||
type = PClass::FindActor("PunchPuff");
|
type = PClass::FindActor("PunchPuff");
|
||||||
}
|
}
|
||||||
puff = Spawn (type, self->Pos(), ALLOW_REPLACE);
|
puff = Spawn (type, self->Pos(), ALLOW_REPLACE);
|
||||||
puff->velz = 2*FRACUNIT;
|
puff->vel.z = 2*FRACUNIT;
|
||||||
self->special1--;
|
self->special1--;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -286,7 +286,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
|
||||||
|
|
||||||
AActor *mo;
|
AActor *mo;
|
||||||
angle_t angle;
|
angle_t angle;
|
||||||
fixed_t velz;
|
fixed_t vz;
|
||||||
fixed_t z;
|
fixed_t z;
|
||||||
bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
|
bool friendly = !!(self->flags5 & MF5_SUMMONEDMONSTER);
|
||||||
|
|
||||||
|
@ -311,12 +311,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
|
||||||
if (mo != NULL)
|
if (mo != NULL)
|
||||||
{
|
{
|
||||||
// S_Sound (mo, CHAN_WEAPON, "minotaur/attack2", 1, ATTN_NORM);
|
// S_Sound (mo, CHAN_WEAPON, "minotaur/attack2", 1, ATTN_NORM);
|
||||||
velz = mo->velz;
|
vz = mo->vel.z;
|
||||||
angle = mo->angle;
|
angle = mo->angle;
|
||||||
P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/8), velz);
|
P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/8), vz);
|
||||||
P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/8), velz);
|
P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/8), vz);
|
||||||
P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/16), velz);
|
P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/16), vz);
|
||||||
P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/16), velz);
|
P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/16), vz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -398,7 +398,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MntrFloorFire)
|
||||||
(pr_fire.Random2 () << 10));
|
(pr_fire.Random2 () << 10));
|
||||||
mo = Spawn("MinotaurFX3", pos.x, pos.y, self->floorz, ALLOW_REPLACE);
|
mo = Spawn("MinotaurFX3", pos.x, pos.y, self->floorz, ALLOW_REPLACE);
|
||||||
mo->target = self->target;
|
mo->target = self->target;
|
||||||
mo->velx = 1; // Force block checking
|
mo->vel.x = 1; // Force block checking
|
||||||
P_CheckMissileSpawn (mo, self->radius);
|
P_CheckMissileSpawn (mo, self->radius);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -418,8 +418,8 @@ void P_MinotaurSlam (AActor *source, AActor *target)
|
||||||
angle = source->AngleTo(target);
|
angle = source->AngleTo(target);
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
thrust = 16*FRACUNIT+(pr_minotaurslam()<<10);
|
thrust = 16*FRACUNIT+(pr_minotaurslam()<<10);
|
||||||
target->velx += FixedMul (thrust, finecosine[angle]);
|
target->vel.x += FixedMul (thrust, finecosine[angle]);
|
||||||
target->vely += FixedMul (thrust, finesine[angle]);
|
target->vel.y += FixedMul (thrust, finesine[angle]);
|
||||||
damage = pr_minotaurslam.HitDice (static_cast<AMinotaur *>(source) ? 4 : 6);
|
damage = pr_minotaurslam.HitDice (static_cast<AMinotaur *>(source) ? 4 : 6);
|
||||||
int newdam = P_DamageMobj (target, NULL, NULL, damage, NAME_Melee);
|
int newdam = P_DamageMobj (target, NULL, NULL, damage, NAME_Melee);
|
||||||
P_TraceBleed (newdam > 0 ? newdam : damage, target, angle, 0);
|
P_TraceBleed (newdam > 0 ? newdam : damage, target, angle, 0);
|
||||||
|
|
|
@ -274,12 +274,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
|
||||||
int numChunks;
|
int numChunks;
|
||||||
AActor *mo;
|
AActor *mo;
|
||||||
|
|
||||||
if ((self->velx || self->vely || self->velz) && !(self->flags6 & MF6_SHATTERING))
|
if ((self->vel.x || self->vel.y || self->vel.z) && !(self->flags6 & MF6_SHATTERING))
|
||||||
{
|
{
|
||||||
self->tics = 3*TICRATE;
|
self->tics = 3*TICRATE;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
self->velx = self->vely = self->velz = 0;
|
self->vel.x = self->vel.y = self->vel.z = 0;
|
||||||
S_Sound (self, CHAN_BODY, "misc/icebreak", 1, ATTN_NORM);
|
S_Sound (self, CHAN_BODY, "misc/icebreak", 1, ATTN_NORM);
|
||||||
|
|
||||||
// [RH] In Hexen, this creates a random number of shards (range [24,56])
|
// [RH] In Hexen, this creates a random number of shards (range [24,56])
|
||||||
|
@ -298,9 +298,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->SetState (mo->SpawnState + (pr_freeze()%3));
|
mo->SetState (mo->SpawnState + (pr_freeze()%3));
|
||||||
mo->velz = FixedDiv(mo->Z() - self->Z(), self->height)<<2;
|
mo->vel.z = FixedDiv(mo->Z() - self->Z(), self->height)<<2;
|
||||||
mo->velx = pr_freeze.Random2 () << (FRACBITS-7);
|
mo->vel.x = pr_freeze.Random2 () << (FRACBITS-7);
|
||||||
mo->vely = pr_freeze.Random2 () << (FRACBITS-7);
|
mo->vel.y = pr_freeze.Random2 () << (FRACBITS-7);
|
||||||
CALL_ACTION(A_IceSetTics, mo); // set a random tic wait
|
CALL_ACTION(A_IceSetTics, mo); // set a random tic wait
|
||||||
mo->RenderStyle = self->RenderStyle;
|
mo->RenderStyle = self->RenderStyle;
|
||||||
mo->alpha = self->alpha;
|
mo->alpha = self->alpha;
|
||||||
|
@ -311,9 +311,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
|
||||||
AActor *head = Spawn("IceChunkHead", self->PosPlusZ(self->player->mo->ViewHeight), ALLOW_REPLACE);
|
AActor *head = Spawn("IceChunkHead", self->PosPlusZ(self->player->mo->ViewHeight), ALLOW_REPLACE);
|
||||||
if (head != NULL)
|
if (head != NULL)
|
||||||
{
|
{
|
||||||
head->velz = FixedDiv(head->Z() - self->Z(), self->height)<<2;
|
head->vel.z = FixedDiv(head->Z() - self->Z(), self->height)<<2;
|
||||||
head->velx = pr_freeze.Random2 () << (FRACBITS-7);
|
head->vel.x = pr_freeze.Random2 () << (FRACBITS-7);
|
||||||
head->vely = pr_freeze.Random2 () << (FRACBITS-7);
|
head->vel.y = pr_freeze.Random2 () << (FRACBITS-7);
|
||||||
head->health = self->health;
|
head->health = self->health;
|
||||||
head->angle = self->angle;
|
head->angle = self->angle;
|
||||||
if (head->IsKindOf(RUNTIME_CLASS(APlayerPawn)))
|
if (head->IsKindOf(RUNTIME_CLASS(APlayerPawn)))
|
||||||
|
|
|
@ -981,9 +981,9 @@ void APowerFlight::InitEffect ()
|
||||||
Owner->flags |= MF_NOGRAVITY;
|
Owner->flags |= MF_NOGRAVITY;
|
||||||
if (Owner->Z() <= Owner->floorz)
|
if (Owner->Z() <= Owner->floorz)
|
||||||
{
|
{
|
||||||
Owner->velz = 4*FRACUNIT; // thrust the player in the air a bit
|
Owner->vel.z = 4*FRACUNIT; // thrust the player in the air a bit
|
||||||
}
|
}
|
||||||
if (Owner->velz <= -35*FRACUNIT)
|
if (Owner->vel.z <= -35*FRACUNIT)
|
||||||
{ // stop falling scream
|
{ // stop falling scream
|
||||||
S_StopSound (Owner, CHAN_VOICE);
|
S_StopSound (Owner, CHAN_VOICE);
|
||||||
}
|
}
|
||||||
|
@ -1261,7 +1261,7 @@ void APowerSpeed::DoEffect ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (P_AproxDistance (Owner->velx, Owner->vely) <= 12*FRACUNIT)
|
if (P_AproxDistance (Owner->vel.x, Owner->vel.y) <= 12*FRACUNIT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AActor *speedMo = Spawn<APlayerSpeedTrail> (Owner->Pos(), NO_REPLACE);
|
AActor *speedMo = Spawn<APlayerSpeedTrail> (Owner->Pos(), NO_REPLACE);
|
||||||
|
|
|
@ -177,7 +177,7 @@ void AAimingCamera::Tick ()
|
||||||
if (MaxPitchChange)
|
if (MaxPitchChange)
|
||||||
{ // Aim camera's pitch; use floats for precision
|
{ // Aim camera's pitch; use floats for precision
|
||||||
fixedvec2 fv3 = tracer->Vec2To(this);
|
fixedvec2 fv3 = tracer->Vec2To(this);
|
||||||
TVector2<double> vect(fv3.x, fv3.y);
|
DVector2 vect(fv3.x, fv3.y);
|
||||||
double dz = Z() - tracer->Z() - tracer->height/2;
|
double dz = Z() - tracer->Z() - tracer->height/2;
|
||||||
double dist = vect.Length();
|
double dist = vect.Length();
|
||||||
double ang = dist != 0.f ? atan2 (dz, dist) : 0;
|
double ang = dist != 0.f ? atan2 (dz, dist) : 0;
|
||||||
|
|
|
@ -15,7 +15,7 @@ public:
|
||||||
{
|
{
|
||||||
if (!Super::FloorBounceMissile (plane))
|
if (!Super::FloorBounceMissile (plane))
|
||||||
{
|
{
|
||||||
if (abs (velz) < (FRACUNIT/2))
|
if (abs (vel.z) < (FRACUNIT/2))
|
||||||
{
|
{
|
||||||
Destroy ();
|
Destroy ();
|
||||||
}
|
}
|
||||||
|
@ -45,7 +45,7 @@ void P_SpawnDirt (AActor *actor, fixed_t radius)
|
||||||
mo = Spawn (dtype, pos, ALLOW_REPLACE);
|
mo = Spawn (dtype, pos, ALLOW_REPLACE);
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velz = pr_dirt()<<10;
|
mo->vel.z = pr_dirt()<<10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ void AFastProjectile::Tick ()
|
||||||
int count = 8;
|
int count = 8;
|
||||||
if (radius > 0)
|
if (radius > 0)
|
||||||
{
|
{
|
||||||
while ( ((abs(velx) >> shift) > radius) || ((abs(vely) >> shift) > radius))
|
while ( ((abs(vel.x) >> shift) > radius) || ((abs(vel.y) >> shift) > radius))
|
||||||
{
|
{
|
||||||
// we need to take smaller steps.
|
// we need to take smaller steps.
|
||||||
shift++;
|
shift++;
|
||||||
|
@ -56,11 +56,11 @@ void AFastProjectile::Tick ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle movement
|
// Handle movement
|
||||||
if (velx || vely || (Z() != floorz) || velz)
|
if (vel.x || vel.y || (Z() != floorz) || vel.z)
|
||||||
{
|
{
|
||||||
xfrac = velx >> shift;
|
xfrac = vel.x >> shift;
|
||||||
yfrac = vely >> shift;
|
yfrac = vel.y >> shift;
|
||||||
zfrac = velz >> shift;
|
zfrac = vel.z >> shift;
|
||||||
changexy = xfrac || yfrac;
|
changexy = xfrac || yfrac;
|
||||||
int ripcount = count >> 3;
|
int ripcount = count >> 3;
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
|
|
|
@ -120,7 +120,7 @@ bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntyp
|
||||||
p->MorphExitFlash = (exit_flash) ? exit_flash : RUNTIME_CLASS(ATeleportFog);
|
p->MorphExitFlash = (exit_flash) ? exit_flash : RUNTIME_CLASS(ATeleportFog);
|
||||||
p->health = morphed->health;
|
p->health = morphed->health;
|
||||||
p->mo = morphed;
|
p->mo = morphed;
|
||||||
p->velx = p->vely = 0;
|
p->vel.x = p->vel.y = 0;
|
||||||
morphed->ObtainInventory (actor);
|
morphed->ObtainInventory (actor);
|
||||||
// Remove all armor
|
// Remove all armor
|
||||||
for (item = morphed->Inventory; item != NULL; )
|
for (item = morphed->Inventory; item != NULL; )
|
||||||
|
@ -227,11 +227,11 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag,
|
||||||
mo->player = player;
|
mo->player = player;
|
||||||
mo->reactiontime = 18;
|
mo->reactiontime = 18;
|
||||||
mo->flags = ActorFlags::FromInt (pmo->special2) & ~MF_JUSTHIT;
|
mo->flags = ActorFlags::FromInt (pmo->special2) & ~MF_JUSTHIT;
|
||||||
mo->velx = 0;
|
mo->vel.x = 0;
|
||||||
mo->vely = 0;
|
mo->vel.y = 0;
|
||||||
player->velx = 0;
|
player->vel.x = 0;
|
||||||
player->vely = 0;
|
player->vel.y = 0;
|
||||||
mo->velz = pmo->velz;
|
mo->vel.z = pmo->vel.z;
|
||||||
if (!(pmo->special2 & MF_JUSTHIT))
|
if (!(pmo->special2 & MF_JUSTHIT))
|
||||||
{
|
{
|
||||||
mo->renderflags &= ~RF_INVISIBLE;
|
mo->renderflags &= ~RF_INVISIBLE;
|
||||||
|
@ -461,9 +461,9 @@ bool P_UndoMonsterMorph (AMorphedMonster *beast, bool force)
|
||||||
if (!(beast->FlagsSave & MF_JUSTHIT))
|
if (!(beast->FlagsSave & MF_JUSTHIT))
|
||||||
actor->renderflags &= ~RF_INVISIBLE;
|
actor->renderflags &= ~RF_INVISIBLE;
|
||||||
actor->health = actor->SpawnHealth();
|
actor->health = actor->SpawnHealth();
|
||||||
actor->velx = beast->velx;
|
actor->vel.x = beast->vel.x;
|
||||||
actor->vely = beast->vely;
|
actor->vel.y = beast->vel.y;
|
||||||
actor->velz = beast->velz;
|
actor->vel.z = beast->vel.z;
|
||||||
actor->tid = beast->tid;
|
actor->tid = beast->tid;
|
||||||
actor->special = beast->special;
|
actor->special = beast->special;
|
||||||
actor->Score = beast->Score;
|
actor->Score = beast->Score;
|
||||||
|
|
|
@ -150,8 +150,8 @@ void DEarthquake::Tick ()
|
||||||
an >>= ANGLETOFINESHIFT;
|
an >>= ANGLETOFINESHIFT;
|
||||||
// So this is actually completely wrong, but it ought to be good
|
// So this is actually completely wrong, but it ought to be good
|
||||||
// enough. Otherwise, I'd have to use tangents and square roots.
|
// enough. Otherwise, I'd have to use tangents and square roots.
|
||||||
victim->velx += FixedMul(m_IntensityX << (FRACBITS-1), finecosine[an]);
|
victim->vel.x += FixedMul(m_IntensityX << (FRACBITS-1), finecosine[an]);
|
||||||
victim->vely += FixedMul(m_IntensityY << (FRACBITS-1), finesine[an]);
|
victim->vel.y += FixedMul(m_IntensityY << (FRACBITS-1), finesine[an]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,9 +175,9 @@ class ARandomSpawner : public AActor
|
||||||
newmobj->SpawnFlags = SpawnFlags;
|
newmobj->SpawnFlags = SpawnFlags;
|
||||||
newmobj->tid = tid;
|
newmobj->tid = tid;
|
||||||
newmobj->AddToHash();
|
newmobj->AddToHash();
|
||||||
newmobj->velx = velx;
|
newmobj->vel.x = vel.x;
|
||||||
newmobj->vely = vely;
|
newmobj->vel.y = vel.y;
|
||||||
newmobj->velz = velz;
|
newmobj->vel.z = vel.z;
|
||||||
newmobj->master = master; // For things such as DamageMaster/DamageChildren, transfer mastery.
|
newmobj->master = master; // For things such as DamageMaster/DamageChildren, transfer mastery.
|
||||||
newmobj->target = target;
|
newmobj->target = target;
|
||||||
newmobj->tracer = tracer;
|
newmobj->tracer = tracer;
|
||||||
|
|
|
@ -29,12 +29,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkSmall)
|
||||||
int t;
|
int t;
|
||||||
|
|
||||||
t = pr_spectrechunk() & 15;
|
t = pr_spectrechunk() & 15;
|
||||||
foo->velx = (t - (pr_spectrechunk() & 7)) << FRACBITS;
|
foo->vel.x = (t - (pr_spectrechunk() & 7)) << FRACBITS;
|
||||||
|
|
||||||
t = pr_spectrechunk() & 15;
|
t = pr_spectrechunk() & 15;
|
||||||
foo->vely = (t - (pr_spectrechunk() & 7)) << FRACBITS;
|
foo->vel.y = (t - (pr_spectrechunk() & 7)) << FRACBITS;
|
||||||
|
|
||||||
foo->velz = (pr_spectrechunk() & 15) << FRACBITS;
|
foo->vel.z = (pr_spectrechunk() & 15) << FRACBITS;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -50,12 +50,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectreChunkLarge)
|
||||||
int t;
|
int t;
|
||||||
|
|
||||||
t = pr_spectrechunk() & 7;
|
t = pr_spectrechunk() & 7;
|
||||||
foo->velx = (t - (pr_spectrechunk() & 15)) << FRACBITS;
|
foo->vel.x = (t - (pr_spectrechunk() & 15)) << FRACBITS;
|
||||||
|
|
||||||
t = pr_spectrechunk() & 7;
|
t = pr_spectrechunk() & 7;
|
||||||
foo->vely = (t - (pr_spectrechunk() & 15)) << FRACBITS;
|
foo->vel.y = (t - (pr_spectrechunk() & 15)) << FRACBITS;
|
||||||
|
|
||||||
foo->velz = (pr_spectrechunk() & 7) << FRACBITS;
|
foo->vel.z = (pr_spectrechunk() & 7) << FRACBITS;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -69,7 +69,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Spectre3Attack)
|
||||||
|
|
||||||
AActor *foo = Spawn("SpectralLightningV2", self->PosPlusZ(32*FRACUNIT), ALLOW_REPLACE);
|
AActor *foo = Spawn("SpectralLightningV2", self->PosPlusZ(32*FRACUNIT), ALLOW_REPLACE);
|
||||||
|
|
||||||
foo->velz = -12*FRACUNIT;
|
foo->vel.z = -12*FRACUNIT;
|
||||||
foo->target = self;
|
foo->target = self;
|
||||||
foo->FriendPlayer = 0;
|
foo->FriendPlayer = 0;
|
||||||
foo->tracer = self->target;
|
foo->tracer = self->target;
|
||||||
|
|
|
@ -57,7 +57,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepLeft)
|
||||||
AActor *misl = P_SpawnMissileZAimed (self, self->Z() + 48*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile"));
|
AActor *misl = P_SpawnMissileZAimed (self, self->Z() + 48*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile"));
|
||||||
if (misl != NULL)
|
if (misl != NULL)
|
||||||
{
|
{
|
||||||
misl->velz += FRACUNIT;
|
misl->vel.z += FRACUNIT;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepRight)
|
||||||
AActor *misl = P_SpawnMissileZAimed (self, self->Z() + 48*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile"));
|
AActor *misl = P_SpawnMissileZAimed (self, self->Z() + 48*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile"));
|
||||||
if (misl != NULL)
|
if (misl != NULL)
|
||||||
{
|
{
|
||||||
misl->velz += FRACUNIT;
|
misl->vel.z += FRACUNIT;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnEntity)
|
||||||
{
|
{
|
||||||
entity->angle = self->angle;
|
entity->angle = self->angle;
|
||||||
entity->CopyFriendliness(self, true);
|
entity->CopyFriendliness(self, true);
|
||||||
entity->velz = 5*FRACUNIT;
|
entity->vel.z = 5*FRACUNIT;
|
||||||
entity->tracer = self;
|
entity->tracer = self;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -108,16 +108,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath)
|
||||||
//second->target = self->target;
|
//second->target = self->target;
|
||||||
A_FaceTarget (second);
|
A_FaceTarget (second);
|
||||||
an = second->angle >> ANGLETOFINESHIFT;
|
an = second->angle >> ANGLETOFINESHIFT;
|
||||||
second->velx += FixedMul (finecosine[an], 320000);
|
second->vel.x += FixedMul (finecosine[an], 320000);
|
||||||
second->vely += FixedMul (finesine[an], 320000);
|
second->vel.y += FixedMul (finesine[an], 320000);
|
||||||
|
|
||||||
pos = spot->Vec3Angle(secondRadius, self->angle + ANGLE_90, self->tracer? 70*FRACUNIT : 0);
|
pos = spot->Vec3Angle(secondRadius, self->angle + ANGLE_90, self->tracer? 70*FRACUNIT : 0);
|
||||||
an = (self->angle + ANGLE_90) >> ANGLETOFINESHIFT;
|
an = (self->angle + ANGLE_90) >> ANGLETOFINESHIFT;
|
||||||
second = Spawn("EntitySecond", pos, ALLOW_REPLACE);
|
second = Spawn("EntitySecond", pos, ALLOW_REPLACE);
|
||||||
second->CopyFriendliness(self, true);
|
second->CopyFriendliness(self, true);
|
||||||
//second->target = self->target;
|
//second->target = self->target;
|
||||||
second->velx = FixedMul (secondRadius, finecosine[an]) << 2;
|
second->vel.x = FixedMul (secondRadius, finecosine[an]) << 2;
|
||||||
second->vely = FixedMul (secondRadius, finesine[an]) << 2;
|
second->vel.y = FixedMul (secondRadius, finesine[an]) << 2;
|
||||||
A_FaceTarget (second);
|
A_FaceTarget (second);
|
||||||
|
|
||||||
pos = spot->Vec3Angle(secondRadius, self->angle - ANGLE_90, self->tracer? 70*FRACUNIT : 0);
|
pos = spot->Vec3Angle(secondRadius, self->angle - ANGLE_90, self->tracer? 70*FRACUNIT : 0);
|
||||||
|
@ -125,8 +125,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath)
|
||||||
second = Spawn("EntitySecond", pos, ALLOW_REPLACE);
|
second = Spawn("EntitySecond", pos, ALLOW_REPLACE);
|
||||||
second->CopyFriendliness(self, true);
|
second->CopyFriendliness(self, true);
|
||||||
//second->target = self->target;
|
//second->target = self->target;
|
||||||
second->velx = FixedMul (secondRadius, finecosine[an]) << 2;
|
second->vel.x = FixedMul (secondRadius, finecosine[an]) << 2;
|
||||||
second->vely = FixedMul (secondRadius, finesine[an]) << 2;
|
second->vel.y = FixedMul (secondRadius, finesine[an]) << 2;
|
||||||
A_FaceTarget (second);
|
A_FaceTarget (second);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,13 +66,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorAttack)
|
||||||
proj = P_SpawnMissileZAimed (self, self->Z(), self->target, PClass::FindActor("InquisitorShot"));
|
proj = P_SpawnMissileZAimed (self, self->Z(), self->target, PClass::FindActor("InquisitorShot"));
|
||||||
if (proj != NULL)
|
if (proj != NULL)
|
||||||
{
|
{
|
||||||
proj->velz += 9*FRACUNIT;
|
proj->vel.z += 9*FRACUNIT;
|
||||||
}
|
}
|
||||||
self->angle += ANGLE_45/16;
|
self->angle += ANGLE_45/16;
|
||||||
proj = P_SpawnMissileZAimed (self, self->Z(), self->target, PClass::FindActor("InquisitorShot"));
|
proj = P_SpawnMissileZAimed (self, self->Z(), self->target, PClass::FindActor("InquisitorShot"));
|
||||||
if (proj != NULL)
|
if (proj != NULL)
|
||||||
{
|
{
|
||||||
proj->velz += 16*FRACUNIT;
|
proj->vel.z += 16*FRACUNIT;
|
||||||
}
|
}
|
||||||
self->AddZ(-32*FRACUNIT);
|
self->AddZ(-32*FRACUNIT);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -94,15 +94,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorJump)
|
||||||
A_FaceTarget (self);
|
A_FaceTarget (self);
|
||||||
an = self->angle >> ANGLETOFINESHIFT;
|
an = self->angle >> ANGLETOFINESHIFT;
|
||||||
speed = self->Speed * 2/3;
|
speed = self->Speed * 2/3;
|
||||||
self->velx += FixedMul (speed, finecosine[an]);
|
self->vel.x += FixedMul (speed, finecosine[an]);
|
||||||
self->vely += FixedMul (speed, finesine[an]);
|
self->vel.y += FixedMul (speed, finesine[an]);
|
||||||
dist = self->AproxDistance (self->target);
|
dist = self->AproxDistance (self->target);
|
||||||
dist /= speed;
|
dist /= speed;
|
||||||
if (dist < 1)
|
if (dist < 1)
|
||||||
{
|
{
|
||||||
dist = 1;
|
dist = 1;
|
||||||
}
|
}
|
||||||
self->velz = (self->target->Z() - self->Z()) / dist;
|
self->vel.z = (self->target->Z() - self->Z()) / dist;
|
||||||
self->reactiontime = 60;
|
self->reactiontime = 60;
|
||||||
self->flags |= MF_NOGRAVITY;
|
self->flags |= MF_NOGRAVITY;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -114,8 +114,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorCheckLand)
|
||||||
|
|
||||||
self->reactiontime--;
|
self->reactiontime--;
|
||||||
if (self->reactiontime < 0 ||
|
if (self->reactiontime < 0 ||
|
||||||
self->velx == 0 ||
|
self->vel.x == 0 ||
|
||||||
self->vely == 0 ||
|
self->vel.y == 0 ||
|
||||||
self->Z() <= self->floorz)
|
self->Z() <= self->floorz)
|
||||||
{
|
{
|
||||||
self->SetState (self->SeeState);
|
self->SetState (self->SeeState);
|
||||||
|
@ -137,9 +137,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossArm)
|
||||||
|
|
||||||
AActor *foo = Spawn("InquisitorArm", self->PosPlusZ(24*FRACUNIT), ALLOW_REPLACE);
|
AActor *foo = Spawn("InquisitorArm", self->PosPlusZ(24*FRACUNIT), ALLOW_REPLACE);
|
||||||
foo->angle = self->angle - ANGLE_90 + (pr_inq.Random2() << 22);
|
foo->angle = self->angle - ANGLE_90 + (pr_inq.Random2() << 22);
|
||||||
foo->velx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]) >> 3;
|
foo->vel.x = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]) >> 3;
|
||||||
foo->vely = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]) >> 3;
|
foo->vel.y = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]) >> 3;
|
||||||
foo->velz = pr_inq() << 10;
|
foo->vel.z = pr_inq() << 10;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,14 +25,14 @@ int ALoreShot::DoSpecialDamage (AActor *victim, int damage, FName damagetype)
|
||||||
if (victim != NULL && target != NULL && !(victim->flags7 & MF7_DONTTHRUST))
|
if (victim != NULL && target != NULL && !(victim->flags7 & MF7_DONTTHRUST))
|
||||||
{
|
{
|
||||||
fixedvec3 fixthrust = victim->Vec3To(target);
|
fixedvec3 fixthrust = victim->Vec3To(target);
|
||||||
TVector3<double> thrust(fixthrust.x, fixthrust.y, fixthrust.z);
|
DVector3 thrust(fixthrust.x, fixthrust.y, fixthrust.z);
|
||||||
|
|
||||||
thrust.MakeUnit();
|
thrust.MakeUnit();
|
||||||
thrust *= double((255*50*FRACUNIT) / (victim->Mass ? victim->Mass : 1));
|
thrust *= double((255*50*FRACUNIT) / (victim->Mass ? victim->Mass : 1));
|
||||||
|
|
||||||
victim->velx += fixed_t(thrust.X);
|
victim->vel.x += fixed_t(thrust.X);
|
||||||
victim->vely += fixed_t(thrust.Y);
|
victim->vel.y += fixed_t(thrust.Y);
|
||||||
victim->velz += fixed_t(thrust.Z);
|
victim->vel.z += fixed_t(thrust.Z);
|
||||||
}
|
}
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LoremasterChain)
|
||||||
|
|
||||||
S_Sound (self, CHAN_BODY, "loremaster/active", 1, ATTN_NORM);
|
S_Sound (self, CHAN_BODY, "loremaster/active", 1, ATTN_NORM);
|
||||||
Spawn("LoreShot2", self->Pos(), ALLOW_REPLACE);
|
Spawn("LoreShot2", self->Pos(), ALLOW_REPLACE);
|
||||||
Spawn("LoreShot2", self->Vec3Offset(-(self->velx >> 1), -(self->vely >> 1), -(self->velz >> 1)), ALLOW_REPLACE);
|
Spawn("LoreShot2", self->Vec3Offset(-(self->vel.x >> 1), -(self->vel.y >> 1), -(self->vel.z >> 1)), ALLOW_REPLACE);
|
||||||
Spawn("LoreShot2", self->Vec3Offset(-self->velx, -self->vely, -self->velz), ALLOW_REPLACE);
|
Spawn("LoreShot2", self->Vec3Offset(-self->vel.x, -self->vel.y, -self->vel.z), ALLOW_REPLACE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -134,9 +134,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnProgrammerBase)
|
||||||
if (foo != NULL)
|
if (foo != NULL)
|
||||||
{
|
{
|
||||||
foo->angle = self->angle + ANGLE_180 + (pr_prog.Random2() << 22);
|
foo->angle = self->angle + ANGLE_180 + (pr_prog.Random2() << 22);
|
||||||
foo->velx = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]);
|
foo->vel.x = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]);
|
||||||
foo->vely = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]);
|
foo->vel.y = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]);
|
||||||
foo->velz = pr_prog() << 9;
|
foo->vel.z = pr_prog() << 9;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelBob)
|
||||||
|
|
||||||
if (self->flags & MF_INFLOAT)
|
if (self->flags & MF_INFLOAT)
|
||||||
{
|
{
|
||||||
self->velz = 0;
|
self->vel.z = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (self->threshold != 0)
|
if (self->threshold != 0)
|
||||||
|
@ -31,11 +31,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelBob)
|
||||||
}
|
}
|
||||||
if (minz < self->Z())
|
if (minz < self->Z())
|
||||||
{
|
{
|
||||||
self->velz -= FRACUNIT;
|
self->vel.z -= FRACUNIT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
self->velz += FRACUNIT;
|
self->vel.z += FRACUNIT;
|
||||||
}
|
}
|
||||||
self->reactiontime = (minz >= self->Z()) ? 4 : 0;
|
self->reactiontime = (minz >= self->Z()) ? 4 : 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -55,22 +55,22 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelAttack)
|
||||||
|
|
||||||
missile = P_SpawnMissileZAimed (self, self->Z() + 32*FRACUNIT, self->target, PClass::FindActor("SentinelFX2"));
|
missile = P_SpawnMissileZAimed (self, self->Z() + 32*FRACUNIT, self->target, PClass::FindActor("SentinelFX2"));
|
||||||
|
|
||||||
if (missile != NULL && (missile->velx | missile->vely) != 0)
|
if (missile != NULL && (missile->vel.x | missile->vel.y) != 0)
|
||||||
{
|
{
|
||||||
for (int i = 8; i > 1; --i)
|
for (int i = 8; i > 1; --i)
|
||||||
{
|
{
|
||||||
trail = Spawn("SentinelFX1",
|
trail = Spawn("SentinelFX1",
|
||||||
self->Vec3Angle(missile->radius*i, missile->angle, (missile->velz / 4 * i)), ALLOW_REPLACE);
|
self->Vec3Angle(missile->radius*i, missile->angle, (missile->vel.z / 4 * i)), ALLOW_REPLACE);
|
||||||
if (trail != NULL)
|
if (trail != NULL)
|
||||||
{
|
{
|
||||||
trail->target = self;
|
trail->target = self;
|
||||||
trail->velx = missile->velx;
|
trail->vel.x = missile->vel.x;
|
||||||
trail->vely = missile->vely;
|
trail->vel.y = missile->vel.y;
|
||||||
trail->velz = missile->velz;
|
trail->vel.z = missile->vel.z;
|
||||||
P_CheckMissileSpawn (trail, self->radius);
|
P_CheckMissileSpawn (trail, self->radius);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
missile->AddZ(missile->velz >> 2);
|
missile->AddZ(missile->vel.z >> 2);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightningTail)
|
||||||
{
|
{
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
AActor *foo = Spawn("SpectralLightningHTail", self->Vec3Offset(-self->velx, -self->vely, 0), ALLOW_REPLACE);
|
AActor *foo = Spawn("SpectralLightningHTail", self->Vec3Offset(-self->vel.x, -self->vel.y, 0), ALLOW_REPLACE);
|
||||||
|
|
||||||
foo->angle = self->angle;
|
foo->angle = self->angle;
|
||||||
foo->FriendPlayer = self->FriendPlayer;
|
foo->FriendPlayer = self->FriendPlayer;
|
||||||
|
@ -63,8 +63,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning)
|
||||||
if (self->threshold != 0)
|
if (self->threshold != 0)
|
||||||
--self->threshold;
|
--self->threshold;
|
||||||
|
|
||||||
self->velx += pr_zap5.Random2(3) << FRACBITS;
|
self->vel.x += pr_zap5.Random2(3) << FRACBITS;
|
||||||
self->vely += pr_zap5.Random2(3) << FRACBITS;
|
self->vel.y += pr_zap5.Random2(3) << FRACBITS;
|
||||||
|
|
||||||
fixedvec2 pos = self->Vec2Offset(
|
fixedvec2 pos = self->Vec2Offset(
|
||||||
pr_zap5.Random2(3) * FRACUNIT * 50,
|
pr_zap5.Random2(3) * FRACUNIT * 50,
|
||||||
|
@ -74,13 +74,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning)
|
||||||
PClass::FindActor(NAME_SpectralLightningV1), pos.x, pos.y, ONCEILINGZ, ALLOW_REPLACE);
|
PClass::FindActor(NAME_SpectralLightningV1), pos.x, pos.y, ONCEILINGZ, ALLOW_REPLACE);
|
||||||
|
|
||||||
flash->target = self->target;
|
flash->target = self->target;
|
||||||
flash->velz = -18*FRACUNIT;
|
flash->vel.z = -18*FRACUNIT;
|
||||||
flash->FriendPlayer = self->FriendPlayer;
|
flash->FriendPlayer = self->FriendPlayer;
|
||||||
|
|
||||||
flash = Spawn(NAME_SpectralLightningV2, self->X(), self->Y(), ONCEILINGZ, ALLOW_REPLACE);
|
flash = Spawn(NAME_SpectralLightningV2, self->X(), self->Y(), ONCEILINGZ, ALLOW_REPLACE);
|
||||||
|
|
||||||
flash->target = self->target;
|
flash->target = self->target;
|
||||||
flash->velz = -18*FRACUNIT;
|
flash->vel.z = -18*FRACUNIT;
|
||||||
flash->FriendPlayer = self->FriendPlayer;
|
flash->FriendPlayer = self->FriendPlayer;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -123,8 +123,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2)
|
||||||
}
|
}
|
||||||
|
|
||||||
exact = self->angle >> ANGLETOFINESHIFT;
|
exact = self->angle >> ANGLETOFINESHIFT;
|
||||||
self->velx = FixedMul (self->Speed, finecosine[exact]);
|
self->vel.x = FixedMul (self->Speed, finecosine[exact]);
|
||||||
self->vely = FixedMul (self->Speed, finesine[exact]);
|
self->vel.y = FixedMul (self->Speed, finesine[exact]);
|
||||||
|
|
||||||
if (!(self->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
if (!(self->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
||||||
{
|
{
|
||||||
|
@ -143,13 +143,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2)
|
||||||
{
|
{
|
||||||
slope = (dest->Z() + self->height*2/3 - self->Z()) / dist;
|
slope = (dest->Z() + self->height*2/3 - self->Z()) / dist;
|
||||||
}
|
}
|
||||||
if (slope < self->velz)
|
if (slope < self->vel.z)
|
||||||
{
|
{
|
||||||
self->velz -= FRACUNIT/8;
|
self->vel.z -= FRACUNIT/8;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
self->velz += FRACUNIT/8;
|
self->vel.z += FRACUNIT/8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -611,9 +611,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossGib)
|
||||||
an = pr_gibtosser() << 24;
|
an = pr_gibtosser() << 24;
|
||||||
gib->angle = an;
|
gib->angle = an;
|
||||||
speed = pr_gibtosser() & 15;
|
speed = pr_gibtosser() & 15;
|
||||||
gib->velx = speed * finecosine[an >> ANGLETOFINESHIFT];
|
gib->vel.x = speed * finecosine[an >> ANGLETOFINESHIFT];
|
||||||
gib->vely = speed * finesine[an >> ANGLETOFINESHIFT];
|
gib->vel.y = speed * finesine[an >> ANGLETOFINESHIFT];
|
||||||
gib->velz = (pr_gibtosser() & 15) << FRACBITS;
|
gib->vel.z = (pr_gibtosser() & 15) << FRACBITS;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -671,8 +671,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CheckTerrain)
|
||||||
fixed_t speed = (anglespeed % 10) << (FRACBITS - 4);
|
fixed_t speed = (anglespeed % 10) << (FRACBITS - 4);
|
||||||
angle_t finean = (anglespeed / 10) << (32-3);
|
angle_t finean = (anglespeed / 10) << (32-3);
|
||||||
finean >>= ANGLETOFINESHIFT;
|
finean >>= ANGLETOFINESHIFT;
|
||||||
self->velx += FixedMul (speed, finecosine[finean]);
|
self->vel.x += FixedMul (speed, finecosine[finean]);
|
||||||
self->vely += FixedMul (speed, finesine[finean]);
|
self->vel.y += FixedMul (speed, finesine[finean]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -722,7 +722,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DropFire)
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
AActor *drop = Spawn("FireDroplet", self->PosPlusZ(24*FRACUNIT), ALLOW_REPLACE);
|
AActor *drop = Spawn("FireDroplet", self->PosPlusZ(24*FRACUNIT), ALLOW_REPLACE);
|
||||||
drop->velz = -FRACUNIT;
|
drop->vel.z = -FRACUNIT;
|
||||||
P_RadiusAttack (self, self, 64, 64, NAME_Fire, 0);
|
P_RadiusAttack (self, self, 64, 64, NAME_Fire, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -380,10 +380,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_RocketInFlight)
|
||||||
|
|
||||||
S_Sound (self, CHAN_VOICE, "misc/missileinflight", 1, ATTN_NORM);
|
S_Sound (self, CHAN_VOICE, "misc/missileinflight", 1, ATTN_NORM);
|
||||||
P_SpawnPuff (self, PClass::FindActor("MiniMissilePuff"), self->Pos(), self->angle - ANGLE_180, 2, PF_HITTHING);
|
P_SpawnPuff (self, PClass::FindActor("MiniMissilePuff"), self->Pos(), self->angle - ANGLE_180, 2, PF_HITTHING);
|
||||||
trail = Spawn("RocketTrail", self->Vec3Offset(-self->velx, -self->vely, 0), ALLOW_REPLACE);
|
trail = Spawn("RocketTrail", self->Vec3Offset(-self->vel.x, -self->vel.y, 0), ALLOW_REPLACE);
|
||||||
if (trail != NULL)
|
if (trail != NULL)
|
||||||
{
|
{
|
||||||
trail->velz = FRACUNIT;
|
trail->vel.z = FRACUNIT;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -401,7 +401,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FlameDie)
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
self->flags |= MF_NOGRAVITY;
|
self->flags |= MF_NOGRAVITY;
|
||||||
self->velz = (pr_flamedie() & 3) << FRACBITS;
|
self->vel.z = (pr_flamedie() & 3) << FRACBITS;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireFlamer)
|
||||||
self = P_SpawnPlayerMissile (self, PClass::FindActor("FlameMissile"));
|
self = P_SpawnPlayerMissile (self, PClass::FindActor("FlameMissile"));
|
||||||
if (self != NULL)
|
if (self != NULL)
|
||||||
{
|
{
|
||||||
self->velz += 5*FRACUNIT;
|
self->vel.z += 5*FRACUNIT;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -578,8 +578,8 @@ AActor *P_SpawnSubMissile (AActor *source, PClassActor *type, AActor *target)
|
||||||
other->target = target;
|
other->target = target;
|
||||||
other->angle = source->angle;
|
other->angle = source->angle;
|
||||||
|
|
||||||
other->velx = FixedMul (other->Speed, finecosine[source->angle >> ANGLETOFINESHIFT]);
|
other->vel.x = FixedMul (other->Speed, finecosine[source->angle >> ANGLETOFINESHIFT]);
|
||||||
other->vely = FixedMul (other->Speed, finesine[source->angle >> ANGLETOFINESHIFT]);
|
other->vel.y = FixedMul (other->Speed, finesine[source->angle >> ANGLETOFINESHIFT]);
|
||||||
|
|
||||||
if (other->flags4 & MF4_SPECTRAL)
|
if (other->flags4 & MF4_SPECTRAL)
|
||||||
{
|
{
|
||||||
|
@ -596,7 +596,7 @@ AActor *P_SpawnSubMissile (AActor *source, PClassActor *type, AActor *target)
|
||||||
if (P_CheckMissileSpawn (other, source->radius))
|
if (P_CheckMissileSpawn (other, source->radius))
|
||||||
{
|
{
|
||||||
angle_t pitch = P_AimLineAttack (source, source->angle, 1024*FRACUNIT);
|
angle_t pitch = P_AimLineAttack (source, source->angle, 1024*FRACUNIT);
|
||||||
other->velz = FixedMul (-finesine[pitch>>ANGLETOFINESHIFT], other->Speed);
|
other->vel.z = FixedMul (-finesine[pitch>>ANGLETOFINESHIFT], other->Speed);
|
||||||
return other;
|
return other;
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -632,9 +632,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Burnination)
|
||||||
{
|
{
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
|
|
||||||
self->velz -= 8*FRACUNIT;
|
self->vel.z -= 8*FRACUNIT;
|
||||||
self->velx += (pr_phburn.Random2 (3)) << FRACBITS;
|
self->vel.x += (pr_phburn.Random2 (3)) << FRACBITS;
|
||||||
self->vely += (pr_phburn.Random2 (3)) << FRACBITS;
|
self->vel.y += (pr_phburn.Random2 (3)) << FRACBITS;
|
||||||
S_Sound (self, CHAN_VOICE, "world/largefire", 1, ATTN_NORM);
|
S_Sound (self, CHAN_VOICE, "world/largefire", 1, ATTN_NORM);
|
||||||
|
|
||||||
// Only the main fire spawns more.
|
// Only the main fire spawns more.
|
||||||
|
@ -675,9 +675,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_Burnination)
|
||||||
self->Z() + 4*FRACUNIT, ALLOW_REPLACE);
|
self->Z() + 4*FRACUNIT, ALLOW_REPLACE);
|
||||||
if (drop != NULL)
|
if (drop != NULL)
|
||||||
{
|
{
|
||||||
drop->velx = self->velx + ((pr_phburn.Random2 (7)) << FRACBITS);
|
drop->vel.x = self->vel.x + ((pr_phburn.Random2 (7)) << FRACBITS);
|
||||||
drop->vely = self->vely + ((pr_phburn.Random2 (7)) << FRACBITS);
|
drop->vel.y = self->vel.y + ((pr_phburn.Random2 (7)) << FRACBITS);
|
||||||
drop->velz = self->velz - FRACUNIT;
|
drop->vel.z = self->vel.z - FRACUNIT;
|
||||||
drop->reactiontime = (pr_phburn() & 3) + 2;
|
drop->reactiontime = (pr_phburn() & 3) + 2;
|
||||||
drop->flags |= MF_DROPPED;
|
drop->flags |= MF_DROPPED;
|
||||||
}
|
}
|
||||||
|
@ -728,7 +728,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireGrenade)
|
||||||
S_Sound (grenade, CHAN_VOICE, grenade->SeeSound, 1, ATTN_NORM);
|
S_Sound (grenade, CHAN_VOICE, grenade->SeeSound, 1, ATTN_NORM);
|
||||||
}
|
}
|
||||||
|
|
||||||
grenade->velz = FixedMul (finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)], grenade->Speed) + 8*FRACUNIT;
|
grenade->vel.z = FixedMul (finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)], grenade->Speed) + 8*FRACUNIT;
|
||||||
|
|
||||||
fixedvec2 offset;
|
fixedvec2 offset;
|
||||||
|
|
||||||
|
@ -1000,8 +1000,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil1)
|
||||||
spot = Spawn("SpectralLightningSpot", self->Pos(), ALLOW_REPLACE);
|
spot = Spawn("SpectralLightningSpot", self->Pos(), ALLOW_REPLACE);
|
||||||
if (spot != NULL)
|
if (spot != NULL)
|
||||||
{
|
{
|
||||||
spot->velx += 28 * finecosine[self->angle >> ANGLETOFINESHIFT];
|
spot->vel.x += 28 * finecosine[self->angle >> ANGLETOFINESHIFT];
|
||||||
spot->vely += 28 * finesine[self->angle >> ANGLETOFINESHIFT];
|
spot->vel.y += 28 * finesine[self->angle >> ANGLETOFINESHIFT];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (spot != NULL)
|
if (spot != NULL)
|
||||||
|
@ -1102,8 +1102,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil4)
|
||||||
spot = P_SpawnPlayerMissile (self, PClass::FindActor("SpectralLightningBigV1"));
|
spot = P_SpawnPlayerMissile (self, PClass::FindActor("SpectralLightningBigV1"));
|
||||||
if (spot != NULL)
|
if (spot != NULL)
|
||||||
{
|
{
|
||||||
spot->velx += FixedMul (spot->Speed, finecosine[self->angle >> ANGLETOFINESHIFT]);
|
spot->vel.x += FixedMul (spot->Speed, finecosine[self->angle >> ANGLETOFINESHIFT]);
|
||||||
spot->vely += FixedMul (spot->Speed, finesine[self->angle >> ANGLETOFINESHIFT]);
|
spot->vel.y += FixedMul (spot->Speed, finesine[self->angle >> ANGLETOFINESHIFT]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -112,9 +112,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightGoesOut)
|
||||||
if (foo != NULL)
|
if (foo != NULL)
|
||||||
{
|
{
|
||||||
int t = pr_lightout() & 15;
|
int t = pr_lightout() & 15;
|
||||||
foo->velx = (t - (pr_lightout() & 7)) << FRACBITS;
|
foo->vel.x = (t - (pr_lightout() & 7)) << FRACBITS;
|
||||||
foo->vely = (pr_lightout.Random2() & 7) << FRACBITS;
|
foo->vel.y = (pr_lightout.Random2() & 7) << FRACBITS;
|
||||||
foo->velz = (7 + (pr_lightout() & 3)) << FRACBITS;
|
foo->vel.z = (7 + (pr_lightout() & 3)) << FRACBITS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -138,7 +138,7 @@ void cht_DoCheat (player_t *player, int cheat)
|
||||||
player->cheats &= ~CF_NOCLIP;
|
player->cheats &= ~CF_NOCLIP;
|
||||||
msg = GStrings("STSTR_NCOFF");
|
msg = GStrings("STSTR_NCOFF");
|
||||||
}
|
}
|
||||||
if (player->mo->velx == 0) player->mo->velx = 1; // force some lateral movement so that internal variables are up to date
|
if (player->mo->vel.x == 0) player->mo->vel.x = 1; // force some lateral movement so that internal variables are up to date
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHT_NOVELOCITY:
|
case CHT_NOVELOCITY:
|
||||||
|
|
|
@ -4897,15 +4897,15 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
|
||||||
|
|
||||||
case ACSF_GetActorVelX:
|
case ACSF_GetActorVelX:
|
||||||
actor = SingleActorFromTID(args[0], activator);
|
actor = SingleActorFromTID(args[0], activator);
|
||||||
return actor != NULL? actor->velx : 0;
|
return actor != NULL? actor->vel.x : 0;
|
||||||
|
|
||||||
case ACSF_GetActorVelY:
|
case ACSF_GetActorVelY:
|
||||||
actor = SingleActorFromTID(args[0], activator);
|
actor = SingleActorFromTID(args[0], activator);
|
||||||
return actor != NULL? actor->vely : 0;
|
return actor != NULL? actor->vel.y : 0;
|
||||||
|
|
||||||
case ACSF_GetActorVelZ:
|
case ACSF_GetActorVelZ:
|
||||||
actor = SingleActorFromTID(args[0], activator);
|
actor = SingleActorFromTID(args[0], activator);
|
||||||
return actor != NULL? actor->velz : 0;
|
return actor != NULL? actor->vel.z : 0;
|
||||||
|
|
||||||
case ACSF_SetPointer:
|
case ACSF_SetPointer:
|
||||||
if (activator)
|
if (activator)
|
||||||
|
@ -5341,7 +5341,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
|
||||||
return FLOAT2FIXED(sqrt(FIXED2DBL(args[0])));
|
return FLOAT2FIXED(sqrt(FIXED2DBL(args[0])));
|
||||||
|
|
||||||
case ACSF_VectorLength:
|
case ACSF_VectorLength:
|
||||||
return FLOAT2FIXED(TVector2<double>(FIXED2DBL(args[0]), FIXED2DBL(args[1])).Length());
|
return FLOAT2FIXED(DVector2(FIXED2DBL(args[0]), FIXED2DBL(args[1])).Length());
|
||||||
|
|
||||||
case ACSF_SetHUDClipRect:
|
case ACSF_SetHUDClipRect:
|
||||||
ClipRectLeft = argCount > 0 ? args[0] : 0;
|
ClipRectLeft = argCount > 0 ? args[0] : 0;
|
||||||
|
|
|
@ -804,7 +804,7 @@ static void CreateStartSpot (fixed_t *pos, FMapThing *start)
|
||||||
|
|
||||||
static void CalcPlane (SlopeWork &slope, secplane_t &plane)
|
static void CalcPlane (SlopeWork &slope, secplane_t &plane)
|
||||||
{
|
{
|
||||||
TVector3<double> pt[3];
|
DVector3 pt[3];
|
||||||
long j;
|
long j;
|
||||||
|
|
||||||
slope.x[0] = slope.wal->x; slope.y[0] = slope.wal->y;
|
slope.x[0] = slope.wal->x; slope.y[0] = slope.wal->y;
|
||||||
|
@ -823,8 +823,8 @@ static void CalcPlane (SlopeWork &slope, secplane_t &plane)
|
||||||
-slope.dy, slope.x[2]-slope.wal->x);
|
-slope.dy, slope.x[2]-slope.wal->x);
|
||||||
slope.z[2] += Scale (slope.heinum, j, slope.i);
|
slope.z[2] += Scale (slope.heinum, j, slope.i);
|
||||||
|
|
||||||
pt[0] = TVector3<double>(slope.dx, -slope.dy, 0);
|
pt[0] = DVector3(slope.dx, -slope.dy, 0);
|
||||||
pt[1] = TVector3<double>(slope.x[2] - slope.x[0], slope.y[0] - slope.y[2], (slope.z[2] - slope.z[0]) / 16);
|
pt[1] = DVector3(slope.x[2] - slope.x[0], slope.y[0] - slope.y[2], (slope.z[2] - slope.z[0]) / 16);
|
||||||
pt[2] = (pt[0] ^ pt[1]).Unit();
|
pt[2] = (pt[0] ^ pt[1]).Unit();
|
||||||
|
|
||||||
if ((pt[2][2] < 0 && plane.c > 0) || (pt[2][2] > 0 && plane.c < 0))
|
if ((pt[2][2] < 0 && plane.c > 0) || (pt[2][2] > 0 && plane.c < 0))
|
||||||
|
|
|
@ -1091,8 +1091,8 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pc->velx = pc->vely = 0; // Stop moving
|
pc->vel.x = pc->vel.y = 0; // Stop moving
|
||||||
pc->player->velx = pc->player->vely = 0;
|
pc->player->vel.x = pc->player->vel.y = 0;
|
||||||
static_cast<APlayerPawn*>(pc)->PlayIdle ();
|
static_cast<APlayerPawn*>(pc)->PlayIdle ();
|
||||||
|
|
||||||
pc->player->ConversationPC = pc;
|
pc->player->ConversationPC = pc;
|
||||||
|
|
108
src/p_effect.cpp
108
src/p_effect.cpp
|
@ -279,15 +279,15 @@ void P_ThinkParticles ()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
fixedvec2 newxy = P_GetOffsetPosition(particle->x, particle->y, particle->velx, particle->vely);
|
fixedvec2 newxy = P_GetOffsetPosition(particle->x, particle->y, particle->vel.x, particle->vel.y);
|
||||||
particle->x = newxy.x;
|
particle->x = newxy.x;
|
||||||
particle->y = newxy.y;
|
particle->y = newxy.y;
|
||||||
//particle->x += particle->velx;
|
//particle->x += particle->vel.x;
|
||||||
//particle->y += particle->vely;
|
//particle->y += particle->vel.y;
|
||||||
particle->z += particle->velz;
|
particle->z += particle->vel.z;
|
||||||
particle->velx += particle->accx;
|
particle->vel.x += particle->accx;
|
||||||
particle->vely += particle->accy;
|
particle->vel.y += particle->accy;
|
||||||
particle->velz += particle->accz;
|
particle->vel.z += particle->accz;
|
||||||
particle->subsector = R_PointInSubsector(particle->x, particle->y);
|
particle->subsector = R_PointInSubsector(particle->x, particle->y);
|
||||||
if (!particle->subsector->sector->PortalBlocksMovement(sector_t::ceiling))
|
if (!particle->subsector->sector->PortalBlocksMovement(sector_t::ceiling))
|
||||||
{
|
{
|
||||||
|
@ -313,7 +313,7 @@ void P_ThinkParticles ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void P_SpawnParticle(fixed_t x, fixed_t y, fixed_t z, fixed_t velx, fixed_t vely, fixed_t velz, PalEntry color, bool fullbright, BYTE startalpha, BYTE lifetime, WORD size, int fadestep, fixed_t accelx, fixed_t accely, fixed_t accelz)
|
void P_SpawnParticle(fixed_t x, fixed_t y, fixed_t z, fixed_t vx, fixed_t vy, fixed_t vz, PalEntry color, bool fullbright, BYTE startalpha, BYTE lifetime, WORD size, int fadestep, fixed_t accelx, fixed_t accely, fixed_t accelz)
|
||||||
{
|
{
|
||||||
particle_t *particle = NewParticle();
|
particle_t *particle = NewParticle();
|
||||||
|
|
||||||
|
@ -322,9 +322,9 @@ void P_SpawnParticle(fixed_t x, fixed_t y, fixed_t z, fixed_t velx, fixed_t vely
|
||||||
particle->x = x;
|
particle->x = x;
|
||||||
particle->y = y;
|
particle->y = y;
|
||||||
particle->z = z;
|
particle->z = z;
|
||||||
particle->velx = velx;
|
particle->vel.x = vx;
|
||||||
particle->vely = vely;
|
particle->vel.y = vy;
|
||||||
particle->velz = velz;
|
particle->vel.z = vz;
|
||||||
particle->color = ParticleColor(color);
|
particle->color = ParticleColor(color);
|
||||||
particle->trans = startalpha;
|
particle->trans = startalpha;
|
||||||
if (fadestep < 0) fadestep = FADEFROMTTL(lifetime);
|
if (fadestep < 0) fadestep = FADEFROMTTL(lifetime);
|
||||||
|
@ -379,7 +379,7 @@ particle_t *JitterParticle (int ttl, double drift)
|
||||||
particle_t *particle = NewParticle ();
|
particle_t *particle = NewParticle ();
|
||||||
|
|
||||||
if (particle) {
|
if (particle) {
|
||||||
fixed_t *val = &particle->velx;
|
fixed_t *val = &particle->vel.x;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Set initial velocities
|
// Set initial velocities
|
||||||
|
@ -415,9 +415,9 @@ static void MakeFountain (AActor *actor, int color1, int color2)
|
||||||
particle->y = pos.y;
|
particle->y = pos.y;
|
||||||
particle->z = pos.z;
|
particle->z = pos.z;
|
||||||
if (out < actor->radius/8)
|
if (out < actor->radius/8)
|
||||||
particle->velz += FRACUNIT*10/3;
|
particle->vel.z += FRACUNIT*10/3;
|
||||||
else
|
else
|
||||||
particle->velz += FRACUNIT*3;
|
particle->vel.z += FRACUNIT*3;
|
||||||
particle->accz -= FRACUNIT/11;
|
particle->accz -= FRACUNIT/11;
|
||||||
if (M_Random() < 30) {
|
if (M_Random() < 30) {
|
||||||
particle->size = 4;
|
particle->size = 4;
|
||||||
|
@ -434,9 +434,9 @@ void P_RunEffect (AActor *actor, int effects)
|
||||||
angle_t moveangle;
|
angle_t moveangle;
|
||||||
|
|
||||||
// 512 is the limit below which R_PointToAngle2 does no longer returns usable values.
|
// 512 is the limit below which R_PointToAngle2 does no longer returns usable values.
|
||||||
if (abs(actor->velx) > 512 || abs(actor->vely) > 512)
|
if (abs(actor->vel.x) > 512 || abs(actor->vel.y) > 512)
|
||||||
{
|
{
|
||||||
moveangle = R_PointToAngle2(0,0,actor->velx,actor->vely);
|
moveangle = R_PointToAngle2(0,0,actor->vel.x,actor->vel.y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -453,7 +453,7 @@ void P_RunEffect (AActor *actor, int effects)
|
||||||
|
|
||||||
fixed_t backx = - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
|
fixed_t backx = - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
|
||||||
fixed_t backy = - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
|
fixed_t backy = - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
|
||||||
fixed_t backz = - (actor->height>>3) * (actor->velz>>16) + (2*actor->height)/3;
|
fixed_t backz = - (actor->height>>3) * (actor->vel.z>>16) + (2*actor->height)/3;
|
||||||
|
|
||||||
angle_t an = (moveangle + ANG90) >> ANGLETOFINESHIFT;
|
angle_t an = (moveangle + ANG90) >> ANGLETOFINESHIFT;
|
||||||
int speed;
|
int speed;
|
||||||
|
@ -462,16 +462,16 @@ void P_RunEffect (AActor *actor, int effects)
|
||||||
if (particle) {
|
if (particle) {
|
||||||
fixed_t pathdist = M_Random()<<8;
|
fixed_t pathdist = M_Random()<<8;
|
||||||
fixedvec3 pos = actor->Vec3Offset(
|
fixedvec3 pos = actor->Vec3Offset(
|
||||||
backx - FixedMul(actor->velx, pathdist),
|
backx - FixedMul(actor->vel.x, pathdist),
|
||||||
backy - FixedMul(actor->vely, pathdist),
|
backy - FixedMul(actor->vel.y, pathdist),
|
||||||
backz - FixedMul(actor->velz, pathdist));
|
backz - FixedMul(actor->vel.z, pathdist));
|
||||||
particle->x = pos.x;
|
particle->x = pos.x;
|
||||||
particle->y = pos.y;
|
particle->y = pos.y;
|
||||||
particle->z = pos.z;
|
particle->z = pos.z;
|
||||||
speed = (M_Random () - 128) * (FRACUNIT/200);
|
speed = (M_Random () - 128) * (FRACUNIT/200);
|
||||||
particle->velx += FixedMul (speed, finecosine[an]);
|
particle->vel.x += FixedMul (speed, finecosine[an]);
|
||||||
particle->vely += FixedMul (speed, finesine[an]);
|
particle->vel.y += FixedMul (speed, finesine[an]);
|
||||||
particle->velz -= FRACUNIT/36;
|
particle->vel.z -= FRACUNIT/36;
|
||||||
particle->accz -= FRACUNIT/20;
|
particle->accz -= FRACUNIT/20;
|
||||||
particle->color = yellow;
|
particle->color = yellow;
|
||||||
particle->size = 2;
|
particle->size = 2;
|
||||||
|
@ -481,16 +481,16 @@ void P_RunEffect (AActor *actor, int effects)
|
||||||
if (particle) {
|
if (particle) {
|
||||||
fixed_t pathdist = M_Random()<<8;
|
fixed_t pathdist = M_Random()<<8;
|
||||||
fixedvec3 pos = actor->Vec3Offset(
|
fixedvec3 pos = actor->Vec3Offset(
|
||||||
backx - FixedMul(actor->velx, pathdist),
|
backx - FixedMul(actor->vel.x, pathdist),
|
||||||
backy - FixedMul(actor->vely, pathdist),
|
backy - FixedMul(actor->vel.y, pathdist),
|
||||||
backz - FixedMul(actor->velz, pathdist) + (M_Random() << 10));
|
backz - FixedMul(actor->vel.z, pathdist) + (M_Random() << 10));
|
||||||
particle->x = pos.x;
|
particle->x = pos.x;
|
||||||
particle->y = pos.y;
|
particle->y = pos.y;
|
||||||
particle->z = pos.z;
|
particle->z = pos.z;
|
||||||
speed = (M_Random () - 128) * (FRACUNIT/200);
|
speed = (M_Random () - 128) * (FRACUNIT/200);
|
||||||
particle->velx += FixedMul (speed, finecosine[an]);
|
particle->vel.x += FixedMul (speed, finecosine[an]);
|
||||||
particle->vely += FixedMul (speed, finesine[an]);
|
particle->vel.y += FixedMul (speed, finesine[an]);
|
||||||
particle->velz += FRACUNIT/80;
|
particle->vel.z += FRACUNIT/80;
|
||||||
particle->accz += FRACUNIT/40;
|
particle->accz += FRACUNIT/40;
|
||||||
if (M_Random () & 7)
|
if (M_Random () & 7)
|
||||||
particle->color = grey2;
|
particle->color = grey2;
|
||||||
|
@ -506,7 +506,7 @@ void P_RunEffect (AActor *actor, int effects)
|
||||||
// Grenade trail
|
// Grenade trail
|
||||||
|
|
||||||
fixedvec3 pos = actor->Vec3Angle(-actor->radius * 2, moveangle,
|
fixedvec3 pos = actor->Vec3Angle(-actor->radius * 2, moveangle,
|
||||||
-(actor->height >> 3) * (actor->velz >> 16) + (2 * actor->height) / 3);
|
-(actor->height >> 3) * (actor->vel.z >> 16) + (2 * actor->height) / 3);
|
||||||
|
|
||||||
P_DrawSplash2 (6, pos.x, pos.y, pos.z,
|
P_DrawSplash2 (6, pos.x, pos.y, pos.z,
|
||||||
moveangle + ANG180, 2, 2);
|
moveangle + ANG180, 2, 2);
|
||||||
|
@ -545,13 +545,13 @@ void P_RunEffect (AActor *actor, int effects)
|
||||||
particle->y = pos.y;
|
particle->y = pos.y;
|
||||||
particle->z = pos.z;
|
particle->z = pos.z;
|
||||||
particle->color = *protectColors[M_Random() & 1];
|
particle->color = *protectColors[M_Random() & 1];
|
||||||
particle->velz = FRACUNIT;
|
particle->vel.z = FRACUNIT;
|
||||||
particle->accz = M_Random () << 7;
|
particle->accz = M_Random () << 7;
|
||||||
particle->size = 1;
|
particle->size = 1;
|
||||||
if (M_Random () < 128)
|
if (M_Random () < 128)
|
||||||
{ // make particle fall from top of actor
|
{ // make particle fall from top of actor
|
||||||
particle->z += actor->height;
|
particle->z += actor->height;
|
||||||
particle->velz = -particle->velz;
|
particle->vel.z = -particle->vel.z;
|
||||||
particle->accz = -particle->accz;
|
particle->accz = -particle->accz;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -583,7 +583,7 @@ void P_DrawSplash (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, in
|
||||||
|
|
||||||
p->size = 2;
|
p->size = 2;
|
||||||
p->color = M_Random() & 0x80 ? color1 : color2;
|
p->color = M_Random() & 0x80 ? color1 : color2;
|
||||||
p->velz -= M_Random () * 512;
|
p->vel.z -= M_Random () * 512;
|
||||||
p->accz -= FRACUNIT/8;
|
p->accz -= FRACUNIT/8;
|
||||||
p->accx += (M_Random () - 128) * 8;
|
p->accx += (M_Random () - 128) * 8;
|
||||||
p->accy += (M_Random () - 128) * 8;
|
p->accy += (M_Random () - 128) * 8;
|
||||||
|
@ -635,14 +635,14 @@ void P_DrawSplash2 (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, i
|
||||||
p->trans = 255;
|
p->trans = 255;
|
||||||
p->size = 4;
|
p->size = 4;
|
||||||
p->color = M_Random() & 0x80 ? color1 : color2;
|
p->color = M_Random() & 0x80 ? color1 : color2;
|
||||||
p->velz = M_Random () * zvel;
|
p->vel.z = M_Random () * zvel;
|
||||||
p->accz = -FRACUNIT/22;
|
p->accz = -FRACUNIT/22;
|
||||||
if (kind) {
|
if (kind) {
|
||||||
an = (angle + ((M_Random() - 128) << 23)) >> ANGLETOFINESHIFT;
|
an = (angle + ((M_Random() - 128) << 23)) >> ANGLETOFINESHIFT;
|
||||||
p->velx = (M_Random () * finecosine[an]) >> 11;
|
p->vel.x = (M_Random () * finecosine[an]) >> 11;
|
||||||
p->vely = (M_Random () * finesine[an]) >> 11;
|
p->vel.y = (M_Random () * finesine[an]) >> 11;
|
||||||
p->accx = p->velx >> 4;
|
p->accx = p->vel.x >> 4;
|
||||||
p->accy = p->vely >> 4;
|
p->accy = p->vel.y >> 4;
|
||||||
}
|
}
|
||||||
p->z = z + (M_Random () + zadd - 128) * zspread;
|
p->z = z + (M_Random () + zadd - 128) * zspread;
|
||||||
an = (angle + ((M_Random() - 128) << 22)) >> ANGLETOFINESHIFT;
|
an = (angle + ((M_Random() - 128) << 22)) >> ANGLETOFINESHIFT;
|
||||||
|
@ -651,12 +651,12 @@ void P_DrawSplash2 (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVector3<double> &end, int color1, int color2, double maxdiff_d, int flags, PClassActor *spawnclass, angle_t angle, int duration, double sparsity, double drift, int SpiralOffset)
|
void P_DrawRailTrail(AActor *source, const DVector3 &start, const DVector3 &end, int color1, int color2, double maxdiff_d, int flags, PClassActor *spawnclass, angle_t angle, int duration, double sparsity, double drift, int SpiralOffset)
|
||||||
{
|
{
|
||||||
double length, lengthsquared;
|
double length, lengthsquared;
|
||||||
int steps, i;
|
int steps, i;
|
||||||
TAngle<double> deg;
|
TAngle<double> deg;
|
||||||
TVector3<double> step, dir, pos, extend;
|
DVector3 step, dir, pos, extend;
|
||||||
bool fullbright;
|
bool fullbright;
|
||||||
float maxdiff = (float)maxdiff_d;
|
float maxdiff = (float)maxdiff_d;
|
||||||
|
|
||||||
|
@ -681,7 +681,7 @@ void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVecto
|
||||||
// The railgun's sound is special. It gets played from the
|
// The railgun's sound is special. It gets played from the
|
||||||
// point on the slug's trail that is closest to the hearing player.
|
// point on the slug's trail that is closest to the hearing player.
|
||||||
AActor *mo = players[consoleplayer].camera;
|
AActor *mo = players[consoleplayer].camera;
|
||||||
TVector3<double> point;
|
DVector3 point;
|
||||||
double r;
|
double r;
|
||||||
double dirz;
|
double dirz;
|
||||||
|
|
||||||
|
@ -728,7 +728,7 @@ void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVecto
|
||||||
minelem = fabs(dir[i]);
|
minelem = fabs(dir[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TVector3<double> tempvec(0, 0, 0);
|
DVector3 tempvec(0, 0, 0);
|
||||||
tempvec[epos] = 1;
|
tempvec[epos] = 1;
|
||||||
extend = tempvec - (dir | tempvec) * dir;
|
extend = tempvec - (dir | tempvec) * dir;
|
||||||
//
|
//
|
||||||
|
@ -739,7 +739,7 @@ void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVecto
|
||||||
// Create the outer spiral.
|
// Create the outer spiral.
|
||||||
if (color1 != -1 && (!r_rail_smartspiral || color2 == -1) && r_rail_spiralsparsity > 0 && (spawnclass == NULL))
|
if (color1 != -1 && (!r_rail_smartspiral || color2 == -1) && r_rail_spiralsparsity > 0 && (spawnclass == NULL))
|
||||||
{
|
{
|
||||||
TVector3<double> spiral_step = step * r_rail_spiralsparsity * sparsity;
|
DVector3 spiral_step = step * r_rail_spiralsparsity * sparsity;
|
||||||
int spiral_steps = (int)(steps * r_rail_spiralsparsity / sparsity);
|
int spiral_steps = (int)(steps * r_rail_spiralsparsity / sparsity);
|
||||||
|
|
||||||
color1 = color1 == 0 ? -1 : ParticleColor(color1);
|
color1 = color1 == 0 ? -1 : ParticleColor(color1);
|
||||||
|
@ -748,7 +748,7 @@ void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVecto
|
||||||
for (i = spiral_steps; i; i--)
|
for (i = spiral_steps; i; i--)
|
||||||
{
|
{
|
||||||
particle_t *p = NewParticle ();
|
particle_t *p = NewParticle ();
|
||||||
TVector3<double> tempvec;
|
DVector3 tempvec;
|
||||||
|
|
||||||
if (!p)
|
if (!p)
|
||||||
return;
|
return;
|
||||||
|
@ -761,10 +761,10 @@ void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVecto
|
||||||
p->size = 3;
|
p->size = 3;
|
||||||
p->bright = fullbright;
|
p->bright = fullbright;
|
||||||
|
|
||||||
tempvec = TMatrix3x3<double>(dir, deg) * extend;
|
tempvec = DMatrix3x3(dir, deg) * extend;
|
||||||
p->velx = FLOAT2FIXED(tempvec.X * drift)>>4;
|
p->vel.x = FLOAT2FIXED(tempvec.X * drift)>>4;
|
||||||
p->vely = FLOAT2FIXED(tempvec.Y * drift)>>4;
|
p->vel.y = FLOAT2FIXED(tempvec.Y * drift)>>4;
|
||||||
p->velz = FLOAT2FIXED(tempvec.Z * drift)>>4;
|
p->vel.z = FLOAT2FIXED(tempvec.Z * drift)>>4;
|
||||||
tempvec += pos;
|
tempvec += pos;
|
||||||
p->x = FLOAT2FIXED(tempvec.X);
|
p->x = FLOAT2FIXED(tempvec.X);
|
||||||
p->y = FLOAT2FIXED(tempvec.Y);
|
p->y = FLOAT2FIXED(tempvec.Y);
|
||||||
|
@ -795,11 +795,11 @@ void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVecto
|
||||||
// Create the inner trail.
|
// Create the inner trail.
|
||||||
if (color2 != -1 && r_rail_trailsparsity > 0 && spawnclass == NULL)
|
if (color2 != -1 && r_rail_trailsparsity > 0 && spawnclass == NULL)
|
||||||
{
|
{
|
||||||
TVector3<double> trail_step = step * r_rail_trailsparsity * sparsity;
|
DVector3 trail_step = step * r_rail_trailsparsity * sparsity;
|
||||||
int trail_steps = xs_FloorToInt(steps * r_rail_trailsparsity / sparsity);
|
int trail_steps = xs_FloorToInt(steps * r_rail_trailsparsity / sparsity);
|
||||||
|
|
||||||
color2 = color2 == 0 ? -1 : ParticleColor(color2);
|
color2 = color2 == 0 ? -1 : ParticleColor(color2);
|
||||||
TVector3<double> diff(0, 0, 0);
|
DVector3 diff(0, 0, 0);
|
||||||
|
|
||||||
pos = start;
|
pos = start;
|
||||||
for (i = trail_steps; i; i--)
|
for (i = trail_steps; i; i--)
|
||||||
|
@ -822,7 +822,7 @@ void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVecto
|
||||||
diff.Z = clamp<double>(diff.Z + ((rnd & 32) ? 1 : -1), -maxdiff, maxdiff);
|
diff.Z = clamp<double>(diff.Z + ((rnd & 32) ? 1 : -1), -maxdiff, maxdiff);
|
||||||
}
|
}
|
||||||
|
|
||||||
TVector3<double> postmp = pos + diff;
|
DVector3 postmp = pos + diff;
|
||||||
|
|
||||||
p->size = 2;
|
p->size = 2;
|
||||||
p->x = FLOAT2FIXED(postmp.X);
|
p->x = FLOAT2FIXED(postmp.X);
|
||||||
|
@ -857,9 +857,9 @@ void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVecto
|
||||||
if (sparsity < 1)
|
if (sparsity < 1)
|
||||||
sparsity = 32;
|
sparsity = 32;
|
||||||
|
|
||||||
TVector3<double> trail_step = (step / 3) * sparsity;
|
DVector3 trail_step = (step / 3) * sparsity;
|
||||||
int trail_steps = (int)((steps * 3) / sparsity);
|
int trail_steps = (int)((steps * 3) / sparsity);
|
||||||
TVector3<double> diff(0, 0, 0);
|
DVector3 diff(0, 0, 0);
|
||||||
|
|
||||||
pos = start;
|
pos = start;
|
||||||
for (i = trail_steps; i; i--)
|
for (i = trail_steps; i; i--)
|
||||||
|
@ -874,7 +874,7 @@ void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVecto
|
||||||
if (rnd & 4)
|
if (rnd & 4)
|
||||||
diff.Z = clamp<double>(diff.Z + ((rnd & 32) ? 1 : -1), -maxdiff, maxdiff);
|
diff.Z = clamp<double>(diff.Z + ((rnd & 32) ? 1 : -1), -maxdiff, maxdiff);
|
||||||
}
|
}
|
||||||
TVector3<double> postmp = pos + diff;
|
DVector3 postmp = pos + diff;
|
||||||
|
|
||||||
AActor *thing = Spawn (spawnclass, FLOAT2FIXED(postmp.X), FLOAT2FIXED(postmp.Y), FLOAT2FIXED(postmp.Z), ALLOW_REPLACE);
|
AActor *thing = Spawn (spawnclass, FLOAT2FIXED(postmp.X), FLOAT2FIXED(postmp.Y), FLOAT2FIXED(postmp.Z), ALLOW_REPLACE);
|
||||||
if (thing)
|
if (thing)
|
||||||
|
|
|
@ -55,7 +55,7 @@ struct subsector_t;
|
||||||
struct particle_t
|
struct particle_t
|
||||||
{
|
{
|
||||||
fixed_t x,y,z;
|
fixed_t x,y,z;
|
||||||
fixed_t velx,vely,velz;
|
fixedvec3 vel;
|
||||||
fixed_t accx,accy,accz;
|
fixed_t accx,accy,accz;
|
||||||
BYTE ttl;
|
BYTE ttl;
|
||||||
BYTE trans;
|
BYTE trans;
|
||||||
|
@ -83,13 +83,13 @@ particle_t *JitterParticle (int ttl);
|
||||||
particle_t *JitterParticle (int ttl, double drift);
|
particle_t *JitterParticle (int ttl, double drift);
|
||||||
|
|
||||||
void P_ThinkParticles (void);
|
void P_ThinkParticles (void);
|
||||||
void P_SpawnParticle(fixed_t x, fixed_t y, fixed_t z, fixed_t velx, fixed_t vely, fixed_t velz, PalEntry color, bool fullbright, BYTE startalpha, BYTE lifetime, WORD size, int fadestep, fixed_t accelx, fixed_t accely, fixed_t accelz);
|
void P_SpawnParticle(fixed_t x, fixed_t y, fixed_t z, fixed_t vx, fixed_t vy, fixed_t vz, PalEntry color, bool fullbright, BYTE startalpha, BYTE lifetime, WORD size, int fadestep, fixed_t accelx, fixed_t accely, fixed_t accelz);
|
||||||
void P_InitEffects (void);
|
void P_InitEffects (void);
|
||||||
void P_RunEffects (void);
|
void P_RunEffects (void);
|
||||||
|
|
||||||
void P_RunEffect (AActor *actor, int effects);
|
void P_RunEffect (AActor *actor, int effects);
|
||||||
|
|
||||||
void P_DrawRailTrail(AActor *source, const TVector3<double> &start, const TVector3<double> &end, int color1, int color2, double maxdiff = 0, int flags = 0, PClassActor *spawnclass = NULL, angle_t angle = 0, int duration = 35, double sparsity = 1.0, double drift = 1.0, int SpiralOffset = 270);
|
void P_DrawRailTrail(AActor *source, const DVector3 &start, const DVector3 &end, int color1, int color2, double maxdiff = 0, int flags = 0, PClassActor *spawnclass = NULL, angle_t angle = 0, int duration = 35, double sparsity = 1.0, double drift = 1.0, int SpiralOffset = 270);
|
||||||
void P_DrawSplash (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int kind);
|
void P_DrawSplash (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int kind);
|
||||||
void P_DrawSplash2 (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int updown, int kind);
|
void P_DrawSplash2 (int count, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int updown, int kind);
|
||||||
void P_DisconnectEffect (AActor *actor);
|
void P_DisconnectEffect (AActor *actor);
|
||||||
|
|
|
@ -563,8 +563,8 @@ bool P_Move (AActor *actor)
|
||||||
{
|
{
|
||||||
actor->SetOrigin(origx, origy, actor->Z(), false);
|
actor->SetOrigin(origx, origy, actor->Z(), false);
|
||||||
movefactor *= FRACUNIT / ORIG_FRICTION_FACTOR / 4;
|
movefactor *= FRACUNIT / ORIG_FRICTION_FACTOR / 4;
|
||||||
actor->velx += FixedMul (deltax, movefactor);
|
actor->vel.x += FixedMul (deltax, movefactor);
|
||||||
actor->vely += FixedMul (deltay, movefactor);
|
actor->vel.y += FixedMul (deltay, movefactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [RH] If a walking monster is no longer on the floor, move it down
|
// [RH] If a walking monster is no longer on the floor, move it down
|
||||||
|
@ -1732,7 +1732,7 @@ bool P_LookForPlayers (AActor *actor, INTBOOL allaround, FLookExParams *params)
|
||||||
player->mo->flags3 & MF3_GHOST)
|
player->mo->flags3 & MF3_GHOST)
|
||||||
{
|
{
|
||||||
if ((player->mo->AproxDistance (actor) > 2*MELEERANGE)
|
if ((player->mo->AproxDistance (actor) > 2*MELEERANGE)
|
||||||
&& P_AproxDistance (player->mo->velx, player->mo->vely) < 5*FRACUNIT)
|
&& P_AproxDistance (player->mo->vel.x, player->mo->vel.y) < 5*FRACUNIT)
|
||||||
{ // Player is sneaking - can't detect
|
{ // Player is sneaking - can't detect
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -2455,8 +2455,8 @@ void A_DoChase (VMFrameStack *stack, AActor *actor, bool fastchase, FState *mele
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
actor->FastChaseStrafeCount = 0;
|
actor->FastChaseStrafeCount = 0;
|
||||||
actor->velx = 0;
|
actor->vel.x = 0;
|
||||||
actor->vely = 0;
|
actor->vel.y = 0;
|
||||||
fixed_t dist = actor->AproxDistance (actor->target);
|
fixed_t dist = actor->AproxDistance (actor->target);
|
||||||
if (dist < CLASS_BOSS_STRAFE_RANGE)
|
if (dist < CLASS_BOSS_STRAFE_RANGE)
|
||||||
{
|
{
|
||||||
|
@ -2465,8 +2465,8 @@ void A_DoChase (VMFrameStack *stack, AActor *actor, bool fastchase, FState *mele
|
||||||
angle_t ang = actor->AngleTo(actor->target);
|
angle_t ang = actor->AngleTo(actor->target);
|
||||||
if (pr_chase() < 128) ang += ANGLE_90;
|
if (pr_chase() < 128) ang += ANGLE_90;
|
||||||
else ang -= ANGLE_90;
|
else ang -= ANGLE_90;
|
||||||
actor->velx = 13 * finecosine[ang>>ANGLETOFINESHIFT];
|
actor->vel.x = 13 * finecosine[ang>>ANGLETOFINESHIFT];
|
||||||
actor->vely = 13 * finesine[ang>>ANGLETOFINESHIFT];
|
actor->vel.y = 13 * finesine[ang>>ANGLETOFINESHIFT];
|
||||||
actor->FastChaseStrafeCount = 3; // strafe time
|
actor->FastChaseStrafeCount = 3; // strafe time
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2649,7 +2649,7 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
corpsehit->velx = corpsehit->vely = 0;
|
corpsehit->vel.x = corpsehit->vel.y = 0;
|
||||||
// [RH] Check against real height and radius
|
// [RH] Check against real height and radius
|
||||||
|
|
||||||
fixed_t oldheight = corpsehit->height;
|
fixed_t oldheight = corpsehit->height;
|
||||||
|
@ -2871,7 +2871,7 @@ void A_Face (AActor *self, AActor *other, angle_t max_turn, angle_t max_pitch, a
|
||||||
if (max_pitch <= ANGLE_180)
|
if (max_pitch <= ANGLE_180)
|
||||||
{
|
{
|
||||||
fixedvec2 pos = self->Vec2To(other);
|
fixedvec2 pos = self->Vec2To(other);
|
||||||
TVector2<double> dist(pos.x, pos.y);
|
DVector2 dist(pos.x, pos.y);
|
||||||
|
|
||||||
// Positioning ala missile spawning, 32 units above foot level
|
// Positioning ala missile spawning, 32 units above foot level
|
||||||
fixed_t source_z = self->Z() + 32*FRACUNIT + self->GetBobOffset();
|
fixed_t source_z = self->Z() + 32*FRACUNIT + self->GetBobOffset();
|
||||||
|
@ -3007,13 +3007,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail)
|
||||||
{
|
{
|
||||||
// We probably won't hit the target, but aim at it anyway so we don't look stupid.
|
// We probably won't hit the target, but aim at it anyway so we don't look stupid.
|
||||||
fixedvec2 pos = self->Vec2To(self->target);
|
fixedvec2 pos = self->Vec2To(self->target);
|
||||||
TVector2<double> xydiff(pos.x, pos.y);
|
DVector2 xydiff(pos.x, pos.y);
|
||||||
double zdiff = (self->target->Z() + (self->target->height>>1)) - (self->Z() + (self->height>>1) - self->floorclip);
|
double zdiff = (self->target->Z() + (self->target->height>>1)) - (self->Z() + (self->height>>1) - self->floorclip);
|
||||||
self->pitch = int(atan2(zdiff, xydiff.Length()) * ANGLE_180 / -M_PI);
|
self->pitch = int(atan2(zdiff, xydiff.Length()) * ANGLE_180 / -M_PI);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Let the aim trail behind the player
|
// Let the aim trail behind the player
|
||||||
self->angle = self->AngleTo(self->target, -self->target->velx * 3, -self->target->vely * 3);
|
self->angle = self->AngleTo(self->target, -self->target->vel.x * 3, -self->target->vel.y * 3);
|
||||||
|
|
||||||
if (self->target->flags & MF_SHADOW && !(self->flags6 & MF6_SEEINVISIBLE))
|
if (self->target->flags & MF_SHADOW && !(self->flags6 & MF6_SEEINVISIBLE))
|
||||||
{
|
{
|
||||||
|
@ -3230,14 +3230,14 @@ void P_TossItem (AActor *item)
|
||||||
|
|
||||||
if (style==2)
|
if (style==2)
|
||||||
{
|
{
|
||||||
item->velx += pr_dropitem.Random2(7) << FRACBITS;
|
item->vel.x += pr_dropitem.Random2(7) << FRACBITS;
|
||||||
item->vely += pr_dropitem.Random2(7) << FRACBITS;
|
item->vel.y += pr_dropitem.Random2(7) << FRACBITS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item->velx = pr_dropitem.Random2() << 8;
|
item->vel.x = pr_dropitem.Random2() << 8;
|
||||||
item->vely = pr_dropitem.Random2() << 8;
|
item->vel.y = pr_dropitem.Random2() << 8;
|
||||||
item->velz = FRACUNIT*5 + (pr_dropitem() << 10);
|
item->vel.z = FRACUNIT*5 + (pr_dropitem() << 10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -140,7 +140,7 @@ static int CheckForMissingSegs()
|
||||||
if (seg->sidedef!=NULL)
|
if (seg->sidedef!=NULL)
|
||||||
{
|
{
|
||||||
// check all the segs and calculate the length they occupy on their sidedef
|
// check all the segs and calculate the length they occupy on their sidedef
|
||||||
TVector2<double> vec1(seg->v2->x - seg->v1->x, seg->v2->y - seg->v1->y);
|
DVector2 vec1(seg->v2->x - seg->v1->x, seg->v2->y - seg->v1->y);
|
||||||
added_seglen[seg->sidedef - sides] += float(vec1.Length());
|
added_seglen[seg->sidedef - sides] += float(vec1.Length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ static int CheckForMissingSegs()
|
||||||
side_t * side =&sides[i];
|
side_t * side =&sides[i];
|
||||||
line_t * line = side->linedef;
|
line_t * line = side->linedef;
|
||||||
|
|
||||||
TVector2<double> lvec(line->dx, line->dy);
|
DVector2 lvec(line->dx, line->dy);
|
||||||
float linelen = float(lvec.Length());
|
float linelen = float(lvec.Length());
|
||||||
|
|
||||||
missing += (added_seglen[i] < linelen - FRACUNIT);
|
missing += (added_seglen[i] < linelen - FRACUNIT);
|
||||||
|
|
|
@ -974,7 +974,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
{
|
{
|
||||||
target->tics = 1;
|
target->tics = 1;
|
||||||
target->flags6 |= MF6_SHATTERING;
|
target->flags6 |= MF6_SHATTERING;
|
||||||
target->velx = target->vely = target->velz = 0;
|
target->vel.x = target->vel.y = target->vel.z = 0;
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -1029,7 +1029,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
}
|
}
|
||||||
if (target->flags & MF_SKULLFLY)
|
if (target->flags & MF_SKULLFLY)
|
||||||
{
|
{
|
||||||
target->velx = target->vely = target->velz = 0;
|
target->vel.x = target->vel.y = target->vel.z = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
player = target->player;
|
player = target->player;
|
||||||
|
@ -1201,17 +1201,17 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage,
|
||||||
(source->player->ReadyWeapon->WeaponFlags & WIF_STAFF2_KICKBACK))
|
(source->player->ReadyWeapon->WeaponFlags & WIF_STAFF2_KICKBACK))
|
||||||
{
|
{
|
||||||
// Staff power level 2
|
// Staff power level 2
|
||||||
target->velx += FixedMul (10*FRACUNIT, finecosine[ang]);
|
target->vel.x += FixedMul (10*FRACUNIT, finecosine[ang]);
|
||||||
target->vely += FixedMul (10*FRACUNIT, finesine[ang]);
|
target->vel.y += FixedMul (10*FRACUNIT, finesine[ang]);
|
||||||
if (!(target->flags & MF_NOGRAVITY))
|
if (!(target->flags & MF_NOGRAVITY))
|
||||||
{
|
{
|
||||||
target->velz += 5*FRACUNIT;
|
target->vel.z += 5*FRACUNIT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
target->velx += FixedMul (thrust, finecosine[ang]);
|
target->vel.x += FixedMul (thrust, finecosine[ang]);
|
||||||
target->vely += FixedMul (thrust, finesine[ang]);
|
target->vel.y += FixedMul (thrust, finesine[ang]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1132,12 +1132,12 @@ FUNC(LS_ThrustThing)
|
||||||
static void ThrustThingHelper (AActor *it, angle_t angle, int force, INTBOOL nolimit)
|
static void ThrustThingHelper (AActor *it, angle_t angle, int force, INTBOOL nolimit)
|
||||||
{
|
{
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
it->velx += force * finecosine[angle];
|
it->vel.x += force * finecosine[angle];
|
||||||
it->vely += force * finesine[angle];
|
it->vel.y += force * finesine[angle];
|
||||||
if (!nolimit)
|
if (!nolimit)
|
||||||
{
|
{
|
||||||
it->velx = clamp<fixed_t> (it->velx, -MAXMOVE, MAXMOVE);
|
it->vel.x = clamp<fixed_t> (it->vel.x, -MAXMOVE, MAXMOVE);
|
||||||
it->vely = clamp<fixed_t> (it->vely, -MAXMOVE, MAXMOVE);
|
it->vel.y = clamp<fixed_t> (it->vel.y, -MAXMOVE, MAXMOVE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1158,18 +1158,18 @@ FUNC(LS_ThrustThingZ) // [BC]
|
||||||
while ( (victim = iterator.Next ()) )
|
while ( (victim = iterator.Next ()) )
|
||||||
{
|
{
|
||||||
if (!arg3)
|
if (!arg3)
|
||||||
victim->velz = thrust;
|
victim->vel.z = thrust;
|
||||||
else
|
else
|
||||||
victim->velz += thrust;
|
victim->vel.z += thrust;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (it)
|
else if (it)
|
||||||
{
|
{
|
||||||
if (!arg3)
|
if (!arg3)
|
||||||
it->velz = thrust;
|
it->vel.z = thrust;
|
||||||
else
|
else
|
||||||
it->velz += thrust;
|
it->vel.z += thrust;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1700,8 +1700,8 @@ FUNC(LS_Thing_Stop)
|
||||||
{
|
{
|
||||||
if (it != NULL)
|
if (it != NULL)
|
||||||
{
|
{
|
||||||
it->velx = it->vely = it->velz = 0;
|
it->vel.x = it->vel.y = it->vel.z = 0;
|
||||||
if (it->player != NULL) it->player->velx = it->player->vely = 0;
|
if (it->player != NULL) it->player->vel.x = it->player->vel.y = 0;
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1711,8 +1711,8 @@ FUNC(LS_Thing_Stop)
|
||||||
|
|
||||||
while ( (target = iterator.Next ()) )
|
while ( (target = iterator.Next ()) )
|
||||||
{
|
{
|
||||||
target->velx = target->vely = target->velz = 0;
|
target->vel.x = target->vel.y = target->vel.z = 0;
|
||||||
if (target->player != NULL) target->player->velx = target->player->vely = 0;
|
if (target->player != NULL) target->player->vel.x = target->player->vel.y = 0;
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3294,9 +3294,9 @@ FUNC(LS_GlassBreak)
|
||||||
glass->angle = an;
|
glass->angle = an;
|
||||||
an >>= ANGLETOFINESHIFT;
|
an >>= ANGLETOFINESHIFT;
|
||||||
speed = pr_glass() & 3;
|
speed = pr_glass() & 3;
|
||||||
glass->velx = finecosine[an] * speed;
|
glass->vel.x = finecosine[an] * speed;
|
||||||
glass->vely = finesine[an] * speed;
|
glass->vel.y = finesine[an] * speed;
|
||||||
glass->velz = (pr_glass() & 7) << FRACBITS;
|
glass->vel.z = (pr_glass() & 7) << FRACBITS;
|
||||||
// [RH] Let the shards stick around longer than they did in Strife.
|
// [RH] Let the shards stick around longer than they did in Strife.
|
||||||
glass->tics += pr_glass();
|
glass->tics += pr_glass();
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,10 +165,10 @@ inline AActor *P_SpawnMissileXYZ(const fixedvec3 &pos, AActor *source, AActor *d
|
||||||
{
|
{
|
||||||
return P_SpawnMissileXYZ(pos.x, pos.y, pos.z, source, dest, type, checkspawn, owner);
|
return P_SpawnMissileXYZ(pos.x, pos.y, pos.z, source, dest, type, checkspawn, owner);
|
||||||
}
|
}
|
||||||
AActor *P_SpawnMissileAngle (AActor *source, PClassActor *type, angle_t angle, fixed_t velz);
|
AActor *P_SpawnMissileAngle (AActor *source, PClassActor *type, angle_t angle, fixed_t vz);
|
||||||
AActor *P_SpawnMissileAngleSpeed (AActor *source, PClassActor *type, angle_t angle, fixed_t velz, fixed_t speed);
|
AActor *P_SpawnMissileAngleSpeed (AActor *source, PClassActor *type, angle_t angle, fixed_t vz, fixed_t speed);
|
||||||
AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z, PClassActor *type, angle_t angle, fixed_t velz);
|
AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z, PClassActor *type, angle_t angle, fixed_t vz);
|
||||||
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, PClassActor *type, angle_t angle, fixed_t velz, fixed_t speed, AActor *owner=NULL, bool checkspawn = true);
|
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z, PClassActor *type, angle_t angle, fixed_t vz, fixed_t speed, AActor *owner=NULL, bool checkspawn = true);
|
||||||
AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, PClassActor *type);
|
AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, PClassActor *type);
|
||||||
|
|
||||||
AActor *P_SpawnPlayerMissile (AActor* source, PClassActor *type);
|
AActor *P_SpawnPlayerMissile (AActor* source, PClassActor *type);
|
||||||
|
|
116
src/p_map.cpp
116
src/p_map.cpp
|
@ -738,7 +738,7 @@ int P_GetMoveFactor(const AActor *mo, int *frictionp)
|
||||||
// phares 3/11/98: you start off slowly, then increase as
|
// phares 3/11/98: you start off slowly, then increase as
|
||||||
// you get better footing
|
// you get better footing
|
||||||
|
|
||||||
int velocity = P_AproxDistance(mo->velx, mo->vely);
|
int velocity = P_AproxDistance(mo->vel.x, mo->vel.y);
|
||||||
|
|
||||||
if (velocity > MORE_FRICTION_VELOCITY << 2)
|
if (velocity > MORE_FRICTION_VELOCITY << 2)
|
||||||
movefactor <<= 3;
|
movefactor <<= 3;
|
||||||
|
@ -1358,9 +1358,9 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch
|
||||||
if (!(thing->flags2 & MF2_BOSS) && (thing->flags3 & MF3_ISMONSTER) && !(thing->flags3 & MF3_DONTBLAST))
|
if (!(thing->flags2 & MF2_BOSS) && (thing->flags3 & MF3_ISMONSTER) && !(thing->flags3 & MF3_DONTBLAST))
|
||||||
{
|
{
|
||||||
// ideally this should take the mass factor into account
|
// ideally this should take the mass factor into account
|
||||||
thing->velx += tm.thing->velx;
|
thing->vel.x += tm.thing->vel.x;
|
||||||
thing->vely += tm.thing->vely;
|
thing->vel.y += tm.thing->vel.y;
|
||||||
if ((thing->velx + thing->vely) > 3 * FRACUNIT)
|
if ((thing->vel.x + thing->vel.y) > 3 * FRACUNIT)
|
||||||
{
|
{
|
||||||
int newdam;
|
int newdam;
|
||||||
damage = (tm.thing->Mass / 100) + 1;
|
damage = (tm.thing->Mass / 100) + 1;
|
||||||
|
@ -1496,8 +1496,8 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch
|
||||||
{ // Push thing
|
{ // Push thing
|
||||||
if (thing->lastpush != tm.PushTime)
|
if (thing->lastpush != tm.PushTime)
|
||||||
{
|
{
|
||||||
thing->velx += FixedMul(tm.thing->velx, thing->pushfactor);
|
thing->vel.x += FixedMul(tm.thing->vel.x, thing->pushfactor);
|
||||||
thing->vely += FixedMul(tm.thing->vely, thing->pushfactor);
|
thing->vel.y += FixedMul(tm.thing->vel.y, thing->pushfactor);
|
||||||
thing->lastpush = tm.PushTime;
|
thing->lastpush = tm.PushTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1555,8 +1555,8 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch
|
||||||
{ // Push thing
|
{ // Push thing
|
||||||
if (thing->lastpush != tm.PushTime)
|
if (thing->lastpush != tm.PushTime)
|
||||||
{
|
{
|
||||||
thing->velx += FixedMul(tm.thing->velx, thing->pushfactor);
|
thing->vel.x += FixedMul(tm.thing->vel.x, thing->pushfactor);
|
||||||
thing->vely += FixedMul(tm.thing->vely, thing->pushfactor);
|
thing->vel.y += FixedMul(tm.thing->vel.y, thing->pushfactor);
|
||||||
thing->lastpush = tm.PushTime;
|
thing->lastpush = tm.PushTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1938,7 +1938,7 @@ void P_FakeZMovement(AActor *mo)
|
||||||
//
|
//
|
||||||
// adjust height
|
// adjust height
|
||||||
//
|
//
|
||||||
mo->AddZ(mo->velz);
|
mo->AddZ(mo->vel.z);
|
||||||
if ((mo->flags&MF_FLOAT) && mo->target)
|
if ((mo->flags&MF_FLOAT) && mo->target)
|
||||||
{ // float down towards target if too close
|
{ // float down towards target if too close
|
||||||
if (!(mo->flags & MF_SKULLFLY) && !(mo->flags & MF_INFLOAT))
|
if (!(mo->flags & MF_SKULLFLY) && !(mo->flags & MF_INFLOAT))
|
||||||
|
@ -2127,12 +2127,12 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y,
|
||||||
// is not blocked.
|
// is not blocked.
|
||||||
if (thing->Top() > tm.ceilingz)
|
if (thing->Top() > tm.ceilingz)
|
||||||
{
|
{
|
||||||
thing->velz = -8 * FRACUNIT;
|
thing->vel.z = -8 * FRACUNIT;
|
||||||
goto pushline;
|
goto pushline;
|
||||||
}
|
}
|
||||||
else if (thing->Z() < tm.floorz && tm.floorz - tm.dropoffz > thing->MaxDropOffHeight)
|
else if (thing->Z() < tm.floorz && tm.floorz - tm.dropoffz > thing->MaxDropOffHeight)
|
||||||
{
|
{
|
||||||
thing->velz = 8 * FRACUNIT;
|
thing->vel.z = 8 * FRACUNIT;
|
||||||
goto pushline;
|
goto pushline;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -2162,7 +2162,7 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y,
|
||||||
{
|
{
|
||||||
thing->SetZ(tm.floorz);
|
thing->SetZ(tm.floorz);
|
||||||
// If moving down, cancel vertical component of the velocity
|
// If moving down, cancel vertical component of the velocity
|
||||||
if (thing->velz < 0)
|
if (thing->vel.z < 0)
|
||||||
{
|
{
|
||||||
// If it's a bouncer, let it bounce off its new floor, too.
|
// If it's a bouncer, let it bounce off its new floor, too.
|
||||||
if (thing->BounceFlags & BOUNCE_Floors)
|
if (thing->BounceFlags & BOUNCE_Floors)
|
||||||
|
@ -2171,7 +2171,7 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
thing->velz = 0;
|
thing->vel.z = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2243,8 +2243,8 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y,
|
||||||
{
|
{
|
||||||
thing->player->Bot->prev = thing->player->Bot->dest;
|
thing->player->Bot->prev = thing->player->Bot->dest;
|
||||||
thing->player->Bot->dest = NULL;
|
thing->player->Bot->dest = NULL;
|
||||||
thing->velx = 0;
|
thing->vel.x = 0;
|
||||||
thing->vely = 0;
|
thing->vel.y = 0;
|
||||||
thing->SetZ(oldz);
|
thing->SetZ(oldz);
|
||||||
thing->flags6 &= ~MF6_INTRYMOVE;
|
thing->flags6 &= ~MF6_INTRYMOVE;
|
||||||
return false;
|
return false;
|
||||||
|
@ -2341,7 +2341,7 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y,
|
||||||
}
|
}
|
||||||
thing->UnlinkFromWorld();
|
thing->UnlinkFromWorld();
|
||||||
thing->SetXYZ(pos);
|
thing->SetXYZ(pos);
|
||||||
P_TranslatePortalVXVY(ld, thing->velx, thing->vely);
|
P_TranslatePortalVXVY(ld, thing->vel.x, thing->vel.y);
|
||||||
P_TranslatePortalAngle(ld, thing->angle);
|
P_TranslatePortalAngle(ld, thing->angle);
|
||||||
thing->LinkToWorld();
|
thing->LinkToWorld();
|
||||||
P_FindFloorCeiling(thing);
|
P_FindFloorCeiling(thing);
|
||||||
|
@ -2890,7 +2890,7 @@ void FSlide::SlideTraverse(fixed_t startx, fixed_t starty, fixed_t endx, fixed_t
|
||||||
//
|
//
|
||||||
// P_SlideMove
|
// P_SlideMove
|
||||||
//
|
//
|
||||||
// The velx / vely move is bad, so try to slide along a wall.
|
// The vel.x / vel.y move is bad, so try to slide along a wall.
|
||||||
//
|
//
|
||||||
// Find the first line hit, move flush to it, and slide along it
|
// Find the first line hit, move flush to it, and slide along it
|
||||||
//
|
//
|
||||||
|
@ -2971,14 +2971,14 @@ retry:
|
||||||
newy = FixedMul(tryy, bestslidefrac);
|
newy = FixedMul(tryy, bestslidefrac);
|
||||||
|
|
||||||
// [BL] We need to abandon this function if we end up going through a teleporter
|
// [BL] We need to abandon this function if we end up going through a teleporter
|
||||||
const fixed_t startvelx = mo->velx;
|
const fixed_t startvelx = mo->vel.x;
|
||||||
const fixed_t startvely = mo->vely;
|
const fixed_t startvely = mo->vel.y;
|
||||||
|
|
||||||
// killough 3/15/98: Allow objects to drop off ledges
|
// killough 3/15/98: Allow objects to drop off ledges
|
||||||
if (!P_TryMove(mo, mo->X() + newx, mo->Y() + newy, true))
|
if (!P_TryMove(mo, mo->X() + newx, mo->Y() + newy, true))
|
||||||
goto stairstep;
|
goto stairstep;
|
||||||
|
|
||||||
if (mo->velx != startvelx || mo->vely != startvely)
|
if (mo->vel.x != startvelx || mo->vel.y != startvely)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2994,16 +2994,16 @@ retry:
|
||||||
|
|
||||||
HitSlideLine(bestslideline); // clip the moves
|
HitSlideLine(bestslideline); // clip the moves
|
||||||
|
|
||||||
mo->velx = tmxmove * numsteps;
|
mo->vel.x = tmxmove * numsteps;
|
||||||
mo->vely = tmymove * numsteps;
|
mo->vel.y = tmymove * numsteps;
|
||||||
|
|
||||||
// killough 10/98: affect the bobbing the same way (but not voodoo dolls)
|
// killough 10/98: affect the bobbing the same way (but not voodoo dolls)
|
||||||
if (mo->player && mo->player->mo == mo)
|
if (mo->player && mo->player->mo == mo)
|
||||||
{
|
{
|
||||||
if (abs(mo->player->velx) > abs(mo->velx))
|
if (abs(mo->player->vel.x) > abs(mo->vel.x))
|
||||||
mo->player->velx = mo->velx;
|
mo->player->vel.x = mo->vel.x;
|
||||||
if (abs(mo->player->vely) > abs(mo->vely))
|
if (abs(mo->player->vel.y) > abs(mo->vel.y))
|
||||||
mo->player->vely = mo->vely;
|
mo->player->vel.y = mo->vel.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
walkplane = P_CheckSlopeWalk(mo, tmxmove, tmymove);
|
walkplane = P_CheckSlopeWalk(mo, tmxmove, tmymove);
|
||||||
|
@ -3129,8 +3129,8 @@ const secplane_t * P_CheckSlopeWalk(AActor *actor, fixed_t &xmove, fixed_t &ymov
|
||||||
}
|
}
|
||||||
if (dopush)
|
if (dopush)
|
||||||
{
|
{
|
||||||
xmove = actor->velx = plane->a * 2;
|
xmove = actor->vel.x = plane->a * 2;
|
||||||
ymove = actor->vely = plane->b * 2;
|
ymove = actor->vel.y = plane->b * 2;
|
||||||
}
|
}
|
||||||
return (actor->floorsector == actor->Sector) ? plane : NULL;
|
return (actor->floorsector == actor->Sector) ? plane : NULL;
|
||||||
}
|
}
|
||||||
|
@ -3245,7 +3245,7 @@ bool FSlide::BounceWall(AActor *mo)
|
||||||
//
|
//
|
||||||
// trace along the three leading corners
|
// trace along the three leading corners
|
||||||
//
|
//
|
||||||
if (mo->velx > 0)
|
if (mo->vel.x > 0)
|
||||||
{
|
{
|
||||||
leadx = mo->X() + mo->radius;
|
leadx = mo->X() + mo->radius;
|
||||||
}
|
}
|
||||||
|
@ -3253,7 +3253,7 @@ bool FSlide::BounceWall(AActor *mo)
|
||||||
{
|
{
|
||||||
leadx = mo->X() - mo->radius;
|
leadx = mo->X() - mo->radius;
|
||||||
}
|
}
|
||||||
if (mo->vely > 0)
|
if (mo->vel.y > 0)
|
||||||
{
|
{
|
||||||
leady = mo->Y() + mo->radius;
|
leady = mo->Y() + mo->radius;
|
||||||
}
|
}
|
||||||
|
@ -3263,7 +3263,7 @@ bool FSlide::BounceWall(AActor *mo)
|
||||||
}
|
}
|
||||||
bestslidefrac = FRACUNIT + 1;
|
bestslidefrac = FRACUNIT + 1;
|
||||||
bestslideline = mo->BlockingLine;
|
bestslideline = mo->BlockingLine;
|
||||||
if (BounceTraverse(leadx, leady, leadx + mo->velx, leady + mo->vely) && mo->BlockingLine == NULL)
|
if (BounceTraverse(leadx, leady, leadx + mo->vel.x, leady + mo->vel.y) && mo->BlockingLine == NULL)
|
||||||
{ // Could not find a wall, so bounce off the floor/ceiling instead.
|
{ // Could not find a wall, so bounce off the floor/ceiling instead.
|
||||||
fixed_t floordist = mo->Z() - mo->floorz;
|
fixed_t floordist = mo->Z() - mo->floorz;
|
||||||
fixed_t ceildist = mo->ceilingz - mo->Z();
|
fixed_t ceildist = mo->ceilingz - mo->Z();
|
||||||
|
@ -3303,13 +3303,13 @@ bool FSlide::BounceWall(AActor *mo)
|
||||||
{
|
{
|
||||||
lineangle += ANG180;
|
lineangle += ANG180;
|
||||||
}
|
}
|
||||||
moveangle = R_PointToAngle2(0, 0, mo->velx, mo->vely);
|
moveangle = R_PointToAngle2(0, 0, mo->vel.x, mo->vel.y);
|
||||||
deltaangle = (2 * lineangle) - moveangle;
|
deltaangle = (2 * lineangle) - moveangle;
|
||||||
mo->angle = deltaangle;
|
mo->angle = deltaangle;
|
||||||
|
|
||||||
deltaangle >>= ANGLETOFINESHIFT;
|
deltaangle >>= ANGLETOFINESHIFT;
|
||||||
|
|
||||||
movelen = fixed_t(sqrt(double(mo->velx)*mo->velx + double(mo->vely)*mo->vely));
|
movelen = fixed_t(sqrt(double(mo->vel.x)*mo->vel.x + double(mo->vel.y)*mo->vel.y));
|
||||||
movelen = FixedMul(movelen, mo->wallbouncefactor);
|
movelen = FixedMul(movelen, mo->wallbouncefactor);
|
||||||
|
|
||||||
FBoundingBox box(mo->X(), mo->Y(), mo->radius);
|
FBoundingBox box(mo->X(), mo->Y(), mo->radius);
|
||||||
|
@ -3325,8 +3325,8 @@ bool FSlide::BounceWall(AActor *mo)
|
||||||
{
|
{
|
||||||
movelen = 2 * FRACUNIT;
|
movelen = 2 * FRACUNIT;
|
||||||
}
|
}
|
||||||
mo->velx = FixedMul(movelen, finecosine[deltaangle]);
|
mo->vel.x = FixedMul(movelen, finecosine[deltaangle]);
|
||||||
mo->vely = FixedMul(movelen, finesine[deltaangle]);
|
mo->vel.y = FixedMul(movelen, finesine[deltaangle]);
|
||||||
if (mo->BounceFlags & BOUNCE_UseBounceState)
|
if (mo->BounceFlags & BOUNCE_UseBounceState)
|
||||||
{
|
{
|
||||||
FState *bouncestate = mo->FindState(NAME_Bounce, NAME_Wall);
|
FState *bouncestate = mo->FindState(NAME_Bounce, NAME_Wall);
|
||||||
|
@ -3371,12 +3371,12 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
|
||||||
{
|
{
|
||||||
fixed_t speed;
|
fixed_t speed;
|
||||||
angle_t angle = BlockingMobj->AngleTo(mo) + ANGLE_1*((pr_bounce() % 16) - 8);
|
angle_t angle = BlockingMobj->AngleTo(mo) + ANGLE_1*((pr_bounce() % 16) - 8);
|
||||||
speed = P_AproxDistance(mo->velx, mo->vely);
|
speed = P_AproxDistance(mo->vel.x, mo->vel.y);
|
||||||
speed = FixedMul(speed, mo->wallbouncefactor); // [GZ] was 0.75, using wallbouncefactor seems more consistent
|
speed = FixedMul(speed, mo->wallbouncefactor); // [GZ] was 0.75, using wallbouncefactor seems more consistent
|
||||||
mo->angle = angle;
|
mo->angle = angle;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
mo->velx = FixedMul(speed, finecosine[angle]);
|
mo->vel.x = FixedMul(speed, finecosine[angle]);
|
||||||
mo->vely = FixedMul(speed, finesine[angle]);
|
mo->vel.y = FixedMul(speed, finesine[angle]);
|
||||||
mo->PlayBounceSound(true);
|
mo->PlayBounceSound(true);
|
||||||
if (mo->BounceFlags & BOUNCE_UseBounceState)
|
if (mo->BounceFlags & BOUNCE_UseBounceState)
|
||||||
{
|
{
|
||||||
|
@ -3397,11 +3397,11 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fixed_t dot = mo->velz;
|
fixed_t dot = mo->vel.z;
|
||||||
|
|
||||||
if (mo->BounceFlags & (BOUNCE_HereticType | BOUNCE_MBF))
|
if (mo->BounceFlags & (BOUNCE_HereticType | BOUNCE_MBF))
|
||||||
{
|
{
|
||||||
mo->velz -= MulScale15(FRACUNIT, dot);
|
mo->vel.z -= MulScale15(FRACUNIT, dot);
|
||||||
if (!(mo->BounceFlags & BOUNCE_MBF)) // Heretic projectiles die, MBF projectiles don't.
|
if (!(mo->BounceFlags & BOUNCE_MBF)) // Heretic projectiles die, MBF projectiles don't.
|
||||||
{
|
{
|
||||||
mo->flags |= MF_INBOUNCE;
|
mo->flags |= MF_INBOUNCE;
|
||||||
|
@ -3411,24 +3411,24 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mo->velz = FixedMul(mo->velz, mo->bouncefactor);
|
mo->vel.z = FixedMul(mo->vel.z, mo->bouncefactor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else // Don't run through this for MBF-style bounces
|
else // Don't run through this for MBF-style bounces
|
||||||
{
|
{
|
||||||
// The reflected velocity keeps only about 70% of its original speed
|
// The reflected velocity keeps only about 70% of its original speed
|
||||||
mo->velz = FixedMul(mo->velz - MulScale15(FRACUNIT, dot), mo->bouncefactor);
|
mo->vel.z = FixedMul(mo->vel.z - MulScale15(FRACUNIT, dot), mo->bouncefactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
mo->PlayBounceSound(true);
|
mo->PlayBounceSound(true);
|
||||||
if (mo->BounceFlags & BOUNCE_MBF) // Bring it to rest below a certain speed
|
if (mo->BounceFlags & BOUNCE_MBF) // Bring it to rest below a certain speed
|
||||||
{
|
{
|
||||||
if (abs(mo->velz) < (fixed_t)(mo->Mass * mo->GetGravity() / 64))
|
if (abs(mo->vel.z) < (fixed_t)(mo->Mass * mo->GetGravity() / 64))
|
||||||
mo->velz = 0;
|
mo->vel.z = 0;
|
||||||
}
|
}
|
||||||
else if (mo->BounceFlags & (BOUNCE_AutoOff | BOUNCE_AutoOffFloorOnly))
|
else if (mo->BounceFlags & (BOUNCE_AutoOff | BOUNCE_AutoOffFloorOnly))
|
||||||
{
|
{
|
||||||
if (!(mo->flags & MF_NOGRAVITY) && (mo->velz < 3 * FRACUNIT))
|
if (!(mo->flags & MF_NOGRAVITY) && (mo->vel.z < 3 * FRACUNIT))
|
||||||
mo->BounceFlags &= ~BOUNCE_TypeMask;
|
mo->BounceFlags &= ~BOUNCE_TypeMask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4585,11 +4585,11 @@ void P_TraceBleed(int damage, AActor *target, AActor *missile)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (missile->velz != 0)
|
if (missile->vel.z != 0)
|
||||||
{
|
{
|
||||||
double aim;
|
double aim;
|
||||||
|
|
||||||
aim = atan((double)missile->velz / (double)target->AproxDistance(missile));
|
aim = atan((double)missile->vel.z / (double)target->AproxDistance(missile));
|
||||||
pitch = -(int)(aim * ANGLE_180 / PI);
|
pitch = -(int)(aim * ANGLE_180 / PI);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -4704,7 +4704,7 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i
|
||||||
{
|
{
|
||||||
fixed_t vx, vy, vz;
|
fixed_t vx, vy, vz;
|
||||||
angle_t angle, pitch;
|
angle_t angle, pitch;
|
||||||
TVector3<double> start, end;
|
DVector3 start, end;
|
||||||
FTraceResults trace;
|
FTraceResults trace;
|
||||||
fixed_t shootz;
|
fixed_t shootz;
|
||||||
|
|
||||||
|
@ -5357,7 +5357,7 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo
|
||||||
// points and bombdamage should be the same sign
|
// points and bombdamage should be the same sign
|
||||||
if (((points * bombdamage) > 0) && P_CheckSight(thing, bombspot, SF_IGNOREVISIBILITY | SF_IGNOREWATERBOUNDARY))
|
if (((points * bombdamage) > 0) && P_CheckSight(thing, bombspot, SF_IGNOREVISIBILITY | SF_IGNOREWATERBOUNDARY))
|
||||||
{ // OK to damage; target is in direct path
|
{ // OK to damage; target is in direct path
|
||||||
double velz;
|
double vz;
|
||||||
double thrust;
|
double thrust;
|
||||||
int damage = abs((int)points);
|
int damage = abs((int)points);
|
||||||
int newdam = damage;
|
int newdam = damage;
|
||||||
|
@ -5384,20 +5384,20 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo
|
||||||
{
|
{
|
||||||
thrust *= selfthrustscale;
|
thrust *= selfthrustscale;
|
||||||
}
|
}
|
||||||
velz = (double)(thing->Z() + (thing->height >> 1) - bombspot->Z()) * thrust;
|
vz = (double)(thing->Z() + (thing->height >> 1) - bombspot->Z()) * thrust;
|
||||||
if (bombsource != thing)
|
if (bombsource != thing)
|
||||||
{
|
{
|
||||||
velz *= 0.5f;
|
vz *= 0.5f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
velz *= 0.8f;
|
vz *= 0.8f;
|
||||||
}
|
}
|
||||||
angle_t ang = bombspot->AngleTo(thing) >> ANGLETOFINESHIFT;
|
angle_t ang = bombspot->AngleTo(thing) >> ANGLETOFINESHIFT;
|
||||||
thing->velx += fixed_t(finecosine[ang] * thrust);
|
thing->vel.x += fixed_t(finecosine[ang] * thrust);
|
||||||
thing->vely += fixed_t(finesine[ang] * thrust);
|
thing->vel.y += fixed_t(finesine[ang] * thrust);
|
||||||
if (!(flags & RADF_NODAMAGE))
|
if (!(flags & RADF_NODAMAGE))
|
||||||
thing->velz += (fixed_t)velz; // this really doesn't work well
|
thing->vel.z += (fixed_t)vz; // this really doesn't work well
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5656,8 +5656,8 @@ void P_DoCrunch(AActor *thing, FChangePosition *cpos)
|
||||||
|
|
||||||
mo = Spawn(bloodcls, thing->PosPlusZ(thing->height / 2), ALLOW_REPLACE);
|
mo = Spawn(bloodcls, thing->PosPlusZ(thing->height / 2), ALLOW_REPLACE);
|
||||||
|
|
||||||
mo->velx = pr_crunch.Random2() << 12;
|
mo->vel.x = pr_crunch.Random2() << 12;
|
||||||
mo->vely = pr_crunch.Random2() << 12;
|
mo->vel.y = pr_crunch.Random2() << 12;
|
||||||
if (bloodcolor != 0 && !(mo->flags2 & MF2_DONTTRANSLATE))
|
if (bloodcolor != 0 && !(mo->flags2 & MF2_DONTTRANSLATE))
|
||||||
{
|
{
|
||||||
mo->Translation = TRANSLATION(TRANSLATION_Blood, bloodcolor.a);
|
mo->Translation = TRANSLATION(TRANSLATION_Blood, bloodcolor.a);
|
||||||
|
@ -5805,7 +5805,7 @@ void PIT_FloorDrop(AActor *thing, FChangePosition *cpos)
|
||||||
if (oldfloorz == thing->floorz) return;
|
if (oldfloorz == thing->floorz) return;
|
||||||
if (thing->flags4 & MF4_ACTLIKEBRIDGE) return; // do not move bridge things
|
if (thing->flags4 & MF4_ACTLIKEBRIDGE) return; // do not move bridge things
|
||||||
|
|
||||||
if (thing->velz == 0 &&
|
if (thing->vel.z == 0 &&
|
||||||
(!(thing->flags & MF_NOGRAVITY) ||
|
(!(thing->flags & MF_NOGRAVITY) ||
|
||||||
(thing->Z() == oldfloorz && !(thing->flags & MF_NOLIFTDROP))))
|
(thing->Z() == oldfloorz && !(thing->flags & MF_NOLIFTDROP))))
|
||||||
{
|
{
|
||||||
|
|
368
src/p_mobj.cpp
368
src/p_mobj.cpp
|
@ -263,9 +263,9 @@ void AActor::Serialize (FArchive &arc)
|
||||||
<< radius
|
<< radius
|
||||||
<< height
|
<< height
|
||||||
<< projectilepassheight
|
<< projectilepassheight
|
||||||
<< velx
|
<< vel.x
|
||||||
<< vely
|
<< vel.y
|
||||||
<< velz
|
<< vel.z
|
||||||
<< tics
|
<< tics
|
||||||
<< state;
|
<< state;
|
||||||
if (arc.IsStoring())
|
if (arc.IsStoring())
|
||||||
|
@ -842,9 +842,9 @@ AInventory *AActor::DropInventory (AInventory *item)
|
||||||
an = angle >> ANGLETOFINESHIFT;
|
an = angle >> ANGLETOFINESHIFT;
|
||||||
drop->SetOrigin(PosPlusZ(10*FRACUNIT), false);
|
drop->SetOrigin(PosPlusZ(10*FRACUNIT), false);
|
||||||
drop->angle = angle;
|
drop->angle = angle;
|
||||||
drop->velx = velx + 5 * finecosine[an];
|
drop->vel.x = vel.x + 5 * finecosine[an];
|
||||||
drop->vely = vely + 5 * finesine[an];
|
drop->vel.y = vel.y + 5 * finesine[an];
|
||||||
drop->velz = velz + FRACUNIT;
|
drop->vel.z = vel.z + FRACUNIT;
|
||||||
drop->flags &= ~MF_NOGRAVITY; // Don't float
|
drop->flags &= ~MF_NOGRAVITY; // Don't float
|
||||||
drop->ClearCounters(); // do not count for statistics again
|
drop->ClearCounters(); // do not count for statistics again
|
||||||
return drop;
|
return drop;
|
||||||
|
@ -1285,7 +1285,7 @@ bool AActor::Grind(bool items)
|
||||||
if (flags & MF_ICECORPSE)
|
if (flags & MF_ICECORPSE)
|
||||||
{
|
{
|
||||||
tics = 1;
|
tics = 1;
|
||||||
velx = vely = velz = 0;
|
vel.x = vel.y = vel.z = 0;
|
||||||
}
|
}
|
||||||
else if (player)
|
else if (player)
|
||||||
{
|
{
|
||||||
|
@ -1362,7 +1362,7 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mo->velx = mo->vely = mo->velz = 0;
|
mo->vel.x = mo->vel.y = mo->vel.z = 0;
|
||||||
mo->effects = 0; // [RH]
|
mo->effects = 0; // [RH]
|
||||||
mo->flags &= ~MF_SHOOTABLE;
|
mo->flags &= ~MF_SHOOTABLE;
|
||||||
|
|
||||||
|
@ -1569,14 +1569,14 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
fixed_t dot = TMulScale16 (velx, plane.a, vely, plane.b, velz, plane.c);
|
fixed_t dot = TMulScale16 (vel.x, plane.a, vel.y, plane.b, vel.z, plane.c);
|
||||||
|
|
||||||
if (BounceFlags & (BOUNCE_HereticType | BOUNCE_MBF))
|
if (BounceFlags & (BOUNCE_HereticType | BOUNCE_MBF))
|
||||||
{
|
{
|
||||||
velx -= MulScale15 (plane.a, dot);
|
vel.x -= MulScale15 (plane.a, dot);
|
||||||
vely -= MulScale15 (plane.b, dot);
|
vel.y -= MulScale15 (plane.b, dot);
|
||||||
velz -= MulScale15 (plane.c, dot);
|
vel.z -= MulScale15 (plane.c, dot);
|
||||||
angle = R_PointToAngle2 (0, 0, velx, vely);
|
angle = R_PointToAngle2 (0, 0, vel.x, vel.y);
|
||||||
if (!(BounceFlags & BOUNCE_MBF)) // Heretic projectiles die, MBF projectiles don't.
|
if (!(BounceFlags & BOUNCE_MBF)) // Heretic projectiles die, MBF projectiles don't.
|
||||||
{
|
{
|
||||||
flags |= MF_INBOUNCE;
|
flags |= MF_INBOUNCE;
|
||||||
|
@ -1584,15 +1584,15 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
||||||
flags &= ~MF_INBOUNCE;
|
flags &= ~MF_INBOUNCE;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else velz = FixedMul(velz, bouncefactor);
|
else vel.z = FixedMul(vel.z, bouncefactor);
|
||||||
}
|
}
|
||||||
else // Don't run through this for MBF-style bounces
|
else // Don't run through this for MBF-style bounces
|
||||||
{
|
{
|
||||||
// The reflected velocity keeps only about 70% of its original speed
|
// The reflected velocity keeps only about 70% of its original speed
|
||||||
velx = FixedMul (velx - MulScale15 (plane.a, dot), bouncefactor);
|
vel.x = FixedMul (vel.x - MulScale15 (plane.a, dot), bouncefactor);
|
||||||
vely = FixedMul (vely - MulScale15 (plane.b, dot), bouncefactor);
|
vel.y = FixedMul (vel.y - MulScale15 (plane.b, dot), bouncefactor);
|
||||||
velz = FixedMul (velz - MulScale15 (plane.c, dot), bouncefactor);
|
vel.z = FixedMul (vel.z - MulScale15 (plane.c, dot), bouncefactor);
|
||||||
angle = R_PointToAngle2 (0, 0, velx, vely);
|
angle = R_PointToAngle2 (0, 0, vel.x, vel.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayBounceSound(true);
|
PlayBounceSound(true);
|
||||||
|
@ -1614,15 +1614,15 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
||||||
|
|
||||||
if (BounceFlags & BOUNCE_MBF) // Bring it to rest below a certain speed
|
if (BounceFlags & BOUNCE_MBF) // Bring it to rest below a certain speed
|
||||||
{
|
{
|
||||||
if (abs(velz) < (fixed_t)(Mass * GetGravity() / 64))
|
if (abs(vel.z) < (fixed_t)(Mass * GetGravity() / 64))
|
||||||
velz = 0;
|
vel.z = 0;
|
||||||
}
|
}
|
||||||
else if (BounceFlags & (BOUNCE_AutoOff|BOUNCE_AutoOffFloorOnly))
|
else if (BounceFlags & (BOUNCE_AutoOff|BOUNCE_AutoOffFloorOnly))
|
||||||
{
|
{
|
||||||
if (plane.c > 0 || (BounceFlags & BOUNCE_AutoOff))
|
if (plane.c > 0 || (BounceFlags & BOUNCE_AutoOff))
|
||||||
{
|
{
|
||||||
// AutoOff only works when bouncing off a floor, not a ceiling (or in compatibility mode.)
|
// AutoOff only works when bouncing off a floor, not a ceiling (or in compatibility mode.)
|
||||||
if (!(flags & MF_NOGRAVITY) && (velz < 3*FRACUNIT))
|
if (!(flags & MF_NOGRAVITY) && (vel.z < 3*FRACUNIT))
|
||||||
BounceFlags &= ~BOUNCE_TypeMask;
|
BounceFlags &= ~BOUNCE_TypeMask;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1638,8 +1638,8 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
||||||
void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move)
|
void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move)
|
||||||
{
|
{
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
mo->velx += FixedMul (move, finecosine[angle]);
|
mo->vel.x += FixedMul (move, finecosine[angle]);
|
||||||
mo->vely += FixedMul (move, finesine[angle]);
|
mo->vel.y += FixedMul (move, finesine[angle]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
@ -1728,7 +1728,7 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci
|
||||||
AActor *target;
|
AActor *target;
|
||||||
fixed_t speed;
|
fixed_t speed;
|
||||||
|
|
||||||
speed = !usecurspeed ? actor->Speed : xs_CRoundToInt(TVector3<double>(actor->velx, actor->vely, actor->velz).Length());
|
speed = !usecurspeed ? actor->Speed : xs_CRoundToInt(DVector3(actor->vel.x, actor->vel.y, actor->vel.z).Length());
|
||||||
target = actor->tracer;
|
target = actor->tracer;
|
||||||
if (target == NULL || !actor->CanSeek(target))
|
if (target == NULL || !actor->CanSeek(target))
|
||||||
{
|
{
|
||||||
|
@ -1764,8 +1764,8 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci
|
||||||
|
|
||||||
if (!precise)
|
if (!precise)
|
||||||
{
|
{
|
||||||
actor->velx = FixedMul (speed, finecosine[angle]);
|
actor->vel.x = FixedMul (speed, finecosine[angle]);
|
||||||
actor->vely = FixedMul (speed, finesine[angle]);
|
actor->vel.y = FixedMul (speed, finesine[angle]);
|
||||||
|
|
||||||
if (!(actor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
if (!(actor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
||||||
{
|
{
|
||||||
|
@ -1777,7 +1777,7 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci
|
||||||
{
|
{
|
||||||
dist = 1;
|
dist = 1;
|
||||||
}
|
}
|
||||||
actor->velz = ((target->Z() + target->height / 2) - (actor->Z() + actor->height / 2)) / dist;
|
actor->vel.z = ((target->Z() + target->height / 2) - (actor->Z() + actor->height / 2)) / dist;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1787,7 +1787,7 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci
|
||||||
if (!(actor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
if (!(actor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
||||||
{ // Need to seek vertically
|
{ // Need to seek vertically
|
||||||
fixedvec2 vec = actor->Vec2To(target);
|
fixedvec2 vec = actor->Vec2To(target);
|
||||||
double dist = MAX(1.0, TVector2<double>(vec.x, vec.y).Length());
|
double dist = MAX(1.0, DVector2(vec.x, vec.y).Length());
|
||||||
// Aim at a player's eyes and at the middle of the actor for everything else.
|
// Aim at a player's eyes and at the middle of the actor for everything else.
|
||||||
fixed_t aimheight = target->height/2;
|
fixed_t aimheight = target->height/2;
|
||||||
if (target->IsKindOf(RUNTIME_CLASS(APlayerPawn)))
|
if (target->IsKindOf(RUNTIME_CLASS(APlayerPawn)))
|
||||||
|
@ -1799,9 +1799,9 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci
|
||||||
}
|
}
|
||||||
|
|
||||||
fixed_t xyscale = FixedMul(speed, finecosine[pitch]);
|
fixed_t xyscale = FixedMul(speed, finecosine[pitch]);
|
||||||
actor->velz = FixedMul(speed, finesine[pitch]);
|
actor->vel.z = FixedMul(speed, finesine[pitch]);
|
||||||
actor->velx = FixedMul(xyscale, finecosine[angle]);
|
actor->vel.x = FixedMul(xyscale, finecosine[angle]);
|
||||||
actor->vely = FixedMul(xyscale, finesine[angle]);
|
actor->vel.y = FixedMul(xyscale, finesine[angle]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -1862,20 +1862,20 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
||||||
(mo->player != NULL && mo->player->crouchfactor < FRACUNIT*3/4))
|
(mo->player != NULL && mo->player->crouchfactor < FRACUNIT*3/4))
|
||||||
{
|
{
|
||||||
// preserve the direction instead of clamping x and y independently.
|
// preserve the direction instead of clamping x and y independently.
|
||||||
xmove = clamp (mo->velx, -maxmove, maxmove);
|
xmove = clamp (mo->vel.x, -maxmove, maxmove);
|
||||||
ymove = clamp (mo->vely, -maxmove, maxmove);
|
ymove = clamp (mo->vel.y, -maxmove, maxmove);
|
||||||
|
|
||||||
fixed_t xfac = FixedDiv(xmove, mo->velx);
|
fixed_t xfac = FixedDiv(xmove, mo->vel.x);
|
||||||
fixed_t yfac = FixedDiv(ymove, mo->vely);
|
fixed_t yfac = FixedDiv(ymove, mo->vel.y);
|
||||||
fixed_t fac = MIN(xfac, yfac);
|
fixed_t fac = MIN(xfac, yfac);
|
||||||
|
|
||||||
xmove = mo->velx = FixedMul(mo->velx, fac);
|
xmove = mo->vel.x = FixedMul(mo->vel.x, fac);
|
||||||
ymove = mo->vely = FixedMul(mo->vely, fac);
|
ymove = mo->vel.y = FixedMul(mo->vel.y, fac);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
xmove = mo->velx;
|
xmove = mo->vel.x;
|
||||||
ymove = mo->vely;
|
ymove = mo->vel.y;
|
||||||
}
|
}
|
||||||
// [RH] Carrying sectors didn't work with low speeds in BOOM. This is
|
// [RH] Carrying sectors didn't work with low speeds in BOOM. This is
|
||||||
// because BOOM relied on the speed being fast enough to accumulate
|
// because BOOM relied on the speed being fast enough to accumulate
|
||||||
|
@ -1885,13 +1885,13 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
||||||
if (abs(scrollx) > CARRYSTOPSPEED)
|
if (abs(scrollx) > CARRYSTOPSPEED)
|
||||||
{
|
{
|
||||||
scrollx = FixedMul (scrollx, CARRYFACTOR);
|
scrollx = FixedMul (scrollx, CARRYFACTOR);
|
||||||
mo->velx += scrollx;
|
mo->vel.x += scrollx;
|
||||||
mo->flags4 |= MF4_SCROLLMOVE;
|
mo->flags4 |= MF4_SCROLLMOVE;
|
||||||
}
|
}
|
||||||
if (abs(scrolly) > CARRYSTOPSPEED)
|
if (abs(scrolly) > CARRYSTOPSPEED)
|
||||||
{
|
{
|
||||||
scrolly = FixedMul (scrolly, CARRYFACTOR);
|
scrolly = FixedMul (scrolly, CARRYFACTOR);
|
||||||
mo->vely += scrolly;
|
mo->vel.y += scrolly;
|
||||||
mo->flags4 |= MF4_SCROLLMOVE;
|
mo->flags4 |= MF4_SCROLLMOVE;
|
||||||
}
|
}
|
||||||
xmove += scrollx;
|
xmove += scrollx;
|
||||||
|
@ -1903,7 +1903,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
||||||
{
|
{
|
||||||
// the skull slammed into something
|
// the skull slammed into something
|
||||||
mo->flags &= ~MF_SKULLFLY;
|
mo->flags &= ~MF_SKULLFLY;
|
||||||
mo->velx = mo->vely = mo->velz = 0;
|
mo->vel.x = mo->vel.y = mo->vel.z = 0;
|
||||||
if (!(mo->flags2 & MF2_DORMANT))
|
if (!(mo->flags2 & MF2_DORMANT))
|
||||||
{
|
{
|
||||||
if (mo->SeeState != NULL) mo->SetState (mo->SeeState);
|
if (mo->SeeState != NULL) mo->SetState (mo->SeeState);
|
||||||
|
@ -1997,7 +1997,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
||||||
*/
|
*/
|
||||||
// [RH] If walking on a slope, stay on the slope
|
// [RH] If walking on a slope, stay on the slope
|
||||||
// killough 3/15/98: Allow objects to drop off
|
// killough 3/15/98: Allow objects to drop off
|
||||||
fixed_t startvelx = mo->velx, startvely = mo->vely;
|
fixed_t startvelx = mo->vel.x, startvely = mo->vel.y;
|
||||||
|
|
||||||
if (!P_TryMove (mo, ptryx, ptryy, true, walkplane, tm))
|
if (!P_TryMove (mo, ptryx, ptryy, true, walkplane, tm))
|
||||||
{
|
{
|
||||||
|
@ -2020,11 +2020,11 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
||||||
(mo->player->cmd.ucmd.forwardmove | mo->player->cmd.ucmd.sidemove) &&
|
(mo->player->cmd.ucmd.forwardmove | mo->player->cmd.ucmd.sidemove) &&
|
||||||
mo->BlockingLine->sidedef[1] != NULL)
|
mo->BlockingLine->sidedef[1] != NULL)
|
||||||
{
|
{
|
||||||
mo->velz = WATER_JUMP_SPEED;
|
mo->vel.z = WATER_JUMP_SPEED;
|
||||||
}
|
}
|
||||||
// If the blocked move executed any push specials that changed the
|
// If the blocked move executed any push specials that changed the
|
||||||
// actor's velocity, do not attempt to slide.
|
// actor's velocity, do not attempt to slide.
|
||||||
if (mo->velx == startvelx && mo->vely == startvely)
|
if (mo->vel.x == startvelx && mo->vel.y == startvely)
|
||||||
{
|
{
|
||||||
if (player && (i_compatflags & COMPATF_WALLRUN))
|
if (player && (i_compatflags & COMPATF_WALLRUN))
|
||||||
{
|
{
|
||||||
|
@ -2032,13 +2032,13 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
||||||
// If the move is done a second time (because it was too fast for one move), it
|
// If the move is done a second time (because it was too fast for one move), it
|
||||||
// is still clipped against the wall at its full speed, so you effectively
|
// is still clipped against the wall at its full speed, so you effectively
|
||||||
// execute two moves in one tic.
|
// execute two moves in one tic.
|
||||||
P_SlideMove (mo, mo->velx, mo->vely, 1);
|
P_SlideMove (mo, mo->vel.x, mo->vel.y, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
P_SlideMove (mo, onestepx, onestepy, totalsteps);
|
P_SlideMove (mo, onestepx, onestepy, totalsteps);
|
||||||
}
|
}
|
||||||
if ((mo->velx | mo->vely) == 0)
|
if ((mo->vel.x | mo->vel.y) == 0)
|
||||||
{
|
{
|
||||||
steps = 0;
|
steps = 0;
|
||||||
}
|
}
|
||||||
|
@ -2046,8 +2046,8 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
||||||
{
|
{
|
||||||
if (!player || !(i_compatflags & COMPATF_WALLRUN))
|
if (!player || !(i_compatflags & COMPATF_WALLRUN))
|
||||||
{
|
{
|
||||||
xmove = mo->velx;
|
xmove = mo->vel.x;
|
||||||
ymove = mo->vely;
|
ymove = mo->vel.y;
|
||||||
onestepx = xmove / steps;
|
onestepx = xmove / steps;
|
||||||
onestepy = ymove / steps;
|
onestepy = ymove / steps;
|
||||||
P_CheckSlopeWalk (mo, xmove, ymove);
|
P_CheckSlopeWalk (mo, xmove, ymove);
|
||||||
|
@ -2068,7 +2068,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
||||||
walkplane = P_CheckSlopeWalk (mo, tx, ty);
|
walkplane = P_CheckSlopeWalk (mo, tx, ty);
|
||||||
if (P_TryMove (mo, mo->X() + tx, mo->Y() + ty, true, walkplane, tm))
|
if (P_TryMove (mo, mo->X() + tx, mo->Y() + ty, true, walkplane, tm))
|
||||||
{
|
{
|
||||||
mo->velx = 0;
|
mo->vel.x = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2076,19 +2076,19 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
||||||
walkplane = P_CheckSlopeWalk (mo, tx, ty);
|
walkplane = P_CheckSlopeWalk (mo, tx, ty);
|
||||||
if (P_TryMove (mo, mo->X() + tx, mo->Y() + ty, true, walkplane, tm))
|
if (P_TryMove (mo, mo->X() + tx, mo->Y() + ty, true, walkplane, tm))
|
||||||
{
|
{
|
||||||
mo->vely = 0;
|
mo->vel.y = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mo->velx = mo->vely = 0;
|
mo->vel.x = mo->vel.y = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (player && player->mo == mo)
|
if (player && player->mo == mo)
|
||||||
{
|
{
|
||||||
if (mo->velx == 0)
|
if (mo->vel.x == 0)
|
||||||
player->velx = 0;
|
player->vel.x = 0;
|
||||||
if (mo->vely == 0)
|
if (mo->vel.y == 0)
|
||||||
player->vely = 0;
|
player->vel.y = 0;
|
||||||
}
|
}
|
||||||
steps = 0;
|
steps = 0;
|
||||||
}
|
}
|
||||||
|
@ -2139,28 +2139,28 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
||||||
//dest->x - source->x
|
//dest->x - source->x
|
||||||
fixedvec3 vect = mo->Vec3To(origin);
|
fixedvec3 vect = mo->Vec3To(origin);
|
||||||
vect.z += origin->height / 2;
|
vect.z += origin->height / 2;
|
||||||
TVector3<double> velocity(vect.x, vect.y, vect.z);
|
DVector3 velocity(vect.x, vect.y, vect.z);
|
||||||
velocity.Resize(speed);
|
velocity.Resize(speed);
|
||||||
mo->velx = (fixed_t)(velocity.X);
|
mo->vel.x = (fixed_t)(velocity.X);
|
||||||
mo->vely = (fixed_t)(velocity.Y);
|
mo->vel.y = (fixed_t)(velocity.Y);
|
||||||
mo->velz = (fixed_t)(velocity.Z);
|
mo->vel.z = (fixed_t)(velocity.Z);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((BlockingMobj->flags7 & MF7_MIRRORREFLECT) && (tg | blockingtg))
|
if ((BlockingMobj->flags7 & MF7_MIRRORREFLECT) && (tg | blockingtg))
|
||||||
{
|
{
|
||||||
mo->angle += ANGLE_180;
|
mo->angle += ANGLE_180;
|
||||||
mo->velx = -mo->velx / 2;
|
mo->vel.x = -mo->vel.x / 2;
|
||||||
mo->vely = -mo->vely / 2;
|
mo->vel.y = -mo->vel.y / 2;
|
||||||
mo->velz = -mo->velz / 2;
|
mo->vel.z = -mo->vel.z / 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mo->angle = angle;
|
mo->angle = angle;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
mo->velx = FixedMul(mo->Speed >> 1, finecosine[angle]);
|
mo->vel.x = FixedMul(mo->Speed >> 1, finecosine[angle]);
|
||||||
mo->vely = FixedMul(mo->Speed >> 1, finesine[angle]);
|
mo->vel.y = FixedMul(mo->Speed >> 1, finesine[angle]);
|
||||||
mo->velz = -mo->velz / 2;
|
mo->vel.z = -mo->vel.z / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2202,7 +2202,7 @@ explode:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mo->velx = mo->vely = 0;
|
mo->vel.x = mo->vel.y = 0;
|
||||||
steps = 0;
|
steps = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2214,7 +2214,7 @@ explode:
|
||||||
// must have gone through a teleporter, so stop moving right now if it
|
// must have gone through a teleporter, so stop moving right now if it
|
||||||
// was a regular teleporter. If it was a line-to-line or fogless teleporter,
|
// was a regular teleporter. If it was a line-to-line or fogless teleporter,
|
||||||
// the move should continue, but startx, starty and xmove, ymove need to change.
|
// the move should continue, but startx, starty and xmove, ymove need to change.
|
||||||
if (mo->velx == 0 && mo->vely == 0)
|
if (mo->vel.x == 0 && mo->vel.y == 0)
|
||||||
{
|
{
|
||||||
step = steps;
|
step = steps;
|
||||||
}
|
}
|
||||||
|
@ -2243,8 +2243,8 @@ explode:
|
||||||
|
|
||||||
if (player && player->mo == mo && player->cheats & CF_NOVELOCITY)
|
if (player && player->mo == mo && player->cheats & CF_NOVELOCITY)
|
||||||
{ // debug option for no sliding at all
|
{ // debug option for no sliding at all
|
||||||
mo->velx = mo->vely = 0;
|
mo->vel.x = mo->vel.y = 0;
|
||||||
player->velx = player->vely = 0;
|
player->vel.x = player->vel.y = 0;
|
||||||
return oldfloorz;
|
return oldfloorz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2260,13 +2260,13 @@ explode:
|
||||||
{ // [RH] Friction when falling is available for larger aircontrols
|
{ // [RH] Friction when falling is available for larger aircontrols
|
||||||
if (player != NULL && level.airfriction != FRACUNIT)
|
if (player != NULL && level.airfriction != FRACUNIT)
|
||||||
{
|
{
|
||||||
mo->velx = FixedMul (mo->velx, level.airfriction);
|
mo->vel.x = FixedMul (mo->vel.x, level.airfriction);
|
||||||
mo->vely = FixedMul (mo->vely, level.airfriction);
|
mo->vel.y = FixedMul (mo->vel.y, level.airfriction);
|
||||||
|
|
||||||
if (player->mo == mo) // Not voodoo dolls
|
if (player->mo == mo) // Not voodoo dolls
|
||||||
{
|
{
|
||||||
player->velx = FixedMul (player->velx, level.airfriction);
|
player->vel.x = FixedMul (player->vel.x, level.airfriction);
|
||||||
player->vely = FixedMul (player->vely, level.airfriction);
|
player->vel.y = FixedMul (player->vel.y, level.airfriction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return oldfloorz;
|
return oldfloorz;
|
||||||
|
@ -2277,7 +2277,7 @@ explode:
|
||||||
// killough 11/98: only include bouncers hanging off ledges
|
// killough 11/98: only include bouncers hanging off ledges
|
||||||
if ((mo->flags & MF_CORPSE) || (mo->BounceFlags & BOUNCE_MBF && mo->Z() > mo->dropoffz) || (mo->flags6 & MF6_FALLING))
|
if ((mo->flags & MF_CORPSE) || (mo->BounceFlags & BOUNCE_MBF && mo->Z() > mo->dropoffz) || (mo->flags6 & MF6_FALLING))
|
||||||
{ // Don't stop sliding if halfway off a step with some velocity
|
{ // Don't stop sliding if halfway off a step with some velocity
|
||||||
if (mo->velx > FRACUNIT/4 || mo->velx < -FRACUNIT/4 || mo->vely > FRACUNIT/4 || mo->vely < -FRACUNIT/4)
|
if (mo->vel.x > FRACUNIT/4 || mo->vel.x < -FRACUNIT/4 || mo->vel.y > FRACUNIT/4 || mo->vel.y < -FRACUNIT/4)
|
||||||
{
|
{
|
||||||
if (mo->floorz > mo->Sector->floorplane.ZatPoint(mo))
|
if (mo->floorz > mo->Sector->floorplane.ZatPoint(mo))
|
||||||
{
|
{
|
||||||
|
@ -2302,8 +2302,8 @@ explode:
|
||||||
// killough 11/98:
|
// killough 11/98:
|
||||||
// Stop voodoo dolls that have come to rest, despite any
|
// Stop voodoo dolls that have come to rest, despite any
|
||||||
// moving corresponding player:
|
// moving corresponding player:
|
||||||
if (mo->velx > -STOPSPEED && mo->velx < STOPSPEED
|
if (mo->vel.x > -STOPSPEED && mo->vel.x < STOPSPEED
|
||||||
&& mo->vely > -STOPSPEED && mo->vely < STOPSPEED
|
&& mo->vel.y > -STOPSPEED && mo->vel.y < STOPSPEED
|
||||||
&& (!player || (player->mo != mo)
|
&& (!player || (player->mo != mo)
|
||||||
|| !(player->cmd.ucmd.forwardmove | player->cmd.ucmd.sidemove)))
|
|| !(player->cmd.ucmd.forwardmove | player->cmd.ucmd.sidemove)))
|
||||||
{
|
{
|
||||||
|
@ -2315,12 +2315,12 @@ explode:
|
||||||
player->mo->PlayIdle ();
|
player->mo->PlayIdle ();
|
||||||
}
|
}
|
||||||
|
|
||||||
mo->velx = mo->vely = 0;
|
mo->vel.x = mo->vel.y = 0;
|
||||||
mo->flags4 &= ~MF4_SCROLLMOVE;
|
mo->flags4 &= ~MF4_SCROLLMOVE;
|
||||||
|
|
||||||
// killough 10/98: kill any bobbing velocity too (except in voodoo dolls)
|
// killough 10/98: kill any bobbing velocity too (except in voodoo dolls)
|
||||||
if (player && player->mo == mo)
|
if (player && player->mo == mo)
|
||||||
player->velx = player->vely = 0;
|
player->vel.x = player->vel.y = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2339,8 +2339,8 @@ explode:
|
||||||
|
|
||||||
fixed_t friction = P_GetFriction (mo, NULL);
|
fixed_t friction = P_GetFriction (mo, NULL);
|
||||||
|
|
||||||
mo->velx = FixedMul (mo->velx, friction);
|
mo->vel.x = FixedMul (mo->vel.x, friction);
|
||||||
mo->vely = FixedMul (mo->vely, friction);
|
mo->vel.y = FixedMul (mo->vel.y, friction);
|
||||||
|
|
||||||
// killough 10/98: Always decrease player bobbing by ORIG_FRICTION.
|
// killough 10/98: Always decrease player bobbing by ORIG_FRICTION.
|
||||||
// This prevents problems with bobbing on ice, where it was not being
|
// This prevents problems with bobbing on ice, where it was not being
|
||||||
|
@ -2348,8 +2348,8 @@ explode:
|
||||||
|
|
||||||
if (player && player->mo == mo) // Not voodoo dolls
|
if (player && player->mo == mo) // Not voodoo dolls
|
||||||
{
|
{
|
||||||
player->velx = FixedMul (player->velx, ORIG_FRICTION);
|
player->vel.x = FixedMul (player->vel.x, ORIG_FRICTION);
|
||||||
player->vely = FixedMul (player->vely, ORIG_FRICTION);
|
player->vel.y = FixedMul (player->vel.y, ORIG_FRICTION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return oldfloorz;
|
return oldfloorz;
|
||||||
|
@ -2366,7 +2366,7 @@ void P_MonsterFallingDamage (AActor *mo)
|
||||||
if (mo->floorsector->Flags & SECF_NOFALLINGDAMAGE)
|
if (mo->floorsector->Flags & SECF_NOFALLINGDAMAGE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vel = abs(mo->velz);
|
vel = abs(mo->vel.z);
|
||||||
if (vel > 35*FRACUNIT)
|
if (vel > 35*FRACUNIT)
|
||||||
{ // automatic death
|
{ // automatic death
|
||||||
damage = TELEFRAG_DAMAGE;
|
damage = TELEFRAG_DAMAGE;
|
||||||
|
@ -2399,27 +2399,27 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
||||||
mo->player->deltaviewheight = mo->player->GetDeltaViewHeight();
|
mo->player->deltaviewheight = mo->player->GetDeltaViewHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
mo->AddZ(mo->velz);
|
mo->AddZ(mo->vel.z);
|
||||||
|
|
||||||
//
|
//
|
||||||
// apply gravity
|
// apply gravity
|
||||||
//
|
//
|
||||||
if (mo->Z() > mo->floorz && !(mo->flags & MF_NOGRAVITY))
|
if (mo->Z() > mo->floorz && !(mo->flags & MF_NOGRAVITY))
|
||||||
{
|
{
|
||||||
fixed_t startvelz = mo->velz;
|
fixed_t startvelz = mo->vel.z;
|
||||||
|
|
||||||
if (mo->waterlevel == 0 || (mo->player &&
|
if (mo->waterlevel == 0 || (mo->player &&
|
||||||
!(mo->player->cmd.ucmd.forwardmove | mo->player->cmd.ucmd.sidemove)))
|
!(mo->player->cmd.ucmd.forwardmove | mo->player->cmd.ucmd.sidemove)))
|
||||||
{
|
{
|
||||||
// [RH] Double gravity only if running off a ledge. Coming down from
|
// [RH] Double gravity only if running off a ledge. Coming down from
|
||||||
// an upward thrust (e.g. a jump) should not double it.
|
// an upward thrust (e.g. a jump) should not double it.
|
||||||
if (mo->velz == 0 && oldfloorz > mo->floorz && mo->Z() == oldfloorz)
|
if (mo->vel.z == 0 && oldfloorz > mo->floorz && mo->Z() == oldfloorz)
|
||||||
{
|
{
|
||||||
mo->velz -= grav + grav;
|
mo->vel.z -= grav + grav;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mo->velz -= grav;
|
mo->vel.z -= grav;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mo->player == NULL)
|
if (mo->player == NULL)
|
||||||
|
@ -2443,20 +2443,20 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
||||||
sinkspeed = Scale(sinkspeed, clamp(mo->Mass, 1, 4000), 100);
|
sinkspeed = Scale(sinkspeed, clamp(mo->Mass, 1, 4000), 100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mo->velz < sinkspeed)
|
if (mo->vel.z < sinkspeed)
|
||||||
{ // Dropping too fast, so slow down toward sinkspeed.
|
{ // Dropping too fast, so slow down toward sinkspeed.
|
||||||
mo->velz -= MAX(sinkspeed*2, -FRACUNIT*8);
|
mo->vel.z -= MAX(sinkspeed*2, -FRACUNIT*8);
|
||||||
if (mo->velz > sinkspeed)
|
if (mo->vel.z > sinkspeed)
|
||||||
{
|
{
|
||||||
mo->velz = sinkspeed;
|
mo->vel.z = sinkspeed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mo->velz > sinkspeed)
|
else if (mo->vel.z > sinkspeed)
|
||||||
{ // Dropping too slow/going up, so trend toward sinkspeed.
|
{ // Dropping too slow/going up, so trend toward sinkspeed.
|
||||||
mo->velz = startvelz + MAX(sinkspeed/3, -FRACUNIT*8);
|
mo->vel.z = startvelz + MAX(sinkspeed/3, -FRACUNIT*8);
|
||||||
if (mo->velz < sinkspeed)
|
if (mo->vel.z < sinkspeed)
|
||||||
{
|
{
|
||||||
mo->velz = sinkspeed;
|
mo->vel.z = sinkspeed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2467,13 +2467,13 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
||||||
{
|
{
|
||||||
fixed_t sinkspeed = -WATER_SINK_SPEED;
|
fixed_t sinkspeed = -WATER_SINK_SPEED;
|
||||||
|
|
||||||
if (mo->velz < sinkspeed)
|
if (mo->vel.z < sinkspeed)
|
||||||
{
|
{
|
||||||
mo->velz = (startvelz < sinkspeed) ? startvelz : sinkspeed;
|
mo->vel.z = (startvelz < sinkspeed) ? startvelz : sinkspeed;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mo->velz = startvelz + ((mo->velz - startvelz) >>
|
mo->vel.z = startvelz + ((mo->vel.z - startvelz) >>
|
||||||
(mo->waterlevel == 1 ? WATER_SINK_SMALL_FACTOR : WATER_SINK_FACTOR));
|
(mo->waterlevel == 1 ? WATER_SINK_SMALL_FACTOR : WATER_SINK_FACTOR));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2511,11 +2511,11 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
||||||
{
|
{
|
||||||
mo->AddZ(finesine[(FINEANGLES/80*level.maptime)&FINEMASK]/8);
|
mo->AddZ(finesine[(FINEANGLES/80*level.maptime)&FINEMASK]/8);
|
||||||
}
|
}
|
||||||
mo->velz = FixedMul (mo->velz, FRICTION_FLY);
|
mo->vel.z = FixedMul (mo->vel.z, FRICTION_FLY);
|
||||||
}
|
}
|
||||||
if (mo->waterlevel && !(mo->flags & MF_NOGRAVITY))
|
if (mo->waterlevel && !(mo->flags & MF_NOGRAVITY))
|
||||||
{
|
{
|
||||||
mo->velz = FixedMul (mo->velz, mo->Sector->friction);
|
mo->vel.z = FixedMul (mo->vel.z, mo->Sector->friction);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -2545,7 +2545,7 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
||||||
else if (mo->flags3 & MF3_NOEXPLODEFLOOR)
|
else if (mo->flags3 & MF3_NOEXPLODEFLOOR)
|
||||||
{
|
{
|
||||||
P_HitFloor (mo);
|
P_HitFloor (mo);
|
||||||
mo->velz = 0;
|
mo->vel.z = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (mo->flags3 & MF3_FLOORHUGGER)
|
else if (mo->flags3 & MF3_FLOORHUGGER)
|
||||||
|
@ -2566,41 +2566,41 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mo->BounceFlags & BOUNCE_MBF && mo->velz) // check for MBF-like bounce on non-missiles
|
else if (mo->BounceFlags & BOUNCE_MBF && mo->vel.z) // check for MBF-like bounce on non-missiles
|
||||||
{
|
{
|
||||||
mo->FloorBounceMissile(mo->floorsector->floorplane);
|
mo->FloorBounceMissile(mo->floorsector->floorplane);
|
||||||
}
|
}
|
||||||
if (mo->flags3 & MF3_ISMONSTER) // Blasted mobj falling
|
if (mo->flags3 & MF3_ISMONSTER) // Blasted mobj falling
|
||||||
{
|
{
|
||||||
if (mo->velz < -(23*FRACUNIT))
|
if (mo->vel.z < -(23*FRACUNIT))
|
||||||
{
|
{
|
||||||
P_MonsterFallingDamage (mo);
|
P_MonsterFallingDamage (mo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mo->SetZ(mo->floorz);
|
mo->SetZ(mo->floorz);
|
||||||
if (mo->velz < 0)
|
if (mo->vel.z < 0)
|
||||||
{
|
{
|
||||||
const fixed_t minvel = -8*FRACUNIT; // landing speed from a jump with normal gravity
|
const fixed_t minvel = -8*FRACUNIT; // landing speed from a jump with normal gravity
|
||||||
|
|
||||||
// Spawn splashes, etc.
|
// Spawn splashes, etc.
|
||||||
P_HitFloor (mo);
|
P_HitFloor (mo);
|
||||||
if (mo->DamageType == NAME_Ice && mo->velz < minvel)
|
if (mo->DamageType == NAME_Ice && mo->vel.z < minvel)
|
||||||
{
|
{
|
||||||
mo->tics = 1;
|
mo->tics = 1;
|
||||||
mo->velx = 0;
|
mo->vel.x = 0;
|
||||||
mo->vely = 0;
|
mo->vel.y = 0;
|
||||||
mo->velz = 0;
|
mo->vel.z = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Let the actor do something special for hitting the floor
|
// Let the actor do something special for hitting the floor
|
||||||
mo->HitFloor ();
|
mo->HitFloor ();
|
||||||
if (mo->player)
|
if (mo->player)
|
||||||
{
|
{
|
||||||
if (mo->player->jumpTics < 0 || mo->velz < minvel)
|
if (mo->player->jumpTics < 0 || mo->vel.z < minvel)
|
||||||
{ // delay any jumping for a short while
|
{ // delay any jumping for a short while
|
||||||
mo->player->jumpTics = 7;
|
mo->player->jumpTics = 7;
|
||||||
}
|
}
|
||||||
if (mo->velz < minvel && !(mo->flags & MF_NOGRAVITY))
|
if (mo->vel.z < minvel && !(mo->flags & MF_NOGRAVITY))
|
||||||
{
|
{
|
||||||
// Squat down.
|
// Squat down.
|
||||||
// Decrease viewheight for a moment after hitting the ground (hard),
|
// Decrease viewheight for a moment after hitting the ground (hard),
|
||||||
|
@ -2608,11 +2608,11 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
||||||
PlayerLandedOnThing (mo, NULL);
|
PlayerLandedOnThing (mo, NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mo->velz = 0;
|
mo->vel.z = 0;
|
||||||
}
|
}
|
||||||
if (mo->flags & MF_SKULLFLY)
|
if (mo->flags & MF_SKULLFLY)
|
||||||
{ // The skull slammed into something
|
{ // The skull slammed into something
|
||||||
mo->velz = -mo->velz;
|
mo->vel.z = -mo->vel.z;
|
||||||
}
|
}
|
||||||
mo->Crash();
|
mo->Crash();
|
||||||
}
|
}
|
||||||
|
@ -2644,10 +2644,10 @@ void P_ZMovement (AActor *mo, fixed_t oldfloorz)
|
||||||
}
|
}
|
||||||
if (mo->flags & MF_SKULLFLY)
|
if (mo->flags & MF_SKULLFLY)
|
||||||
{ // the skull slammed into something
|
{ // the skull slammed into something
|
||||||
mo->velz = -mo->velz;
|
mo->vel.z = -mo->vel.z;
|
||||||
}
|
}
|
||||||
if (mo->velz > 0)
|
if (mo->vel.z > 0)
|
||||||
mo->velz = 0;
|
mo->vel.z = 0;
|
||||||
if ((mo->flags & MF_MISSILE) && !(mo->flags & MF_NOCLIP))
|
if ((mo->flags & MF_MISSILE) && !(mo->flags & MF_NOCLIP))
|
||||||
{
|
{
|
||||||
if (mo->flags3 & MF3_CEILINGHUGGER)
|
if (mo->flags3 & MF3_CEILINGHUGGER)
|
||||||
|
@ -2745,7 +2745,7 @@ static void PlayerLandedOnThing (AActor *mo, AActor *onmobj)
|
||||||
|
|
||||||
if (mo->player->mo == mo)
|
if (mo->player->mo == mo)
|
||||||
{
|
{
|
||||||
mo->player->deltaviewheight = mo->velz >> 3;
|
mo->player->deltaviewheight = mo->vel.z >> 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mo->player->cheats & CF_PREDICTING)
|
if (mo->player->cheats & CF_PREDICTING)
|
||||||
|
@ -2758,7 +2758,7 @@ static void PlayerLandedOnThing (AActor *mo, AActor *onmobj)
|
||||||
{
|
{
|
||||||
grunted = false;
|
grunted = false;
|
||||||
// Why should this number vary by gravity?
|
// Why should this number vary by gravity?
|
||||||
if (mo->health > 0 && mo->velz < -mo->player->mo->GruntSpeed)
|
if (mo->health > 0 && mo->vel.z < -mo->player->mo->GruntSpeed)
|
||||||
{
|
{
|
||||||
S_Sound (mo, CHAN_VOICE, "*grunt", 1, ATTN_NORM);
|
S_Sound (mo, CHAN_VOICE, "*grunt", 1, ATTN_NORM);
|
||||||
grunted = true;
|
grunted = true;
|
||||||
|
@ -3085,7 +3085,7 @@ void AActor::HitFloor ()
|
||||||
bool AActor::Slam (AActor *thing)
|
bool AActor::Slam (AActor *thing)
|
||||||
{
|
{
|
||||||
flags &= ~MF_SKULLFLY;
|
flags &= ~MF_SKULLFLY;
|
||||||
velx = vely = velz = 0;
|
vel.x = vel.y = vel.z = 0;
|
||||||
if (health > 0)
|
if (health > 0)
|
||||||
{
|
{
|
||||||
if (!(flags2 & MF2_DORMANT))
|
if (!(flags2 & MF2_DORMANT))
|
||||||
|
@ -3440,7 +3440,7 @@ void AActor::Tick ()
|
||||||
|
|
||||||
UnlinkFromWorld ();
|
UnlinkFromWorld ();
|
||||||
flags |= MF_NOBLOCKMAP;
|
flags |= MF_NOBLOCKMAP;
|
||||||
SetXYZ(Vec3Offset(velx, vely, velz));
|
SetXYZ(Vec3Offset(vel.x, vel.y, vel.z));
|
||||||
CheckPortalTransition(false);
|
CheckPortalTransition(false);
|
||||||
LinkToWorld ();
|
LinkToWorld ();
|
||||||
}
|
}
|
||||||
|
@ -3488,7 +3488,7 @@ void AActor::Tick ()
|
||||||
{
|
{
|
||||||
// add some smoke behind the rocket
|
// add some smoke behind the rocket
|
||||||
smokecounter = 0;
|
smokecounter = 0;
|
||||||
AActor *th = Spawn("RocketSmokeTrail", Vec3Offset(-velx, -vely, -velz), ALLOW_REPLACE);
|
AActor *th = Spawn("RocketSmokeTrail", Vec3Offset(-vel.x, -vel.y, -vel.z), ALLOW_REPLACE);
|
||||||
if (th)
|
if (th)
|
||||||
{
|
{
|
||||||
th->tics -= pr_rockettrail()&3;
|
th->tics -= pr_rockettrail()&3;
|
||||||
|
@ -3502,10 +3502,10 @@ void AActor::Tick ()
|
||||||
if (++smokecounter == 8)
|
if (++smokecounter == 8)
|
||||||
{
|
{
|
||||||
smokecounter = 0;
|
smokecounter = 0;
|
||||||
angle_t moveangle = R_PointToAngle2(0,0,velx,vely);
|
angle_t moveangle = R_PointToAngle2(0,0,vel.x,vel.y);
|
||||||
fixed_t xo = -FixedMul(finecosine[(moveangle) >> ANGLETOFINESHIFT], radius * 2) + (pr_rockettrail() << 10);
|
fixed_t xo = -FixedMul(finecosine[(moveangle) >> ANGLETOFINESHIFT], radius * 2) + (pr_rockettrail() << 10);
|
||||||
fixed_t yo = -FixedMul(finesine[(moveangle) >> ANGLETOFINESHIFT], radius * 2) + (pr_rockettrail() << 10);
|
fixed_t yo = -FixedMul(finesine[(moveangle) >> ANGLETOFINESHIFT], radius * 2) + (pr_rockettrail() << 10);
|
||||||
AActor * th = Spawn("GrenadeSmokeTrail", Vec3Offset(xo, yo, - (height>>3) * (velz>>16) + (2*height)/3), ALLOW_REPLACE);
|
AActor * th = Spawn("GrenadeSmokeTrail", Vec3Offset(xo, yo, - (height>>3) * (vel.z>>16) + (2*height)/3), ALLOW_REPLACE);
|
||||||
if (th)
|
if (th)
|
||||||
{
|
{
|
||||||
th->tics -= pr_rockettrail()&3;
|
th->tics -= pr_rockettrail()&3;
|
||||||
|
@ -3524,14 +3524,14 @@ void AActor::Tick ()
|
||||||
{
|
{
|
||||||
if (health >0)
|
if (health >0)
|
||||||
{
|
{
|
||||||
if (abs (velz) < FRACUNIT/4)
|
if (abs (vel.z) < FRACUNIT/4)
|
||||||
{
|
{
|
||||||
velz = 0;
|
vel.z = 0;
|
||||||
flags4 &= ~MF4_VFRICTION;
|
flags4 &= ~MF4_VFRICTION;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
velz = FixedMul (velz, 0xe800);
|
vel.z = FixedMul (vel.z, 0xe800);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3768,7 +3768,7 @@ void AActor::Tick ()
|
||||||
// [RH] If standing on a steep slope, fall down it
|
// [RH] If standing on a steep slope, fall down it
|
||||||
if ((flags & MF_SOLID) && !(flags & (MF_NOCLIP|MF_NOGRAVITY)) &&
|
if ((flags & MF_SOLID) && !(flags & (MF_NOCLIP|MF_NOGRAVITY)) &&
|
||||||
!(flags & MF_NOBLOCKMAP) &&
|
!(flags & MF_NOBLOCKMAP) &&
|
||||||
velz <= 0 &&
|
vel.z <= 0 &&
|
||||||
floorz == Z())
|
floorz == Z())
|
||||||
{
|
{
|
||||||
secplane_t floorplane;
|
secplane_t floorplane;
|
||||||
|
@ -3799,8 +3799,8 @@ void AActor::Tick ()
|
||||||
}
|
}
|
||||||
if (dopush)
|
if (dopush)
|
||||||
{
|
{
|
||||||
velx += floorplane.a;
|
vel.x += floorplane.a;
|
||||||
vely += floorplane.b;
|
vel.y += floorplane.b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3810,9 +3810,9 @@ void AActor::Tick ()
|
||||||
// still have missiles that go straight up and down through actors without
|
// still have missiles that go straight up and down through actors without
|
||||||
// damaging anything.
|
// damaging anything.
|
||||||
// (for backwards compatibility this must check for lack of damage function, not for zero damage!)
|
// (for backwards compatibility this must check for lack of damage function, not for zero damage!)
|
||||||
if ((flags & MF_MISSILE) && (velx|vely) == 0 && Damage != NULL)
|
if ((flags & MF_MISSILE) && (vel.x|vel.y) == 0 && Damage != NULL)
|
||||||
{
|
{
|
||||||
velx = 1;
|
vel.x = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle X and Y velocities
|
// Handle X and Y velocities
|
||||||
|
@ -3822,7 +3822,7 @@ void AActor::Tick ()
|
||||||
{ // actor was destroyed
|
{ // actor was destroyed
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((velx | vely) == 0) // Actors at rest
|
if ((vel.x | vel.y) == 0) // Actors at rest
|
||||||
{
|
{
|
||||||
if (flags2 & MF2_BLASTED)
|
if (flags2 & MF2_BLASTED)
|
||||||
{ // Reset to not blasted when velocities are gone
|
{ // Reset to not blasted when velocities are gone
|
||||||
|
@ -3834,7 +3834,7 @@ void AActor::Tick ()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (velz || BlockingMobj || Z() != floorz)
|
if (vel.z || BlockingMobj || Z() != floorz)
|
||||||
{ // Handle Z velocity and gravity
|
{ // Handle Z velocity and gravity
|
||||||
if (((flags2 & MF2_PASSMOBJ) || (flags & MF_SPECIAL)) && !(i_compatflags & COMPATF_NO_PASSMOBJ))
|
if (((flags2 & MF2_PASSMOBJ) || (flags & MF_SPECIAL)) && !(i_compatflags & COMPATF_NO_PASSMOBJ))
|
||||||
{
|
{
|
||||||
|
@ -3847,7 +3847,7 @@ void AActor::Tick ()
|
||||||
{
|
{
|
||||||
if (player)
|
if (player)
|
||||||
{
|
{
|
||||||
if (velz < (fixed_t)(level.gravity * Sector->gravity * -655.36f)
|
if (vel.z < (fixed_t)(level.gravity * Sector->gravity * -655.36f)
|
||||||
&& !(flags&MF_NOGRAVITY))
|
&& !(flags&MF_NOGRAVITY))
|
||||||
{
|
{
|
||||||
PlayerLandedOnThing (this, onmo);
|
PlayerLandedOnThing (this, onmo);
|
||||||
|
@ -3883,14 +3883,14 @@ void AActor::Tick ()
|
||||||
onmo->lastbump = level.maptime + TICRATE;
|
onmo->lastbump = level.maptime + TICRATE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (velz != 0 && (BounceFlags & BOUNCE_Actors))
|
if (vel.z != 0 && (BounceFlags & BOUNCE_Actors))
|
||||||
{
|
{
|
||||||
P_BounceActor(this, onmo, true);
|
P_BounceActor(this, onmo, true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
flags2 |= MF2_ONMOBJ;
|
flags2 |= MF2_ONMOBJ;
|
||||||
velz = 0;
|
vel.z = 0;
|
||||||
Crash();
|
Crash();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4777,7 +4777,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
||||||
p->MUSINFOactor = NULL;
|
p->MUSINFOactor = NULL;
|
||||||
p->MUSINFOtics = -1;
|
p->MUSINFOtics = -1;
|
||||||
|
|
||||||
p->velx = p->vely = 0; // killough 10/98: initialize bobbing to 0.
|
p->vel.x = p->vel.y = 0; // killough 10/98: initialize bobbing to 0.
|
||||||
|
|
||||||
for (int ii = 0; ii < MAXPLAYERS; ++ii)
|
for (int ii = 0; ii < MAXPLAYERS; ++ii)
|
||||||
{
|
{
|
||||||
|
@ -5360,7 +5360,7 @@ void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, angle_t dir, int damage, AAc
|
||||||
{
|
{
|
||||||
z += pr_spawnblood.Random2 () << 10;
|
z += pr_spawnblood.Random2 () << 10;
|
||||||
th = Spawn (bloodcls, x, y, z, NO_REPLACE); // GetBloodType already performed the replacement
|
th = Spawn (bloodcls, x, y, z, NO_REPLACE); // GetBloodType already performed the replacement
|
||||||
th->velz = FRACUNIT*2;
|
th->vel.z = FRACUNIT*2;
|
||||||
th->angle = dir;
|
th->angle = dir;
|
||||||
// [NG] Applying PUFFGETSOWNER to the blood will make it target the owner
|
// [NG] Applying PUFFGETSOWNER to the blood will make it target the owner
|
||||||
if (th->flags5 & MF5_PUFFGETSOWNER) th->target = originator;
|
if (th->flags5 & MF5_PUFFGETSOWNER) th->target = originator;
|
||||||
|
@ -5456,9 +5456,9 @@ void P_BloodSplatter (fixedvec3 pos, AActor *originator)
|
||||||
|
|
||||||
mo = Spawn(bloodcls, pos, NO_REPLACE); // GetBloodType already performed the replacement
|
mo = Spawn(bloodcls, pos, NO_REPLACE); // GetBloodType already performed the replacement
|
||||||
mo->target = originator;
|
mo->target = originator;
|
||||||
mo->velx = pr_splatter.Random2 () << 10;
|
mo->vel.x = pr_splatter.Random2 () << 10;
|
||||||
mo->vely = pr_splatter.Random2 () << 10;
|
mo->vel.y = pr_splatter.Random2 () << 10;
|
||||||
mo->velz = 3*FRACUNIT;
|
mo->vel.z = 3*FRACUNIT;
|
||||||
|
|
||||||
// colorize the blood!
|
// colorize the blood!
|
||||||
if (bloodcolor!=0 && !(mo->flags2 & MF2_DONTTRANSLATE))
|
if (bloodcolor!=0 && !(mo->flags2 & MF2_DONTTRANSLATE))
|
||||||
|
@ -5543,8 +5543,8 @@ void P_RipperBlood (AActor *mo, AActor *bleeder)
|
||||||
if (th->flags5 & MF5_PUFFGETSOWNER) th->target = bleeder;
|
if (th->flags5 & MF5_PUFFGETSOWNER) th->target = bleeder;
|
||||||
if (gameinfo.gametype == GAME_Heretic)
|
if (gameinfo.gametype == GAME_Heretic)
|
||||||
th->flags |= MF_NOGRAVITY;
|
th->flags |= MF_NOGRAVITY;
|
||||||
th->velx = mo->velx >> 1;
|
th->vel.x = mo->vel.x >> 1;
|
||||||
th->vely = mo->vely >> 1;
|
th->vel.y = mo->vel.y >> 1;
|
||||||
th->tics += pr_ripperblood () & 3;
|
th->tics += pr_ripperblood () & 3;
|
||||||
|
|
||||||
// colorize the blood!
|
// colorize the blood!
|
||||||
|
@ -5609,7 +5609,7 @@ bool P_HitWater (AActor * thing, sector_t * sec, fixed_t x, fixed_t y, fixed_t z
|
||||||
// Missiles are typically small and fast, so they might
|
// Missiles are typically small and fast, so they might
|
||||||
// end up submerged by the move that calls P_HitWater.
|
// end up submerged by the move that calls P_HitWater.
|
||||||
if (thing->flags & MF_MISSILE)
|
if (thing->flags & MF_MISSILE)
|
||||||
compare_z -= thing->velz;
|
compare_z -= thing->vel.z;
|
||||||
if (z > compare_z)
|
if (z > compare_z)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -5673,7 +5673,7 @@ foundone:
|
||||||
|
|
||||||
// Don't splash for living things with small vertical velocities.
|
// Don't splash for living things with small vertical velocities.
|
||||||
// There are levels where the constant splashing from the monsters gets extremely annoying
|
// There are levels where the constant splashing from the monsters gets extremely annoying
|
||||||
if (((thing->flags3&MF3_ISMONSTER || thing->player) && thing->velz >= -6*FRACUNIT) && !force)
|
if (((thing->flags3&MF3_ISMONSTER || thing->player) && thing->vel.z >= -6*FRACUNIT) && !force)
|
||||||
return Terrains[terrainnum].IsLiquid;
|
return Terrains[terrainnum].IsLiquid;
|
||||||
|
|
||||||
splash = &Splashes[splashnum];
|
splash = &Splashes[splashnum];
|
||||||
|
@ -5695,13 +5695,13 @@ foundone:
|
||||||
mo->target = thing;
|
mo->target = thing;
|
||||||
if (splash->ChunkXVelShift != 255)
|
if (splash->ChunkXVelShift != 255)
|
||||||
{
|
{
|
||||||
mo->velx = pr_chunk.Random2() << splash->ChunkXVelShift;
|
mo->vel.x = pr_chunk.Random2() << splash->ChunkXVelShift;
|
||||||
}
|
}
|
||||||
if (splash->ChunkYVelShift != 255)
|
if (splash->ChunkYVelShift != 255)
|
||||||
{
|
{
|
||||||
mo->vely = pr_chunk.Random2() << splash->ChunkYVelShift;
|
mo->vel.y = pr_chunk.Random2() << splash->ChunkYVelShift;
|
||||||
}
|
}
|
||||||
mo->velz = splash->ChunkBaseZVel + (pr_chunk() << splash->ChunkZVelShift);
|
mo->vel.z = splash->ChunkBaseZVel + (pr_chunk() << splash->ChunkZVelShift);
|
||||||
}
|
}
|
||||||
if (splash->SplashBase)
|
if (splash->SplashBase)
|
||||||
{
|
{
|
||||||
|
@ -5742,7 +5742,7 @@ bool P_HitFloor (AActor *thing)
|
||||||
|
|
||||||
// killough 11/98: touchy objects explode on impact
|
// killough 11/98: touchy objects explode on impact
|
||||||
// Allow very short drops to be safe, so that a touchy can be summoned without exploding.
|
// Allow very short drops to be safe, so that a touchy can be summoned without exploding.
|
||||||
if (thing->flags6 & MF6_TOUCHY && ((thing->flags6 & MF6_ARMED) || thing->IsSentient()) && ((thing->velz) < (-5 * FRACUNIT)))
|
if (thing->flags6 & MF6_TOUCHY && ((thing->flags6 & MF6_ARMED) || thing->IsSentient()) && ((thing->vel.z) < (-5 * FRACUNIT)))
|
||||||
{
|
{
|
||||||
thing->flags6 &= ~MF6_ARMED; // Disarm
|
thing->flags6 &= ~MF6_ARMED; // Disarm
|
||||||
P_DamageMobj (thing, NULL, NULL, thing->health, NAME_Crush, DMG_FORCED); // kill object
|
P_DamageMobj (thing, NULL, NULL, thing->health, NAME_Crush, DMG_FORCED); // kill object
|
||||||
|
@ -5796,7 +5796,7 @@ void P_CheckSplash(AActor *self, fixed_t distance)
|
||||||
{
|
{
|
||||||
sector_t *floorsec;
|
sector_t *floorsec;
|
||||||
self->Sector->LowestFloorAt(self, &floorsec);
|
self->Sector->LowestFloorAt(self, &floorsec);
|
||||||
if (self->Z() <= self->floorz + (distance<<FRACBITS) && self->floorsector == floorsec && self->Sector->GetHeightSec() == NULL && floorsec->heightsec == NULL)
|
if (self->Z() <= self->floorz + distance && self->floorsector == floorsec && self->Sector->GetHeightSec() == NULL && floorsec->heightsec == NULL)
|
||||||
{
|
{
|
||||||
// Explosion splashes never alert monsters. This is because A_Explode has
|
// Explosion splashes never alert monsters. This is because A_Explode has
|
||||||
// a separate parameter for that so this would get in the way of proper
|
// a separate parameter for that so this would get in the way of proper
|
||||||
|
@ -5828,7 +5828,7 @@ bool P_CheckMissileSpawn (AActor* th, fixed_t maxdist)
|
||||||
if (maxdist > 0)
|
if (maxdist > 0)
|
||||||
{
|
{
|
||||||
// move a little forward so an angle can be computed if it immediately explodes
|
// move a little forward so an angle can be computed if it immediately explodes
|
||||||
TVector3<double> advance(FIXED2DBL(th->velx), FIXED2DBL(th->vely), FIXED2DBL(th->velz));
|
DVector3 advance(FIXED2DBL(th->vel.x), FIXED2DBL(th->vel.y), FIXED2DBL(th->vel.z));
|
||||||
double maxsquared = FIXED2DBL(maxdist);
|
double maxsquared = FIXED2DBL(maxdist);
|
||||||
maxsquared *= maxsquared;
|
maxsquared *= maxsquared;
|
||||||
|
|
||||||
|
@ -5838,7 +5838,7 @@ bool P_CheckMissileSpawn (AActor* th, fixed_t maxdist)
|
||||||
{
|
{
|
||||||
advance *= 0.5f;
|
advance *= 0.5f;
|
||||||
}
|
}
|
||||||
while (TVector2<double>(advance).LengthSquared() >= maxsquared);
|
while (DVector2(advance).LengthSquared() >= maxsquared);
|
||||||
th->SetXYZ(
|
th->SetXYZ(
|
||||||
th->X() + FLOAT2FIXED(advance.X),
|
th->X() + FLOAT2FIXED(advance.X),
|
||||||
th->Y() + FLOAT2FIXED(advance.Y),
|
th->Y() + FLOAT2FIXED(advance.Y),
|
||||||
|
@ -6000,7 +6000,7 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
||||||
// Answer: No, because this way, you can set up sets of parallel missiles.
|
// Answer: No, because this way, you can set up sets of parallel missiles.
|
||||||
|
|
||||||
fixedvec3 fixvel = source->Vec3To(dest);
|
fixedvec3 fixvel = source->Vec3To(dest);
|
||||||
TVector3<double> velocity(fixvel.x, fixvel.y, fixvel.z);
|
DVector3 velocity(fixvel.x, fixvel.y, fixvel.z);
|
||||||
// Floor and ceiling huggers should never have a vertical component to their velocity
|
// Floor and ceiling huggers should never have a vertical component to their velocity
|
||||||
if (th->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))
|
if (th->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))
|
||||||
{
|
{
|
||||||
|
@ -6012,9 +6012,9 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
||||||
velocity.Z += (dest->height - z + source->Z());
|
velocity.Z += (dest->height - z + source->Z());
|
||||||
}
|
}
|
||||||
velocity.Resize (speed);
|
velocity.Resize (speed);
|
||||||
th->velx = xs_CRoundToInt(velocity.X);
|
th->vel.x = xs_CRoundToInt(velocity.X);
|
||||||
th->vely = xs_CRoundToInt(velocity.Y);
|
th->vel.y = xs_CRoundToInt(velocity.Y);
|
||||||
th->velz = xs_CRoundToInt(velocity.Z);
|
th->vel.z = xs_CRoundToInt(velocity.Z);
|
||||||
|
|
||||||
// invisible target: rotate velocity vector in 2D
|
// invisible target: rotate velocity vector in 2D
|
||||||
// [RC] Now monsters can aim at invisible player as if they were fully visible.
|
// [RC] Now monsters can aim at invisible player as if they were fully visible.
|
||||||
|
@ -6023,13 +6023,13 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
||||||
angle_t an = pr_spawnmissile.Random2 () << 20;
|
angle_t an = pr_spawnmissile.Random2 () << 20;
|
||||||
an >>= ANGLETOFINESHIFT;
|
an >>= ANGLETOFINESHIFT;
|
||||||
|
|
||||||
fixed_t newx = DMulScale16 (th->velx, finecosine[an], -th->vely, finesine[an]);
|
fixed_t newx = DMulScale16 (th->vel.x, finecosine[an], -th->vel.y, finesine[an]);
|
||||||
fixed_t newy = DMulScale16 (th->velx, finesine[an], th->vely, finecosine[an]);
|
fixed_t newy = DMulScale16 (th->vel.x, finesine[an], th->vel.y, finecosine[an]);
|
||||||
th->velx = newx;
|
th->vel.x = newx;
|
||||||
th->vely = newy;
|
th->vel.y = newy;
|
||||||
}
|
}
|
||||||
|
|
||||||
th->angle = R_PointToAngle2 (0, 0, th->velx, th->vely);
|
th->angle = R_PointToAngle2 (0, 0, th->vel.x, th->vel.y);
|
||||||
|
|
||||||
if (th->flags4 & MF4_SPECTRAL)
|
if (th->flags4 & MF4_SPECTRAL)
|
||||||
{
|
{
|
||||||
|
@ -6054,8 +6054,8 @@ AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassAct
|
||||||
|
|
||||||
th->angle = an = source->AngleTo(dest);
|
th->angle = an = source->AngleTo(dest);
|
||||||
an >>= ANGLETOFINESHIFT;
|
an >>= ANGLETOFINESHIFT;
|
||||||
th->velx = FixedMul (th->Speed, finecosine[an]);
|
th->vel.x = FixedMul (th->Speed, finecosine[an]);
|
||||||
th->vely = FixedMul (th->Speed, finesine[an]);
|
th->vel.y = FixedMul (th->Speed, finesine[an]);
|
||||||
|
|
||||||
dist = source->AproxDistance (dest);
|
dist = source->AproxDistance (dest);
|
||||||
if (th->Speed) dist = dist / th->Speed;
|
if (th->Speed) dist = dist / th->Speed;
|
||||||
|
@ -6063,7 +6063,7 @@ AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassAct
|
||||||
if (dist < 1)
|
if (dist < 1)
|
||||||
dist = 1;
|
dist = 1;
|
||||||
|
|
||||||
th->velz = (dest->Z() - source->Z()) / dist;
|
th->vel.z = (dest->Z() - source->Z()) / dist;
|
||||||
|
|
||||||
if (th->flags4 & MF4_SPECTRAL)
|
if (th->flags4 & MF4_SPECTRAL)
|
||||||
{
|
{
|
||||||
|
@ -6084,20 +6084,20 @@ AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassAct
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
AActor *P_SpawnMissileAngle (AActor *source, PClassActor *type,
|
AActor *P_SpawnMissileAngle (AActor *source, PClassActor *type,
|
||||||
angle_t angle, fixed_t velz)
|
angle_t angle, fixed_t vz)
|
||||||
{
|
{
|
||||||
if (source == NULL)
|
if (source == NULL)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return P_SpawnMissileAngleZSpeed (source, source->Z() + 32*FRACUNIT + source->GetBobOffset(),
|
return P_SpawnMissileAngleZSpeed (source, source->Z() + 32*FRACUNIT + source->GetBobOffset(),
|
||||||
type, angle, velz, GetDefaultSpeed (type));
|
type, angle, vz, GetDefaultSpeed (type));
|
||||||
}
|
}
|
||||||
|
|
||||||
AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z,
|
AActor *P_SpawnMissileAngleZ (AActor *source, fixed_t z,
|
||||||
PClassActor *type, angle_t angle, fixed_t velz)
|
PClassActor *type, angle_t angle, fixed_t vz)
|
||||||
{
|
{
|
||||||
return P_SpawnMissileAngleZSpeed (source, z, type, angle, velz,
|
return P_SpawnMissileAngleZSpeed (source, z, type, angle, vz,
|
||||||
GetDefaultSpeed (type));
|
GetDefaultSpeed (type));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6110,7 +6110,7 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, PClassAct
|
||||||
angle_t an;
|
angle_t an;
|
||||||
fixed_t dist;
|
fixed_t dist;
|
||||||
fixed_t speed;
|
fixed_t speed;
|
||||||
fixed_t velz;
|
fixed_t vz;
|
||||||
|
|
||||||
an = source->angle;
|
an = source->angle;
|
||||||
|
|
||||||
|
@ -6121,8 +6121,8 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, PClassAct
|
||||||
dist = source->AproxDistance (dest);
|
dist = source->AproxDistance (dest);
|
||||||
speed = GetDefaultSpeed (type);
|
speed = GetDefaultSpeed (type);
|
||||||
dist /= speed;
|
dist /= speed;
|
||||||
velz = dist != 0 ? (dest->Z() - source->Z())/dist : speed;
|
vz = dist != 0 ? (dest->Z() - source->Z())/dist : speed;
|
||||||
return P_SpawnMissileAngleZSpeed (source, z, type, an, velz, speed);
|
return P_SpawnMissileAngleZSpeed (source, z, type, an, vz, speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -6135,18 +6135,18 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, PClassAct
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
AActor *P_SpawnMissileAngleSpeed (AActor *source, PClassActor *type,
|
AActor *P_SpawnMissileAngleSpeed (AActor *source, PClassActor *type,
|
||||||
angle_t angle, fixed_t velz, fixed_t speed)
|
angle_t angle, fixed_t vz, fixed_t speed)
|
||||||
{
|
{
|
||||||
if (source == NULL)
|
if (source == NULL)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return P_SpawnMissileAngleZSpeed (source, source->Z() + 32*FRACUNIT + source->GetBobOffset(),
|
return P_SpawnMissileAngleZSpeed (source, source->Z() + 32*FRACUNIT + source->GetBobOffset(),
|
||||||
type, angle, velz, speed);
|
type, angle, vz, speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
|
AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
|
||||||
PClassActor *type, angle_t angle, fixed_t velz, fixed_t speed, AActor *owner, bool checkspawn)
|
PClassActor *type, angle_t angle, fixed_t vz, fixed_t speed, AActor *owner, bool checkspawn)
|
||||||
{
|
{
|
||||||
if (source == NULL)
|
if (source == NULL)
|
||||||
{
|
{
|
||||||
|
@ -6166,9 +6166,9 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
|
||||||
mo->target = owner;
|
mo->target = owner;
|
||||||
mo->angle = angle;
|
mo->angle = angle;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
mo->velx = FixedMul (speed, finecosine[angle]);
|
mo->vel.x = FixedMul (speed, finecosine[angle]);
|
||||||
mo->vely = FixedMul (speed, finesine[angle]);
|
mo->vel.y = FixedMul (speed, finesine[angle]);
|
||||||
mo->velz = velz;
|
mo->vel.z = vz;
|
||||||
|
|
||||||
if (mo->flags4 & MF4_SPECTRAL)
|
if (mo->flags4 & MF4_SPECTRAL)
|
||||||
{
|
{
|
||||||
|
@ -6288,16 +6288,16 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z,
|
||||||
vz = -finesine[pitch>>ANGLETOFINESHIFT];
|
vz = -finesine[pitch>>ANGLETOFINESHIFT];
|
||||||
speed = MissileActor->Speed;
|
speed = MissileActor->Speed;
|
||||||
|
|
||||||
TVector3<double> vec(vx, vy, vz);
|
DVector3 vec(vx, vy, vz);
|
||||||
|
|
||||||
if (MissileActor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))
|
if (MissileActor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))
|
||||||
{
|
{
|
||||||
vec.Z = 0;
|
vec.Z = 0;
|
||||||
}
|
}
|
||||||
vec.Resize(speed);
|
vec.Resize(speed);
|
||||||
MissileActor->velx = xs_CRoundToInt(vec.X);
|
MissileActor->vel.x = xs_CRoundToInt(vec.X);
|
||||||
MissileActor->vely = xs_CRoundToInt(vec.Y);
|
MissileActor->vel.y = xs_CRoundToInt(vec.Y);
|
||||||
MissileActor->velz = xs_CRoundToInt(vec.Z);
|
MissileActor->vel.z = xs_CRoundToInt(vec.Z);
|
||||||
|
|
||||||
if (MissileActor->flags4 & MF4_SPECTRAL)
|
if (MissileActor->flags4 & MF4_SPECTRAL)
|
||||||
{
|
{
|
||||||
|
@ -6774,7 +6774,7 @@ void PrintMiscActorInfo(AActor *query)
|
||||||
FIXED2DBL(query->X()), FIXED2DBL(query->Y()), FIXED2DBL(query->Z()),
|
FIXED2DBL(query->X()), FIXED2DBL(query->Y()), FIXED2DBL(query->Z()),
|
||||||
FIXED2DBL(query->floorz), FIXED2DBL(query->ceilingz));
|
FIXED2DBL(query->floorz), FIXED2DBL(query->ceilingz));
|
||||||
Printf("\nSpeed= %f, velocity= x:%f, y:%f, z:%f, combined:%f.\n",
|
Printf("\nSpeed= %f, velocity= x:%f, y:%f, z:%f, combined:%f.\n",
|
||||||
FIXED2DBL(query->Speed), FIXED2DBL(query->velx), FIXED2DBL(query->vely), FIXED2DBL(query->velz),
|
FIXED2DBL(query->Speed), FIXED2DBL(query->vel.x), FIXED2DBL(query->vel.y), FIXED2DBL(query->vel.z),
|
||||||
sqrt(pow(FIXED2DBL(query->velx), 2) + pow(FIXED2DBL(query->vely), 2) + pow(FIXED2DBL(query->velz), 2)));
|
sqrt(pow(FIXED2DBL(query->vel.x), 2) + pow(FIXED2DBL(query->vel.y), 2) + pow(FIXED2DBL(query->vel.z), 2)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ static void P_SlopeLineToPoint (int lineid, fixed_t x, fixed_t y, fixed_t z, boo
|
||||||
plane = &sec->floorplane;
|
plane = &sec->floorplane;
|
||||||
}
|
}
|
||||||
|
|
||||||
TVector3<double> p, v1, v2, cross;
|
DVector3 p, v1, v2, cross;
|
||||||
|
|
||||||
p[0] = FIXED2DBL (line->v1->x);
|
p[0] = FIXED2DBL (line->v1->x);
|
||||||
p[1] = FIXED2DBL (line->v1->y);
|
p[1] = FIXED2DBL (line->v1->y);
|
||||||
|
@ -189,7 +189,7 @@ void P_SetSlope (secplane_t *plane, bool setCeil, int xyangi, int zangi,
|
||||||
}
|
}
|
||||||
xyang = (angle_t)Scale (xyangi, ANGLE_90, 90 << ANGLETOFINESHIFT);
|
xyang = (angle_t)Scale (xyangi, ANGLE_90, 90 << ANGLETOFINESHIFT);
|
||||||
|
|
||||||
TVector3<double> norm;
|
DVector3 norm;
|
||||||
|
|
||||||
if (ib_compatflags & BCOMPATF_SETSLOPEOVERFLOW)
|
if (ib_compatflags & BCOMPATF_SETSLOPEOVERFLOW)
|
||||||
{
|
{
|
||||||
|
@ -228,7 +228,7 @@ void P_VavoomSlope(sector_t * sec, int id, fixed_t x, fixed_t y, fixed_t z, int
|
||||||
|
|
||||||
if (l->args[0]==id)
|
if (l->args[0]==id)
|
||||||
{
|
{
|
||||||
TVector3<double> v1, v2, cross;
|
DVector3 v1, v2, cross;
|
||||||
secplane_t *srcplane = (which == 0) ? &sec->floorplane : &sec->ceilingplane;
|
secplane_t *srcplane = (which == 0) ? &sec->floorplane : &sec->ceilingplane;
|
||||||
fixed_t srcheight = (which == 0) ? sec->GetPlaneTexZ(sector_t::floor) : sec->GetPlaneTexZ(sector_t::ceiling);
|
fixed_t srcheight = (which == 0) ? sec->GetPlaneTexZ(sector_t::floor) : sec->GetPlaneTexZ(sector_t::ceiling);
|
||||||
|
|
||||||
|
@ -336,8 +336,8 @@ static void P_SetSlopesFromVertexHeights(FMapThing *firstmt, FMapThing *lastmt,
|
||||||
sector_t *sec = §ors[i];
|
sector_t *sec = §ors[i];
|
||||||
if (sec->linecount != 3) continue; // only works with triangular sectors
|
if (sec->linecount != 3) continue; // only works with triangular sectors
|
||||||
|
|
||||||
TVector3<double> vt1, vt2, vt3, cross;
|
DVector3 vt1, vt2, vt3, cross;
|
||||||
TVector3<double> vec1, vec2;
|
DVector3 vec1, vec2;
|
||||||
int vi1, vi2, vi3;
|
int vi1, vi2, vi3;
|
||||||
|
|
||||||
vi1 = int(sec->lines[0]->v1 - vertexes);
|
vi1 = int(sec->lines[0]->v1 - vertexes);
|
||||||
|
@ -376,7 +376,7 @@ static void P_SetSlopesFromVertexHeights(FMapThing *firstmt, FMapThing *lastmt,
|
||||||
vec2 = vt2 - vt3;
|
vec2 = vt2 - vt3;
|
||||||
}
|
}
|
||||||
|
|
||||||
TVector3<double> cross = vec1 ^ vec2;
|
DVector3 cross = vec1 ^ vec2;
|
||||||
|
|
||||||
double len = cross.Length();
|
double len = cross.Length();
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
|
@ -521,7 +521,7 @@ static void P_AlignPlane (sector_t *sec, line_t *line, int which)
|
||||||
|
|
||||||
refsec = line->frontsector == sec ? line->backsector : line->frontsector;
|
refsec = line->frontsector == sec ? line->backsector : line->frontsector;
|
||||||
|
|
||||||
TVector3<double> p, v1, v2, cross;
|
DVector3 p, v1, v2, cross;
|
||||||
|
|
||||||
secplane_t *srcplane;
|
secplane_t *srcplane;
|
||||||
fixed_t srcheight, destheight;
|
fixed_t srcheight, destheight;
|
||||||
|
|
|
@ -2310,8 +2310,8 @@ void DPusher::Tick ()
|
||||||
if (m_Source->GetClass()->TypeName == NAME_PointPusher)
|
if (m_Source->GetClass()->TypeName == NAME_PointPusher)
|
||||||
pushangle += ANG180; // away
|
pushangle += ANG180; // away
|
||||||
pushangle >>= ANGLETOFINESHIFT;
|
pushangle >>= ANGLETOFINESHIFT;
|
||||||
thing->velx += FixedMul (speed, finecosine[pushangle]);
|
thing->vel.x += FixedMul (speed, finecosine[pushangle]);
|
||||||
thing->vely += FixedMul (speed, finesine[pushangle]);
|
thing->vel.y += FixedMul (speed, finesine[pushangle]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2385,8 +2385,8 @@ void DPusher::Tick ()
|
||||||
yspeed = m_Ymag;
|
yspeed = m_Ymag;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
thing->velx += xspeed<<(FRACBITS-PUSH_FACTOR);
|
thing->vel.x += xspeed<<(FRACBITS-PUSH_FACTOR);
|
||||||
thing->vely += yspeed<<(FRACBITS-PUSH_FACTOR);
|
thing->vel.y += yspeed<<(FRACBITS-PUSH_FACTOR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
|
||||||
ceilingheight = destsect->ceilingplane.ZatPoint (x, y);
|
ceilingheight = destsect->ceilingplane.ZatPoint (x, y);
|
||||||
if (thing->flags & MF_MISSILE)
|
if (thing->flags & MF_MISSILE)
|
||||||
{ // We don't measure z velocity, because it doesn't change.
|
{ // We don't measure z velocity, because it doesn't change.
|
||||||
missilespeed = xs_CRoundToInt(TVector2<double>(thing->velx, thing->vely).Length());
|
missilespeed = xs_CRoundToInt(DVector2(thing->vel.x, thing->vel.y).Length());
|
||||||
}
|
}
|
||||||
if (flags & TELF_KEEPHEIGHT)
|
if (flags & TELF_KEEPHEIGHT)
|
||||||
{
|
{
|
||||||
|
@ -215,16 +215,16 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
|
||||||
if (thing->flags & MF_MISSILE)
|
if (thing->flags & MF_MISSILE)
|
||||||
{
|
{
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
thing->velx = FixedMul (missilespeed, finecosine[angle]);
|
thing->vel.x = FixedMul (missilespeed, finecosine[angle]);
|
||||||
thing->vely = FixedMul (missilespeed, finesine[angle]);
|
thing->vel.y = FixedMul (missilespeed, finesine[angle]);
|
||||||
}
|
}
|
||||||
// [BC] && bHaltVelocity.
|
// [BC] && bHaltVelocity.
|
||||||
else if (!(flags & TELF_KEEPORIENTATION) && !(flags & TELF_KEEPVELOCITY))
|
else if (!(flags & TELF_KEEPORIENTATION) && !(flags & TELF_KEEPVELOCITY))
|
||||||
{ // no fog doesn't alter the player's momentum
|
{ // no fog doesn't alter the player's momentum
|
||||||
thing->velx = thing->vely = thing->velz = 0;
|
thing->vel.x = thing->vel.y = thing->vel.z = 0;
|
||||||
// killough 10/98: kill all bobbing velocity too
|
// killough 10/98: kill all bobbing velocity too
|
||||||
if (player)
|
if (player)
|
||||||
player->velx = player->vely = 0;
|
player->vel.x = player->vel.y = 0;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -330,7 +330,7 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, int f
|
||||||
fixed_t z;
|
fixed_t z;
|
||||||
angle_t angle = 0;
|
angle_t angle = 0;
|
||||||
fixed_t s = 0, c = 0;
|
fixed_t s = 0, c = 0;
|
||||||
fixed_t velx = 0, vely = 0;
|
fixed_t vx = 0, vy = 0;
|
||||||
angle_t badangle = 0;
|
angle_t badangle = 0;
|
||||||
|
|
||||||
if (thing == NULL)
|
if (thing == NULL)
|
||||||
|
@ -365,8 +365,8 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, int f
|
||||||
c = finecosine[angle>>ANGLETOFINESHIFT];
|
c = finecosine[angle>>ANGLETOFINESHIFT];
|
||||||
|
|
||||||
// Velocity of thing crossing teleporter linedef
|
// Velocity of thing crossing teleporter linedef
|
||||||
velx = thing->velx;
|
vx = thing->vel.x;
|
||||||
vely = thing->vely;
|
vy = thing->vel.y;
|
||||||
|
|
||||||
z = searcher->Z();
|
z = searcher->Z();
|
||||||
}
|
}
|
||||||
|
@ -391,10 +391,10 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, int f
|
||||||
thing->angle += angle;
|
thing->angle += angle;
|
||||||
|
|
||||||
// Rotate thing's velocity to come out of exit just like it entered
|
// Rotate thing's velocity to come out of exit just like it entered
|
||||||
thing->velx = FixedMul(velx, c) - FixedMul(vely, s);
|
thing->vel.x = FixedMul(vx, c) - FixedMul(vy, s);
|
||||||
thing->vely = FixedMul(vely, c) + FixedMul(velx, s);
|
thing->vel.y = FixedMul(vy, c) + FixedMul(vx, s);
|
||||||
}
|
}
|
||||||
if ((velx | vely) == 0 && thing->player != NULL && thing->player->mo == thing && !predicting)
|
if ((vx | vy) == 0 && thing->player != NULL && thing->player->mo == thing && !predicting)
|
||||||
{
|
{
|
||||||
thing->player->mo->PlayIdle ();
|
thing->player->mo->PlayIdle ();
|
||||||
}
|
}
|
||||||
|
@ -554,21 +554,21 @@ bool EV_SilentLineTeleport (line_t *line, int side, AActor *thing, int id, INTBO
|
||||||
thing->angle += angle;
|
thing->angle += angle;
|
||||||
|
|
||||||
// Velocity of thing crossing teleporter linedef
|
// Velocity of thing crossing teleporter linedef
|
||||||
x = thing->velx;
|
x = thing->vel.x;
|
||||||
y = thing->vely;
|
y = thing->vel.y;
|
||||||
|
|
||||||
// Rotate thing's velocity to come out of exit just like it entered
|
// Rotate thing's velocity to come out of exit just like it entered
|
||||||
thing->velx = DMulScale16 (x, c, -y, s);
|
thing->vel.x = DMulScale16 (x, c, -y, s);
|
||||||
thing->vely = DMulScale16 (y, c, x, s);
|
thing->vel.y = DMulScale16 (y, c, x, s);
|
||||||
|
|
||||||
// Adjust a player's view, in case there has been a height change
|
// Adjust a player's view, in case there has been a height change
|
||||||
if (player && player->mo == thing)
|
if (player && player->mo == thing)
|
||||||
{
|
{
|
||||||
// Adjust player's local copy of velocity
|
// Adjust player's local copy of velocity
|
||||||
x = player->velx;
|
x = player->vel.x;
|
||||||
y = player->vely;
|
y = player->vel.y;
|
||||||
player->velx = DMulScale16 (x, c, -y, s);
|
player->vel.x = DMulScale16 (x, c, -y, s);
|
||||||
player->vely = DMulScale16 (y, c, x, s);
|
player->vel.y = DMulScale16 (y, c, x, s);
|
||||||
|
|
||||||
// Save the current deltaviewheight, used in stepping
|
// Save the current deltaviewheight, used in stepping
|
||||||
fixed_t deltaviewheight = player->deltaviewheight;
|
fixed_t deltaviewheight = player->deltaviewheight;
|
||||||
|
|
|
@ -257,9 +257,9 @@ bool P_Thing_Projectile (int tid, AActor *source, int type, const char *type_nam
|
||||||
{
|
{
|
||||||
fixedvec3 vect = mobj->Vec3To(targ);
|
fixedvec3 vect = mobj->Vec3To(targ);
|
||||||
vect.z += targ->height / 2;
|
vect.z += targ->height / 2;
|
||||||
TVector3<double> aim(vect.x, vect.y, vect.z);
|
DVector3 aim(vect.x, vect.y, vect.z);
|
||||||
|
|
||||||
if (leadTarget && speed > 0 && (targ->velx | targ->vely | targ->velz))
|
if (leadTarget && speed > 0 && (targ->vel.x | targ->vel.y | targ->vel.z))
|
||||||
{
|
{
|
||||||
// Aiming at the target's position some time in the future
|
// Aiming at the target's position some time in the future
|
||||||
// is basically just an application of the law of sines:
|
// is basically just an application of the law of sines:
|
||||||
|
@ -268,14 +268,14 @@ bool P_Thing_Projectile (int tid, AActor *source, int type, const char *type_nam
|
||||||
// with the math. I don't think I would have thought of using
|
// with the math. I don't think I would have thought of using
|
||||||
// trig alone had I been left to solve it by myself.
|
// trig alone had I been left to solve it by myself.
|
||||||
|
|
||||||
TVector3<double> tvel(targ->velx, targ->vely, targ->velz);
|
DVector3 tvel(targ->vel.x, targ->vel.y, targ->vel.z);
|
||||||
if (!(targ->flags & MF_NOGRAVITY) && targ->waterlevel < 3)
|
if (!(targ->flags & MF_NOGRAVITY) && targ->waterlevel < 3)
|
||||||
{ // If the target is subject to gravity and not underwater,
|
{ // If the target is subject to gravity and not underwater,
|
||||||
// assume that it isn't moving vertically. Thanks to gravity,
|
// assume that it isn't moving vertically. Thanks to gravity,
|
||||||
// even if we did consider the vertical component of the target's
|
// even if we did consider the vertical component of the target's
|
||||||
// velocity, we would still miss more often than not.
|
// velocity, we would still miss more often than not.
|
||||||
tvel.Z = 0.0;
|
tvel.Z = 0.0;
|
||||||
if ((targ->velx | targ->vely) == 0)
|
if ((targ->vel.x | targ->vel.y) == 0)
|
||||||
{
|
{
|
||||||
goto nolead;
|
goto nolead;
|
||||||
}
|
}
|
||||||
|
@ -289,29 +289,29 @@ bool P_Thing_Projectile (int tid, AActor *source, int type, const char *type_nam
|
||||||
|
|
||||||
// Use the cross product of two of the triangle's sides to get a
|
// Use the cross product of two of the triangle's sides to get a
|
||||||
// rotation vector.
|
// rotation vector.
|
||||||
TVector3<double> rv(tvel ^ aim);
|
DVector3 rv(tvel ^ aim);
|
||||||
// The vector must be normalized.
|
// The vector must be normalized.
|
||||||
rv.MakeUnit();
|
rv.MakeUnit();
|
||||||
// Now combine the rotation vector with angle b to get a rotation matrix.
|
// Now combine the rotation vector with angle b to get a rotation matrix.
|
||||||
TMatrix3x3<double> rm(rv, cos(asin(sinb)), sinb);
|
DMatrix3x3 rm(rv, cos(asin(sinb)), sinb);
|
||||||
// And multiply the original aim vector with the matrix to get a
|
// And multiply the original aim vector with the matrix to get a
|
||||||
// new aim vector that leads the target.
|
// new aim vector that leads the target.
|
||||||
TVector3<double> aimvec = rm * aim;
|
DVector3 aimvec = rm * aim;
|
||||||
// And make the projectile follow that vector at the desired speed.
|
// And make the projectile follow that vector at the desired speed.
|
||||||
double aimscale = fspeed / dist;
|
double aimscale = fspeed / dist;
|
||||||
mobj->velx = fixed_t (aimvec[0] * aimscale);
|
mobj->vel.x = fixed_t (aimvec[0] * aimscale);
|
||||||
mobj->vely = fixed_t (aimvec[1] * aimscale);
|
mobj->vel.y = fixed_t (aimvec[1] * aimscale);
|
||||||
mobj->velz = fixed_t (aimvec[2] * aimscale);
|
mobj->vel.z = fixed_t (aimvec[2] * aimscale);
|
||||||
mobj->angle = R_PointToAngle2 (0, 0, mobj->velx, mobj->vely);
|
mobj->angle = R_PointToAngle2 (0, 0, mobj->vel.x, mobj->vel.y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nolead:
|
nolead:
|
||||||
mobj->angle = mobj->AngleTo(targ);
|
mobj->angle = mobj->AngleTo(targ);
|
||||||
aim.Resize (fspeed);
|
aim.Resize (fspeed);
|
||||||
mobj->velx = fixed_t(aim[0]);
|
mobj->vel.x = fixed_t(aim[0]);
|
||||||
mobj->vely = fixed_t(aim[1]);
|
mobj->vel.y = fixed_t(aim[1]);
|
||||||
mobj->velz = fixed_t(aim[2]);
|
mobj->vel.z = fixed_t(aim[2]);
|
||||||
}
|
}
|
||||||
if (mobj->flags2 & MF2_SEEKERMISSILE)
|
if (mobj->flags2 & MF2_SEEKERMISSILE)
|
||||||
{
|
{
|
||||||
|
@ -321,19 +321,19 @@ nolead:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mobj->angle = angle;
|
mobj->angle = angle;
|
||||||
mobj->velx = FixedMul (speed, finecosine[angle>>ANGLETOFINESHIFT]);
|
mobj->vel.x = FixedMul (speed, finecosine[angle>>ANGLETOFINESHIFT]);
|
||||||
mobj->vely = FixedMul (speed, finesine[angle>>ANGLETOFINESHIFT]);
|
mobj->vel.y = FixedMul (speed, finesine[angle>>ANGLETOFINESHIFT]);
|
||||||
mobj->velz = vspeed;
|
mobj->vel.z = vspeed;
|
||||||
}
|
}
|
||||||
// Set the missile's speed to reflect the speed it was spawned at.
|
// Set the missile's speed to reflect the speed it was spawned at.
|
||||||
if (mobj->flags & MF_MISSILE)
|
if (mobj->flags & MF_MISSILE)
|
||||||
{
|
{
|
||||||
mobj->Speed = fixed_t (sqrt (double(mobj->velx)*mobj->velx + double(mobj->vely)*mobj->vely + double(mobj->velz)*mobj->velz));
|
mobj->Speed = fixed_t (sqrt (double(mobj->vel.x)*mobj->vel.x + double(mobj->vel.y)*mobj->vel.y + double(mobj->vel.z)*mobj->vel.z));
|
||||||
}
|
}
|
||||||
// Hugger missiles don't have any vertical velocity
|
// Hugger missiles don't have any vertical velocity
|
||||||
if (mobj->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))
|
if (mobj->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))
|
||||||
{
|
{
|
||||||
mobj->velz = 0;
|
mobj->vel.z = 0;
|
||||||
}
|
}
|
||||||
if (mobj->flags & MF_SPECIAL)
|
if (mobj->flags & MF_SPECIAL)
|
||||||
{
|
{
|
||||||
|
@ -427,7 +427,7 @@ bool P_Thing_Raise(AActor *thing, AActor *raiser)
|
||||||
|
|
||||||
AActor *info = thing->GetDefault ();
|
AActor *info = thing->GetDefault ();
|
||||||
|
|
||||||
thing->velx = thing->vely = 0;
|
thing->vel.x = thing->vel.y = 0;
|
||||||
|
|
||||||
// [RH] Check against real height and radius
|
// [RH] Check against real height and radius
|
||||||
fixed_t oldheight = thing->height;
|
fixed_t oldheight = thing->height;
|
||||||
|
@ -500,16 +500,16 @@ void P_Thing_SetVelocity(AActor *actor, fixed_t vx, fixed_t vy, fixed_t vz, bool
|
||||||
{
|
{
|
||||||
if (!add)
|
if (!add)
|
||||||
{
|
{
|
||||||
actor->velx = actor->vely = actor->velz = 0;
|
actor->vel.x = actor->vel.y = actor->vel.z = 0;
|
||||||
if (actor->player != NULL) actor->player->velx = actor->player->vely = 0;
|
if (actor->player != NULL) actor->player->vel.x = actor->player->vel.y = 0;
|
||||||
}
|
}
|
||||||
actor->velx += vx;
|
actor->vel.x += vx;
|
||||||
actor->vely += vy;
|
actor->vel.y += vy;
|
||||||
actor->velz += vz;
|
actor->vel.z += vz;
|
||||||
if (setbob && actor->player != NULL)
|
if (setbob && actor->player != NULL)
|
||||||
{
|
{
|
||||||
actor->player->velx += vx;
|
actor->player->vel.x += vx;
|
||||||
actor->player->vely += vy;
|
actor->player->vel.y += vy;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -771,15 +771,15 @@ int P_Thing_Warp(AActor *caller, AActor *reference, fixed_t xofs, fixed_t yofs,
|
||||||
|
|
||||||
if (flags & WARPF_COPYVELOCITY)
|
if (flags & WARPF_COPYVELOCITY)
|
||||||
{
|
{
|
||||||
caller->velx = reference->velx;
|
caller->vel.x = reference->vel.x;
|
||||||
caller->vely = reference->vely;
|
caller->vel.y = reference->vel.y;
|
||||||
caller->velz = reference->velz;
|
caller->vel.z = reference->vel.z;
|
||||||
}
|
}
|
||||||
if (flags & WARPF_STOP)
|
if (flags & WARPF_STOP)
|
||||||
{
|
{
|
||||||
caller->velx = 0;
|
caller->vel.x = 0;
|
||||||
caller->vely = 0;
|
caller->vel.y = 0;
|
||||||
caller->velz = 0;
|
caller->vel.z = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is no fun with line portals
|
// this is no fun with line portals
|
||||||
|
|
|
@ -1607,7 +1607,7 @@ public:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double ulen = TVector3<double>(fp[0], fp[1], fp[2]).Length();
|
double ulen = DVector3(fp[0], fp[1], fp[2]).Length();
|
||||||
|
|
||||||
// normalize the vector, it must have a length of 1
|
// normalize the vector, it must have a length of 1
|
||||||
sec->floorplane.a = FLOAT2FIXED(fp[0] / ulen);
|
sec->floorplane.a = FLOAT2FIXED(fp[0] / ulen);
|
||||||
|
@ -1625,7 +1625,7 @@ public:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double ulen = TVector3<double>(cp[0], cp[1], cp[2]).Length();
|
double ulen = DVector3(cp[0], cp[1], cp[2]).Length();
|
||||||
|
|
||||||
// normalize the vector, it must have a length of 1
|
// normalize the vector, it must have a length of 1
|
||||||
sec->ceilingplane.a = FLOAT2FIXED(cp[0] / ulen);
|
sec->ceilingplane.a = FLOAT2FIXED(cp[0] / ulen);
|
||||||
|
|
|
@ -257,8 +257,7 @@ player_t::player_t()
|
||||||
viewheight(0),
|
viewheight(0),
|
||||||
deltaviewheight(0),
|
deltaviewheight(0),
|
||||||
bob(0),
|
bob(0),
|
||||||
velx(0),
|
vel({ 0,0 }),
|
||||||
vely(0),
|
|
||||||
centering(0),
|
centering(0),
|
||||||
turnticks(0),
|
turnticks(0),
|
||||||
attackdown(0),
|
attackdown(0),
|
||||||
|
@ -337,8 +336,8 @@ player_t &player_t::operator=(const player_t &p)
|
||||||
viewheight = p.viewheight;
|
viewheight = p.viewheight;
|
||||||
deltaviewheight = p.deltaviewheight;
|
deltaviewheight = p.deltaviewheight;
|
||||||
bob = p.bob;
|
bob = p.bob;
|
||||||
velx = p.velx;
|
vel.x = p.vel.x;
|
||||||
vely = p.vely;
|
vel.y = p.vel.y;
|
||||||
centering = p.centering;
|
centering = p.centering;
|
||||||
turnticks = p.turnticks;
|
turnticks = p.turnticks;
|
||||||
attackdown = p.attackdown;
|
attackdown = p.attackdown;
|
||||||
|
@ -1580,7 +1579,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PlayerScream)
|
||||||
// Handle the different player death screams
|
// Handle the different player death screams
|
||||||
if ((((level.flags >> 15) | (dmflags)) &
|
if ((((level.flags >> 15) | (dmflags)) &
|
||||||
(DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX)) &&
|
(DF_FORCE_FALLINGZD | DF_FORCE_FALLINGHX)) &&
|
||||||
self->velz <= -39*FRACUNIT)
|
self->vel.z <= -39*FRACUNIT)
|
||||||
{
|
{
|
||||||
sound = S_FindSkinnedSound (self, "*splat");
|
sound = S_FindSkinnedSound (self, "*splat");
|
||||||
chan = CHAN_BODY;
|
chan = CHAN_BODY;
|
||||||
|
@ -1652,9 +1651,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullPop)
|
||||||
self->flags &= ~MF_SOLID;
|
self->flags &= ~MF_SOLID;
|
||||||
mo = (APlayerPawn *)Spawn (spawntype, self->PosPlusZ(48*FRACUNIT), NO_REPLACE);
|
mo = (APlayerPawn *)Spawn (spawntype, self->PosPlusZ(48*FRACUNIT), NO_REPLACE);
|
||||||
//mo->target = self;
|
//mo->target = self;
|
||||||
mo->velx = pr_skullpop.Random2() << 9;
|
mo->vel.x = pr_skullpop.Random2() << 9;
|
||||||
mo->vely = pr_skullpop.Random2() << 9;
|
mo->vel.y = pr_skullpop.Random2() << 9;
|
||||||
mo->velz = 2*FRACUNIT + (pr_skullpop() << 6);
|
mo->vel.z = 2*FRACUNIT + (pr_skullpop() << 6);
|
||||||
// Attach player mobj to bloody skull
|
// Attach player mobj to bloody skull
|
||||||
player = self->player;
|
player = self->player;
|
||||||
self->player = NULL;
|
self->player = NULL;
|
||||||
|
@ -1760,8 +1759,8 @@ void P_SideThrust (player_t *player, angle_t angle, fixed_t move)
|
||||||
{
|
{
|
||||||
angle = (angle - ANGLE_90) >> ANGLETOFINESHIFT;
|
angle = (angle - ANGLE_90) >> ANGLETOFINESHIFT;
|
||||||
|
|
||||||
player->mo->velx += FixedMul (move, finecosine[angle]);
|
player->mo->vel.x += FixedMul (move, finecosine[angle]);
|
||||||
player->mo->vely += FixedMul (move, finesine[angle]);
|
player->mo->vel.y += FixedMul (move, finesine[angle]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void P_ForwardThrust (player_t *player, angle_t angle, fixed_t move)
|
void P_ForwardThrust (player_t *player, angle_t angle, fixed_t move)
|
||||||
|
@ -1775,11 +1774,11 @@ void P_ForwardThrust (player_t *player, angle_t angle, fixed_t move)
|
||||||
fixed_t zpush = FixedMul (move, finesine[pitch]);
|
fixed_t zpush = FixedMul (move, finesine[pitch]);
|
||||||
if (player->mo->waterlevel && player->mo->waterlevel < 2 && zpush < 0)
|
if (player->mo->waterlevel && player->mo->waterlevel < 2 && zpush < 0)
|
||||||
zpush = 0;
|
zpush = 0;
|
||||||
player->mo->velz -= zpush;
|
player->mo->vel.z -= zpush;
|
||||||
move = FixedMul (move, finecosine[pitch]);
|
move = FixedMul (move, finecosine[pitch]);
|
||||||
}
|
}
|
||||||
player->mo->velx += FixedMul (move, finecosine[angle]);
|
player->mo->vel.x += FixedMul (move, finecosine[angle]);
|
||||||
player->mo->vely += FixedMul (move, finesine[angle]);
|
player->mo->vel.y += FixedMul (move, finesine[angle]);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1805,8 +1804,8 @@ void P_Bob (player_t *player, angle_t angle, fixed_t move, bool forward)
|
||||||
|
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
|
|
||||||
player->velx += FixedMul(move, finecosine[angle]);
|
player->vel.x += FixedMul(move, finecosine[angle]);
|
||||||
player->vely += FixedMul(move, finesine[angle]);
|
player->vel.y += FixedMul(move, finesine[angle]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1845,7 +1844,7 @@ void P_CalcHeight (player_t *player)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player->bob = DMulScale16 (player->velx, player->velx, player->vely, player->vely);
|
player->bob = DMulScale16 (player->vel.x, player->vel.x, player->vel.y, player->vel.y);
|
||||||
if (player->bob == 0)
|
if (player->bob == 0)
|
||||||
{
|
{
|
||||||
still = true;
|
still = true;
|
||||||
|
@ -2065,7 +2064,7 @@ void P_FallingDamage (AActor *actor)
|
||||||
if (actor->floorsector->Flags & SECF_NOFALLINGDAMAGE)
|
if (actor->floorsector->Flags & SECF_NOFALLINGDAMAGE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vel = abs(actor->velz);
|
vel = abs(actor->vel.z);
|
||||||
|
|
||||||
// Since Hexen falling damage is stronger than ZDoom's, it takes
|
// Since Hexen falling damage is stronger than ZDoom's, it takes
|
||||||
// precedence. ZDoom falling damage may not be as strong, but it
|
// precedence. ZDoom falling damage may not be as strong, but it
|
||||||
|
@ -2086,7 +2085,7 @@ void P_FallingDamage (AActor *actor)
|
||||||
{
|
{
|
||||||
vel = FixedMul (vel, 16*FRACUNIT/23);
|
vel = FixedMul (vel, 16*FRACUNIT/23);
|
||||||
damage = ((FixedMul (vel, vel) / 10) >> FRACBITS) - 24;
|
damage = ((FixedMul (vel, vel) / 10) >> FRACBITS) - 24;
|
||||||
if (actor->velz > -39*FRACUNIT && damage > actor->health
|
if (actor->vel.z > -39*FRACUNIT && damage > actor->health
|
||||||
&& actor->health != 1)
|
&& actor->health != 1)
|
||||||
{ // No-death threshold
|
{ // No-death threshold
|
||||||
damage = actor->health-1;
|
damage = actor->health-1;
|
||||||
|
@ -2575,11 +2574,11 @@ void P_PlayerThink (player_t *player)
|
||||||
}
|
}
|
||||||
else if (player->mo->waterlevel >= 2)
|
else if (player->mo->waterlevel >= 2)
|
||||||
{
|
{
|
||||||
player->mo->velz = FixedMul(4*FRACUNIT, player->mo->Speed);
|
player->mo->vel.z = FixedMul(4*FRACUNIT, player->mo->Speed);
|
||||||
}
|
}
|
||||||
else if (player->mo->flags & MF_NOGRAVITY)
|
else if (player->mo->flags & MF_NOGRAVITY)
|
||||||
{
|
{
|
||||||
player->mo->velz = 3*FRACUNIT;
|
player->mo->vel.z = 3*FRACUNIT;
|
||||||
}
|
}
|
||||||
else if (level.IsJumpingAllowed() && player->onground && player->jumpTics == 0)
|
else if (level.IsJumpingAllowed() && player->onground && player->jumpTics == 0)
|
||||||
{
|
{
|
||||||
|
@ -2588,7 +2587,7 @@ void P_PlayerThink (player_t *player)
|
||||||
// [BC] If the player has the high jump power, double his jump velocity.
|
// [BC] If the player has the high jump power, double his jump velocity.
|
||||||
if ( player->cheats & CF_HIGHJUMP ) jumpvelz *= 2;
|
if ( player->cheats & CF_HIGHJUMP ) jumpvelz *= 2;
|
||||||
|
|
||||||
player->mo->velz += jumpvelz;
|
player->mo->vel.z += jumpvelz;
|
||||||
player->mo->flags2 &= ~MF2_ONMOBJ;
|
player->mo->flags2 &= ~MF2_ONMOBJ;
|
||||||
player->jumpTics = -1;
|
player->jumpTics = -1;
|
||||||
if (!(player->cheats & CF_PREDICTING))
|
if (!(player->cheats & CF_PREDICTING))
|
||||||
|
@ -2614,12 +2613,12 @@ void P_PlayerThink (player_t *player)
|
||||||
}
|
}
|
||||||
if (player->mo->waterlevel >= 2 || (player->mo->flags2 & MF2_FLY) || (player->cheats & CF_NOCLIP2))
|
if (player->mo->waterlevel >= 2 || (player->mo->flags2 & MF2_FLY) || (player->cheats & CF_NOCLIP2))
|
||||||
{
|
{
|
||||||
player->mo->velz = FixedMul(player->mo->Speed, cmd->ucmd.upmove << 9);
|
player->mo->vel.z = FixedMul(player->mo->Speed, cmd->ucmd.upmove << 9);
|
||||||
if (player->mo->waterlevel < 2 && !(player->mo->flags & MF_NOGRAVITY))
|
if (player->mo->waterlevel < 2 && !(player->mo->flags & MF_NOGRAVITY))
|
||||||
{
|
{
|
||||||
player->mo->flags2 |= MF2_FLY;
|
player->mo->flags2 |= MF2_FLY;
|
||||||
player->mo->flags |= MF_NOGRAVITY;
|
player->mo->flags |= MF_NOGRAVITY;
|
||||||
if ((player->mo->velz <= -39 * FRACUNIT) && !(player->cheats & CF_PREDICTING))
|
if ((player->mo->vel.z <= -39 * FRACUNIT) && !(player->cheats & CF_PREDICTING))
|
||||||
{ // Stop falling scream
|
{ // Stop falling scream
|
||||||
S_StopSound (player->mo, CHAN_VOICE);
|
S_StopSound (player->mo, CHAN_VOICE);
|
||||||
}
|
}
|
||||||
|
@ -2649,8 +2648,8 @@ void P_PlayerThink (player_t *player)
|
||||||
// Player must be touching the floor
|
// Player must be touching the floor
|
||||||
P_PlayerOnSpecialFlat(player, P_GetThingFloorType(player->mo));
|
P_PlayerOnSpecialFlat(player, P_GetThingFloorType(player->mo));
|
||||||
}
|
}
|
||||||
if (player->mo->velz <= -player->mo->FallingScreamMinSpeed &&
|
if (player->mo->vel.z <= -player->mo->FallingScreamMinSpeed &&
|
||||||
player->mo->velz >= -player->mo->FallingScreamMaxSpeed && !player->morphTics &&
|
player->mo->vel.z >= -player->mo->FallingScreamMaxSpeed && !player->morphTics &&
|
||||||
player->mo->waterlevel == 0)
|
player->mo->waterlevel == 0)
|
||||||
{
|
{
|
||||||
int id = S_FindSkinnedSound (player->mo, "*falling");
|
int id = S_FindSkinnedSound (player->mo, "*falling");
|
||||||
|
@ -2753,13 +2752,13 @@ void P_PredictionLerpReset()
|
||||||
|
|
||||||
bool P_LerpCalculate(PredictPos from, PredictPos to, PredictPos &result, float scale)
|
bool P_LerpCalculate(PredictPos from, PredictPos to, PredictPos &result, float scale)
|
||||||
{
|
{
|
||||||
TVector3<double> vecFrom(FIXED2DBL(from.x), FIXED2DBL(from.y), FIXED2DBL(from.z));
|
DVector3 vecFrom(FIXED2DBL(from.x), FIXED2DBL(from.y), FIXED2DBL(from.z));
|
||||||
TVector3<double> vecTo(FIXED2DBL(to.x), FIXED2DBL(to.y), FIXED2DBL(to.z));
|
DVector3 vecTo(FIXED2DBL(to.x), FIXED2DBL(to.y), FIXED2DBL(to.z));
|
||||||
TVector3<double> vecResult;
|
DVector3 vecResult;
|
||||||
vecResult = vecTo - vecFrom;
|
vecResult = vecTo - vecFrom;
|
||||||
vecResult *= scale;
|
vecResult *= scale;
|
||||||
vecResult = vecResult + vecFrom;
|
vecResult = vecResult + vecFrom;
|
||||||
TVector3<double> delta = vecResult - vecTo;
|
DVector3 delta = vecResult - vecTo;
|
||||||
|
|
||||||
result.x = FLOAT2FIXED(vecResult.X);
|
result.x = FLOAT2FIXED(vecResult.X);
|
||||||
result.y = FLOAT2FIXED(vecResult.Y);
|
result.y = FLOAT2FIXED(vecResult.Y);
|
||||||
|
@ -3072,8 +3071,8 @@ void player_t::Serialize (FArchive &arc)
|
||||||
<< viewheight
|
<< viewheight
|
||||||
<< deltaviewheight
|
<< deltaviewheight
|
||||||
<< bob
|
<< bob
|
||||||
<< velx
|
<< vel.x
|
||||||
<< vely
|
<< vel.y
|
||||||
<< centering
|
<< centering
|
||||||
<< health
|
<< health
|
||||||
<< inventorytics;
|
<< inventorytics;
|
||||||
|
|
|
@ -577,7 +577,7 @@ bool EV_MovePolyTo(line_t *line, int polyNum, int speed, fixed_t targx, fixed_t
|
||||||
{
|
{
|
||||||
DMovePolyTo *pe = NULL;
|
DMovePolyTo *pe = NULL;
|
||||||
FPolyObj *poly;
|
FPolyObj *poly;
|
||||||
TVector2<double> dist;
|
DVector2 dist;
|
||||||
double distlen;
|
double distlen;
|
||||||
|
|
||||||
if ((poly = PO_GetPolyobj(polyNum)) == NULL)
|
if ((poly = PO_GetPolyobj(polyNum)) == NULL)
|
||||||
|
@ -900,8 +900,8 @@ void FPolyObj::ThrustMobj (AActor *actor, side_t *side)
|
||||||
|
|
||||||
thrustX = FixedMul (force, finecosine[thrustAngle]);
|
thrustX = FixedMul (force, finecosine[thrustAngle]);
|
||||||
thrustY = FixedMul (force, finesine[thrustAngle]);
|
thrustY = FixedMul (force, finesine[thrustAngle]);
|
||||||
actor->velx += thrustX;
|
actor->vel.x += thrustX;
|
||||||
actor->vely += thrustY;
|
actor->vel.y += thrustY;
|
||||||
if (crush)
|
if (crush)
|
||||||
{
|
{
|
||||||
fixedvec2 pos = actor->Vec2Offset(thrustX, thrustY);
|
fixedvec2 pos = actor->Vec2Offset(thrustX, thrustY);
|
||||||
|
|
|
@ -1700,8 +1700,8 @@ static bool sv_compare(vissprite_t *a, vissprite_t *b)
|
||||||
// the viewpoint.
|
// the viewpoint.
|
||||||
static bool sv_compare2d(vissprite_t *a, vissprite_t *b)
|
static bool sv_compare2d(vissprite_t *a, vissprite_t *b)
|
||||||
{
|
{
|
||||||
return TVector2<double>(a->deltax, a->deltay).LengthSquared() <
|
return DVector2(a->deltax, a->deltay).LengthSquared() <
|
||||||
TVector2<double>(b->deltax, b->deltay).LengthSquared();
|
DVector2(b->deltax, b->deltay).LengthSquared();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
|
@ -615,7 +615,7 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
|
||||||
{
|
{
|
||||||
fixedvec3a &start = i == 0 ? oldpos : InterpolationPath[i - 1];
|
fixedvec3a &start = i == 0 ? oldpos : InterpolationPath[i - 1];
|
||||||
fixedvec3a &end = InterpolationPath[i];
|
fixedvec3a &end = InterpolationPath[i];
|
||||||
pathlen += xs_CRoundToInt(TVector2<double>(end.x - start.x, end.y - start.y).Length());
|
pathlen += xs_CRoundToInt(DVector2(end.x - start.x, end.y - start.y).Length());
|
||||||
totalzdiff += start.z;
|
totalzdiff += start.z;
|
||||||
totaladiff += start.angle;
|
totaladiff += start.angle;
|
||||||
}
|
}
|
||||||
|
@ -625,7 +625,7 @@ void R_InterpolateView (player_t *player, fixed_t frac, InterpolationViewer *ivi
|
||||||
{
|
{
|
||||||
fixedvec3a &start = i == 0 ? oldpos : InterpolationPath[i - 1];
|
fixedvec3a &start = i == 0 ? oldpos : InterpolationPath[i - 1];
|
||||||
fixedvec3a &end = InterpolationPath[i];
|
fixedvec3a &end = InterpolationPath[i];
|
||||||
fixed_t fraglen = xs_CRoundToInt(TVector2<double>(end.x - start.x, end.y - start.y).Length());
|
fixed_t fraglen = xs_CRoundToInt(DVector2(end.x - start.x, end.y - start.y).Length());
|
||||||
zdiff += start.z;
|
zdiff += start.z;
|
||||||
adiff += start.angle;
|
adiff += start.angle;
|
||||||
if (fraglen <= interpolatedlen)
|
if (fraglen <= interpolatedlen)
|
||||||
|
|
|
@ -736,9 +736,9 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector,
|
||||||
// Only actors maintain velocity information.
|
// Only actors maintain velocity information.
|
||||||
if (type == SOURCE_Actor && actor != NULL)
|
if (type == SOURCE_Actor && actor != NULL)
|
||||||
{
|
{
|
||||||
vel->X = FIXED2FLOAT(actor->velx) * TICRATE;
|
vel->X = FIXED2FLOAT(actor->vel.x) * TICRATE;
|
||||||
vel->Y = FIXED2FLOAT(actor->velz) * TICRATE;
|
vel->Y = FIXED2FLOAT(actor->vel.z) * TICRATE;
|
||||||
vel->Z = FIXED2FLOAT(actor->vely) * TICRATE;
|
vel->Z = FIXED2FLOAT(actor->vel.y) * TICRATE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1952,9 +1952,9 @@ static void S_SetListener(SoundListener &listener, AActor *listenactor)
|
||||||
{
|
{
|
||||||
listener.angle = ANGLE2RADF(listenactor->angle);
|
listener.angle = ANGLE2RADF(listenactor->angle);
|
||||||
/*
|
/*
|
||||||
listener.velocity.X = listenactor->velx * (TICRATE/65536.f);
|
listener.velocity.X = listenactor->vel.x * (TICRATE/65536.f);
|
||||||
listener.velocity.Y = listenactor->velz * (TICRATE/65536.f);
|
listener.velocity.Y = listenactor->vel.z * (TICRATE/65536.f);
|
||||||
listener.velocity.Z = listenactor->vely * (TICRATE/65536.f);
|
listener.velocity.Z = listenactor->vel.y * (TICRATE/65536.f);
|
||||||
*/
|
*/
|
||||||
listener.velocity.Zero();
|
listener.velocity.Zero();
|
||||||
listener.position.X = FIXED2FLOAT(listenactor->SoundX());
|
listener.position.X = FIXED2FLOAT(listenactor->SoundX());
|
||||||
|
|
|
@ -316,7 +316,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, GetDistance)
|
||||||
if (checkz)
|
if (checkz)
|
||||||
diff.z += (target->height - self->height) / 2;
|
diff.z += (target->height - self->height) / 2;
|
||||||
|
|
||||||
const double length = TVector3<double>(FIXED2DBL(diff.x), FIXED2DBL(diff.y), (checkz) ? FIXED2DBL(diff.z) : 0).Length();
|
const double length = DVector3(FIXED2DBL(diff.x), FIXED2DBL(diff.y), (checkz) ? FIXED2DBL(diff.z) : 0).Length();
|
||||||
ret->SetFloat(length);
|
ret->SetFloat(length);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1260,16 +1260,16 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile)
|
||||||
{
|
{
|
||||||
if (CMF_OFFSETPITCH & flags)
|
if (CMF_OFFSETPITCH & flags)
|
||||||
{
|
{
|
||||||
TVector2<double> velocity (missile->velx, missile->vely);
|
DVector2 velocity (missile->vel.x, missile->vel.y);
|
||||||
pitch += R_PointToAngle2(0,0, xs_CRoundToInt(velocity.Length()), missile->velz);
|
pitch += R_PointToAngle2(0,0, xs_CRoundToInt(velocity.Length()), missile->vel.z);
|
||||||
}
|
}
|
||||||
ang = pitch >> ANGLETOFINESHIFT;
|
ang = pitch >> ANGLETOFINESHIFT;
|
||||||
missilespeed = abs(FixedMul(finecosine[ang], missile->Speed));
|
missilespeed = abs(FixedMul(finecosine[ang], missile->Speed));
|
||||||
missile->velz = FixedMul(finesine[ang], missile->Speed);
|
missile->vel.z = FixedMul(finesine[ang], missile->Speed);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TVector2<double> velocity (missile->velx, missile->vely);
|
DVector2 velocity (missile->vel.x, missile->vel.y);
|
||||||
missilespeed = xs_CRoundToInt(velocity.Length());
|
missilespeed = xs_CRoundToInt(velocity.Length());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1284,8 +1284,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomMissile)
|
||||||
missile->angle = (CMF_ABSOLUTEANGLE & flags) ? angle : missile->angle + angle ;
|
missile->angle = (CMF_ABSOLUTEANGLE & flags) ? angle : missile->angle + angle ;
|
||||||
|
|
||||||
ang = missile->angle >> ANGLETOFINESHIFT;
|
ang = missile->angle >> ANGLETOFINESHIFT;
|
||||||
missile->velx = FixedMul(missilespeed, finecosine[ang]);
|
missile->vel.x = FixedMul(missilespeed, finecosine[ang]);
|
||||||
missile->vely = FixedMul(missilespeed, finesine[ang]);
|
missile->vel.y = FixedMul(missilespeed, finesine[ang]);
|
||||||
|
|
||||||
// handle projectile shooting projectiles - track the
|
// handle projectile shooting projectiles - track the
|
||||||
// links back to a real owner
|
// links back to a real owner
|
||||||
|
@ -1677,12 +1677,12 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireCustomMissile)
|
||||||
{
|
{
|
||||||
// This original implementation is to aim straight ahead and then offset
|
// This original implementation is to aim straight ahead and then offset
|
||||||
// the angle from the resulting direction.
|
// the angle from the resulting direction.
|
||||||
TVector3<double> velocity(misl->velx, misl->vely, 0);
|
DVector3 velocity(misl->vel.x, misl->vel.y, 0);
|
||||||
fixed_t missilespeed = xs_CRoundToInt(velocity.Length());
|
fixed_t missilespeed = xs_CRoundToInt(velocity.Length());
|
||||||
misl->angle += angle;
|
misl->angle += angle;
|
||||||
angle_t an = misl->angle >> ANGLETOFINESHIFT;
|
angle_t an = misl->angle >> ANGLETOFINESHIFT;
|
||||||
misl->velx = FixedMul (missilespeed, finecosine[an]);
|
misl->vel.x = FixedMul (missilespeed, finecosine[an]);
|
||||||
misl->vely = FixedMul (missilespeed, finesine[an]);
|
misl->vel.y = FixedMul (missilespeed, finesine[an]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1932,7 +1932,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun)
|
||||||
{
|
{
|
||||||
// We probably won't hit the target, but aim at it anyway so we don't look stupid.
|
// We probably won't hit the target, but aim at it anyway so we don't look stupid.
|
||||||
fixedvec2 pos = self->Vec2To(self->target);
|
fixedvec2 pos = self->Vec2To(self->target);
|
||||||
TVector2<double> xydiff(pos.x, pos.y);
|
DVector2 xydiff(pos.x, pos.y);
|
||||||
double zdiff = (self->target->Z() + (self->target->height>>1)) -
|
double zdiff = (self->target->Z() + (self->target->height>>1)) -
|
||||||
(self->Z() + (self->height>>1) - self->floorclip);
|
(self->Z() + (self->height>>1) - self->floorclip);
|
||||||
self->pitch = int(atan2(zdiff, xydiff.Length()) * ANGLE_180 / -M_PI);
|
self->pitch = int(atan2(zdiff, xydiff.Length()) * ANGLE_180 / -M_PI);
|
||||||
|
@ -1940,7 +1940,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun)
|
||||||
// Let the aim trail behind the player
|
// Let the aim trail behind the player
|
||||||
if (aim)
|
if (aim)
|
||||||
{
|
{
|
||||||
saved_angle = self->angle = self->AngleTo(self->target, -self->target->velx * 3, -self->target->vely * 3);
|
saved_angle = self->angle = self->AngleTo(self->target, -self->target->vel.x * 3, -self->target->vel.y * 3);
|
||||||
|
|
||||||
if (aim == CRF_AIMDIRECT)
|
if (aim == CRF_AIMDIRECT)
|
||||||
{
|
{
|
||||||
|
@ -1950,7 +1950,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomRailgun)
|
||||||
spawnofs_xy * finecosine[self->angle],
|
spawnofs_xy * finecosine[self->angle],
|
||||||
spawnofs_xy * finesine[self->angle]));
|
spawnofs_xy * finesine[self->angle]));
|
||||||
spawnofs_xy = 0;
|
spawnofs_xy = 0;
|
||||||
self->angle = self->AngleTo(self->target,- self->target->velx * 3, -self->target->vely * 3);
|
self->angle = self->AngleTo(self->target,- self->target->vel.x * 3, -self->target->vel.y * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self->target->flags & MF_SHADOW)
|
if (self->target->flags & MF_SHADOW)
|
||||||
|
@ -2518,15 +2518,15 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnItemEx)
|
||||||
}
|
}
|
||||||
if (flags & SIXF_MULTIPLYSPEED)
|
if (flags & SIXF_MULTIPLYSPEED)
|
||||||
{
|
{
|
||||||
mo->velx = FixedMul(xvel, mo->Speed);
|
mo->vel.x = FixedMul(xvel, mo->Speed);
|
||||||
mo->vely = FixedMul(yvel, mo->Speed);
|
mo->vel.y = FixedMul(yvel, mo->Speed);
|
||||||
mo->velz = FixedMul(zvel, mo->Speed);
|
mo->vel.z = FixedMul(zvel, mo->Speed);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mo->velx = xvel;
|
mo->vel.x = xvel;
|
||||||
mo->vely = yvel;
|
mo->vel.y = yvel;
|
||||||
mo->velz = zvel;
|
mo->vel.z = zvel;
|
||||||
}
|
}
|
||||||
mo->angle = angle;
|
mo->angle = angle;
|
||||||
}
|
}
|
||||||
|
@ -2598,9 +2598,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ThrowGrenade)
|
||||||
fixed_t z_velx = FixedMul(z_xyscale, finecosine[angle]);
|
fixed_t z_velx = FixedMul(z_xyscale, finecosine[angle]);
|
||||||
fixed_t z_vely = FixedMul(z_xyscale, finesine[angle]);
|
fixed_t z_vely = FixedMul(z_xyscale, finesine[angle]);
|
||||||
|
|
||||||
bo->velx = xy_velx + z_velx + (self->velx >> 1);
|
bo->vel.x = xy_velx + z_velx + (self->vel.x >> 1);
|
||||||
bo->vely = xy_vely + z_vely + (self->vely >> 1);
|
bo->vel.y = xy_vely + z_vely + (self->vel.y >> 1);
|
||||||
bo->velz = xy_velz + z_velz;
|
bo->vel.z = xy_velz + z_velz;
|
||||||
|
|
||||||
bo->target = self;
|
bo->target = self;
|
||||||
P_CheckMissileSpawn (bo, self->radius);
|
P_CheckMissileSpawn (bo, self->radius);
|
||||||
|
@ -2625,8 +2625,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Recoil)
|
||||||
|
|
||||||
angle_t angle = self->angle + ANG180;
|
angle_t angle = self->angle + ANG180;
|
||||||
angle >>= ANGLETOFINESHIFT;
|
angle >>= ANGLETOFINESHIFT;
|
||||||
self->velx += FixedMul(xyvel, finecosine[angle]);
|
self->vel.x += FixedMul(xyvel, finecosine[angle]);
|
||||||
self->vely += FixedMul(xyvel, finesine[angle]);
|
self->vel.y += FixedMul(xyvel, finesine[angle]);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2985,9 +2985,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnDebris)
|
||||||
{
|
{
|
||||||
mo->SetState (mo->GetClass()->OwnedStates + i);
|
mo->SetState (mo->GetClass()->OwnedStates + i);
|
||||||
}
|
}
|
||||||
mo->velz = FixedMul(mult_v, ((pr_spawndebris()&7)+5)*FRACUNIT);
|
mo->vel.z = FixedMul(mult_v, ((pr_spawndebris()&7)+5)*FRACUNIT);
|
||||||
mo->velx = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6));
|
mo->vel.x = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6));
|
||||||
mo->vely = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6));
|
mo->vel.y = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3344,7 +3344,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
self->velx = self->vely = self->velz = 0;
|
self->vel.x = self->vel.y = self->vel.z = 0;
|
||||||
self->height = self->GetDefault()->height;
|
self->height = self->GetDefault()->height;
|
||||||
|
|
||||||
// [RH] In Hexen, this creates a random number of shards (range [24,56])
|
// [RH] In Hexen, this creates a random number of shards (range [24,56])
|
||||||
|
@ -3363,9 +3363,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Burst)
|
||||||
|
|
||||||
if (mo)
|
if (mo)
|
||||||
{
|
{
|
||||||
mo->velz = FixedDiv(mo->Z() - self->Z(), self->height)<<2;
|
mo->vel.z = FixedDiv(mo->Z() - self->Z(), self->height)<<2;
|
||||||
mo->velx = pr_burst.Random2 () << (FRACBITS-7);
|
mo->vel.x = pr_burst.Random2 () << (FRACBITS-7);
|
||||||
mo->vely = pr_burst.Random2 () << (FRACBITS-7);
|
mo->vel.y = pr_burst.Random2 () << (FRACBITS-7);
|
||||||
mo->RenderStyle = self->RenderStyle;
|
mo->RenderStyle = self->RenderStyle;
|
||||||
mo->alpha = self->alpha;
|
mo->alpha = self->alpha;
|
||||||
mo->CopyFriendliness(self, true);
|
mo->CopyFriendliness(self, true);
|
||||||
|
@ -3429,11 +3429,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckCeiling)
|
||||||
DEFINE_ACTION_FUNCTION(AActor, A_Stop)
|
DEFINE_ACTION_FUNCTION(AActor, A_Stop)
|
||||||
{
|
{
|
||||||
PARAM_ACTION_PROLOGUE;
|
PARAM_ACTION_PROLOGUE;
|
||||||
self->velx = self->vely = self->velz = 0;
|
self->vel.x = self->vel.y = self->vel.z = 0;
|
||||||
if (self->player && self->player->mo == self && !(self->player->cheats & CF_PREDICTING))
|
if (self->player && self->player->mo == self && !(self->player->cheats & CF_PREDICTING))
|
||||||
{
|
{
|
||||||
self->player->mo->PlayIdle();
|
self->player->mo->PlayIdle();
|
||||||
self->player->velx = self->player->vely = 0;
|
self->player->vel.x = self->player->vel.y = 0;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3443,10 +3443,10 @@ static void CheckStopped(AActor *self)
|
||||||
if (self->player != NULL &&
|
if (self->player != NULL &&
|
||||||
self->player->mo == self &&
|
self->player->mo == self &&
|
||||||
!(self->player->cheats & CF_PREDICTING) &&
|
!(self->player->cheats & CF_PREDICTING) &&
|
||||||
!(self->velx | self->vely | self->velz))
|
!(self->vel.x | self->vel.y | self->vel.z))
|
||||||
{
|
{
|
||||||
self->player->mo->PlayIdle();
|
self->player->mo->PlayIdle();
|
||||||
self->player->velx = self->player->vely = 0;
|
self->player->vel.x = self->player->vel.y = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4562,11 +4562,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ScaleVelocity)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
INTBOOL was_moving = ref->velx | ref->vely | ref->velz;
|
INTBOOL was_moving = ref->vel.x | ref->vel.y | ref->vel.z;
|
||||||
|
|
||||||
ref->velx = FixedMul(ref->velx, scale);
|
ref->vel.x = FixedMul(ref->vel.x, scale);
|
||||||
ref->vely = FixedMul(ref->vely, scale);
|
ref->vel.y = FixedMul(ref->vel.y, scale);
|
||||||
ref->velz = FixedMul(ref->velz, scale);
|
ref->vel.z = FixedMul(ref->vel.z, scale);
|
||||||
|
|
||||||
// If the actor was previously moving but now is not, and is a player,
|
// If the actor was previously moving but now is not, and is a player,
|
||||||
// update its player variables. (See A_Stop.)
|
// update its player variables. (See A_Stop.)
|
||||||
|
@ -4599,7 +4599,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeVelocity)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
INTBOOL was_moving = ref->velx | ref->vely | ref->velz;
|
INTBOOL was_moving = ref->vel.x | ref->vel.y | ref->vel.z;
|
||||||
|
|
||||||
fixed_t vx = x, vy = y, vz = z;
|
fixed_t vx = x, vy = y, vz = z;
|
||||||
fixed_t sina = finesine[ref->angle >> ANGLETOFINESHIFT];
|
fixed_t sina = finesine[ref->angle >> ANGLETOFINESHIFT];
|
||||||
|
@ -4612,15 +4612,15 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_ChangeVelocity)
|
||||||
}
|
}
|
||||||
if (flags & 2) // discard old velocity - replace old velocity with new velocity
|
if (flags & 2) // discard old velocity - replace old velocity with new velocity
|
||||||
{
|
{
|
||||||
ref->velx = vx;
|
ref->vel.x = vx;
|
||||||
ref->vely = vy;
|
ref->vel.y = vy;
|
||||||
ref->velz = vz;
|
ref->vel.z = vz;
|
||||||
}
|
}
|
||||||
else // add new velocity to old velocity
|
else // add new velocity to old velocity
|
||||||
{
|
{
|
||||||
ref->velx += vx;
|
ref->vel.x += vx;
|
||||||
ref->vely += vy;
|
ref->vel.y += vy;
|
||||||
ref->velz += vz;
|
ref->vel.z += vz;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (was_moving)
|
if (was_moving)
|
||||||
|
@ -4903,7 +4903,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Teleport)
|
||||||
ref->angle = spot->angle;
|
ref->angle = spot->angle;
|
||||||
|
|
||||||
if (!(flags & TF_KEEPVELOCITY))
|
if (!(flags & TF_KEEPVELOCITY))
|
||||||
ref->velx = ref->vely = ref->velz = 0;
|
ref->vel.x = ref->vel.y = ref->vel.z = 0;
|
||||||
|
|
||||||
if (!(flags & TF_NOJUMP)) //The state jump should only happen with the calling actor.
|
if (!(flags & TF_NOJUMP)) //The state jump should only happen with the calling actor.
|
||||||
{
|
{
|
||||||
|
@ -5139,9 +5139,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_WolfAttack)
|
||||||
dist /= blocksize;
|
dist /= blocksize;
|
||||||
|
|
||||||
// Now for the speed accuracy thingie
|
// Now for the speed accuracy thingie
|
||||||
fixed_t speed = FixedMul(self->target->velx, self->target->velx)
|
fixed_t speed = FixedMul(self->target->vel.x, self->target->vel.x)
|
||||||
+ FixedMul(self->target->vely, self->target->vely)
|
+ FixedMul(self->target->vel.y, self->target->vel.y)
|
||||||
+ FixedMul(self->target->velz, self->target->velz);
|
+ FixedMul(self->target->vel.z, self->target->vel.z);
|
||||||
int hitchance = speed < runspeed ? 256 : 160;
|
int hitchance = speed < runspeed ? 256 : 160;
|
||||||
|
|
||||||
// Distance accuracy (factoring dodge)
|
// Distance accuracy (factoring dodge)
|
||||||
|
@ -5514,7 +5514,7 @@ static bool DoRadiusGive(AActor *self, AActor *thing, PClassActor *item, int amo
|
||||||
{ // check if inside a sphere
|
{ // check if inside a sphere
|
||||||
double distsquared = double(distance) * double(distance);
|
double distsquared = double(distance) * double(distance);
|
||||||
double minsquared = double(mindist) * double(mindist);
|
double minsquared = double(mindist) * double(mindist);
|
||||||
double lengthsquared = TVector3<double>(diff.x, diff.y, diff.z).LengthSquared();
|
double lengthsquared = DVector3(diff.x, diff.y, diff.z).LengthSquared();
|
||||||
if (lengthsquared > distsquared || (minsquared && (lengthsquared < minsquared)))
|
if (lengthsquared > distsquared || (minsquared && (lengthsquared < minsquared)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
@ -6776,10 +6776,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FaceMovementDirection)
|
||||||
}
|
}
|
||||||
|
|
||||||
//Don't bother calculating this if we don't have any horizontal movement.
|
//Don't bother calculating this if we don't have any horizontal movement.
|
||||||
if (!(flags & FMDF_NOANGLE) && (mobj->velx != 0 || mobj->vely != 0))
|
if (!(flags & FMDF_NOANGLE) && (mobj->vel.x != 0 || mobj->vel.y != 0))
|
||||||
{
|
{
|
||||||
angle_t current = mobj->angle;
|
angle_t current = mobj->angle;
|
||||||
const angle_t angle = R_PointToAngle2(0, 0, mobj->velx, mobj->vely);
|
const angle_t angle = R_PointToAngle2(0, 0, mobj->vel.x, mobj->vel.y);
|
||||||
//Done because using anglelimit directly causes a signed/unsigned mismatch.
|
//Done because using anglelimit directly causes a signed/unsigned mismatch.
|
||||||
const angle_t limit = anglelimit;
|
const angle_t limit = anglelimit;
|
||||||
|
|
||||||
|
@ -6814,8 +6814,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FaceMovementDirection)
|
||||||
if (!(flags & FMDF_NOPITCH))
|
if (!(flags & FMDF_NOPITCH))
|
||||||
{
|
{
|
||||||
fixed_t current = mobj->pitch;
|
fixed_t current = mobj->pitch;
|
||||||
const TVector2<double> velocity(mobj->velx, mobj->vely);
|
const DVector2 velocity(mobj->vel.x, mobj->vel.y);
|
||||||
const fixed_t pitch = R_PointToAngle2(0, 0, xs_CRoundToInt(velocity.Length()), -mobj->velz);
|
const fixed_t pitch = R_PointToAngle2(0, 0, xs_CRoundToInt(velocity.Length()), -mobj->vel.z);
|
||||||
if (pitchlimit > 0)
|
if (pitchlimit > 0)
|
||||||
{
|
{
|
||||||
// [MC] angle_t for pitchlimit was required because otherwise
|
// [MC] angle_t for pitchlimit was required because otherwise
|
||||||
|
|
|
@ -635,12 +635,12 @@ void InitThingdef()
|
||||||
symt.AddSymbol(new PField(NAME_X, TypeFixed, VARF_Native, myoffsetof(AActor,__pos.x))); // must remain read-only!
|
symt.AddSymbol(new PField(NAME_X, TypeFixed, VARF_Native, myoffsetof(AActor,__pos.x))); // must remain read-only!
|
||||||
symt.AddSymbol(new PField(NAME_Y, TypeFixed, VARF_Native, myoffsetof(AActor,__pos.y))); // must remain read-only!
|
symt.AddSymbol(new PField(NAME_Y, TypeFixed, VARF_Native, myoffsetof(AActor,__pos.y))); // must remain read-only!
|
||||||
symt.AddSymbol(new PField(NAME_Z, TypeFixed, VARF_Native, myoffsetof(AActor,__pos.z))); // must remain read-only!
|
symt.AddSymbol(new PField(NAME_Z, TypeFixed, VARF_Native, myoffsetof(AActor,__pos.z))); // must remain read-only!
|
||||||
symt.AddSymbol(new PField(NAME_VelX, TypeFixed, VARF_Native, myoffsetof(AActor,velx)));
|
symt.AddSymbol(new PField(NAME_VelX, TypeFixed, VARF_Native, myoffsetof(AActor,vel.x)));
|
||||||
symt.AddSymbol(new PField(NAME_VelY, TypeFixed, VARF_Native, myoffsetof(AActor,vely)));
|
symt.AddSymbol(new PField(NAME_VelY, TypeFixed, VARF_Native, myoffsetof(AActor,vel.y)));
|
||||||
symt.AddSymbol(new PField(NAME_VelZ, TypeFixed, VARF_Native, myoffsetof(AActor,velz)));
|
symt.AddSymbol(new PField(NAME_VelZ, TypeFixed, VARF_Native, myoffsetof(AActor,vel.z)));
|
||||||
symt.AddSymbol(new PField(NAME_MomX, TypeFixed, VARF_Native, myoffsetof(AActor,velx)));
|
symt.AddSymbol(new PField(NAME_MomX, TypeFixed, VARF_Native, myoffsetof(AActor,vel.x)));
|
||||||
symt.AddSymbol(new PField(NAME_MomY, TypeFixed, VARF_Native, myoffsetof(AActor,vely)));
|
symt.AddSymbol(new PField(NAME_MomY, TypeFixed, VARF_Native, myoffsetof(AActor,vel.y)));
|
||||||
symt.AddSymbol(new PField(NAME_MomZ, TypeFixed, VARF_Native, myoffsetof(AActor,velz)));
|
symt.AddSymbol(new PField(NAME_MomZ, TypeFixed, VARF_Native, myoffsetof(AActor,vel.z)));
|
||||||
symt.AddSymbol(new PField(NAME_ScaleX, TypeFixed, VARF_Native, myoffsetof(AActor,scaleX)));
|
symt.AddSymbol(new PField(NAME_ScaleX, TypeFixed, VARF_Native, myoffsetof(AActor,scaleX)));
|
||||||
symt.AddSymbol(new PField(NAME_ScaleY, TypeFixed, VARF_Native, myoffsetof(AActor,scaleY)));
|
symt.AddSymbol(new PField(NAME_ScaleY, TypeFixed, VARF_Native, myoffsetof(AActor,scaleY)));
|
||||||
symt.AddSymbol(new PField(NAME_Score, TypeSInt32, VARF_Native, myoffsetof(AActor,Score)));
|
symt.AddSymbol(new PField(NAME_Score, TypeSInt32, VARF_Native, myoffsetof(AActor,Score)));
|
||||||
|
|
|
@ -1331,7 +1331,7 @@ DEFINE_PROPERTY(cameraheight, F, Actor)
|
||||||
DEFINE_PROPERTY(vspeed, F, Actor)
|
DEFINE_PROPERTY(vspeed, F, Actor)
|
||||||
{
|
{
|
||||||
PROP_FIXED_PARM(i, 0);
|
PROP_FIXED_PARM(i, 0);
|
||||||
defaults->velz = i;
|
defaults->vel.z = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -1279,7 +1279,7 @@ void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
|
||||||
ds_x1 = x1;
|
ds_x1 = x1;
|
||||||
ds_x2 = x2 - 1;
|
ds_x2 = x2 - 1;
|
||||||
|
|
||||||
TVector2<double> tex(x1 - originx, y - originy);
|
DVector2 tex(x1 - originx, y - originy);
|
||||||
if (dorotate)
|
if (dorotate)
|
||||||
{
|
{
|
||||||
double t = tex.X;
|
double t = tex.X;
|
||||||
|
|
|
@ -1232,4 +1232,9 @@ typedef TRotator<float> FRotator;
|
||||||
typedef TMatrix3x3<float> FMatrix3x3;
|
typedef TMatrix3x3<float> FMatrix3x3;
|
||||||
//typedef TAngle<float> FAngle;
|
//typedef TAngle<float> FAngle;
|
||||||
|
|
||||||
|
typedef TVector2<double> DVector2;
|
||||||
|
typedef TVector3<double> DVector3;
|
||||||
|
typedef TRotator<double> DRotator;
|
||||||
|
typedef TMatrix3x3<double> DMatrix3x3;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -671,7 +671,7 @@ declarator(X) ::= decl_flags(A) type_list_or_void(B) variables_or_function(C).
|
||||||
X = NULL;
|
X = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declarator_no_fun(X) ::= decl_flags(A) type(B) variable_list(C).
|
declarator_no_fun(X) ::= decl_flags(A) type(B) variable_list(C) SEMICOLON.
|
||||||
{
|
{
|
||||||
NEW_AST_NODE(VarDeclarator, decl, A.SourceLoc ? A.SourceLoc : B->SourceLoc);
|
NEW_AST_NODE(VarDeclarator, decl, A.SourceLoc ? A.SourceLoc : B->SourceLoc);
|
||||||
decl->Type = B;
|
decl->Type = B;
|
||||||
|
|
|
@ -240,7 +240,7 @@ ACTOR Actor native //: Thinker
|
||||||
action native A_CustomMeleeAttack(int damage = 0, sound meleesound = "", sound misssound = "", name damagetype = "none", bool bleed = true);
|
action native A_CustomMeleeAttack(int damage = 0, sound meleesound = "", sound misssound = "", name damagetype = "none", bool bleed = true);
|
||||||
action native A_CustomComboAttack(class<Actor> missiletype, float spawnheight, int damage, sound meleesound = "", name damagetype = "none", bool bleed = true);
|
action native A_CustomComboAttack(class<Actor> missiletype, float spawnheight, int damage, sound meleesound = "", name damagetype = "none", bool bleed = true);
|
||||||
action native A_Burst(class<Actor> chunktype);
|
action native A_Burst(class<Actor> chunktype);
|
||||||
action native A_Blast(int flags = 0, int strength = 255, float radius = 255, float speed = 20, class<Actor> blasteffect = "BlastEffect", sound blastsound = "BlastRadius");
|
action native A_Blast(int flags = 0, float strength = 255, float radius = 255, float speed = 20, class<Actor> blasteffect = "BlastEffect", sound blastsound = "BlastRadius");
|
||||||
action native A_RadiusThrust(int force = 128, int distance = -1, int flags = RTF_AFFECTSOURCE, int fullthrustdistance = 0);
|
action native A_RadiusThrust(int force = 128, int distance = -1, int flags = RTF_AFFECTSOURCE, int fullthrustdistance = 0);
|
||||||
action native A_Explode(int damage = -1, int distance = -1, int flags = XF_HURTSOURCE, bool alert = false, int fulldamagedistance = 0, int nails = 0, int naildamage = 10, class<Actor> pufftype = "BulletPuff");
|
action native A_Explode(int damage = -1, int distance = -1, int flags = XF_HURTSOURCE, bool alert = false, int fulldamagedistance = 0, int nails = 0, int naildamage = 10, class<Actor> pufftype = "BulletPuff");
|
||||||
action native A_Stop();
|
action native A_Stop();
|
||||||
|
|
|
@ -66,6 +66,7 @@ Actor BetaSkull : LostSoul
|
||||||
Pain:
|
Pain:
|
||||||
SKUL G 4
|
SKUL G 4
|
||||||
SKUL H 2 A_Pain
|
SKUL H 2 A_Pain
|
||||||
|
Goto See
|
||||||
SKUL I 4
|
SKUL I 4
|
||||||
Goto See
|
Goto See
|
||||||
Death:
|
Death:
|
||||||
|
|
Loading…
Reference in a new issue