Stage Auto leveling

main
Brett 2023-03-03 15:08:01 -05:00
parent 295049702f
commit b087a47015
1 changed files with 3 additions and 0 deletions

View File

@ -62,6 +62,9 @@ public abstract class Building {
public void upgrade(Stage stage) { public void upgrade(Stage stage) {
this.stage = stage; this.stage = stage;
this.health += stage.dHealth; this.health += stage.dHealth;
// evil hack
String name = stage.getClass().getSimpleName();
this.level = Integer.parseInt(name.charAt(name.length()-1) + "") - 1;
// interact with the timer regarding Upgrade time // interact with the timer regarding Upgrade time
} }