Merge branch 'master' of http://60.1.1.230/backend/jieling_server
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/handler/map/MapLogic.javaback_recharge
commit
af186980d4
|
@ -1,3 +1,3 @@
|
||||||
Id BornItem SpeedFormula InitialEnergy EnergyRecoverSpeed ActionPowerRormula Speed HeroNumlimit EquipNumlimit WorldTalking BornPosition
|
Id BornItem SpeedFormula InitialEnergy EnergyRecoverSpeed ActionPowerRormula Speed HeroNumlimit EquipNumlimit WorldTalking BornPosition
|
||||||
int mut,int#int,2 mut,float#float,1 int mut,int#int,1 mut,int#int,1 mut,int#int,1 int int int mut,int#int,1
|
int mut,int#int,2 mut,float#float,1 int mut,int#int,1 mut,int#int,1 mut,int#int,1 int int int mut,int#int,1
|
||||||
1 10008#1|10013#1|10023#1|1503#8|2#60 0#0#0.3164#0 100 60#1 0#0#1#0 70#100 999 9999 1 08#19
|
1 10026#1|2#80 0#0#0.3164#0 80 1#6 0#0#1#0 70#100 999 9999 1 08#19
|
||||||
|
|
|
@ -1321,8 +1321,9 @@ public class MapLogic {
|
||||||
return;
|
return;
|
||||||
}else if(resultCode == 0){
|
}else if(resultCode == 0){
|
||||||
LevelDifficulty levelDifficulty = levelDifficultyManager.getLevelDifficultyInfosMap().get(fightId);
|
LevelDifficulty levelDifficulty = levelDifficultyManager.getLevelDifficultyInfosMap().get(fightId);
|
||||||
levelDifficulty.setState(Global.FIGHT_OPEND_NO_CLEARANCE);
|
if (levelDifficulty.getState() != Global.FIGHT_CLEARANCE){
|
||||||
// 失败处理
|
levelDifficulty.setState(Global.FIGHT_OPEND_NO_CLEARANCE);
|
||||||
|
}
|
||||||
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
|
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
|
||||||
FightInfoProto.FightEndResponse fightEndResponse = FightInfoProto.FightEndResponse
|
FightInfoProto.FightEndResponse fightEndResponse = FightInfoProto.FightEndResponse
|
||||||
.newBuilder()
|
.newBuilder()
|
||||||
|
@ -1337,9 +1338,11 @@ public class MapLogic {
|
||||||
ItemUtil.itemCost(user, sLevelDifficultyConfig.getCost());
|
ItemUtil.itemCost(user, sLevelDifficultyConfig.getCost());
|
||||||
//玩家升级
|
//玩家升级
|
||||||
userLevelUp(playerInfoManager,sLevelDifficultyConfig.getExp());
|
userLevelUp(playerInfoManager,sLevelDifficultyConfig.getExp());
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sLevelDifficultyConfig.getRandomReward(), 1, 1);
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sLevelDifficultyConfig.getRandomReward(), 1, 0);
|
||||||
LevelDifficulty levelDifficulty = levelDifficultyManager.getLevelDifficultyInfosMap().get(fightId);
|
LevelDifficulty levelDifficulty = levelDifficultyManager.getLevelDifficultyInfosMap().get(fightId);
|
||||||
levelDifficulty.setState(Global.FIGHT_CLEARANCE);
|
if (levelDifficulty.getState() != Global.FIGHT_CLEARANCE){
|
||||||
|
levelDifficulty.setState(Global.FIGHT_CLEARANCE);
|
||||||
|
}
|
||||||
levelDifficulty.setChallengeTimes(levelDifficulty.getChallengeTimes() +1);
|
levelDifficulty.setChallengeTimes(levelDifficulty.getChallengeTimes() +1);
|
||||||
//开启关卡
|
//开启关卡
|
||||||
openNextFightIds(levelDifficultyManager,playerInfoManager,fightId);
|
openNextFightIds(levelDifficultyManager,playerInfoManager,fightId);
|
||||||
|
@ -1394,7 +1397,7 @@ public class MapLogic {
|
||||||
}
|
}
|
||||||
int curExp = MathUtils.setBetweenWithMax(playerInfoManager.getExp() + addExp, 0, maxExp);
|
int curExp = MathUtils.setBetweenWithMax(playerInfoManager.getExp() + addExp, 0, maxExp);
|
||||||
int oldLevel = playerInfoManager.getLevel();
|
int oldLevel = playerInfoManager.getLevel();
|
||||||
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(oldLevel + 1);
|
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(oldLevel);
|
||||||
int levelUpExp;
|
int levelUpExp;
|
||||||
if (sPlayerLevelConfig == null) {
|
if (sPlayerLevelConfig == null) {
|
||||||
levelUpExp = maxExp;
|
levelUpExp = maxExp;
|
||||||
|
@ -1403,7 +1406,7 @@ public class MapLogic {
|
||||||
}
|
}
|
||||||
while (curExp >= levelUpExp && curExp <= maxExp) {
|
while (curExp >= levelUpExp && curExp <= maxExp) {
|
||||||
playerInfoManager.setLevel(playerInfoManager.getLevel() + 1);
|
playerInfoManager.setLevel(playerInfoManager.getLevel() + 1);
|
||||||
sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(playerInfoManager.getLevel() + 1);
|
// sPlayerLevelConfig = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(playerInfoManager.getLevel() + 1);
|
||||||
if (sPlayerLevelConfig == null) {
|
if (sPlayerLevelConfig == null) {
|
||||||
levelUpExp = Integer.MAX_VALUE;
|
levelUpExp = Integer.MAX_VALUE;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -203,9 +203,9 @@ public class MapManager extends MongoBase {
|
||||||
Item item = user.getItemManager().getItemMap().get(Global.STAMINA);
|
Item item = user.getItemManager().getItemMap().get(Global.STAMINA);
|
||||||
int updateTime = (int)(System.currentTimeMillis()/1000);
|
int updateTime = (int)(System.currentTimeMillis()/1000);
|
||||||
int lastUpdateEnergyTime = item.getEndingTime();
|
int lastUpdateEnergyTime = item.getEndingTime();
|
||||||
if ((updateTime -lastUpdateEnergyTime)/60 >= 1){
|
int[] energyRecoverSpeed = SGameSetting.getGameSetting().getEnergyRecoverSpeed();
|
||||||
|
if ((updateTime -lastUpdateEnergyTime)/60 >=energyRecoverSpeed[1]){
|
||||||
if(itemNum < playerInfoManager.getMaxStamina()){
|
if(itemNum < playerInfoManager.getMaxStamina()){
|
||||||
int[] energyRecoverSpeed = SGameSetting.getGameSetting().getEnergyRecoverSpeed();
|
|
||||||
int addValue = (updateTime - lastUpdateEnergyTime)/60/energyRecoverSpeed[1] * energyRecoverSpeed[0];
|
int addValue = (updateTime - lastUpdateEnergyTime)/60/energyRecoverSpeed[1] * energyRecoverSpeed[0];
|
||||||
if(addValue != 0){
|
if(addValue != 0){
|
||||||
int curEnergy = MathUtils.setBetweenWithMax(itemNum + addValue,0,SGameSetting.getGameSetting().getInitialEnergy());
|
int curEnergy = MathUtils.setBetweenWithMax(itemNum + addValue,0,SGameSetting.getGameSetting().getInitialEnergy());
|
||||||
|
|
|
@ -5,14 +5,16 @@ import com.ljsd.jieling.handler.map.TemporaryItems;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class AdventureManager extends MongoBase {
|
public class AdventureManager extends MongoBase {
|
||||||
|
|
||||||
private Map<Integer,AdventureStateInfo> adventureStateInfoMap;
|
private Map<Integer,AdventureStateInfo> adventureStateInfoMap;
|
||||||
|
|
||||||
private Map<int[],Float> tempDropRatio = new HashMap<>();
|
private List<TempDropInfo> tempDropRatio = new ArrayList<>();
|
||||||
|
|
||||||
public AdventureManager(){
|
public AdventureManager(){
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
this.setRootCollection(User._COLLECTION_NAME);
|
||||||
|
@ -25,18 +27,18 @@ public class AdventureManager extends MongoBase {
|
||||||
adventureStateInfoMap.put(position,adventureStateInfo);
|
adventureStateInfoMap.put(position,adventureStateInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<int[], Float> getTempDropRation() {
|
public List<TempDropInfo> getTempDropRatio() {
|
||||||
return tempDropRatio;
|
return tempDropRatio;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updateTemp(int dropIds[],float ratio){
|
public void updateTemp(int dropIds[], float ratio){
|
||||||
tempDropRatio.put(dropIds,ratio);
|
tempDropRatio.add(new TempDropInfo(dropIds,ratio));
|
||||||
updateString("tempDropRatio."+dropIds,ratio);
|
updateString("tempDropRatio",tempDropRatio);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearTemp(){
|
public void clearTemp(){
|
||||||
tempDropRatio.clear();
|
tempDropRatio.clear();
|
||||||
updateString("tempDropRatio",new HashMap<>());
|
updateString("tempDropRatio", new ArrayList<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Integer, AdventureStateInfo> getAdventureStateInfoMap() {
|
public Map<Integer, AdventureStateInfo> getAdventureStateInfoMap() {
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.ljsd.jieling.logic.dao;
|
||||||
|
|
||||||
|
public class TempDropInfo {
|
||||||
|
private int[] dropGroupIds;
|
||||||
|
private float dropRatio;
|
||||||
|
|
||||||
|
public TempDropInfo(int[] dropGroupIds, float dropRatio) {
|
||||||
|
this.dropGroupIds = dropGroupIds;
|
||||||
|
this.dropRatio = dropRatio;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TempDropInfo() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getDropGroupIds() {
|
||||||
|
return dropGroupIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float getDropRatio() {
|
||||||
|
return dropRatio;
|
||||||
|
}
|
||||||
|
}
|
|
@ -147,7 +147,10 @@ public class CombatLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!isOnLine){
|
if(!isOnLine){
|
||||||
tempDropRation.putAll(adventureManager.getTempDropRation());
|
List<TempDropInfo> tempDropRatioList = adventureManager.getTempDropRatio();
|
||||||
|
for(TempDropInfo tempDropInfo : tempDropRatioList){
|
||||||
|
tempDropRation.put(tempDropInfo.getDropGroupIds(),tempDropInfo.getDropRatio());
|
||||||
|
}
|
||||||
adventureManager.clearTemp();
|
adventureManager.clearTemp();
|
||||||
}
|
}
|
||||||
return ItemUtil.drop(user, tempDropRation);
|
return ItemUtil.drop(user, tempDropRation);
|
||||||
|
|
Loading…
Reference in New Issue