示例#1
0
 /// <summary>
 /// Begins executing of this action. After it is executed, it will be considered ended.
 /// </summary>
 public void Execute()
 {
     currentPhase = Phase.Execute;
     StratusDebug.Log("Now executing", User);
     this.currentPhaseSequence = StratusActions.Sequence(this.User);
     StratusActions.Delay(this.currentPhaseSequence, this.Timers.execute);
     StratusActions.Call(this.currentPhaseSequence, () => this.OnExecute(this.User, this.Target));
     StratusActions.Call(this.currentPhaseSequence, () => Inform <ExecuteEvent>());
     StratusActions.Call(this.currentPhaseSequence, () => this.End(this.User));
 }
        /// <summary>
        /// Triggers this action, signaling that it is ready to be executed.
        /// </summary>
        /// <param name="user"></param>
        public void Trigger(StratusCombatController user, StratusCombatController target)
        {
            currentPhase = Phase.Trigger;

            // Inform the skill is ready to be triggered
            this.currentPhaseSequence = StratusActions.Sequence(this.User.behaviour);
            StratusActions.Call(this.currentPhaseSequence, () => Inform <TriggerEvent>(), Timers.trigger);
            // The action is now finished updating
            isFinished = true;
            // Invoke the trigger
            this.OnTrigger(user, target);
        }
        /// <summary>
        /// After getting in range of the target, starts the action. It will begin casting it.
        /// </summary>
        /// <param name="user">The controller who will be running this action.</param>
        /// <param name="target"></param>
        protected void Start(StratusCombatController user, StratusCombatController target)
        {
            currentPhase = Phase.Started;
            //Trace.Script("Starting", user);

            // Called the first time the action is about to start casting
            //this.OnStart(user, target);
            // Inform the controller the the action has started casting
            this.currentPhaseSequence = StratusActions.Sequence(this.User.behaviour);
            StratusActions.Call(this.currentPhaseSequence, () => Inform <StartedEvent>());
            StratusActions.Delay(this.currentPhaseSequence, Timers.start);
            StratusActions.Call(this.currentPhaseSequence, () => this.OnStart(user, target));
            StratusActions.Call(this.currentPhaseSequence, () =>
            {
                currentPhase = Phase.Casting;
            });
            //Actions.Property(seq, () => this.CurrentPhase, Phase.Casting, 0f, Ease.Linear);
        }
示例#4
0
        void OnTransitionEvent(TransitionEvent e)
        {
            // If there's a mask, change to it
            if (e.mask)
            {
                this.maskTexture = e.mask;
            }
            // Set the initial value instantly
            maskValue = e.initialValue;
            // Create a sequence for the transition
            currentSeq?.Cancel();
            currentSeq = StratusActions.Sequence(this);
            StratusActions.Property(currentSeq, () => maskValue, e.endingValue, e.speed, Ease.Linear);

            // If the transition is of a fixed duration
            if (e.duration > 0.0f)
            {
                StratusActions.Delay(currentSeq, e.duration);
                StratusActions.Property(currentSeq, () => maskValue, e.initialValue, e.speed, Ease.Linear);
            }
        }