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
3bd53ba5
Commit
3bd53ba5
authored
Mar 20, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:IceYGO/windbot
parents
fd9b4610
a927ee30
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
7 deletions
+42
-7
Game/AI/Decks/LuckyExecutor.cs
Game/AI/Decks/LuckyExecutor.cs
+40
-2
Game/GameAI.cs
Game/GameAI.cs
+2
-5
No files found.
Game/AI/Decks/LuckyExecutor.cs
View file @
3bd53ba5
...
...
@@ -83,7 +83,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
ExodiaTheForbiddenOne
,
JustDontIt
);
}
private
List
<
int
>
HintMsgFor
Remove
=
new
List
<
int
>
private
List
<
int
>
HintMsgFor
Enemy
=
new
List
<
int
>
{
HintMsg
.
Release
,
HintMsg
.
Destroy
,
HintMsg
.
Remove
,
HintMsg
.
ToGrave
,
HintMsg
.
ReturnToHand
,
HintMsg
.
ToDeck
,
HintMsg
.
FusionMaterial
,
HintMsg
.
SynchroMaterial
,
HintMsg
.
XyzMaterial
,
HintMsg
.
LinkMaterial
,
HintMsg
.
Disable
...
...
@@ -94,6 +94,16 @@ namespace WindBot.Game.AI.Decks
HintMsg
.
SpSummon
,
HintMsg
.
ToGrave
,
HintMsg
.
Remove
,
HintMsg
.
AddToHand
,
HintMsg
.
FusionMaterial
};
private
List
<
int
>
HintMsgForSelf
=
new
List
<
int
>
{
HintMsg
.
Equip
};
private
List
<
int
>
HintMsgForMaterial
=
new
List
<
int
>
{
HintMsg
.
FusionMaterial
,
HintMsg
.
SynchroMaterial
,
HintMsg
.
XyzMaterial
,
HintMsg
.
LinkMaterial
,
HintMsg
.
Release
};
private
List
<
int
>
HintMsgForMaxSelect
=
new
List
<
int
>
{
HintMsg
.
SpSummon
,
HintMsg
.
ToGrave
,
HintMsg
.
AddToHand
,
HintMsg
.
FusionMaterial
,
HintMsg
.
Destroy
...
...
@@ -111,7 +121,7 @@ namespace WindBot.Game.AI.Decks
if
(
max
>
cards
.
Count
)
max
=
cards
.
Count
;
if
(
HintMsgFor
Remove
.
Contains
(
hint
))
if
(
HintMsgFor
Enemy
.
Contains
(
hint
))
{
IList
<
ClientCard
>
enemyCards
=
cards
.
Where
(
card
=>
card
.
Controller
==
1
).
ToList
();
...
...
@@ -139,6 +149,34 @@ namespace WindBot.Game.AI.Decks
}
}
if
(
HintMsgForSelf
.
Contains
(
hint
))
{
IList
<
ClientCard
>
botCards
=
cards
.
Where
(
card
=>
card
.
Controller
==
0
).
ToList
();
// select bot's card first
while
(
botCards
.
Count
>
0
&&
selected
.
Count
<
max
)
{
ClientCard
card
=
botCards
[
Program
.
Rand
.
Next
(
botCards
.
Count
)];
selected
.
Add
(
card
);
botCards
.
Remove
(
card
);
cards
.
Remove
(
card
);
}
}
if
(
HintMsgForMaterial
.
Contains
(
hint
))
{
IList
<
ClientCard
>
materials
=
cards
.
OrderBy
(
card
=>
card
.
Attack
).
ToList
();
// select low attack first
while
(
materials
.
Count
>
0
&&
selected
.
Count
<
min
)
{
ClientCard
card
=
materials
[
0
];
selected
.
Add
(
card
);
materials
.
Remove
(
card
);
cards
.
Remove
(
card
);
}
}
// select random cards
while
(
selected
.
Count
<
min
)
{
...
...
Game/GameAI.cs
View file @
3bd53ba5
...
...
@@ -195,11 +195,8 @@ namespace WindBot.Game
if
(
defenders
.
Count
==
0
)
{
// Attack with the monster with the lowest attack first
for
(
int
i
=
attackers
.
Count
-
1
;
i
>=
0
;
--
i
)
{
ClientCard
attacker
=
attackers
[
i
];
Attack
(
attacker
,
null
);
}
ClientCard
attacker
=
attackers
[
attackers
.
Count
-
1
];
return
Attack
(
attacker
,
null
);
}
else
{
...
...
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