コード例 #1
0
        public void Revive(int amount, float vulnerabilityDuartion)
        {
            if (!dead)
            {
                return;
            }
            dead = false;
            TargetManager.Instance.AddTarget(gameObject);
            Heal(amount > 0 ? amount : MaxHitpoints);
            var immune = new DamageInterceptor {
                Interceptor = (int x) => 0,
                Order       = 1
            };

            AddDamageInterceptorWithDuration(immune, vulnerabilityDuartion);
            ToggleCommonComponents(true);
        }
コード例 #2
0
        private void ApplyDebuff(Damageable target)
        {
            var interceptor = new DamageInterceptor {
                // Apply this effect pretty much last
                Order       = 10,
                Interceptor = amount => {
                    // Don't change healing
                    if (amount >= 0)
                    {
                        return(amount);
                    }
                    // Increase dmg
                    var p = (float)PercentileIncrease / 100;
                    return((int)(amount + amount * p));
                }
            };

            target.AddDamageInterceptorWithDuration(interceptor, Duration);
        }
コード例 #3
0
 public void RemoveDamageInterceptor(DamageInterceptor interceptor)
 {
     damageInterceptors.Remove(interceptor);
 }
コード例 #4
0
 public void AddDamageInterceptorWithDuration(DamageInterceptor interceptor, float duration)
 {
     damageInterceptors.Add(interceptor);
     DoAfterDelay(() => RemoveDamageInterceptor(interceptor), duration);
 }
コード例 #5
0
 public void AddDamageInterceptor(DamageInterceptor interceptor)
 {
     damageInterceptors.Add(interceptor);
 }