Esempio n. 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;
        }
        /// <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;
        }
        /// <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;
        }
        /// <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;
        }
 /// <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);
 }
        /// <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;
        }
 /// <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);
 }
Esempio n. 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;
 }
Esempio n. 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; }
        }
Esempio n. 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);
 }
Esempio n. 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);
 }
 /// <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);
 }
 /// <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);
 }
Esempio n. 14
0
 /// <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(); }
 }
Esempio n. 15
0
 /// <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;
 }