public override bool Cast(ISpellParams parameters) { SpellTargetParams projectileParameters = (SpellTargetParams)parameters; Instantiate(gameObject, projectileParameters.source + Vector3.back * .6F, gameObject.transform.rotation, Mage.instance.spellAnchor).GetComponent <SpellProjectile>().target = projectileParameters.destination; return(true); }
public override bool Cast(ISpellParams parameters) { if (Mage.instance.GetHealth() >= 1F) { return(false); } Mage.instance.Heal(healAmount); return(base.Cast(parameters)); }
public override bool Cast(ISpellParams parameters) { SpellGroundParams groundParams = (SpellGroundParams)parameters; foreach (Vector3 point in groundParams.positions) { Instantiate(gameObject, point, gameObject.transform.rotation, Mage.instance.spellAnchor); } return(true); }
public override bool Cast(ISpellParams parameters) { for (int i = 0; i < shockwaveVectors; i++) { // Create objects targetting a circle around the player SpellSelfShockwave spell = Instantiate(gameObject, Mage.instance.transform.position, transform.rotation, Mage.instance.spellAnchor).GetComponent <SpellSelfShockwave>(); spell.target = Mage.instance.transform.position + new Vector3(shockwaveDistance * Mathf.Cos(2 * Mathf.PI * i / shockwaveVectors), shockwaveDistance * Mathf.Sin(2 * Mathf.PI * i / shockwaveVectors), 0F); } return(true); }
private void CastSpell(SpellTargetType type, ISpellParams parameters) { ElementType element = GetSelectedElement(); ISpell spell = FindSpell(element, type); if (spell != null && GetElementCharge(element) >= spell.GetCost()) { if (spell.Cast(parameters)) { elementCharge[element] = GetElementCharge(element) - spell.GetCost(); ClearElements(); } } }
public override bool Cast(ISpellParams parameters) { SpellTargetParams targetParams = (SpellTargetParams)parameters; Transform t = Instantiate(gameObject).transform; t.GetComponent <SpellAttach>().target = targetParams.destination; if (immobilizeEnemy) { IEnemy enemy = targetParams.destination.GetComponent <IEnemy>(); if (enemy != null) { enemy.AddImmobilizedAgent(t); } } return(true); }
public override bool Cast(ISpellParams parameters) { Instantiate(gameObject, Mage.instance.transform, false); return(true); }
public abstract bool Cast(ISpellParams parameters);