void DoDamageCallback(Damage.Result result)
 {
     if (StatusEffect.CheckProbability(probabilty + Attack.Power.Percentage))
     {
         StatusEffect.Afflict(data, result.Target, result.Source);
     }
 }
Ejemplo n.º 2
0
 protected virtual void Death(Damage.Result result)
 {
     if (OnDeath != null)
     {
         OnDeath(result);
     }
 }
Ejemplo n.º 3
0
        protected virtual Damage.Result TakeDamage(float value, Damage.Method method, Entity cause)
        {
            if (Defense != null)
            {
                value = Defense.Sample(value);
            }

            var initialHealth = Health.Value;

            if (Health.Value > 0f)
            {
                Health.Value -= value;
            }
            else
            {
            }

            var result = new Damage.Result(value, this, method, cause);

            if (OnTookDamage != null)
            {
                OnTookDamage(result);
            }

            if (initialHealth > 0)
            {
                if (IsDead)
                {
                    Death(result);
                }
            }

            return(result);
        }
Ejemplo n.º 4
0
        protected override void Death(Damage.Result result)
        {
            Leader.Enemy.Energy.Value += Template.Deployment.Cost / 2;

            base.Death(result);

            Destroy(gameObject);
        }
Ejemplo n.º 5
0
        void OnTookDamage(Damage.Result result)
        {
            var label = Spawn();

            label.Configure();

            label.Text = result.Value.ToString();
        }
Ejemplo n.º 6
0
        void OnTookDamage(Damage.Result result)
        {
            var effect = Spawn(hit);

            if (Unit.Health.Value == 0f)
            {
                effect.transform.SetParent(null);
            }
        }
 void TookDamageCallback(Damage.Result result)
 {
     if (result.Method == Damage.Method.Contact)
     {
         if (StatusEffect.CheckProbability(probabilty))
         {
             StatusEffect.Afflict(data, result.Source, this.Entity);
         }
     }
 }
Ejemplo n.º 8
0
        void DealthCallback(Unit unit, Damage.Result result)
        {
            List.Remove(unit);

            UpdateIndexes();

            TriggerCountChanged();

            if (OnUnitDeath != null)
            {
                OnUnitDeath(unit, result);
            }
        }
Ejemplo n.º 9
0
 void OnBaseDestroyed(Damage.Result result)
 {
     DeclareDefeat();
 }
Ejemplo n.º 10
0
        private void DeathCallback(Damage.Result result)
        {
            transform.SetParent(null);

            Destroy(gameObject, 2f);
        }
Ejemplo n.º 11
0
 void UnitDoDamageCallback(Damage.Result result)
 {
     ApplyStatusEffects(result.Target);
 }
Ejemplo n.º 12
0
 void OnDeath(Damage.Result result)
 {
     Spawn(death);
 }
 void UnitDeathCallback(Unit unit, Damage.Result damage) => UpdateState();