mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-12 20:34:36 +01:00
Implement starting musical notes
This commit is contained in:
@@ -179,11 +179,8 @@ public class StarTowerGame {
|
|||||||
this.subNoteDropList.add(id);
|
this.subNoteDropList.add(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add starting coin directly
|
// Add starting items
|
||||||
int coin = this.getModifiers().getStartingCoin();
|
this.getModifiers().addStartingItems();
|
||||||
if (coin > 0) {
|
|
||||||
this.getRes().add(GameConstants.TOWER_COIN_ITEM_ID, coin);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package emu.nebula.game.tower;
|
package emu.nebula.game.tower;
|
||||||
|
|
||||||
|
import emu.nebula.GameConstants;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -131,17 +132,43 @@ public class StarTowerModifiers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public int getStartingCoin() {
|
public int getStartingCoin() {
|
||||||
int gold = 0;
|
int coin = 0;
|
||||||
|
|
||||||
if (this.hasGrowthNode(10103)) {
|
if (this.hasGrowthNode(10103)) {
|
||||||
gold += 50;
|
coin += 50;
|
||||||
} if (this.hasGrowthNode(10403)) {
|
} if (this.hasGrowthNode(10403)) {
|
||||||
gold += 100;
|
coin += 100;
|
||||||
} if (this.hasGrowthNode(10702)) {
|
} 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) {
|
public void setFreeStrengthen(boolean b) {
|
||||||
|
|||||||
Reference in New Issue
Block a user