void CEliteDetector::UpdateAf() { ui().Clear (); if(m_artefacts.m_ItemInfos.size()==0) return; CAfList::ItemsMapIt it_b = m_artefacts.m_ItemInfos.begin(); CAfList::ItemsMapIt it_e = m_artefacts.m_ItemInfos.end(); CAfList::ItemsMapIt it = it_b; Fvector detector_pos = Position(); for(;it_b!=it_e;++it_b) { CArtefact *pAf = it_b->first; if(pAf->H_Parent()) continue; ui().RegisterItemToDraw (pAf->Position(),"af_sign"); if(pAf->CanBeInvisible()) { float d = detector_pos.distance_to(pAf->Position()); if(d<m_fAfVisRadius) pAf->SwitchVisibility(true); } } }
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()); }
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::PhDataUpdate(dReal step) { if (m_cur_activation_state==eFlying) { Fvector dir = {0, -1.f, 0}; if(Level().ObjectSpace.RayTest(m_af->Position(), dir, 1.0f, collide::rqtBoth,NULL,m_af) ){ dir.y = ph_world->Gravity()*1.1f; m_af->m_pPhysicsShell->applyGravityAccel(dir); } } }
void CScientificDetector::UpfateWork() { ui().Clear (); CAfList::ItemsMapIt ait_b = m_artefacts.m_ItemInfos.begin(); CAfList::ItemsMapIt ait_e = m_artefacts.m_ItemInfos.end(); CAfList::ItemsMapIt ait = ait_b; Fvector detector_pos = Position(); for(;ait_b!=ait_e;++ait_b) { CArtefact *pAf = ait_b->first; if(pAf->H_Parent()) continue; ui().RegisterItemToDraw (pAf->Position(), pAf->cNameSect()); if(pAf->CanBeInvisible()) { float d = detector_pos.distance_to(pAf->Position()); if(d<m_fAfVisRadius) pAf->SwitchVisibility(true); } } CZoneList::ItemsMapIt zit_b = m_zones.m_ItemInfos.begin(); CZoneList::ItemsMapIt zit_e = m_zones.m_ItemInfos.end(); CZoneList::ItemsMapIt zit = zit_b; for(;zit_b!=zit_e;++zit_b) { CCustomZone* pZone = zit_b->first; ui().RegisterItemToDraw (pZone->Position(),pZone->cNameSect()); } m_ui->update (); }
void game_cl_ArtefactHunt::GetMapEntities(xr_vector<SZoneMapEntityData>& dst) { inherited::GetMapEntities(dst); SZoneMapEntityData D; u32 color_enemy_with_artefact = 0xffff0000; u32 color_artefact = 0xffffffff; u32 color_friend_with_artefact = 0xffffff00; s16 local_team = local_player->team; CObject* pObject = Level().Objects.net_Find(artefactID); if(!pObject) return; CArtefact* pArtefact = smart_cast<CArtefact*>(pObject); VERIFY(pArtefact); CObject* pParent = pArtefact->H_Parent(); if(!pParent){// Artefact alone D.color = color_artefact; D.pos = pArtefact->Position(); dst.push_back(D); return; }; if (pParent && pParent->ID() == artefactBearerID && GetPlayerByGameID(artefactBearerID)){ CObject* pBearer = Level().Objects.net_Find(artefactBearerID); VERIFY(pBearer); D.pos = pBearer->Position(); game_PlayerState* ps = GetPlayerByGameID (artefactBearerID); (ps->team==local_team)? D.color=color_friend_with_artefact:D.color=color_enemy_with_artefact; //remove previous record about this actor !!! dst.push_back(D); return; } }