玩家经验修改
parent
66d10040d3
commit
1d7e46ee36
|
@ -125,6 +125,15 @@ public class MathUtils {
|
|||
}
|
||||
return original;
|
||||
}
|
||||
public static long setBetweenWithMax(long original, long min, long max) {
|
||||
if (original >= max) {
|
||||
original = max;
|
||||
}
|
||||
if (original < min) {
|
||||
original = min;
|
||||
}
|
||||
return original;
|
||||
}
|
||||
|
||||
public static int getMaxNum(int a, int b) {
|
||||
if(a>=b){
|
||||
|
|
|
@ -42,7 +42,7 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private int level;
|
||||
|
||||
private int exp;
|
||||
private long exp;
|
||||
|
||||
private int vipLevel;
|
||||
|
||||
|
@ -204,11 +204,11 @@ public class PlayerManager extends MongoBase {
|
|||
this.level = level;
|
||||
}
|
||||
|
||||
public int getExp() {
|
||||
public long getExp() {
|
||||
return exp;
|
||||
}
|
||||
|
||||
public void setExp(int exp) throws Exception {
|
||||
public void setExp(long exp) throws Exception {
|
||||
updateString("exp", exp);
|
||||
this.exp = exp;
|
||||
}
|
||||
|
|
|
@ -846,7 +846,7 @@ public class ItemUtil {
|
|||
if (playerInfoManager.getExp() >= maxExp) {
|
||||
return;
|
||||
}
|
||||
int curExp = MathUtils.setBetweenWithMax((int)playerInfoManager.getExp() + (int)addExp, 0, maxExp);
|
||||
long curExp = MathUtils.setBetweenWithMax(playerInfoManager.getExp() + addExp, 0, maxExp);
|
||||
int oldLevel = playerInfoManager.getLevel();
|
||||
// 当前等级表配置
|
||||
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(oldLevel);
|
||||
|
|
Loading…
Reference in New Issue