mirror of
https://github.com/Melledy/Nebula.git
synced 2026-09-19 09:09:54 +02:00
Fix wrong potentials in star tower potential selector
This commit is contained in:
@@ -114,9 +114,11 @@ public class GameData {
|
|||||||
@Getter private static DataTable<StarTowerGrowthNodeDef> StarTowerGrowthNodeDataTable = new DataTable<>();
|
@Getter private static DataTable<StarTowerGrowthNodeDef> StarTowerGrowthNodeDataTable = new DataTable<>();
|
||||||
@Getter private static DataTable<StarTowerFloorExpDef> StarTowerFloorExpDataTable = new DataTable<>();
|
@Getter private static DataTable<StarTowerFloorExpDef> StarTowerFloorExpDataTable = new DataTable<>();
|
||||||
@Getter private static DataTable<StarTowerTeamExpDef> StarTowerTeamExpDataTable = new DataTable<>();
|
@Getter private static DataTable<StarTowerTeamExpDef> StarTowerTeamExpDataTable = new DataTable<>();
|
||||||
@Getter private static DataTable<PotentialDef> PotentialDataTable = new DataTable<>();
|
|
||||||
@Getter private static DataTable<SubNoteSkillPromoteGroupDef> SubNoteSkillPromoteGroupDataTable = new DataTable<>();
|
@Getter private static DataTable<SubNoteSkillPromoteGroupDef> SubNoteSkillPromoteGroupDataTable = new DataTable<>();
|
||||||
|
|
||||||
|
@Getter private static DataTable<PotentialDef> PotentialDataTable = new DataTable<>();
|
||||||
|
@Getter private static DataTable<CharPotentialDef> CharPotentialDataTable = new DataTable<>();
|
||||||
|
|
||||||
@Getter private static DataTable<StarTowerBookFateCardBundleDef> StarTowerBookFateCardBundleDataTable = new DataTable<>();
|
@Getter private static DataTable<StarTowerBookFateCardBundleDef> StarTowerBookFateCardBundleDataTable = new DataTable<>();
|
||||||
@Getter private static DataTable<StarTowerBookFateCardQuestDef> StarTowerBookFateCardQuestDataTable = new DataTable<>();
|
@Getter private static DataTable<StarTowerBookFateCardQuestDef> StarTowerBookFateCardQuestDataTable = new DataTable<>();
|
||||||
@Getter private static DataTable<StarTowerBookFateCardDef> StarTowerBookFateCardDataTable = new DataTable<>();
|
@Getter private static DataTable<StarTowerBookFateCardDef> StarTowerBookFateCardDataTable = new DataTable<>();
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package emu.nebula.data.resources;
|
||||||
|
|
||||||
|
import emu.nebula.data.BaseDef;
|
||||||
|
import emu.nebula.data.ResourceType;
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@ResourceType(name = "CharPotential.json")
|
||||||
|
public class CharPotentialDef extends BaseDef {
|
||||||
|
private int Id;
|
||||||
|
|
||||||
|
private int[] MasterSpecificPotentialIds;
|
||||||
|
private int[] AssistSpecificPotentialIds;
|
||||||
|
private int[] CommonPotentialIds;
|
||||||
|
private int[] MasterNormalPotentialIds;
|
||||||
|
private int[] AssistNormalPotentialIds;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getId() {
|
||||||
|
return Id;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -7,7 +7,6 @@ import dev.morphia.annotations.Entity;
|
|||||||
|
|
||||||
import emu.nebula.GameConstants;
|
import emu.nebula.GameConstants;
|
||||||
import emu.nebula.data.GameData;
|
import emu.nebula.data.GameData;
|
||||||
import emu.nebula.data.resources.PotentialDef;
|
|
||||||
import emu.nebula.data.resources.StarTowerDef;
|
import emu.nebula.data.resources.StarTowerDef;
|
||||||
import emu.nebula.data.resources.StarTowerStageDef;
|
import emu.nebula.data.resources.StarTowerStageDef;
|
||||||
import emu.nebula.game.formation.Formation;
|
import emu.nebula.game.formation.Formation;
|
||||||
@@ -427,22 +426,35 @@ public class StarTowerGame {
|
|||||||
* Creates a potential selector for the specified character
|
* Creates a potential selector for the specified character
|
||||||
*/
|
*/
|
||||||
public StarTowerBaseCase createPotentialSelector(int charId) {
|
public StarTowerBaseCase createPotentialSelector(int charId) {
|
||||||
// Get random potentials
|
// Get character potentials
|
||||||
List<PotentialDef> potentials = new ArrayList<>();
|
var data = GameData.getCharPotentialDataTable().get(charId);
|
||||||
|
if (data == null) {
|
||||||
for (var potentialData : GameData.getPotentialDataTable()) {
|
return null;
|
||||||
if (potentialData.getCharId() == charId) {
|
|
||||||
potentials.add(potentialData);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Random potentials list
|
||||||
|
var potentials = new IntArrayList();
|
||||||
|
|
||||||
|
// Add potentials based on character role
|
||||||
|
boolean isMainCharacter = this.getCharIds().getInt(0) == charId;
|
||||||
|
|
||||||
|
if (isMainCharacter) {
|
||||||
|
potentials.addElements(0, data.getMasterSpecificPotentialIds());
|
||||||
|
potentials.addElements(0, data.getMasterNormalPotentialIds());
|
||||||
|
} else {
|
||||||
|
potentials.addElements(0, data.getAssistSpecificPotentialIds());
|
||||||
|
potentials.addElements(0, data.getAssistNormalPotentialIds());
|
||||||
|
}
|
||||||
|
|
||||||
|
potentials.addElements(0, data.getCommonPotentialIds());
|
||||||
|
|
||||||
// Get up to 3 random potentials
|
// Get up to 3 random potentials
|
||||||
// TODO bug: this may pick duplicate potentials
|
// TODO bug: this may pick duplicate potentials
|
||||||
IntList selector = new IntArrayList();
|
IntList selector = new IntArrayList();
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
var potentialData = Utils.randomElement(potentials);
|
var potentialId = Utils.randomElement(potentials);
|
||||||
selector.add(potentialData.getId());
|
selector.add(potentialId);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creator potential selector case
|
// Creator potential selector case
|
||||||
|
|||||||
Reference in New Issue
Block a user