mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-15 08:41:59 +00:00
- first stage of converting actor angles to float complete
Patched up everything so that it compiles without errors again. This only addresses code related to some compile error. A large portion of the angle code still uses angle_t and converts back and forth.
This commit is contained in:
parent
c64eee5b15
commit
671291227e
112 changed files with 1132 additions and 1232 deletions
95
src/actor.h
95
src/actor.h
|
@ -600,7 +600,7 @@ public:
|
|||
|
||||
// Adjusts the angle for deflection/reflection of incoming missiles
|
||||
// Returns true if the missile should be allowed to explode anyway
|
||||
bool AdjustReflectionAngle (AActor *thing, angle_t &angle);
|
||||
bool AdjustReflectionAngle (AActor *thing, DAngle &angle);
|
||||
|
||||
// Returns true if this actor is within melee range of its target
|
||||
bool CheckMeleeRange();
|
||||
|
@ -782,9 +782,9 @@ public:
|
|||
}
|
||||
|
||||
// These also set CF_INTERPVIEW for players.
|
||||
void SetPitch(int p, bool interpolate, bool forceclamp = false);
|
||||
void SetAngle(angle_t ang, bool interpolate);
|
||||
void SetRoll(angle_t roll, bool interpolate);
|
||||
void SetPitch(DAngle p, bool interpolate, bool forceclamp = false);
|
||||
void SetAngle(DAngle ang, bool interpolate);
|
||||
void SetRoll(DAngle roll, bool interpolate);
|
||||
|
||||
PClassActor *GetBloodType(int type = 0) const
|
||||
{
|
||||
|
@ -872,6 +872,18 @@ public:
|
|||
return R_PointToAngle2(X(), Y(), other->X() + oxofs, other->Y() + oyofs);
|
||||
}
|
||||
|
||||
DAngle _f_AngleTo(AActor *other, bool absolute = false)
|
||||
{
|
||||
fixedvec3 otherpos = absolute ? other->Pos() : other->PosRelative(this);
|
||||
return g_atan2(otherpos.y - Y(), otherpos.x - X());
|
||||
}
|
||||
|
||||
DAngle _f_AngleTo(AActor *other, fixed_t oxofs, fixed_t oyofs, bool absolute = false) const
|
||||
{
|
||||
fixedvec3 otherpos = absolute ? other->Pos() : other->PosRelative(this);
|
||||
return g_atan2(otherpos.y + oxofs - Y(), otherpos.x + oyofs - X());
|
||||
}
|
||||
|
||||
fixedvec2 Vec2To(AActor *other) const
|
||||
{
|
||||
fixedvec3 otherpos = other->PosRelative(this);
|
||||
|
@ -973,7 +985,20 @@ public:
|
|||
AActor *snext, **sprev; // links in sector (if needed)
|
||||
fixedvec3 __pos; // double underscores so that it won't get used by accident. Access to this should be exclusively through the designated access functions.
|
||||
|
||||
/*
|
||||
angle_t angle;
|
||||
fixed_t pitch;
|
||||
angle_t roll; // This was fixed_t before, which is probably wrong
|
||||
*/
|
||||
|
||||
DRotator Angles;
|
||||
|
||||
// intentionally stange names so that searching for them is easier.
|
||||
angle_t _f_angle() { return FLOAT2ANGLE(Angles.Yaw.Degrees); }
|
||||
int _f_pitch() { return FLOAT2ANGLE(Angles.Pitch.Degrees); }
|
||||
angle_t _f_roll() { return FLOAT2ANGLE(Angles.Roll.Degrees); }
|
||||
|
||||
|
||||
WORD sprite; // used to find patch_t and flip value
|
||||
BYTE frame; // sprite frame to draw
|
||||
fixed_t scaleX, scaleY; // Scaling values; FRACUNIT is normal size
|
||||
|
@ -985,8 +1010,6 @@ public:
|
|||
DWORD fillcolor; // Color to draw when STYLE_Shaded
|
||||
|
||||
// interaction info
|
||||
fixed_t pitch;
|
||||
angle_t roll; // This was fixed_t before, which is probably wrong
|
||||
FBlockNode *BlockNode; // links in blocks (if needed)
|
||||
struct sector_t *Sector;
|
||||
subsector_t * subsector;
|
||||
|
@ -1148,7 +1171,8 @@ public:
|
|||
|
||||
// [RH] Used to interpolate the view to get >35 FPS
|
||||
fixed_t PrevX, PrevY, PrevZ;
|
||||
angle_t PrevAngle;
|
||||
//angle_t PrevAngle;
|
||||
DRotator PrevAngles;
|
||||
int PrevPortalGroup;
|
||||
|
||||
// ThingIDs
|
||||
|
@ -1284,6 +1308,56 @@ public:
|
|||
__pos.y = npos.y;
|
||||
__pos.z = npos.z;
|
||||
}
|
||||
|
||||
fixed_t VelXYToSpeed() const
|
||||
{
|
||||
return xs_CRoundToInt(sqrt((double)vel.x * vel.x + (double)vel.y*vel.y));
|
||||
}
|
||||
|
||||
fixed_t VelToSpeed() const
|
||||
{
|
||||
return xs_CRoundToInt(sqrt((double)vel.x * vel.x + (double)vel.y*vel.y + (double)vel.z*vel.z));
|
||||
}
|
||||
|
||||
void AngleFromVel()
|
||||
{
|
||||
Angles.Yaw = vectoyaw(DVector2(vel.x, vel.y));
|
||||
}
|
||||
|
||||
void VelFromAngle()
|
||||
{
|
||||
vel.x = xs_CRoundToInt(Speed * Angles.Yaw.Cos());
|
||||
vel.y = xs_CRoundToInt(Speed * Angles.Yaw.Sin());
|
||||
}
|
||||
|
||||
void VelFromAngle(fixed_t speed)
|
||||
{
|
||||
vel.x = xs_CRoundToInt(speed * Angles.Yaw.Cos());
|
||||
vel.y = xs_CRoundToInt(speed * Angles.Yaw.Sin());
|
||||
}
|
||||
|
||||
void VelFromAngle(DAngle angle, fixed_t speed)
|
||||
{
|
||||
vel.x = xs_CRoundToInt(speed * angle.Cos());
|
||||
vel.y = xs_CRoundToInt(speed * angle.Sin());
|
||||
}
|
||||
|
||||
void Vel3DFromAngle(DAngle angle, DAngle pitch, fixed_t speed)
|
||||
{
|
||||
double cospitch = pitch.Cos();
|
||||
vel.x = xs_CRoundToInt(speed * cospitch * angle.Cos());
|
||||
vel.y = xs_CRoundToInt(speed * cospitch * angle.Sin());
|
||||
vel.z = xs_CRoundToInt(speed * -pitch.Sin());
|
||||
}
|
||||
|
||||
void Vel3DFromAngle(DAngle pitch, fixed_t speed)
|
||||
{
|
||||
double cospitch = pitch.Cos();
|
||||
vel.x = xs_CRoundToInt(speed * cospitch * Angles.Yaw.Cos());
|
||||
vel.y = xs_CRoundToInt(speed * cospitch * Angles.Yaw.Sin());
|
||||
vel.z = xs_CRoundToInt(speed * -pitch.Sin());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class FActorIterator
|
||||
|
@ -1394,6 +1468,11 @@ inline fixedvec2 Vec2Angle(fixed_t length, angle_t angle)
|
|||
return ret;
|
||||
}
|
||||
|
||||
inline fixedvec2 Vec2Angle(fixed_t length, DAngle angle)
|
||||
{
|
||||
return { xs_CRoundToInt(length * angle.Cos()), xs_CRoundToInt(length * angle.Sin()) };
|
||||
}
|
||||
|
||||
void PrintMiscActorInfo(AActor * query);
|
||||
AActor *P_LinePickActor(AActor *t1, angle_t angle, fixed_t distance, int pitch, ActorFlags actorMask, DWORD wallMask);
|
||||
|
||||
|
@ -1401,7 +1480,7 @@ AActor *P_LinePickActor(AActor *t1, angle_t angle, fixed_t distance, int pitch,
|
|||
struct FTranslatedLineTarget
|
||||
{
|
||||
AActor *linetarget;
|
||||
angle_t angleFromSource;
|
||||
DAngle angleFromSource;
|
||||
bool unlinked; // found by a trace that went through an unlinked portal.
|
||||
};
|
||||
|
||||
|
|
|
@ -1129,7 +1129,7 @@ static void AM_ClipRotatedExtents (fixed_t pivotx, fixed_t pivoty)
|
|||
{
|
||||
xs[i] -= pivotx;
|
||||
ys[i] -= pivoty;
|
||||
AM_rotate (&xs[i], &ys[i], ANG90 - players[consoleplayer].camera->angle);
|
||||
AM_rotate (&xs[i], &ys[i], ANG90 - players[consoleplayer].camera->_f_angle());
|
||||
|
||||
if (i == 5)
|
||||
break;
|
||||
|
@ -1150,7 +1150,7 @@ static void AM_ClipRotatedExtents (fixed_t pivotx, fixed_t pivoty)
|
|||
// ys[4] = rmax_y;
|
||||
// else if (ys[4] < rmin_y)
|
||||
// ys[4] = rmin_y;
|
||||
AM_rotate (&xs[4], &ys[4], ANG270 - players[consoleplayer].camera->angle);
|
||||
AM_rotate (&xs[4], &ys[4], ANG270 - players[consoleplayer].camera->_f_angle());
|
||||
m_x = xs[4] + pivotx - m_w/2;
|
||||
m_y = ys[4] + pivoty - m_h/2;
|
||||
#endif
|
||||
|
@ -1216,7 +1216,7 @@ void AM_changeWindowLoc ()
|
|||
oincy = incy = Scale(m_paninc.y, SCREENHEIGHT, 200);
|
||||
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||
{
|
||||
AM_rotate(&incx, &incy, players[consoleplayer].camera->angle - ANG90);
|
||||
AM_rotate(&incx, &incy, players[consoleplayer].camera->_f_angle() - ANG90);
|
||||
}
|
||||
|
||||
m_x += incx;
|
||||
|
@ -1598,7 +1598,7 @@ void AM_doFollowPlayer ()
|
|||
sy = (f_oldloc.y - players[consoleplayer].camera->Y()) >> FRACTOMAPBITS;
|
||||
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||
{
|
||||
AM_rotate (&sx, &sy, players[consoleplayer].camera->angle - ANG90);
|
||||
AM_rotate (&sx, &sy, players[consoleplayer].camera->_f_angle() - ANG90);
|
||||
}
|
||||
AM_ScrollParchment (sx, sy);
|
||||
|
||||
|
@ -2042,7 +2042,7 @@ void AM_drawSubsectors()
|
|||
// Apply the automap's rotation to the texture origin.
|
||||
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||
{
|
||||
rotation += ANG90 - players[consoleplayer].camera->angle;
|
||||
rotation += ANG90 - players[consoleplayer].camera->_f_angle();
|
||||
AM_rotatePoint(&originpt.x, &originpt.y);
|
||||
}
|
||||
originx = f_x + ((originpt.x - m_x) * scale / float(1 << 24));
|
||||
|
@ -2588,7 +2588,7 @@ void AM_rotatePoint (fixed_t *x, fixed_t *y)
|
|||
fixed_t pivoty = m_y + m_h/2;
|
||||
*x -= pivotx;
|
||||
*y -= pivoty;
|
||||
AM_rotate (x, y, ANG90 - players[consoleplayer].camera->angle);
|
||||
AM_rotate (x, y, ANG90 - players[consoleplayer].camera->_f_angle());
|
||||
*x += pivotx;
|
||||
*y += pivoty;
|
||||
}
|
||||
|
@ -2678,7 +2678,7 @@ void AM_drawPlayers ()
|
|||
}
|
||||
else
|
||||
{
|
||||
angle = players[consoleplayer].camera->angle;
|
||||
angle = players[consoleplayer].camera->_f_angle();
|
||||
}
|
||||
|
||||
if (am_cheat != 0 && CheatMapArrow.Size() > 0)
|
||||
|
@ -2736,12 +2736,12 @@ void AM_drawPlayers ()
|
|||
pt.x = pos.x >> FRACTOMAPBITS;
|
||||
pt.y = pos.y >> FRACTOMAPBITS;
|
||||
|
||||
angle = p->mo->angle;
|
||||
angle = p->mo->_f_angle();
|
||||
|
||||
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||
{
|
||||
AM_rotatePoint (&pt.x, &pt.y);
|
||||
angle -= players[consoleplayer].camera->angle - ANG90;
|
||||
angle -= players[consoleplayer].camera->_f_angle() - ANG90;
|
||||
}
|
||||
|
||||
AM_drawLineCharacter(&MapArrow[0], MapArrow.Size(), 0, angle, color, pt.x, pt.y);
|
||||
|
@ -2770,12 +2770,12 @@ void AM_drawKeys ()
|
|||
p.x = pos.x >> FRACTOMAPBITS;
|
||||
p.y = pos.y >> FRACTOMAPBITS;
|
||||
|
||||
angle = key->angle;
|
||||
angle = key->_f_angle();
|
||||
|
||||
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||
{
|
||||
AM_rotatePoint (&p.x, &p.y);
|
||||
angle += ANG90 - players[consoleplayer].camera->angle;
|
||||
angle += ANG90 - players[consoleplayer].camera->_f_angle();
|
||||
}
|
||||
|
||||
if (key->flags & MF_SPECIAL)
|
||||
|
@ -2830,11 +2830,11 @@ void AM_drawThings ()
|
|||
const size_t spriteIndex = sprite.spriteframes + (show > 1 ? t->frame : 0);
|
||||
|
||||
frame = &SpriteFrames[spriteIndex];
|
||||
angle_t angle = ANGLE_270 - t->angle;
|
||||
angle_t angle = ANGLE_270 - t->_f_angle();
|
||||
if (frame->Texture[0] != frame->Texture[1]) angle += (ANGLE_180 / 16);
|
||||
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||
{
|
||||
angle += players[consoleplayer].camera->angle - ANGLE_90;
|
||||
angle += players[consoleplayer].camera->_f_angle() - ANGLE_90;
|
||||
}
|
||||
rotation = angle >> 28;
|
||||
|
||||
|
@ -2853,12 +2853,12 @@ void AM_drawThings ()
|
|||
else
|
||||
{
|
||||
drawTriangle:
|
||||
angle = t->angle;
|
||||
angle = t->_f_angle();
|
||||
|
||||
if (am_rotate == 1 || (am_rotate == 2 && viewactive))
|
||||
{
|
||||
AM_rotatePoint (&p.x, &p.y);
|
||||
angle += ANG90 - players[consoleplayer].camera->angle;
|
||||
angle += ANG90 - players[consoleplayer].camera->_f_angle();
|
||||
}
|
||||
|
||||
color = AMColors[AMColors.ThingColor];
|
||||
|
@ -2920,7 +2920,7 @@ void AM_drawThings ()
|
|||
{ { -MAPUNIT, MAPUNIT }, { -MAPUNIT, -MAPUNIT } },
|
||||
};
|
||||
|
||||
AM_drawLineCharacter (box, 4, t->radius >> FRACTOMAPBITS, angle - t->angle, color, p.x, p.y);
|
||||
AM_drawLineCharacter (box, 4, t->radius >> FRACTOMAPBITS, angle - t->_f_angle(), color, p.x, p.y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ bool DBot::Check_LOS (AActor *to, angle_t vangle)
|
|||
if (vangle == 0)
|
||||
return false; //Looker seems to be blind.
|
||||
|
||||
return absangle(player->mo->AngleTo(to) - player->mo->angle) <= vangle/2;
|
||||
return absangle(player->mo->AngleTo(to) - player->mo->_f_angle()) <= vangle/2;
|
||||
}
|
||||
|
||||
//-------------------------------------
|
||||
|
@ -212,7 +212,7 @@ void DBot::Dofire (ticcmd_t *cmd)
|
|||
{
|
||||
angle = an;
|
||||
//have to be somewhat precise. to avoid suicide.
|
||||
if (absangle(angle - player->mo->angle) < 12*ANGLE_1)
|
||||
if (absangle(angle - player->mo->_f_angle()) < 12*ANGLE_1)
|
||||
{
|
||||
t_rocket = 9;
|
||||
no_fire = false;
|
||||
|
@ -254,7 +254,7 @@ shootmissile:
|
|||
angle -= m;
|
||||
}
|
||||
|
||||
if (absangle(angle - player->mo->angle) < 4*ANGLE_1)
|
||||
if (absangle(angle - player->mo->_f_angle()) < 4*ANGLE_1)
|
||||
{
|
||||
increase = !increase;
|
||||
}
|
||||
|
@ -456,7 +456,7 @@ void FCajunMaster::SetBodyAt (fixed_t x, fixed_t y, fixed_t z, int hostnum)
|
|||
//
|
||||
//Returns NULL if shouldn't fire
|
||||
//else an angle (in degrees) are given
|
||||
//This function assumes actor->player->angle
|
||||
//This function assumes actor->player->_f_angle()
|
||||
//has been set an is the main aiming angle.
|
||||
|
||||
|
||||
|
|
|
@ -305,13 +305,13 @@ bool FCajunMaster::CleanAhead (AActor *thing, fixed_t x, fixed_t y, ticcmd_t *cm
|
|||
return true;
|
||||
}
|
||||
|
||||
#define OKAYRANGE (5*ANGLE_1) //counts *2, when angle is in range, turning is not executed.
|
||||
#define MAXTURN (15*ANGLE_1) //Max degrees turned in one tic. Lower is smother but may cause the bot not getting where it should = crash
|
||||
#define OKAYRANGE (5) //counts *2, when angle is in range, turning is not executed.
|
||||
#define MAXTURN (15) //Max degrees turned in one tic. Lower is smother but may cause the bot not getting where it should = crash
|
||||
#define TURNSENS 3 //Higher is smoother but slower turn.
|
||||
|
||||
void DBot::TurnToAng ()
|
||||
{
|
||||
int maxturn = MAXTURN;
|
||||
double maxturn = MAXTURN;
|
||||
|
||||
if (player->ReadyWeapon != NULL)
|
||||
{
|
||||
|
@ -331,16 +331,16 @@ void DBot::TurnToAng ()
|
|||
maxturn = 3;
|
||||
}
|
||||
|
||||
int distance = angle - player->mo->angle;
|
||||
DAngle distance = deltaangle(player->mo->Angles.Yaw, ANGLE2DBL(angle));
|
||||
|
||||
if (abs (distance) < OKAYRANGE && !enemy)
|
||||
if (fabs (distance) < OKAYRANGE && !enemy)
|
||||
return;
|
||||
|
||||
distance /= TURNSENS;
|
||||
if (abs (distance) > maxturn)
|
||||
if (fabs (distance) > maxturn)
|
||||
distance = distance < 0 ? -maxturn : maxturn;
|
||||
|
||||
player->mo->angle += distance;
|
||||
player->mo->Angles.Yaw += distance;
|
||||
}
|
||||
|
||||
void DBot::Pitch (AActor *target)
|
||||
|
@ -350,7 +350,7 @@ void DBot::Pitch (AActor *target)
|
|||
|
||||
diff = target->Z() - player->mo->Z();
|
||||
aim = g_atan(diff / (double)player->mo->AproxDistance(target));
|
||||
player->mo->pitch = -(int)(aim * ANGLE_180/M_PI);
|
||||
player->mo->Angles.Pitch = ToDegrees(aim);
|
||||
}
|
||||
|
||||
//Checks if a sector is dangerous.
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
#include "d_net.h"
|
||||
#include "d_event.h"
|
||||
#include "d_player.h"
|
||||
#include "vectors.h"
|
||||
|
||||
static FRandom pr_botmove ("BotMove");
|
||||
|
||||
|
@ -39,20 +40,21 @@ void DBot::Think ()
|
|||
if (teamplay || !deathmatch)
|
||||
mate = Choose_Mate ();
|
||||
|
||||
angle_t oldyaw = player->mo->angle;
|
||||
int oldpitch = player->mo->pitch;
|
||||
AActor *actor = player->mo;
|
||||
DAngle oldyaw = actor->Angles.Yaw;
|
||||
DAngle oldpitch = actor->Angles.Pitch;
|
||||
|
||||
Set_enemy ();
|
||||
ThinkForMove (cmd);
|
||||
TurnToAng ();
|
||||
|
||||
cmd->ucmd.yaw = (short)((player->mo->angle - oldyaw) >> 16) / ticdup;
|
||||
cmd->ucmd.pitch = (short)((oldpitch - player->mo->pitch) >> 16);
|
||||
cmd->ucmd.yaw = (short)((actor->Angles.Yaw - oldyaw).Degrees * (65536 / 360.f)) / ticdup;
|
||||
cmd->ucmd.pitch = (short)((oldpitch - actor->Angles.Pitch).Degrees * (65536 / 360.f));
|
||||
if (cmd->ucmd.pitch == -32768)
|
||||
cmd->ucmd.pitch = -32767;
|
||||
cmd->ucmd.pitch /= ticdup;
|
||||
player->mo->angle = oldyaw + (cmd->ucmd.yaw << 16) * ticdup;
|
||||
player->mo->pitch = oldpitch - (cmd->ucmd.pitch << 16) * ticdup;
|
||||
actor->Angles.Yaw = oldyaw + DAngle(cmd->ucmd.yaw * ticdup * (360 / 65536.f));
|
||||
actor->Angles.Pitch = oldpitch - DAngle(cmd->ucmd.pitch * ticdup * (360 / 65536.f));
|
||||
}
|
||||
|
||||
if (t_active) t_active--;
|
||||
|
@ -91,10 +93,10 @@ void DBot::ThinkForMove (ticcmd_t *cmd)
|
|||
missile = NULL; //Probably ended its travel.
|
||||
}
|
||||
|
||||
if (player->mo->pitch > 0)
|
||||
player->mo->pitch -= 80;
|
||||
else if (player->mo->pitch <= -60)
|
||||
player->mo->pitch += 80;
|
||||
if (player->mo->Angles.Pitch > 0)
|
||||
player->mo->Angles.Pitch -= 80;
|
||||
else if (player->mo->Angles.Pitch <= -60)
|
||||
player->mo->Angles.Pitch += 80;
|
||||
|
||||
//HOW TO MOVE:
|
||||
if (missile && (player->mo->AproxDistance(missile)<AVOID_DIST)) //try avoid missile got from P_Mobj.c thinking part.
|
||||
|
|
|
@ -875,7 +875,7 @@ CCMD(linetarget)
|
|||
FTranslatedLineTarget t;
|
||||
|
||||
if (CheckCheatmode () || players[consoleplayer].mo == NULL) return;
|
||||
P_AimLineAttack(players[consoleplayer].mo,players[consoleplayer].mo->angle,MISSILERANGE, &t, 0);
|
||||
P_AimLineAttack(players[consoleplayer].mo,players[consoleplayer].mo->_f_angle(),MISSILERANGE, &t, 0);
|
||||
if (t.linetarget)
|
||||
{
|
||||
Printf("Target=%s, Health=%d, Spawnhealth=%d\n",
|
||||
|
@ -892,7 +892,7 @@ CCMD(info)
|
|||
FTranslatedLineTarget t;
|
||||
|
||||
if (CheckCheatmode () || players[consoleplayer].mo == NULL) return;
|
||||
P_AimLineAttack(players[consoleplayer].mo,players[consoleplayer].mo->angle,MISSILERANGE,
|
||||
P_AimLineAttack(players[consoleplayer].mo,players[consoleplayer].mo->_f_angle(),MISSILERANGE,
|
||||
&t, 0, ALF_CHECKNONSHOOTABLE|ALF_FORCENOSMART);
|
||||
if (t.linetarget)
|
||||
{
|
||||
|
@ -1087,7 +1087,7 @@ CCMD(currentpos)
|
|||
if(mo)
|
||||
{
|
||||
Printf("Current player position: (%1.3f,%1.3f,%1.3f), angle: %1.3f, floorheight: %1.3f, sector:%d, lightlevel: %d\n",
|
||||
FIXED2DBL(mo->X()), FIXED2DBL(mo->Y()), FIXED2DBL(mo->Z()), ANGLE2DBL(mo->angle), FIXED2DBL(mo->floorz), mo->Sector->sectornum, mo->Sector->lightlevel);
|
||||
FIXED2DBL(mo->X()), FIXED2DBL(mo->Y()), FIXED2DBL(mo->Z()), ANGLE2DBL(mo->_f_angle()), FIXED2DBL(mo->floorz), mo->Sector->sectornum, mo->Sector->lightlevel);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1342,7 +1342,7 @@ static int PatchSound (int soundNum)
|
|||
else CHECKKEY ("Zero/One", info->singularity)
|
||||
else CHECKKEY ("Value", info->priority)
|
||||
else CHECKKEY ("Zero 1", info->link)
|
||||
else CHECKKEY ("Neg. One 1", info->pitch)
|
||||
else CHECKKEY ("Neg. One 1", info->_f_pitch())
|
||||
else CHECKKEY ("Neg. One 2", info->volume)
|
||||
else CHECKKEY ("Zero 2", info->data)
|
||||
else CHECKKEY ("Zero 3", info->usefulness)
|
||||
|
|
|
@ -2321,7 +2321,7 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
|||
else
|
||||
{
|
||||
const AActor *def = GetDefaultByType (typeinfo);
|
||||
fixedvec3 spawnpos = source->Vec3Angle(def->radius * 2 + source->radius, source->angle, 8 * FRACUNIT);
|
||||
fixedvec3 spawnpos = source->Vec3Angle(def->radius * 2 + source->radius, source->_f_angle(), 8 * FRACUNIT);
|
||||
|
||||
AActor *spawned = Spawn (typeinfo, spawnpos, ALLOW_REPLACE);
|
||||
if (spawned != NULL)
|
||||
|
@ -2348,7 +2348,7 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
|||
}
|
||||
if (type >= DEM_SUMMON2 && type <= DEM_SUMMONFOE2)
|
||||
{
|
||||
spawned->angle = source->angle - (ANGLE_1 * angle);
|
||||
spawned->Angles.Yaw -= angle;
|
||||
spawned->tid = tid;
|
||||
spawned->special = special;
|
||||
for(i = 0; i < 5; i++) {
|
||||
|
@ -2366,8 +2366,8 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
|||
{
|
||||
FTraceResults trace;
|
||||
|
||||
angle_t ang = players[player].mo->angle >> ANGLETOFINESHIFT;
|
||||
angle_t pitch = (angle_t)(players[player].mo->pitch) >> ANGLETOFINESHIFT;
|
||||
angle_t ang = players[player].mo->_f_angle() >> ANGLETOFINESHIFT;
|
||||
angle_t pitch = (angle_t)(players[player].mo->_f_pitch()) >> ANGLETOFINESHIFT;
|
||||
fixed_t vx = FixedMul (finecosine[pitch], finecosine[ang]);
|
||||
fixed_t vy = FixedMul (finecosine[pitch], finesine[ang]);
|
||||
fixed_t vz = -finesine[pitch];
|
||||
|
@ -2656,8 +2656,8 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
|||
break;
|
||||
|
||||
case DEM_SETPITCHLIMIT:
|
||||
players[player].MinPitch = ReadByte(stream) * -ANGLE_1; // up
|
||||
players[player].MaxPitch = ReadByte(stream) * ANGLE_1; // down
|
||||
players[player].MinPitch = ReadByte(stream); // up
|
||||
players[player].MaxPitch = ReadByte(stream); // down
|
||||
break;
|
||||
|
||||
case DEM_ADVANCEINTER:
|
||||
|
|
|
@ -488,8 +488,8 @@ public:
|
|||
|
||||
FString LogText; // [RH] Log for Strife
|
||||
|
||||
int MinPitch; // Viewpitch limits (negative is up, positive is down)
|
||||
int MaxPitch;
|
||||
DAngle MinPitch; // Viewpitch limits (negative is up, positive is down)
|
||||
DAngle MaxPitch;
|
||||
|
||||
fixed_t crouchfactor;
|
||||
fixed_t crouchoffset;
|
||||
|
@ -499,7 +499,7 @@ public:
|
|||
|
||||
// [CW] I moved these here for multiplayer conversation support.
|
||||
TObjPtr<AActor> ConversationNPC, ConversationPC;
|
||||
angle_t ConversationNPCAngle;
|
||||
DAngle ConversationNPCAngle;
|
||||
bool ConversationFaceTalker;
|
||||
|
||||
fixed_t GetDeltaViewHeight() const
|
||||
|
|
|
@ -1532,3 +1532,18 @@ FArchive &operator<< (FArchive &arc, side_t *&side)
|
|||
{
|
||||
return arc.SerializePointer (sides, (BYTE **)&side, sizeof(*sides));
|
||||
}
|
||||
|
||||
FArchive &operator<<(FArchive &arc, DAngle &ang)
|
||||
{
|
||||
if (SaveVersion >= 4534)
|
||||
{
|
||||
arc << ang.Degrees;
|
||||
}
|
||||
else
|
||||
{
|
||||
angle_t an;
|
||||
arc << an;
|
||||
ang.Degrees = ANGLE2DBL(an);
|
||||
}
|
||||
return arc;
|
||||
}
|
||||
|
|
|
@ -324,6 +324,8 @@ FArchive &operator<< (FArchive &arc, line_t *&line);
|
|||
FArchive &operator<< (FArchive &arc, vertex_t *&vert);
|
||||
FArchive &operator<< (FArchive &arc, side_t *&side);
|
||||
|
||||
FArchive &operator<<(FArchive &arc, DAngle &ang);
|
||||
|
||||
|
||||
|
||||
template<typename T, typename TT>
|
||||
|
|
|
@ -864,7 +864,7 @@ void FParser::SF_Spawn(void)
|
|||
{
|
||||
int x, y, z;
|
||||
PClassActor *pclass;
|
||||
angle_t angle = 0;
|
||||
DAngle angle = 0;
|
||||
|
||||
if (CheckArgs(3))
|
||||
{
|
||||
|
@ -890,7 +890,7 @@ void FParser::SF_Spawn(void)
|
|||
|
||||
if(t_argc >= 4)
|
||||
{
|
||||
angle = intvalue(t_argv[3]) * (SQWORD)ANG45 / 45;
|
||||
angle = floatvalue(t_argv[3]);
|
||||
}
|
||||
|
||||
t_return.type = svt_mobj;
|
||||
|
@ -898,7 +898,7 @@ void FParser::SF_Spawn(void)
|
|||
|
||||
if (t_return.value.mobj)
|
||||
{
|
||||
t_return.value.mobj->angle = angle;
|
||||
t_return.value.mobj->Angles.Yaw = angle;
|
||||
|
||||
if (!DFraggleThinker::ActiveThinker->nocheckposition)
|
||||
{
|
||||
|
@ -1054,7 +1054,7 @@ void FParser::SF_ObjAngle(void)
|
|||
}
|
||||
|
||||
t_return.type = svt_fixed; // haleyjd: fixed-point -- SoM again :)
|
||||
t_return.value.f = mo ? (fixed_t)AngleToFixed(mo->angle) : 0; // null ptr check
|
||||
t_return.value.f = mo ? (fixed_t)AngleToFixed(mo->_f_angle()) : 0; // null ptr check
|
||||
}
|
||||
|
||||
|
||||
|
@ -1449,7 +1449,7 @@ void FParser::SF_PointToDist(void)
|
|||
|
||||
void FParser::SF_SetCamera(void)
|
||||
{
|
||||
angle_t angle;
|
||||
DAngle angle;
|
||||
player_t * player;
|
||||
AActor * newcamera;
|
||||
|
||||
|
@ -1465,20 +1465,14 @@ void FParser::SF_SetCamera(void)
|
|||
return; // nullptr check
|
||||
}
|
||||
|
||||
angle = t_argc < 2 ? newcamera->angle : (fixed_t)FixedToAngle(fixedvalue(t_argv[1]));
|
||||
angle = t_argc < 2 ? newcamera->Angles.Yaw : floatvalue(t_argv[1]);
|
||||
|
||||
newcamera->special1=newcamera->angle;
|
||||
newcamera->special1 = newcamera->Angles.Yaw.BAMs();
|
||||
newcamera->special2=newcamera->Z();
|
||||
newcamera->SetZ(t_argc < 3 ? (newcamera->Z() + (41 << FRACBITS)) : (intvalue(t_argv[2]) << FRACBITS));
|
||||
newcamera->angle = angle;
|
||||
if(t_argc < 4) newcamera->pitch = 0;
|
||||
else
|
||||
{
|
||||
fixed_t pitch = fixedvalue(t_argv[3]);
|
||||
if (pitch < -50 * FRACUNIT) pitch = -50 * FRACUNIT;
|
||||
if (pitch > 50 * FRACUNIT) pitch = 50 * FRACUNIT;
|
||||
newcamera->pitch = xs_CRoundToUInt((pitch / 65536.0f)*(ANGLE_45 / 45.0f)*(20.0f / 32.0f));
|
||||
}
|
||||
newcamera->Angles.Yaw = angle;
|
||||
if (t_argc < 4) newcamera->Angles.Pitch = 0;
|
||||
else newcamera->Angles.Pitch = clamp(floatvalue(t_argv[3]), -50., 50.) * (20. / 32.);
|
||||
player->camera=newcamera;
|
||||
}
|
||||
}
|
||||
|
@ -1499,7 +1493,7 @@ void FParser::SF_ClearCamera(void)
|
|||
if (cam)
|
||||
{
|
||||
player->camera=player->mo;
|
||||
cam->angle=cam->special1;
|
||||
cam->Angles.Yaw = ANGLE2DBL(cam->special1);
|
||||
cam->SetZ(cam->special2);
|
||||
}
|
||||
|
||||
|
@ -3115,15 +3109,16 @@ void FParser::SF_MoveCamera(void)
|
|||
//180--+--0
|
||||
// Q2|Q3
|
||||
// 270
|
||||
angle_t camangle = cam->Angles.Yaw.BAMs();
|
||||
quad1 = targetangle / ANG90;
|
||||
quad2 = cam->angle / ANG90;
|
||||
bigangle = targetangle > cam->angle ? targetangle : cam->angle;
|
||||
smallangle = targetangle < cam->angle ? targetangle : cam->angle;
|
||||
quad2 = camangle / ANG90;
|
||||
bigangle = targetangle > camangle ? targetangle : camangle;
|
||||
smallangle = targetangle < camangle ? targetangle : camangle;
|
||||
if((quad1 > quad2 && quad1 - 1 == quad2) || (quad2 > quad1 && quad2 - 1 == quad1) ||
|
||||
quad1 == quad2)
|
||||
{
|
||||
angledist = bigangle - smallangle;
|
||||
angledir = targetangle > cam->angle ? 1 : -1;
|
||||
angledir = targetangle > cam->_f_angle() ? 1 : -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3145,10 +3140,10 @@ void FParser::SF_MoveCamera(void)
|
|||
if(angledist > ANG180)
|
||||
{
|
||||
angledist = diff180;
|
||||
angledir = targetangle > cam->angle ? -1 : 1;
|
||||
angledir = targetangle > camangle ? -1 : 1;
|
||||
}
|
||||
else
|
||||
angledir = targetangle > cam->angle ? 1 : -1;
|
||||
angledir = targetangle > camangle ? 1 : -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3203,17 +3198,17 @@ void FParser::SF_MoveCamera(void)
|
|||
}
|
||||
|
||||
if(anglestep >= angledist)
|
||||
cam->angle = targetangle;
|
||||
cam->Angles.Yaw = ANGLE2DBL(targetangle);
|
||||
else
|
||||
{
|
||||
if(angledir == 1)
|
||||
{
|
||||
cam->angle += anglestep;
|
||||
cam->Angles.Yaw += ANGLE2DBL(anglestep);
|
||||
moved = 1;
|
||||
}
|
||||
else if(angledir == -1)
|
||||
{
|
||||
cam->angle -= anglestep;
|
||||
cam->Angles.Yaw -= ANGLE2DBL(anglestep);
|
||||
moved = 1;
|
||||
}
|
||||
}
|
||||
|
@ -4288,7 +4283,7 @@ void FParser::SF_SpawnShot2(void)
|
|||
{
|
||||
S_Sound (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_NORM);
|
||||
mo->target = source;
|
||||
P_ThrustMobj(mo, mo->angle = source->angle, mo->Speed);
|
||||
P_ThrustMobj(mo, (mo->Angles.Yaw = source->Angles.Yaw), mo->Speed);
|
||||
if (!P_CheckMissileSpawn(mo, source->radius)) mo = NULL;
|
||||
}
|
||||
t_return.value.mobj = mo;
|
||||
|
|
|
@ -68,7 +68,7 @@ void A_Fire(AActor *self, int height)
|
|||
if (!P_CheckSight (self->target, dest, 0) )
|
||||
return;
|
||||
|
||||
fixedvec3 newpos = dest->Vec3Angle(24 * FRACUNIT, dest->angle, height);
|
||||
fixedvec3 newpos = dest->Vec3Angle(24 * FRACUNIT, dest->_f_angle(), height);
|
||||
self->SetOrigin(newpos, true);
|
||||
}
|
||||
|
||||
|
@ -147,7 +147,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileAttack)
|
|||
if (fire != NULL)
|
||||
{
|
||||
// move the fire between the vile and the player
|
||||
fixedvec3 pos = target->Vec3Angle(-24 * FRACUNIT, self->angle, 0);
|
||||
fixedvec3 pos = target->Vec3Angle(-24 * FRACUNIT, self->_f_angle(), 0);
|
||||
fire->SetOrigin (pos, true);
|
||||
|
||||
P_RadiusAttack (fire, self, blastdmg, blastrad, dmgtype, 0);
|
||||
|
|
|
@ -50,7 +50,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Punch)
|
|||
if (self->FindInventory<APowerStrength>())
|
||||
damage *= 10;
|
||||
|
||||
angle = self->angle;
|
||||
angle = self->_f_angle();
|
||||
|
||||
angle += pr_punch.Random2() << 18;
|
||||
pitch = P_AimLineAttack (self, angle, MELEERANGE);
|
||||
|
@ -61,7 +61,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Punch)
|
|||
if (t.linetarget)
|
||||
{
|
||||
S_Sound (self, CHAN_WEAPON, "*fist", 1, ATTN_NORM);
|
||||
self->angle = t.angleFromSource;
|
||||
self->Angles.Yaw = t.angleFromSource;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
|
|||
range = MELEERANGE+1;
|
||||
}
|
||||
|
||||
angle = self->angle + (pr_saw.Random2() * (spread_xy / 255));
|
||||
angle = self->_f_angle() + (pr_saw.Random2() * (spread_xy / 255));
|
||||
slope = P_AimLineAttack (self, angle, range, &t) + (pr_saw.Random2() * (spread_z / 255));
|
||||
|
||||
AWeapon *weapon = self->player->ReadyWeapon;
|
||||
|
@ -232,20 +232,21 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw)
|
|||
// turn to face target
|
||||
if (!(flags & SF_NOTURN))
|
||||
{
|
||||
angle = t.angleFromSource;
|
||||
if (angle - self->angle > ANG180)
|
||||
DAngle anglediff = deltaangle(self->Angles.Yaw, t.angleFromSource);
|
||||
|
||||
if (anglediff < 0.0)
|
||||
{
|
||||
if (angle - self->angle < (angle_t)(-ANG90 / 20))
|
||||
self->angle = angle + ANG90 / 21;
|
||||
if (anglediff < -4.5)
|
||||
self->Angles.Yaw = angle + 90.0 / 21;
|
||||
else
|
||||
self->angle -= ANG90 / 20;
|
||||
self->Angles.Yaw -= 4.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (angle - self->angle > ANG90 / 20)
|
||||
self->angle = angle - ANG90 / 21;
|
||||
if (anglediff > 4.5)
|
||||
self->Angles.Yaw = angle - 90.0 / 21;
|
||||
else
|
||||
self->angle += ANG90 / 20;
|
||||
self->Angles.Yaw += 4.5;
|
||||
}
|
||||
}
|
||||
if (!(flags & SF_NOPULLIN))
|
||||
|
@ -320,7 +321,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireShotgun2)
|
|||
for (i=0 ; i<20 ; i++)
|
||||
{
|
||||
damage = 5*(pr_fireshotgun2()%3+1);
|
||||
angle = self->angle;
|
||||
angle = self->_f_angle();
|
||||
angle += pr_fireshotgun2.Random2() << 19;
|
||||
|
||||
// Doom adjusts the bullet slope by shifting a random number [-255,255]
|
||||
|
@ -501,10 +502,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireSTGrenade)
|
|||
}
|
||||
|
||||
// Temporarily raise the pitch to send the grenade slightly upwards
|
||||
fixed_t SavedPlayerPitch = self->pitch;
|
||||
self->pitch -= (1152 << FRACBITS);
|
||||
DAngle SavedPlayerPitch = self->Angles.Pitch;
|
||||
self->Angles.Pitch -= 6.328125; //(1152 << FRACBITS);
|
||||
P_SpawnPlayerMissile(self, grenade);
|
||||
self->pitch = SavedPlayerPitch;
|
||||
self->Angles.Pitch = SavedPlayerPitch;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -619,7 +620,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBFG)
|
|||
return 0;
|
||||
}
|
||||
|
||||
P_SpawnPlayerMissile (self, 0, 0, 0, PClass::FindActor("BFGBall"), self->angle, NULL, NULL, !!(dmflags2 & DF2_NO_FREEAIMBFG));
|
||||
P_SpawnPlayerMissile (self, 0, 0, 0, PClass::FindActor("BFGBall"), self->_f_angle(), NULL, NULL, !!(dmflags2 & DF2_NO_FREEAIMBFG));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -659,7 +660,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
|
|||
// offset angles from its attack angle
|
||||
for (i = 0; i < numrays; i++)
|
||||
{
|
||||
an = self->angle - angle / 2 + angle / numrays*i;
|
||||
an = self->_f_angle() - angle / 2 + angle / numrays*i;
|
||||
|
||||
// self->target is the originator (player) of the missile
|
||||
P_AimLineAttack(self->target, an, distance, &t, vrange);
|
||||
|
@ -696,7 +697,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray)
|
|||
damage = defdamage;
|
||||
}
|
||||
|
||||
int newdam = P_DamageMobj(t.linetarget, self->target, self->target, damage, dmgType, dmgFlags|DMG_USEANGLE, t.angleFromSource);
|
||||
int newdam = P_DamageMobj(t.linetarget, self->target, self->target, damage, dmgType, dmgFlags|DMG_USEANGLE, FLOAT2ANGLE(t.angleFromSource.Degrees));
|
||||
P_TraceBleed(newdam > 0 ? newdam : damage, &t, self);
|
||||
}
|
||||
}
|
||||
|
@ -749,16 +750,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireOldBFG)
|
|||
self->player->extralight = 2;
|
||||
|
||||
// Save values temporarily
|
||||
angle_t SavedPlayerAngle = self->angle;
|
||||
fixed_t SavedPlayerPitch = self->pitch;
|
||||
DAngle SavedPlayerAngle = self->Angles.Yaw;
|
||||
DAngle SavedPlayerPitch = self->Angles.Pitch;
|
||||
for (int i = 0; i < 2; i++) // Spawn two plasma balls in sequence
|
||||
{
|
||||
self->angle += ((pr_oldbfg()&127) - 64) * (ANG90/768);
|
||||
self->pitch += ((pr_oldbfg()&127) - 64) * (ANG90/640);
|
||||
self->Angles.Yaw += ((pr_oldbfg()&127) - 64) * (90./768);
|
||||
self->Angles.Pitch += ((pr_oldbfg()&127) - 64) * (90./640);
|
||||
mo = P_SpawnPlayerMissile (self, plasma[i]);
|
||||
// Restore saved values
|
||||
self->angle = SavedPlayerAngle;
|
||||
self->pitch = SavedPlayerPitch;
|
||||
self->Angles.Yaw = SavedPlayerAngle;
|
||||
self->Angles.Pitch = SavedPlayerPitch;
|
||||
}
|
||||
if (doesautoaim && weapon != NULL)
|
||||
{ // Restore autoaim setting
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// firing three missiles in three different directions?
|
||||
// Doesn't look like it.
|
||||
//
|
||||
#define FATSPREAD (ANG90/8)
|
||||
#define FATSPREAD (90./8)
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_FatRaise)
|
||||
{
|
||||
|
@ -32,7 +32,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack1)
|
|||
PARAM_CLASS_OPT(spawntype, AActor) { spawntype = NULL; }
|
||||
|
||||
AActor *missile;
|
||||
angle_t an;
|
||||
|
||||
if (!self->target)
|
||||
return 0;
|
||||
|
@ -41,16 +40,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack1)
|
|||
|
||||
A_FaceTarget (self);
|
||||
// Change direction to ...
|
||||
self->angle += FATSPREAD;
|
||||
self->Angles.Yaw += FATSPREAD;
|
||||
P_SpawnMissile (self, self->target, spawntype);
|
||||
|
||||
missile = P_SpawnMissile (self, self->target, spawntype);
|
||||
if (missile != NULL)
|
||||
{
|
||||
missile->angle += FATSPREAD;
|
||||
an = missile->angle >> ANGLETOFINESHIFT;
|
||||
missile->vel.x = FixedMul (missile->Speed, finecosine[an]);
|
||||
missile->vel.y = FixedMul (missile->Speed, finesine[an]);
|
||||
missile->Angles.Yaw += FATSPREAD;
|
||||
missile->VelFromAngle();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -61,7 +58,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack2)
|
|||
PARAM_CLASS_OPT(spawntype, AActor) { spawntype = NULL; }
|
||||
|
||||
AActor *missile;
|
||||
angle_t an;
|
||||
|
||||
if (!self->target)
|
||||
return 0;
|
||||
|
@ -70,16 +66,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack2)
|
|||
|
||||
A_FaceTarget (self);
|
||||
// Now here choose opposite deviation.
|
||||
self->angle -= FATSPREAD;
|
||||
self->Angles.Yaw -= FATSPREAD;
|
||||
P_SpawnMissile (self, self->target, spawntype);
|
||||
|
||||
missile = P_SpawnMissile (self, self->target, spawntype);
|
||||
if (missile != NULL)
|
||||
{
|
||||
missile->angle -= FATSPREAD*2;
|
||||
an = missile->angle >> ANGLETOFINESHIFT;
|
||||
missile->vel.x = FixedMul (missile->Speed, finecosine[an]);
|
||||
missile->vel.y = FixedMul (missile->Speed, finesine[an]);
|
||||
missile->Angles.Yaw -= FATSPREAD*2;
|
||||
missile->VelFromAngle();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -90,7 +84,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3)
|
|||
PARAM_CLASS_OPT(spawntype, AActor) { spawntype = NULL; }
|
||||
|
||||
AActor *missile;
|
||||
angle_t an;
|
||||
|
||||
if (!self->target)
|
||||
return 0;
|
||||
|
@ -102,19 +95,15 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3)
|
|||
missile = P_SpawnMissile (self, self->target, spawntype);
|
||||
if (missile != NULL)
|
||||
{
|
||||
missile->angle -= FATSPREAD/2;
|
||||
an = missile->angle >> ANGLETOFINESHIFT;
|
||||
missile->vel.x = FixedMul (missile->Speed, finecosine[an]);
|
||||
missile->vel.y = FixedMul (missile->Speed, finesine[an]);
|
||||
missile->Angles.Yaw -= FATSPREAD/2;
|
||||
missile->VelFromAngle();
|
||||
}
|
||||
|
||||
missile = P_SpawnMissile (self, self->target, spawntype);
|
||||
if (missile != NULL)
|
||||
{
|
||||
missile->angle += FATSPREAD/2;
|
||||
an = missile->angle >> ANGLETOFINESHIFT;
|
||||
missile->vel.x = FixedMul (missile->Speed, finecosine[an]);
|
||||
missile->vel.y = FixedMul (missile->Speed, finesine[an]);
|
||||
missile->Angles.Yaw += FATSPREAD/2;
|
||||
missile->VelFromAngle();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ void A_SkullAttack(AActor *self, fixed_t speed)
|
|||
|
||||
S_Sound (self, CHAN_VOICE, self->AttackSound, 1, ATTN_NORM);
|
||||
A_FaceTarget (self);
|
||||
an = self->angle >> ANGLETOFINESHIFT;
|
||||
an = self->_f_angle() >> ANGLETOFINESHIFT;
|
||||
self->vel.x = FixedMul (speed, finecosine[an]);
|
||||
self->vel.y = FixedMul (speed, finesine[an]);
|
||||
dist = self->AproxDistance (dest);
|
||||
|
|
|
@ -166,7 +166,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PainAttack)
|
|||
|
||||
if (!(flags & PAF_AIMFACING))
|
||||
A_FaceTarget (self);
|
||||
A_PainShootSkull (self, self->angle+angle, spawntype, flags, limit);
|
||||
A_PainShootSkull (self, self->_f_angle()+angle, spawntype, flags, limit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -179,8 +179,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_DualPainAttack)
|
|||
return 0;
|
||||
|
||||
A_FaceTarget (self);
|
||||
A_PainShootSkull (self, self->angle + ANG45, spawntype);
|
||||
A_PainShootSkull (self, self->angle - ANG45, spawntype);
|
||||
A_PainShootSkull (self, self->_f_angle() + ANG45, spawntype);
|
||||
A_PainShootSkull (self, self->_f_angle() - ANG45, spawntype);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -194,8 +194,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PainDie)
|
|||
self->flags &= ~MF_FRIENDLY;
|
||||
}
|
||||
A_Unblock(self, true);
|
||||
A_PainShootSkull (self, self->angle + ANG90, spawntype);
|
||||
A_PainShootSkull (self, self->angle + ANG180, spawntype);
|
||||
A_PainShootSkull (self, self->angle + ANG270, spawntype);
|
||||
A_PainShootSkull (self, self->_f_angle() + ANG90, spawntype);
|
||||
A_PainShootSkull (self, self->_f_angle() + ANG180, spawntype);
|
||||
A_PainShootSkull (self, self->_f_angle() + ANG270, spawntype);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PosAttack)
|
|||
return 0;
|
||||
|
||||
A_FaceTarget (self);
|
||||
angle = self->angle;
|
||||
angle = self->_f_angle();
|
||||
slope = P_AimLineAttack (self, angle, MISSILERANGE);
|
||||
|
||||
S_Sound (self, CHAN_WEAPON, "grunt/attack", 1, ATTN_NORM);
|
||||
|
@ -47,7 +47,7 @@ static void A_SPosAttack2 (AActor *self)
|
|||
int slope;
|
||||
|
||||
A_FaceTarget (self);
|
||||
bangle = self->angle;
|
||||
bangle = self->_f_angle();
|
||||
slope = P_AimLineAttack (self, bangle, MISSILERANGE);
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
|
@ -104,7 +104,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CPosAttack)
|
|||
|
||||
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
|
||||
A_FaceTarget (self);
|
||||
bangle = self->angle;
|
||||
bangle = self->_f_angle();
|
||||
slope = P_AimLineAttack (self, bangle, MISSILERANGE);
|
||||
|
||||
angle = bangle + (pr_cposattack.Random2() << 20);
|
||||
|
|
|
@ -39,13 +39,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_SkelMissile)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#define TRACEANGLE (0xc000000)
|
||||
#define TRACEANGLE (16.875)
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
angle_t exact;
|
||||
fixed_t dist;
|
||||
fixed_t slope;
|
||||
AActor *dest;
|
||||
|
@ -64,7 +63,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
|
|||
return 0;
|
||||
|
||||
// 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->_f_angle(), self->_f_angle(), 3);
|
||||
|
||||
smoke = Spawn ("RevenantTracerSmoke", self->Vec3Offset(-self->vel.x, -self->vel.y, 0), ALLOW_REPLACE);
|
||||
|
||||
|
@ -80,27 +79,23 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer)
|
|||
return 0;
|
||||
|
||||
// change angle
|
||||
exact = self->AngleTo(dest);
|
||||
DAngle exact = self->_f_AngleTo(dest);
|
||||
DAngle diff = deltaangle(self->Angles.Yaw, exact);
|
||||
|
||||
if (exact != self->angle)
|
||||
if (diff < 0)
|
||||
{
|
||||
if (exact - self->angle > 0x80000000)
|
||||
{
|
||||
self->angle -= TRACEANGLE;
|
||||
if (exact - self->angle < 0x80000000)
|
||||
self->angle = exact;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->angle += TRACEANGLE;
|
||||
if (exact - self->angle > 0x80000000)
|
||||
self->angle = exact;
|
||||
}
|
||||
self->Angles.Yaw -= TRACEANGLE;
|
||||
if (deltaangle(self->Angles.Yaw, exact) > 0)
|
||||
self->Angles.Yaw = exact;
|
||||
}
|
||||
|
||||
exact = self->angle>>ANGLETOFINESHIFT;
|
||||
self->vel.x = FixedMul (self->Speed, finecosine[exact]);
|
||||
self->vel.y = FixedMul (self->Speed, finesine[exact]);
|
||||
else if (diff > 0)
|
||||
{
|
||||
self->Angles.Yaw += TRACEANGLE;
|
||||
if (deltaangle(self->Angles.Yaw, exact) < 0.)
|
||||
self->Angles.Yaw = exact;
|
||||
}
|
||||
|
||||
self->VelFromAngle();
|
||||
|
||||
if (!(self->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
||||
{
|
||||
|
|
|
@ -275,14 +275,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_Saw)
|
|||
A_FaceTarget (self);
|
||||
if (self->CheckMeleeRange ())
|
||||
{
|
||||
angle_t angle;
|
||||
angle_t Angle;
|
||||
FTranslatedLineTarget t;
|
||||
|
||||
damage *= (pr_m_saw()%10+1);
|
||||
angle = self->angle + (pr_m_saw.Random2() << 18);
|
||||
Angle = self->_f_angle() + (pr_m_saw.Random2() << 18);
|
||||
|
||||
P_LineAttack (self, angle, MELEERANGE+1,
|
||||
P_AimLineAttack (self, angle, MELEERANGE+1), damage,
|
||||
P_LineAttack (self, Angle, MELEERANGE+1,
|
||||
P_AimLineAttack (self, Angle, MELEERANGE+1), damage,
|
||||
NAME_Melee, pufftype, false, &t);
|
||||
|
||||
if (!t.linetarget)
|
||||
|
@ -293,20 +293,22 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_Saw)
|
|||
S_Sound (self, CHAN_WEAPON, hitsound, 1, ATTN_NORM);
|
||||
|
||||
// turn to face target
|
||||
angle = t.angleFromSource;
|
||||
if (angle - self->angle > ANG180)
|
||||
DAngle angle = t.angleFromSource;
|
||||
DAngle anglediff = deltaangle(self->Angles.Yaw, angle);
|
||||
|
||||
if (anglediff < 0.0)
|
||||
{
|
||||
if (angle - self->angle < (angle_t)(-ANG90/20))
|
||||
self->angle = angle + ANG90/21;
|
||||
if (anglediff < -4.5)
|
||||
self->Angles.Yaw = angle + 90.0 / 21;
|
||||
else
|
||||
self->angle -= ANG90/20;
|
||||
self->Angles.Yaw -= 4.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (angle - self->angle > ANG90/20)
|
||||
self->angle = angle - ANG90/21;
|
||||
if (anglediff > 4.5)
|
||||
self->Angles.Yaw = angle - 90.0 / 21;
|
||||
else
|
||||
self->angle += ANG90/20;
|
||||
self->Angles.Yaw += 4.5;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -336,7 +338,7 @@ static void MarinePunch(AActor *self, int damagemul)
|
|||
damage = ((pr_m_punch()%10+1) << 1) * damagemul;
|
||||
|
||||
A_FaceTarget (self);
|
||||
angle = self->angle + (pr_m_punch.Random2() << 18);
|
||||
angle = self->_f_angle() + (pr_m_punch.Random2() << 18);
|
||||
pitch = P_AimLineAttack (self, angle, MELEERANGE);
|
||||
P_LineAttack (self, angle, MELEERANGE, pitch, damage, NAME_Melee, NAME_BulletPuff, true, &t);
|
||||
|
||||
|
@ -344,7 +346,7 @@ static void MarinePunch(AActor *self, int damagemul)
|
|||
if (t.linetarget)
|
||||
{
|
||||
S_Sound (self, CHAN_WEAPON, "*fist", 1, ATTN_NORM);
|
||||
self->angle = t.angleFromSource;
|
||||
self->Angles.Yaw = t.angleFromSource;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -369,7 +371,7 @@ void P_GunShot2 (AActor *mo, bool accurate, int pitch, PClassActor *pufftype)
|
|||
int damage;
|
||||
|
||||
damage = 5*(pr_m_gunshot()%3+1);
|
||||
angle = mo->angle;
|
||||
angle = mo->_f_angle();
|
||||
|
||||
if (!accurate)
|
||||
{
|
||||
|
@ -395,7 +397,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_FirePistol)
|
|||
|
||||
S_Sound (self, CHAN_WEAPON, "weapons/pistol", 1, ATTN_NORM);
|
||||
A_FaceTarget (self);
|
||||
P_GunShot2 (self, accurate, P_AimLineAttack (self, self->angle, MISSILERANGE),
|
||||
P_GunShot2 (self, accurate, P_AimLineAttack (self, self->_f_angle(), MISSILERANGE),
|
||||
PClass::FindActor(NAME_BulletPuff));
|
||||
return 0;
|
||||
}
|
||||
|
@ -417,7 +419,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun)
|
|||
|
||||
S_Sound (self, CHAN_WEAPON, "weapons/shotgf", 1, ATTN_NORM);
|
||||
A_FaceTarget (self);
|
||||
pitch = P_AimLineAttack (self, self->angle, MISSILERANGE);
|
||||
pitch = P_AimLineAttack (self, self->_f_angle(), MISSILERANGE);
|
||||
for (int i = 0; i < 7; ++i)
|
||||
{
|
||||
P_GunShot2 (self, false, pitch, PClass::FindActor(NAME_BulletPuff));
|
||||
|
@ -464,11 +466,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_M_FireShotgun2)
|
|||
|
||||
S_Sound (self, CHAN_WEAPON, "weapons/sshotf", 1, ATTN_NORM);
|
||||
A_FaceTarget (self);
|
||||
pitch = P_AimLineAttack (self, self->angle, MISSILERANGE);
|
||||
pitch = P_AimLineAttack (self, self->_f_angle(), MISSILERANGE);
|
||||
for (int i = 0; i < 20; ++i)
|
||||
{
|
||||
int damage = 5*(pr_m_fireshotgun2()%3+1);
|
||||
angle_t angle = self->angle + (pr_m_fireshotgun2.Random2() << 19);
|
||||
angle_t angle = self->_f_angle() + (pr_m_fireshotgun2.Random2() << 19);
|
||||
|
||||
P_LineAttack (self, angle, MISSILERANGE,
|
||||
pitch + (pr_m_fireshotgun2.Random2() * 332063), damage,
|
||||
|
@ -494,7 +496,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_M_FireCGun)
|
|||
|
||||
S_Sound (self, CHAN_WEAPON, "weapons/chngun", 1, ATTN_NORM);
|
||||
A_FaceTarget (self);
|
||||
P_GunShot2 (self, accurate, P_AimLineAttack (self, self->angle, MISSILERANGE),
|
||||
P_GunShot2 (self, accurate, P_AimLineAttack (self, self->_f_angle(), MISSILERANGE),
|
||||
PClass::FindActor(NAME_BulletPuff));
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1183,7 +1183,7 @@ void G_Ticker ()
|
|||
if (players[i].mo)
|
||||
{
|
||||
DWORD sum = rngsum + players[i].mo->X() + players[i].mo->Y() + players[i].mo->Z()
|
||||
+ players[i].mo->angle + players[i].mo->pitch;
|
||||
+ players[i].mo->_f_angle() + players[i].mo->_f_pitch();
|
||||
sum ^= players[i].health;
|
||||
consistancy[i][buf] = sum;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ void AChickenPlayer::MorphPlayerThink ()
|
|||
}
|
||||
if (!(vel.x | vel.y) && pr_chickenplayerthink () < 160)
|
||||
{ // Twitch view angle
|
||||
angle += pr_chickenplayerthink.Random2 () << 19;
|
||||
Angles.Yaw += pr_chickenplayerthink.Random2() * (360. / 256. / 32.);
|
||||
}
|
||||
if ((Z() <= floorz) && (pr_chickenplayerthink() < 32))
|
||||
{ // Jump and noise
|
||||
|
@ -184,12 +184,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL1)
|
|||
}
|
||||
|
||||
damage = 1 + (pr_beakatkpl1()&3);
|
||||
angle = player->mo->angle;
|
||||
angle = player->mo->_f_angle();
|
||||
slope = P_AimLineAttack (player->mo, angle, MELEERANGE);
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, NAME_Melee, "BeakPuff", true, &t);
|
||||
if (t.linetarget)
|
||||
{
|
||||
player->mo->angle = t.angleFromSource;
|
||||
player->mo->Angles.Yaw = t.angleFromSource;
|
||||
}
|
||||
P_PlayPeck (player->mo);
|
||||
player->chickenPeck = 12;
|
||||
|
@ -219,12 +219,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_BeakAttackPL2)
|
|||
}
|
||||
|
||||
damage = pr_beakatkpl2.HitDice (4);
|
||||
angle = player->mo->angle;
|
||||
angle = player->mo->_f_angle();
|
||||
slope = P_AimLineAttack (player->mo, angle, MELEERANGE);
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, NAME_Melee, "BeakPuff", true, &t);
|
||||
if (t.linetarget)
|
||||
{
|
||||
player->mo->angle = t.angleFromSource;
|
||||
player->mo->Angles.Yaw = t.angleFromSource;
|
||||
}
|
||||
P_PlayPeck (player->mo);
|
||||
player->chickenPeck = 12;
|
||||
|
|
|
@ -94,7 +94,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr1Attack)
|
|||
if (mo != NULL)
|
||||
{
|
||||
vz = mo->vel.z;
|
||||
angle = mo->angle;
|
||||
angle = mo->_f_angle();
|
||||
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, vz);
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcererRise)
|
|||
mo = Spawn("Sorcerer2", self->Pos(), ALLOW_REPLACE);
|
||||
mo->Translation = self->Translation;
|
||||
mo->SetState (mo->FindState("Rise"));
|
||||
mo->angle = self->angle;
|
||||
mo->Angles.Yaw = self->Angles.Yaw;
|
||||
mo->CopyFriendliness (self, true);
|
||||
return 0;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ void P_DSparilTeleport (AActor *actor)
|
|||
actor->SetState (actor->FindState("Teleport"));
|
||||
S_Sound (actor, CHAN_BODY, "misc/teleport", 1, ATTN_NORM);
|
||||
actor->SetZ(actor->floorz, false);
|
||||
actor->angle = spot->angle;
|
||||
actor->Angles.Yaw = spot->Angles.Yaw;
|
||||
actor->vel.x = actor->vel.y = actor->vel.z = 0;
|
||||
}
|
||||
}
|
||||
|
@ -230,8 +230,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Srcr2Attack)
|
|||
PClassActor *fx = PClass::FindActor("Sorcerer2FX2");
|
||||
if (fx)
|
||||
{
|
||||
P_SpawnMissileAngle (self, fx, self->angle-ANG45, FRACUNIT/2);
|
||||
P_SpawnMissileAngle (self, fx, self->angle+ANG45, FRACUNIT/2);
|
||||
P_SpawnMissileAngle (self, fx, self->_f_angle()-ANG45, FRACUNIT/2);
|
||||
P_SpawnMissileAngle (self, fx, self->_f_angle()+ANG45, FRACUNIT/2);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -70,9 +70,9 @@ IMPLEMENT_CLASS (AArtiTimeBomb)
|
|||
|
||||
bool AArtiTimeBomb::Use (bool pickup)
|
||||
{
|
||||
angle_t angle = Owner->angle >> ANGLETOFINESHIFT;
|
||||
angle_t angle = Owner->_f_angle() >> ANGLETOFINESHIFT;
|
||||
AActor *mo = Spawn("ActivatedTimeBomb",
|
||||
Owner->Vec3Angle(24*FRACUNIT, Owner->angle, - Owner->floorclip), ALLOW_REPLACE);
|
||||
Owner->Vec3Angle(24*FRACUNIT, Owner->_f_angle(), - Owner->floorclip), ALLOW_REPLACE);
|
||||
mo->target = Owner;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -172,18 +172,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcanoBlast)
|
|||
int i;
|
||||
int count;
|
||||
AActor *blast;
|
||||
angle_t angle;
|
||||
|
||||
count = 1 + (pr_blast() % 3);
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
blast = Spawn("VolcanoBlast", self->PosPlusZ(44*FRACUNIT), ALLOW_REPLACE);
|
||||
blast->target = self;
|
||||
angle = pr_blast () << 24;
|
||||
blast->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
blast->vel.x = FixedMul (1*FRACUNIT, finecosine[angle]);
|
||||
blast->vel.y = FixedMul (1*FRACUNIT, finesine[angle]);
|
||||
blast->Angles.Yaw = pr_blast() * (360 / 256.f);
|
||||
blast->VelFromAngle(1 * FRACUNIT);
|
||||
blast->vel.z = (FRACUNIT*5/2) + (pr_blast() << 10);
|
||||
S_Sound (blast, CHAN_BODY, "world/volcano/shoot", 1, ATTN_NORM);
|
||||
P_CheckMissileSpawn (blast, self->radius);
|
||||
|
@ -203,7 +199,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact)
|
|||
|
||||
unsigned int i;
|
||||
AActor *tiny;
|
||||
angle_t angle;
|
||||
|
||||
if (self->Z() <= self->floorz)
|
||||
{
|
||||
|
@ -217,11 +212,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_VolcBallImpact)
|
|||
{
|
||||
tiny = Spawn("VolcanoTBlast", self->Pos(), ALLOW_REPLACE);
|
||||
tiny->target = self;
|
||||
angle = i*ANG90;
|
||||
tiny->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
tiny->vel.x = FixedMul (FRACUNIT*7/10, finecosine[angle]);
|
||||
tiny->vel.y = FixedMul (FRACUNIT*7/10, finesine[angle]);
|
||||
tiny->Angles.Yaw = 90.*i;
|
||||
tiny->VelFromAngle(FRACUNIT * 7 / 10);
|
||||
tiny->vel.z = FRACUNIT + (pr_volcimpact() << 9);
|
||||
P_CheckMissileSpawn (tiny, self->radius);
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StaffAttack)
|
|||
{
|
||||
puff = PClass::FindActor(NAME_BulletPuff); // just to be sure
|
||||
}
|
||||
angle = self->angle;
|
||||
angle = self->_f_angle();
|
||||
angle += pr_sap.Random2() << 18;
|
||||
slope = P_AimLineAttack (self, angle, MELEERANGE);
|
||||
P_LineAttack (self, angle, MELEERANGE, slope, damage, NAME_Melee, puff, true, &t);
|
||||
|
@ -94,7 +94,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_StaffAttack)
|
|||
{
|
||||
//S_StartSound(player->mo, sfx_stfhit);
|
||||
// turn to face target
|
||||
self->angle = t.angleFromSource;
|
||||
self->Angles.Yaw = t.angleFromSource;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL1)
|
|||
}
|
||||
angle_t pitch = P_BulletSlope(self);
|
||||
damage = 7+(pr_fgw()&7);
|
||||
angle = self->angle;
|
||||
angle = self->_f_angle();
|
||||
if (player->refire)
|
||||
{
|
||||
angle += pr_fgw.Random2() << 18;
|
||||
|
@ -167,9 +167,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireGoldWandPL2)
|
|||
angle_t pitch = P_BulletSlope(self);
|
||||
vz = FixedMul (GetDefaultByName("GoldWandFX2")->Speed,
|
||||
finetangent[FINEANGLES/4-((signed)pitch>>ANGLETOFINESHIFT)]);
|
||||
P_SpawnMissileAngle (self, PClass::FindActor("GoldWandFX2"), self->angle-(ANG45/8), vz);
|
||||
P_SpawnMissileAngle (self, PClass::FindActor("GoldWandFX2"), self->angle+(ANG45/8), vz);
|
||||
angle = self->angle-(ANG45/8);
|
||||
P_SpawnMissileAngle (self, PClass::FindActor("GoldWandFX2"), self->_f_angle()-(ANG45/8), vz);
|
||||
P_SpawnMissileAngle (self, PClass::FindActor("GoldWandFX2"), self->_f_angle()+(ANG45/8), vz);
|
||||
angle = self->_f_angle()-(ANG45/8);
|
||||
for(i = 0; i < 5; i++)
|
||||
{
|
||||
damage = 1+(pr_fgw2()&7);
|
||||
|
@ -204,8 +204,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL1)
|
|||
return 0;
|
||||
}
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX1"));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX3"), self->angle-(ANG45/10));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX3"), self->angle+(ANG45/10));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX3"), self->_f_angle()-(ANG45/10));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX3"), self->_f_angle()+(ANG45/10));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -233,10 +233,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireCrossbowPL2)
|
|||
return 0;
|
||||
}
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX2"));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX2"), self->angle-(ANG45/10));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX2"), self->angle+(ANG45/10));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX3"), self->angle-(ANG45/5));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX3"), self->angle+(ANG45/5));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX2"), self->_f_angle()-(ANG45/10));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX2"), self->_f_angle()+(ANG45/10));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX3"), self->_f_angle()-(ANG45/5));
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("CrossbowFX3"), self->_f_angle()+(ANG45/5));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -250,7 +250,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack)
|
|||
{
|
||||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
angle_t angle;
|
||||
angle_t Angle;
|
||||
int damage;
|
||||
int slope;
|
||||
int randVal;
|
||||
|
@ -275,23 +275,23 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack)
|
|||
}
|
||||
player->psprites[ps_weapon].sx = ((pr_gatk()&3)-2) * FRACUNIT;
|
||||
player->psprites[ps_weapon].sy = WEAPONTOP + (pr_gatk()&3) * FRACUNIT;
|
||||
angle = self->angle;
|
||||
Angle = self->_f_angle();
|
||||
if (power)
|
||||
{
|
||||
damage = pr_gatk.HitDice (2);
|
||||
dist = 4*MELEERANGE;
|
||||
angle += pr_gatk.Random2() << 17;
|
||||
Angle += pr_gatk.Random2() << 17;
|
||||
pufftype = PClass::FindActor("GauntletPuff2");
|
||||
}
|
||||
else
|
||||
{
|
||||
damage = pr_gatk.HitDice (2);
|
||||
dist = MELEERANGE+1;
|
||||
angle += pr_gatk.Random2() << 18;
|
||||
Angle += pr_gatk.Random2() << 18;
|
||||
pufftype = PClass::FindActor("GauntletPuff1");
|
||||
}
|
||||
slope = P_AimLineAttack (self, angle, dist);
|
||||
P_LineAttack (self, angle, dist, slope, damage, NAME_Melee, pufftype, false, &t, &actualdamage);
|
||||
slope = P_AimLineAttack (self, Angle, dist);
|
||||
P_LineAttack (self, Angle, dist, slope, damage, NAME_Melee, pufftype, false, &t, &actualdamage);
|
||||
if (!t.linetarget)
|
||||
{
|
||||
if (pr_gatk() > 64)
|
||||
|
@ -324,20 +324,22 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack)
|
|||
S_Sound (self, CHAN_AUTO, "weapons/gauntletshit", 1, ATTN_NORM);
|
||||
}
|
||||
// turn to face target
|
||||
angle = t.angleFromSource;
|
||||
if (angle-self->angle > ANG180)
|
||||
DAngle angle = t.angleFromSource;
|
||||
DAngle anglediff = deltaangle(self->Angles.Yaw, angle);
|
||||
|
||||
if (anglediff < 0.0)
|
||||
{
|
||||
if ((int)(angle-self->angle) < -ANG90/20)
|
||||
self->angle = angle+ANG90/21;
|
||||
if (anglediff < -4.5)
|
||||
self->Angles.Yaw = angle + 90.0 / 21;
|
||||
else
|
||||
self->angle -= ANG90/20;
|
||||
self->Angles.Yaw -= 4.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (angle-self->angle > ANG90/20)
|
||||
self->angle = angle-ANG90/21;
|
||||
if (anglediff > 4.5)
|
||||
self->Angles.Yaw = angle - 90.0 / 21;
|
||||
else
|
||||
self->angle += ANG90/20;
|
||||
self->Angles.Yaw += 4.5;
|
||||
}
|
||||
self->flags |= MF_JUSTATTACKED;
|
||||
return 0;
|
||||
|
@ -387,7 +389,6 @@ int AMaceFX4::DoSpecialDamage (AActor *target, int damage, FName damagetype)
|
|||
void FireMacePL1B (AActor *actor)
|
||||
{
|
||||
AActor *ball;
|
||||
angle_t angle;
|
||||
player_t *player;
|
||||
|
||||
if (NULL == (player = actor->player))
|
||||
|
@ -402,15 +403,13 @@ void FireMacePL1B (AActor *actor)
|
|||
return;
|
||||
}
|
||||
ball = Spawn("MaceFX2", actor->PosPlusZ(28*FRACUNIT - actor->floorclip), ALLOW_REPLACE);
|
||||
ball->vel.z = 2*FRACUNIT+/*((player->lookdir)<<(FRACBITS-5))*/
|
||||
finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)];
|
||||
angle = actor->angle;
|
||||
ball->vel.z = FLOAT2FIXED(2 + g_tan(-actor->Angles.Pitch.Degrees));
|
||||
ball->target = actor;
|
||||
ball->angle = angle;
|
||||
ball->AddZ(2*finetangent[FINEANGLES/4-(actor->pitch>>ANGLETOFINESHIFT)]);
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
ball->vel.x = (actor->vel.x>>1) + FixedMul(ball->Speed, finecosine[angle]);
|
||||
ball->vel.y = (actor->vel.y>>1) + FixedMul(ball->Speed, finesine[angle]);
|
||||
ball->Angles.Yaw = actor->Angles.Yaw;
|
||||
ball->AddZ(ball->vel.z);
|
||||
ball->VelFromAngle();
|
||||
ball->vel.x += (actor->vel.x>>1);
|
||||
ball->vel.y += (actor->vel.y>>1);
|
||||
S_Sound (ball, CHAN_BODY, "weapons/maceshoot", 1, ATTN_NORM);
|
||||
P_CheckMissileSpawn (ball, actor->radius);
|
||||
}
|
||||
|
@ -447,7 +446,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL1)
|
|||
player->psprites[ps_weapon].sx = ((pr_maceatk()&3)-2)*FRACUNIT;
|
||||
player->psprites[ps_weapon].sy = WEAPONTOP+(pr_maceatk()&3)*FRACUNIT;
|
||||
ball = P_SpawnPlayerMissile (self, PClass::FindActor("MaceFX1"),
|
||||
self->angle+(((pr_maceatk()&7)-4)<<24));
|
||||
self->_f_angle()+(((pr_maceatk()&7)-4)<<24));
|
||||
if (ball)
|
||||
{
|
||||
ball->special1 = 16; // tics till dropoff
|
||||
|
@ -480,7 +479,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MacePL1Check)
|
|||
// [RH] Avoid some precision loss by scaling the velocity directly
|
||||
#if 0
|
||||
// This is the original code, for reference.
|
||||
angle_t angle = self->angle>>ANGLETOFINESHIFT;
|
||||
angle_t angle = self->_f_angle()>>ANGLETOFINESHIFT;
|
||||
self->vel.x = FixedMul(7*FRACUNIT, finecosine[angle]);
|
||||
self->vel.y = FixedMul(7*FRACUNIT, finesine[angle]);
|
||||
#else
|
||||
|
@ -533,7 +532,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2)
|
|||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
AActor *tiny;
|
||||
angle_t angle;
|
||||
|
||||
if ((self->Z() <= self->floorz) && P_HitFloor (self))
|
||||
{ // Landed in some sort of liquid
|
||||
|
@ -552,22 +550,20 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaceBallImpact2)
|
|||
self->SetState (self->SpawnState);
|
||||
|
||||
tiny = Spawn("MaceFX3", self->Pos(), ALLOW_REPLACE);
|
||||
angle = self->angle+ANG90;
|
||||
tiny->target = self->target;
|
||||
tiny->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
tiny->vel.x = (self->vel.x>>1) + FixedMul(self->vel.z-FRACUNIT, finecosine[angle]);
|
||||
tiny->vel.y = (self->vel.y>>1) + FixedMul(self->vel.z-FRACUNIT, finesine[angle]);
|
||||
tiny->Angles.Yaw = self->Angles.Yaw + 90.;
|
||||
tiny->VelFromAngle(self->vel.z - FRACUNIT);
|
||||
tiny->vel.x += (self->vel.x >> 1);
|
||||
tiny->vel.y += (self->vel.y >> 1);
|
||||
tiny->vel.z = self->vel.z;
|
||||
P_CheckMissileSpawn (tiny, self->radius);
|
||||
|
||||
tiny = Spawn("MaceFX3", self->Pos(), ALLOW_REPLACE);
|
||||
angle = self->angle-ANG90;
|
||||
tiny->target = self->target;
|
||||
tiny->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
tiny->vel.x = (self->vel.x>>1) + FixedMul(self->vel.z-FRACUNIT, finecosine[angle]);
|
||||
tiny->vel.y = (self->vel.y>>1) + FixedMul(self->vel.z-FRACUNIT, finesine[angle]);
|
||||
tiny->Angles.Yaw = self->Angles.Yaw - 90.;
|
||||
tiny->VelFromAngle(self->vel.z - FRACUNIT);
|
||||
tiny->vel.x += (self->vel.x >> 1);
|
||||
tiny->vel.y += (self->vel.y >> 1);
|
||||
tiny->vel.z = self->vel.z;
|
||||
P_CheckMissileSpawn (tiny, self->radius);
|
||||
}
|
||||
|
@ -607,13 +603,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMacePL2)
|
|||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return 0;
|
||||
}
|
||||
mo = P_SpawnPlayerMissile (self, 0,0,0, RUNTIME_CLASS(AMaceFX4), self->angle, &t);
|
||||
mo = P_SpawnPlayerMissile (self, 0,0,0, RUNTIME_CLASS(AMaceFX4), self->_f_angle(), &t);
|
||||
if (mo)
|
||||
{
|
||||
mo->vel.x += self->vel.x;
|
||||
mo->vel.y += self->vel.y;
|
||||
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->_f_pitch()>>ANGLETOFINESHIFT)], -5*FRACUNIT, 5*FRACUNIT);
|
||||
if (t.linetarget && !t.unlinked)
|
||||
{
|
||||
mo->tracer = t.linetarget;
|
||||
|
@ -635,7 +631,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
|
|||
|
||||
int i;
|
||||
AActor *target;
|
||||
angle_t angle = 0;
|
||||
DAngle angle = 0;
|
||||
bool newAngle;
|
||||
FTranslatedLineTarget t;
|
||||
|
||||
|
@ -662,7 +658,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
|
|||
}
|
||||
else
|
||||
{ // Seek
|
||||
angle = self->AngleTo(target);
|
||||
angle = self->_f_AngleTo(target);
|
||||
newAngle = true;
|
||||
}
|
||||
}
|
||||
|
@ -671,7 +667,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
|
|||
angle = 0;
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
P_AimLineAttack (self, angle, 10*64*FRACUNIT, &t, 0, ALF_NOFRIENDS|ALF_PORTALRESTRICT, NULL, self->target);
|
||||
P_AimLineAttack (self, FLOAT2ANGLE(angle.Degrees), 10*64*FRACUNIT, &t, 0, ALF_NOFRIENDS|ALF_PORTALRESTRICT, NULL, self->target);
|
||||
if (t.linetarget && self->target != t.linetarget)
|
||||
{
|
||||
self->tracer = t.linetarget;
|
||||
|
@ -679,15 +675,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
|
|||
newAngle = true;
|
||||
break;
|
||||
}
|
||||
angle += ANGLE_45/2;
|
||||
angle += 22.5;
|
||||
}
|
||||
}
|
||||
if (newAngle)
|
||||
{
|
||||
self->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
self->vel.x = FixedMul (self->Speed, finecosine[angle]);
|
||||
self->vel.y = FixedMul (self->Speed, finesine[angle]);
|
||||
self->Angles.Yaw = angle;
|
||||
self->VelFromAngle();
|
||||
}
|
||||
self->SetState (self->SpawnState);
|
||||
S_Sound (self, CHAN_BODY, "weapons/macestop", 1, ATTN_NORM);
|
||||
|
@ -795,7 +789,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireBlasterPL1)
|
|||
}
|
||||
angle_t pitch = P_BulletSlope(self);
|
||||
damage = pr_fb1.HitDice (4);
|
||||
angle = self->angle;
|
||||
angle = self->_f_angle();
|
||||
if (player->refire)
|
||||
{
|
||||
angle += pr_fb1.Random2() << 18;
|
||||
|
@ -816,18 +810,16 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnRippers)
|
|||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
unsigned int i;
|
||||
angle_t angle;
|
||||
DAngle angle;
|
||||
AActor *ripper;
|
||||
|
||||
for(i = 0; i < 8; i++)
|
||||
{
|
||||
ripper = Spawn<ARipper> (self->Pos(), ALLOW_REPLACE);
|
||||
angle = i*ANG45;
|
||||
angle = i*45.;
|
||||
ripper->target = self->target;
|
||||
ripper->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
ripper->vel.x = FixedMul (ripper->Speed, finecosine[angle]);
|
||||
ripper->vel.y = FixedMul (ripper->Speed, finesine[angle]);
|
||||
ripper->Angles.Yaw = angle;
|
||||
ripper->VelFromAngle();
|
||||
P_CheckMissileSpawn (ripper, self->radius);
|
||||
}
|
||||
return 0;
|
||||
|
@ -955,7 +947,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSkullRodPL2)
|
|||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return 0;
|
||||
}
|
||||
P_SpawnPlayerMissile (self, 0,0,0, RUNTIME_CLASS(AHornRodFX2), self->angle, &t, &MissileActor);
|
||||
P_SpawnPlayerMissile (self, 0,0,0, RUNTIME_CLASS(AHornRodFX2), self->_f_angle(), &t, &MissileActor);
|
||||
// Use MissileActor instead of the return value from
|
||||
// P_SpawnPlayerMissile because we need to give info to the mobj
|
||||
// even if it exploded immediately.
|
||||
|
@ -1252,7 +1244,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL1)
|
|||
return 0;
|
||||
}
|
||||
P_SpawnPlayerMissile (self, RUNTIME_CLASS(APhoenixFX1));
|
||||
angle = self->angle + ANG180;
|
||||
angle = self->_f_angle() + ANG180;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
self->vel.x += FixedMul (4*FRACUNIT, finecosine[angle]);
|
||||
self->vel.y += FixedMul (4*FRACUNIT, finesine[angle]);
|
||||
|
@ -1275,13 +1267,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_PhoenixPuff)
|
|||
//[RH] Heretic never sets the target for seeking
|
||||
//P_SeekerMissile (self, ANGLE_1*5, ANGLE_1*10);
|
||||
puff = Spawn("PhoenixPuff", self->Pos(), ALLOW_REPLACE);
|
||||
angle = self->angle + ANG90;
|
||||
angle = self->_f_angle() + ANG90;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
puff->vel.x = FixedMul (FRACUNIT*13/10, finecosine[angle]);
|
||||
puff->vel.y = FixedMul (FRACUNIT*13/10, finesine[angle]);
|
||||
puff->vel.z = 0;
|
||||
puff = Spawn("PhoenixPuff", self->Pos(), ALLOW_REPLACE);
|
||||
angle = self->angle - ANG90;
|
||||
angle = self->_f_angle() - ANG90;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
puff->vel.x = FixedMul (FRACUNIT*13/10, finecosine[angle]);
|
||||
puff->vel.y = FixedMul (FRACUNIT*13/10, finesine[angle]);
|
||||
|
@ -1323,7 +1315,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
|
|||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
AActor *mo;
|
||||
angle_t angle;
|
||||
|
||||
fixed_t slope;
|
||||
FSoundID soundid;
|
||||
|
@ -1345,19 +1336,20 @@ DEFINE_ACTION_FUNCTION(AActor, A_FirePhoenixPL2)
|
|||
S_StopSound (self, CHAN_WEAPON);
|
||||
return 0;
|
||||
}
|
||||
angle = self->angle;
|
||||
|
||||
slope = FLOAT2FIXED(g_tan(-self->Angles.Pitch.Degrees));
|
||||
fixed_t xo = (pr_fp2.Random2() << 9);
|
||||
fixed_t yo = (pr_fp2.Random2() << 9);
|
||||
fixedvec3 pos = self->Vec3Offset(xo, yo,
|
||||
26*FRACUNIT + finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)] - self->floorclip);
|
||||
26*FRACUNIT + slope - self->floorclip);
|
||||
|
||||
slope = finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)] + (FRACUNIT/10);
|
||||
slope += (FRACUNIT/10);
|
||||
mo = Spawn("PhoenixFX2", pos, ALLOW_REPLACE);
|
||||
mo->target = self;
|
||||
mo->angle = angle;
|
||||
mo->vel.x = self->vel.x + FixedMul (mo->Speed, finecosine[angle>>ANGLETOFINESHIFT]);
|
||||
mo->vel.y = self->vel.y + FixedMul (mo->Speed, finesine[angle>>ANGLETOFINESHIFT]);
|
||||
mo->Angles.Yaw = self->Angles.Yaw;
|
||||
mo->VelFromAngle();
|
||||
mo->vel.x += self->vel.x;
|
||||
mo->vel.y += self->vel.y;
|
||||
mo->vel.z = FixedMul (mo->Speed, slope);
|
||||
if (!player->refire || !S_IsActorPlayingSomething (self, CHAN_WEAPON, -1))
|
||||
{
|
||||
|
|
|
@ -30,7 +30,7 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage, FName damagetype)
|
|||
|
||||
if (!(target->flags7 & MF7_DONTTHRUST))
|
||||
{
|
||||
target->angle += pr_foo.Random2() << 20;
|
||||
target->Angles.Yaw += pr_foo.Random2() * (360 / 4096.);
|
||||
target->vel.x += pr_foo.Random2() << 10;
|
||||
target->vel.y += pr_foo.Random2() << 10;
|
||||
}
|
||||
|
@ -114,10 +114,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichAttack)
|
|||
S_Sound (self, CHAN_BODY, "ironlich/attack1", 1, ATTN_NORM);
|
||||
}
|
||||
fire->target = baseFire->target;
|
||||
fire->angle = baseFire->angle;
|
||||
fire->vel.x = baseFire->vel.x;
|
||||
fire->vel.y = baseFire->vel.y;
|
||||
fire->vel.z = baseFire->vel.z;
|
||||
fire->Angles.Yaw = baseFire->Angles.Yaw;
|
||||
fire->vel = baseFire->vel;
|
||||
fire->Damage = NULL;
|
||||
fire->health = (i+1) * 2;
|
||||
P_CheckMissileSpawn (fire, self->radius);
|
||||
|
@ -180,18 +178,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_LichIceImpact)
|
|||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
unsigned int i;
|
||||
angle_t angle;
|
||||
AActor *shard;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
shard = Spawn("HeadFX2", self->Pos(), ALLOW_REPLACE);
|
||||
angle = i*ANG45;
|
||||
shard->target = self->target;
|
||||
shard->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
shard->vel.x = FixedMul (shard->Speed, finecosine[angle]);
|
||||
shard->vel.y = FixedMul (shard->Speed, finesine[angle]);
|
||||
shard->Angles.Yaw = i*45.;
|
||||
shard->VelFromAngle();
|
||||
shard->vel.z = -FRACUNIT*6/10;
|
||||
P_CheckMissileSpawn (shard, self->radius);
|
||||
}
|
||||
|
|
|
@ -88,8 +88,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_WizAtk3)
|
|||
mo = P_SpawnMissile (self, self->target, fx);
|
||||
if (mo != NULL)
|
||||
{
|
||||
P_SpawnMissileAngle(self, fx, mo->angle-(ANG45/8), mo->vel.z);
|
||||
P_SpawnMissileAngle(self, fx, mo->angle+(ANG45/8), mo->vel.z);
|
||||
P_SpawnMissileAngle(self, fx, mo->_f_angle()-(ANG45/8), mo->vel.z);
|
||||
P_SpawnMissileAngle(self, fx, mo->_f_angle()+(ANG45/8), mo->vel.z);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BatSpawn)
|
|||
|
||||
delta = self->args[1];
|
||||
if (delta==0) delta=1;
|
||||
angle = self->angle + (((pr_batspawn()%delta)-(delta>>1))<<24);
|
||||
angle = self->_f_angle() + (((pr_batspawn()%delta)-(delta>>1))<<24);
|
||||
mo = P_SpawnMissileAngle (self, PClass::FindActor("Bat"), angle, 0);
|
||||
if (mo)
|
||||
{
|
||||
|
@ -74,11 +74,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_BatMove)
|
|||
|
||||
if (pr_batmove()<128)
|
||||
{
|
||||
newangle = self->angle + ANGLE_1*self->args[4];
|
||||
newangle = self->_f_angle() + ANGLE_1*self->args[4];
|
||||
}
|
||||
else
|
||||
{
|
||||
newangle = self->angle - ANGLE_1*self->args[4];
|
||||
newangle = self->_f_angle() - ANGLE_1*self->args[4];
|
||||
}
|
||||
|
||||
// Adjust velocity vector to new direction
|
||||
|
|
|
@ -118,15 +118,15 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopDoBlur)
|
|||
self->special1 = (pr_doblur() & 3) + 3; // Random number of blurs
|
||||
if (pr_doblur() < 120)
|
||||
{
|
||||
P_ThrustMobj (self, self->angle + ANG90, 11*FRACUNIT);
|
||||
P_ThrustMobj (self, self->_f_angle() + ANG90, 11*FRACUNIT);
|
||||
}
|
||||
else if (pr_doblur() > 125)
|
||||
{
|
||||
P_ThrustMobj (self, self->angle - ANG90, 11*FRACUNIT);
|
||||
P_ThrustMobj (self, self->_f_angle() - ANG90, 11*FRACUNIT);
|
||||
}
|
||||
else
|
||||
{ // Thrust forward
|
||||
P_ThrustMobj (self, self->angle, 11*FRACUNIT);
|
||||
P_ThrustMobj (self, self->_f_angle(), 11*FRACUNIT);
|
||||
}
|
||||
S_Sound (self, CHAN_BODY, "BishopBlur", 1, ATTN_NORM);
|
||||
return 0;
|
||||
|
@ -160,7 +160,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopSpawnBlur)
|
|||
mo = Spawn ("BishopBlur", self->Pos(), ALLOW_REPLACE);
|
||||
if (mo)
|
||||
{
|
||||
mo->angle = self->angle;
|
||||
mo->Angles.Yaw = self->Angles.Yaw;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_BishopPainBlur)
|
|||
mo = Spawn ("BishopPainBlur", self->Vec3Offset(xo, yo, zo), ALLOW_REPLACE);
|
||||
if (mo)
|
||||
{
|
||||
mo->angle = self->angle;
|
||||
mo->Angles.Yaw = self->Angles.Yaw;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ void ACFlameMissile::Effect ()
|
|||
AActor *mo = Spawn ("CFlameFloor", X(), Y(), newz, ALLOW_REPLACE);
|
||||
if (mo)
|
||||
{
|
||||
mo->angle = angle;
|
||||
mo->Angles.Yaw = Angles.Yaw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile)
|
|||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
int i;
|
||||
int an, an90;
|
||||
DAngle an;
|
||||
fixed_t dist;
|
||||
AActor *mo;
|
||||
|
||||
|
@ -129,30 +129,29 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameMissile)
|
|||
dist = BlockingMobj->radius+18*FRACUNIT;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
an = (i*ANG45)>>ANGLETOFINESHIFT;
|
||||
an90 = (i*ANG45+ANG90)>>ANGLETOFINESHIFT;
|
||||
an = i*45.;
|
||||
mo = Spawn ("CircleFlame", BlockingMobj->Vec3Offset(
|
||||
FixedMul(dist, finecosine[an]),
|
||||
FixedMul(dist, finesine[an]),
|
||||
xs_CRoundToInt(an.Cos()*dist), xs_CRoundToInt(an.Sin()*dist),
|
||||
5*FRACUNIT), ALLOW_REPLACE);
|
||||
if (mo)
|
||||
{
|
||||
mo->angle = an<<ANGLETOFINESHIFT;
|
||||
mo->Angles.Yaw = an;
|
||||
mo->target = self->target;
|
||||
mo->vel.x = mo->special1 = FixedMul(FLAMESPEED, finecosine[an]);
|
||||
mo->vel.y = mo->special2 = FixedMul(FLAMESPEED, finesine[an]);
|
||||
mo->VelFromAngle(FLAMESPEED);
|
||||
mo->special1 = mo->vel.x;
|
||||
mo->special2 = mo->vel.y;
|
||||
mo->tics -= pr_missile()&3;
|
||||
}
|
||||
mo = Spawn ("CircleFlame", BlockingMobj->Vec3Offset(
|
||||
-FixedMul(dist, finecosine[an]),
|
||||
-FixedMul(dist, finesine[an]),
|
||||
-xs_CRoundToInt(an.Cos()*dist), -xs_CRoundToInt(an.Sin()*dist),
|
||||
5*FRACUNIT), ALLOW_REPLACE);
|
||||
if(mo)
|
||||
{
|
||||
mo->angle = ANG180+(an<<ANGLETOFINESHIFT);
|
||||
mo->Angles.Yaw = an + 180.;
|
||||
mo->target = self->target;
|
||||
mo->vel.x = mo->special1 = FixedMul(-FLAMESPEED, finecosine[an]);
|
||||
mo->vel.y = mo->special2 = FixedMul(-FLAMESPEED, finesine[an]);
|
||||
mo->VelFromAngle(-FLAMESPEED);
|
||||
mo->special1 = mo->vel.x;
|
||||
mo->special2 = mo->vel.y;
|
||||
mo->tics -= pr_missile()&3;
|
||||
}
|
||||
}
|
||||
|
@ -171,11 +170,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_CFlameRotate)
|
|||
{
|
||||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
int an;
|
||||
DAngle an = self->Angles.Yaw + 90.;
|
||||
self->VelFromAngle(an, FLAMEROTSPEED);
|
||||
self->vel.x += self->special1;
|
||||
self->vel.y += self->special2;
|
||||
|
||||
an = (self->angle+ANG90)>>ANGLETOFINESHIFT;
|
||||
self->vel.x = self->special1+FixedMul(FLAMEROTSPEED, finecosine[an]);
|
||||
self->vel.y = self->special2+FixedMul(FLAMEROTSPEED, finesine[an]);
|
||||
self->angle += ANG90/15;
|
||||
self->Angles.Yaw += 6.;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -160,8 +160,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyAttack2)
|
|||
break;
|
||||
}
|
||||
mo->SetZ(self->Z());
|
||||
mo->angle = self->angle+(ANGLE_45+ANGLE_45/2)-ANGLE_45*j;
|
||||
P_ThrustMobj(mo, mo->angle, mo->Speed);
|
||||
mo->Angles.Yaw = self->Angles.Yaw + 67.5 - 45.*j;
|
||||
P_ThrustMobj(mo, mo->_f_angle(), mo->Speed);
|
||||
mo->target = self->target;
|
||||
mo->args[0] = 10; // initial turn value
|
||||
mo->args[1] = 0; // initial look angle
|
||||
|
@ -225,7 +225,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyAttack)
|
|||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return 0;
|
||||
}
|
||||
AActor *missile = P_SpawnPlayerMissile (self, 0,0,0, PClass::FindActor("HolyMissile"), self->angle, &t);
|
||||
AActor *missile = P_SpawnPlayerMissile (self, 0,0,0, PClass::FindActor("HolyMissile"), self->_f_angle(), &t);
|
||||
if (missile != NULL && !t.unlinked)
|
||||
{
|
||||
missile->tracer = t.linetarget;
|
||||
|
@ -342,8 +342,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolyTail)
|
|||
else
|
||||
{
|
||||
if (P_TryMove (self,
|
||||
parent->X() - 14*finecosine[parent->angle>>ANGLETOFINESHIFT],
|
||||
parent->Y() - 14*finesine[parent->angle>>ANGLETOFINESHIFT], true))
|
||||
parent->X() - 14*finecosine[parent->_f_angle()>>ANGLETOFINESHIFT],
|
||||
parent->Y() - 14*finesine[parent->_f_angle()>>ANGLETOFINESHIFT], true))
|
||||
{
|
||||
self->SetZ(parent->Z()-5*FRACUNIT);
|
||||
}
|
||||
|
@ -377,12 +377,11 @@ static void CHolyFindTarget (AActor *actor)
|
|||
// Similar to P_SeekerMissile, but seeks to a random Z on the target
|
||||
//============================================================================
|
||||
|
||||
static void CHolySeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax)
|
||||
static void CHolySeekerMissile (AActor *actor, DAngle thresh, DAngle turnMax)
|
||||
{
|
||||
int dir;
|
||||
int dist;
|
||||
angle_t delta;
|
||||
angle_t angle;
|
||||
DAngle delta;
|
||||
AActor *target;
|
||||
fixed_t newZ;
|
||||
fixed_t deltaZ;
|
||||
|
@ -404,7 +403,7 @@ static void CHolySeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax)
|
|||
dir = P_FaceMobj (actor, target, &delta);
|
||||
if (delta > thresh)
|
||||
{
|
||||
delta >>= 1;
|
||||
delta /= 2;
|
||||
if (delta > turnMax)
|
||||
{
|
||||
delta = turnMax;
|
||||
|
@ -412,15 +411,14 @@ static void CHolySeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax)
|
|||
}
|
||||
if (dir)
|
||||
{ // Turn clockwise
|
||||
actor->angle += delta;
|
||||
actor->Angles.Yaw += delta;
|
||||
}
|
||||
else
|
||||
{ // Turn counter clockwise
|
||||
actor->angle -= delta;
|
||||
actor->Angles.Yaw -= delta;
|
||||
}
|
||||
angle = actor->angle>>ANGLETOFINESHIFT;
|
||||
actor->vel.x = FixedMul (actor->Speed, finecosine[angle]);
|
||||
actor->vel.y = FixedMul (actor->Speed, finesine[angle]);
|
||||
actor->VelFromAngle();
|
||||
|
||||
if (!(level.time&15)
|
||||
|| actor->Z() > target->Top()
|
||||
|| actor->Top() < target->Z())
|
||||
|
@ -463,7 +461,7 @@ void CHolyWeave (AActor *actor, FRandom &pr_random)
|
|||
|
||||
weaveXY = actor->special2 >> 16;
|
||||
weaveZ = actor->special2 & FINEMASK;
|
||||
angle = (actor->angle + ANG90) >> ANGLETOFINESHIFT;
|
||||
angle = (actor->_f_angle() + ANG90) >> ANGLETOFINESHIFT;
|
||||
newX = actor->X() - FixedMul(finecosine[angle], finesine[weaveXY] * 32);
|
||||
newY = actor->Y() - FixedMul(finesine[angle], finesine[weaveXY] * 32);
|
||||
weaveXY = (weaveXY + pr_random(5 << BOBTOFINESHIFT)) & FINEMASK;
|
||||
|
@ -500,8 +498,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CHolySeek)
|
|||
}
|
||||
if (self->tracer)
|
||||
{
|
||||
CHolySeekerMissile (self, self->args[0]*ANGLE_1,
|
||||
self->args[0]*ANGLE_1*2);
|
||||
CHolySeekerMissile (self, self->args[0], self->args[0]*2);
|
||||
if (!((level.time+7)&15))
|
||||
{
|
||||
self->args[0] = 5+(pr_holyseek()/20);
|
||||
|
|
|
@ -36,7 +36,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CMaceAttack)
|
|||
{
|
||||
for (int j = 1; j >= -1; j -= 2)
|
||||
{
|
||||
angle = player->mo->angle + j*i*(ANG45 / 16);
|
||||
angle = player->mo->_f_angle() + j*i*(ANG45 / 16);
|
||||
slope = P_AimLineAttack(player->mo, angle, 2 * MELEERANGE, &t);
|
||||
if (t.linetarget)
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CMaceAttack)
|
|||
// didn't find any creatures, so try to strike any walls
|
||||
player->mo->weaponspecial = 0;
|
||||
|
||||
angle = player->mo->angle;
|
||||
angle = player->mo->_f_angle();
|
||||
slope = P_AimLineAttack (player->mo, angle, MELEERANGE);
|
||||
P_LineAttack (player->mo, angle, MELEERANGE, slope, damage, NAME_Melee, hammertime);
|
||||
macedone:
|
||||
|
|
|
@ -72,14 +72,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffCheck)
|
|||
{
|
||||
for (int j = 1; j >= -1; j -= 2)
|
||||
{
|
||||
angle = pmo->angle + j*i*(ANG45 / 16);
|
||||
angle = pmo->_f_angle() + j*i*(ANG45 / 16);
|
||||
slope = P_AimLineAttack(pmo, angle, fixed_t(1.5*MELEERANGE), &t, 0, ALF_CHECK3D);
|
||||
if (t.linetarget)
|
||||
{
|
||||
P_LineAttack(pmo, angle, fixed_t(1.5*MELEERANGE), slope, damage, NAME_Melee, puff, false, &t);
|
||||
if (t.linetarget != NULL)
|
||||
{
|
||||
pmo->angle = t.angleFromSource;
|
||||
pmo->Angles.Yaw = t.angleFromSource;
|
||||
if (((t.linetarget->player && (!t.linetarget->IsTeammate(pmo) || level.teamdamage != 0)) || t.linetarget->flags3&MF3_ISMONSTER)
|
||||
&& (!(t.linetarget->flags2&(MF2_DORMANT | MF2_INVULNERABLE))))
|
||||
{
|
||||
|
@ -131,12 +131,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_CStaffAttack)
|
|||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return 0;
|
||||
}
|
||||
mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(ACStaffMissile), self->angle-(ANG45/15));
|
||||
mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(ACStaffMissile), self->_f_angle()-(ANG45/15));
|
||||
if (mo)
|
||||
{
|
||||
mo->WeaveIndexXY = 32;
|
||||
}
|
||||
mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(ACStaffMissile), self->angle+(ANG45/15));
|
||||
mo = P_SpawnPlayerMissile (self, RUNTIME_CLASS(ACStaffMissile), self->_f_angle()+(ANG45/15));
|
||||
if (mo)
|
||||
{
|
||||
mo->WeaveIndexXY = 0;
|
||||
|
|
|
@ -22,12 +22,11 @@ DECLARE_ACTION(A_DragonFlight)
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
|
||||
static void DragonSeek (AActor *actor, DAngle thresh, DAngle turnMax)
|
||||
{
|
||||
int dir;
|
||||
int dist;
|
||||
angle_t delta;
|
||||
angle_t angle;
|
||||
DAngle delta;
|
||||
AActor *target;
|
||||
int i;
|
||||
angle_t bestAngle;
|
||||
|
@ -42,7 +41,7 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
|
|||
dir = P_FaceMobj (actor, target, &delta);
|
||||
if (delta > thresh)
|
||||
{
|
||||
delta >>= 1;
|
||||
delta /= 2;
|
||||
if (delta > turnMax)
|
||||
{
|
||||
delta = turnMax;
|
||||
|
@ -50,15 +49,14 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
|
|||
}
|
||||
if (dir)
|
||||
{ // Turn clockwise
|
||||
actor->angle += delta;
|
||||
actor->Angles.Yaw += delta;
|
||||
}
|
||||
else
|
||||
{ // Turn counter clockwise
|
||||
actor->angle -= delta;
|
||||
actor->Angles.Yaw -= delta;
|
||||
}
|
||||
angle = actor->angle>>ANGLETOFINESHIFT;
|
||||
actor->vel.x = FixedMul (actor->Speed, finecosine[angle]);
|
||||
actor->vel.y = FixedMul (actor->Speed, finesine[angle]);
|
||||
actor->VelFromAngle();
|
||||
|
||||
dist = actor->AproxDistance (target) / actor->Speed;
|
||||
if (actor->Top() < target->Z() ||
|
||||
target->Top() < actor->Z())
|
||||
|
@ -73,7 +71,7 @@ static void DragonSeek (AActor *actor, angle_t thresh, angle_t turnMax)
|
|||
{ // attack the destination mobj if it's attackable
|
||||
AActor *oldTarget;
|
||||
|
||||
if (absangle(actor->angle - actor->AngleTo(target)) < ANGLE_45/2)
|
||||
if (absangle(actor->_f_angle() - actor->AngleTo(target)) < ANGLE_45/2)
|
||||
{
|
||||
oldTarget = actor->target;
|
||||
actor->target = target;
|
||||
|
@ -184,7 +182,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFlight)
|
|||
|
||||
angle_t angle;
|
||||
|
||||
DragonSeek (self, 4*ANGLE_1, 8*ANGLE_1);
|
||||
DragonSeek (self, 4, 8);
|
||||
if (self->target)
|
||||
{
|
||||
if(!(self->target->flags&MF_SHOOTABLE))
|
||||
|
@ -193,14 +191,14 @@ DEFINE_ACTION_FUNCTION(AActor, A_DragonFlight)
|
|||
return 0;
|
||||
}
|
||||
angle = self->AngleTo(self->target);
|
||||
if (absangle(self->angle-angle) < ANGLE_45/2 && self->CheckMeleeRange())
|
||||
if (absangle(self->_f_angle()-angle) < ANGLE_45/2 && self->CheckMeleeRange())
|
||||
{
|
||||
int damage = pr_dragonflight.HitDice (8);
|
||||
int newdam = P_DamageMobj (self->target, self, self, damage, NAME_Melee);
|
||||
P_TraceBleed (newdam > 0 ? newdam : damage, self->target, self);
|
||||
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
|
||||
}
|
||||
else if (absangle(self->angle-angle) <= ANGLE_1*20)
|
||||
else if (absangle(self->_f_angle()-angle) <= ANGLE_1*20)
|
||||
{
|
||||
self->SetState (self->MissileState);
|
||||
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
|
||||
|
|
|
@ -236,7 +236,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeAttack)
|
|||
{
|
||||
for (int j = 1; j >= -1; j -= 2)
|
||||
{
|
||||
angle = pmo->angle + j*i*(ANG45 / 16);
|
||||
angle = pmo->_f_angle() + j*i*(ANG45 / 16);
|
||||
slope = P_AimLineAttack(pmo, angle, AXERANGE, &t);
|
||||
if (t.linetarget)
|
||||
{
|
||||
|
@ -257,7 +257,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FAxeAttack)
|
|||
// didn't find any creatures, so try to strike any walls
|
||||
pmo->weaponspecial = 0;
|
||||
|
||||
angle = pmo->angle;
|
||||
angle = pmo->_f_angle();
|
||||
slope = P_AimLineAttack (pmo, angle, MELEERANGE);
|
||||
P_LineAttack (pmo, angle, MELEERANGE, slope, damage, NAME_Melee, pufftype, true);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack)
|
|||
hammertime = PClass::FindActor("HammerPuff");
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
angle = pmo->angle + i*(ANG45/32);
|
||||
angle = pmo->_f_angle() + i*(ANG45/32);
|
||||
slope = P_AimLineAttack (pmo, angle, HAMMER_RANGE, &t, 0, ALF_CHECK3D);
|
||||
if (t.linetarget != NULL)
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack)
|
|||
goto hammerdone;
|
||||
}
|
||||
}
|
||||
angle = pmo->angle-i*(ANG45/32);
|
||||
angle = pmo->_f_angle()-i*(ANG45/32);
|
||||
slope = P_AimLineAttack(pmo, angle, HAMMER_RANGE, &t, 0, ALF_CHECK3D);
|
||||
if (t.linetarget != NULL)
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FHammerAttack)
|
|||
}
|
||||
}
|
||||
// didn't find any targets in meleerange, so set to throw out a hammer
|
||||
angle = pmo->angle;
|
||||
angle = pmo->_f_angle();
|
||||
slope = P_AimLineAttack (pmo, angle, HAMMER_RANGE, NULL, 0, ALF_CHECK3D);
|
||||
if (P_LineAttack (pmo, angle, HAMMER_RANGE, slope, damage, NAME_Melee, hammertime, true) != NULL)
|
||||
{
|
||||
|
|
|
@ -23,29 +23,25 @@ static FRandom pr_fpatk ("FPunchAttack");
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
#define MAX_ANGLE_ADJUST (5*ANGLE_1)
|
||||
#define MAX_ANGLE_ADJUST (5.)
|
||||
|
||||
void AdjustPlayerAngle (AActor *pmo, FTranslatedLineTarget *t)
|
||||
{
|
||||
angle_t angle;
|
||||
int difference;
|
||||
|
||||
angle = t->angleFromSource;
|
||||
difference = (int)angle - (int)pmo->angle;
|
||||
if (abs(difference) > MAX_ANGLE_ADJUST)
|
||||
DAngle difference = deltaangle(pmo->Angles.Yaw, t->angleFromSource);
|
||||
if (fabs(difference) > MAX_ANGLE_ADJUST)
|
||||
{
|
||||
if (difference > 0)
|
||||
{
|
||||
pmo->angle += MAX_ANGLE_ADJUST;
|
||||
pmo->Angles.Yaw += MAX_ANGLE_ADJUST;
|
||||
}
|
||||
else
|
||||
{
|
||||
pmo->angle -= MAX_ANGLE_ADJUST;
|
||||
pmo->Angles.Yaw -= MAX_ANGLE_ADJUST;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pmo->angle = angle;
|
||||
pmo->Angles.Yaw = t->angleFromSource;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,8 +112,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FPunchAttack)
|
|||
power = 2*FRACUNIT;
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
if (TryPunch(pmo, pmo->angle + i*(ANG45/16), damage, power) ||
|
||||
TryPunch(pmo, pmo->angle - i*(ANG45/16), damage, power))
|
||||
if (TryPunch(pmo, pmo->_f_angle() + i*(ANG45/16), damage, power) ||
|
||||
TryPunch(pmo, pmo->_f_angle() - i*(ANG45/16), damage, power))
|
||||
{ // hit something
|
||||
if (pmo->weaponspecial >= 3)
|
||||
{
|
||||
|
@ -131,7 +127,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FPunchAttack)
|
|||
// didn't find any creatures, so try to strike any walls
|
||||
pmo->weaponspecial = 0;
|
||||
|
||||
int slope = P_AimLineAttack (pmo, pmo->angle, MELEERANGE);
|
||||
P_LineAttack (pmo, pmo->angle, MELEERANGE, slope, damage, NAME_Melee, PClass::FindActor("PunchPuff"), true);
|
||||
int slope = P_AimLineAttack (pmo, pmo->_f_angle(), MELEERANGE);
|
||||
P_LineAttack (pmo, pmo->_f_angle(), MELEERANGE, slope, damage, NAME_Melee, PClass::FindActor("PunchPuff"), true);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -95,11 +95,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_FSwordAttack)
|
|||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return 0;
|
||||
}
|
||||
P_SpawnPlayerMissile (self, 0, 0, -10*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->angle+ANGLE_45/4);
|
||||
P_SpawnPlayerMissile (self, 0, 0, -5*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->angle+ANGLE_45/8);
|
||||
P_SpawnPlayerMissile (self, 0, 0, 0, RUNTIME_CLASS(AFSwordMissile), self->angle);
|
||||
P_SpawnPlayerMissile (self, 0, 0, 5*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->angle-ANGLE_45/8);
|
||||
P_SpawnPlayerMissile (self, 0, 0, 10*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->angle-ANGLE_45/4);
|
||||
P_SpawnPlayerMissile (self, 0, 0, -10*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->_f_angle()+ANGLE_45/4);
|
||||
P_SpawnPlayerMissile (self, 0, 0, -5*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->_f_angle()+ANGLE_45/8);
|
||||
P_SpawnPlayerMissile (self, 0, 0, 0, RUNTIME_CLASS(AFSwordMissile), self->_f_angle());
|
||||
P_SpawnPlayerMissile (self, 0, 0, 5*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->_f_angle()-ANGLE_45/8);
|
||||
P_SpawnPlayerMissile (self, 0, 0, 10*FRACUNIT, RUNTIME_CLASS(AFSwordMissile), self->_f_angle()-ANGLE_45/4);
|
||||
S_Sound (self, CHAN_WEAPON, "FighterSwordFire", 1, ATTN_NORM);
|
||||
return 0;
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FighterAttack)
|
|||
|
||||
if (!self->target) return 0;
|
||||
|
||||
angle_t angle = self->angle;
|
||||
angle_t angle = self->_f_angle();
|
||||
|
||||
P_SpawnMissileAngle (self, RUNTIME_CLASS(AFSwordMissile), angle+ANG45/4, 0);
|
||||
P_SpawnMissileAngle (self, RUNTIME_CLASS(AFSwordMissile), angle+ANG45/8, 0);
|
||||
|
|
|
@ -39,7 +39,7 @@ IMPLEMENT_CLASS (AArtiPoisonBag1)
|
|||
|
||||
bool AArtiPoisonBag1::Use (bool pickup)
|
||||
{
|
||||
angle_t angle = Owner->angle >> ANGLETOFINESHIFT;
|
||||
angle_t angle = Owner->_f_angle() >> ANGLETOFINESHIFT;
|
||||
AActor *mo;
|
||||
|
||||
mo = Spawn ("PoisonBag", Owner->Vec3Offset(
|
||||
|
@ -67,7 +67,7 @@ IMPLEMENT_CLASS (AArtiPoisonBag2)
|
|||
|
||||
bool AArtiPoisonBag2::Use (bool pickup)
|
||||
{
|
||||
angle_t angle = Owner->angle >> ANGLETOFINESHIFT;
|
||||
angle_t angle = Owner->_f_angle() >> ANGLETOFINESHIFT;
|
||||
AActor *mo;
|
||||
|
||||
mo = Spawn ("FireBomb", Owner->Vec3Offset(
|
||||
|
@ -100,12 +100,12 @@ bool AArtiPoisonBag3::Use (bool pickup)
|
|||
mo = Spawn("ThrowingBomb", Owner->PosPlusZ(-Owner->floorclip+35*FRACUNIT + (Owner->player? Owner->player->crouchoffset : 0)), ALLOW_REPLACE);
|
||||
if (mo)
|
||||
{
|
||||
mo->angle = Owner->angle + (((pr_poisonbag()&7) - 4) << 24);
|
||||
mo->Angles.Yaw = Owner->Angles.Yaw + (((pr_poisonbag() & 7) - 4) * 22.5f);
|
||||
|
||||
/* Original flight code from Hexen
|
||||
* mo->momz = 4*FRACUNIT+((player->lookdir)<<(FRACBITS-4));
|
||||
* mo->z += player->lookdir<<(FRACBITS-4);
|
||||
* P_ThrustMobj(mo, mo->angle, mo->info->speed);
|
||||
* P_ThrustMobj(mo, mo->_f_angle(), mo->info->speed);
|
||||
* mo->momx += player->mo->momx>>1;
|
||||
* mo->momy += player->mo->momy>>1;
|
||||
*/
|
||||
|
@ -114,9 +114,9 @@ bool AArtiPoisonBag3::Use (bool pickup)
|
|||
// is as set by the projectile. To accommodate this with a proper trajectory, we
|
||||
// aim the projectile ~20 degrees higher than we're looking at and increase the
|
||||
// speed we fire at accordingly.
|
||||
angle_t orgpitch = angle_t(-Owner->pitch) >> ANGLETOFINESHIFT;
|
||||
angle_t modpitch = angle_t(0xDC00000 - Owner->pitch) >> ANGLETOFINESHIFT;
|
||||
angle_t angle = mo->angle >> ANGLETOFINESHIFT;
|
||||
angle_t orgpitch = angle_t(-Owner->_f_pitch()) >> ANGLETOFINESHIFT;
|
||||
angle_t modpitch = angle_t(0xDC00000 - Owner->_f_pitch()) >> ANGLETOFINESHIFT;
|
||||
angle_t angle = mo->_f_angle() >> ANGLETOFINESHIFT;
|
||||
fixed_t speed = fixed_t(g_sqrt((double)mo->Speed*mo->Speed + (4.0*65536*4*65536)));
|
||||
fixed_t xyscale = FixedMul(speed, finecosine[modpitch]);
|
||||
|
||||
|
|
|
@ -84,9 +84,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_FlyBuzz)
|
|||
return 0;
|
||||
}
|
||||
|
||||
angle_t ang = self->AngleTo(targ);
|
||||
self->angle = ang;
|
||||
self->Angles.Yaw = self->_f_AngleTo(targ);
|
||||
self->args[0]++;
|
||||
angle_t ang = self->AngleTo(targ);
|
||||
ang >>= ANGLETOFINESHIFT;
|
||||
if (!P_TryMove(self, self->X() + 6 * finecosine[ang], self->Y() + 6 * finesine[ang], true))
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FogSpawn)
|
|||
{
|
||||
delta = self->args[1];
|
||||
if (delta==0) delta=1;
|
||||
mo->angle = self->angle + (((pr_fogspawn()%delta)-(delta>>1))<<24);
|
||||
mo->Angles.Yaw = self->Angles.Yaw + (((pr_fogspawn() % delta) - (delta >> 1)) * (360 / 256.));
|
||||
mo->target = self;
|
||||
if (self->args[0] < 1) self->args[0] = 1;
|
||||
mo->args[0] = (pr_fogspawn() % (self->args[0]))+1; // Random speed
|
||||
|
@ -94,7 +94,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FogMove)
|
|||
self->special2 = (weaveindex + 1) & 63;
|
||||
}
|
||||
|
||||
angle = self->angle>>ANGLETOFINESHIFT;
|
||||
angle = self->_f_angle()>>ANGLETOFINESHIFT;
|
||||
self->vel.x = FixedMul(speed, finecosine[angle]);
|
||||
self->vel.y = FixedMul(speed, finesine[angle]);
|
||||
return 0;
|
||||
|
|
|
@ -296,7 +296,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
|
|||
|
||||
baseangle = (angle_t)parent->special1;
|
||||
angle = baseangle + actor->AngleOffset;
|
||||
actor->angle = angle;
|
||||
actor->Angles.Yaw = ANGLE2FLOAT(angle);
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
|
||||
switch (mode)
|
||||
|
@ -318,13 +318,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
|
|||
case SORC_STOPPING: // Balls stopping
|
||||
if ((parent->StopBall == actor->GetClass()) &&
|
||||
(parent->args[1] > SORCBALL_SPEED_ROTATIONS) &&
|
||||
(absangle(angle - (parent->angle>>ANGLETOFINESHIFT)) < (30<<5)))
|
||||
(absangle(angle - (parent->_f_angle()>>ANGLETOFINESHIFT)) < (30<<5)))
|
||||
{
|
||||
// Can stop now
|
||||
actor->target->args[3] = SORC_FIRESPELL;
|
||||
actor->target->args[4] = 0;
|
||||
// Set angle so self angle == sorcerer angle
|
||||
parent->special1 = (int)(parent->angle - actor->AngleOffset);
|
||||
parent->special1 = (int)(parent->_f_angle() - actor->AngleOffset);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -573,8 +573,8 @@ void ASorcBall3::CastSorcererSpell ()
|
|||
angle_t ang1, ang2;
|
||||
AActor *parent = target;
|
||||
|
||||
ang1 = angle - ANGLE_45;
|
||||
ang2 = angle + ANGLE_45;
|
||||
ang1 = FLOAT2ANGLE(Angles.Yaw.Degrees) - ANGLE_45;
|
||||
ang2 = FLOAT2ANGLE(Angles.Yaw.Degrees) + ANGLE_45;
|
||||
PClassActor *cls = PClass::FindActor("SorcFX3");
|
||||
if (health < (SpawnHealth()/3))
|
||||
{ // Spawn 2 at a time
|
||||
|
@ -622,8 +622,8 @@ void ASorcBall1::CastSorcererSpell ()
|
|||
angle_t ang1, ang2;
|
||||
AActor *parent = target;
|
||||
|
||||
ang1 = angle + ANGLE_1*70;
|
||||
ang2 = angle - ANGLE_1*70;
|
||||
ang1 = FLOAT2ANGLE(Angles.Yaw.Degrees) + ANGLE_1*70;
|
||||
ang2 = FLOAT2ANGLE(Angles.Yaw.Degrees) - ANGLE_1*70;
|
||||
PClassActor *cls = PClass::FindActor("SorcFX1");
|
||||
mo = P_SpawnMissileAngle (parent, cls, ang1, 0);
|
||||
if (mo)
|
||||
|
@ -670,7 +670,7 @@ void A_SorcOffense2(AActor *actor)
|
|||
actor->args[4] = (actor->args[4] + 15) & 255;
|
||||
delta = (finesine[index])*SORCFX4_SPREAD_ANGLE;
|
||||
delta = (delta>>FRACBITS)*ANGLE_1;
|
||||
ang1 = actor->angle + delta;
|
||||
ang1 = actor->_f_angle() + delta;
|
||||
mo = P_SpawnMissileAngle(parent, PClass::FindActor("SorcFX4"), ang1, 0);
|
||||
if (mo)
|
||||
{
|
||||
|
@ -715,13 +715,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnFizzle)
|
|||
AActor *mo;
|
||||
int ix;
|
||||
|
||||
fixedvec3 pos = self->Vec3Angle(dist, self->angle, -self->floorclip + (self->height >> 1));
|
||||
fixedvec3 pos = self->Vec3Angle(dist, self->_f_angle(), -self->floorclip + (self->height >> 1));
|
||||
for (ix=0; ix<5; ix++)
|
||||
{
|
||||
mo = Spawn("SorcSpark1", pos, ALLOW_REPLACE);
|
||||
if (mo)
|
||||
{
|
||||
rangle = (self->angle >> ANGLETOFINESHIFT) + ((pr_heresiarch()%5) << 1);
|
||||
rangle = (self->_f_angle() >> ANGLETOFINESHIFT) + ((pr_heresiarch()%5) << 1);
|
||||
mo->vel.x = FixedMul(pr_heresiarch()%speed, finecosine[rangle]);
|
||||
mo->vel.y = FixedMul(pr_heresiarch()%speed, finesine[rangle]);
|
||||
mo->vel.z = FRACUNIT*2;
|
||||
|
@ -776,7 +776,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Split)
|
|||
{
|
||||
mo->target = self->target;
|
||||
mo->args[0] = 0; // CW
|
||||
mo->special1 = self->angle; // Set angle
|
||||
mo->special1 = self->_f_angle(); // Set angle
|
||||
mo->SetState (mo->FindState("Orbit"));
|
||||
}
|
||||
mo = Spawn(self->GetClass(), self->Pos(), NO_REPLACE);
|
||||
|
@ -784,7 +784,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcFX2Split)
|
|||
{
|
||||
mo->target = self->target;
|
||||
mo->args[0] = 1; // CCW
|
||||
mo->special1 = self->angle; // Set angle
|
||||
mo->special1 = self->_f_angle(); // Set angle
|
||||
mo->SetState (mo->FindState("Orbit"));
|
||||
}
|
||||
self->Destroy ();
|
||||
|
|
|
@ -117,7 +117,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_PotteryCheck)
|
|||
if (playeringame[i])
|
||||
{
|
||||
AActor *pmo = players[i].mo;
|
||||
if (P_CheckSight (self, pmo) && (absangle(pmo->AngleTo(self) - pmo->angle) <= ANGLE_45))
|
||||
if (P_CheckSight (self, pmo) && (absangle(pmo->AngleTo(self) - pmo->_f_angle()) <= ANGLE_45))
|
||||
{ // Previous state (pottery bit waiting state)
|
||||
self->SetState (self->state - 1);
|
||||
return 0;
|
||||
|
@ -222,7 +222,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafSpawn)
|
|||
|
||||
if (mo)
|
||||
{
|
||||
P_ThrustMobj (mo, self->angle, (pr_leaf()<<9)+3*FRACUNIT);
|
||||
P_ThrustMobj (mo, self->_f_angle(), (pr_leaf()<<9)+3*FRACUNIT);
|
||||
mo->target = self;
|
||||
mo->special1 = 0;
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_LeafCheck)
|
|||
self->SetState (NULL);
|
||||
return 0;
|
||||
}
|
||||
angle_t ang = self->target ? self->target->angle : self->angle;
|
||||
angle_t ang = self->target ? self->target->_f_angle() : self->_f_angle();
|
||||
if (pr_leafcheck() > 64)
|
||||
{
|
||||
if (!self->vel.x && !self->vel.y)
|
||||
|
|
|
@ -35,7 +35,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyLook)
|
|||
if (pr_iceguylook() < 64)
|
||||
{
|
||||
dist = ((pr_iceguylook()-128)*self->radius)>>7;
|
||||
an = (self->angle+ANG90)>>ANGLETOFINESHIFT;
|
||||
an = (self->_f_angle()+ANG90)>>ANGLETOFINESHIFT;
|
||||
|
||||
Spawn(WispTypes[pr_iceguylook() & 1], self->Vec3Offset(
|
||||
FixedMul(dist, finecosine[an]),
|
||||
|
@ -63,7 +63,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyChase)
|
|||
if (pr_iceguychase() < 128)
|
||||
{
|
||||
dist = ((pr_iceguychase()-128)*self->radius)>>7;
|
||||
an = (self->angle+ANG90)>>ANGLETOFINESHIFT;
|
||||
an = (self->_f_angle()+ANG90)>>ANGLETOFINESHIFT;
|
||||
|
||||
mo = Spawn(WispTypes[pr_iceguychase() & 1], self->Vec3Offset(
|
||||
FixedMul(dist, finecosine[an]),
|
||||
|
@ -94,8 +94,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_IceGuyAttack)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
P_SpawnMissileXYZ(self->Vec3Angle(self->radius>>1, self->angle+ANG90, 40*FRACUNIT), self, self->target, PClass::FindActor ("IceGuyFX"));
|
||||
P_SpawnMissileXYZ(self->Vec3Angle(self->radius>>1, self->angle-ANG90, 40*FRACUNIT), self, self->target, PClass::FindActor ("IceGuyFX"));
|
||||
P_SpawnMissileXYZ(self->Vec3Angle(self->radius>>1, self->_f_angle()+ANG90, 40*FRACUNIT), self, self->target, PClass::FindActor ("IceGuyFX"));
|
||||
P_SpawnMissileXYZ(self->Vec3Angle(self->radius>>1, self->_f_angle()-ANG90, 40*FRACUNIT), self, self->target, PClass::FindActor ("IceGuyFX"));
|
||||
S_Sound (self, CHAN_WEAPON, self->AttackSound, 1, ATTN_NORM);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxChase)
|
|||
spot = iterator.Next ();
|
||||
if (spot != NULL)
|
||||
{
|
||||
P_Teleport (self, spot->X(), spot->Y(), ONFLOORZ, spot->angle, TELF_SOURCEFOG | TELF_DESTFOG);
|
||||
P_Teleport (self, spot->X(), spot->Y(), ONFLOORZ, spot->Angles.Yaw, TELF_SOURCEFOG | TELF_DESTFOG);
|
||||
}
|
||||
|
||||
P_StartScript (self, NULL, 249, NULL, NULL, 0, 0);
|
||||
|
@ -141,7 +141,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxChase)
|
|||
self->tracer = spot;
|
||||
if (spot)
|
||||
{
|
||||
P_Teleport (self, spot->X(), spot->Y(), ONFLOORZ, spot->angle, TELF_SOURCEFOG | TELF_DESTFOG);
|
||||
P_Teleport (self, spot->X(), spot->Y(), ONFLOORZ, spot->Angles.Yaw, TELF_SOURCEFOG | TELF_DESTFOG);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -273,7 +273,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KoraxCommand)
|
|||
S_Sound (self, CHAN_VOICE, "KoraxCommand", 1, ATTN_NORM);
|
||||
|
||||
// Shoot stream of lightning to ceiling
|
||||
ang = (self->angle - ANGLE_90) >> ANGLETOFINESHIFT;
|
||||
ang = (self->_f_angle() - ANGLE_90) >> ANGLETOFINESHIFT;
|
||||
fixedvec3 pos = self->Vec3Offset(
|
||||
KORAX_COMMAND_OFFSET * finecosine[ang],
|
||||
KORAX_COMMAND_OFFSET * finesine[ang],
|
||||
|
@ -331,7 +331,7 @@ void KoraxFire (AActor *actor, PClassActor *type, int arm)
|
|||
|
||||
angle_t ang;
|
||||
|
||||
ang = (actor->angle + (arm < 3 ? -KORAX_DELTAANGLE : KORAX_DELTAANGLE)) >> ANGLETOFINESHIFT;
|
||||
ang = (actor->_f_angle() + (arm < 3 ? -KORAX_DELTAANGLE : KORAX_DELTAANGLE)) >> ANGLETOFINESHIFT;
|
||||
fixedvec3 pos = actor->Vec3Offset(
|
||||
extension[arm] * finecosine[ang],
|
||||
extension[arm] * finesine[ang],
|
||||
|
@ -354,12 +354,11 @@ void CHolyWeave (AActor *actor, FRandom &pr_random);
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
void A_KSpiritSeeker (AActor *actor, angle_t thresh, angle_t turnMax)
|
||||
static void A_KSpiritSeeker (AActor *actor, DAngle thresh, DAngle turnMax)
|
||||
{
|
||||
int dir;
|
||||
int dist;
|
||||
angle_t delta;
|
||||
angle_t angle;
|
||||
DAngle delta;
|
||||
AActor *target;
|
||||
fixed_t newZ;
|
||||
fixed_t deltaZ;
|
||||
|
@ -372,7 +371,7 @@ void A_KSpiritSeeker (AActor *actor, angle_t thresh, angle_t turnMax)
|
|||
dir = P_FaceMobj (actor, target, &delta);
|
||||
if (delta > thresh)
|
||||
{
|
||||
delta >>= 1;
|
||||
delta /= 2;
|
||||
if(delta > turnMax)
|
||||
{
|
||||
delta = turnMax;
|
||||
|
@ -380,15 +379,13 @@ void A_KSpiritSeeker (AActor *actor, angle_t thresh, angle_t turnMax)
|
|||
}
|
||||
if(dir)
|
||||
{ // Turn clockwise
|
||||
actor->angle += delta;
|
||||
actor->Angles.Yaw += delta;
|
||||
}
|
||||
else
|
||||
{ // Turn counter clockwise
|
||||
actor->angle -= delta;
|
||||
actor->Angles.Yaw -= delta;
|
||||
}
|
||||
angle = actor->angle>>ANGLETOFINESHIFT;
|
||||
actor->vel.x = FixedMul (actor->Speed, finecosine[angle]);
|
||||
actor->vel.y = FixedMul (actor->Speed, finesine[angle]);
|
||||
actor->VelFromAngle();
|
||||
|
||||
if (!(level.time&15)
|
||||
|| actor->Z() > target->Z()+(target->GetDefault()->height)
|
||||
|
@ -436,8 +433,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_KSpiritRoam)
|
|||
{
|
||||
if (self->tracer)
|
||||
{
|
||||
A_KSpiritSeeker (self, self->args[0]*ANGLE_1,
|
||||
self->args[0]*ANGLE_1*2);
|
||||
A_KSpiritSeeker(self, self->args[0], self->args[0] * 2);
|
||||
}
|
||||
CHolyWeave(self, pr_kspiritweave);
|
||||
if (pr_kspiritroam()<50)
|
||||
|
@ -507,7 +503,7 @@ AActor *P_SpawnKoraxMissile (fixed_t x, fixed_t y, fixed_t z,
|
|||
AActor *source, AActor *dest, PClassActor *type)
|
||||
{
|
||||
AActor *th;
|
||||
angle_t an;
|
||||
DAngle an;
|
||||
int dist;
|
||||
|
||||
z -= source->floorclip;
|
||||
|
@ -516,12 +512,10 @@ AActor *P_SpawnKoraxMissile (fixed_t x, fixed_t y, fixed_t z,
|
|||
an = th->AngleTo(dest);
|
||||
if (dest->flags & MF_SHADOW)
|
||||
{ // Invisible target
|
||||
an += pr_kmissile.Random2()<<21;
|
||||
an += pr_missile.Random2() * (45/256.);
|
||||
}
|
||||
th->angle = an;
|
||||
an >>= ANGLETOFINESHIFT;
|
||||
th->vel.x = FixedMul (th->Speed, finecosine[an]);
|
||||
th->vel.y = FixedMul (th->Speed, finesine[an]);
|
||||
th->Angles.Yaw = an;
|
||||
th->VelFromAngle();
|
||||
dist = dest->AproxDistance (th) / th->Speed;
|
||||
if (dist < 1)
|
||||
{
|
||||
|
|
|
@ -78,11 +78,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireConePL1)
|
|||
damage = 90+(pr_cone()&15);
|
||||
for (i = 0; i < 16; i++)
|
||||
{
|
||||
angle = self->angle+i*(ANG45/16);
|
||||
angle = self->_f_angle()+i*(ANG45/16);
|
||||
slope = P_AimLineAttack (self, angle, MELEERANGE, &t, 0, ALF_CHECK3D);
|
||||
if (t.linetarget)
|
||||
{
|
||||
P_DamageMobj (t.linetarget, self, self, damage, NAME_Ice, DMG_USEANGLE, t.angleFromSource);
|
||||
P_DamageMobj (t.linetarget, self, self, damage, NAME_Ice, DMG_USEANGLE, FLOAT2ANGLE(t.angleFromSource.Degrees));
|
||||
conedone = true;
|
||||
break;
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
|
|||
// every so many calls, spawn a new missile in its set directions
|
||||
if (spawndir & SHARDSPAWN_LEFT)
|
||||
{
|
||||
mo = P_SpawnMissileAngleZSpeed (self, self->Z(), RUNTIME_CLASS(AFrostMissile), self->angle+(ANG45/9),
|
||||
mo = P_SpawnMissileAngleZSpeed (self, self->Z(), RUNTIME_CLASS(AFrostMissile), self->_f_angle()+(ANG45/9),
|
||||
0, (20+2*spermcount)<<FRACBITS, self->target);
|
||||
if (mo)
|
||||
{
|
||||
|
@ -140,7 +140,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
|
|||
}
|
||||
if (spawndir & SHARDSPAWN_RIGHT)
|
||||
{
|
||||
mo = P_SpawnMissileAngleZSpeed (self, self->Z(), RUNTIME_CLASS(AFrostMissile), self->angle-(ANG45/9),
|
||||
mo = P_SpawnMissileAngleZSpeed (self, self->Z(), RUNTIME_CLASS(AFrostMissile), self->_f_angle()-(ANG45/9),
|
||||
0, (20+2*spermcount)<<FRACBITS, self->target);
|
||||
if (mo)
|
||||
{
|
||||
|
@ -152,7 +152,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
|
|||
}
|
||||
if (spawndir & SHARDSPAWN_UP)
|
||||
{
|
||||
mo = P_SpawnMissileAngleZSpeed (self, self->Z()+8*FRACUNIT, RUNTIME_CLASS(AFrostMissile), self->angle,
|
||||
mo = P_SpawnMissileAngleZSpeed (self, self->Z()+8*FRACUNIT, RUNTIME_CLASS(AFrostMissile), self->_f_angle(),
|
||||
0, (15+2*spermcount)<<FRACBITS, self->target);
|
||||
if (mo)
|
||||
{
|
||||
|
@ -167,7 +167,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShedShard)
|
|||
}
|
||||
if (spawndir & SHARDSPAWN_DOWN)
|
||||
{
|
||||
mo = P_SpawnMissileAngleZSpeed (self, self->Z()-4*FRACUNIT, RUNTIME_CLASS(AFrostMissile), self->angle,
|
||||
mo = P_SpawnMissileAngleZSpeed (self, self->Z()-4*FRACUNIT, RUNTIME_CLASS(AFrostMissile), self->_f_angle(),
|
||||
0, (15+2*spermcount)<<FRACBITS, self->target);
|
||||
if (mo)
|
||||
{
|
||||
|
|
|
@ -170,19 +170,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
|
|||
zigZag = pr_lightningclip();
|
||||
if((zigZag > 128 && self->special1 < 2) || self->special1 < -2)
|
||||
{
|
||||
P_ThrustMobj(self, self->angle+ANG90, ZAGSPEED);
|
||||
P_ThrustMobj(self, self->_f_angle()+ANG90, ZAGSPEED);
|
||||
if(cMo)
|
||||
{
|
||||
P_ThrustMobj(cMo, self->angle+ANG90, ZAGSPEED);
|
||||
P_ThrustMobj(cMo, self->_f_angle()+ANG90, ZAGSPEED);
|
||||
}
|
||||
self->special1++;
|
||||
}
|
||||
else
|
||||
{
|
||||
P_ThrustMobj(self, self->angle-ANG90, ZAGSPEED);
|
||||
P_ThrustMobj(self, self->_f_angle()-ANG90, ZAGSPEED);
|
||||
if(cMo)
|
||||
{
|
||||
P_ThrustMobj(cMo, cMo->angle-ANG90, ZAGSPEED);
|
||||
P_ThrustMobj(cMo, cMo->_f_angle()-ANG90, ZAGSPEED);
|
||||
}
|
||||
self->special1--;
|
||||
}
|
||||
|
@ -195,10 +195,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_LightningClip)
|
|||
}
|
||||
else
|
||||
{
|
||||
self->angle = self->AngleTo(target);
|
||||
self->Angles.Yaw = self->_f_AngleTo(target);
|
||||
self->vel.x = 0;
|
||||
self->vel.y = 0;
|
||||
P_ThrustMobj (self, self->angle, self->Speed>>1);
|
||||
P_ThrustMobj (self, self->Angles.Yaw, self->Speed>>1);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -139,7 +139,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MStaffAttack)
|
|||
if (!weapon->DepleteAmmo (weapon->bAltFire))
|
||||
return 0;
|
||||
}
|
||||
angle = self->angle;
|
||||
angle = self->_f_angle();
|
||||
|
||||
// [RH] Let's try and actually track what the player aimed at
|
||||
P_AimLineAttack (self, angle, PLAYERMISSILERANGE, &t, ANGLE_1*32);
|
||||
|
@ -258,7 +258,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MageAttack)
|
|||
return 0;
|
||||
}
|
||||
angle_t angle;
|
||||
angle = self->angle;
|
||||
angle = self->_f_angle();
|
||||
MStaffSpawn2 (self, angle);
|
||||
MStaffSpawn2 (self, angle-ANGLE_1*5);
|
||||
MStaffSpawn2 (self, angle+ANGLE_1*5);
|
||||
|
|
|
@ -73,7 +73,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SnoutAttack)
|
|||
}
|
||||
|
||||
damage = 3+(pr_snoutattack()&3);
|
||||
angle = player->mo->angle;
|
||||
angle = player->mo->_f_angle();
|
||||
slope = P_AimLineAttack(player->mo, angle, MELEERANGE);
|
||||
puff = P_LineAttack(player->mo, angle, MELEERANGE, slope, damage, NAME_Melee, "SnoutPuff", true, &t);
|
||||
S_Sound(player->mo, CHAN_VOICE, "PigActive", 1, ATTN_NORM);
|
||||
|
|
|
@ -55,7 +55,7 @@ static void TeloSpawn (AActor *source, const char *type)
|
|||
if (fx)
|
||||
{
|
||||
fx->special1 = TELEPORT_LIFE; // Lifetime countdown
|
||||
fx->angle = source->angle;
|
||||
fx->Angles.Yaw = source->Angles.Yaw;
|
||||
fx->target = source->target;
|
||||
fx->vel.x = source->vel.x >> 1;
|
||||
fx->vel.y = source->vel.y >> 1;
|
||||
|
@ -167,13 +167,11 @@ int ATelOtherFX1::DoSpecialDamage (AActor *target, int damage, FName damagetype)
|
|||
void P_TeleportToPlayerStarts (AActor *victim)
|
||||
{
|
||||
fixed_t destX,destY;
|
||||
angle_t destAngle;
|
||||
|
||||
FPlayerStart *start = G_PickPlayerStart(0, PPS_FORCERANDOM | PPS_NOBLOCKINGCHECK);
|
||||
destX = start->x;
|
||||
destY = start->y;
|
||||
destAngle = ANG45 * (start->angle/45);
|
||||
P_Teleport (victim, destX, destY, ONFLOORZ, destAngle, TELF_SOURCEFOG | TELF_DESTFOG);
|
||||
P_Teleport (victim, destX, destY, ONFLOORZ, start->angle, TELF_SOURCEFOG | TELF_DESTFOG);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -186,7 +184,6 @@ void P_TeleportToDeathmatchStarts (AActor *victim)
|
|||
{
|
||||
unsigned int i, selections;
|
||||
fixed_t destX,destY;
|
||||
angle_t destAngle;
|
||||
|
||||
selections = deathmatchstarts.Size ();
|
||||
if (selections > 0)
|
||||
|
@ -194,8 +191,7 @@ void P_TeleportToDeathmatchStarts (AActor *victim)
|
|||
i = pr_teledm() % selections;
|
||||
destX = deathmatchstarts[i].x;
|
||||
destY = deathmatchstarts[i].y;
|
||||
destAngle = ANG45 * (deathmatchstarts[i].angle/45);
|
||||
P_Teleport (victim, destX, destY, ONFLOORZ, destAngle, TELF_SOURCEFOG | TELF_DESTFOG);
|
||||
P_Teleport (victim, destX, destY, ONFLOORZ, deathmatchstarts[i].angle, TELF_SOURCEFOG | TELF_DESTFOG);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -129,11 +129,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_WraithFX2)
|
|||
{
|
||||
if (pr_wraithfx2 ()<128)
|
||||
{
|
||||
angle = self->angle+(pr_wraithfx2()<<22);
|
||||
angle = self->_f_angle()+(pr_wraithfx2()<<22);
|
||||
}
|
||||
else
|
||||
{
|
||||
angle = self->angle-(pr_wraithfx2()<<22);
|
||||
angle = self->_f_angle()-(pr_wraithfx2()<<22);
|
||||
}
|
||||
mo->vel.z = 0;
|
||||
mo->vel.x = FixedMul((pr_wraithfx2()<<7)+FRACUNIT,
|
||||
|
|
|
@ -1240,8 +1240,7 @@ void G_FinishTravel ()
|
|||
{
|
||||
if (!(changeflags & CHANGELEVEL_KEEPFACING))
|
||||
{
|
||||
pawn->angle = pawndup->angle;
|
||||
pawn->pitch = pawndup->pitch;
|
||||
pawn->Angles = pawndup->Angles;
|
||||
}
|
||||
pawn->SetXYZ(pawndup->X(), pawndup->Y(), pawndup->Z());
|
||||
pawn->vel.x = pawndup->vel.x;
|
||||
|
|
|
@ -29,7 +29,7 @@ bool AArtiTeleport::Use (bool pickup)
|
|||
{
|
||||
fixed_t destX;
|
||||
fixed_t destY;
|
||||
angle_t destAngle;
|
||||
int destAngle;
|
||||
|
||||
if (deathmatch)
|
||||
{
|
||||
|
@ -37,14 +37,14 @@ bool AArtiTeleport::Use (bool pickup)
|
|||
unsigned int i = pr_tele() % selections;
|
||||
destX = deathmatchstarts[i].x;
|
||||
destY = deathmatchstarts[i].y;
|
||||
destAngle = ANG45 * (deathmatchstarts[i].angle/45);
|
||||
destAngle = deathmatchstarts[i].angle;
|
||||
}
|
||||
else
|
||||
{
|
||||
FPlayerStart *start = G_PickPlayerStart(int(Owner->player - players));
|
||||
destX = start->x;
|
||||
destY = start->y;
|
||||
destAngle = ANG45 * (start->angle/45);
|
||||
destAngle = start->angle;
|
||||
}
|
||||
P_Teleport (Owner, destX, destY, ONFLOORZ, destAngle, TELF_SOURCEFOG | TELF_DESTFOG);
|
||||
bool canlaugh = true;
|
||||
|
|
|
@ -210,7 +210,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurDecide)
|
|||
self->flags2 |= MF2_INVULNERABLE;
|
||||
}
|
||||
A_FaceTarget (self);
|
||||
angle = self->angle>>ANGLETOFINESHIFT;
|
||||
angle = self->_f_angle()>>ANGLETOFINESHIFT;
|
||||
self->vel.x = FixedMul (MNTR_CHARGE_SPEED, finecosine[angle]);
|
||||
self->vel.y = FixedMul (MNTR_CHARGE_SPEED, finesine[angle]);
|
||||
self->special1 = TICRATE/2; // Charge duration
|
||||
|
@ -312,7 +312,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MinotaurAtk2)
|
|||
{
|
||||
// S_Sound (mo, CHAN_WEAPON, "minotaur/attack2", 1, ATTN_NORM);
|
||||
vz = mo->vel.z;
|
||||
angle = mo->angle;
|
||||
angle = mo->_f_angle();
|
||||
P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/8), vz);
|
||||
P_SpawnMissileAngleZ (self, z, fx, angle+(ANG45/8), vz);
|
||||
P_SpawnMissileAngleZ (self, z, fx, angle-(ANG45/16), vz);
|
||||
|
|
|
@ -315,7 +315,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
|
|||
head->vel.x = pr_freeze.Random2 () << (FRACBITS-7);
|
||||
head->vel.y = pr_freeze.Random2 () << (FRACBITS-7);
|
||||
head->health = self->health;
|
||||
head->angle = self->angle;
|
||||
head->Angles.Yaw = self->Angles.Yaw;
|
||||
if (head->IsKindOf(RUNTIME_CLASS(APlayerPawn)))
|
||||
{
|
||||
head->player = self->player;
|
||||
|
@ -323,7 +323,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FreezeDeathChunks)
|
|||
self->player = NULL;
|
||||
head->ObtainInventory (self);
|
||||
}
|
||||
head->pitch = 0;
|
||||
head->Angles.Pitch = 0;
|
||||
head->RenderStyle = self->RenderStyle;
|
||||
head->alpha = self->alpha;
|
||||
if (head->player->camera == self)
|
||||
|
@ -638,32 +638,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_LowGravity)
|
|||
|
||||
void FaceMovementDirection (AActor *actor)
|
||||
{
|
||||
switch (actor->movedir)
|
||||
if (actor->movedir >= DI_EAST && actor->movedir <= DI_NORTHEAST)
|
||||
{
|
||||
case DI_EAST:
|
||||
actor->angle = 0<<24;
|
||||
break;
|
||||
case DI_NORTHEAST:
|
||||
actor->angle = 32<<24;
|
||||
break;
|
||||
case DI_NORTH:
|
||||
actor->angle = 64<<24;
|
||||
break;
|
||||
case DI_NORTHWEST:
|
||||
actor->angle = 96<<24;
|
||||
break;
|
||||
case DI_WEST:
|
||||
actor->angle = 128<<24;
|
||||
break;
|
||||
case DI_SOUTHWEST:
|
||||
actor->angle = 160<<24;
|
||||
break;
|
||||
case DI_SOUTH:
|
||||
actor->angle = 192<<24;
|
||||
break;
|
||||
case DI_SOUTHEAST:
|
||||
actor->angle = 224<<24;
|
||||
break;
|
||||
actor->Angles.Yaw = 45. * actor->movedir;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1267,7 +1267,7 @@ void APowerSpeed::DoEffect ()
|
|||
AActor *speedMo = Spawn<APlayerSpeedTrail> (Owner->Pos(), NO_REPLACE);
|
||||
if (speedMo)
|
||||
{
|
||||
speedMo->angle = Owner->angle;
|
||||
speedMo->Angles.Yaw = Owner->Angles.Yaw;
|
||||
speedMo->Translation = Owner->Translation;
|
||||
speedMo->target = Owner;
|
||||
speedMo->sprite = Owner->sprite;
|
||||
|
|
|
@ -101,18 +101,18 @@ DEFINE_ACTION_FUNCTION(AActor, A_BridgeOrbit)
|
|||
}
|
||||
// Set default values
|
||||
// Every five tics, Hexen moved the ball 3/256th of a revolution.
|
||||
int rotationspeed = ANGLE_45/32*3/5;
|
||||
int rotationradius = ORBIT_RADIUS * FRACUNIT;
|
||||
DAngle rotationspeed = 45./32*3/5;
|
||||
int rotationradius = ORBIT_RADIUS;
|
||||
// If the bridge is custom, set non-default values if any.
|
||||
|
||||
// Set angular speed; 1--128: counterclockwise rotation ~=1--180°; 129--255: clockwise rotation ~= 180--1°
|
||||
if (self->target->args[3] > 128) rotationspeed = ANGLE_45/32 * (self->target->args[3]-256) / TICRATE;
|
||||
else if (self->target->args[3] > 0) rotationspeed = ANGLE_45/32 * (self->target->args[3]) / TICRATE;
|
||||
if (self->target->args[3] > 128) rotationspeed = 45./32 * (self->target->args[3]-256) / TICRATE;
|
||||
else if (self->target->args[3] > 0) rotationspeed = 45./32 * (self->target->args[3]) / TICRATE;
|
||||
// Set rotation radius
|
||||
if (self->target->args[4]) rotationradius = ((self->target->args[4] * self->target->radius) / 100);
|
||||
|
||||
self->angle += rotationspeed;
|
||||
self->SetOrigin(self->target->Vec3Angle(rotationradius, self->angle, 0), true);
|
||||
self->Angles.Yaw += rotationspeed;
|
||||
self->SetOrigin(self->target->Vec3Angle(rotationradius, self->_f_angle(), 0), true);
|
||||
self->floorz = self->target->floorz;
|
||||
self->ceilingz = self->target->ceilingz;
|
||||
return 0;
|
||||
|
@ -124,7 +124,6 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BridgeInit)
|
|||
PARAM_ACTION_PROLOGUE;
|
||||
PARAM_CLASS_OPT(balltype, AActor) { balltype = NULL; }
|
||||
|
||||
angle_t startangle;
|
||||
AActor *ball;
|
||||
|
||||
if (balltype == NULL)
|
||||
|
@ -132,7 +131,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BridgeInit)
|
|||
balltype = PClass::FindActor("BridgeBall");
|
||||
}
|
||||
|
||||
startangle = pr_orbit() << 24;
|
||||
DAngle startangle = pr_orbit() * (360./256.);
|
||||
|
||||
// Spawn triad into world -- may be more than a triad now.
|
||||
int ballcount = self->args[2]==0 ? 3 : self->args[2];
|
||||
|
@ -140,7 +139,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BridgeInit)
|
|||
for (int i = 0; i < ballcount; i++)
|
||||
{
|
||||
ball = Spawn(balltype, self->Pos(), ALLOW_REPLACE);
|
||||
ball->angle = startangle + (ANGLE_45/32) * (256/ballcount) * i;
|
||||
ball->Angles.Yaw = startangle + (45./32) * (256/ballcount) * i;
|
||||
ball->target = self;
|
||||
CALL_ACTION(A_BridgeOrbit, ball);
|
||||
}
|
||||
|
|
|
@ -57,10 +57,10 @@ public:
|
|||
|
||||
void Serialize (FArchive &arc);
|
||||
protected:
|
||||
angle_t Center;
|
||||
angle_t Acc;
|
||||
angle_t Delta;
|
||||
angle_t Range;
|
||||
DAngle Center;
|
||||
DAngle Acc;
|
||||
DAngle Delta;
|
||||
DAngle Range;
|
||||
};
|
||||
|
||||
IMPLEMENT_CLASS (ASecurityCamera)
|
||||
|
@ -74,29 +74,25 @@ void ASecurityCamera::Serialize (FArchive &arc)
|
|||
void ASecurityCamera::PostBeginPlay ()
|
||||
{
|
||||
Super::PostBeginPlay ();
|
||||
Center = angle;
|
||||
Center = Angles.Yaw;
|
||||
if (args[2])
|
||||
Delta = ANGLE_MAX / (args[2] * TICRATE / 8);
|
||||
Delta = 360. / (args[2] * TICRATE / 8);
|
||||
else
|
||||
Delta = 0;
|
||||
if (args[1])
|
||||
Delta /= 2;
|
||||
Acc = 0;
|
||||
pitch = (signed int)((char)args[0]) * ANGLE_1;
|
||||
if (pitch <= -ANGLE_90)
|
||||
pitch = -ANGLE_90 + ANGLE_1;
|
||||
else if (pitch >= ANGLE_90)
|
||||
pitch = ANGLE_90 - ANGLE_1;
|
||||
Range = FLOAT2ANGLE(args[1]);
|
||||
Angles.Pitch = clamp<int>((signed int)((signed char)args[0]), -89, 89);
|
||||
Range = args[1];
|
||||
}
|
||||
|
||||
void ASecurityCamera::Tick ()
|
||||
{
|
||||
Acc += Delta;
|
||||
if (Range)
|
||||
angle = Center + FixedMul (Range, finesine[Acc >> ANGLETOFINESHIFT]);
|
||||
else if (Delta)
|
||||
angle = Acc;
|
||||
if (Range != 0)
|
||||
Angles.Yaw = Center + Range * Acc.Sin();
|
||||
else if (Delta != 0)
|
||||
Angles.Yaw = Acc;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -120,7 +116,7 @@ public:
|
|||
|
||||
void Serialize (FArchive &arc);
|
||||
protected:
|
||||
int MaxPitchChange;
|
||||
DAngle MaxPitchChange;
|
||||
};
|
||||
|
||||
IMPLEMENT_CLASS (AAimingCamera)
|
||||
|
@ -137,7 +133,7 @@ void AAimingCamera::PostBeginPlay ()
|
|||
|
||||
args[2] = 0;
|
||||
Super::PostBeginPlay ();
|
||||
MaxPitchChange = FLOAT2ANGLE(changepitch * TICRATE);
|
||||
MaxPitchChange = changepitch / TICRATE;
|
||||
Range /= TICRATE;
|
||||
|
||||
TActorIterator<AActor> iterator (args[3]);
|
||||
|
@ -161,7 +157,7 @@ void AAimingCamera::Tick ()
|
|||
}
|
||||
if (tracer != NULL)
|
||||
{
|
||||
angle_t delta;
|
||||
DAngle delta;
|
||||
int dir = P_FaceMobj (this, tracer, &delta);
|
||||
if (delta > Range)
|
||||
{
|
||||
|
@ -169,31 +165,32 @@ void AAimingCamera::Tick ()
|
|||
}
|
||||
if (dir)
|
||||
{
|
||||
angle += delta;
|
||||
Angles.Yaw += delta;
|
||||
}
|
||||
else
|
||||
{
|
||||
angle -= delta;
|
||||
Angles.Yaw -= delta;
|
||||
}
|
||||
if (MaxPitchChange)
|
||||
if (MaxPitchChange != 0)
|
||||
{ // Aim camera's pitch; use floats for precision
|
||||
fixedvec2 fv3 = tracer->Vec2To(this);
|
||||
DVector2 vect(fv3.x, fv3.y);
|
||||
double dz = Z() - tracer->Z() - tracer->height/2;
|
||||
double dist = vect.Length();
|
||||
double ang = dist != 0.f ? g_atan2 (dz, dist) : 0;
|
||||
int desiredpitch = (int)RAD2ANGLE(ang);
|
||||
if (abs (desiredpitch - pitch) < MaxPitchChange)
|
||||
DAngle desiredPitch = ToDegrees(ang);
|
||||
DAngle diff = deltaangle(Angles.Pitch, desiredPitch);
|
||||
if (fabs (diff) < MaxPitchChange)
|
||||
{
|
||||
pitch = desiredpitch;
|
||||
Angles.Pitch = desiredPitch;
|
||||
}
|
||||
else if (desiredpitch < pitch)
|
||||
else if (diff < 0)
|
||||
{
|
||||
pitch -= MaxPitchChange;
|
||||
Angles.Pitch -= MaxPitchChange;
|
||||
}
|
||||
else
|
||||
{
|
||||
pitch += MaxPitchChange;
|
||||
Angles.Pitch += MaxPitchChange;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -827,7 +827,7 @@ void ADecal::BeginPlay ()
|
|||
// Look for a wall within 64 units behind the actor. If none can be
|
||||
// found, then no decal is created, and this actor is destroyed
|
||||
// without effectively doing anything.
|
||||
if (NULL == ShootDecal(tpl, this, Sector, X(), Y(), Z(), angle + ANGLE_180, 64*FRACUNIT, true))
|
||||
if (NULL == ShootDecal(tpl, this, Sector, X(), Y(), Z(), FLOAT2ANGLE(Angles.Yaw.Degrees) + ANGLE_180, 64*FRACUNIT, true))
|
||||
{
|
||||
DPrintf ("Could not find a wall to stick decal to at (%d,%d)\n", X()>>FRACBITS, Y()>>FRACBITS);
|
||||
}
|
||||
|
|
|
@ -176,7 +176,7 @@ void AFastProjectile::Effect()
|
|||
AActor *act = Spawn (trail, X(), Y(), hitz, ALLOW_REPLACE);
|
||||
if (act != NULL)
|
||||
{
|
||||
act->angle = this->angle;
|
||||
act->Angles.Yaw = Angles.Yaw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@ class AHateTarget : public AActor
|
|||
DECLARE_CLASS (AHateTarget, AActor)
|
||||
public:
|
||||
void BeginPlay ();
|
||||
int TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype);
|
||||
};
|
||||
|
||||
IMPLEMENT_CLASS (AHateTarget)
|
||||
|
@ -51,28 +50,14 @@ IMPLEMENT_CLASS (AHateTarget)
|
|||
void AHateTarget::BeginPlay ()
|
||||
{
|
||||
Super::BeginPlay ();
|
||||
if (angle != 0)
|
||||
if (SpawnAngle != 0)
|
||||
{ // Each degree translates into 10 units of health
|
||||
health = Scale (angle >> 1, 1800, 0x40000000);
|
||||
// Round to the nearest 10 because of inaccuracy above
|
||||
health = (health + 5) / 10 * 10;
|
||||
health = SpawnAngle * 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
special2 = 1;
|
||||
flags5 |= MF5_NODAMAGE;
|
||||
health = 1000001;
|
||||
}
|
||||
}
|
||||
|
||||
int AHateTarget::TakeSpecialDamage (AActor *inflictor, AActor *source, int damage, FName damagetype)
|
||||
{
|
||||
if (special2 != 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return damage;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntyp
|
|||
actor->RemoveFromHash ();
|
||||
actor->tid = 0;
|
||||
}
|
||||
morphed->angle = actor->angle;
|
||||
morphed->Angles.Yaw = actor->Angles.Yaw;
|
||||
morphed->target = actor->target;
|
||||
morphed->tracer = actor;
|
||||
morphed->Score = actor->Score;
|
||||
|
@ -223,7 +223,7 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag,
|
|||
mo->tid = pmo->tid;
|
||||
mo->AddToHash ();
|
||||
}
|
||||
mo->angle = pmo->angle;
|
||||
mo->Angles.Yaw = pmo->Angles.Yaw;
|
||||
mo->player = player;
|
||||
mo->reactiontime = 18;
|
||||
mo->flags = ActorFlags::FromInt (pmo->special2) & ~MF_JUSTHIT;
|
||||
|
@ -307,7 +307,7 @@ bool P_UndoPlayerMorph (player_t *activator, player_t *player, int unmorphflag,
|
|||
}
|
||||
}
|
||||
|
||||
angle = mo->angle >> ANGLETOFINESHIFT;
|
||||
angle = mo->_f_angle() >> ANGLETOFINESHIFT;
|
||||
AActor *eflash = NULL;
|
||||
if (exit_flash != NULL)
|
||||
{
|
||||
|
@ -385,7 +385,7 @@ bool P_MorphMonster (AActor *actor, PClassActor *spawntype, int duration, int st
|
|||
morphed = static_cast<AMorphedMonster *>(Spawn (spawntype, actor->Pos(), NO_REPLACE));
|
||||
DObject::StaticPointerSubstitution (actor, morphed);
|
||||
morphed->tid = actor->tid;
|
||||
morphed->angle = actor->angle;
|
||||
morphed->Angles.Yaw = actor->Angles.Yaw;
|
||||
morphed->UnmorphedMe = actor;
|
||||
morphed->alpha = actor->alpha;
|
||||
morphed->RenderStyle = actor->RenderStyle;
|
||||
|
@ -450,7 +450,7 @@ bool P_UndoMonsterMorph (AMorphedMonster *beast, bool force)
|
|||
beast->UnmorphTime = level.time + 5*TICRATE; // Next try in 5 seconds
|
||||
return false;
|
||||
}
|
||||
actor->angle = beast->angle;
|
||||
actor->Angles.Yaw = beast->Angles.Yaw;
|
||||
actor->target = beast->target;
|
||||
actor->FriendPlayer = beast->FriendPlayer;
|
||||
actor->flags = beast->FlagsSave & ~MF_JUSTHIT;
|
||||
|
|
|
@ -102,11 +102,7 @@ void AInterpolationPoint::FormChain ()
|
|||
if (Next == NULL && (args[3] | args[4]))
|
||||
Printf ("Can't find target for camera node %d\n", tid);
|
||||
|
||||
pitch = (signed int)((char)args[0]) * ANGLE_1;
|
||||
if (pitch <= -ANGLE_90)
|
||||
pitch = -ANGLE_90 + ANGLE_1;
|
||||
else if (pitch >= ANGLE_90)
|
||||
pitch = ANGLE_90 - ANGLE_1;
|
||||
Angles.Pitch = clamp<int>((signed char)args[0], -89, 89);
|
||||
|
||||
if (Next != NULL)
|
||||
Next->FormChain ();
|
||||
|
@ -426,7 +422,7 @@ bool APathFollower::Interpolate ()
|
|||
}
|
||||
if (args[2] & 2)
|
||||
{ // adjust yaw
|
||||
angle = R_PointToAngle2 (0, 0, dx, dy);
|
||||
Angles.Yaw = vectoyaw(DVector2(dx, dy));
|
||||
}
|
||||
if (args[2] & 4)
|
||||
{ // adjust pitch; use floats for precision
|
||||
|
@ -435,57 +431,30 @@ bool APathFollower::Interpolate ()
|
|||
double fdz = FIXED2DBL(-dz);
|
||||
double dist = g_sqrt (fdx*fdx + fdy*fdy);
|
||||
double ang = dist != 0.f ? g_atan2 (fdz, dist) : 0;
|
||||
pitch = (fixed_t)RAD2ANGLE(ang);
|
||||
Angles.Pitch = ToDegrees(ang);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (args[2] & 2)
|
||||
{ // interpolate angle
|
||||
double angle1 = (double)CurrNode->angle;
|
||||
double angle2 = (double)CurrNode->Next->angle;
|
||||
if (angle2 - angle1 <= -2147483648.f)
|
||||
{
|
||||
double lerped = Lerp (angle1, angle2 + 4294967296.f);
|
||||
if (lerped >= 4294967296.f)
|
||||
{
|
||||
angle = xs_CRoundToUInt(lerped - 4294967296.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
angle = xs_CRoundToUInt(lerped);
|
||||
}
|
||||
}
|
||||
else if (angle2 - angle1 >= 2147483648.f)
|
||||
{
|
||||
double lerped = Lerp (angle1, angle2 - 4294967296.f);
|
||||
if (lerped < 0.f)
|
||||
{
|
||||
angle = xs_CRoundToUInt(lerped + 4294967296.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
angle = xs_CRoundToUInt(lerped);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
angle = xs_CRoundToUInt(Lerp (angle1, angle2));
|
||||
}
|
||||
DAngle angle1 = CurrNode->Angles.Yaw.Normalized180();
|
||||
DAngle angle2 = angle1 + deltaangle(angle1, CurrNode->Next->Angles.Yaw);
|
||||
Angles.Yaw = Lerp(angle1.Degrees, angle2.Degrees);
|
||||
}
|
||||
if (args[2] & 1)
|
||||
{ // linear
|
||||
if (args[2] & 4)
|
||||
{ // interpolate pitch
|
||||
pitch = FLOAT2FIXED(Lerp (FIXED2DBL(CurrNode->pitch), FIXED2DBL(CurrNode->Next->pitch)));
|
||||
Angles.Pitch = Lerp(CurrNode->Angles.Pitch.Degrees, CurrNode->Next->Angles.Pitch.Degrees);
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // spline
|
||||
if (args[2] & 4)
|
||||
{ // interpolate pitch
|
||||
pitch = FLOAT2FIXED(Splerp (FIXED2DBL(PrevNode->pitch), FIXED2DBL(CurrNode->pitch),
|
||||
FIXED2DBL(CurrNode->Next->pitch), FIXED2DBL(CurrNode->Next->Next->pitch)));
|
||||
Angles.Pitch = Splerp(PrevNode->Angles.Pitch.Degrees, CurrNode->Angles.Pitch.Degrees,
|
||||
CurrNode->Next->Angles.Pitch.Degrees, CurrNode->Next->Next->Angles.Pitch.Degrees);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -558,9 +527,9 @@ bool AActorMover::Interpolate ()
|
|||
}
|
||||
|
||||
if (args[2] & 2)
|
||||
tracer->angle = angle;
|
||||
tracer->Angles.Yaw = Angles.Yaw;
|
||||
if (args[2] & 4)
|
||||
tracer->pitch = pitch;
|
||||
tracer->Angles.Pitch = Angles.Pitch;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -665,7 +634,7 @@ bool AMovingCamera::Interpolate ()
|
|||
|
||||
if (Super::Interpolate ())
|
||||
{
|
||||
angle = AngleTo(tracer, true);
|
||||
Angles.Yaw = _f_AngleTo(tracer, true);
|
||||
|
||||
if (args[2] & 4)
|
||||
{ // Also aim camera's pitch; use floats for precision
|
||||
|
@ -674,7 +643,7 @@ bool AMovingCamera::Interpolate ()
|
|||
double dz = FIXED2DBL(Z() - tracer->Z() - tracer->height/2);
|
||||
double dist = g_sqrt (dx*dx + dy*dy);
|
||||
double ang = dist != 0.f ? g_atan2 (dz, dist) : 0;
|
||||
pitch = RAD2ANGLE(ang);
|
||||
Angles.Pitch = ToDegrees(ang);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -140,7 +140,7 @@ void DEarthquake::Tick ()
|
|||
P_DamageMobj (victim, NULL, NULL, pr_quake.HitDice (1), NAME_None);
|
||||
}
|
||||
// Thrust player around
|
||||
angle_t an = victim->angle + ANGLE_1*pr_quake();
|
||||
angle_t an = victim->_f_angle() + ANGLE_1*pr_quake();
|
||||
if (m_IntensityX == m_IntensityY)
|
||||
{ // Thrust in a circle
|
||||
P_ThrustMobj (victim, an, m_IntensityX << (FRACBITS-1));
|
||||
|
|
|
@ -160,7 +160,8 @@ class ARandomSpawner : public AActor
|
|||
if (newmobj != NULL)
|
||||
{
|
||||
// copy everything relevant
|
||||
newmobj->SpawnAngle = newmobj->angle = angle;
|
||||
newmobj->SpawnAngle = SpawnAngle;
|
||||
newmobj->Angles = Angles;
|
||||
newmobj->SpawnPoint[2] = SpawnPoint[2];
|
||||
newmobj->special = special;
|
||||
newmobj->args[0] = args[0];
|
||||
|
|
|
@ -50,6 +50,6 @@ IMPLEMENT_CLASS (ASpark)
|
|||
void ASpark::Activate (AActor *activator)
|
||||
{
|
||||
Super::Activate (activator);
|
||||
P_DrawSplash (args[0] ? args[0] : 32, X(), Y(), Z(), angle, 1);
|
||||
P_DrawSplash (args[0] ? args[0] : 32, X(), Y(), Z(), FLOAT2ANGLE(Angles.Yaw.Degrees), 1);
|
||||
S_Sound (this, CHAN_AUTO, "world/spark", 1, ATTN_STATIC);
|
||||
}
|
||||
|
|
|
@ -367,16 +367,16 @@ int FMugShot::UpdateState(player_t *player, StateFlags stateflags)
|
|||
{
|
||||
// The next 12 lines are from the Doom statusbar code.
|
||||
badguyangle = player->mo->AngleTo(player->attacker);
|
||||
if (badguyangle > player->mo->angle)
|
||||
if (badguyangle > player->mo->_f_angle())
|
||||
{
|
||||
// whether right or left
|
||||
diffang = badguyangle - player->mo->angle;
|
||||
diffang = badguyangle - player->mo->_f_angle();
|
||||
i = diffang > ANG180;
|
||||
}
|
||||
else
|
||||
{
|
||||
// whether left or right
|
||||
diffang = player->mo->angle - badguyangle;
|
||||
diffang = player->mo->_f_angle() - badguyangle;
|
||||
i = diffang <= ANG180;
|
||||
} // confusing, aint it?
|
||||
if (i && diffang >= ANG45)
|
||||
|
|
|
@ -74,13 +74,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_Spectre3Attack)
|
|||
foo->FriendPlayer = 0;
|
||||
foo->tracer = self->target;
|
||||
|
||||
self->angle -= ANGLE_180 / 20 * 10;
|
||||
self->Angles.Yaw -= 90.;
|
||||
for (int i = 0; i < 20; ++i)
|
||||
{
|
||||
self->angle += ANGLE_180 / 20;
|
||||
self->Angles.Yaw += 9.;
|
||||
P_SpawnSubMissile (self, PClass::FindActor("SpectralLightningBall2"), self);
|
||||
}
|
||||
self->angle -= ANGLE_180 / 20 * 10;
|
||||
self->Angles.Yaw -= 90.;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderChoose)
|
|||
if (CrusaderCheckRange (self))
|
||||
{
|
||||
A_FaceTarget (self);
|
||||
self->angle -= ANGLE_180/16;
|
||||
self->Angles.Yaw -= 180./16;
|
||||
P_SpawnMissileZAimed (self, self->Z() + 40*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile"));
|
||||
}
|
||||
else
|
||||
|
@ -37,11 +37,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderChoose)
|
|||
{
|
||||
A_FaceTarget (self);
|
||||
P_SpawnMissileZAimed (self, self->Z() + 56*FRACUNIT, self->target, PClass::FindActor("CrusaderMissile"));
|
||||
self->angle -= ANGLE_45/32;
|
||||
self->Angles.Yaw -= 45./32;
|
||||
P_SpawnMissileZAimed (self, self->Z() + 40*FRACUNIT, self->target, PClass::FindActor("CrusaderMissile"));
|
||||
self->angle += ANGLE_45/16;
|
||||
self->Angles.Yaw += 45./16;
|
||||
P_SpawnMissileZAimed (self, self->Z() + 40*FRACUNIT, self->target, PClass::FindActor("CrusaderMissile"));
|
||||
self->angle -= ANGLE_45/16;
|
||||
self->Angles.Yaw -= 45./16;
|
||||
self->reactiontime += 15;
|
||||
}
|
||||
self->SetState (self->SeeState);
|
||||
|
@ -53,7 +53,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepLeft)
|
|||
{
|
||||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
self->angle += ANGLE_90/16;
|
||||
self->Angles.Yaw += 90./16;
|
||||
AActor *misl = P_SpawnMissileZAimed (self, self->Z() + 48*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile"));
|
||||
if (misl != NULL)
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_CrusaderSweepRight)
|
|||
{
|
||||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
self->angle -= ANGLE_90/16;
|
||||
self->Angles.Yaw -= 90./16;
|
||||
AActor *misl = P_SpawnMissileZAimed (self, self->Z() + 48*FRACUNIT, self->target, PClass::FindActor("FastFlameMissile"));
|
||||
if (misl != NULL)
|
||||
{
|
||||
|
|
|
@ -81,7 +81,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnEntity)
|
|||
AActor *entity = Spawn("EntityBoss", self->PosPlusZ(70*FRACUNIT), ALLOW_REPLACE);
|
||||
if (entity != NULL)
|
||||
{
|
||||
entity->angle = self->angle;
|
||||
entity->Angles.Yaw = self->Angles.Yaw;
|
||||
entity->CopyFriendliness(self, true);
|
||||
entity->vel.z = 5*FRACUNIT;
|
||||
entity->tracer = self;
|
||||
|
@ -100,19 +100,19 @@ DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath)
|
|||
AActor *spot = self->tracer;
|
||||
if (spot == NULL) spot = self;
|
||||
|
||||
fixedvec3 pos = spot->Vec3Angle(secondRadius, self->angle, self->tracer? 70*FRACUNIT : 0);
|
||||
fixedvec3 pos = spot->Vec3Angle(secondRadius, self->_f_angle(), self->tracer? 70*FRACUNIT : 0);
|
||||
|
||||
an = self->angle >> ANGLETOFINESHIFT;
|
||||
an = self->_f_angle() >> ANGLETOFINESHIFT;
|
||||
second = Spawn("EntitySecond", pos, ALLOW_REPLACE);
|
||||
second->CopyFriendliness(self, true);
|
||||
//second->target = self->target;
|
||||
A_FaceTarget (second);
|
||||
an = second->angle >> ANGLETOFINESHIFT;
|
||||
an = second->_f_angle() >> ANGLETOFINESHIFT;
|
||||
second->vel.x += FixedMul (finecosine[an], 320000);
|
||||
second->vel.y += FixedMul (finesine[an], 320000);
|
||||
|
||||
pos = spot->Vec3Angle(secondRadius, self->angle + ANGLE_90, self->tracer? 70*FRACUNIT : 0);
|
||||
an = (self->angle + ANGLE_90) >> ANGLETOFINESHIFT;
|
||||
pos = spot->Vec3Angle(secondRadius, self->_f_angle() + ANGLE_90, self->tracer? 70*FRACUNIT : 0);
|
||||
an = (self->_f_angle() + ANGLE_90) >> ANGLETOFINESHIFT;
|
||||
second = Spawn("EntitySecond", pos, ALLOW_REPLACE);
|
||||
second->CopyFriendliness(self, true);
|
||||
//second->target = self->target;
|
||||
|
@ -120,8 +120,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_EntityDeath)
|
|||
second->vel.y = FixedMul (secondRadius, finesine[an]) << 2;
|
||||
A_FaceTarget (second);
|
||||
|
||||
pos = spot->Vec3Angle(secondRadius, self->angle - ANGLE_90, self->tracer? 70*FRACUNIT : 0);
|
||||
an = (self->angle - ANGLE_90) >> ANGLETOFINESHIFT;
|
||||
pos = spot->Vec3Angle(secondRadius, self->_f_angle() - ANGLE_90, self->tracer? 70*FRACUNIT : 0);
|
||||
an = (self->_f_angle() - ANGLE_90) >> ANGLETOFINESHIFT;
|
||||
second = Spawn("EntitySecond", pos, ALLOW_REPLACE);
|
||||
second->CopyFriendliness(self, true);
|
||||
//second->target = self->target;
|
||||
|
|
|
@ -62,13 +62,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorAttack)
|
|||
A_FaceTarget (self);
|
||||
|
||||
self->AddZ(32*FRACUNIT);
|
||||
self->angle -= ANGLE_45/32;
|
||||
self->Angles.Yaw -= 45./32;
|
||||
proj = P_SpawnMissileZAimed (self, self->Z(), self->target, PClass::FindActor("InquisitorShot"));
|
||||
if (proj != NULL)
|
||||
{
|
||||
proj->vel.z += 9*FRACUNIT;
|
||||
}
|
||||
self->angle += ANGLE_45/16;
|
||||
self->Angles.Yaw += 45./16;
|
||||
proj = P_SpawnMissileZAimed (self, self->Z(), self->target, PClass::FindActor("InquisitorShot"));
|
||||
if (proj != NULL)
|
||||
{
|
||||
|
@ -92,7 +92,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_InquisitorJump)
|
|||
S_Sound (self, CHAN_ITEM|CHAN_LOOP, "inquisitor/jump", 1, ATTN_NORM);
|
||||
self->AddZ(64*FRACUNIT);
|
||||
A_FaceTarget (self);
|
||||
an = self->angle >> ANGLETOFINESHIFT;
|
||||
an = self->_f_angle() >> ANGLETOFINESHIFT;
|
||||
speed = self->Speed * 2/3;
|
||||
self->vel.x += FixedMul (speed, finecosine[an]);
|
||||
self->vel.y += FixedMul (speed, finesine[an]);
|
||||
|
@ -136,9 +136,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossArm)
|
|||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
AActor *foo = Spawn("InquisitorArm", self->PosPlusZ(24*FRACUNIT), ALLOW_REPLACE);
|
||||
foo->angle = self->angle - ANGLE_90 + (pr_inq.Random2() << 22);
|
||||
foo->vel.x = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]) >> 3;
|
||||
foo->vel.y = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]) >> 3;
|
||||
foo->Angles.Yaw = self->Angles.Yaw - 90. + pr_inq.Random2() * (360./1024.);
|
||||
foo->VelFromAngle(foo->Speed / 8);
|
||||
foo->vel.z = pr_inq() << 10;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -133,9 +133,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpawnProgrammerBase)
|
|||
AActor *foo = Spawn("ProgrammerBase", self->PosPlusZ(24*FRACUNIT), ALLOW_REPLACE);
|
||||
if (foo != NULL)
|
||||
{
|
||||
foo->angle = self->angle + ANGLE_180 + (pr_prog.Random2() << 22);
|
||||
foo->vel.x = FixedMul (foo->Speed, finecosine[foo->angle >> ANGLETOFINESHIFT]);
|
||||
foo->vel.y = FixedMul (foo->Speed, finesine[foo->angle >> ANGLETOFINESHIFT]);
|
||||
foo->Angles.Yaw = self->Angles.Yaw + 180. + pr_prog.Random2() * (360. / 1024.);
|
||||
foo->VelFromAngle();
|
||||
foo->vel.z = pr_prog() << 9;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -22,7 +22,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ReaverRanged)
|
|||
|
||||
A_FaceTarget (self);
|
||||
S_Sound (self, CHAN_WEAPON, "reaver/attack", 1, ATTN_NORM);
|
||||
bangle = self->angle;
|
||||
bangle = self->_f_angle();
|
||||
pitch = P_AimLineAttack (self, bangle, MISSILERANGE);
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
|
|
|
@ -31,8 +31,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_ShootGun)
|
|||
|
||||
S_Sound (self, CHAN_WEAPON, "monsters/rifle", 1, ATTN_NORM);
|
||||
A_FaceTarget (self);
|
||||
pitch = P_AimLineAttack (self, self->angle, MISSILERANGE);
|
||||
P_LineAttack (self, self->angle + (pr_shootgun.Random2() << 19),
|
||||
pitch = P_AimLineAttack (self, self->_f_angle(), MISSILERANGE);
|
||||
P_LineAttack (self, self->_f_angle() + (pr_shootgun.Random2() << 19),
|
||||
MISSILERANGE, pitch,
|
||||
3*(pr_shootgun() % 5 + 1), NAME_Hitscan, NAME_StrifePuff);
|
||||
return 0;
|
||||
|
@ -115,8 +115,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_Beacon)
|
|||
}
|
||||
|
||||
rebel->SetState (rebel->SeeState);
|
||||
rebel->angle = self->angle;
|
||||
an = self->angle >> ANGLETOFINESHIFT;
|
||||
rebel->Angles.Yaw = self->Angles.Yaw;
|
||||
an = self->_f_angle() >> ANGLETOFINESHIFT;
|
||||
Spawn<ATeleportFog> (rebel->Vec3Offset(20*finecosine[an], 20*finesine[an], TELEFOGHEIGHT), ALLOW_REPLACE);
|
||||
if (--self->health < 0)
|
||||
{
|
||||
|
|
|
@ -60,7 +60,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SentinelAttack)
|
|||
for (int i = 8; i > 1; --i)
|
||||
{
|
||||
trail = Spawn("SentinelFX1",
|
||||
self->Vec3Angle(missile->radius*i, missile->angle, (missile->vel.z / 4 * i)), ALLOW_REPLACE);
|
||||
self->Vec3Angle(missile->radius*i, missile->_f_angle(), (missile->vel.z / 4 * i)), ALLOW_REPLACE);
|
||||
if (trail != NULL)
|
||||
{
|
||||
trail->target = self;
|
||||
|
|
|
@ -30,7 +30,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightningTail)
|
|||
|
||||
AActor *foo = Spawn("SpectralLightningHTail", self->Vec3Offset(-self->vel.x, -self->vel.y, 0), ALLOW_REPLACE);
|
||||
|
||||
foo->angle = self->angle;
|
||||
foo->Angles.Yaw = self->Angles.Yaw;
|
||||
foo->FriendPlayer = self->FriendPlayer;
|
||||
return 0;
|
||||
}
|
||||
|
@ -42,11 +42,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralBigBallLightning)
|
|||
PClassActor *cls = PClass::FindActor("SpectralLightningH3");
|
||||
if (cls)
|
||||
{
|
||||
self->angle += ANGLE_90;
|
||||
self->Angles.Yaw += 90.;
|
||||
P_SpawnSubMissile (self, cls, self->target);
|
||||
self->angle += ANGLE_180;
|
||||
self->Angles.Yaw += 180.;
|
||||
P_SpawnSubMissile (self, cls, self->target);
|
||||
self->angle += ANGLE_90;
|
||||
self->Angles.Yaw -= 270.;
|
||||
P_SpawnSubMissile (self, cls, self->target);
|
||||
}
|
||||
return 0;
|
||||
|
@ -87,14 +87,13 @@ DEFINE_ACTION_FUNCTION(AActor, A_SpectralLightning)
|
|||
|
||||
// In Strife, this number is stored in the data segment, but it doesn't seem to be
|
||||
// altered anywhere.
|
||||
#define TRACEANGLE (0xe000000)
|
||||
#define TRACEANGLE (19.6875)
|
||||
|
||||
DEFINE_ACTION_FUNCTION(AActor, A_Tracer2)
|
||||
{
|
||||
PARAM_ACTION_PROLOGUE;
|
||||
|
||||
AActor *dest;
|
||||
angle_t exact;
|
||||
fixed_t dist;
|
||||
fixed_t slope;
|
||||
|
||||
|
@ -103,28 +102,23 @@ DEFINE_ACTION_FUNCTION(AActor, A_Tracer2)
|
|||
if (!dest || dest->health <= 0 || self->Speed == 0 || !self->CanSeek(dest))
|
||||
return 0;
|
||||
|
||||
// change angle
|
||||
exact = self->AngleTo(dest);
|
||||
DAngle exact = self->_f_AngleTo(dest);
|
||||
DAngle diff = deltaangle(self->Angles.Yaw, exact);
|
||||
|
||||
if (exact != self->angle)
|
||||
if (diff < 0)
|
||||
{
|
||||
if (exact - self->angle > 0x80000000)
|
||||
{
|
||||
self->angle -= TRACEANGLE;
|
||||
if (exact - self->angle < 0x80000000)
|
||||
self->angle = exact;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->angle += TRACEANGLE;
|
||||
if (exact - self->angle > 0x80000000)
|
||||
self->angle = exact;
|
||||
}
|
||||
self->Angles.Yaw -= TRACEANGLE;
|
||||
if (deltaangle(self->Angles.Yaw, exact) > 0)
|
||||
self->Angles.Yaw = exact;
|
||||
}
|
||||
else if (diff > 0)
|
||||
{
|
||||
self->Angles.Yaw += TRACEANGLE;
|
||||
if (deltaangle(self->Angles.Yaw, exact) < 0.)
|
||||
self->Angles.Yaw = exact;
|
||||
}
|
||||
|
||||
exact = self->angle >> ANGLETOFINESHIFT;
|
||||
self->vel.x = FixedMul (self->Speed, finecosine[exact]);
|
||||
self->vel.y = FixedMul (self->Speed, finesine[exact]);
|
||||
self->VelFromAngle();
|
||||
|
||||
if (!(self->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
||||
{
|
||||
|
|
|
@ -600,7 +600,6 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossGib)
|
|||
|
||||
const char *gibtype = (self->flags & MF_NOBLOOD) ? "Junk" : "Meat";
|
||||
AActor *gib = Spawn (gibtype, self->PosPlusZ(24*FRACUNIT), ALLOW_REPLACE);
|
||||
angle_t an;
|
||||
int speed;
|
||||
|
||||
if (gib == NULL)
|
||||
|
@ -608,11 +607,9 @@ DEFINE_ACTION_FUNCTION(AActor, A_TossGib)
|
|||
return 0;
|
||||
}
|
||||
|
||||
an = pr_gibtosser() << 24;
|
||||
gib->angle = an;
|
||||
gib->Angles.Yaw = pr_gibtosser() * (360 / 256.f);
|
||||
speed = pr_gibtosser() & 15;
|
||||
gib->vel.x = speed * finecosine[an >> ANGLETOFINESHIFT];
|
||||
gib->vel.y = speed * finesine[an >> ANGLETOFINESHIFT];
|
||||
gib->VelFromAngle(speed);
|
||||
gib->vel.z = (pr_gibtosser() & 15) << FRACBITS;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_JabDagger)
|
|||
damage *= 10;
|
||||
}
|
||||
|
||||
angle = self->angle + (pr_jabdagger.Random2() << 18);
|
||||
angle = self->_f_angle() + (pr_jabdagger.Random2() << 18);
|
||||
pitch = P_AimLineAttack (self, angle, 80*FRACUNIT);
|
||||
P_LineAttack (self, angle, 80*FRACUNIT, pitch, damage, NAME_Melee, "StrifeSpark", true, &t);
|
||||
|
||||
|
@ -120,7 +120,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_JabDagger)
|
|||
S_Sound (self, CHAN_WEAPON,
|
||||
t.linetarget->flags & MF_NOBLOOD ? "misc/metalhit" : "misc/meathit",
|
||||
1, ATTN_NORM);
|
||||
self->angle = t.angleFromSource;
|
||||
self->Angles.Yaw = t.angleFromSource;
|
||||
self->flags |= MF_JUSTATTACKED;
|
||||
P_DaggerAlert (self, t.linetarget);
|
||||
}
|
||||
|
@ -265,11 +265,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireArrow)
|
|||
|
||||
if (ti)
|
||||
{
|
||||
savedangle = self->angle;
|
||||
self->angle += pr_electric.Random2 () << (18 - self->player->mo->accuracy * 5 / 100);
|
||||
savedangle = self->_f_angle();
|
||||
self->Angles.Yaw += ANGLE2DBL(pr_electric.Random2() * (1 << (18 - self->player->mo->accuracy * 5 / 100)));
|
||||
self->player->mo->PlayAttacking2 ();
|
||||
P_SpawnPlayerMissile (self, ti);
|
||||
self->angle = savedangle;
|
||||
self->Angles.Yaw = savedangle;
|
||||
S_Sound (self, CHAN_WEAPON, "weapons/xbowshoot", 1, ATTN_NORM);
|
||||
}
|
||||
return 0;
|
||||
|
@ -289,7 +289,7 @@ void P_StrifeGunShot (AActor *mo, bool accurate, angle_t pitch)
|
|||
int damage;
|
||||
|
||||
damage = 4*(pr_sgunshot()%3+1);
|
||||
angle = mo->angle;
|
||||
angle = mo->_f_angle();
|
||||
|
||||
if (mo->player != NULL && !accurate)
|
||||
{
|
||||
|
@ -358,11 +358,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMiniMissile)
|
|||
return 0;
|
||||
}
|
||||
|
||||
savedangle = self->angle;
|
||||
self->angle += pr_minimissile.Random2() << (19 - player->mo->accuracy * 5 / 100);
|
||||
savedangle = self->_f_angle();
|
||||
self->Angles.Yaw += ANGLE2DBL(pr_minimissile.Random2() << (19 - player->mo->accuracy * 5 / 100));
|
||||
player->mo->PlayAttacking2 ();
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("MiniMissile"));
|
||||
self->angle = savedangle;
|
||||
self->Angles.Yaw = savedangle;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -379,7 +379,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_RocketInFlight)
|
|||
AActor *trail;
|
||||
|
||||
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->_f_angle() - ANGLE_180, 2, PF_HITTHING);
|
||||
trail = Spawn("RocketTrail", self->Vec3Offset(-self->vel.x, -self->vel.y, 0), ALLOW_REPLACE);
|
||||
if (trail != NULL)
|
||||
{
|
||||
|
@ -428,7 +428,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireFlamer)
|
|||
player->mo->PlayAttacking2 ();
|
||||
}
|
||||
|
||||
self->angle += pr_flamethrower.Random2() << 18;
|
||||
self->Angles.Yaw += pr_flamethrower.Random2() * (5.625/256.);
|
||||
self = P_SpawnPlayerMissile (self, PClass::FindActor("FlameMissile"));
|
||||
if (self != NULL)
|
||||
{
|
||||
|
@ -472,7 +472,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMauler1)
|
|||
for (int i = 0; i < 20; ++i)
|
||||
{
|
||||
int damage = 5 * (pr_mauler1() % 3 + 1);
|
||||
angle_t angle = self->angle + (pr_mauler1.Random2() << 19);
|
||||
angle_t angle = self->_f_angle() + (pr_mauler1.Random2() << 19);
|
||||
int pitch = bpitch + (pr_mauler1.Random2() * 332063);
|
||||
|
||||
// Strife used a range of 2112 units for the mauler to signal that
|
||||
|
@ -530,7 +530,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireMauler2)
|
|||
}
|
||||
P_SpawnPlayerMissile (self, PClass::FindActor("MaulerTorpedo"));
|
||||
P_DamageMobj (self, self, NULL, 20, self->DamageType);
|
||||
P_ThrustMobj (self, self->angle + ANGLE_180, 0x7D000);
|
||||
P_ThrustMobj (self, self->_f_angle() + ANGLE_180, 0x7D000);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -548,7 +548,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave)
|
|||
|
||||
AActor *wavedef = GetDefaultByName("MaulerTorpedoWave");
|
||||
fixed_t savedz;
|
||||
self->angle += ANGLE_180;
|
||||
self->Angles.Yaw += 180.;
|
||||
|
||||
// If the torpedo hit the ceiling, it should still spawn the wave
|
||||
savedz = self->Z();
|
||||
|
@ -559,7 +559,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MaulerTorpedoWave)
|
|||
|
||||
for (int i = 0; i < 80; ++i)
|
||||
{
|
||||
self->angle += ANGLE_45/10;
|
||||
self->Angles.Yaw += 4.5;
|
||||
P_SpawnSubMissile (self, PClass::FindActor("MaulerTorpedoWave"), self->target);
|
||||
}
|
||||
self->SetZ(savedz);
|
||||
|
@ -576,10 +576,8 @@ AActor *P_SpawnSubMissile (AActor *source, PClassActor *type, AActor *target)
|
|||
}
|
||||
|
||||
other->target = target;
|
||||
other->angle = source->angle;
|
||||
|
||||
other->vel.x = FixedMul (other->Speed, finecosine[source->angle >> ANGLETOFINESHIFT]);
|
||||
other->vel.y = FixedMul (other->Speed, finesine[source->angle >> ANGLETOFINESHIFT]);
|
||||
other->Angles.Yaw = source->Angles.Yaw;
|
||||
other->VelFromAngle();
|
||||
|
||||
if (other->flags4 & MF4_SPECTRAL)
|
||||
{
|
||||
|
@ -595,7 +593,7 @@ AActor *P_SpawnSubMissile (AActor *source, PClassActor *type, AActor *target)
|
|||
|
||||
if (P_CheckMissileSpawn (other, source->radius))
|
||||
{
|
||||
angle_t pitch = P_AimLineAttack (source, source->angle, 1024*FRACUNIT);
|
||||
angle_t pitch = P_AimLineAttack (source, source->_f_angle(), 1024*FRACUNIT);
|
||||
other->vel.z = FixedMul (-finesine[pitch>>ANGLETOFINESHIFT], other->Speed);
|
||||
return other;
|
||||
}
|
||||
|
@ -728,16 +726,16 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FireGrenade)
|
|||
S_Sound (grenade, CHAN_VOICE, grenade->SeeSound, 1, ATTN_NORM);
|
||||
}
|
||||
|
||||
grenade->vel.z = FixedMul (finetangent[FINEANGLES/4-(self->pitch>>ANGLETOFINESHIFT)], grenade->Speed) + 8*FRACUNIT;
|
||||
grenade->vel.z = FixedMul (finetangent[FINEANGLES/4-(self->_f_pitch()>>ANGLETOFINESHIFT)], grenade->Speed) + 8*FRACUNIT;
|
||||
|
||||
fixedvec2 offset;
|
||||
|
||||
an = self->angle >> ANGLETOFINESHIFT;
|
||||
an = self->_f_angle() >> ANGLETOFINESHIFT;
|
||||
tworadii = self->radius + grenade->radius;
|
||||
offset.x = FixedMul (finecosine[an], tworadii);
|
||||
offset.y = FixedMul (finesine[an], tworadii);
|
||||
|
||||
an = self->angle + angleofs;
|
||||
an = self->_f_angle() + angleofs;
|
||||
an >>= ANGLETOFINESHIFT;
|
||||
offset.x += FixedMul (finecosine[an], 15*FRACUNIT);
|
||||
offset.y += FixedMul (finesine[an], 15*FRACUNIT);
|
||||
|
@ -1000,8 +998,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil1)
|
|||
spot = Spawn("SpectralLightningSpot", self->Pos(), ALLOW_REPLACE);
|
||||
if (spot != NULL)
|
||||
{
|
||||
spot->vel.x += 28 * finecosine[self->angle >> ANGLETOFINESHIFT];
|
||||
spot->vel.y += 28 * finesine[self->angle >> ANGLETOFINESHIFT];
|
||||
spot->vel.x += 28 * finecosine[self->_f_angle() >> ANGLETOFINESHIFT];
|
||||
spot->vel.y += 28 * finesine[self->_f_angle() >> ANGLETOFINESHIFT];
|
||||
}
|
||||
}
|
||||
if (spot != NULL)
|
||||
|
@ -1054,17 +1052,17 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil3)
|
|||
P_DamageMobj (self, self, NULL, 3*4, 0, DMG_NO_ARMOR);
|
||||
S_Sound (self, CHAN_WEAPON, "weapons/sigilcharge", 1, ATTN_NORM);
|
||||
|
||||
self->angle -= ANGLE_90;
|
||||
self->Angles.Yaw -= 90.;
|
||||
for (i = 0; i < 20; ++i)
|
||||
{
|
||||
self->angle += ANGLE_180/20;
|
||||
self->Angles.Yaw += 9.;
|
||||
spot = P_SpawnSubMissile (self, PClass::FindActor("SpectralLightningBall1"), self);
|
||||
if (spot != NULL)
|
||||
{
|
||||
spot->SetZ(self->Z() + 32*FRACUNIT);
|
||||
}
|
||||
}
|
||||
self->angle -= (ANGLE_180/20)*10;
|
||||
self->Angles.Yaw -= 90.;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1091,7 +1089,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil4)
|
|||
P_BulletSlope (self, &t, ALF_PORTALRESTRICT);
|
||||
if (t.linetarget != NULL)
|
||||
{
|
||||
spot = P_SpawnPlayerMissile (self, 0,0,0, PClass::FindActor("SpectralLightningBigV1"), self->angle, &t, NULL, false, false, ALF_PORTALRESTRICT);
|
||||
spot = P_SpawnPlayerMissile (self, 0,0,0, PClass::FindActor("SpectralLightningBigV1"), self->_f_angle(), &t, NULL, false, false, ALF_PORTALRESTRICT);
|
||||
if (spot != NULL)
|
||||
{
|
||||
spot->tracer = t.linetarget;
|
||||
|
@ -1102,8 +1100,8 @@ DEFINE_ACTION_FUNCTION(AActor, A_FireSigil4)
|
|||
spot = P_SpawnPlayerMissile (self, PClass::FindActor("SpectralLightningBigV1"));
|
||||
if (spot != NULL)
|
||||
{
|
||||
spot->vel.x += FixedMul (spot->Speed, finecosine[self->angle >> ANGLETOFINESHIFT]);
|
||||
spot->vel.y += FixedMul (spot->Speed, finesine[self->angle >> ANGLETOFINESHIFT]);
|
||||
spot->vel.x += FixedMul (spot->Speed, finecosine[self->_f_angle() >> ANGLETOFINESHIFT]);
|
||||
spot->vel.y += FixedMul (spot->Speed, finesine[self->_f_angle() >> ANGLETOFINESHIFT]);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -25,12 +25,12 @@ DEFINE_ACTION_FUNCTION(AActor, A_TemplarAttack)
|
|||
|
||||
S_Sound (self, CHAN_WEAPON, "templar/shoot", 1, ATTN_NORM);
|
||||
A_FaceTarget (self);
|
||||
pitch = P_AimLineAttack (self, self->angle, MISSILERANGE);
|
||||
pitch = P_AimLineAttack (self, self->_f_angle(), MISSILERANGE);
|
||||
|
||||
for (int i = 0; i < 10; ++i)
|
||||
{
|
||||
damage = (pr_templar() & 4) * 2;
|
||||
angle = self->angle + (pr_templar.Random2() << 19);
|
||||
angle = self->_f_angle() + (pr_templar.Random2() << 19);
|
||||
pitchdiff = pr_templar.Random2() * 332063;
|
||||
P_LineAttack (self, angle, MISSILERANGE+64*FRACUNIT, pitch+pitchdiff, damage, NAME_Hitscan, NAME_MaulerPuff);
|
||||
}
|
||||
|
|
|
@ -469,8 +469,8 @@ void cht_DoCheat (player_t *player, int cheat)
|
|||
{
|
||||
// Don't allow this in deathmatch even with cheats enabled, because it's
|
||||
// a very very cheap kill.
|
||||
P_LineAttack (player->mo, player->mo->angle, PLAYERMISSILERANGE,
|
||||
P_AimLineAttack (player->mo, player->mo->angle, PLAYERMISSILERANGE), TELEFRAG_DAMAGE,
|
||||
P_LineAttack (player->mo, player->mo->_f_angle(), PLAYERMISSILERANGE,
|
||||
P_AimLineAttack (player->mo, player->mo->_f_angle(), PLAYERMISSILERANGE), TELEFRAG_DAMAGE,
|
||||
NAME_MDK, NAME_BulletPuff);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -3455,7 +3455,7 @@ int DLevelScript::DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, i
|
|||
actor->flags2 |= MF2_PASSMOBJ;
|
||||
if (force || P_TestMobjLocation (actor))
|
||||
{
|
||||
actor->angle = angle << 24;
|
||||
actor->Angles.Yaw = angle * (360. / 256);
|
||||
actor->tid = tid;
|
||||
actor->AddToHash ();
|
||||
if (actor->flags & MF_SPECIAL)
|
||||
|
@ -3508,12 +3508,12 @@ int DLevelScript::DoSpawnSpotFacing (int type, int spot, int tid, bool force)
|
|||
|
||||
while ( (aspot = iterator.Next ()) )
|
||||
{
|
||||
spawned += DoSpawn (type, aspot->X(), aspot->Y(), aspot->Z(), tid, aspot->angle >> 24, force);
|
||||
spawned += DoSpawn (type, aspot->X(), aspot->Y(), aspot->Z(), tid, aspot->_f_angle() >> 24, force);
|
||||
}
|
||||
}
|
||||
else if (activator != NULL)
|
||||
{
|
||||
spawned += DoSpawn (type, activator->X(), activator->Y(), activator->Z(), tid, activator->angle >> 24, force);
|
||||
spawned += DoSpawn (type, activator->X(), activator->Y(), activator->Z(), tid, activator->_f_angle() >> 24, force);
|
||||
}
|
||||
return spawned;
|
||||
}
|
||||
|
@ -4736,7 +4736,7 @@ static bool DoSpawnDecal(AActor *actor, const FDecalTemplate *tpl, int flags, an
|
|||
{
|
||||
if (!(flags & SDF_ABSANGLE))
|
||||
{
|
||||
angle += actor->angle;
|
||||
angle += actor->_f_angle();
|
||||
}
|
||||
return NULL != ShootDecal(tpl, actor, actor->Sector, actor->X(), actor->Y(),
|
||||
actor->Z() + (actor->height>>1) - actor->floorclip + actor->GetBobOffset() + zofs,
|
||||
|
@ -4745,11 +4745,12 @@ static bool DoSpawnDecal(AActor *actor, const FDecalTemplate *tpl, int flags, an
|
|||
|
||||
static void SetActorAngle(AActor *activator, int tid, int angle, bool interpolate)
|
||||
{
|
||||
DAngle an = angle * (360. / 65536);
|
||||
if (tid == 0)
|
||||
{
|
||||
if (activator != NULL)
|
||||
{
|
||||
activator->SetAngle(angle << 16, interpolate);
|
||||
activator->SetAngle(an, interpolate);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -4759,18 +4760,19 @@ static void SetActorAngle(AActor *activator, int tid, int angle, bool interpolat
|
|||
|
||||
while ((actor = iterator.Next()))
|
||||
{
|
||||
actor->SetAngle(angle << 16, interpolate);
|
||||
actor->SetAngle(an, interpolate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void SetActorPitch(AActor *activator, int tid, int angle, bool interpolate)
|
||||
{
|
||||
DAngle an = angle * (360. / 65536);
|
||||
if (tid == 0)
|
||||
{
|
||||
if (activator != NULL)
|
||||
{
|
||||
activator->SetPitch(angle << 16, interpolate);
|
||||
activator->SetPitch(an, interpolate);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -4780,18 +4782,19 @@ static void SetActorPitch(AActor *activator, int tid, int angle, bool interpolat
|
|||
|
||||
while ((actor = iterator.Next()))
|
||||
{
|
||||
actor->SetPitch(angle << 16, interpolate);
|
||||
actor->SetPitch(an, interpolate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void SetActorRoll(AActor *activator, int tid, int angle, bool interpolate)
|
||||
{
|
||||
DAngle an = angle * (360. / 65536);
|
||||
if (tid == 0)
|
||||
{
|
||||
if (activator != NULL)
|
||||
{
|
||||
activator->SetRoll(angle << 16, interpolate);
|
||||
activator->SetRoll(an, interpolate);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -4801,7 +4804,7 @@ static void SetActorRoll(AActor *activator, int tid, int angle, bool interpolate
|
|||
|
||||
while ((actor = iterator.Next()))
|
||||
{
|
||||
actor->SetRoll(angle << 16, interpolate);
|
||||
actor->SetRoll(an, interpolate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5901,11 +5904,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
|
||||
// [Nash] Actor roll functions. Let's roll!
|
||||
case ACSF_SetActorRoll:
|
||||
actor = SingleActorFromTID(args[0], activator);
|
||||
if (actor != NULL)
|
||||
{
|
||||
actor->SetRoll(args[1] << 16, false);
|
||||
}
|
||||
SetActorRoll(activator, args[0], args[1], false);
|
||||
return 0;
|
||||
|
||||
case ACSF_ChangeActorRoll:
|
||||
|
@ -5917,7 +5916,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
|
||||
case ACSF_GetActorRoll:
|
||||
actor = SingleActorFromTID(args[0], activator);
|
||||
return actor != NULL? actor->roll >> 16 : 0;
|
||||
return actor != NULL? actor->Angles.Roll.FixedAngle() : 0;
|
||||
|
||||
// [ZK] A_Warp in ACS
|
||||
case ACSF_Warp:
|
||||
|
@ -8690,14 +8689,14 @@ scriptwait:
|
|||
case PCD_GETACTORANGLE:
|
||||
{
|
||||
AActor *actor = SingleActorFromTID(STACK(1), activator);
|
||||
STACK(1) = actor == NULL ? 0 : actor->angle >> 16;
|
||||
STACK(1) = actor == NULL ? 0 : actor->Angles.Yaw.FixedAngle();
|
||||
}
|
||||
break;
|
||||
|
||||
case PCD_GETACTORPITCH:
|
||||
{
|
||||
AActor *actor = SingleActorFromTID(STACK(1), activator);
|
||||
STACK(1) = actor == NULL ? 0 : actor->pitch >> 16;
|
||||
STACK(1) = actor == NULL ? 0 : actor->Angles.Pitch.FixedAngle();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -9034,15 +9033,15 @@ scriptwait:
|
|||
// Like Thing_Projectile(Gravity) specials, but you can give the
|
||||
// projectile a TID.
|
||||
// Thing_Projectile2 (tid, type, angle, speed, vspeed, gravity, newtid);
|
||||
P_Thing_Projectile (STACK(7), activator, STACK(6), NULL, ((angle_t)(STACK(5)<<24)),
|
||||
STACK(4)<<(FRACBITS-3), STACK(3)<<(FRACBITS-3), 0, NULL, STACK(2), STACK(1), false);
|
||||
P_Thing_Projectile(STACK(7), activator, STACK(6), NULL, STACK(5) * (360. / 256.),
|
||||
STACK(4) << (FRACBITS - 3), STACK(3) << (FRACBITS - 3), 0, NULL, STACK(2), STACK(1), false);
|
||||
sp -= 7;
|
||||
break;
|
||||
|
||||
case PCD_SPAWNPROJECTILE:
|
||||
// Same, but takes an actor name instead of a spawn ID.
|
||||
P_Thing_Projectile (STACK(7), activator, 0, FBehavior::StaticLookupString (STACK(6)), ((angle_t)(STACK(5)<<24)),
|
||||
STACK(4)<<(FRACBITS-3), STACK(3)<<(FRACBITS-3), 0, NULL, STACK(2), STACK(1), false);
|
||||
P_Thing_Projectile(STACK(7), activator, 0, FBehavior::StaticLookupString(STACK(6)), STACK(5) * (360. / 256.),
|
||||
STACK(4) << (FRACBITS - 3), STACK(3) << (FRACBITS - 3), 0, NULL, STACK(2), STACK(1), false);
|
||||
sp -= 7;
|
||||
break;
|
||||
|
||||
|
|
|
@ -1110,14 +1110,14 @@ void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveang
|
|||
pc->player->ConversationFaceTalker = facetalker;
|
||||
if (saveangle)
|
||||
{
|
||||
pc->player->ConversationNPCAngle = npc->angle;
|
||||
pc->player->ConversationNPCAngle = npc->Angles.Yaw;
|
||||
}
|
||||
oldtarget = npc->target;
|
||||
npc->target = pc;
|
||||
if (facetalker)
|
||||
{
|
||||
A_FaceTarget (npc);
|
||||
pc->angle = pc->AngleTo(npc);
|
||||
pc->Angles.Yaw = pc->_f_AngleTo(npc);
|
||||
}
|
||||
if ((npc->flags & MF_FRIENDLY) || (npc->flags4 & MF4_NOHATEPLAYERS))
|
||||
{
|
||||
|
@ -1227,7 +1227,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
|
|||
if (reply == NULL)
|
||||
{
|
||||
// The default reply was selected
|
||||
npc->angle = player->ConversationNPCAngle;
|
||||
npc->Angles.Yaw = player->ConversationNPCAngle;
|
||||
npc->flags5 &= ~MF5_INCONVERSATION;
|
||||
return;
|
||||
}
|
||||
|
@ -1243,7 +1243,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
|
|||
TerminalResponse(reply->QuickNo);
|
||||
}
|
||||
npc->ConversationAnimation(2);
|
||||
npc->angle = player->ConversationNPCAngle;
|
||||
npc->Angles.Yaw = player->ConversationNPCAngle;
|
||||
npc->flags5 &= ~MF5_INCONVERSATION;
|
||||
return;
|
||||
}
|
||||
|
@ -1371,7 +1371,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
|
|||
}
|
||||
}
|
||||
|
||||
npc->angle = player->ConversationNPCAngle;
|
||||
npc->Angles.Yaw = player->ConversationNPCAngle;
|
||||
|
||||
// [CW] Set these to NULL because we're not using to them
|
||||
// anymore. However, this can interfere with slideshows
|
||||
|
@ -1421,7 +1421,7 @@ void P_ConversationCommand (int netcode, int pnum, BYTE **stream)
|
|||
assert(netcode == DEM_CONVNULL || netcode == DEM_CONVCLOSE);
|
||||
if (player->ConversationNPC != NULL)
|
||||
{
|
||||
player->ConversationNPC->angle = player->ConversationNPCAngle;
|
||||
player->ConversationNPC->Angles.Yaw = player->ConversationNPCAngle;
|
||||
player->ConversationNPC->flags5 &= ~MF5_INCONVERSATION;
|
||||
}
|
||||
if (netcode == DEM_CONVNULL)
|
||||
|
|
|
@ -440,7 +440,7 @@ void P_RunEffect (AActor *actor, int effects)
|
|||
}
|
||||
else
|
||||
{
|
||||
moveangle = actor->angle;
|
||||
moveangle = actor->_f_angle();
|
||||
}
|
||||
|
||||
particle_t *particle;
|
||||
|
@ -878,7 +878,7 @@ void P_DrawRailTrail(AActor *source, const DVector3 &start, const DVector3 &end,
|
|||
|
||||
AActor *thing = Spawn (spawnclass, FLOAT2FIXED(postmp.X), FLOAT2FIXED(postmp.Y), FLOAT2FIXED(postmp.Z), ALLOW_REPLACE);
|
||||
if (thing)
|
||||
thing->angle = angle;
|
||||
thing->Angles.Yaw = ANGLE2DBL(angle);
|
||||
pos += trail_step;
|
||||
}
|
||||
}
|
||||
|
|
102
src/p_enemy.cpp
102
src/p_enemy.cpp
|
@ -1191,7 +1191,7 @@ bool P_IsVisible(AActor *lookee, AActor *other, INTBOOL allaround, FLookExParams
|
|||
|
||||
if (fov && fov < ANGLE_MAX)
|
||||
{
|
||||
angle_t an = lookee->AngleTo(other) - lookee->angle;
|
||||
angle_t an = lookee->AngleTo(other) - lookee->_f_angle();
|
||||
|
||||
if (an > (fov / 2) && an < (ANGLE_MAX - (fov / 2)))
|
||||
{
|
||||
|
@ -2135,15 +2135,15 @@ void A_Wander(AActor *self, int flags)
|
|||
// turn towards movement direction if not there yet
|
||||
if (!(flags & CHF_NODIRECTIONTURN) && (self->movedir < DI_NODIR))
|
||||
{
|
||||
self->angle &= (angle_t)(7 << 29);
|
||||
int delta = self->angle - (self->movedir << 29);
|
||||
if (delta > 0)
|
||||
self->Angles.Yaw = floor(self->Angles.Yaw.Degrees / 45) * 45.;
|
||||
DAngle delta = deltaangle(self->Angles.Yaw, (self->movedir * 45));
|
||||
if (delta < 0)
|
||||
{
|
||||
self->angle -= ANG90 / 2;
|
||||
self->Angles.Yaw -= 45;
|
||||
}
|
||||
else if (delta < 0)
|
||||
else if (delta > 0)
|
||||
{
|
||||
self->angle += ANG90 / 2;
|
||||
self->Angles.Yaw += 45;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2228,7 +2228,6 @@ nosee:
|
|||
|
||||
void A_DoChase (VMFrameStack *stack, AActor *actor, bool fastchase, FState *meleestate, FState *missilestate, bool playactive, bool nightmarefast, bool dontmove, int flags)
|
||||
{
|
||||
int delta;
|
||||
|
||||
if (actor->flags5 & MF5_INCONVERSATION)
|
||||
return;
|
||||
|
@ -2290,15 +2289,15 @@ void A_DoChase (VMFrameStack *stack, AActor *actor, bool fastchase, FState *mele
|
|||
}
|
||||
else if (!(flags & CHF_NODIRECTIONTURN) && actor->movedir < 8)
|
||||
{
|
||||
actor->angle &= (angle_t)(7<<29);
|
||||
delta = actor->angle - (actor->movedir << 29);
|
||||
if (delta > 0)
|
||||
actor->Angles.Yaw = floor(actor->Angles.Yaw.Degrees / 45) * 45.;
|
||||
DAngle delta = deltaangle(actor->Angles.Yaw, (actor->movedir * 45));
|
||||
if (delta < 0)
|
||||
{
|
||||
actor->angle -= ANG90/2;
|
||||
actor->Angles.Yaw -= 45;
|
||||
}
|
||||
else if (delta < 0)
|
||||
else if (delta > 0)
|
||||
{
|
||||
actor->angle += ANG90/2;
|
||||
actor->Angles.Yaw += 45;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2414,7 +2413,7 @@ void A_DoChase (VMFrameStack *stack, AActor *actor, bool fastchase, FState *mele
|
|||
spec->args[1], spec->args[2], spec->args[3], spec->args[4]);
|
||||
}
|
||||
|
||||
angle_t lastgoalang = actor->goal->angle;
|
||||
DAngle lastgoalang = actor->goal->Angles.Yaw;
|
||||
int delay;
|
||||
AActor * newgoal = iterator.Next ();
|
||||
if (newgoal != NULL && actor->goal == actor->target)
|
||||
|
@ -2426,7 +2425,7 @@ void A_DoChase (VMFrameStack *stack, AActor *actor, bool fastchase, FState *mele
|
|||
{
|
||||
delay = 0;
|
||||
actor->reactiontime = actor->GetDefault()->reactiontime;
|
||||
actor->angle = lastgoalang; // Look in direction of last goal
|
||||
actor->Angles.Yaw = lastgoalang; // Look in direction of last goal
|
||||
}
|
||||
if (actor->target == actor->goal) actor->target = NULL;
|
||||
actor->flags |= MF_JUSTATTACKED;
|
||||
|
@ -2820,7 +2819,7 @@ enum FAF_Flags
|
|||
FAF_TOP = 4,
|
||||
FAF_NODISTFACTOR = 8, // deprecated
|
||||
};
|
||||
void A_Face (AActor *self, AActor *other, angle_t max_turn, angle_t max_pitch, angle_t ang_offset, angle_t pitch_offset, int flags, fixed_t z_add)
|
||||
void A_Face (AActor *self, AActor *other, angle_t _max_turn, angle_t _max_pitch, angle_t _ang_offset, angle_t _pitch_offset, int flags, fixed_t z_add)
|
||||
{
|
||||
if (!other)
|
||||
return;
|
||||
|
@ -2833,43 +2832,35 @@ void A_Face (AActor *self, AActor *other, angle_t max_turn, angle_t max_pitch, a
|
|||
|
||||
self->flags &= ~MF_AMBUSH;
|
||||
|
||||
angle_t other_angle = self->AngleTo(other);
|
||||
DAngle max_turn = ANGLE2DBL(_max_turn);
|
||||
DAngle ang_offset = ANGLE2DBL(_ang_offset);
|
||||
DAngle max_pitch = ANGLE2DBL(_max_pitch);
|
||||
DAngle pitch_offset = ANGLE2DBL(_pitch_offset);
|
||||
DAngle other_angle = self->_f_AngleTo(other);
|
||||
|
||||
DAngle delta = deltaangle(self->Angles.Yaw, other_angle);
|
||||
|
||||
// 0 means no limit. Also, if we turn in a single step anyways, no need to go through the algorithms.
|
||||
// It also means that there is no need to check for going past the other.
|
||||
if (max_turn && (max_turn < absangle(self->angle - other_angle)))
|
||||
if (max_turn != 0 && (max_turn < fabs(delta)))
|
||||
{
|
||||
if (self->angle > other_angle)
|
||||
if (delta > 0)
|
||||
{
|
||||
if (self->angle - other_angle < ANGLE_180)
|
||||
{
|
||||
self->angle -= max_turn + ang_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->angle += max_turn + ang_offset;
|
||||
}
|
||||
self->Angles.Yaw -= max_turn + ang_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (other_angle - self->angle < ANGLE_180)
|
||||
{
|
||||
self->angle += max_turn + ang_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->angle -= max_turn + ang_offset;
|
||||
}
|
||||
self->Angles.Yaw += max_turn + ang_offset;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self->angle = other_angle + ang_offset;
|
||||
self->Angles.Yaw = other_angle + ang_offset;
|
||||
}
|
||||
|
||||
// [DH] Now set pitch. In order to maintain compatibility, this can be
|
||||
// disabled and is so by default.
|
||||
if (max_pitch <= ANGLE_180)
|
||||
if (max_pitch <= 180.)
|
||||
{
|
||||
fixedvec2 pos = self->Vec2To(other);
|
||||
DVector2 dist(pos.x, pos.y);
|
||||
|
@ -2898,34 +2889,35 @@ void A_Face (AActor *self, AActor *other, angle_t max_turn, angle_t max_pitch, a
|
|||
|
||||
double dist_z = target_z - source_z;
|
||||
double ddist = g_sqrt(dist.X*dist.X + dist.Y*dist.Y + dist_z*dist_z);
|
||||
int other_pitch = (int)RAD2ANGLE(g_asin(dist_z / ddist));
|
||||
|
||||
DAngle other_pitch = DAngle(ToDegrees(g_asin(dist_z / ddist))).Normalized180();
|
||||
|
||||
if (max_pitch != 0)
|
||||
{
|
||||
if (self->pitch > other_pitch)
|
||||
if (self->Angles.Pitch > other_pitch)
|
||||
{
|
||||
max_pitch = MIN(max_pitch, unsigned(self->pitch - other_pitch));
|
||||
self->pitch -= max_pitch;
|
||||
max_pitch = MIN(max_pitch, (self->Angles.Pitch - other_pitch).Normalized360());
|
||||
self->Angles.Pitch -= max_pitch;
|
||||
}
|
||||
else
|
||||
{
|
||||
max_pitch = MIN(max_pitch, unsigned(other_pitch - self->pitch));
|
||||
self->pitch += max_pitch;
|
||||
max_pitch = MIN(max_pitch, (other_pitch - self->Angles.Pitch).Normalized360());
|
||||
self->Angles.Pitch += max_pitch;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self->pitch = other_pitch;
|
||||
self->Angles.Pitch = other_pitch;
|
||||
}
|
||||
self->pitch += pitch_offset;
|
||||
self->Angles.Pitch += pitch_offset;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// This will never work well if the turn angle is limited.
|
||||
if (max_turn == 0 && (self->angle == other_angle) && other->flags & MF_SHADOW && !(self->flags6 & MF6_SEEINVISIBLE) )
|
||||
if (max_turn == 0 && (self->Angles.Yaw == other_angle) && other->flags & MF_SHADOW && !(self->flags6 & MF6_SEEINVISIBLE) )
|
||||
{
|
||||
self->angle += pr_facetarget.Random2() << 21;
|
||||
self->Angles.Yaw += pr_facetarget.Random2() * (45 / 256.);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2990,7 +2982,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail)
|
|||
if (!self->target)
|
||||
return 0;
|
||||
|
||||
fixed_t saved_pitch = self->pitch;
|
||||
DAngle saved_pitch = self->Angles.Pitch;
|
||||
FTranslatedLineTarget t;
|
||||
|
||||
// [RH] Andy Baker's stealth monsters
|
||||
|
@ -3001,28 +2993,28 @@ DEFINE_ACTION_FUNCTION(AActor, A_MonsterRail)
|
|||
|
||||
self->flags &= ~MF_AMBUSH;
|
||||
|
||||
self->angle = self->AngleTo(self->target);
|
||||
self->Angles.Yaw = self->_f_AngleTo(self->target);
|
||||
|
||||
self->pitch = P_AimLineAttack (self, self->angle, MISSILERANGE, &t, ANGLE_1*60, 0, self->target);
|
||||
self->Angles.Pitch = ANGLE2DBL(P_AimLineAttack (self, self->_f_angle(), MISSILERANGE, &t, ANGLE_1*60, 0, self->target));
|
||||
if (t.linetarget == NULL)
|
||||
{
|
||||
// We probably won't hit the target, but aim at it anyway so we don't look stupid.
|
||||
fixedvec2 pos = self->Vec2To(self->target);
|
||||
DVector2 xydiff(pos.x, pos.y);
|
||||
double zdiff = (self->target->Z() + (self->target->height>>1)) - (self->Z() + (self->height>>1) - self->floorclip);
|
||||
self->pitch = int(g_atan2(zdiff, xydiff.Length()) * ANGLE_180 / -M_PI);
|
||||
self->Angles.Pitch = -ToDegrees(g_atan2(zdiff, xydiff.Length()));
|
||||
}
|
||||
|
||||
// Let the aim trail behind the player
|
||||
self->angle = self->AngleTo(self->target, -self->target->vel.x * 3, -self->target->vel.y * 3);
|
||||
self->Angles.Yaw = ANGLE2DBL(self->AngleTo(self->target, -self->target->vel.x * 3, -self->target->vel.y * 3));
|
||||
|
||||
if (self->target->flags & MF_SHADOW && !(self->flags6 & MF6_SEEINVISIBLE))
|
||||
{
|
||||
self->angle += pr_railface.Random2() << 21;
|
||||
self->Angles.Yaw += pr_railface.Random2() * 45./256;
|
||||
}
|
||||
|
||||
P_RailAttack (self, self->GetMissileDamage (0, 1), 0);
|
||||
self->pitch = saved_pitch;
|
||||
self->Angles.Pitch = saved_pitch;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,8 @@ static const BYTE ChangeMap[8] = { 0, 1, 5, 3, 7, 2, 6, 0 };
|
|||
#define SPEED(a) ((a)*(FRACUNIT/8))
|
||||
#define TICS(a) (((a)*TICRATE)/35)
|
||||
#define OCTICS(a) (((a)*TICRATE)/8)
|
||||
#define BYTEANGLE(a) ((angle_t)((a)<<24))
|
||||
#define _f_BYTEANGLE(a) ((angle_t)((a)<<24))
|
||||
#define BYTEANGLE(a) ((a) * (360./256.))
|
||||
#define CRUSH(a) ((a) > 0? (a) : -1)
|
||||
#define CRUSHTYPE(a) ((a)==1? false : (a)==2? true : gameinfo.gametype == GAME_Hexen)
|
||||
#define CHANGE(a) (((a) >= 0 && (a)<=7)? ChangeMap[a]:0)
|
||||
|
@ -146,13 +147,13 @@ FUNC(LS_Polyobj_RotateRight)
|
|||
FUNC(LS_Polyobj_Move)
|
||||
// Polyobj_Move (po, speed, angle, distance)
|
||||
{
|
||||
return EV_MovePoly (ln, arg0, SPEED(arg1), BYTEANGLE(arg2), arg3 * FRACUNIT, false);
|
||||
return EV_MovePoly (ln, arg0, SPEED(arg1), _f_BYTEANGLE(arg2), arg3 * FRACUNIT, false);
|
||||
}
|
||||
|
||||
FUNC(LS_Polyobj_MoveTimes8)
|
||||
// Polyobj_MoveTimes8 (po, speed, angle, distance)
|
||||
{
|
||||
return EV_MovePoly (ln, arg0, SPEED(arg1), BYTEANGLE(arg2), arg3 * FRACUNIT * 8, false);
|
||||
return EV_MovePoly (ln, arg0, SPEED(arg1), _f_BYTEANGLE(arg2), arg3 * FRACUNIT * 8, false);
|
||||
}
|
||||
|
||||
FUNC(LS_Polyobj_MoveTo)
|
||||
|
@ -173,13 +174,13 @@ FUNC(LS_Polyobj_MoveToSpot)
|
|||
FUNC(LS_Polyobj_DoorSwing)
|
||||
// Polyobj_DoorSwing (po, speed, angle, delay)
|
||||
{
|
||||
return EV_OpenPolyDoor (ln, arg0, arg1, BYTEANGLE(arg2), arg3, 0, PODOOR_SWING);
|
||||
return EV_OpenPolyDoor (ln, arg0, arg1, _f_BYTEANGLE(arg2), arg3, 0, PODOOR_SWING);
|
||||
}
|
||||
|
||||
FUNC(LS_Polyobj_DoorSlide)
|
||||
// Polyobj_DoorSlide (po, speed, angle, distance, delay)
|
||||
{
|
||||
return EV_OpenPolyDoor (ln, arg0, SPEED(arg1), BYTEANGLE(arg2), arg4, arg3*FRACUNIT, PODOOR_SLIDE);
|
||||
return EV_OpenPolyDoor (ln, arg0, SPEED(arg1), _f_BYTEANGLE(arg2), arg4, arg3*FRACUNIT, PODOOR_SLIDE);
|
||||
}
|
||||
|
||||
FUNC(LS_Polyobj_OR_RotateLeft)
|
||||
|
@ -197,13 +198,13 @@ FUNC(LS_Polyobj_OR_RotateRight)
|
|||
FUNC(LS_Polyobj_OR_Move)
|
||||
// Polyobj_OR_Move (po, speed, angle, distance)
|
||||
{
|
||||
return EV_MovePoly (ln, arg0, SPEED(arg1), BYTEANGLE(arg2), arg3 * FRACUNIT, true);
|
||||
return EV_MovePoly (ln, arg0, SPEED(arg1), _f_BYTEANGLE(arg2), arg3 * FRACUNIT, true);
|
||||
}
|
||||
|
||||
FUNC(LS_Polyobj_OR_MoveTimes8)
|
||||
// Polyobj_OR_MoveTimes8 (po, speed, angle, distance)
|
||||
{
|
||||
return EV_MovePoly (ln, arg0, SPEED(arg1), BYTEANGLE(arg2), arg3 * FRACUNIT * 8, true);
|
||||
return EV_MovePoly (ln, arg0, SPEED(arg1), _f_BYTEANGLE(arg2), arg3 * FRACUNIT * 8, true);
|
||||
}
|
||||
|
||||
FUNC(LS_Polyobj_OR_MoveTo)
|
||||
|
@ -1100,7 +1101,7 @@ FUNC(LS_Teleport_Line)
|
|||
return EV_SilentLineTeleport (ln, backSide, it, arg1, arg2);
|
||||
}
|
||||
|
||||
static void ThrustThingHelper (AActor *it, angle_t angle, int force, INTBOOL nolimit);
|
||||
static void ThrustThingHelper (AActor *it, DAngle angle, int force, INTBOOL nolimit);
|
||||
FUNC(LS_ThrustThing)
|
||||
// ThrustThing (angle, force, nolimit, tid)
|
||||
{
|
||||
|
@ -1125,11 +1126,9 @@ FUNC(LS_ThrustThing)
|
|||
return false;
|
||||
}
|
||||
|
||||
static void ThrustThingHelper (AActor *it, angle_t angle, int force, INTBOOL nolimit)
|
||||
static void ThrustThingHelper (AActor *it, DAngle angle, int force, INTBOOL nolimit)
|
||||
{
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
it->vel.x += force * finecosine[angle];
|
||||
it->vel.y += force * finesine[angle];
|
||||
it->VelFromAngle(angle, force << FRACBITS);
|
||||
if (!nolimit)
|
||||
{
|
||||
it->vel.x = clamp<fixed_t> (it->vel.x, -MAXMOVE, MAXMOVE);
|
||||
|
@ -1661,7 +1660,7 @@ FUNC(LS_Thing_SpawnNoFog)
|
|||
FUNC(LS_Thing_SpawnFacing)
|
||||
// Thing_SpawnFacing (tid, type, nofog, newtid)
|
||||
{
|
||||
return P_Thing_Spawn (arg0, it, arg1, ANGLE_MAX, arg2 ? false : true, arg3);
|
||||
return P_Thing_Spawn (arg0, it, arg1, 1000000., arg2 ? false : true, arg3);
|
||||
}
|
||||
|
||||
FUNC(LS_Thing_Raise)
|
||||
|
@ -3217,7 +3216,7 @@ FUNC(LS_ForceField)
|
|||
if (it != NULL)
|
||||
{
|
||||
P_DamageMobj (it, NULL, NULL, 16, NAME_None);
|
||||
P_ThrustMobj (it, it->angle + ANGLE_180, 0x7D000);
|
||||
P_ThrustMobj (it, it->_f_angle() + ANGLE_180, 0x7D000);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -3272,8 +3271,6 @@ FUNC(LS_GlassBreak)
|
|||
{ // Break some glass
|
||||
fixed_t x, y;
|
||||
AActor *glass;
|
||||
angle_t an;
|
||||
int speed;
|
||||
|
||||
x = ln->v1->x + ln->dx/2;
|
||||
y = ln->v1->y + ln->dy/2;
|
||||
|
@ -3286,12 +3283,9 @@ FUNC(LS_GlassBreak)
|
|||
|
||||
glass->AddZ(24 * FRACUNIT);
|
||||
glass->SetState (glass->SpawnState + (pr_glass() % glass->health));
|
||||
an = pr_glass() << (32-8);
|
||||
glass->angle = an;
|
||||
an >>= ANGLETOFINESHIFT;
|
||||
speed = pr_glass() & 3;
|
||||
glass->vel.x = finecosine[an] * speed;
|
||||
glass->vel.y = finesine[an] * speed;
|
||||
|
||||
glass->Angles.Yaw = pr_glass() * (360 / 256.);
|
||||
glass->VelFromAngle(pr_glass() & 3);
|
||||
glass->vel.z = (pr_glass() & 7) << FRACBITS;
|
||||
// [RH] Let the shards stick around longer than they did in Strife.
|
||||
glass->tics += pr_glass();
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "doomtype.h"
|
||||
#include "tables.h"
|
||||
#include "vectors.h"
|
||||
|
||||
class player_t;
|
||||
class AActor;
|
||||
|
@ -129,7 +130,12 @@ void P_PredictionLerpReset();
|
|||
APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags=0);
|
||||
|
||||
void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move);
|
||||
int P_FaceMobj (AActor *source, AActor *target, angle_t *delta);
|
||||
inline void P_ThrustMobj(AActor *mo, DAngle angle, fixed_t move)
|
||||
{
|
||||
P_ThrustMobj(mo, FLOAT2ANGLE(angle.Degrees), move);
|
||||
}
|
||||
|
||||
int P_FaceMobj (AActor *source, AActor *target, DAngle *delta);
|
||||
bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool precise = false, bool usecurspeed=false);
|
||||
|
||||
enum EPuffFlags
|
||||
|
@ -187,8 +193,8 @@ AActor *P_SpawnSubMissile (AActor *source, PClassActor *type, AActor *target); /
|
|||
extern FClassMap SpawnableThings;
|
||||
extern FClassMap StrifeTypes;
|
||||
|
||||
bool P_Thing_Spawn (int tid, AActor *source, int type, angle_t angle, bool fog, int newtid);
|
||||
bool P_Thing_Projectile (int tid, AActor *source, int type, const char * type_name, angle_t angle,
|
||||
bool P_Thing_Spawn (int tid, AActor *source, int type, DAngle angle, bool fog, int newtid);
|
||||
bool P_Thing_Projectile (int tid, AActor *source, int type, const char * type_name, DAngle angle,
|
||||
fixed_t speed, fixed_t vspeed, int dest, AActor *forcedest, int gravity, int newtid,
|
||||
bool leadTarget);
|
||||
bool P_MoveThing(AActor *source, fixed_t x, fixed_t y, fixed_t z, bool fog);
|
||||
|
|
|
@ -2348,7 +2348,7 @@ bool P_TryMove(AActor *thing, fixed_t x, fixed_t y,
|
|||
thing->UnlinkFromWorld();
|
||||
thing->SetXYZ(pos);
|
||||
P_TranslatePortalVXVY(ld, thing->vel.x, thing->vel.y);
|
||||
P_TranslatePortalAngle(ld, thing->angle);
|
||||
P_TranslatePortalAngle(ld, thing->Angles.Yaw);
|
||||
thing->LinkToWorld();
|
||||
P_FindFloorCeiling(thing);
|
||||
thing->ClearInterpolation();
|
||||
|
@ -3314,7 +3314,7 @@ bool FSlide::BounceWall(AActor *mo)
|
|||
}
|
||||
moveangle = R_PointToAngle2(0, 0, mo->vel.x, mo->vel.y);
|
||||
deltaangle = (2 * lineangle) - moveangle;
|
||||
mo->angle = deltaangle;
|
||||
mo->Angles.Yaw = ANGLE2DBL(deltaangle);
|
||||
|
||||
deltaangle >>= ANGLETOFINESHIFT;
|
||||
|
||||
|
@ -3379,13 +3379,11 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
|
|||
if (!ontop)
|
||||
{
|
||||
fixed_t speed;
|
||||
angle_t angle = BlockingMobj->AngleTo(mo) + ANGLE_1*((pr_bounce() % 16) - 8);
|
||||
DAngle angle = BlockingMobj->_f_AngleTo(mo) + ((pr_bounce() % 16) - 8);
|
||||
speed = P_AproxDistance(mo->vel.x, mo->vel.y);
|
||||
speed = FixedMul(speed, mo->wallbouncefactor); // [GZ] was 0.75, using wallbouncefactor seems more consistent
|
||||
mo->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
mo->vel.x = FixedMul(speed, finecosine[angle]);
|
||||
mo->vel.y = FixedMul(speed, finesine[angle]);
|
||||
mo->Angles.Yaw = ANGLE2DBL(angle);
|
||||
mo->VelFromAngle(speed);
|
||||
mo->PlayBounceSound(true);
|
||||
if (mo->BounceFlags & BOUNCE_UseBounceState)
|
||||
{
|
||||
|
@ -3533,7 +3531,7 @@ struct aim_t
|
|||
{
|
||||
res.linetarget = th;
|
||||
res.pitch = pitch;
|
||||
res.angleFromSource = R_PointToAngle2(startpos.x, startpos.y, th->X(), th->Y());
|
||||
res.angleFromSource = vectoyaw(DVector2(th->X() - startpos.x, th->Y() - startpos.y));
|
||||
res.unlinked = unlinked;
|
||||
res.frac = frac;
|
||||
}
|
||||
|
@ -4095,10 +4093,10 @@ fixed_t P_AimLineAttack(AActor *t1, angle_t angle, fixed_t distance, FTranslated
|
|||
aim.startpos = t1->Pos();
|
||||
aim.aimtrace = Vec2Angle(distance, angle);
|
||||
aim.limitz = aim.shootz = shootz;
|
||||
aim.toppitch = t1->pitch - vrange;
|
||||
aim.bottompitch = t1->pitch + vrange;
|
||||
aim.toppitch = t1->_f_pitch() - vrange;
|
||||
aim.bottompitch = t1->_f_pitch() + vrange;
|
||||
aim.attackrange = distance;
|
||||
aim.aimpitch = t1->pitch;
|
||||
aim.aimpitch = t1->_f_pitch();
|
||||
aim.lastsector = t1->Sector;
|
||||
aim.startfrac = 0;
|
||||
aim.unlinked = false;
|
||||
|
@ -4112,7 +4110,7 @@ fixed_t P_AimLineAttack(AActor *t1, angle_t angle, fixed_t distance, FTranslated
|
|||
{
|
||||
*pLineTarget = *result;
|
||||
}
|
||||
return result->linetarget ? result->pitch : t1->pitch;
|
||||
return result->linetarget ? result->pitch : t1->_f_pitch();
|
||||
}
|
||||
|
||||
|
||||
|
@ -4399,7 +4397,7 @@ AActor *P_LineAttack(AActor *t1, angle_t angle, fixed_t distance,
|
|||
if (victim != NULL)
|
||||
{
|
||||
victim->linetarget = trace.Actor;
|
||||
victim->angleFromSource = trace.SrcAngleToTarget;
|
||||
victim->angleFromSource = ANGLE2DBL(trace.SrcAngleToTarget);
|
||||
victim->unlinked = trace.unlinked;
|
||||
}
|
||||
}
|
||||
|
@ -4625,7 +4623,7 @@ void P_TraceBleed(int damage, FTranslatedLineTarget *t, AActor *puff)
|
|||
|
||||
fixed_t randpitch = (pr_tracebleed() - 128) << 16;
|
||||
P_TraceBleed(damage, t->linetarget->X(), t->linetarget->Y(), t->linetarget->Z() + t->linetarget->height / 2,
|
||||
t->linetarget, t->angleFromSource, 0);
|
||||
t->linetarget, FLOAT2ANGLE(t->angleFromSource.Degrees), 0);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -4722,8 +4720,8 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i
|
|||
puffclass = PClass::FindActor(NAME_BulletPuff);
|
||||
}
|
||||
|
||||
pitch = ((angle_t)(-source->pitch) + pitchoffset) >> ANGLETOFINESHIFT;
|
||||
angle = (source->angle + angleoffset) >> ANGLETOFINESHIFT;
|
||||
pitch = ((angle_t)(-source->_f_pitch()) + pitchoffset) >> ANGLETOFINESHIFT;
|
||||
angle = (source->_f_angle() + angleoffset) >> ANGLETOFINESHIFT;
|
||||
|
||||
vx = FixedMul(finecosine[pitch], finecosine[angle]);
|
||||
vy = FixedMul(finecosine[pitch], finesine[angle]);
|
||||
|
@ -4743,7 +4741,7 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i
|
|||
}
|
||||
}
|
||||
|
||||
angle = ((source->angle + angleoffset) - ANG90) >> ANGLETOFINESHIFT;
|
||||
angle = ((source->_f_angle() + angleoffset) - ANG90) >> ANGLETOFINESHIFT;
|
||||
|
||||
fixedvec2 xy = source->Vec2Offset(offset_xy * finecosine[angle], offset_xy * finesine[angle]);
|
||||
|
||||
|
@ -4822,7 +4820,7 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i
|
|||
if (bleed)
|
||||
{
|
||||
P_SpawnBlood(hitpos, hitangle, newdam > 0 ? newdam : damage, hitactor);
|
||||
P_TraceBleed(newdam > 0 ? newdam : damage, hitpos, hitactor, source->angle, pitch);
|
||||
P_TraceBleed(newdam > 0 ? newdam : damage, hitpos, hitactor, source->_f_angle(), pitch);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4874,7 +4872,7 @@ void P_RailAttack(AActor *source, int damage, int offset_xy, fixed_t offset_z, i
|
|||
end.X = FIXED2DBL(trace.HitPos.x);
|
||||
end.Y = FIXED2DBL(trace.HitPos.y);
|
||||
end.Z = FIXED2DBL(trace.HitPos.z);
|
||||
P_DrawRailTrail(source, start, end, color1, color2, maxdiff, railflags, spawnclass, source->angle + angleoffset, duration, sparsity, drift, SpiralOffset);
|
||||
P_DrawRailTrail(source, start, end, color1, color2, maxdiff, railflags, spawnclass, source->_f_angle() + angleoffset, duration, sparsity, drift, SpiralOffset);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -4889,8 +4887,8 @@ CVAR(Float, chase_dist, 90.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
|||
void P_AimCamera(AActor *t1, fixed_t &CameraX, fixed_t &CameraY, fixed_t &CameraZ, sector_t *&CameraSector, bool &unlinked)
|
||||
{
|
||||
fixed_t distance = (fixed_t)(clamp<double>(chase_dist, 0, 30000) * FRACUNIT);
|
||||
angle_t angle = (t1->angle - ANG180) >> ANGLETOFINESHIFT;
|
||||
angle_t pitch = (angle_t)(t1->pitch) >> ANGLETOFINESHIFT;
|
||||
angle_t angle = (t1->_f_angle() - ANG180) >> ANGLETOFINESHIFT;
|
||||
angle_t pitch = (angle_t)(t1->_f_pitch()) >> ANGLETOFINESHIFT;
|
||||
FTraceResults trace;
|
||||
fixed_t vx, vy, vz, sz;
|
||||
|
||||
|
@ -4937,7 +4935,7 @@ bool P_TalkFacing(AActor *player)
|
|||
|
||||
for (int angle : angleofs)
|
||||
{
|
||||
P_AimLineAttack(player, player->angle + angle, TALKRANGE, &t, ANGLE_1 * 35, ALF_FORCENOSMART | ALF_CHECKCONVERSATION | ALF_PORTALRESTRICT);
|
||||
P_AimLineAttack(player, player->_f_angle() + angle, TALKRANGE, &t, ANGLE_1 * 35, ALF_FORCENOSMART | ALF_CHECKCONVERSATION | ALF_PORTALRESTRICT);
|
||||
if (t.linetarget != NULL)
|
||||
{
|
||||
if (t.linetarget->health > 0 && // Dead things can't talk.
|
||||
|
@ -5133,7 +5131,7 @@ void P_UseLines(player_t *player)
|
|||
// If the player is transitioning a portal, use the group that is at its vertical center.
|
||||
fixedvec2 start = player->mo->GetPortalTransition(player->mo->height / 2);
|
||||
// [NS] Now queries the Player's UseRange.
|
||||
fixedvec2 end = start + Vec2Angle(userange > 0? fixed_t(userange<<FRACBITS) : player->mo->UseRange, player->mo->angle);
|
||||
fixedvec2 end = start + Vec2Angle(userange > 0? fixed_t(userange<<FRACBITS) : player->mo->UseRange, player->mo->_f_angle());
|
||||
|
||||
// old code:
|
||||
//
|
||||
|
@ -5167,7 +5165,7 @@ bool P_UsePuzzleItem(AActor *PuzzleItemUser, int PuzzleItemType)
|
|||
int angle;
|
||||
fixed_t x1, y1, x2, y2, usedist;
|
||||
|
||||
angle = PuzzleItemUser->angle >> ANGLETOFINESHIFT;
|
||||
angle = PuzzleItemUser->_f_angle() >> ANGLETOFINESHIFT;
|
||||
x1 = PuzzleItemUser->X();
|
||||
y1 = PuzzleItemUser->Y();
|
||||
|
||||
|
|
237
src/p_mobj.cpp
237
src/p_mobj.cpp
|
@ -237,7 +237,7 @@ void AActor::Serialize (FArchive &arc)
|
|||
arc << __pos.x
|
||||
<< __pos.y
|
||||
<< __pos.z
|
||||
<< angle
|
||||
<< Angles.Yaw
|
||||
<< frame
|
||||
<< scaleX
|
||||
<< scaleY
|
||||
|
@ -252,8 +252,8 @@ void AActor::Serialize (FArchive &arc)
|
|||
<< effects
|
||||
<< alpha
|
||||
<< fillcolor
|
||||
<< pitch
|
||||
<< roll
|
||||
<< Angles.Pitch // move these up when savegame compatibility is broken!
|
||||
<< Angles.Roll // For now they have to remain here.
|
||||
<< Sector
|
||||
<< floorz
|
||||
<< ceilingz
|
||||
|
@ -832,19 +832,17 @@ bool AActor::UseInventory (AInventory *item)
|
|||
|
||||
AInventory *AActor::DropInventory (AInventory *item)
|
||||
{
|
||||
angle_t an;
|
||||
AInventory *drop = item->CreateTossable ();
|
||||
|
||||
if (drop == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
an = angle >> ANGLETOFINESHIFT;
|
||||
drop->SetOrigin(PosPlusZ(10*FRACUNIT), false);
|
||||
drop->angle = angle;
|
||||
drop->vel.x = vel.x + 5 * finecosine[an];
|
||||
drop->vel.y = vel.y + 5 * finesine[an];
|
||||
drop->vel.z = vel.z + FRACUNIT;
|
||||
drop->Angles.Yaw = Angles.Yaw;
|
||||
drop->VelFromAngle(5);
|
||||
drop->vel.z = FRACUNIT;
|
||||
drop->vel += vel;
|
||||
drop->flags &= ~MF_NOGRAVITY; // Don't float
|
||||
drop->ClearCounters(); // do not count for statistics again
|
||||
return drop;
|
||||
|
@ -1576,7 +1574,7 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
|||
vel.x -= MulScale15 (plane.a, dot);
|
||||
vel.y -= MulScale15 (plane.b, dot);
|
||||
vel.z -= MulScale15 (plane.c, dot);
|
||||
angle = R_PointToAngle2 (0, 0, vel.x, vel.y);
|
||||
AngleFromVel();
|
||||
if (!(BounceFlags & BOUNCE_MBF)) // Heretic projectiles die, MBF projectiles don't.
|
||||
{
|
||||
flags |= MF_INBOUNCE;
|
||||
|
@ -1592,7 +1590,7 @@ bool AActor::FloorBounceMissile (secplane_t &plane)
|
|||
vel.x = FixedMul (vel.x - MulScale15 (plane.a, dot), bouncefactor);
|
||||
vel.y = FixedMul (vel.y - MulScale15 (plane.b, dot), bouncefactor);
|
||||
vel.z = FixedMul (vel.z - MulScale15 (plane.c, dot), bouncefactor);
|
||||
angle = R_PointToAngle2 (0, 0, vel.x, vel.y);
|
||||
AngleFromVel();
|
||||
}
|
||||
|
||||
PlayBounceSound(true);
|
||||
|
@ -1652,41 +1650,20 @@ void P_ThrustMobj (AActor *mo, angle_t angle, fixed_t move)
|
|||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
int P_FaceMobj (AActor *source, AActor *target, angle_t *delta)
|
||||
int P_FaceMobj (AActor *source, AActor *target, DAngle *delta)
|
||||
{
|
||||
angle_t diff;
|
||||
angle_t angle1;
|
||||
angle_t angle2;
|
||||
DAngle diff;
|
||||
|
||||
angle1 = source->angle;
|
||||
angle2 = source->AngleTo(target);
|
||||
if (angle2 > angle1)
|
||||
diff = deltaangle(source->Angles.Yaw, source->_f_AngleTo(target));
|
||||
if (diff > 0)
|
||||
{
|
||||
diff = angle2 - angle1;
|
||||
if (diff > ANGLE_180)
|
||||
{
|
||||
*delta = ANGLE_MAX - diff;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*delta = diff;
|
||||
return 1;
|
||||
}
|
||||
*delta = diff;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
diff = angle1 - angle2;
|
||||
if (diff > ANGLE_180)
|
||||
{
|
||||
*delta = ANGLE_MAX - diff;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*delta = diff;
|
||||
return 0;
|
||||
}
|
||||
*delta = -diff;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1719,16 +1696,18 @@ bool AActor::CanSeek(AActor *target) const
|
|||
//
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool precise, bool usecurspeed)
|
||||
bool P_SeekerMissile (AActor *actor, angle_t _thresh, angle_t _turnMax, bool precise, bool usecurspeed)
|
||||
{
|
||||
DAngle thresh = ANGLE2DBL(_thresh);
|
||||
DAngle turnMax = ANGLE2DBL(_turnMax);
|
||||
|
||||
int dir;
|
||||
int dist;
|
||||
angle_t delta;
|
||||
angle_t angle;
|
||||
DAngle delta;
|
||||
AActor *target;
|
||||
fixed_t speed;
|
||||
|
||||
speed = !usecurspeed ? actor->Speed : xs_CRoundToInt(DVector3(actor->vel.x, actor->vel.y, actor->vel.z).Length());
|
||||
speed = !usecurspeed ? actor->Speed : actor->VelToSpeed();
|
||||
target = actor->tracer;
|
||||
if (target == NULL || !actor->CanSeek(target))
|
||||
{
|
||||
|
@ -1746,7 +1725,7 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci
|
|||
dir = P_FaceMobj (actor, target, &delta);
|
||||
if (delta > thresh)
|
||||
{
|
||||
delta >>= 1;
|
||||
delta /= 2;
|
||||
if (delta > turnMax)
|
||||
{
|
||||
delta = turnMax;
|
||||
|
@ -1754,18 +1733,16 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci
|
|||
}
|
||||
if (dir)
|
||||
{ // Turn clockwise
|
||||
actor->angle += delta;
|
||||
actor->Angles.Yaw += delta;
|
||||
}
|
||||
else
|
||||
{ // Turn counter clockwise
|
||||
actor->angle -= delta;
|
||||
actor->Angles.Yaw -= delta;
|
||||
}
|
||||
angle = actor->angle>>ANGLETOFINESHIFT;
|
||||
|
||||
if (!precise)
|
||||
{
|
||||
actor->vel.x = FixedMul (speed, finecosine[angle]);
|
||||
actor->vel.y = FixedMul (speed, finesine[angle]);
|
||||
actor->VelFromAngle(speed);
|
||||
|
||||
if (!(actor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
||||
{
|
||||
|
@ -1783,25 +1760,19 @@ bool P_SeekerMissile (AActor *actor, angle_t thresh, angle_t turnMax, bool preci
|
|||
}
|
||||
else
|
||||
{
|
||||
angle_t pitch = 0;
|
||||
DAngle pitch = 0;
|
||||
if (!(actor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)))
|
||||
{ // Need to seek vertically
|
||||
fixedvec2 vec = actor->Vec2To(target);
|
||||
double dist = MAX(1.0, DVector2(vec.x, vec.y).Length());
|
||||
fixed_t dist = MAX(1, actor->Distance2D(target));
|
||||
// Aim at a player's eyes and at the middle of the actor for everything else.
|
||||
fixed_t aimheight = target->height/2;
|
||||
if (target->IsKindOf(RUNTIME_CLASS(APlayerPawn)))
|
||||
{
|
||||
aimheight = static_cast<APlayerPawn *>(target)->ViewHeight;
|
||||
}
|
||||
pitch = R_PointToAngle2(0, actor->Z() + actor->height/2, xs_CRoundToInt(dist), target->Z() + aimheight);
|
||||
pitch >>= ANGLETOFINESHIFT;
|
||||
pitch = ANGLE2DBL(R_PointToAngle2(0, actor->Z() + actor->height/2, dist, target->Z() + aimheight));
|
||||
}
|
||||
|
||||
fixed_t xyscale = FixedMul(speed, finecosine[pitch]);
|
||||
actor->vel.z = FixedMul(speed, finesine[pitch]);
|
||||
actor->vel.x = FixedMul(xyscale, finecosine[angle]);
|
||||
actor->vel.y = FixedMul(xyscale, finesine[angle]);
|
||||
actor->Vel3DFromAngle(pitch, speed);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -1820,7 +1791,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
{
|
||||
static int pushtime = 0;
|
||||
bool bForceSlide = scrollx || scrolly;
|
||||
angle_t angle;
|
||||
DAngle Angle;
|
||||
fixed_t ptryx, ptryy;
|
||||
player_t *player;
|
||||
fixed_t xmove, ymove;
|
||||
|
@ -1983,7 +1954,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
|
||||
FCheckPosition tm(!!(mo->flags2 & MF2_RIP));
|
||||
|
||||
angle_t oldangle = mo->angle;
|
||||
angle_t oldangle = mo->_f_angle();
|
||||
do
|
||||
{
|
||||
if (i_compatflags & COMPATF_WALLRUN) pushtime++;
|
||||
|
@ -2123,7 +2094,7 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
// Don't change the angle if there's THRUREFLECT on the monster.
|
||||
if (!(BlockingMobj->flags7 & MF7_THRUREFLECT))
|
||||
{
|
||||
angle = BlockingMobj->AngleTo(mo);
|
||||
DAngle angle = BlockingMobj->_f_AngleTo(mo);
|
||||
bool dontReflect = (mo->AdjustReflectionAngle(BlockingMobj, angle));
|
||||
// Change angle for deflection/reflection
|
||||
|
||||
|
@ -2149,17 +2120,15 @@ fixed_t P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly)
|
|||
{
|
||||
if ((BlockingMobj->flags7 & MF7_MIRRORREFLECT) && (tg | blockingtg))
|
||||
{
|
||||
mo->angle += ANGLE_180;
|
||||
mo->Angles.Yaw += 180.;
|
||||
mo->vel.x = -mo->vel.x / 2;
|
||||
mo->vel.y = -mo->vel.y / 2;
|
||||
mo->vel.z = -mo->vel.z / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
mo->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
mo->vel.x = FixedMul(mo->Speed >> 1, finecosine[angle]);
|
||||
mo->vel.y = FixedMul(mo->Speed >> 1, finesine[angle]);
|
||||
mo->Angles.Yaw = angle;
|
||||
mo->VelFromAngle(mo->Speed / 2);
|
||||
mo->vel.z = -mo->vel.z / 2;
|
||||
}
|
||||
}
|
||||
|
@ -2220,7 +2189,7 @@ explode:
|
|||
}
|
||||
else
|
||||
{
|
||||
angle_t anglediff = (mo->angle - oldangle) >> ANGLETOFINESHIFT;
|
||||
angle_t anglediff = (mo->_f_angle() - oldangle) >> ANGLETOFINESHIFT;
|
||||
|
||||
if (anglediff != 0)
|
||||
{
|
||||
|
@ -2229,7 +2198,7 @@ explode:
|
|||
|
||||
xmove = xnew;
|
||||
ymove = ynew;
|
||||
oldangle = mo->angle; // in case more moves are needed this needs to be updated.
|
||||
oldangle = mo->_f_angle(); // in case more moves are needed this needs to be updated.
|
||||
}
|
||||
|
||||
startx = mo->X() - Scale (xmove, step, steps);
|
||||
|
@ -2855,7 +2824,7 @@ void P_NightmareRespawn (AActor *mobj)
|
|||
mo->SpawnPoint[2] = mobj->SpawnPoint[2];
|
||||
mo->SpawnAngle = mobj->SpawnAngle;
|
||||
mo->SpawnFlags = mobj->SpawnFlags & ~MTF_DORMANT; // It wasn't dormant when it died, so it's not dormant now, either.
|
||||
mo->angle = ANG45 * (mobj->SpawnAngle/45);
|
||||
mo->Angles.Yaw = mobj->SpawnAngle;
|
||||
|
||||
mo->HandleSpawnFlags ();
|
||||
mo->reactiontime = 18;
|
||||
|
@ -3119,37 +3088,37 @@ int AActor::SpecialMissileHit (AActor *victim)
|
|||
return -1;
|
||||
}
|
||||
|
||||
bool AActor::AdjustReflectionAngle (AActor *thing, angle_t &angle)
|
||||
bool AActor::AdjustReflectionAngle (AActor *thing, DAngle &angle)
|
||||
{
|
||||
if (flags2 & MF2_DONTREFLECT) return true;
|
||||
if (thing->flags7 & MF7_THRUREFLECT) return false;
|
||||
// Change angle for reflection
|
||||
if (thing->flags4&MF4_SHIELDREFLECT)
|
||||
{
|
||||
// Shield reflection (from the Centaur
|
||||
if (absangle(angle - thing->angle)>>24 > 45)
|
||||
// Shield reflection (from the Centaur)
|
||||
if (diffangle(angle, thing->Angles.Yaw) > 45)
|
||||
return true; // Let missile explode
|
||||
|
||||
if (thing->IsKindOf (RUNTIME_CLASS(AHolySpirit))) // shouldn't this be handled by another flag???
|
||||
return true;
|
||||
|
||||
if (pr_reflect () < 128)
|
||||
angle += ANGLE_45;
|
||||
angle += 45;
|
||||
else
|
||||
angle -= ANGLE_45;
|
||||
angle -= 45;
|
||||
|
||||
}
|
||||
else if (thing->flags4&MF4_DEFLECT)
|
||||
{
|
||||
// deflect (like the Heresiarch)
|
||||
if(pr_reflect() < 128)
|
||||
angle += ANG45;
|
||||
angle += 45;
|
||||
else
|
||||
angle -= ANG45;
|
||||
angle -= 45;
|
||||
}
|
||||
else
|
||||
{
|
||||
angle += ANGLE_1 * ((pr_reflect() % 16) - 8);
|
||||
angle += ((pr_reflect() % 16) - 8);
|
||||
}
|
||||
//Always check for AIMREFLECT, no matter what else is checked above.
|
||||
if (thing->flags7 & MF7_AIMREFLECT)
|
||||
|
@ -3219,7 +3188,7 @@ bool AActor::IsOkayToAttack (AActor *link)
|
|||
// to only allow the check to succeed if the enemy was in a ~84<38> FOV of the player
|
||||
if (flags3 & MF3_SCREENSEEKER)
|
||||
{
|
||||
angle_t angle = Friend->AngleTo(link) - Friend->angle;
|
||||
angle_t angle = Friend->AngleTo(link) - Friend->_f_angle();
|
||||
angle >>= 24;
|
||||
if (angle>226 || angle<30)
|
||||
{
|
||||
|
@ -3244,11 +3213,11 @@ void AActor::SetShade (int r, int g, int b)
|
|||
fillcolor = MAKEARGB(ColorMatcher.Pick (r, g, b), r, g, b);
|
||||
}
|
||||
|
||||
void AActor::SetPitch(int p, bool interpolate, bool forceclamp)
|
||||
void AActor::SetPitch(DAngle p, bool interpolate, bool forceclamp)
|
||||
{
|
||||
if (player != NULL || forceclamp)
|
||||
{ // clamp the pitch we set
|
||||
int min, max;
|
||||
DAngle min, max;
|
||||
|
||||
if (player != NULL)
|
||||
{
|
||||
|
@ -3257,14 +3226,14 @@ void AActor::SetPitch(int p, bool interpolate, bool forceclamp)
|
|||
}
|
||||
else
|
||||
{
|
||||
min = -ANGLE_90 + (1 << ANGLETOFINESHIFT);
|
||||
max = ANGLE_90 - (1 << ANGLETOFINESHIFT);
|
||||
min = -89.;
|
||||
max = 89.;
|
||||
}
|
||||
p = clamp<int>(p, min, max);
|
||||
p = clamp(p, min, max);
|
||||
}
|
||||
if (p != pitch)
|
||||
if (p != Angles.Pitch)
|
||||
{
|
||||
pitch = p;
|
||||
Angles.Pitch = p;
|
||||
if (player != NULL && interpolate)
|
||||
{
|
||||
player->cheats |= CF_INTERPVIEW;
|
||||
|
@ -3272,11 +3241,11 @@ void AActor::SetPitch(int p, bool interpolate, bool forceclamp)
|
|||
}
|
||||
}
|
||||
|
||||
void AActor::SetAngle(angle_t ang, bool interpolate)
|
||||
void AActor::SetAngle(DAngle ang, bool interpolate)
|
||||
{
|
||||
if (ang != angle)
|
||||
if (ang != Angles.Yaw)
|
||||
{
|
||||
angle = ang;
|
||||
Angles.Yaw = ang;
|
||||
if (player != NULL && interpolate)
|
||||
{
|
||||
player->cheats |= CF_INTERPVIEW;
|
||||
|
@ -3284,11 +3253,11 @@ void AActor::SetAngle(angle_t ang, bool interpolate)
|
|||
}
|
||||
}
|
||||
|
||||
void AActor::SetRoll(angle_t r, bool interpolate)
|
||||
void AActor::SetRoll(DAngle r, bool interpolate)
|
||||
{
|
||||
if (r != roll)
|
||||
if (r != Angles.Roll)
|
||||
{
|
||||
roll = r;
|
||||
Angles.Roll = r;
|
||||
if (player != NULL && interpolate)
|
||||
{
|
||||
player->cheats |= CF_INTERPVIEW;
|
||||
|
@ -4453,7 +4422,7 @@ void AActor::PostBeginPlay ()
|
|||
{
|
||||
Renderer->StateChanged(this);
|
||||
}
|
||||
PrevAngle = angle;
|
||||
PrevAngles = Angles;
|
||||
flags7 |= MF7_HANDLENODELAY;
|
||||
}
|
||||
|
||||
|
@ -4613,7 +4582,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
|||
APlayerPawn *mobj, *oldactor;
|
||||
BYTE state;
|
||||
fixed_t spawn_x, spawn_y, spawn_z;
|
||||
angle_t spawn_angle;
|
||||
DAngle SpawnAngle;
|
||||
|
||||
if (mthing == NULL)
|
||||
{
|
||||
|
@ -4672,25 +4641,18 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
|||
spawn_y = p->mo->Y();
|
||||
spawn_z = p->mo->Z();
|
||||
|
||||
spawn_angle = p->mo->angle;
|
||||
SpawnAngle = p->mo->Angles.Yaw;
|
||||
}
|
||||
else
|
||||
{
|
||||
spawn_x = mthing->x;
|
||||
spawn_y = mthing->y;
|
||||
|
||||
// Allow full angular precision but avoid roundoff errors for multiples of 45 degrees.
|
||||
if (mthing->angle % 45 != 0)
|
||||
{
|
||||
spawn_angle = mthing->angle * (ANG45 / 45);
|
||||
}
|
||||
else
|
||||
{
|
||||
spawn_angle = ANG45 * (mthing->angle / 45);
|
||||
}
|
||||
// Allow full angular precision
|
||||
SpawnAngle = mthing->angle;
|
||||
if (i_compatflags2 & COMPATF2_BADANGLES)
|
||||
{
|
||||
spawn_angle += 1 << ANGLETOFINESHIFT;
|
||||
SpawnAngle += 0.01;
|
||||
}
|
||||
|
||||
if (GetDefaultByType(p->cls)->flags & MF_SPAWNCEILING)
|
||||
|
@ -4741,8 +4703,8 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
|||
mobj->Translation = TRANSLATION(TRANSLATION_Players,playernum);
|
||||
}
|
||||
|
||||
mobj->angle = spawn_angle;
|
||||
mobj->pitch = mobj->roll = 0;
|
||||
mobj->Angles.Yaw = SpawnAngle;
|
||||
mobj->Angles.Pitch = mobj->Angles.Roll = 0;
|
||||
mobj->health = p->health;
|
||||
|
||||
// [RH] Set player sprite based on skin
|
||||
|
@ -4829,7 +4791,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
|||
|
||||
if (multiplayer)
|
||||
{
|
||||
unsigned an = mobj->angle >> ANGLETOFINESHIFT;
|
||||
unsigned an = mobj->_f_angle() >> ANGLETOFINESHIFT;
|
||||
Spawn ("TeleportFog", mobj->Vec3Offset(20*finecosine[an], 20*finesine[an], TELEFOGHEIGHT), ALLOW_REPLACE);
|
||||
}
|
||||
|
||||
|
@ -4946,7 +4908,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
|||
polyspawn->x = mthing->x;
|
||||
polyspawn->y = mthing->y;
|
||||
polyspawn->angle = mthing->angle;
|
||||
polyspawn->type = mentry->Special;
|
||||
polyspawn->type = mentry->Special;
|
||||
polyspawns = polyspawn;
|
||||
if (mentry->Special != SMT_PolyAnchor)
|
||||
po_NumPolyobjs++;
|
||||
|
@ -5205,7 +5167,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
|||
mobj->tid = mthing->thingid;
|
||||
mobj->AddToHash ();
|
||||
|
||||
mobj->PrevAngle = mobj->angle = (DWORD)((mthing->angle * CONST64(0x100000000)) / 360);
|
||||
mobj->PrevAngles.Yaw = mobj->Angles.Yaw = mthing->angle;
|
||||
|
||||
// Check if this actor's mapthing has a conversation defined
|
||||
if (mthing->Conversation > 0)
|
||||
|
@ -5229,9 +5191,9 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
|||
if (mthing->scaleY)
|
||||
mobj->scaleY = FixedMul(mthing->scaleY, mobj->scaleY);
|
||||
if (mthing->pitch)
|
||||
mobj->pitch = ANGLE_1 * mthing->pitch;
|
||||
mobj->Angles.Pitch = mthing->pitch;
|
||||
if (mthing->roll)
|
||||
mobj->roll = ANGLE_1 * mthing->roll;
|
||||
mobj->Angles.Roll = mthing->roll;
|
||||
if (mthing->score)
|
||||
mobj->Score = mthing->score;
|
||||
if (mthing->fillcolor)
|
||||
|
@ -5295,7 +5257,7 @@ AActor *P_SpawnPuff (AActor *source, PClassActor *pufftype, fixed_t x, fixed_t y
|
|||
puff->target = source;
|
||||
|
||||
// Angle is the opposite of the hit direction (i.e. the puff faces the source.)
|
||||
puff->angle = hitdir + ANGLE_180;
|
||||
puff->Angles.Yaw = ANGLE2DBL(hitdir + ANGLE_180);
|
||||
|
||||
// If a puff has a crash state and an actor was not hit,
|
||||
// it will enter the crash state. This is used by the StrifeSpark
|
||||
|
@ -5361,7 +5323,7 @@ void P_SpawnBlood (fixed_t x, fixed_t y, fixed_t z, angle_t dir, int damage, AAc
|
|||
z += pr_spawnblood.Random2 () << 10;
|
||||
th = Spawn (bloodcls, x, y, z, NO_REPLACE); // GetBloodType already performed the replacement
|
||||
th->vel.z = FRACUNIT*2;
|
||||
th->angle = dir;
|
||||
th->Angles.Yaw = ANGLE2DBL(dir);
|
||||
// [NG] Applying PUFFGETSOWNER to the blood will make it target the owner
|
||||
if (th->flags5 & MF5_PUFFGETSOWNER) th->target = originator;
|
||||
if (gameinfo.gametype & GAME_DoomChex)
|
||||
|
@ -6029,7 +5991,7 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
|||
th->vel.y = newy;
|
||||
}
|
||||
|
||||
th->angle = R_PointToAngle2 (0, 0, th->vel.x, th->vel.y);
|
||||
th->AngleFromVel();
|
||||
|
||||
if (th->flags4 & MF4_SPECTRAL)
|
||||
{
|
||||
|
@ -6045,17 +6007,14 @@ AActor *P_OldSpawnMissile(AActor *source, AActor *owner, AActor *dest, PClassAct
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
angle_t an;
|
||||
fixed_t dist;
|
||||
AActor *th = Spawn (type, source->PosPlusZ(4*8*FRACUNIT), ALLOW_REPLACE);
|
||||
|
||||
P_PlaySpawnSound(th, source);
|
||||
th->target = owner; // record missile's originator
|
||||
|
||||
th->angle = an = source->AngleTo(dest);
|
||||
an >>= ANGLETOFINESHIFT;
|
||||
th->vel.x = FixedMul (th->Speed, finecosine[an]);
|
||||
th->vel.y = FixedMul (th->Speed, finesine[an]);
|
||||
th->Angles.Yaw = source->_f_AngleTo(dest);
|
||||
th->VelFromAngle();
|
||||
|
||||
dist = source->AproxDistance (dest);
|
||||
if (th->Speed) dist = dist / th->Speed;
|
||||
|
@ -6112,7 +6071,7 @@ AActor *P_SpawnMissileZAimed (AActor *source, fixed_t z, AActor *dest, PClassAct
|
|||
fixed_t speed;
|
||||
fixed_t vz;
|
||||
|
||||
an = source->angle;
|
||||
an = source->_f_angle();
|
||||
|
||||
if (dest->flags & MF_SHADOW)
|
||||
{
|
||||
|
@ -6164,10 +6123,8 @@ AActor *P_SpawnMissileAngleZSpeed (AActor *source, fixed_t z,
|
|||
P_PlaySpawnSound(mo, source);
|
||||
if (owner == NULL) owner = source;
|
||||
mo->target = owner;
|
||||
mo->angle = angle;
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
mo->vel.x = FixedMul (speed, finecosine[angle]);
|
||||
mo->vel.y = FixedMul (speed, finesine[angle]);
|
||||
mo->Angles.Yaw = ANGLE2DBL(angle);
|
||||
mo->VelFromAngle(speed);
|
||||
mo->vel.z = vz;
|
||||
|
||||
if (mo->flags4 & MF4_SPECTRAL)
|
||||
|
@ -6193,7 +6150,7 @@ AActor *P_SpawnPlayerMissile (AActor *source, PClassActor *type)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
return P_SpawnPlayerMissile (source, 0, 0, 0, type, source->angle);
|
||||
return P_SpawnPlayerMissile (source, 0, 0, 0, type, source->_f_angle());
|
||||
}
|
||||
|
||||
AActor *P_SpawnPlayerMissile (AActor *source, PClassActor *type, angle_t angle)
|
||||
|
@ -6221,7 +6178,7 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z,
|
|||
{
|
||||
// Keep exactly the same angle and pitch as the player's own aim
|
||||
an = angle;
|
||||
pitch = source->pitch;
|
||||
pitch = source->_f_pitch();
|
||||
pLineTarget->linetarget = NULL;
|
||||
}
|
||||
else // see which target is to be aimed at
|
||||
|
@ -6279,25 +6236,15 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z,
|
|||
if (pMissileActor) *pMissileActor = MissileActor;
|
||||
P_PlaySpawnSound(MissileActor, source);
|
||||
MissileActor->target = source;
|
||||
MissileActor->angle = an;
|
||||
|
||||
fixed_t vx, vy, vz, speed;
|
||||
|
||||
vx = FixedMul (finecosine[pitch>>ANGLETOFINESHIFT], finecosine[an>>ANGLETOFINESHIFT]);
|
||||
vy = FixedMul (finecosine[pitch>>ANGLETOFINESHIFT], finesine[an>>ANGLETOFINESHIFT]);
|
||||
vz = -finesine[pitch>>ANGLETOFINESHIFT];
|
||||
speed = MissileActor->Speed;
|
||||
|
||||
DVector3 vec(vx, vy, vz);
|
||||
|
||||
if (MissileActor->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER))
|
||||
MissileActor->Angles.Yaw = ANGLE2DBL(an);
|
||||
if (MissileActor->flags3 & (MF3_FLOORHUGGER | MF3_CEILINGHUGGER))
|
||||
{
|
||||
vec.Z = 0;
|
||||
MissileActor->VelFromAngle();
|
||||
}
|
||||
else
|
||||
{
|
||||
MissileActor->Vel3DFromAngle(ANGLE2DBL(pitch), MissileActor->Speed);
|
||||
}
|
||||
vec.Resize(speed);
|
||||
MissileActor->vel.x = xs_CRoundToInt(vec.X);
|
||||
MissileActor->vel.y = xs_CRoundToInt(vec.Y);
|
||||
MissileActor->vel.z = xs_CRoundToInt(vec.Z);
|
||||
|
||||
if (MissileActor->flags4 & MF4_SPECTRAL)
|
||||
{
|
||||
|
|
|
@ -932,7 +932,7 @@ angle_t P_BulletSlope (AActor *mo, FTranslatedLineTarget *pLineTarget, int aimfl
|
|||
i = 2;
|
||||
do
|
||||
{
|
||||
an = mo->angle + angdiff[i];
|
||||
an = mo->_f_angle() + angdiff[i];
|
||||
pitch = P_AimLineAttack (mo, an, 16*64*FRACUNIT, pLineTarget, 0, aimflags);
|
||||
|
||||
if (mo->player != NULL &&
|
||||
|
@ -956,7 +956,7 @@ void P_GunShot (AActor *mo, bool accurate, PClassActor *pufftype, angle_t pitch)
|
|||
int damage;
|
||||
|
||||
damage = 5*(pr_gunshot()%3+1);
|
||||
angle = mo->angle;
|
||||
angle = mo->_f_angle();
|
||||
|
||||
if (!accurate)
|
||||
{
|
||||
|
|
|
@ -919,7 +919,7 @@ inline void P_SpawnTeleportFog(AActor *mobj, const fixedvec3 &pos, bool beforeTe
|
|||
{
|
||||
P_SpawnTeleportFog(mobj, pos.x, pos.y, pos.z, beforeTele, setTarget);
|
||||
}
|
||||
bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int flags); // bool useFog, bool sourceFog, bool keepOrientation, bool haltVelocity = true, bool keepHeight = false
|
||||
bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, DAngle angle, int flags); // bool useFog, bool sourceFog, bool keepOrientation, bool haltVelocity = true, bool keepHeight = false
|
||||
bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, int flags);
|
||||
bool EV_SilentLineTeleport (line_t *line, int side, AActor *thing, int id, INTBOOL reverse);
|
||||
bool EV_TeleportOther (int other_tid, int dest_tid, bool fog);
|
||||
|
|
|
@ -143,8 +143,8 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, fixedvec3 *optpo
|
|||
fixedvec3 pos = optpos? *optpos : user->PosRelative(line);
|
||||
dlu.x = pos.x;
|
||||
dlu.y = pos.y;
|
||||
dlu.dx = finecosine[user->angle >> ANGLETOFINESHIFT];
|
||||
dlu.dy = finesine[user->angle >> ANGLETOFINESHIFT];
|
||||
dlu.dx = finecosine[user->_f_angle() >> ANGLETOFINESHIFT];
|
||||
dlu.dy = finesine[user->_f_angle() >> ANGLETOFINESHIFT];
|
||||
inter = P_InterceptVector(&dll, &dlu);
|
||||
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ void P_SpawnTeleportFog(AActor *mobj, fixed_t x, fixed_t y, fixed_t z, bool befo
|
|||
// TELEPORTATION
|
||||
//
|
||||
|
||||
bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, int flags)
|
||||
bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, DAngle angle, int flags)
|
||||
{
|
||||
bool predicting = (thing->player && (thing->player->cheats & CF_PREDICTING));
|
||||
|
||||
|
@ -171,16 +171,16 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
|
|||
player->viewz = thing->Z() + player->viewheight;
|
||||
if (resetpitch)
|
||||
{
|
||||
player->mo->pitch = 0;
|
||||
player->mo->Angles.Pitch = 0;
|
||||
}
|
||||
}
|
||||
if (!(flags & TELF_KEEPORIENTATION))
|
||||
{
|
||||
thing->angle = angle;
|
||||
thing->Angles.Yaw = angle;
|
||||
}
|
||||
else
|
||||
{
|
||||
angle = thing->angle;
|
||||
angle = thing->Angles.Yaw;
|
||||
}
|
||||
// Spawn teleport fog at source and destination
|
||||
if ((flags & TELF_SOURCEFOG) && !predicting)
|
||||
|
@ -214,9 +214,7 @@ bool P_Teleport (AActor *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle,
|
|||
}
|
||||
if (thing->flags & MF_MISSILE)
|
||||
{
|
||||
angle >>= ANGLETOFINESHIFT;
|
||||
thing->vel.x = FixedMul (missilespeed, finecosine[angle]);
|
||||
thing->vel.y = FixedMul (missilespeed, finesine[angle]);
|
||||
thing->VelFromAngle(missilespeed);
|
||||
}
|
||||
// [BC] && bHaltVelocity.
|
||||
else if (!(flags & TELF_KEEPORIENTATION) && !(flags & TELF_KEEPVELOCITY))
|
||||
|
@ -328,10 +326,10 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, int f
|
|||
{
|
||||
AActor *searcher;
|
||||
fixed_t z;
|
||||
angle_t angle = 0;
|
||||
DAngle angle = 0;
|
||||
fixed_t s = 0, c = 0;
|
||||
fixed_t vx = 0, vy = 0;
|
||||
angle_t badangle = 0;
|
||||
DAngle badangle = 0;
|
||||
|
||||
if (thing == NULL)
|
||||
{ // Teleport function called with an invalid actor
|
||||
|
@ -358,11 +356,11 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, int f
|
|||
// Rotate 90 degrees, so that walking perpendicularly across
|
||||
// teleporter linedef causes thing to exit in the direction
|
||||
// indicated by the exit thing.
|
||||
angle = R_PointToAngle2 (0, 0, line->dx, line->dy) - searcher->angle + ANG90;
|
||||
angle = vectoyaw(DVector2(line->dx, line->dy)) - searcher->Angles.Yaw + 90;
|
||||
|
||||
// Sine, cosine of angle adjustment
|
||||
s = finesine[angle>>ANGLETOFINESHIFT];
|
||||
c = finecosine[angle>>ANGLETOFINESHIFT];
|
||||
s = FLOAT2FIXED(angle.Sin());
|
||||
c = FLOAT2FIXED(angle.Cos());
|
||||
|
||||
// Velocity of thing crossing teleporter linedef
|
||||
vx = thing->vel.x;
|
||||
|
@ -380,15 +378,15 @@ bool EV_Teleport (int tid, int tag, line_t *line, int side, AActor *thing, int f
|
|||
}
|
||||
if ((i_compatflags2 & COMPATF2_BADANGLES) && (thing->player != NULL))
|
||||
{
|
||||
badangle = 1 << ANGLETOFINESHIFT;
|
||||
badangle = 0.01;
|
||||
}
|
||||
if (P_Teleport (thing, searcher->X(), searcher->Y(), z, searcher->angle + badangle, flags))
|
||||
if (P_Teleport (thing, searcher->X(), searcher->Y(), z, searcher->Angles.Yaw + badangle, flags))
|
||||
{
|
||||
// [RH] Lee Killough's changes for silent teleporters from BOOM
|
||||
if (!(flags & TELF_DESTFOG) && line && (flags & TELF_KEEPORIENTATION))
|
||||
{
|
||||
// Rotate thing according to difference in angles
|
||||
thing->angle += angle;
|
||||
thing->Angles.Yaw += angle;
|
||||
|
||||
// Rotate thing's velocity to come out of exit just like it entered
|
||||
thing->vel.x = FixedMul(vx, c) - FixedMul(vy, s);
|
||||
|
@ -551,7 +549,7 @@ bool EV_SilentLineTeleport (line_t *line, int side, AActor *thing, int id, INTBO
|
|||
}
|
||||
|
||||
// Rotate thing's orientation according to difference in linedef angles
|
||||
thing->angle += angle;
|
||||
thing->Angles.Yaw += ANGLE2DBL(angle);
|
||||
|
||||
// Velocity of thing crossing teleporter linedef
|
||||
x = thing->vel.x;
|
||||
|
@ -611,10 +609,9 @@ bool EV_TeleportOther (int other_tid, int dest_tid, bool fog)
|
|||
|
||||
static bool DoGroupForOne (AActor *victim, AActor *source, AActor *dest, bool floorz, bool fog)
|
||||
{
|
||||
int an = (dest->angle - source->angle) >> ANGLETOFINESHIFT;
|
||||
int an = (dest->_f_angle() - source->_f_angle()) >> ANGLETOFINESHIFT;
|
||||
fixed_t offX = victim->X() - source->X();
|
||||
fixed_t offY = victim->Y() - source->Y();
|
||||
angle_t offAngle = victim->angle - source->angle;
|
||||
fixed_t newX = DMulScale16 (offX, finecosine[an], -offY, finesine[an]);
|
||||
fixed_t newY = DMulScale16 (offX, finesine[an], offY, finecosine[an]);
|
||||
|
||||
|
@ -624,7 +621,7 @@ static bool DoGroupForOne (AActor *victim, AActor *source, AActor *dest, bool fl
|
|||
floorz ? ONFLOORZ : dest->Z() + victim->Z() - source->Z(),
|
||||
0, fog ? (TELF_DESTFOG | TELF_SOURCEFOG) : TELF_KEEPORIENTATION);
|
||||
// P_Teleport only changes angle if fog is true
|
||||
victim->angle = dest->angle + offAngle;
|
||||
victim->Angles.Yaw = (dest->Angles.Yaw + victim->Angles.Yaw - source->Angles.Yaw).Normalized360();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
@ -632,7 +629,7 @@ static bool DoGroupForOne (AActor *victim, AActor *source, AActor *dest, bool fl
|
|||
#if 0
|
||||
static void MoveTheDecal (DBaseDecal *decal, fixed_t z, AActor *source, AActor *dest)
|
||||
{
|
||||
int an = (dest->angle - source->angle) >> ANGLETOFINESHIFT;
|
||||
int an = (dest->_f_angle() - source->_f_angle()) >> ANGLETOFINESHIFT;
|
||||
fixed_t offX = decal->x - source->x;
|
||||
fixed_t offY = decal->y - source->y;
|
||||
fixed_t newX = DMulScale16 (offX, finecosine[an], -offY, finesine[an]);
|
||||
|
@ -691,7 +688,7 @@ bool EV_TeleportGroup (int group_tid, AActor *victim, int source_tid, int dest_t
|
|||
didSomething |=
|
||||
P_Teleport (sourceOrigin, destOrigin->X(), destOrigin->Y(),
|
||||
floorz ? ONFLOORZ : destOrigin->Z(), 0, TELF_KEEPORIENTATION);
|
||||
sourceOrigin->angle = destOrigin->angle;
|
||||
sourceOrigin->Angles.Yaw = destOrigin->Angles.Yaw;
|
||||
}
|
||||
|
||||
return didSomething;
|
||||
|
|
|
@ -57,7 +57,7 @@ FClassMap SpawnableThings;
|
|||
|
||||
static FRandom pr_leadtarget ("LeadTarget");
|
||||
|
||||
bool P_Thing_Spawn (int tid, AActor *source, int type, angle_t angle, bool fog, int newtid)
|
||||
bool P_Thing_Spawn (int tid, AActor *source, int type, DAngle angle, bool fog, int newtid)
|
||||
{
|
||||
int rtn = 0;
|
||||
PClassActor *kind;
|
||||
|
@ -95,7 +95,7 @@ bool P_Thing_Spawn (int tid, AActor *source, int type, angle_t angle, bool fog,
|
|||
if (P_TestMobjLocation (mobj))
|
||||
{
|
||||
rtn++;
|
||||
mobj->angle = (angle != ANGLE_MAX ? angle : spot->angle);
|
||||
mobj->Angles.Yaw = (angle != 1000000. ? angle : spot->Angles.Yaw);
|
||||
if (fog)
|
||||
{
|
||||
P_SpawnTeleportFog(mobj, spot->X(), spot->Y(), spot->Z() + TELEFOGHEIGHT, false, true);
|
||||
|
@ -172,7 +172,7 @@ bool P_Thing_Move (int tid, AActor *source, int mapspot, bool fog)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool P_Thing_Projectile (int tid, AActor *source, int type, const char *type_name, angle_t angle,
|
||||
bool P_Thing_Projectile (int tid, AActor *source, int type, const char *type_name, DAngle angle,
|
||||
fixed_t speed, fixed_t vspeed, int dest, AActor *forcedest, int gravity, int newtid,
|
||||
bool leadTarget)
|
||||
{
|
||||
|
@ -303,12 +303,12 @@ bool P_Thing_Projectile (int tid, AActor *source, int type, const char *type_nam
|
|||
mobj->vel.x = fixed_t (aimvec[0] * aimscale);
|
||||
mobj->vel.y = fixed_t (aimvec[1] * aimscale);
|
||||
mobj->vel.z = fixed_t (aimvec[2] * aimscale);
|
||||
mobj->angle = R_PointToAngle2 (0, 0, mobj->vel.x, mobj->vel.y);
|
||||
mobj->AngleFromVel();
|
||||
}
|
||||
else
|
||||
{
|
||||
nolead:
|
||||
mobj->angle = mobj->AngleTo(targ);
|
||||
mobj->Angles.Yaw = mobj->_f_AngleTo(targ);
|
||||
aim.Resize (fspeed);
|
||||
mobj->vel.x = fixed_t(aim[0]);
|
||||
mobj->vel.y = fixed_t(aim[1]);
|
||||
|
@ -321,9 +321,8 @@ nolead:
|
|||
}
|
||||
else
|
||||
{
|
||||
mobj->angle = angle;
|
||||
mobj->vel.x = FixedMul (speed, finecosine[angle>>ANGLETOFINESHIFT]);
|
||||
mobj->vel.y = FixedMul (speed, finesine[angle>>ANGLETOFINESHIFT]);
|
||||
mobj->Angles.Yaw = angle;
|
||||
mobj->VelFromAngle();
|
||||
mobj->vel.z = vspeed;
|
||||
}
|
||||
// Set the missile's speed to reflect the speed it was spawned at.
|
||||
|
@ -701,7 +700,7 @@ int P_Thing_Warp(AActor *caller, AActor *reference, fixed_t xofs, fixed_t yofs,
|
|||
|
||||
if (!(flags & WARPF_ABSOLUTEANGLE))
|
||||
{
|
||||
angle += (flags & WARPF_USECALLERANGLE) ? caller->angle : reference->angle;
|
||||
angle += (flags & WARPF_USECALLERANGLE) ? caller->_f_angle() : reference->_f_angle();
|
||||
}
|
||||
|
||||
const fixed_t rad = FixedMul(radiusoffset, reference->radius);
|
||||
|
@ -762,13 +761,13 @@ int P_Thing_Warp(AActor *caller, AActor *reference, fixed_t xofs, fixed_t yofs,
|
|||
}
|
||||
else
|
||||
{
|
||||
caller->angle = angle;
|
||||
caller->Angles.Yaw = ANGLE2DBL(angle);
|
||||
|
||||
if (flags & WARPF_COPYPITCH)
|
||||
caller->SetPitch(reference->pitch, false);
|
||||
caller->SetPitch(reference->Angles.Pitch, false);
|
||||
|
||||
if (pitch)
|
||||
caller->SetPitch(caller->pitch + pitch, false);
|
||||
caller->SetPitch(caller->Angles.Pitch + ANGLE2DBL(pitch), false);
|
||||
|
||||
if (flags & WARPF_COPYVELOCITY)
|
||||
{
|
||||
|
|
|
@ -1660,7 +1660,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SkullPop)
|
|||
mo->ObtainInventory (self);
|
||||
mo->player = player;
|
||||
mo->health = self->health;
|
||||
mo->angle = self->angle;
|
||||
mo->Angles.Yaw = self->Angles.Yaw;
|
||||
if (player != NULL)
|
||||
{
|
||||
player->mo = mo;
|
||||
|
@ -1768,9 +1768,9 @@ void P_ForwardThrust (player_t *player, angle_t angle, fixed_t move)
|
|||
angle >>= ANGLETOFINESHIFT;
|
||||
|
||||
if ((player->mo->waterlevel || (player->mo->flags & MF_NOGRAVITY))
|
||||
&& player->mo->pitch != 0)
|
||||
&& player->mo->_f_pitch() != 0)
|
||||
{
|
||||
angle_t pitch = (angle_t)player->mo->pitch >> ANGLETOFINESHIFT;
|
||||
angle_t pitch = (angle_t)player->mo->_f_pitch() >> ANGLETOFINESHIFT;
|
||||
fixed_t zpush = FixedMul (move, finesine[pitch]);
|
||||
if (player->mo->waterlevel && player->mo->waterlevel < 2 && zpush < 0)
|
||||
zpush = 0;
|
||||
|
@ -1796,9 +1796,9 @@ void P_Bob (player_t *player, angle_t angle, fixed_t move, bool forward)
|
|||
{
|
||||
if (forward
|
||||
&& (player->mo->waterlevel || (player->mo->flags & MF_NOGRAVITY))
|
||||
&& player->mo->pitch != 0)
|
||||
&& player->mo->_f_pitch() != 0)
|
||||
{
|
||||
angle_t pitch = (angle_t)player->mo->pitch >> ANGLETOFINESHIFT;
|
||||
angle_t pitch = (angle_t)player->mo->_f_pitch() >> ANGLETOFINESHIFT;
|
||||
move = FixedMul (move, finecosine[pitch]);
|
||||
}
|
||||
|
||||
|
@ -1956,11 +1956,11 @@ void P_MovePlayer (player_t *player)
|
|||
if (player->turnticks)
|
||||
{
|
||||
player->turnticks--;
|
||||
mo->angle += (ANGLE_180 / TURN180_TICKS);
|
||||
mo->Angles.Yaw += (180. / TURN180_TICKS);
|
||||
}
|
||||
else
|
||||
{
|
||||
mo->angle += cmd->ucmd.yaw << 16;
|
||||
mo->Angles.Yaw += cmd->ucmd.yaw * (360./65536.);
|
||||
}
|
||||
|
||||
player->onground = (mo->Z() <= mo->floorz) || (mo->flags2 & MF2_ONMOBJ) || (mo->BounceFlags & BOUNCE_MBF) || (player->cheats & CF_NOCLIP2);
|
||||
|
@ -2007,13 +2007,13 @@ void P_MovePlayer (player_t *player)
|
|||
|
||||
if (forwardmove)
|
||||
{
|
||||
P_Bob (player, mo->angle, (cmd->ucmd.forwardmove * bobfactor) >> 8, true);
|
||||
P_ForwardThrust (player, mo->angle, forwardmove);
|
||||
P_Bob (player, mo->_f_angle(), (cmd->ucmd.forwardmove * bobfactor) >> 8, true);
|
||||
P_ForwardThrust (player, mo->_f_angle(), forwardmove);
|
||||
}
|
||||
if (sidemove)
|
||||
{
|
||||
P_Bob (player, mo->angle-ANG90, (cmd->ucmd.sidemove * bobfactor) >> 8, false);
|
||||
P_SideThrust (player, mo->angle, sidemove);
|
||||
P_Bob (player, mo->_f_angle()-ANG90, (cmd->ucmd.sidemove * bobfactor) >> 8, false);
|
||||
P_SideThrust (player, mo->_f_angle(), sidemove);
|
||||
}
|
||||
|
||||
if (debugfile)
|
||||
|
@ -2147,8 +2147,7 @@ void P_FallingDamage (AActor *actor)
|
|||
void P_DeathThink (player_t *player)
|
||||
{
|
||||
int dir;
|
||||
angle_t delta;
|
||||
int lookDelta;
|
||||
DAngle delta;
|
||||
|
||||
P_MovePsprites (player);
|
||||
|
||||
|
@ -2159,10 +2158,10 @@ void P_DeathThink (player_t *player)
|
|||
player->deltaviewheight = 0;
|
||||
if (player->onground)
|
||||
{
|
||||
if (player->mo->pitch > -(int)ANGLE_1*19)
|
||||
if (player->mo->Angles.Pitch > -19.)
|
||||
{
|
||||
lookDelta = (-(int)ANGLE_1*19 - player->mo->pitch) / 8;
|
||||
player->mo->pitch += lookDelta;
|
||||
DAngle lookDelta = (-19. - player->mo->Angles.Pitch) / 8;
|
||||
player->mo->Angles.Pitch += lookDelta;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2177,17 +2176,17 @@ void P_DeathThink (player_t *player)
|
|||
{
|
||||
player->viewheight = 6*FRACUNIT;
|
||||
}
|
||||
if (player->mo->pitch < 0)
|
||||
if (player->mo->Angles.Pitch < 0)
|
||||
{
|
||||
player->mo->pitch += ANGLE_1*3;
|
||||
player->mo->Angles.Pitch += 3;
|
||||
}
|
||||
else if (player->mo->pitch > 0)
|
||||
else if (player->mo->Angles.Pitch > 0)
|
||||
{
|
||||
player->mo->pitch -= ANGLE_1*3;
|
||||
player->mo->Angles.Pitch -= 3;
|
||||
}
|
||||
if (abs(player->mo->pitch) < ANGLE_1*3)
|
||||
if (fabs(player->mo->Angles.Pitch) < 3)
|
||||
{
|
||||
player->mo->pitch = 0;
|
||||
player->mo->Angles.Pitch = 0;
|
||||
}
|
||||
}
|
||||
P_CalcHeight (player);
|
||||
|
@ -2195,7 +2194,7 @@ void P_DeathThink (player_t *player)
|
|||
if (player->attacker && player->attacker != player->mo)
|
||||
{ // Watch killer
|
||||
dir = P_FaceMobj (player->mo, player->attacker, &delta);
|
||||
if (delta < ANGLE_1*10)
|
||||
if (delta < 10)
|
||||
{ // Looking at killer, so fade damage and poison counters
|
||||
if (player->damagecount)
|
||||
{
|
||||
|
@ -2207,17 +2206,17 @@ void P_DeathThink (player_t *player)
|
|||
}
|
||||
}
|
||||
delta /= 8;
|
||||
if (delta > ANGLE_1*5)
|
||||
if (delta > 5)
|
||||
{
|
||||
delta = ANGLE_1*5;
|
||||
delta = 5;
|
||||
}
|
||||
if (dir)
|
||||
{ // Turn clockwise
|
||||
player->mo->angle += delta;
|
||||
player->mo->Angles.Yaw += delta;
|
||||
}
|
||||
else
|
||||
{ // Turn counter clockwise
|
||||
player->mo->angle -= delta;
|
||||
player->mo->Angles.Yaw -= delta;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -2304,7 +2303,7 @@ void P_PlayerThink (player_t *player)
|
|||
{
|
||||
fprintf (debugfile, "tic %d for pl %d: (%d, %d, %d, %u) b:%02x p:%d y:%d f:%d s:%d u:%d\n",
|
||||
gametic, (int)(player-players), player->mo->X(), player->mo->Y(), player->mo->Z(),
|
||||
player->mo->angle>>ANGLETOFINESHIFT, player->cmd.ucmd.buttons,
|
||||
player->mo->_f_angle()>>ANGLETOFINESHIFT, player->cmd.ucmd.buttons,
|
||||
player->cmd.ucmd.pitch, player->cmd.ucmd.yaw, player->cmd.ucmd.forwardmove,
|
||||
player->cmd.ucmd.sidemove, player->cmd.ucmd.upmove);
|
||||
}
|
||||
|
@ -2493,54 +2492,38 @@ void P_PlayerThink (player_t *player)
|
|||
// [RH] Look up/down stuff
|
||||
if (!level.IsFreelookAllowed())
|
||||
{
|
||||
player->mo->pitch = 0;
|
||||
player->mo->Angles.Pitch = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
int look = cmd->ucmd.pitch << 16;
|
||||
|
||||
// The player's view pitch is clamped between -32 and +56 degrees,
|
||||
// which translates to about half a screen height up and (more than)
|
||||
// one full screen height down from straight ahead when view panning
|
||||
// is used.
|
||||
if (look)
|
||||
int clook = cmd->ucmd.pitch;
|
||||
if (clook != 0)
|
||||
{
|
||||
if (look == -32768 << 16)
|
||||
if (clook == -32768)
|
||||
{ // center view
|
||||
player->centering = true;
|
||||
}
|
||||
else if (!player->centering)
|
||||
{
|
||||
fixed_t oldpitch = player->mo->pitch;
|
||||
player->mo->pitch -= look;
|
||||
if (look > 0)
|
||||
{ // look up
|
||||
player->mo->pitch = MAX(player->mo->pitch, player->MinPitch);
|
||||
if (player->mo->pitch > oldpitch)
|
||||
{
|
||||
player->mo->pitch = player->MinPitch;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // look down
|
||||
player->mo->pitch = MIN(player->mo->pitch, player->MaxPitch);
|
||||
if (player->mo->pitch < oldpitch)
|
||||
{
|
||||
player->mo->pitch = player->MaxPitch;
|
||||
}
|
||||
}
|
||||
// no more overflows with floating point. Yay! :)
|
||||
player->mo->Angles.Pitch = clamp(player->mo->Angles.Pitch - clook * (360. / 65536.), player->MinPitch, player->MaxPitch);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (player->centering)
|
||||
{
|
||||
if (abs(player->mo->pitch) > 2*ANGLE_1)
|
||||
player->mo->Angles.Pitch.Normalize180(); // make sure we are in the proper range here for the following code.
|
||||
if (fabs(player->mo->Angles.Pitch) > 2.)
|
||||
{
|
||||
player->mo->pitch = FixedMul(player->mo->pitch, FRACUNIT*2/3);
|
||||
player->mo->Angles.Pitch *= (2. / 3.);
|
||||
}
|
||||
else
|
||||
{
|
||||
player->mo->pitch = 0;
|
||||
player->mo->Angles.Pitch = 0;
|
||||
player->centering = false;
|
||||
if (player - players == consoleplayer)
|
||||
{
|
||||
|
@ -3158,7 +3141,7 @@ void player_t::Serialize (FArchive &arc)
|
|||
arc << LogText
|
||||
<< ConversationNPC
|
||||
<< ConversationPC
|
||||
<< ConversationNPCAngle
|
||||
<< ConversationNPCAngle.Degrees
|
||||
<< ConversationFaceTalker;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
|
|
|
@ -102,7 +102,7 @@ static int WriteTHINGS (FILE *file)
|
|||
|
||||
mt.x = LittleShort(short(mo->X() >> FRACBITS));
|
||||
mt.y = LittleShort(short(mo->Y() >> FRACBITS));
|
||||
mt.angle = LittleShort(short(MulScale32 (mo->angle >> ANGLETOFINESHIFT, 360)));
|
||||
mt.angle = LittleShort(short(MulScale32 (mo->_f_angle() >> ANGLETOFINESHIFT, 360)));
|
||||
mt.type = LittleShort((short)1);
|
||||
mt.flags = LittleShort((short)(7|224|MTF_SINGLE));
|
||||
fwrite (&mt, sizeof(mt), 1, file);
|
||||
|
|
|
@ -174,8 +174,6 @@ void PO_Init (void);
|
|||
|
||||
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
|
||||
|
||||
static void RotatePt (int an, fixed_t *x, fixed_t *y, fixed_t startSpotX,
|
||||
fixed_t startSpotY);
|
||||
static void UnLinkPolyobj (FPolyObj *po);
|
||||
static void LinkPolyobj (FPolyObj *po);
|
||||
static bool CheckMobjBlocking (side_t *seg, FPolyObj *po);
|
||||
|
@ -1036,13 +1034,16 @@ void FPolyObj::DoMovePolyobj (int x, int y)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
static void RotatePt (int an, fixed_t *x, fixed_t *y, fixed_t startSpotX, fixed_t startSpotY)
|
||||
static void RotatePt (DAngle an, fixed_t *x, fixed_t *y, fixed_t startSpotX, fixed_t startSpotY)
|
||||
{
|
||||
fixed_t tr_x = *x;
|
||||
fixed_t tr_y = *y;
|
||||
|
||||
*x = (DMulScale16 (tr_x, finecosine[an], -tr_y, finesine[an]) & 0xFFFFFE00) + startSpotX;
|
||||
*y = (DMulScale16 (tr_x, finesine[an], tr_y, finecosine[an]) & 0xFFFFFE00) + startSpotY;
|
||||
double s = an.Sin();
|
||||
double c = an.Cos();
|
||||
|
||||
*x = (xs_CRoundToInt(tr_x * c - tr_y*s) & 0xfffffe00) + startSpotX;
|
||||
*y = (xs_CRoundToInt(tr_x * s + tr_y*c) & 0xfffffe00) + startSpotX;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -1053,11 +1054,11 @@ static void RotatePt (int an, fixed_t *x, fixed_t *y, fixed_t startSpotX, fixed_
|
|||
|
||||
bool FPolyObj::RotatePolyobj (angle_t angle, bool fromsave)
|
||||
{
|
||||
int an;
|
||||
DAngle an;
|
||||
bool blocked;
|
||||
FBoundingBox oldbounds = Bounds;
|
||||
|
||||
an = (this->angle+angle)>>ANGLETOFINESHIFT;
|
||||
an = ANGLE2DBL(this->angle + angle);
|
||||
|
||||
UnLinkPolyobj();
|
||||
|
||||
|
|
|
@ -253,7 +253,7 @@ static void SetRotation(FLinePortal *port)
|
|||
double angle = g_atan2(dst->dy, dst->dx) - g_atan2(line->dy, line->dx) + M_PI;
|
||||
port->mSinRot = FLOAT2FIXED(g_sin(angle));
|
||||
port->mCosRot = FLOAT2FIXED(g_cos(angle));
|
||||
port->mAngleDiff = RAD2ANGLE(angle);
|
||||
port->mAngleDiff = ToDegrees(angle);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -606,12 +606,12 @@ void P_TranslatePortalVXVY(line_t* src, fixed_t& vx, fixed_t& vy)
|
|||
//
|
||||
//============================================================================
|
||||
|
||||
void P_TranslatePortalAngle(line_t* src, angle_t& angle)
|
||||
void P_TranslatePortalAngle(line_t* src, DAngle& angle)
|
||||
{
|
||||
if (!src) return;
|
||||
FLinePortal *port = src->getPortal();
|
||||
if (!port) return;
|
||||
angle += port->mAngleDiff;
|
||||
angle = (angle + port->mAngleDiff).Normalized360();
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
|
|
@ -179,7 +179,7 @@ struct FLinePortal
|
|||
BYTE mFlags;
|
||||
BYTE mDefFlags;
|
||||
BYTE mAlign;
|
||||
angle_t mAngleDiff;
|
||||
DAngle mAngleDiff;
|
||||
fixed_t mSinRot;
|
||||
fixed_t mCosRot;
|
||||
};
|
||||
|
@ -203,7 +203,7 @@ inline int P_NumPortalGroups()
|
|||
bool P_ClipLineToPortal(line_t* line, line_t* portal, fixed_t viewx, fixed_t viewy, bool partial = true, bool samebehind = true);
|
||||
void P_TranslatePortalXY(line_t* src, fixed_t& x, fixed_t& y);
|
||||
void P_TranslatePortalVXVY(line_t* src, fixed_t& vx, fixed_t& vy);
|
||||
void P_TranslatePortalAngle(line_t* src, angle_t& angle);
|
||||
void P_TranslatePortalAngle(line_t* src, DAngle& angle);
|
||||
void P_TranslatePortalZ(line_t* src, fixed_t& z);
|
||||
void P_NormalizeVXVY(fixed_t& vx, fixed_t& vy);
|
||||
fixed_t P_PointLineDistance(line_t* line, fixed_t x, fixed_t y);
|
||||
|
|
|
@ -491,7 +491,7 @@ void SDLFB::Update ()
|
|||
return;
|
||||
|
||||
pixels = Surface->pixels;
|
||||
pitch = Surface->pitch;
|
||||
pitch = Surface->_f_pitch();
|
||||
}
|
||||
|
||||
if (NotPaletted)
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue