/// <summary> /// Increases magic and updates the grimoire /// </summary> /// <param name="amountToIncr">The amount to increase magic by</param> private void IncreaseMagic(int amountToIncr) { // Don't bother if we aren't increasing anything if (amountToIncr <= 0) { return; } _magic += amountToIncr; // Increase the literal stat // Call the magic increase from this character's grimoire _grimRef.MagicIncrease(); }
// Called before the first frame // Initialize some variables private void Start() { // Basic attack should already be on every ally, so add that skill as the first one _availableSkills.Add(this.GetComponent <BasicAttack>()); // Set the default first skill to basic attack SetSkill(_availableSkills[0]); _availableSkills[0].EquipSkill(); _specialActive = false; // Check if this character should start out with any skills by calling Grimoire's Magic increase AllyGrimoire myGrim = this.GetComponent <AllyGrimoire>(); if (myGrim != null) { myGrim.MagicIncrease(); } else { Debug.Log("There is no Grimoire attached to " + this.name); } }