コード例 #1
0
        /// <summary>
        /// Initialize the modify event.
        /// </summary>
        /// <param name="timeline">The timeline this event is part of.</param>
        /// <param name="start">The start of the event.</param>
        /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
        /// <param name="move">The move to calculate impact from.</param>
        protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn, BattleMove move)
        {
            //Call the base method.
            base.Initialize(timeline, start, dependentOn);

            //Initialize the variables.
            _Move = move;
        }
コード例 #2
0
        /// <summary>
        /// Initialize the modify event.
        /// </summary>
        /// <param name="timeline">The timeline this event is part of.</param>
        /// <param name="start">The start of the event.</param>
        /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
        /// <param name="character">The character who health will be modified.</param>
        /// <param name="state">The state to change into.</param>
        protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn, Creature character, BattleState state)
        {
            //Call the base method.
            base.Initialize(timeline, start, dependentOn);

            //Initialize the variables.
            _Character = character;
            _ChangeState = state;
        }
コード例 #3
0
        /// <summary>
        /// Initialize the modify event.
        /// </summary>
        /// <param name="timeline">The timeline this event is part of.</param>
        /// <param name="start">The start of the event.</param>
        /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
        /// <param name="character">The character whos energy will be modified.</param>
        /// <param name="amount">The amount to add to the energy.</param>
        protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn, Creature character, float amount)
        {
            //Call the base method.
            base.Initialize(timeline, start, dependentOn);

            //Initialize the variables.
            _Character = character;
            _Amount = amount;
        }
コード例 #4
0
        /// <summary>
        /// Initialize the modify event.
        /// </summary>
        /// <param name="timeline">The timeline this event is part of.</param>
        /// <param name="start">The start of the event.</param>
        /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
        /// <param name="move">The move to modify.</param>
        /// <param name="character">The character whos state of control will be modified.</param>
        /// <param name="control">The new state of control.</param>
        protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn, BattleMove move, Creature character, bool control)
        {
            //Call the base method.
            base.Initialize(timeline, start, dependentOn);

            //Initialize the variables.
            _Move = move;
            _Character = character;
            _HasControl = control;
        }
コード例 #5
0
 /// <summary>
 /// Constructor for a modify event.
 /// </summary>
 /// <param name="timeline">The timeline this event is part of.</param>
 /// <param name="start">The start of the event.</param>
 /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
 /// <param name="move">The move who will be modified.</param>
 /// <param name="isCancelable">Whether the move can be cancelled or not.</param>
 public ModifyCancelableEvent(Timeline timeline, float start, TimelineEvent dependentOn, BattleMove move, bool isCancelable)
 {
     Initialize(timeline, start, dependentOn, move, isCancelable);
 }
コード例 #6
0
        /// <summary>
        /// Initialize the projectile event.
        /// </summary>
        /// <param name="timeline">The timeline this event is part of.</param>
        /// <param name="start">The start of the event.</param>
        /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
        /// <param name="position">The starting position of the projectile.</param>
        /// <param name="destination">The destination point of the projectile.</param>
        protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn, Vector2 position, Destination destination)
        {
            //Call the base method.
            base.Initialize(timeline, start, dependentOn);

            //Initialize the variables.
            _Position = position;
            _Destination = destination;
            _Projectile = new FlameProjectile(_Position, _Destination);

            //Subscribe to the projectile's collision event.
            _Projectile.OnCollision += OnProjectileCollided;
        }
コード例 #7
0
 /// <summary>
 /// Constructor for a projectile event.
 /// </summary>
 /// <param name="timeline">The timeline this event is part of.</param>
 /// <param name="start">The start of the event.</param>
 /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
 /// <param name="position">The starting position of the projectile.</param>
 /// <param name="destination">The destination point of the projectile.</param>
 public ProjectileEvent(Timeline timeline, float start, TimelineEvent dependentOn, Vector2 position, Destination destination)
 {
     Initialize(timeline, start, dependentOn, position, destination);
 }
コード例 #8
0
 /// <summary>
 /// Activate this event if the one we have been dependent upon has ended.
 /// </summary>
 /// <param name="eventRule">The event that has ended.</param>
 protected virtual void OnDependentEnded(TimelineEvent eventRule)
 {
     //Set the state to active.
     _State = TimelineState.Active;
 }
コード例 #9
0
        /// <summary>
        /// Initialize the timeline event.
        /// </summary>
        /// <param name="timeline">The timeline this event is part of.</param>
        /// <param name="start">The start of the event.</param>
        /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
        protected virtual void Initialize(Timeline timeline, float start, TimelineEvent dependentOn)
        {
            //Initialize the variables.
            _Timeline = timeline;
            _StartTime = start;
            _EndTime = start;
            _DependentOn = dependentOn;
            _Outcome = EventOutcome.None;
            _State = TimelineState.Idle;

            //If this event is dependent upon someone else, subscribe to it.
            if (_DependentOn != null) { _DependentOn.OnConcluded += OnDependentEnded; }
        }
コード例 #10
0
 /// <summary>
 /// Constructor for a recoil event.
 /// </summary>
 /// <param name="timeline">The timeline this event is part of.</param>
 /// <param name="start">The start of the event.</param>
 /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
 /// <param name="move">The move to calculate impact from.</param>
 public ImpactEvent(Timeline timeline, float start, TimelineEvent dependentOn, BattleMove move)
 {
     Initialize(timeline, start, dependentOn, move);
 }
コード例 #11
0
 /// <summary>
 /// Constructor for a modify event.
 /// </summary>
 /// <param name="timeline">The timeline this event is part of.</param>
 /// <param name="start">The start of the event.</param>
 /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
 /// <param name="character">The character who health will be modified.</param>
 /// <param name="state">The state to change into.</param>
 public ModifyStateEvent(Timeline timeline, float start, TimelineEvent dependentOn, Creature character, BattleState state)
 {
     Initialize(timeline, start, dependentOn, character, state);
 }
コード例 #12
0
 /// <summary>
 /// Constructor for a modify event.
 /// </summary>
 /// <param name="timeline">The timeline this event is part of.</param>
 /// <param name="start">The start of the event.</param>
 /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
 /// <param name="character">The character whos energy will be modified.</param>
 /// <param name="amount">The amount to add to the energy.</param>
 public ModifyEnergyEvent(Timeline timeline, float start, TimelineEvent dependentOn, Creature character, float amount)
 {
     Initialize(timeline, start, dependentOn, character, amount);
 }
コード例 #13
0
 /// <summary>
 /// Constructor for a modify event.
 /// </summary>
 /// <param name="timeline">The timeline this event is part of.</param>
 /// <param name="start">The start of the event.</param>
 /// <param name="dependentOn">An optional event to be dependent upon, ie. wait for.</param>
 /// <param name="move">The move to modify.</param>
 /// <param name="character">The character whos state of control will be modified.</param>
 /// <param name="control">The new state of control.</param>
 public ModifyControlEvent(Timeline timeline, float start, TimelineEvent dependentOn, BattleMove move, Creature character, bool control)
 {
     Initialize(timeline, start, dependentOn, move, character, control);
 }
コード例 #14
0
ファイル: Timeline.cs プロジェクト: LaudableBauble/Insipidus
 /// <summary>
 /// An event has been concluded, see if the timeline has ended with it.
 /// </summary>
 /// <param name="e">The event that has been concluded.</param>
 private void OnEventConcluded(TimelineEvent e)
 {
     //If this was the last active event, conclude the timeline.
     if (!_Events.Exists(item => item.State != TimelineState.Concluded)) { Stop(); }
 }
コード例 #15
0
ファイル: Timeline.cs プロジェクト: LaudableBauble/Insipidus
 /// <summary>
 /// Add an event to the timeline.
 /// </summary>
 /// <param name="eventRule">The event to add.</param>
 public void AddEvent(TimelineEvent eventRule)
 {
     //Add the event and subscribe to its events.
     _Events.Add(eventRule);
     eventRule.OnConcluded += OnEventConcluded;
 }