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
HiiragiGuardians
windbot
Commits
00071a3b
Commit
00071a3b
authored
Mar 13, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'change-side'
parents
ca6c267e
f368dda6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
141 additions
and
4 deletions
+141
-4
Game/AI/Decks/LuckyExecutor.cs
Game/AI/Decks/LuckyExecutor.cs
+98
-0
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+20
-1
Game/GameAI.cs
Game/GameAI.cs
+5
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+4
-3
Game/GameClient.cs
Game/GameClient.cs
+2
-0
Program.cs
Program.cs
+4
-0
README.md
README.md
+5
-0
WindBot.csproj
WindBot.csproj
+1
-0
WindBotInfo.cs
WindBotInfo.cs
+2
-0
No files found.
Game/AI/Decks/LuckyExecutor.cs
0 → 100644
View file @
00071a3b
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
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
MysticalSpaceTyphoon
,
DefaultMysticalSpaceTyphoon
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
CosmicCyclone
,
DefaultCosmicCyclone
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
GalaxyCyclone
,
DefaultGalaxyCyclone
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
BookOfMoon
,
DefaultBookOfMoon
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
CompulsoryEvacuationDevice
,
DefaultCompulsoryEvacuationDevice
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
CallOfTheHaunted
,
DefaultCallOfTheHaunted
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
Scapegoat
,
DefaultScapegoat
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
MaxxC
,
DefaultMaxxC
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
AshBlossom
,
DefaultAshBlossomAndJoyousSpring
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
GhostOgreAndSnowRabbit
,
DefaultGhostOgreAndSnowRabbit
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
GhostBelle
,
DefaultGhostBelleAndHauntedMansion
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
EffectVeiler
,
DefaultEffectVeiler
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
CalledByTheGrave
,
DefaultCalledByTheGrave
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
InfiniteImpermanence
,
DefaultInfiniteImpermanence
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
BreakthroughSkill
,
DefaultBreakthroughSkill
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
SolemnJudgment
,
DefaultSolemnJudgment
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
SolemnWarning
,
DefaultSolemnWarning
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
SolemnStrike
,
DefaultSolemnStrike
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
TorrentialTribute
,
DefaultTorrentialTribute
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
HeavyStorm
,
DefaultHeavyStorm
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
HarpiesFeatherDuster
,
DefaultHarpiesFeatherDusterFirst
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
HammerShot
,
DefaultHammerShot
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
DarkHole
,
DefaultDarkHole
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
Raigeki
,
DefaultRaigeki
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
SmashingGround
,
DefaultSmashingGround
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
PotOfDesires
,
DefaultPotOfDesires
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
AllureofDarkness
,
DefaultAllureofDarkness
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
DimensionalBarrier
,
DefaultDimensionalBarrier
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
InterruptedKaijuSlumber
,
DefaultInterruptedKaijuSlumber
);
AddExecutor
(
ExecutorType
.
SpSummon
,
_CardId
.
JizukirutheStarDestroyingKaiju
,
DefaultKaijuSpsummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
_CardId
.
GadarlatheMysteryDustKaiju
,
DefaultKaijuSpsummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
_CardId
.
GamecieltheSeaTurtleKaiju
,
DefaultKaijuSpsummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
_CardId
.
RadiantheMultidimensionalKaiju
,
DefaultKaijuSpsummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
_CardId
.
KumongoustheStickyStringKaiju
,
DefaultKaijuSpsummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
_CardId
.
ThunderKingtheLightningstrikeKaiju
,
DefaultKaijuSpsummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
_CardId
.
DogorantheMadFlameKaiju
,
DefaultKaijuSpsummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
_CardId
.
SuperAntiKaijuWarMachineMechaDogoran
,
DefaultKaijuSpsummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
_CardId
.
EvilswarmExcitonKnight
,
DefaultEvilswarmExcitonKnightSummon
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
EvilswarmExcitonKnight
,
DefaultEvilswarmExcitonKnightEffect
);
}
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/AI/DefaultExecutor.cs
View file @
00071a3b
...
...
@@ -36,8 +36,27 @@ namespace WindBot.Game.AI
public
const
int
DarkMagicAttack
=
2314238
;
public
const
int
MysticalSpaceTyphoon
=
5318639
;
public
const
int
CosmicCyclone
=
8267140
;
public
const
int
ChickenGame
=
67616300
;
public
const
int
GalaxyCyclone
=
5133471
;
public
const
int
BookOfMoon
=
14087893
;
public
const
int
CompulsoryEvacuationDevice
=
94192409
;
public
const
int
CallOfTheHaunted
=
97077563
;
public
const
int
Scapegoat
=
73915051
;
public
const
int
BreakthroughSkill
=
78474168
;
public
const
int
SolemnJudgment
=
41420027
;
public
const
int
SolemnWarning
=
84749824
;
public
const
int
SolemnStrike
=
40605147
;
public
const
int
TorrentialTribute
=
53582587
;
public
const
int
HeavyStorm
=
19613556
;
public
const
int
HammerShot
=
26412047
;
public
const
int
DarkHole
=
53129443
;
public
const
int
Raigeki
=
12580477
;
public
const
int
SmashingGround
=
97169186
;
public
const
int
PotOfDesires
=
35261759
;
public
const
int
AllureofDarkness
=
1475311
;
public
const
int
DimensionalBarrier
=
83326048
;
public
const
int
InterruptedKaijuSlumber
=
99330325
;
public
const
int
ChickenGame
=
67616300
;
public
const
int
SantaClaws
=
46565218
;
public
const
int
CastelTheSkyblasterMusketeer
=
82633039
;
...
...
Game/GameAI.cs
View file @
00071a3b
...
...
@@ -951,6 +951,11 @@ namespace WindBot.Game
m_materialSelector
=
null
;
}
public
bool
HaveSelectedCards
()
{
return
m_selector
.
Count
>
0
||
m_materialSelector
!=
null
;
}
public
CardSelector
GetSelectedCards
()
{
CardSelector
selected
=
null
;
...
...
Game/GameBehavior.cs
View file @
00071a3b
...
...
@@ -47,9 +47,10 @@ namespace WindBot.Game
_ai
=
new
GameAI
(
Game
,
_duel
);
_ai
.
Executor
=
DecksManager
.
Instantiate
(
_ai
,
_duel
);
Deck
=
Deck
.
Load
(
_ai
.
Executor
.
Deck
);
DeckForWin
=
Deck
.
Load
(
"Win/"
+
_ai
.
Executor
.
Deck
);
DeckForLose
=
Deck
.
Load
(
"Lose/"
+
_ai
.
Executor
.
Deck
);
string
deckName
=
Game
.
DeckFile
??
_ai
.
Executor
.
Deck
;
Deck
=
Deck
.
Load
(
deckName
);
DeckForWin
=
Deck
.
Load
(
"Win/"
+
deckName
);
DeckForLose
=
Deck
.
Load
(
"Lose/"
+
deckName
);
_select_hint
=
0
;
lastDuelResult
=
2
;
}
...
...
Game/GameClient.cs
View file @
00071a3b
...
...
@@ -13,6 +13,7 @@ namespace WindBot.Game
public
YGOClient
Connection
{
get
;
private
set
;
}
public
string
Username
;
public
string
Deck
;
public
string
DeckFile
;
public
string
Dialog
;
public
int
Hand
;
public
bool
Debug
;
...
...
@@ -29,6 +30,7 @@ namespace WindBot.Game
{
Username
=
Info
.
Name
;
Deck
=
Info
.
Deck
;
DeckFile
=
Info
.
DeckFile
;
Dialog
=
Info
.
Dialog
;
Hand
=
Info
.
Hand
;
Debug
=
Info
.
Debug
;
...
...
Program.cs
View file @
00071a3b
...
...
@@ -68,6 +68,7 @@ namespace WindBot
WindBotInfo
Info
=
new
WindBotInfo
();
Info
.
Name
=
Config
.
GetString
(
"Name"
,
Info
.
Name
);
Info
.
Deck
=
Config
.
GetString
(
"Deck"
,
Info
.
Deck
);
Info
.
DeckFile
=
Config
.
GetString
(
"DeckFile"
,
Info
.
DeckFile
);
Info
.
Dialog
=
Config
.
GetString
(
"Dialog"
,
Info
.
Dialog
);
Info
.
Host
=
Config
.
GetString
(
"Host"
,
Info
.
Host
);
Info
.
Port
=
Config
.
GetInt
(
"Port"
,
Info
.
Port
);
...
...
@@ -104,6 +105,9 @@ namespace WindBot
string
port
=
HttpUtility
.
ParseQueryString
(
RawUrl
).
Get
(
"port"
);
if
(
port
!=
null
)
Info
.
Port
=
Int32
.
Parse
(
port
);
string
deckfile
=
HttpUtility
.
ParseQueryString
(
RawUrl
).
Get
(
"deckfile"
);
if
(
deckfile
!=
null
)
Info
.
DeckFile
=
deckfile
;
string
dialog
=
HttpUtility
.
ParseQueryString
(
RawUrl
).
Get
(
"dialog"
);
if
(
dialog
!=
null
)
Info
.
Dialog
=
dialog
;
...
...
README.md
View file @
00071a3b
...
...
@@ -20,6 +20,11 @@ The nickname for the bot.
`Deck`
The deck to be used by the bot. Available decks are listed below. Keep empty to use random deck.
`DeckFile`
The deck file (.ydk) to be used by the bot. Will be set by
`Deck`
automatically, but you can override it.
Note: Most cards not in the original deck are unknown to the bot, and won't be summoned or activated in the duel.
`Dialog`
The dialog texts to be used by the bot. See Dialogs folder for list.
...
...
WindBot.csproj
View file @
00071a3b
...
...
@@ -72,6 +72,7 @@
<Compile
Include=
"Game\AI\Decks\AltergeistExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\FamiliarPossessedExecutor.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\PureWindsExecutor.cs"
/>
<Compile
Include=
"Game\AI\Decks\DragunExecutor.cs"
/>
...
...
WindBotInfo.cs
View file @
00071a3b
...
...
@@ -6,6 +6,7 @@ namespace WindBot
{
public
string
Name
{
get
;
set
;
}
public
string
Deck
{
get
;
set
;
}
public
string
DeckFile
{
get
;
set
;
}
public
string
Dialog
{
get
;
set
;
}
public
string
Host
{
get
;
set
;
}
public
int
Port
{
get
;
set
;
}
...
...
@@ -18,6 +19,7 @@ namespace WindBot
{
Name
=
"WindBot"
;
Deck
=
null
;
DeckFile
=
null
;
Dialog
=
"default"
;
Host
=
"127.0.0.1"
;
Port
=
7911
;
...
...
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