package org.project.entity.enemies;

import org.project.item.weapons.BoneHarpoon;
import org.project.item.weapons.Weapon;

import java.util.Random;

// TODO: UPDATE IMPLEMENTATION
public class Skeleton extends Enemy implements Key {
    private static int DEFAULT_HP = 100;
    private static int DEFAULT_MP = 100;
    private static BoneHarpoon DEFAULT_WEAPON = new BoneHarpoon();
    private static int DEFAULT_HEAL_MANA_COST = 30;
    private static int DEFAULT_DEFEND_MANA_COST = 20;
    private static int keysRemaining = 1;
    private boolean hasKey = false;

    public Skeleton() {
        super(DEFAULT_HP, DEFAULT_MP, DEFAULT_WEAPON,
                DEFAULT_HEAL_MANA_COST, DEFAULT_DEFEND_MANA_COST);
    }

    public Skeleton(String name, int hp, int mp, Weapon weapon,
                  int healManaCost, int defendManaCost) {
        super(hp, mp, weapon, healManaCost, defendManaCost);
    }

    @Override
    public String getType() {
        return "Skeleton" ;
    }

    @Override
    public boolean generateKey() {
        if (keysRemaining > 0) {
            Random random = new Random();
            int dice = random.nextInt(5);
            if (dice == 1) {
                decreaseKey();
                return true;
            }
        }
        return false;
    }

    @Override
    public void decreaseKey() {
        keysRemaining -= 1;
    }

    @Override
    public int getKeysRemaining() {
        return keysRemaining;
    }
    // TODO: DESIGN ENEMY AND IMPLEMENT THE CONSTRUCTOR
}
