- half done with xvel

This commit is contained in:
Christoph Oelckers 2022-09-01 16:54:28 +02:00
parent 434548a5aa
commit fb1a9881e3
8 changed files with 21 additions and 21 deletions

View file

@ -1000,7 +1000,7 @@ void movemasterswitch(DDukeActor *actor)
void movetrash(DDukeActor *actor)
{
if (actor->spr.xvel == 0) actor->spr.xvel = 1;
if (actor->int_xvel() == 0) actor->spr.xvel = 1;
if (ssp(actor, CLIPMASK0))
{
makeitfall(actor);
@ -1480,12 +1480,12 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
fi.checkhitsprite(actor, coll.actor());
}
actor->spr.xvel--;
actor->add_int_xvel(-1);
if(actor->float_xvel() < 0) actor->clear_xvel();
if (actor->spr.picnum == stripeball)
{
actor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
actor->spr.cstat |= (CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP) & ESpriteFlags::FromInt(actor->spr.xvel);
actor->spr.cstat |= (CSTAT_SPRITE_XFLIP | CSTAT_SPRITE_YFLIP) & ESpriteFlags::FromInt(int(actor->float_xvel() / 16.)); // special hack edition...
}
}
else
@ -2152,7 +2152,7 @@ bool jibs(DDukeActor *actor, int JIBS6, bool timeout, bool callsetsprite, bool f
{
auto sectp = actor->sector();
if(actor->float_xvel() > 0) actor->spr.xvel--;
if(actor->float_xvel() > 0) actor->add_int_xvel(-1);
else actor->clear_xvel();
if (timeout)
@ -2398,7 +2398,7 @@ void shell(DDukeActor* actor, bool morecheck)
}
if (actor->float_zvel() < 2) actor->add_int_zvel( (gs.gravity / 3)); // 52;
if(actor->float_xvel() > 0)
actor->spr.xvel--;
actor->add_int_xvel(-1);
else
{
deletesprite(actor);
@ -2464,7 +2464,7 @@ void scrap(DDukeActor* actor, int SCRAP1, int SCRAP6)
auto sectp = actor->sector();
if(actor->float_xvel() > 0)
actor->spr.xvel--;
actor->add_int_xvel(-1);
else actor->clear_xvel();
if (actor->float_zvel() > 4 && actor->float_zvel() < 5)
@ -2779,7 +2779,7 @@ void handle_se14(DDukeActor* actor, bool checkstat, int RPG, int JIBS6)
actor->add_int_ang(q);
bool statstate = (!checkstat || ((sc->floorstat & CSTAT_SECTOR_SKY) == 0 && (sc->ceilingstat & CSTAT_SECTOR_SKY) == 0));
if (actor->spr.xvel == sc->extra)
if (actor->int_xvel() == sc->extra)
{
if (statstate)
{
@ -2954,7 +2954,7 @@ void handle_se30(DDukeActor *actor, int JIBS6)
actor->temp_data[4] = 2;
else
{
if (actor->spr.xvel == 0)
if (actor->int_xvel() == 0)
operateactivators(actor->spr.hitag + (!actor->temp_data[3]), -1);
if (actor->int_xvel() < 256)
actor->spr.xvel += 16;

View file

@ -2705,7 +2705,7 @@ DETONATEB:
}
}
}
else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->spr.xvel == 0)
else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->int_xvel() == 0)
if (cansee(actor->spr.pos.plusZ(-8), actor->sector(), ps[p].pos, ps[p].cursector))
if (ps[p].ammo_amount[HANDBOMB_WEAPON] < gs.max_ammo_amount[HANDBOMB_WEAPON])
{

View file

@ -2493,7 +2493,7 @@ DETONATEB:
return;
}
}
else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->spr.xvel == 0)
else if (actor->spr.picnum == HEAVYHBOMB && x < 788 && actor->temp_data[0] > 7 && actor->int_xvel() == 0)
if (cansee(actor->spr.pos.plusZ(-8), actor->sector(), ps[p].pos, ps[p].cursector))
if (ps[p].ammo_amount[DYNAMITE_WEAPON] < gs.max_ammo_amount[DYNAMITE_WEAPON])
if (actor->spr.pal == 0)
@ -2590,7 +2590,7 @@ static int henstand(DDukeActor *actor)
}
}
}
actor->spr.xvel--;
actor->add_int_xvel(-1);
if(actor->float_xvel() < 0) actor->clear_xvel();
actor->spr.cstat = CSTAT_SPRITE_BLOCK_ALL;
if (actor->spr.picnum == BOWLINGPIN)
@ -2853,7 +2853,7 @@ void moveactors_r(void)
MulScale(act->int_xvel(), bcos(act->int_ang()), 14),
MulScale(act->int_xvel(), bsin(act->int_ang()), 14),
act->int_zvel(),CLIPMASK0, coll);
act->spr.xvel--;
act->add_int_xvel(-1);
}
break;

View file

@ -119,7 +119,7 @@ void AIFishLimb::Tick(RunListEvent* ev)
}
else
{
auto coll = movesprite(pActor, pActor->spr.xvel << 8, pActor->spr.yvel << 8, pActor->int_zvel(), 2560, -2560, CLIPMASK1);
auto coll = movesprite(pActor, pActor->int_xvel() << 8, pActor->spr.yvel << 8, pActor->int_zvel(), 2560, -2560, CLIPMASK1);
if (coll.type != kHitNone)
{
pActor->clear_xvel();
@ -415,7 +415,7 @@ void AIFish::Tick(RunListEvent* ev)
auto pSector =pActor->sector();
// loc_2EF54
Collision coll = movesprite(pActor, pActor->spr.xvel << 13, pActor->spr.yvel << 13, pActor->int_zvel() << 2, 0, 0, CLIPMASK0);
Collision coll = movesprite(pActor, pActor->int_xvel() << 13, pActor->spr.yvel << 13, pActor->int_zvel() << 2, 0, 0, CLIPMASK0);
if (!(pActor->sector()->Flag & kSectUnderwater))
{

View file

@ -73,7 +73,7 @@ void AILavaDudeLimb::Tick(RunListEvent* ev)
pActor->spr.shade += 3;
auto coll = movesprite(pActor, pActor->spr.xvel << 12, pActor->spr.yvel << 12, pActor->int_zvel(), 2560, -2560, CLIPMASK1);
auto coll = movesprite(pActor, pActor->int_xvel() << 12, pActor->spr.yvel << 12, pActor->int_zvel(), 2560, -2560, CLIPMASK1);
if (coll.type || pActor->spr.shade > 100)
{
@ -280,7 +280,7 @@ void AILavaDude::Tick(RunListEvent* ev)
auto pos = pActor->spr.pos;
auto pSector =pActor->sector();
auto coll = movesprite(pActor, pActor->spr.xvel << 8, pActor->spr.yvel << 8, 0, 0, 0, CLIPMASK0);
auto coll = movesprite(pActor, pActor->int_xvel() << 8, pActor->spr.yvel << 8, 0, 0, 0, CLIPMASK0);
if (pSector != pActor->sector())
{

View file

@ -612,7 +612,7 @@ void Gravity(DExhumedActor* pActor)
Collision MoveCreature(DExhumedActor* pActor)
{
return movesprite(pActor, pActor->spr.xvel << 8, pActor->spr.yvel << 8, pActor->int_zvel(), 15360, -5120, CLIPMASK0);
return movesprite(pActor, pActor->int_xvel() << 8, pActor->spr.yvel << 8, pActor->int_zvel(), 15360, -5120, CLIPMASK0);
}
Collision MoveCreatureWithCaution(DExhumedActor* pActor)
@ -1352,7 +1352,7 @@ void AICreatureChunk::Tick(RunListEvent* ev)
auto pSector = pActor->sector();
pActor->spr.pal = pSector->ceilingpal;
auto nVal = movesprite(pActor, pActor->spr.xvel << 10, pActor->spr.yvel << 10, pActor->int_zvel(), 2560, -2560, CLIPMASK1);
auto nVal = movesprite(pActor, pActor->int_xvel() << 10, pActor->spr.yvel << 10, pActor->int_zvel(), 2560, -2560, CLIPMASK1);
if (pActor->spr.pos.Z >= pSector->floorz)
{

View file

@ -1436,7 +1436,7 @@ void AISpark::Tick(RunListEvent* ev)
pActor->add_int_zvel( 128);
auto nMov = movesprite(pActor, pActor->spr.xvel << 12, pActor->spr.yvel << 12, pActor->int_zvel(), 2560, -2560, CLIPMASK1);
auto nMov = movesprite(pActor, pActor->int_xvel() << 12, pActor->spr.yvel << 12, pActor->int_zvel(), 2560, -2560, CLIPMASK1);
if (!nMov.type && !nMov.exbits) {
return;
}
@ -1888,7 +1888,7 @@ void AIObject::Tick(RunListEvent* ev)
FUNCOBJECT_GOTO:
if (nStat != kStatExplodeTarget)
{
auto nMov = movesprite(pActor, pActor->spr.xvel << 6, pActor->spr.yvel << 6, pActor->int_zvel(), 0, 0, CLIPMASK0);
auto nMov = movesprite(pActor, pActor->int_xvel() << 6, pActor->spr.yvel << 6, pActor->int_zvel(), 0, 0, CLIPMASK0);
if (pActor->spr.statnum == kStatExplodeTrigger) {
pActor->spr.pal = 1;

View file

@ -275,7 +275,7 @@ void AISpider::Tick(RunListEvent* ev)
spp->spr.yvel = 0;
}
auto nMov = movesprite(spp, spp->spr.xvel << nVel, spp->spr.yvel << nVel, spp->int_zvel(), 1280, -1280, CLIPMASK0);
auto nMov = movesprite(spp, spp->int_xvel() << nVel, spp->spr.yvel << nVel, spp->int_zvel(), 1280, -1280, CLIPMASK0);
if (nMov.type == kHitNone && nMov.exbits == 0)
return;