mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- move stuff to refactor to a sub-structure.
This commit is contained in:
parent
12266a3693
commit
3612127a5e
27 changed files with 200 additions and 195 deletions
|
@ -531,11 +531,11 @@ void KeepActorOnFloor(DSWActor* actor)
|
|||
|
||||
if ((sectp->extra & SECTFX_SINK) &&
|
||||
depth > 35 &&
|
||||
actor->user.ActorActionSet && actor->user.ActorActionSet->Swim)
|
||||
actor->user.__legacyState.ActorActionSet && actor->user.__legacyState.ActorActionSet->Swim)
|
||||
{
|
||||
if (actor->user.Flags & (SPR_SWIMMING))
|
||||
{
|
||||
if (actor->user.Rot != actor->user.ActorActionSet->Run && actor->user.Rot != actor->user.ActorActionSet->Swim && actor->user.Rot != actor->user.ActorActionSet->Stand)
|
||||
if (actor->user.__legacyState.Rot != actor->user.__legacyState.ActorActionSet->Run && actor->user.__legacyState.Rot != actor->user.__legacyState.ActorActionSet->Swim && actor->user.__legacyState.Rot != actor->user.__legacyState.ActorActionSet->Stand)
|
||||
{
|
||||
// was swimming but have now stopped
|
||||
actor->user.Flags &= ~(SPR_SWIMMING);
|
||||
|
@ -544,9 +544,9 @@ void KeepActorOnFloor(DSWActor* actor)
|
|||
return;
|
||||
}
|
||||
|
||||
if (actor->user.Rot == actor->user.ActorActionSet->Run)
|
||||
if (actor->user.__legacyState.Rot == actor->user.__legacyState.ActorActionSet->Run)
|
||||
{
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Swim);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Swim);
|
||||
}
|
||||
|
||||
// are swimming
|
||||
|
@ -555,9 +555,9 @@ void KeepActorOnFloor(DSWActor* actor)
|
|||
else
|
||||
{
|
||||
// only start swimming if you are running
|
||||
if (actor->user.Rot == actor->user.ActorActionSet->Run || actor->user.Rot == actor->user.ActorActionSet->Swim)
|
||||
if (actor->user.__legacyState.Rot == actor->user.__legacyState.ActorActionSet->Run || actor->user.__legacyState.Rot == actor->user.__legacyState.ActorActionSet->Swim)
|
||||
{
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Swim);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Swim);
|
||||
actor->spr.pos.Z = actor->user.oz = actor->user.loz - depth;
|
||||
actor->user.Flags |= (SPR_SWIMMING);
|
||||
actor->spr.cstat |= (CSTAT_SPRITE_YCENTER);
|
||||
|
@ -656,12 +656,12 @@ int DoActorBeginJump(DSWActor* actor)
|
|||
actor->user.jump_grav = ACTOR_GRAVITY;
|
||||
|
||||
// Change sprites state to jumping
|
||||
if (actor->user.ActorActionSet)
|
||||
if (actor->user.__legacyState.ActorActionSet)
|
||||
{
|
||||
if (actor->user.Flags & (SPR_DEAD))
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->DeathJump);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->DeathJump);
|
||||
else
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Jump);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Jump);
|
||||
}
|
||||
actor->user.StateFallOverride = nullptr;
|
||||
|
||||
|
@ -728,14 +728,14 @@ int DoActorBeginFall(DSWActor* actor)
|
|||
actor->user.jump_grav = ACTOR_GRAVITY;
|
||||
|
||||
// Change sprites state to falling
|
||||
if (actor->user.ActorActionSet)
|
||||
if (actor->user.__legacyState.ActorActionSet)
|
||||
{
|
||||
if (actor->user.Flags & (SPR_DEAD))
|
||||
{
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->DeathFall);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->DeathFall);
|
||||
}
|
||||
else
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Fall);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Fall);
|
||||
|
||||
if (actor->user.StateFallOverride)
|
||||
{
|
||||
|
@ -796,23 +796,23 @@ int DoActorStopFall(DSWActor* actor)
|
|||
}
|
||||
|
||||
// Change sprites state to running
|
||||
if (actor->user.ActorActionSet)
|
||||
if (actor->user.__legacyState.ActorActionSet)
|
||||
{
|
||||
if (actor->user.Flags & (SPR_DEAD))
|
||||
{
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Dead);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Dead);
|
||||
PlaySound(DIGI_ACTORBODYFALL1, actor, v3df_none);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlaySound(DIGI_ACTORHITGROUND, actor, v3df_none);
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
if ((actor->user.track >= 0) && (actor->user.jump_speed) > 800 && (actor->user.ActorActionSet->Sit))
|
||||
if ((actor->user.track >= 0) && (actor->user.jump_speed) > 800 && (actor->user.__legacyState.ActorActionSet->Sit))
|
||||
{
|
||||
actor->user.WaitTics = 80;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Sit);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Sit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -421,7 +421,7 @@ int DoActorOperate(DSWActor* actor)
|
|||
if (actor->user.ID == HORNET_RUN_R0 || actor->user.ID == EEL_RUN_R0 || actor->user.ID == BUNNY_RUN_R0)
|
||||
return false;
|
||||
|
||||
if (actor->user.Rot == actor->user.ActorActionSet->Sit || actor->user.Rot == actor->user.ActorActionSet->Stand)
|
||||
if (actor->user.__legacyState.Rot == actor->user.__legacyState.ActorActionSet->Sit || actor->user.__legacyState.Rot == actor->user.__legacyState.ActorActionSet->Stand)
|
||||
return false;
|
||||
|
||||
if ((actor->user.WaitTics -= ACTORMOVETICS) > 0)
|
||||
|
@ -441,7 +441,7 @@ int DoActorOperate(DSWActor* actor)
|
|||
{
|
||||
actor->user.WaitTics = 2 * 120;
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Sit);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Sit);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -556,7 +556,7 @@ ANIMATOR* DoActorActionDecide(DSWActor* actor)
|
|||
actor->user.Flags &= ~(SPR_TARGETED); // as far as actor
|
||||
// knows, its not a
|
||||
// target any more
|
||||
if (actor->user.ActorActionSet->Duck && RANDOM_P2(1024<<8)>>8 < 100)
|
||||
if (actor->user.__legacyState.ActorActionSet->Duck && RANDOM_P2(1024<<8)>>8 < 100)
|
||||
action = InitActorDuck;
|
||||
else
|
||||
{
|
||||
|
@ -697,7 +697,7 @@ int DoActorDecide(DSWActor* actor)
|
|||
else
|
||||
{
|
||||
// Actually staying put
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Stand);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Stand);
|
||||
//CON_Message("DoActorDecide: Staying put");
|
||||
}
|
||||
|
||||
|
@ -816,8 +816,8 @@ int InitActorMoveCloser(DSWActor* actor)
|
|||
{
|
||||
actor->user.ActorActionFunc = DoActorMoveCloser;
|
||||
|
||||
if (actor->user.Rot != actor->user.ActorActionSet->Run)
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
if (actor->user.__legacyState.Rot != actor->user.__legacyState.ActorActionSet->Run)
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
(*actor->user.ActorActionFunc)(actor);
|
||||
|
||||
|
@ -843,7 +843,7 @@ int DoActorCantMoveCloser(DSWActor* actor)
|
|||
actor->user.Flags |= (SPR_FIND_PLAYER);
|
||||
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1079,7 +1079,7 @@ int FindWanderTrack(DSWActor* actor)
|
|||
int InitActorRunAway(DSWActor* actor)
|
||||
{
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
actor->user.track = FindTrackAwayFromPlayer(actor);
|
||||
|
||||
|
@ -1108,7 +1108,7 @@ int InitActorRunAway(DSWActor* actor)
|
|||
int InitActorRunToward(DSWActor* actor)
|
||||
{
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
InitActorReposition(actor);
|
||||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
|
@ -1170,7 +1170,7 @@ int InitActorAttack(DSWActor* actor)
|
|||
actor->user.ActorActionFunc = DoActorAttack;
|
||||
|
||||
// move into standing frame
|
||||
//NewStateGroup(actor, actor->user.ActorActionSet->Stand);
|
||||
//NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Stand);
|
||||
|
||||
// face player when attacking
|
||||
actor->spr.Angles.Yaw = (actor->user.targetActor->spr.pos - actor->spr.pos).Angle();
|
||||
|
@ -1183,7 +1183,7 @@ int InitActorAttack(DSWActor* actor)
|
|||
}
|
||||
|
||||
// Hari Kari for Ninja's
|
||||
if (actor->user.ActorActionSet->Death2)
|
||||
if (actor->user.__legacyState.ActorActionSet->Death2)
|
||||
{
|
||||
const int SUICIDE_HEALTH_VALUE = 38;
|
||||
|
||||
|
@ -1192,7 +1192,7 @@ int InitActorAttack(DSWActor* actor)
|
|||
if (CHOOSE2(100))
|
||||
{
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Death2);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Death2);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1219,22 +1219,22 @@ int DoActorAttack(DSWActor* actor)
|
|||
double dist =(actor->spr.pos.XY() - actor->user.targetActor->spr.pos.XY()).Length();
|
||||
|
||||
auto pActor = GetPlayerSpriteNum(actor);
|
||||
if ((actor->user.ActorActionSet->CloseAttack[0] && dist < CloseRangeDist(actor, actor->user.targetActor)) ||
|
||||
if ((actor->user.__legacyState.ActorActionSet->CloseAttack[0] && dist < CloseRangeDist(actor, actor->user.targetActor)) ||
|
||||
(pActor && pActor->hasU() && pActor->user.WeaponNum == WPN_FIST)) // JBF: added null check
|
||||
{
|
||||
rand_num = ChooseActionNumber(actor->user.ActorActionSet->CloseAttackPercent);
|
||||
rand_num = ChooseActionNumber(actor->user.__legacyState.ActorActionSet->CloseAttackPercent);
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->CloseAttack[rand_num]);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->CloseAttack[rand_num]);
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSERT(actor->user.WeaponNum != 0);
|
||||
|
||||
rand_num = ChooseActionNumber(actor->user.ActorActionSet->AttackPercent);
|
||||
rand_num = ChooseActionNumber(actor->user.__legacyState.ActorActionSet->AttackPercent);
|
||||
|
||||
ASSERT(rand_num < actor->user.WeaponNum);
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Attack[rand_num]);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Attack[rand_num]);
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
}
|
||||
|
||||
|
@ -1255,7 +1255,7 @@ int InitActorEvade(DSWActor* actor)
|
|||
// you stop and take up the fight again.
|
||||
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
actor->user.track = FindTrackAwayFromPlayer(actor);
|
||||
|
||||
|
@ -1280,7 +1280,7 @@ int InitActorEvade(DSWActor* actor)
|
|||
int InitActorWanderAround(DSWActor* actor)
|
||||
{
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
DoActorPickClosePlayer(actor);
|
||||
|
||||
|
@ -1305,7 +1305,7 @@ int InitActorWanderAround(DSWActor* actor)
|
|||
int InitActorFindPlayer(DSWActor* actor)
|
||||
{
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
actor->user.track = FindTrackToPlayer(actor);
|
||||
|
||||
|
@ -1317,7 +1317,7 @@ int InitActorFindPlayer(DSWActor* actor)
|
|||
actor->user.Flags |= (SPR_FIND_PLAYER);
|
||||
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1334,14 +1334,14 @@ int InitActorFindPlayer(DSWActor* actor)
|
|||
|
||||
int InitActorDuck(DSWActor* actor)
|
||||
{
|
||||
if (!actor->user.ActorActionSet->Duck)
|
||||
if (!actor->user.__legacyState.ActorActionSet->Duck)
|
||||
{
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
return 0;
|
||||
}
|
||||
|
||||
actor->user.ActorActionFunc = DoActorDuck;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Duck);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Duck);
|
||||
|
||||
double dist = (actor->spr.pos.XY() - actor->user.targetActor->spr.pos.XY()).LengthSquared();
|
||||
|
||||
|
@ -1371,7 +1371,7 @@ int DoActorDuck(DSWActor* actor)
|
|||
{
|
||||
if ((actor->user.WaitTics -= ACTORMOVETICS) < 0)
|
||||
{
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Rise);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Rise);
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
actor->user.Flags &= ~(SPR_TARGETED);
|
||||
}
|
||||
|
@ -1693,7 +1693,7 @@ int InitActorReposition(DSWActor* actor)
|
|||
|
||||
actor->user.ActorActionFunc = DoActorReposition;
|
||||
if (!(actor->user.Flags & SPR_SWIMMING))
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
(*actor->user.ActorActionFunc)(actor);
|
||||
|
||||
|
|
|
@ -743,7 +743,7 @@ int SetupBunny(DSWActor* actor)
|
|||
|
||||
ChangeState(actor, s_BunnyRun[0]);
|
||||
actor->user.StateEnd = s_BunnyDie;
|
||||
actor->user.Rot = sg_BunnyRun;
|
||||
actor->user.__legacyState.Rot = sg_BunnyRun;
|
||||
actor->user.ShellNum = 0; // Not Pregnant right now
|
||||
actor->user.FlagOwner = 0;
|
||||
|
||||
|
@ -1178,7 +1178,7 @@ void BunnyHatch(DSWActor* actor)
|
|||
|
||||
actorNew->user.ShellNum = 0; // Not Pregnant right now
|
||||
|
||||
NewStateGroup(actorNew, actorNew->user.ActorActionSet->Jump);
|
||||
NewStateGroup(actorNew, actorNew->user.__legacyState.ActorActionSet->Jump);
|
||||
actorNew->user.ActorActionFunc = DoActorMoveJump;
|
||||
DoActorSetSpeed(actorNew, FAST_SPEED);
|
||||
PickJumpMaxSpeed(actorNew, -600);
|
||||
|
@ -1226,7 +1226,7 @@ DSWActor* BunnyHatch2(DSWActor* actor)
|
|||
|
||||
actorNew->user.ShellNum = 0; // Not Pregnant right now
|
||||
|
||||
NewStateGroup(actorNew, actorNew->user.ActorActionSet->Jump);
|
||||
NewStateGroup(actorNew, actorNew->user.__legacyState.ActorActionSet->Jump);
|
||||
actorNew->user.ActorActionFunc = DoActorMoveJump;
|
||||
DoActorSetSpeed(actorNew, FAST_SPEED);
|
||||
if (TEST_BOOL3(actor))
|
||||
|
|
|
@ -537,7 +537,7 @@ int SetupCoolg(DSWActor* actor)
|
|||
actor->user.Attrib = &CoolgAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_CoolgDie;
|
||||
actor->user.Rot = sg_CoolgRun;
|
||||
actor->user.__legacyState.Rot = sg_CoolgRun;
|
||||
|
||||
EnemyDefaults(actor, &CoolgActionSet, &CoolgPersonality);
|
||||
|
||||
|
@ -562,10 +562,10 @@ int NewCoolg(DSWActor* actor)
|
|||
|
||||
ChangeState(actorNew, &s_CoolgBirth[0]);
|
||||
actorNew->user.StateEnd = s_CoolgDie;
|
||||
actorNew->user.Rot = sg_CoolgRun;
|
||||
actorNew->user.__legacyState.Rot = sg_CoolgRun;
|
||||
actorNew->spr.pal = actorNew->user.spal = actor->user.spal;
|
||||
|
||||
actorNew->user.ActorActionSet = &CoolgActionSet;
|
||||
actorNew->user.__legacyState.ActorActionSet = &CoolgActionSet;
|
||||
|
||||
actorNew->spr.shade = actor->spr.shade;
|
||||
actorNew->user.Personality = &CoolgPersonality;
|
||||
|
@ -595,7 +595,7 @@ int DoCoolgBirth(DSWActor* actor)
|
|||
|
||||
ChangeState(actor, s_CoolgRun[0]);
|
||||
actor->user.StateEnd = s_CoolgDie;
|
||||
actor->user.Rot = sg_CoolgRun;
|
||||
actor->user.__legacyState.Rot = sg_CoolgRun;
|
||||
|
||||
EnemyDefaults(actor, &CoolgActionSet, &CoolgPersonality);
|
||||
// special case
|
||||
|
@ -715,7 +715,7 @@ int InitCoolgCircle(DSWActor* actor)
|
|||
{
|
||||
actor->user.ActorActionFunc = DoCoolgCircle;
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
// set it close
|
||||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
|
@ -820,7 +820,7 @@ int DoCoolgDeath(DSWActor* actor)
|
|||
{
|
||||
actor->user.Flags &= ~(SPR_FALLING|SPR_SLIDING);
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP); // If upside down, reset it
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Dead);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Dead);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -431,7 +431,7 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso
|
|||
change_actor_stat(actor, STAT_ENEMY);
|
||||
|
||||
actor->user.Personality = person;
|
||||
actor->user.ActorActionSet = action;
|
||||
actor->user.__legacyState.ActorActionSet = action;
|
||||
|
||||
DoActorZrange(actor);
|
||||
|
||||
|
@ -468,14 +468,14 @@ void EnemyDefaults(DSWActor* actor, ACTOR_ACTION_SET* action, PERSONALITY* perso
|
|||
if (!action)
|
||||
return;
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
actor->user.ActorActionFunc = DoActorDecide;
|
||||
|
||||
// find the number of long range attacks
|
||||
for (wpn = wpn_cnt = 0; wpn < SIZ(actor->user.ActorActionSet->Attack); wpn++)
|
||||
for (wpn = wpn_cnt = 0; wpn < SIZ(actor->user.__legacyState.ActorActionSet->Attack); wpn++)
|
||||
{
|
||||
if (actor->user.ActorActionSet->Attack[wpn])
|
||||
if (actor->user.__legacyState.ActorActionSet->Attack[wpn])
|
||||
wpn_cnt++;
|
||||
else
|
||||
break;
|
||||
|
@ -500,7 +500,7 @@ int SetupCoolie(DSWActor* actor)
|
|||
actor->user.Attrib = &CoolieAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_CoolieDie;
|
||||
actor->user.Rot = sg_CoolieRun;
|
||||
actor->user.__legacyState.Rot = sg_CoolieRun;
|
||||
|
||||
EnemyDefaults(actor, &CoolieActionSet, &CooliePersonality);
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ int SetActorRotation(tspriteArray& tsprites, int tSpriteNum, const DVector2& vie
|
|||
ASSERT(Rotation < 5);
|
||||
|
||||
// Reset the State animation start based on the Rotation
|
||||
StateStart = ownerActor->user.Rot[Rotation];
|
||||
StateStart = ownerActor->user.__legacyState.Rot[Rotation];
|
||||
|
||||
// Set the sprites state
|
||||
State = StateStart + StateOffset;
|
||||
|
@ -1094,7 +1094,7 @@ void PreDrawStackedWater(void)
|
|||
// copy everything reasonable from the user that
|
||||
// analyzesprites() needs to draw the image
|
||||
actorNew->user.State = itActor2->user.State;
|
||||
actorNew->user.Rot = itActor2->user.Rot;
|
||||
actorNew->user.__legacyState.Rot = itActor2->user.__legacyState.Rot;
|
||||
actorNew->user.StateStart = itActor2->user.StateStart;
|
||||
actorNew->user.StateEnd = itActor2->user.StateEnd;
|
||||
actorNew->user.Flags = itActor2->user.Flags;
|
||||
|
|
|
@ -396,7 +396,7 @@ int SetupEel(DSWActor* actor)
|
|||
actor->user.Attrib = &EelAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_EelDie;
|
||||
actor->user.Rot = sg_EelRun;
|
||||
actor->user.__legacyState.Rot = sg_EelRun;
|
||||
|
||||
EnemyDefaults(actor, &EelActionSet, &EelPersonality);
|
||||
|
||||
|
@ -564,7 +564,7 @@ int DoEelDeath(DSWActor* actor)
|
|||
actor->spr.cstat |= (CSTAT_SPRITE_XFLIP);
|
||||
if (RandomRange(1000) > 500)
|
||||
actor->spr.cstat |= (CSTAT_SPRITE_YFLIP);
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Dead);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Dead);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -579,10 +579,10 @@ int DoEelDeath(DSWActor* actor)
|
|||
|
||||
int DoEelMove(DSWActor* actor)
|
||||
{
|
||||
ASSERT(actor->user.Rot != nullptr);
|
||||
ASSERT(actor->user.__legacyState.Rot != nullptr);
|
||||
|
||||
if (SpriteOverlap(actor, actor->user.targetActor))
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->CloseAttack[0]);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->CloseAttack[0]);
|
||||
|
||||
if (actor->user.Flags & (SPR_SLIDING))
|
||||
DoActorSlide(actor);
|
||||
|
|
|
@ -689,14 +689,19 @@ struct USER
|
|||
TArray<int8_t> WallShade;
|
||||
|
||||
walltype* WallP; // operate on wall instead of sprite
|
||||
STATE* State;
|
||||
struct LegacyState
|
||||
{
|
||||
ACTOR_ACTION_SET* ActorActionSet;
|
||||
STATE* *Rot;
|
||||
};
|
||||
LegacyState __legacyState;
|
||||
|
||||
STATE* State;
|
||||
STATE* StateStart;
|
||||
STATE* StateEnd;
|
||||
STATE* *StateFallOverride; // a bit kludgy - override std fall state
|
||||
|
||||
ANIMATOR* ActorActionFunc;
|
||||
ACTOR_ACTION_SET* ActorActionSet;
|
||||
PERSONALITY* Personality;
|
||||
ATTRIBUTE* Attrib;
|
||||
SECTOR_OBJECT* sop_parent; // denotes that this sprite is a part of the
|
||||
|
|
|
@ -727,7 +727,7 @@ int SetupGirlNinja(DSWActor* actor)
|
|||
}
|
||||
|
||||
actor->user.StateEnd = s_GirlNinjaDie;
|
||||
actor->user.Rot = sg_GirlNinjaRun;
|
||||
actor->user.__legacyState.Rot = sg_GirlNinjaRun;
|
||||
actor->spr.scale = DVector2(0.796875, 0.671875);
|
||||
|
||||
actor->user.Attrib = &GirlNinjaAttrib;
|
||||
|
|
|
@ -501,7 +501,7 @@ int SetupGoro(DSWActor* actor)
|
|||
actor->user.Attrib = &GoroAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_GoroDie;
|
||||
actor->user.Rot = sg_GoroRun;
|
||||
actor->user.__legacyState.Rot = sg_GoroRun;
|
||||
|
||||
|
||||
EnemyDefaults(actor, &GoroActionSet, &GoroPersonality);
|
||||
|
|
|
@ -307,7 +307,7 @@ int SetupHornet(DSWActor* actor)
|
|||
actor->user.Attrib = &HornetAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_HornetDie;
|
||||
actor->user.Rot = sg_HornetRun;
|
||||
actor->user.__legacyState.Rot = sg_HornetRun;
|
||||
|
||||
EnemyDefaults(actor, &HornetActionSet, &HornetPersonality);
|
||||
|
||||
|
@ -430,7 +430,7 @@ int InitHornetCircle(DSWActor* actor)
|
|||
{
|
||||
actor->user.ActorActionFunc = DoHornetCircle;
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
// set it close
|
||||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
|
@ -542,7 +542,7 @@ int DoHornetDeath(DSWActor* actor)
|
|||
{
|
||||
actor->user.Flags &= ~(SPR_FALLING|SPR_SLIDING);
|
||||
actor->spr.cstat &= ~(CSTAT_SPRITE_YFLIP); // If upside down, reset it
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Dead);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Dead);
|
||||
DeleteNoSoundOwner(actor);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -471,7 +471,7 @@ int SetupLava(DSWActor* actor)
|
|||
actor->user.Attrib = &LavaAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_LavaDie;
|
||||
actor->user.Rot = sg_LavaRun;
|
||||
actor->user.__legacyState.Rot = sg_LavaRun;
|
||||
|
||||
EnemyDefaults(actor, &LavaActionSet, &LavaPersonality);
|
||||
actor->spr.scale = DVector2(1.71875, 1.71875);
|
||||
|
|
|
@ -132,7 +132,7 @@ int SetupToiletGirl(DSWActor* actor)
|
|||
ChangeState(actor,s_ToiletGirlStand);
|
||||
actor->user.Attrib = &ToiletGirlAttrib;
|
||||
actor->user.StateEnd = s_ToiletGirlStand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
|
||||
actor->spr.scale = DVector2(0.5, 0.5);
|
||||
|
@ -387,7 +387,7 @@ int SetupWashGirl(DSWActor* actor)
|
|||
ChangeState(actor,s_WashGirlStand);
|
||||
actor->user.Attrib = &WashGirlAttrib;
|
||||
actor->user.StateEnd = s_WashGirlStand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
|
||||
actor->spr.scale = DVector2(0.4374, 0.375);
|
||||
|
@ -616,7 +616,7 @@ int SetupTrashCan(DSWActor* actor)
|
|||
ChangeState(actor,s_TrashCanStand);
|
||||
actor->user.Attrib = &TrashCanAttrib;
|
||||
actor->user.StateEnd = s_TrashCanStand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
|
||||
|
||||
|
@ -729,7 +729,7 @@ int SetupPachinkoLight(DSWActor* actor)
|
|||
ChangeState(actor,s_PachinkoLightStand);
|
||||
actor->user.Attrib = &PachinkoLightAttrib;
|
||||
actor->user.StateEnd = s_PachinkoLightStand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
actor->user.ID = PACHINKOLIGHT_R0;
|
||||
|
||||
|
@ -834,7 +834,7 @@ int SetupPachinko1(DSWActor* actor)
|
|||
ChangeState(actor,s_Pachinko1Stand);
|
||||
actor->user.Attrib = &Pachinko1Attrib;
|
||||
actor->user.StateEnd = s_Pachinko1Stand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
actor->user.ID = PACHINKO1;
|
||||
|
||||
|
@ -1007,7 +1007,7 @@ int SetupPachinko2(DSWActor* actor)
|
|||
ChangeState(actor,s_Pachinko2Stand);
|
||||
actor->user.Attrib = &Pachinko2Attrib;
|
||||
actor->user.StateEnd = s_Pachinko2Stand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
actor->user.ID = PACHINKO2;
|
||||
|
||||
|
@ -1092,7 +1092,7 @@ int SetupPachinko3(DSWActor* actor)
|
|||
ChangeState(actor,s_Pachinko3Stand);
|
||||
actor->user.Attrib = &Pachinko3Attrib;
|
||||
actor->user.StateEnd = s_Pachinko3Stand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
actor->user.ID = PACHINKO3;
|
||||
|
||||
|
@ -1178,7 +1178,7 @@ int SetupPachinko4(DSWActor* actor)
|
|||
ChangeState(actor,s_Pachinko4Stand);
|
||||
actor->user.Attrib = &Pachinko4Attrib;
|
||||
actor->user.StateEnd = s_Pachinko4Stand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
actor->user.ID = PACHINKO4;
|
||||
|
||||
|
@ -1292,7 +1292,7 @@ int SetupCarGirl(DSWActor* actor)
|
|||
ChangeState(actor,s_CarGirlStand);
|
||||
actor->user.Attrib = &CarGirlAttrib;
|
||||
actor->user.StateEnd = s_CarGirlStand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
|
||||
actor->spr.scale = DVector2(0.453125, 0.390625);
|
||||
|
@ -1527,7 +1527,7 @@ int SetupMechanicGirl(DSWActor* actor)
|
|||
ChangeState(actor,s_MechanicGirlStand);
|
||||
actor->user.Attrib = &MechanicGirlAttrib;
|
||||
actor->user.StateEnd = s_MechanicGirlStand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
|
||||
actor->spr.scale = DVector2(0.421875, 0.40625);
|
||||
|
@ -1761,7 +1761,7 @@ int SetupSailorGirl(DSWActor* actor)
|
|||
ChangeState(actor,s_SailorGirlStand);
|
||||
actor->user.Attrib = &SailorGirlAttrib;
|
||||
actor->user.StateEnd = s_SailorGirlStand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
|
||||
actor->spr.scale = DVector2(0.4375, 0.40625);
|
||||
|
@ -1990,7 +1990,7 @@ int SetupPruneGirl(DSWActor* actor)
|
|||
ChangeState(actor,s_PruneGirlStand);
|
||||
actor->user.Attrib = &PruneGirlAttrib;
|
||||
actor->user.StateEnd = s_PruneGirlStand;
|
||||
actor->user.Rot = 0;
|
||||
actor->user.__legacyState.Rot = 0;
|
||||
actor->user.RotNum = 0;
|
||||
|
||||
actor->spr.scale = DVector2(0.515625, 0.4375);
|
||||
|
|
|
@ -1829,7 +1829,7 @@ int SetupNinja(DSWActor* actor)
|
|||
}
|
||||
|
||||
actor->user.StateEnd = s_NinjaDie;
|
||||
actor->user.Rot = sg_NinjaRun;
|
||||
actor->user.__legacyState.Rot = sg_NinjaRun;
|
||||
actor->spr.scale = DVector2(0.71875, 0.71875);
|
||||
|
||||
if (actor->spr.pal == PALETTE_PLAYER5)
|
||||
|
@ -1847,14 +1847,14 @@ int SetupNinja(DSWActor* actor)
|
|||
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
|
||||
{
|
||||
actor->user.Attrib = &NinjaAttrib;
|
||||
actor->user.ActorActionSet = &NinjaActionSet;
|
||||
actor->user.__legacyState.ActorActionSet = &NinjaActionSet;
|
||||
actor->user.Personality = &NinjaPersonality;
|
||||
ChangeState(actor, s_NinjaCeiling[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
actor->user.Attrib = &NinjaAttrib;
|
||||
actor->user.ActorActionSet = &NinjaSniperActionSet;
|
||||
actor->user.__legacyState.ActorActionSet = &NinjaSniperActionSet;
|
||||
actor->user.Personality = &NinjaSniperPersonality;
|
||||
ChangeState(actor, s_NinjaDuck[0]);
|
||||
}
|
||||
|
@ -1872,14 +1872,14 @@ int SetupNinja(DSWActor* actor)
|
|||
if (actor->spr.cstat & (CSTAT_SPRITE_YFLIP))
|
||||
{
|
||||
actor->user.Attrib = &NinjaAttrib;
|
||||
actor->user.ActorActionSet = &NinjaActionSet;
|
||||
actor->user.__legacyState.ActorActionSet = &NinjaActionSet;
|
||||
actor->user.Personality = &NinjaPersonality;
|
||||
ChangeState(actor, s_NinjaCeiling[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
actor->user.Attrib = &NinjaAttrib;
|
||||
actor->user.ActorActionSet = &NinjaSniperActionSet;
|
||||
actor->user.__legacyState.ActorActionSet = &NinjaSniperActionSet;
|
||||
actor->user.Personality = &NinjaSniperPersonality;
|
||||
ChangeState(actor, s_NinjaDuck[0]);
|
||||
}
|
||||
|
@ -1911,7 +1911,7 @@ int SetupNinja(DSWActor* actor)
|
|||
if (pic == NINJA_CRAWL_R0)
|
||||
{
|
||||
actor->user.Attrib = &NinjaAttrib;
|
||||
actor->user.ActorActionSet = &NinjaSniperActionSet;
|
||||
actor->user.__legacyState.ActorActionSet = &NinjaSniperActionSet;
|
||||
actor->user.Personality = &NinjaSniperPersonality;
|
||||
ChangeState(actor, s_NinjaDuck[0]);
|
||||
}
|
||||
|
@ -2408,8 +2408,8 @@ void InitPlayerSprite(PLAYER* pp, const DVector3& spawnpos, const DAngle startan
|
|||
|
||||
// Grouping items that need to be reset after a LoadLevel
|
||||
ChangeState(actor, s_NinjaRun[0]);
|
||||
actor->user.Rot = sg_NinjaRun;
|
||||
actor->user.ActorActionSet = &PlayerNinjaActionSet;
|
||||
actor->user.__legacyState.Rot = sg_NinjaRun;
|
||||
actor->user.__legacyState.ActorActionSet = &PlayerNinjaActionSet;
|
||||
|
||||
actor->user.RotNum = 5;
|
||||
|
||||
|
@ -2427,7 +2427,7 @@ void InitPlayerSprite(PLAYER* pp, const DVector3& spawnpos, const DAngle startan
|
|||
actor->spr.pal = PALETTE_PLAYER0 + pp->pnum;
|
||||
actor->user.spal = actor->spr.pal;
|
||||
|
||||
NewStateGroup(pp->actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(pp->actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
pp->PlayerUnderActor = nullptr;
|
||||
|
||||
|
@ -2477,16 +2477,16 @@ void SpawnPlayerUnderSprite(PLAYER* pp)
|
|||
actor->spr.cstat |= (CSTAT_SPRITE_BLOCK | CSTAT_SPRITE_BLOCK_HITSCAN);
|
||||
actor->spr.extra |= (SPRX_PLAYER_OR_ENEMY);
|
||||
|
||||
actor->user.Rot = sg_NinjaRun;
|
||||
actor->user.__legacyState.Rot = sg_NinjaRun;
|
||||
actor->user.RotNum = plActor->user.RotNum;
|
||||
NewStateGroup(pp->PlayerUnderActor, plActor->user.Rot);
|
||||
NewStateGroup(pp->PlayerUnderActor, plActor->user.__legacyState.Rot);
|
||||
|
||||
actor->user.Radius = plActor->user.Radius;
|
||||
actor->user.PlayerP = pp;
|
||||
actor->user.Health = pp->MaxHealth;
|
||||
actor->user.Flags |= (SPR_XFLIP_TOGGLE);
|
||||
|
||||
actor->user.ActorActionSet = plActor->user.ActorActionSet;
|
||||
actor->user.__legacyState.ActorActionSet = plActor->user.__legacyState.ActorActionSet;
|
||||
|
||||
actor->spr.picnum = plActor->spr.picnum;
|
||||
actor->copy_clipdist(plActor);
|
||||
|
|
|
@ -1058,10 +1058,10 @@ void DoPlayerSpriteThrow(PLAYER* pp)
|
|||
{
|
||||
if (!(pp->Flags & (PF_DIVING|PF_FLYING|PF_CRAWLING)))
|
||||
{
|
||||
if (pp->CurWpn == pp->Wpn[WPN_SWORD] && pp->actor->user.Rot != sg_PlayerNinjaSword)
|
||||
if (pp->CurWpn == pp->Wpn[WPN_SWORD] && pp->actor->user.__legacyState.Rot != sg_PlayerNinjaSword)
|
||||
NewStateGroup(pp->actor, sg_PlayerNinjaSword);
|
||||
else
|
||||
//if (pp->CurWpn == pp->Wpn[WPN_FIST] && pp->actor->user.Rot != sg_PlayerNinjaPunch)
|
||||
//if (pp->CurWpn == pp->Wpn[WPN_FIST] && pp->actor->user.__legacyState.Rot != sg_PlayerNinjaPunch)
|
||||
NewStateGroup(pp->actor, sg_PlayerNinjaPunch);
|
||||
//else
|
||||
// NewStateGroup(pp->actor, sg_PlayerNinjaThrow);
|
||||
|
@ -1085,13 +1085,13 @@ int DoPlayerSpriteReset(DSWActor* actor)
|
|||
|
||||
// need to figure out what frames to put sprite into
|
||||
if (pp->DoPlayerAction == DoPlayerCrawl)
|
||||
NewStateGroup(pp->actor, actor->user.ActorActionSet->Crawl);
|
||||
NewStateGroup(pp->actor, actor->user.__legacyState.ActorActionSet->Crawl);
|
||||
else
|
||||
{
|
||||
if (pp->Flags & (PF_PLAYER_MOVED))
|
||||
NewStateGroup(pp->actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(pp->actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
else
|
||||
NewStateGroup(pp->actor, actor->user.ActorActionSet->Stand);
|
||||
NewStateGroup(pp->actor, actor->user.__legacyState.ActorActionSet->Stand);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1423,7 +1423,7 @@ void DoPlayerWarpTeleporter(PLAYER* pp)
|
|||
DoPlayerBeginRun(pp);
|
||||
pp->DoPlayerAction = DoPlayerTeleportPause;
|
||||
|
||||
NewStateGroup(ppActor, ppActor->user.ActorActionSet->Stand);
|
||||
NewStateGroup(ppActor, ppActor->user.__legacyState.ActorActionSet->Stand);
|
||||
|
||||
UpdatePlayerSprite(pp);
|
||||
DoSpawnTeleporterEffect(ppActor);
|
||||
|
@ -1816,7 +1816,7 @@ void UpdatePlayerUnderSprite(PLAYER* pp)
|
|||
act_under->spr.pos.Z = act_under->sector()->ceilingz + zdiff;
|
||||
|
||||
act_under->user.State = act_over->user.State;
|
||||
act_under->user.Rot = act_over->user.Rot;
|
||||
act_under->user.__legacyState.Rot = act_over->user.__legacyState.Rot;
|
||||
act_under->user.StateStart = act_over->user.StateStart;
|
||||
act_under->spr.picnum = act_over->spr.picnum;
|
||||
}
|
||||
|
@ -2789,7 +2789,7 @@ void DoPlayerBeginJump(PLAYER* pp)
|
|||
|
||||
///DamageData[plActor->user.WeaponNum].Init(pp);
|
||||
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Jump);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Jump);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -2816,7 +2816,7 @@ void DoPlayerBeginForceJump(PLAYER* pp)
|
|||
|
||||
///DamageData[plActor->user.WeaponNum].Init(pp);
|
||||
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Jump);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Jump);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -2991,8 +2991,8 @@ void DoPlayerBeginFall(PLAYER* pp)
|
|||
|
||||
// Only change to falling frame if you were in the jump frame
|
||||
// Otherwise an animation may be messed up such as Running Jump Kick
|
||||
if (plActor->user.Rot == plActor->user.ActorActionSet->Jump)
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Fall);
|
||||
if (plActor->user.__legacyState.Rot == plActor->user.__legacyState.ActorActionSet->Jump)
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Fall);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -3198,7 +3198,7 @@ void DoPlayerBeginClimb(PLAYER* pp)
|
|||
|
||||
//DamageData[plActor->user.WeaponNum].Init(pp);
|
||||
|
||||
//NewStateGroup(pp->actor, pp->actor->user.ActorActionSet->Climb);
|
||||
//NewStateGroup(pp->actor, pp->actor->user.__legacyState.ActorActionSet->Climb);
|
||||
NewStateGroup(pp->actor, sg_PlayerNinjaClimb);
|
||||
}
|
||||
|
||||
|
@ -3464,7 +3464,7 @@ void DoPlayerBeginCrawl(PLAYER* pp)
|
|||
|
||||
//pp->posz = pp->loz - PLAYER_CRAWL_HEIGHT;
|
||||
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Crawl);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Crawl);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -3571,7 +3571,7 @@ void DoPlayerCrawl(PLAYER* pp)
|
|||
|
||||
if (!(pp->Flags & PF_PLAYER_MOVED))
|
||||
{
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Crawl);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Crawl);
|
||||
}
|
||||
|
||||
// If the floor is far below you, fall hard instead of adjusting height
|
||||
|
@ -4304,7 +4304,7 @@ void DoPlayerBeginDive(PLAYER* pp)
|
|||
DoPlayerMove(pp); // needs to be called to reset the pp->loz/hiz variable
|
||||
///DamageData[plActor->user.WeaponNum].Init(pp);
|
||||
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Dive);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Dive);
|
||||
|
||||
DoPlayerDive(pp);
|
||||
}
|
||||
|
@ -4357,7 +4357,7 @@ void DoPlayerBeginDiveNoWarp(PLAYER* pp)
|
|||
pp->DiveDamageTics = 0;
|
||||
DoPlayerMove(pp); // needs to be called to reset the pp->loz/hiz variable
|
||||
///DamageData[plActor->user.WeaponNum].Init(pp);
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Dive);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Dive);
|
||||
DoPlayerDive(pp);
|
||||
}
|
||||
|
||||
|
@ -4794,9 +4794,9 @@ void DoPlayerBeginWade(PLAYER* pp)
|
|||
if (pp->jump_speed > 0 && pp->jump_speed < 1300)
|
||||
pp->jump_speed = 0;
|
||||
|
||||
ASSERT(plActor->user.ActorActionSet->Run);
|
||||
ASSERT(plActor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Run);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4889,13 +4889,13 @@ void DoPlayerWade(PLAYER* pp)
|
|||
|
||||
if (pp->Flags & (PF_PLAYER_MOVED))
|
||||
{
|
||||
if (plActor->user.Rot != plActor->user.ActorActionSet->Run)
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
|
||||
if (plActor->user.__legacyState.Rot != plActor->user.__legacyState.ActorActionSet->Run)
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Run);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (plActor->user.Rot != plActor->user.ActorActionSet->Stand)
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Stand);
|
||||
if (plActor->user.__legacyState.Rot != plActor->user.__legacyState.ActorActionSet->Stand)
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Stand);
|
||||
}
|
||||
|
||||
// If the floor is far below you, fall hard instead of adjusting height
|
||||
|
@ -4965,9 +4965,9 @@ void DoPlayerBeginOperateVehicle(PLAYER* pp)
|
|||
|
||||
///DamageData[plActor->user.WeaponNum].Init(pp);
|
||||
|
||||
ASSERT(plActor->user.ActorActionSet->Stand);
|
||||
ASSERT(plActor->user.__legacyState.ActorActionSet->Stand);
|
||||
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Stand);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Stand);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -4990,9 +4990,9 @@ void DoPlayerBeginOperateTurret(PLAYER* pp)
|
|||
|
||||
///DamageData[plActor->user.WeaponNum].Init(pp);
|
||||
|
||||
ASSERT(plActor->user.ActorActionSet->Stand);
|
||||
ASSERT(plActor->user.__legacyState.ActorActionSet->Stand);
|
||||
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Stand);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Stand);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -5755,7 +5755,7 @@ void DoPlayerBeginDie(PLAYER* pp)
|
|||
pp->sop = nullptr;
|
||||
pp->Flags &= ~(PF_TWO_UZI);
|
||||
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Run);
|
||||
pWeaponForceRest(pp);
|
||||
|
||||
switch (pp->DeathType)
|
||||
|
@ -5977,7 +5977,7 @@ void DoPlayerDeathCheckKeys(PLAYER* pp)
|
|||
InitBloodSpray(plActor,true,-1);
|
||||
}
|
||||
|
||||
NewStateGroup(plActor, plActor->user.ActorActionSet->Stand);
|
||||
NewStateGroup(plActor, plActor->user.__legacyState.ActorActionSet->Stand);
|
||||
plActor->spr.picnum = plActor->user.State->Pic;
|
||||
plActor->spr.picnum = plActor->user.State->Pic;
|
||||
plActor->spr.cstat &= ~(CSTAT_SPRITE_YCENTER);
|
||||
|
@ -6417,12 +6417,12 @@ void DoPlayerBeginRun(PLAYER* pp)
|
|||
|
||||
///DamageData[plActor->user.WeaponNum].Init(pp);
|
||||
|
||||
ASSERT(plActor->user.ActorActionSet->Run);
|
||||
ASSERT(plActor->user.__legacyState.ActorActionSet->Run);
|
||||
|
||||
if (pp->Flags & (PF_PLAYER_MOVED))
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Run);
|
||||
else
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Stand);
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Stand);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -6545,17 +6545,17 @@ void DoPlayerRun(PLAYER* pp)
|
|||
// Move about
|
||||
DoPlayerMove(pp);
|
||||
|
||||
if (plActor->user.Rot != sg_PlayerNinjaSword && plActor->user.Rot != sg_PlayerNinjaPunch)
|
||||
if (plActor->user.__legacyState.Rot != sg_PlayerNinjaSword && plActor->user.__legacyState.Rot != sg_PlayerNinjaPunch)
|
||||
{
|
||||
if (pp->Flags & (PF_PLAYER_MOVED))
|
||||
{
|
||||
if (plActor->user.Rot != plActor->user.ActorActionSet->Run)
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Run);
|
||||
if (plActor->user.__legacyState.Rot != plActor->user.__legacyState.ActorActionSet->Run)
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Run);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (plActor->user.Rot != plActor->user.ActorActionSet->Stand)
|
||||
NewStateGroup(pp->actor, plActor->user.ActorActionSet->Stand);
|
||||
if (plActor->user.__legacyState.Rot != plActor->user.__legacyState.ActorActionSet->Stand)
|
||||
NewStateGroup(pp->actor, plActor->user.__legacyState.ActorActionSet->Stand);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6624,7 +6624,7 @@ void PlayerStateControl(DSWActor* actor)
|
|||
|
||||
// Set picnum to the correct pic
|
||||
if (actor->user.RotNum > 1)
|
||||
actor->spr.picnum = actor->user.Rot[0]->Pic;
|
||||
actor->spr.picnum = actor->user.__legacyState.Rot[0]->Pic;
|
||||
else
|
||||
actor->spr.picnum = actor->user.State->Pic;
|
||||
|
||||
|
|
|
@ -834,7 +834,7 @@ int SetupRipper(DSWActor* actor)
|
|||
actor->user.Attrib = &RipperAttrib;
|
||||
DoActorSetSpeed(actor, FAST_SPEED);
|
||||
actor->user.StateEnd = s_RipperDie;
|
||||
actor->user.Rot = sg_RipperRun;
|
||||
actor->user.__legacyState.Rot = sg_RipperRun;
|
||||
actor->spr.scale = DVector2(1, 1);
|
||||
|
||||
if (actor->spr.pal == PALETTE_BROWN_RIPPER)
|
||||
|
@ -1017,7 +1017,7 @@ int DoRipperMoveHang(DSWActor* actor)
|
|||
{
|
||||
if (actor->user.coll.type == kHitWall)
|
||||
{
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Special[1]);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Special[1]);
|
||||
actor->user.WaitTics = 2 + ((RANDOM_P2(4 << 8) >> 8) * 120);
|
||||
|
||||
// hang flush with the wall
|
||||
|
@ -1241,7 +1241,7 @@ void RipperHatch(DSWActor* actor)
|
|||
// make immediately active
|
||||
actorNew->user.Flags |= (SPR_ACTIVE);
|
||||
|
||||
NewStateGroup(actorNew, actorNew->user.ActorActionSet->Jump);
|
||||
NewStateGroup(actorNew, actorNew->user.__legacyState.ActorActionSet->Jump);
|
||||
actorNew->user.ActorActionFunc = DoActorMoveJump;
|
||||
DoActorSetSpeed(actorNew, FAST_SPEED);
|
||||
PickJumpMaxSpeed(actorNew, -600);
|
||||
|
|
|
@ -902,7 +902,7 @@ int SetupRipper2(DSWActor* actor)
|
|||
actor->user.Attrib = &Ripper2Attrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_Ripper2Die;
|
||||
actor->user.Rot = sg_Ripper2Run;
|
||||
actor->user.__legacyState.Rot = sg_Ripper2Run;
|
||||
actor->clipdist = 32; // This actor is bigger, needs bigger box.
|
||||
actor->spr.scale = DVector2(0.859375, 0.859375);
|
||||
|
||||
|
@ -1022,7 +1022,7 @@ int DoRipper2MoveHang(DSWActor* actor)
|
|||
if (abs(actor->spr.pos.Z - actor->user.targetActor->spr.pos.Z) > 250)
|
||||
return 0;
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Special[1]);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Special[1]);
|
||||
if (RANDOM_P2(1024<<8)>>8 > 500)
|
||||
actor->user.WaitTics = ((RANDOM_P2(2 << 8) >> 8) * 120);
|
||||
else
|
||||
|
@ -1251,7 +1251,7 @@ void Ripper2Hatch(DSWActor* actor)
|
|||
// make immediately active
|
||||
actorNew->user.Flags |= (SPR_ACTIVE);
|
||||
|
||||
NewStateGroup(actorNew, actorNew->user.ActorActionSet->Jump);
|
||||
NewStateGroup(actorNew, actorNew->user.__legacyState.ActorActionSet->Jump);
|
||||
actorNew->user.ActorActionFunc = DoActorMoveJump;
|
||||
DoActorSetSpeed(actorNew, FAST_SPEED);
|
||||
PickJumpMaxSpeed(actorNew, -600);
|
||||
|
|
|
@ -742,11 +742,11 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, USER& w, USER* def
|
|||
{
|
||||
arc("WallP", w.WallP, def->WallP)
|
||||
("State", w.State, def->State)
|
||||
("Rot", w.Rot, def->Rot)
|
||||
("Rot", w.__legacyState.Rot, def->__legacyState.Rot)
|
||||
("StateStart", w.StateStart, def->StateStart)
|
||||
("StateEnd", w.StateEnd, def->StateEnd)
|
||||
("StateFallOverride", w.StateFallOverride, def->StateFallOverride)
|
||||
("ActorActionSet", w.ActorActionSet, def->ActorActionSet)
|
||||
("ActorActionSet", w.__legacyState.ActorActionSet, def->__legacyState.ActorActionSet)
|
||||
("Personality", w.Personality, def->Personality)
|
||||
("Attrib", w.Attrib, def->Attrib)
|
||||
("sop_parent", w.sop_parent, def->sop_parent)
|
||||
|
|
|
@ -710,7 +710,7 @@ int SetupSerp(DSWActor* actor)
|
|||
actor->user.Attrib = &SerpAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_SerpDie;
|
||||
actor->user.Rot = sg_SerpRun;
|
||||
actor->user.__legacyState.Rot = sg_SerpRun;
|
||||
|
||||
EnemyDefaults(actor, &SerpActionSet, &SerpPersonality);
|
||||
|
||||
|
|
|
@ -520,7 +520,7 @@ int SetupSkel(DSWActor* actor)
|
|||
actor->user.Attrib = &SkelAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_SkelDie;
|
||||
actor->user.Rot = sg_SkelRun;
|
||||
actor->user.__legacyState.Rot = sg_SkelRun;
|
||||
|
||||
EnemyDefaults(actor, &SkelActionSet, &SkelPersonality);
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ int SetupSkull(DSWActor* actor)
|
|||
actor->user.Attrib = &SkullAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_SkullExplode;
|
||||
actor->user.Rot = sg_SkullWait;
|
||||
actor->user.__legacyState.Rot = sg_SkullWait;
|
||||
|
||||
actor->user.ID = SKULL_R0;
|
||||
|
||||
|
@ -646,7 +646,7 @@ int SetupBetty(DSWActor* actor)
|
|||
actor->user.Attrib = &BettyAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_BettyExplode;
|
||||
actor->user.Rot = sg_BettyWait;
|
||||
actor->user.__legacyState.Rot = sg_BettyWait;
|
||||
|
||||
actor->user.ID = BETTY_R0;
|
||||
|
||||
|
|
|
@ -4301,7 +4301,7 @@ int NewStateGroup(DSWActor* actor, STATE* StateGroup[])
|
|||
if (actor->user.State && (actor->user.State->Pic < 0 || actor->user.State->Pic > MAXTILES)) // JBF: verify this!
|
||||
return 0;
|
||||
|
||||
actor->user.Rot = StateGroup;
|
||||
actor->user.__legacyState.Rot = StateGroup;
|
||||
actor->user.State = actor->user.StateStart = StateGroup[0];
|
||||
|
||||
actor->user.Tics = 0;
|
||||
|
@ -6088,7 +6088,7 @@ int StateControl(DSWActor* actor)
|
|||
else
|
||||
{
|
||||
if (actor->user.RotNum > 1)
|
||||
actor->spr.picnum = actor->user.Rot[0]->Pic;
|
||||
actor->spr.picnum = actor->user.__legacyState.Rot[0]->Pic;
|
||||
else
|
||||
actor->spr.picnum = actor->user.State->Pic;
|
||||
}
|
||||
|
|
|
@ -620,7 +620,7 @@ int SetupSumo(DSWActor* actor)
|
|||
actor->user.Attrib = &SumoAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_SumoDie;
|
||||
actor->user.Rot = sg_SumoRun;
|
||||
actor->user.__legacyState.Rot = sg_SumoRun;
|
||||
|
||||
EnemyDefaults(actor, &SumoActionSet, &SumoPersonality);
|
||||
|
||||
|
@ -629,7 +629,7 @@ int SetupSumo(DSWActor* actor)
|
|||
{
|
||||
// Mini Sumo
|
||||
actor->spr.scale = DVector2(0.671875, 0.453125);
|
||||
actor->user.ActorActionSet = &MiniSumoActionSet;
|
||||
actor->user.__legacyState.ActorActionSet = &MiniSumoActionSet;
|
||||
actor->user.Health = 500;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -154,7 +154,7 @@ short ActorFindTrack(DSWActor* actor, int8_t player_dir, int track_type, int* tr
|
|||
{
|
||||
case BIT(TT_DUCK_N_SHOOT):
|
||||
{
|
||||
if (!actor->user.ActorActionSet->Duck)
|
||||
if (!actor->user.__legacyState.ActorActionSet->Duck)
|
||||
return -1;
|
||||
|
||||
end_point[1] = 0;
|
||||
|
@ -164,7 +164,7 @@ short ActorFindTrack(DSWActor* actor, int8_t player_dir, int track_type, int* tr
|
|||
// for ladders only look at first track point
|
||||
case BIT(TT_LADDER):
|
||||
{
|
||||
if (!actor->user.ActorActionSet->Climb)
|
||||
if (!actor->user.__legacyState.ActorActionSet->Climb)
|
||||
return -1;
|
||||
|
||||
end_point[1] = 0;
|
||||
|
@ -174,7 +174,7 @@ short ActorFindTrack(DSWActor* actor, int8_t player_dir, int track_type, int* tr
|
|||
case BIT(TT_JUMP_UP):
|
||||
case BIT(TT_JUMP_DOWN):
|
||||
{
|
||||
if (!actor->user.ActorActionSet->Jump)
|
||||
if (!actor->user.__legacyState.ActorActionSet->Jump)
|
||||
return -1;
|
||||
|
||||
end_point[1] = 0;
|
||||
|
@ -183,7 +183,7 @@ short ActorFindTrack(DSWActor* actor, int8_t player_dir, int track_type, int* tr
|
|||
|
||||
case BIT(TT_TRAVERSE):
|
||||
{
|
||||
if (!actor->user.ActorActionSet->Crawl || !actor->user.ActorActionSet->Jump)
|
||||
if (!actor->user.__legacyState.ActorActionSet->Crawl || !actor->user.__legacyState.ActorActionSet->Jump)
|
||||
return -1;
|
||||
|
||||
break;
|
||||
|
@ -2897,11 +2897,11 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
break;
|
||||
|
||||
case TRACK_ACTOR_STAND:
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Stand);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Stand);
|
||||
break;
|
||||
|
||||
case TRACK_ACTOR_JUMP:
|
||||
if (actor->user.ActorActionSet->Jump)
|
||||
if (actor->user.__legacyState.ActorActionSet->Jump)
|
||||
{
|
||||
actor->spr.Angles.Yaw = tpoint->angle;
|
||||
|
||||
|
@ -2918,7 +2918,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
|
||||
case TRACK_ACTOR_QUICK_JUMP:
|
||||
case TRACK_ACTOR_QUICK_SUPER_JUMP:
|
||||
if (actor->user.ActorActionSet->Jump)
|
||||
if (actor->user.__legacyState.ActorActionSet->Jump)
|
||||
{
|
||||
int zdiff;
|
||||
HitInfo hit{};
|
||||
|
@ -2966,7 +2966,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
|
||||
case TRACK_ACTOR_QUICK_JUMP_DOWN:
|
||||
|
||||
if (actor->user.ActorActionSet->Jump)
|
||||
if (actor->user.__legacyState.ActorActionSet->Jump)
|
||||
{
|
||||
actor->spr.Angles.Yaw = tpoint->angle;
|
||||
|
||||
|
@ -2990,7 +2990,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
|
||||
case TRACK_ACTOR_QUICK_SCAN:
|
||||
|
||||
if (actor->user.ActorActionSet->Jump)
|
||||
if (actor->user.__legacyState.ActorActionSet->Jump)
|
||||
{
|
||||
ActorLeaveTrack(actor);
|
||||
return false;
|
||||
|
@ -3000,7 +3000,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
|
||||
case TRACK_ACTOR_QUICK_DUCK:
|
||||
|
||||
if (actor->user.Rot != actor->user.ActorActionSet->Duck)
|
||||
if (actor->user.__legacyState.Rot != actor->user.__legacyState.ActorActionSet->Duck)
|
||||
{
|
||||
actor->spr.Angles.Yaw = tpoint->angle;
|
||||
|
||||
|
@ -3024,7 +3024,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
HitInfo near{};
|
||||
double z[2];
|
||||
|
||||
if (actor->user.Rot == actor->user.ActorActionSet->Sit || actor->user.Rot == actor->user.ActorActionSet->Stand)
|
||||
if (actor->user.__legacyState.Rot == actor->user.__legacyState.ActorActionSet->Sit || actor->user.__legacyState.Rot == actor->user.__legacyState.ActorActionSet->Stand)
|
||||
return false;
|
||||
|
||||
actor->spr.Angles.Yaw = tpoint->angle;
|
||||
|
@ -3045,7 +3045,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
else
|
||||
actor->user.WaitTics = tpoint->tag_high * 128;
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Stand);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Stand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3059,7 +3059,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
else
|
||||
actor->user.WaitTics = tpoint->tag_high * 128;
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Sit);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Sit);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3067,7 +3067,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
}
|
||||
|
||||
case TRACK_ACTOR_JUMP_IF_FORWARD:
|
||||
if (actor->user.ActorActionSet->Jump && actor->user.track_dir == 1)
|
||||
if (actor->user.__legacyState.ActorActionSet->Jump && actor->user.track_dir == 1)
|
||||
{
|
||||
if (!tpoint->tag_high)
|
||||
actor->user.jump_speed = ACTOR_STD_JUMP;
|
||||
|
@ -3080,7 +3080,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
break;
|
||||
|
||||
case TRACK_ACTOR_JUMP_IF_REVERSE:
|
||||
if (actor->user.ActorActionSet->Jump && actor->user.track_dir == -1)
|
||||
if (actor->user.__legacyState.ActorActionSet->Jump && actor->user.track_dir == -1)
|
||||
{
|
||||
if (!tpoint->tag_high)
|
||||
actor->user.jump_speed = ACTOR_STD_JUMP;
|
||||
|
@ -3093,92 +3093,92 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
break;
|
||||
|
||||
case TRACK_ACTOR_CRAWL:
|
||||
if (actor->user.Rot != actor->user.ActorActionSet->Crawl)
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Crawl);
|
||||
if (actor->user.__legacyState.Rot != actor->user.__legacyState.ActorActionSet->Crawl)
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Crawl);
|
||||
else
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Rise);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Rise);
|
||||
break;
|
||||
|
||||
case TRACK_ACTOR_SWIM:
|
||||
if (actor->user.Rot != actor->user.ActorActionSet->Swim)
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Swim);
|
||||
if (actor->user.__legacyState.Rot != actor->user.__legacyState.ActorActionSet->Swim)
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Swim);
|
||||
else
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Rise);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Rise);
|
||||
break;
|
||||
|
||||
case TRACK_ACTOR_FLY:
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Fly);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Fly);
|
||||
break;
|
||||
|
||||
case TRACK_ACTOR_SIT:
|
||||
|
||||
if (actor->user.ActorActionSet->Sit)
|
||||
if (actor->user.__legacyState.ActorActionSet->Sit)
|
||||
{
|
||||
if (!tpoint->tag_high)
|
||||
actor->user.WaitTics = 3 * 120;
|
||||
else
|
||||
actor->user.WaitTics = tpoint->tag_high * 128;
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Sit);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Sit);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TRACK_ACTOR_DEATH1:
|
||||
if (actor->user.ActorActionSet->Death2)
|
||||
if (actor->user.__legacyState.ActorActionSet->Death2)
|
||||
{
|
||||
actor->user.WaitTics = 4 * 120;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Death1);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Death1);
|
||||
}
|
||||
break;
|
||||
|
||||
case TRACK_ACTOR_DEATH2:
|
||||
|
||||
if (actor->user.ActorActionSet->Death2)
|
||||
if (actor->user.__legacyState.ActorActionSet->Death2)
|
||||
{
|
||||
actor->user.WaitTics = 4 * 120;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Death2);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Death2);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TRACK_ACTOR_DEATH_JUMP:
|
||||
|
||||
if (actor->user.ActorActionSet->DeathJump)
|
||||
if (actor->user.__legacyState.ActorActionSet->DeathJump)
|
||||
{
|
||||
actor->user.Flags |= (SPR_DEAD);
|
||||
actor->vel.X *= 2;
|
||||
actor->user.jump_speed = -495;
|
||||
DoActorBeginJump(actor);
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->DeathJump);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->DeathJump);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TRACK_ACTOR_CLOSE_ATTACK1:
|
||||
|
||||
if (actor->user.ActorActionSet->CloseAttack[0])
|
||||
if (actor->user.__legacyState.ActorActionSet->CloseAttack[0])
|
||||
{
|
||||
if (!tpoint->tag_high)
|
||||
actor->user.WaitTics = 2 * 120;
|
||||
else
|
||||
actor->user.WaitTics = tpoint->tag_high * 128;
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->CloseAttack[0]);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->CloseAttack[0]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TRACK_ACTOR_CLOSE_ATTACK2:
|
||||
|
||||
if (actor->user.ActorActionSet->CloseAttack[1])
|
||||
if (actor->user.__legacyState.ActorActionSet->CloseAttack[1])
|
||||
{
|
||||
if (!tpoint->tag_high)
|
||||
actor->user.WaitTics = 4 * 120;
|
||||
else
|
||||
actor->user.WaitTics = tpoint->tag_high * 128;
|
||||
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->CloseAttack[1]);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->CloseAttack[1]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -3190,7 +3190,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
case TRACK_ACTOR_ATTACK5:
|
||||
case TRACK_ACTOR_ATTACK6:
|
||||
{
|
||||
STATE* **ap = &actor->user.ActorActionSet->Attack[0] + (tpoint->tag_low - TRACK_ACTOR_ATTACK1);
|
||||
STATE* **ap = &actor->user.__legacyState.ActorActionSet->Attack[0] + (tpoint->tag_low - TRACK_ACTOR_ATTACK1);
|
||||
|
||||
|
||||
if (*ap)
|
||||
|
@ -3221,7 +3221,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
|
||||
case TRACK_ACTOR_CLIMB_LADDER:
|
||||
|
||||
if (actor->user.ActorActionSet->Jump)
|
||||
if (actor->user.__legacyState.ActorActionSet->Jump)
|
||||
{
|
||||
HitInfo near;
|
||||
|
||||
|
@ -3290,7 +3290,7 @@ bool ActorTrackDecide(TRACK_POINT* tpoint, DSWActor* actor)
|
|||
//
|
||||
|
||||
actor->user.Flags |= (SPR_CLIMBING);
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Climb);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Climb);
|
||||
|
||||
actor->vel.Z -= 1;
|
||||
}
|
||||
|
@ -3356,7 +3356,7 @@ int ActorFollowTrack(DSWActor* actor, short locktics)
|
|||
if (actor->user.WaitTics <= 0)
|
||||
{
|
||||
actor->user.Flags &= ~(SPR_DONT_UPDATE_ANG);
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Run);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Run);
|
||||
actor->user.WaitTics = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -3553,7 +3553,7 @@ AutoShrap:
|
|||
{
|
||||
extern STATE* sg_PlayerHeadHurl[];
|
||||
|
||||
if (parentActor->user.Rot == sg_PlayerHeadHurl)
|
||||
if (parentActor->user.__legacyState.Rot == sg_PlayerHeadHurl)
|
||||
{
|
||||
p = PlayerHeadHurl1;
|
||||
}
|
||||
|
@ -5105,7 +5105,7 @@ int ActorHealth(DSWActor* actor, short amt)
|
|||
actor->user.LastDamage = -amt;
|
||||
|
||||
// Do alternate Death2 if it exists
|
||||
if (actor->user.ActorActionSet && actor->user.ActorActionSet->Death2) // JBF: added null check
|
||||
if (actor->user.__legacyState.ActorActionSet && actor->user.__legacyState.ActorActionSet->Death2) // JBF: added null check
|
||||
{
|
||||
#define DEATH2_HEALTH_VALUE 15
|
||||
|
||||
|
@ -5233,11 +5233,11 @@ int ActorPain(DSWActor* actor)
|
|||
|
||||
if (!(actor->user.Flags & (SPR_JUMPING | SPR_FALLING)))
|
||||
{
|
||||
if (actor->user.ActorActionSet && actor->user.ActorActionSet->Pain)
|
||||
if (actor->user.__legacyState.ActorActionSet && actor->user.__legacyState.ActorActionSet->Pain)
|
||||
{
|
||||
ActorLeaveTrack(actor);
|
||||
actor->user.WaitTics = 60;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Pain);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Pain);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -5255,10 +5255,10 @@ int ActorPainPlasma(DSWActor* actor)
|
|||
{
|
||||
if (!(actor->user.Flags & (SPR_JUMPING | SPR_FALLING | SPR_ELECTRO_TOLERANT)))
|
||||
{
|
||||
if (actor->user.ActorActionSet && actor->user.ActorActionSet->Pain)
|
||||
if (actor->user.__legacyState.ActorActionSet && actor->user.__legacyState.ActorActionSet->Pain)
|
||||
{
|
||||
actor->user.WaitTics = PLASMA_FOUNTAIN_TIME;
|
||||
NewStateGroup(actor, actor->user.ActorActionSet->Pain);
|
||||
NewStateGroup(actor, actor->user.__legacyState.ActorActionSet->Pain);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
@ -11908,7 +11908,7 @@ int InitSerpRing(DSWActor* actor)
|
|||
actorNew->user.Counter2 = 0;
|
||||
|
||||
actorNew->user.StateEnd = s_SkullExplode;
|
||||
actorNew->user.Rot = sg_SkullRing;
|
||||
actorNew->user.__legacyState.Rot = sg_SkullRing;
|
||||
|
||||
// defaults do change the statnum
|
||||
EnemyDefaults(actorNew, nullptr, nullptr);
|
||||
|
@ -12625,7 +12625,7 @@ int InitSumoSkull(DSWActor* actor)
|
|||
actorNew->user.Flags |= (actor->user.Flags & (SPR_BOUNCE));
|
||||
|
||||
actorNew->user.StateEnd = s_SkullExplode;
|
||||
actorNew->user.Rot = sg_SkullWait;
|
||||
actorNew->user.__legacyState.Rot = sg_SkullWait;
|
||||
|
||||
actorNew->user.Attrib = &SkullAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
|
|
|
@ -626,7 +626,7 @@ int SetupZilla(DSWActor* actor)
|
|||
actor->user.Attrib = &ZillaAttrib;
|
||||
DoActorSetSpeed(actor, NORM_SPEED);
|
||||
actor->user.StateEnd = s_ZillaDie;
|
||||
actor->user.Rot = sg_ZillaRun;
|
||||
actor->user.__legacyState.Rot = sg_ZillaRun;
|
||||
|
||||
EnemyDefaults(actor, &ZillaActionSet, &ZillaPersonality);
|
||||
|
||||
|
|
|
@ -759,7 +759,7 @@ int SetupZombie(DSWActor* actor)
|
|||
|
||||
actor->user.Health = 100;
|
||||
actor->user.StateEnd = &s_ZombiePain[0][0];
|
||||
actor->user.Rot = sg_ZombieRun;
|
||||
actor->user.__legacyState.Rot = sg_ZombieRun;
|
||||
actor->spr.scale = DVector2(PLAYER_NINJA_XREPEAT, PLAYER_NINJA_YREPEAT);
|
||||
|
||||
actor->user.Attrib = &ZombieAttrib;
|
||||
|
|
Loading…
Reference in a new issue