Beispiel #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;
        }
Beispiel #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;
        }
Beispiel #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;
        }
Beispiel #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;
        }