コード例 #1
0
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);
		}
	}
}
コード例 #2
0
ファイル: Artifact.cpp プロジェクト: OLR-xray/XRay-NEW
void SArtefactActivation::Start()
{
	VERIFY(!ph_world->Processing());
	m_af->StopLights				();
	m_cur_activation_state			= eStarting;
	m_cur_state_time				= 0.0f;
	
	m_af->processing_activate();

	NET_Packet						P;
	CGameObject::u_EventGen			(P,GE_OWNERSHIP_REJECT, m_af->H_Parent()->ID());
	P.w_u16							(m_af->ID());
	if (OnServer())
		CGameObject::u_EventSend		(P);
	m_light->set_active				(true);
	ChangeEffects					();
}
コード例 #3
0
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;
	}

}
コード例 #4
0
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			();
}