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
f8435d17
Commit
f8435d17
authored
Aug 29, 2018
by
mercury233
Committed by
GitHub
Aug 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ClientCard.IsCode, fix ClientCard.Alias support (#97)
parent
48df4873
Changes
32
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
436 additions
and
435 deletions
+436
-435
Game/AI/AIFunctions.cs
Game/AI/AIFunctions.cs
+4
-4
Game/AI/CardContainer.cs
Game/AI/CardContainer.cs
+2
-2
Game/AI/CardSelector.cs
Game/AI/CardSelector.cs
+2
-2
Game/AI/Decks/AltergeistExecutor.cs
Game/AI/Decks/AltergeistExecutor.cs
+104
-98
Game/AI/Decks/BlackwingExecutor.cs
Game/AI/Decks/BlackwingExecutor.cs
+4
-4
Game/AI/Decks/BlueEyesExecutor.cs
Game/AI/Decks/BlueEyesExecutor.cs
+6
-13
Game/AI/Decks/BlueEyesMaxDragonExecutor.cs
Game/AI/Decks/BlueEyesMaxDragonExecutor.cs
+30
-34
Game/AI/Decks/BurnExecutor.cs
Game/AI/Decks/BurnExecutor.cs
+3
-3
Game/AI/Decks/ChainBurnExecutor.cs
Game/AI/Decks/ChainBurnExecutor.cs
+27
-27
Game/AI/Decks/DarkMagicianExecutor.cs
Game/AI/Decks/DarkMagicianExecutor.cs
+34
-39
Game/AI/Decks/DragunityExecutor.cs
Game/AI/Decks/DragunityExecutor.cs
+9
-10
Game/AI/Decks/FrogExecutor.cs
Game/AI/Decks/FrogExecutor.cs
+7
-7
Game/AI/Decks/GrenMajuThunderBoarderExecutor.cs
Game/AI/Decks/GrenMajuThunderBoarderExecutor.cs
+22
-25
Game/AI/Decks/HorusExecutor.cs
Game/AI/Decks/HorusExecutor.cs
+3
-3
Game/AI/Decks/LightswornExecutor.cs
Game/AI/Decks/LightswornExecutor.cs
+1
-1
Game/AI/Decks/LightswornShaddoldinosourExecutor.cs
Game/AI/Decks/LightswornShaddoldinosourExecutor.cs
+18
-24
Game/AI/Decks/NekrozExecutor.cs
Game/AI/Decks/NekrozExecutor.cs
+5
-5
Game/AI/Decks/PhantasmExecutor.cs
Game/AI/Decks/PhantasmExecutor.cs
+19
-19
Game/AI/Decks/QliphortExecutor.cs
Game/AI/Decks/QliphortExecutor.cs
+3
-3
Game/AI/Decks/RainbowExecutor.cs
Game/AI/Decks/RainbowExecutor.cs
+1
-1
Game/AI/Decks/Rank5Executor.cs
Game/AI/Decks/Rank5Executor.cs
+7
-7
Game/AI/Decks/ST1732Executor.cs
Game/AI/Decks/ST1732Executor.cs
+3
-3
Game/AI/Decks/SkyStrikerExecutor.cs
Game/AI/Decks/SkyStrikerExecutor.cs
+7
-7
Game/AI/Decks/ToadallyAwesomeExecutor.cs
Game/AI/Decks/ToadallyAwesomeExecutor.cs
+9
-9
Game/AI/Decks/TrickstarExecutor.cs
Game/AI/Decks/TrickstarExecutor.cs
+40
-40
Game/AI/Decks/YosenjuExecutor.cs
Game/AI/Decks/YosenjuExecutor.cs
+4
-4
Game/AI/Decks/ZexalWeaponsExecutor.cs
Game/AI/Decks/ZexalWeaponsExecutor.cs
+2
-2
Game/AI/Decks/ZoodiacExecutor.cs
Game/AI/Decks/ZoodiacExecutor.cs
+6
-6
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+24
-24
Game/ClientCard.cs
Game/ClientCard.cs
+20
-0
Game/ClientField.cs
Game/ClientField.cs
+8
-8
Game/GameBehavior.cs
Game/GameBehavior.cs
+2
-1
No files found.
Game/AI/AIFunctions.cs
View file @
f8435d17
...
@@ -335,12 +335,12 @@ namespace WindBot.Game.AI
...
@@ -335,12 +335,12 @@ namespace WindBot.Game.AI
public
bool
ChainContainsCard
(
int
id
)
public
bool
ChainContainsCard
(
int
id
)
{
{
return
Duel
.
CurrentChain
.
Any
(
card
=>
card
.
I
d
==
id
);
return
Duel
.
CurrentChain
.
Any
(
card
=>
card
.
I
sCode
(
id
)
);
}
}
public
bool
ChainContainsCard
(
int
[]
ids
)
public
bool
ChainContainsCard
(
int
[]
ids
)
{
{
return
Duel
.
CurrentChain
.
Any
(
card
=>
ids
.
Contains
(
card
.
Id
));
return
Duel
.
CurrentChain
.
Any
(
card
=>
card
.
IsCode
(
ids
));
}
}
public
int
ChainCountPlayer
(
int
player
)
public
int
ChainCountPlayer
(
int
player
)
...
@@ -385,7 +385,7 @@ namespace WindBot.Game.AI
...
@@ -385,7 +385,7 @@ namespace WindBot.Game.AI
IList
<
ClientCard
>
selected
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
selected
=
new
List
<
ClientCard
>();
foreach
(
ClientCard
card
in
cards
)
foreach
(
ClientCard
card
in
cards
)
{
{
if
(
card
.
I
d
==
preferred
&&
selected
.
Count
<
max
)
if
(
card
.
I
sCode
(
preferred
)
&&
selected
.
Count
<
max
)
selected
.
Add
(
card
);
selected
.
Add
(
card
);
}
}
...
@@ -420,7 +420,7 @@ namespace WindBot.Game.AI
...
@@ -420,7 +420,7 @@ namespace WindBot.Game.AI
{
{
foreach
(
ClientCard
card
in
cards
)
foreach
(
ClientCard
card
in
cards
)
{
{
if
(
card
.
I
d
==
id
&&
selected
.
Count
<
max
&&
selected
.
IndexOf
(
card
)
<=
0
)
if
(
card
.
I
sCode
(
id
)
&&
selected
.
Count
<
max
&&
selected
.
IndexOf
(
card
)
<=
0
)
selected
.
Add
(
card
);
selected
.
Add
(
card
);
}
}
if
(
selected
.
Count
>=
max
)
if
(
selected
.
Count
>=
max
)
...
...
Game/AI/CardContainer.cs
View file @
f8435d17
...
@@ -47,12 +47,12 @@ namespace WindBot.Game.AI
...
@@ -47,12 +47,12 @@ namespace WindBot.Game.AI
public
static
bool
ContainsCardWithId
(
this
IEnumerable
<
ClientCard
>
cards
,
int
id
)
public
static
bool
ContainsCardWithId
(
this
IEnumerable
<
ClientCard
>
cards
,
int
id
)
{
{
return
cards
.
Where
(
card
=>
card
?.
Data
!=
null
).
Any
(
card
=>
card
.
I
d
==
id
);
return
cards
.
Where
(
card
=>
card
?.
Data
!=
null
).
Any
(
card
=>
card
.
I
sCode
(
id
)
);
}
}
public
static
int
GetCardCount
(
this
IEnumerable
<
ClientCard
>
cards
,
int
id
)
public
static
int
GetCardCount
(
this
IEnumerable
<
ClientCard
>
cards
,
int
id
)
{
{
return
cards
.
Where
(
card
=>
card
?.
Data
!=
null
).
Count
(
card
=>
card
.
I
d
==
id
);
return
cards
.
Where
(
card
=>
card
?.
Data
!=
null
).
Count
(
card
=>
card
.
I
sCode
(
id
)
);
}
}
public
static
List
<
ClientCard
>
GetMonsters
(
this
IEnumerable
<
ClientCard
>
cards
)
public
static
List
<
ClientCard
>
GetMonsters
(
this
IEnumerable
<
ClientCard
>
cards
)
...
...
Game/AI/CardSelector.cs
View file @
f8435d17
...
@@ -68,13 +68,13 @@ namespace WindBot.Game.AI
...
@@ -68,13 +68,13 @@ namespace WindBot.Game.AI
break
;
break
;
case
SelectType
.
Id
:
case
SelectType
.
Id
:
foreach
(
ClientCard
card
in
cards
)
foreach
(
ClientCard
card
in
cards
)
if
(
card
.
I
d
==
_id
)
if
(
card
.
I
sCode
(
_id
)
)
result
.
Add
(
card
);
result
.
Add
(
card
);
break
;
break
;
case
SelectType
.
Ids
:
case
SelectType
.
Ids
:
foreach
(
int
id
in
_ids
)
foreach
(
int
id
in
_ids
)
foreach
(
ClientCard
card
in
cards
)
foreach
(
ClientCard
card
in
cards
)
if
(
card
.
I
d
==
id
&&
!
result
.
Contains
(
card
))
if
(
card
.
I
sCode
(
id
)
&&
!
result
.
Contains
(
card
))
result
.
Add
(
card
);
result
.
Add
(
card
);
break
;
break
;
case
SelectType
.
Location
:
case
SelectType
.
Location
:
...
...
Game/AI/Decks/AltergeistExecutor.cs
View file @
f8435d17
This diff is collapsed.
Click to expand it.
Game/AI/Decks/BlackwingExecutor.cs
View file @
f8435d17
...
@@ -111,7 +111,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -111,7 +111,7 @@ namespace WindBot.Game.AI.Decks
{
{
List
<
ClientCard
>
monster
=
Bot
.
GetMonsters
();
List
<
ClientCard
>
monster
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
card
in
monster
)
foreach
(
ClientCard
card
in
monster
)
if
(
card
!=
null
&&
card
.
I
d
==
CardId
.
KrisTheCrackOfDawn
||
card
.
Id
==
CardId
.
KalutTheMoonShadow
||
card
.
Id
==
CardId
.
GaleTheWhirlwind
||
card
.
Id
==
CardId
.
BoraTheSpear
||
card
.
Id
==
CardId
.
SiroccoTheDawn
||
card
.
Id
==
CardId
.
ShuraTheBlueFlame
||
card
.
Id
==
CardId
.
BlizzardTheFarNorth
)
if
(
card
!=
null
&&
card
.
I
sCode
(
CardId
.
KrisTheCrackOfDawn
,
CardId
.
KalutTheMoonShadow
,
CardId
.
GaleTheWhirlwind
,
CardId
.
BoraTheSpear
,
CardId
.
SiroccoTheDawn
,
CardId
.
ShuraTheBlueFlame
,
CardId
.
BlizzardTheFarNorth
)
)
return
true
;
return
true
;
return
false
;
return
false
;
}
}
...
@@ -119,7 +119,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -119,7 +119,7 @@ namespace WindBot.Game.AI.Decks
private
bool
KalutTheMoonShadowSummon
()
private
bool
KalutTheMoonShadowSummon
()
{
{
foreach
(
ClientCard
card
in
Bot
.
Hand
)
foreach
(
ClientCard
card
in
Bot
.
Hand
)
if
(
card
!=
null
&&
card
.
I
d
==
CardId
.
KrisTheCrackOfDawn
||
card
.
Id
==
CardId
.
GaleTheWhirlwind
||
card
.
Id
==
CardId
.
BoraTheSpear
||
card
.
Id
==
CardId
.
SiroccoTheDawn
||
card
.
Id
==
CardId
.
ShuraTheBlueFlame
||
card
.
Id
==
CardId
.
BlizzardTheFarNorth
)
if
(
card
!=
null
&&
card
.
I
sCode
(
CardId
.
KrisTheCrackOfDawn
,
CardId
.
GaleTheWhirlwind
,
CardId
.
BoraTheSpear
,
CardId
.
SiroccoTheDawn
,
CardId
.
ShuraTheBlueFlame
,
CardId
.
BlizzardTheFarNorth
)
)
return
false
;
return
false
;
return
true
;
return
true
;
}
}
...
@@ -127,7 +127,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -127,7 +127,7 @@ namespace WindBot.Game.AI.Decks
private
bool
BlizzardTheFarNorthSummon
()
private
bool
BlizzardTheFarNorthSummon
()
{
{
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
if
(
card
!=
null
&&
card
.
I
d
==
CardId
.
KalutTheMoonShadow
||
card
.
Id
==
CardId
.
BoraTheSpear
||
card
.
Id
==
CardId
.
ShuraTheBlueFlame
||
card
.
Id
==
CardId
.
KrisTheCrackOfDawn
)
if
(
card
!=
null
&&
card
.
I
sCode
(
CardId
.
KalutTheMoonShadow
,
CardId
.
BoraTheSpear
,
CardId
.
ShuraTheBlueFlame
,
CardId
.
KrisTheCrackOfDawn
)
)
return
true
;
return
true
;
return
false
;
return
false
;
}
}
...
@@ -138,7 +138,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -138,7 +138,7 @@ namespace WindBot.Game.AI.Decks
List
<
ClientCard
>
monster
=
Bot
.
GetMonsters
();
List
<
ClientCard
>
monster
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
card
in
monster
)
foreach
(
ClientCard
card
in
monster
)
if
(
card
!=
null
&&
card
.
I
d
==
CardId
.
KrisTheCrackOfDawn
||
card
.
Id
==
CardId
.
KalutTheMoonShadow
||
card
.
Id
==
CardId
.
GaleTheWhirlwind
||
card
.
Id
==
CardId
.
BoraTheSpear
||
card
.
Id
==
CardId
.
SiroccoTheDawn
||
card
.
Id
==
CardId
.
ShuraTheBlueFlame
||
card
.
Id
==
CardId
.
BlizzardTheFarNorth
)
if
(
card
!=
null
&&
card
.
I
sCode
(
CardId
.
KrisTheCrackOfDawn
,
CardId
.
KalutTheMoonShadow
,
CardId
.
GaleTheWhirlwind
,
CardId
.
BoraTheSpear
,
CardId
.
SiroccoTheDawn
,
CardId
.
ShuraTheBlueFlame
,
CardId
.
BlizzardTheFarNorth
)
)
Count
++;
Count
++;
if
(
Count
==
3
)
if
(
Count
==
3
)
...
...
Game/AI/Decks/BlueEyesExecutor.cs
View file @
f8435d17
...
@@ -141,8 +141,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -141,8 +141,8 @@ namespace WindBot.Game.AI.Decks
Logger
.
DebugWriteLine
(
"OnSelectCard MelodyOfAwakeningDragon"
);
Logger
.
DebugWriteLine
(
"OnSelectCard MelodyOfAwakeningDragon"
);
List
<
ClientCard
>
result
=
new
List
<
ClientCard
>();
List
<
ClientCard
>
result
=
new
List
<
ClientCard
>();
if
(!
Bot
.
HasInHand
(
CardId
.
WhiteDragon
))
if
(!
Bot
.
HasInHand
(
CardId
.
WhiteDragon
))
result
.
AddRange
(
cards
.
Where
(
card
=>
card
.
I
d
==
CardId
.
WhiteDragon
).
Take
(
1
));
result
.
AddRange
(
cards
.
Where
(
card
=>
card
.
I
sCode
(
CardId
.
WhiteDragon
)
).
Take
(
1
));
result
.
AddRange
(
cards
.
Where
(
card
=>
card
.
I
d
==
CardId
.
AlternativeWhiteDragon
));
result
.
AddRange
(
cards
.
Where
(
card
=>
card
.
I
sCode
(
CardId
.
AlternativeWhiteDragon
)
));
return
AI
.
Utils
.
CheckSelectCount
(
result
,
cards
,
min
,
max
);
return
AI
.
Utils
.
CheckSelectCount
(
result
,
cards
,
min
,
max
);
}
}
Logger
.
DebugWriteLine
(
"Use default."
);
Logger
.
DebugWriteLine
(
"Use default."
);
...
@@ -883,23 +883,16 @@ namespace WindBot.Game.AI.Decks
...
@@ -883,23 +883,16 @@ namespace WindBot.Game.AI.Decks
return
true
;
return
true
;
if
(
Card
.
IsDefense
()
&&
!
enemyBetter
&&
Card
.
Attack
>=
Card
.
Defense
)
if
(
Card
.
IsDefense
()
&&
!
enemyBetter
&&
Card
.
Attack
>=
Card
.
Defense
)
return
true
;
return
true
;
if
(
Card
.
IsDefense
()
&&
(
if
(
Card
.
IsDefense
()
&&
Card
.
IsCode
(
CardId
.
BlueEyesSpiritDragon
,
CardId
.
AzureEyesSilverDragon
))
Card
.
Id
==
CardId
.
BlueEyesSpiritDragon
||
Card
.
Id
==
CardId
.
AzureEyesSilverDragon
))
return
true
;
return
true
;
if
(
Card
.
IsAttack
()
&&
(
if
(
Card
.
IsAttack
()
&&
Card
.
IsCode
(
CardId
.
SageWithEyesOfBlue
,
CardId
.
WhiteStoneOfAncients
,
CardId
.
WhiteStoneOfLegend
))
Card
.
Id
==
CardId
.
SageWithEyesOfBlue
||
Card
.
Id
==
CardId
.
WhiteStoneOfAncients
||
Card
.
Id
==
CardId
.
WhiteStoneOfLegend
))
return
true
;
return
true
;
return
false
;
return
false
;
}
}
private
bool
SpellSet
()
private
bool
SpellSet
()
{
{
return
(
Card
.
IsTrap
()
||
(
Card
.
Id
==
CardId
.
SilversCry
))
&&
Bot
.
GetSpellCountWithoutField
()
<
4
;
return
(
Card
.
IsTrap
()
||
Card
.
IsCode
(
CardId
.
SilversCry
))
&&
Bot
.
GetSpellCountWithoutField
()
<
4
;
}
}
private
bool
HasTwoInHand
(
int
id
)
private
bool
HasTwoInHand
(
int
id
)
...
@@ -907,7 +900,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -907,7 +900,7 @@ namespace WindBot.Game.AI.Decks
int
num
=
0
;
int
num
=
0
;
foreach
(
ClientCard
card
in
Bot
.
Hand
)
foreach
(
ClientCard
card
in
Bot
.
Hand
)
{
{
if
(
card
!=
null
&&
card
.
I
d
==
id
)
if
(
card
!=
null
&&
card
.
I
sCode
(
id
)
)
num
++;
num
++;
}
}
return
num
>=
2
;
return
num
>=
2
;
...
...
Game/AI/Decks/BlueEyesMaxDragonExecutor.cs
View file @
f8435d17
This diff is collapsed.
Click to expand it.
Game/AI/Decks/BurnExecutor.cs
View file @
f8435d17
...
@@ -108,7 +108,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -108,7 +108,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
{
{
if
(
card
.
I
d
==
CardId
.
Marshmallon
||
card
.
Id
==
CardId
.
SpiritReaper
)
if
(
card
.
I
sCode
(
CardId
.
Marshmallon
,
CardId
.
SpiritReaper
)
)
{
{
return
false
;
return
false
;
}
}
...
@@ -134,9 +134,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -134,9 +134,9 @@ namespace WindBot.Game.AI.Decks
private
bool
ReposEverything
()
private
bool
ReposEverything
()
{
{
if
(
Card
.
I
d
==
CardId
.
ReflectBounder
)
if
(
Card
.
I
sCode
(
CardId
.
ReflectBounder
)
)
return
Card
.
IsDefense
();
return
Card
.
IsDefense
();
if
(
Card
.
I
d
==
CardId
.
FencingFireFerret
)
if
(
Card
.
I
sCode
(
CardId
.
FencingFireFerret
)
)
return
DefaultMonsterRepos
();
return
DefaultMonsterRepos
();
if
(
Card
.
IsAttack
())
if
(
Card
.
IsAttack
())
return
true
;
return
true
;
...
...
Game/AI/Decks/ChainBurnExecutor.cs
View file @
f8435d17
...
@@ -227,7 +227,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -227,7 +227,7 @@ namespace WindBot.Game.AI.Decks
{
{
return
(
id
==
CardId
.
SandaionTheTimelord
||
return
(
id
==
CardId
.
SandaionTheTimelord
||
id
==
CardId
.
BattleFader
||
id
==
CardId
.
BattleFader
||
id
==
CardId
.
MichionTimelord
id
==
CardId
.
MichionTimelord
);
);
}
}
bool
no_sp
=
false
;
bool
no_sp
=
false
;
...
@@ -322,49 +322,49 @@ namespace WindBot.Game.AI.Decks
...
@@ -322,49 +322,49 @@ namespace WindBot.Game.AI.Decks
IList
<
ClientCard
>
check
=
Bot
.
GetSpells
();
IList
<
ClientCard
>
check
=
Bot
.
GetSpells
();
foreach
(
ClientCard
card
in
check
)
foreach
(
ClientCard
card
in
check
)
{
{
if
(
card
.
I
d
==
CardId
.
AccuulatedFortune
)
if
(
card
.
I
sCode
(
CardId
.
AccuulatedFortune
)
)
HasAccuulatedFortune
++;
HasAccuulatedFortune
++;
}
}
foreach
(
ClientCard
card
in
check
)
foreach
(
ClientCard
card
in
check
)
{
{
if
(
card
.
I
d
==
CardId
.
SecretBlast
)
if
(
card
.
I
sCode
(
CardId
.
SecretBlast
)
)
blast_count
++;
blast_count
++;
}
}
foreach
(
ClientCard
card
in
check
)
foreach
(
ClientCard
card
in
check
)
{
{
if
(
card
.
I
d
==
CardId
.
SectetBarrel
)
if
(
card
.
I
sCode
(
CardId
.
SectetBarrel
)
)
barrel_count
++;
barrel_count
++;
}
}
foreach
(
ClientCard
card
in
check
)
foreach
(
ClientCard
card
in
check
)
{
{
if
(
card
.
I
d
==
CardId
.
JustDesserts
)
if
(
card
.
I
sCode
(
CardId
.
JustDesserts
)
)
just_count
++;
just_count
++;
}
}
foreach
(
ClientCard
card
in
check
)
foreach
(
ClientCard
card
in
check
)
{
{
if
(
card
.
I
d
==
CardId
.
ChainStrike
)
if
(
card
.
I
sCode
(
CardId
.
ChainStrike
)
)
strike_count
++;
strike_count
++;
}
}
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
{
{
if
(
card
.
I
d
==
CardId
.
RecklessGreed
)
if
(
card
.
I
sCode
(
CardId
.
RecklessGreed
)
)
greed_count
++;
greed_count
++;
}
}
foreach
(
ClientCard
card
in
check
)
foreach
(
ClientCard
card
in
check
)
{
{
if
(
card
.
I
d
==
CardId
.
Waboku
)
if
(
card
.
I
sCode
(
CardId
.
Waboku
)
)
Waboku_count
++;
Waboku_count
++;
}
}
foreach
(
ClientCard
card
in
check
)
foreach
(
ClientCard
card
in
check
)
{
{
if
(
card
.
I
d
==
CardId
.
ThreateningRoar
)
if
(
card
.
I
sCode
(
CardId
.
ThreateningRoar
)
)
Roar_count
++;
Roar_count
++;
}
}
...
@@ -418,7 +418,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -418,7 +418,7 @@ namespace WindBot.Game.AI.Decks
if
(
AI
.
Utils
.
IsChainTarget
(
Card
))
return
true
;
if
(
AI
.
Utils
.
IsChainTarget
(
Card
))
return
true
;
foreach
(
ClientCard
card
in
Enemy
.
GetSpells
())
foreach
(
ClientCard
card
in
Enemy
.
GetSpells
())
{
{
if
(
card
.
I
d
==
CardId
.
HarpiesFeatherDuster
&&
card
.
IsFaceup
())
if
(
card
.
I
sCode
(
CardId
.
HarpiesFeatherDuster
)
&&
card
.
IsFaceup
())
{
{
return
true
;
return
true
;
}
}
...
@@ -432,7 +432,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -432,7 +432,7 @@ namespace WindBot.Game.AI.Decks
}
}
private
bool
BrunSpellSet
()
private
bool
BrunSpellSet
()
{
{
if
(
Card
.
I
d
==
CardId
.
OjamaTrio
&&
Bot
.
HasInSpellZone
(
CardId
.
OjamaTrio
))
return
false
;
if
(
Card
.
I
sCode
(
CardId
.
OjamaTrio
)
&&
Bot
.
HasInSpellZone
(
CardId
.
OjamaTrio
))
return
false
;
return
(
Card
.
IsTrap
()
||
Card
.
HasType
(
CardType
.
QuickPlay
))
&&
Bot
.
GetSpellCountWithoutField
()
<
5
;
return
(
Card
.
IsTrap
()
||
Card
.
HasType
(
CardType
.
QuickPlay
))
&&
Bot
.
GetSpellCountWithoutField
()
<
5
;
}
}
private
bool
MichionTimelordsummon
()
private
bool
MichionTimelordsummon
()
...
@@ -565,7 +565,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -565,7 +565,7 @@ namespace WindBot.Game.AI.Decks
int
count
=
0
;
int
count
=
0
;
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
{
{
if
(
card
.
I
d
==
CardId
.
RecklessGreed
)
if
(
card
.
I
sCode
(
CardId
.
RecklessGreed
)
)
count
++;
count
++;
}
}
...
@@ -668,7 +668,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -668,7 +668,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
{
{
if
(
card
.
I
d
==
CardId
.
CardcarD
&&
card
.
IsFaceup
())
if
(
card
.
I
sCode
(
CardId
.
CardcarD
)
&&
card
.
IsFaceup
())
return
false
;
return
false
;
}
}
if
(
Bot
.
GetHandCount
()
==
1
&&
Bot
.
GetSpellCountWithoutField
()
<=
3
)
if
(
Bot
.
GetHandCount
()
==
1
&&
Bot
.
GetSpellCountWithoutField
()
<=
3
)
...
@@ -694,7 +694,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -694,7 +694,7 @@ namespace WindBot.Game.AI.Decks
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
{
{
if
(
card
.
I
d
==
CardId
.
DiceJar
&&
card
.
IsFacedown
())
if
(
card
.
I
sCode
(
CardId
.
DiceJar
)
&&
card
.
IsFacedown
())
return
true
;
return
true
;
break
;
break
;
}
}
...
@@ -725,24 +725,24 @@ namespace WindBot.Game.AI.Decks
...
@@ -725,24 +725,24 @@ namespace WindBot.Game.AI.Decks
if
(
GetTotalATK
(
newlist
)
/
2
>=
Enemy
.
LifePoints
&&
Bot
.
HasInSpellZone
(
CardId
.
BlazingMirrorForce
))
if
(
GetTotalATK
(
newlist
)
/
2
>=
Enemy
.
LifePoints
&&
Bot
.
HasInSpellZone
(
CardId
.
BlazingMirrorForce
))
return
false
;
return
false
;
if
(
AI
.
Utils
.
GetLastChainCard
()
==
null
)
return
true
;
if
(
AI
.
Utils
.
GetLastChainCard
()
==
null
)
return
true
;
if
(
AI
.
Utils
.
GetLastChainCard
().
I
d
==
CardId
.
Linkuriboh
)
return
false
;
if
(
AI
.
Utils
.
GetLastChainCard
().
I
sCode
(
CardId
.
Linkuriboh
)
)
return
false
;
return
true
;
return
true
;
}
}
public
bool
MonsterRepos
()
public
bool
MonsterRepos
()
{
{
if
(
Card
.
IsFacedown
()
&&
Card
.
Id
!=
CardId
.
DiceJar
)
if
(
Card
.
IsFacedown
()
&&
!
Card
.
IsCode
(
CardId
.
DiceJar
)
)
return
true
;
return
true
;
return
base
.
DefaultMonsterRepos
();
return
base
.
DefaultMonsterRepos
();
}
}
public
override
bool
OnPreBattleBetween
(
ClientCard
attacker
,
ClientCard
defender
)
public
override
bool
OnPreBattleBetween
(
ClientCard
attacker
,
ClientCard
defender
)
{
{
if
(
attacker
.
I
d
==
CardId
.
Linkuriboh
&&
defender
.
IsFacedown
())
return
false
;
if
(
attacker
.
I
sCode
(
CardId
.
Linkuriboh
)
&&
defender
.
IsFacedown
())
return
false
;
if
(
attacker
.
I
d
==
CardId
.
SandaionTheTimelord
&&
!
attacker
.
IsDisabled
())
if
(
attacker
.
I
sCode
(
CardId
.
SandaionTheTimelord
)
&&
!
attacker
.
IsDisabled
())
{
{
attacker
.
RealPower
=
9999
;
attacker
.
RealPower
=
9999
;
return
true
;
return
true
;
}
}
if
(
attacker
.
I
d
==
CardId
.
MichionTimelord
&&
!
attacker
.
IsDisabled
())
if
(
attacker
.
I
sCode
(
CardId
.
MichionTimelord
)
&&
!
attacker
.
IsDisabled
())
{
{
attacker
.
RealPower
=
9999
;
attacker
.
RealPower
=
9999
;
return
true
;
return
true
;
...
@@ -771,49 +771,49 @@ namespace WindBot.Game.AI.Decks
...
@@ -771,49 +771,49 @@ namespace WindBot.Game.AI.Decks
IList
<
ClientCard
>
check
=
Bot
.
GetSpells
();
IList
<
ClientCard
>
check
=
Bot
.
GetSpells
();
foreach
(
ClientCard
card1
in
check
)
foreach
(
ClientCard
card1
in
check
)
{
{
if
(
card1
.
I
d
==
CardId
.
AccuulatedFortune
)
if
(
card1
.
I
sCode
(
CardId
.
AccuulatedFortune
)
)
HasAccuulatedFortune
++;
HasAccuulatedFortune
++;
}
}
foreach
(
ClientCard
card1
in
check
)
foreach
(
ClientCard
card1
in
check
)
{
{
if
(
card1
.
I
d
==
CardId
.
SecretBlast
)
if
(
card1
.
I
sCode
(
CardId
.
SecretBlast
)
)
blast_count
++;
blast_count
++;
}
}
foreach
(
ClientCard
card1
in
check
)
foreach
(
ClientCard
card1
in
check
)
{
{
if
(
card1
.
I
d
==
CardId
.
SectetBarrel
)
if
(
card1
.
I
sCode
(
CardId
.
SectetBarrel
)
)
barrel_count
++;
barrel_count
++;
}
}
foreach
(
ClientCard
card1
in
check
)
foreach
(
ClientCard
card1
in
check
)
{
{
if
(
card1
.
I
d
==
CardId
.
JustDesserts
)
if
(
card1
.
I
sCode
(
CardId
.
JustDesserts
)
)
just_count
++;
just_count
++;
}
}
foreach
(
ClientCard
card1
in
check
)
foreach
(
ClientCard
card1
in
check
)
{
{
if
(
card1
.
I
d
==
CardId
.
ChainStrike
)
if
(
card1
.
I
sCode
(
CardId
.
ChainStrike
)
)
strike_count
++;
strike_count
++;
}
}
foreach
(
ClientCard
card1
in
Bot
.
GetSpells
())
foreach
(
ClientCard
card1
in
Bot
.
GetSpells
())
{
{
if
(
card1
.
I
d
==
CardId
.
RecklessGreed
)
if
(
card1
.
I
sCode
(
CardId
.
RecklessGreed
)
)
greed_count
++;
greed_count
++;
}
}
foreach
(
ClientCard
card1
in
check
)
foreach
(
ClientCard
card1
in
check
)
{
{
if
(
card1
.
I
d
==
CardId
.
Waboku
)
if
(
card1
.
I
sCode
(
CardId
.
Waboku
)
)
Waboku_count
++;
Waboku_count
++;
}
}
foreach
(
ClientCard
card1
in
check
)
foreach
(
ClientCard
card1
in
check
)
{
{
if
(
card1
.
I
d
==
CardId
.
ThreateningRoar
)
if
(
card1
.
I
sCode
(
CardId
.
ThreateningRoar
)
)
Roar_count
++;
Roar_count
++;
}
}
...
...
Game/AI/Decks/DarkMagicianExecutor.cs
View file @
f8435d17
This diff is collapsed.
Click to expand it.
Game/AI/Decks/DragunityExecutor.cs
View file @
f8435d17
...
@@ -136,7 +136,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -136,7 +136,7 @@ namespace WindBot.Game.AI.Decks
int
count
=
0
;
int
count
=
0
;
foreach
(
ClientCard
card
in
Bot
.
Hand
)
foreach
(
ClientCard
card
in
Bot
.
Hand
)
{
{
if
(
card
.
I
d
==
CardId
.
DragunityDux
)
if
(
card
.
I
sCode
(
CardId
.
DragunityDux
)
)
++
count
;
++
count
;
}
}
if
(
count
>=
2
)
if
(
count
>=
2
)
...
@@ -164,7 +164,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -164,7 +164,7 @@ namespace WindBot.Game.AI.Decks
/*bool hasRealMonster = false;
/*bool hasRealMonster = false;
foreach (ClientCard card in Bot.GetMonsters())
foreach (ClientCard card in Bot.GetMonsters())
{
{
if (
card.Id != CardId.AssaultBeast
)
if (
!card.IsCode(CardId.AssaultBeast)
)
{
{
hasRealMonster = true;
hasRealMonster = true;
break;
break;
...
@@ -184,13 +184,13 @@ namespace WindBot.Game.AI.Decks
...
@@ -184,13 +184,13 @@ namespace WindBot.Game.AI.Decks
int
remaining
=
3
;
int
remaining
=
3
;
foreach
(
ClientCard
card
in
Bot
.
Hand
)
foreach
(
ClientCard
card
in
Bot
.
Hand
)
if
(
card
.
I
d
==
needId
)
if
(
card
.
I
sCode
(
needId
)
)
remaining
--;
remaining
--;
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
if
(
card
.
I
d
==
needId
)
if
(
card
.
I
sCode
(
needId
)
)
remaining
--;
remaining
--;
foreach
(
ClientCard
card
in
Bot
.
Banished
)
foreach
(
ClientCard
card
in
Bot
.
Banished
)
if
(
card
.
I
d
==
needId
)
if
(
card
.
I
sCode
(
needId
)
)
remaining
--;
remaining
--;
if
(
remaining
<=
0
)
if
(
remaining
<=
0
)
return
false
;
return
false
;
...
@@ -262,8 +262,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -262,8 +262,7 @@ namespace WindBot.Game.AI.Decks
ClientCard
card
=
cards
[
i
];
ClientCard
card
=
cards
[
i
];
if
(
card
.
Attack
<
2000
)
if
(
card
.
Attack
<
2000
)
break
;
break
;
if
(
card
.
Id
==
(
int
)
CardId
.
StardustDragonAssaultMode
||
if
(
card
.
IsCode
(
CardId
.
StardustDragonAssaultMode
,
CardId
.
FiveHeadedDragon
))
card
.
Id
==
(
int
)
CardId
.
FiveHeadedDragon
)
continue
;
continue
;
if
(
card
.
IsMonster
())
if
(
card
.
IsMonster
())
{
{
...
@@ -298,7 +297,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -298,7 +297,7 @@ namespace WindBot.Game.AI.Decks
int
phalanxCount
=
0
;
int
phalanxCount
=
0
;
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
{
{
if
(
card
.
I
d
==
(
int
)
CardId
.
DragunityPhalanx
)
if
(
card
.
I
sCode
(
CardId
.
DragunityPhalanx
)
)
{
{
phalanxCount
++;
phalanxCount
++;
break
;
break
;
...
@@ -315,7 +314,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -315,7 +314,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
{
{
if
(
card
.
I
d
==
(
int
)
CardId
.
DragunityPhalanx
)
if
(
card
.
I
sCode
(
CardId
.
DragunityPhalanx
)
)
{
{
phalanxCount
--;
phalanxCount
--;
tributes
.
Add
(
card
);
tributes
.
Add
(
card
);
...
@@ -462,7 +461,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -462,7 +461,7 @@ namespace WindBot.Game.AI.Decks
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
foreach
(
ClientCard
monster
in
monsters
)
{
{
if
(
monster
.
I
d
==
CardId
.
StardustDragon
&&
monster
.
Attacked
)
if
(
monster
.
I
sCode
(
CardId
.
StardustDragon
)
&&
monster
.
Attacked
)
{
{
AI
.
SelectCard
(
monster
);
AI
.
SelectCard
(
monster
);
return
true
;
return
true
;
...
...
Game/AI/Decks/FrogExecutor.cs
View file @
f8435d17
...
@@ -147,7 +147,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -147,7 +147,7 @@ namespace WindBot.Game.AI.Decks
if
(
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
atk
,
true
))
if
(
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
atk
,
true
))
return
false
;
return
false
;
if
(
Card
.
I
d
==
CardId
.
SwapFrog
)
if
(
Card
.
I
sCode
(
CardId
.
SwapFrog
)
)
m_swapFrogSummoned
=
Duel
.
Turn
;
m_swapFrogSummoned
=
Duel
.
Turn
;
return
true
;
return
true
;
}
}
...
@@ -200,7 +200,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -200,7 +200,7 @@ namespace WindBot.Game.AI.Decks
List
<
ClientCard
>
spells
=
Bot
.
GetSpells
();
List
<
ClientCard
>
spells
=
Bot
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
foreach
(
ClientCard
spell
in
spells
)
{
{
if
(
spell
.
I
d
==
CardId
.
GravityBind
&&
!
spell
.
IsFacedown
())
if
(
spell
.
I
sCode
(
CardId
.
GravityBind
)
&&
!
spell
.
IsFacedown
())
return
false
;
return
false
;
}
}
return
true
;
return
true
;
...
@@ -208,9 +208,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -208,9 +208,9 @@ namespace WindBot.Game.AI.Decks
private
bool
FrogMonsterRepos
()
private
bool
FrogMonsterRepos
()
{
{
if
(
Card
.
I
d
==
CardId
.
Unifrog
)
if
(
Card
.
I
sCode
(
CardId
.
Unifrog
)
)
return
Card
.
IsDefense
();
return
Card
.
IsDefense
();
if
(
Card
.
I
d
==
CardId
.
DewdarkOfTheIceBarrier
)
if
(
Card
.
I
sCode
(
CardId
.
DewdarkOfTheIceBarrier
)
)
return
Card
.
IsDefense
();
return
Card
.
IsDefense
();
bool
enemyBetter
=
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
Card
.
Attack
+
(
Card
.
IsFacedown
()
?
GetSpellBonus
()
:
0
),
true
);
bool
enemyBetter
=
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
Card
.
Attack
+
(
Card
.
IsFacedown
()
?
GetSpellBonus
()
:
0
),
true
);
...
@@ -222,10 +222,10 @@ namespace WindBot.Game.AI.Decks
...
@@ -222,10 +222,10 @@ namespace WindBot.Game.AI.Decks
if
(
Card
.
IsDefense
()
&&
!
enemyBetter
)
if
(
Card
.
IsDefense
()
&&
!
enemyBetter
)
result
=
true
;
result
=
true
;
if
(!
result
&&
Card
.
I
d
==
CardId
.
FlipFlopFrog
&&
Enemy
.
GetMonsterCount
()
>
0
&&
Card
.
IsFacedown
())
if
(!
result
&&
Card
.
I
sCode
(
CardId
.
FlipFlopFrog
)
&&
Enemy
.
GetMonsterCount
()
>
0
&&
Card
.
IsFacedown
())
result
=
true
;
result
=
true
;
if
(
Card
.
I
d
==
CardId
.
FlipFlopFrog
&&
Card
.
IsFacedown
()
&&
result
)
if
(
Card
.
I
sCode
(
CardId
.
FlipFlopFrog
)
&&
Card
.
IsFacedown
()
&&
result
)
m_flipFlopFrogSummoned
=
Duel
.
Turn
;
m_flipFlopFrogSummoned
=
Duel
.
Turn
;
return
result
;
return
result
;
...
@@ -242,7 +242,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -242,7 +242,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
{
{
if
(
card
.
I
d
==
CardId
.
Solidarity
)
if
(
card
.
I
sCode
(
CardId
.
Solidarity
)
)
atk
+=
800
;
atk
+=
800
;
}
}
}
}
...
...
Game/AI/Decks/GrenMajuThunderBoarderExecutor.cs
View file @
f8435d17
...
@@ -251,21 +251,21 @@ namespace WindBot.Game.AI.Decks
...
@@ -251,21 +251,21 @@ namespace WindBot.Game.AI.Decks
private
bool
DarkBribeeff
()
private
bool
DarkBribeeff
()
{
{
if
(
AI
.
Utils
.
GetLastChainCard
()!=
null
&&
AI
.
Utils
.
GetLastChainCard
().
I
d
==
CardId
.
UpstartGoblin
)
if
(
AI
.
Utils
.
GetLastChainCard
()!=
null
&&
AI
.
Utils
.
GetLastChainCard
().
I
sCode
(
CardId
.
UpstartGoblin
)
)
return
false
;
return
false
;
return
true
;
return
true
;
}
}
private
bool
ImperialOrderfirst
()
private
bool
ImperialOrderfirst
()
{
{
if
(
AI
.
Utils
.
GetLastChainCard
()
!=
null
&&
AI
.
Utils
.
GetLastChainCard
().
I
d
==
CardId
.
UpstartGoblin
)
if
(
AI
.
Utils
.
GetLastChainCard
()
!=
null
&&
AI
.
Utils
.
GetLastChainCard
().
I
sCode
(
CardId
.
UpstartGoblin
)
)
return
false
;
return
false
;
return
DefaultOnBecomeTarget
()
&&
AI
.
Utils
.
GetLastChainCard
().
HasType
(
CardType
.
Spell
);
return
DefaultOnBecomeTarget
()
&&
AI
.
Utils
.
GetLastChainCard
().
HasType
(
CardType
.
Spell
);
}
}
private
bool
ImperialOrdereff
()
private
bool
ImperialOrdereff
()
{
{
if
(
AI
.
Utils
.
GetLastChainCard
()
!=
null
&&
AI
.
Utils
.
GetLastChainCard
().
I
d
==
CardId
.
UpstartGoblin
)
if
(
AI
.
Utils
.
GetLastChainCard
()
!=
null
&&
AI
.
Utils
.
GetLastChainCard
().
I
sCode
(
CardId
.
UpstartGoblin
)
)
return
false
;
return
false
;
if
(
Duel
.
LastChainPlayer
==
1
)
if
(
Duel
.
LastChainPlayer
==
1
)
{
{
...
@@ -437,7 +437,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -437,7 +437,7 @@ namespace WindBot.Game.AI.Decks
IList
<
ClientCard
>
material_list
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
material_list
=
new
List
<
ClientCard
>();
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
{
{
if
(
monster
.
I
d
==
CardId
.
MissusRadiant
||
monster
.
Id
==
CardId
.
LinkSpider
||
monster
.
Id
==
CardId
.
Linkuriboh
)
if
(
monster
.
I
sCode
(
CardId
.
MissusRadiant
,
CardId
.
LinkSpider
,
CardId
.
Linkuriboh
)
)
material_list
.
Add
(
monster
);
material_list
.
Add
(
monster
);
if
(
material_list
.
Count
==
3
)
break
;
if
(
material_list
.
Count
==
3
)
break
;
}
}
...
@@ -454,10 +454,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -454,10 +454,7 @@ namespace WindBot.Game.AI.Decks
IList
<
ClientCard
>
material_list
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
material_list
=
new
List
<
ClientCard
>();
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
{
{
if
((
monster
.
Id
==
CardId
.
MissusRadiant
||
if
(
monster
.
IsCode
(
CardId
.
MissusRadiant
,
CardId
.
LinkSpider
,
CardId
.
Linkuriboh
))
monster
.
Id
==
CardId
.
LinkSpider
||
monster
.
Id
==
CardId
.
Linkuriboh
)&&
monster
.
Id
!=
CardId
.
EaterOfMillions
)
material_list
.
Add
(
monster
);
material_list
.
Add
(
monster
);
if
(
material_list
.
Count
==
3
)
break
;
if
(
material_list
.
Count
==
3
)
break
;
}
}
...
@@ -559,7 +556,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -559,7 +556,7 @@ namespace WindBot.Game.AI.Decks
IList
<
ClientCard
>
material_list
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
material_list
=
new
List
<
ClientCard
>();
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
{
{
if
(
monster
.
HasAttribute
(
CardAttribute
.
Earth
)
&&
monster
.
Level
==
1
&&
monster
.
Id
!=
CardId
.
EaterOfMillions
)
if
(
monster
.
HasAttribute
(
CardAttribute
.
Earth
)
&&
monster
.
Level
==
1
&&
!
monster
.
IsCode
(
CardId
.
EaterOfMillions
)
)
material_list
.
Add
(
monster
);
material_list
.
Add
(
monster
);
if
(
material_list
.
Count
==
2
)
break
;
if
(
material_list
.
Count
==
2
)
break
;
}
}
...
@@ -587,7 +584,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -587,7 +584,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
c
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
c
in
Bot
.
GetMonsters
())
{
{
if
(
c
.
Id
!=
CardId
.
EaterOfMillions
&&
c
.
Id
!=
CardId
.
Linkuriboh
&&
c
.
Level
==
1
)
if
(
!
c
.
IsCode
(
CardId
.
EaterOfMillions
,
CardId
.
Linkuriboh
)
&&
c
.
Level
==
1
)
{
{
AI
.
SelectMaterials
(
c
);
AI
.
SelectMaterials
(
c
);
return
true
;
return
true
;
...
@@ -598,12 +595,12 @@ namespace WindBot.Game.AI.Decks
...
@@ -598,12 +595,12 @@ namespace WindBot.Game.AI.Decks
private
bool
Linkuriboheff
()
private
bool
Linkuriboheff
()
{
{
if
(
Duel
.
LastChainPlayer
==
0
&&
AI
.
Utils
.
GetLastChainCard
().
I
d
==
CardId
.
Linkuriboh
)
return
false
;
if
(
Duel
.
LastChainPlayer
==
0
&&
AI
.
Utils
.
GetLastChainCard
().
I
sCode
(
CardId
.
Linkuriboh
)
)
return
false
;
return
true
;
return
true
;
}
}
private
bool
MonsterRepos
()
private
bool
MonsterRepos
()
{
{
if
(
Card
.
I
d
==
CardId
.
EaterOfMillions
&&
Card
.
IsAttack
())
return
false
;
if
(
Card
.
I
sCode
(
CardId
.
EaterOfMillions
)
&&
Card
.
IsAttack
())
return
false
;
return
DefaultMonsterRepos
();
return
DefaultMonsterRepos
();
}
}
...
@@ -612,29 +609,29 @@ namespace WindBot.Game.AI.Decks
...
@@ -612,29 +609,29 @@ namespace WindBot.Game.AI.Decks
int
count
=
0
;
int
count
=
0
;
foreach
(
ClientCard
check
in
Bot
.
Hand
)
foreach
(
ClientCard
check
in
Bot
.
Hand
)
{
{
if
(
check
.
I
d
==
CardId
.
CardOfDemise
)
if
(
check
.
I
sCode
(
CardId
.
CardOfDemise
)
)
count
++;
count
++;
}
}
if
(
count
==
2
&&
Bot
.
Hand
.
Count
==
2
&&
Bot
.
GetSpellCountWithoutField
()
<=
2
)
if
(
count
==
2
&&
Bot
.
Hand
.
Count
==
2
&&
Bot
.
GetSpellCountWithoutField
()
<=
2
)
return
true
;
return
true
;
if
(
Card
.
I
d
==
CardId
.
MacroCosmos
&&
Bot
.
HasInSpellZone
(
CardId
.
MacroCosmos
))
return
false
;
if
(
Card
.
I
sCode
(
CardId
.
MacroCosmos
)
&&
Bot
.
HasInSpellZone
(
CardId
.
MacroCosmos
))
return
false
;
if
(
Card
.
I
d
==
CardId
.
AntiSpellFragrance
&&
Bot
.
HasInSpellZone
(
CardId
.
AntiSpellFragrance
))
return
false
;
if
(
Card
.
I
sCode
(
CardId
.
AntiSpellFragrance
)
&&
Bot
.
HasInSpellZone
(
CardId
.
AntiSpellFragrance
))
return
false
;
if
(
CardOfDemiseeff_used
)
return
true
;
if
(
CardOfDemiseeff_used
)
return
true
;
if
(
Card
.
I
d
==
CardId
.
EvenlyMatched
&&
(
Enemy
.
GetFieldCount
()
-
Bot
.
GetFieldCount
())
<
0
)
return
false
;
if
(
Card
.
I
sCode
(
CardId
.
EvenlyMatched
)
&&
(
Enemy
.
GetFieldCount
()
-
Bot
.
GetFieldCount
())
<
0
)
return
false
;
if
(
Card
.
I
d
==
CardId
.
AntiSpellFragrance
&&
Bot
.
HasInSpellZone
(
CardId
.
AntiSpellFragrance
))
return
false
;
if
(
Card
.
I
sCode
(
CardId
.
AntiSpellFragrance
)
&&
Bot
.
HasInSpellZone
(
CardId
.
AntiSpellFragrance
))
return
false
;
if
(
Card
.
I
d
==
CardId
.
MacroCosmos
&&
Bot
.
HasInSpellZone
(
CardId
.
MacroCosmos
))
return
false
;
if
(
Card
.
I
sCode
(
CardId
.
MacroCosmos
)
&&
Bot
.
HasInSpellZone
(
CardId
.
MacroCosmos
))
return
false
;
if
(
Duel
.
Turn
>
1
&&
Duel
.
Phase
==
DuelPhase
.
Main1
&&
Bot
.
HasAttackingMonster
())
if
(
Duel
.
Turn
>
1
&&
Duel
.
Phase
==
DuelPhase
.
Main1
&&
Bot
.
HasAttackingMonster
())
return
false
;
return
false
;
if
(
Card
.
I
d
==
CardId
.
InfiniteImpermanence
)
if
(
Card
.
I
sCode
(
CardId
.
InfiniteImpermanence
)
)
return
Bot
.
GetFieldCount
()
>
0
&&
Bot
.
GetSpellCountWithoutField
()
<
4
;
return
Bot
.
GetFieldCount
()
>
0
&&
Bot
.
GetSpellCountWithoutField
()
<
4
;
if
(
Card
.
I
d
==
CardId
.
Scapegoat
)
if
(
Card
.
I
sCode
(
CardId
.
Scapegoat
)
)
return
true
;
return
true
;
if
(
Card
.
HasType
(
CardType
.
Trap
))
if
(
Card
.
HasType
(
CardType
.
Trap
))
return
Bot
.
GetSpellCountWithoutField
()
<
4
;
return
Bot
.
GetSpellCountWithoutField
()
<
4
;
if
(
Bot
.
HasInSpellZone
(
CardId
.
AntiSpellFragrance
,
true
))
if
(
Bot
.
HasInSpellZone
(
CardId
.
AntiSpellFragrance
,
true
))
{
{
if
(
Card
.
I
d
==
CardId
.
UpstartGoblin
||
Card
.
Id
==
CardId
.
PotOfDesires
||
Card
.
Id
==
CardId
.
PotOfDuality
)
return
true
;
if
(
Card
.
I
sCode
(
CardId
.
UpstartGoblin
,
CardId
.
PotOfDesires
,
CardId
.
PotOfDuality
)
)
return
true
;
if
(
Card
.
I
d
==
CardId
.
CardOfDemise
&&
Bot
.
HasInSpellZone
(
CardId
.
CardOfDemise
))
return
false
;
if
(
Card
.
I
sCode
(
CardId
.
CardOfDemise
)
&&
Bot
.
HasInSpellZone
(
CardId
.
CardOfDemise
))
return
false
;
if
(
Card
.
HasType
(
CardType
.
Spell
))
if
(
Card
.
HasType
(
CardType
.
Spell
))
return
Bot
.
GetSpellCountWithoutField
()
<
4
;
return
Bot
.
GetSpellCountWithoutField
()
<
4
;
}
}
...
@@ -642,12 +639,12 @@ namespace WindBot.Game.AI.Decks
...
@@ -642,12 +639,12 @@ namespace WindBot.Game.AI.Decks
}
}
public
override
bool
OnPreBattleBetween
(
ClientCard
attacker
,
ClientCard
defender
)
public
override
bool
OnPreBattleBetween
(
ClientCard
attacker
,
ClientCard
defender
)
{
{
if
(
attacker
.
I
d
==
_CardId
.
EaterOfMillions
&&
(
Bot
.
HasInMonstersZone
(
CardId
.
InspectBoarder
)
&&
eater_eff
)
&&
!
attacker
.
IsDisabled
())
if
(
attacker
.
I
sCode
(
_CardId
.
EaterOfMillions
)
&&
(
Bot
.
HasInMonstersZone
(
CardId
.
InspectBoarder
)
&&
eater_eff
)
&&
!
attacker
.
IsDisabled
())
{
{
attacker
.
RealPower
=
9999
;
attacker
.
RealPower
=
9999
;
return
true
;
return
true
;
}
}
if
(
attacker
.
I
d
==
_CardId
.
EaterOfMillions
&&
!
Bot
.
HasInMonstersZone
(
CardId
.
InspectBoarder
)
&&
!
attacker
.
IsDisabled
())
if
(
attacker
.
I
sCode
(
_CardId
.
EaterOfMillions
)
&&
!
Bot
.
HasInMonstersZone
(
CardId
.
InspectBoarder
)
&&
!
attacker
.
IsDisabled
())
{
{
attacker
.
RealPower
=
9999
;
attacker
.
RealPower
=
9999
;
return
true
;
return
true
;
...
@@ -659,7 +656,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -659,7 +656,7 @@ namespace WindBot.Game.AI.Decks
for
(
int
i
=
0
;
i
<
attackers
.
Count
;
++
i
)
for
(
int
i
=
0
;
i
<
attackers
.
Count
;
++
i
)
{
{
ClientCard
attacker
=
attackers
[
i
];
ClientCard
attacker
=
attackers
[
i
];
if
(
attacker
.
I
d
==
CardId
.
BirrelswordDragon
||
attacker
.
Id
==
CardId
.
EaterOfMillions
)
return
attacker
;
if
(
attacker
.
I
sCode
(
CardId
.
BirrelswordDragon
,
CardId
.
EaterOfMillions
)
)
return
attacker
;
}
}
return
null
;
return
null
;
}
}
...
...
Game/AI/Decks/HorusExecutor.cs
View file @
f8435d17
...
@@ -79,7 +79,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -79,7 +79,7 @@ namespace WindBot.Game.AI.Decks
return
false
;
return
false
;
int
remaining
=
2
;
int
remaining
=
2
;
foreach
(
ClientCard
card
in
Bot
.
Banished
)
foreach
(
ClientCard
card
in
Bot
.
Banished
)
if
(
card
.
I
d
==
CardId
.
WhiteNightDragon
)
if
(
card
.
I
sCode
(
CardId
.
WhiteNightDragon
)
)
remaining
--;
remaining
--;
if
(
remaining
>
0
)
if
(
remaining
>
0
)
{
{
...
@@ -154,7 +154,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -154,7 +154,7 @@ namespace WindBot.Game.AI.Decks
// We should summon Horus the Black Flame Dragon LV6 if he can lvlup.
// We should summon Horus the Black Flame Dragon LV6 if he can lvlup.
if
(
Enemy
.
GetMonsterCount
()
!=
0
&&
!
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2300
-
1
,
false
))
if
(
Enemy
.
GetMonsterCount
()
!=
0
&&
!
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2300
-
1
,
false
))
foreach
(
ClientCard
card
in
Main
.
SummonableCards
)
foreach
(
ClientCard
card
in
Main
.
SummonableCards
)
if
(
card
.
I
d
==
11224103
)
if
(
card
.
I
sCode
(
11224103
)
)
return
false
;
return
false
;
return
DefaultTributeSummon
();
return
DefaultTributeSummon
();
...
@@ -197,7 +197,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -197,7 +197,7 @@ namespace WindBot.Game.AI.Decks
ClientCard
monster
=
cards
[
i
];
ClientCard
monster
=
cards
[
i
];
if
(
monster
.
Attack
<
2300
)
if
(
monster
.
Attack
<
2300
)
return
false
;
return
false
;
if
(
monster
.
Race
==
(
int
)
CardRace
.
Dragon
&&
monster
.
Id
!=
CardId
.
HorusTheBlackFlameDragonLv8
)
if
(
monster
.
Race
==
(
int
)
CardRace
.
Dragon
&&
!
monster
.
IsCode
(
CardId
.
HorusTheBlackFlameDragonLv8
)
)
{
{
summonCard
=
monster
;
summonCard
=
monster
;
break
;
break
;
...
...
Game/AI/Decks/LightswornExecutor.cs
View file @
f8435d17
...
@@ -110,7 +110,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -110,7 +110,7 @@ namespace WindBot.Game.AI.Decks
IList
<
ClientCard
>
result
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
result
=
new
List
<
ClientCard
>();
foreach
(
ClientCard
card
in
cards
)
foreach
(
ClientCard
card
in
cards
)
{
{
if
(!
result
.
Contains
(
card
)
&&
(!
ClownUsed
||
card
.
Id
!=
CardId
.
PerformageTrickClown
))
if
(!
result
.
Contains
(
card
)
&&
(!
ClownUsed
||
!
card
.
IsCode
(
CardId
.
PerformageTrickClown
)
))
result
.
Add
(
card
);
result
.
Add
(
card
);
if
(
result
.
Count
>=
max
)
if
(
result
.
Count
>=
max
)
break
;
break
;
...
...
Game/AI/Decks/LightswornShaddoldinosourExecutor.cs
View file @
f8435d17
...
@@ -390,7 +390,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -390,7 +390,7 @@ namespace WindBot.Game.AI.Decks
Pillused
=
true
;
Pillused
=
true
;
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
{
{
if
(
card
.
I
d
==
CardId
.
UltimateConductorTytanno
&&
card
.
IsFaceup
())
if
(
card
.
I
sCode
(
CardId
.
UltimateConductorTytanno
)
&&
card
.
IsFaceup
())
return
false
;
return
false
;
}
}
Ultimate_ss
++;
Ultimate_ss
++;
...
@@ -410,12 +410,12 @@ namespace WindBot.Game.AI.Decks
...
@@ -410,12 +410,12 @@ namespace WindBot.Game.AI.Decks
private
bool
MonsterRepos
()
private
bool
MonsterRepos
()
{
{
if
(
Card
.
I
d
==
CardId
.
UltimateConductorTytanno
&&
Card
.
IsFacedown
())
return
true
;
if
(
Card
.
I
sCode
(
CardId
.
UltimateConductorTytanno
)
&&
Card
.
IsFacedown
())
return
true
;
if
(
Card
.
I
d
==
CardId
.
ElShaddollConstruct
&&
Card
.
IsFacedown
())
return
true
;
if
(
Card
.
I
sCode
(
CardId
.
ElShaddollConstruct
)
&&
Card
.
IsFacedown
())
return
true
;
if
(
Card
.
I
d
==
CardId
.
ElShaddollConstruct
&&
Card
.
IsAttack
())
return
false
;
if
(
Card
.
I
sCode
(
CardId
.
ElShaddollConstruct
)
&&
Card
.
IsAttack
())
return
false
;
if
(
Card
.
I
d
==
CardId
.
GlowUpBulb
&&
Card
.
IsDefense
())
return
false
;
if
(
Card
.
I
sCode
(
CardId
.
GlowUpBulb
)
&&
Card
.
IsDefense
())
return
false
;
if
(
Card
.
I
d
==
CardId
.
ShaddollDragon
&&
Card
.
IsFacedown
()
&&
Enemy
.
GetMonsterCount
()
>=
0
)
return
true
;
if
(
Card
.
I
sCode
(
CardId
.
ShaddollDragon
)
&&
Card
.
IsFacedown
()
&&
Enemy
.
GetMonsterCount
()
>=
0
)
return
true
;
if
(
Card
.
I
d
==
CardId
.
ShaddollSquamata
&&
Card
.
IsFacedown
()
&&
Enemy
.
GetMonsterCount
()
>=
0
)
return
true
;
if
(
Card
.
I
sCode
(
CardId
.
ShaddollSquamata
)
&&
Card
.
IsFacedown
()
&&
Enemy
.
GetMonsterCount
()
>=
0
)
return
true
;
return
base
.
DefaultMonsterRepos
();
return
base
.
DefaultMonsterRepos
();
}
}
...
@@ -430,7 +430,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -430,7 +430,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
{
{
if
(
card
.
I
d
==
CardId
.
UltimateConductorTytanno
&&
card
.
IsFaceup
())
if
(
card
.
I
sCode
(
CardId
.
UltimateConductorTytanno
)
&&
card
.
IsFaceup
())
return
false
;
return
false
;
}
}
if
(
Pillused
==
true
)
return
false
;
if
(
Pillused
==
true
)
return
false
;
...
@@ -552,7 +552,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -552,7 +552,7 @@ namespace WindBot.Game.AI.Decks
IList
<
ClientCard
>
all
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
all
=
new
List
<
ClientCard
>();
foreach
(
ClientCard
check
in
grave
)
foreach
(
ClientCard
check
in
grave
)
{
{
if
(
check
.
I
d
==
CardId
.
GiantRex
)
if
(
check
.
I
sCode
(
CardId
.
GiantRex
)
)
{
{
all
.
Add
(
check
);
all
.
Add
(
check
);
}
}
...
@@ -1030,8 +1030,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -1030,8 +1030,8 @@ namespace WindBot.Game.AI.Decks
public
bool
Hand_act_eff
()
public
bool
Hand_act_eff
()
{
{
//if (Card.I
d == CardId.Urara
&& Bot.HasInHand(CardId.LockBird) && Bot.HasInSpellZone(CardId.Re)) return false;
//if (Card.I
sCode(CardId.Urara)
&& Bot.HasInHand(CardId.LockBird) && Bot.HasInSpellZone(CardId.Re)) return false;
if
(
Card
.
I
d
==
CardId
.
GhostOgre
&&
Card
.
Location
==
CardLocation
.
Hand
&&
Bot
.
HasInMonstersZone
(
CardId
.
GhostOgre
))
return
false
;
if
(
Card
.
I
sCode
(
CardId
.
GhostOgre
)
&&
Card
.
Location
==
CardLocation
.
Hand
&&
Bot
.
HasInMonstersZone
(
CardId
.
GhostOgre
))
return
false
;
return
(
Duel
.
LastChainPlayer
==
1
);
return
(
Duel
.
LastChainPlayer
==
1
);
}
}
//other extra
//other extra
...
@@ -1128,14 +1128,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -1128,14 +1128,8 @@ namespace WindBot.Game.AI.Decks
};
};
int
count
=
0
;
int
count
=
0
;
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
if
(
monster
.
Id
==
CardId
.
GlowUpBulb
||
if
(
monster
.
IsCode
(
CardId
.
GlowUpBulb
,
CardId
.
FairyTailSnow
,
CardId
.
KeeperOfDragonicMagic
,
monster
.
Id
==
CardId
.
FairyTailSnow
||
CardId
.
SouleatingOviraptor
,
CardId
.
GiantRex
,
CardId
.
Lumina
,
CardId
.
Raiden
))
monster
.
Id
==
CardId
.
KeeperOfDragonicMagic
||
monster
.
Id
==
CardId
.
SouleatingOviraptor
||
monster
.
Id
==
CardId
.
GiantRex
||
monster
.
Id
==
CardId
.
Lumina
||
monster
.
Id
==
CardId
.
Raiden
)
count
++;
count
++;
if
(!
Bot
.
HasInMonstersZone
(
CardId
.
GlowUpBulb
)
||
count
<
2
)
if
(!
Bot
.
HasInMonstersZone
(
CardId
.
GlowUpBulb
)
||
count
<
2
)
return
false
;
return
false
;
...
@@ -1150,7 +1144,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -1150,7 +1144,7 @@ namespace WindBot.Game.AI.Decks
bool
DarkHole
=
false
;
bool
DarkHole
=
false
;
foreach
(
ClientCard
card
in
Enemy
.
GetSpells
())
foreach
(
ClientCard
card
in
Enemy
.
GetSpells
())
{
{
if
(
card
.
I
d
==
53129443
&&
card
.
IsFaceup
())
if
(
card
.
I
sCode
(
53129443
)
&&
card
.
IsFaceup
())
{
{
DarkHole
=
true
;
DarkHole
=
true
;
}
}
...
@@ -1222,12 +1216,12 @@ namespace WindBot.Game.AI.Decks
...
@@ -1222,12 +1216,12 @@ namespace WindBot.Game.AI.Decks
{
{
foreach (ClientCard hand in Bot.Hand)
foreach (ClientCard hand in Bot.Hand)
{
{
if (hand.I
d == CardId.Red || hand.Id == CardId.Pink
)
if (hand.I
sCode(CardId.Red, CardId.Pink)
)
{
{
AI.SelectCard(hand);
AI.SelectCard(hand);
return true;
return true;
}
}
if (hand.I
d == CardId.Urara || hand.Id == CardId.Ghost
)
if (hand.I
sCode(CardId.Urara, CardId.Ghost)
)
{
{
if (Tuner_ss())
if (Tuner_ss())
{
{
...
@@ -1304,9 +1298,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -1304,9 +1298,9 @@ namespace WindBot.Game.AI.Decks
{
{
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
())
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
())
{
{
if
(
attacker
.
I
d
==
CardId
.
ElShaddollConstruct
&&
!
attacker
.
IsDisabled
())
// TODO: && defender.IsSpecialSummoned
if
(
attacker
.
I
sCode
(
CardId
.
ElShaddollConstruct
)
&&
!
attacker
.
IsDisabled
())
// TODO: && defender.IsSpecialSummoned
attacker
.
RealPower
=
9999
;
attacker
.
RealPower
=
9999
;
if
(
attacker
.
I
d
==
CardId
.
UltimateConductorTytanno
&&
!
attacker
.
IsDisabled
()
&&
defender
.
IsDefense
())
if
(
attacker
.
I
sCode
(
CardId
.
UltimateConductorTytanno
)
&&
!
attacker
.
IsDisabled
()
&&
defender
.
IsDefense
())
attacker
.
RealPower
=
9999
;
attacker
.
RealPower
=
9999
;
}
}
return
base
.
OnPreBattleBetween
(
attacker
,
defender
);
return
base
.
OnPreBattleBetween
(
attacker
,
defender
);
...
...
Game/AI/Decks/NekrozExecutor.cs
View file @
f8435d17
...
@@ -106,9 +106,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -106,9 +106,9 @@ namespace WindBot.Game.AI.Decks
if
(!
Bot
.
HasInHand
(
NekrozRituelCard
)
||
Bot
.
HasInHand
(
CardId
.
Shurit
)
||
!
Bot
.
HasInHand
(
NekrozSpellCard
))
if
(!
Bot
.
HasInHand
(
NekrozRituelCard
)
||
Bot
.
HasInHand
(
CardId
.
Shurit
)
||
!
Bot
.
HasInHand
(
NekrozSpellCard
))
return
true
;
return
true
;
foreach
(
ClientCard
Card
in
Bot
.
Hand
)
foreach
(
ClientCard
Card
in
Bot
.
Hand
)
if
(
Card
!=
null
&&
Card
.
I
d
==
CardId
.
Kaleidoscope
&&
!
Bot
.
HasInHand
(
CardId
.
Unicore
))
if
(
Card
!=
null
&&
Card
.
I
sCode
(
CardId
.
Kaleidoscope
)
&&
!
Bot
.
HasInHand
(
CardId
.
Unicore
))
return
true
;
return
true
;
else
if
(
Card
.
I
d
==
CardId
.
Trishula
||
Card
.
Id
==
CardId
.
DecisiveArmor
&&
!
Bot
.
HasInHand
(
CardId
.
Mirror
)
||
!
Bot
.
HasInHand
(
CardId
.
Shurit
))
else
if
(
Card
.
I
sCode
(
CardId
.
Trishula
)
||
Card
.
IsCode
(
CardId
.
DecisiveArmor
)
&&
!
Bot
.
HasInHand
(
CardId
.
Mirror
)
||
!
Bot
.
HasInHand
(
CardId
.
Shurit
))
return
true
;
return
true
;
return
false
;
return
false
;
}
}
...
@@ -271,9 +271,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -271,9 +271,9 @@ namespace WindBot.Game.AI.Decks
List
<
int
>
NekrozCard
=
new
List
<
int
>();
List
<
int
>
NekrozCard
=
new
List
<
int
>();
try
try
{
{
foreach
(
ClientCard
C
ard
in
Bot
.
Hand
)
foreach
(
ClientCard
c
ard
in
Bot
.
Hand
)
if
(
Card
!=
null
&&
NekrozRituelCard
.
Contains
((
int
)
Card
.
I
d
))
if
(
card
!=
null
&&
card
.
IsCode
(
NekrozRituelCar
d
))
NekrozCard
.
Add
(
C
ard
.
Id
);
NekrozCard
.
Add
(
c
ard
.
Id
);
foreach
(
int
Id
in
NekrozCard
)
foreach
(
int
Id
in
NekrozCard
)
{
{
...
...
Game/AI/Decks/PhantasmExecutor.cs
View file @
f8435d17
...
@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks
}
}
if
(
AI
.
Utils
.
GetProblematicEnemyCard
(
9999
,
true
)!=
null
)
if
(
AI
.
Utils
.
GetProblematicEnemyCard
(
9999
,
true
)!=
null
)
{
{
if
(
AI
.
Utils
.
GetProblematicEnemyCard
(
9999
,
true
).
I
d
==
CardId
.
ElShaddollWinda
&&
if
(
AI
.
Utils
.
GetProblematicEnemyCard
(
9999
,
true
).
I
sCode
(
CardId
.
ElShaddollWinda
)
&&
!
AI
.
Utils
.
GetProblematicEnemyCard
(
9999
,
true
).
IsDisabled
())
!
AI
.
Utils
.
GetProblematicEnemyCard
(
9999
,
true
).
IsDisabled
())
return
false
;
return
false
;
AI
.
SelectCard
(
AI
.
Utils
.
GetProblematicEnemyCard
(
9999
,
true
));
AI
.
SelectCard
(
AI
.
Utils
.
GetProblematicEnemyCard
(
9999
,
true
));
...
@@ -349,7 +349,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -349,7 +349,7 @@ namespace WindBot.Game.AI.Decks
ClientCard
target
=
null
;
ClientCard
target
=
null
;
foreach
(
ClientCard
s
in
Bot
.
GetSpells
())
foreach
(
ClientCard
s
in
Bot
.
GetSpells
())
{
{
if
(
s
.
I
d
==
CardId
.
SeaStealthAttack
&&
Card
.
IsFaceup
())
if
(
s
.
I
sCode
(
CardId
.
SeaStealthAttack
)
&&
Card
.
IsFaceup
())
{
{
target
=
s
;
target
=
s
;
break
;
break
;
...
@@ -388,7 +388,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -388,7 +388,7 @@ namespace WindBot.Game.AI.Decks
IList
<
ClientCard
>
material_list
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
material_list
=
new
List
<
ClientCard
>();
foreach
(
ClientCard
m
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
m
in
Bot
.
GetMonsters
())
{
{
if
(
m
.
I
d
==
CardId
.
MissusRadiant
)
if
(
m
.
I
sCode
(
CardId
.
MissusRadiant
)
)
{
{
material_list
.
Add
(
m
);
material_list
.
Add
(
m
);
break
;
break
;
...
@@ -396,7 +396,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -396,7 +396,7 @@ namespace WindBot.Game.AI.Decks
}
}
foreach
(
ClientCard
m
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
m
in
Bot
.
GetMonsters
())
{
{
if
(
m
.
I
d
==
CardId
.
Linkuriboh
||
m
.
Id
==
CardId
.
LinkSpider
)
if
(
m
.
I
sCode
(
CardId
.
Linkuriboh
,
CardId
.
LinkSpider
)
)
{
{
material_list
.
Add
(
m
);
material_list
.
Add
(
m
);
if
(
material_list
.
Count
==
3
)
if
(
material_list
.
Count
==
3
)
...
@@ -489,7 +489,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -489,7 +489,7 @@ namespace WindBot.Game.AI.Decks
IList
<
ClientCard
>
material_list
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
material_list
=
new
List
<
ClientCard
>();
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
{
{
if
(
monster
.
HasAttribute
(
CardAttribute
.
Earth
)
&&
monster
.
Level
==
1
&&
monster
.
Id
!=
CardId
.
EaterOfMillions
)
if
(
monster
.
HasAttribute
(
CardAttribute
.
Earth
)
&&
monster
.
Level
==
1
&&
!
monster
.
IsCode
(
CardId
.
EaterOfMillions
)
)
material_list
.
Add
(
monster
);
material_list
.
Add
(
monster
);
if
(
material_list
.
Count
==
2
)
break
;
if
(
material_list
.
Count
==
2
)
break
;
}
}
...
@@ -518,7 +518,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -518,7 +518,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
c
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
c
in
Bot
.
GetMonsters
())
{
{
if
(
c
.
Id
!=
CardId
.
EaterOfMillions
&&
c
.
Id
!=
CardId
.
Linkuriboh
&&
c
.
Level
==
1
)
if
(
!
c
.
IsCode
(
CardId
.
EaterOfMillions
,
CardId
.
Linkuriboh
)
&&
c
.
Level
==
1
)
{
{
AI
.
SelectMaterials
(
c
);
AI
.
SelectMaterials
(
c
);
return
true
;
return
true
;
...
@@ -529,7 +529,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -529,7 +529,7 @@ namespace WindBot.Game.AI.Decks
private
bool
Linkuriboheff
()
private
bool
Linkuriboheff
()
{
{
if
(
Duel
.
LastChainPlayer
==
0
&&
AI
.
Utils
.
GetLastChainCard
().
I
d
==
CardId
.
Linkuriboh
)
return
false
;
if
(
Duel
.
LastChainPlayer
==
0
&&
AI
.
Utils
.
GetLastChainCard
().
I
sCode
(
CardId
.
Linkuriboh
)
)
return
false
;
return
true
;
return
true
;
}
}
private
bool
SeaStealthAttackeff
()
private
bool
SeaStealthAttackeff
()
...
@@ -548,7 +548,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -548,7 +548,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
s
in
Bot
.
GetGraveyardSpells
())
foreach
(
ClientCard
s
in
Bot
.
GetGraveyardSpells
())
{
{
if
(
s
.
I
d
==
CardId
.
PacifisThePhantasmCity
)
if
(
s
.
I
sCode
(
CardId
.
PacifisThePhantasmCity
)
)
{
{
AI
.
SelectYesNo
(
true
);
AI
.
SelectYesNo
(
true
);
AI
.
SelectCard
(
s
);
AI
.
SelectCard
(
s
);
...
@@ -560,7 +560,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -560,7 +560,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
s
in
Bot
.
Hand
)
foreach
(
ClientCard
s
in
Bot
.
Hand
)
{
{
if
(
s
.
I
d
==
CardId
.
PacifisThePhantasmCity
)
if
(
s
.
I
sCode
(
CardId
.
PacifisThePhantasmCity
)
)
{
{
AI
.
SelectYesNo
(
true
);
AI
.
SelectYesNo
(
true
);
AI
.
SelectCard
(
s
);
AI
.
SelectCard
(
s
);
...
@@ -579,7 +579,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -579,7 +579,7 @@ namespace WindBot.Game.AI.Decks
ClientCard
target
=
null
;
ClientCard
target
=
null
;
foreach
(
ClientCard
s
in
Bot
.
GetSpells
())
foreach
(
ClientCard
s
in
Bot
.
GetSpells
())
{
{
if
(
s
.
I
d
==
CardId
.
PacifisThePhantasmCity
)
if
(
s
.
I
sCode
(
CardId
.
PacifisThePhantasmCity
)
)
target
=
s
;
target
=
s
;
}
}
if
(
target
!=
null
&&
AI
.
Utils
.
IsChainTarget
(
target
))
if
(
target
!=
null
&&
AI
.
Utils
.
IsChainTarget
(
target
))
...
@@ -590,13 +590,13 @@ namespace WindBot.Game.AI.Decks
...
@@ -590,13 +590,13 @@ namespace WindBot.Game.AI.Decks
target
=
AI
.
Utils
.
GetLastChainCard
();
target
=
AI
.
Utils
.
GetLastChainCard
();
if
(
target
!=
null
)
if
(
target
!=
null
)
{
{
if
(
target
.
I
d
==
CardId
.
BrandishSkillAfterburner
)
if
(
target
.
I
sCode
(
CardId
.
BrandishSkillAfterburner
)
)
{
{
AI
.
SelectCard
(
CardId
.
MegalosmasherX
);
AI
.
SelectCard
(
CardId
.
MegalosmasherX
);
SeaStealthAttackeff_used
=
true
;
SeaStealthAttackeff_used
=
true
;
return
true
;
return
true
;
}
}
if
(
Enemy
.
GetGraveyardSpells
().
Count
>=
3
&&
target
.
I
d
==
CardId
.
BrandishSkillJammingWave
)
if
(
Enemy
.
GetGraveyardSpells
().
Count
>=
3
&&
target
.
I
sCode
(
CardId
.
BrandishSkillJammingWave
)
)
{
{
AI
.
SelectCard
(
CardId
.
MegalosmasherX
);
AI
.
SelectCard
(
CardId
.
MegalosmasherX
);
SeaStealthAttackeff_used
=
true
;
SeaStealthAttackeff_used
=
true
;
...
@@ -675,7 +675,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -675,7 +675,7 @@ namespace WindBot.Game.AI.Decks
int
zone_count
=
5
-
Bot
.
GetSpellCountWithoutField
();
int
zone_count
=
5
-
Bot
.
GetSpellCountWithoutField
();
return
zone_count
-
hand_spell_count
>=
1
;
return
zone_count
-
hand_spell_count
>=
1
;
}
}
if
(
Card
.
I
d
==
CardId
.
PhantasmSprialBattle
||
Card
.
Id
==
CardId
.
PhantasmSpiralPower
)
if
(
Card
.
I
sCode
(
CardId
.
PhantasmSprialBattle
,
CardId
.
PhantasmSpiralPower
)
)
{
{
if
(
Bot
.
HasInMonstersZone
(
CardId
.
MegalosmasherX
)
&&
if
(
Bot
.
HasInMonstersZone
(
CardId
.
MegalosmasherX
)
&&
!
Bot
.
HasInHandOrInSpellZone
(
CardId
.
PacifisThePhantasmCity
)
&&
!
Bot
.
HasInHandOrInSpellZone
(
CardId
.
PacifisThePhantasmCity
)
&&
...
@@ -691,20 +691,20 @@ namespace WindBot.Game.AI.Decks
...
@@ -691,20 +691,20 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
s
in
Bot
.
GetSpells
())
foreach
(
ClientCard
s
in
Bot
.
GetSpells
())
{
{
if
(
s
.
IsFaceup
()
&&
s
.
I
d
==
CardId
.
SeaStealthAttack
&&
if
(
s
.
IsFaceup
()
&&
s
.
I
sCode
(
CardId
.
SeaStealthAttack
)
&&
Bot
.
HasInSpellZone
(
CardId
.
PacifisThePhantasmCity
)
&&
Bot
.
HasInSpellZone
(
CardId
.
PacifisThePhantasmCity
)
&&
Card
.
IsAttack
())
Card
.
IsAttack
())
return
false
;
return
false
;
}
}
}
}
if
(
Card
.
I
d
==
CardId
.
EaterOfMillions
&&
!
Card
.
IsDisabled
()
&&
Card
.
IsAttack
())
if
(
Card
.
I
sCode
(
CardId
.
EaterOfMillions
)
&&
!
Card
.
IsDisabled
()
&&
Card
.
IsAttack
())
return
false
;
return
false
;
return
DefaultMonsterRepos
();
return
DefaultMonsterRepos
();
}
}
public
override
bool
OnPreBattleBetween
(
ClientCard
attacker
,
ClientCard
defender
)
public
override
bool
OnPreBattleBetween
(
ClientCard
attacker
,
ClientCard
defender
)
{
{
if
(
attacker
.
I
d
==
CardId
.
PacifisThePhantasmCity
+
1
&&
defender
.
Id
==
CardId
.
EaterOfMillions
)
if
(
attacker
.
I
sCode
(
CardId
.
PacifisThePhantasmCity
+
1
)
&&
defender
.
IsCode
(
CardId
.
EaterOfMillions
)
)
{
{
if
(
attacker
.
RealPower
>=
defender
.
RealPower
)
return
true
;
if
(
attacker
.
RealPower
>=
defender
.
RealPower
)
return
true
;
}
}
...
@@ -712,10 +712,10 @@ namespace WindBot.Game.AI.Decks
...
@@ -712,10 +712,10 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
s
in
Bot
.
GetSpells
())
foreach
(
ClientCard
s
in
Bot
.
GetSpells
())
{
{
if
(
s
.
IsFaceup
()
&&
s
.
I
d
==
CardId
.
SeaStealthAttack
&&
Bot
.
HasInSpellZone
(
CardId
.
PacifisThePhantasmCity
))
if
(
s
.
IsFaceup
()
&&
s
.
I
sCode
(
CardId
.
SeaStealthAttack
)
&&
Bot
.
HasInSpellZone
(
CardId
.
PacifisThePhantasmCity
))
{
{
attacker
.
RealPower
=
9999
;
attacker
.
RealPower
=
9999
;
if
(
defender
.
I
d
==
CardId
.
EaterOfMillions
)
return
true
;
if
(
defender
.
I
sCode
(
CardId
.
EaterOfMillions
)
)
return
true
;
}
}
}
}
...
@@ -728,7 +728,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -728,7 +728,7 @@ namespace WindBot.Game.AI.Decks
for
(
int
i
=
0
;
i
<
attackers
.
Count
;
++
i
)
for
(
int
i
=
0
;
i
<
attackers
.
Count
;
++
i
)
{
{
ClientCard
attacker
=
attackers
[
i
];
ClientCard
attacker
=
attackers
[
i
];
if
(
attacker
.
I
d
==
CardId
.
EaterOfMillions
)
return
attacker
;
if
(
attacker
.
I
sCode
(
CardId
.
EaterOfMillions
)
)
return
attacker
;
}
}
return
null
;
return
null
;
}
}
...
...
Game/AI/Decks/QliphortExecutor.cs
View file @
f8435d17
...
@@ -141,7 +141,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -141,7 +141,7 @@ namespace WindBot.Game.AI.Decks
for
(
int
i
=
1
;
i
<=
max
;
++
i
)
for
(
int
i
=
1
;
i
<=
max
;
++
i
)
{
{
ClientCard
card
=
cards
[
cards
.
Count
-
i
];
ClientCard
card
=
cards
[
cards
.
Count
-
i
];
if
(
card
.
Id
!=
CardId
.
Scout
||
(
card
.
Location
==
CardLocation
.
Extra
&&
!
Duel
.
IsNewRule
))
if
(
!
card
.
IsCode
(
CardId
.
Scout
)
||
(
card
.
Location
==
CardLocation
.
Extra
&&
!
Duel
.
IsNewRule
))
selected
.
Add
(
card
);
selected
.
Add
(
card
);
}
}
if
(
selected
.
Count
==
0
)
if
(
selected
.
Count
==
0
)
...
@@ -152,7 +152,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -152,7 +152,7 @@ namespace WindBot.Game.AI.Decks
private
bool
NormalSummon
()
private
bool
NormalSummon
()
{
{
if
(
Card
.
I
d
==
CardId
.
Scout
)
if
(
Card
.
I
sCode
(
CardId
.
Scout
)
)
return
false
;
return
false
;
if
(
Card
.
Level
<
8
)
if
(
Card
.
Level
<
8
)
AI
.
SelectOption
(
1
);
AI
.
SelectOption
(
1
);
...
@@ -196,7 +196,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -196,7 +196,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
{
{
if
(
card
.
I
d
==
Card
.
Id
)
if
(
card
.
I
sCode
(
Card
.
Id
)
)
return
false
;
return
false
;
}
}
return
TrapSetWhenZoneFree
();
return
TrapSetWhenZoneFree
();
...
...
Game/AI/Decks/RainbowExecutor.cs
View file @
f8435d17
...
@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
card2
in
cards
)
foreach
(
ClientCard
card2
in
cards
)
{
{
if
(
card1
.
I
d
==
card2
.
Id
&&
!
card1
.
Equals
(
card2
))
if
(
card1
.
I
sCode
(
card2
.
Id
)
&&
!
card1
.
Equals
(
card2
))
{
{
result
.
Add
(
card1
);
result
.
Add
(
card1
);
result
.
Add
(
card2
);
result
.
Add
(
card2
);
...
...
Game/AI/Decks/Rank5Executor.cs
View file @
f8435d17
...
@@ -185,15 +185,15 @@ namespace WindBot.Game.AI.Decks
...
@@ -185,15 +185,15 @@ namespace WindBot.Game.AI.Decks
int
lv5Count
=
0
;
int
lv5Count
=
0
;
foreach
(
ClientCard
card
in
Bot
.
Hand
)
foreach
(
ClientCard
card
in
Bot
.
Hand
)
{
{
if
(
card
.
I
d
==
CardId
.
SolarWindJammer
&&
Bot
.
GetMonsterCount
()
==
0
)
if
(
card
.
I
sCode
(
CardId
.
SolarWindJammer
)
&&
Bot
.
GetMonsterCount
()
==
0
)
++
lv5Count
;
++
lv5Count
;
if
(
card
.
I
d
==
CardId
.
InstantFusion
&&
!
InstantFusionUsed
)
if
(
card
.
I
sCode
(
CardId
.
InstantFusion
)
&&
!
InstantFusionUsed
)
++
lv5Count
;
++
lv5Count
;
if
(
card
.
I
d
==
CardId
.
QuickdrawSynchron
&&
Bot
.
Hand
.
ContainsMonsterWithLevel
(
4
))
if
(
card
.
I
sCode
(
CardId
.
QuickdrawSynchron
)
&&
Bot
.
Hand
.
ContainsMonsterWithLevel
(
4
))
++
lv5Count
;
++
lv5Count
;
if
(
card
.
I
d
==
CardId
.
MistArchfiend
&&
!
NormalSummoned
)
if
(
card
.
I
sCode
(
CardId
.
MistArchfiend
)
&&
!
NormalSummoned
)
++
lv5Count
;
++
lv5Count
;
if
(
card
.
I
d
==
CardId
.
DoubleSummon
&&
DoubleSummonEffect
())
if
(
card
.
I
sCode
(
CardId
.
DoubleSummon
)
&&
DoubleSummonEffect
())
++
lv5Count
;
++
lv5Count
;
}
}
if
(
lv5Count
>=
2
)
if
(
lv5Count
>=
2
)
...
@@ -387,8 +387,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -387,8 +387,8 @@ namespace WindBot.Game.AI.Decks
if
(
monster
.
HasType
(
CardType
.
Monster
)
&&
if
(
monster
.
HasType
(
CardType
.
Monster
)
&&
!
monster
.
HasType
(
CardType
.
Xyz
)
&&
!
monster
.
HasType
(
CardType
.
Xyz
)
&&
(
monster
.
Level
==
5
(
monster
.
Level
==
5
||
monster
.
I
d
==
CardId
.
StarDrawing
||
monster
.
I
sCode
(
CardId
.
StarDrawing
)
||
(
monster
.
I
d
==
CardId
.
WindUpSoldier
)
&&
!
monster
.
Equals
(
Card
)))
||
(
monster
.
I
sCode
(
CardId
.
WindUpSoldier
)
)
&&
!
monster
.
Equals
(
Card
)))
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
Game/AI/Decks/ST1732Executor.cs
View file @
f8435d17
...
@@ -284,7 +284,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -284,7 +284,7 @@ namespace WindBot.Game.AI.Decks
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
foreach
(
ClientCard
monster
in
monsters
)
{
{
if
(
monster
.
I
d
==
CardId
.
BalancerLord
)
if
(
monster
.
I
sCode
(
CardId
.
BalancerLord
)
)
{
{
AI
.
SelectCard
(
monster
);
AI
.
SelectCard
(
monster
);
selected
=
true
;
selected
=
true
;
...
@@ -404,7 +404,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -404,7 +404,7 @@ namespace WindBot.Game.AI.Decks
};
};
foreach
(
ClientCard
monster
in
Bot
.
Hand
)
foreach
(
ClientCard
monster
in
Bot
.
Hand
)
{
{
if
(
targets
.
Contains
(
monster
.
Id
))
if
(
monster
.
IsCode
(
targets
))
{
{
AI
.
SelectCard
(
targets
);
AI
.
SelectCard
(
targets
);
return
true
;
return
true
;
...
@@ -418,7 +418,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -418,7 +418,7 @@ namespace WindBot.Game.AI.Decks
};
};
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
monster
in
Bot
.
GetMonsters
())
{
{
if
(
targets2
.
Contains
(
monster
.
Id
))
if
(
monster
.
IsCode
(
targets2
))
{
{
AI
.
SelectCard
(
targets2
);
AI
.
SelectCard
(
targets2
);
return
true
;
return
true
;
...
...
Game/AI/Decks/SkyStrikerExecutor.cs
View file @
f8435d17
...
@@ -152,7 +152,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -152,7 +152,7 @@ namespace WindBot.Game.AI.Decks
{
{
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
())
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
())
{
{
if
(
attacker
.
I
d
==
CardId
.
HiSpeedroidChanbara
&&
!
attacker
.
IsDisabled
())
if
(
attacker
.
I
sCode
(
CardId
.
HiSpeedroidChanbara
)
&&
!
attacker
.
IsDisabled
())
attacker
.
RealPower
=
attacker
.
RealPower
+
200
;
attacker
.
RealPower
=
attacker
.
RealPower
+
200
;
}
}
return
base
.
OnPreBattleBetween
(
attacker
,
defender
);
return
base
.
OnPreBattleBetween
(
attacker
,
defender
);
...
@@ -399,7 +399,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -399,7 +399,7 @@ namespace WindBot.Game.AI.Decks
IList
<
ClientCard
>
targets
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
targets
=
new
List
<
ClientCard
>();
foreach
(
ClientCard
card
in
Bot
.
GetGraveyardMonsters
())
foreach
(
ClientCard
card
in
Bot
.
GetGraveyardMonsters
())
{
{
if
(
card
.
I
d
==
CardId
.
Hayate
||
card
.
Id
==
CardId
.
Kagari
||
card
.
Id
==
CardId
.
Shizuku
)
if
(
card
.
I
sCode
(
CardId
.
Hayate
,
CardId
.
Kagari
,
CardId
.
Shizuku
)
)
targets
.
Add
(
card
);
targets
.
Add
(
card
);
}
}
if
(
targets
.
Count
>
0
)
if
(
targets
.
Count
>
0
)
...
@@ -451,7 +451,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -451,7 +451,7 @@ namespace WindBot.Game.AI.Decks
}
}
foreach
(
ClientCard
target
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
target
in
Bot
.
GetMonsters
())
{
{
if
(
target
.
I
d
==
CardId
.
Raye
&&
Bot
.
GetMonstersExtraZoneCount
()
==
0
)
if
(
target
.
I
sCode
(
CardId
.
Raye
)
&&
Bot
.
GetMonstersExtraZoneCount
()
==
0
)
{
{
AI
.
SelectCard
(
target
);
AI
.
SelectCard
(
target
);
return
true
;
return
true
;
...
@@ -459,7 +459,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -459,7 +459,7 @@ namespace WindBot.Game.AI.Decks
}
}
foreach
(
ClientCard
target
in
Bot
.
GetSpells
())
foreach
(
ClientCard
target
in
Bot
.
GetSpells
())
{
{
if
(
target
.
Id
!=
CardId
.
AreaZero
&&
target
.
Id
!=
CardId
.
Multirole
&&
target
.
Id
!=
CardId
.
WidowAnchor
&&
target
.
IsSpell
())
if
(
!
target
.
IsCode
(
CardId
.
AreaZero
,
CardId
.
Multirole
,
CardId
.
WidowAnchor
)
&&
target
.
IsSpell
())
{
{
AI
.
SelectCard
(
target
);
AI
.
SelectCard
(
target
);
return
true
;
return
true
;
...
@@ -482,7 +482,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -482,7 +482,7 @@ namespace WindBot.Game.AI.Decks
}
}
foreach
(
ClientCard
target
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
target
in
Bot
.
GetMonsters
())
{
{
if
(
target
.
I
d
==
CardId
.
Raye
&&
Bot
.
GetMonstersExtraZoneCount
()
==
0
)
if
(
target
.
I
sCode
(
CardId
.
Raye
)
&&
Bot
.
GetMonstersExtraZoneCount
()
==
0
)
{
{
AI
.
SelectCard
(
target
);
AI
.
SelectCard
(
target
);
return
true
;
return
true
;
...
@@ -490,7 +490,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -490,7 +490,7 @@ namespace WindBot.Game.AI.Decks
}
}
foreach
(
ClientCard
target
in
Bot
.
GetSpells
())
foreach
(
ClientCard
target
in
Bot
.
GetSpells
())
{
{
if
(
target
.
I
d
==
CardId
.
AreaZero
)
if
(
target
.
I
sCode
(
CardId
.
AreaZero
)
)
{
{
AI
.
SelectCard
(
target
);
AI
.
SelectCard
(
target
);
return
true
;
return
true
;
...
@@ -498,7 +498,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -498,7 +498,7 @@ namespace WindBot.Game.AI.Decks
}
}
foreach
(
ClientCard
target
in
Bot
.
GetSpells
())
foreach
(
ClientCard
target
in
Bot
.
GetSpells
())
{
{
if
(
target
.
Id
!=
CardId
.
Multirole
&&
target
.
Id
!=
CardId
.
WidowAnchor
&&
target
.
IsSpell
())
if
(
!
target
.
IsCode
(
CardId
.
Multirole
,
CardId
.
WidowAnchor
)
&&
target
.
IsSpell
())
{
{
AI
.
SelectCard
(
target
);
AI
.
SelectCard
(
target
);
return
true
;
return
true
;
...
...
Game/AI/Decks/ToadallyAwesomeExecutor.cs
View file @
f8435d17
...
@@ -116,7 +116,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -116,7 +116,7 @@ namespace WindBot.Game.AI.Decks
{
{
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
())
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
())
{
{
if
(
attacker
.
I
d
==
CardId
.
SkyCavalryCentaurea
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
())
if
(
attacker
.
I
sCode
(
CardId
.
SkyCavalryCentaurea
)
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
())
attacker
.
RealPower
=
Bot
.
LifePoints
+
attacker
.
Attack
;
attacker
.
RealPower
=
Bot
.
LifePoints
+
attacker
.
Attack
;
}
}
return
base
.
OnPreBattleBetween
(
attacker
,
defender
);
return
base
.
OnPreBattleBetween
(
attacker
,
defender
);
...
@@ -315,7 +315,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -315,7 +315,7 @@ namespace WindBot.Game.AI.Decks
};
};
foreach
(
ClientCard
monster
in
monsters
)
foreach
(
ClientCard
monster
in
monsters
)
{
{
if
(
suitableCost
.
Contains
(
monster
.
Id
))
if
(
monster
.
IsCode
(
suitableCost
))
{
{
AI
.
SelectCard
(
monster
);
AI
.
SelectCard
(
monster
);
return
true
;
return
true
;
...
@@ -325,7 +325,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -325,7 +325,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
monster
in
monsters
)
foreach
(
ClientCard
monster
in
monsters
)
{
{
if
(
monster
.
I
d
==
CardId
.
DupeFrog
)
if
(
monster
.
I
sCode
(
CardId
.
DupeFrog
)
)
{
{
AI
.
SelectCard
(
monster
);
AI
.
SelectCard
(
monster
);
return
true
;
return
true
;
...
@@ -337,7 +337,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -337,7 +337,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
monster
in
hands
)
foreach
(
ClientCard
monster
in
hands
)
{
{
if
(
monster
.
I
d
==
CardId
.
GraydleSlimeJr
)
if
(
monster
.
I
sCode
(
CardId
.
GraydleSlimeJr
)
)
{
{
AI
.
SelectCard
(
monster
);
AI
.
SelectCard
(
monster
);
return
true
;
return
true
;
...
@@ -348,7 +348,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -348,7 +348,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
monster
in
hands
)
foreach
(
ClientCard
monster
in
hands
)
{
{
if
(
monster
.
I
d
==
CardId
.
DupeFrog
)
if
(
monster
.
I
sCode
(
CardId
.
DupeFrog
)
)
{
{
AI
.
SelectCard
(
monster
);
AI
.
SelectCard
(
monster
);
return
true
;
return
true
;
...
@@ -357,7 +357,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -357,7 +357,7 @@ namespace WindBot.Game.AI.Decks
}
}
foreach
(
ClientCard
monster
in
hands
)
foreach
(
ClientCard
monster
in
hands
)
{
{
if
(
monster
.
I
d
==
CardId
.
Ronintoadin
||
monster
.
Id
==
CardId
.
DupeFrog
)
if
(
monster
.
I
sCode
(
CardId
.
Ronintoadin
,
CardId
.
DupeFrog
)
)
{
{
AI
.
SelectCard
(
monster
);
AI
.
SelectCard
(
monster
);
return
true
;
return
true
;
...
@@ -442,7 +442,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -442,7 +442,7 @@ namespace WindBot.Game.AI.Decks
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
foreach
(
ClientCard
monster
in
monsters
)
{
{
if
(
monster
.
I
d
==
CardId
.
ToadallyAwesome
&&
monster
.
Attack
<=
2200
)
if
(
monster
.
I
sCode
(
CardId
.
ToadallyAwesome
)
&&
monster
.
Attack
<=
2200
)
{
{
SelectXYZDetach
(
Card
.
Overlays
);
SelectXYZDetach
(
Card
.
Overlays
);
AI
.
SelectNextCard
(
monster
);
AI
.
SelectNextCard
(
monster
);
...
@@ -451,7 +451,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -451,7 +451,7 @@ namespace WindBot.Game.AI.Decks
}
}
foreach
(
ClientCard
monster
in
monsters
)
foreach
(
ClientCard
monster
in
monsters
)
{
{
if
(
monster
.
I
d
==
CardId
.
SkyCavalryCentaurea
&&
monster
.
Attack
<=
2000
)
if
(
monster
.
I
sCode
(
CardId
.
SkyCavalryCentaurea
)
&&
monster
.
Attack
<=
2000
)
{
{
SelectXYZDetach
(
Card
.
Overlays
);
SelectXYZDetach
(
Card
.
Overlays
);
AI
.
SelectNextCard
(
monster
);
AI
.
SelectNextCard
(
monster
);
...
@@ -460,7 +460,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -460,7 +460,7 @@ namespace WindBot.Game.AI.Decks
}
}
foreach
(
ClientCard
monster
in
monsters
)
foreach
(
ClientCard
monster
in
monsters
)
{
{
if
(
monster
.
I
d
==
CardId
.
DaigustoPhoenix
&&
monster
.
Attack
<=
1500
)
if
(
monster
.
I
sCode
(
CardId
.
DaigustoPhoenix
)
&&
monster
.
Attack
<=
1500
)
{
{
SelectXYZDetach
(
Card
.
Overlays
);
SelectXYZDetach
(
Card
.
Overlays
);
AI
.
SelectNextCard
(
monster
);
AI
.
SelectNextCard
(
monster
);
...
...
Game/AI/Decks/TrickstarExecutor.cs
View file @
f8435d17
This diff is collapsed.
Click to expand it.
Game/AI/Decks/YosenjuExecutor.cs
View file @
f8435d17
...
@@ -163,7 +163,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -163,7 +163,7 @@ namespace WindBot.Game.AI.Decks
if
(
Card
==
null
)
if
(
Card
==
null
)
return
true
;
return
true
;
// Logger.DebugWriteLine(Card.Name);
// Logger.DebugWriteLine(Card.Name);
if
(
Card
.
I
d
==
CardId
.
YosenjuKama2
)
if
(
Card
.
I
sCode
(
CardId
.
YosenjuKama2
)
)
return
Card
.
ShouldDirectAttack
;
return
Card
.
ShouldDirectAttack
;
else
else
return
true
;
return
true
;
...
@@ -181,7 +181,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -181,7 +181,7 @@ namespace WindBot.Game.AI.Decks
public
override
IList
<
ClientCard
>
OnSelectXyzMaterial
(
IList
<
ClientCard
>
cards
,
int
min
,
int
max
)
public
override
IList
<
ClientCard
>
OnSelectXyzMaterial
(
IList
<
ClientCard
>
cards
,
int
min
,
int
max
)
{
{
IList
<
ClientCard
>
result
=
AI
.
Utils
.
SelectPreferredCards
(
CardId
.
YosenjuTsujik
,
cards
,
min
,
max
);
IList
<
ClientCard
>
result
=
AI
.
Utils
.
SelectPreferredCards
(
CardId
.
YosenjuTsujik
,
cards
,
min
,
max
);
return
AI
.
Utils
.
CheckSelectCount
(
result
,
cards
,
min
,
max
);
return
AI
.
Utils
.
CheckSelectCount
(
result
,
cards
,
min
,
max
);
}
}
...
@@ -241,7 +241,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -241,7 +241,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
card
in
Bot
.
Hand
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
Hand
.
GetMonsters
())
{
{
if
(!
card
.
Equals
(
Card
)
&&
card
.
I
d
==
Card
.
Id
)
if
(!
card
.
Equals
(
Card
)
&&
card
.
I
sCode
(
Card
.
Id
)
)
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
@@ -251,7 +251,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -251,7 +251,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
{
{
if
(
card
.
I
d
==
Card
.
Id
)
if
(
card
.
I
sCode
(
Card
.
Id
)
)
return
false
;
return
false
;
}
}
return
TrapSetWhenZoneFree
();
return
TrapSetWhenZoneFree
();
...
...
Game/AI/Decks/ZexalWeaponsExecutor.cs
View file @
f8435d17
...
@@ -238,7 +238,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -238,7 +238,7 @@ namespace WindBot.Game.AI.Decks
{
{
var
lastChainCard
=
AI
.
Utils
.
GetLastChainCard
();
var
lastChainCard
=
AI
.
Utils
.
GetLastChainCard
();
if
(
lastChainCard
==
null
)
return
true
;
if
(
lastChainCard
==
null
)
return
true
;
return
lastChainCard
.
Id
!=
CardId
.
Goblindbergh
&&
lastChainCard
.
Id
!=
CardId
.
TinGoldfish
;
return
!
lastChainCard
.
IsCode
(
CardId
.
Goblindbergh
,
CardId
.
TinGoldfish
)
;
}
}
private
bool
SummonerMonkEffect
()
private
bool
SummonerMonkEffect
()
...
@@ -279,7 +279,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -279,7 +279,7 @@ namespace WindBot.Game.AI.Decks
private
bool
MonsterRepos
()
private
bool
MonsterRepos
()
{
{
if
(
Card
.
I
d
==
CardId
.
NumberS39UtopiatheLightning
&&
Card
.
IsAttack
())
if
(
Card
.
I
sCode
(
CardId
.
NumberS39UtopiatheLightning
)
&&
Card
.
IsAttack
())
return
false
;
return
false
;
return
base
.
DefaultMonsterRepos
();
return
base
.
DefaultMonsterRepos
();
}
}
...
...
Game/AI/Decks/ZoodiacExecutor.cs
View file @
f8435d17
...
@@ -230,14 +230,14 @@ namespace WindBot.Game.AI.Decks
...
@@ -230,14 +230,14 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
card
in
Enemy
.
Graveyard
)
foreach
(
ClientCard
card
in
Enemy
.
Graveyard
)
{
{
if
(
card
.
I
d
==
CardId
.
AleisterTheInvoker
)
if
(
card
.
I
sCode
(
CardId
.
AleisterTheInvoker
)
)
{
{
return
card
;
return
card
;
}
}
}
}
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
{
{
if
(
card
.
I
d
==
CardId
.
AleisterTheInvoker
)
if
(
card
.
I
sCode
(
CardId
.
AleisterTheInvoker
)
)
{
{
return
card
;
return
card
;
}
}
...
@@ -445,7 +445,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -445,7 +445,7 @@ namespace WindBot.Game.AI.Decks
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
foreach
(
ClientCard
monster
in
monsters
)
{
{
if
(
monster
.
IsFaceup
()
&&
monster
.
I
d
==
CardId
.
Drident
&&
!
monster
.
HasXyzMaterial
())
if
(
monster
.
IsFaceup
()
&&
monster
.
I
sCode
(
CardId
.
Drident
)
&&
!
monster
.
HasXyzMaterial
())
{
{
target
=
monster
;
target
=
monster
;
break
;
break
;
...
@@ -455,7 +455,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -455,7 +455,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach (ClientCard monster in monsters)
foreach (ClientCard monster in monsters)
{
{
if (monster.IsFaceup() && monster.Type == (int)CardType.Xyz &&
monster.Id != CardId.DaigustoEmeral
&& !monster.HasXyzMaterial())
if (monster.IsFaceup() && monster.Type == (int)CardType.Xyz &&
!monster.IsCode(CardId.DaigustoEmeral)
&& !monster.HasXyzMaterial())
{
{
target = monster;
target = monster;
break;
break;
...
@@ -550,7 +550,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -550,7 +550,7 @@ namespace WindBot.Game.AI.Decks
{
{
foreach
(
ClientCard
spell
in
Bot
.
GetSpells
())
foreach
(
ClientCard
spell
in
Bot
.
GetSpells
())
{
{
if
(
spell
.
I
d
==
CardId
.
ZoodiacBarrage
&&
!
Card
.
Equals
(
spell
))
if
(
spell
.
I
sCode
(
CardId
.
ZoodiacBarrage
)
&&
!
Card
.
Equals
(
spell
))
return
false
;
return
false
;
}
}
AI
.
SelectCard
(
new
[]
AI
.
SelectCard
(
new
[]
...
@@ -604,7 +604,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -604,7 +604,7 @@ namespace WindBot.Game.AI.Decks
private
bool
MonsterRepos
()
private
bool
MonsterRepos
()
{
{
if
(
Card
.
I
d
==
CardId
.
NumberS39UtopiatheLightning
&&
Card
.
IsAttack
())
if
(
Card
.
I
sCode
(
CardId
.
NumberS39UtopiatheLightning
)
&&
Card
.
IsAttack
())
return
false
;
return
false
;
return
base
.
DefaultMonsterRepos
();
return
base
.
DefaultMonsterRepos
();
}
}
...
...
Game/AI/DefaultExecutor.cs
View file @
f8435d17
...
@@ -129,16 +129,16 @@ namespace WindBot.Game.AI
...
@@ -129,16 +129,16 @@ namespace WindBot.Game.AI
if
(
defender
.
IsMonsterDangerous
())
if
(
defender
.
IsMonsterDangerous
())
{
{
bool
canIgnoreIt
=
!
attacker
.
IsDisabled
()
&&
(
bool
canIgnoreIt
=
!
attacker
.
IsDisabled
()
&&
(
attacker
.
I
d
==
_CardId
.
UltimateConductorTytanno
&&
defender
.
IsDefense
()
||
attacker
.
I
sCode
(
_CardId
.
UltimateConductorTytanno
)
&&
defender
.
IsDefense
()
||
attacker
.
I
d
==
_CardId
.
ElShaddollConstruct
&&
defender
.
IsSpecialSummoned
||
attacker
.
I
sCode
(
_CardId
.
ElShaddollConstruct
)
&&
defender
.
IsSpecialSummoned
||
attacker
.
I
d
==
_CardId
.
AllyOfJusticeCatastor
&&
!
defender
.
HasAttribute
(
CardAttribute
.
Dark
));
attacker
.
I
sCode
(
_CardId
.
AllyOfJusticeCatastor
)
&&
!
defender
.
HasAttribute
(
CardAttribute
.
Dark
));
if
(!
canIgnoreIt
)
if
(!
canIgnoreIt
)
return
false
;
return
false
;
}
}
foreach
(
ClientCard
equip
in
defender
.
EquipCards
)
foreach
(
ClientCard
equip
in
defender
.
EquipCards
)
{
{
if
(
equip
.
I
d
==
_CardId
.
MoonMirrorShield
&&
!
equip
.
IsDisabled
())
if
(
equip
.
I
sCode
(
_CardId
.
MoonMirrorShield
)
&&
!
equip
.
IsDisabled
())
{
{
return
false
;
return
false
;
}
}
...
@@ -146,44 +146,44 @@ namespace WindBot.Game.AI
...
@@ -146,44 +146,44 @@ namespace WindBot.Game.AI
if
(!
defender
.
IsDisabled
())
if
(!
defender
.
IsDisabled
())
{
{
if
(
defender
.
I
d
==
_CardId
.
CrystalWingSynchroDragon
&&
defender
.
IsAttack
()
&&
attacker
.
Level
>=
5
)
if
(
defender
.
I
sCode
(
_CardId
.
CrystalWingSynchroDragon
)
&&
defender
.
IsAttack
()
&&
attacker
.
Level
>=
5
)
return
false
;
return
false
;
if
(
defender
.
I
d
==
_CardId
.
AllyOfJusticeCatastor
&&
!
attacker
.
HasAttribute
(
CardAttribute
.
Dark
))
if
(
defender
.
I
sCode
(
_CardId
.
AllyOfJusticeCatastor
)
&&
!
attacker
.
HasAttribute
(
CardAttribute
.
Dark
))
return
false
;
return
false
;
if
(
defender
.
I
d
==
_CardId
.
NumberS39UtopiaTheLightning
&&
defender
.
IsAttack
()
&&
defender
.
HasXyzMaterial
(
2
,
_CardId
.
Number39Utopia
))
if
(
defender
.
I
sCode
(
_CardId
.
NumberS39UtopiaTheLightning
)
&&
defender
.
IsAttack
()
&&
defender
.
HasXyzMaterial
(
2
,
_CardId
.
Number39Utopia
))
defender
.
RealPower
=
5000
;
defender
.
RealPower
=
5000
;
if
(
defender
.
I
d
==
_CardId
.
VampireFraeulein
)
if
(
defender
.
I
sCode
(
_CardId
.
VampireFraeulein
)
)
defender
.
RealPower
+=
(
Enemy
.
LifePoints
>
3000
)
?
3000
:
(
Enemy
.
LifePoints
-
100
);
defender
.
RealPower
+=
(
Enemy
.
LifePoints
>
3000
)
?
3000
:
(
Enemy
.
LifePoints
-
100
);
if
(
defender
.
I
d
==
_CardId
.
InjectionFairyLily
&&
Enemy
.
LifePoints
>
2000
)
if
(
defender
.
I
sCode
(
_CardId
.
InjectionFairyLily
)
&&
Enemy
.
LifePoints
>
2000
)
defender
.
RealPower
+=
3000
;
defender
.
RealPower
+=
3000
;
}
}
}
}
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
())
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
())
{
{
if
(
attacker
.
I
d
==
_CardId
.
NumberS39UtopiaTheLightning
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
(
2
,
_CardId
.
Number39Utopia
))
if
(
attacker
.
I
sCode
(
_CardId
.
NumberS39UtopiaTheLightning
)
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
(
2
,
_CardId
.
Number39Utopia
))
attacker
.
RealPower
=
5000
;
attacker
.
RealPower
=
5000
;
foreach
(
ClientCard
equip
in
attacker
.
EquipCards
)
foreach
(
ClientCard
equip
in
attacker
.
EquipCards
)
{
{
if
(
equip
.
I
d
==
_CardId
.
MoonMirrorShield
&&
!
equip
.
IsDisabled
())
if
(
equip
.
I
sCode
(
_CardId
.
MoonMirrorShield
)
&&
!
equip
.
IsDisabled
())
{
{
attacker
.
RealPower
=
defender
.
RealPower
+
100
;
attacker
.
RealPower
=
defender
.
RealPower
+
100
;
}
}
}
}
}
}
if
(
Enemy
.
HasInMonstersZone
(
_CardId
.
DupeFrog
,
true
)
&&
defender
.
Id
!=
_CardId
.
DupeFrog
)
if
(
Enemy
.
HasInMonstersZone
(
_CardId
.
DupeFrog
,
true
)
&&
!(
defender
).
IsCode
(
_CardId
.
DupeFrog
)
)
return
false
;
return
false
;
if
(
Enemy
.
HasInMonstersZone
(
_CardId
.
MaraudingCaptain
,
true
)
&&
defender
.
Id
!=
_CardId
.
MaraudingCaptain
&&
defender
.
Race
==
(
int
)
CardRace
.
Warrior
)
if
(
Enemy
.
HasInMonstersZone
(
_CardId
.
MaraudingCaptain
,
true
)
&&
!
defender
.
IsCode
(
_CardId
.
MaraudingCaptain
)
&&
defender
.
Race
==
(
int
)
CardRace
.
Warrior
)
return
false
;
return
false
;
if
(
defender
.
I
d
==
_CardId
.
UltimayaTzolkin
&&
!
defender
.
IsDisabled
()
&&
Enemy
.
GetMonsters
().
Any
(
monster
=>
!
monster
.
Equals
(
defender
)
&&
monster
.
HasType
(
CardType
.
Synchro
)))
if
(
defender
.
I
sCode
(
_CardId
.
UltimayaTzolkin
)
&&
!
defender
.
IsDisabled
()
&&
Enemy
.
GetMonsters
().
Any
(
monster
=>
!
monster
.
Equals
(
defender
)
&&
monster
.
HasType
(
CardType
.
Synchro
)))
return
false
;
return
false
;
return
true
;
return
true
;
...
@@ -231,7 +231,7 @@ namespace WindBot.Game.AI
...
@@ -231,7 +231,7 @@ namespace WindBot.Game.AI
/// </summary>
/// </summary>
protected
bool
DefaultMysticalSpaceTyphoon
()
protected
bool
DefaultMysticalSpaceTyphoon
()
{
{
if
(
Duel
.
CurrentChain
.
Any
(
card
=>
card
.
I
d
==
_CardId
.
MysticalSpaceTyphoon
))
if
(
Duel
.
CurrentChain
.
Any
(
card
=>
card
.
I
sCode
(
_CardId
.
MysticalSpaceTyphoon
)
))
{
{
return
false
;
return
false
;
}
}
...
@@ -262,7 +262,7 @@ namespace WindBot.Game.AI
...
@@ -262,7 +262,7 @@ namespace WindBot.Game.AI
protected
bool
DefaultCosmicCyclone
()
protected
bool
DefaultCosmicCyclone
()
{
{
foreach
(
ClientCard
card
in
Duel
.
CurrentChain
)
foreach
(
ClientCard
card
in
Duel
.
CurrentChain
)
if
(
card
.
I
d
==
_CardId
.
CosmicCyclone
)
if
(
card
.
I
sCode
(
_CardId
.
CosmicCyclone
)
)
return
false
;
return
false
;
return
(
Bot
.
LifePoints
>
1000
)
&&
DefaultMysticalSpaceTyphoon
();
return
(
Bot
.
LifePoints
>
1000
)
&&
DefaultMysticalSpaceTyphoon
();
}
}
...
@@ -386,7 +386,7 @@ namespace WindBot.Game.AI
...
@@ -386,7 +386,7 @@ namespace WindBot.Game.AI
_CardId
.
UpstartGoblin
,
_CardId
.
UpstartGoblin
,
_CardId
.
CyberEmergency
_CardId
.
CyberEmergency
};
};
if
(
ignoreList
.
Contains
(
AI
.
Utils
.
GetLastChainCard
().
Id
))
if
(
AI
.
Utils
.
GetLastChainCard
().
IsCode
(
ignoreList
))
return
false
;
return
false
;
return
Duel
.
LastChainPlayer
==
1
;
return
Duel
.
LastChainPlayer
==
1
;
}
}
...
@@ -411,7 +411,7 @@ namespace WindBot.Game.AI
...
@@ -411,7 +411,7 @@ namespace WindBot.Game.AI
/// </summary>
/// </summary>
protected
bool
DefaultEffectVeiler
()
protected
bool
DefaultEffectVeiler
()
{
{
if
(
AI
.
Utils
.
GetLastChainCard
()
!=
null
&&
AI
.
Utils
.
GetLastChainCard
().
I
d
==
_CardId
.
GalaxySoldier
&&
Enemy
.
Hand
.
Count
>=
3
)
return
false
;
if
(
AI
.
Utils
.
GetLastChainCard
()
!=
null
&&
AI
.
Utils
.
GetLastChainCard
().
I
sCode
(
_CardId
.
GalaxySoldier
)
&&
Enemy
.
Hand
.
Count
>=
3
)
return
false
;
if
(
AI
.
Utils
.
ChainContainsCard
(
_CardId
.
EffectVeiler
))
if
(
AI
.
Utils
.
ChainContainsCard
(
_CardId
.
EffectVeiler
))
return
false
;
return
false
;
return
DefaultBreakthroughSkill
();
return
DefaultBreakthroughSkill
();
...
@@ -433,7 +433,7 @@ namespace WindBot.Game.AI
...
@@ -433,7 +433,7 @@ namespace WindBot.Game.AI
{
{
foreach
(
int
id
in
targetList
)
foreach
(
int
id
in
targetList
)
{
{
if
(
AI
.
Utils
.
GetLastChainCard
().
I
d
==
id
)
if
(
AI
.
Utils
.
GetLastChainCard
().
I
sCode
(
id
)
)
{
{
AI
.
SelectCard
(
id
);
AI
.
SelectCard
(
id
);
return
UniqueFaceupSpell
();
return
UniqueFaceupSpell
();
...
@@ -479,7 +479,7 @@ namespace WindBot.Game.AI
...
@@ -479,7 +479,7 @@ namespace WindBot.Game.AI
if
(
Bot
.
BattlingMonster
!=
null
&&
Enemy
.
BattlingMonster
!=
null
)
if
(
Bot
.
BattlingMonster
!=
null
&&
Enemy
.
BattlingMonster
!=
null
)
{
{
if
(!
Enemy
.
BattlingMonster
.
IsDisabled
()
&&
Enemy
.
BattlingMonster
.
I
d
==
_CardId
.
EaterOfMillions
)
if
(!
Enemy
.
BattlingMonster
.
IsDisabled
()
&&
Enemy
.
BattlingMonster
.
I
sCode
(
_CardId
.
EaterOfMillions
)
)
{
{
AI
.
SelectCard
(
Enemy
.
BattlingMonster
);
AI
.
SelectCard
(
Enemy
.
BattlingMonster
);
return
true
;
return
true
;
...
@@ -659,7 +659,7 @@ namespace WindBot.Game.AI
...
@@ -659,7 +659,7 @@ namespace WindBot.Game.AI
ClientCard
card
=
null
;
ClientCard
card
=
null
;
foreach
(
ClientCard
check
in
Bot
.
GetSpells
())
foreach
(
ClientCard
check
in
Bot
.
GetSpells
())
{
{
if
(
check
.
I
d
==
_CardId
.
AntiSpellFragrance
&&
!
check
.
IsDisabled
())
if
(
check
.
I
sCode
(
_CardId
.
AntiSpellFragrance
)
&&
!
check
.
IsDisabled
())
card
=
check
;
card
=
check
;
}
}
if
(
card
!=
null
&&
card
.
IsFaceup
())
if
(
card
!=
null
&&
card
.
IsFaceup
())
...
@@ -715,7 +715,7 @@ namespace WindBot.Game.AI
...
@@ -715,7 +715,7 @@ namespace WindBot.Game.AI
/// </summary>
/// </summary>
protected
bool
UniqueFaceupSpell
()
protected
bool
UniqueFaceupSpell
()
{
{
return
!
Bot
.
GetSpells
().
Any
(
card
=>
card
.
I
d
==
Card
.
Id
&&
card
.
IsFaceup
());
return
!
Bot
.
GetSpells
().
Any
(
card
=>
card
.
I
sCode
(
Card
.
Id
)
&&
card
.
IsFaceup
());
}
}
/// <summary>
/// <summary>
...
@@ -723,7 +723,7 @@ namespace WindBot.Game.AI
...
@@ -723,7 +723,7 @@ namespace WindBot.Game.AI
/// </summary>
/// </summary>
protected
bool
UniqueFaceupMonster
()
protected
bool
UniqueFaceupMonster
()
{
{
return
!
Bot
.
GetMonsters
().
Any
(
card
=>
card
.
I
d
==
Card
.
Id
&&
card
.
IsFaceup
());
return
!
Bot
.
GetMonsters
().
Any
(
card
=>
card
.
I
sCode
(
Card
.
Id
)
&&
card
.
IsFaceup
());
}
}
/// <summary>
/// <summary>
...
@@ -917,7 +917,7 @@ namespace WindBot.Game.AI
...
@@ -917,7 +917,7 @@ namespace WindBot.Game.AI
};
};
foreach
(
ClientCard
monster
in
Enemy
.
GetMonsters
())
foreach
(
ClientCard
monster
in
Enemy
.
GetMonsters
())
{
{
if
(
kaijus
.
Contains
(
monster
.
Id
))
if
(
monster
.
IsCode
(
kaijus
))
return
Card
.
GetDefensePower
()
>
monster
.
GetDefensePower
();
return
Card
.
GetDefensePower
()
>
monster
.
GetDefensePower
();
}
}
ClientCard
card
=
Enemy
.
MonsterZone
.
GetFloodgate
();
ClientCard
card
=
Enemy
.
MonsterZone
.
GetFloodgate
();
...
...
Game/ClientCard.cs
View file @
f8435d17
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
YGOSharp.OCGWrapper
;
using
YGOSharp.OCGWrapper
;
using
YGOSharp.OCGWrapper.Enums
;
using
YGOSharp.OCGWrapper.Enums
;
...
@@ -72,7 +73,11 @@ namespace WindBot.Game
...
@@ -72,7 +73,11 @@ namespace WindBot.Game
Id
=
id
;
Id
=
id
;
Data
=
NamedCard
.
Get
(
Id
);
Data
=
NamedCard
.
Get
(
Id
);
if
(
Data
!=
null
)
if
(
Data
!=
null
)
{
Name
=
Data
.
Name
;
Name
=
Data
.
Name
;
if
(
Data
.
Alias
!=
0
)
Alias
=
Data
.
Alias
;
}
}
}
public
void
Update
(
BinaryReader
packet
,
Duel
duel
)
public
void
Update
(
BinaryReader
packet
,
Duel
duel
)
...
@@ -274,6 +279,21 @@ namespace WindBot.Game
...
@@ -274,6 +279,21 @@ namespace WindBot.Game
return
Disabled
!=
0
;
return
Disabled
!=
0
;
}
}
public
bool
IsCode
(
int
id
)
{
return
Id
==
id
||
Alias
!=
0
&&
Alias
==
id
;
}
public
bool
IsCode
(
IList
<
int
>
ids
)
{
return
ids
.
Contains
(
Id
)
||
Alias
!=
0
&&
ids
.
Contains
(
Alias
);
}
public
bool
IsCode
(
params
int
[]
ids
)
{
return
ids
.
Contains
(
Id
)
||
Alias
!=
0
&&
ids
.
Contains
(
Alias
);
}
public
bool
HasXyzMaterial
()
public
bool
HasXyzMaterial
()
{
{
return
Overlays
.
Count
>
0
;
return
Overlays
.
Count
>
0
;
...
...
Game/ClientField.cs
View file @
f8435d17
...
@@ -300,10 +300,10 @@ namespace WindBot.Game
...
@@ -300,10 +300,10 @@ namespace WindBot.Game
public
int
GetRemainingCount
(
int
cardId
,
int
initialCount
)
public
int
GetRemainingCount
(
int
cardId
,
int
initialCount
)
{
{
int
remaining
=
initialCount
;
int
remaining
=
initialCount
;
remaining
=
remaining
-
Hand
.
Count
(
card
=>
card
!=
null
&&
card
.
I
d
==
cardId
);
remaining
=
remaining
-
Hand
.
Count
(
card
=>
card
!=
null
&&
card
.
I
sCode
(
cardId
)
);
remaining
=
remaining
-
SpellZone
.
Count
(
card
=>
card
!=
null
&&
card
.
I
d
==
cardId
);
remaining
=
remaining
-
SpellZone
.
Count
(
card
=>
card
!=
null
&&
card
.
I
sCode
(
cardId
)
);
remaining
=
remaining
-
Graveyard
.
Count
(
card
=>
card
!=
null
&&
card
.
I
d
==
cardId
);
remaining
=
remaining
-
Graveyard
.
Count
(
card
=>
card
!=
null
&&
card
.
I
sCode
(
cardId
)
);
remaining
=
remaining
-
Banished
.
Count
(
card
=>
card
!=
null
&&
card
.
I
d
==
cardId
);
remaining
=
remaining
-
Banished
.
Count
(
card
=>
card
!=
null
&&
card
.
I
sCode
(
cardId
)
);
return
(
remaining
<
0
)
?
0
:
remaining
;
return
(
remaining
<
0
)
?
0
:
remaining
;
}
}
...
@@ -314,12 +314,12 @@ namespace WindBot.Game
...
@@ -314,12 +314,12 @@ namespace WindBot.Game
public
int
GetCountCardInZone
(
IEnumerable
<
ClientCard
>
cards
,
int
cardId
)
public
int
GetCountCardInZone
(
IEnumerable
<
ClientCard
>
cards
,
int
cardId
)
{
{
return
cards
.
Count
(
card
=>
card
!=
null
&&
card
.
I
d
==
cardId
);
return
cards
.
Count
(
card
=>
card
!=
null
&&
card
.
I
sCode
(
cardId
)
);
}
}
public
int
GetCountCardInZone
(
IEnumerable
<
ClientCard
>
cards
,
List
<
int
>
cardId
)
public
int
GetCountCardInZone
(
IEnumerable
<
ClientCard
>
cards
,
List
<
int
>
cardId
)
{
{
return
cards
.
Count
(
card
=>
card
!=
null
&&
card
Id
.
Contains
(
card
.
Id
));
return
cards
.
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
card
Id
));
}
}
private
static
List
<
ClientCard
>
GetCards
(
IEnumerable
<
ClientCard
>
cards
,
CardType
type
)
private
static
List
<
ClientCard
>
GetCards
(
IEnumerable
<
ClientCard
>
cards
,
CardType
type
)
...
@@ -334,12 +334,12 @@ namespace WindBot.Game
...
@@ -334,12 +334,12 @@ namespace WindBot.Game
private
static
bool
HasInCards
(
IEnumerable
<
ClientCard
>
cards
,
int
cardId
,
bool
notDisabled
=
false
,
bool
hasXyzMaterial
=
false
,
bool
faceUp
=
false
)
private
static
bool
HasInCards
(
IEnumerable
<
ClientCard
>
cards
,
int
cardId
,
bool
notDisabled
=
false
,
bool
hasXyzMaterial
=
false
,
bool
faceUp
=
false
)
{
{
return
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
I
d
==
cardId
&&
!(
notDisabled
&&
card
.
IsDisabled
())
&&
!(
hasXyzMaterial
&&
!
card
.
HasXyzMaterial
())
&&
!(
faceUp
&&
card
.
IsFacedown
()));
return
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
I
sCode
(
cardId
)
&&
!(
notDisabled
&&
card
.
IsDisabled
())
&&
!(
hasXyzMaterial
&&
!
card
.
HasXyzMaterial
())
&&
!(
faceUp
&&
card
.
IsFacedown
()));
}
}
private
static
bool
HasInCards
(
IEnumerable
<
ClientCard
>
cards
,
IList
<
int
>
cardId
,
bool
notDisabled
=
false
,
bool
hasXyzMaterial
=
false
,
bool
faceUp
=
false
)
private
static
bool
HasInCards
(
IEnumerable
<
ClientCard
>
cards
,
IList
<
int
>
cardId
,
bool
notDisabled
=
false
,
bool
hasXyzMaterial
=
false
,
bool
faceUp
=
false
)
{
{
return
cards
.
Any
(
card
=>
card
!=
null
&&
card
Id
.
Contains
(
card
.
Id
)
&&
!(
notDisabled
&&
card
.
IsDisabled
())
&&
!(
hasXyzMaterial
&&
!
card
.
HasXyzMaterial
())
&&
!(
faceUp
&&
card
.
IsFacedown
()));
return
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
IsCode
(
card
Id
)
&&
!(
notDisabled
&&
card
.
IsDisabled
())
&&
!(
hasXyzMaterial
&&
!
card
.
HasXyzMaterial
())
&&
!(
faceUp
&&
card
.
IsFacedown
()));
}
}
}
}
}
}
\ No newline at end of file
Game/GameBehavior.cs
View file @
f8435d17
...
@@ -1086,7 +1086,8 @@ namespace WindBot.Game
...
@@ -1086,7 +1086,8 @@ namespace WindBot.Game
return
;
return
;
}
}
if
(
card
.
Id
==
0
)
card
.
SetId
(
cardId
);
if
(
card
.
Id
==
0
)
card
.
SetId
(
cardId
);
int
reply
=
_ai
.
OnSelectEffectYn
(
card
,
desc
)
?
(
1
)
:
(
0
);
int
reply
=
_ai
.
OnSelectEffectYn
(
card
,
desc
)
?
(
1
)
:
(
0
);
Connection
.
Send
(
CtosMessage
.
Response
,
reply
);
Connection
.
Send
(
CtosMessage
.
Response
,
reply
);
...
...
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