Example #1
0
void Yarn::InitFromShooter( GameObjectPtr inShooter, GameObjectPtr inTarget )
{
	SetPlayerId( inShooter->GetPlayerId() );

	Vector3 forward = inTarget->GetLocation() - inShooter->GetLocation();
	SetVelocity( forward * kMuzzleSpeed );
	SetLocation( inShooter->GetLocation() );

	mShooterCat = inShooter;
	mTargetCat = inTarget;
}
Example #2
0
void RoboCat::EnterAttackState( uint32_t inTargetNetId )
{
	mTargetNetId = inTargetNetId;

	//cache the target cat
	GameObjectPtr go = NetworkManager::sInstance->GetGameObject( mTargetNetId );
	//double check this attack target is valid
	if ( go && go->GetClassId() == RoboCat::kClassId && go->GetPlayerId() != GetPlayerId() )
	{
		mTargetCat = go;
		mState = RC_ATTACK;
	}
	else
	{
		mState = RC_IDLE;
	}
}