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
79206c87
Commit
79206c87
authored
Sep 02, 2016
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add recognize Floodgates
parent
78be7e2f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
133 additions
and
24 deletions
+133
-24
Game/AI/AIFunctions.cs
Game/AI/AIFunctions.cs
+4
-1
Game/AI/CardContainer.cs
Game/AI/CardContainer.cs
+10
-0
Game/AI/CardExtension.cs
Game/AI/CardExtension.cs
+5
-0
Game/AI/Decks/BlueEyesExecutor.cs
Game/AI/Decks/BlueEyesExecutor.cs
+47
-13
Game/AI/Decks/DragunityExecutor.cs
Game/AI/Decks/DragunityExecutor.cs
+1
-1
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+1
-9
Game/AI/Enums/Floodgate.cs
Game/AI/Enums/Floodgate.cs
+64
-0
WindBot.csproj
WindBot.csproj
+1
-0
No files found.
Game/AI/AIFunctions.cs
View file @
79206c87
...
...
@@ -120,7 +120,10 @@ namespace WindBot.Game.AI
ClientCard
card
=
Duel
.
Fields
[
1
].
MonsterZone
.
GetInvincibleMonster
();
if
(
card
!=
null
)
return
card
;
card
=
Duel
.
Fields
[
1
].
SpellZone
.
GetNegateAttackSpell
();
card
=
Duel
.
Fields
[
1
].
MonsterZone
.
GetFloodgate
();
if
(
card
!=
null
)
return
card
;
card
=
Duel
.
Fields
[
1
].
SpellZone
.
GetFloodgate
();
if
(
card
!=
null
)
return
card
;
if
(
attack
==
0
)
...
...
Game/AI/CardContainer.cs
View file @
79206c87
...
...
@@ -164,5 +164,15 @@ namespace WindBot.Game.AI
}
return
null
;
}
public
static
ClientCard
GetFloodgate
(
this
IEnumerable
<
ClientCard
>
cards
)
{
foreach
(
ClientCard
card
in
cards
)
{
if
(
card
!=
null
&&
card
.
IsFloodgate
())
return
card
;
}
return
null
;
}
}
}
\ No newline at end of file
Game/AI/CardExtension.cs
View file @
79206c87
...
...
@@ -19,5 +19,10 @@ namespace WindBot.Game.AI
{
return
Enum
.
IsDefined
(
typeof
(
NegateAttackSpell
),
card
.
Id
);
}
public
static
bool
IsFloodgate
(
this
ClientCard
card
)
{
return
Enum
.
IsDefined
(
typeof
(
Floodgate
),
card
.
Id
);
}
}
}
\ No newline at end of file
Game/AI/Decks/BlueEyesExecutor.cs
View file @
79206c87
...
...
@@ -51,7 +51,7 @@ namespace MycardBot.Game.AI.Decks
:
base
(
ai
,
duel
)
{
// 有坑先清
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
银河旋风
,
DefaultMysticalSpaceTyphoon
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
银河旋风
,
银河旋风效果
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
鹰身女妖的羽毛扫
);
// 灵庙
...
...
@@ -253,6 +253,47 @@ namespace MycardBot.Game.AI.Decks
return
attacker
.
Attack
>
0
;
}
private
bool
银河旋风效果
()
{
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
].
GetSpells
();
if
(
spells
.
Count
==
0
)
return
false
;
ClientCard
selected
=
null
;
if
(
Card
.
Location
==
CardLocation
.
Grave
)
{
selected
=
Duel
.
Fields
[
1
].
SpellZone
.
GetFloodgate
();
if
(
selected
==
null
)
{
foreach
(
ClientCard
card
in
spells
)
{
if
(!
card
.
IsFacedown
())
{
selected
=
card
;
break
;
}
}
}
}
else
{
foreach
(
ClientCard
card
in
spells
)
{
if
(
card
.
IsFacedown
())
{
selected
=
card
;
break
;
}
}
}
if
(
selected
==
null
)
return
false
;
AI
.
SelectCard
(
selected
);
return
true
;
}
private
bool
龙之灵庙效果
()
{
Logger
.
DebugWriteLine
(
"龙之灵庙."
);
...
...
@@ -413,17 +454,8 @@ namespace MycardBot.Game.AI.Decks
{
return
false
;
}
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
].
GetSpells
();
ClientCard
selected
=
null
;
foreach
(
ClientCard
card
in
spells
)
{
if
(
card
.
IsSpellNegateAttack
())
{
selected
=
card
;
break
;
}
}
if
(
selected
!=
null
&&
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
白色灵龙
))
ClientCard
floodgate
=
Duel
.
Fields
[
1
].
SpellZone
.
GetFloodgate
();
if
(
floodgate
!=
null
&&
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
白色灵龙
))
{
AI
.
SelectCard
((
int
)
CardId
.
白色灵龙
);
}
...
...
@@ -475,6 +507,8 @@ namespace MycardBot.Game.AI.Decks
if
(
ActivateDescription
==
-
1
)
// AI.Utils.GetStringId((int)CardId.白色灵龙, 0))
{
Logger
.
DebugWriteLine
(
"白色灵龙拆后场."
);
ClientCard
target
=
Duel
.
Fields
[
1
].
SpellZone
.
GetFloodgate
();
AI
.
SelectCard
(
target
);
return
true
;
}
/*else if(Duel.Phase==DuelPhase.BattleStart)
...
...
@@ -740,7 +774,7 @@ namespace MycardBot.Game.AI.Decks
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
].
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
Is
SpellNegateAttack
())
if
(
spell
.
Is
Floodgate
())
{
AI
.
SelectCard
(
spell
);
return
true
;
...
...
Game/AI/Decks/DragunityExecutor.cs
View file @
79206c87
...
...
@@ -469,7 +469,7 @@ namespace DevBot.Game.AI.Decks
private
ClientCard
GetProblematicCard
()
{
ClientCard
card
=
Duel
.
Fields
[
1
].
MonsterZone
.
GetInvincibleMonster
();
return
card
??
Duel
.
Fields
[
1
].
SpellZone
.
Get
NegateAttackSpell
();
return
card
??
Duel
.
Fields
[
1
].
SpellZone
.
Get
Floodgate
();
}
}
}
\ No newline at end of file
Game/AI/DefaultExecutor.cs
View file @
79206c87
...
...
@@ -33,15 +33,7 @@ namespace WindBot.Game.AI
if
(
spells
.
Count
==
0
)
return
false
;
ClientCard
selected
=
null
;
foreach
(
ClientCard
card
in
spells
)
{
if
(
card
.
IsSpellNegateAttack
())
{
selected
=
card
;
break
;
}
}
ClientCard
selected
=
Duel
.
Fields
[
1
].
SpellZone
.
GetFloodgate
();
if
(
selected
==
null
)
{
...
...
Game/AI/Enums/Floodgate.cs
0 → 100644
View file @
79206c87
namespace
WindBot.Game.AI.Enums
{
public
enum
Floodgate
{
BarrierStatueoftheTorrent
=
10963799
,
BarrierStatueoftheDrought
=
19740112
,
BarrierStatueoftheHeavens
=
46145256
,
BarrierStatueoftheInferno
=
47961808
,
BarrierStatueoftheStormwinds
=
73356503
,
BarrierStatueoftheAbyss
=
84478195
,
ThunderKingRaiOh
=
71564252
,
FossilDynaPachycephalo
=
42009836
,
VanitysFiend
=
47084486
,
MajestysFiend
=
33746252
,
VanitysRuler
=
72634965
,
KycootheGhostDestroyer
=
88240808
,
ConsecratedLight
=
2980764
,
ArchlordKristya
=
59509952
,
KoakiMeiruDrago
=
12435193
,
DenkoSekka
=
13974207
,
ZapMustung
=
29951323
,
Jinzo
=
77585513
,
SpellCanceller
=
84636823
,
LevelLimitAreaB
=
3136426
,
DimensionalFissure
=
81674782
,
Necrovalley
=
47355498
,
SecretVillageoftheSpellcasters
=
68462976
,
SwordsofRevealingLight
=
72302403
,
MessengerofPeace
=
44656491
,
KaiserColosseum
=
35059553
,
DomainoftheTrueMonarchs
=
84171830
,
ImperialOrder
=
61740673
,
MacroCosmos
=
30241314
,
MindDrain
=
68937720
,
SoulDrain
=
73599290
,
SkillDrain
=
82732705
,
Eisbahn
=
54059040
,
GozenMatch
=
53334471
,
RivalryofWarlords
=
90846359
,
AntiSpellFragrance
=
58921041
,
LightImprisoningMirror
=
53341729
,
ShadowImprisoningMirror
=
99735427
,
WallofRevealingLight
=
17078030
,
VanitysEmptiness
=
5851097
,
Lose1Turn
=
24348804
,
Reqliate
=
20426907
,
SummonLimit
=
23516703
,
AndtheBandPlayedOn
=
47594939
,
StygianDirge
=
81489939
,
RoyalDecree
=
51452091
,
ImperialIronWall
=
30459350
,
DNASurgery
=
74701381
,
NaturiaExterio
=
99916754
,
TheLastWarriorfromAnotherPlanet
=
86099788
,
ThousandEyesRestrict
=
63519819
,
ElShaddollWinda
=
94977269
,
MaskedHERODarkLaw
=
58481572
,
NaturiaBeast
=
33198837
,
NaturiaBarkion
=
2956282
,
EvilswarmOphion
=
91279700
,
MermailAbyssgaios
=
74371660
,
AbyssDweller
=
21044178
}
}
WindBot.csproj
View file @
79206c87
...
...
@@ -76,6 +76,7 @@
<Compile
Include=
"Game\AI\Dialogs.cs"
/>
<Compile
Include=
"Game\AI\Enums\DangerousMonster.cs"
/>
<Compile
Include=
"Game\AI\Enums\InvincibleMonster.cs"
/>
<Compile
Include=
"Game\AI\Enums\Floodgate.cs"
/>
<Compile
Include=
"Game\AI\Enums\NegateAttackSpell.cs"
/>
<Compile
Include=
"Game\AI\Enums\NegatesEffects.cs"
/>
<Compile
Include=
"Game\AI\Enums\NegatesSpells.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