Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qwgame
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
赵国君
qwgame
Commits
4f3041ac
Commit
4f3041ac
authored
Apr 09, 2019
by
zhaoguojun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持QA停留
parent
84a2ab40
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
3 deletions
+59
-3
PlotConstructor2.java
.../com/qiwu/chatbotbackend/gameDesign/PlotConstructor2.java
+58
-2
FormsPoster.java
.../java/com/qiwu/chatbotbackend/processing/FormsPoster.java
+1
-1
No files found.
src/main/java/com/qiwu/chatbotbackend/gameDesign/PlotConstructor2.java
View file @
4f3041ac
...
@@ -214,6 +214,7 @@ public class PlotConstructor2 extends ElementConstructor {
...
@@ -214,6 +214,7 @@ public class PlotConstructor2 extends ElementConstructor {
Boolean
curAutoJump
,
nextAutoJump
=
false
,
prevAutoJump
,
moveWithPlot
=
false
;
Boolean
curAutoJump
,
nextAutoJump
=
false
,
prevAutoJump
,
moveWithPlot
=
false
;
StringBuffer
skipText
=
new
StringBuffer
(),
extraUK
=
new
StringBuffer
(),
extraHP
=
new
StringBuffer
(),
extraFT
=
new
StringBuffer
(),
arriveUK
=
new
StringBuffer
();
StringBuffer
skipText
=
new
StringBuffer
(),
extraUK
=
new
StringBuffer
(),
extraHP
=
new
StringBuffer
(),
extraFT
=
new
StringBuffer
(),
arriveUK
=
new
StringBuffer
();
JSONArray
branch
=
null
;
JSONArray
branch
=
null
;
Boolean
preferQA
=
false
;
int
branchSize
;
int
branchSize
;
...
@@ -278,6 +279,8 @@ public class PlotConstructor2 extends ElementConstructor {
...
@@ -278,6 +279,8 @@ public class PlotConstructor2 extends ElementConstructor {
curAutoJump
=
node
.
getBoolean
(
"autoJump"
);
curAutoJump
=
node
.
getBoolean
(
"autoJump"
);
prevAutoJump
=
node
.
getBoolean
(
"prevAutoJump"
);
prevAutoJump
=
node
.
getBoolean
(
"prevAutoJump"
);
curUnknownText
=
(
String
)
node
.
get
(
"unknownText"
);
curUnknownText
=
(
String
)
node
.
get
(
"unknownText"
);
//preferQA = node.getBoolean("remain");
//剧情状态的名字,任务线xxx的进度
//剧情状态的名字,任务线xxx的进度
taskLineName
=
String
.
format
(
TASK_LINE
,
location
);
taskLineName
=
String
.
format
(
TASK_LINE
,
location
);
...
@@ -305,6 +308,7 @@ public class PlotConstructor2 extends ElementConstructor {
...
@@ -305,6 +308,7 @@ public class PlotConstructor2 extends ElementConstructor {
nextId
=
branchNode
.
getString
(
"nextPlotId"
);
nextId
=
branchNode
.
getString
(
"nextPlotId"
);
preferQA
=
branchNode
.
getBoolean
(
"remain"
);
//是否将玩家移动到下个剧情所在地点
//是否将玩家移动到下个剧情所在地点
moveWithPlot
=
branchNode
.
getBoolean
(
"moveWithPlot"
);
moveWithPlot
=
branchNode
.
getBoolean
(
"moveWithPlot"
);
...
@@ -543,13 +547,23 @@ public class PlotConstructor2 extends ElementConstructor {
...
@@ -543,13 +547,23 @@ public class PlotConstructor2 extends ElementConstructor {
//当剧情没有条件限制时的操作(条件剧情) 需要顺便激活qa、地图、物品的查询配置文件, 额外要求当前剧情不是自动跳转(当前剧情不是合并剧情)
//当剧情没有条件限制时的操作(条件剧情) 需要顺便激活qa、地图、物品的查询配置文件, 额外要求当前剧情不是自动跳转(当前剧情不是合并剧情)
if
(
curPremiseList
.
size
()
==
0
&&
historyPremiseList
.
size
()
==
0
&&
!
curAutoJump
){
if
(
curPremiseList
.
size
()
==
0
&&
historyPremiseList
.
size
()
==
0
&&
!
curAutoJump
){
if
(
preferQA
!=
null
&&
preferQA
)
{
ConfigTermText
termText1
,
termText2
,
tmpTermText
;
tmpTermText
=
configTermText
;
termText1
=
createTermExtra1
(
configTermText
);
termText2
=
createTermExtra2
(
configTermText
);
configTermText
=
alterTerm
(
configTermText
);
configTermTextList
.
add
(
termText1
);
configTermTextList
.
add
(
termText2
);
}
else
{
Boolean
activateFlag
=
false
;
Boolean
activateFlag
=
false
;
//有activate意味着下一步剧情是合并剧情
//有activate意味着下一步剧情是合并剧情
if
(
extraFT
.
indexOf
(
"activate"
)
!=
-
1
)
if
(
extraFT
.
indexOf
(
"activate"
)
!=
-
1
)
activateFlag
=
true
;
activateFlag
=
true
;
unconditionalPlotProcess
(
configTermText
,
nextCondition
,
activateFlag
);
unconditionalPlotProcess
(
configTermText
,
nextCondition
,
activateFlag
);
}
}
}
if
(
branchNode
.
getBoolean
(
"higherPriority"
)
!=
null
&&
branchNode
.
getBoolean
(
"higherPriority"
))
if
(
branchNode
.
getBoolean
(
"higherPriority"
)
!=
null
&&
branchNode
.
getBoolean
(
"higherPriority"
))
configTermText
.
setAuxiliaryPriority
(
"3"
);
configTermText
.
setAuxiliaryPriority
(
"3"
);
...
@@ -959,6 +973,48 @@ public class PlotConstructor2 extends ElementConstructor {
...
@@ -959,6 +973,48 @@ public class PlotConstructor2 extends ElementConstructor {
// }
// }
/**
* @param term 原始的配置数据
* @return 生成的用于QA的配置
*/
private
ConfigTermText
alterTerm
(
ConfigTermText
term
)
{
ConfigTermText
newTerm
=
(
ConfigTermText
)
term
.
clone
();
newTerm
.
setUpdateKnowledge
(
""
);
String
stemStr
=
newTerm
.
getConfigName
();
String
feature
=
newTerm
.
getFeature
();
feature
=
feature
+
",activate,post::gameQA("
+
QA_URL
+
")"
;
newTerm
.
setFeature
(
feature
);
newTerm
.
setNextStep
(
stemStr
+
"_qa1,"
+
stemStr
+
"_qa2"
);
return
newTerm
;
}
private
ConfigTermText
createTermExtra1
(
ConfigTermText
term
)
{
String
hPremise
=
"qa_score::number-Bigger=90"
;
String
featureStr
=
"match,activate,return-0"
;
String
nextStr
=
"map*,item*,npc*"
;
String
knowledgeStr
=
UNKNOWN_COUNTER_NAME
+
":+1"
;
String
configName
=
term
.
getConfigName
()+
"_qa1"
;
ConfigTermText
newTerm
=
new
ConfigTermText
(
" "
,
hPremise
,
featureStr
,
""
,
nextStr
,
knowledgeStr
);
newTerm
.
setConfigName
(
configName
,
false
);
newTerm
.
setStatus
(
"sleeping"
);
return
newTerm
;
}
private
ConfigTermText
createTermExtra2
(
ConfigTermText
term
)
{
String
hPremise
=
"qa_score::number-Smaller=90"
;
String
featureStr
=
"match,activate"
;
String
nextStr
=
"map*,item*,npc*"
;
String
configName
=
term
.
getConfigName
()+
"_qa2"
;
if
(
term
.
getFeature
().
indexOf
(
"activate"
)
!=
-
1
)
{
nextStr
=
term
.
getNextStep
()
+
","
+
nextStr
;
}
ConfigTermText
newTerm
=
(
ConfigTermText
)
term
.
clone
();
newTerm
.
setHisPremise
(
hPremise
);
newTerm
.
setConfigName
(
configName
,
false
);
newTerm
.
setFeature
(
featureStr
);
newTerm
.
setNextStep
(
nextStr
);
newTerm
.
setStatus
(
"sleeping"
);
return
newTerm
;
}
}
}
src/main/java/com/qiwu/chatbotbackend/processing/FormsPoster.java
View file @
4f3041ac
...
@@ -230,7 +230,7 @@ public class FormsPoster {
...
@@ -230,7 +230,7 @@ public class FormsPoster {
Pattern
findTalker
=
Pattern
.
compile
(
TALKER
);
Pattern
findTalker
=
Pattern
.
compile
(
TALKER
);
if
((
Integer
)
textscore
.
get
(
1
)
>
9
0
)
{
if
((
Integer
)
textscore
.
get
(
1
)
>
9
8
)
{
Matcher
m
=
findTalker
.
matcher
((
String
)
textscore
.
get
(
0
));
Matcher
m
=
findTalker
.
matcher
((
String
)
textscore
.
get
(
0
));
if
(
m
.
find
())
{
if
(
m
.
find
())
{
npc
=
m
.
group
(
1
);
npc
=
m
.
group
(
1
);
...
...
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