mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-23 04:22:16 +00:00
add a getDudeInfo variant that only takes an actor pointer as parameter
This commit is contained in:
parent
658646323c
commit
9b22d9a811
26 changed files with 143 additions and 138 deletions
|
@ -2554,7 +2554,7 @@ static void ConcussSprite(DBloodActor* source, DBloodActor* actor, const DVector
|
|||
double mass = 0;
|
||||
if (actor->IsDudeActor())
|
||||
{
|
||||
mass = getDudeInfo(actor->spr.type)->mass;
|
||||
mass = getDudeInfo(actor)->mass;
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
if (actor->GetType() == kDudeModernCustom || actor->GetType() == kDudeModernCustomBurning)
|
||||
{
|
||||
|
@ -3569,7 +3569,7 @@ void actKillDude(DBloodActor* killerActor, DBloodActor* actor, DAMAGE_TYPE damag
|
|||
|
||||
if (damageType == kDamageExplode)
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
for (int i = 0; i < 3; i++)
|
||||
if (pDudeInfo->nGibType[i] > -1)
|
||||
GibSprite(actor, (GIBTYPE)pDudeInfo->nGibType[i], nullptr, nullptr);
|
||||
|
@ -4154,7 +4154,7 @@ static void checkCeilHit(DBloodActor* actor)
|
|||
if ((actor->IsPlayerActor() && isShrinked(actor)) || (actor2->IsPlayerActor() && isGrown(actor2))) {
|
||||
|
||||
int mass1 = getDudeInfo(actor2->spr.type)->mass;
|
||||
int mass2 = getDudeInfo(actor->spr.type)->mass;
|
||||
int mass2 = getDudeInfo(actor)->mass;
|
||||
switch (actor->spr.type)
|
||||
{
|
||||
case kDudeModernCustom:
|
||||
|
@ -4241,7 +4241,7 @@ static void checkHit(DBloodActor* actor)
|
|||
{
|
||||
if (actor->vel.X != 0 && actor2->IsDudeActor())
|
||||
{
|
||||
int mass1 = getDudeInfo(actor->spr.type)->mass;
|
||||
int mass1 = getDudeInfo(actor)->mass;
|
||||
int mass2 = getDudeInfo(actor2->spr.type)->mass;
|
||||
switch (actor2->spr.type)
|
||||
{
|
||||
|
@ -4313,7 +4313,7 @@ static void checkFloorHit(DBloodActor* actor)
|
|||
if ((actor2->IsPlayerActor() && isShrinked(actor2)) || (actor->IsPlayerActor() && isGrown(actor)))
|
||||
{
|
||||
|
||||
int mass1 = getDudeInfo(actor->spr.type)->mass;
|
||||
int mass1 = getDudeInfo(actor)->mass;
|
||||
int mass2 = getDudeInfo(actor2->spr.type)->mass;
|
||||
switch (actor2->spr.type)
|
||||
{
|
||||
|
@ -4699,7 +4699,7 @@ void MoveDude(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
double top, bottom;
|
||||
GetActorExtents(actor, &top, &bottom);
|
||||
double bz = (bottom - actor->spr.pos.Z) / 4;
|
||||
|
@ -6715,7 +6715,7 @@ void actFireVector(DBloodActor* shooter, double offset, double zoffset, DVector3
|
|||
}
|
||||
if (actor->spr.statnum == kStatDude && actor->hasX())
|
||||
{
|
||||
int mass = getDudeInfo(actor->spr.type)->mass;
|
||||
int mass = getDudeInfo(actor)->mass;
|
||||
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
if (actor->IsDudeActor())
|
||||
|
|
|
@ -47,7 +47,7 @@ bool dudeIsPlayingSeq(DBloodActor* actor, int nSeq)
|
|||
{
|
||||
if (actor->spr.statnum == kStatDude && actor->IsDudeActor())
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (seqGetID(actor) == pDudeInfo->seqStartID + nSeq && seqGetStatus(actor) >= 0)
|
||||
return true;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ void aiPlay3DSound(DBloodActor* actor, int soundid, AI_SFX_PRIORITY a3, int play
|
|||
|
||||
void aiNewState(DBloodActor* actor, AISTATE* pAIState)
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
actor->xspr.stateTimer = pAIState->stateTicks;
|
||||
actor->xspr.aiState = pAIState;
|
||||
int seqStartId = pDudeInfo->seqStartID;
|
||||
|
@ -294,7 +294,7 @@ void aiChooseDirection(DBloodActor* actor, DAngle direction)
|
|||
void aiMoveForward(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -312,7 +312,7 @@ void aiMoveForward(DBloodActor* actor)
|
|||
void aiMoveTurn(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -327,7 +327,7 @@ void aiMoveTurn(DBloodActor* actor)
|
|||
void aiMoveDodge(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -939,7 +939,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
|
|||
return 0;
|
||||
actor->xspr.health = ClipLow(actor->xspr.health - nDamage, 0);
|
||||
actor->cumulDamage += nDamage;
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
|
||||
if (source)
|
||||
{
|
||||
|
@ -979,7 +979,7 @@ int aiDamageSprite(DBloodActor* source, DBloodActor* actor, DAMAGE_TYPE nDmgType
|
|||
nDamage += aiDamageSprite(actor, source, nDmgType, nDamage * (10 - gGameOptions.nDifficulty));
|
||||
if (actor->xspr.health > 0)
|
||||
{
|
||||
int fullHp = (actor->xspr.sysData2 > 0) ? ClipRange(actor->xspr.sysData2 << 4, 1, 65535) : getDudeInfo(actor->spr.type)->startHealth << 4;
|
||||
int fullHp = (actor->xspr.sysData2 > 0) ? ClipRange(actor->xspr.sysData2 << 4, 1, 65535) : getDudeInfo(actor)->startHealth << 4;
|
||||
if (((100 * actor->xspr.health) / fullHp) <= 75)
|
||||
{
|
||||
actor->cumulDamage += nDamage << 4; // to be sure any enemy will play the recoil animation
|
||||
|
@ -1228,7 +1228,7 @@ void RecoilDude(DBloodActor* actor)
|
|||
DUDEEXTRA* pDudeExtra = &actor->dudeExtra;
|
||||
if (actor->spr.statnum == kStatDude && (actor->IsDudeActor()))
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
switch (actor->spr.type)
|
||||
{
|
||||
#ifdef NOONE_EXTENSIONS
|
||||
|
@ -1486,7 +1486,7 @@ void RecoilDude(DBloodActor* actor)
|
|||
void aiThinkTarget(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (Chance(pDudeInfo->alertChance))
|
||||
{
|
||||
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
||||
|
@ -1531,7 +1531,7 @@ void aiThinkTarget(DBloodActor* actor)
|
|||
void aiLookForTarget(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (Chance(pDudeInfo->alertChance))
|
||||
{
|
||||
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
||||
|
@ -1598,7 +1598,7 @@ void aiProcessDudes(void)
|
|||
while (auto actor = it.Next())
|
||||
{
|
||||
if (actor->spr.flags & 32) continue;
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (actor->IsPlayerActor() || actor->xspr.health == 0) continue;
|
||||
|
||||
actor->xspr.stateTimer = ClipLow(actor->xspr.stateTimer - 4, 0);
|
||||
|
|
|
@ -67,7 +67,7 @@ void batBiteSeqCallback(int, DBloodActor* actor)
|
|||
auto pTarget = actor->GetTarget();
|
||||
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEINFO* pDudeInfoT = getDudeInfo(pTarget->spr.type);
|
||||
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
|
@ -78,7 +78,7 @@ void batBiteSeqCallback(int, DBloodActor* actor)
|
|||
static void batThinkTarget(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
|
||||
if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10)
|
||||
pDudeExtraE->thinkTime++;
|
||||
|
@ -134,7 +134,7 @@ static void batThinkSearch(DBloodActor* actor)
|
|||
static void batThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.X;
|
||||
auto nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -152,7 +152,7 @@ static void batThinkPonder(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto pTarget = actor->GetTarget();
|
||||
auto dvec = pTarget->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
@ -199,7 +199,7 @@ static void batThinkPonder(DBloodActor* actor)
|
|||
static void batMoveDodgeUp(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -216,7 +216,7 @@ static void batMoveDodgeUp(DBloodActor* actor)
|
|||
static void batMoveDodgeDown(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -240,7 +240,7 @@ static void batThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto pTarget = actor->GetTarget();
|
||||
auto dvec = pTarget->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
@ -297,7 +297,7 @@ static void batThinkChase(DBloodActor* actor)
|
|||
static void batMoveForward(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -322,7 +322,7 @@ static void batMoveForward(DBloodActor* actor)
|
|||
static void batMoveSwoop(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -346,7 +346,7 @@ static void batMoveSwoop(DBloodActor* actor)
|
|||
static void batMoveFly(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
|
|
@ -171,7 +171,7 @@ static void beastThinkSearch(DBloodActor* actor)
|
|||
static void beastThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto pSector = actor->sector();
|
||||
auto pXSector = pSector->hasX() ? &pSector->xs() : nullptr;
|
||||
|
||||
|
@ -203,7 +203,7 @@ static void beastThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
@ -323,7 +323,7 @@ static void beastThinkChase(DBloodActor* actor)
|
|||
static void beastThinkSwimGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
auto nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -341,7 +341,7 @@ static void beastThinkSwimChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
@ -390,7 +390,7 @@ static void beastThinkSwimChase(DBloodActor* actor)
|
|||
static void beastMoveForward(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -406,7 +406,7 @@ static void beastMoveForward(DBloodActor* actor)
|
|||
static void sub_628A0(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -430,7 +430,7 @@ static void sub_628A0(DBloodActor* actor)
|
|||
static void sub_62AE0(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
@ -460,7 +460,7 @@ static void sub_62AE0(DBloodActor* actor)
|
|||
static void sub_62D7C(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ void eelBiteSeqCallback(int, DBloodActor* actor)
|
|||
|
||||
auto target = actor->GetTarget();
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
double height2 = (pDudeInfoT->eyeHeight * target->spr.scale.Y);
|
||||
|
@ -90,7 +90,7 @@ void eelBiteSeqCallback(int, DBloodActor* actor)
|
|||
static void eelThinkTarget(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
|
||||
if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10)
|
||||
pDudeExtraE->thinkTime++;
|
||||
|
@ -147,7 +147,7 @@ static void eelThinkSearch(DBloodActor* actor)
|
|||
static void eelThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
auto nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -165,7 +165,7 @@ static void eelThinkPonder(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
@ -214,7 +214,7 @@ static void eelThinkPonder(DBloodActor* actor)
|
|||
static void eelMoveDodgeUp(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -231,7 +231,7 @@ static void eelMoveDodgeUp(DBloodActor* actor)
|
|||
static void eelMoveDodgeDown(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -255,7 +255,7 @@ static void eelThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
@ -307,7 +307,7 @@ static void eelThinkChase(DBloodActor* actor)
|
|||
static void eelMoveForward(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -332,7 +332,7 @@ static void eelMoveForward(DBloodActor* actor)
|
|||
static void eelMoveSwoop(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -353,7 +353,7 @@ static void eelMoveSwoop(DBloodActor* actor)
|
|||
static void eelMoveAscend(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
|
|
@ -83,7 +83,7 @@ static void burnThinkSearch(DBloodActor* actor)
|
|||
static void burnThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -153,7 +153,7 @@ static void burnThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
|
|
@ -88,7 +88,7 @@ static void calebThinkSearch(DBloodActor* actor)
|
|||
static void calebThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
|
||||
auto pSector = actor->sector();
|
||||
auto pXSector = pSector->hasX() ? &pSector->xs() : nullptr;
|
||||
|
@ -121,7 +121,7 @@ static void calebThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
@ -211,7 +211,7 @@ static void calebThinkChase(DBloodActor* actor)
|
|||
static void calebThinkSwimGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -229,7 +229,7 @@ static void calebThinkSwimChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
@ -275,7 +275,7 @@ static void calebThinkSwimChase(DBloodActor* actor)
|
|||
static void sub_65D04(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -300,7 +300,7 @@ static void sub_65D04(DBloodActor* actor)
|
|||
static void sub_65F44(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
|
||||
auto target = actor->GetTarget();
|
||||
|
@ -328,7 +328,7 @@ static void sub_65F44(DBloodActor* actor)
|
|||
static void sub_661E0(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
|
||||
auto target = actor->GetTarget();
|
||||
|
|
|
@ -77,7 +77,7 @@ void cerberusBiteSeqCallback(int, DBloodActor* actor)
|
|||
|
||||
void cerberusBurnSeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
double height = pDudeInfo->eyeHeight * actor->spr.scale.Y * 0.25;
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
|
||||
|
@ -139,7 +139,7 @@ void cerberusBurnSeqCallback(int, DBloodActor* actor)
|
|||
void cerberusBurnSeqCallback2(int, DBloodActor* actor)
|
||||
{
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
double height = pDudeInfo->eyeHeight * actor->spr.scale.Y * 0.25;
|
||||
|
||||
DVector3 pos(actor->spr.pos.XY(), height);
|
||||
|
@ -219,7 +219,7 @@ static void cerberusThinkTarget(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
|
||||
if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10)
|
||||
pDudeExtraE->thinkTime++;
|
||||
|
@ -275,7 +275,7 @@ static void cerberusThinkGoto(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -314,7 +314,7 @@ static void cerberusThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
|
|
@ -183,7 +183,7 @@ static void cultThinkSearch(DBloodActor* actor)
|
|||
static void cultThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -221,7 +221,7 @@ static void cultThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto dvec = target->spr.pos - actor->spr.pos;
|
||||
|
|
|
@ -79,7 +79,7 @@ void SlashFSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
double height2 = (pDudeInfoT->eyeHeight * target->spr.scale.Y);
|
||||
|
@ -104,7 +104,7 @@ void BlastSSeqCallback(int, DBloodActor* actor)
|
|||
wrand(); // ???
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
double height = (actor->spr.scale.Y * getDudeInfo(actor->spr.type)->eyeHeight);
|
||||
double height = (actor->spr.scale.Y * getDudeInfo(actor)->eyeHeight);
|
||||
DVector3 pos(actor->spr.pos.XY(), height);
|
||||
|
||||
DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
|
@ -178,7 +178,7 @@ static void gargThinkTarget(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
|
||||
if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10)
|
||||
pDudeExtraE->thinkTime++;
|
||||
|
@ -237,7 +237,7 @@ static void gargThinkGoto(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -253,7 +253,7 @@ static void gargMoveDodgeUp(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -273,7 +273,7 @@ static void gargMoveDodgeDown(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -301,7 +301,7 @@ static void gargThinkChase(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
DVector2 dxy = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
@ -488,7 +488,7 @@ static void gargMoveForward(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -516,7 +516,7 @@ static void gargMoveSlow(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -551,7 +551,7 @@ static void gargMoveSwoop(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -586,7 +586,7 @@ static void gargMoveFly(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
|
|
@ -64,7 +64,7 @@ void ghostSlashSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
double height2 = (pDudeInfoT->eyeHeight * target->spr.scale.Y);
|
||||
|
@ -91,7 +91,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
|
|||
wrand(); // ???
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
double height = (actor->spr.scale.Y * getDudeInfo(actor->spr.type)->eyeHeight);
|
||||
double height = (actor->spr.scale.Y * getDudeInfo(actor)->eyeHeight);
|
||||
DVector3 pos(actor->spr.pos.XY(), height);
|
||||
|
||||
DVector3 Aim(actor->spr.Angles.Yaw.ToVector(), actor->dudeSlope);
|
||||
|
@ -159,7 +159,7 @@ static void ghostThinkTarget(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
|
||||
if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10)
|
||||
pDudeExtraE->thinkTime++;
|
||||
|
@ -217,7 +217,7 @@ static void ghostThinkGoto(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -233,7 +233,7 @@ static void ghostMoveDodgeUp(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -253,7 +253,7 @@ static void ghostMoveDodgeDown(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -280,7 +280,7 @@ static void ghostThinkChase(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
DVector2 dxy = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
@ -384,7 +384,7 @@ static void ghostMoveForward(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -411,7 +411,7 @@ static void ghostMoveSlow(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -442,7 +442,7 @@ static void ghostMoveSwoop(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -472,7 +472,7 @@ static void ghostMoveFly(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
|
|
@ -78,7 +78,7 @@ static void gillThinkSearch(DBloodActor* actor)
|
|||
static void gillThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
|
||||
auto pSector = actor->sector();
|
||||
auto pXSector = pSector->hasX() ? &pSector->xs() : nullptr;
|
||||
|
@ -111,7 +111,7 @@ static void gillThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
auto dv = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
@ -195,7 +195,7 @@ static void gillThinkChase(DBloodActor* actor)
|
|||
static void gillThinkSwimGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -213,7 +213,7 @@ static void gillThinkSwimChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
@ -263,7 +263,7 @@ static void gillThinkSwimChase(DBloodActor* actor)
|
|||
static void sub_6CB00(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
auto nTurnRange = pDudeInfo->TurnRange();
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
@ -288,7 +288,7 @@ static void sub_6CB00(DBloodActor* actor)
|
|||
static void sub_6CD74(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
@ -315,7 +315,7 @@ static void sub_6CD74(DBloodActor* actor)
|
|||
static void sub_6D03C(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ static void handThinkSearch(DBloodActor* actor)
|
|||
static void handThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -83,7 +83,7 @@ static void handThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ static void houndThinkGoto(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -95,7 +95,7 @@ static void houndThinkChase(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
|
|
@ -49,7 +49,7 @@ static void innocThinkSearch(DBloodActor* actor)
|
|||
static void innocThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -67,7 +67,7 @@ static void innocThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ void podAttack(int, DBloodActor* actor)
|
|||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dv = target->spr.pos - actor->spr.pos;
|
||||
dv.X += Random2F(1000, 4);
|
||||
dv.Y += Random2F(1000, 4);
|
||||
|
@ -135,7 +135,7 @@ static void aiPodMove(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -175,7 +175,7 @@ static void aiPodChase(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
|
|
@ -62,7 +62,7 @@ static void ratThinkSearch(DBloodActor* actor)
|
|||
static void ratThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -80,7 +80,7 @@ static void ratThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
|
|
@ -132,7 +132,7 @@ void SpidJumpSeqCallback(int, DBloodActor* actor)
|
|||
void SpidBirthSeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
|
||||
|
@ -170,7 +170,7 @@ static void spidThinkSearch(DBloodActor* actor)
|
|||
static void spidThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -188,7 +188,7 @@ static void spidThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
auto dvec = target->spr.pos.XY() - actor->spr.pos.XY();
|
||||
|
|
|
@ -60,7 +60,7 @@ void sub_71A90(int, DBloodActor* actor)
|
|||
|
||||
void tchernobogBurnSeqCallback(int, DBloodActor* actor)
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
double height = actor->spr.scale.Y * pDudeInfo->eyeHeight * 0.25;
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
DVector3 pos(actor->spr.pos.XY(), height);
|
||||
|
@ -119,7 +119,7 @@ void tchernobogBurnSeqCallback2(int, DBloodActor* actor)
|
|||
{
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
double height = actor->spr.scale.Y * pDudeInfo->eyeHeight * 0.25;
|
||||
|
||||
DVector3 pos(actor->spr.pos.XY(), height);
|
||||
|
@ -183,7 +183,7 @@ static void sub_725A4(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEEXTRA_STATS* pDudeExtraE = &actor->dudeExtra.stats;
|
||||
if (pDudeExtraE->active && pDudeExtraE->thinkTime < 10)
|
||||
pDudeExtraE->thinkTime++;
|
||||
|
@ -238,7 +238,7 @@ static void sub_72850(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -259,7 +259,7 @@ static void tchernobogThinkChase(DBloodActor* actor)
|
|||
Printf(PRINT_HIGH, "actor->IsDudeActor()");
|
||||
return;
|
||||
}
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ void punchCallback(int, DBloodActor* actor)
|
|||
auto const target = actor->GetTarget();
|
||||
if (target != nullptr)
|
||||
{
|
||||
double nZOffset1 = getDudeInfo(actor->spr.type)->eyeHeight * actor->spr.scale.Y;
|
||||
double nZOffset1 = getDudeInfo(actor)->eyeHeight * actor->spr.scale.Y;
|
||||
double nZOffset2 = 0;
|
||||
|
||||
|
||||
|
@ -421,7 +421,7 @@ static void unicultThinkGoto(DBloodActor* actor)
|
|||
aiChooseDirection(actor, nAngle);
|
||||
|
||||
// if reached target, change to search mode
|
||||
if (nDist < 320 && absangle(actor->spr.Angles.Yaw, nAngle) < getDudeInfo(actor->spr.type)->Periphery())
|
||||
if (nDist < 320 && absangle(actor->spr.Angles.Yaw, nAngle) < getDudeInfo(actor)->Periphery())
|
||||
{
|
||||
if (spriteIsUnderwater(actor, false)) aiGenDudeNewState(actor, &genDudeSearchW);
|
||||
else aiGenDudeNewState(actor, &genDudeSearchL);
|
||||
|
@ -508,7 +508,7 @@ static void unicultThinkChase(DBloodActor* actor)
|
|||
}
|
||||
}
|
||||
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DAngle losAngle = absangle(actor->spr.Angles.Yaw, nAngle);
|
||||
double height = (pDudeInfo->eyeHeight * actor->spr.scale.Y);
|
||||
|
||||
|
@ -1071,7 +1071,7 @@ int checkAttackState(DBloodActor* actor)
|
|||
|
||||
static int getGenDudeMoveSpeed(DBloodActor* actor, int which, bool mul, bool shift)
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
int speed = -1; int step = 2500; int maxSpeed = 146603;
|
||||
switch (which)
|
||||
{
|
||||
|
@ -1111,7 +1111,7 @@ static int getGenDudeMoveSpeed(DBloodActor* actor, int which, bool mul, bool shi
|
|||
|
||||
void aiGenDudeMoveForward(DBloodActor* actor)
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
GENDUDEEXTRA* pExtra = &actor->genDudeExtra;
|
||||
|
||||
if (pExtra->canFly)
|
||||
|
@ -2304,7 +2304,7 @@ bool genDudePrepare(DBloodActor* actor, int propId)
|
|||
|
||||
// check the animation
|
||||
int seqStartId = -1;
|
||||
if (actor->xspr.data2 <= 0) seqStartId = actor->xspr.data2 = getDudeInfo(actor->spr.type)->seqStartID;
|
||||
if (actor->xspr.data2 <= 0) seqStartId = actor->xspr.data2 = getDudeInfo(actor)->seqStartID;
|
||||
else seqStartId = actor->xspr.data2;
|
||||
|
||||
for (int i = seqStartId; i < seqStartId + kGenDudeSeqMax; i++) {
|
||||
|
@ -2318,7 +2318,7 @@ bool genDudePrepare(DBloodActor* actor, int propId)
|
|||
Seq* pSeq = getSequence(i);
|
||||
if (!pSeq)
|
||||
{
|
||||
actor->xspr.data2 = getDudeInfo(actor->spr.type)->seqStartID;
|
||||
actor->xspr.data2 = getDudeInfo(actor)->seqStartID;
|
||||
viewSetSystemMessage("No SEQ animation id %d found for custom dude #%d!", i, actor->GetIndex());
|
||||
viewSetSystemMessage("SEQ base id: %d", seqStartId);
|
||||
}
|
||||
|
@ -2475,7 +2475,7 @@ void genDudePostDeath(DBloodActor* actor, DAMAGE_TYPE damageType, int damage)
|
|||
{
|
||||
if (damageType == kDamageExplode)
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
for (int i = 0; i < 3; i++)
|
||||
if (pDudeInfo->nGibType[i] > -1)
|
||||
GibSprite(actor, (GIBTYPE)pDudeInfo->nGibType[i], NULL, NULL);
|
||||
|
|
|
@ -62,7 +62,7 @@ void HackSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
auto target = actor->GetTarget();
|
||||
if (!target) return;
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
|
||||
DVector3 dv;
|
||||
dv.XY() = (actor->xspr.TargetPos.XY() - actor->spr.pos.XY()).Resized(64);
|
||||
|
@ -89,7 +89,7 @@ static void zombaThinkSearch(DBloodActor* actor)
|
|||
static void zombaThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -107,7 +107,7 @@ static void zombaThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
@ -159,7 +159,7 @@ static void zombaThinkPonder(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
@ -206,7 +206,7 @@ static void zombaThinkPonder(DBloodActor* actor)
|
|||
static void myThinkTarget(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
for (int p = connecthead; p >= 0; p = connectpoint2[p])
|
||||
{
|
||||
PLAYER* pPlayer = &gPlayer[p];
|
||||
|
|
|
@ -51,7 +51,7 @@ void zombfHackSeqCallback(int, DBloodActor* actor)
|
|||
return;
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
double height = pDudeInfo->eyeHeight * actor->spr.scale.Y * 0.25;
|
||||
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
|
||||
double height2 = pDudeInfoT->eyeHeight * target->spr.scale.Y * 0.25;
|
||||
|
@ -62,7 +62,7 @@ void PukeSeqCallback(int, DBloodActor* actor)
|
|||
{
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
DUDEINFO* pDudeInfoT = getDudeInfo(target->spr.type);
|
||||
|
||||
DVector2 dv = (actor->xspr.TargetPos.XY() - actor->spr.pos.XY()).Resized(64);
|
||||
|
@ -89,7 +89,7 @@ static void zombfThinkSearch(DBloodActor* actor)
|
|||
static void zombfThinkGoto(DBloodActor* actor)
|
||||
{
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
auto dvec = actor->xspr.TargetPos.XY() - actor->spr.pos.XY();
|
||||
DAngle nAngle = dvec.Angle();
|
||||
double nDist = dvec.Length();
|
||||
|
@ -107,7 +107,7 @@ static void zombfThinkChase(DBloodActor* actor)
|
|||
return;
|
||||
}
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (!actor->ValidateTarget(__FUNCTION__)) return;
|
||||
auto target = actor->GetTarget();
|
||||
|
||||
|
|
|
@ -99,4 +99,9 @@ inline DUDEINFO* getDudeInfo(int const nType)
|
|||
return &fakeDudeInfo;
|
||||
}
|
||||
|
||||
inline DUDEINFO* getDudeInfo(DBloodActor* actor)
|
||||
{
|
||||
return getDudeInfo(actor->GetType());
|
||||
}
|
||||
|
||||
END_BLD_NS
|
||||
|
|
|
@ -340,7 +340,7 @@ bool nnExtIsImmune(DBloodActor* actor, int dmgType, int minScale)
|
|||
{
|
||||
if (actor->IsPlayerActor()) return (gPlayer[actor->spr.type - kDudePlayer1].damageControl[dmgType]);
|
||||
else if (actor->GetType() == kDudeModernCustom) return (actor->genDudeExtra.dmgControl[dmgType] <= minScale);
|
||||
else return (getDudeInfo(actor->spr.type)->damageVal[dmgType] <= minScale);
|
||||
else return (getDudeInfo(actor)->damageVal[dmgType] <= minScale);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1406,7 +1406,7 @@ int getSpriteMassBySize(DBloodActor* actor)
|
|||
clipDist = actor->genDudeExtra.clipdist;
|
||||
break;
|
||||
default:
|
||||
seqId = getDudeInfo(actor->spr.type)->seqStartID;
|
||||
seqId = getDudeInfo(actor)->seqStartID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3571,7 +3571,7 @@ void damageSprites(DBloodActor* sourceactor, DBloodActor* actor)
|
|||
{
|
||||
if (sourceactor->spr.flags & kModernTypeFlag1) dmg = ClipHigh(sourceactor->xspr.data3 << 1, 65535);
|
||||
else if (actor->xspr.sysData2 > 0) dmg = (ClipHigh(actor->xspr.sysData2 << 4, 65535) * sourceactor->xspr.data3) / kPercFull;
|
||||
else dmg = ((getDudeInfo(actor->spr.type)->startHealth << 4) * sourceactor->xspr.data3) / kPercFull;
|
||||
else dmg = ((getDudeInfo(actor)->startHealth << 4) * sourceactor->xspr.data3) / kPercFull;
|
||||
|
||||
health = actor->xspr.health - dmg;
|
||||
}
|
||||
|
@ -5041,7 +5041,7 @@ void modernTypeTrigger(int destObjType, sectortype* destSect, walltype* destWall
|
|||
|
||||
DBloodActor* aiFightGetTargetInRange(DBloodActor* actor, int minDist, int maxDist, int data, int teamMode)
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
|
||||
BloodStatIterator it(kStatDude);
|
||||
while (auto targactor = it.Next())
|
||||
|
@ -5284,7 +5284,7 @@ bool aiFightGetDudesForBattle(DBloodActor* actor)
|
|||
|
||||
void aiFightAlarmDudesInSight(DBloodActor* actor, int max)
|
||||
{
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
|
||||
BloodStatIterator it(kStatDude);
|
||||
while (auto dudeactor = it.Next())
|
||||
|
@ -6939,7 +6939,7 @@ void useTargetChanger(DBloodActor* sourceactor, DBloodActor* actor)
|
|||
|
||||
|
||||
int receiveHp = 33 + Random(33);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
int matesPerEnemy = 1;
|
||||
|
||||
// dude is burning?
|
||||
|
@ -8107,7 +8107,7 @@ void aiPatrolRandGoalAng(DBloodActor* actor)
|
|||
|
||||
void aiPatrolTurn(DBloodActor* actor)
|
||||
{
|
||||
DAngle nTurnRange = mapangle((getDudeInfo(actor->spr.type)->angSpeed << 1) >> 4);
|
||||
DAngle nTurnRange = mapangle((getDudeInfo(actor)->angSpeed << 1) >> 4);
|
||||
DAngle nAng = deltaangle(actor->spr.Angles.Yaw, actor->xspr.goalAng);
|
||||
actor->spr.Angles.Yaw += clamp(nAng, -nTurnRange, nTurnRange);
|
||||
|
||||
|
@ -8264,7 +8264,7 @@ void aiPatrolAlarmFull(DBloodActor* actor, DBloodActor* targetactor, bool chain)
|
|||
if (actor->xspr.health <= 0)
|
||||
return;
|
||||
|
||||
double eaz2 = (getDudeInfo(actor->spr.type)->eyeHeight * actor->spr.scale.Y);
|
||||
double eaz2 = (getDudeInfo(actor)->eyeHeight * actor->spr.scale.Y);
|
||||
auto pos2 = actor->spr.pos.plusZ(-eaz2);
|
||||
|
||||
auto pSect2 = actor->sector();
|
||||
|
@ -8381,7 +8381,7 @@ DBloodActor* aiPatrolSearchTargets(DBloodActor* actor)
|
|||
PATROL_FOUND_SOUNDS patrolBonkles[kMaxPatrolFoundSounds];
|
||||
|
||||
assert(actor->IsDudeActor());
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type); PLAYER* pPlayer = NULL;
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor); PLAYER* pPlayer = NULL;
|
||||
|
||||
for (int i = 0; i < kMaxPatrolFoundSounds; i++)
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ void tilePrecacheTile(FTextureID nTex, int nType, int palette)
|
|||
void PrecacheDude(DBloodActor* actor)
|
||||
{
|
||||
int palette = actor->spr.pal;
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
seqPrecacheId(pDudeInfo->seqStartID, palette);
|
||||
seqPrecacheId(pDudeInfo->seqStartID + 5, palette);
|
||||
seqPrecacheId(pDudeInfo->seqStartID + 1, palette);
|
||||
|
|
|
@ -491,7 +491,7 @@ void UpdateAimVector(PLAYER* pPlayer)
|
|||
if (nDist2 >= nClosest)
|
||||
continue;
|
||||
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
|
||||
DUDEINFO* pDudeInfo = getDudeInfo(actor);
|
||||
if (cansee(pos, plActor->sector(), pos2, actor->sector()))
|
||||
{
|
||||
double center = (actor->spr.scale.Y * pDudeInfo->aimHeight);
|
||||
|
|
Loading…
Reference in a new issue