Commit 8a61ded5 by 周君强

1.bug修复和代码优化;

2.帮助模块实现; 3.日常任务配置调整.
parent 3010968d
......@@ -141,10 +141,18 @@ public class Constants {
/**
* --------------------操作ID,用于记录每轮操作-------------------
* 园丁升级
* 种植
*/
public static final Integer PLANT_SEED= 1001;
/**
* 升级花圃
*/
public static final Integer NURSERY_UPGRADE = 1006;
/**
* 查看植物成熟时间
*/
public static final Integer CHECK_MATURE_TIME = 1012;
/**
* 园丁升级
*/
public static final Integer GARDENER_UPGRADE = 2001;
......@@ -153,6 +161,14 @@ public class Constants {
*/
public static final Integer PET_DELETE = 3004;
/**
* 拜访陌生人
*/
public static final Integer VISIT_STRANGER = 5001;
/**
* 添加好友
*/
public static final Integer ADD_FRIEND = 5002;
/**
* 查看园地
*/
public static final Integer CHECK_GARDEN = 5005;
......@@ -165,6 +181,10 @@ public class Constants {
*/
public static final Integer HELP_FRIEND = 5007;
/**
* 查看好友申请
*/
public static final Integer ADD_FRIEND_CHECK = 5009;
/**
* 查看帮助简报
*/
public static final Integer CHECK_HELP_REPORT = 5013;
......
......@@ -5,6 +5,7 @@ import com.qiwuai.garden.common.utils.DateUtil;
import com.qiwuai.garden.common.utils.SpeechUtil;
import com.qiwuai.garden.common.utils.YamlUtil;
import com.qiwuai.garden.dto.GardenerDto;
import com.qiwuai.garden.dto.ItemBagDto;
import com.qiwuai.garden.dto.base.CommonResponse;
import com.qiwuai.garden.dto.request.OperationRequest;
import org.slf4j.Logger;
......@@ -55,7 +56,18 @@ public class ProxyFactory {
if (StringUtils.isEmpty(commonResponse.getData().getVars().get后台附加返回())) {
commonResponse.getData().getVars().set后台附加返回("无效返回");
}
//所有“后台附加返回”为null值的都给转成“无效返回”
if (StringUtils.isEmpty(commonResponse.getData().getVars().get后台附加返回2())) {
commonResponse.getData().getVars().set后台附加返回2("无效返回");
}
}
//玩家货币数量
//获取货币袋
//货币配置信息
Integer moneyId = Integer.parseInt(TimingAcquisition.systemConfigMap.get("money").getValue());
Integer moneyNum = TimingAcquisition.gardenerMap.get(request.getUid()).getBackPack().getItemBags()
.get(Constants.ITEM_TYPE_MONEY).getItems(moneyId).getItemNum();
commonResponse.getData().getVars().set玩家金币数量(moneyNum);
String feedContent = "后台返回参数 = [" +
"code:" + commonResponse.getCode() +
", msg:" + commonResponse.getMsg() +
......@@ -67,6 +79,7 @@ public class ProxyFactory {
", 玩家当前地址:" + commonResponse.getData().getVars().get玩家当前位置() +
", 消息提醒:" + commonResponse.getData().getVars().get消息提醒() +
", 任务完成:" + commonResponse.getData().getVars().get任务完成() +
", 玩家金币数量:" + commonResponse.getData().getVars().get玩家金币数量() +
"]";
//玩家有新消息提示
log.info(feedContent);
......
package com.qiwuai.garden.common.utils;
import com.alibaba.druid.support.json.JSONUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.qiwuai.garden.dto.request.PhraseRequest;
import com.qiwuai.garden.dto.response.PhraseResponse;
import org.apache.commons.codec.digest.DigestUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
......@@ -13,13 +13,14 @@ import org.springframework.http.ResponseEntity;
import org.springframework.web.client.RestTemplate;
public class HttpUtil {
static Logger log = LoggerFactory.getLogger(HttpUtil.class);
//动态词组更新秘钥
public static String appSecret = YamlUtil.getValueByKey("appSecret");
public static PhraseResponse doPut(String phraseName, String phraseContent) {
public static void doPut(String phraseName, String phraseContent) {
RestTemplate template = new RestTemplate();
// String url = "http://hw-gz24.heyqiwu.cn:8082/out/phrase";
String url = "fake";
String url = "http://hw-gz24.heyqiwu.cn:8082/out/phrase";
// url = "fake";
//获取时间戳
long timestamp = System.currentTimeMillis();
//签名
......@@ -42,6 +43,6 @@ public class HttpUtil {
HttpEntity<JSONObject> request = new HttpEntity<>(object, httpHeaders);
ResponseEntity<PhraseResponse> forObject = template.exchange(url, HttpMethod.PUT, request, PhraseResponse.class);
System.out.println("动态词组更新后的返回结果" + forObject);
return forObject.getBody();
log.info(phraseName + "的动态词组更新结果:" + forObject.getBody());
}
}
......@@ -323,7 +323,7 @@ public class PersistenceUtil {
File[] fileList = file.listFiles();
if (!StringUtils.isEmpty(fileList)) {
//留言保留时间(小时)
// String messageKeepTime = TimingAcquisition.systemConfigMap.get("message_keep_time").getValue();
String messageKeepTime = TimingAcquisition.systemConfigMap.get("message_keep_time").getValue();
if (fileList.length != 0) {
//遍历所有好友的目录
for (File value : fileList) {
......@@ -342,7 +342,7 @@ public class PersistenceUtil {
long subTime = DateUtil.subTime(DateUtil.getCurrentTime(), fileName); //单位为秒
subTime = subTime / (60 * 60); //单位为小时
//删除过期的留言
if (subTime > 24) {
if (subTime > Integer.parseInt(messageKeepTime)) {
f.delete();
}
}
......@@ -459,6 +459,83 @@ public class PersistenceUtil {
}
/**
*从report目录的json文件中删除指定简报(帮助或偷菜)
* @param uid
* @param reportName
* @return String
*/
public static void deleteReportFromFile(String uid, String reportName) {
File file;
//取出简报名称中的中文
String reportPre = TypeConvertUtil.extractChinese(reportName);
if ("帮助简报".equals(reportPre) || "帮助".equals(reportPre)) {
file = new File(reportFilePath + uid + "/helpReport/" + reportName + ".json");
} else {
file = new File(reportFilePath + uid + "/stealReport/" + reportName + ".json");
}
try {
file.delete();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 删除指定简报状态的简报:0-未读,1-已读
* @param uid
* @return void
*/
public static void deleteReportByStatus(String uid, String reportName, Integer reportStatus) {
File file;
//取出简报名称中的中文
String reportPre = TypeConvertUtil.extractChinese(reportName);
if ("帮助简报".equals(reportPre) || "帮助".equals(reportPre)) {
file = new File(reportFilePath + uid + "/helpReport/");
} else {
file = new File(reportFilePath + uid + "/stealReport/");
}
BufferedReader reader = null;
try {
if (file.exists()) {
File[] fileList = file.listFiles();
if (!StringUtils.isEmpty(fileList)) {
//遍历所有简报
for (File value : fileList) {
StringBuilder result = new StringBuilder();
if (value.getAbsolutePath().matches(".*\\.json$")) {
FileInputStream fileInputStream = new FileInputStream(value.getAbsolutePath());
InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8");
reader = new BufferedReader(inputStreamReader);
String stringTmp = null;
while ((stringTmp = reader.readLine()) != null) {
result.append(stringTmp);
}
}
//删除指定状态的简报
try {
if ("帮助简报".equals(reportPre) || "帮助".equals(reportPre)) {
HelpReportDto helpReport = JSON.parseObject(result.toString(), new TypeReference<HelpReportDto>(){});
if (reportStatus.equals(helpReport.getRead())) {
value.delete();
}
} else {
StealReportDto stealReport = JSON.parseObject(result.toString(), new TypeReference<StealReportDto>(){});
if (reportStatus.equals(stealReport.getRead())) {
value.delete();
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
*从report目录的json文件中读取指定简报(帮助或偷菜)
* @param uid
* @param reportName
......
......@@ -176,6 +176,17 @@ public class RequestConversionUtil {
int gender = genderCh.equals("男") ? 1 : 2;
operationRequest.setGender(gender);
}
//---------------存在园丁等级-----------------
String gardenerLevel = callRequest.get园丁等级();
if (!StringUtils.isEmpty(gardenerLevel)) {
//找到中文数字对应的阿拉伯数字
Integer number = TypeConvertUtil.change2Integer(gardenerLevel);
//中文中不包含中文数字时,提取阿拉伯数字
if (number == 0) {
number = TypeConvertUtil.extractNum(gardenerLevel);
}
operationRequest.setLevel(number);
}
//-----------------存在所属地区--------------------
String region = callRequest.get所属地区();
if (!StringUtils.isEmpty(region)) {
......
package com.qiwuai.garden.common.utils;
import com.alibaba.fastjson.JSON;
import com.qiwuai.garden.dto.RegionIPDto;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource;
......@@ -10,10 +12,8 @@ import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.net.URL;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@Component
@Data
......@@ -167,6 +167,18 @@ public class YamlUtil {
// System.out.println("随机数i:" + i);
// System.out.println("植物因没有伴生宠物种植失败的回复:" + speech.get("man").get("plant_fail_near_plant").get(i));
System.out.println("从yml文件取出的值" + getValueByKey("userFilePath"));
Map<String, List<RegionIPDto>> IPRegionsMap = new ConcurrentHashMap<>();
List<RegionIPDto> regionIPList = new ArrayList<>();
RegionIPDto regionIP = new RegionIPDto();
regionIP.setId(1);
regionIP.setPlace("昆仑");
regionIP.setServerIP("192.168.1.142");
regionIP.setNumMax(10000);
regionIP.setPopulation(4);
regionIPList.add(regionIP);
IPRegionsMap.put("192.168.1.142", regionIPList);
String IPRegions = JSON.toJSONString(IPRegionsMap);
System.out.println(IPRegions);
}
}
......@@ -326,6 +326,12 @@ public class CommonController {
case "随机拜访陌生人":
result = socialServiceProxy.visitStrangerRandom(operationReq);
break;
case "上一个玩家":
result = socialServiceProxy.visitLastOne(operationReq);
break;
case "下一个玩家":
result = socialServiceProxy.visitNextOne(operationReq);
break;
case "添加好友":
result = socialServiceProxy.addFriendAsk(operationReq);
break;
......@@ -530,6 +536,123 @@ public class CommonController {
case "帮助-植物对应宠物":
result = helpServiceProxy.PlantAttractPetCheck(operationReq);
break;
case "帮助-不能种植原因":
result = helpServiceProxy.PlantingFailCheck(operationReq);
break;
case "帮助-不能成熟原因":
result = helpServiceProxy.PlantMatureFailCheck(operationReq);
break;
case "帮助-伴生植物":
result = helpServiceProxy.nearPlanRuleCheck(operationReq);
break;
case "帮助-伴生宠物":
result = helpServiceProxy.nearPetRuleCheck(operationReq);
break;
case "帮助-园丁等级":
result = helpServiceProxy.gardenerLevelExplainCheck(operationReq);
break;
case "帮助-园丁升级":
result = helpServiceProxy.gardenerUpgradeExplainCheck(operationReq);
break;
case "帮助-园丁升级任务":
result = helpServiceProxy.gardenerUpgradeTaskCheck(operationReq);
break;
case "帮助-园丁升级消耗":
result = helpServiceProxy.gardenerUpgradeCostCheck(operationReq);
break;
case "帮助-园丁功能":
result = helpServiceProxy.gardenerLevelAbilityCheck(operationReq);
break;
case "查询园丁技能说明":
result = helpServiceProxy.gardenerSkillRuleCheck(operationReq);
break;
case "查询园丁技能重置规则":
result = helpServiceProxy.gardenerSkillResetRuleCheck(operationReq);
break;
case "查询园丁技能详情":
result = helpServiceProxy.gardenerLevelSkillRuleCheck(operationReq);
break;
case "查询园丁技能获得方式":
result = helpServiceProxy.gardenerSkilGetlRuleCheck(operationReq);
break;
case "查询背包查看方式说明":
result = helpServiceProxy.backPackRuleCheck(operationReq);
break;
case "查询园丁改名规则":
result = helpServiceProxy.gardenerRenameRuleCheck(operationReq);
break;
case "查询宠物获取方式":
result = helpServiceProxy.petGetRuleCheck(operationReq);
break;
case "查询宠物获取方式说明":
result = helpServiceProxy.petGetByNameRuleCheck(operationReq);
break;
case "查询宠物说明":
result = helpServiceProxy.petExplainCheck(operationReq);
break;
case "查询宠物战斗规则":
result = helpServiceProxy.petFightRuleCheck(operationReq);
break;
case "查询宠物属性说明":
result = helpServiceProxy.petAttributeExplainCheck(operationReq);
break;
case "查询宠物属性克制":
result = helpServiceProxy.petAttributeRestrainCheck(operationReq);
break;
case "查询宠物稀有度说明":
result = helpServiceProxy.petRarityCheck(operationReq);
break;
case "查询宠物资料":
result = helpServiceProxy.petInfoCheck(operationReq);
break;
case "查询宠物维护品":
result = helpServiceProxy.petCostCheck(operationReq);
break;
case "查询拜访陌生人规则":
result = helpServiceProxy.visitStrangerRuleCheck(operationReq);
break;
case "查询偷菜规则":
result = helpServiceProxy.stealStrangerRuleCheck(operationReq);
break;
case "查询偷菜简报规则":
result = helpServiceProxy.stealReportRuleCheck(operationReq);
break;
case "查询拜访好友规则":
result = helpServiceProxy.visitFriendRuleCheck(operationReq);
break;
case "查询好友申请规则":
result = helpServiceProxy.addFriendRuleCheck(operationReq);
break;
case "查询好友帮助规则":
result = helpServiceProxy.helpFriendRuleCheck(operationReq);
break;
case "查询好友帮助报酬规则":
result = helpServiceProxy.helpFriendAwardRuleCheck(operationReq);
break;
case "查询帮助简报规则":
result = helpServiceProxy.helpReportRuleCheck(operationReq);
break;
case "查询购买物品规则":
result = helpServiceProxy.buyGoodsRuleCheck(operationReq);
break;
case "查询出售物品规则":
result = helpServiceProxy.sellItemsRuleCheck(operationReq);
break;
case "查询日常任务规则":
result = helpServiceProxy.dailyTaskRuleCheck(operationReq);
break;
case "查询排行榜规则":
result = helpServiceProxy.rankingListRuleCheck(operationReq);
break;
case "查询排行榜操作规则":
result = helpServiceProxy.rankingListRuleLookCheck(operationReq);
break;
case "重开引导指令":
result = helpServiceProxy.backgroundStoryCheck(operationReq);
break;
case "查询货币说明":
result = helpServiceProxy.moneyExplainCheck(operationReq);
break;
}
log.info(operationReq.getUid() + "已完成操作:【" + commonRequest.getVars().get操作名() + "】");
return result;
......
package com.qiwuai.garden.dto;
import lombok.Data;
@Data
public class RegionIPDto {
/**
* id
*/
private Integer id;
/**
* 地区
*/
private String place;
/**
* 地区所在服务器ip
*/
private String serverIP;
/**
* 人数上限
*/
private Integer numMax;
/**
* 该地区现有人数
*/
private Integer population;
}
......@@ -36,6 +36,10 @@ public class ResultResponse {
* 任务完成,玩家每完成一个新手引导任务返回该变量提示bot进入新手引导的话术
*/
private String 任务完成;
/**
* 玩家金币数量,bot话题模块需要该变量
*/
private Integer 玩家金币数量;
/***************************用于清空bot端保留的变量***********************************/
/**
......
......@@ -52,6 +52,10 @@ public class CallRequest {
@JsonProperty(value = "GB_园丁性别")
private String 园丁性别;
/**
* 园丁等级
*/
private String 园丁等级;
/**
* 所属地区
*/
private String 所属地区;
......
......@@ -38,30 +38,28 @@ public class BackPackServiceImpl implements BackPackService {
log.info(uid + "开始查看背包详情");
//获取背包中的所有袋子
Map<Integer, ItemBagDto> itemBags = TimingAcquisition.gardenerMap.get(uid).getBackPack().getItemBags();
StringBuilder feedText = new StringBuilder();
int itemTypeCount = itemBags.size() - 1; //物品种类统计,钱袋除外
int fruitCount = 0; //果实数量统计
int materialCount = 0; //材料数量统计
int otherCount = 0; //其他物品数量统计
//取出背包里的果实袋
Map<Integer, ItemDto> fruitBag = itemBags.get(Constants.ITEM_TYPE_FRUIT).getItemBag();
//取出背包里的材料袋
Map<Integer, ItemDto> materialBag = itemBags.get(Constants.ITEM_TYPE_MATERIAL).getItemBag();
//取出背包里的其他袋
Map<Integer, ItemDto> otherBag = itemBags.get(Constants.ITEM_TYPE_OTHER).getItemBag();
for (ItemDto item : fruitBag.values()) {
fruitCount += item.getItemNum();
}
feedText.append("果实").append(fruitCount).append("个,");
for (ItemDto item : materialBag.values()) {
materialCount += item.getItemNum();
//货币配置信息
Integer moneyId = Integer.parseInt(TimingAcquisition.systemConfigMap.get("money").getValue());
//货币对应种类
Integer moneyType = TimingAcquisition.itemConfigMap.get(moneyId).getItemTypeId();
//遍历所有袋子
for (Map.Entry<Integer, ItemBagDto> entry : itemBags.entrySet()) {
if (!entry.getKey().equals(moneyType)) {
int count = 0; //袋子中某个物品数量统计
Map<Integer, ItemDto> itemBag = entry.getValue().getItemBag();
for (ItemDto item : itemBag.values()) {
count += item.getItemNum();
}
//种类名称
String itemTypeName = TimingAcquisition.itemTypeMap.get(entry.getKey()).getDescription();
feedText.append(itemTypeName).append(count).append("个,");
}
}
feedText.append("材料").append(materialCount).append("个,");
for (ItemDto item : otherBag.values()) {
otherCount += item.getItemNum();
if (feedText.length() != 0) {
feedText.deleteCharAt(feedText.length() - 1);
}
feedText.append("其他").append(otherCount).append("个");
//获取对应话术
String text = SpeechUtil.getGardenerSpeech(Constants.SPEECH_ASIDE, "view_back_pack");
text = SpeechUtil.speechReplaceNum(text, String.valueOf(itemTypeCount), feedText.toString());
......@@ -348,14 +346,26 @@ public class BackPackServiceImpl implements BackPackService {
String uid = operationReq.getUid();
Integer taskAward = operationReq.getTaskAward(); //任务奖励
Integer awardNum = operationReq.getAwardNum(); //奖励数量
log.info(uid + "发放奖励:" + awardNum + "个" + taskAward);
List<ItemDto> awardItemList = new ArrayList<>();
ItemDto item = new ItemDto();
item.setItemId(taskAward);
item.setItemNum(awardNum);
awardItemList.add(item);
//给玩家发放奖励
TimingAcquisition.addAwardItem(uid, awardItemList);
//增加物品
if (awardNum >= 0) {
log.info(uid + "发放奖励:" + awardNum + "个" + taskAward);
List<ItemDto> awardItemList = new ArrayList<>();
ItemDto item = new ItemDto();
item.setItemId(taskAward);
item.setItemNum(awardNum);
awardItemList.add(item);
//给玩家发放奖励
TimingAcquisition.addAwardItem(uid, awardItemList);
} else { //扣除物品
log.info(uid + "扣除:" + awardNum + "个" + taskAward);
List<ItemDto> awardItemList = new ArrayList<>();
ItemDto item = new ItemDto();
item.setItemId(taskAward);
item.setItemNum(awardNum);
awardItemList.add(item);
//给玩家扣除物品
TimingAcquisition.addAwardItem(uid, awardItemList);
}
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈ID(200901);
......
......@@ -138,4 +138,238 @@ public interface HelpService {
* @return CommonResponse
*/
CommonResponse PlantAttractPetCheck(OperationRequest operationReq);
/**
* 帮助-不能种植原因
* @param operationReq
* @return CommonResponse
*/
CommonResponse PlantingFailCheck(OperationRequest operationReq);
/**
* 帮助-不能成熟原因
* @param operationReq
* @return CommonResponse
*/
CommonResponse PlantMatureFailCheck(OperationRequest operationReq);
/**
* 帮助-伴生植物
* @param operationReq
* @return CommonResponse
*/
CommonResponse nearPlanRuleCheck(OperationRequest operationReq);
/**
* 帮助-伴生宠物
* @param operationReq
* @return CommonResponse
*/
CommonResponse nearPetRuleCheck(OperationRequest operationReq);
/**
* 帮助-园丁等级
* @param operationReq
* @return CommonResponse
*/
CommonResponse gardenerLevelExplainCheck(OperationRequest operationReq);
/**
* 帮助-园丁升级
* @param operationReq
* @return CommonResponse
*/
CommonResponse gardenerUpgradeExplainCheck(OperationRequest operationReq);
/**
* 帮助-园丁升级任务
* @param operationReq
* @return CommonResponse
*/
CommonResponse gardenerUpgradeTaskCheck(OperationRequest operationReq);
/**
* 帮助-园丁升级消耗
* @param operationReq
* @return CommonResponse
*/
CommonResponse gardenerUpgradeCostCheck(OperationRequest operationReq);
/**
* 帮助-园丁功能
* @param operationReq
* @return CommonResponse
*/
CommonResponse gardenerLevelAbilityCheck(OperationRequest operationReq);
/**
* 查询园丁技能说明
* @param operationReq
* @return CommonResponse
*/
CommonResponse gardenerSkillRuleCheck(OperationRequest operationReq);
/**
* 查询园丁技能说明
* @param operationReq
* @return CommonResponse
*/
CommonResponse gardenerSkillResetRuleCheck(OperationRequest operationReq);
/**
* 查询园丁技能详情
* @param operationReq
* @return CommonResponse
*/
CommonResponse gardenerLevelSkillRuleCheck(OperationRequest operationReq);
/**
* 查询园丁技能详情
* @param operationReq
* @return CommonResponse
*/
CommonResponse gardenerSkilGetlRuleCheck(OperationRequest operationReq);
/**
* 查询背包查看方式说明
* @param operationReq
* @return CommonResponse
*/
CommonResponse backPackRuleCheck(OperationRequest operationReq);
/**
* 查询园丁改名规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse gardenerRenameRuleCheck(OperationRequest operationReq);
/**
* 查询宠物获取方式
* @param operationReq
* @return CommonResponse
*/
CommonResponse petGetRuleCheck(OperationRequest operationReq);
/**
* 查询宠物获取方式
* @param operationReq
* @return CommonResponse
*/
CommonResponse petGetByNameRuleCheck(OperationRequest operationReq);
/**
* 查询宠物说明
* @param operationReq
* @return CommonResponse
*/
CommonResponse petExplainCheck(OperationRequest operationReq);
/**
* 查询宠物战斗规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse petFightRuleCheck(OperationRequest operationReq);
/**
* 查询宠物属性说明
* @param operationReq
* @return CommonResponse
*/
CommonResponse petAttributeExplainCheck(OperationRequest operationReq);
/**
* 查询宠物属性说明
* @param operationReq
* @return CommonResponse
*/
CommonResponse petAttributeRestrainCheck(OperationRequest operationReq);
/**
* 查询宠物稀有度说明
* @param operationReq
* @return CommonResponse
*/
CommonResponse petRarityCheck(OperationRequest operationReq);
/**
* 查询宠物资料
* @param operationReq
* @return CommonResponse
*/
CommonResponse petInfoCheck(OperationRequest operationReq);
/**
* 查询宠物维护品
* @param operationReq
* @return CommonResponse
*/
CommonResponse petCostCheck(OperationRequest operationReq);
/**
* 查询拜访陌生人规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse visitStrangerRuleCheck(OperationRequest operationReq);
/**
* 查询偷菜规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse stealStrangerRuleCheck(OperationRequest operationReq);
/**
* 查询偷菜简报规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse stealReportRuleCheck(OperationRequest operationReq);
/**
* 查询拜访好友规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse visitFriendRuleCheck(OperationRequest operationReq);
/**
* 查询好友申请规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse addFriendRuleCheck(OperationRequest operationReq);
/**
* 查询好友帮助规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse helpFriendRuleCheck(OperationRequest operationReq);
/**
* 查询好友帮助报酬规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse helpFriendAwardRuleCheck(OperationRequest operationReq);
/**
* 查询帮助简报规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse helpReportRuleCheck(OperationRequest operationReq);
/**
* 查询购买物品规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse buyGoodsRuleCheck(OperationRequest operationReq);
/**
* 查询出售物品规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse sellItemsRuleCheck(OperationRequest operationReq);
/**
* 查询日常任务规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse dailyTaskRuleCheck(OperationRequest operationReq);
/**
* 查询排行榜规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse rankingListRuleCheck(OperationRequest operationReq);
/**
* 查询排行榜操作规则
* @param operationReq
* @return CommonResponse
*/
CommonResponse rankingListRuleLookCheck(OperationRequest operationReq);
/**
* 重开引导指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse backgroundStoryCheck(OperationRequest operationReq);
/**
* 查询物品说明
* @param operationReq
* @return CommonResponse
*/
CommonResponse moneyExplainCheck(OperationRequest operationReq);
}
......@@ -293,7 +293,7 @@ public class MarketServiceImpl implements MarketService {
ItemBagDto itemBag = new ItemBagDto(); //定义背包里的袋子
List<Integer> packPackItemIds = new ArrayList<>();
//根据种类id取出背包里的钱
ItemDto moneyBag = itemBags.get(Constants.ITEM_TYPE_MONEY).getItems(moneyId);
ItemDto moneyBag = itemBags.get(moneyConfig.getItemTypeId()).getItems(moneyId);
Integer money = moneyBag.getItemNum();
//根据用户购买物品类型id找到类型袋中所有物品
itemBag = itemBags.get(itemTypeId);
......@@ -947,7 +947,8 @@ public class MarketServiceImpl implements MarketService {
GoodsPojo goods = entry.getValue();
ItemPojo itemPojo = itemConfigMap.get(goods.getItemId());
if (itemTypeId.equals(itemPojo.getItemTypeId())) {
feedText.append(itemPojo.getName()).append("售价为").append(goods.getDiscount().multiply(new BigDecimal(goods.getPrice()))).append(moneyConfig.getName()).append("/个、");
String price = (goods.getDiscount().multiply(new BigDecimal(goods.getPrice()))).stripTrailingZeros().toPlainString();
feedText.append(itemPojo.getName()).append("售价为").append(price).append(moneyConfig.getName()).append("/个、");
itemIdList.add(itemPojo.getId());
}
}
......
......@@ -31,6 +31,18 @@ public interface SocialService {
*/
CommonResponse visitStrangerRandom(OperationRequest operationReq);
/**
* 上一个玩家
* @param operationReq
* @return CommonResponse
*/
CommonResponse visitLastOne(OperationRequest operationReq);
/**
* 下一个玩家
* @param operationReq
* @return CommonResponse
*/
CommonResponse visitNextOne(OperationRequest operationReq);
/**
* 添加好友
* @param operationReq
* @return CommonResponse
......
......@@ -90,18 +90,24 @@ aside:
- 【旁白@正常】有些植物是需要伴生宠物才能种植的,将伴生宠物放置在花圃中,就可以种植这个植物了,成熟的时候如果没有伴生宠物的话植物也是无法成熟的。
#-----------------------------园丁-------------------------------
#8009:园丁等级
gardener_level_axplain_check:
gardener_level_explain_check:
- 【旁白@正常】园丁可升至最高10级,每级园丁等级都会提升各项能力:宠物养育能力可以提升宠物栏存放宠物的总数,花圃培育能力可以提升花圃开启总数,领导能力可以提升每天率领宠物出击偷菜的次数,同时每升级一次都可以从两个技能中选择一个学习,提升种植植物或是培养宠物的能力。
gardener_upgrade_axplain_check:
gardener_upgrade_explain_check:
- 【旁白@正常】可以通过下达指令‘园丁升级’来进行升级,升级时需要园丁完成下一级的养成任务,同时消耗一定量的‘游戏货币’和材料提升等级,可以询问具体等级对应的升级条件来获知该等级具体的升级需求。
gardener_upgrade_task_check:
- 【旁白@正常】园丁升级至等级【1】需要完成任务:【2】。
gardener_upgrade_check_fail:
- 【旁白@正常】这个等级不存在或没有对应的升级任务。
gardener_upgrade_task_check_none:
- 【旁白@正常】等级【1】没有对应的升级任务。
gardener_upgrade_cost_check:
- 【旁白@正常】园丁升级至等级【1】需要消耗物品为:【2】。
gardener_upgrade_cost_check_none:
- 【旁白@正常】等级【1】无需消耗物品。
gardener_level_ability_check:
- 【旁白@正常】园丁【1】级时,花圃数量上限【2】,宠物栏容量【3】,偷菜和帮助好友次数【3】。
- 【旁白@正常】园丁【1】级时,花圃数量上限【2】,宠物栏容量【3】,偷菜和帮助好友次数【4】。
gardener_level_rule_check_fail_null:
- 【旁白@正常】你还未提供园丁等级,无法查看。目前有等级【1】。
gardener_level_rule_check_fail_over:
- 【旁白@正常】目前仅有园丁等级1至【1】,无法查看。
#8010:园丁技能
gardener_skill_check:
- 【旁白@正常】园丁技能可以提升园丁种植植物和培育宠物的能力,使种植植物的效率提高,宠物的战斗能力增强。园丁每升级1级就可以从上述两种技能当中选择一个,等级越高对应的技能能力越强,可以全部选择提升种植能力,也可以全部选择培育能力,或是自由选择搭配出你认为最适合的技能组合。
......@@ -109,16 +115,16 @@ aside:
- 【旁白@正常】可以下达指令‘重置园丁技能’来重新学习技能,重置需要花费一定的‘游戏货币’,重置次数越多消费的‘游戏货币’数量也会越多,重置后就可以立即重新选择一次技能了。
gardener_level_skill_check:
- 【旁白@正常】园丁等级【1】的两个技能分别为:【2】。
gardener_level_skill_check_fail:
- 【旁白@正常】这个等级没有对应的技能。
gardener_level_skill_check_none:
- 【旁白@正常】等级【1】没有对应的技能。
gardener_skill_get_check:
- 【旁白@正常】首先提升园丁的等级,成功升级以后根据系统提示从两个技能中选择一个就可以了。
#8011:园丁背包
item_save_check:
backpack_rule_check:
- 【旁白@正常】所有的物品都会收纳在园丁的背包中,可以通过指令‘查看背包’来进行查看。查看背包时,首先通过物品分类来告知每个分类的具体物品数量,此时可以指定一个物品分类来获知更具体的物品数量,也可以询问‘背包里有没有某个物品’来获知是否有该物品,有多少该物品的信息。
#8012:其他问题
gardener_rename_check:
- 【旁白@正常】园丁可以通过下达‘园丁改名’指令进行改名,下达指令后提供需要更改的名称就可以了,每次改名都要花费【1】【2】,当然第一次改名是免费的。
- 【旁白@正常】园丁可以通过下达‘园丁改名’指令进行改名,下达指令后提供需要更改的名称就可以了,每次改名都要花费【1】,当然第一次改名是免费的。
#-----------------------------宠物-------------------------------
#8013:宠物获取
pet_get_check:
......@@ -134,13 +140,21 @@ aside:
pet_attribute_check:
- 【旁白@正常】宠物的属性一共有【1】种,和植物的属性一致,分别为:【2】,一般情况下宠物都会喜欢与自己属性相同的植物,还有些罕见的宠物会同时具有两个属性。
pet_attribute_restrain_check:
- 【旁白@正常】宠物属性相克,在克制对方宠物属性时造成的伤害为攻击力的【1】倍,受到对方伤害为攻击力的50%。在计算同时具有两种属性的情况下,最多伤害倍数为【2】倍,最多承受伤害倍数为25%。属性克制关系如下:【3】。
- 【旁白@正常】宠物属性相克,在克制对方宠物属性时造成的伤害为攻击力的【1】倍,受到对方伤害为攻击力的【2】。在计算同时具有两种属性的情况下,最多伤害倍数为【3】倍,最多承受伤害倍数为【4】。属性克制关系如下:【5】。
pet_rarity_check:
- 【旁白@正常】宠物的稀有度决定了宠物出现的概率,稀有度等级越高的,出现概率就越低,但同时战斗力也会更高。稀有度等级如下:【1】。
pet_info_check:
- 【旁白@正常】【1】【2】,稀有度为【3】,属性【4】,生命【5】,攻击【6】,在花圃中可能会遗留【7】,喜欢植物:【8】。
- 【旁白@正常】【1】 【2】,稀有度为【3】,属性【4】,生命【5】,攻击【6】,在花圃中可能会遗留【7】,喜欢植物:【8】。
pet_info_check_none:
- 【旁白@正常】【1】 【2】,稀有度为【3】,属性【4】,生命【5】,攻击【6】,不会在花圃中遗留物品,喜欢植物:【7】。
pet_cost_check:
- 【旁白@正常】【1】需要每天消耗【2】。
pet_cost_check_none:
- 【旁白@正常】【1】无需消耗物品。
pet_check_fail_null:
- 【旁白@正常】你还没有提供宠物名称,暂时无法查看。
pet_check_fail_not_exist:
- 【旁白@正常】该宠物不存在,暂时无法查看。
#-----------------------------社交-------------------------------
#8016:陌生人
visit_strange_rule_check:
......@@ -148,7 +162,7 @@ aside:
steal_stranger_rule_check:
- 【旁白@正常】在拜访时,通过下达‘偷取果实’指令进行偷菜,如果没有另外指定一个花圃编号的话就会随机选取一个有成熟果实的花圃偷菜。当然偷菜需要宠物进行战斗,双方宠物栏中的宠物1对1的进行作战,胜利的话就可以成功偷菜,成功偷菜会获得所有该花圃的产出包括各种掉落物品。战斗失败或平局就没办法偷菜了。对同一个陌生人偷菜后需要等待‘配置冷却时间’才可以再次对其偷菜。
steal_report_rule_check:
- 【旁白@正常】被其他人偷菜后,您会收到一条偷菜简报,通过下达指令‘查看偷菜简报’进行查看,简报会存放总数100条,每一条的存放时间为1天。查看简报时可以选择查看详细的战斗过程,战斗过程需要根据每一轮战斗单独查看详情。
- 【旁白@正常】被其他人偷菜后,您会收到一条偷菜简报,通过下达指令‘查看偷菜简报’进行查看,简报会存放总数【1】条,每一条的存放时间为【2】天。查看简报时可以选择查看详细的战斗过程,战斗过程需要根据每一轮战斗单独查看详情。
#8017:好友
visit_friend_rule_check:
- 【旁白@正常】可以通过下达指令‘拜访好友’拜访一名随机匹配的好友,或是加上好友地址拜访指定的好友,也可以说‘拜访一名有成熟果实的好友’来随机拜访一名满足条件的好友。跨区拜访好友时也需要花费‘数量’‘游戏货币’才能拜访。
......@@ -159,7 +173,7 @@ aside:
help_friend_award_rule_check:
- 【旁白@正常】可以通过下达指令‘设置帮助收益报酬’来设置,需要你提供花圃编号和比例参数,每个花圃需要单独设置报酬比例,如果不进行设置的话默认报酬比例为【1】,可以设置比例范围是【2】至【3】之间的任意整数百分比。
help_report_rule_check:
- 【旁白@正常】好友帮助收取果实后会给您发送一封帮助简报,您可以通过下达指令‘查看帮助简报’进行查看,帮助简报记录了好友帮助您收取的花圃、植物、时间以及获得的果实详情。简报存放数量上限为100,每个简报存放时间为1天。
- 【旁白@正常】好友帮助收取果实后会给您发送一封帮助简报,您可以通过下达指令‘查看帮助简报’进行查看,帮助简报记录了好友帮助您收取的花圃、植物、时间以及获得的果实详情。简报存放数量上限为【1】,每个简报存放时间为【2】天。
#-----------------------------市场-------------------------------
#8018:购买物品
buy_goods_rule_check:
......
......@@ -127,7 +127,7 @@ aside:
man:
#宠物查询
pet_view_nursery:
- 【男园丁@正常】真是可爱的小动物,主人我陪去你去看看吧。
- 【男园丁@正常】真是可爱的小动物。
- 【男园丁@正常】有它们在,我们就不必害怕别人来偷植物了。
- 【男园丁@正常】这些小家伙一定会好好守护我们的植物的!
pet_view_field:
......@@ -294,7 +294,7 @@ man:
woman:
#宠物查询
pet_view_nursery:
- 【女园丁@正常】走走走,我想去看看小动物。
- 【女园丁@正常】好可爱的小动物耶。
- 【女园丁@正常】动物们可以保护我们种植的植物,不被人偷走!
- 【女园丁@正常】这些动物真让我安心,不用担心别人会来偷走我们的植物了。
pet_view_field:
......
......@@ -144,21 +144,29 @@ aside:
search_nursery_to_type:
- 【旁白@正常】当前花圃可选择升级为【1】
search_upgrade_condition:
- 【旁白@正常】升级为【1】,需要种植【2】,即可升级该花圃。
- 【旁白@正常】升级为【1】,需要完整种植【2】,即可升级该花圃。
search_upgrade_condition_fail_none:
- 【旁白@正常】【1】不是可选择的花圃类型,当前花圃可选择升级为【2】。
search_upgrade_condition_fail_over:
- 【旁白@正常】可选择的花圃类型只有【1】个。可选择升级为【2】。
search_upgrade_condition_fail_not_exist:
- 【旁白@正常】不存在该花圃类型。
nursery_upgrade_fail_no_ore:
- 【旁白@正常】还未检查花圃可升级的花圃类型,请选择花圃类型后再升级。
nursery_upgrade_fail_limit_level:
- 【旁白@正常】花圃【1】等级为【2】,不能超过目前的园丁等级【3】。
nursery_upgrade_fail_planted:
- 【旁白@正常】升级失败,该花圃需要种植【1】植物【2】次,目前已种植【3】次,还需要【4】次。
- 【旁白@正常】升级失败,该花圃需要种植【1】【2】次,目前已种植【3】次,还需要【4】次。
nursery_upgrade_fail_type:
- 【旁白@正常】没有这个类型的花圃,当前花圃可选择升级为【1】。
nursery_upgrade_fail_no_money:
- 【旁白@正常】升级失败,目前没有【1】,需要消耗【1】【2】个。
nursery_upgrade_fail_money:
- 【旁白@正常】升级失败,货币不足,需要消耗【1】【2】个,没有足够的【3】。
- 【旁白@正常】升级失败,目前有【1】个【3】,需要消耗【2】个【3】,没有足够的【3】。
nursery_upgrade_fail_no_material:
- 【旁白@正常】升级失败,目前没有【1】,需要消耗【1】【2】个。
nursery_upgrade_fail_material:
- 【旁白@正常】升级失败,材料不足,需要消耗【1】【2】个,没有足够的【3】。
- 【旁白@正常】升级失败,目前有【1】个【3】,需要消耗【2】个【3】,没有足够的【3】。
nursery_upgrade_cancel:
- 【旁白@正常】已为你取消花圃【1】的升级。
nursery_upgrade_fail_no_type:
......@@ -194,10 +202,12 @@ aside:
- 【旁白@正常】花圃【1】的【2】还有【3】成熟,预计成熟时间【4】。
check_plant_mature_time_fail_no_plant:
- 【旁白@正常】花圃【1】还没有种植植物。
check_plant_mature_time_fail_no_num:
- 【旁白@正常】你还未提供花圃编号,暂时无法查看。目前有【1】。
check_plant_mature_time_fail_wrong_num:
- 【旁白@正常】该花圃编号不存在。
- 【旁白@正常】该花圃编号不存在。目前有【1】。
check_plant_mature_time_fail_num_over:
- 【旁白@正常】花圃编号【1】越界。
- 【旁白@正常】花圃编号【1】越界。目前有【2】。
check_plant_mature_time_fail_plant_error:
- 【旁白@正常】不存在该植物。
check_plant_mature_time_fail_num_plant_dif:
......@@ -366,9 +376,9 @@ man:
nursery_upgrade_fail_type:
- 【男园丁@正常】没有这类花圃哦,主人要不你再看一下。
nursery_upgrade_fail_money:
- 【男园丁@正常】货币数量不足,无法进行升级呢主人……我还是陪主人你再去找找吧。
- 【男园丁@正常】【1】数量不足,无法进行升级呢主人……我还是陪主人你再去找找吧。
nursery_upgrade_fail_material:
- 【男园丁@正常】材料数量不足,无法进行升级呢主人……我还是陪主人你再去找找吧。
- 【男园丁@正常】【1】数量不足,无法进行升级呢主人……我还是陪主人你再去找找吧。
nursery_upgrade_fail_no_type:
- 【男园丁@正常】主人,没有可选择的花圃类型了。
#重置花圃
......@@ -563,9 +573,9 @@ woman:
nursery_upgrade_fail_type:
- 【女园丁@正常】没有这种类型花圃哦,主人我们再看看吧。
nursery_upgrade_fail_money:
- 【女园丁@正常】啊,主人,没钱啦,我们先去存钱吧。
- 【女园丁@正常】啊,主人,没【1】啦,我们先去存钱吧。
nursery_upgrade_fail_material:
- 【女园丁@正常】可惜这种材料不够,不然就成功了,主人,我们再去收集点。
- 【女园丁@正常】可惜这种【1】不够,不然就成功了,主人,我们再去收集点。
nursery_upgrade_fail_no_type:
- 【女园丁@正常】主人,没有找到可选择的花圃类型以供升级哦。
#重置花圃
......
......@@ -4,7 +4,7 @@ aside:
visit_stranger_check:
- 【旁白@正常】你正在拜访【1】。
visit_stranger_check_fail_no_exist:
- 【旁白@正常】不存在这个人。
- 【旁白@正常】不存在该玩家。已为你找到最近的玩家【1】,是否前往?
visit_stranger_check_cross:
- 【旁白@正常】前往【1】区域需要花费【2】【3】,是否前往?
visit_stranger_check_cross_fail:
......
......@@ -30,7 +30,7 @@ aside:
daily_task_finished:
- 【旁白@正常】日常【1】任务已完成,获得奖励:【2】。
daily_task_all_finished:
- 【旁白@正常】日常【1】任务已完成,今日任务已全部完成,获得奖励【2】。
- 【旁白@正常】【1】已全部完成,获得奖励【2】。
......
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