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); }
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); }
public void RemoveDamageInterceptor(DamageInterceptor interceptor) { damageInterceptors.Remove(interceptor); }
public void AddDamageInterceptorWithDuration(DamageInterceptor interceptor, float duration) { damageInterceptors.Add(interceptor); DoAfterDelay(() => RemoveDamageInterceptor(interceptor), duration); }
public void AddDamageInterceptor(DamageInterceptor interceptor) { damageInterceptors.Add(interceptor); }