private void DealRadialDamage(AbilityParamaters useParams) { RaycastHit[] hits = Physics.SphereCastAll( transform.position, config.GetRadius(), Vector3.forward, config.GetRadius() ); foreach (RaycastHit hit in hits) { var damageable = hit.collider.gameObject.GetComponent <IDamageable>(); if (damageable != null) { if (hit.collider.gameObject.layer != PLAYER_LAYER) { float damageToDeal = config.GetPerTargetDamage() + useParams.baseDamage; damageable.TakeDamage(damageToDeal); } } } }
public void Use(AbilityParamaters useParams) { player.ReceiveHealth(config.HealAmount()); PlayerParticalEffect(); PlayAudio(); }
public void Use(AbilityParamaters useParams) { combatController.SetWeaponDamage(useParams.baseDamage + config.GetExtraDamage()); PlayerParticalEffect(); PlayAudio(); }
public void Use(AbilityParamaters useParams) { DealRadialDamage(useParams); PlayerParticalEffect(); PlayAudio(); }
public void Use(AbilityParamaters useParams) { behavior.Use(useParams); }