2016-03-27 11:49:47 +02:00
|
|
|
/*
|
|
|
|
===========================================================================
|
2023-10-12 18:19:22 +02:00
|
|
|
Copyright (C) 2023 the OpenMoHAA team
|
2016-03-27 11:49:47 +02:00
|
|
|
|
|
|
|
This file is part of OpenMoHAA source code.
|
|
|
|
|
|
|
|
OpenMoHAA source code is free software; you can redistribute it
|
|
|
|
and/or modify it under the terms of the GNU General Public License as
|
|
|
|
published by the Free Software Foundation; either version 2 of the License,
|
|
|
|
or (at your option) any later version.
|
|
|
|
|
|
|
|
OpenMoHAA source code is distributed in the hope that it will be
|
|
|
|
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OpenMoHAA source code; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
===========================================================================
|
|
|
|
*/
|
|
|
|
|
|
|
|
// actor_balcony.cpp
|
|
|
|
|
|
|
|
#include "actor.h"
|
2023-04-29 21:56:38 +02:00
|
|
|
#include "scriptexception.h"
|
2016-03-27 11:49:47 +02:00
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::InitBalconyIdle(GlobalFuncs_t *func)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
func->ThinkState = &Actor::Think_Idle;
|
|
|
|
func->PassesTransitionConditions = &Actor::PassesTransitionConditions_Idle;
|
|
|
|
func->Pain = &Actor::Pain_Balcony;
|
|
|
|
func->Killed = &Actor::Killed_Balcony;
|
|
|
|
func->IsState = &Actor::IsIdleState;
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::InitBalconyCurious(GlobalFuncs_t *func)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
func->ThinkState = &Actor::Think_Curious;
|
|
|
|
func->BeginState = &Actor::Begin_Curious;
|
|
|
|
func->EndState = &Actor::End_Curious;
|
|
|
|
func->ResumeState = &Actor::Resume_Curious;
|
|
|
|
func->SuspendState = &Actor::Suspend_Curious;
|
|
|
|
func->FinishedAnimation = &Actor::FinishedAnimation_Curious;
|
|
|
|
func->PassesTransitionConditions = &Actor::PassesTransitionConditions_Curious;
|
|
|
|
func->IsState = &Actor::IsCuriousState;
|
|
|
|
func->Pain = &Actor::Pain_Balcony;
|
|
|
|
func->Killed = &Actor::Killed_Balcony;
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::InitBalconyAttack(GlobalFuncs_t *func)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
func->ThinkState = &Actor::Think_BalconyAttack;
|
|
|
|
func->PassesTransitionConditions = &Actor::PassesTransitionConditions_Attack;
|
|
|
|
func->BeginState = &Actor::Begin_BalconyAttack;
|
|
|
|
func->FinishedAnimation = &Actor::FinishedAnimation_BalconyAttack;
|
|
|
|
func->Pain = &Actor::Pain_Balcony;
|
|
|
|
func->Killed = &Actor::Killed_Balcony;
|
|
|
|
func->IsState = &Actor::IsAttackState;
|
|
|
|
func->PostShoot = &Actor::State_Balcony_PostShoot;
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::InitBalconyDisguise(GlobalFuncs_t *func)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
func->IsState = &Actor::IsDisguiseState;
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::InitBalconyGrenade(GlobalFuncs_t *func)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
func->IsState = &Actor::IsGrenadeState;
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::InitBalconyPain(GlobalFuncs_t *func)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
func->BeginState = &Actor::Begin_Pain;
|
|
|
|
func->ThinkState = &Actor::Think_Pain;
|
|
|
|
func->FinishedAnimation = &Actor::FinishedAnimation_Pain;
|
|
|
|
func->Pain = &Actor::Pain_Balcony;
|
|
|
|
func->Killed = &Actor::Killed_Balcony;
|
|
|
|
func->IsState = &Actor::IsPainState;
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::InitBalconyKilled(GlobalFuncs_t *func)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
func->BeginState = &Actor::Begin_BalconyKilled;
|
|
|
|
func->EndState = &Actor::End_BalconyKilled;
|
|
|
|
func->ThinkState = &Actor::Think_BalconyKilled;
|
|
|
|
func->FinishedAnimation = &Actor::FinishedAnimation_BalconyKilled;
|
|
|
|
func->IsState = &Actor::IsKilledState;
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::Pain_Balcony(Event *ev)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
SetThink(THINKSTATE_PAIN, THINK_BALCONY_PAIN);
|
|
|
|
HandlePain(ev);
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::Killed_Balcony(Event *ev, bool bPlayDeathAnim)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
ClearStates();
|
|
|
|
SetThink(THINKSTATE_KILLED, THINK_BALCONY_KILLED);
|
|
|
|
HandleKilled(ev, true);
|
2016-03-27 11:49:47 +02:00
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
if (!bPlayDeathAnim) {
|
|
|
|
ScriptError("cannot do 'bedead' on balcony guys");
|
|
|
|
}
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::Begin_BalconyAttack(void)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-20 23:03:17 +02:00
|
|
|
TransitionState(ACTOR_STATE_BALCONY_ATTACK_FIND_ENEMY, 0);
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::State_Balcony_PostShoot(void)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
if (m_Enemy) {
|
2023-10-20 23:03:17 +02:00
|
|
|
TransitionState(ACTOR_STATE_BALCONY_ATTACK_TARGET, 0);
|
2023-10-12 18:19:22 +02:00
|
|
|
}
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::State_Balcony_FindEnemy(void)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
m_bHasDesiredLookAngles = false;
|
|
|
|
Anim_Aim();
|
2016-03-27 11:49:47 +02:00
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
if (CanSeeEnemy(200)) {
|
2023-10-20 23:03:17 +02:00
|
|
|
TransitionState(ACTOR_STATE_BALCONY_ATTACK_TARGET, 0);
|
2023-10-12 18:19:22 +02:00
|
|
|
}
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::State_Balcony_Target(void)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
Anim_Aim();
|
|
|
|
AimAtTargetPos();
|
|
|
|
|
|
|
|
if (level.inttime > m_iStateTime + 1000) {
|
|
|
|
if (CanSeeEnemy(0) && CanShootEnemy(0)) {
|
2023-10-20 23:03:17 +02:00
|
|
|
TransitionState(ACTOR_STATE_BALCONY_ATTACK_SHOOT, 0);
|
2023-10-12 18:19:22 +02:00
|
|
|
} else {
|
|
|
|
ClearPath();
|
2023-10-20 23:03:17 +02:00
|
|
|
TransitionState(ACTOR_STATE_BALCONY_ATTACK_FIND_ENEMY, 0);
|
2023-10-12 18:19:22 +02:00
|
|
|
}
|
|
|
|
}
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::State_Balcony_Shoot(void)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
Anim_Shoot();
|
|
|
|
AimAtTargetPos();
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::Think_BalconyAttack(void)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
if (!RequireThink()) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
UpdateEyeOrigin();
|
|
|
|
UpdateEnemy(500);
|
|
|
|
|
|
|
|
if (!m_Enemy) {
|
2023-10-15 20:52:06 +02:00
|
|
|
SetThinkState(THINKSTATE_IDLE, THINKLEVEL_IDLE);
|
2023-10-12 18:19:22 +02:00
|
|
|
IdleThink();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
NoPoint();
|
|
|
|
|
2023-10-20 23:03:17 +02:00
|
|
|
switch (m_State) {
|
|
|
|
case ACTOR_STATE_BALCONY_ATTACK_TARGET:
|
2023-10-12 18:19:22 +02:00
|
|
|
m_pszDebugState = "target";
|
|
|
|
State_Balcony_Target();
|
2023-10-20 23:03:17 +02:00
|
|
|
break;
|
|
|
|
case ACTOR_STATE_BALCONY_ATTACK_SHOOT:
|
2023-10-12 18:19:22 +02:00
|
|
|
m_pszDebugState = "shoot";
|
|
|
|
State_Balcony_Shoot();
|
2023-10-20 23:03:17 +02:00
|
|
|
break;
|
|
|
|
case ACTOR_STATE_BALCONY_ATTACK_FIND_ENEMY:
|
2023-10-12 18:19:22 +02:00
|
|
|
m_pszDebugState = "findenemy";
|
|
|
|
State_Balcony_FindEnemy();
|
2023-10-20 23:03:17 +02:00
|
|
|
break;
|
|
|
|
default:
|
2023-10-12 18:19:22 +02:00
|
|
|
Com_Printf("Actor::Think_BalconyAttack: invalid think state %i\n", m_State);
|
|
|
|
assert(0);
|
2023-10-20 23:03:17 +02:00
|
|
|
break;
|
2023-10-12 18:19:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
PostThink(true);
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::FinishedAnimation_BalconyAttack(void)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-20 23:03:17 +02:00
|
|
|
if (m_State == ACTOR_STATE_BALCONY_ATTACK_SHOOT) {
|
2023-10-12 18:19:22 +02:00
|
|
|
State_Balcony_PostShoot();
|
|
|
|
}
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
2023-10-12 18:19:22 +02:00
|
|
|
|
|
|
|
bool Actor::CalcFallPath(void)
|
2023-10-11 22:49:06 +02:00
|
|
|
{
|
|
|
|
mmove_t mm;
|
2023-10-20 23:03:17 +02:00
|
|
|
int currentPos = 0;
|
|
|
|
int loop;
|
|
|
|
vec3_t pos[200];
|
|
|
|
float startDeltaTime;
|
|
|
|
float nextTime;
|
|
|
|
vec3_t vRelDelta;
|
|
|
|
vec3_t vAbsDelta;
|
|
|
|
float animTime;
|
|
|
|
int anim;
|
|
|
|
int i;
|
|
|
|
float startTime;
|
2023-10-11 22:49:06 +02:00
|
|
|
|
|
|
|
SetMoveInfo(&mm);
|
|
|
|
|
2023-10-20 23:03:17 +02:00
|
|
|
mm.tracemask &= ~(CONTENTS_BODY | CONTENTS_UNKNOWN2 | CONTENTS_NOBOTCLIP | CONTENTS_BBOX);
|
2023-10-11 22:49:06 +02:00
|
|
|
mm.desired_speed = 80;
|
|
|
|
VectorCopy2D(orientation[0], mm.desired_dir);
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
anim = gi.Anim_NumForName(edict->tiki, "death_balcony_intro");
|
2023-10-11 22:49:06 +02:00
|
|
|
animTime = gi.Anim_Time(edict->tiki, anim);
|
2023-10-20 23:03:17 +02:00
|
|
|
startTime = 0.65f;
|
2023-10-11 22:49:06 +02:00
|
|
|
|
2023-10-20 23:03:17 +02:00
|
|
|
for (;;) {
|
2023-10-11 22:49:06 +02:00
|
|
|
MmoveSingle(&mm);
|
2023-10-20 23:03:17 +02:00
|
|
|
VectorCopy(mm.origin, pos[currentPos]);
|
2023-10-12 18:19:22 +02:00
|
|
|
|
2023-10-20 23:03:17 +02:00
|
|
|
currentPos++;
|
|
|
|
if (currentPos >= ARRAY_LEN(pos)) {
|
|
|
|
return false;
|
|
|
|
}
|
2023-10-11 22:49:06 +02:00
|
|
|
|
2023-10-20 23:03:17 +02:00
|
|
|
if (mm.hit_obstacle) {
|
2023-10-11 22:49:06 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2023-10-20 23:03:17 +02:00
|
|
|
if (!mm.groundPlane) {
|
|
|
|
return false;
|
|
|
|
}
|
2023-10-11 22:49:06 +02:00
|
|
|
|
2023-10-20 23:03:17 +02:00
|
|
|
startTime -= level.frametime;
|
|
|
|
if (startTime < 0) {
|
2023-10-11 22:49:06 +02:00
|
|
|
return false;
|
|
|
|
}
|
2023-10-20 23:03:17 +02:00
|
|
|
}
|
2023-10-11 22:49:06 +02:00
|
|
|
|
2023-10-20 23:03:17 +02:00
|
|
|
for (startDeltaTime = 0.65f; startDeltaTime < animTime; startDeltaTime = nextTime) {
|
|
|
|
nextTime = startDeltaTime + level.frametime;
|
|
|
|
if (nextTime >= animTime - 0.01f) {
|
|
|
|
nextTime = animTime;
|
|
|
|
}
|
|
|
|
|
|
|
|
gi.Anim_DeltaOverTime(edict->tiki, anim, startDeltaTime, nextTime, vRelDelta);
|
|
|
|
MatrixTransformVector(vRelDelta, orientation, vAbsDelta);
|
|
|
|
|
|
|
|
VectorAdd(mm.origin, vAbsDelta, mm.origin);
|
|
|
|
VectorCopy(mm.origin, pos[currentPos]);
|
|
|
|
|
|
|
|
currentPos++;
|
|
|
|
if (currentPos >= ARRAY_LEN(pos)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
loop = currentPos;
|
|
|
|
|
|
|
|
mm.desired_speed = 0;
|
2024-06-07 20:34:13 +02:00
|
|
|
mm.groundPlane = qfalse;
|
2023-10-20 23:03:17 +02:00
|
|
|
mm.walking = false;
|
|
|
|
VectorSet(mm.velocity, 0, 0, -171);
|
|
|
|
|
|
|
|
do {
|
|
|
|
MmoveSingle(&mm);
|
|
|
|
VectorCopy(mm.origin, pos[currentPos]);
|
|
|
|
|
|
|
|
currentPos++;
|
|
|
|
if (currentPos >= ARRAY_LEN(pos)) {
|
|
|
|
return false;
|
2023-10-11 22:49:06 +02:00
|
|
|
}
|
2023-10-20 23:03:17 +02:00
|
|
|
|
|
|
|
if (mm.hit_obstacle) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} while (!mm.groundPlane);
|
|
|
|
|
|
|
|
if (origin[2] - pos[currentPos - 1][2] < m_fBalconyHeight) {
|
2023-10-11 22:49:06 +02:00
|
|
|
return false;
|
|
|
|
}
|
2023-10-20 23:03:17 +02:00
|
|
|
|
|
|
|
m_pFallPath = (FallPath*)gi.Malloc(sizeof(FallPath) + sizeof(FallPath::pos) * (currentPos - 1));
|
|
|
|
m_pFallPath->length = currentPos;
|
|
|
|
m_pFallPath->currentPos = 0;
|
|
|
|
m_pFallPath->startTime = startTime;
|
|
|
|
m_pFallPath->loop = loop;
|
|
|
|
|
|
|
|
for (i = 0; i < currentPos; i++) {
|
|
|
|
VectorCopy(pos[i], m_pFallPath->pos[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
2023-10-11 22:49:06 +02:00
|
|
|
}
|
2016-03-27 11:49:47 +02:00
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::Begin_BalconyKilled(void)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
ClearPath();
|
|
|
|
ResetBoneControllers();
|
2016-03-27 11:49:47 +02:00
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
PostEvent(EV_Actor_DeathEmbalm, 0.05f);
|
2016-03-27 11:49:47 +02:00
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
if (CalcFallPath()) {
|
2023-10-20 23:03:17 +02:00
|
|
|
TransitionState(ACTOR_STATE_BALCONY_KILLED_BEGIN, 0);
|
2023-10-12 18:19:22 +02:00
|
|
|
} else {
|
2023-10-20 23:03:17 +02:00
|
|
|
TransitionState(ACTOR_STATE_BALCONY_KILLED_NORMAL, 0);
|
2023-10-12 18:19:22 +02:00
|
|
|
}
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::End_BalconyKilled(void)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
if (m_pFallPath) {
|
|
|
|
gi.Free(m_pFallPath);
|
|
|
|
m_pFallPath = NULL;
|
|
|
|
}
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::Think_BalconyKilled(void)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-12 18:19:22 +02:00
|
|
|
int animnum;
|
|
|
|
|
|
|
|
Unregister(STRING_ANIMDONE);
|
|
|
|
|
2023-10-20 23:03:17 +02:00
|
|
|
if (m_State == ACTOR_STATE_BALCONY_KILLED_END) {
|
|
|
|
m_pszDebugState = "";
|
|
|
|
return;
|
|
|
|
}
|
2023-10-12 18:19:22 +02:00
|
|
|
|
2023-10-20 23:03:17 +02:00
|
|
|
NoPoint();
|
|
|
|
ForwardLook();
|
|
|
|
|
|
|
|
switch (m_State) {
|
|
|
|
case ACTOR_STATE_BALCONY_KILLED_BEGIN:
|
|
|
|
m_bNextForceStart = true;
|
|
|
|
m_eNextAnimMode = ANIM_MODE_FALLING_PATH;
|
|
|
|
m_pszDebugState = "begin";
|
|
|
|
m_csNextAnimString = STRING_ANIM_NO_KILLED_SCR;
|
|
|
|
|
|
|
|
animnum = gi.Anim_NumForName(edict->tiki, "death_balcony_intro");
|
|
|
|
|
|
|
|
ChangeMotionAnim();
|
|
|
|
|
|
|
|
m_bMotionAnimSet = true;
|
|
|
|
m_iMotionSlot = GetMotionSlot(0);
|
2023-10-23 14:46:17 +02:00
|
|
|
m_weightType[m_iMotionSlot] = ANIM_WEIGHT_MOTION;
|
2023-10-20 23:03:17 +02:00
|
|
|
m_weightCrossBlend[m_iMotionSlot] = 0.0;
|
|
|
|
m_weightBase[m_iMotionSlot] = 1.0;
|
|
|
|
|
|
|
|
NewAnim(animnum, m_iMotionSlot);
|
|
|
|
SetTime(m_iMotionSlot, m_pFallPath->startTime);
|
|
|
|
UpdateNormalAnimSlot(m_iMotionSlot);
|
|
|
|
TransitionState(ACTOR_STATE_BALCONY_KILLED_INTRO, 0);
|
|
|
|
break;
|
|
|
|
case ACTOR_STATE_BALCONY_KILLED_INTRO:
|
|
|
|
m_bNextForceStart = false;
|
|
|
|
m_pszDebugState = "intro";
|
|
|
|
m_eNextAnimMode = ANIM_MODE_FALLING_PATH;
|
|
|
|
m_csNextAnimString = STRING_ANIM_NO_KILLED_SCR;
|
|
|
|
break;
|
|
|
|
case ACTOR_STATE_BALCONY_KILLED_LOOP:
|
|
|
|
m_pszDebugState = "loop";
|
|
|
|
Anim_FullBody(STRING_DEATH_BALCONY_LOOP, 7);
|
|
|
|
break;
|
|
|
|
case ACTOR_STATE_BALCONY_KILLED_LOOP_END:
|
|
|
|
TransitionState(804, 0);
|
|
|
|
StopAllAnimating();
|
|
|
|
case ACTOR_STATE_BALCONY_KILLED_OUTTRO:
|
|
|
|
m_pszDebugState = "outtro";
|
|
|
|
Anim_FullBody(STRING_DEATH_BALCONY_OUTTRO, 1);
|
|
|
|
break;
|
|
|
|
case ACTOR_STATE_BALCONY_KILLED_NORMAL:
|
|
|
|
m_pszDebugState = "normal";
|
|
|
|
Anim_Killed();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
Com_Printf("Actor::Think_BalconyKilled: invalid think state %i\n", m_State);
|
|
|
|
assert(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
PostThink(false);
|
|
|
|
|
|
|
|
if (m_State >= ACTOR_STATE_BALCONY_KILLED_BEGIN) {
|
|
|
|
if (m_State == ACTOR_STATE_BALCONY_KILLED_INTRO) {
|
|
|
|
if (m_pFallPath->currentPos >= m_pFallPath->length) {
|
|
|
|
TransitionState(ACTOR_STATE_BALCONY_KILLED_LOOP_END, 0);
|
|
|
|
}
|
|
|
|
else if (m_pFallPath->currentPos >= m_pFallPath->loop) {
|
|
|
|
TransitionState(ACTOR_STATE_BALCONY_KILLED_LOOP, 0);
|
|
|
|
}
|
|
|
|
} else if (m_State == ACTOR_STATE_BALCONY_KILLED_LOOP) {
|
|
|
|
if (m_pFallPath->currentPos >= m_pFallPath->length) {
|
|
|
|
TransitionState(ACTOR_STATE_BALCONY_KILLED_LOOP_END, 0);
|
2023-10-12 18:19:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|
|
|
|
|
2023-10-12 18:19:22 +02:00
|
|
|
void Actor::FinishedAnimation_BalconyKilled(void)
|
2016-03-27 11:49:47 +02:00
|
|
|
{
|
2023-10-20 23:03:17 +02:00
|
|
|
switch (m_State) {
|
|
|
|
case ACTOR_STATE_BALCONY_KILLED_OUTTRO:
|
|
|
|
case ACTOR_STATE_BALCONY_KILLED_NORMAL:
|
2023-10-12 18:19:22 +02:00
|
|
|
BecomeCorpse();
|
2023-10-20 23:03:17 +02:00
|
|
|
TransitionState(ACTOR_STATE_BALCONY_KILLED_END, 0);
|
|
|
|
break;
|
|
|
|
case ACTOR_STATE_BALCONY_KILLED_INTRO:
|
|
|
|
TransitionState(ACTOR_STATE_BALCONY_KILLED_LOOP, 0);
|
2023-10-12 18:19:22 +02:00
|
|
|
StopAllAnimating();
|
2023-10-20 23:03:17 +02:00
|
|
|
break;
|
2023-10-12 18:19:22 +02:00
|
|
|
}
|
2016-03-27 11:49:47 +02:00
|
|
|
}
|