Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
inference-game
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周君强
inference-game
Commits
d4c7ebca
Commit
d4c7ebca
authored
Jan 03, 2023
by
周君强
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.推理项目第一版
parent
7d2055fe
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
2939 additions
and
377 deletions
+2939
-377
pom.xml
pom.xml
+5
-0
InferenceApplication.java
src/main/java/com/qiwu/inference/InferenceApplication.java
+8
-1
InitSysServlet.java
src/main/java/com/qiwu/inference/common/InitSysServlet.java
+53
-0
TimingAcquisition.java
...ain/java/com/qiwu/inference/common/TimingAcquisition.java
+29
-2
TaskTipsThread.java
.../java/com/qiwu/inference/common/cache/TaskTipsThread.java
+68
-0
DataTrimUtil.java
...in/java/com/qiwu/inference/common/utils/DataTrimUtil.java
+11
-4
PlayerUtil.java
...main/java/com/qiwu/inference/common/utils/PlayerUtil.java
+771
-81
RequestConversionUtil.java
...om/qiwu/inference/common/utils/RequestConversionUtil.java
+7
-1
SpeechUtil.java
...main/java/com/qiwu/inference/common/utils/SpeechUtil.java
+715
-3
CommonController.java
.../java/com/qiwu/inference/controller/CommonController.java
+23
-1
EndGoalMapper.java
src/main/java/com/qiwu/inference/dao/EndGoalMapper.java
+3
-1
BarrierTaskKeyDto.java
src/main/java/com/qiwu/inference/dto/BarrierTaskKeyDto.java
+39
-0
ClueDto.java
src/main/java/com/qiwu/inference/dto/ClueDto.java
+28
-9
DemandTaskDto.java
src/main/java/com/qiwu/inference/dto/DemandTaskDto.java
+54
-19
LocationInfoDto.java
src/main/java/com/qiwu/inference/dto/LocationInfoDto.java
+24
-0
PersonInfoDto.java
src/main/java/com/qiwu/inference/dto/PersonInfoDto.java
+8
-0
Player.java
src/main/java/com/qiwu/inference/dto/Player.java
+48
-19
PostTaskDto.java
src/main/java/com/qiwu/inference/dto/PostTaskDto.java
+17
-0
PostTaskRecordDto.java
src/main/java/com/qiwu/inference/dto/PostTaskRecordDto.java
+27
-0
TaskStatusDto.java
src/main/java/com/qiwu/inference/dto/TaskStatusDto.java
+15
-0
ChatSpeech.java
src/main/java/com/qiwu/inference/pojo/ChatSpeech.java
+44
-0
ClueSpeech.java
src/main/java/com/qiwu/inference/pojo/ClueSpeech.java
+47
-0
EndGoal.java
src/main/java/com/qiwu/inference/pojo/EndGoal.java
+50
-47
Location.java
src/main/java/com/qiwu/inference/pojo/Location.java
+54
-51
PersonSpeech.java
src/main/java/com/qiwu/inference/pojo/PersonSpeech.java
+26
-0
TaskSpeech.java
src/main/java/com/qiwu/inference/pojo/TaskSpeech.java
+53
-0
TipSpeech.java
src/main/java/com/qiwu/inference/pojo/TipSpeech.java
+23
-0
AskServiceImpl.java
...a/com/qiwu/inference/service/ask/impl/AskServiceImpl.java
+0
-10
BarrierServiceImpl.java
...wu/inference/service/barrier/impl/BarrierServiceImpl.java
+162
-8
ChatService.java
...ain/java/com/qiwu/inference/service/chat/ChatService.java
+9
-0
ChatServiceImpl.java
...com/qiwu/inference/service/chat/impl/ChatServiceImpl.java
+57
-0
CheckServiceImpl.java
...m/qiwu/inference/service/check/impl/CheckServiceImpl.java
+168
-21
CommonService.java
...java/com/qiwu/inference/service/common/CommonService.java
+9
-0
LoginService.java
...n/java/com/qiwu/inference/service/login/LoginService.java
+2
-0
LoginServiceImpl.java
...m/qiwu/inference/service/login/impl/LoginServiceImpl.java
+113
-6
PlayerServiceImpl.java
...qiwu/inference/service/player/impl/PlayerServiceImpl.java
+0
-0
application-pro.yml
src/main/resources/application-pro.yml
+35
-0
application.yml
src/main/resources/application.yml
+2
-2
EndGoalMapper.xml
src/main/resources/com/qiwu/inference/dao/EndGoalMapper.xml
+4
-0
ask.yaml
src/main/resources/speech/ask.yaml
+40
-26
barrier.yaml
src/main/resources/speech/barrier.yaml
+5
-3
check.yaml
src/main/resources/speech/check.yaml
+12
-3
task.yaml
src/main/resources/speech/task.yaml
+71
-59
No files found.
pom.xml
View file @
d4c7ebca
...
...
@@ -117,6 +117,11 @@
<artifactId>
hutool-all
</artifactId>
<version>
5.8.8
</version>
</dependency>
<dependency>
<groupId>
org.apache.poi
</groupId>
<artifactId>
poi-ooxml
</artifactId>
<version>
4.1.2
</version>
</dependency>
</dependencies>
<properties>
...
...
src/main/java/com/qiwu/inference/InferenceApplication.java
View file @
d4c7ebca
package
com
.
qiwu
.
inference
;
import
com.qiwu.inference.common.TimingAcquisition
;
import
com.qiwu.inference.common.cache.ExpireThread
;
import
com.qiwu.inference.common.cache.TaskTipsThread
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringBootConfiguration
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
...
...
@@ -10,5 +11,11 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
public
class
InferenceApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
InferenceApplication
.
class
,
args
);
ExpireThread
expireThread
=
new
ExpireThread
();
Thread
thread
=
new
Thread
(
expireThread
);
thread
.
start
();
// TaskTipsThread taskTipsThread = new TaskTipsThread();
// Thread taskThread = new Thread(taskTipsThread);
// taskThread.start();
}
}
src/main/java/com/qiwu/inference/common/InitSysServlet.java
View file @
d4c7ebca
...
...
@@ -3,7 +3,9 @@ package com.qiwu.inference.common;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.qiwu.inference.common.utils.PersistenceUtil
;
import
com.qiwu.inference.common.utils.SpeechUtil
;
import
com.qiwu.inference.dao.*
;
import
com.qiwu.inference.dto.BarrierTaskKeyDto
;
import
com.qiwu.inference.dto.Person
;
import
com.qiwu.inference.dto.Player
;
import
com.qiwu.inference.pojo.*
;
...
...
@@ -40,6 +42,8 @@ public class InitSysServlet implements InitializingBean {
private
DemandTaskMapper
demandTaskMapper
;
@Autowired
private
DispositionMapper
dispositionMapper
;
@Autowired
private
EndGoalMapper
endGoalMapper
;
/**
* 保存配置信息到缓存
...
...
@@ -53,6 +57,17 @@ public class InitSysServlet implements InitializingBean {
TimingAcquisition
.
gateInfoMap
.
putAll
(
gateInfoMap
);
log
.
info
(
"关卡数据缓存完成"
);
for
(
Map
.
Entry
<
String
,
List
<
Person
>>
entry
:
gateInfoMap
.
entrySet
())
{
String
gateNo
=
entry
.
getKey
();
//-------------------------缓存关卡攻略数据---------------------
log
.
info
(
"开始缓存关卡攻略数据"
);
String
barrierTaskKey
=
PersistenceUtil
.
getConfigFromFile
(
configFilePath
,
"results_final_task.json"
);
List
<
BarrierTaskKeyDto
>
barrierTaskKeyList
=
JSON
.
parseObject
(
barrierTaskKey
,
new
TypeReference
<
List
<
BarrierTaskKeyDto
>>(){});
Map
<
String
,
List
<
BarrierTaskKeyDto
>>
barrierTaskKeyMap
=
new
ConcurrentHashMap
<>();
barrierTaskKeyMap
.
put
(
gateNo
,
barrierTaskKeyList
);
TimingAcquisition
.
barrierTaskKeyMap
.
putAll
(
barrierTaskKeyMap
);
log
.
info
(
"关卡攻略数据缓存完成"
);
}
//--------------------------加载玩家数据----------------------
...
...
@@ -79,6 +94,35 @@ public class InitSysServlet implements InitializingBean {
//--------------------加载话术-----------------
TimingAcquisition
.
speechLoading
(
speechFilePath
);
//--------------------加载闲聊话术的excel表----------------
log
.
info
(
"加载闲聊话术"
);
Map
<
Integer
,
List
<
ChatSpeech
>>
chatSpeechMap
=
SpeechUtil
.
getChatSpeechModel
(
speechFilePath
);
TimingAcquisition
.
chatSpeechMap
.
putAll
(
chatSpeechMap
);
log
.
info
(
"闲聊话术加载完成"
);
//--------------------加载线索成功话术的excel表----------------
log
.
info
(
"加载线索成功话术"
);
Map
<
Integer
,
List
<
ClueSpeech
>>
clueSpeechMap
=
SpeechUtil
.
getClueSpeechModel
(
speechFilePath
);
TimingAcquisition
.
successClueSpeechMap
.
putAll
(
clueSpeechMap
);
log
.
info
(
"线索成功话术加载完成"
);
//--------------------加载任务成功话术的excel表----------------
log
.
info
(
"加载任务成功话术"
);
Map
<
Integer
,
List
<
TaskSpeech
>>
taskSpeechMap
=
SpeechUtil
.
getTaskSpeechModel
(
speechFilePath
);
TimingAcquisition
.
successTaskSpeechMap
.
putAll
(
taskSpeechMap
);
log
.
info
(
"任务成功话术加载完成"
);
//--------------------加载任务成功话术的excel表----------------
log
.
info
(
"加载任务提示话术"
);
Map
<
Integer
,
List
<
TipSpeech
>>
tipSpeechMap
=
SpeechUtil
.
getTipSpeechModel
(
speechFilePath
);
TimingAcquisition
.
tipSpeechMap
.
putAll
(
tipSpeechMap
);
log
.
info
(
"任务提示话术加载完成"
);
//--------------------加载人物见面话术的excel表----------------
log
.
info
(
"加载人物见面话术"
);
Map
<
String
,
List
<
PersonSpeech
>>
personSpeechMap
=
SpeechUtil
.
getPersonSpeechModel
(
speechFilePath
);
TimingAcquisition
.
personSpeechMap
.
putAll
(
personSpeechMap
);
log
.
info
(
"人物见面话术加载完成"
);
//-----------------缓存场所信息------------------
...
...
@@ -134,5 +178,14 @@ public class InitSysServlet implements InitializingBean {
}
TimingAcquisition
.
systemConfigMap
.
putAll
(
systemConfigMap
);
log
.
info
(
"系统配置信息缓存完成"
);
//-----------------缓存结局目标配置信息------------------
Map
<
Integer
,
EndGoal
>
endGoalMap
=
new
ConcurrentHashMap
<>();
List
<
EndGoal
>
endGoalList
=
endGoalMapper
.
findAll
();
for
(
EndGoal
endGoal
:
endGoalList
)
{
endGoalMap
.
put
(
endGoal
.
getId
(),
endGoal
);
}
TimingAcquisition
.
endGoalMap
.
putAll
(
endGoalMap
);
log
.
info
(
"结局目标配置信息缓存完成"
);
}
}
src/main/java/com/qiwu/inference/common/TimingAcquisition.java
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
common
;
import
com.qiwu.inference.common.utils.PersistenceUtil
;
import
com.qiwu.inference.
common.utils.YamlUtil
;
import
com.qiwu.inference.
dto.BarrierTaskKeyDto
;
import
com.qiwu.inference.dto.Person
;
import
com.qiwu.inference.dto.Player
;
import
com.qiwu.inference.pojo.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.StringUtils
;
...
...
@@ -23,6 +22,10 @@ public class TimingAcquisition {
*/
public
volatile
static
Map
<
String
,
List
<
Person
>>
gateInfoMap
=
new
ConcurrentHashMap
<>();
/**
* 关卡攻略信息,Map<关卡编号, List<攻略任务>>
*/
public
volatile
static
Map
<
String
,
List
<
BarrierTaskKeyDto
>>
barrierTaskKeyMap
=
new
ConcurrentHashMap
<>();
/**
* 用户id跟关卡编号对应关系
*/
public
volatile
static
Map
<
String
,
String
>
uidGateNoMap
=
new
ConcurrentHashMap
<>();
...
...
@@ -55,6 +58,10 @@ public class TimingAcquisition {
* 系统配置信息
*/
public
volatile
static
Map
<
String
,
SystemConfigPojo
>
systemConfigMap
=
new
ConcurrentHashMap
<>();
/**
* 结局目标配置信息
*/
public
volatile
static
Map
<
Integer
,
EndGoal
>
endGoalMap
=
new
ConcurrentHashMap
<>();
/**
* 询问模块话术
...
...
@@ -72,6 +79,26 @@ public class TimingAcquisition {
* 查看模块话术
*/
public
volatile
static
Map
<
String
,
Map
<
Integer
,
List
<
String
>>>
barrierSpeechMap
=
new
ConcurrentHashMap
<>();
/**
* 闲聊模块话术,Map<意图, List<话术配置>>
*/
public
volatile
static
Map
<
Integer
,
List
<
ChatSpeech
>>
chatSpeechMap
=
new
ConcurrentHashMap
<>();
/**
* 线索成功话术,Map<线索id, List<话术配置>>
*/
public
volatile
static
Map
<
Integer
,
List
<
ClueSpeech
>>
successClueSpeechMap
=
new
ConcurrentHashMap
<>();
/**
* 任务成功话术,Map<任务id, List<话术配置>>
*/
public
volatile
static
Map
<
Integer
,
List
<
TaskSpeech
>>
successTaskSpeechMap
=
new
ConcurrentHashMap
<>();
/**
* 任务提示话术,Map<任务id, List<话术配置>>
*/
public
volatile
static
Map
<
Integer
,
List
<
TipSpeech
>>
tipSpeechMap
=
new
ConcurrentHashMap
<>();
/**
* 人物见面话术,Map<人物名称, List<话术配置>>
*/
public
volatile
static
Map
<
String
,
List
<
PersonSpeech
>>
personSpeechMap
=
new
ConcurrentHashMap
<>();
/**
* 通过yaml文件加载所有话术到缓存中
...
...
src/main/java/com/qiwu/inference/common/cache/TaskTipsThread.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
common
.
cache
;
import
com.qiwu.inference.common.Constants
;
import
com.qiwu.inference.common.TimingAcquisition
;
import
com.qiwu.inference.common.utils.DateUtil
;
import
com.qiwu.inference.dto.Player
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.stereotype.Component
;
import
java.text.ParseException
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
/**
* 任务提示线程
*/
@EnableAsync
@Component
public
class
TaskTipsThread
implements
Runnable
{
@Override
public
void
run
()
{
while
(
true
)
{
try
{
//每60秒检测一次
TimeUnit
.
SECONDS
.
sleep
(
60
);
checkTaskTips
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
/**
* 检测是否需要任务提示
*/
public
void
checkTaskTips
()
throws
ParseException
{
Map
<
String
,
Player
>
playerMap
=
TimingAcquisition
.
playerMap
;
String
nowTime
=
DateUtil
.
getCurrentTime
();
String
tipTime
=
TimingAcquisition
.
systemConfigMap
.
get
(
"tipTime"
).
getValue
();
for
(
Map
.
Entry
<
String
,
Player
>
entry
:
playerMap
.
entrySet
())
{
Player
player
=
entry
.
getValue
();
//在线玩家
if
(
player
.
getStatus
().
equals
(
Constants
.
ONLINE
))
{
//上次提示时间已超过规定时间
if
(
DateUtil
.
subTime
(
nowTime
,
player
.
getNumUpdateTime
())
>=
Long
.
parseLong
(
tipTime
))
{
Map
<
Integer
,
Map
<
Integer
,
Integer
>>
taskMap
=
player
.
getTaskMap
();
//该玩家已完成任务个数
int
num
=
0
;
for
(
Map
.
Entry
<
Integer
,
Map
<
Integer
,
Integer
>>
mapEntry
:
taskMap
.
entrySet
())
{
num
+=
mapEntry
.
getValue
().
size
();
}
//第一次更新,不需要提示。做完了第一个任务之后再去提示
if
(
num
==
0
)
{
continue
;
}
if
(
num
>
player
.
getFinishedTaskNum
())
{
player
.
setFinishedTaskNum
(
num
);
}
else
{
//规定时间内没有完成新的任务,需要提示一个攻略
player
.
setTipFlag
(
true
);
}
player
.
setNumUpdateTime
(
nowTime
);
}
}
}
}
}
src/main/java/com/qiwu/inference/common/utils/DataTrimUtil.java
View file @
d4c7ebca
...
...
@@ -34,10 +34,10 @@ public class DataTrimUtil {
public
static
void
AdjustStatus
(
String
uid
,
String
offlineTime
)
throws
ParseException
{
//玩家当前为离线状态
Player
player
=
TimingAcquisition
.
playerMap
.
get
(
uid
);
//
操作日期为今天之前
,需更改为在线状态
//
上次操作时间过期
,需更改为在线状态
String
nowTime
=
DateUtil
.
getCurrentTime
();
if
(!
StringUtils
.
isEmpty
(
player
.
getOnlineTime
()))
{
if
(
DateUtil
.
compare
(
nowTime
,
player
.
getOnlineTime
())
==
1
)
{
if
(
DateUtil
.
subTime
(
nowTime
,
player
.
getOnlineTime
())
>
(
Long
.
parseLong
(
offlineTime
)
/
1000
)
)
{
//更新玩家在线状态
statusUpdate
(
uid
);
}
...
...
@@ -65,7 +65,7 @@ public class DataTrimUtil {
/**
* 判断整数尾数是否为1
*/
public
static
CommonResult
<
ResultVarsResponse
>
AdjustParams
(
CommonResult
<
ResultVarsResponse
>
result
)
{
public
static
CommonResult
<
ResultVarsResponse
>
AdjustParams
(
String
uid
,
CommonResult
<
ResultVarsResponse
>
result
)
{
if
(
StringUtils
.
isEmpty
(
result
))
{
return
CommonResult
.
failed
(
"操作失败"
);
}
...
...
@@ -88,7 +88,14 @@ public class DataTrimUtil {
", 后台附加返回:"
+
data
.
getVars
().
get
后台附加返回
()
+
", 后台附加返回2:"
+
data
.
getVars
().
get
后台附加返回
2
()
+
"]"
;
//玩家有新消息提示
//需要给玩家提示任务线索
// if (TimingAcquisition.playerMap.get(uid).isTipFlag()) {
// String addText = PlayerUtil.getClueFromTaskKey(uid);
// if (!StringUtils.isEmpty(addText)) {
// TimingAcquisition.playerMap.get(uid).setTipFlag(false);
// data.getVars().set反馈文本(data.getVars().get反馈文本() + "【寒烟@正常】" + addText);
// }
// }
log
.
info
(
feedContent
);
}
return
result
;
...
...
src/main/java/com/qiwu/inference/common/utils/PlayerUtil.java
View file @
d4c7ebca
...
...
@@ -3,13 +3,77 @@ package com.qiwu.inference.common.utils;
import
com.qiwu.inference.common.Constants
;
import
com.qiwu.inference.common.TimingAcquisition
;
import
com.qiwu.inference.dto.*
;
import
com.qiwu.inference.pojo.Location
;
import
org.springframework.util.StringUtils
;
import
java.io.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
public
class
PlayerUtil
{
/**
* 通过角色身份找到对应的人物名称
* @param name
*/
public
static
String
getName
(
String
uid
,
String
name
)
{
Map
<
Integer
,
Person
>
personMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
();
for
(
Map
.
Entry
<
Integer
,
Person
>
entry
:
personMap
.
entrySet
())
{
Person
person
=
entry
.
getValue
();
//name为身份或人物名称
if
(
person
.
getIdentityName
().
equals
(
name
)
||
person
.
getName
().
equals
(
name
))
{
return
person
.
getName
();
}
}
return
name
;
}
/**
* 查询符合条件的线索
* @param current
* @param subject
* @param type
* @return
*/
public
static
List
<
ClueDto
>
findClues
(
Person
current
,
Person
subject
,
Integer
type
){
List
<
ClueDto
>
result
=
new
ArrayList
<>();
if
(!
StringUtils
.
isEmpty
(
current
)){
List
<
ClueDto
>
clueList
=
current
.
getClues
();
for
(
int
i
=
0
;
i
<
clueList
.
size
();
i
++){
ClueDto
clue
=
clueList
.
get
(
i
);
if
(
clue
.
getClueName
().
equals
(
"追回失踪的货款"
)&&
type
==
9
&&
subject
.
getId
()==
1
){
System
.
out
.
println
(
"----------"
);
}
if
(
type
.
equals
(
clue
.
getType
())
&&
clue
.
getSubject
()
==
subject
.
getId
()){
result
.
add
(
clue
);
}
}
}
return
result
;
}
/**
* 判断是否符合阈值需求
* @param person
* @param clueList
* @return
*/
public
static
List
<
ClueDto
>
checkThreshold
(
Person
person
,
List
<
ClueDto
>
clueList
){
List
<
ClueDto
>
result
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
clueList
.
size
();
i
++){
ClueDto
clue
=
clueList
.
get
(
i
);
//判断是否符合阈值需求
boolean
flag
=
false
;
if
(
person
.
getTrustDegree
()
>=
clue
.
getTrustDegree
()||
person
.
getDeterrenceDegree
()
>=
clue
.
getThreaten
()){
flag
=
true
;
}
if
(
flag
){
//符合阈值要求
result
.
add
(
clue
);
}
}
return
result
;
}
/**
* 获取玩家关卡中人物所在的所有场所
*/
public
static
List
<
String
>
getLocationByUid
(
String
uid
)
{
...
...
@@ -42,19 +106,12 @@ public class PlayerUtil {
*/
public
static
String
getLocations
(
String
uid
)
{
StringBuilder
text
=
new
StringBuilder
();
List
<
String
>
locationIdList
=
new
ArrayList
<>();
Map
<
Integer
,
Person
>
personMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
();
for
(
Map
.
Entry
<
Integer
,
Person
>
entry
:
personMap
.
entrySet
())
{
Person
person
=
entry
.
getValue
();
if
(!
StringUtils
.
isEmpty
(
person
.
getLocation
()))
{
if
(!
locationIdList
.
contains
(
person
.
getLocation
()))
{
locationIdList
.
add
(
person
.
getLocation
());
}
Map
<
String
,
LocationInfoDto
>
locationMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getLocationMap
();
for
(
Map
.
Entry
<
String
,
LocationInfoDto
>
entry
:
locationMap
.
entrySet
())
{
if
(!
"1"
.
equals
(
entry
.
getValue
().
getIsHidden
()))
{
text
.
append
(
TimingAcquisition
.
locationMap
.
get
(
entry
.
getKey
()).
getName
()).
append
(
"、"
);
}
}
for
(
String
locationId
:
locationIdList
)
{
text
.
append
(
TimingAcquisition
.
locationMap
.
get
(
locationId
).
getName
()).
append
(
"、"
);
}
if
(
text
.
length
()
!=
0
)
{
text
.
deleteCharAt
(
text
.
length
()
-
1
);
}
...
...
@@ -65,11 +122,12 @@ public class PlayerUtil {
* 通过场所id找到场所的所有人物
*/
public
static
List
<
Integer
>
getPersonsByLocationId
(
String
uid
,
String
locationId
)
{
List
<
Integer
>
personIdList
=
new
ArrayList
<>();
Map
<
Integer
,
Person
>
personMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
();
for
(
Map
.
Entry
<
Integer
,
Person
>
entry
:
personMap
.
entrySet
())
{
if
(
locationId
.
equals
(
entry
.
getValue
().
getLocation
()))
{
personIdList
.
add
(
entry
.
getKey
());
List
<
Integer
>
personIdList
=
null
;
Map
<
String
,
LocationInfoDto
>
locationMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getLocationMap
();
if
(!
StringUtils
.
isEmpty
(
locationMap
.
get
(
locationId
)))
{
Map
<
Integer
,
Integer
>
personIdMap
=
locationMap
.
get
(
locationId
).
getPersonInfoMap
();
if
(
personIdMap
.
size
()
!=
0
)
{
personIdList
=
new
ArrayList
<>(
personIdMap
.
keySet
());
}
}
return
personIdList
;
...
...
@@ -110,12 +168,16 @@ public class PlayerUtil {
/**
* 记录玩家已获得线索
*/
public
static
void
recordClue
(
String
uid
,
Integer
personId
,
Integer
clueTypeId
,
ClueDto
clue
)
{
public
static
void
recordClue
(
String
uid
,
Integer
sourceId
,
Integer
personId
,
Integer
clueTypeId
,
ClueDto
clue
)
{
Map
<
Integer
,
Map
<
Integer
,
List
<
ClueDto
>>>
clueMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getClueMap
();
Map
<
Integer
,
List
<
ClueDto
>>
clueListMap
=
new
ConcurrentHashMap
<>();
List
<
ClueDto
>
clueList
=
new
ArrayList
<>();
//线索来源的人物id
List
<
Integer
>
sourceIdList
=
new
ArrayList
<>();
sourceIdList
.
add
(
sourceId
);
//玩家还没有收集此人的线索
if
(
StringUtils
.
isEmpty
(
clueMap
.
get
(
personId
)))
{
clue
.
setSourceIdList
(
sourceIdList
);
clueList
.
add
(
clue
);
clueListMap
.
put
(
clueTypeId
,
clueList
);
clueMap
.
put
(
personId
,
clueListMap
);
...
...
@@ -123,6 +185,7 @@ public class PlayerUtil {
}
//玩家还没有收集到此人这类的线索
if
(
StringUtils
.
isEmpty
(
clueMap
.
get
(
personId
).
get
(
clueTypeId
)))
{
clue
.
setSourceIdList
(
sourceIdList
);
clueList
.
add
(
clue
);
clueListMap
.
put
(
clueTypeId
,
clueList
);
clueMap
.
get
(
personId
).
putAll
(
clueListMap
);
...
...
@@ -132,12 +195,19 @@ public class PlayerUtil {
List
<
ClueDto
>
clues
=
clueMap
.
get
(
personId
).
get
(
clueTypeId
);
boolean
have
=
false
;
for
(
ClueDto
c
:
clues
)
{
if
(
c
.
getClueId
().
equals
(
clue
.
getClueId
()))
{
if
(
c
.
getClueId
()
==
clue
.
getClueId
())
{
//找到了同样的线索,则新增来源
//不为同一个人
if
(!
c
.
getSourceIdList
().
contains
(
sourceId
))
{
c
.
getSourceIdList
().
add
(
sourceId
);
}
have
=
true
;
break
;
}
}
//没有找到则新增一条线索
if
(!
have
)
{
clue
.
setSourceIdList
(
sourceIdList
);
clues
.
add
(
clue
);
}
}
...
...
@@ -182,23 +252,48 @@ public class PlayerUtil {
/**
* 找到人物对应线索类型,且符合任务目的线索
* @param
uid
* @param
personId
* @param
current
* @param
subject
* @param taskTarget 1 信任度提升 2 信任度降低 3 威慑度提升 4 威慑度降低
*/
public
static
List
<
ClueDto
>
getCluesByType
(
String
uid
,
Integer
personId
,
Integer
taskTarget
)
{
public
static
List
<
ClueDto
>
getCluesByType
(
Person
current
,
Person
subject
,
Integer
taskTarget
)
{
List
<
ClueDto
>
result
=
new
ArrayList
<>();
Person
person
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
personId
);
if
(!
StringUtils
.
isEmpty
(
person
)){
//找到玩家能达到目的任务
List
<
DemandTaskDto
>
demandTaskList
=
findTasks
(
person
,
taskTarget
);
//遍历任务,找到对应的任务线索
for
(
DemandTaskDto
demandTask
:
demandTaskList
)
{
Integer
clueId
=
demandTask
.
getClueId
();
//找到对应线索
ClueDto
clue
=
getClueById
(
uid
,
personId
,
clueId
);
if
(!
StringUtils
.
isEmpty
(
clue
))
{
result
.
add
(
clue
);
List
<
ClueDto
>
clueList
=
current
.
getClues
();
//找到玩家能达到目的任务的线索
for
(
ClueDto
clue
:
clueList
)
{
//线索为任务类型
if
(
clue
.
getSubject
()
==
subject
.
getId
()
&&
clue
.
getType
()
==
6
)
{
//通过线索id找主体对象身上的任务
DemandTaskDto
demandTask
=
getDemandTaskByClueId
(
subject
,
clue
.
getClueId
());
if
(!
StringUtils
.
isEmpty
(
demandTask
))
{
//增加信任值
if
(
taskTarget
==
1
)
{
int
trustDegree
=
demandTask
.
getTrustDegree
();
if
(!
StringUtils
.
isEmpty
(
trustDegree
)
&&
trustDegree
>
0
)
{
result
.
add
(
clue
);
}
}
//降低信任值
if
(
taskTarget
==
2
)
{
int
trustDegree
=
demandTask
.
getTrustDegree
();
if
(!
StringUtils
.
isEmpty
(
trustDegree
)
&&
trustDegree
<
0
)
{
result
.
add
(
clue
);
}
}
//提升威慑度
if
(
taskTarget
==
3
)
{
int
deterrenceDegree
=
demandTask
.
getDeterrenceDegree
();
if
(!
StringUtils
.
isEmpty
(
deterrenceDegree
)
&&
deterrenceDegree
>
0
)
{
result
.
add
(
clue
);
}
}
//降低威慑度
if
(
taskTarget
==
4
)
{
int
deterrenceDegree
=
demandTask
.
getDeterrenceDegree
();
if
(!
StringUtils
.
isEmpty
(
deterrenceDegree
)
&&
deterrenceDegree
<
0
)
{
result
.
add
(
clue
);
}
}
}
}
}
...
...
@@ -212,10 +307,11 @@ public class PlayerUtil {
*/
public
static
List
<
ClueDto
>
getClueByTypeAndTaskId
(
String
uid
,
Integer
personId
,
String
taskId
)
{
List
<
ClueDto
>
result
=
new
ArrayList
<>();
Person
person
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
personId
);
if
(!
StringUtils
.
isEmpty
(
person
)){
Integer
currentId
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonId
();
Person
current
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
currentId
);
if
(!
StringUtils
.
isEmpty
(
current
)){
//通过任务条件id找到玩家需求任务集合
List
<
DemandTaskDto
>
demandTaskList
=
findDemandsByTaskId
(
person
,
taskId
);
List
<
DemandTaskDto
>
demandTaskList
=
findDemandsByTaskId
(
current
,
personId
,
taskId
);
for
(
DemandTaskDto
demandTask
:
demandTaskList
)
{
//找到对应的任务线索
Integer
clueId
=
demandTask
.
getClueId
();
...
...
@@ -240,32 +336,34 @@ public class PlayerUtil {
if
(!
StringUtils
.
isEmpty
(
person
)){
List
<
DemandTaskDto
>
demandTaskList
=
person
.
getDemandTasks
();
for
(
DemandTaskDto
demandTask
:
demandTaskList
)
{
if
(
taskTarget
==
1
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
()))
{
String
trustDegree
=
demandTask
.
getTrustDegree
();
if
(!
StringUtils
.
isEmpty
(
trustDegree
)
&&
Integer
.
parseInt
(
trustDegree
)
>
0
)
{
result
.
add
(
demandTask
);
if
(
demandTask
.
getType
()
==
6
)
{
if
(
taskTarget
==
1
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
()))
{
int
trustDegree
=
demandTask
.
getTrustDegree
();
if
(!
StringUtils
.
isEmpty
(
trustDegree
)
&&
trustDegree
>
0
)
{
result
.
add
(
demandTask
);
}
}
}
}
else
if
(
taskTarget
==
2
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
()))
{
String
trustDegree
=
demandTask
.
getTrustDegree
();
if
(!
StringUtils
.
isEmpty
(
trustDegree
)
&&
Integer
.
parseInt
(
trustDegree
)
<
0
)
{
result
.
add
(
demandTask
);
}
else
if
(
taskTarget
==
2
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
())
)
{
int
trustDegree
=
demandTask
.
getTrustDegree
();
if
(!
StringUtils
.
isEmpty
(
trustDegree
)
&&
trustDegree
<
0
)
{
result
.
add
(
demandTask
);
}
}
}
}
else
if
(
taskTarget
==
3
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
()))
{
String
deterrenceDegree
=
demandTask
.
getDeterrenceDegree
();
if
(!
StringUtils
.
isEmpty
(
deterrenceDegree
)
&&
Integer
.
parseInt
(
deterrenceDegree
)
>
0
)
{
result
.
add
(
demandTask
);
}
else
if
(
taskTarget
==
3
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
())
)
{
int
deterrenceDegree
=
demandTask
.
getDeterrenceDegree
();
if
(!
StringUtils
.
isEmpty
(
deterrenceDegree
)
&&
deterrenceDegree
>
0
)
{
result
.
add
(
demandTask
);
}
}
}
}
else
if
(
taskTarget
==
4
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
()))
{
String
deterrenceDegree
=
demandTask
.
getDeterrenceDegree
();
if
(!
StringUtils
.
isEmpty
(
deterrenceDegree
)
&&
Integer
.
parseInt
(
deterrenceDegree
)
<
0
)
{
result
.
add
(
demandTask
);
}
else
if
(
taskTarget
==
4
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
())
)
{
int
deterrenceDegree
=
demandTask
.
getDeterrenceDegree
();
if
(!
StringUtils
.
isEmpty
(
deterrenceDegree
)
&&
deterrenceDegree
<
0
)
{
result
.
add
(
demandTask
);
}
}
}
}
...
...
@@ -277,14 +375,22 @@ public class PlayerUtil {
/**
* 通过任务条件id找到对应的需求任务id
*/
public
static
List
<
DemandTaskDto
>
findDemandsByTaskId
(
Person
person
,
String
task
Id
)
{
public
static
List
<
DemandTaskDto
>
findDemandsByTaskId
(
Person
person
,
Integer
personId
,
String
taskCondition
Id
)
{
List
<
DemandTaskDto
>
result
=
new
ArrayList
<>();
List
<
DemandTaskDto
>
demandTaskList
=
person
.
getDemandTasks
();
for
(
DemandTaskDto
demandTask
:
demandTaskList
)
{
String
condition1
=
demandTask
.
getCondition1
();
String
[]
taskIdTimes
=
condition1
.
split
(
"\\|"
);
if
(
taskId
.
equals
(
taskIdTimes
[
0
]))
{
result
.
add
(
demandTask
);
if
(
taskConditionId
.
equals
(
taskIdTimes
[
0
])
&&
demandTask
.
getType
()
==
6
)
{
if
(
demandTask
.
getObject
()
!=
0
)
{
if
(
personId
==
demandTask
.
getObject
())
{
result
.
add
(
demandTask
);
}
}
else
{
if
(
personId
==
demandTask
.
getSubject
())
{
result
.
add
(
demandTask
);
}
}
}
}
return
result
;
...
...
@@ -292,6 +398,24 @@ public class PlayerUtil {
/**
* 通过线索id找到对应线索
* @param current
* @param clueId
*/
public
static
ClueDto
getClueById
(
Person
current
,
Integer
clueId
)
{
List
<
ClueDto
>
clueList
=
current
.
getClues
();
for
(
ClueDto
clue
:
clueList
)
{
if
(
clueId
.
equals
(
clue
.
getClueId
()))
{
return
clue
;
}
}
return
null
;
}
/**
* 通过线索id找到对应线索
* @param uid
* @param personId
* @param clueId
*/
public
static
ClueDto
getClueById
(
String
uid
,
Integer
personId
,
Integer
clueId
)
{
List
<
ClueDto
>
clueList
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
personId
).
getClues
();
...
...
@@ -317,6 +441,100 @@ public class PlayerUtil {
}
/**
* 查询符合条件的任务
* @param demandTaskList
* @param clue
* @return
*/
private
static
DemandTaskDto
findTasks
(
List
<
DemandTaskDto
>
demandTaskList
,
ClueDto
clue
)
{
DemandTaskDto
result
=
null
;
for
(
DemandTaskDto
demandTask
:
demandTaskList
)
{
if
(
Objects
.
equals
(
demandTask
.
getClueId
(),
clue
.
getClueId
())
&&
Objects
.
equals
(
demandTask
.
getType
(),
clue
.
getType
()))
{
result
=
demandTask
;
break
;
}
}
if
(!
StringUtils
.
isEmpty
(
result
))
{
for
(
DemandTaskDto
demandTask:
demandTaskList
)
{
if
(
demandTask
.
getDemandTaskId
()
==
result
.
getDemandTaskId
()
&&
demandTask
.
getType
()
==
6
&&
result
.
getSubject
()
==
demandTask
.
getSubject
())
{
return
demandTask
;
}
}
}
return
null
;
}
/**
* 通过任务id找到对应的任务
*/
public
static
DemandTaskDto
getDemandTaskById
(
String
uid
,
Integer
personId
,
Integer
taskId
)
{
List
<
DemandTaskDto
>
demandTaskList
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
personId
).
getDemandTasks
();
for
(
DemandTaskDto
demandTask:
demandTaskList
)
{
if
(
demandTask
.
getDemandTaskId
()
==
taskId
&&
demandTask
.
getType
()
==
6
&&
demandTask
.
getSubject
()
==
personId
)
{
return
demandTask
;
}
}
return
null
;
}
/**
* 根据线索找到对应任务,判断任务是否需要解锁,需要则改为解锁状态
*/
public
static
void
unlockTask
(
String
uid
,
Person
person
,
ClueDto
clue
)
{
List
<
DemandTaskDto
>
demandTaskList
=
person
.
getDemandTasks
();
String
postTaskId
=
null
;
//本人身上该任务解锁
for
(
DemandTaskDto
demandTask
:
demandTaskList
)
{
if
(
demandTask
.
getClueId
()
==
clue
.
getClueId
()
&&
demandTask
.
getType
()
==
clue
.
getType
())
{
//需解锁任务
if
(
demandTask
.
getClueSwitch
()
==
1
)
{
demandTask
.
setClueSwitch
(
2
);
postTaskId
=
demandTask
.
getPostTask
();
for
(
DemandTaskDto
task
:
demandTaskList
)
{
if
(
task
.
getDemandTaskId
()
==
demandTask
.
getDemandTaskId
())
{
task
.
setClueSwitch
(
2
);
}
}
}
}
}
if
(!
StringUtils
.
isEmpty
(
postTaskId
))
{
//线索对应人物解锁
int
objectId
=
clue
.
getSubject
();
if
(
person
.
getId
()
==
clue
.
getSubject
())
{
objectId
=
clue
.
getObject
();
}
List
<
DemandTaskDto
>
demandTaskObjectList
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
objectId
).
getDemandTasks
();
//客体身上该任务解锁
for
(
DemandTaskDto
demandTask
:
demandTaskObjectList
)
{
if
(
demandTask
.
getDemandTaskId
()
==
Integer
.
parseInt
(
postTaskId
))
{
//需解锁任务
if
(
demandTask
.
getClueSwitch
()
==
1
)
{
demandTask
.
setClueSwitch
(
2
);
}
}
}
}
}
/**
* 根据线索找到对应任务,判断任务是否需要解锁,需要则改为解锁状态
*/
public
static
void
unlockTask
(
String
uid
,
ClueDto
clue
)
{
Map
<
Integer
,
Person
>
personMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
();
for
(
Map
.
Entry
<
Integer
,
Person
>
entry
:
personMap
.
entrySet
())
{
Person
person
=
entry
.
getValue
();
DemandTaskDto
demandTask
=
getDemandTaskByClueId
(
person
,
clue
.
getClueId
());
if
(!
StringUtils
.
isEmpty
(
demandTask
))
{
//需解锁任务
if
(
demandTask
.
getClueSwitch
()
==
1
)
{
demandTask
.
setClueSwitch
(
2
);
}
}
}
}
/**
* 判断线索是否符合阈值需求
* @param uid
* @param clueList
...
...
@@ -339,42 +557,40 @@ public class PlayerUtil {
/**
* 查找任务目的为对应类型线索
* @param uid
* @param personId
* @param person
* @param clueList
* @param taskTarget 1 信任度提升 2 信任度降低 3 威慑度提升 4 威慑度降低
*/
public
static
List
<
ClueDto
>
getCluesIsType
(
String
uid
,
Integer
personId
,
List
<
ClueDto
>
clueList
,
Integer
taskTarget
)
{
public
static
List
<
ClueDto
>
getCluesIsType
(
Person
person
,
List
<
ClueDto
>
clueList
,
Integer
taskTarget
)
{
List
<
ClueDto
>
result
=
new
ArrayList
<>();
Person
person
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
personId
);
for
(
ClueDto
clue
:
clueList
)
{
DemandTaskDto
demandTask
=
getDemandTaskByClueId
(
person
,
clue
.
getClueId
());
if
(!
StringUtils
.
isEmpty
(
demandTask
))
{
if
(
taskTarget
==
1
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
()))
{
String
trustDegree
=
demandTask
.
getTrustDegree
();
if
(!
StringUtils
.
isEmpty
(
trustDegree
)
&&
Integer
.
parseInt
(
trustDegree
)
>
0
)
{
int
trustDegree
=
demandTask
.
getTrustDegree
();
if
(!
StringUtils
.
isEmpty
(
trustDegree
)
&&
trustDegree
>
0
)
{
result
.
add
(
clue
);
}
}
}
else
if
(
taskTarget
==
2
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
()))
{
String
trustDegree
=
demandTask
.
getTrustDegree
();
if
(!
StringUtils
.
isEmpty
(
trustDegree
)
&&
Integer
.
parseInt
(
trustDegree
)
<
0
)
{
int
trustDegree
=
demandTask
.
getTrustDegree
();
if
(!
StringUtils
.
isEmpty
(
trustDegree
)
&&
trustDegree
<
0
)
{
result
.
add
(
clue
);
}
}
}
else
if
(
taskTarget
==
3
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
()))
{
String
deterrenceDegree
=
demandTask
.
getDeterrenceDegree
();
if
(!
StringUtils
.
isEmpty
(
deterrenceDegree
)
&&
Integer
.
parseInt
(
deterrenceDegree
)
>
0
)
{
int
deterrenceDegree
=
demandTask
.
getDeterrenceDegree
();
if
(!
StringUtils
.
isEmpty
(
deterrenceDegree
)
&&
deterrenceDegree
>
0
)
{
result
.
add
(
clue
);
}
}
}
else
if
(
taskTarget
==
4
)
{
if
(
Objects
.
equals
(
demandTask
.
getSubject
(),
person
.
getId
()))
{
String
deterrenceDegree
=
demandTask
.
getDeterrenceDegree
();
if
(!
StringUtils
.
isEmpty
(
deterrenceDegree
)
&&
Integer
.
parseInt
(
deterrenceDegree
)
<
0
)
{
int
deterrenceDegree
=
demandTask
.
getDeterrenceDegree
();
if
(!
StringUtils
.
isEmpty
(
deterrenceDegree
)
&&
deterrenceDegree
<
0
)
{
result
.
add
(
clue
);
}
}
...
...
@@ -415,22 +631,22 @@ public class PlayerUtil {
* @param demandTask
*/
public
static
void
addThreshold
(
Person
subject
,
DemandTaskDto
demandTask
)
{
if
(
!
StringUtils
.
isEmpty
(
demandTask
.
getTrustDegree
())
)
{
if
(
subject
.
getTrustDegree
()
<
100
)
{
if
((
subject
.
getTrustDegree
()
+
Integer
.
parseInt
(
demandTask
.
getTrustDegree
()
)
)
>
100
)
{
if
(
demandTask
.
getTrustDegree
()
!=
0
)
{
if
(
subject
.
getTrustDegree
()
<
=
100
)
{
if
((
subject
.
getTrustDegree
()
+
demandTask
.
getTrustDegree
(
)
)
>
100
)
{
subject
.
setTrustDegree
(
100
);
}
else
{
subject
.
setTrustDegree
(
subject
.
getTrustDegree
()
+
Integer
.
parseInt
(
demandTask
.
getTrustDegree
()
));
subject
.
setTrustDegree
(
Math
.
max
((
subject
.
getTrustDegree
()
+
demandTask
.
getTrustDegree
()),
0
));
}
}
}
if
(
!
StringUtils
.
isEmpty
(
demandTask
.
getDeterrenceDegree
())
)
{
if
(
subject
.
getDeterrenceDegree
()
<
100
)
{
if
((
subject
.
getDeterrenceDegree
()
+
Integer
.
parseInt
(
demandTask
.
getDeterrenceDegree
()
))
>
100
){
if
(
demandTask
.
getDeterrenceDegree
()
!=
0
)
{
if
(
subject
.
getDeterrenceDegree
()
<
=
100
)
{
if
((
subject
.
getDeterrenceDegree
()
+
demandTask
.
getDeterrenceDegree
(
))
>
100
){
subject
.
setDeterrenceDegree
(
100
);
}
else
{
subject
.
setDeterrenceDegree
(
subject
.
getDeterrenceDegree
()
+
Integer
.
parseInt
(
demandTask
.
getDeterrenceDegree
()
));
subject
.
setDeterrenceDegree
(
Math
.
max
((
subject
.
getDeterrenceDegree
()
+
demandTask
.
getDeterrenceDegree
()),
0
));
}
}
}
...
...
@@ -462,4 +678,478 @@ public class PlayerUtil {
player
.
setCurrency
(
0.0
);
player
.
setPoint
(
0
);
}
/**
* 判断数组A是否为数组B的子集
*/
public
static
boolean
checkSubset
(
List
<
Integer
>
listA
,
List
<
Integer
>
listB
)
{
for
(
Integer
a
:
listA
)
{
if
(!
listB
.
contains
(
a
))
{
return
false
;
}
}
return
true
;
}
/**
* 生成场所表
*/
public
static
Map
<
String
,
LocationInfoDto
>
makeLocationMap
(
Map
<
String
,
List
<
Integer
>>
locationPersonMap
)
{
Map
<
String
,
LocationInfoDto
>
locationInfoMap
=
new
HashMap
<>();
Map
<
String
,
Location
>
locationMap
=
TimingAcquisition
.
locationMap
;
//遍历所有场所,找到所有已知和必现场所
for
(
Map
.
Entry
<
String
,
Location
>
entry
:
locationMap
.
entrySet
())
{
LocationInfoDto
locationInfo
=
new
LocationInfoDto
();
String
locationId
=
entry
.
getKey
();
List
<
Integer
>
personIdList
=
locationPersonMap
.
get
(
locationId
);
//该场所已有玩家
if
(!
StringUtils
.
isEmpty
(
personIdList
))
{
Map
<
Integer
,
Integer
>
personInfoMap
=
new
HashMap
<>();
for
(
Integer
personId
:
personIdList
)
{
personInfoMap
.
put
(
personId
,
0
);
}
String
isHidden
=
entry
.
getValue
().
getIsHidden
();
locationInfo
.
setIsHidden
(
isHidden
);
locationInfo
.
setPersonInfoMap
(
personInfoMap
);
locationInfoMap
.
put
(
entry
.
getKey
(),
locationInfo
);
}
else
{
//该场所为必现场所
if
(
"1"
.
equals
(
entry
.
getValue
().
getIsAppear
()))
{
String
isHidden
=
entry
.
getValue
().
getIsHidden
();
locationInfo
.
setIsHidden
(
isHidden
);
locationInfoMap
.
put
(
entry
.
getKey
(),
locationInfo
);
}
}
}
return
locationInfoMap
;
}
/**
* 判断玩家是否获得了对应人物的场所线索
* @param clueMap
* @param personId
*/
public
static
boolean
checkLocationClue
(
Map
<
Integer
,
Map
<
Integer
,
List
<
ClueDto
>>>
clueMap
,
Integer
personId
)
{
Map
<
Integer
,
List
<
ClueDto
>>
personClueMap
=
clueMap
.
get
(
personId
);
//有这个人的线索
if
(!
StringUtils
.
isEmpty
(
personClueMap
))
{
List
<
ClueDto
>
clueList
=
personClueMap
.
get
(
2
);
//有这个人场所线索
return
!
StringUtils
.
isEmpty
(
clueList
);
}
return
false
;
}
/**
* 解锁场所
* @param locationMap
* @param locationId
*/
public
static
void
unlockLocation
(
Map
<
String
,
LocationInfoDto
>
locationMap
,
String
locationId
)
{
//场所未解锁
String
isHidden
=
locationMap
.
get
(
locationId
).
getIsHidden
();
if
(
"1"
.
equals
(
isHidden
))
{
locationMap
.
get
(
locationId
).
setIsHidden
(
"1"
);
}
}
/**
* 查找有前置任务的任务
*/
public
static
List
<
PostTaskDto
>
getDemandTaskHavePre
(
String
uid
,
List
<
Integer
>
personIdList
)
{
List
<
PostTaskDto
>
postTaskStatusList
=
new
ArrayList
<>();
//所有人物
Map
<
Integer
,
Person
>
personMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
();
//遍历所有人物
for
(
Integer
personId
:
personIdList
)
{
//该人物身上挂的任务
List
<
DemandTaskDto
>
demandTasks
=
personMap
.
get
(
personId
).
getDemandTasks
();
PostTaskDto
postTask
=
new
PostTaskDto
();
postTask
.
setPersonId
(
personId
);
Map
<
Integer
,
TaskStatusDto
>
taskStatusMap
=
new
HashMap
<>();
//判断任务是否有前置任务
for
(
DemandTaskDto
demandTask
:
demandTasks
)
{
//该任务有前置任务,则为后置任务
if
(!
StringUtils
.
isEmpty
(
demandTask
.
getPostTask
()))
{
//判断后置任务是否已经完成
int
flag
=
checkTaskStatus
(
uid
,
personId
,
demandTask
.
getDemandTaskId
());
//未完成
if
(
flag
==
0
)
{
TaskStatusDto
taskStatus
=
new
TaskStatusDto
();
//判断前置任务是否已经完成
Integer
postTaskId
=
Integer
.
valueOf
(
demandTask
.
getPostTask
());
int
finished
=
checkTaskStatus
(
uid
,
demandTask
.
getObject
(),
postTaskId
);
taskStatus
.
setTaskId
(
postTaskId
);
taskStatus
.
setStatus
(
finished
);
taskStatusMap
.
put
(
demandTask
.
getDemandTaskId
(),
taskStatus
);
}
}
}
if
(
taskStatusMap
.
size
()
!=
0
)
{
postTask
.
setTaskStatusMap
(
taskStatusMap
);
postTaskStatusList
.
add
(
postTask
);
}
}
return
postTaskStatusList
;
}
/**
* 查找单个人有前置任务的任务
*/
public
static
List
<
PostTaskDto
>
getDemandTaskHavePre
(
String
uid
,
Integer
personId
)
{
List
<
PostTaskDto
>
postTaskStatusList
=
new
ArrayList
<>();
//该人物身上挂的任务
List
<
DemandTaskDto
>
demandTasks
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
personId
).
getDemandTasks
();
PostTaskDto
postTask
=
new
PostTaskDto
();
postTask
.
setPersonId
(
personId
);
Map
<
Integer
,
TaskStatusDto
>
taskStatusMap
=
new
HashMap
<>();
//判断任务是否有前置任务
for
(
DemandTaskDto
demandTask
:
demandTasks
)
{
//该任务有前置任务,则为后置任务
if
(!
StringUtils
.
isEmpty
(
demandTask
.
getPostTask
()))
{
//判断后置任务是否已经完成
int
flag
=
checkTaskStatus
(
uid
,
personId
,
demandTask
.
getDemandTaskId
());
//未完成
if
(
flag
==
0
)
{
TaskStatusDto
taskStatus
=
new
TaskStatusDto
();
//判断前置任务是否已经完成
Integer
postTaskId
=
Integer
.
valueOf
(
demandTask
.
getPostTask
());
int
finished
=
checkTaskStatus
(
uid
,
demandTask
.
getObject
(),
postTaskId
);
taskStatus
.
setTaskId
(
postTaskId
);
taskStatus
.
setStatus
(
finished
);
taskStatusMap
.
put
(
demandTask
.
getDemandTaskId
(),
taskStatus
);
}
}
}
if
(
taskStatusMap
.
size
()
!=
0
)
{
postTask
.
setTaskStatusMap
(
taskStatusMap
);
postTaskStatusList
.
add
(
postTask
);
}
return
postTaskStatusList
;
}
/**
* 判断任务是否已经完成,0-未完成,1-已完成
*/
public
static
int
checkTaskStatus
(
String
uid
,
Integer
personId
,
Integer
taskId
)
{
Map
<
Integer
,
Integer
>
taskStatusMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getTaskMap
().
get
(
personId
);
if
(!
StringUtils
.
isEmpty
(
taskStatusMap
.
get
(
taskId
)))
{
return
1
;
}
return
0
;
}
/**
* 后置任务的提示按优先级查找
*/
public
static
PostTaskRecordDto
getPostTask
(
String
uid
,
List
<
PostTaskDto
>
postTaskList
)
{
PostTaskRecordDto
postTaskRecord
=
new
PostTaskRecordDto
();
List
<
PostTaskRecordDto
>
postTaskRecordList
=
new
ArrayList
<>();
//遍历每个人
for
(
PostTaskDto
postTask
:
postTaskList
)
{
Map
<
Integer
,
TaskStatusDto
>
taskStatusMap
=
postTask
.
getTaskStatusMap
();
for
(
Map
.
Entry
<
Integer
,
TaskStatusDto
>
entry
:
taskStatusMap
.
entrySet
())
{
Integer
postTaskId
=
entry
.
getKey
();
TaskStatusDto
taskStatus
=
entry
.
getValue
();
DemandTaskDto
demandTask
=
getDemandTaskInfo
(
uid
,
postTask
.
getPersonId
(),
postTaskId
);
//有前置任务已完成
if
(
taskStatus
.
getStatus
()
==
1
)
{
if
(!
StringUtils
.
isEmpty
(
demandTask
))
{
String
[]
condition1
=
demandTask
.
getCondition1
().
split
(
"\\|"
);
//任务条件为“70043”
if
(
"70043"
.
equals
(
condition1
[
0
]))
{
postTaskRecord
.
setPersonId
(
postTask
.
getPersonId
());
postTaskRecord
.
setPostTaskId
(
postTaskId
);
postTaskRecord
.
setPreTaskId
(
taskStatus
.
getTaskId
());
postTaskRecord
.
setStatus
(
taskStatus
.
getStatus
());
boolean
flag
=
checkTaskSelf
(
uid
,
postTask
.
getPersonId
(),
demandTask
.
getClueId
());
if
(
flag
)
{
postTaskRecord
.
setLevel
(
1
);
//前置任务已完成且是自己发布
}
else
{
postTaskRecord
.
setLevel
(
2
);
//前置任务已完成且不是自己发布
}
return
postTaskRecord
;
}
}
}
//前置任务为本人发布
if
(!
StringUtils
.
isEmpty
(
demandTask
))
{
boolean
flag
=
checkTaskSelf
(
uid
,
postTask
.
getPersonId
(),
demandTask
.
getClueId
());
if
(
flag
)
{
PostTaskRecordDto
postTaskRecordCopy
=
new
PostTaskRecordDto
();
postTaskRecordCopy
.
setPersonId
(
postTask
.
getPersonId
());
postTaskRecordCopy
.
setPostTaskId
(
postTaskId
);
postTaskRecordCopy
.
setPreTaskId
(
taskStatus
.
getTaskId
());
postTaskRecordCopy
.
setStatus
(
taskStatus
.
getStatus
());
postTaskRecordCopy
.
setLevel
(
3
);
//任务为本人发布
postTaskRecordList
.
add
(
postTaskRecordCopy
);
}
}
}
}
if
(
postTaskRecordList
.
size
()
!=
0
)
{
return
postTaskRecordList
.
get
(
0
);
}
return
null
;
}
/**
* 通过人物的任务id找到任务信息
* @param uid
* @param personId
* @param taskId
*/
public
static
DemandTaskDto
getDemandTaskInfo
(
String
uid
,
Integer
personId
,
Integer
taskId
)
{
List
<
DemandTaskDto
>
demandTasks
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
personId
).
getDemandTasks
();
for
(
DemandTaskDto
demandTask
:
demandTasks
)
{
if
(
demandTask
.
getDemandTaskId
()
==
taskId
)
{
return
demandTask
;
}
}
return
null
;
}
/**
* 验证任务是否为本人发布
* @param uid
* @param personId
* @param clueId
*/
public
static
boolean
checkTaskSelf
(
String
uid
,
Integer
personId
,
Integer
clueId
)
{
Map
<
Integer
,
Map
<
Integer
,
List
<
ClueDto
>>>
clueMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getClueMap
();
//有收集到线索
if
(
clueMap
.
size
()
!=
0
)
{
//有收集到这个人的线索
Map
<
Integer
,
List
<
ClueDto
>>
clueTypeMap
=
clueMap
.
get
(
personId
);
if
(!
StringUtils
.
isEmpty
(
clueTypeMap
))
{
for
(
Map
.
Entry
<
Integer
,
List
<
ClueDto
>>
entry
:
clueTypeMap
.
entrySet
())
{
List
<
ClueDto
>
clueList
=
entry
.
getValue
();
for
(
ClueDto
clue
:
clueList
)
{
if
(
clue
.
getClueId
()
==
clueId
&&
clue
.
getSourceIdList
().
contains
(
personId
))
{
return
true
;
}
}
}
}
}
return
false
;
}
/**
* 根据玩家任务进度,给玩家提供建议
* @param uid
*/
public
static
String
getClueFromTaskKey
(
String
uid
)
{
String
gateNo
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getGateNo
();
//攻略任务
List
<
BarrierTaskKeyDto
>
barrierTaskKeyList
=
TimingAcquisition
.
barrierTaskKeyMap
.
get
(
gateNo
);
//玩家已完成的任务
Map
<
Integer
,
Map
<
Integer
,
Integer
>>
taskMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getTaskMap
();
for
(
BarrierTaskKeyDto
barrierTaskKey
:
barrierTaskKeyList
)
{
Map
<
Integer
,
Integer
>
taskStatusMap
=
taskMap
.
get
(
barrierTaskKey
.
getSubject
());
//有完成的任务
if
(!
StringUtils
.
isEmpty
(
taskStatusMap
))
{
//该任务已经完成,查找下一个
if
(
StringUtils
.
isEmpty
(
taskStatusMap
.
get
(
barrierTaskKey
.
getDemandTaskId
())))
{
Integer
clueId
=
barrierTaskKey
.
getClueId
();
Integer
subjectId
=
barrierTaskKey
.
getSubject
();
ClueDto
clue
=
getClueById
(
uid
,
subjectId
,
clueId
);
if
(!
StringUtils
.
isEmpty
(
clue
))
{
return
clue
.
getClueTemplate
()
+
"这条线索可能对你比较重要。"
;
}
}
}
}
return
null
;
}
/**
* 找到白名单内该人的任务中已解锁或无需解锁的任务对应的提示
*/
public
static
String
getTipInChat
(
String
uid
,
Person
person
)
{
List
<
DemandTaskDto
>
demandTaskList
=
person
.
getDemandTasks
();
Player
player
=
TimingAcquisition
.
playerMap
.
get
(
uid
);
String
gateNo
=
player
.
getGateNo
();
//攻略任务(白名单)
List
<
BarrierTaskKeyDto
>
barrierTaskKeyList
=
TimingAcquisition
.
barrierTaskKeyMap
.
get
(
gateNo
);
int
count
=
0
;
//统计已完成次数
//信任值
Integer
trustDegree
=
person
.
getTrustDegree
();
//威慑度
Integer
deterrenceDegree
=
person
.
getDeterrenceDegree
();
String
text
=
""
;
for
(
DemandTaskDto
demandTask
:
demandTaskList
)
{
//判断这个任务是否在白名单内
for
(
BarrierTaskKeyDto
barrierTaskKey
:
barrierTaskKeyList
)
{
//任务在白名单中
if
(
barrierTaskKey
.
getId
().
equals
(
demandTask
.
getId
()))
{
//该任务已解锁或无需解锁
if
(
demandTask
.
getClueSwitch
()
!=
1
)
{
//任务是否已经完成
int
taskStatus
=
checkTaskStatus
(
uid
,
person
.
getId
(),
demandTask
.
getDemandTaskId
());
//未完成
if
(
taskStatus
==
0
)
{
if
(
trustDegree
>=
demandTask
.
getTrustStart
()
||
deterrenceDegree
>=
demandTask
.
getDeterrenceStart
())
{
return
SpeechUtil
.
getTipSpeech
(
uid
,
demandTask
,
0
,
1
);
}
}
}
else
{
//任务需要解锁,找到能解锁任务的线索
//能解锁任务的线索在哪个人身上
List
<
Integer
>
personIdList
=
getPersonIdByClueId
(
uid
,
demandTask
.
getClueId
(),
demandTask
.
getSubject
());
//线索挂在NPC本人身上
if
(
personIdList
.
contains
(
person
.
getId
()))
{
ClueDto
clue
=
getClueById
(
uid
,
person
.
getId
(),
demandTask
.
getClueId
());
if
(!
StringUtils
.
isEmpty
(
clue
))
{
if
(
trustDegree
>=
clue
.
getTrustDegree
()
||
deterrenceDegree
>=
clue
.
getThreaten
())
{
return
SpeechUtil
.
getTipSpeech
(
uid
,
demandTask
,
0
,
2
);
}
}
}
}
count
++;
}
}
}
//该NPC身上有其他人的线索且在白名单
List
<
ClueDto
>
clueList
=
person
.
getClues
();
for
(
BarrierTaskKeyDto
barrierTaskKey
:
barrierTaskKeyList
)
{
List
<
Integer
>
clueIdList
=
getClueByTaskId
(
player
.
getPersonMap
().
get
(
barrierTaskKey
.
getSubject
()),
barrierTaskKey
.
getDemandTaskId
());
for
(
ClueDto
clue
:
clueList
)
{
if
(
clueIdList
.
contains
(
clue
.
getClueId
())
&&
clue
.
getSubject
()
==
barrierTaskKey
.
getSubject
())
{
//任务是否已经完成
// int taskStatus = checkTaskStatus(uid, barrierTaskKey.getSubject(), barrierTaskKey.getDemandTaskId());
//任务是否已经解锁
DemandTaskDto
demandTask
=
getDemandTaskInfo
(
uid
,
barrierTaskKey
.
getSubject
(),
barrierTaskKey
.
getDemandTaskId
());
//未解锁
if
(!
StringUtils
.
isEmpty
(
demandTask
))
{
//未完成
if
(
demandTask
.
getClueSwitch
()
==
1
)
{
if
(
trustDegree
>=
clue
.
getTrustDegree
()
||
deterrenceDegree
>=
clue
.
getThreaten
())
{
//----------------记录线索--------------
recordClue
(
uid
,
person
.
getId
(),
barrierTaskKey
.
getSubject
(),
clue
.
getType
(),
clue
);
return
SpeechUtil
.
getTipSpeech
(
uid
,
barrierTaskKey
,
person
.
getId
());
}
}
}
count
++;
}
}
}
if
(
count
>
0
)
{
return
"我们走吧,这人暂时问不出更重要的消息了,去先找别人问问吧。"
;
}
return
"算了吧,估计这个人问不出什么东西来。去问问其他人吧。"
;
}
/**
* 通过线索id找到挂线索的人物
*/
public
static
List
<
Integer
>
getPersonIdByClueId
(
String
uid
,
Integer
clueId
,
Integer
subjectId
)
{
List
<
Integer
>
personIdList
=
new
ArrayList
<>();
Map
<
Integer
,
Person
>
personMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
();
for
(
Map
.
Entry
<
Integer
,
Person
>
entry
:
personMap
.
entrySet
())
{
Person
person
=
entry
.
getValue
();
List
<
ClueDto
>
clueList
=
person
.
getClues
();
for
(
ClueDto
clue
:
clueList
)
{
if
(
clueId
.
equals
(
clue
.
getClueId
())
&&
subjectId
.
equals
(
clue
.
getSubject
()))
{
if
(!
personIdList
.
contains
(
entry
.
getKey
()))
{
personIdList
.
add
(
entry
.
getKey
());
}
}
}
}
return
personIdList
;
}
/**
* 找到NPC身上的某个任务对应的所有线索
*/
public
static
List
<
Integer
>
getClueByTaskId
(
Person
person
,
Integer
demandTaskId
)
{
List
<
Integer
>
clueIdList
=
new
ArrayList
<>();
List
<
DemandTaskDto
>
demandTaskList
=
person
.
getDemandTasks
();
for
(
DemandTaskDto
demandTask
:
demandTaskList
)
{
if
(
demandTask
.
getDemandTaskId
()
==
demandTaskId
&&
demandTask
.
getSubject
()
==
person
.
getId
())
{
clueIdList
.
add
(
demandTask
.
getClueId
());
}
}
return
clueIdList
;
}
/**
* 判断该人物是否是第一次见面
* @param uid
* @param locationId
* @param personId
*/
public
static
boolean
isFirstMeet
(
String
uid
,
String
locationId
,
Integer
personId
)
{
Map
<
Integer
,
Integer
>
personInfoMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getLocationMap
().
get
(
locationId
).
getPersonInfoMap
();
int
times
=
personInfoMap
.
get
(
personId
);
return
times
==
0
;
}
/**
* 更新玩家跟人物的见面次数
*/
public
static
void
updateMeetTimes
(
String
uid
,
String
locationId
,
Integer
personId
)
{
Map
<
Integer
,
Integer
>
personInfoMap
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getLocationMap
().
get
(
locationId
).
getPersonInfoMap
();
int
times
=
personInfoMap
.
get
(
personId
)
+
1
;
personInfoMap
.
put
(
personId
,
times
);
}
/**
* 扣除玩家的货币
*/
public
static
void
updateMoneyNum
(
String
uid
,
int
num
)
{
int
money
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getCurrency
().
intValue
();
if
(
money
>
num
)
{
TimingAcquisition
.
playerMap
.
get
(
uid
).
setCurrency
((
double
)
(
money
-
num
));
}
else
{
TimingAcquisition
.
playerMap
.
get
(
uid
).
setCurrency
((
double
)
(
0
));
}
}
/**
* 增加玩家的货币
*/
public
static
void
addMoneyNum
(
String
uid
,
int
num
)
{
int
money
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getCurrency
().
intValue
();
TimingAcquisition
.
playerMap
.
get
(
uid
).
setCurrency
((
double
)
(
money
+
num
));
}
/**
* 深拷贝list
*/
public
static
<
T
>
List
<
T
>
deepCopyList
(
List
<
T
>
src
)
{
List
<
T
>
dest
=
null
;
try
{
ByteArrayOutputStream
byteOut
=
new
ByteArrayOutputStream
();
ObjectOutputStream
out
=
new
ObjectOutputStream
(
byteOut
);
out
.
writeObject
(
src
);
ByteArrayInputStream
byteIn
=
new
ByteArrayInputStream
(
byteOut
.
toByteArray
());
ObjectInputStream
in
=
new
ObjectInputStream
(
byteIn
);
dest
=
(
List
<
T
>)
in
.
readObject
();
}
catch
(
ClassNotFoundException
|
IOException
e
)
{
e
.
printStackTrace
();
}
return
dest
;
}
/**
* 过滤到已经完成任务对应的线索
*/
public
static
List
<
ClueDto
>
getUndoClueList
(
String
uid
,
Person
person
,
List
<
ClueDto
>
clueList
)
{
List
<
ClueDto
>
result
=
new
ArrayList
<>();
for
(
ClueDto
clue
:
clueList
)
{
DemandTaskDto
demandTask
=
getDemandTaskByClueId
(
person
,
clue
.
getClueId
());
if
(!
StringUtils
.
isEmpty
(
demandTask
))
{
int
taskStatus
=
checkTaskStatus
(
uid
,
person
.
getId
(),
demandTask
.
getDemandTaskId
());
if
(
taskStatus
==
1
)
{
continue
;
}
}
result
.
add
(
clue
);
}
return
result
;
}
}
src/main/java/com/qiwu/inference/common/utils/RequestConversionUtil.java
View file @
d4c7ebca
...
...
@@ -33,6 +33,8 @@ public class RequestConversionUtil {
String
[]
name
=
subjectName
.
split
(
"\\+"
);
subjectName
=
name
[
0
];
}
//通过身份找到对应人物名称
subjectName
=
PlayerUtil
.
getName
(
commonRequest
.
getUid
(),
subjectName
);
operationRequest
.
setSubjectName
(
subjectName
);
Integer
subjectId
=
TimingAcquisition
.
getPersonIdByName
(
commonRequest
.
getUid
(),
subjectName
);
operationRequest
.
setSubjectId
(
subjectId
);
...
...
@@ -52,7 +54,11 @@ public class RequestConversionUtil {
objectName
=
objectName
.
replace
(
subjectName
,
""
);
objectName
=
objectName
.
replace
(
"+"
,
""
);
}
operationRequest
.
setObjectName
(
objectName
);
if
(!
objectName
.
equals
(
subjectName
))
{
//通过身份找到对应人物名称
objectName
=
PlayerUtil
.
getName
(
commonRequest
.
getUid
(),
objectName
);
operationRequest
.
setObjectName
(
objectName
);
}
}
//---------------------存在"性格类型"-----------------------
String
dispositionType
=
callRequest
.
get
性格类型
();
...
...
src/main/java/com/qiwu/inference/common/utils/SpeechUtil.java
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
common
.
utils
;
import
cn.hutool.poi.excel.ExcelReader
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
com.qiwu.inference.common.TimingAcquisition
;
import
com.qiwu.inference.pojo.DemandTask
;
import
com.qiwu.inference.dto.*
;
import
com.qiwu.inference.pojo.*
;
import
org.springframework.util.StringUtils
;
import
java.util.List
;
import
java.util.Random
;
import
java.io.File
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.stream.Collectors
;
public
class
SpeechUtil
{
/**
...
...
@@ -254,4 +260,710 @@ public class SpeechUtil {
public
static
String
replaceHeader
(
String
text
,
String
name
)
{
return
text
.
replaceAll
(
"【人物名称"
,
"【"
+
name
);
}
/**
* 添加人物名称
* @param text
* @return String
*/
public
static
String
addHeader
(
String
text
,
String
name
)
{
text
=
"【"
+
name
+
"@正常】"
+
text
;
return
text
;
}
/**
* 加载闲聊话术
*/
public
static
Map
<
Integer
,
List
<
ChatSpeech
>>
getChatSpeechModel
(
String
speechFilePath
)
{
String
chatPath
=
speechFilePath
+
"chat.xlsx"
;
ExcelReader
reader
=
ExcelUtil
.
getReader
(
new
File
(
chatPath
));
reader
.
addHeaderAlias
(
"意图反馈"
,
"methodId"
);
reader
.
addHeaderAlias
(
"身份"
,
"identity"
);
reader
.
addHeaderAlias
(
"人物ID"
,
"personId"
);
reader
.
addHeaderAlias
(
"性别"
,
"gender"
);
reader
.
addHeaderAlias
(
"年龄段"
,
"age"
);
reader
.
addHeaderAlias
(
"性格A"
,
"dispositionIds"
);
reader
.
addHeaderAlias
(
"行为"
,
"behaviour"
);
reader
.
addHeaderAlias
(
"任务状态"
,
"taskStatus"
);
reader
.
addHeaderAlias
(
"关系"
,
"degree"
);
reader
.
addHeaderAlias
(
"文本内容"
,
"answer"
);
reader
.
addHeaderAlias
(
"通用标签"
,
"flag"
);
List
<
ChatSpeech
>
chatList
=
reader
.
readAll
(
ChatSpeech
.
class
);
reader
.
close
();
Map
<
Integer
,
List
<
ChatSpeech
>>
chatSpeechMap
=
new
ConcurrentHashMap
<>();
for
(
ChatSpeech
chat
:
chatList
)
{
if
(
StringUtils
.
isEmpty
(
chatSpeechMap
.
get
(
chat
.
getMethodId
())))
{
List
<
ChatSpeech
>
chats
=
new
ArrayList
<>();
chats
.
add
(
chat
);
chatSpeechMap
.
put
(
chat
.
getMethodId
(),
chats
);
}
else
{
chatSpeechMap
.
get
(
chat
.
getMethodId
()).
add
(
chat
);
}
}
return
chatSpeechMap
;
}
/**
* 加载线索成功的话术
*/
public
static
Map
<
Integer
,
List
<
ClueSpeech
>>
getClueSpeechModel
(
String
speechFilePath
)
{
String
clueSpeechPath
=
speechFilePath
+
"clue_success.xlsx"
;
ExcelReader
reader
=
ExcelUtil
.
getReader
(
new
File
(
clueSpeechPath
));
reader
.
addHeaderAlias
(
"线索ID"
,
"clueId"
);
reader
.
addHeaderAlias
(
"任务名称"
,
"taskName"
);
reader
.
addHeaderAlias
(
"身份1"
,
"identity"
);
reader
.
addHeaderAlias
(
"性别"
,
"gender"
);
reader
.
addHeaderAlias
(
"人物ID"
,
"personId"
);
reader
.
addHeaderAlias
(
"年龄段"
,
"age"
);
reader
.
addHeaderAlias
(
"性格A"
,
"dispositionIds"
);
reader
.
addHeaderAlias
(
"行为"
,
"behaviour"
);
reader
.
addHeaderAlias
(
"任务状态"
,
"status"
);
reader
.
addHeaderAlias
(
"线索文本"
,
"answer"
);
reader
.
addHeaderAlias
(
"自身线索文本"
,
"answerSelf"
);
reader
.
addHeaderAlias
(
"通用标签"
,
"flag"
);
List
<
ClueSpeech
>
clueSpeechList
=
reader
.
readAll
(
ClueSpeech
.
class
);
reader
.
close
();
Map
<
Integer
,
List
<
ClueSpeech
>>
clueSpeechMap
=
new
ConcurrentHashMap
<>();
for
(
ClueSpeech
clueSpeech
:
clueSpeechList
)
{
if
(
StringUtils
.
isEmpty
(
clueSpeechMap
.
get
(
clueSpeech
.
getClueId
())))
{
List
<
ClueSpeech
>
clueSpeeches
=
new
ArrayList
<>();
clueSpeeches
.
add
(
clueSpeech
);
clueSpeechMap
.
put
(
clueSpeech
.
getClueId
(),
clueSpeeches
);
}
else
{
clueSpeechMap
.
get
(
clueSpeech
.
getClueId
()).
add
(
clueSpeech
);
}
}
return
clueSpeechMap
;
}
/**
* 加载任务成功的话术
*/
public
static
Map
<
Integer
,
List
<
TaskSpeech
>>
getTaskSpeechModel
(
String
speechFilePath
)
{
String
taskSpeechPath
=
speechFilePath
+
"task_success.xlsx"
;
ExcelReader
reader
=
ExcelUtil
.
getReader
(
new
File
(
taskSpeechPath
));
reader
.
addHeaderAlias
(
"线索ID"
,
"demandTaskId"
);
reader
.
addHeaderAlias
(
"任务名称"
,
"taskName"
);
reader
.
addHeaderAlias
(
"身份1"
,
"identity"
);
reader
.
addHeaderAlias
(
"性别"
,
"gender"
);
reader
.
addHeaderAlias
(
"人物ID"
,
"personId"
);
reader
.
addHeaderAlias
(
"年龄段"
,
"age"
);
reader
.
addHeaderAlias
(
"性格A"
,
"dispositionIds"
);
reader
.
addHeaderAlias
(
"行为"
,
"behaviour"
);
reader
.
addHeaderAlias
(
"任务状态"
,
"status"
);
reader
.
addHeaderAlias
(
"进行中任务询问"
,
"doingAsk"
);
reader
.
addHeaderAlias
(
"进行中任务完成提醒"
,
"doingFinishedAnswer"
);
reader
.
addHeaderAlias
(
"未进行中任务完成提醒"
,
"noDoingFinishedAnswer"
);
reader
.
addHeaderAlias
(
"完成对话文本"
,
"answer"
);
reader
.
addHeaderAlias
(
"通用标签"
,
"flag"
);
List
<
TaskSpeech
>
taskSpeechList
=
reader
.
readAll
(
TaskSpeech
.
class
);
reader
.
close
();
Map
<
Integer
,
List
<
TaskSpeech
>>
taskSpeechMap
=
new
ConcurrentHashMap
<>();
for
(
TaskSpeech
taskSpeech
:
taskSpeechList
)
{
if
(
StringUtils
.
isEmpty
(
taskSpeechMap
.
get
(
taskSpeech
.
getDemandTaskId
())))
{
List
<
TaskSpeech
>
taskSpeeches
=
new
ArrayList
<>();
taskSpeeches
.
add
(
taskSpeech
);
taskSpeechMap
.
put
(
taskSpeech
.
getDemandTaskId
(),
taskSpeeches
);
}
else
{
taskSpeechMap
.
get
(
taskSpeech
.
getDemandTaskId
()).
add
(
taskSpeech
);
}
}
return
taskSpeechMap
;
}
/**
* 加载人物见面成功的话术
*/
public
static
Map
<
String
,
List
<
PersonSpeech
>>
getPersonSpeechModel
(
String
speechFilePath
)
{
String
personSpeechPath
=
speechFilePath
+
"person.xlsx"
;
ExcelReader
reader
=
ExcelUtil
.
getReader
(
new
File
(
personSpeechPath
));
reader
.
addHeaderAlias
(
"ID"
,
"personId"
);
reader
.
addHeaderAlias
(
"人物名称"
,
"name"
);
reader
.
addHeaderAlias
(
"人物描述"
,
"description"
);
reader
.
addHeaderAlias
(
"首次回复"
,
"firstAnswer"
);
reader
.
addHeaderAlias
(
"回复"
,
"answer"
);
List
<
PersonSpeech
>
personSpeechList
=
reader
.
readAll
(
PersonSpeech
.
class
);
reader
.
close
();
Map
<
String
,
List
<
PersonSpeech
>>
personSpeechMap
=
new
ConcurrentHashMap
<>();
for
(
PersonSpeech
personSpeech
:
personSpeechList
)
{
if
(
StringUtils
.
isEmpty
(
personSpeechMap
.
get
(
personSpeech
.
getName
())))
{
List
<
PersonSpeech
>
personSpeeches
=
new
ArrayList
<>();
personSpeeches
.
add
(
personSpeech
);
personSpeechMap
.
put
(
personSpeech
.
getName
(),
personSpeeches
);
}
else
{
personSpeechMap
.
get
(
personSpeech
.
getName
()).
add
(
personSpeech
);
}
}
return
personSpeechMap
;
}
/**
* 加载任务提示的话术
*/
public
static
Map
<
Integer
,
List
<
TipSpeech
>>
getTipSpeechModel
(
String
speechFilePath
)
{
String
tipSpeechPath
=
speechFilePath
+
"tip.xlsx"
;
ExcelReader
reader
=
ExcelUtil
.
getReader
(
new
File
(
tipSpeechPath
));
reader
.
addHeaderAlias
(
"ID"
,
"demandTaskId"
);
reader
.
addHeaderAlias
(
"关于自身线索的指引"
,
"selfClue"
);
reader
.
addHeaderAlias
(
"关于他人线索的指引"
,
"otherClue"
);
reader
.
addHeaderAlias
(
"关于任务的指引"
,
"taskClue"
);
List
<
TipSpeech
>
tipSpeechList
=
reader
.
readAll
(
TipSpeech
.
class
);
reader
.
close
();
Map
<
Integer
,
List
<
TipSpeech
>>
tipSpeechMap
=
new
ConcurrentHashMap
<>();
for
(
TipSpeech
tipSpeech
:
tipSpeechList
)
{
if
(
StringUtils
.
isEmpty
(
tipSpeechMap
.
get
(
tipSpeech
.
getDemandTaskId
())))
{
List
<
TipSpeech
>
tipSpeeches
=
new
ArrayList
<>();
tipSpeeches
.
add
(
tipSpeech
);
tipSpeechMap
.
put
(
tipSpeech
.
getDemandTaskId
(),
tipSpeeches
);
}
else
{
tipSpeechMap
.
get
(
tipSpeech
.
getDemandTaskId
()).
add
(
tipSpeech
);
}
}
return
tipSpeechMap
;
}
/**
* 获取闲聊的话术
* @param uid
* @param person
* @param methodId
*/
public
static
String
getChatSpeech
(
String
uid
,
Person
person
,
String
methodId
)
{
String
text
=
""
;
Map
<
Integer
,
Integer
>
countMap
=
new
HashMap
<>();
List
<
ChatSpeech
>
chatList
=
TimingAcquisition
.
chatSpeechMap
.
get
(
Integer
.
valueOf
(
methodId
));
String
gender
=
person
.
getGender
()
==
1
?
"男"
:
"女"
;
boolean
flag
=
false
;
//有条件标记
int
num
=
0
;
for
(
int
i
=
0
;
i
<
chatList
.
size
();
i
++)
{
ChatSpeech
chatSpeech
=
chatList
.
get
(
i
);
if
(
StringUtils
.
isEmpty
(
chatSpeech
.
getIdentity
())
&&
StringUtils
.
isEmpty
(
chatSpeech
.
getGender
())
&&
StringUtils
.
isEmpty
(
chatSpeech
.
getAge
())
&&
StringUtils
.
isEmpty
(
chatSpeech
.
getDispositionIds
()))
{
flag
=
true
;
num
=
i
;
continue
;
}
int
count
=
0
;
//符合身份
if
(!
StringUtils
.
isEmpty
(
chatSpeech
.
getIdentity
()))
{
if
(
person
.
getIdentityName
().
equals
(
chatSpeech
.
getIdentity
()))
{
count
++;
}
else
{
continue
;
}
}
//符合性别
if
(!
StringUtils
.
isEmpty
(
chatSpeech
.
getGender
()))
{
if
(
gender
.
equals
(
chatSpeech
.
getGender
()))
{
count
++;
}
else
{
continue
;
}
}
//符合年龄
if
(!
StringUtils
.
isEmpty
(
chatSpeech
.
getAge
()))
{
String
[]
ageRange
=
chatSpeech
.
getAge
().
split
(
"\\|"
);
if
(
NumberUtil
.
inNumRange
(
person
.
getAge
(),
"["
+
ageRange
[
0
]+
","
+
ageRange
[
1
]+
"]"
))
{
count
++;
}
else
{
continue
;
}
}
//符合性格
if
(!
StringUtils
.
isEmpty
(
chatSpeech
.
getDispositionIds
()))
{
String
[]
dispositionIds
=
chatSpeech
.
getDispositionIds
().
split
(
"\\|"
);
//话术的性格要求
List
<
Integer
>
dispositionIdList
=
Arrays
.
stream
(
dispositionIds
).
map
(
Integer:
:
new
).
collect
(
Collectors
.
toList
());
//对话人的性格要求
List
<
Integer
>
dispositionPerson
=
person
.
getDispositions
().
stream
().
map
(
DispositionDto:
:
getDispositionId
).
collect
(
Collectors
.
toList
());
//所有性格都符合
if
(
PlayerUtil
.
checkSubset
(
dispositionIdList
,
dispositionPerson
))
{
count
++;
}
else
{
continue
;
}
}
countMap
.
put
(
i
,
count
);
}
int
max
=
0
;
int
index
=
0
;
//找到命中次数最多的索引
for
(
Map
.
Entry
<
Integer
,
Integer
>
entry
:
countMap
.
entrySet
())
{
if
(
entry
.
getValue
()
>
max
)
{
max
=
entry
.
getValue
();
index
=
entry
.
getKey
();
}
}
if
(
max
==
0
)
{
//有配置但是没有找到对应的话术
if
(!
flag
)
{
//没有对应话术时,采用笼统的回复
List
<
ChatSpeech
>
normalChatList
=
TimingAcquisition
.
chatSpeechMap
.
get
(
9002
);
for
(
ChatSpeech
speech
:
normalChatList
)
{
//符合身份
if
(!
StringUtils
.
isEmpty
(
speech
.
getIdentity
()))
{
if
(
person
.
getIdentityName
().
equals
(
speech
.
getIdentity
()))
{
//获取对应话术
text
=
speech
.
getAnswer
();
break
;
}
}
}
}
else
{
//通用的话术
//获取对应话术
text
=
chatList
.
get
(
num
).
getAnswer
();
}
}
else
{
//获取对应话术
text
=
chatList
.
get
(
index
).
getAnswer
();
}
return
text
;
}
/**
* 获取线索成功的话术
* @param uid
* @param person
* @param clue
*/
public
static
String
getSuccessClueSpeech
(
String
uid
,
Person
person
,
ClueDto
clue
)
{
String
text
=
""
;
Map
<
Integer
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
Integer
,
List
<
ClueSpeech
>>
successClueSpeechMap
=
TimingAcquisition
.
successClueSpeechMap
;
List
<
ClueSpeech
>
clueSpeechList
=
successClueSpeechMap
.
get
(
clue
.
getClueId
());
String
gender
=
person
.
getGender
()
==
1
?
"男"
:
"女"
;
for
(
int
i
=
1
;
i
<
clueSpeechList
.
size
();
i
++)
{
ClueSpeech
clueSpeech
=
clueSpeechList
.
get
(
i
);
int
count
=
0
;
//符合身份
if
(!
StringUtils
.
isEmpty
(
clueSpeech
.
getIdentity
()))
{
if
(
person
.
getIdentityName
().
equals
(
clueSpeech
.
getIdentity
()))
{
count
++;
}
else
{
continue
;
}
}
//符合性别
if
(!
StringUtils
.
isEmpty
(
clueSpeech
.
getGender
()))
{
if
(
gender
.
equals
(
clueSpeech
.
getGender
()))
{
count
++;
}
else
{
continue
;
}
}
//符合年龄
if
(!
StringUtils
.
isEmpty
(
clueSpeech
.
getAge
()))
{
String
[]
ageRange
=
clueSpeech
.
getAge
().
split
(
"\\|"
);
if
(
NumberUtil
.
inNumRange
(
person
.
getAge
(),
"["
+
ageRange
[
0
]+
","
+
ageRange
[
1
]+
"]"
))
{
count
++;
}
else
{
continue
;
}
}
//符合性格
if
(!
StringUtils
.
isEmpty
(
clueSpeech
.
getDispositionIds
()))
{
String
[]
dispositionIds
=
clueSpeech
.
getDispositionIds
().
split
(
"\\|"
);
//话术的性格要求
List
<
Integer
>
dispositionIdList
=
Arrays
.
stream
(
dispositionIds
).
map
(
Integer:
:
new
).
collect
(
Collectors
.
toList
());
//对话人的性格要求
List
<
Integer
>
dispositionPerson
=
person
.
getDispositions
().
stream
().
map
(
DispositionDto:
:
getDispositionId
).
collect
(
Collectors
.
toList
());
//所有性格都符合
if
(
PlayerUtil
.
checkSubset
(
dispositionIdList
,
dispositionPerson
))
{
count
++;
}
else
{
continue
;
}
}
countMap
.
put
(
i
,
count
);
}
int
max
=
0
;
int
index
=
0
;
//找到命中次数最多的索引
for
(
Map
.
Entry
<
Integer
,
Integer
>
entry
:
countMap
.
entrySet
())
{
if
(
entry
.
getValue
()
>
max
)
{
max
=
entry
.
getValue
();
index
=
entry
.
getKey
();
}
}
if
(
max
==
0
)
{
//获取对应话术
if
(!
person
.
getId
().
equals
(
clue
.
getSubject
()))
{
text
=
clueSpeechList
.
get
(
0
).
getAnswer
();
}
else
{
text
=
clueSpeechList
.
get
(
0
).
getAnswerSelf
();
}
}
else
{
//获取对应话术
if
(!
person
.
getId
().
equals
(
clue
.
getSubject
()))
{
text
=
clueSpeechList
.
get
(
index
).
getAnswer
();
}
else
{
text
=
clueSpeechList
.
get
(
index
).
getAnswerSelf
();
}
}
//话术中配置数据替换
if
(
text
.
contains
(
"【A】"
))
{
text
=
text
.
replace
(
"【A】"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
clue
.
getSubject
()));
}
if
(
text
.
contains
(
"【B】"
))
{
text
=
text
.
replace
(
"【B】"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
clue
.
getObject
()));
}
if
(
text
.
contains
(
"【第三人称】"
))
{
String
call
=
(
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
clue
.
getSubject
()).
getGender
()
==
1
)
?
"他"
:
"她"
;
text
=
text
.
replace
(
"【第三人称】"
,
call
);
}
if
(
text
.
contains
(
"A"
))
{
text
=
text
.
replace
(
"A"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
clue
.
getSubject
()));
}
if
(
text
.
contains
(
"B"
))
{
text
=
text
.
replace
(
"B"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
clue
.
getObject
()));
}
return
text
;
}
/**
* 获取任务成功的话术
* @param uid
* @param person
* @param demandTask
*/
public
static
String
getSuccessTaskSpeech
(
String
uid
,
Person
person
,
DemandTaskDto
demandTask
)
{
String
text
=
""
;
Map
<
Integer
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
Integer
,
List
<
TaskSpeech
>>
successTaskSpeechMap
=
TimingAcquisition
.
successTaskSpeechMap
;
List
<
TaskSpeech
>
taskSpeechList
=
successTaskSpeechMap
.
get
(
demandTask
.
getDemandTaskId
());
String
gender
=
person
.
getGender
()
==
1
?
"男"
:
"女"
;
for
(
int
i
=
1
;
i
<
taskSpeechList
.
size
();
i
++)
{
TaskSpeech
taskSpeech
=
taskSpeechList
.
get
(
i
);
int
count
=
0
;
//符合身份
if
(!
StringUtils
.
isEmpty
(
taskSpeech
.
getIdentity
()))
{
if
(
person
.
getIdentityName
().
equals
(
taskSpeech
.
getIdentity
()))
{
count
++;
}
else
{
continue
;
}
}
//符合性别
if
(!
StringUtils
.
isEmpty
(
taskSpeech
.
getGender
()))
{
if
(
gender
.
equals
(
taskSpeech
.
getGender
()))
{
count
++;
}
else
{
continue
;
}
}
//符合年龄
if
(!
StringUtils
.
isEmpty
(
taskSpeech
.
getAge
()))
{
String
[]
ageRange
=
taskSpeech
.
getAge
().
split
(
"\\|"
);
if
(
NumberUtil
.
inNumRange
(
person
.
getAge
(),
"["
+
ageRange
[
0
]+
","
+
ageRange
[
1
]+
"]"
))
{
count
++;
}
else
{
continue
;
}
}
//符合性格
if
(!
StringUtils
.
isEmpty
(
taskSpeech
.
getDispositionIds
()))
{
String
[]
dispositionIds
=
taskSpeech
.
getDispositionIds
().
split
(
"\\|"
);
//话术的性格要求
List
<
Integer
>
dispositionIdList
=
Arrays
.
stream
(
dispositionIds
).
map
(
Integer:
:
new
).
collect
(
Collectors
.
toList
());
//对话人的性格要求
List
<
Integer
>
dispositionPerson
=
person
.
getDispositions
().
stream
().
map
(
DispositionDto:
:
getDispositionId
).
collect
(
Collectors
.
toList
());
//所有性格都符合
if
(
PlayerUtil
.
checkSubset
(
dispositionIdList
,
dispositionPerson
))
{
count
++;
}
else
{
continue
;
}
}
countMap
.
put
(
i
,
count
);
}
int
max
=
0
;
int
index
=
0
;
//找到命中次数最多的索引
for
(
Map
.
Entry
<
Integer
,
Integer
>
entry
:
countMap
.
entrySet
())
{
if
(
entry
.
getValue
()
>
max
)
{
max
=
entry
.
getValue
();
index
=
entry
.
getKey
();
}
}
if
(
max
==
0
)
{
//获取对应话术
text
=
taskSpeechList
.
get
(
0
).
getAnswer
();
}
else
{
//获取对应话术
text
=
taskSpeechList
.
get
(
index
).
getAnswer
();
}
//话术中配置数据替换
if
(
text
.
contains
(
"【A】"
))
{
text
=
text
.
replace
(
"【A】"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
demandTask
.
getSubject
()));
}
if
(
text
.
contains
(
"【B】"
))
{
text
=
text
.
replace
(
"【B】"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
demandTask
.
getObject
()));
}
if
(
text
.
contains
(
"【第三人称】"
))
{
String
call
=
(
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
demandTask
.
getSubject
()).
getGender
()
==
1
)
?
"他"
:
"她"
;
text
=
text
.
replace
(
"【第三人称】"
,
call
);
}
if
(
text
.
contains
(
"【条件2】"
))
{
if
(!
StringUtils
.
isEmpty
(
demandTask
.
getCondition2
()))
{
text
=
text
.
replace
(
"【条件2】"
,
demandTask
.
getCondition2
());
}
}
if
(
text
.
contains
(
"【奖励】"
))
{
if
(!
StringUtils
.
isEmpty
(
demandTask
.
getCompletionReward
()))
{
if
(!
"0"
.
equals
(
demandTask
.
getCompletionReward
()))
{
PlayerUtil
.
addMoneyNum
(
uid
,
Integer
.
parseInt
(
demandTask
.
getCompletionReward
()));
text
=
text
.
replace
(
"【奖励】"
,
demandTask
.
getCompletionReward
());
}
}
}
if
(
text
.
contains
(
"A"
))
{
text
=
text
.
replace
(
"A"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
demandTask
.
getSubject
()));
}
if
(
text
.
contains
(
"B"
))
{
text
=
text
.
replace
(
"B"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
demandTask
.
getObject
()));
}
//补充信任值和威慑度增减的回复
String
addText
=
"【旁白@正常】【1】对你的信任达到【2】,对你的畏惧达到【3】。"
;
addText
=
speechReplaceNum
(
addText
,
person
.
getName
(),
String
.
valueOf
(
person
.
getTrustDegree
()),
String
.
valueOf
(
person
.
getDeterrenceDegree
()));
// if (!StringUtils.isEmpty(demandTask.getCompletionReward())) {
// if (!"0".equals(demandTask.getCompletionReward())) {
// addText += "你获得" + demandTask.getCompletionReward() + "文酬劳。";
// }
// }
text
+=
addText
;
text
=
text
.
replace
(
"\n"
,
""
);
return
text
;
}
/**
* 获取前后置任务成功的话术
* @param uid
* @param person
* @param demandTask
*/
public
static
String
getPreSuccessTaskSpeech
(
String
uid
,
Person
person
,
DemandTaskDto
demandTask
,
int
level
)
{
String
text
=
""
;
Map
<
Integer
,
Integer
>
countMap
=
new
HashMap
<>();
Map
<
Integer
,
List
<
TaskSpeech
>>
successTaskSpeechMap
=
TimingAcquisition
.
successTaskSpeechMap
;
List
<
TaskSpeech
>
taskSpeechList
=
successTaskSpeechMap
.
get
(
demandTask
.
getDemandTaskId
());
String
gender
=
person
.
getGender
()
==
1
?
"男"
:
"女"
;
for
(
int
i
=
1
;
i
<
taskSpeechList
.
size
();
i
++)
{
TaskSpeech
taskSpeech
=
taskSpeechList
.
get
(
i
);
int
count
=
0
;
//符合身份
if
(!
StringUtils
.
isEmpty
(
taskSpeech
.
getIdentity
()))
{
if
(
person
.
getIdentityName
().
equals
(
taskSpeech
.
getIdentity
()))
{
count
++;
}
else
{
continue
;
}
}
//符合性别
if
(!
StringUtils
.
isEmpty
(
taskSpeech
.
getGender
()))
{
if
(
gender
.
equals
(
taskSpeech
.
getGender
()))
{
count
++;
}
else
{
continue
;
}
}
//符合年龄
if
(!
StringUtils
.
isEmpty
(
taskSpeech
.
getAge
()))
{
String
[]
ageRange
=
taskSpeech
.
getAge
().
split
(
"\\|"
);
if
(
NumberUtil
.
inNumRange
(
person
.
getAge
(),
"["
+
ageRange
[
0
]+
","
+
ageRange
[
1
]+
"]"
))
{
count
++;
}
else
{
continue
;
}
}
//符合性格
if
(!
StringUtils
.
isEmpty
(
taskSpeech
.
getDispositionIds
()))
{
String
[]
dispositionIds
=
taskSpeech
.
getDispositionIds
().
split
(
"\\|"
);
//话术的性格要求
List
<
Integer
>
dispositionIdList
=
Arrays
.
stream
(
dispositionIds
).
map
(
Integer:
:
new
).
collect
(
Collectors
.
toList
());
//对话人的性格要求
List
<
Integer
>
dispositionPerson
=
person
.
getDispositions
().
stream
().
map
(
DispositionDto:
:
getDispositionId
).
collect
(
Collectors
.
toList
());
//所有性格都符合
if
(
PlayerUtil
.
checkSubset
(
dispositionIdList
,
dispositionPerson
))
{
count
++;
}
else
{
continue
;
}
}
countMap
.
put
(
i
,
count
);
}
int
max
=
0
;
int
index
=
0
;
//找到命中次数最多的索引
for
(
Map
.
Entry
<
Integer
,
Integer
>
entry
:
countMap
.
entrySet
())
{
if
(
entry
.
getValue
()
>
max
)
{
max
=
entry
.
getValue
();
index
=
entry
.
getKey
();
}
}
String
addText
=
""
;
if
(
max
==
0
)
{
//获取对应话术
if
(
level
==
1
)
{
text
=
taskSpeechList
.
get
(
0
).
getDoingFinishedAnswer
();
text
+=
taskSpeechList
.
get
(
0
).
getAnswer
();
}
if
(
level
==
2
)
{
text
=
taskSpeechList
.
get
(
0
).
getNoDoingFinishedAnswer
();
text
+=
taskSpeechList
.
get
(
0
).
getAnswer
();
}
if
(
level
==
3
)
{
text
=
taskSpeechList
.
get
(
0
).
getDoingAsk
();
}
}
else
{
//获取对应话术
if
(
level
==
1
)
{
text
=
taskSpeechList
.
get
(
index
).
getDoingFinishedAnswer
();
text
+=
taskSpeechList
.
get
(
index
).
getAnswer
();
//补充信任值和威慑度增减的回复
addText
=
"【旁白@正常】【1】对你的信任达到【2】,对你的畏惧达到【3】。"
;
addText
=
speechReplaceNum
(
addText
,
person
.
getName
(),
String
.
valueOf
(
person
.
getTrustDegree
()),
String
.
valueOf
(
person
.
getDeterrenceDegree
()));
if
(!
StringUtils
.
isEmpty
(
demandTask
.
getCompletionReward
()))
{
if
(!
"0"
.
equals
(
demandTask
.
getCompletionReward
()))
{
addText
+=
"你获得"
+
demandTask
.
getCompletionReward
()
+
"文酬劳。"
;
}
}
}
if
(
level
==
2
)
{
text
=
taskSpeechList
.
get
(
index
).
getNoDoingFinishedAnswer
();
text
+=
taskSpeechList
.
get
(
index
).
getAnswer
();
//补充信任值和威慑度增减的回复
addText
=
"【旁白@正常】【1】对你的信任达到【2】,对你的畏惧达到【3】。"
;
addText
=
speechReplaceNum
(
addText
,
person
.
getName
(),
String
.
valueOf
(
person
.
getTrustDegree
()),
String
.
valueOf
(
person
.
getDeterrenceDegree
()));
if
(!
StringUtils
.
isEmpty
(
demandTask
.
getCompletionReward
()))
{
if
(!
"0"
.
equals
(
demandTask
.
getCompletionReward
()))
{
addText
+=
"你获得"
+
demandTask
.
getCompletionReward
()
+
"文酬劳。"
;
}
}
}
if
(
level
==
3
)
{
text
=
taskSpeechList
.
get
(
index
).
getDoingAsk
();
}
}
text
=
addHeader
(
text
,
person
.
getName
());
//话术中配置数据替换
if
(
text
.
contains
(
"【A】"
))
{
text
=
text
.
replace
(
"【A】"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
demandTask
.
getSubject
()));
}
if
(
text
.
contains
(
"【B】"
))
{
text
=
text
.
replace
(
"【B】"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
demandTask
.
getObject
()));
}
if
(
text
.
contains
(
"【第三人称】"
))
{
String
call
=
(
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
demandTask
.
getSubject
()).
getGender
()
==
1
)
?
"他"
:
"她"
;
text
=
text
.
replace
(
"【第三人称】"
,
call
);
}
if
(
text
.
contains
(
"【条件2】"
))
{
if
(!
StringUtils
.
isEmpty
(
demandTask
.
getCondition2
()))
{
text
=
text
.
replace
(
"【条件2】"
,
demandTask
.
getCondition2
());
}
}
if
(
text
.
contains
(
"【奖励】"
))
{
if
(!
StringUtils
.
isEmpty
(
demandTask
.
getCompletionReward
()))
{
if
(!
"0"
.
equals
(
demandTask
.
getCompletionReward
()))
{
PlayerUtil
.
addMoneyNum
(
uid
,
Integer
.
parseInt
(
demandTask
.
getCompletionReward
()));
text
=
text
.
replace
(
"【奖励】"
,
demandTask
.
getCompletionReward
());
}
}
}
if
(
text
.
contains
(
"A"
))
{
text
=
text
.
replace
(
"A"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
demandTask
.
getSubject
()));
}
if
(
text
.
contains
(
"B"
))
{
text
=
text
.
replace
(
"B"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
demandTask
.
getObject
()));
}
text
+=
addText
;
text
=
text
.
replace
(
"\n"
,
""
);
return
text
;
}
/**
* 获取自身任务线索提示的话术
* @param uid
* @param demandTask
* @param personId
* @param source
*/
public
static
String
getTipSpeech
(
String
uid
,
DemandTaskDto
demandTask
,
Integer
personId
,
int
source
)
{
String
text
=
""
;
Map
<
Integer
,
List
<
TipSpeech
>>
tipSpeechMap
=
TimingAcquisition
.
tipSpeechMap
;
List
<
TipSpeech
>
tipSpeechList
=
tipSpeechMap
.
get
(
demandTask
.
getDemandTaskId
());
//当前能做的任务线索
if
(
source
==
1
)
{
//获取对应话术
text
=
tipSpeechList
.
get
(
0
).
getTaskClue
();
}
//自身能解锁任务的线索
if
(
source
==
2
)
{
//获取对应话术
text
=
tipSpeechList
.
get
(
0
).
getSelfClue
();
}
//他人能解锁任务的线索
if
(
source
==
3
)
{
//获取对应话术
text
=
tipSpeechList
.
get
(
0
).
getOtherClue
();
}
//话术中配置数据替换
if
(
text
.
contains
(
"【A】"
))
{
text
=
text
.
replace
(
"【A】"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
demandTask
.
getSubject
()));
}
if
(
text
.
contains
(
"【B】"
))
{
text
=
text
.
replace
(
"【B】"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
demandTask
.
getObject
()));
}
if
(
personId
!=
0
)
{
if
(
text
.
contains
(
"【C】"
))
{
text
=
text
.
replace
(
"【C】"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
personId
));
}
}
text
=
text
.
replace
(
"\n"
,
""
);
return
text
;
}
/**
* 获取他人线索提示的话术
* @param uid
* @param barrierTaskKey
* @param personId
*/
public
static
String
getTipSpeech
(
String
uid
,
BarrierTaskKeyDto
barrierTaskKey
,
Integer
personId
)
{
String
text
=
""
;
Map
<
Integer
,
List
<
TipSpeech
>>
tipSpeechMap
=
TimingAcquisition
.
tipSpeechMap
;
List
<
TipSpeech
>
tipSpeechList
=
tipSpeechMap
.
get
(
barrierTaskKey
.
getDemandTaskId
());
//他人能解锁任务的线索
//获取对应话术
text
=
tipSpeechList
.
get
(
0
).
getOtherClue
();
//话术中配置数据替换
if
(
text
.
contains
(
"【A】"
))
{
text
=
text
.
replace
(
"【A】"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
personId
));
}
if
(
personId
!=
0
)
{
if
(
text
.
contains
(
"【C】"
))
{
text
=
text
.
replace
(
"【C】"
,
TimingAcquisition
.
getNameByPersonId
(
uid
,
barrierTaskKey
.
getSubject
()));
}
}
text
=
text
.
replace
(
"\n"
,
""
);
return
text
;
}
/**
* 获取人物见面时的话术
*/
public
static
String
getPersonSpeech
(
String
uid
,
String
locationId
,
Integer
personId
)
{
String
text
=
""
;
String
name
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonMap
().
get
(
personId
).
getName
();
//判断该人物是否是第一次见面
boolean
isFirstMeet
=
PlayerUtil
.
isFirstMeet
(
uid
,
locationId
,
personId
);
if
(
isFirstMeet
)
{
String
asideText
=
"【旁白@正常】"
+
TimingAcquisition
.
personSpeechMap
.
get
(
name
).
get
(
0
).
getDescription
();
String
personText
=
"【人物名称@正常】"
+
TimingAcquisition
.
personSpeechMap
.
get
(
name
).
get
(
0
).
getFirstAnswer
();
text
=
asideText
+
personText
;
}
else
{
text
=
"【人物名称@正常】"
+
TimingAcquisition
.
personSpeechMap
.
get
(
name
).
get
(
0
).
getAnswer
();
}
return
text
;
}
}
src/main/java/com/qiwu/inference/controller/CommonController.java
View file @
d4c7ebca
...
...
@@ -11,6 +11,7 @@ import com.qiwu.inference.dto.response.ResultResponse;
import
com.qiwu.inference.dto.response.ResultVarsResponse
;
import
com.qiwu.inference.service.ask.AskService
;
import
com.qiwu.inference.service.barrier.BarrierService
;
import
com.qiwu.inference.service.chat.ChatService
;
import
com.qiwu.inference.service.check.CheckService
;
import
com.qiwu.inference.service.login.LoginService
;
import
com.qiwu.inference.service.task.TaskService
;
...
...
@@ -49,6 +50,9 @@ public class CommonController {
@Autowired
private
BarrierService
barrierService
;
@Autowired
private
ChatService
chatService
;
@PostMapping
(
value
=
"/ask"
,
produces
=
"application/json;charset=UTF-8"
)
public
CommonResult
<
ResultVarsResponse
>
startGame
(
@RequestBody
CommonRequest
commonRequest
)
throws
ParseException
{
log
.
info
(
commonRequest
.
getUid
()
+
"当前操作的原始请求参数:"
+
commonRequest
.
getVars
());
...
...
@@ -78,7 +82,22 @@ public class CommonController {
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
//统计玩家闲聊次数
if
(
"闲聊"
.
equals
(
operateName
))
{
int
chatTimes
=
TimingAcquisition
.
playerMap
.
get
(
uid
).
getChatTimes
();
int
times
=
Integer
.
parseInt
(
TimingAcquisition
.
systemConfigMap
.
get
(
"chatTimes"
).
getValue
());
if
(
chatTimes
>
times
)
{
TimingAcquisition
.
playerMap
.
get
(
uid
).
setChatTimes
(
0
);
}
else
{
TimingAcquisition
.
playerMap
.
get
(
uid
).
setChatTimes
(
TimingAcquisition
.
playerMap
.
get
(
uid
).
getChatTimes
()
+
1
);
}
}
else
{
TimingAcquisition
.
playerMap
.
get
(
uid
).
setChatTimes
(
0
);
}
switch
(
operateName
)
{
case
"开始游戏"
:
result
=
loginService
.
startGame
(
operationReq
);
break
;
case
"询问操作"
:
result
=
askService
.
ask
(
operationReq
);
break
;
...
...
@@ -94,8 +113,11 @@ public class CommonController {
case
"取消操作指令"
:
result
=
barrierService
.
cancel
(
operationReq
);
break
;
case
"闲聊"
:
result
=
chatService
.
operate
(
operationReq
);
break
;
}
log
.
info
(
uid
+
"已完成操作:【"
+
operateName
+
"】"
);
return
DataTrimUtil
.
AdjustParams
(
result
);
return
DataTrimUtil
.
AdjustParams
(
uid
,
result
);
}
}
src/main/java/com/qiwu/inference/dao/EndGoalMapper.java
View file @
d4c7ebca
...
...
@@ -5,6 +5,8 @@ import com.qiwu.inference.pojo.EndGoal;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
/**
* <p>
* Mapper 接口
...
...
@@ -16,5 +18,5 @@ import org.springframework.stereotype.Repository;
@Mapper
@Repository
public
interface
EndGoalMapper
extends
BaseMapper
<
EndGoal
>
{
List
<
EndGoal
>
findAll
();
}
src/main/java/com/qiwu/inference/dto/BarrierTaskKeyDto.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
dto
;
import
lombok.Data
;
@Data
public
class
BarrierTaskKeyDto
{
/**
* id唯一标识
*/
private
Integer
id
;
/**
* 需求任务id
*/
private
Integer
demandTaskId
;
/**
* 任务主体
*/
private
Integer
subject
;
/**
* 任务客体
*/
private
Integer
object
;
/**
* 线索id
*/
private
Integer
clueId
;
/**
* 线索类型
*/
private
Integer
type
;
/**
* 任务标签
*/
private
Integer
taskLabel
;
/**
* 后置任务
*/
private
String
postTask
;
}
src/main/java/com/qiwu/inference/dto/ClueDto.java
View file @
d4c7ebca
...
...
@@ -4,6 +4,8 @@ import lombok.Getter;
import
lombok.Setter
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.Objects
;
@Getter
...
...
@@ -15,11 +17,11 @@ public class ClueDto implements Serializable {
/**
* id
*/
private
Integer
id
;
private
int
id
;
/**
* 线索id
*/
private
Integer
clueId
;
private
int
clueId
;
/**
* 线索名称
...
...
@@ -28,11 +30,11 @@ public class ClueDto implements Serializable {
/**
* 主体
*/
private
Integer
subject
;
private
int
subject
;
/**
* 客体
*/
private
Integer
object
;
private
int
object
;
/**
* 描述
*/
...
...
@@ -40,15 +42,15 @@ public class ClueDto implements Serializable {
/**
* 类型: 1:身份 2:场所 3:性格爱好 4:行为 5:关系 6:任务 9: 关键线索
*/
private
Integer
type
;
private
int
type
;
/**
* 信息级别
*/
private
Integer
infoLevel
;
private
int
infoLevel
;
/**
* 关联人物
*/
private
Integer
associatedPerson
;
private
int
associatedPerson
;
/**
* 线索模板
*/
...
...
@@ -57,12 +59,29 @@ public class ClueDto implements Serializable {
/**
* 信任度
*/
private
Integer
trustDegree
;
private
int
trustDegree
=
100
;
/**
* 威胁
*/
private
Integer
threaten
;
private
int
threaten
=
100
;
/**
* 线索来源
*/
private
List
<
Integer
>
sourceIdList
;
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
ClueDto
clue
=
(
ClueDto
)
o
;
return
id
==
clue
.
id
&&
clueId
==
clue
.
clueId
&&
subject
==
clue
.
subject
&&
clueName
.
equals
(
clue
.
clueName
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
id
,
clueId
,
clueName
,
subject
);
}
}
src/main/java/com/qiwu/inference/dto/DemandTaskDto.java
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
dto
;
import
com.qiwu.inference.pojo.DemandTask
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.io.Serializable
;
import
java.util.Objects
;
@Getter
...
...
@@ -14,12 +16,12 @@ public class DemandTaskDto implements Serializable {
/**
* id
*/
private
Integer
id
;
private
int
id
;
/**
* demandTaskId
*/
private
Integer
demandTaskId
;
private
int
demandTaskId
;
/**
* 名称
...
...
@@ -34,22 +36,44 @@ public class DemandTaskDto implements Serializable {
/**
* 主体
*/
private
Integer
subject
;
private
int
subject
;
/**
* 客体
*/
private
Integer
object
;
private
int
object
;
/**
* 开启条件信任度的开始
*/
private
int
trustStart
=
100
;
/**
* 开启条件信任度的结束
*/
private
int
trustEnd
=
100
;
/**
* 开启条件威胁度的开始
*/
private
int
deterrenceStart
=
100
;
/**
* 开启条件威胁度的结束
*/
private
int
deterrenceEnd
=
100
;
/**
*
开启条件信任度
*
后置任务
*/
private
String
trustCondition
;
private
String
postTask
;
/**
*
开启条件威慑度
*
线索开关 0 代表不需要线索就可执行,1 代表需要线索才能执行此任务 2 代表任务已解锁(操作添加,非ai)
*/
private
String
deterrenceCondition
;
private
int
clueSwitch
;
/**
* 条件1|次数
...
...
@@ -64,12 +88,12 @@ public class DemandTaskDto implements Serializable {
/**
* 信任度增减
*/
private
String
trustDegree
;
private
int
trustDegree
;
/**
* 威慑度增减
*/
private
String
deterrenceDegree
;
private
int
deterrenceDegree
;
/**
* 完成奖励
...
...
@@ -82,29 +106,40 @@ public class DemandTaskDto implements Serializable {
/**
* 有效次数
*/
private
String
effectiveDegree
;
/**
* 后置任务
*/
private
String
postTask
;
private
int
effectiveDegree
;
/**
* 类型: 1:身份 2:场所 3:性格爱好 4:行为 5:关系 6:任务 9:关键线索
*/
private
Integer
type
;
private
int
type
;
/**
* 线索id
*/
private
Integer
clueId
;
private
int
clueId
;
/**
* 信息级别
*/
private
Integer
infoLevel
;
private
int
infoLevel
;
/**
* 任务标签 1普通任务 2关键任务 3目标任
*/
private
Integer
taskLabel
;
private
int
taskLabel
;
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
DemandTaskDto
that
=
(
DemandTaskDto
)
o
;
return
id
==
that
.
id
&&
demandTaskId
==
that
.
demandTaskId
&&
subject
==
that
.
subject
&&
type
==
that
.
type
&&
clueId
==
that
.
clueId
&&
name
.
equals
(
that
.
name
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hash
(
id
,
demandTaskId
,
name
,
subject
,
type
,
clueId
);
}
}
src/main/java/com/qiwu/inference/dto/LocationInfoDto.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
dto
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Data
public
class
LocationInfoDto
{
/**
* 场所隐藏状态
*/
private
String
isHidden
;
/**
* 该场所的所有人物id
*/
// List<Integer> personIdList = new ArrayList<>();
/**
* 该场所的所有人物id和见面次数
*/
Map
<
Integer
,
Integer
>
personInfoMap
=
new
HashMap
<>();
}
src/main/java/com/qiwu/inference/dto/PersonInfoDto.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
dto
;
import
lombok.Data
;
@Data
public
class
PersonInfoDto
{
}
src/main/java/com/qiwu/inference/dto/Player.java
View file @
d4c7ebca
...
...
@@ -37,9 +37,9 @@ public class Player {
*/
private
String
total
;
/**
* 当前关卡
已完成次数
* 当前关卡
完成状态:0-未完成,1-已完成
*/
private
String
finished
;
private
int
finished
=
0
;
/**
* 玩家在线状态
*/
...
...
@@ -63,16 +63,16 @@ public class Player {
/**
* 人物集合
*/
private
Map
<
Integer
,
Person
>
personMap
;
private
Map
<
Integer
,
Person
>
personMap
=
new
HashMap
<>()
;
/**
* 人物的姓名和编号转换 map
*/
private
Map
<
String
,
Integer
>
name2IdMap
;
private
Map
<
String
,
Integer
>
name2IdMap
=
new
HashMap
<>()
;
/**
* 当前关卡的货币
*/
private
Double
currency
=
1
000.0
;
private
Double
currency
=
3
000.0
;
/**
* 当前关卡的积分
*/
...
...
@@ -93,6 +93,11 @@ public class Player {
private
Map
<
Integer
,
Map
<
Integer
,
List
<
ClueDto
>>>
clueMap
=
new
HashMap
<>();
/**
* 场所表
*/
private
Map
<
String
,
LocationInfoDto
>
locationMap
=
new
HashMap
<>();
/**
* 线索集合表
*/
private
List
<
ClueDto
>
clues
=
new
ArrayList
<>();
...
...
@@ -102,21 +107,45 @@ public class Player {
*/
private
Map
<
Integer
,
Map
<
Integer
,
Integer
>>
taskMap
=
new
HashMap
<>();
/**
* 已完成任务个数
*/
private
int
finishedTaskNum
=
0
;
public
Player
(){
//初始化推理游戏人物
List
<
String
>
keys
=
new
ArrayList
<>(
TimingAcquisition
.
gateInfoMap
.
keySet
());
int
index
=
RandomUtil
.
randomInt
(
keys
.
size
());
this
.
gateNo
=
keys
.
get
(
index
);
List
<
Person
>
personList
=
TimingAcquisition
.
gateInfoMap
.
get
(
keys
.
get
(
index
));
personMap
=
new
HashMap
<>();
name2IdMap
=
new
HashMap
<>();
for
(
Person
person
:
personList
)
{
taskMap
.
put
(
person
.
getId
(),
new
HashMap
<>());
personMap
.
put
(
person
.
getId
(),
person
);
name2IdMap
.
put
(
person
.
getName
(),
person
.
getId
());
}
}
/**
* 任务个数更新时间
*/
private
String
numUpdateTime
;
/**
* 需要提示任务线索的标识
*/
private
boolean
tipFlag
=
false
;
/**
* 记录玩家当前闲聊次数
*/
private
int
chatTimes
=
0
;
// public Player(){
// //初始化推理游戏人物
// List<String> keys = new ArrayList<>(TimingAcquisition.gateInfoMap.keySet());
// int index = RandomUtil.randomInt(keys.size());
// this.gateNo = keys.get(index);
// List<Person> personList = TimingAcquisition.gateInfoMap.get(keys.get(index));
// List<Person> personCopyList = new ArrayList<>(personList);
// Map<Integer,Map<Integer,Integer>> taskMapCopy = new HashMap<>();
// Map<Integer,Person> personMapCopy = new HashMap<>();
// Map<String,Integer> name2IdMapCopy = new HashMap<>();
// for (Person person : personCopyList) {
// taskMapCopy.put(person.getId(), new HashMap<>());
// personMapCopy.put(person.getId(), person);
// name2IdMapCopy.put(person.getName(), person.getId());
// }
// taskMap.putAll(taskMapCopy);
// personMap.putAll(personMapCopy);
// name2IdMap.putAll(name2IdMapCopy);
// }
/**
* 读取json文件数据
...
...
src/main/java/com/qiwu/inference/dto/PostTaskDto.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
dto
;
import
lombok.Data
;
import
java.util.Map
;
@Data
public
class
PostTaskDto
{
/**
* 人物id
*/
private
Integer
personId
;
/**
* 后置任务的前置任务完成情况: Map<后置任务id, Map<前置任务id, 完成状态>>
*/
Map
<
Integer
,
TaskStatusDto
>
taskStatusMap
;
}
src/main/java/com/qiwu/inference/dto/PostTaskRecordDto.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
dto
;
import
lombok.Data
;
@Data
public
class
PostTaskRecordDto
{
/**
* 人物id
*/
private
Integer
personId
;
/**
* 后置任务id
*/
private
Integer
postTaskId
;
/**
* 前置任务id
*/
private
Integer
preTaskId
;
/**
* 完成状态: 0-未完成, 1-已完成
*/
private
Integer
status
;
/**
* 优先级标记
*/
private
Integer
level
;
}
src/main/java/com/qiwu/inference/dto/TaskStatusDto.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
dto
;
import
lombok.Data
;
@Data
public
class
TaskStatusDto
{
/**
* 任务id
*/
private
Integer
taskId
;
/**
* 完成状态
*/
private
Integer
status
;
}
src/main/java/com/qiwu/inference/pojo/ChatSpeech.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
pojo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ChatSpeech
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"意图反馈"
)
private
Integer
methodId
;
@ApiModelProperty
(
"身份"
)
private
String
identity
;
@ApiModelProperty
(
"人物ID"
)
private
Integer
personId
;
@ApiModelProperty
(
"性别"
)
private
String
gender
;
@ApiModelProperty
(
"年龄段"
)
private
String
age
;
@ApiModelProperty
(
"性格A"
)
private
String
dispositionIds
;
@ApiModelProperty
(
"行为"
)
private
String
behaviour
;
@ApiModelProperty
(
"任务状态"
)
private
String
taskStatus
;
@ApiModelProperty
(
"关系"
)
private
String
degree
;
@ApiModelProperty
(
"文本内容"
)
private
String
answer
;
@ApiModelProperty
(
"通用标签"
)
private
String
flag
;
}
src/main/java/com/qiwu/inference/pojo/ClueSpeech.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
pojo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ClueSpeech
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"线索ID"
)
private
Integer
clueId
;
@ApiModelProperty
(
"任务名称"
)
private
String
taskName
;
@ApiModelProperty
(
"身份1"
)
private
String
identity
;
@ApiModelProperty
(
"性别"
)
private
String
gender
;
@ApiModelProperty
(
"人物ID"
)
private
Integer
personId
;
@ApiModelProperty
(
"年龄段"
)
private
String
age
;
@ApiModelProperty
(
"性格A"
)
private
String
dispositionIds
;
@ApiModelProperty
(
"行为"
)
private
String
behaviour
;
@ApiModelProperty
(
"任务状态"
)
private
Integer
status
;
@ApiModelProperty
(
"线索文本"
)
private
String
answer
;
@ApiModelProperty
(
"自身线索文本"
)
private
String
answerSelf
;
@ApiModelProperty
(
"通用标签"
)
private
Integer
flag
;
}
src/main/java/com/qiwu/inference/pojo/EndGoal.java
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
pojo
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @author xingxing.ye
* @since 2022-11-02
*/
@Getter
@Setter
@TableName
(
"end_goal"
)
@ApiModel
(
value
=
"EndGoal对象"
,
description
=
""
)
public
class
EndGoal
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"结局目标id"
)
private
Integer
id
;
@ApiModelProperty
(
"目标名称"
)
private
String
name
;
@ApiModelProperty
(
"目标描述"
)
private
String
description
;
@ApiModelProperty
(
"组合表:1|2|3|4|5"
)
private
String
clueGroup
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
}
package
com
.
qiwu
.
inference
.
pojo
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @author xingxing.ye
* @since 2022-11-02
*/
@Getter
@Setter
@TableName
(
"end_goal"
)
@ApiModel
(
value
=
"EndGoal对象"
,
description
=
""
)
public
class
EndGoal
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"结局目标id"
)
private
Integer
id
;
@ApiModelProperty
(
"目标名称"
)
private
String
name
;
@ApiModelProperty
(
"目标描述"
)
private
String
description
;
@ApiModelProperty
(
"组合表:1|2|3|4|5"
)
private
String
clueGroup
;
@ApiModelProperty
(
"关键任务id:60034|60043"
)
private
String
associatedTaskId
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
}
src/main/java/com/qiwu/inference/pojo/Location.java
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
pojo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @author xingxing.ye
* @since 2022-11-02
*/
@Getter
@Setter
@ApiModel
(
value
=
"Location对象"
,
description
=
""
)
public
class
Location
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"场所id"
)
private
Integer
id
;
@ApiModelProperty
(
"场所名称"
)
private
String
name
;
@ApiModelProperty
(
"描述"
)
private
String
description
;
@ApiModelProperty
(
"关键场所"
)
private
String
keyLocation
;
@ApiModelProperty
(
"是否隐藏"
)
private
String
isHidden
;
@ApiModelProperty
(
"对应线索模板:"
)
private
String
clueTemplate
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
}
package
com
.
qiwu
.
inference
.
pojo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <p>
*
* </p>
*
* @author xingxing.ye
* @since 2022-11-02
*/
@Getter
@Setter
@ApiModel
(
value
=
"Location对象"
,
description
=
""
)
public
class
Location
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"场所id"
)
private
Integer
id
;
@ApiModelProperty
(
"场所名称"
)
private
String
name
;
@ApiModelProperty
(
"描述"
)
private
String
description
;
@ApiModelProperty
(
"关键场所"
)
private
String
keyLocation
;
@ApiModelProperty
(
"是否隐藏"
)
private
String
isHidden
;
@ApiModelProperty
(
"是否必现"
)
private
String
isAppear
;
@ApiModelProperty
(
"对应线索模板:"
)
private
String
clueTemplate
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"更新时间"
)
private
Date
updateTime
;
}
src/main/java/com/qiwu/inference/pojo/PersonSpeech.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
pojo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
PersonSpeech
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"ID"
)
private
Integer
personId
;
@ApiModelProperty
(
"人物名称"
)
private
String
name
;
@ApiModelProperty
(
"人物描述"
)
private
String
description
;
@ApiModelProperty
(
"首次回复"
)
private
String
firstAnswer
;
@ApiModelProperty
(
"回复"
)
private
String
answer
;
}
src/main/java/com/qiwu/inference/pojo/TaskSpeech.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
pojo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
TaskSpeech
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"线索ID"
)
private
Integer
demandTaskId
;
@ApiModelProperty
(
"任务名称"
)
private
String
taskName
;
@ApiModelProperty
(
"身份1"
)
private
String
identity
;
@ApiModelProperty
(
"性别"
)
private
String
gender
;
@ApiModelProperty
(
"人物ID"
)
private
Integer
personId
;
@ApiModelProperty
(
"年龄段"
)
private
String
age
;
@ApiModelProperty
(
"性格A"
)
private
String
dispositionIds
;
@ApiModelProperty
(
"行为"
)
private
String
behaviour
;
@ApiModelProperty
(
"任务状态"
)
private
Integer
status
;
@ApiModelProperty
(
"进行中任务询问"
)
private
String
doingAsk
;
@ApiModelProperty
(
"进行中任务完成提醒"
)
private
String
doingFinishedAnswer
;
@ApiModelProperty
(
"未进行中任务完成提醒"
)
private
String
noDoingFinishedAnswer
;
@ApiModelProperty
(
"完成对话文本"
)
private
String
answer
;
@ApiModelProperty
(
"通用标签"
)
private
Integer
flag
;
}
src/main/java/com/qiwu/inference/pojo/TipSpeech.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
pojo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
TipSpeech
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"ID"
)
private
Integer
demandTaskId
;
@ApiModelProperty
(
"关于自身线索的指引"
)
private
String
selfClue
;
@ApiModelProperty
(
"关于他人线索的指引"
)
private
String
otherClue
;
@ApiModelProperty
(
"关于任务的指引"
)
private
String
taskClue
;
}
src/main/java/com/qiwu/inference/service/ask/impl/AskServiceImpl.java
View file @
d4c7ebca
...
...
@@ -30,16 +30,6 @@ public class AskServiceImpl implements AskService {
@Override
public
CommonResult
<
ResultVarsResponse
>
ask
(
OperationRequest
operationReq
)
{
String
uid
=
operationReq
.
getUid
();
String
subjectName
=
operationReq
.
getSubjectName
();
//人物名称1
String
objectName
=
operationReq
.
getObjectName
();
//人物名称2
//当前玩家上一轮的请求信息
OperationRequest
lastReq
=
(
OperationRequest
)
CacheUtil
.
get
(
uid
);
if
(!
StringUtils
.
isEmpty
(
lastReq
))
{
subjectName
=
(
subjectName
==
null
)
?
lastReq
.
getSubjectName
()
:
subjectName
;
objectName
=
(
objectName
==
null
)
?
lastReq
.
getObjectName
()
:
objectName
;
}
operationReq
.
setSubjectName
(
subjectName
);
operationReq
.
setObjectName
(
objectName
);
//----------------记录见过的人--------------
PlayerUtil
.
recordClue
(
uid
,
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonId
());
...
...
src/main/java/com/qiwu/inference/service/barrier/impl/BarrierServiceImpl.java
View file @
d4c7ebca
...
...
@@ -8,7 +8,10 @@ import com.qiwu.inference.common.utils.CacheUtil;
import
com.qiwu.inference.common.utils.PlayerUtil
;
import
com.qiwu.inference.common.utils.RandomUtil
;
import
com.qiwu.inference.common.utils.SpeechUtil
;
import
com.qiwu.inference.dto.DemandTaskDto
;
import
com.qiwu.inference.dto.Player
;
import
com.qiwu.inference.dto.PostTaskDto
;
import
com.qiwu.inference.dto.PostTaskRecordDto
;
import
com.qiwu.inference.dto.request.OperationRequest
;
import
com.qiwu.inference.dto.response.ResultResponse
;
import
com.qiwu.inference.dto.response.ResultVarsResponse
;
...
...
@@ -22,6 +25,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.StringUtils
;
import
java.util.List
;
import
java.util.Map
;
@Service
public
class
BarrierServiceImpl
implements
BarrierService
{
...
...
@@ -56,6 +60,17 @@ public class BarrierServiceImpl implements BarrierService {
String
subjectName
=
PlayerUtil
.
getNameByPersonId
(
uid
,
subjectId
);
//场所移动
if
(
"4001"
.
equals
(
methodId
))
{
//离开,或者没有说明去哪和找谁
if
(
StringUtils
.
isEmpty
(
subjectId
)
&&
StringUtils
.
isEmpty
(
locationId
))
{
String
locationText
=
PlayerUtil
.
getLocations
(
uid
);
//获取对应话术
String
text
=
SpeechUtil
.
getBarrierSpeech
(
Constants
.
SPEECH_ASIDE
,
400105
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
locationText
);
resultResponse
.
set
反馈
ID
(
400105
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
//玩家提供的人物名称
if
(!
StringUtils
.
isEmpty
(
subjectId
))
{
//获取人物所在场所
...
...
@@ -71,7 +86,7 @@ public class BarrierServiceImpl implements BarrierService {
return
CommonResult
.
success
(
resultVarsResponse
);
}
List
<
Integer
>
personIdList
=
PlayerUtil
.
getPersonsByLocationId
(
uid
,
locationId
);
if
(
personIdList
.
size
()
==
0
)
{
if
(
StringUtils
.
isEmpty
(
personIdList
)
)
{
//获取对应话术
String
text
=
SpeechUtil
.
getBarrierSpeech
(
Constants
.
SPEECH_ASIDE
,
400104
);
resultResponse
.
set
反馈
ID
(
400104
);
...
...
@@ -79,12 +94,68 @@ public class BarrierServiceImpl implements BarrierService {
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
//查找所有每个人物的后置任务情况
List
<
PostTaskDto
>
postTaskList
=
PlayerUtil
.
getDemandTaskHavePre
(
uid
,
personIdList
);
if
(
postTaskList
.
size
()
!=
0
)
{
//找到优先级高的任务
PostTaskRecordDto
postTaskRecord
=
PlayerUtil
.
getPostTask
(
uid
,
postTaskList
);
//存在优先级高的任务
if
(!
StringUtils
.
isEmpty
(
postTaskRecord
))
{
//前置任务已完成
if
(
postTaskRecord
.
getLevel
()
==
1
||
postTaskRecord
.
getLevel
()
==
2
)
{
subjectId
=
postTaskRecord
.
getPersonId
();
//----------------记录见过的人--------------
PlayerUtil
.
recordClue
(
uid
,
subjectId
);
//任务自动完成
Map
<
Integer
,
Map
<
Integer
,
Integer
>>
taskMap
=
player
.
getTaskMap
();
Map
<
Integer
,
Integer
>
map
=
taskMap
.
get
(
subjectId
);
map
.
put
(
postTaskRecord
.
getPostTaskId
(),
1
);
player
.
setLocation
(
locationId
);
player
.
setPersonId
(
subjectId
);
DemandTaskDto
demandTask
=
PlayerUtil
.
getDemandTaskById
(
uid
,
subjectId
,
postTaskRecord
.
getPostTaskId
());
if
(!
StringUtils
.
isEmpty
(
demandTask
))
{
PlayerUtil
.
addThreshold
(
player
.
getPersonMap
().
get
(
subjectId
),
demandTask
);
String
text
=
""
;
if
(
postTaskRecord
.
getLevel
()
==
1
)
{
//获取对应话术
text
=
SpeechUtil
.
getPreSuccessTaskSpeech
(
uid
,
player
.
getPersonMap
().
get
(
subjectId
),
demandTask
,
1
);
resultResponse
.
set
反馈
ID
(
400105
);
}
if
(
postTaskRecord
.
getLevel
()
==
2
)
{
//获取对应话术
text
=
SpeechUtil
.
getPreSuccessTaskSpeech
(
uid
,
player
.
getPersonMap
().
get
(
subjectId
),
demandTask
,
2
);
resultResponse
.
set
反馈
ID
(
400106
);
}
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
}
//任务是本人发布的
if
(
postTaskRecord
.
getLevel
()
==
3
)
{
subjectId
=
postTaskRecord
.
getPersonId
();
player
.
setLocation
(
locationId
);
player
.
setPersonId
(
subjectId
);
DemandTaskDto
demandTask
=
PlayerUtil
.
getDemandTaskById
(
uid
,
subjectId
,
postTaskRecord
.
getPostTaskId
());
String
text
=
""
;
if
(!
StringUtils
.
isEmpty
(
demandTask
))
{
text
=
SpeechUtil
.
getPreSuccessTaskSpeech
(
uid
,
player
.
getPersonMap
().
get
(
subjectId
),
demandTask
,
3
);
}
//----------------记录见过的人--------------
PlayerUtil
.
recordClue
(
uid
,
subjectId
);
resultResponse
.
set
反馈
ID
(
400107
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
}
}
int
index
=
RandomUtil
.
randomInt
(
personIdList
.
size
());
subjectId
=
personIdList
.
get
(
index
);
subjectName
=
PlayerUtil
.
getNameByPersonId
(
uid
,
subjectId
);
}
//场所为隐藏
if
(
Constants
.
IS_HIDDEN
.
equals
(
TimingAcquisition
.
locationMap
.
get
(
locationId
).
getIsHidden
()))
{
//场所为隐藏
,还未解锁
if
(
Constants
.
IS_HIDDEN
.
equals
(
player
.
getLocationMap
()
.
get
(
locationId
).
getIsHidden
()))
{
//获取对应话术
String
text
=
SpeechUtil
.
getBarrierSpeech
(
Constants
.
SPEECH_ASIDE
,
400102
);
resultResponse
.
set
反馈
ID
(
400102
);
...
...
@@ -97,14 +168,20 @@ public class BarrierServiceImpl implements BarrierService {
//----------------记录见过的人--------------
PlayerUtil
.
recordClue
(
uid
,
subjectId
);
//获取对应话术
String
text
=
SpeechUtil
.
getBarrierSpeech
(
Constants
.
SPEECH_ASIDE
,
400101
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
TimingAcquisition
.
locationMap
.
get
(
locationId
).
getName
(),
subjectName
);
String
text
=
SpeechUtil
.
getPersonSpeech
(
uid
,
locationId
,
subjectId
);
text
=
SpeechUtil
.
replaceHeader
(
text
,
subjectName
);
//更新见面次数
PlayerUtil
.
updateMeetTimes
(
uid
,
locationId
,
subjectId
);
// String call = (player.getPersonMap().get(subjectId).getGender() == 1) ? "他" : "她";
//获取对应话术
// String text = SpeechUtil.getBarrierSpeech(Constants.SPEECH_ASIDE, 400101);
// text = SpeechUtil.speechReplaceNum(text, TimingAcquisition.locationMap.get(locationId).getName(), subjectName, call);
resultResponse
.
set
反馈
ID
(
400101
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
//
场所移动
//
直接找人
if
(
"4002"
.
equals
(
methodId
))
{
//关卡中没有这个人物
if
(
StringUtils
.
isEmpty
(
player
.
getPersonMap
().
get
(
subjectId
)))
{
...
...
@@ -119,23 +196,100 @@ public class BarrierServiceImpl implements BarrierService {
if
(
StringUtils
.
isEmpty
(
player
.
getPersonMap
().
get
(
subjectId
).
getLocation
()))
{
//获取对应话术
String
text
=
SpeechUtil
.
getBarrierSpeech
(
Constants
.
SPEECH_ASIDE
,
400204
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
subjectName
);
resultResponse
.
set
反馈
ID
(
400204
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
//查找所有这个人物的后置任务情况
List
<
PostTaskDto
>
postTaskList
=
PlayerUtil
.
getDemandTaskHavePre
(
uid
,
subjectId
);
if
(
postTaskList
.
size
()
!=
0
)
{
//找到优先级高的任务
PostTaskRecordDto
postTaskRecord
=
PlayerUtil
.
getPostTask
(
uid
,
postTaskList
);
//存在优先级高的任务
if
(!
StringUtils
.
isEmpty
(
postTaskRecord
))
{
//前置任务已完成
if
(
postTaskRecord
.
getLevel
()
==
1
||
postTaskRecord
.
getLevel
()
==
2
)
{
subjectId
=
postTaskRecord
.
getPersonId
();
//----------------记录见过的人--------------
PlayerUtil
.
recordClue
(
uid
,
subjectId
);
//任务自动完成
Map
<
Integer
,
Map
<
Integer
,
Integer
>>
taskMap
=
player
.
getTaskMap
();
Map
<
Integer
,
Integer
>
map
=
taskMap
.
get
(
subjectId
);
map
.
put
(
postTaskRecord
.
getPostTaskId
(),
1
);
player
.
setLocation
(
locationId
);
player
.
setPersonId
(
subjectId
);
DemandTaskDto
demandTask
=
PlayerUtil
.
getDemandTaskById
(
uid
,
subjectId
,
postTaskRecord
.
getPostTaskId
());
if
(!
StringUtils
.
isEmpty
(
demandTask
))
{
PlayerUtil
.
addThreshold
(
player
.
getPersonMap
().
get
(
subjectId
),
demandTask
);
String
text
=
""
;
if
(
postTaskRecord
.
getLevel
()
==
1
)
{
//获取对应话术
text
=
SpeechUtil
.
getPreSuccessTaskSpeech
(
uid
,
player
.
getPersonMap
().
get
(
subjectId
),
demandTask
,
1
);
resultResponse
.
set
反馈
ID
(
400105
);
}
if
(
postTaskRecord
.
getLevel
()
==
2
)
{
//获取对应话术
text
=
SpeechUtil
.
getPreSuccessTaskSpeech
(
uid
,
player
.
getPersonMap
().
get
(
subjectId
),
demandTask
,
2
);
resultResponse
.
set
反馈
ID
(
400106
);
}
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
}
//任务是本人发布的
if
(
postTaskRecord
.
getLevel
()
==
3
)
{
subjectId
=
postTaskRecord
.
getPersonId
();
player
.
setLocation
(
locationId
);
player
.
setPersonId
(
subjectId
);
DemandTaskDto
demandTask
=
PlayerUtil
.
getDemandTaskById
(
uid
,
subjectId
,
postTaskRecord
.
getPostTaskId
());
String
text
=
""
;
if
(!
StringUtils
.
isEmpty
(
demandTask
))
{
text
=
SpeechUtil
.
getPreSuccessTaskSpeech
(
uid
,
player
.
getPersonMap
().
get
(
subjectId
),
demandTask
,
3
);
}
//----------------记录见过的人--------------
PlayerUtil
.
recordClue
(
uid
,
subjectId
);
resultResponse
.
set
反馈
ID
(
400107
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
}
}
//获取人物所在场所
locationId
=
player
.
getPersonMap
().
get
(
subjectId
).
getLocation
();
//跟玩家在同一场所
,直接打招呼
//跟玩家在同一场所
if
(
player
.
getLocation
().
equals
(
locationId
))
{
operationReq
.
setMethodId
(
"2002"
);
player
.
setPersonId
(
subjectId
);
operationReq
.
setMethodId
(
"2002"
);
operationReq
.
setTaskConditionId
(
"70004"
);
//执行打招呼任务
//----------------记录见过的人--------------
PlayerUtil
.
recordClue
(
uid
,
subjectId
);
//更新见面次数
PlayerUtil
.
updateMeetTimes
(
uid
,
locationId
,
subjectId
);
return
commonService
.
operate
(
operationReq
);
//获取对应话术
// String text = SpeechUtil.getPersonSpeech(uid, locationId, subjectId);
// text = SpeechUtil.replaceHeader(text, subjectName);
// resultResponse.set反馈ID(400206);
// resultResponse.set反馈文本(text);
// resultVarsResponse.setVars(resultResponse);
// return CommonResult.success(resultVarsResponse);
}
//不在同一场所
//判断玩家是否已经获得了该人物的场所线索
boolean
flag
=
PlayerUtil
.
checkLocationClue
(
player
.
getClueMap
(),
subjectId
);
if
(!
flag
)
{
//获取对应话术
String
text
=
SpeechUtil
.
getBarrierSpeech
(
Constants
.
SPEECH_ASIDE
,
400204
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
subjectName
);
resultResponse
.
set
反馈
ID
(
400205
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
//保存本轮对话
operationReq
.
setSubjectId
(
subjectId
);
operationReq
.
setMethodId
(
"4001"
);
...
...
src/main/java/com/qiwu/inference/service/chat/ChatService.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
service
.
chat
;
import
com.qiwu.inference.common.api.CommonResult
;
import
com.qiwu.inference.dto.request.OperationRequest
;
import
com.qiwu.inference.dto.response.ResultVarsResponse
;
public
interface
ChatService
{
CommonResult
<
ResultVarsResponse
>
operate
(
OperationRequest
operationReq
);
}
src/main/java/com/qiwu/inference/service/chat/impl/ChatServiceImpl.java
0 → 100644
View file @
d4c7ebca
package
com
.
qiwu
.
inference
.
service
.
chat
.
impl
;
import
com.qiwu.inference.common.TimingAcquisition
;
import
com.qiwu.inference.common.api.CommonResult
;
import
com.qiwu.inference.common.utils.NumberUtil
;
import
com.qiwu.inference.common.utils.PlayerUtil
;
import
com.qiwu.inference.common.utils.SpeechUtil
;
import
com.qiwu.inference.dto.BarrierTaskKeyDto
;
import
com.qiwu.inference.dto.DispositionDto
;
import
com.qiwu.inference.dto.Person
;
import
com.qiwu.inference.dto.Player
;
import
com.qiwu.inference.dto.request.OperationRequest
;
import
com.qiwu.inference.dto.response.ResultResponse
;
import
com.qiwu.inference.dto.response.ResultVarsResponse
;
import
com.qiwu.inference.pojo.ChatSpeech
;
import
com.qiwu.inference.service.chat.ChatService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
public
class
ChatServiceImpl
implements
ChatService
{
@Override
public
CommonResult
<
ResultVarsResponse
>
operate
(
OperationRequest
operationReq
)
{
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
String
methodId
=
operationReq
.
getMethodId
();
//方法编号
Player
player
=
TimingAcquisition
.
playerMap
.
get
(
uid
);
//对话人的信息
Person
current
=
player
.
getPersonMap
().
get
(
player
.
getPersonId
());
//获取对应话术
String
text
=
SpeechUtil
.
getChatSpeech
(
uid
,
current
,
methodId
);
text
=
SpeechUtil
.
addHeader
(
text
,
current
.
getName
());
//闲聊连续对话次数超过指定次数,任务白名单中有该人已解锁或无需解锁的任务则进行提示
int
chatTimes
=
Integer
.
parseInt
(
TimingAcquisition
.
systemConfigMap
.
get
(
"chatTimes"
).
getValue
());
if
(
player
.
getChatTimes
()
>=
chatTimes
)
{
//找到白名单内该人的任务中已解锁或无需解锁的任务
String
addText
=
PlayerUtil
.
getTipInChat
(
uid
,
current
);
if
(!
StringUtils
.
isEmpty
(
addText
))
{
addText
=
"【寒烟@正常】"
+
addText
;
text
+=
addText
;
}
}
resultResponse
.
set
反馈
ID
(
600101
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
}
src/main/java/com/qiwu/inference/service/check/impl/CheckServiceImpl.java
View file @
d4c7ebca
...
...
@@ -40,6 +40,62 @@ public class CheckServiceImpl implements CheckService {
Integer
subjectId
=
operationReq
.
getSubjectId
();
//人物名称id
Integer
clueTypeId
=
operationReq
.
getClueTypeId
();
//线索类型id
boolean
hadTalk
=
false
;
//该关卡没有这个人物
if
(!
StringUtils
.
isEmpty
(
subjectId
))
{
if
(
subjectId
==
Constants
.
REQ_NON
){
//获取对应话术
String
text
=
SpeechUtil
.
getAskSpeech
(
Constants
.
SPEECH_ASIDE
,
100008
);
resultResponse
.
set
反馈
ID
(
300008
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
}
operationReq
.
setOperate
(
Constants
.
OPERATE_CHECK
);
Player
player
=
TimingAcquisition
.
playerMap
.
get
(
uid
);
if
(
"3001"
.
equals
(
methodId
))
{
//玩家已对话过的人物
List
<
Integer
>
personList
=
new
ArrayList
<>(
player
.
getClueMap
().
keySet
());
//玩家还没有获得线索
if
(
personList
.
size
()
==
0
)
{
//获取对应话术
String
text
=
SpeechUtil
.
getCheckSpeech
(
Constants
.
SPEECH_ASIDE
,
30010101
);
resultResponse
.
set
反馈
ID
(
30010101
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
StringBuilder
personText
=
new
StringBuilder
();
for
(
Integer
personId
:
personList
)
{
personText
.
append
(
PlayerUtil
.
getNameByPersonId
(
uid
,
personId
)).
append
(
"、"
);
}
if
(
personText
.
length
()
!=
0
)
{
personText
.
deleteCharAt
(
personText
.
length
()
-
1
);
}
//未提供人物名称
if
(
StringUtils
.
isEmpty
(
subjectId
))
{
//获取对应话术
String
text
=
""
;
if
(
personList
.
size
()
==
1
)
{
//人物信息
Person
person
=
player
.
getPersonMap
().
get
(
personList
.
get
(
0
));
String
call
=
(
person
.
getGender
()
==
1
)
?
"他"
:
"她"
;
text
=
SpeechUtil
.
getCheckSpeech
(
Constants
.
SPEECH_ASIDE
,
30010102
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
personText
.
toString
(),
call
);
//保存本轮对话
operationReq
.
setSubjectId
(
personList
.
get
(
0
));
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
}
else
{
text
=
SpeechUtil
.
getCheckSpeech
(
Constants
.
SPEECH_ASIDE
,
300101
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
personText
.
toString
());
}
resultResponse
.
set
反馈
ID
(
300101
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看人物列表1"
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
}
//当前玩家上一轮的请求信息
OperationRequest
lastReq
=
(
OperationRequest
)
CacheUtil
.
get
(
uid
);
if
(!
StringUtils
.
isEmpty
(
lastReq
))
{
...
...
@@ -49,10 +105,8 @@ public class CheckServiceImpl implements CheckService {
hadTalk
=
true
;
}
}
operationReq
.
setOperate
(
Constants
.
OPERATE_CHECK
);
Player
player
=
TimingAcquisition
.
playerMap
.
get
(
uid
);
//查看人物列表
if
(
"3001"
.
equals
(
methodId
)
||
"3002"
.
equals
(
methodId
))
{
if
(
"3001
02
"
.
equals
(
methodId
)
||
"3002"
.
equals
(
methodId
))
{
//玩家已对话过的人物
List
<
Integer
>
personList
=
new
ArrayList
<>(
player
.
getClueMap
().
keySet
());
//玩家还没有获得线索
...
...
@@ -115,6 +169,9 @@ public class CheckServiceImpl implements CheckService {
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
//保存本轮对话
operationReq
.
setSubjectId
(
subjectId
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//人物信息
Person
person
=
player
.
getPersonMap
().
get
(
subjectId
);
String
call
=
(
person
.
getGender
()
==
1
)
?
"他"
:
"她"
;
...
...
@@ -175,16 +232,19 @@ public class CheckServiceImpl implements CheckService {
if
(
entry
.
getKey
()
==
9
)
{
clueText
.
append
(
"关键线索: "
);
}
clueText
.
append
(
clues
.
size
()).
append
(
"、"
);
clueText
.
append
(
clues
.
size
()).
append
(
"
条
、"
);
}
if
(
clueText
.
length
()
!=
0
)
{
clueText
.
deleteCharAt
(
clueText
.
length
()
-
1
);
//保存本轮对话
operationReq
.
setSubjectId
(
subjectId
);
CacheUtil
.
put
(
uid
,
operationReq
,
Long
.
parseLong
(
expireTime
));
//获取对应话术
String
text
=
SpeechUtil
.
getCheckSpeech
(
Constants
.
SPEECH_ASIDE
,
300103
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
clueText
.
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
PlayerUtil
.
getNameByPersonId
(
uid
,
subjectId
),
clueText
.
toString
());
resultResponse
.
set
反馈
ID
(
300103
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看
人物列表2
"
);
resultResponse
.
set
后台附加返回
(
"查看
线索3
"
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
...
...
@@ -222,8 +282,12 @@ public class CheckServiceImpl implements CheckService {
if
(
"3005"
.
equals
(
methodId
))
{
int
clueSize
=
0
;
for
(
Map
.
Entry
<
Integer
,
Map
<
Integer
,
List
<
ClueDto
>>>
entry
:
player
.
getClueMap
().
entrySet
())
{
for
(
Map
.
Entry
<
Integer
,
List
<
ClueDto
>>
listEntry
:
entry
.
getValue
().
entrySet
())
{
clueSize
+=
listEntry
.
getValue
().
size
();
Map
<
Integer
,
List
<
ClueDto
>>
clueMap
=
entry
.
getValue
();
//遍历该人物所有类型的线索
if
(!
StringUtils
.
isEmpty
(
clueMap
))
{
for
(
Map
.
Entry
<
Integer
,
List
<
ClueDto
>>
listEntry
:
clueMap
.
entrySet
())
{
clueSize
+=
listEntry
.
getValue
().
size
();
}
}
}
//获取对应话术
...
...
@@ -254,20 +318,27 @@ public class CheckServiceImpl implements CheckService {
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
//有线索人物的人数统计
int
count
=
0
;
for
(
Map
.
Entry
<
Integer
,
Map
<
Integer
,
List
<
ClueDto
>>>
entry
:
player
.
getClueMap
().
entrySet
())
{
clueNumText
.
append
(
player
.
getPersonMap
().
get
(
entry
.
getKey
()).
getName
()).
append
(
"有"
);
int
size
=
0
;
for
(
Map
.
Entry
<
Integer
,
List
<
ClueDto
>>
listEntry
:
entry
.
getValue
().
entrySet
())
{
size
+=
listEntry
.
getValue
().
size
();
Map
<
Integer
,
List
<
ClueDto
>>
clueMap
=
entry
.
getValue
();
//遍历该人物所有类型的线索
if
(!
StringUtils
.
isEmpty
(
clueMap
))
{
clueNumText
.
append
(
player
.
getPersonMap
().
get
(
entry
.
getKey
()).
getName
()).
append
(
"有"
);
for
(
Map
.
Entry
<
Integer
,
List
<
ClueDto
>>
listEntry
:
clueMap
.
entrySet
())
{
size
+=
listEntry
.
getValue
().
size
();
count
++;
}
clueNumText
.
append
(
size
).
append
(
"条线索、"
);
}
clueNumText
.
append
(
size
).
append
(
"条线索、"
);
}
if
(
clueNumText
.
length
()
!=
0
)
{
clueNumText
.
deleteCharAt
(
clueNumText
.
length
()
-
1
);
}
//获取对应话术
String
text
=
SpeechUtil
.
getCheckSpeech
(
Constants
.
SPEECH_ASIDE
,
300502
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
player
.
getClueMap
().
size
()
),
clueNumText
.
toString
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
String
.
valueOf
(
count
),
clueNumText
.
toString
());
resultResponse
.
set
反馈
ID
(
300502
);
resultResponse
.
set
反馈文本
(
text
);
resultResponse
.
set
后台附加返回
(
"查看线索2"
);
...
...
@@ -279,9 +350,13 @@ public class CheckServiceImpl implements CheckService {
StringBuilder
clueText
=
new
StringBuilder
();
Map
<
Integer
,
Integer
>
clueNumMap
=
new
HashMap
<>();
for
(
Map
.
Entry
<
Integer
,
Map
<
Integer
,
List
<
ClueDto
>>>
entry
:
player
.
getClueMap
().
entrySet
())
{
for
(
Map
.
Entry
<
Integer
,
List
<
ClueDto
>>
listEntry
:
entry
.
getValue
().
entrySet
())
{
int
size
=
(
clueNumMap
.
get
(
listEntry
.
getKey
())
==
null
)
?
0
:
clueNumMap
.
get
(
listEntry
.
getKey
());
clueNumMap
.
put
(
listEntry
.
getKey
(),
size
+
listEntry
.
getValue
().
size
());
Map
<
Integer
,
List
<
ClueDto
>>
clueMap
=
entry
.
getValue
();
//遍历该人物所有类型的线索
if
(!
StringUtils
.
isEmpty
(
clueMap
))
{
for
(
Map
.
Entry
<
Integer
,
List
<
ClueDto
>>
listEntry
:
clueMap
.
entrySet
())
{
int
size
=
(
clueNumMap
.
get
(
listEntry
.
getKey
())
==
null
)
?
0
:
clueNumMap
.
get
(
listEntry
.
getKey
());
clueNumMap
.
put
(
listEntry
.
getKey
(),
size
+
listEntry
.
getValue
().
size
());
}
}
}
//玩家没有收集到线索
...
...
@@ -417,11 +492,15 @@ public class CheckServiceImpl implements CheckService {
StringBuilder
clueText
=
new
StringBuilder
();
int
size
=
0
;
for
(
Map
.
Entry
<
Integer
,
Map
<
Integer
,
List
<
ClueDto
>>>
entry
:
player
.
getClueMap
().
entrySet
())
{
clueText
.
append
(
player
.
getPersonMap
().
get
(
entry
.
getKey
()).
getName
()).
append
(
"有"
);
for
(
Map
.
Entry
<
Integer
,
List
<
ClueDto
>>
listEntry
:
entry
.
getValue
().
entrySet
())
{
if
(
clueTypeId
.
equals
(
listEntry
.
getKey
()))
{
size
+=
listEntry
.
getValue
().
size
();
clueText
.
append
(
listEntry
.
getValue
().
size
()).
append
(
"条、"
);
Map
<
Integer
,
List
<
ClueDto
>>
clueMap
=
entry
.
getValue
();
//遍历该人物所有类型的线索
if
(!
StringUtils
.
isEmpty
(
clueMap
))
{
clueText
.
append
(
player
.
getPersonMap
().
get
(
entry
.
getKey
()).
getName
()).
append
(
"有"
);
for
(
Map
.
Entry
<
Integer
,
List
<
ClueDto
>>
listEntry
:
clueMap
.
entrySet
())
{
if
(
clueTypeId
.
equals
(
listEntry
.
getKey
()))
{
size
+=
listEntry
.
getValue
().
size
();
clueText
.
append
(
listEntry
.
getValue
().
size
()).
append
(
"条、"
);
}
}
}
}
...
...
@@ -476,6 +555,8 @@ public class CheckServiceImpl implements CheckService {
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
subjectId
=
(
subjectId
==
null
)
?
lastReq
.
getSubjectId
()
:
subjectId
;
clueTypeId
=
(
clueTypeId
==
null
)
?
lastReq
.
getClueTypeId
()
:
clueTypeId
;
}
//没有提供人物名称
if
(
StringUtils
.
isEmpty
(
subjectId
))
{
...
...
@@ -560,6 +641,72 @@ public class CheckServiceImpl implements CheckService {
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
//查看某人的模糊操作
if
(
"3101"
.
equals
(
methodId
))
{
//没有提供人物名称
if
(
StringUtils
.
isEmpty
(
subjectId
))
{
//获取对应话术
String
text
=
SpeechUtil
.
getCheckSpeech
(
Constants
.
SPEECH_ASIDE
,
310101
);
resultResponse
.
set
反馈
ID
(
310101
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
//提供的人物名称不存在
if
(
subjectId
==
Constants
.
REQ_NON
)
{
//获取对应话术
String
text
=
SpeechUtil
.
getCheckSpeech
(
Constants
.
SPEECH_ASIDE
,
310102
);
resultResponse
.
set
反馈
ID
(
310102
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
Person
current
=
player
.
getPersonMap
().
get
(
player
.
getPersonId
());
Person
subject
=
player
.
getPersonMap
().
get
(
subjectId
);
//查找符合条件的线索
List
<
ClueDto
>
clueList
=
PlayerUtil
.
findClues
(
current
,
subject
,
1
);
//检查是否符合阈值要求
clueList
=
PlayerUtil
.
checkThreshold
(
current
,
clueList
);
//有身份线索
if
(
clueList
.
size
()
!=
0
)
{
int
index
=
RandomUtil
.
randomInt
(
clueList
.
size
());
//----------------记录线索--------------
PlayerUtil
.
recordClue
(
uid
,
current
.
getId
(),
subjectId
,
clueList
.
get
(
index
).
getType
(),
clueList
.
get
(
index
));
//----------------是否解锁任务-------------
PlayerUtil
.
unlockTask
(
uid
,
subject
,
clueList
.
get
(
index
));
//获取对应话术
String
text
=
SpeechUtil
.
getSuccessClueSpeech
(
uid
,
current
,
clueList
.
get
(
index
));
text
=
SpeechUtil
.
addHeader
(
text
,
current
.
getName
());
resultResponse
.
set
反馈
ID
(
310105
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
//玩家已对话过的人物
List
<
Integer
>
personList
=
new
ArrayList
<>(
player
.
getClueMap
().
keySet
());
//人物未知,则提供基本线信息
if
(!
personList
.
contains
(
subjectId
))
{
//获取对应话术
String
text
=
SpeechUtil
.
getCheckSpeech
(
Constants
.
SPEECH_ASIDE
,
310103
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
subject
.
getName
(),
subject
.
getAge
().
toString
(),
(
subject
.
getGender
()
==
1
)
?
"男"
:
"女"
,
subject
.
getIdentityName
());
resultResponse
.
set
反馈
ID
(
310103
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
else
{
String
call
=
(
subject
.
getGender
()
==
1
)
?
"他"
:
"她"
;
//获取对应话术
String
text
=
SpeechUtil
.
getCheckSpeech
(
Constants
.
SPEECH_ASIDE
,
310104
);
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
subject
.
getName
(),
subject
.
getAge
().
toString
(),
(
subject
.
getGender
()
==
1
)
?
"男"
:
"女"
,
subject
.
getIdentityName
(),
call
,
subject
.
getTrustDegree
().
toString
(),
subject
.
getDeterrenceDegree
().
toString
());
resultResponse
.
set
反馈
ID
(
310104
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
}
//获取对应话术
String
text
=
SpeechUtil
.
getCheckSpeech
(
Constants
.
SPEECH_ASIDE
,
300001
);
resultResponse
.
set
反馈
ID
(
300001
);
...
...
src/main/java/com/qiwu/inference/service/common/CommonService.java
View file @
d4c7ebca
...
...
@@ -49,6 +49,8 @@ public class CommonService {
case
"1026"
:
return
playerService
.
askLocation
(
request
);
case
"1027"
:
case
"1028"
:
case
"1029"
:
return
playerService
.
askPrompt
(
request
);
case
"2001"
:
case
"2003"
:
...
...
@@ -91,6 +93,13 @@ public class CommonService {
case
"2039"
:
case
"2040"
:
case
"2041"
:
case
"2101"
:
case
"2102"
:
case
"2104"
:
case
"2106"
:
case
"2107"
:
case
"2108"
:
case
"2109"
:
return
playerService
.
performTask
(
request
);
}
return
null
;
...
...
src/main/java/com/qiwu/inference/service/login/LoginService.java
View file @
d4c7ebca
...
...
@@ -7,4 +7,6 @@ import com.qiwu.inference.dto.response.ResultVarsResponse;
public
interface
LoginService
{
CommonResult
<
ResultVarsResponse
>
login
(
String
uid
);
CommonResult
<
ResultVarsResponse
>
startGame
(
OperationRequest
operationReq
);
}
src/main/java/com/qiwu/inference/service/login/impl/LoginServiceImpl.java
View file @
d4c7ebca
...
...
@@ -6,19 +6,18 @@ import com.qiwu.inference.common.Constants;
import
com.qiwu.inference.common.TimingAcquisition
;
import
com.qiwu.inference.common.api.CommonResult
;
import
com.qiwu.inference.common.utils.*
;
import
com.qiwu.inference.dto.LocationInfoDto
;
import
com.qiwu.inference.dto.Person
;
import
com.qiwu.inference.dto.Player
;
import
com.qiwu.inference.dto.request.OperationRequest
;
import
com.qiwu.inference.dto.response.*
;
import
com.qiwu.inference.pojo.EndGoal
;
import
com.qiwu.inference.service.login.LoginService
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
@Service
...
...
@@ -35,11 +34,29 @@ public class LoginServiceImpl implements LoginService {
ResultResponse
resultResponse
=
new
ResultResponse
();
//存放玩家数据
Map
<
String
,
String
>
sidGateNoMap
=
new
ConcurrentHashMap
<>();
String
nowTime
=
DateUtil
.
getCurrentTime
();
Player
player
=
new
Player
();
player
.
setSid
(
uid
);
player
.
setStatus
(
Constants
.
ONLINE
);
player
.
setOnlineTime
(
DateUtil
.
getCurrentTime
());
player
.
setOnlineTime
(
nowTime
);
//初始化推理游戏人物
List
<
String
>
keys
=
new
ArrayList
<>(
TimingAcquisition
.
gateInfoMap
.
keySet
());
int
random
=
RandomUtil
.
randomInt
(
keys
.
size
());
player
.
setGateNo
(
keys
.
get
(
random
));
List
<
Person
>
personsCopy
=
TimingAcquisition
.
gateInfoMap
.
get
(
keys
.
get
(
random
));
//深拷贝list
List
<
Person
>
personCopyList
=
PlayerUtil
.
deepCopyList
(
personsCopy
);
Map
<
Integer
,
Map
<
Integer
,
Integer
>>
taskMapCopy
=
new
HashMap
<>();
Map
<
Integer
,
Person
>
personMapCopy
=
new
HashMap
<>();
Map
<
String
,
Integer
>
name2IdMapCopy
=
new
HashMap
<>();
for
(
Person
person
:
personCopyList
)
{
taskMapCopy
.
put
(
person
.
getId
(),
new
HashMap
<>());
personMapCopy
.
put
(
person
.
getId
(),
person
);
name2IdMapCopy
.
put
(
person
.
getName
(),
person
.
getId
());
}
player
.
setTaskMap
(
taskMapCopy
);
player
.
setPersonMap
(
personMapCopy
);
player
.
setName2IdMap
(
name2IdMapCopy
);
//给玩家分配场所和对话人物
Map
<
String
,
List
<
Integer
>>
locationPersonMap
=
new
HashMap
<>();
Map
<
Integer
,
Person
>
personMap
=
player
.
getPersonMap
();
...
...
@@ -67,6 +84,11 @@ public class LoginServiceImpl implements LoginService {
List
<
Integer
>
personList
=
locationPersonMap
.
get
(
locationId
);
int
num
=
RandomUtil
.
randomInt
(
personList
.
size
());
player
.
setPersonId
(
personList
.
get
(
num
));
//生成场所表,包含场所隐藏状态和必现场所
Map
<
String
,
LocationInfoDto
>
locationMap
=
PlayerUtil
.
makeLocationMap
(
locationPersonMap
);
player
.
setLocationMap
(
locationMap
);
//记录玩家第一次的任务个数更新时间
player
.
setNumUpdateTime
(
nowTime
);
TimingAcquisition
.
playerMap
.
put
(
uid
,
player
);
String
playerStr
=
JSON
.
toJSONString
(
player
);
//持久化玩家数据
...
...
@@ -79,4 +101,89 @@ public class LoginServiceImpl implements LoginService {
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
@Override
public
CommonResult
<
ResultVarsResponse
>
startGame
(
OperationRequest
operationReq
)
{
ResultVarsResponse
resultVarsResponse
=
new
ResultVarsResponse
();
ResultResponse
resultResponse
=
new
ResultResponse
();
String
uid
=
operationReq
.
getUid
();
String
text
=
""
;
Player
player
=
TimingAcquisition
.
playerMap
.
get
(
uid
);
//数据重置
if
(
player
.
getFinished
()
==
1
)
{
//初始化推理游戏人物
List
<
String
>
keys
=
new
ArrayList
<>(
TimingAcquisition
.
gateInfoMap
.
keySet
());
int
random
=
RandomUtil
.
randomInt
(
keys
.
size
());
player
.
setGateNo
(
keys
.
get
(
random
));
List
<
Person
>
personsCopy
=
TimingAcquisition
.
gateInfoMap
.
get
(
keys
.
get
(
random
));
//深拷贝list
List
<
Person
>
personCopyList
=
PlayerUtil
.
deepCopyList
(
personsCopy
);
Map
<
Integer
,
Map
<
Integer
,
Integer
>>
taskMapCopy
=
new
HashMap
<>();
Map
<
Integer
,
Person
>
personMapCopy
=
new
HashMap
<>();
Map
<
String
,
Integer
>
name2IdMapCopy
=
new
HashMap
<>();
for
(
Person
person
:
personCopyList
)
{
taskMapCopy
.
put
(
person
.
getId
(),
new
HashMap
<>());
personMapCopy
.
put
(
person
.
getId
(),
person
);
name2IdMapCopy
.
put
(
person
.
getName
(),
person
.
getId
());
}
player
.
setTaskMap
(
taskMapCopy
);
player
.
setPersonMap
(
personMapCopy
);
player
.
setName2IdMap
(
name2IdMapCopy
);
player
.
setCurrency
(
3000.0
);
//给玩家分配场所和对话人物
Map
<
String
,
List
<
Integer
>>
locationPersonMap
=
new
HashMap
<>();
Map
<
Integer
,
Person
>
personMap
=
player
.
getPersonMap
();
for
(
Map
.
Entry
<
Integer
,
Person
>
entry
:
personMap
.
entrySet
())
{
Person
person
=
entry
.
getValue
();
if
(!
StringUtils
.
isEmpty
(
person
.
getLocation
()))
{
//没有当前场所
if
(
StringUtils
.
isEmpty
(
locationPersonMap
.
get
(
person
.
getLocation
())))
{
List
<
Integer
>
personList
=
new
ArrayList
<>();
personList
.
add
(
entry
.
getKey
());
locationPersonMap
.
put
(
person
.
getLocation
(),
personList
);
}
//有当前场所,但是没有这个人
List
<
Integer
>
persons
=
locationPersonMap
.
get
(
person
.
getLocation
());
if
(!
persons
.
contains
(
entry
.
getKey
()))
{
persons
.
add
(
entry
.
getKey
());
}
}
}
List
<
String
>
locationList
=
new
ArrayList
<>(
locationPersonMap
.
keySet
());
int
index
=
RandomUtil
.
randomInt
(
locationList
.
size
());
String
locationId
=
locationList
.
get
(
index
);
player
.
setLocation
(
locationId
);
//随机分配人物
List
<
Integer
>
personList
=
locationPersonMap
.
get
(
locationId
);
int
num
=
RandomUtil
.
randomInt
(
personList
.
size
());
player
.
setPersonId
(
personList
.
get
(
num
));
//生成场所表,包含场所隐藏状态和必现场所
Map
<
String
,
LocationInfoDto
>
locationMap
=
PlayerUtil
.
makeLocationMap
(
locationPersonMap
);
player
.
setLocationMap
(
locationMap
);
}
//关卡编号
String
gateNo
=
player
.
getGateNo
();
int
size
=
TimingAcquisition
.
barrierTaskKeyMap
.
get
(
gateNo
).
size
();
Integer
demandTaskId
=
TimingAcquisition
.
barrierTaskKeyMap
.
get
(
gateNo
).
get
(
size
-
1
).
getDemandTaskId
();
Map
<
Integer
,
EndGoal
>
endGoalMap
=
TimingAcquisition
.
endGoalMap
;
for
(
Map
.
Entry
<
Integer
,
EndGoal
>
entry
:
endGoalMap
.
entrySet
())
{
EndGoal
endGoal
=
entry
.
getValue
();
List
<
String
>
associatedTaskIds
=
Arrays
.
asList
(
endGoal
.
getAssociatedTaskId
().
split
(
"\\|"
));
if
(
associatedTaskIds
.
contains
(
demandTaskId
.
toString
()))
{
text
=
"【旁白@正常】"
+
endGoal
.
getName
();
text
+=
"【旁白@正常】"
+
endGoal
.
getDescription
();
text
+=
SpeechUtil
.
getAskSpeech
(
Constants
.
SPEECH_PERSON
,
103001
);
text
+=
SpeechUtil
.
getAskSpeech
(
Constants
.
SPEECH_PERSON
,
103002
);
String
location
=
TimingAcquisition
.
locationMap
.
get
(
TimingAcquisition
.
playerMap
.
get
(
uid
).
getLocation
()).
getName
();
String
name
=
PlayerUtil
.
getNameByPersonId
(
uid
,
TimingAcquisition
.
playerMap
.
get
(
uid
).
getPersonId
());
text
=
SpeechUtil
.
speechReplaceNum
(
text
,
location
,
name
);
break
;
}
}
resultResponse
.
set
反馈
ID
(
100009
);
resultResponse
.
set
反馈文本
(
text
);
resultVarsResponse
.
setVars
(
resultResponse
);
return
CommonResult
.
success
(
resultVarsResponse
);
}
}
src/main/java/com/qiwu/inference/service/player/impl/PlayerServiceImpl.java
View file @
d4c7ebca
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/main/resources/application-pro.yml
View file @
d4c7ebca
server
:
port
:
60018
serlvet
:
context-type:/inference
#设置当前服务名
spring
:
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://localhost:3306/inference_game?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC
username
:
root
password
:
dgKNTmt2iLHNjEQajkDEZkq8
type
:
com.alibaba.druid.pool.DruidDataSource
druid
:
initial-size
:
5
min-idle
:
5
max-active
:
20
max-wait
:
60000
#配置间隔多久才进行一次检测,检测需要关闭的空闲连接
time-between-eviction-runs-millis
:
20000
#配置一个连接在池中最小生存的时间
min-evictable-idle-time-millis
:
300000
#对话过期时间
expireTime
:
180000
#玩家无操作时长,默认下线
offlineTime
:
180000
speechFilePath
:
/home/jiaoyou/projects/inferenceGame/speech/
configFilePath
:
/home/jiaoyou/projects/inferenceGame/config/
userFilePath
:
/home/jiaoyou/projects/inferenceGame/user/
src/main/resources/application.yml
View file @
d4c7ebca
spring
:
profiles
:
active
:
dev
\ No newline at end of file
active
:
pro
\ No newline at end of file
src/main/resources/com/qiwu/inference/dao/EndGoalMapper.xml
View file @
d4c7ebca
...
...
@@ -8,8 +8,12 @@
<result
column=
"name"
property=
"name"
/>
<result
column=
"description"
property=
"description"
/>
<result
column=
"clue_group"
property=
"clueGroup"
/>
<result
column=
"associated_task_id"
property=
"associatedTaskId"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
</resultMap>
<select
id=
"findAll"
resultMap=
"BaseResultMap"
>
select * from end_goal
</select>
</mapper>
src/main/resources/speech/ask.yaml
View file @
d4c7ebca
...
...
@@ -14,6 +14,8 @@ aside:
-
【旁白@正常】您想打听什么身份呢。
100007
:
-
【旁白@正常】您想打听什么地方呢。
100008
:
-
【旁白@正常】现在没有这个人哦。
#1001: 询问A的性格
100101
:
-
【旁白@正常】【1】。
...
...
@@ -171,7 +173,7 @@ person:
10010201
:
-
【人物名称@正常】我又不认识你,为什么要告诉你关于我的事。
100103
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
【1】的性格。
100104
:
-
【人物名称@正常】
100105
:
...
...
@@ -186,9 +188,9 @@ person:
100203
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
10020301
:
-
【人物名称@正常】我又不认识你,为什么要告诉你我
喜欢什么
?
-
【人物名称@正常】我又不认识你,为什么要告诉你我
的事
?
100204
:
-
【人物名称@正常】不好意思,我不知道。
-
【人物名称@正常】不好意思,我不知道
【1】的性格
。
#1003: 询问A和B是什么关系
100301
:
-
【人物名称@正常】【1】
...
...
@@ -197,7 +199,7 @@ person:
10030201
:
-
【人物名称@正常】我又不认识你,为什么要告诉你我们的关系?
100303
:
-
【人物名称@正常】不好意思,我不知道。
-
【人物名称@正常】不好意思,我不知道
他们的关系
。
10030301
:
-
【人物名称@正常】【1】吗?我好像不认识这个人啊
#1004: 询问A和B是不是某个关系
...
...
@@ -208,42 +210,42 @@ person:
100403
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
100404
:
-
【人物名称@正常】不好意思,我不知道。
-
【人物名称@正常】不好意思,我不知道
他们的关系
。
#1005: 询问和A有某个关系的人是谁
100501
:
-
【人物名称@正常】【1】
100502
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
100503
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
【1】【2】是谁。
#1006: 询问谁和谁有某个关系
100601
:
-
【人物名称@正常】【1】
100602
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
100603
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
有【1】关系的人。
#1007: 询问A有过什么行为
100701
:
-
【人物名称@正常】【1】
100702
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
100703
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
【1】干过什么。
#1008: 询问A和B有什么行为
100801
:
-
【人物名称@正常】【1】
100802
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
100803
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
他们干过什么。
#1009: 询问A和谁有了某个行为
100901
:
-
【人物名称@正常】【1】
100902
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
100903
:
-
【人物名称@正常】不好意思,我不知道。
-
【人物名称@正常】不好意思,我不知道
【1】和谁【2】了
。
#1010: 询问A有没有发生过某个行为
101001
:
-
【人物名称@正常】是的,【1】
...
...
@@ -252,7 +254,7 @@ person:
101003
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
101004
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
【1】有没有【2】过。
#1011: 询问A和B有没有发生过某个行为
101101
:
-
【人物名称@正常】是的,【1】
...
...
@@ -261,14 +263,14 @@ person:
101103
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
101104
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
他们有没有【1】过。
#1012: 询问A知道/看见了B和C的什么行为
101201
:
-
【人物名称@正常】【1】
101202
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
101203
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
。
#1013: 询问A有没有看到B和C发生了某个行为
101301
:
-
【人物名称@正常】是的,【1】
...
...
@@ -284,21 +286,23 @@ person:
101402
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
101403
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
【1】。
#1015: 询问A的提升信任度任务
101501
:
-
【人物名称@正常】【1】
101502
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
101503
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】你想知道的我都已经告诉过你了。
101504
:
-
【人物名称@正常】不好意思,我不知道【1】想干什么。
#1016: 询问A的提升威慑度任务
101601
:
-
【人物名称@正常】【1】
101602
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
101603
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
【1】怕什么。
#1017: 询问A是否有某个提升信任度的任务
101701
:
-
【人物名称@正常】是的,【1】
...
...
@@ -307,7 +311,7 @@ person:
101703
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
101704
:
-
【人物名称@正常】不好意思,我不知道。
-
【人物名称@正常】不好意思,我不知道
可不可以
。
#1018: 询问A是否有某个提升威慑度的任务
101801
:
-
【人物名称@正常】是的,【1】
...
...
@@ -316,21 +320,21 @@ person:
101803
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
101804
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
这样【1】会不会怕你。
#1019: 询问A降低信任度的任务
101901
:
-
【人物名称@正常】【1】
101902
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
101903
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
这样【1】会不会不喜欢你。
#1020: 询问A降低威慑度的任务
102001
:
-
【人物名称@正常】【1】
102002
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
102003
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
【1】会不会对你改观。
#1021: 询问A是否有某个降低信任度的任务
102101
:
-
【人物名称@正常】是的,【1】
...
...
@@ -339,7 +343,7 @@ person:
102103
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
102104
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
这样【1】会不会不喜欢你。
#1022: 询问A是否有某个降低威慑度的任务
102201
:
-
【人物名称@正常】是的,【1】
...
...
@@ -348,28 +352,30 @@ person:
102203
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
102204
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
能不能让【1】不讨厌你。
#1023: 询问A是什么身份
102301
:
-
【人物名称@正常】【1】
102302
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
102303
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
【1】的身份。
#1024: 询问A是不是某个身份
102401
:
-
【人物名称@正常】是的,【1】
102402
:
-
【人物名称@正常】不是,【1】
102403
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】我又不认识你,为什么要告诉你?
102404
:
-
【人物名称@正常】不好意思,我不知道是不是【1】。
#1025: 询问A在哪个场所
102501
:
-
【人物名称@正常】【1】
102502
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
102503
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
【1】在哪。
#1026: 询问A是不是在某个场所
102601
:
-
【人物名称@正常】是的,【1】
...
...
@@ -378,9 +384,17 @@ person:
102603
:
-
【人物名称@正常】我又不认识你,为什么要告诉你?
102604
:
-
【人物名称@正常】不好意思,我不知道
-
【人物名称@正常】不好意思,我不知道
【1】在哪。
#1027: 询问提示
102701
:
-
【人物名称@正常】你可以去问问【1】,他可能知道点什么。
102702
:
-
【人物名称@正常】抱歉,爱莫能助。
#1029: 询问玩家所在场所
102901
:
-
【人物名称@正常】主人,我们在【1】呀。
#1030: 搭档说话
103001
:
-
【寒烟@正常】这个县城里有各色各样的人物,您可以试着从打招呼、送小费开始,到帮助对方解决麻烦,来拉进和对方的关系,或者使用暴力,让对方畏惧于你,以逐步挖掘更深的线索,并最终找出目标。如果一开始没有头绪,少主也可以四处走走,多跟人聊聊天,搜集一下信息。您想去哪里或者找谁,直接说就好。如果发现了任何蛛丝马迹,我会及时提醒少主的。另外,关于人物、地点和关系,如果少主不记得了,也可以随时向我提问。
103002
:
-
【寒烟@正常】我们现在在【1】,看到【2】了,我们过去打个招呼吧。
src/main/resources/speech/barrier.yaml
View file @
d4c7ebca
...
...
@@ -4,13 +4,15 @@ aside:
-
【旁白@正常】好的,已为您取消操作。
#4001: 场所移动
400101
:
-
【旁白@正常】您来到了【1】,【2】在这里,
他
对你微笑点头。
-
【旁白@正常】您来到了【1】,【2】在这里,
【3】
对你微笑点头。
400102
:
-
【旁白@正常】还不知道这个地方在哪,找个人问问吧。
400103
:
-
【旁白@正常】不知道您说的这个地方在哪呢。
400104
:
-
【旁白@正常】这个地方没有你要找的人。
400105
:
-
【旁白@正常】你想要去哪里呢?目前已知场所有:【1】。
#4002: 开启对话
400201
:
-
【旁白@正常】【1】当前线索有:【2】,您要详细查看哪一类的线索呢?
...
...
@@ -43,9 +45,9 @@ aside:
person
:
#4001: 场所移动
400101
:
-
【人物名称@正常】
-
【人物名称@正常】
听说你已经把事办好了,不错不错。
400102
:
-
【人物名称@正常】
-
【人物名称@正常】
那件事办好了吗?
#4002: 开启对话
400201
:
-
【人物名称@正常】【1】
...
...
src/main/resources/speech/check.yaml
View file @
d4c7ebca
...
...
@@ -10,13 +10,13 @@ aside:
30010102
:
-
【旁白@正常】当前已知人物有:【1】,需要查看【2】的详情呢?
300102
:
-
【旁白@正常】【1】,年龄【2】,性别【3】,【4】对你的信任度为:【5】、威慑度为:【6】,要查看
他
的相关线索吗?
-
【旁白@正常】【1】,年龄【2】,性别【3】,【4】对你的信任度为:【5】、威慑度为:【6】,要查看
【4】
的相关线索吗?
30010201
:
-
【旁白@正常】【1】,年龄不详,性别不明,可以去找找这个人。
300103
:
-
【旁白@正常】【1】当前线索有:【2】,您要详细查看哪一类的线索呢?
30010301
:
-
【旁白@正常】您还告诉我想看哪个人的线索呢。
-
【旁白@正常】您
没
还告诉我想看哪个人的线索呢。
30010302
:
-
【旁白@正常】您只见过这个人,还没有收集到线索。
300104
:
...
...
@@ -51,7 +51,7 @@ aside:
30050501
:
-
【旁白@正常】您当前还没有【1】线索。
300506
:
-
【旁白@正常】【1】的【2】线索共【3】条,第【4】条:【5】
。
-
【旁白@正常】【1】的【2】线索共【3】条,第【4】条:【5】
要查看下一条吗?
30050601
:
-
【旁白@正常】您当前还没有收集到【1】的【2】线索。
30050602
:
...
...
@@ -65,5 +65,14 @@ aside:
#3006: 询问谁和谁有某个关系
300601
:
-
【旁白@正常】您当前排名积分为:【1】。
#3101: 询问某人的模糊处理操作
310101
:
-
【寒烟@正常】您还没告诉要看谁的呢。
310102
:
-
【寒烟@正常】没有您说的这个人哦。
310103
:
-
【寒烟@正常】【1】,年龄【2】,性别【3】,身份【4】,其他信息不详。
310104
:
-
【寒烟@正常】【1】,年龄【2】,性别【3】,身份【4】,【5】对你的信任度为:【6】、威慑度为:【7】。
src/main/resources/speech/task.yaml
View file @
d4c7ebca
...
...
@@ -304,7 +304,7 @@ person:
200105
:
-
【人物名称@正常】这酒还是算了吧。
200106
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
谢谢,我不喝酒
。
#2002: 打招呼
200201
:
-
【人物名称@正常】幸会幸会。不知您找在下有什么事情?
...
...
@@ -324,7 +324,7 @@ person:
200304
:
-
【人物名称@正常】我们好像不熟吧?抱歉这是我心爱之物,不能随意割爱。
200305
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
抱歉,我这不买这东西
。
#2004: 买药
200401
:
-
【人物名称@正常】自无不可。
...
...
@@ -335,7 +335,7 @@ person:
200404
:
-
【人物名称@正常】我的药不卖给险恶之人。快走快走。
200405
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
抱歉,我没有药可卖
。
#2005: 获赠金疮药
200501
:
-
【人物名称@正常】以你我的交情,还谈什么钱。这份金疮药我送你了。
...
...
@@ -344,7 +344,7 @@ person:
200503
:
-
【人物名称@正常】我这金疮药得来不易,以你我的交情,还不足以让我割爱。
200504
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我没有金疮药,卖不了
。
#2006: 揍人
200601
:
-
【人物名称@正常】我和你无冤无仇……哎哟!哎哟!
...
...
@@ -353,7 +353,7 @@ person:
200603
:
-
【人物名称@正常】呸,凭你的细胳膊细腿也配和我动手?找死。
200604
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
别动手啊,告诉你,打我也没用
。
#2007: 请吃饭
200701
:
-
【人物名称@正常】盛情难却,这次让你破费了。感谢,感谢。
...
...
@@ -364,7 +364,7 @@ person:
200704
:
-
【人物名称@正常】你的饭菜,我可吃不起。
200705
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我不饿,你也别请了,请客对我没用
。
#2008: 好处费
200801
:
-
【人物名称@正常】哎哟,这,这多不好意思的。
...
...
@@ -373,7 +373,7 @@ person:
200804
:
-
【人物名称@正常】哎哟,您的钱我可不敢收,怕烫手。
200805
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我不收礼,没用的,放弃吧
。
#2009: 帮挑水
200901
:
-
【人物名称@正常】这可太感谢你了。
...
...
@@ -382,7 +382,7 @@ person:
200903
:
-
【人物名称@正常】非亲非故的,不敢劳驾你。
200904
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
家里不缺水,不用你给挑
。
#2010: 一起钓鱼
201001
:
-
【人物名称@正常】正合我意。走!
...
...
@@ -391,7 +391,7 @@ person:
201003
:
-
【人物名称@正常】钓鱼须得三五好友,情投意合才有乐趣。我跟你个陌生人去钓什么鱼!
201004
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我不钓鱼,你找别人吧
。
#2011: 送货
201101
:
-
【人物名称@正常】谢谢,货物我就收下了。
...
...
@@ -400,7 +400,7 @@ person:
201103
:
-
【人物名称@正常】我看你面目可憎,这货我是不敢收的。回去换个人给我送吧。
201104
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我没有东西要收,你找错人了吧
。
#2012: 给钱
201201
:
-
【人物名称@正常】太客气了太客气了。
...
...
@@ -409,7 +409,7 @@ person:
201204
:
-
【人物名称@正常】你这是干什么?非亲非故送人钱财,怕是不安好心。收回去吧。
201205
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我差这么点钱吗,别给我来这套
。
#2013: 邀请医生
201301
:
-
【人物名称@正常】医者父母心,我这就陪你走一趟。诊金么,先预付个【1】文吧。
...
...
@@ -420,8 +420,8 @@ person:
201304
:
-
【人物名称@正常】话不投机,想要我陪你去却是万万不能。
201305
:
-
【人物名称@正常】不好意思,
我很忙
。
#2014: 给钱买
药
-
【人物名称@正常】不好意思,
你另请高明吧
。
#2014: 给钱买
茶具
201401
:
-
【人物名称@正常】也罢。钱给我,这茶具你拿去吧。
201402
:
...
...
@@ -431,7 +431,7 @@ person:
201404
:
-
【人物名称@正常】别以为有两个破钱就了不起。这药不卖!
201405
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我没有茶具这东西,你找别人问问吧
。
#2015: 开怀畅饮
201501
:
-
【人物名称@正常】好酒!好酒!劳您破费了,咱们不醉不归!
...
...
@@ -442,7 +442,7 @@ person:
201504
:
-
【人物名称@正常】咱们不熟,这顿酒还是免了吧。
201505
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
谢谢啊,我真不喝酒
。
#2016: 买回钗子
201601
:
-
【人物名称@正常】行吧,一手交钱一手交货,钗子给你。
...
...
@@ -453,7 +453,7 @@ person:
201604
:
-
【人物名称@正常】休想。这可是美人儿贴身的钗子,怎么能卖给你。
201605
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
别问我,我这真没钗子这样的东西
。
#2017: 抢回钗子
201701
:
-
【人物名称@正常】别,别动手,钗子在这里。给你给你。
...
...
@@ -462,7 +462,7 @@ person:
201703
:
-
【人物名称@正常】想得美!想要回钗子,让她自己来跟我说!
201704
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
抢没用,我这没有钗子
。
#2018: 追回私吞款项
201801
:
-
【人物名称@正常】别,别动手,有话好好说,钱,钱我这就给你。
...
...
@@ -471,7 +471,7 @@ person:
201803
:
-
【人物名称@正常】就凭你?也敢找我追账?知道死字怎么写吗?
201804
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
你找我追什么帐,你找其他人吧
。
#2019: 探听身家
201901
:
-
【人物名称@正常】别看我平时低调,悄悄跟你说,我的身家,最少有这个数,嘿嘿。
...
...
@@ -480,7 +480,7 @@ person:
201903
:
-
【人物名称@正常】你打听这个作什么?无可奉告!
201904
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我这没什么可问的
。
#2020:解救被绑女孩
202001
:
-
【人物名称@正常】你,你怎么知道的?
...
...
@@ -491,7 +491,7 @@ person:
202003
:
-
【人物名称@正常】你在说什么,我完全听不懂!
202004
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
你找错人了吧
。
#2021:审问罪犯供出老巢
202101
:
-
【人物名称@正常】别动手,别动手,我说。
...
...
@@ -501,7 +501,7 @@ person:
202103
:
-
【人物名称@正常】呸,你休想知道。
202104
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
此事与我无关,不知道你在说什么
。
#2022:交出藏宝图
202201
:
-
【人物名称@正常】想不到你居然能打听到如此隐秘之事。
...
...
@@ -511,7 +511,7 @@ person:
202203
:
-
【人物名称@正常】我的秘药可不是随便给人用的。告辞!
202204
:
-
【人物名称@正常】不好意思,我
很忙
。
-
【人物名称@正常】不好意思,我
没有这东西
。
#2023:抓捕人犯
202301
:
-
【人物名称@正常】我自以为天衣无缝,居然还是被你发现了。天意啊,天意。
...
...
@@ -521,8 +521,8 @@ person:
202303
:
-
【人物名称@正常】就凭你,还不足以让我认罪。给我滚!
202304
:
-
【人物名称@正常】
不好意思,我很忙
。
#2024:
抓捕人犯
-
【人物名称@正常】
拜托你别乱抓人好不好,别逮谁都像坏人
。
#2024:
购买犯人信息
202401
:
-
【人物名称@正常】嘿嘿,这还差不多,我告诉你啊,那天我刚好路过,听到一声惨叫,偷偷探头一看,发现【1】满脸鲜血,正在行凶!
202402
:
...
...
@@ -532,7 +532,7 @@ person:
202404
:
-
【人物名称@正常】我跟你很熟吗?这钱我可不敢要。
202405
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
抱歉,我没有这消息
。
#2025:购买物品完成
202501
:
-
【人物名称@正常】且让我看看。这,这正是我所需之物。感激不尽。
...
...
@@ -546,11 +546,11 @@ person:
202505
:
-
【人物名称@正常】且让我看看。这,这根本是假货啊!你被人骗了!算了,算了。你辛苦一场,也不容易。这点钱你收下。
202506
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
你找错人了吧,我可没叫你帮我带东西
。
#2026:大夫出诊完成
202601
:
-
【人物名称@正常】大夫刚才已经来过,我感觉好多了。请受我一拜。
【旁白@正常】你与【1】的友好度
改变【2】点,威慑度改变
【3】点。
【旁白@正常】你与【1】的友好度
变为【2】点,威慑度变为
【3】点。
202602
:
-
【人物名称@正常】正如刚才所言,大夫已经来过了。大恩不言谢,以后有什么困难可以找我。
202603
:
...
...
@@ -558,11 +558,11 @@ person:
202604
:
-
【人物名称@正常】大夫虽然来过,但是不是你请回来的我可不确定。
202605
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
抱歉,我不是大夫。你找错人了
。
#2027:寻回物品完成
202701
:
-
【人物名称@正常】哎呀,这正是我丢失的。太谢谢你了。
【旁白@正常】你与【1】的友好度
改变【2】点,威慑度改变
【3】点。
【旁白@正常】你与【1】的友好度
变为【2】点,威慑度变为
【3】点。
202702
:
-
【人物名称@正常】我不明白你的意思。之前丢的东西你不是已经帮我找回来了吗?
202703
:
...
...
@@ -570,11 +570,11 @@ person:
202704
:
-
【人物名称@正常】虽然我一直想寻回此物,但是你给的我可不敢收。
202705
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我没有让你找东西啊,你问错人了吧
。
#2028:打探肥羊完成
202801
:
-
【人物名称@正常】想不到你还挺能干。很好。
【旁白@正常】你与【1】的友好度
改变【2】点,威慑度改变
【3】点。
【旁白@正常】你与【1】的友好度
变为【2】点,威慑度变为
【3】点。
202802
:
-
【人物名称@正常】知道了,你不是说过了吗?
202803
:
...
...
@@ -582,12 +582,12 @@ person:
202804
:
-
【人物名称@正常】以我俩的交情,你这话的的真假,可说不准啊。
202805
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我没有让你去问啊,你搞错了吧
。
#2029:催账完成
202901
:
-
【人物名称@正常】你居然帮我把那个老赖的钱收回来了?这是一点点感谢,不成敬意。
【旁白@正常】你帮【1】收回了【2】的欠款,【3】对你满口感谢,并递给你【4】文钱作为谢礼。
【旁白@正常】你与【1】的友好度
改变【5】点,威慑度改变
【6】点。
【旁白@正常】你与【1】的友好度
变为【5】点,威慑度变为
【6】点。
202902
:
-
【人物名称@正常】你刚才不是已经给我了吗?
202903
:
...
...
@@ -595,7 +595,7 @@ person:
202904
:
-
【人物名称@正常】无事献殷勤,来历不明的钱我可不敢收。
202905
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
别人没欠我钱,你问错人啦
。
#2030:催账
203001
:
-
【人物名称@正常】我给,我给。别动手。
...
...
@@ -605,11 +605,11 @@ person:
203003
:
-
【人物名称@正常】你算老几,敢来找我要钱。
203004
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
别找我,我可没欠任何人钱
。
#2031:砸场子完成
203101
:
-
【人物名称@正常】哈哈哈,太好了。你果然没让我失望。这点钱你收下,就当是辛苦费。
【旁白@正常】你帮【1】大大出了一口气,你与【1】的友好度
改变【2】点,威慑度改变
【3】点。你获得【4】文作为辛苦费。
【旁白@正常】你帮【1】大大出了一口气,你与【1】的友好度
变为【2】点,威慑度变为
【3】点。你获得【4】文作为辛苦费。
203102
:
-
【人物名称@正常】知道了,不是给过你钱了吗?
203103
:
...
...
@@ -617,24 +617,24 @@ person:
203104
:
-
【人物名称@正常】你自己做下的事情,与我何干。我们很熟吗?
203105
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
没有这事,你看错人了吧
。
#2032:砸场子
203201
:
-
【人物名称@正常】你,你欺人太甚!快住手。
【旁白@正常】你无视【1】的阻拦,将眼前一切可以砸的都砸了个稀巴烂。
【旁白@正常】你与【1】的友好度
改变【2】点,威慑度改变
【3】点。
【旁白@正常】你与【1】的友好度
变为【2】点,威慑度变为
【3】点。
203202
:
-
【人物名称@正常】你,你还来做什么,这里还有什么可以砸的吗?
203203
:
-
【人物名称@正常】就凭你那三脚猫的功夫也敢来找死?
203204
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
别乱来,你找错人了
。
#2033:探听隐私完成
203301
:
-
【人物名称@正常】什,什么,竟有此事?
【旁白@正常】【1】大惊失色。
【人物名称@正常】此事关联甚大。这点钱财你先收下。此事隐秘,切记不要乱传。
【旁白@正常】你与【1】的友好度
改变【2】点,威慑度改变
【3】点。你获得【4】文酬劳。
【旁白@正常】你与【1】的友好度
变为【2】点,威慑度变为
【3】点。你获得【4】文酬劳。
203302
:
-
【人物名称@正常】你已经告知过我了,此事关联甚大,千万不要乱传。
203303
:
...
...
@@ -642,51 +642,51 @@ person:
203304
:
-
【人物名称@正常】只凭你我关系,还不足以让我信任于你。
203305
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我没有让你去问吧,你搞错了
。
#2034:探听隐私
203401
:
-
【人物名称@正常】莫名其妙。
【旁白@正常】【1】警惕地扫了你一眼,转身离去。你小心翼翼观察了下周围,远远跟在了【2】身后。
【旁白@正常】太阳渐渐落山,月亮爬上来了。
【旁白@正常】你悄悄爬上屋顶,掀开一片瓦片,烛光下,【1】对着镜子,正轻轻把自己的脸皮撕了下来。那居然是一张人皮面具!面具下,是一张陌生的人脸!震惊之下,你赶紧溜下了屋檐。
【旁白@正常】你成功打探到了【1】的隐私!你与【1】的友好度
改变【3】点,威慑度改变
【4】点。
【旁白@正常】你成功打探到了【1】的隐私!你与【1】的友好度
变为【3】点,威慑度变为
【4】点。
203402
:
-
【人物名称@正常】你已经知道他的隐私了。
203403
:
-
【人物名称@正常】就凭你那三脚猫的功夫也敢来找死?
203404
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我没什么可说,你找其他人吧
。
#2035:试药
203501
:
-
【人物名称@正常】太好了。我正在找敢试药的人呢。你且来试试。先说好,出问题了可不关我事。
【旁白@正常】你一脸视死如归地接过了那鸽蛋大的药丸,张口就吞了下去。
【旁白@正常】你满面红光,感到浑身充满了力量。
【人物名称@正常】成,成功了??太好了。这是你的报酬。拿了钱,以后有什么头疼胸闷啥的可不许赖我。
【旁白@正常】你勇敢地帮【1】试药成功,你与【1】的友好度
改变【2】点,威慑度改变
【3】点。你获得【4】文酬劳。
【旁白@正常】你勇敢地帮【1】试药成功,你与【1】的友好度
变为【2】点,威慑度变为
【3】点。你获得【4】文酬劳。
203502
:
-
【人物名称@正常】太好了。我正在找敢试药的人呢。你且来试试。先说好,出问题了可不关我事。
【旁白@正常】你一脸视死如归地接过了那鸽蛋大的药丸,张口就吞了下去。
【旁白@正常】你眼前一黑,一头栽倒在地。
【旁白@正常】过了很久,你才悠悠醒过来,感到浑身像散架了一样。
【人物名称@正常】这,这可是你自愿的。不关我事,这点钱拿着,就算我给你的补偿。
【旁白@正常】很遗憾,你帮【1】试药失败,你与【1】的友好度
改变【2】点,威慑度改变
【3】点。你获得【4】文补偿。
【旁白@正常】很遗憾,你帮【1】试药失败,你与【1】的友好度
变为【2】点,威慑度变为
【3】点。你获得【4】文补偿。
203503
:
-
【人物名称@正常】你,你还来做什么,我没有药可以试了,快走快走。
203504
:
-
【人物名称@正常】我们很熟吗?
203505
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
我药都没有,来我这试什么药
。
#2036:证据账本完成
203601
:
-
【人物名称@正常】快让我看看。
【旁白@正常】【1】接过账本,翻看几下,大笑起来。
【人物名称@正常】好,好,好,【2】你这次在劫难逃!壮士果然身手不凡。小小心意,还请收下。
【旁白@正常】你与【1】的友好度
改变【3】点,威慑度改变
【4】点。你获得【5】文酬劳。
【旁白@正常】你与【1】的友好度
变为【3】点,威慑度变为
【4】点。你获得【5】文酬劳。
203602
:
-
【人物名称@正常】快让我看看。
【旁白@正常】【1】接过账本,翻看几下,脸色难看起来。
【人物名称@正常】此物是假的。看来【2】早有准备。再去也无益。罢了。无论如何,多谢壮士相助,壮士身手不凡,这点心意还请收下。
【旁白@正常】你与【1】的友好度
改变【3】点,威慑度改变
【4】点。你获得【5】文酬劳。
【旁白@正常】你与【1】的友好度
变为【3】点,威慑度变为
【4】点。你获得【5】文酬劳。
203603
:
-
【人物名称@正常】你不是已经给过我了吗?此事关联甚大,千万不要乱传。
203604
:
...
...
@@ -694,22 +694,22 @@ person:
203605
:
-
【人物名称@正常】只凭你我关系,还不足以让我认定此物真假。
203606
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
你搞错了吧,我没让你去查这个啊
。
#2037:证据账本
203701
:
-
【人物名称@正常】你说什么?
【旁白@正常】你趁【1】不注意,一掌打晕了【2】。然后翻箱倒柜。
【旁白@正常】你成功偷取到了【2】的账本!你与【2】的友好度
改变【3】点,威慑度改变
【4】点。
【旁白@正常】你成功偷取到了【2】的账本!你与【2】的友好度
变为【3】点,威慑度变为
【4】点。
203702
:
-
【人物名称@正常】你说什么?
【旁白@正常】你假装离去,趁夜摸进了【1】的密室,翻箱倒柜。
【旁白@正常】你成功偷取到了【1】的账本!你与【1】的友好度
改变【2】点,威慑度改变
【3】点。
【旁白@正常】你成功偷取到了【1】的账本!你与【1】的友好度
变为【2】点,威慑度变为
【3】点。
203703
:
-
【人物名称@正常】你已经知道他的隐私了。
203704
:
-
【人物名称@正常】就凭你那三脚猫的功夫也敢来找死?
203705
:
-
【人物名称@正常】不好意思,我
很忙
。
-
【人物名称@正常】不好意思,我
这没有这东西
。
#2038:证据账本类型2完成
203801
:
-
【人物名称@正常】快让我看看。
...
...
@@ -717,7 +717,7 @@ person:
【人物名称@正常】好,好,好,你可以滚了。
【旁白@正常】【1】将账本藏在身后,突然间变了脸色。
【人物名称@正常】账本?什么账本。我没见到!再说话我连你一起告!
【旁白@正常】【1】不由分说将你轰出了大门。你与【1】的友好度
改变【2】点,威慑度改变
【3】点。
【旁白@正常】【1】不由分说将你轰出了大门。你与【1】的友好度
变为【2】点,威慑度变为
【3】点。
203802
:
-
【人物名称@正常】无凭无据,说话小心点,再纠结此事,小心我连你一起送官。
203803
:
...
...
@@ -725,13 +725,13 @@ person:
203804
:
-
【人物名称@正常】凭你我关系,如何才能让我相信这是真的呢?
203805
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
你搞错了,我可没让你帮我找这个
。
#2039:栽赃陷害完成
203901
:
-
【人物名称@正常】此事当真?好,好,好!
【旁白@正常】【1】不住点头。
【人物名称@正常】我这就去报官!【2】这次不死也得给我扒一层皮!这是你的报酬,记得把嘴给我闭紧点!
【旁白@正常】你帮【1】完成了给【1】栽赃的任务,你与【1】的友好度
改变【3】点,威慑度改变
【4】点。
【旁白@正常】你帮【1】完成了给【1】栽赃的任务,你与【1】的友好度
变为【3】点,威慑度变为
【4】点。
203902
:
-
【人物名称@正常】你在胡说什么!不是叫你把嘴闭紧点吗?
203903
:
...
...
@@ -739,7 +739,7 @@ person:
203904
:
-
【人物名称@正常】凭你我关系,如何才能让我相信这是真的呢?
203905
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
什么事?都不知道你在说什么,你找其他人吧
。
#2040:栽赃陷害类型2完成
204001
:
-
【人物名称@正常】此事当真?好,好,好!
...
...
@@ -748,7 +748,7 @@ person:
【旁白@正常】【1】突然露出一副奸计得逞的表情,上前一把扭住了你。
【人物名称@正常】你来历不明,还偷偷给【2】送钱,狼狈为奸,肯定是一伙的。走,跟我见官去!!
【旁白@正常】你被【1】送到了官府。公堂上,你百口莫辩,被迫交出了【3】文钱才勉强脱身。
【旁白@正常】你被【1】这个卑鄙小人算计了!你与【1】的友好度
改变【4】点,威慑度改变
【5】点。
【旁白@正常】你被【1】这个卑鄙小人算计了!你与【1】的友好度
变为【4】点,威慑度变为
【5】点。
204002
:
-
【人物名称@正常】你在胡说什么!怎么,还想再上一次公堂?
204003
:
...
...
@@ -756,11 +756,11 @@ person:
204004
:
-
【人物名称@正常】凭你我关系,如何才能让我相信这是真的呢?
204005
:
-
【人物名称@正常】
不好意思,我很忙
。
-
【人物名称@正常】
什么事?都不知道你在说什么,你找其他人吧
。
#2041:栽赃陷害类型2完成
204101
:
-
【人物名称@正常】我已知晓此事,辛苦你了。
【旁白@正常】你与【1】的友好度
改变【2】点,威慑度改变
【3】点。你获得了【4】文辛苦费。
【旁白@正常】你与【1】的友好度
变为【2】点,威慑度变为
【3】点。你获得了【4】文辛苦费。
204102
:
-
【人物名称@正常】此事你已经跟我说过了。
204103
:
...
...
@@ -769,4 +769,16 @@ person:
-
【人物名称@正常】凭你我关系,我可不敢相信。
204105
:
-
【人物名称@正常】不好意思,我很忙。
#2101:买东西
210101
:
-
【人物名称@正常】既然出得起价钱,就卖给你了。
【旁白@正常】你从【1】手上买下了。
210102
:
-
【人物名称@正常】你不是已经买过了吗。
210103
:
-
【人物名称@正常】【1】文,不能再少了。你身上的钱可不够。
210104
:
-
【人物名称@正常】抱歉,不卖给信不过的人。
210105
:
-
【人物名称@正常】不好意思,我这不卖东西。
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment