package de.frajul.endlessroll.entities.tools;

import de.frajul.endlessroll.data.Vector;
import de.frajul.endlessroll.entities.DestroyEffect;
import de.frajul.endlessroll.entities.Player;
import de.frajul.endlessroll.entities.collision.geometry.Geometry;
import de.frajul.endlessroll.main.game.Timer;
import de.frajul.endlessroll.sounds.SoundManager;

/**
 * Created by Julian on 02.10.2017.
 */

public class PowerMushroom extends Tool {

    private SoundManager soundManager;

    public PowerMushroom(Vector position, SoundManager soundManager) {
        super(ToolType.POWER_MUSHROOM, position, .35f, .3f, true, true);
        animation.disable();
        this.soundManager = soundManager;
    }

    @Override
    public void onPlayerCollision(Player player, Timer timer) {
        player.startSuperPower((long) ToolType.POWER_MUSHROOM.getCurrentUpgradeValue(ToolUpgradeType.DURATION));
        soundManager.playSound(soundManager.mushroomSound);
        super.destroy(DestroyEffect.ENERGY_COLLECT);
    }

    @Override
    protected Geometry createWorldCollisionBounds() {
        return this;
    }

    @Override
    protected Geometry createPlayerCollisionBounds() {
        return this;
    }
}
