package de.miaurizius.jgame2d.entity.item;

import de.miaurizius.jgame2d.core.GamePanel;
import de.miaurizius.jgame2d.core.enums.EntityType;
import de.miaurizius.jgame2d.core.enums.GameState;
import de.miaurizius.jgame2d.entity.Entity;

public class TentObj extends Entity {

    public TentObj(GamePanel panel) {
        super(panel);

        type = EntityType.ITEM;
        consumable = true;
        name = "Tent";
        down1 = initEntitySprites("objects/tent");
        description = "[" + name + "]\nA small tent to rest\nuntil next morning.";
        price = 200;
        stackable = true;
    }

    @Override
    public boolean use(Entity entity) {
        panel.gameState = GameState.SLEEP;
        panel.playSE(14);
        panel.player.life = panel.player.maxLife;
        panel.player.mana = panel.player.maxMana;
        panel.player.getSleepingImage(down1);
        return true;
    }
}
