コード例 #1
0
 public AIMoveToDestinationSystem(CoreInteractiveObject CoreInteractiveObject, AbstractAIInteractiveObjectInitializerData AIInteractiveObjectInitializerData,
                                  OnAIInteractiveObjectDestinationReachedDelegate OnAIInteractiveObjectDestinationReached)
 {
     this.IsEnabled           = true;
     AIDestinationMoveManager = new AIDestinationMoveManager(CoreInteractiveObject.InteractiveGameObject.Agent, AIInteractiveObjectInitializerData, OnAIInteractiveObjectDestinationReached);
     AISpeedEventDispatcher   = new AISpeedEventDispatcher(CoreInteractiveObject, AIInteractiveObjectInitializerData);
 }
コード例 #2
0
 private void OnInteractiveObjectDestroyed(CoreInteractiveObject destroyedInteractiveObject)
 {
     if (destroyedInteractiveObject == this.CurrentlyTargettedInteractiveObject.GetValue())
     {
         this.CurrentlyTargettedInteractiveObject.SetValue(null);
     }
 }
コード例 #3
0
 public void OnInteractiveObjectTargetted(CoreInteractiveObject targettedInteractiveobject)
 {
     if (targettedInteractiveobject != null && !targettedInteractiveobject.IsAskingToBeDestroyed)
     {
         this.CurrentlyTargettedInteractiveObject.SetValue(targettedInteractiveobject);
     }
 }
コード例 #4
0
        /// <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);
        }
コード例 #5
0
 public DeflectingProjectileInteractiveObjectActionInput(CoreInteractiveObject associatedInteractiveObject, ProjectileDeflectionTrackingInteractiveObjectAction projectileDeflectionTrackingInteractiveObjectActionRef,
                                                         DeflectingProjectileInteractiveObjectActionInherentData DeflectingProjectileInteractiveObjectActionInherentData)
 {
     AssociatedInteractiveObject = associatedInteractiveObject;
     ProjectileDeflectionTrackingInteractiveObjectActionRef       = projectileDeflectionTrackingInteractiveObjectActionRef;
     this.DeflectingProjectileInteractiveObjectActionInherentData = DeflectingProjectileInteractiveObjectActionInherentData;
 }
コード例 #6
0
 public TrackUnknownStateManager(CoreInteractiveObject associatedInteractiveObject, SoldierAIBehaviorDefinition SoldierAIBehaviorDefinition,
                                 SoldierAIBehaviorExternalCallbacksV2 SoldierAIBehaviorExternalCallbacksV2,
                                 Action AskTrackUnknownStateManagerToExitAction)
 {
     this._trackUnknownStateBehavior = new TrackUnknownStateBehavior();
     this._trackUnknownStateBehavior.Init(associatedInteractiveObject, SoldierAIBehaviorDefinition, SoldierAIBehaviorExternalCallbacksV2, AskTrackUnknownStateManagerToExitAction);
 }
コード例 #7
0
        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);
                }
            }
        }
コード例 #8
0
        /// <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);
        }
コード例 #9
0
 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;
 }
コード例 #10
0
 public void OnInteractiveObjectJustOutOfSight(CoreInteractiveObject NotInSightInteractiveObject)
 {
     if (NotInSightInteractiveObject.InteractiveObjectTag.IsPlayer)
     {
         this.IsPlayerInSight.SetValue(false);
         this.OnPlayerObjectJustOutOfSightAction.Invoke(NotInSightInteractiveObject);
     }
 }
コード例 #11
0
        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));
        }
コード例 #12
0
        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);
        }
コード例 #13
0
 private void OnTriggerEnter(CoreInteractiveObject Other)
 {
     if (AssociatedInteractiveObjectRef != Other)
     {
         Other.DealDamage(-1 * this._damageDealerEmitterSystemDefinition.Damage, this.AssociatedInteractiveObjectRef);
         this.OnDamageDealtToOtherAction?.Invoke(Other);
     }
 }
コード例 #14
0
 public TrackAndKillPlayerStateManager(CoreInteractiveObject AssociatedInteractiveObject, SoldierAIBehaviorDefinition SoldierAIBehaviorDefinition,
                                       PlayerObjectStateDataSystem PlayerObjectStateDataSystem,
                                       SoldierAIBehaviorExternalCallbacksV2 SoldierAIBehaviorExternalCallbacksV2,
                                       Action AskTrackAndKillPlayerStateBehaviorExitAction)
 {
     this._trackAndKillPlayerStateBehavior = new TrackAndKillPlayerStateBehavior();
     this._trackAndKillPlayerStateBehavior.Init(AssociatedInteractiveObject, SoldierAIBehaviorDefinition, PlayerObjectStateDataSystem, SoldierAIBehaviorExternalCallbacksV2, AskTrackAndKillPlayerStateBehaviorExitAction);
 }
コード例 #15
0
 public DashPathCalculationSystem(CoreInteractiveObject associatedInteractiveObject,
                                  PlayerDashTeleportationDirectionActionDefinition DashTeleportationDirectionActionDefinition, TargetCursorManager targetCursorManagerRef, Camera mainCamera) : this()
 {
     AssociatedInteractiveObject = associatedInteractiveObject;
     this.DashTeleportationDirectionActionDefinition = DashTeleportationDirectionActionDefinition;
     TargetCursorManagerRef = targetCursorManagerRef;
     MainCamera             = mainCamera;
 }
コード例 #16
0
 public void OnInteractiveObjectJustOutsideDeflectionRange(CoreInteractiveObject OutsideInteractiveObject)
 {
     if (ProjectileDeflectionFeedbackIcons.ContainsKey(OutsideInteractiveObject))
     {
         this.ProjectileDeflectionFeedbackIcons[OutsideInteractiveObject].Destroy();
         this.ProjectileDeflectionFeedbackIcons.Remove(OutsideInteractiveObject);
     }
 }
コード例 #17
0
        public InteractiveObjectActionPlayerSystem(CoreInteractiveObject AssociatedInteractiveObject)
        {
            this.interactiveObjectActionExecutionManager = new InteractiveObjectActionExecutionManager();
            this.interactiveObjectActionExecutionManager.Init();

            this.AssociatedInteractiveObject = AssociatedInteractiveObject;
            AssociatedInteractiveObject.RegisterInteractiveObjectDestroyedEventListener(this.OnAssociatedInteractiveObjectDestroyed);
        }
コード例 #18
0
        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();
        }
コード例 #19
0
 public void OnInteractiveObjectTargetted(CoreInteractiveObject CoreInteractiveObject)
 {
     if (CoreInteractiveObject != null && !CoreInteractiveObject.IsAskingToBeDestroyed)
     {
         this.CurrentlyTargettedInteractiveObject.SetValue(CoreInteractiveObject);
         this.UpdateTargetPlanePosition();
     }
 }
コード例 #20
0
 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);
     }
 }
コード例 #21
0
 /// <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);
     }
 }
コード例 #22
0
 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))))
     });
 }
コード例 #23
0
 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();
 }
コード例 #24
0
        public CoreInteractiveObject PlayerObject()
        {
            if (this.playerObject == null)
            {
                this.playerObject = PlayerInteractiveObjectManager.Get().PlayerInteractiveObject;
            }

            return(this.playerObject);
        }
コード例 #25
0
 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);
     }
 }
コード例 #26
0
        private void OnCurrentlyTargettedInteractiveObjectDestroyed(CoreInteractiveObject CoreInteractiveObject)
        {
            this.AllSelectableTargettedInteractiveObject.Remove(CoreInteractiveObject);

            if (CoreInteractiveObject == this.CurrentlyTargettedInteractiveObject.GetValue())
            {
                this.CurrentlyTargettedInteractiveObject.SetValue(null);
            }
        }
コード例 #27
0
        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)));
        }
コード例 #28
0
 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);
 }
コード例 #29
0
 private void OnObstacleInteractiveObjectDestroyed(CoreInteractiveObject ObstacleInteractiveObject)
 {
     for (var i = this.nearSquareObstacles.Count - 1; i >= 0; i--)
     {
         if (this.nearSquareObstacles[i] == ObstacleInteractiveObject)
         {
             this.nearSquareObstacles.RemoveAt(i);
         }
     }
 }
コード例 #30
0
        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)));
        }