public AIMoveToDestinationSystem(CoreInteractiveObject CoreInteractiveObject, AbstractAIInteractiveObjectInitializerData AIInteractiveObjectInitializerData, OnAIInteractiveObjectDestinationReachedDelegate OnAIInteractiveObjectDestinationReached) { this.IsEnabled = true; AIDestinationMoveManager = new AIDestinationMoveManager(CoreInteractiveObject.InteractiveGameObject.Agent, AIInteractiveObjectInitializerData, OnAIInteractiveObjectDestinationReached); AISpeedEventDispatcher = new AISpeedEventDispatcher(CoreInteractiveObject, AIInteractiveObjectInitializerData); }
private void OnInteractiveObjectDestroyed(CoreInteractiveObject destroyedInteractiveObject) { if (destroyedInteractiveObject == this.CurrentlyTargettedInteractiveObject.GetValue()) { this.CurrentlyTargettedInteractiveObject.SetValue(null); } }
public void OnInteractiveObjectTargetted(CoreInteractiveObject targettedInteractiveobject) { if (targettedInteractiveobject != null && !targettedInteractiveobject.IsAskingToBeDestroyed) { this.CurrentlyTargettedInteractiveObject.SetValue(targettedInteractiveobject); } }
/// <summary> /// /!\ It is crucial to call <see cref="TrackUnknownInterestDirectionSystem"/> before propagating DamageDealt event because /// it may need data from <see cref="TrackUnknownInterestDirectionSystem"/>. /// </summary> /// <param name="DamageDealerInteractiveObject"></param> public void DamageDealt(CoreInteractiveObject DamageDealerInteractiveObject) { this.TrackUnknownInterestDirectionSystem.DamageDealt(DamageDealerInteractiveObject); this.SetState(TrackUnknownStateEnum.MOVE_TOWARDS_INTEREST_DIRECTION); this.GetCurrentStateManager().DamageDealt(DamageDealerInteractiveObject); }
public DeflectingProjectileInteractiveObjectActionInput(CoreInteractiveObject associatedInteractiveObject, ProjectileDeflectionTrackingInteractiveObjectAction projectileDeflectionTrackingInteractiveObjectActionRef, DeflectingProjectileInteractiveObjectActionInherentData DeflectingProjectileInteractiveObjectActionInherentData) { AssociatedInteractiveObject = associatedInteractiveObject; ProjectileDeflectionTrackingInteractiveObjectActionRef = projectileDeflectionTrackingInteractiveObjectActionRef; this.DeflectingProjectileInteractiveObjectActionInherentData = DeflectingProjectileInteractiveObjectActionInherentData; }
public TrackUnknownStateManager(CoreInteractiveObject associatedInteractiveObject, SoldierAIBehaviorDefinition SoldierAIBehaviorDefinition, SoldierAIBehaviorExternalCallbacksV2 SoldierAIBehaviorExternalCallbacksV2, Action AskTrackUnknownStateManagerToExitAction) { this._trackUnknownStateBehavior = new TrackUnknownStateBehavior(); this._trackUnknownStateBehavior.Init(associatedInteractiveObject, SoldierAIBehaviorDefinition, SoldierAIBehaviorExternalCallbacksV2, AskTrackUnknownStateManagerToExitAction); }
private void OnTrackedInteractiveObjectDestroyed(CoreInteractiveObject trackedInteractiveObject) { List <RangeIntersectionCalculator> RangeIntersectionCalculatorsToDestroy = null; for (var i = 0; i < this.AllRangeIntersectionCalculatorV2.Count; i++) { var currentIntersectionCalculator = this.AllRangeIntersectionCalculatorV2[i]; if (currentIntersectionCalculator.TrackedInteractiveObject == trackedInteractiveObject) { if (RangeIntersectionCalculatorsToDestroy == null) { RangeIntersectionCalculatorsToDestroy = new List <RangeIntersectionCalculator>(); } RangeIntersectionCalculatorsToDestroy.Add(currentIntersectionCalculator); } } if (RangeIntersectionCalculatorsToDestroy != null) { foreach (var rangeIntersectionCalculatorToDestroy in RangeIntersectionCalculatorsToDestroy) { rangeIntersectionCalculatorToDestroy.OnDestroy(); this.AllRangeIntersectionCalculatorV2.Remove(rangeIntersectionCalculatorToDestroy); } } }
/// <summary> /// Calculates the initial orientation and position of a <see cref="FiredProjectile"/>. /// It is used by WeaponHandlingSystems when <see cref="CoreInteractiveObject.AskToFireAFiredProjectile_ToTargetPoint"/> /// </summary> public static void CalculateProjectilePath_ToTargetPoint(CoreInteractiveObject WeaponHolder, CoreInteractiveObject Target, out Vector3 StartWorldPosition, out Quaternion StartOrientation) { StartWorldPosition = WeaponHolder.GetWeaponWorldFirePoint(); var firingTargetWorldLocation = Target.InteractiveGameObject.GetLocalToWorld().MultiplyPoint(Target.GetFiringTargetLocalPosition()); StartOrientation = Quaternion.LookRotation((firingTargetWorldLocation - StartWorldPosition).normalized); }
public AIMoveToActionV2(CoreInteractiveObject InteractiveObject, TransformStruct WorldPoint, AIMovementSpeedDefinition AIMovementSpeed, Func <List <ASequencedAction> > nextActionsDeffered) : base(nextActionsDeffered) { this.destinationReached = false; this.InteractiveObject = InteractiveObject; this.WorldPoint = WorldPoint; this.AIMovementSpeed = AIMovementSpeed; }
public void OnInteractiveObjectJustOutOfSight(CoreInteractiveObject NotInSightInteractiveObject) { if (NotInSightInteractiveObject.InteractiveObjectTag.IsPlayer) { this.IsPlayerInSight.SetValue(false); this.OnPlayerObjectJustOutOfSightAction.Invoke(NotInSightInteractiveObject); } }
public void CreateLineFollowing(DottedLineID DottedLineID, CoreInteractiveObject TargetInteractiveGameObject) { sourceTriggeringInteractiveObjects.Add(TargetInteractiveGameObject); lines.Add(new DottedLine(DottedLineID)); var targetGameObject = TargetInteractiveGameObject.InteractiveGameObject; linePositionings.Add(new LineFollowTransformPositioning(targetGameObject.InteractiveGameObjectParent.transform, targetGameObject.AverageModelBounds)); }
public Weapon(IInteractiveGameObject IInteractiveGameObject, WeaponDefinition WeaponDefinition, CoreInteractiveObject weaponHolder) { this.WeaponHolder = weaponHolder; this.BaseInit(IInteractiveGameObject, true); this.FiringProjectileSystem = new FiringProjectileSystem(this, WeaponDefinition); this.WeaponPositioningSystem = new WeaponPositioningSystem(this, this.WeaponHolder); }
private void OnTriggerEnter(CoreInteractiveObject Other) { if (AssociatedInteractiveObjectRef != Other) { Other.DealDamage(-1 * this._damageDealerEmitterSystemDefinition.Damage, this.AssociatedInteractiveObjectRef); this.OnDamageDealtToOtherAction?.Invoke(Other); } }
public TrackAndKillPlayerStateManager(CoreInteractiveObject AssociatedInteractiveObject, SoldierAIBehaviorDefinition SoldierAIBehaviorDefinition, PlayerObjectStateDataSystem PlayerObjectStateDataSystem, SoldierAIBehaviorExternalCallbacksV2 SoldierAIBehaviorExternalCallbacksV2, Action AskTrackAndKillPlayerStateBehaviorExitAction) { this._trackAndKillPlayerStateBehavior = new TrackAndKillPlayerStateBehavior(); this._trackAndKillPlayerStateBehavior.Init(AssociatedInteractiveObject, SoldierAIBehaviorDefinition, PlayerObjectStateDataSystem, SoldierAIBehaviorExternalCallbacksV2, AskTrackAndKillPlayerStateBehaviorExitAction); }
public DashPathCalculationSystem(CoreInteractiveObject associatedInteractiveObject, PlayerDashTeleportationDirectionActionDefinition DashTeleportationDirectionActionDefinition, TargetCursorManager targetCursorManagerRef, Camera mainCamera) : this() { AssociatedInteractiveObject = associatedInteractiveObject; this.DashTeleportationDirectionActionDefinition = DashTeleportationDirectionActionDefinition; TargetCursorManagerRef = targetCursorManagerRef; MainCamera = mainCamera; }
public void OnInteractiveObjectJustOutsideDeflectionRange(CoreInteractiveObject OutsideInteractiveObject) { if (ProjectileDeflectionFeedbackIcons.ContainsKey(OutsideInteractiveObject)) { this.ProjectileDeflectionFeedbackIcons[OutsideInteractiveObject].Destroy(); this.ProjectileDeflectionFeedbackIcons.Remove(OutsideInteractiveObject); } }
public InteractiveObjectActionPlayerSystem(CoreInteractiveObject AssociatedInteractiveObject) { this.interactiveObjectActionExecutionManager = new InteractiveObjectActionExecutionManager(); this.interactiveObjectActionExecutionManager.Init(); this.AssociatedInteractiveObject = AssociatedInteractiveObject; AssociatedInteractiveObject.RegisterInteractiveObjectDestroyedEventListener(this.OnAssociatedInteractiveObjectDestroyed); }
public PlayerOnLowHealthVisualEffectSystem(CoreInteractiveObject AssociatedInteractiveObject, PlayerVisualEffectSystemDefinition PlayerVisualEffectSystemDefinition) : this() { this.AssociatedInteractiveObject = AssociatedInteractiveObject; this.PlayerVisualEffectSystemDefinition = PlayerVisualEffectSystemDefinition; this.PlayerBodyRenderer = this.AssociatedInteractiveObject.InteractiveGameObject.Animator.gameObject.FindChildObjectRecursively("Body").GetComponent <Renderer>(); this.ResetPlayerEmissionColor(); }
public void OnInteractiveObjectTargetted(CoreInteractiveObject CoreInteractiveObject) { if (CoreInteractiveObject != null && !CoreInteractiveObject.IsAskingToBeDestroyed) { this.CurrentlyTargettedInteractiveObject.SetValue(CoreInteractiveObject); this.UpdateTargetPlanePosition(); } }
public void OnProjectileLaunched(CoreInteractiveObject projectile, Weapon.Weapon sourceWeapon) { if (this.EnemyObject == sourceWeapon.WeaponHolder) { this.SpawnedProjectile = projectile; this.SpawnedProjectile.RegisterInteractiveObjectDestroyedEventListener((CoreInteractiveObject) => this.SpawnedProjectile = null); this.Tick(0f); } }
/// <summary> /// <see cref="FiredProjectile"/> deflection also check if the object is deflectable <see cref="AskIfProjectileCanBeDeflected"/>. By design, /// it should not be useful because the DeflectionSystem (the caller of <see cref="InteractiveObjectDeflected"/>) already check this condition. But this is added here for safety. /// </summary> public override void InteractiveObjectDeflected(CoreInteractiveObject DelfectionActorObject) { if (this.AskIfProjectileCanBeDeflected(DelfectionActorObject)) { DeflectionCalculations.ForwardDeflection(DelfectionActorObject, this); HealthGlobeSpawnCalculation.HealthGlobeSpawn(DelfectionActorObject, this.FiredProjectileDefinition.ProjectileDeflectedProperties.HealthGlobeRecoveryDefinition); // DelfectionActorObject.OnRecoverHealth(this.FiredProjectileDefinition.ProjectileDeflectedProperties.HealthRecovered); } }
public override ASequencedAction[] AIPatrolGraphActions(CoreInteractiveObject InvolvedInteractiveObject, AIPatrolGraphRuntimeCallbacks AIPatrolGraphRuntimeCallbacks) { return(new ASequencedAction[] { CreateAIWarpAction(InvolvedInteractiveObject, this.StandingStillPoint) .Then(new AIWarpActionV2(InvolvedInteractiveObject, this.StandingStillPoint.WorldPosition, this.StandingStillPoint.GetWorldRotation()) .Then(new BranchInfiniteLoopAction(CreateAIMoveToActionV2(this.StandingStillPoint, AIPatrolGraphRuntimeCallbacks)))) }); }
public AIPatrolSystem(CoreInteractiveObject AssociatedInteractiveObject, AIPatrolGraphBuilder AIPatrolGraphBuilder, Action <IAgentMovementCalculationStrategy> coreInteractiveObjectDestinationCallback = null, Action <AIMovementSpeedAttenuationFactor> aiSpeedAttenuationFactorCallback = null) { SequencedActionPlayer = new SequencedActionPlayer(AIPatrolGraphBuilder.GetPatrolGraphSequencedActions( AssociatedInteractiveObject, new AIPatrolGraphRuntimeCallbacks(coreInteractiveObjectDestinationCallback, aiSpeedAttenuationFactorCallback)), null, null); SequencedActionPlayer.Play(); }
public CoreInteractiveObject PlayerObject() { if (this.playerObject == null) { this.playerObject = PlayerInteractiveObjectManager.Get().PlayerInteractiveObject; } return(this.playerObject); }
private void OnInteractiveObjectCreated(CoreInteractiveObject CoreInteractiveObject) { if (this.InteractiveObjectSelectionGuard.Invoke(CoreInteractiveObject.InteractiveObjectTag)) { this.InteractiveObjectsListened.Add(CoreInteractiveObject, CoreInteractiveObject.InteractiveGameObject.IsVisible()); this.InteractiveObjectsOverCursorTarget.Add(CoreInteractiveObject, new BoolVariable(false, () => this.OnCursorOverObject(CoreInteractiveObject), () => { this.OnCursorNoMoveOverObject(CoreInteractiveObject); })); CoreInteractiveObject.RegisterInteractiveObjectDestroyedEventListener(this.OnInteractiveObjectDestroyed); } }
private void OnCurrentlyTargettedInteractiveObjectDestroyed(CoreInteractiveObject CoreInteractiveObject) { this.AllSelectableTargettedInteractiveObject.Remove(CoreInteractiveObject); if (CoreInteractiveObject == this.CurrentlyTargettedInteractiveObject.GetValue()) { this.CurrentlyTargettedInteractiveObject.SetValue(null); } }
public override void DamageDealt(CoreInteractiveObject damageDealerInteractiveObject) { base.DamageDealt(damageDealerInteractiveObject); var TargetWorldPositionNavMehshit = this.GetTargetWorldPositionNavMehshit(); this.ISetAIAgentDestinationActionCallback.SetAIAgentSpeedAttenuationAction.Invoke(AIMovementSpeedAttenuationFactor.RUN); this.ISetAIAgentDestinationActionCallback.SetAIAgentDestinationAction.Invoke(new ForwardAgentMovementCalculationStrategy(new AIDestination(TargetWorldPositionNavMehshit.position, null))); }
public AIMoveToDestinationSystem(CoreInteractiveObject CoreInteractiveObject, TransformMoveManagerComponentV3 AITransformMoveManagerComponentV3, OnAIInteractiveObjectDestinationReachedDelegate OnAIInteractiveObjectDestinationReached = null) { this.IsEnabled = true; this.objectAgent = CoreInteractiveObject.InteractiveGameObject.Agent; this.AITransformMoveManagerComponentV3 = AITransformMoveManagerComponentV3; this.aiPositionMoveManager = new AIPositionMoveManager(this.objectAgent, () => this.A_AIRotationMoveManager.CurrentLookingTargetRotation, AITransformMoveManagerComponentV3); this.AIDestinationManager = new AIDestinationManager(this.objectAgent, OnAIInteractiveObjectDestinationReached); this.A_AIRotationMoveManager = new AIRotationMoveManager(this.objectAgent, AITransformMoveManagerComponentV3, this.AIDestinationManager); }
private void OnObstacleInteractiveObjectDestroyed(CoreInteractiveObject ObstacleInteractiveObject) { for (var i = this.nearSquareObstacles.Count - 1; i >= 0; i--) { if (this.nearSquareObstacles[i] == ObstacleInteractiveObject) { this.nearSquareObstacles.RemoveAt(i); } } }
public SkillSlot(CoreInteractiveObject AssociatedInteractiveObject, InteractiveObjectActionPlayerSystem interactiveObjectActionPlayerSystem, ref SKillSlotUIPositionInput SKillSlotUIPositionInput, InputID AssociatedInput) { this.AssociatedInteractiveObject = AssociatedInteractiveObject; this._interactiveObjectActionPlayerSystem = interactiveObjectActionPlayerSystem; this.AssociatedInput = AssociatedInput; this.SkillSlotUI = new SkillSlotUI(ref SKillSlotUIPositionInput); this.CurrentPlayerActionInherentData = new ObjectVariable <InteractiveObjectActionInherentData>(this.OnCurrentPlayerActionInherentDataChanged); this.SkillSlotUI.SetInputText(InputControlLookup.GetInputControlRawName(InputControlLookup.FindTheFirstInputControlForInputID(this.AssociatedInput))); }