bool CTeleWhirlwindObject::destroy_object (const Fvector dir,float val) { CPHDestroyable* D=object->ph_destroyable(); if(D) { D->PhysicallyRemoveSelf(); D->Destroy(m_telekinesis->OwnerObject()->ID()); //. m_telekinesis->add_impact(dir,val*10.f); xr_vector<shared_str>::iterator i = D->m_destroyed_obj_visual_names.begin(); xr_vector<shared_str>::iterator e = D->m_destroyed_obj_visual_names.end(); if (IsGameTypeSingle()) { for(;e!=i;i++) m_telekinesis->add_impact(dir,val*10.f); }; CParticlesPlayer* PP = smart_cast<CParticlesPlayer*>(object); if(PP) { u16 root=(smart_cast<IKinematics*>(object->Visual()))->LL_GetBoneRoot(); PP->StartParticles(m_telekinesis->destroing_particles(),root, Fvector().set(0,1,0),m_telekinesis->OwnerObject()->ID()); } return true; } return false; }
void CCustomZone::PlayObjectIdleParticles(CGameObject* pObject) { CParticlesPlayer* PP = smart_cast<CParticlesPlayer*>(pObject); if(!PP) return; shared_str particle_str = NULL; //разные партиклы для объектов разного размера if(pObject->Radius()<SMALL_OBJECT_RADIUS) { if(!m_sIdleObjectParticlesSmall) return; particle_str = m_sIdleObjectParticlesSmall; } else { if(!m_sIdleObjectParticlesBig) return; particle_str = m_sIdleObjectParticlesBig; } //запустить партиклы на объекте //. new PP->StopParticles (particle_str, BI_NONE, true); PP->StartParticles (particle_str, Fvector().set(0,1,0), ID()); if (!IsEnabled()) PP->StopParticles (particle_str, BI_NONE, true); }
void CCustomZone::PlayHitParticles(CGameObject* pObject) { m_hit_sound.play_at_pos(0, pObject->Position()); shared_str particle_str = NULL; if(pObject->Radius()<SMALL_OBJECT_RADIUS) { if(!m_sHitParticlesSmall) return; particle_str = m_sHitParticlesSmall; } else { if(!m_sHitParticlesBig) return; particle_str = m_sHitParticlesBig; } if( particle_str.size() ) { CParticlesPlayer* PP = smart_cast<CParticlesPlayer*>(pObject); if (PP){ u16 play_bone = PP->GetRandomBone(); if (play_bone!=BI_NONE) PP->StartParticles (particle_str,play_bone,Fvector().set(0,1,0), ID()); } } }
void CBurer::StartTeleObjectParticle(CGameObject *pO) { CParticlesPlayer* PP = smart_cast<CParticlesPlayer*>(pO); if(!PP) return; PP->StartParticles (particle_tele_object, Fvector().set(0.0f, 0.1f, 0.0f), pO->ID()); }
void CScriptGameObject::start_particles(LPCSTR pname, LPCSTR bone) { CParticlesPlayer* PP = smart_cast<CParticlesPlayer*>(&object()); if (!PP) return; IKinematics* K = smart_cast<IKinematics*>(object().Visual()); R_ASSERT(K); u16 play_bone = K->LL_BoneID(bone); R_ASSERT(play_bone != BI_NONE); if (K->LL_GetBoneVisible(play_bone)) PP->StartParticles(pname, play_bone, Fvector().set(0, 1, 0), 9999); else ai().script_engine().script_log(ScriptStorage::eLuaMessageTypeError, "Cant start particles, bone [%s] is not visible now", bone); }
bool CTeleWhirlwindObject::destroy_object (const Fvector dir,float val) { CPHDestroyable* D=object->ph_destroyable(); if(D) { D->PhysicallyRemoveSelf(); D->Destroy(m_telekinesis->OwnerObject()->ID()); m_telekinesis->add_impact(dir,val*10.f); CParticlesPlayer* PP = smart_cast<CParticlesPlayer*>(object); if(PP) { u16 root=(smart_cast<CKinematics*>(object->Visual()))->LL_GetBoneRoot(); PP->StartParticles(m_telekinesis->destroing_particles(),root, Fvector().set(0,1,0),m_telekinesis->OwnerObject()->ID()); } return true; } return false; }
void CBaseGraviZone::PlayTeleParticles(CGameObject* pObject) { CParticlesPlayer* PP = smart_cast<CParticlesPlayer*>(pObject); if(!PP) return; shared_str particle_str = NULL; //разные партиклы дл¤ объектов разного размера if(pObject->Radius()<SMALL_OBJECT_RADIUS) { if(!m_sTeleParticlesSmall) return; particle_str = m_sTeleParticlesSmall; } else { if(!m_sTeleParticlesBig) return; particle_str = m_sTeleParticlesBig; } PP->StartParticles(particle_str, Fvector().set(0,1,0), ID()); }
void CMincer::NotificateDestroy (CPHDestroyableNotificate *dn) { Fvector dir = {0,0,0}; float impulse = 0; //if(!m_telekinetics.has_impacts()) return; //CObject* obj=Level().Objects.net_Find(id); CPhysicsShellHolder* obj=dn->PPhysicsShellHolder(); m_telekinetics.draw_out_impact(dir,impulse); CParticlesPlayer* PP = smart_cast<CParticlesPlayer*>(obj); if(PP && *m_torn_particles) { PP->StartParticles(m_torn_particles,Fvector().set(0,1,0),ID()); } m_tearing_sound.play_at_pos(0,m_telekinetics.Center()); Fvector position_in_bone_space, throw_in_dir; position_in_bone_space.set (0.0f, 0.0f, 0.0f); throw_in_dir.set (1.0f, 0.0f, 1.0f); CreateHit(obj->ID(),ID(),throw_in_dir,0.0f,0,position_in_bone_space,impulse,ALife::eHitTypeExplosion); }