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
13c8f9ce
Commit
13c8f9ce
authored
Jul 28, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update Yosenju deck
parent
96bc0f0c
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
378 additions
and
37 deletions
+378
-37
Decks/AI_Yosenju.ydk
Decks/AI_Yosenju.ydk
+5
-20
Dialogs/near.zh-CN.json
Dialogs/near.zh-CN.json
+1
-1
Game/AI/AIFunctions.cs
Game/AI/AIFunctions.cs
+21
-0
Game/AI/Decks/YosenjuExecutor.cs
Game/AI/Decks/YosenjuExecutor.cs
+326
-12
Game/AI/Executor.cs
Game/AI/Executor.cs
+8
-1
Game/ClientCard.cs
Game/ClientCard.cs
+2
-0
Game/ClientField.cs
Game/ClientField.cs
+5
-0
Game/GameAI.cs
Game/GameAI.cs
+5
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+5
-3
No files found.
Decks/AI_Yosenju.ydk
View file @
13c8f9ce
...
@@ -42,33 +42,18 @@
...
@@ -42,33 +42,18 @@
84749824
84749824
#extra
#extra
44508094
44508094
56832966
86532744
16195942
84013237
94380860
94380860
96381979
96381979
63746411
63746411
82633039
95169481
95169481
22653490
22653490
46772449
46772449
21044178
21044178
12014404
12014404
12014404
12014404
16195942
82633039
56832966
86532744
84013237
!side
!side
5133471
5133471
5133471
3493058
3493058
3493058
5318639
5318639
5318639
30459350
30459350
30459350
83266092
83266092
83266092
Dialogs/near.zh-CN.json
View file @
13c8f9ce
...
@@ -52,7 +52,7 @@
...
@@ -52,7 +52,7 @@
],
],
"chaining"
:
[
"chaining"
:
[
"我挥动了神奇的魔法棒,并发动了{0}的效果~"
,
"我挥动了神奇的魔法棒,并发动了{0}的效果~"
,
"啊!这下死定了!...嘿嘿你上当了,
打开盖卡!
{0}!"
,
"啊!这下死定了!...嘿嘿你上当了,
我发动
{0}!"
,
"你这太贸然了,难道你没想到我会发动{0}吗?"
"你这太贸然了,难道你没想到我会发动{0}吗?"
]
]
}
}
Game/AI/AIFunctions.cs
View file @
13c8f9ce
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
YGOSharp.OCGWrapper.Enums
;
namespace
WindBot.Game.AI
namespace
WindBot.Game.AI
{
{
...
@@ -37,6 +38,21 @@ namespace WindBot.Game.AI
...
@@ -37,6 +38,21 @@ namespace WindBot.Game.AI
return
1
;
return
1
;
}
}
public
int
GetBestAttack
(
ClientField
field
,
bool
onlyatk
)
{
int
bestAtk
=
-
1
;
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
ClientCard
card
=
field
.
MonsterZone
[
i
];
if
(
card
==
null
)
continue
;
if
(
onlyatk
&&
card
.
IsDefense
())
continue
;
int
ennemyValue
=
card
.
GetDefensePower
();
if
(
ennemyValue
>
bestAtk
)
bestAtk
=
ennemyValue
;
}
return
bestAtk
;
}
public
bool
IsEnnemyBetter
(
bool
onlyatk
,
bool
all
)
public
bool
IsEnnemyBetter
(
bool
onlyatk
,
bool
all
)
{
{
if
(
Duel
.
Fields
[
1
].
GetMonsterCount
()
==
0
)
if
(
Duel
.
Fields
[
1
].
GetMonsterCount
()
==
0
)
...
@@ -103,5 +119,10 @@ namespace WindBot.Game.AI
...
@@ -103,5 +119,10 @@ namespace WindBot.Game.AI
{
{
return
id
*
16
+
option
;
return
id
*
16
+
option
;
}
}
public
bool
IsTurn1OrMain2
()
{
return
Duel
.
Turn
==
1
||
Duel
.
Phase
==
DuelPhase
.
Main2
;
}
}
}
}
}
\ No newline at end of file
Game/AI/Decks/YosenjuExecutor.cs
View file @
13c8f9ce
This diff is collapsed.
Click to expand it.
Game/AI/Executor.cs
View file @
13c8f9ce
...
@@ -33,7 +33,7 @@ namespace WindBot.Game.AI
...
@@ -33,7 +33,7 @@ namespace WindBot.Game.AI
public
virtual
bool
OnSelectHand
()
public
virtual
bool
OnSelectHand
()
{
{
return
true
;
// I want to begin !
return
Program
.
Rand
.
Next
(
2
)
>
0
;
}
}
public
virtual
BattlePhaseAction
OnBattle
(
IList
<
ClientCard
>
attackers
,
IList
<
ClientCard
>
defenders
)
public
virtual
BattlePhaseAction
OnBattle
(
IList
<
ClientCard
>
attackers
,
IList
<
ClientCard
>
defenders
)
...
@@ -59,6 +59,13 @@ namespace WindBot.Game.AI
...
@@ -59,6 +59,13 @@ namespace WindBot.Game.AI
}
}
}
}
for
(
int
i
=
attackers
.
Count
-
1
;
i
>=
0
;
--
i
)
{
ClientCard
attacker
=
attackers
[
i
];
if
(
attacker
.
CanDirectAttack
)
return
AI
.
Attack
(
attacker
,
null
);
}
if
(!
Battle
.
CanMainPhaseTwo
)
if
(!
Battle
.
CanMainPhaseTwo
)
return
AI
.
Attack
(
attackers
[
attackers
.
Count
-
1
],
defenders
[
0
]);
return
AI
.
Attack
(
attackers
[
attackers
.
Count
-
1
],
defenders
[
0
]);
...
...
Game/ClientCard.cs
View file @
13c8f9ce
...
@@ -30,6 +30,8 @@ namespace WindBot.Game
...
@@ -30,6 +30,8 @@ namespace WindBot.Game
public
int
Controller
{
get
;
private
set
;
}
public
int
Controller
{
get
;
private
set
;
}
public
int
Disabled
{
get
;
private
set
;
}
public
int
Disabled
{
get
;
private
set
;
}
public
int
SelectSeq
{
get
;
set
;
}
public
int
SelectSeq
{
get
;
set
;
}
public
bool
CanDirectAttack
{
get
;
set
;
}
public
bool
ShouldDirectAttack
{
get
;
set
;
}
public
int
[]
ActionIndex
{
get
;
set
;
}
public
int
[]
ActionIndex
{
get
;
set
;
}
public
IDictionary
<
int
,
int
>
ActionActivateIndex
{
get
;
private
set
;
}
public
IDictionary
<
int
,
int
>
ActionActivateIndex
{
get
;
private
set
;
}
...
...
Game/ClientField.cs
View file @
13c8f9ce
...
@@ -42,6 +42,11 @@ namespace WindBot.Game
...
@@ -42,6 +42,11 @@ namespace WindBot.Game
return
GetCount
(
SpellZone
);
return
GetCount
(
SpellZone
);
}
}
public
int
GetHandCount
()
{
return
GetCount
(
Hand
);
}
public
int
GetSpellCountWithoutField
()
public
int
GetSpellCountWithoutField
()
{
{
int
count
=
0
;
int
count
=
0
;
...
...
Game/GameAI.cs
View file @
13c8f9ce
...
@@ -632,14 +632,19 @@ namespace WindBot.Game
...
@@ -632,14 +632,19 @@ namespace WindBot.Game
public
BattlePhaseAction
Attack
(
ClientCard
attacker
,
ClientCard
defender
)
public
BattlePhaseAction
Attack
(
ClientCard
attacker
,
ClientCard
defender
)
{
{
Executor
.
SetCard
(
0
,
attacker
,
-
1
);
if
(
defender
!=
null
)
if
(
defender
!=
null
)
{
{
string
cardName
=
defender
.
Name
??
"monster"
;
string
cardName
=
defender
.
Name
??
"monster"
;
attacker
.
ShouldDirectAttack
=
false
;
_dialogs
.
SendAttack
(
attacker
.
Name
,
cardName
);
_dialogs
.
SendAttack
(
attacker
.
Name
,
cardName
);
SelectCard
(
defender
);
SelectCard
(
defender
);
}
}
else
else
{
attacker
.
ShouldDirectAttack
=
true
;
_dialogs
.
SendDirectAttack
(
attacker
.
Name
);
_dialogs
.
SendDirectAttack
(
attacker
.
Name
);
}
return
new
BattlePhaseAction
(
BattlePhaseAction
.
BattleAction
.
Attack
,
attacker
.
ActionIndex
);
return
new
BattlePhaseAction
(
BattlePhaseAction
.
BattleAction
.
Attack
,
attacker
.
ActionIndex
);
}
}
...
...
Game/GameBehavior.cs
View file @
13c8f9ce
...
@@ -529,13 +529,15 @@ namespace WindBot.Game
...
@@ -529,13 +529,15 @@ namespace WindBot.Game
int
con
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
con
=
GetLocalPlayer
(
packet
.
ReadByte
());
CardLocation
loc
=
(
CardLocation
)
packet
.
ReadByte
();
CardLocation
loc
=
(
CardLocation
)
packet
.
ReadByte
();
int
seq
=
packet
.
ReadByte
();
int
seq
=
packet
.
ReadByte
();
packet
.
ReadByte
();
// diratt
int
diratt
=
packet
.
ReadByte
();
ClientCard
card
=
_duel
.
GetCard
(
con
,
loc
,
seq
);
ClientCard
card
=
_duel
.
GetCard
(
con
,
loc
,
seq
);
if
(
card
!=
null
)
if
(
card
!=
null
)
{
{
card
.
ActionIndex
[
1
]
=
i
;
card
.
ActionIndex
[
1
]
=
i
;
battle
.
AttackableCards
.
Add
(
_duel
.
GetCard
(
con
,
loc
,
seq
));
if
(
diratt
>
0
)
card
.
CanDirectAttack
=
true
;
battle
.
AttackableCards
.
Add
(
card
);
}
}
}
}
...
@@ -625,7 +627,7 @@ namespace WindBot.Game
...
@@ -625,7 +627,7 @@ namespace WindBot.Game
int
con
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
con
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
loc
=
packet
.
ReadByte
();
int
loc
=
packet
.
ReadByte
();
int
seq
=
packet
.
ReadByte
();
int
seq
=
packet
.
ReadByte
();
int
sseq
=
0
;
//
packet.ReadByte();
int
sseq
=
packet
.
ReadByte
();
int
desc
=
packet
.
ReadInt32
();
int
desc
=
packet
.
ReadInt32
();
cards
.
Add
(
_duel
.
GetCard
(
con
,
loc
,
seq
,
sseq
));
cards
.
Add
(
_duel
.
GetCard
(
con
,
loc
,
seq
,
sseq
));
...
...
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