feat: add buff at the end of levels

This commit is contained in:
Renge 2022-04-25 21:43:57 -04:00
parent 435157b192
commit 3d4894fb60

View File

@ -382,16 +382,25 @@ export default class GameLevel extends Scene {
(<PlayerController>this.player._ai).addBuff(this.buffs[0]); (<PlayerController>this.player._ai).addBuff(this.buffs[0]);
this.buffLayer.disable(); this.buffLayer.disable();
this.setGameState(); this.setGameState();
if (this.levelEnded) {
this.goToNextLevel();
}
break; break;
case "buff2": case "buff2":
(<PlayerController>this.player._ai).addBuff(this.buffs[1]); (<PlayerController>this.player._ai).addBuff(this.buffs[1]);
this.buffLayer.disable(); this.buffLayer.disable();
this.setGameState(); this.setGameState();
if (this.levelEnded) {
this.goToNextLevel();
}
break; break;
case "buff3": case "buff3":
(<PlayerController>this.player._ai).addBuff(this.buffs[2]); (<PlayerController>this.player._ai).addBuff(this.buffs[2]);
this.buffLayer.disable(); this.buffLayer.disable();
this.setGameState(); this.setGameState();
if (this.levelEnded) {
this.goToNextLevel();
}
break; break;
} }
} }
@ -1090,7 +1099,7 @@ export default class GameLevel extends Scene {
this.storytextLabel = undefined; this.storytextLabel = undefined;
// this.storyLayer = undefined; // this.storyLayer = undefined;
if (this.levelEnded) { if (this.levelEnded) {
this.goToNextLevel(); this.emitter.fireEvent(Player_Events.GIVE_SPECIAL_BUFF, {});
} }
} }
} }