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
List
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
Tang Xinwei
windbot
Commits
6fca44af
Commit
6fca44af
authored
Jun 22, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update dialogues
parent
43590bd6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
133 additions
and
66 deletions
+133
-66
Dialogs/cirno.zh-CN.json
Dialogs/cirno.zh-CN.json
+33
-38
Dialogs/default.json
Dialogs/default.json
+8
-0
Dialogs/zh-CN.json
Dialogs/zh-CN.json
+37
-28
Game/AI/Dialogs.cs
Game/AI/Dialogs.cs
+18
-0
Game/GameAI.cs
Game/GameAI.cs
+16
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+21
-0
No files found.
Dialogs/cirno.zh-CN.json
View file @
6fca44af
{
"welcome"
:
[
"本小姐是最强的!"
,
"AI功能正在测试中,遇到问题请及时反馈。"
,
"人家终于想起来怎么用坑了~"
],
"duelstart"
:
[
"
本小姐是最强的
!"
"
让我把你冻结
!"
],
"newturn"
:
[
"雅达,该我抽卡了"
,
"我的回合,抽卡"
,
"么么哒,神抽了"
"我不会算数,解不了构向胜利的方程式……"
,
"我的回合,抽卡!"
],
"endturn"
:
[
"就这样被你征服,喝下你藏好的毒,我的回合已结束,我的坑等着你入"
,
"哎,俺的,买,忒嗯"
,
"轮到你了,快点出牌,人家等的好急"
"饶你一命!"
],
"directattack"
:
[
"{0},直接攻击!"
,
"{0},直接攻击对手!"
,
"{0},没有防守的地方,攻击!"
,
"{0},攻击对手的生命值!"
,
"{0},直接攻击对手的生命值!"
,
"{0},通过直接攻击打倒对手!"
,
"{0},使用直接攻击打倒对手!"
,
"{0},直接攻击释放你的力量吧!"
,
"我的 {0} 将会粉碎你的生命值!"
,
"向对手展示你的力量吧,{0}!"
,
"你已经无法阻止我了。{0},攻击!"
"弱小就要挨打!"
,
"懒得算数了,打了再说!"
,
"超⑨武神霸斩!"
],
"attack"
:
[
"{0},攻击这只 {1}!"
,
"{0},消灭这只 {1}!"
,
"{0},打倒 {1}!"
,
"{0},冲向那只 {1}!"
,
"{0},把你的力量释放到 {1} 上吧!"
"{0},攻击这只{1}!"
,
"{0},消灭这只{1}!"
,
"{0},打倒{1}!"
,
"{0},冲向那只{1}!"
],
"ondirectattack"
:
[
"别开玩笑了~。你这种人,就让我把你和英吉利牛肉一起冷冻保存好了!!"
,
"一只小小的{0},有什么可怕!"
,
"笨蛋是不会感冒的!"
],
"facedownmonstername"
:
"怪兽"
,
"activate"
:
[
"我发动
{0}
"
,
"我使用
{0} 的效果
"
,
"我使用
{0} 的力量
"
"我发动
{0}。
"
,
"我使用
{0}的效果。
"
,
"我使用
{0}的力量。
"
],
"summon"
:
[
"我召唤
{0}
"
,
"我召唤
{0}。
"
,
"出来吧,{0}!"
,
"出现吧,{0}!"
,
"我召唤了强大的 {0}"
,
"我呼唤 {0} 参加战斗!"
,
"我呼唤出 {0}"
,
"让我召唤 {0}"
"我呼唤出{0}。"
],
"setmonster"
:
[
"我放置了一只怪兽"
,
"不给你看,哼"
,
"我放置了一只迷之怪兽"
"我放置了一只怪兽
。
"
,
"不给你看,哼
~
"
,
"我放置了一只迷之怪兽
~
"
],
"chaining"
:
[
"看这里!我发动 {0}"
,
"我使用 {0} 的力量"
,
"准备!我使用 {0}"
,
"看这里!我发动{0}!"
,
"我使用{0}的力量。"
,
"畏惧我的{0}吧!"
,
"看样子你忘了我的
{0}
"
,
"你考虑过我有
{0} 吗?
"
"看样子你忘了我的
{0}!
"
,
"你考虑过我有
{0}吗?
"
]
}
Dialogs/default.json
View file @
6fca44af
{
"welcome"
:
[
"Hi, I'm Windbot."
],
"duelstart"
:
[
"Good luck, have fun."
],
...
...
@@ -32,6 +35,11 @@
"{0}, strike that {1}!"
,
"{0}, unleash your power on this {1}!"
],
"ondirectattack"
:
[
"Ahhhhh..."
,
"Just {0} ..."
,
"Think you can defeat me?"
],
"activate"
:
[
"I'm activating {0}."
,
"I'm using the effect of {0}."
,
...
...
Dialogs/zh-CN.json
View file @
6fca44af
{
"welcome"
:
[
"你好,我是一个机器人。"
,
"AI功能正在测试中,遇到问题请及时反馈。"
,
"不要再幻想我会进化成LV6了。不过听说过几天会出现比我强的家伙。"
],
"duelstart"
:
[
"好戏才正要开始呢!"
,
"用决斗带来笑容吧!"
],
"newturn"
:
[
"到我的回合了,抽卡"
,
"我的回合,抽卡"
,
"我抽了一张卡"
"到我的回合了,抽卡
!
"
,
"我的回合,抽卡
!
"
,
"我抽了一张卡
。
"
],
"endturn"
:
[
"回合结束"
,
"我的回合结束了"
,
"轮到你了"
"回合结束
。
"
,
"我的回合结束了
。
"
,
"轮到你了
。
"
],
"directattack"
:
[
"{0},直接攻击!"
,
...
...
@@ -22,43 +27,47 @@
"{0},通过直接攻击打倒对手!"
,
"{0},使用直接攻击打倒对手!"
,
"{0},直接攻击释放你的力量吧!"
,
"我的
{0}
将会粉碎你的生命值!"
,
"我的
{0}
将会粉碎你的生命值!"
,
"向对手展示你的力量吧,{0}!"
,
"你已经无法阻止我了。{0},攻击!"
],
"attack"
:
[
"{0},攻击这只 {1}!"
,
"{0},消灭这只 {1}!"
,
"{0},打倒 {1}!"
,
"{0},冲向那只 {1}!"
,
"{0},把你的力量释放到 {1} 上吧!"
"{0},攻击这只{1}!"
,
"{0},消灭这只{1}!"
,
"{0},打倒{1}!"
,
"{0},冲向那只{1}!"
,
"{0},把你的力量释放到{1}上吧!"
],
"ondirectattack"
:
[
"可恶……"
,
"不过是{0}而已!"
,
"你以为这样就能打倒我吗?"
],
"facedownmonstername"
:
"怪兽"
,
"activate"
:
[
"我发动
{0}
"
,
"我使用
{0} 的效果
"
,
"我使用
{0} 的力量
"
"我发动
{0}。
"
,
"我使用
{0}的效果。
"
,
"我使用
{0}的力量。
"
],
"summon"
:
[
"我召唤
{0}
"
,
"我召唤
{0}。
"
,
"出来吧,{0}!"
,
"出现吧,{0}!"
,
"我召唤了强大的
{0}
"
,
"我呼唤
{0}
参加战斗!"
,
"我呼唤出
{0}
"
,
"让我召唤
{0}
"
"我召唤了强大的
{0}!
"
,
"我呼唤
{0}
参加战斗!"
,
"我呼唤出
{0}。
"
,
"让我召唤
{0}。
"
],
"setmonster"
:
[
"我放置了一只怪兽"
,
"我里侧表示放置了一只怪兽"
,
"我放置了一只迷之怪兽"
"我放置了一只怪兽。"
,
"我里侧表示放置了一只怪兽。"
],
"chaining"
:
[
"看这里!我发动
{0}
"
,
"我使用
{0} 的力量
"
,
"准备!我使用
{0}
"
,
"看这里!我发动
{0}!
"
,
"我使用
{0}的力量。
"
,
"准备!我使用
{0}!
"
,
"我不认同。{0},发动!"
,
"看样子你忘了我的
{0}
"
,
"你考虑过我有
{0} 吗?
"
"看样子你忘了我的
{0}!
"
,
"你考虑过我有
{0}吗?
"
]
}
Game/AI/Dialogs.cs
View file @
6fca44af
...
...
@@ -9,6 +9,8 @@ namespace WindBot.Game.AI
[
DataContract
]
public
class
DialogsData
{
[
DataMember
]
public
string
[]
welcome
{
get
;
set
;
}
[
DataMember
]
public
string
[]
duelstart
{
get
;
set
;
}
[
DataMember
]
...
...
@@ -20,6 +22,8 @@ namespace WindBot.Game.AI
[
DataMember
]
public
string
[]
attack
{
get
;
set
;
}
[
DataMember
]
public
string
[]
ondirectattack
{
get
;
set
;
}
[
DataMember
]
public
string
facedownmonstername
{
get
;
set
;
}
[
DataMember
]
public
string
[]
activate
{
get
;
set
;
}
...
...
@@ -34,11 +38,13 @@ namespace WindBot.Game.AI
{
private
GameClient
_game
;
private
string
[]
_welcome
;
private
string
[]
_duelstart
;
private
string
[]
_newturn
;
private
string
[]
_endturn
;
private
string
[]
_directattack
;
private
string
[]
_attack
;
private
string
[]
_ondirectattack
;
private
string
_facedownmonstername
;
private
string
[]
_activate
;
private
string
[]
_summon
;
...
...
@@ -52,11 +58,13 @@ namespace WindBot.Game.AI
using
(
FileStream
fs
=
File
.
OpenRead
(
"Dialogs/"
+
Environment
.
GetEnvironmentVariable
(
"YGOPRO_DIALOG"
)
+
".json"
))
{
DialogsData
data
=
(
DialogsData
)
serializer
.
ReadObject
(
fs
);
_welcome
=
data
.
welcome
;
_duelstart
=
data
.
duelstart
;
_newturn
=
data
.
newturn
;
_endturn
=
data
.
endturn
;
_directattack
=
data
.
directattack
;
_attack
=
data
.
attack
;
_ondirectattack
=
data
.
ondirectattack
;
_facedownmonstername
=
data
.
facedownmonstername
;
_activate
=
data
.
activate
;
_summon
=
data
.
summon
;
...
...
@@ -65,6 +73,11 @@ namespace WindBot.Game.AI
}
}
public
void
SendWelcome
()
{
InternalSendMessage
(
_welcome
);
}
public
void
SendDuelStart
()
{
InternalSendMessage
(
_duelstart
);
...
...
@@ -94,6 +107,11 @@ namespace WindBot.Game.AI
InternalSendMessage
(
_attack
,
attacker
,
defender
);
}
public
void
SendOnDirectAttack
(
string
attacker
)
{
InternalSendMessage
(
_ondirectattack
,
attacker
);
}
public
void
SendActivate
(
string
spell
)
{
InternalSendMessage
(
_activate
,
spell
);
...
...
Game/GameAI.cs
View file @
6fca44af
...
...
@@ -22,6 +22,14 @@ namespace WindBot.Game
_dialogs
=
new
Dialogs
(
game
);
}
/// <summary>
/// Called when the AI join the game.
/// </summary>
public
void
OnJoinGame
()
{
_dialogs
.
SendWelcome
();
}
/// <summary>
/// Called when the duel starts.
/// </summary>
...
...
@@ -59,6 +67,14 @@ namespace WindBot.Game
_dialogs
.
SendNewTurn
();
}
/// <summary>
/// Called when the AI got attack directly.
/// </summary>
public
void
OnDirectAttack
(
ClientCard
card
)
{
_dialogs
.
SendOnDirectAttack
(
card
.
Name
);
}
/// <summary>
/// Called when a chain is executed.
/// </summary>
...
...
Game/GameBehavior.cs
View file @
6fca44af
...
...
@@ -86,6 +86,7 @@ namespace WindBot.Game
_messages
.
Add
(
GameMessage
.
Recover
,
OnRecover
);
_messages
.
Add
(
GameMessage
.
LpUpdate
,
OnLpUpdate
);
_messages
.
Add
(
GameMessage
.
Move
,
OnMove
);
_messages
.
Add
(
GameMessage
.
Attack
,
OnAttack
);
_messages
.
Add
(
GameMessage
.
PosChange
,
OnPosChange
);
_messages
.
Add
(
GameMessage
.
Chaining
,
OnChaining
);
_messages
.
Add
(
GameMessage
.
ChainEnd
,
OnChainEnd
);
...
...
@@ -124,6 +125,7 @@ namespace WindBot.Game
foreach
(
NamedCard
card
in
Deck
.
SideCards
)
deck
.
Write
(
card
.
Id
);
Connection
.
Send
(
deck
);
_ai
.
OnJoinGame
();
}
private
void
OnTypeChange
(
BinaryReader
packet
)
...
...
@@ -355,6 +357,25 @@ namespace WindBot.Game
}
}
private
void
OnAttack
(
BinaryReader
packet
)
{
int
ca
=
packet
.
ReadByte
();
int
la
=
packet
.
ReadByte
();
int
sa
=
packet
.
ReadByte
();
packet
.
ReadByte
();
//
packet
.
ReadByte
();
// cd
int
ld
=
packet
.
ReadByte
();
packet
.
ReadByte
();
// sd
packet
.
ReadByte
();
//
ClientCard
attackcard
=
_duel
.
GetCard
(
ca
,
(
CardLocation
)
la
,
sa
);
if
(
ld
==
0
)
{
_ai
.
OnDirectAttack
(
attackcard
);
}
}
private
void
OnPosChange
(
BinaryReader
packet
)
{
packet
.
ReadInt32
();
// card id
...
...
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