package org.project.entity.players;

import org.project.entity.Entity;
import org.project.entity.enemies.Enemy;
import org.project.item.armors.Armor;
import org.project.item.weapons.Weapon;

public class Assassin extends Player{
    public Assassin(String name, Weapon weapon, Armor armor) {
        super(name, 40, 50, weapon, armor, 40, 50);
    }

    //turns invisible and saves an attack for the next turn
    @Override
    public boolean specialAbility(Player player, Enemy target) {
        //checks if player has enough mana
        if (player.getMP() >= 15) {
            spendMP(15);
            //checks if the former move was to use the special ability
            if (isCHitOnNextTurn()) {
                target.takeDamage(player.getWeapon().getDamage() + 5);
                CHitOnNextTurn(false);
            }
            turnInvisible();
            CHitOnNextTurn(true);
            return true;
        }
        return false;
    }
}
