예제 #1
0
        public void SpotFoe(int actorId)
        {
            AggroRecord aggro;

            if (!mFoes.ContainsKey(actorId))
            {
                aggro        = new AggroRecord();
                aggro.Enmity = AggroRecord.NEW_FOE_ENMITY;
                mFoes.Add(actorId, aggro);
            }
            else
            {
                aggro = mFoes[actorId];
            }

            Actor foe = GameResources.ActorManager.GetActorById(actorId);
            BipedControllerComponent bcc = foe.GetComponent <BipedControllerComponent>(ActorComponent.ComponentType.Control);

            aggro.PositionLastSensed = BepuConverter.Convert(bcc.Controller.Body.Position);
            if (aggro.TimeLastVisible < GameResources.ActorManager.CurrentTime.Subtract(SharedResources.Game.TargetElapsedTime))
            {
                // They reappeared just now.
                aggro.TimeBecameVisible = GameResources.ActorManager.CurrentTime;
            }

            aggro.TimeLastSensed  = GameResources.ActorManager.CurrentTime;
            aggro.TimeLastVisible = GameResources.ActorManager.CurrentTime;
        }
예제 #2
0
        // For non-vision memory input.
        public void SenseFoe(int actorId)
        {
            AggroRecord aggro;
            if (!mFoes.ContainsKey(actorId))
            {
                aggro = new AggroRecord();
                aggro.Enmity = AggroRecord.NEW_FOE_ENMITY;
                mFoes.Add(actorId, aggro);
            }
            else
            {
                aggro = mFoes[actorId];
            }

            Actor foe = GameResources.ActorManager.GetActorById(actorId);
            BipedControllerComponent bcc = foe.GetComponent<BipedControllerComponent>(ActorComponent.ComponentType.Control);

            aggro.PositionLastSensed = BepuConverter.Convert(bcc.Controller.Body.Position);

            aggro.TimeLastSensed = GameResources.ActorManager.CurrentTime;
        }
예제 #3
0
        // For non-vision memory input.
        public void SenseFoe(int actorId)
        {
            AggroRecord aggro;

            if (!mFoes.ContainsKey(actorId))
            {
                aggro        = new AggroRecord();
                aggro.Enmity = AggroRecord.NEW_FOE_ENMITY;
                mFoes.Add(actorId, aggro);
            }
            else
            {
                aggro = mFoes[actorId];
            }

            Actor foe = GameResources.ActorManager.GetActorById(actorId);
            BipedControllerComponent bcc = foe.GetComponent <BipedControllerComponent>(ActorComponent.ComponentType.Control);

            aggro.PositionLastSensed = BepuConverter.Convert(bcc.Controller.Body.Position);

            aggro.TimeLastSensed = GameResources.ActorManager.CurrentTime;
        }
예제 #4
0
        public void SpotFoe(int actorId)
        {
            AggroRecord aggro;
            if (!mFoes.ContainsKey(actorId))
            {
                aggro = new AggroRecord();
                aggro.Enmity = AggroRecord.NEW_FOE_ENMITY;
                mFoes.Add(actorId, aggro);
            }
            else
            {
                aggro = mFoes[actorId];
            }

            Actor foe = GameResources.ActorManager.GetActorById(actorId);
            BipedControllerComponent bcc = foe.GetComponent<BipedControllerComponent>(ActorComponent.ComponentType.Control);

            aggro.PositionLastSensed = BepuConverter.Convert(bcc.Controller.Body.Position);
            if (aggro.TimeLastVisible < GameResources.ActorManager.CurrentTime.Subtract(SharedResources.Game.TargetElapsedTime))
            {
                // They reappeared just now.
                aggro.TimeBecameVisible = GameResources.ActorManager.CurrentTime;
            }

            aggro.TimeLastSensed = GameResources.ActorManager.CurrentTime;
            aggro.TimeLastVisible = GameResources.ActorManager.CurrentTime;
        }