mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-05-01 07:07:58 +03:00
Added events moved actor methods to the correct source files
This commit is contained in:
parent
39ac9f7de6
commit
ba855cd064
5 changed files with 14036 additions and 13878 deletions
27741
code/fgame/actor.cpp
27741
code/fgame/actor.cpp
File diff suppressed because it is too large
Load diff
|
@ -752,6 +752,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Actor();
|
Actor();
|
||||||
|
~Actor();
|
||||||
|
|
||||||
virtual void setContentsSolid( void ) override;
|
virtual void setContentsSolid( void ) override;
|
||||||
void InitThinkStates( void );
|
void InitThinkStates( void );
|
||||||
|
|
|
@ -249,6 +249,128 @@ void Actor::FinishedAnimation_BalconyAttack
|
||||||
if( m_State == 202 )
|
if( m_State == 202 )
|
||||||
State_Balcony_PostShoot();
|
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
|
void Actor::Begin_BalconyKilled
|
||||||
(
|
(
|
||||||
|
|
|
@ -91,38 +91,4 @@ void Actor::IdleThink
|
||||||
|
|
||||||
PostThink(true);
|
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;
|
|
||||||
}
|
}
|
|
@ -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
|
void Actor::Think_MachineGunner
|
||||||
(
|
(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue