//Main constructor public AbilityTest(eEquippedSlot slot, eAbilityCast aCast, int dmg, float cd, int eCost, int cCost,Sprite img) { damage = dmg; cooldown = cd; equippedSlot = slot; offCooldown = true; energy = eCost; corruption = cCost; abilityImage = img; equippedSlot = slot; cast = aCast; animationTag = DetermineAnimationTag(slot); }
//Determines what ability is being casted public AbilityTest determineAbility(eEquippedSlot ability) { switch (ability) { case eEquippedSlot.Attack1: return attack1; case eEquippedSlot.Attack2: return attack2; case eEquippedSlot.Spell1: return spell1; case eEquippedSlot.Spell2: return spell2; case eEquippedSlot.Spell3: return spell3; case eEquippedSlot.Ultimate: return ultimate; default: return null; } }
// Internal function for determing which ability is associated with which UI element private SkillBarElement DetermineHudElement(eEquippedSlot ability) { switch (ability) { case eEquippedSlot.Attack1: return playerSkillBar.Attack1; case eEquippedSlot.Attack2: return playerSkillBar.Attack2; case eEquippedSlot.Spell1: return playerSkillBar.Spell1; case eEquippedSlot.Spell2: return playerSkillBar.Spell2; case eEquippedSlot.Spell3: return playerSkillBar.Spell3; case eEquippedSlot.Ultimate: return playerSkillBar.Ultimate; default: return null; } }
public string DetermineAnimationTag(eEquippedSlot slot) { switch (slot) { case eEquippedSlot.Attack1: return "BasicAttack1"; case eEquippedSlot.Attack2: return "BasicAttack2"; case eEquippedSlot.Spell1: return "Ability1"; case eEquippedSlot.Spell2: return "Ability2"; case eEquippedSlot.Spell3: return "Ability3"; case eEquippedSlot.Ultimate: return "Ultimate"; default: return null; } }