private void OnCollisionStay(Collision other) { if (ignoreObjs.Contains(other.gameObject)) { return; } if (other.rigidbody) { StatusEffectHandler statEffHandler; var statEffHandlerExists = statEffHandler = other.rigidbody.GetComponent <StatusEffectHandler>(); if (!statEffHandlerExists) { ignoreObjs.Add(other.rigidbody.gameObject); } var statEffData = elementToApply.StatusEffectToApply; statEffHandler.AddStatusEffect(statEffData, StatusEffectFactory.CreateStatusEffect(statEffData), statEffData.Duration, out var buff); } }
private void TryApplyStatusEffect(IDamageable hitImpactTarget) { var healthBehav = hitImpactTarget as HealthSystemBehaviour; if (healthBehav == null) { return; } var statEffData = spellElement.StatusEffectToApply; var statEff = StatusEffectFactory.CreateStatusEffect(statEffData, caster, spellElement, healthBehav.gameObject); // Delegate this over to HealthSystemBehaviour var statEffHandler = healthBehav.StatusEffectHandler; var res = statEffHandler.AddStatusEffect(statEffData, statEff , statEffData.Duration, out var buff); if (res == StatusEffectAddResult.SpellBuff) { explosionDamage = (int)Math.Round(explosionDamage * buff.Effectiveness); } }