Added level up notifs and disabled autosave at chapter 2 starting

This commit is contained in:
thepaperpilot 2021-01-24 12:08:37 -06:00
parent 5d4558182a
commit ddd029588b

View file

@ -11,6 +11,7 @@ addLayer("flowers", {
points: new Decimal(1),
total: new Decimal(1),
xp: new Decimal(0),
lastLevel: new Decimal(1),
realTime: 0
};
},
@ -87,6 +88,16 @@ addLayer("flowers", {
if (player.tab === this.layer) {
player[this.layer].realTime += diff;
}
let jobLevel = new Decimal(getJobLevel(this.layer));
if (jobLevel.neq(player[this.layer].lastLevel)) {
doPopup("none", `Level ${jobLevel}`, "Level Up!", 3, layers[this.layer].color);
player[this.layer].lastLevel = jobLevel;
if (jobLevel.eq(10) && player.chapter === 1) {
player.chapter = 2;
player.autosave = false;
save();
}
}
},
onAddPoints(gain) {
let xpGain = gain;