void CCharacterPhysicsSupport::update_interactive_anims () { if ( Type() != etStalker ) return; VERIFY( m_EntityAlife.cast_stalker( ) ); CAI_Stalker *stalker = m_EntityAlife.cast_stalker( ); CBlend *b = stalker->animation().global().blend(); if( b && !m_interactive_animation && stalker->animation().global().callback_on_collision() ) run_interactive ( b ); if( m_interactive_animation && !m_interactive_animation->update( m_EntityAlife.XFORM( ) ) ) xr_delete( m_interactive_animation ); }
void CStalkerAnimationManager::script_play_callback(CBlend *blend) { CAI_Stalker *object = (CAI_Stalker*)blend->CallbackParam; VERIFY (object); CStalkerAnimationManager &animation_manager = object->animation(); CStalkerAnimationPair &pair = animation_manager.script(); const SCRIPT_ANIMATIONS &animations = animation_manager.script_animations(); #if 0 Msg ( "%6d Script callback [%s]", Device.dwTimeGlobal, animations.empty() ? "unknown" : animation_manager.m_skeleton_animated->LL_MotionDefName_dbg(animations.front().animation()) ); #endif if ( pair.animation() && !animations.empty() && (pair.animation() == animations.front().animation()) ) animation_manager.pop_script_animation(); animation_manager.m_call_script_callback = true; pair.on_animation_end (); }
void CStalkerAnimationManager::legs_play_callback (CBlend *blend) { CAI_Stalker *object = (CAI_Stalker*)blend->CallbackParam; VERIFY (object); CStalkerAnimationPair &pair = object->animation().legs(); pair.on_animation_end (); }
int CScriptGameObject::animation_count () const { CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(&object()); if (!stalker) { ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CGameObject : cannot access class member clear_animations!"); return (-1); } return ((int)stalker->animation().script_animations().size()); }
void CScriptGameObject::clear_animations () { CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(&object()); if (!stalker) { ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CGameObject : cannot access class member clear_animations!"); return; } stalker->animation().clear_script_animations(); }
void CScriptGameObject::add_animation (LPCSTR animation, bool hand_usage, bool use_movement_controller) { CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(&object()); if (!stalker) { ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CGameObject : cannot access class member add_animation!"); return; } stalker->animation().add_script_animation(animation,hand_usage,use_movement_controller); }
bool CScriptGameObject::special_danger_move () { CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(&object()); if (!stalker) { ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : cannot access class member special_danger_move!"); return (false); } return (stalker->animation().special_danger_move()); }