mirror of
https://github.com/Melledy/Nebula.git
synced 2026-09-19 09:09:54 +02:00
Implement bonus max potential level
This commit is contained in:
@@ -2,6 +2,7 @@ package emu.nebula.data.resources;
|
|||||||
|
|
||||||
import emu.nebula.data.BaseDef;
|
import emu.nebula.data.BaseDef;
|
||||||
import emu.nebula.data.ResourceType;
|
import emu.nebula.data.ResourceType;
|
||||||
|
import emu.nebula.game.tower.StarTowerGame;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@@ -10,6 +11,7 @@ public class PotentialDef extends BaseDef {
|
|||||||
private int Id;
|
private int Id;
|
||||||
private int CharId;
|
private int CharId;
|
||||||
private int Build;
|
private int Build;
|
||||||
|
private int BranchType;
|
||||||
private int MaxLevel;
|
private int MaxLevel;
|
||||||
private int[] BuildScore;
|
private int[] BuildScore;
|
||||||
|
|
||||||
@@ -19,4 +21,24 @@ public class PotentialDef extends BaseDef {
|
|||||||
public int getId() {
|
public int getId() {
|
||||||
return Id;
|
return Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getMaxLevel(StarTowerGame game) {
|
||||||
|
// Check if regular potential
|
||||||
|
if (this.BranchType == 3) {
|
||||||
|
return this.MaxLevel + game.getModifiers().getBonusMaxPotentialLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Special potential should always have a max level of 1
|
||||||
|
return this.MaxLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getBuildScore(int level) {
|
||||||
|
int index = level - 1;
|
||||||
|
|
||||||
|
if (index >= this.BuildScore.length) {
|
||||||
|
index = this.BuildScore.length - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.BuildScore[index];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -140,8 +140,7 @@ public class StarTowerBuild implements GameDatabaseObject {
|
|||||||
var data = GameData.getPotentialDataTable().get(potential.getIntKey());
|
var data = GameData.getPotentialDataTable().get(potential.getIntKey());
|
||||||
if (data == null) continue;
|
if (data == null) continue;
|
||||||
|
|
||||||
int index = potential.getIntValue() - 1;
|
this.score += data.getBuildScore(potential.getIntValue());
|
||||||
this.score += data.getBuildScore()[index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sub note skills
|
// Sub note skills
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ public class StarTowerGame {
|
|||||||
|
|
||||||
// Clamp level
|
// Clamp level
|
||||||
int curLevel = getPotentials().get(id);
|
int curLevel = getPotentials().get(id);
|
||||||
int nextLevel = Math.min(curLevel + count, potentialData.getMaxLevel());
|
int nextLevel = Math.min(curLevel + count, potentialData.getMaxLevel(this));
|
||||||
|
|
||||||
// Sanity
|
// Sanity
|
||||||
count = nextLevel - curLevel;
|
count = nextLevel - curLevel;
|
||||||
@@ -529,7 +529,7 @@ public class StarTowerGame {
|
|||||||
|
|
||||||
// Check max level
|
// Check max level
|
||||||
int level = item.getIntValue();
|
int level = item.getIntValue();
|
||||||
if (level >= potential.getMaxLevel()) {
|
if (level >= potential.getMaxLevel(this)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ public class StarTowerModifiers {
|
|||||||
private boolean freeStrengthen;
|
private boolean freeStrengthen;
|
||||||
private int strengthenDiscount;
|
private int strengthenDiscount;
|
||||||
|
|
||||||
|
// Bonus max potential level
|
||||||
|
private int bonusMaxPotentialLevel;
|
||||||
|
|
||||||
public StarTowerModifiers(StarTowerGame game) {
|
public StarTowerModifiers(StarTowerGame game) {
|
||||||
this.game = game;
|
this.game = game;
|
||||||
|
|
||||||
@@ -27,9 +30,17 @@ public class StarTowerModifiers {
|
|||||||
|
|
||||||
if (this.hasGrowthNode(30402)) {
|
if (this.hasGrowthNode(30402)) {
|
||||||
this.strengthenDiscount += 60;
|
this.strengthenDiscount += 60;
|
||||||
} else if (this.hasGrowthNode(30102)) {
|
}
|
||||||
|
if (this.hasGrowthNode(30102)) {
|
||||||
this.strengthenDiscount += 30;
|
this.strengthenDiscount += 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Bonus max level
|
||||||
|
if (this.hasGrowthNode(30301)) {
|
||||||
|
this.bonusMaxPotentialLevel = 6;
|
||||||
|
} else if (this.hasGrowthNode(20601)) {
|
||||||
|
this.bonusMaxPotentialLevel = 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasGrowthNode(int nodeId) {
|
public boolean hasGrowthNode(int nodeId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user