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; }
// 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; }
// 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; }
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; }