Implement starting musical notes

This commit is contained in:
Melledy
2025-12-05 23:24:10 -08:00
parent b7bf1fcdeb
commit cf63bc0b7e
2 changed files with 34 additions and 10 deletions

View File

@@ -179,11 +179,8 @@ public class StarTowerGame {
this.subNoteDropList.add(id);
}
// Add starting coin directly
int coin = this.getModifiers().getStartingCoin();
if (coin > 0) {
this.getRes().add(GameConstants.TOWER_COIN_ITEM_ID, coin);
}
// Add starting items
this.getModifiers().addStartingItems();
}
public Player getPlayer() {

View File

@@ -1,5 +1,6 @@
package emu.nebula.game.tower;
import emu.nebula.GameConstants;
import lombok.Getter;
/**
@@ -131,17 +132,43 @@ public class StarTowerModifiers {
}
public int getStartingCoin() {
int gold = 0;
int coin = 0;
if (this.hasGrowthNode(10103)) {
gold += 50;
coin += 50;
} if (this.hasGrowthNode(10403)) {
gold += 100;
coin += 100;
} if (this.hasGrowthNode(10702)) {
gold += 200;
coin += 200;
}
return gold;
return coin;
}
public int getStartingSubNotes() {
int subNotes = 0;
if (this.hasGrowthNode(10102)) {
subNotes += 3;
}
return subNotes;
}
public void addStartingItems() {
// Add starting coin directly
int coin = this.getStartingCoin();
if (coin > 0) {
this.getGame().getRes().add(GameConstants.TOWER_COIN_ITEM_ID, coin);
}
// Add starting subnotes
int subNotes = this.getStartingSubNotes();
for (int i = 0; i < subNotes; i++) {
int id = this.getGame().getRandomSubNoteId();
this.getGame().getItems().add(id, 1);
}
}
public void setFreeStrengthen(boolean b) {