mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 14:41:55 +00:00
- replaced sp-> in several files.
This commit is contained in:
parent
42a525692d
commit
40050f5008
8 changed files with 176 additions and 176 deletions
|
@ -493,11 +493,11 @@ BREAK_INFOp SetupWallForBreak(WALLp wallp)
|
|||
BREAK_INFOp SetupSpriteForBreak(DSWActor* actor)
|
||||
{
|
||||
auto sp = &actor->s();
|
||||
int picnum = sp->picnum;
|
||||
int picnum = actor->spr.picnum;
|
||||
BREAK_INFOp break_info;
|
||||
|
||||
// ignore as a breakable if true
|
||||
if (sp->lotag == TAG_SPRITE_HIT_MATCH)
|
||||
if (actor->spr.lotag == TAG_SPRITE_HIT_MATCH)
|
||||
return nullptr;
|
||||
|
||||
break_info = FindSpriteBreakInfo(picnum);
|
||||
|
@ -508,20 +508,20 @@ BREAK_INFOp SetupSpriteForBreak(DSWActor* actor)
|
|||
if (TEST(break_info->flags, BF_OVERRIDE_BLOCK))
|
||||
{
|
||||
// if not blocking then skip this code
|
||||
if (!TEST(sp->cstat, CSTAT_SPRITE_BLOCK))
|
||||
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_BLOCK))
|
||||
{
|
||||
return (BREAK_INFOp)(-1);
|
||||
}
|
||||
}
|
||||
|
||||
if (TEST(break_info->flags, BF_BURN))
|
||||
SET(sp->extra, SPRX_BURNABLE);
|
||||
SET(actor->spr.extra, SPRX_BURNABLE);
|
||||
else
|
||||
SET(sp->extra, SPRX_BREAKABLE);
|
||||
SET(actor->spr.extra, SPRX_BREAKABLE);
|
||||
|
||||
sp->clipdist = GetSpriteSizeX(sp);
|
||||
actor->spr.clipdist = GetSpriteSizeX(sp);
|
||||
|
||||
SET(sp->cstat, CSTAT_SPRITE_BREAKABLE);
|
||||
SET(actor->spr.cstat, CSTAT_SPRITE_BREAKABLE);
|
||||
}
|
||||
|
||||
return break_info;
|
||||
|
@ -537,7 +537,7 @@ DSWActor* FindBreakSpriteMatch(int match)
|
|||
while (auto actor = it.Next())
|
||||
{
|
||||
auto sp = &actor->s();
|
||||
if (SP_TAG2(sp) == match && sp->picnum == ST1)
|
||||
if (SP_TAG2(sp) == match && actor->spr.picnum == ST1)
|
||||
{
|
||||
return actor;
|
||||
}
|
||||
|
@ -1053,7 +1053,7 @@ static void DoWallBreakSpriteMatch(int match)
|
|||
{
|
||||
SPRITEp sp = &actor->s();
|
||||
|
||||
if (sp->hitag == match)
|
||||
if (actor->spr.hitag == match)
|
||||
{
|
||||
KillActor(actor);
|
||||
}
|
||||
|
|
|
@ -728,7 +728,7 @@ int SetupBunny(DSWActor* actor)
|
|||
USERp u;
|
||||
ANIMATOR DoActorDecide;
|
||||
|
||||
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
|
||||
if (TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE))
|
||||
{
|
||||
u = actor->u();
|
||||
ASSERT(u);
|
||||
|
@ -747,29 +747,29 @@ int SetupBunny(DSWActor* actor)
|
|||
u->ShellNum = 0; // Not Pregnant right now
|
||||
u->FlagOwner = 0;
|
||||
|
||||
sp->clipdist = (150) >> 2;
|
||||
actor->spr.clipdist = (150) >> 2;
|
||||
|
||||
if (sp->pal == PALETTE_PLAYER1)
|
||||
if (actor->spr.pal == PALETTE_PLAYER1)
|
||||
{
|
||||
EnemyDefaults(actor, &BunnyWhiteActionSet, &WhiteBunnyPersonality);
|
||||
u->Attrib = &WhiteBunnyAttrib;
|
||||
sp->xrepeat = 96;
|
||||
sp->yrepeat = 90;
|
||||
actor->spr.xrepeat = 96;
|
||||
actor->spr.yrepeat = 90;
|
||||
|
||||
sp->clipdist = 200>>2;
|
||||
actor->spr.clipdist = 200>>2;
|
||||
|
||||
if (!TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
|
||||
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE))
|
||||
u->Health = 60;
|
||||
}
|
||||
else if (sp->pal == PALETTE_PLAYER8) // Male Rabbit
|
||||
else if (actor->spr.pal == PALETTE_PLAYER8) // Male Rabbit
|
||||
{
|
||||
EnemyDefaults(actor, &BunnyActionSet, &BunnyPersonality);
|
||||
u->Attrib = &BunnyAttrib;
|
||||
//sp->xrepeat = 76;
|
||||
//sp->yrepeat = 70;
|
||||
//actor->spr.xrepeat = 76;
|
||||
//actor->spr.yrepeat = 70;
|
||||
|
||||
//sp->shade = 0; // darker
|
||||
if (!TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
|
||||
//actor->spr.shade = 0; // darker
|
||||
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE))
|
||||
u->Health = 20;
|
||||
u->Flag1 = 0;
|
||||
}
|
||||
|
@ -778,9 +778,9 @@ int SetupBunny(DSWActor* actor)
|
|||
// Female Rabbit
|
||||
EnemyDefaults(actor, &BunnyActionSet, &BunnyPersonality);
|
||||
u->Attrib = &BunnyAttrib;
|
||||
u->spal = sp->pal = PALETTE_PLAYER0;
|
||||
u->spal = actor->spr.pal = PALETTE_PLAYER0;
|
||||
u->Flag1 = SEC(5);
|
||||
//sp->shade = 0; // darker
|
||||
//actor->spr.shade = 0; // darker
|
||||
}
|
||||
|
||||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
|
@ -843,15 +843,15 @@ int DoBunnyBeginJumpAttack(DSWActor* actor)
|
|||
SPRITEp psp = &u->targetActor->s();
|
||||
int tang;
|
||||
|
||||
tang = getangle(psp->pos.X - sp->pos.X, psp->pos.Y - sp->pos.Y);
|
||||
tang = getangle(psp->pos.X - actor->spr.pos.X, psp->pos.Y - actor->spr.pos.Y);
|
||||
|
||||
Collision coll = move_sprite(actor, bcos(tang, -7), bsin(tang, -7),
|
||||
0L, u->ceiling_dist, u->floor_dist, CLIPMASK_ACTOR, ACTORMOVETICS);
|
||||
|
||||
if (coll.type != kHitNone)
|
||||
sp->ang = NORM_ANGLE(sp->ang + 1024) + (RANDOM_NEG(256, 6) >> 6);
|
||||
actor->spr.ang = NORM_ANGLE(actor->spr.ang + 1024) + (RANDOM_NEG(256, 6) >> 6);
|
||||
else
|
||||
sp->ang = NORM_ANGLE(tang + (RANDOM_NEG(256, 6) >> 6));
|
||||
actor->spr.ang = NORM_ANGLE(tang + (RANDOM_NEG(256, 6) >> 6));
|
||||
|
||||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
|
||||
|
@ -882,8 +882,8 @@ int DoBunnyMoveJump(DSWActor* actor)
|
|||
int nx, ny;
|
||||
|
||||
// Move while jumping
|
||||
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
|
||||
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
|
||||
nx = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
|
||||
ny = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
|
||||
|
||||
move_actor(actor, nx, ny, 0L);
|
||||
|
||||
|
@ -923,11 +923,11 @@ void DoPickCloseBunny(DSWActor* actor)
|
|||
|
||||
if (tu->ID != BUNNY_RUN_R0) continue;
|
||||
|
||||
DISTANCE(tsp->pos.X, tsp->pos.Y, sp->pos.X, sp->pos.Y, dist, a, b, c);
|
||||
DISTANCE(tsp->pos.X, tsp->pos.Y, actor->spr.pos.X, actor->spr.pos.Y, dist, a, b, c);
|
||||
|
||||
if (dist > near_dist) continue;
|
||||
|
||||
ICanSee = FAFcansee(sp->pos.X, sp->pos.Y, look_height, sp->sector(), tsp->pos.X, tsp->pos.Y, ActorUpperZ(itActor), tsp->sector());
|
||||
ICanSee = FAFcansee(actor->spr.pos.X, actor->spr.pos.Y, look_height, actor->spr.sector(), tsp->pos.X, tsp->pos.Y, ActorUpperZ(itActor), tsp->sector());
|
||||
|
||||
if (ICanSee && dist < near_dist && tu->ID == BUNNY_RUN_R0)
|
||||
{
|
||||
|
@ -961,12 +961,12 @@ int DoBunnyQuickJump(DSWActor* actor)
|
|||
|
||||
|
||||
// Not mature enough yet
|
||||
if (sp->xrepeat != 64 || sp->yrepeat != 64) return false;
|
||||
if (actor->spr.xrepeat != 64 || actor->spr.yrepeat != 64) return false;
|
||||
if (tsp->xrepeat != 64 || tsp->yrepeat != 64) return false;
|
||||
|
||||
// Kill a rival
|
||||
// Only males fight
|
||||
if (tu->spal == sp->pal && RandomRange(1000) > 995)
|
||||
if (tu->spal == actor->spr.pal && RandomRange(1000) > 995)
|
||||
{
|
||||
if (u->spal == PALETTE_PLAYER8 && tu->spal == PALETTE_PLAYER8)
|
||||
{
|
||||
|
@ -1003,7 +1003,7 @@ int DoBunnyQuickJump(DSWActor* actor)
|
|||
if (!tu || tu->ID != BUNNY_RUN_R0) return false;
|
||||
|
||||
// Not mature enough to mate yet
|
||||
if (sp->xrepeat != 64 || sp->yrepeat != 64) return false;
|
||||
if (actor->spr.xrepeat != 64 || actor->spr.yrepeat != 64) return false;
|
||||
if (tsp->xrepeat != 64 || tsp->yrepeat != 64) return false;
|
||||
|
||||
if (tu->ShellNum <= 0 && tu->WaitTics <= 0 && u->WaitTics <= 0)
|
||||
|
@ -1032,7 +1032,7 @@ int DoBunnyQuickJump(DSWActor* actor)
|
|||
if (pp == Player+myconnectindex)
|
||||
{
|
||||
choose_snd = STD_RANDOM_RANGE(2<<8)>>8;
|
||||
if (FAFcansee(sp->pos.X,sp->pos.Y,GetSpriteZOfTop(sp),sp->sector(),pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector) && Facing(actor, u->targetActor))
|
||||
if (FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,GetSpriteZOfTop(sp),actor->spr.sector(),pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector) && Facing(actor, u->targetActor))
|
||||
PlayerSound(fagsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp);
|
||||
}
|
||||
}
|
||||
|
@ -1047,19 +1047,19 @@ int DoBunnyQuickJump(DSWActor* actor)
|
|||
if (pp == Player+myconnectindex)
|
||||
{
|
||||
choose_snd = STD_RANDOM_RANGE(3<<8)>>8;
|
||||
if (FAFcansee(sp->pos.X,sp->pos.Y,GetSpriteZOfTop(sp),sp->sector(),pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector) && Facing(actor, u->targetActor))
|
||||
if (FAFcansee(actor->spr.pos.X,actor->spr.pos.Y,GetSpriteZOfTop(sp),actor->spr.sector(),pp->pos.X, pp->pos.Y, pp->pos.Z, pp->cursector) && Facing(actor, u->targetActor))
|
||||
PlayerSound(straightsnds[choose_snd], v3df_doppler|v3df_follow|v3df_dontpan,pp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sp->pos.X = tsp->pos.X; // Mount up little bunny
|
||||
sp->pos.Y = tsp->pos.Y;
|
||||
sp->ang = tsp->ang;
|
||||
sp->ang = NORM_ANGLE(sp->ang + 1024);
|
||||
actor->spr.pos.X = tsp->pos.X; // Mount up little bunny
|
||||
actor->spr.pos.Y = tsp->pos.Y;
|
||||
actor->spr.ang = tsp->ang;
|
||||
actor->spr.ang = NORM_ANGLE(actor->spr.ang + 1024);
|
||||
HelpMissileLateral(actor, 2000);
|
||||
sp->ang = tsp->ang;
|
||||
u->Vis = sp->ang; // Remember angles for later
|
||||
actor->spr.ang = tsp->ang;
|
||||
u->Vis = actor->spr.ang; // Remember angles for later
|
||||
tu->Vis = tsp->ang;
|
||||
|
||||
NewStateGroup(actor, sg_BunnyScrew);
|
||||
|
@ -1121,7 +1121,7 @@ int DoBunnyRipHeart(DSWActor* actor)
|
|||
u->WaitTics = 6 * 120;
|
||||
|
||||
// player face bunny
|
||||
tsp->ang = getangle(sp->pos.X - tsp->pos.X, sp->pos.Y - tsp->pos.Y);
|
||||
tsp->ang = getangle(actor->spr.pos.X - tsp->pos.X, actor->spr.pos.Y - tsp->pos.Y);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1155,19 +1155,19 @@ void BunnyHatch(DSWActor* actor)
|
|||
|
||||
for (int i = 0; i < MAX_BUNNYS; i++)
|
||||
{
|
||||
auto actorNew = insertActor(sp->sector(), STAT_DEFAULT);
|
||||
auto actorNew = insertActor(actor->spr.sector(), STAT_DEFAULT);
|
||||
np = &actorNew->s();
|
||||
np->clear();
|
||||
np->pos.X = sp->pos.X;
|
||||
np->pos.Y = sp->pos.Y;
|
||||
np->pos.Z = sp->pos.Z;
|
||||
np->pos.X = actor->spr.pos.X;
|
||||
np->pos.Y = actor->spr.pos.Y;
|
||||
np->pos.Z = actor->spr.pos.Z;
|
||||
np->xrepeat = 30; // Baby size
|
||||
np->yrepeat = 24;
|
||||
np->ang = rip_ang[i];
|
||||
np->pal = 0;
|
||||
SetupBunny(actorNew);
|
||||
nu = actorNew->u();
|
||||
np->shade = sp->shade;
|
||||
np->shade = actor->spr.shade;
|
||||
|
||||
// make immediately active
|
||||
SET(nu->Flags, SPR_ACTIVE);
|
||||
|
@ -1284,8 +1284,8 @@ int DoBunnyMove(DSWActor* actor)
|
|||
auto sp = &actor->s();
|
||||
|
||||
// Parental lock crap
|
||||
if (TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE))
|
||||
RESET(sp->cstat, CSTAT_SPRITE_INVISIBLE); // Turn em' back on
|
||||
if (TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE); // Turn em' back on
|
||||
|
||||
// Sometimes they just won't die!
|
||||
if (u->Health <= 0)
|
||||
|
@ -1324,9 +1324,9 @@ int DoBunnyMove(DSWActor* actor)
|
|||
|
||||
DoActorSectorDamage(actor);
|
||||
|
||||
if (RandomRange(1000) > 985 && sp->pal != PALETTE_PLAYER1 && u->track < 0)
|
||||
if (RandomRange(1000) > 985 && actor->spr.pal != PALETTE_PLAYER1 && u->track < 0)
|
||||
{
|
||||
switch (sp->sector()->floorpicnum)
|
||||
switch (actor->spr.sector()->floorpicnum)
|
||||
{
|
||||
case 153:
|
||||
case 154:
|
||||
|
@ -1341,7 +1341,7 @@ int DoBunnyMove(DSWActor* actor)
|
|||
NewStateGroup(actor,sg_BunnyStand);
|
||||
break;
|
||||
default:
|
||||
sp->ang = NORM_ANGLE(RandomRange(2048 << 6) >> 6);
|
||||
actor->spr.ang = NORM_ANGLE(RandomRange(2048 << 6) >> 6);
|
||||
u->jump_speed = -350;
|
||||
DoActorBeginJump(actor);
|
||||
u->ActorActionFunc = DoActorMoveJump;
|
||||
|
@ -1387,7 +1387,7 @@ int DoBunnyEat(DSWActor* actor)
|
|||
|
||||
DoActorSectorDamage(actor);
|
||||
|
||||
switch (sp->sector()->floorpicnum)
|
||||
switch (actor->spr.sector()->floorpicnum)
|
||||
{
|
||||
case 153:
|
||||
case 154:
|
||||
|
@ -1449,7 +1449,7 @@ int DoBunnyScrew(DSWActor* actor)
|
|||
|
||||
if (u->WaitTics <= 0)
|
||||
{
|
||||
RESET(sp->cstat, CSTAT_SPRITE_INVISIBLE); // Turn em' back on
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE); // Turn em' back on
|
||||
u->FlagOwner = 0;
|
||||
NewStateGroup(actor,sg_BunnyRun);
|
||||
}
|
||||
|
@ -1462,21 +1462,21 @@ int DoBunnyGrowUp(DSWActor* actor)
|
|||
USER* u = actor->u();
|
||||
SPRITEp sp = &actor->s();
|
||||
|
||||
if (sp->pal == PALETTE_PLAYER1) return 0; // Don't bother white bunnies
|
||||
if (actor->spr.pal == PALETTE_PLAYER1) return 0; // Don't bother white bunnies
|
||||
|
||||
if ((u->Counter -= ACTORMOVETICS) <= 0)
|
||||
{
|
||||
if ((++sp->xrepeat) > 64) sp->xrepeat = 64;
|
||||
if ((++sp->yrepeat) > 64) sp->yrepeat = 64;
|
||||
if ((++actor->spr.xrepeat) > 64) actor->spr.xrepeat = 64;
|
||||
if ((++actor->spr.yrepeat) > 64) actor->spr.yrepeat = 64;
|
||||
u->Counter = 60;
|
||||
}
|
||||
|
||||
// Don't go homo too much!
|
||||
if (sp->pal != PALETTE_PLAYER0 && u->Flag1 > 0)
|
||||
if (actor->spr.pal != PALETTE_PLAYER0 && u->Flag1 > 0)
|
||||
u->Flag1 -= ACTORMOVETICS;
|
||||
|
||||
// Gestation period for female rabbits
|
||||
if (sp->pal == PALETTE_PLAYER0 && u->ShellNum > 0)
|
||||
if (actor->spr.pal == PALETTE_PLAYER0 && u->ShellNum > 0)
|
||||
{
|
||||
if ((u->Flag1 -= ACTORMOVETICS) <= 0)
|
||||
{
|
||||
|
|
|
@ -504,16 +504,16 @@ void CoolgCommon(DSWActor* actor)
|
|||
SPRITEp sp = &actor->s();
|
||||
USERp u = actor->u();
|
||||
|
||||
sp->clipdist = (200) >> 2;
|
||||
actor->spr.clipdist = (200) >> 2;
|
||||
//u->floor_dist = Z(5);
|
||||
u->floor_dist = Z(16);
|
||||
u->ceiling_dist = Z(20);
|
||||
|
||||
u->sz = sp->pos.Z;
|
||||
u->sz = actor->spr.pos.Z;
|
||||
|
||||
sp->xrepeat = 42;
|
||||
sp->yrepeat = 42;
|
||||
SET(sp->extra, SPRX_PLAYER_OR_ENEMY);
|
||||
actor->spr.xrepeat = 42;
|
||||
actor->spr.yrepeat = 42;
|
||||
SET(actor->spr.extra, SPRX_PLAYER_OR_ENEMY);
|
||||
}
|
||||
|
||||
int SetupCoolg(DSWActor* actor)
|
||||
|
@ -522,7 +522,7 @@ int SetupCoolg(DSWActor* actor)
|
|||
USERp u;
|
||||
ANIMATOR DoActorDecide;
|
||||
|
||||
if (!TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
|
||||
if (!TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE))
|
||||
{
|
||||
u = SpawnUser(actor,COOLG_RUN_R0,s_CoolgRun[0]);
|
||||
u->Health = HEALTH_COOLIE_GHOST;
|
||||
|
@ -552,7 +552,7 @@ int NewCoolg(DSWActor* actor)
|
|||
SPRITEp np;
|
||||
ANIMATOR DoActorDecide;
|
||||
|
||||
auto actorNew = SpawnActor(STAT_ENEMY, COOLG_RUN_R0, &s_CoolgBirth[0], sp->sector(), sp->pos.X, sp->pos.Y, sp->pos.Z, sp->ang, 50);
|
||||
auto actorNew = SpawnActor(STAT_ENEMY, COOLG_RUN_R0, &s_CoolgBirth[0], actor->spr.sector(), actor->spr.pos.X, actor->spr.pos.Y, actor->spr.pos.Z, actor->spr.ang, 50);
|
||||
|
||||
nu = actorNew->u();
|
||||
np = &actorNew->s();
|
||||
|
@ -564,7 +564,7 @@ int NewCoolg(DSWActor* actor)
|
|||
|
||||
nu->ActorActionSet = &CoolgActionSet;
|
||||
|
||||
np->shade = sp->shade;
|
||||
np->shade = actor->spr.shade;
|
||||
nu->Personality = &CoolgPersonality;
|
||||
nu->Attrib = &CoolgAttrib;
|
||||
|
||||
|
@ -624,7 +624,7 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
|
|||
int bound;
|
||||
|
||||
// If blocking bits get unset, just die
|
||||
if (!TEST(sp->cstat,CSTAT_SPRITE_BLOCK) || !TEST(sp->cstat,CSTAT_SPRITE_BLOCK_HITSCAN))
|
||||
if (!TEST(actor->spr.cstat,CSTAT_SPRITE_BLOCK) || !TEST(actor->spr.cstat,CSTAT_SPRITE_BLOCK_HITSCAN))
|
||||
{
|
||||
InitBloodSpray(actor, true, 105);
|
||||
InitBloodSpray(actor, true, 105);
|
||||
|
@ -681,13 +681,13 @@ int DoCoolgMatchPlayerZ(DSWActor* actor)
|
|||
u->sz = max(u->sz, hiz + u->ceiling_dist);
|
||||
|
||||
u->Counter = (u->Counter + (ACTORMOVETICS<<3)) & 2047;
|
||||
sp->pos.Z = u->sz + MulScale(COOLG_BOB_AMT, bsin(u->Counter), 14);
|
||||
actor->spr.pos.Z = u->sz + MulScale(COOLG_BOB_AMT, bsin(u->Counter), 14);
|
||||
|
||||
bound = u->hiz + u->ceiling_dist + COOLG_BOB_AMT;
|
||||
if (sp->pos.Z < bound)
|
||||
if (actor->spr.pos.Z < bound)
|
||||
{
|
||||
// bumped something
|
||||
sp->pos.Z = u->sz = bound + COOLG_BOB_AMT;
|
||||
actor->spr.pos.Z = u->sz = bound + COOLG_BOB_AMT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -706,9 +706,9 @@ int InitCoolgCircle(DSWActor* actor)
|
|||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
|
||||
// set to really fast
|
||||
sp->xvel = 400;
|
||||
actor->spr.xvel = 400;
|
||||
// angle adjuster
|
||||
u->Counter2 = sp->xvel/3;
|
||||
u->Counter2 = actor->spr.xvel/3;
|
||||
// random angle direction
|
||||
if (RANDOM_P2(1024) < 512)
|
||||
u->Counter2 = -u->Counter2;
|
||||
|
@ -732,10 +732,10 @@ int DoCoolgCircle(DSWActor* actor)
|
|||
int nx,ny,bound;
|
||||
|
||||
|
||||
sp->ang = NORM_ANGLE(sp->ang + u->Counter2);
|
||||
actor->spr.ang = NORM_ANGLE(actor->spr.ang + u->Counter2);
|
||||
|
||||
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
|
||||
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
|
||||
nx = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
|
||||
ny = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
|
||||
|
||||
if (!move_actor(actor, nx, ny, 0L))
|
||||
{
|
||||
|
@ -774,10 +774,10 @@ int DoCoolgDeath(DSWActor* actor)
|
|||
int nx, ny;
|
||||
|
||||
|
||||
RESET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT);
|
||||
RESET(sp->cstat, CSTAT_SPRITE_INVISIBLE);
|
||||
sp->xrepeat = 42;
|
||||
sp->shade = -10;
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_TRANSLUCENT);
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE);
|
||||
actor->spr.xrepeat = 42;
|
||||
actor->spr.shade = -10;
|
||||
|
||||
if (TEST(u->Flags, SPR_FALLING))
|
||||
{
|
||||
|
@ -794,17 +794,17 @@ int DoCoolgDeath(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
// slide while falling
|
||||
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
|
||||
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
|
||||
nx = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
|
||||
ny = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
|
||||
|
||||
u->coll = move_sprite(actor, nx, ny, 0L, u->ceiling_dist, u->floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS);
|
||||
DoFindGroundPoint(actor);
|
||||
|
||||
// on the ground
|
||||
if (sp->pos.Z >= u->loz)
|
||||
if (actor->spr.pos.Z >= u->loz)
|
||||
{
|
||||
RESET(u->Flags, SPR_FALLING|SPR_SLIDING);
|
||||
RESET(sp->cstat, CSTAT_SPRITE_YFLIP); // If upside down, reset it
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_YFLIP); // If upside down, reset it
|
||||
NewStateGroup(actor, u->ActorActionSet->Dead);
|
||||
return 0;
|
||||
}
|
||||
|
@ -823,24 +823,24 @@ int DoCoolgMove(DSWActor* actor)
|
|||
switch (u->FlagOwner)
|
||||
{
|
||||
case 0:
|
||||
SET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT);
|
||||
SET(actor->spr.cstat, CSTAT_SPRITE_TRANSLUCENT);
|
||||
u->ShellNum = SEC(2);
|
||||
break;
|
||||
case 1:
|
||||
PlaySound(DIGI_VOID3, actor, v3df_follow);
|
||||
RESET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT);
|
||||
SET(sp->cstat, CSTAT_SPRITE_INVISIBLE);
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_TRANSLUCENT);
|
||||
SET(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE);
|
||||
u->ShellNum = SEC(1) + SEC(RandomRange(2));
|
||||
break;
|
||||
case 2:
|
||||
SET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT);
|
||||
RESET(sp->cstat, CSTAT_SPRITE_INVISIBLE);
|
||||
SET(actor->spr.cstat, CSTAT_SPRITE_TRANSLUCENT);
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE);
|
||||
u->ShellNum = SEC(2);
|
||||
break;
|
||||
case 3:
|
||||
PlaySound(DIGI_VOID3, actor, v3df_follow);
|
||||
RESET(sp->cstat, CSTAT_SPRITE_TRANSLUCENT);
|
||||
RESET(sp->cstat, CSTAT_SPRITE_INVISIBLE);
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_TRANSLUCENT);
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE);
|
||||
u->ShellNum = SEC(2) + SEC(RandomRange(3));
|
||||
break;
|
||||
default:
|
||||
|
@ -853,28 +853,28 @@ int DoCoolgMove(DSWActor* actor)
|
|||
|
||||
if (u->FlagOwner-1 == 0)
|
||||
{
|
||||
sp->xrepeat--;
|
||||
sp->shade++;
|
||||
if (sp->xrepeat < 4) sp->xrepeat = 4;
|
||||
if (sp->shade > 126)
|
||||
actor->spr.xrepeat--;
|
||||
actor->spr.shade++;
|
||||
if (actor->spr.xrepeat < 4) actor->spr.xrepeat = 4;
|
||||
if (actor->spr.shade > 126)
|
||||
{
|
||||
sp->shade = 127;
|
||||
sp->hitag = 9998;
|
||||
actor->spr.shade = 127;
|
||||
actor->spr.hitag = 9998;
|
||||
}
|
||||
}
|
||||
else if (u->FlagOwner-1 == 2)
|
||||
{
|
||||
sp->hitag = 0;
|
||||
sp->xrepeat++;
|
||||
sp->shade--;
|
||||
if (sp->xrepeat > 42) sp->xrepeat = 42;
|
||||
if (sp->shade < -10) sp->shade = -10;
|
||||
actor->spr.hitag = 0;
|
||||
actor->spr.xrepeat++;
|
||||
actor->spr.shade--;
|
||||
if (actor->spr.xrepeat > 42) actor->spr.xrepeat = 42;
|
||||
if (actor->spr.shade < -10) actor->spr.shade = -10;
|
||||
}
|
||||
else if (u->FlagOwner == 0)
|
||||
{
|
||||
sp->xrepeat = 42;
|
||||
sp->shade = -10;
|
||||
sp->hitag = 0;
|
||||
actor->spr.xrepeat = 42;
|
||||
actor->spr.shade = -10;
|
||||
actor->spr.hitag = 0;
|
||||
}
|
||||
|
||||
if (TEST(u->Flags,SPR_SLIDING))
|
||||
|
@ -887,7 +887,7 @@ int DoCoolgMove(DSWActor* actor)
|
|||
(*u->ActorActionFunc)(actor);
|
||||
}
|
||||
|
||||
if (RANDOM_P2(1024) < 32 && !TEST(sp->cstat, CSTAT_SPRITE_INVISIBLE))
|
||||
if (RANDOM_P2(1024) < 32 && !TEST(actor->spr.cstat, CSTAT_SPRITE_INVISIBLE))
|
||||
InitCoolgDrip(actor);
|
||||
|
||||
DoCoolgMatchPlayerZ(actor);
|
||||
|
|
|
@ -402,12 +402,12 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SETp action, PERSONALITYp perso
|
|||
break;
|
||||
}
|
||||
|
||||
RESET(sp->cstat, CSTAT_SPRITE_RESTORE);
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_RESTORE);
|
||||
|
||||
u->spal = sp->pal;
|
||||
u->spal = actor->spr.pal;
|
||||
|
||||
u->RotNum = 5;
|
||||
sp->clipdist = (256) >> 2;
|
||||
actor->spr.clipdist = (256) >> 2;
|
||||
|
||||
u->zclip = Z(48);
|
||||
u->lo_step = Z(32);
|
||||
|
@ -421,10 +421,10 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SETp action, PERSONALITYp perso
|
|||
|
||||
u->PainThreshold = (u->Health >> 4) - 1;
|
||||
|
||||
SET(sp->cstat,CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
SET(sp->extra,SPRX_PLAYER_OR_ENEMY);
|
||||
SET(actor->spr.cstat,CSTAT_SPRITE_BLOCK|CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
SET(actor->spr.extra,SPRX_PLAYER_OR_ENEMY);
|
||||
|
||||
sp->picnum = u->State->Pic;
|
||||
actor->spr.picnum = u->State->Pic;
|
||||
change_actor_stat(actor, STAT_ENEMY);
|
||||
|
||||
u->Personality = person;
|
||||
|
@ -456,11 +456,11 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SETp action, PERSONALITYp perso
|
|||
}
|
||||
}
|
||||
|
||||
if (depth && labs(sp->pos.Z - u->loz) < Z(8))
|
||||
if (depth && labs(actor->spr.pos.Z - u->loz) < Z(8))
|
||||
{
|
||||
sp->pos.Z += Z(depth);
|
||||
u->loz = sp->pos.Z;
|
||||
sp->backupz();
|
||||
actor->spr.pos.Z += Z(depth);
|
||||
u->loz = actor->spr.pos.Z;
|
||||
actor->spr.backupz();
|
||||
}
|
||||
|
||||
if (!action)
|
||||
|
@ -490,7 +490,7 @@ int SetupCoolie(DSWActor* actor)
|
|||
USERp u;
|
||||
ANIMATOR DoActorDecide;
|
||||
|
||||
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
|
||||
if (TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE))
|
||||
{
|
||||
u = actor->u();
|
||||
ASSERT(u);
|
||||
|
@ -509,8 +509,8 @@ int SetupCoolie(DSWActor* actor)
|
|||
|
||||
EnemyDefaults(actor, &CoolieActionSet, &CooliePersonality);
|
||||
|
||||
sp->xrepeat = 42;
|
||||
sp->yrepeat = 42;
|
||||
actor->spr.xrepeat = 42;
|
||||
actor->spr.yrepeat = 42;
|
||||
|
||||
SET(u->Flags, SPR_XFLIP_TOGGLE);
|
||||
|
||||
|
@ -586,7 +586,7 @@ int DoCoolieMove(DSWActor* actor)
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (Distance(sp->pos.X, sp->pos.Y, u->targetActor->spr.pos.X, u->targetActor->spr.pos.Y) < 1200)
|
||||
if (Distance(actor->spr.pos.X, actor->spr.pos.Y, u->targetActor->spr.pos.X, u->targetActor->spr.pos.Y) < 1200)
|
||||
{
|
||||
UpdateSinglePlayKills(actor);
|
||||
DoActorDie(actor, actor, 0);
|
||||
|
|
|
@ -362,15 +362,15 @@ void EelCommon(DSWActor* actor)
|
|||
SPRITEp sp = &actor->s();
|
||||
USERp u = actor->u();
|
||||
|
||||
sp->clipdist = (100) >> 2;
|
||||
actor->spr.clipdist = (100) >> 2;
|
||||
u->floor_dist = Z(16);
|
||||
u->floor_dist = Z(16);
|
||||
u->ceiling_dist = Z(20);
|
||||
|
||||
u->sz = sp->pos.Z;
|
||||
u->sz = actor->spr.pos.Z;
|
||||
|
||||
sp->xrepeat = 35;
|
||||
sp->yrepeat = 27;
|
||||
actor->spr.xrepeat = 35;
|
||||
actor->spr.yrepeat = 27;
|
||||
u->Radius = 400;
|
||||
}
|
||||
|
||||
|
@ -380,7 +380,7 @@ int SetupEel(DSWActor* actor)
|
|||
USERp u;
|
||||
ANIMATOR DoActorDecide;
|
||||
|
||||
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
|
||||
if (TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE))
|
||||
{
|
||||
u = actor->u();
|
||||
ASSERT(u);
|
||||
|
@ -435,17 +435,17 @@ int DoEelMatchPlayerZ(DSWActor* actor)
|
|||
|
||||
int bound;
|
||||
|
||||
if (FAF_ConnectArea(sp->sector()))
|
||||
if (FAF_ConnectArea(actor->spr.sector()))
|
||||
{
|
||||
if (u->hi_sectp)
|
||||
{
|
||||
u->hiz = sp->sector()->ceilingz + Z(16);
|
||||
u->hi_sectp = sp->sector();
|
||||
u->hiz = actor->spr.sector()->ceilingz + Z(16);
|
||||
u->hi_sectp = actor->spr.sector();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (u->hiz < sp->sector()->ceilingz + Z(16))
|
||||
u->hiz = sp->sector()->ceilingz + Z(16);
|
||||
if (u->hiz < actor->spr.sector()->ceilingz + Z(16))
|
||||
u->hiz = actor->spr.sector()->ceilingz + Z(16);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -477,7 +477,7 @@ int DoEelMatchPlayerZ(DSWActor* actor)
|
|||
// lower bound
|
||||
if (u->lowActor && u->targetActor == u->highActor) // this doesn't look right...
|
||||
{
|
||||
DISTANCE(sp->pos.X, sp->pos.Y, u->lowActor->spr.pos.X, u->lowActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, u->lowActor->spr.pos.X, u->lowActor->spr.pos.Y, dist, a, b, c);
|
||||
if (dist <= 300)
|
||||
bound = u->sz;
|
||||
else
|
||||
|
@ -494,7 +494,7 @@ int DoEelMatchPlayerZ(DSWActor* actor)
|
|||
// upper bound
|
||||
if (u->highActor && u->targetActor == u->highActor)
|
||||
{
|
||||
DISTANCE(sp->pos.X, sp->pos.Y, u->highActor->spr.pos.X, u->highActor->spr.pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, u->highActor->spr.pos.X, u->highActor->spr.pos.Y, dist, a, b, c);
|
||||
if (dist <= 300)
|
||||
bound = u->sz;
|
||||
else
|
||||
|
@ -512,13 +512,13 @@ int DoEelMatchPlayerZ(DSWActor* actor)
|
|||
u->sz = max(u->sz, hiz + u->ceiling_dist);
|
||||
|
||||
u->Counter = (u->Counter + (ACTORMOVETICS << 3) + (ACTORMOVETICS << 1)) & 2047;
|
||||
sp->pos.Z = u->sz + MulScale(EEL_BOB_AMT, bsin(u->Counter), 14);
|
||||
actor->spr.pos.Z = u->sz + MulScale(EEL_BOB_AMT, bsin(u->Counter), 14);
|
||||
|
||||
bound = u->hiz + u->ceiling_dist + EEL_BOB_AMT;
|
||||
if (sp->pos.Z < bound)
|
||||
if (actor->spr.pos.Z < bound)
|
||||
{
|
||||
// bumped something
|
||||
sp->pos.Z = u->sz = bound + EEL_BOB_AMT;
|
||||
actor->spr.pos.Z = u->sz = bound + EEL_BOB_AMT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -544,20 +544,20 @@ int DoEelDeath(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
// slide while falling
|
||||
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
|
||||
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
|
||||
nx = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
|
||||
ny = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
|
||||
|
||||
u->coll = move_sprite(actor, nx, ny, 0L, u->ceiling_dist, u->floor_dist, CLIPMASK_MISSILE, ACTORMOVETICS);
|
||||
DoFindGroundPoint(actor);
|
||||
|
||||
// on the ground
|
||||
if (sp->pos.Z >= u->loz)
|
||||
if (actor->spr.pos.Z >= u->loz)
|
||||
{
|
||||
RESET(u->Flags, SPR_FALLING|SPR_SLIDING);
|
||||
if (RandomRange(1000) > 500)
|
||||
SET(sp->cstat, CSTAT_SPRITE_XFLIP);
|
||||
SET(actor->spr.cstat, CSTAT_SPRITE_XFLIP);
|
||||
if (RandomRange(1000) > 500)
|
||||
SET(sp->cstat, CSTAT_SPRITE_YFLIP);
|
||||
SET(actor->spr.cstat, CSTAT_SPRITE_YFLIP);
|
||||
NewStateGroup(actor, u->ActorActionSet->Dead);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -716,7 +716,7 @@ int SetupGirlNinja(DSWActor* actor)
|
|||
USERp u;
|
||||
ANIMATOR DoActorDecide;
|
||||
|
||||
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
|
||||
if (TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE))
|
||||
{
|
||||
u = actor->u();
|
||||
ASSERT(u);
|
||||
|
@ -729,11 +729,11 @@ int SetupGirlNinja(DSWActor* actor)
|
|||
|
||||
u->StateEnd = s_GirlNinjaDie;
|
||||
u->Rot = sg_GirlNinjaRun;
|
||||
sp->xrepeat = 51;
|
||||
sp->yrepeat = 43;
|
||||
actor->spr.xrepeat = 51;
|
||||
actor->spr.yrepeat = 43;
|
||||
|
||||
u->Attrib = &GirlNinjaAttrib;
|
||||
sp->pal = u->spal = 26;
|
||||
actor->spr.pal = u->spal = 26;
|
||||
EnemyDefaults(actor, &GirlNinjaActionSet, &GirlNinjaPersonality);
|
||||
|
||||
ChangeState(actor, s_GirlNinjaRun[0]);
|
||||
|
@ -790,8 +790,8 @@ int GirlNinjaJumpActionFunc(DSWActor* actor)
|
|||
int nx, ny;
|
||||
|
||||
// Move while jumping
|
||||
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
|
||||
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
|
||||
nx = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
|
||||
ny = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
|
||||
|
||||
// if cannot move the sprite
|
||||
if (!move_actor(actor, nx, ny, 0L))
|
||||
|
@ -844,9 +844,9 @@ int DoGirlNinjaSpecial(DSWActor* actor)
|
|||
|
||||
if (u->spal == PALETTE_PLAYER5)
|
||||
{
|
||||
RESET(sp->cstat,CSTAT_SPRITE_TRANSLUCENT);
|
||||
sp->hitag = 0;
|
||||
sp->shade = -10;
|
||||
RESET(actor->spr.cstat,CSTAT_SPRITE_TRANSLUCENT);
|
||||
actor->spr.hitag = 0;
|
||||
actor->spr.shade = -10;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -487,7 +487,7 @@ int SetupGoro(DSWActor* actor)
|
|||
USERp u;
|
||||
ANIMATOR DoActorDecide;
|
||||
|
||||
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
|
||||
if (TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE))
|
||||
{
|
||||
u = actor->u();
|
||||
ASSERT(u);
|
||||
|
@ -506,7 +506,7 @@ int SetupGoro(DSWActor* actor)
|
|||
|
||||
|
||||
EnemyDefaults(actor, &GoroActionSet, &GoroPersonality);
|
||||
sp->clipdist = 512 >> 2;
|
||||
actor->spr.clipdist = 512 >> 2;
|
||||
SET(u->Flags, SPR_XFLIP_TOGGLE);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -293,7 +293,7 @@ int SetupHornet(DSWActor* actor)
|
|||
USERp u;
|
||||
ANIMATOR DoActorDecide;
|
||||
|
||||
if (TEST(sp->cstat, CSTAT_SPRITE_RESTORE))
|
||||
if (TEST(actor->spr.cstat, CSTAT_SPRITE_RESTORE))
|
||||
{
|
||||
u = actor->u();
|
||||
ASSERT(u);
|
||||
|
@ -313,16 +313,16 @@ int SetupHornet(DSWActor* actor)
|
|||
EnemyDefaults(actor, &HornetActionSet, &HornetPersonality);
|
||||
|
||||
SET(u->Flags, SPR_NO_SCAREDZ|SPR_XFLIP_TOGGLE);
|
||||
SET(sp->cstat, CSTAT_SPRITE_YCENTER);
|
||||
SET(actor->spr.cstat, CSTAT_SPRITE_YCENTER);
|
||||
|
||||
sp->clipdist = (100) >> 2;
|
||||
actor->spr.clipdist = (100) >> 2;
|
||||
u->floor_dist = Z(16);
|
||||
u->ceiling_dist = Z(16);
|
||||
|
||||
u->sz = sp->pos.Z;
|
||||
u->sz = actor->spr.pos.Z;
|
||||
|
||||
sp->xrepeat = 37;
|
||||
sp->yrepeat = 32;
|
||||
actor->spr.xrepeat = 37;
|
||||
actor->spr.yrepeat = 32;
|
||||
|
||||
// Special looping buzz sound attached to each hornet spawned
|
||||
PlaySound(DIGI_HORNETBUZZ, actor, v3df_follow|v3df_init);
|
||||
|
@ -405,13 +405,13 @@ int DoHornetMatchPlayerZ(DSWActor* actor)
|
|||
u->sz = max(u->sz, hiz + u->ceiling_dist);
|
||||
|
||||
u->Counter = (u->Counter + (ACTORMOVETICS << 3) + (ACTORMOVETICS << 1)) & 2047;
|
||||
sp->pos.Z = u->sz + MulScale(HORNET_BOB_AMT, bsin(u->Counter), 14);
|
||||
actor->spr.pos.Z = u->sz + MulScale(HORNET_BOB_AMT, bsin(u->Counter), 14);
|
||||
|
||||
bound = u->hiz + u->ceiling_dist + HORNET_BOB_AMT;
|
||||
if (sp->pos.Z < bound)
|
||||
if (actor->spr.pos.Z < bound)
|
||||
{
|
||||
// bumped something
|
||||
sp->pos.Z = u->sz = bound + HORNET_BOB_AMT;
|
||||
actor->spr.pos.Z = u->sz = bound + HORNET_BOB_AMT;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -430,9 +430,9 @@ int InitHornetCircle(DSWActor* actor)
|
|||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
|
||||
// set to really fast
|
||||
sp->xvel = 400;
|
||||
actor->spr.xvel = 400;
|
||||
// angle adjuster
|
||||
u->Counter2 = sp->xvel/3;
|
||||
u->Counter2 = actor->spr.xvel/3;
|
||||
// random angle direction
|
||||
if (RANDOM_P2(1024) < 512)
|
||||
u->Counter2 = -u->Counter2;
|
||||
|
@ -455,10 +455,10 @@ int DoHornetCircle(DSWActor* actor)
|
|||
SPRITEp sp = &actor->s();
|
||||
int nx,ny,bound;
|
||||
|
||||
sp->ang = NORM_ANGLE(sp->ang + u->Counter2);
|
||||
actor->spr.ang = NORM_ANGLE(actor->spr.ang + u->Counter2);
|
||||
|
||||
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
|
||||
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
|
||||
nx = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
|
||||
ny = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
|
||||
|
||||
if (!move_actor(actor, nx, ny, 0L))
|
||||
{
|
||||
|
@ -466,9 +466,9 @@ int DoHornetCircle(DSWActor* actor)
|
|||
|
||||
// try moving in the opposite direction
|
||||
u->Counter2 = -u->Counter2;
|
||||
sp->ang = NORM_ANGLE(sp->ang + 1024);
|
||||
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
|
||||
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
|
||||
actor->spr.ang = NORM_ANGLE(actor->spr.ang + 1024);
|
||||
nx = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
|
||||
ny = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
|
||||
|
||||
if (!move_actor(actor, nx, ny, 0L))
|
||||
{
|
||||
|
@ -514,7 +514,7 @@ int DoHornetDeath(DSWActor* actor)
|
|||
}
|
||||
else
|
||||
{
|
||||
RESET(sp->cstat, CSTAT_SPRITE_YCENTER);
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_YCENTER);
|
||||
u->jump_speed = 0;
|
||||
u->floor_dist = 0;
|
||||
DoBeginFall(actor);
|
||||
|
@ -526,16 +526,16 @@ int DoHornetDeath(DSWActor* actor)
|
|||
DoActorSlide(actor);
|
||||
|
||||
// slide while falling
|
||||
nx = MulScale(sp->xvel, bcos(sp->ang), 14);
|
||||
ny = MulScale(sp->xvel, bsin(sp->ang), 14);
|
||||
nx = MulScale(actor->spr.xvel, bcos(actor->spr.ang), 14);
|
||||
ny = MulScale(actor->spr.xvel, bsin(actor->spr.ang), 14);
|
||||
|
||||
u->coll = move_sprite(actor, nx, ny, 0L, u->ceiling_dist, u->floor_dist, 1, ACTORMOVETICS);
|
||||
|
||||
// on the ground
|
||||
if (sp->pos.Z >= u->loz)
|
||||
if (actor->spr.pos.Z >= u->loz)
|
||||
{
|
||||
RESET(u->Flags, SPR_FALLING|SPR_SLIDING);
|
||||
RESET(sp->cstat, CSTAT_SPRITE_YFLIP); // If upside down, reset it
|
||||
RESET(actor->spr.cstat, CSTAT_SPRITE_YFLIP); // If upside down, reset it
|
||||
NewStateGroup(actor, u->ActorActionSet->Dead);
|
||||
DeleteNoSoundOwner(actor);
|
||||
return 0;
|
||||
|
@ -563,7 +563,7 @@ int DoCheckSwarm(DSWActor* actor)
|
|||
if (u->targetActor->user.PlayerP)
|
||||
{
|
||||
pp = u->targetActor->user.PlayerP;
|
||||
DISTANCE(sp->pos.X, sp->pos.Y, pp->pos.X, pp->pos.Y, pdist, a, b, c);
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, pp->pos.X, pp->pos.Y, pdist, a, b, c);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
@ -579,7 +579,7 @@ int DoCheckSwarm(DSWActor* actor)
|
|||
|
||||
if (tsp->hitag != TAG_SWARMSPOT || tsp->lotag != 2) continue;
|
||||
|
||||
DISTANCE(sp->pos.X, sp->pos.Y, tsp->pos.X, tsp->pos.Y, dist, a, b, c);
|
||||
DISTANCE(actor->spr.pos.X, actor->spr.pos.Y, tsp->pos.X, tsp->pos.Y, dist, a, b, c);
|
||||
|
||||
if (dist < pdist && u->ID == tu->ID) // Only flock to your own kind
|
||||
{
|
||||
|
@ -599,7 +599,7 @@ int DoHornetMove(DSWActor* actor)
|
|||
// Check for swarming
|
||||
// lotag of 1 = Swarm around lotags of 2
|
||||
// lotag of 0 is normal
|
||||
if (sp->hitag == TAG_SWARMSPOT && sp->lotag == 1)
|
||||
if (actor->spr.hitag == TAG_SWARMSPOT && actor->spr.lotag == 1)
|
||||
DoCheckSwarm(actor);
|
||||
|
||||
if (TEST(u->Flags,SPR_SLIDING))
|
||||
|
|
Loading…
Reference in a new issue