mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- floatify FacingRange
This commit is contained in:
parent
8b70326da5
commit
2fd918674d
2 changed files with 11 additions and 9 deletions
|
@ -1969,9 +1969,9 @@ inline bool PlayerFacingRange(PLAYER* pp, DSWActor* a, int range)
|
|||
return (abs(getincangle(getangle(a->spr.pos - pp->pos), (pp)->angle.ang.Buildang())) < (range));
|
||||
}
|
||||
|
||||
inline bool FacingRange(DSWActor* a1, DSWActor* a2, int range)
|
||||
inline bool FacingRange(DSWActor* a1, DSWActor* a2, DAngle range)
|
||||
{
|
||||
return (abs(getincangle(getangle(a1->spr.pos - a2->spr.pos), a2->int_ang())) < (range));
|
||||
return absangle(VecToAngle(a1->spr.pos - a2->spr.pos), a2->spr.angle) < range;
|
||||
}
|
||||
inline void SET_BOOL1(DSWActor* sp) { sp->spr.extra |= SPRX_BOOL1; }
|
||||
inline void SET_BOOL2(DSWActor* sp) { sp->spr.extra |= SPRX_BOOL2; }
|
||||
|
|
|
@ -64,6 +64,8 @@ ANIMATOR DoBettyBeginDeath;
|
|||
ANIMATOR DoSkullBeginDeath;
|
||||
ANIMATOR DoRipperGrow;
|
||||
|
||||
constexpr DAngle FacingAngle = DAngle::fromBuild(150);
|
||||
|
||||
//
|
||||
// Damage Amounts defined in damage.h
|
||||
//
|
||||
|
@ -14244,7 +14246,7 @@ int InitRipperSlash(DSWActor* actor)
|
|||
|
||||
double dist = (actor->spr.pos.XY() - itActor->spr.pos.XY()).Length();
|
||||
|
||||
if (dist < CloseRangeDist(actor, itActor, 600) && FacingRange(itActor, actor,150))
|
||||
if (dist < CloseRangeDist(actor, itActor, 600) && FacingRange(itActor, actor,FacingAngle))
|
||||
{
|
||||
DoDamage(itActor, actor);
|
||||
}
|
||||
|
@ -14277,7 +14279,7 @@ int InitBunnySlash(DSWActor* actor)
|
|||
|
||||
double dist = (actor->spr.pos.XY() - itActor->spr.pos.XY()).Length();
|
||||
|
||||
if (dist < CloseRangeDist(actor, itActor, 600) && FacingRange(itActor, actor,150))
|
||||
if (dist < CloseRangeDist(actor, itActor, 600) && FacingRange(itActor, actor,FacingAngle))
|
||||
{
|
||||
DoDamage(itActor, actor);
|
||||
}
|
||||
|
@ -14311,7 +14313,7 @@ int InitSerpSlash(DSWActor* actor)
|
|||
|
||||
double dist = (actor->spr.pos.XY() - itActor->spr.pos.XY()).Length();
|
||||
|
||||
if (dist < CloseRangeDist(actor, itActor, 800) && FacingRange(itActor, actor,150))
|
||||
if (dist < CloseRangeDist(actor, itActor, 800) && FacingRange(itActor, actor,FacingAngle))
|
||||
{
|
||||
DoDamage(itActor, actor);
|
||||
}
|
||||
|
@ -14439,7 +14441,7 @@ int InitCoolgBash(DSWActor* actor)
|
|||
|
||||
double dist = (actor->spr.pos.XY() - itActor->spr.pos.XY()).Length();
|
||||
|
||||
if (dist < CloseRangeDist(actor, itActor, 600) && FacingRange(itActor, actor,150))
|
||||
if (dist < CloseRangeDist(actor, itActor, 600) && FacingRange(itActor, actor,FacingAngle))
|
||||
{
|
||||
DoDamage(itActor, actor);
|
||||
}
|
||||
|
@ -14472,7 +14474,7 @@ int InitSkelSlash(DSWActor* actor)
|
|||
|
||||
double dist = (actor->spr.pos.XY() - itActor->spr.pos.XY()).Length();
|
||||
|
||||
if (dist < CloseRangeDist(actor, itActor, 600) && FacingRange(itActor, actor,150))
|
||||
if (dist < CloseRangeDist(actor, itActor, 600) && FacingRange(itActor, actor,FacingAngle))
|
||||
{
|
||||
DoDamage(itActor, actor);
|
||||
}
|
||||
|
@ -14505,7 +14507,7 @@ int InitGoroChop(DSWActor* actor)
|
|||
|
||||
double dist = (actor->spr.pos.XY() - itActor->spr.pos.XY()).Length();
|
||||
|
||||
if (dist < CloseRangeDist(actor, itActor, 700) && FacingRange(itActor, actor,150))
|
||||
if (dist < CloseRangeDist(actor, itActor, 700) && FacingRange(itActor, actor,FacingAngle))
|
||||
{
|
||||
PlaySound(DIGI_GRDAXEHIT, actor, v3df_none);
|
||||
DoDamage(itActor, actor);
|
||||
|
@ -15202,7 +15204,7 @@ int InitEelFire(DSWActor* actor)
|
|||
|
||||
double dist = (actor->spr.pos.XY() - itActor->spr.pos.XY()).Length();
|
||||
|
||||
if (dist < CloseRangeDist(actor, itActor, 600) && FacingRange(itActor, actor,150))
|
||||
if (dist < CloseRangeDist(actor, itActor, 600) && FacingRange(itActor, actor,FacingAngle))
|
||||
{
|
||||
PlaySound(DIGI_GIBS1, actor, v3df_none);
|
||||
DoDamage(itActor, actor);
|
||||
|
|
Loading…
Reference in a new issue