//Enemy's Special Attack Functionality IEnumerator EnemySpecial(UnitWLevelling unit, BattleHUDWLevelling hud) { bool isDead = false; enemyUnit.unitCurrentMP -= 33; if (!enemyUnit.unitIsMagic) { isDead = unit.TakeRegDamage(enemyUnit, true); } else if (enemyUnit.unitIsMagic) { isDead = unit.TakeMagDamage(enemyUnit, true); } hud.HPFiddling(unit.unitCurrentHP); hud.MPFiddling(unit.unitCurrentMP); dialogueText.text = enemyUnit.unitName + " attacks " + unit.unitName + " for " + enemyUnit.unitAttack + "!"; yield return(new WaitForSeconds(2f)); if (isDead) { deadCheck += 1; } }
void MpRegen(UnitWLevelling unit, BattleHUDWLevelling hud) { unit.unitCurrentMP += 10; if (unit.unitCurrentMP > unit.unitMaxMP) { unit.unitCurrentMP = unit.unitMaxMP; } hud.MPFiddling(unit.unitCurrentMP); }
//Uses item if passed unit selected to use an item IEnumerator PartyUseItem(UnitWLevelling unit, BattleHUDWLevelling hud) { if (unit.unitCurrentMP >= 50) { unit.unitCurrentHP += 25; if (unit.unitCurrentHP > unit.unitMaxHP) { unit.unitCurrentHP = unit.unitMaxHP; } unit.unitCurrentMP -= 50; dialogueText.text = unit.unitName + " healed self, at least, they had better have."; } else { dialogueText.text = unit.unitName + "'s attempt to heal failed."; } hud.HPFiddling(unit.unitCurrentHP); hud.MPFiddling(unit.unitCurrentMP); yield return(new WaitForSeconds(2f)); Debug.Log(unit.unitName + " healed self"); }