Commit f5863c5a by zhaoguojun

加随机数变量

parent 77c0805c
# #
## qa问答地址 ## qa问答地址
#qa_url=http://192.168.1.78:59000/game qa_url=http://192.168.1.78:59000/game
# #
## 中控url ## 中控url
#cc_url=http://localhost:8070/api/update/data cc_url=http://localhost:8070/api/update/data
# #
## condition后台url ## condition后台url
#condition_backend_url=http://192.168.1.82:6636/api condition_backend_url=http://192.168.1.82:6636/api
# #
## action生成指定的后台地址 ## action生成指定的后台地址
#service_url=http://192.168.1.178:8081/bot/dialog service_url=http://192.168.1.111:8081/bot/dialog
qa_url=http://localhost:59100/game # qa_url=http://localhost:59100/game
cc_url=http://localhost:8070/api/update/data # cc_url=http://localhost:8070/api/update/data
condition_backend_url=http://localhost:6636/api # condition_backend_url=http://localhost:6636/api
service_url=http://localhost:8081/bot/dialog # service_url=http://localhost:8081/bot/dialog
chatcache_time_out=300000 chatcache_time_out=300000
...@@ -64,6 +64,8 @@ star_plot_not_exist=开始剧情不存在,请到剧情列表设置 ...@@ -64,6 +64,8 @@ star_plot_not_exist=开始剧情不存在,请到剧情列表设置
assistant=globalVariable_智能助手 assistant=globalVariable_智能助手
unknown_counter_name=globalVariable_无匹配次数 unknown_counter_name=globalVariable_无匹配次数
plot_random_num=globalVariable_剧情随机数
# ------------------------助手情绪-------------- # ------------------------助手情绪--------------
assistant_emotion=正常 assistant_emotion=正常
......
...@@ -188,7 +188,5 @@ public class Config { ...@@ -188,7 +188,5 @@ public class Config {
public static String SCRIPT_ALL_IN_PLACE = null; public static String SCRIPT_ALL_IN_PLACE = null;
//script_item_intro //script_item_intro
public static String PLOT_RANDOM_NUM = null;
} }
...@@ -290,11 +290,14 @@ public class ActionUtils { ...@@ -290,11 +290,14 @@ public class ActionUtils {
String pair[] = null; String pair[] = null;
for(String line:keywordtText.split("\r\n")){ for(String line:keywordtText.split("\r\n")){
//System.out.println(line);
if(line.startsWith("++")){ if(line.startsWith("++")){
pair = line.split("\\|"); pair = line.split("\\|");
if(pair.length < 2) {
System.out.println("宏定义非法: " + line);
}
else {
macroMap.put(pair[0], pair[1]); macroMap.put(pair[0], pair[1]);
//System.out.println("put" + pair[0] + pair[1]); }
} }
} }
...@@ -936,6 +939,7 @@ public class ActionUtils { ...@@ -936,6 +939,7 @@ public class ActionUtils {
}catch (SQLException e){ }catch (SQLException e){
intervalStatus = new IntervalStatus(0, ACTION_TEXT_GENERATE_ERROR); intervalStatus = new IntervalStatus(0, ACTION_TEXT_GENERATE_ERROR);
System.out.println(e.getMessage()); System.out.println(e.getMessage());
e.printStackTrace();
}finally { }finally {
platformUtils.destroy(); platformUtils.destroy();
} }
......
...@@ -183,21 +183,21 @@ public class ConfigTermText implements Cloneable{ ...@@ -183,21 +183,21 @@ public class ConfigTermText implements Cloneable{
Map<String ,Integer> nameCount = new HashMap<String , Integer>(); Map<String ,Integer> nameCount = new HashMap<String , Integer>();
for (Premise premise : premises){ for (Premise premise : premises){
//设置初始值
//System.out.println("nameCount" + nameCount);
conditionName = premise.getConditionName(); conditionName = premise.getConditionName();
if(conditionName.startsWith("npc_") ||
conditionName.startsWith("goods_") ||
conditionName.startsWith("globalVariable_") ||
conditionName.startsWith("map_"))
{}
else {
nameCount.putIfAbsent(conditionName, 0); nameCount.putIfAbsent(conditionName, 0);
//nameCount加一 //nameCount加一
nameCount.put(conditionName, nameCount.get(conditionName) + 1); nameCount.put(conditionName, nameCount.get(conditionName) + 1);
//在conditionName后添加count //在conditionName后添加count
if(nameCount.get(conditionName) > 1) { if(nameCount.get(conditionName) > 1) {
premise.setConditionName(conditionName + nameCount.get(conditionName)); premise.setConditionName(conditionName + nameCount.get(conditionName));
} }
}
sb.append(","); sb.append(",");
sb.append(premise.getConditionName()); sb.append(premise.getConditionName());
......
...@@ -282,6 +282,7 @@ public class PlotConstructor2 extends ElementConstructor { ...@@ -282,6 +282,7 @@ public class PlotConstructor2 extends ElementConstructor {
nextId = branchNode.getString("nextPlotId"); nextId = branchNode.getString("nextPlotId");
//自动寻路
moveWithPlot = branchNode.getBoolean("moveWithPlot"); moveWithPlot = branchNode.getBoolean("moveWithPlot");
if(nextId == null || nextId.equals("") || !plotIndex.containsKey(nextId)){ if(nextId == null || nextId.equals("") || !plotIndex.containsKey(nextId)){
nextId = id + "_end"; nextId = id + "_end";
...@@ -336,6 +337,8 @@ public class PlotConstructor2 extends ElementConstructor { ...@@ -336,6 +337,8 @@ public class PlotConstructor2 extends ElementConstructor {
*/ */
//现在暂时放开下一步剧情未发生过的限制条件 //现在暂时放开下一步剧情未发生过的限制条件
//historyPremise
//currentPremise
//extraHP = taskLineName + "::match-Include=" + id + ",site::match-Include=" + location + "," + id + "::number-BiggerOrEqual=" + 1 + "," + nextId + "::match-Include=null"; //extraHP = taskLineName + "::match-Include=" + id + ",site::match-Include=" + location + "," + id + "::number-BiggerOrEqual=" + 1 + "," + nextId + "::match-Include=null";
appendPremise(extraHP, taskLineName, "match", "Include", gameStep); appendPremise(extraHP, taskLineName, "match", "Include", gameStep);
appendPremise(extraHP, "site", "match", "Include", location); appendPremise(extraHP, "site", "match", "Include", location);
......
...@@ -76,8 +76,8 @@ public class GameBotUtil extends BasicBotUtil{ ...@@ -76,8 +76,8 @@ public class GameBotUtil extends BasicBotUtil{
}else { }else {
chatCache.getInfoPoint().put("临时变量condition", activeList[activeList.length-1]); chatCache.getInfoPoint().put("临时变量condition", activeList[activeList.length-1]);
} }
int randomNumber = (int)(Math.random() * 10000);
chatCache.getInfoPoint().put(PLOT_RANDOM_NUM, String.valueOf(randomNumber));
return debugFlag; return debugFlag;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment