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
xiaoye
windbot
Commits
b2427bbd
Commit
b2427bbd
authored
Mar 13, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add LuckyExecutor
parent
1348ee44
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
0 deletions
+62
-0
Game/AI/Decks/LuckyExecutor.cs
Game/AI/Decks/LuckyExecutor.cs
+56
-0
Game/GameAI.cs
Game/GameAI.cs
+5
-0
WindBot.csproj
WindBot.csproj
+1
-0
No files found.
Game/AI/Decks/LuckyExecutor.cs
0 → 100644
View file @
b2427bbd
using
YGOSharp.OCGWrapper.Enums
;
using
System.Collections.Generic
;
using
WindBot
;
using
WindBot.Game
;
using
WindBot.Game.AI
;
namespace
WindBot.Game.AI.Decks
{
[
Deck
(
"Lucky"
,
"AI_Test"
,
"Test"
)]
public
class
LuckyExecutor
:
DefaultExecutor
{
public
LuckyExecutor
(
GameAI
ai
,
Duel
duel
)
:
base
(
ai
,
duel
)
{
AddExecutor
(
ExecutorType
.
SpSummon
,
ImFeelingLucky
);
AddExecutor
(
ExecutorType
.
Activate
,
ImFeelingLucky
);
AddExecutor
(
ExecutorType
.
SummonOrSet
,
ImFeelingLucky
);
AddExecutor
(
ExecutorType
.
SpellSet
,
ImFeelingLucky
);
AddExecutor
(
ExecutorType
.
Repos
,
DefaultMonsterRepos
);
}
public
override
IList
<
ClientCard
>
OnSelectCard
(
IList
<
ClientCard
>
_cards
,
int
min
,
int
max
,
int
hint
,
bool
cancelable
)
{
if
(
Duel
.
Phase
==
DuelPhase
.
BattleStart
)
return
null
;
if
(
AI
.
HaveSelectedCards
())
return
null
;
IList
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
_cards
);
IList
<
ClientCard
>
selected
=
new
List
<
ClientCard
>();
if
(
max
>
cards
.
Count
)
max
=
cards
.
Count
;
// select random cards
while
(
selected
.
Count
<
max
)
{
ClientCard
card
=
cards
[
Program
.
Rand
.
Next
(
cards
.
Count
)];
selected
.
Add
(
card
);
cards
.
Remove
(
card
);
}
return
selected
;
}
public
override
int
OnSelectOption
(
IList
<
int
>
options
)
{
return
Program
.
Rand
.
Next
(
options
.
Count
);
}
private
bool
ImFeelingLucky
()
{
return
Program
.
Rand
.
Next
(
9
)
>=
3
&&
DefaultDontChainMyself
();
}
}
}
\ No newline at end of file
Game/GameAI.cs
View file @
b2427bbd
...
@@ -951,6 +951,11 @@ namespace WindBot.Game
...
@@ -951,6 +951,11 @@ namespace WindBot.Game
m_materialSelector
=
null
;
m_materialSelector
=
null
;
}
}
public
bool
HaveSelectedCards
()
{
return
m_selector
.
Count
>
0
||
m_materialSelector
!=
null
;
}
public
CardSelector
GetSelectedCards
()
public
CardSelector
GetSelectedCards
()
{
{
CardSelector
selected
=
null
;
CardSelector
selected
=
null
;
...
...
WindBot.csproj
View file @
b2427bbd
...
@@ -72,6 +72,7 @@
...
@@ -72,6 +72,7 @@
<Compile
Include=
"Game\AI\Decks\AltergeistExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\AltergeistExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\FamiliarPossessedExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\FamiliarPossessedExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\BlackwingExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\BlackwingExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\LuckyExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\MathMechExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\MathMechExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\PureWindsExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\PureWindsExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\DragunExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\DragunExecutor.cs"
/>
...
...
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