mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-13 04:45:02 +01:00
feat: properly handle door cases and currency
This commit is contained in:
@@ -11,6 +11,7 @@ public class StarTowerStageDef extends BaseDef {
|
|||||||
private int Stage;
|
private int Stage;
|
||||||
private int Floor;
|
private int Floor;
|
||||||
private int RoomType;
|
private int RoomType;
|
||||||
|
private int InteriorCurrencyQuantity;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getId() {
|
public int getId() {
|
||||||
|
|||||||
@@ -175,15 +175,6 @@ public class StarTowerGame {
|
|||||||
// Add cases
|
// Add cases
|
||||||
this.addCase(new StarTowerCase(CaseType.Battle));
|
this.addCase(new StarTowerCase(CaseType.Battle));
|
||||||
this.addCase(new StarTowerCase(CaseType.SyncHP));
|
this.addCase(new StarTowerCase(CaseType.SyncHP));
|
||||||
|
|
||||||
// Always keep the door open
|
|
||||||
var doorCase = this.addCase(new StarTowerCase(CaseType.OpenDoor));
|
|
||||||
doorCase.setFloorId(this.getStageFloor() + 1);
|
|
||||||
|
|
||||||
var nextStage = this.getNextStageData();
|
|
||||||
if (nextStage != null) {
|
|
||||||
doorCase.setRoomType(nextStage.getRoomType());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player getPlayer() {
|
public Player getPlayer() {
|
||||||
@@ -465,12 +456,7 @@ public class StarTowerGame {
|
|||||||
.setBattleTime(this.getBattleTime());
|
.setBattleTime(this.getBattleTime());
|
||||||
|
|
||||||
// Add money
|
// Add money
|
||||||
// TODO calculate properly
|
int money = this.getStageData(this.getStageNum(), this.getStageFloor()).getInteriorCurrencyQuantity();
|
||||||
int money = Utils.randomRange(5, 15) * 10;
|
|
||||||
|
|
||||||
if (this.getRoomType() == StarTowerRoomType.BossRoom.getValue()) {
|
|
||||||
money += 100;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.addItem(GameConstants.STAR_TOWER_GOLD_ITEM_ID, money, change);
|
this.addItem(GameConstants.STAR_TOWER_GOLD_ITEM_ID, money, change);
|
||||||
|
|
||||||
@@ -492,6 +478,7 @@ public class StarTowerGame {
|
|||||||
int subNoteSkills = battleCase.getSubNoteSkillNum();
|
int subNoteSkills = battleCase.getSubNoteSkillNum();
|
||||||
this.addRandomSubNoteSkills(subNoteSkills, change);
|
this.addRandomSubNoteSkills(subNoteSkills, change);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Handle defeat
|
// Handle defeat
|
||||||
// TODO
|
// TODO
|
||||||
@@ -530,9 +517,21 @@ public class StarTowerGame {
|
|||||||
// Create potential selector
|
// Create potential selector
|
||||||
var potentialCase = this.createPotentialSelector(this.getRandomCharId());
|
var potentialCase = this.createPotentialSelector(this.getRandomCharId());
|
||||||
this.addCase(rsp.getMutableCases(), potentialCase);
|
this.addCase(rsp.getMutableCases(), potentialCase);
|
||||||
|
|
||||||
this.pendingPotentialCases--;
|
this.pendingPotentialCases--;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// Add door case
|
||||||
|
var doorCase = this.addCase(new StarTowerCase(CaseType.OpenDoor));
|
||||||
|
doorCase.setFloorId(this.getStageFloor() + 1);
|
||||||
|
|
||||||
|
var nextStage = this.getNextStageData();
|
||||||
|
if (nextStage != null) {
|
||||||
|
doorCase.setRoomType(nextStage.getRoomType());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addCase(rsp.getMutableCases(), doorCase);
|
||||||
|
}
|
||||||
|
|
||||||
return rsp;
|
return rsp;
|
||||||
}
|
}
|
||||||
@@ -579,14 +578,6 @@ public class StarTowerGame {
|
|||||||
|
|
||||||
// Add cases
|
// Add cases
|
||||||
var syncHpCase = new StarTowerCase(CaseType.SyncHP);
|
var syncHpCase = new StarTowerCase(CaseType.SyncHP);
|
||||||
var doorCase = new StarTowerCase(CaseType.OpenDoor);
|
|
||||||
doorCase.setFloorId(this.getFloor() + 1);
|
|
||||||
|
|
||||||
// Set room type of next room
|
|
||||||
var nextStage = this.getNextStageData();
|
|
||||||
if (nextStage != null) {
|
|
||||||
doorCase.setRoomType(nextStage.getRoomType());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Room proto
|
// Room proto
|
||||||
var room = rsp.getMutableEnterResp().getMutableRoom();
|
var room = rsp.getMutableEnterResp().getMutableRoom();
|
||||||
@@ -613,7 +604,21 @@ public class StarTowerGame {
|
|||||||
|
|
||||||
// Add cases
|
// Add cases
|
||||||
this.addCase(room.getMutableCases(), syncHpCase);
|
this.addCase(room.getMutableCases(), syncHpCase);
|
||||||
this.addCase(room.getMutableCases(), doorCase);
|
|
||||||
|
// Add door to next floor if current floor is choice/shop domains
|
||||||
|
if (this.roomType == 6 | this.roomType == 7) {
|
||||||
|
var doorCase = new StarTowerCase(CaseType.OpenDoor);
|
||||||
|
doorCase.setFloorId(this.getFloor() + 1);
|
||||||
|
|
||||||
|
// Set room type of next room
|
||||||
|
var nextStage = this.getNextStageData();
|
||||||
|
if (nextStage != null) {
|
||||||
|
doorCase.setRoomType(nextStage.getRoomType());
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add case
|
||||||
|
this.addCase(room.getMutableCases(), doorCase);
|
||||||
|
}
|
||||||
|
|
||||||
// Done
|
// Done
|
||||||
return rsp;
|
return rsp;
|
||||||
|
|||||||
Reference in New Issue
Block a user