private void SpecialPower(GameObject player, GameObject enemy, GameManagerScript gM, int currentPlayer) { switch (elementIndex) { case 0: player.GetComponent <PlayerScript>().Heal(3 * damage); break; case 1: PoisonBurnFreeze(enemy); break; case 2: PoisonBurnFreeze(enemy); break; case 3: int[] gain = new int[5]; for (int i = 0; i < 5; i++) { gain[i] = Mathf.Min(5, gM.GetPowerPoints(-currentPlayer)[i]); } for (int i = 0; i < 5; i++) { gM.AddPowerPoints(i, gain[i], currentPlayer); gM.AddPowerPoints(i, -gain[i], -currentPlayer); } break; case 4: int hpGain = enemy.GetComponent <PlayerScript>().CurrentHp; enemy.GetComponent <PlayerScript>().TakeDamage(2 * damage, elementIndex); hpGain -= enemy.GetComponent <PlayerScript>().CurrentHp; player.GetComponent <PlayerScript>().Heal(hpGain); break; default: break; } }