山河社稷
parent
a8e76d24db
commit
7e21e0df43
|
@ -205,4 +205,18 @@ public class StringUtil {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 一个将Int数组转String的方法
|
||||
* @param intArr
|
||||
* @return
|
||||
*/
|
||||
public static StringBuffer intArrToStringArr(int[] intArr) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
for(int num : intArr){
|
||||
stringBuffer.append(num);
|
||||
}
|
||||
return stringBuffer;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.logic.activity.event.GoldRefreshEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.ShanHeSheJiTuStarEvent;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
|
@ -18,7 +17,6 @@ import com.ljsd.jieling.logic.dao.UserManager;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.FightRecordLogic;
|
||||
import com.ljsd.jieling.logic.fight.FightUtil;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.hardStage.HardStageChapter;
|
||||
import com.ljsd.jieling.logic.hardStage.HardStageLogic;
|
||||
import com.ljsd.jieling.logic.hardStage.HardStageNode;
|
||||
|
@ -27,9 +25,7 @@ import com.ljsd.jieling.util.FightDataUtil;
|
|||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.ljsd.jieling.util.MonsterUtil;
|
||||
import config.SHardStage;
|
||||
import javafx.stage.Stage;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.luaj.vm2.lib.jse.JseMathLib;
|
||||
import rpc.protocols.*;
|
||||
import com.ljsd.fight.ArenaRecord;
|
||||
import com.ljsd.jieling.util.*;
|
||||
|
@ -69,9 +65,11 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
if (nodeConfig.getStageType() == 2) {
|
||||
Map<Integer, HardStageChapter> chapt = user.getHardStageManager().getChapterMap(user);
|
||||
HardStageNode node = chapt.get(nodeConfig.getChapter()).getNode(nodeConfig.getId());
|
||||
node.setHasPass(true);
|
||||
node.setState(1);
|
||||
dropList.addAll(HardStageLogic.getFirstRewards(user, nodeConfig));
|
||||
if (!node.isHasPass()) {
|
||||
node.setHasPass(true);
|
||||
node.setState(1);
|
||||
dropList.addAll(HardStageLogic.getFirstRewards(user, nodeConfig));
|
||||
}
|
||||
} else if (nodeConfig.getStageType() == 1 || nodeConfig.getStageType() == 3) {
|
||||
//战斗后发奖励
|
||||
int seed = (int) (System.currentTimeMillis() / 1000);
|
||||
|
@ -107,7 +105,6 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
FightRecordLogic.getInstance().addRecordMap(user, fightData);
|
||||
|
||||
//战斗回放
|
||||
//String fightInfo = nodeId + "#" + seed + "#" + teamId;
|
||||
int force = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
|
||||
// 首次通关记录
|
||||
ArenaRecord firstPassRecord = RedisUtil.getInstence().get(RedisKey.HARD_STAGE_FIST_PASS, String.valueOf(nodeId), ArenaRecord.class);
|
||||
|
@ -154,9 +151,6 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
}
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.HARD_STAGE_FIGHT_START_RESPONSE.getNumber(), fightStartResponse.build(), true);
|
||||
//更新消息
|
||||
CommonProto.HardStageInfo.Builder info = HardStageLogic.getInfo(user);
|
||||
PlayerInfoProto.HardStageResponse.Builder response = PlayerInfoProto.HardStageResponse.newBuilder();
|
||||
response.setInfo(info);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.HARD_STAGE_INFO_RESPONSE.getNumber(), response.build(), true);
|
||||
HardStageLogic.sendHardStageIndication(user);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class HardStageManager extends MongoBase {
|
|||
node.getRewardMap().put(config.getReward1()[1], Boolean.FALSE);
|
||||
node.getRewardMap().put(config.getReward1()[2], Boolean.FALSE);
|
||||
}
|
||||
setCurNode(config.getId());
|
||||
setCurNode(config.getSection());
|
||||
return node;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.slf4j.LoggerFactory;
|
|||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
import util.StringUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -39,6 +40,7 @@ public class HardStageLogic {
|
|||
CommonProto.HardStageInfo.Builder builder = CommonProto.HardStageInfo.newBuilder();
|
||||
|
||||
for (Map.Entry<Integer, HardStageChapter> entry : map.entrySet()) {
|
||||
//章节信息
|
||||
CommonProto.HardStageChapter.Builder chapterBuilder = CommonProto.HardStageChapter.newBuilder();
|
||||
for (HardStageNode node : entry.getValue().getNodeList()) {
|
||||
CommonProto.HardStageNode.Builder nodeBuilder = CommonProto.HardStageNode.newBuilder();
|
||||
|
@ -100,7 +102,7 @@ public class HardStageLogic {
|
|||
int currentStar = node.getState();
|
||||
|
||||
//当前战斗的星星状态
|
||||
String currenState = Arrays.toString(num);
|
||||
StringBuffer currenState = StringUtil.intArrToStringArr(num);;
|
||||
//已存在的星星状态
|
||||
StringBuffer existState = reformatBinary(currentStar);
|
||||
|
||||
|
@ -120,8 +122,8 @@ public class HardStageLogic {
|
|||
rewardId = config.getReward1()[0];
|
||||
}
|
||||
if (addDropAndStar(node, dropList, rewardId, user)) {
|
||||
node.setState(currentStar + (int) increase);
|
||||
addStar += increase;
|
||||
node.setState(node.getState() + (int) increase);
|
||||
addStar += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -193,7 +195,7 @@ public class HardStageLogic {
|
|||
if (node.getType() == 1) {//大节点
|
||||
int star = passReward(user, node, resultNum, dropList);//星级通关奖励
|
||||
chapterMap.get(nodeConfig.getChapter()).addStars(star);
|
||||
user.getHardStageManager().updateString("chapterMap." + nodeConfig.getChapter(), chapterMap.get(nodeConfig.getChapter()));
|
||||
|
||||
if (!node.isHasPass()) {
|
||||
node.setHasPass(true);
|
||||
dropList.addAll(getFirstRewards(user, nodeConfig));//关卡通过奖励
|
||||
|
@ -204,6 +206,7 @@ public class HardStageLogic {
|
|||
}
|
||||
});
|
||||
}
|
||||
user.getHardStageManager().updateString("chapterMap." + nodeConfig.getChapter(), chapterMap.get(nodeConfig.getChapter()));
|
||||
} else if (node.getType() == 3) {
|
||||
if (!node.isHasPass()) {
|
||||
node.setHasPass(true);
|
||||
|
|
Loading…
Reference in New Issue