void SArtefactActivation::ChangeEffects() { VERIFY(!ph_world->Processing()); SStateDef& state_def = m_activation_states[(int)m_cur_activation_state]; if(m_snd._feedback()) m_snd.stop(); if(state_def.m_snd.size()){ m_snd.create (*state_def.m_snd,st_Effect,sg_SourceType); m_snd.play_at_pos (m_af, m_af->Position()); }; m_light->set_range ( state_def.m_light_range); m_light->set_color ( state_def.m_light_color.r, state_def.m_light_color.g, state_def.m_light_color.b); if(state_def.m_particle.size()){ Fvector dir; dir.set(0,1,0); m_af->CParticlesPlayer::StartParticles( state_def.m_particle, dir, m_af->ID(), iFloor(state_def.m_time*1000) ); }; if(state_def.m_animation.size()){ CKinematicsAnimated *K=smart_cast<CKinematicsAnimated*>(m_af->Visual()); if(K)K->PlayCycle(*state_def.m_animation); } }
void SArtefactActivation::UpdateEffects() { VERIFY(!ph_world->Processing()); if(m_snd._feedback()) m_snd.set_position( m_af->Position() ); m_light->set_position(m_af->Position()); }
IC bool operator() (ref_sound &s) { return (NULL != s._feedback() ); }