package org.project.entity.players;

import org.project.entity.Entity;


public class Assassin extends Player{

    private final int lightAttackDamage;
    private final int heavyAttackDamage;
    private final int heavyAttackMana;
    private final int healNumber;
    private final int healMana;
    private boolean invisible;

    public Assassin(String name, int hp, int mp,int maxHP,int maxMP, int lightAttackDamage, int heavyAttackDamage, int heavyAttackMana, int healNumber, int healMana){
        super(name, hp, mp, maxHP,maxMP);
        this.lightAttackDamage = lightAttackDamage  ;
        this.heavyAttackDamage = heavyAttackDamage;
        this.heavyAttackMana=heavyAttackMana ;
        this.healNumber =healNumber ;
        this.healMana=healMana ;
        this.invisible = false;
    }

    @Override
    public void SpecialAbility(Entity target) {
        if (mp >= heavyAttackMana + 10) {
            invisible = true;
            mp -= (heavyAttackMana + 10);
        }
    }

    @Override
    public void LightAttack(Entity target, int damage) {
        int dmg = invisible ? lightAttackDamage * 2 : lightAttackDamage;
        target.takeDamage(dmg);
        invisible = false;
    }

    @Override
    public void HeavyAttack(Entity target, int damage) {
        if (mp >= heavyAttackMana) {
            int dmg = invisible ? heavyAttackDamage * 2 : heavyAttackDamage;
            target.takeDamage(dmg);
            mp -= heavyAttackMana;
            invisible = false;
        }
    }

    @Override
    public void heal(int health) {
        if (mp >= healMana) {
            super.heal(healNumber);
            mp -= healMana;
        }
    }

    public int getLightAttackDamage(){
        return lightAttackDamage;
    }
    public int getHeavyAttackDamage(){
        return heavyAttackDamage;
    }
    public int getHeavyAttackMana(){
        return heavyAttackMana;
    }
    public int getHealNumber(){
        return healNumber;
    }
    public int getHealMana(){
        return healMana;
    }
}

