mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 04:24:39 +00:00
- handle all remaining move_sprite calls.
int_ceiling_dist and int_floor_dist are gone
This commit is contained in:
parent
55eb824e7d
commit
620de9ebf7
6 changed files with 20 additions and 30 deletions
|
@ -943,8 +943,6 @@ struct USER
|
|||
memset(&WallP, 0, sizeof(USER) - myoffsetof(USER, WallP));
|
||||
}
|
||||
|
||||
int int_ceiling_dist() const { return ceiling_dist * zworldtoint; }
|
||||
int int_floor_dist() const { return floor_dist * zworldtoint; }
|
||||
vec3_t int_change() const { return { int(change.X * worldtoint), int(change.Y * worldtoint), int(change.Z * zworldtoint) }; }
|
||||
void set_int_change_x(int x) { change.X = x * inttoworld; }
|
||||
void set_int_change_y(int x) { change.Y = x * inttoworld; }
|
||||
|
|
|
@ -4453,17 +4453,14 @@ void DoPlayerDive(PLAYER* pp)
|
|||
if ((!Prediction && pp->z_speed && ((RANDOM_P2(1024<<5)>>5) < 64)) ||
|
||||
(PLAYER_MOVING(pp) && (RANDOM_P2(1024<<5)>>5) < 64))
|
||||
{
|
||||
int nx,ny;
|
||||
|
||||
PlaySound(DIGI_BUBBLES, pp, v3df_none);
|
||||
auto bubble = SpawnBubble(pp->actor);
|
||||
if (bubble != nullptr)
|
||||
{
|
||||
// back it up a bit to get it out of your face
|
||||
nx = MOVEx((128+64), NORM_ANGLE(bubble->int_ang() + 1024));
|
||||
ny = MOVEy((128+64), NORM_ANGLE(bubble->int_ang() + 1024));
|
||||
auto vec = MOVExy((128+64), bubble->spr.angle + DAngle180);
|
||||
|
||||
move_sprite(bubble, nx, ny, 0L, plActor->user.int_ceiling_dist(), plActor->user.int_floor_dist(), 0, synctics);
|
||||
move_sprite(bubble, DVector3(vec, 0), plActor->user.ceiling_dist, plActor->user.floor_dist, 0, synctics);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1040,17 +1040,14 @@ int DoRipperHangJF(DSWActor* actor)
|
|||
int DoRipperBeginJumpAttack(DSWActor* actor)
|
||||
{
|
||||
DSWActor* target = actor->user.targetActor;
|
||||
short tang;
|
||||
|
||||
tang = getangle(target->int_pos().X - actor->int_pos().X, target->int_pos().Y - actor->int_pos().Y);
|
||||
|
||||
Collision coll = move_sprite(actor, bcos(tang, -7), bsin(tang, -7),
|
||||
0L, actor->user.int_ceiling_dist(), actor->user.int_floor_dist(), CLIPMASK_ACTOR, ACTORMOVETICS);
|
||||
auto vec = (target->spr.pos.XY() - actor->spr.pos.XY()).Unit() * 8;
|
||||
Collision coll = move_sprite(actor, DVector3(vec, 0), actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS);
|
||||
|
||||
if (coll.type != kHitNone)
|
||||
actor->set_int_ang(NORM_ANGLE((actor->int_ang() + 1024) + (RANDOM_NEG(256, 6) >> 6)));
|
||||
actor->spr.angle += DAngle180 + DAngle::fromBuild(RANDOM_NEG(256, 6) >> 6);
|
||||
else
|
||||
actor->set_int_ang(NORM_ANGLE(tang + (RANDOM_NEG(256, 6) >> 6)));
|
||||
actor->spr.angle = VecToAngle(vec) + DAngle::fromBuild(RANDOM_NEG(256, 6) >> 6);
|
||||
|
||||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
|
||||
|
|
|
@ -1062,19 +1062,16 @@ int DoRipper2HangJF(DSWActor* actor)
|
|||
int DoRipper2BeginJumpAttack(DSWActor* actor)
|
||||
{
|
||||
DSWActor* target = actor->user.targetActor;
|
||||
short tang;
|
||||
|
||||
tang = getangle(target->int_pos().X - actor->int_pos().X, target->int_pos().Y - actor->int_pos().Y);
|
||||
// Always jump at player if mad.
|
||||
|
||||
// Always jump at player if mad.
|
||||
|
||||
Collision coll = move_sprite(actor, bcos(tang, -7), bsin(tang, -7),
|
||||
0, actor->user.int_ceiling_dist(), actor->user.int_floor_dist(), CLIPMASK_ACTOR, ACTORMOVETICS);
|
||||
if (coll.type != kHitNone)
|
||||
actor->set_int_ang(NORM_ANGLE((actor->int_ang() + 1024) + (RANDOM_NEG(256, 6) >> 6)));
|
||||
else
|
||||
actor->set_int_ang(NORM_ANGLE(tang));
|
||||
auto vec = (target->spr.pos.XY() - actor->spr.pos.XY()).Unit() * 8;
|
||||
Collision coll = move_sprite(actor, DVector3(vec, 0), actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS);
|
||||
|
||||
if (coll.type != kHitNone)
|
||||
actor->spr.angle += DAngle180 + DAngle::fromBuild(RANDOM_NEG(256, 6) >> 6);
|
||||
else
|
||||
actor->spr.angle = VecToAngle(vec);
|
||||
|
||||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
|
||||
|
|
|
@ -4598,6 +4598,7 @@ bool DropAhead(DSWActor* actor, int min_height)
|
|||
|
||||
int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
|
||||
{
|
||||
DVector3 change(xchange * inttoworld, ychange * inttoworld, zchange * zinttoworld);
|
||||
DSWActor* highActor;
|
||||
DSWActor* lowActor;
|
||||
sectortype* lo_sectp,* hi_sectp;
|
||||
|
@ -4622,8 +4623,7 @@ int move_actor(DSWActor* actor, int xchange, int ychange, int zchange)
|
|||
hi_sectp = actor->user.hi_sectp;
|
||||
auto sect = actor->sector();
|
||||
|
||||
actor->user.coll = move_sprite(actor, xchange, ychange, zchange,
|
||||
actor->user.int_ceiling_dist(), actor->user.int_floor_dist(), cliptype, ACTORMOVETICS);
|
||||
actor->user.coll = move_sprite(actor, change, actor->user.ceiling_dist, actor->user.floor_dist, cliptype, ACTORMOVETICS);
|
||||
|
||||
ASSERT(actor->insector());
|
||||
|
||||
|
@ -6516,8 +6516,9 @@ Collision move_missile(DSWActor* actor, const DVector3& change, double ceil_dist
|
|||
}
|
||||
|
||||
|
||||
Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int ceildist, int flordist, uint32_t cliptype, int numtics)
|
||||
Collision move_ground_missile(DSWActor* actor, const DVector2& change, double ceildist, double flordist, uint32_t cliptype, int numtics)
|
||||
{
|
||||
int xchange = change.X * worldtoint, ychange = change.Y * worldtoint;
|
||||
Collision retval{};
|
||||
int ox,oy;
|
||||
|
||||
|
@ -6551,7 +6552,7 @@ Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int cei
|
|||
actor->user.z_tgt = 0;
|
||||
}
|
||||
|
||||
actor->add_int_pos({ xchange / 2, ychange / 2, 0 });
|
||||
actor->spr.pos += change * 0.5;
|
||||
|
||||
updatesector(actor->spr.pos, &dasect);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ struct MISSILE_PLACEMENT
|
|||
|
||||
|
||||
void SpawnZombie2(DSWActor*);
|
||||
Collision move_ground_missile(DSWActor* actor, int xchange, int ychange, int ceildist, int flordist, uint32_t cliptype, int numtics);
|
||||
Collision move_ground_missile(DSWActor* actor, const DVector2& change, double ceildist, double flordist, uint32_t cliptype, int numtics);
|
||||
void DoPlayerBeginDie(PLAYER*);
|
||||
void VehicleSetSmoke(SECTOR_OBJECT* sop, ANIMATOR* animator);
|
||||
|
||||
|
@ -10784,7 +10784,7 @@ int DoBloodWorm(DSWActor* actor)
|
|||
int xvect,yvect;
|
||||
int amt;
|
||||
|
||||
actor->user.coll = move_ground_missile(actor, actor->user.int_change().X, actor->user.int_change().Y, actor->user.int_ceiling_dist(), actor->user.int_floor_dist(), CLIPMASK_MISSILE, MISSILEMOVETICS);
|
||||
actor->user.coll = move_ground_missile(actor, actor->user.change.XY(), actor->user.ceiling_dist, actor->user.floor_dist, CLIPMASK_MISSILE, MISSILEMOVETICS);
|
||||
|
||||
if (actor->user.coll.type != kHitNone)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue