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
alstroemeria-silentlove
windbot
Commits
d5eb3807
Commit
d5eb3807
authored
Aug 29, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update test ai
parent
b9b9761a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
Game/AI/Decks/DoEveryThingExecutor.cs
Game/AI/Decks/DoEveryThingExecutor.cs
+24
-2
Game/AI/Executor.cs
Game/AI/Executor.cs
+5
-0
Game/GameAI.cs
Game/GameAI.cs
+5
-0
No files found.
Game/AI/Decks/DoEveryThingExecutor.cs
View file @
d5eb3807
namespace
WindBot.Game.AI.Decks
using
YGOSharp.OCGWrapper.Enums
;
using
System.Collections.Generic
;
using
WindBot
;
using
WindBot.Game
;
using
WindBot.Game.AI
;
namespace
WindBot.Game.AI.Decks
{
[
Deck
(
"Test"
,
"AI_Test"
)]
public
class
DoEverythingExecutor
:
DefaultExecutor
...
...
@@ -12,13 +18,29 @@
public
DoEverythingExecutor
(
GameAI
ai
,
Duel
duel
)
:
base
(
ai
,
duel
)
{
AddExecutor
(
ExecutorType
.
SpSummon
);
AddExecutor
(
ExecutorType
.
Activate
,
DontChainMyself
);
AddExecutor
(
ExecutorType
.
SummonOrSet
);
AddExecutor
(
ExecutorType
.
SpSummon
);
AddExecutor
(
ExecutorType
.
Repos
,
DefaultMonsterRepos
);
AddExecutor
(
ExecutorType
.
SpellSet
);
}
public
override
IList
<
ClientCard
>
OnSelectCard
(
IList
<
ClientCard
>
cards
,
int
min
,
int
max
,
bool
cancelable
)
{
IList
<
ClientCard
>
selected
=
new
List
<
ClientCard
>();
// select the last cards
for
(
int
i
=
1
;
i
<=
max
;
++
i
)
selected
.
Add
(
cards
[
cards
.
Count
-
i
]);
return
selected
;
}
public
override
int
OnSelectOption
(
IList
<
int
>
options
)
{
return
Program
.
Rand
.
Next
(
options
.
Count
);
}
private
bool
DontChainMyself
()
{
return
LastChainPlayer
!=
0
;
...
...
Game/AI/Executor.cs
View file @
d5eb3807
...
...
@@ -114,6 +114,11 @@ namespace WindBot.Game.AI
return
true
;
}
public
virtual
int
OnSelectOption
(
IList
<
int
>
options
)
{
return
-
1
;
}
public
bool
ChainContainsCard
(
int
id
)
{
foreach
(
ClientCard
card
in
CurrentChain
)
...
...
Game/GameAI.cs
View file @
d5eb3807
...
...
@@ -326,6 +326,11 @@ namespace WindBot.Game
{
if
(
m_option
!=
-
1
)
return
m_option
;
int
result
=
Executor
.
OnSelectOption
(
options
);
if
(
result
!=
-
1
)
return
result
;
return
0
;
// Always select the first option.
}
...
...
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