Added events moved actor methods to the correct source files

This commit is contained in:
smallmodel 2023-10-11 22:49:06 +02:00
parent 39ac9f7de6
commit ba855cd064
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
5 changed files with 14036 additions and 13878 deletions

File diff suppressed because it is too large Load diff

View file

@ -752,6 +752,7 @@ protected:
public:
Actor();
~Actor();
virtual void setContentsSolid( void ) override;
void InitThinkStates( void );

View file

@ -249,6 +249,128 @@ void Actor::FinishedAnimation_BalconyAttack
if( m_State == 202 )
State_Balcony_PostShoot();
}
bool Actor::CalcFallPath
(
void
)
{
float startTime, animTime, startDeltaTime, nextTime;
vec3_t vAbsDelta, vRelDelta, pos[200];
int anim, loop, /*currentPos,*/ i;
mmove_t mm;
SetMoveInfo(&mm);
mm.desired_speed = 80;
mm.tracemask &= 0xFDFFF4FF;
VectorCopy2D(orientation[0], mm.desired_dir);
anim = gi.Anim_NumForName(edict->tiki, "death_balcony_intro");
animTime = gi.Anim_Time(edict->tiki, anim);
startTime = 0.65F;
i = 0;
while (true)
{
MmoveSingle(&mm);
i++;
VectorCopy(mm.origin, pos[i]);
if (i >= 200)
{
break;
}
if (mm.hit_obstacle)
{
for (float j = 0.65f; j < animTime; j = nextTime)
{
nextTime = j + level.frametime;
if (nextTime >= animTime - 0.01f)
nextTime = animTime;
startDeltaTime = j;
gi.Anim_DeltaOverTime(
edict->tiki,
anim,
startDeltaTime,
nextTime,
vAbsDelta);
MatrixTransformVector(vAbsDelta, orientation, vRelDelta);
i++;
VectorAdd(vRelDelta, mm.origin, mm.origin);
VectorCopy(mm.origin, pos[i]);
if (i >= 200)
return false;
}
mm.desired_speed = 0;
mm.groundPlane = qfalse;
mm.walking = qfalse;
mm.velocity[0] = 0;
mm.velocity[1] = 0;
mm.velocity[2] = -171;
loop = i;
while (true)
{
MmoveSingle(&mm);
i++;
VectorCopy(mm.origin, pos[i]);
if (i >= 200)
{
break;
}
if (mm.hit_obstacle)
return false;
if (mm.groundPlane)
{
if (m_fBalconyHeight > origin[2] - pos[i][2])
return false;
m_pFallPath = (FallPath *)gi.Malloc((sizeof(FallPath::pos)) * i + (sizeof(FallPath) - sizeof(FallPath::pos)));
m_pFallPath->length = i;
m_pFallPath->currentPos = 0;
m_pFallPath->startTime = startTime;
m_pFallPath->loop = loop;
if (i > 0)
{
for (int j = i; j ; j--)
{
VectorCopy(pos[j], m_pFallPath->pos[j]);
}
}
return true;
}
}
return false;
}
if (mm.groundPlane)
{
startTime -= level.frametime;
if (startTime >= 0)
continue;
}
return false;
}
return false;
}
void Actor::Begin_BalconyKilled
(

View file

@ -92,37 +92,3 @@ void Actor::IdleThink
PostThink(true);
}
/*
===============
Actor::PassesTransitionConditions_Idle
Should actor transition think state to idle ?
===============
*/
bool Actor::PassesTransitionConditions_Idle
(
void
)
{
glbs.Printf("PassesTransitionConditions_Idle\n");
UpdateEnemy(500);
if (m_bLockThinkState)
return false;
if (!m_Enemy && !m_iCuriousTime)
return true;
return false;
}
bool Actor::IsIdleState
(
int state
)
{
return state == THINKSTATE_IDLE;
}

View file

@ -102,22 +102,6 @@ void Actor::End_MachineGunner
}
}
}
void Actor::BecomeTurretGuy
(
void
)
{
SetThinkIdle(THINK_IDLE);
SetThink(THINKSTATE_ATTACK, THINK_TURRET);
SetThink(THINKSTATE_DISGUISE, THINK_DISGUISE_SALUTE);
SetThink(THINKSTATE_GRENADE, THINK_GRENADE);
if (CurrentThink() == THINK_IDLE && Turret_DecideToSelectState())
{
TransitionState(100, 0);
}
}
void Actor::Think_MachineGunner
(