Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
windbot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
windbot
Commits
648eef1e
Commit
648eef1e
authored
Jun 30, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add deck error dialog
parent
b5cabb3d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
60 additions
and
0 deletions
+60
-0
Dialogs/cirno.zh-CN.json
Dialogs/cirno.zh-CN.json
+3
-0
Dialogs/copy.zh-CN.json
Dialogs/copy.zh-CN.json
+3
-0
Dialogs/default.json
Dialogs/default.json
+3
-0
Dialogs/near.zh-CN.json
Dialogs/near.zh-CN.json
+3
-0
Dialogs/soul.zh-CN.json
Dialogs/soul.zh-CN.json
+3
-0
Dialogs/swordsman.zh-CN.json
Dialogs/swordsman.zh-CN.json
+3
-0
Dialogs/zh-CN.json
Dialogs/zh-CN.json
+3
-0
Game/AI/Dialogs.cs
Game/AI/Dialogs.cs
+12
-0
Game/GameAI.cs
Game/GameAI.cs
+5
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+22
-0
No files found.
Dialogs/cirno.zh-CN.json
View file @
648eef1e
...
...
@@ -4,6 +4,9 @@
"AI功能正在测试中,遇到问题请及时反馈。"
,
"饼蛙是什么,好吃吗?"
],
"deckerror"
:
[
"为什么我的{0}不能用了?"
],
"duelstart"
:
[
"让我把你冻结!"
,
"不就是打倒人类嘛,我一个人足够了!"
...
...
Dialogs/copy.zh-CN.json
View file @
648eef1e
...
...
@@ -3,6 +3,9 @@
"AI功能正在测试中,遇到问题请及时反馈。"
,
"密码输入 AI#复制植物 就可以和我打牌了~"
],
"deckerror"
:
[
"我的超主流卡组需要{0}才能玩。"
],
"duelstart"
:
[
"十二兽卡组测试中,渣操是正常情况。"
,
"超主流是游戏王的一环,不爽不要玩。"
,
...
...
Dialogs/default.json
View file @
648eef1e
...
...
@@ -2,6 +2,9 @@
"welcome"
:
[
"Hi, I'm Windbot."
],
"deckerror"
:
[
"Sorry, it seems that I have too much {0} in my deck."
],
"duelstart"
:
[
"Good luck, have fun."
],
...
...
Dialogs/near.zh-CN.json
View file @
648eef1e
...
...
@@ -4,6 +4,9 @@
"终有一天,我的力量将会强过本体的!你们走着瞧吧!"
,
"AI功能正在测试中,遇到问题请及时反馈。"
],
"deckerror"
:
[
"什么,居然不让我使用我无敌的{0}!"
],
"duelstart"
:
[
"没有人可以战胜我!"
,
"万能的我,什么卡组都会使用!"
,
...
...
Dialogs/soul.zh-CN.json
View file @
648eef1e
...
...
@@ -3,6 +3,9 @@
"你好,我是一个机器人。"
,
"AI功能正在测试中,遇到问题请及时反馈。"
],
"deckerror"
:
[
"抱歉,我的卡组里的{0}的数量似乎出了问题。"
],
"duelstart"
:
[
"这套卡组好旧啊……"
,
"使用过这套卡组的孩子身上发生了什么呢……"
...
...
Dialogs/swordsman.zh-CN.json
View file @
648eef1e
...
...
@@ -4,6 +4,9 @@
"AI功能正在测试中,遇到问题请及时反馈。"
,
"新的风暴已经出现,怎么能够停滞不前!我的R5卡组也得到了加强!"
],
"deckerror"
:
[
"抱歉,我的卡组里的{0}的数量似乎出了问题。"
],
"duelstart"
:
[
"好戏才正要开始呢!"
,
"用决斗带来笑容吧!"
...
...
Dialogs/zh-CN.json
View file @
648eef1e
...
...
@@ -3,6 +3,9 @@
"你好,我是一个机器人。"
,
"AI功能正在测试中,遇到问题请及时反馈。"
],
"deckerror"
:
[
"抱歉,我的卡组里的{0}的数量似乎出了问题。"
],
"duelstart"
:
[
"好戏才正要开始呢!"
,
"用决斗带来笑容吧!"
...
...
Game/AI/Dialogs.cs
View file @
648eef1e
...
...
@@ -12,6 +12,8 @@ namespace WindBot.Game.AI
[
DataMember
]
public
string
[]
welcome
{
get
;
set
;
}
[
DataMember
]
public
string
[]
deckerror
{
get
;
set
;
}
[
DataMember
]
public
string
[]
duelstart
{
get
;
set
;
}
[
DataMember
]
public
string
[]
newturn
{
get
;
set
;
}
...
...
@@ -39,6 +41,7 @@ namespace WindBot.Game.AI
private
GameClient
_game
;
private
string
[]
_welcome
;
private
string
[]
_deckerror
;
private
string
[]
_duelstart
;
private
string
[]
_newturn
;
private
string
[]
_endturn
;
...
...
@@ -60,6 +63,7 @@ namespace WindBot.Game.AI
{
DialogsData
data
=
(
DialogsData
)
serializer
.
ReadObject
(
fs
);
_welcome
=
data
.
welcome
;
_deckerror
=
data
.
deckerror
;
_duelstart
=
data
.
duelstart
;
_newturn
=
data
.
newturn
;
_endturn
=
data
.
endturn
;
...
...
@@ -79,6 +83,14 @@ namespace WindBot.Game.AI
InternalSendMessage
(
new
[]
{
"Sorry, an error occurs."
});
}
public
void
SendDeckSorry
(
string
card
)
{
if
(
card
==
"DECK"
)
InternalSendMessage
(
new
[]
{
"Deck illegal. Please check the database of your YGOPro and WindBot."
});
else
InternalSendMessage
(
_deckerror
,
card
);
}
public
void
SendWelcome
()
{
InternalSendMessage
(
_welcome
);
...
...
Game/GameAI.cs
View file @
648eef1e
...
...
@@ -30,6 +30,11 @@ namespace WindBot.Game
_dialogs
.
SendSorry
();
}
public
void
OnDeckError
(
string
card
)
{
_dialogs
.
SendDeckSorry
(
card
);
}
/// <summary>
/// Called when the AI join the game.
/// </summary>
...
...
Game/GameBehavior.cs
View file @
648eef1e
...
...
@@ -74,6 +74,7 @@ namespace WindBot.Game
_packets
.
Add
(
StocMessage
.
DuelEnd
,
OnDuelEnd
);
_packets
.
Add
(
StocMessage
.
Chat
,
OnChat
);
_packets
.
Add
(
StocMessage
.
ChangeSide
,
OnJoinGame
);
_packets
.
Add
(
StocMessage
.
ErrorMsg
,
OnErrorMsg
);
_messages
.
Add
(
GameMessage
.
Retry
,
OnRetry
);
_messages
.
Add
(
GameMessage
.
Start
,
OnStart
);
...
...
@@ -239,6 +240,27 @@ namespace WindBot.Game
Logger
.
WriteLine
(
otherName
+
" say to "
+
myName
+
": "
+
message
);
}
private
void
OnErrorMsg
(
BinaryReader
packet
)
{
int
msg
=
packet
.
ReadByte
();
// align
packet
.
ReadByte
();
packet
.
ReadByte
();
packet
.
ReadByte
();
int
code
=
packet
.
ReadInt32
();
if
(
msg
==
2
)
//ERRMSG_DECKERROR
{
NamedCard
card
=
NamedCard
.
Get
(
code
);
if
(
card
!=
null
)
_ai
.
OnDeckError
(
card
.
Name
);
else
if
(
code
==
1
)
_ai
.
OnDeckError
(
"DECK"
);
else
_ai
.
OnDeckError
(
"Unknown Card"
);
}
Connection
.
Close
();
}
private
void
OnRetry
(
BinaryReader
packet
)
{
_ai
.
OnRetry
();
...
...
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