package de.miaurizius.jgame2d.tile.interactive;

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

import java.awt.*;

public class DryTreeTI extends InteractiveTile{

    GamePanel panel;

    public DryTreeTI(GamePanel panel, int col, int row) {
        super(panel, col, row);
        this.panel = panel;
        this.worldX = panel.tileSize * col;
        this.worldY = panel.tileSize * row;

        down1 = initEntitySprites("/interactive_tiles/drytree");
        destructible = true;
        life = 3;
    }

    // PRE_CONFIGURED
    public void playSE() {
        panel.playSE(11);
    }

    // GETTERS
    public boolean meetItemReq(Entity entity) {
        return entity.currentWeapon.weaponType == EntityType.WeaponType.AXE;
    }
    public InteractiveTile getDestroyedForm() {
        return new TrunkIT(panel, worldX/panel.tileSize, worldY/panel.tileSize);
    }
    public Color getParticleColor() {
        return new Color(65, 50,30);
    }
    public int getParticleSize() {
        return 6; //in pixels
    }
    public int getParticleSpeed() {
        return 1;
    }
    public int getParticleMaxLife() {
        return 20;
    }
}
