class BonusShield extends Bonus {
    constructor(name, scene, x, y, value, time, color) {
        let bonus;
        switch (value) {
            case 75:
                bonus = 'bonusShield0';
                break;
            case 125:
                bonus = 'bonusShield1';
                break;
            case 200:
                bonus = 'bonusShield2';
                break;
            default:
                bonus = 'bonusShield2';
                break;
        }
        super(name, scene, x, y, bonus, value);
        this.time = time;
        this.color = color;
    }

    useOn(robot) {
        let oldColor = robot.shield.color;
        robot.shield.increaseValueMax(this.value, this.color);
        this.scene.time.addEvent({
            delay: this.time,
            callback: () => robot.shield.decreaseValueMax(this.value, oldColor)
        });
        this.destroy();
    }
}