Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
windbot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HiiragiGuardians
windbot
Commits
b225efae
Commit
b225efae
authored
Nov 03, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ai util functions
parent
fc10fcec
Changes
28
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
300 additions
and
387 deletions
+300
-387
Game/AI/AIFunctions.cs
Game/AI/AIFunctions.cs
+151
-63
Game/AI/CardContainer.cs
Game/AI/CardContainer.cs
+17
-14
Game/AI/CardExtension.cs
Game/AI/CardExtension.cs
+6
-5
Game/AI/Decks/BlueEyesExecutor.cs
Game/AI/Decks/BlueEyesExecutor.cs
+25
-50
Game/AI/Decks/DragunityExecutor.cs
Game/AI/Decks/DragunityExecutor.cs
+9
-11
Game/AI/Decks/FrogExecutor.cs
Game/AI/Decks/FrogExecutor.cs
+1
-1
Game/AI/Decks/LightswornExecutor.cs
Game/AI/Decks/LightswornExecutor.cs
+7
-7
Game/AI/Decks/NekrozExecutor.cs
Game/AI/Decks/NekrozExecutor.cs
+3
-3
Game/AI/Decks/OldSchoolExecutor.cs
Game/AI/Decks/OldSchoolExecutor.cs
+1
-1
Game/AI/Decks/QliphortExecutor.cs
Game/AI/Decks/QliphortExecutor.cs
+9
-52
Game/AI/Decks/RainbowExecutor.cs
Game/AI/Decks/RainbowExecutor.cs
+13
-16
Game/AI/Decks/Rank5Executor.cs
Game/AI/Decks/Rank5Executor.cs
+3
-25
Game/AI/Decks/ST1732Executor.cs
Game/AI/Decks/ST1732Executor.cs
+3
-3
Game/AI/Decks/ToadallyAwesomeExecutor.cs
Game/AI/Decks/ToadallyAwesomeExecutor.cs
+5
-5
Game/AI/Decks/YosenjuExecutor.cs
Game/AI/Decks/YosenjuExecutor.cs
+5
-5
Game/AI/Decks/ZoodiacExecutor.cs
Game/AI/Decks/ZoodiacExecutor.cs
+7
-46
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+19
-25
Game/AI/Enums/DangerousMonster.cs
Game/AI/Enums/DangerousMonster.cs
+4
-3
Game/AI/Enums/Floodgate.cs
Game/AI/Enums/Floodgate.cs
+6
-0
Game/AI/Enums/InvincibleMonster.cs
Game/AI/Enums/InvincibleMonster.cs
+3
-0
Game/AI/Enums/NegateAttackSpell.cs
Game/AI/Enums/NegateAttackSpell.cs
+0
-10
Game/AI/Enums/NegatesEffects.cs
Game/AI/Enums/NegatesEffects.cs
+0
-8
Game/AI/Enums/NegatesSpells.cs
Game/AI/Enums/NegatesSpells.cs
+0
-8
Game/AI/Enums/NegatesSummons.cs
Game/AI/Enums/NegatesSummons.cs
+0
-12
Game/AI/Enums/NegatesTraps.cs
Game/AI/Enums/NegatesTraps.cs
+0
-8
Game/GameAI.cs
Game/GameAI.cs
+1
-1
README.md
README.md
+2
-0
WindBot.csproj
WindBot.csproj
+0
-5
No files found.
Game/AI/AIFunctions.cs
View file @
b225efae
This diff is collapsed.
Click to expand it.
Game/AI/CardContainer.cs
View file @
b225efae
...
...
@@ -12,7 +12,7 @@ namespace WindBot.Game.AI
ClientCard
selected
=
null
;
foreach
(
ClientCard
card
in
cards
)
{
if
(
card
==
null
||
card
.
Data
==
null
)
continue
;
if
(
card
==
null
||
card
.
Data
==
null
||
card
.
IsFacedown
()
)
continue
;
if
(
card
.
HasType
(
CardType
.
Monster
)
&&
card
.
Attack
>
highestAtk
)
{
highestAtk
=
card
.
Attack
;
...
...
@@ -28,7 +28,7 @@ namespace WindBot.Game.AI
ClientCard
selected
=
null
;
foreach
(
ClientCard
card
in
cards
)
{
if
(
card
==
null
||
card
.
Data
==
null
)
continue
;
if
(
card
==
null
||
card
.
Data
==
null
||
card
.
IsFacedown
()
)
continue
;
if
(
card
.
HasType
(
CardType
.
Monster
)
&&
card
.
Defense
>
highestDef
)
{
highestDef
=
card
.
Defense
;
...
...
@@ -44,7 +44,7 @@ namespace WindBot.Game.AI
ClientCard
selected
=
null
;
foreach
(
ClientCard
card
in
cards
)
{
if
(
card
==
null
||
card
.
Data
==
null
)
continue
;
if
(
card
==
null
||
card
.
Data
==
null
||
card
.
IsFacedown
()
)
continue
;
if
(
lowestAtk
==
0
&&
card
.
HasType
(
CardType
.
Monster
)
||
card
.
HasType
(
CardType
.
Monster
)
&&
card
.
Attack
<
lowestAtk
)
{
...
...
@@ -61,7 +61,7 @@ namespace WindBot.Game.AI
ClientCard
selected
=
null
;
foreach
(
ClientCard
card
in
cards
)
{
if
(
card
==
null
||
card
.
Data
==
null
)
continue
;
if
(
card
==
null
||
card
.
Data
==
null
||
card
.
IsFacedown
()
)
continue
;
if
(
lowestDef
==
0
&&
card
.
HasType
(
CardType
.
Monster
)
||
card
.
HasType
(
CardType
.
Monster
)
&&
card
.
Defense
<
lowestDef
)
{
...
...
@@ -131,36 +131,39 @@ namespace WindBot.Game.AI
continue
;
if
(
card
.
HasType
(
CardType
.
Monster
))
cardlist
.
Add
(
card
);
}
return
cardlist
;
}
public
static
ClientCard
GetInvincibleMonster
(
this
IEnumerable
<
ClientCard
>
cards
)
public
static
IList
<
ClientCard
>
GetFaceupPendulumMonsters
(
this
IEnumerable
<
ClientCard
>
cards
)
{
IList
<
ClientCard
>
cardlist
=
new
List
<
ClientCard
>();
foreach
(
ClientCard
card
in
cards
)
{
if
(
card
!=
null
&&
card
.
IsMonsterInvincible
())
return
card
;
if
(
card
==
null
)
continue
;
if
(
card
.
HasType
(
CardType
.
Monster
)
&&
card
.
IsFaceup
()
&&
card
.
HasType
(
CardType
.
Pendulum
))
cardlist
.
Add
(
card
);
}
return
null
;
return
cardlist
;
}
public
static
ClientCard
Get
Dangerous
Monster
(
this
IEnumerable
<
ClientCard
>
cards
)
public
static
ClientCard
Get
Invincible
Monster
(
this
IEnumerable
<
ClientCard
>
cards
)
{
foreach
(
ClientCard
card
in
cards
)
{
if
(
card
!=
null
&&
card
.
IsMonster
Dangerous
())
if
(
card
!=
null
&&
card
.
IsMonster
Invincible
()
&&
card
.
IsFaceup
())
return
card
;
}
return
null
;
}
public
static
ClientCard
Get
NegateAttackSpell
(
this
IEnumerable
<
ClientCard
>
cards
)
public
static
ClientCard
Get
DangerousMonster
(
this
IEnumerable
<
ClientCard
>
cards
)
{
foreach
(
ClientCard
card
in
cards
)
{
if
(
card
!=
null
&&
card
.
Is
SpellNegateAttack
())
if
(
card
!=
null
&&
card
.
Is
MonsterDangerous
()
&&
card
.
IsFaceup
())
return
card
;
}
return
null
;
...
...
@@ -170,7 +173,7 @@ namespace WindBot.Game.AI
{
foreach
(
ClientCard
card
in
cards
)
{
if
(
card
!=
null
&&
card
.
IsFloodgate
())
if
(
card
!=
null
&&
card
.
IsFloodgate
()
&&
card
.
IsFaceup
()
)
return
card
;
}
return
null
;
...
...
Game/AI/CardExtension.cs
View file @
b225efae
...
...
@@ -5,21 +5,22 @@ namespace WindBot.Game.AI
{
public
static
class
CardExtension
{
/// <summary>
/// Is this monster is invincible to battle?
/// </summary>
public
static
bool
IsMonsterInvincible
(
this
ClientCard
card
)
{
return
Enum
.
IsDefined
(
typeof
(
InvincibleMonster
),
card
.
Id
);
}
/// <summary>
/// Is this monster is dangerous to attack?
/// </summary>
public
static
bool
IsMonsterDangerous
(
this
ClientCard
card
)
{
return
Enum
.
IsDefined
(
typeof
(
DangerousMonster
),
card
.
Id
);
}
public
static
bool
IsSpellNegateAttack
(
this
ClientCard
card
)
{
return
Enum
.
IsDefined
(
typeof
(
NegateAttackSpell
),
card
.
Id
);
}
public
static
bool
IsFloodgate
(
this
ClientCard
card
)
{
return
Enum
.
IsDefined
(
typeof
(
Floodgate
),
card
.
Id
);
...
...
Game/AI/Decks/BlueEyesExecutor.cs
View file @
b225efae
...
...
@@ -99,10 +99,10 @@ namespace WindBot.Game.AI.Decks
// special summon from extra
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
GalaxyEyesCipherDragon
,
GalaxyEyesCipherDragonSummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
GalaxyEyesPrimePhotonDragon
,
GalaxyEyesPrimePhotonDragonSum
om
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
GalaxyEyesPrimePhotonDragon
,
GalaxyEyesPrimePhotonDragonSum
mon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
GalaxyEyesFullArmorPhotonDragon
,
GalaxyEyesFullArmorPhotonDragonSummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
GalaxyEyesCipherBladeDragon
,
GalaxyEyesCipherBladeDragonSummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
GalaxyEyesDarkMatterDragon
,
GalaxyEyesDarkMatterDragonSummo
m
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
GalaxyEyesDarkMatterDragon
,
GalaxyEyesDarkMatterDragonSummo
n
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
Giganticastle
,
GiganticastleSummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
BlueEyesSpiritDragon
,
BlueEyesSpiritDragonSummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
HopeHarbingerDragonTitanicGalaxy
,
HopeHarbingerDragonTitanicGalaxySummon
);
...
...
@@ -332,28 +332,7 @@ namespace WindBot.Game.AI.Decks
private
bool
AlternativeWhiteDragonEffect
()
{
ClientCard
card
=
Enemy
.
MonsterZone
.
GetFloodgate
();
if
(
card
!=
null
)
{
AI
.
SelectCard
(
card
);
UsedAlternativeWhiteDragon
.
Add
(
Card
);
return
true
;
}
card
=
Enemy
.
MonsterZone
.
GetInvincibleMonster
();
if
(
card
!=
null
)
{
AI
.
SelectCard
(
card
);
UsedAlternativeWhiteDragon
.
Add
(
Card
);
return
true
;
}
card
=
Enemy
.
MonsterZone
.
GetDangerousMonster
();
if
(
card
!=
null
)
{
AI
.
SelectCard
(
card
);
UsedAlternativeWhiteDragon
.
Add
(
Card
);
return
true
;
}
card
=
AI
.
Utils
.
GetOneEnemyBetterThanValue
(
Card
.
GetDefensePower
(),
false
);
ClientCard
card
=
AI
.
Utils
.
GetProblematicEnemyMonster
(
Card
.
GetDefensePower
());
if
(
card
!=
null
)
{
AI
.
SelectCard
(
card
);
...
...
@@ -362,6 +341,8 @@ namespace WindBot.Game.AI.Decks
}
if
(
CanDealWithUsedAlternativeWhiteDragon
())
{
card
=
AI
.
Utils
.
GetBestEnemyMonster
();
AI
.
SelectCard
(
card
);
UsedAlternativeWhiteDragon
.
Add
(
Card
);
return
true
;
}
...
...
@@ -487,7 +468,7 @@ namespace WindBot.Game.AI.Decks
{
if
(
ActivateDescription
==
-
1
)
{
ClientCard
target
=
Enemy
.
SpellZone
.
GetFloodgate
();
ClientCard
target
=
AI
.
Utils
.
GetBestEnemySpell
();
AI
.
SelectCard
(
target
);
return
true
;
}
...
...
@@ -504,12 +485,9 @@ namespace WindBot.Game.AI.Decks
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
DragonSpiritOfWhite
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
WhiteDragon
);
}
foreach
(
ClientCard
card
in
Duel
.
ChainTargets
)
if
(
AI
.
Utils
.
IsChainTarget
(
Card
)
)
{
if
(
Card
.
Equals
(
card
))
{
return
HaveEnoughWhiteDragonInHand
();
}
return
HaveEnoughWhiteDragonInHand
();
}
return
false
;
}
...
...
@@ -528,13 +506,10 @@ namespace WindBot.Game.AI.Decks
}
else
{
foreach
(
ClientCard
card
in
Duel
.
ChainTargets
)
if
(
AI
.
Utils
.
IsChainTarget
(
Card
)
)
{
if
(
Card
.
Equals
(
card
))
{
AI
.
SelectCard
((
int
)
CardId
.
AzureEyesSilverDragon
);
return
true
;
}
AI
.
SelectCard
((
int
)
CardId
.
AzureEyesSilverDragon
);
return
true
;
}
return
false
;
}
...
...
@@ -638,7 +613,7 @@ namespace WindBot.Game.AI.Decks
return
false
;
}
private
bool
GalaxyEyesPrimePhotonDragonSum
om
()
private
bool
GalaxyEyesPrimePhotonDragonSum
mon
()
{
if
(
Duel
.
Turn
==
1
)
{
...
...
@@ -679,7 +654,7 @@ namespace WindBot.Game.AI.Decks
private
bool
GalaxyEyesCipherBladeDragonSummon
()
{
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
GalaxyEyesFullArmorPhotonDragon
)
&&
AI
.
Utils
.
GetProblematicCard
()
!=
null
)
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
GalaxyEyesFullArmorPhotonDragon
)
&&
AI
.
Utils
.
GetProblematic
Enemy
Card
()
!=
null
)
{
AI
.
SelectCard
((
int
)
CardId
.
GalaxyEyesFullArmorPhotonDragon
);
return
true
;
...
...
@@ -687,7 +662,7 @@ namespace WindBot.Game.AI.Decks
return
false
;
}
private
bool
GalaxyEyesDarkMatterDragonSummo
m
()
private
bool
GalaxyEyesDarkMatterDragonSummo
n
()
{
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
GalaxyEyesFullArmorPhotonDragon
))
{
...
...
@@ -729,22 +704,22 @@ namespace WindBot.Game.AI.Decks
private
bool
GalaxyEyesFullArmorPhotonDragonEffect
()
{
ClientCard
floodgate
=
Enemy
.
SpellZone
.
GetFloodgate
();
if
(
floodgate
!=
null
)
ClientCard
target
=
AI
.
Utils
.
GetProblematicEnemySpell
();
if
(
target
!=
null
)
{
AI
.
SelectCard
(
floodgate
);
AI
.
SelectCard
(
target
);
return
true
;
}
floodgate
=
Enemy
.
MonsterZone
.
GetFloodgate
();
if
(
floodgate
!=
null
)
target
=
AI
.
Utils
.
GetProblematicEnemyMonster
();
if
(
target
!=
null
)
{
AI
.
SelectCard
(
floodgate
);
AI
.
SelectCard
(
target
);
return
true
;
}
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
!
spell
.
IsFacedown
())
if
(
spell
.
IsFaceup
())
{
AI
.
SelectCard
(
spell
);
return
true
;
...
...
@@ -787,7 +762,7 @@ namespace WindBot.Game.AI.Decks
{
return
true
;
}
ClientCard
target
=
AI
.
Utils
.
GetProblematicCard
();
ClientCard
target
=
AI
.
Utils
.
GetProblematic
Enemy
Card
();
if
(
target
!=
null
)
{
AI
.
SelectCard
(
target
);
...
...
@@ -847,8 +822,8 @@ namespace WindBot.Game.AI.Decks
{
if
(
Duel
.
Phase
!=
DuelPhase
.
Main1
||
Duel
.
Turn
==
1
||
SoulChargeUsed
)
return
false
;
int
bestSelfAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
false
);
int
bestEnemyAttack
=
AI
.
Utils
.
GetBest
Attack
(
Enemy
,
false
);
int
bestSelfAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
);
int
bestEnemyAttack
=
AI
.
Utils
.
GetBest
Power
(
Enemy
);
return
bestSelfAttack
<=
bestEnemyAttack
&&
bestEnemyAttack
>
2500
&&
bestEnemyAttack
<=
3100
;
}
...
...
@@ -973,7 +948,7 @@ namespace WindBot.Game.AI.Decks
private
bool
Repos
()
{
bool
enemyBetter
=
AI
.
Utils
.
Is
EnemyBetter
(
true
,
true
);
bool
enemyBetter
=
AI
.
Utils
.
Is
AllEnemyBetter
(
true
);
if
(
Card
.
IsAttack
()
&&
enemyBetter
)
return
true
;
...
...
Game/AI/Decks/DragunityExecutor.cs
View file @
b225efae
...
...
@@ -344,32 +344,30 @@ namespace WindBot.Game.AI.Decks
{
//if (AI.Utils.IsOneEnemyBetterThanValue(2500, true))
// return true;
ClientCard
invincible
=
AI
.
Utils
.
GetProblematicCard
();
ClientCard
invincible
=
AI
.
Utils
.
GetProblematic
Enemy
Card
();
return
invincible
!=
null
;
}
private
bool
ScrapDragonEffect
()
{
ClientCard
invincible
=
AI
.
Utils
.
GetProblematicCard
();
ClientCard
invincible
=
AI
.
Utils
.
GetProblematic
Enemy
Card
();
if
(
invincible
==
null
&&
!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
2800
-
1
,
false
))
return
false
;
ClientField
field
=
Bot
;
int
tributeId
=
-
1
;
if
(
field
.
HasInSpellZone
((
int
)
CardId
.
FireFormationTenki
))
if
(
Bot
.
HasInSpellZone
((
int
)
CardId
.
FireFormationTenki
))
tributeId
=
(
int
)
CardId
.
FireFormationTenki
;
else
if
(
field
.
HasInSpellZone
((
int
)
CardId
.
Terraforming
))
else
if
(
Bot
.
HasInSpellZone
((
int
)
CardId
.
Terraforming
))
tributeId
=
(
int
)
CardId
.
Terraforming
;
else
if
(
field
.
HasInSpellZone
((
int
)
CardId
.
DragonsMirror
))
else
if
(
Bot
.
HasInSpellZone
((
int
)
CardId
.
DragonsMirror
))
tributeId
=
(
int
)
CardId
.
DragonsMirror
;
else
if
(
field
.
HasInSpellZone
((
int
)
CardId
.
CardsOfConsonance
))
else
if
(
Bot
.
HasInSpellZone
((
int
)
CardId
.
CardsOfConsonance
))
tributeId
=
(
int
)
CardId
.
CardsOfConsonance
;
else
if
(
field
.
HasInSpellZone
((
int
)
CardId
.
AssaultTeleport
))
else
if
(
Bot
.
HasInSpellZone
((
int
)
CardId
.
AssaultTeleport
))
tributeId
=
(
int
)
CardId
.
AssaultTeleport
;
else
if
(
field
.
HasInSpellZone
((
int
)
CardId
.
AssaultModeActivate
))
else
if
(
Bot
.
HasInSpellZone
((
int
)
CardId
.
AssaultModeActivate
))
tributeId
=
(
int
)
CardId
.
AssaultModeActivate
;
else
if
(
field
.
HasInSpellZone
((
int
)
CardId
.
DragonRavine
))
else
if
(
Bot
.
HasInSpellZone
((
int
)
CardId
.
DragonRavine
))
tributeId
=
(
int
)
CardId
.
DragonRavine
;
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
...
...
Game/AI/Decks/FrogExecutor.cs
View file @
b225efae
...
...
@@ -165,7 +165,7 @@ namespace WindBot.Game.AI.Decks
{
List
<
int
>
cards
=
new
List
<
int
>();
if
(
AI
.
Utils
.
Is
EnemyBetter
(
false
,
false
))
if
(
AI
.
Utils
.
Is
OneEnemyBetter
(
))
{
cards
.
Add
((
int
)
CardId
.
FlipFlopFrog
);
}
...
...
Game/AI/Decks/LightswornExecutor.cs
View file @
b225efae
...
...
@@ -74,7 +74,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
EvilswarmExcitonKnight
,
EvilswarmExcitonKnightSummon
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
EvilswarmExcitonKnight
,
EvilswarmExcitonKnightEffect
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
CastelTheSkyblasterMusketeer
,
CastelTheSkyblasterMusketeerSummo
m
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
CastelTheSkyblasterMusketeer
,
CastelTheSkyblasterMusketeerSummo
n
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
CastelTheSkyblasterMusketeer
,
CastelTheSkyblasterMusketeerEffect
);
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
ScarlightRedDragonArchfiend
,
ScarlightRedDragonArchfiendSummon
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
ScarlightRedDragonArchfiend
,
ScarlightRedDragonArchfiendEffect
);
...
...
@@ -249,8 +249,8 @@ namespace WindBot.Game.AI.Decks
private
bool
ScarlightRedDragonArchfiendSummon
()
{
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBest
Attack
(
Enemy
,
false
);
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBest
Power
(
Enemy
);
return
(
selfBestAttack
<=
oppoBestAttack
&&
oppoBestAttack
<=
3000
)
||
ScarlightRedDragonArchfiendEffect
();
}
...
...
@@ -275,22 +275,22 @@ namespace WindBot.Game.AI.Decks
return
(
oppoCount
>
0
&&
selfCount
<=
oppoCount
)
||
oppoCount
>
2
;
}
private
bool
CastelTheSkyblasterMusketeerSummo
m
()
private
bool
CastelTheSkyblasterMusketeerSummo
n
()
{
return
AI
.
Utils
.
GetProblematicCard
()
!=
null
;
return
AI
.
Utils
.
GetProblematic
Enemy
Card
()
!=
null
;
}
private
bool
CastelTheSkyblasterMusketeerEffect
()
{
if
(
ActivateDescription
==
AI
.
Utils
.
GetStringId
((
int
)
CardId
.
CastelTheSkyblasterMusketeer
,
0
))
return
false
;
AI
.
SelectNextCard
(
AI
.
Utils
.
GetProblematicCard
());
AI
.
SelectNextCard
(
AI
.
Utils
.
GetProblematic
Enemy
Card
());
return
true
;
}
private
bool
NumberS39UtopiatheLightningSummon
()
{
return
AI
.
Utils
.
Is
EnemyBetter
(
false
,
false
);
return
AI
.
Utils
.
Is
OneEnemyBetter
(
);
}
}
}
\ No newline at end of file
Game/AI/Decks/NekrozExecutor.cs
View file @
b225efae
...
...
@@ -72,7 +72,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SummonOrSet
,
(
int
)
CardId
.
DancePrincess
,
DancePrincessSummon
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
(
int
)
CardId
.
Shurit
,
ShuritSet
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
ThousandHands
,
ThousandHandsSummo
m
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
ThousandHands
,
ThousandHandsSummo
n
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
TenThousandHands
,
TenThousandHandsSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
PhantomOfChaos
,
PhantomOfChaosSummon
);
...
...
@@ -101,7 +101,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
EvilswarmExcitonKnight
,
EvilswarmExcitonKnightSummon
);
}
private
bool
ThousandHandsSummo
m
()
private
bool
ThousandHandsSummo
n
()
{
if
(!
Bot
.
HasInHand
(
NekrozRituelCard
)
||
Bot
.
HasInHand
((
int
)
CardId
.
Shurit
)
||
!
Bot
.
HasInHand
(
NekrozSpellCard
))
return
true
;
...
...
@@ -190,7 +190,7 @@ namespace WindBot.Game.AI.Decks
private
bool
GungnirEffect
()
{
if
(
AI
.
Utils
.
Is
EnemyBetter
(
true
,
fals
e
)
&&
Duel
.
Phase
==
DuelPhase
.
Main1
)
if
(
AI
.
Utils
.
Is
OneEnemyBetter
(
tru
e
)
&&
Duel
.
Phase
==
DuelPhase
.
Main1
)
{
AI
.
SelectCard
(
Enemy
.
GetMonsters
().
GetHighestAttackMonster
());
return
true
;
...
...
Game/AI/Decks/OldSchoolExecutor.cs
View file @
b225efae
...
...
@@ -91,7 +91,7 @@ namespace WindBot.Game.AI.Decks
if
(
handCard
.
IsFacedown
())
return
true
;
}
return
AI
.
Utils
.
Is
EnemyBetter
(
true
,
fals
e
);
return
AI
.
Utils
.
Is
OneEnemyBetter
(
tru
e
);
}
}
}
\ No newline at end of file
Game/AI/Decks/QliphortExecutor.cs
View file @
b225efae
...
...
@@ -244,10 +244,9 @@ namespace WindBot.Game.AI.Decks
if
(!
Card
.
Equals
(
card
))
count
++;
}
foreach
(
ClientCard
card
in
Bot
.
ExtraDeck
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
ExtraDeck
.
Get
FaceupPendulum
Monsters
())
{
if
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
IsFaceup
())
count
++;
count
++;
}
ClientCard
l
=
AI
.
Utils
.
GetPZone
(
0
,
0
);
ClientCard
r
=
AI
.
Utils
.
GetPZone
(
0
,
1
);
...
...
@@ -290,10 +289,9 @@ namespace WindBot.Game.AI.Decks
{
fieldcount
++;
}
foreach
(
ClientCard
card
in
Bot
.
ExtraDeck
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
ExtraDeck
.
Get
FaceupPendulum
Monsters
())
{
if
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
IsFaceup
())
count
++;
count
++;
}
if
(
count
>
0
&&
!
Bot
.
HasInHand
(
LowScaleCards
))
{
...
...
@@ -319,32 +317,12 @@ namespace WindBot.Game.AI.Decks
{
if
(
Card
.
Location
==
CardLocation
.
Hand
)
return
false
;
ClientCard
target
=
AI
.
Utils
.
Get
Problematic
Card
();
ClientCard
target
=
AI
.
Utils
.
Get
BestEnemy
Card
();
if
(
target
!=
null
)
{
AI
.
SelectCard
(
target
);
return
true
;
}
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
AI
.
SelectCard
(
monster
);
return
true
;
}
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFacedown
())
{
AI
.
SelectCard
(
spell
);
return
true
;
}
}
foreach
(
ClientCard
spell
in
spells
)
{
AI
.
SelectCard
(
spell
);
return
true
;
}
return
false
;
}
...
...
@@ -352,18 +330,12 @@ namespace WindBot.Game.AI.Decks
{
if
(
Card
.
Location
==
CardLocation
.
Hand
)
return
false
;
ClientCard
target
=
AI
.
Utils
.
Get
ProblematicMonsterCard
();
ClientCard
target
=
AI
.
Utils
.
Get
BestEnemyMonster
();
if
(
target
!=
null
)
{
AI
.
SelectCard
(
target
);
return
true
;
}
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
AI
.
SelectCard
(
monster
);
return
true
;
}
return
false
;
}
...
...
@@ -371,26 +343,12 @@ namespace WindBot.Game.AI.Decks
{
if
(
Card
.
Location
==
CardLocation
.
Hand
)
return
false
;
ClientCard
target
=
AI
.
Utils
.
Get
ProblematicSpellCard
();
ClientCard
target
=
AI
.
Utils
.
Get
BestEnemySpell
();
if
(
target
!=
null
)
{
AI
.
SelectCard
(
target
);
return
true
;
}
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFacedown
())
{
AI
.
SelectCard
(
spell
);
return
true
;
}
}
foreach
(
ClientCard
spell
in
spells
)
{
AI
.
SelectCard
(
spell
);
return
true
;
}
return
false
;
}
...
...
@@ -405,10 +363,9 @@ namespace WindBot.Game.AI.Decks
{
count
++;
}
foreach
(
ClientCard
card
in
Bot
.
ExtraDeck
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
ExtraDeck
.
Get
FaceupPendulum
Monsters
())
{
if
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
IsFaceup
())
count
++;
count
++;
}
return
count
>
1
;
}
...
...
Game/AI/Decks/RainbowExecutor.cs
View file @
b225efae
...
...
@@ -290,8 +290,8 @@ namespace WindBot.Game.AI.Decks
private
bool
ScarlightRedDragonArchfiendSummon
()
{
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBest
Attack
(
Enemy
,
false
);
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBest
Power
(
Enemy
);
return
(
selfBestAttack
<=
oppoBestAttack
&&
oppoBestAttack
<=
3000
)
||
ScarlightRedDragonArchfiendEffect
();
}
...
...
@@ -319,20 +319,20 @@ namespace WindBot.Game.AI.Decks
private
bool
CastelTheSkyblasterMusketeerSummon
()
{
return
AI
.
Utils
.
GetProblematicCard
()
!=
null
;
return
AI
.
Utils
.
GetProblematic
Enemy
Card
()
!=
null
;
}
private
bool
CastelTheSkyblasterMusketeerEffect
()
{
if
(
ActivateDescription
==
AI
.
Utils
.
GetStringId
((
int
)
CardId
.
CastelTheSkyblasterMusketeer
,
0
))
return
false
;
AI
.
SelectNextCard
(
AI
.
Utils
.
GetProblematicCard
());
AI
.
SelectNextCard
(
AI
.
Utils
.
GetProblematic
Enemy
Card
());
return
true
;
}
private
bool
IgnisterProminenceTheBlastingDracoslayerSummon
()
{
return
AI
.
Utils
.
GetProblematicCard
()
!=
null
;
return
AI
.
Utils
.
GetProblematic
Enemy
Card
()
!=
null
;
}
private
bool
IgnisterProminenceTheBlastingDracoslayerEffect
()
...
...
@@ -340,7 +340,7 @@ namespace WindBot.Game.AI.Decks
if
(
ActivateDescription
==
AI
.
Utils
.
GetStringId
((
int
)
CardId
.
IgnisterProminenceTheBlastingDracoslayer
,
1
))
return
true
;
ClientCard
target1
=
null
;
ClientCard
target2
=
AI
.
Utils
.
GetProblematicCard
();
ClientCard
target2
=
AI
.
Utils
.
GetProblematic
Enemy
Card
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
...
...
@@ -409,19 +409,19 @@ namespace WindBot.Game.AI.Decks
}
}
return
AI
.
Utils
.
GetProblematicCard
()
!=
null
;
return
AI
.
Utils
.
GetProblematic
Enemy
Card
()
!=
null
;
}
private
bool
LightningChidoriEffect
()
{
ClientCard
problematicCard
=
AI
.
Utils
.
GetProblematicCard
();
ClientCard
problematicCard
=
AI
.
Utils
.
GetProblematic
Enemy
Card
();
AI
.
SelectNextCard
(
problematicCard
);
return
true
;
}
private
bool
StardustDragonSummon
()
{
return
(
AI
.
Utils
.
Is
EnemyBetter
(
false
,
false
)
&&
!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
2400
,
true
))
||
AI
.
Utils
.
IsTurn1OrMain2
();
return
(
AI
.
Utils
.
Is
OneEnemyBetter
(
)
&&
!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
2400
,
true
))
||
AI
.
Utils
.
IsTurn1OrMain2
();
}
private
bool
StardustDragonEffect
()
...
...
@@ -457,18 +457,15 @@ namespace WindBot.Game.AI.Decks
private
bool
Number59CrookedCookSummon
()
{
return
((
Bot
.
GetMonsterCount
()
+
Bot
.
GetSpellCount
()
-
2
)
<=
1
)
&&
((
AI
.
Utils
.
Is
EnemyBetter
(
false
,
false
)
&&
!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
2300
,
true
))
||
AI
.
Utils
.
IsTurn1OrMain2
());
((
AI
.
Utils
.
Is
OneEnemyBetter
(
)
&&
!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
2300
,
true
))
||
AI
.
Utils
.
IsTurn1OrMain2
());
}
private
bool
Number59CrookedCookEffect
()
{
if
(
Duel
.
Player
==
0
)
{
foreach
(
ClientCard
card
in
Duel
.
ChainTargets
)
{
if
(
Card
.
Equals
(
card
))
return
true
;
}
if
(
AI
.
Utils
.
IsChainTarget
(
Card
))
return
true
;
}
else
{
...
...
@@ -501,7 +498,7 @@ namespace WindBot.Game.AI.Decks
private
bool
NumberS39UtopiatheLightningSummon
()
{
return
AI
.
Utils
.
Is
EnemyBetter
(
false
,
fals
e
);
return
AI
.
Utils
.
Is
OneEnemyBetter
(
tru
e
);
}
private
bool
TrapSet
()
...
...
Game/AI/Decks/Rank5Executor.cs
View file @
b225efae
...
...
@@ -276,9 +276,7 @@ namespace WindBot.Game.AI.Decks
private
bool
Number61VolcasaurusEffect
()
{
ClientCard
target
=
Enemy
.
MonsterZone
.
GetFloodgate
();
if
(
target
==
null
)
target
=
AI
.
Utils
.
GetOneEnemyBetterThanValue
(
2000
,
false
);
ClientCard
target
=
AI
.
Utils
.
GetProblematicEnemyMonster
(
2000
);
if
(
target
!=
null
)
{
AI
.
SelectCard
((
int
)
CardId
.
CyberDragon
);
...
...
@@ -291,7 +289,7 @@ namespace WindBot.Game.AI.Decks
private
bool
TirasKeeperOfGenesisEffect
()
{
ClientCard
target
=
AI
.
Utils
.
GetProblematicCard
();
ClientCard
target
=
AI
.
Utils
.
GetProblematic
Enemy
Card
();
if
(
target
!=
null
)
{
AI
.
SelectCard
(
target
);
...
...
@@ -346,32 +344,12 @@ namespace WindBot.Game.AI.Decks
private
bool
PanzerDragonEffect
()
{
ClientCard
target
=
AI
.
Utils
.
Get
Problematic
Card
();
ClientCard
target
=
AI
.
Utils
.
Get
BestEnemy
Card
();
if
(
target
!=
null
)
{
AI
.
SelectCard
(
target
);
return
true
;
}
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
AI
.
SelectCard
(
monster
);
return
true
;
}
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFacedown
())
{
AI
.
SelectCard
(
spell
);
return
true
;
}
}
foreach
(
ClientCard
spell
in
spells
)
{
AI
.
SelectCard
(
spell
);
return
true
;
}
return
false
;
}
...
...
Game/AI/Decks/ST1732Executor.cs
View file @
b225efae
...
...
@@ -189,7 +189,7 @@ namespace WindBot.Game.AI.Decks
private
bool
MindControlEffect
()
{
ClientCard
target
=
AI
.
Utils
.
Get
Any
EnemyMonster
();
ClientCard
target
=
AI
.
Utils
.
Get
Best
EnemyMonster
();
if
(
target
!=
null
)
{
AI
.
SelectCard
(
target
);
...
...
@@ -470,8 +470,8 @@ namespace WindBot.Game.AI.Decks
private
bool
LinkSummon
()
{
return
(
AI
.
Utils
.
IsTurn1OrMain2
()
||
AI
.
Utils
.
Is
EnemyBetter
(
false
,
false
))
&&
AI
.
Utils
.
GetBestAttack
(
Bot
,
true
)
<
Card
.
Attack
;
return
(
AI
.
Utils
.
IsTurn1OrMain2
()
||
AI
.
Utils
.
Is
OneEnemyBetter
(
))
&&
AI
.
Utils
.
GetBestAttack
(
Bot
)
<
Card
.
Attack
;
}
}
}
\ No newline at end of file
Game/AI/Decks/ToadallyAwesomeExecutor.cs
View file @
b225efae
...
...
@@ -426,7 +426,7 @@ namespace WindBot.Game.AI.Decks
private
bool
CatSharkSummon
()
{
bool
should
=
Bot
.
HasInMonstersZone
((
int
)
CardId
.
ToadallyAwesome
)
&&
((
AI
.
Utils
.
Is
EnemyBetter
(
true
,
fals
e
)
&&
((
AI
.
Utils
.
Is
OneEnemyBetter
(
tru
e
)
&&
!
Bot
.
HasInMonstersZone
(
new
List
<
int
>
{
(
int
)
CardId
.
CatShark
,
...
...
@@ -485,8 +485,8 @@ namespace WindBot.Game.AI.Decks
num
++;
}
}
return
AI
.
Utils
.
Is
EnemyBetter
(
true
,
fals
e
)
&&
AI
.
Utils
.
GetBestAttack
(
Enemy
,
true
)
>
2200
return
AI
.
Utils
.
Is
OneEnemyBetter
(
tru
e
)
&&
AI
.
Utils
.
GetBestAttack
(
Enemy
)
>
2200
&&
num
<
4
&&
!
Bot
.
HasInMonstersZone
(
new
List
<
int
>
{
...
...
@@ -513,7 +513,7 @@ namespace WindBot.Game.AI.Decks
{
defence
+=
monster
.
GetDefensePower
();
}
if
(
attack
-
2000
-
defence
>
Duel
.
LifePoints
[
1
]
&&
!
AI
.
Utils
.
Is
EnemyBetter
(
true
,
fals
e
))
if
(
attack
-
2000
-
defence
>
Duel
.
LifePoints
[
1
]
&&
!
AI
.
Utils
.
Is
OneEnemyBetter
(
tru
e
))
return
true
;
}
return
false
;
...
...
@@ -527,7 +527,7 @@ namespace WindBot.Game.AI.Decks
private
bool
Repos
()
{
bool
enemyBetter
=
AI
.
Utils
.
Is
EnemyBetter
(
true
,
true
);
bool
enemyBetter
=
AI
.
Utils
.
Is
AllEnemyBetter
(
true
);
if
(
Card
.
IsFacedown
())
return
true
;
...
...
Game/AI/Decks/YosenjuExecutor.cs
View file @
b225efae
...
...
@@ -314,14 +314,14 @@ namespace WindBot.Game.AI.Decks
private
bool
DarkRebellionXyzDragonSummon
()
{
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Enemy
,
true
);
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Enemy
);
return
selfBestAttack
<=
oppoBestAttack
;
}
private
bool
DarkRebellionXyzDragonEffect
()
{
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Enemy
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Enemy
);
ClientCard
target
=
AI
.
Utils
.
GetOneEnemyBetterThanValue
(
oppoBestAttack
,
true
);
if
(
target
!=
null
)
{
...
...
@@ -332,8 +332,8 @@ namespace WindBot.Game.AI.Decks
private
bool
NumberS39UtopiatheLightningSummon
()
{
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBest
Attack
(
Enemy
,
false
);
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBest
Power
(
Enemy
);
return
selfBestAttack
<=
oppoBestAttack
;
}
...
...
Game/AI/Decks/ZoodiacExecutor.cs
View file @
b225efae
...
...
@@ -90,9 +90,9 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SpSummon
,
(
int
)
CardId
.
Drident
,
DridentSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
Ratpier
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
Ratpier
,
Ratpier
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
Ratpier
,
Ratpier
Effect
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
Thoroughblade
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
Thoroughblade
,
Ratpier
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
Thoroughblade
,
Ratpier
Effect
);
AddExecutor
(
ExecutorType
.
Summon
,
(
int
)
CardId
.
AleisterTheInvoker
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
AleisterTheInvoker
,
AleisterTheInvokerEffect
);
...
...
@@ -151,8 +151,8 @@ namespace WindBot.Game.AI.Decks
private
bool
NumberS39UtopiatheLightningSummon
()
{
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBest
Attack
(
Enemy
,
false
);
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBest
Power
(
Enemy
);
return
selfBestAttack
<
oppoBestAttack
;
}
...
...
@@ -172,7 +172,7 @@ namespace WindBot.Game.AI.Decks
||
Duel
.
Phase
==
DuelPhase
.
Damage
))
return
false
;
return
Duel
.
Player
==
0
||
AI
.
Utils
.
Is
EnemyBetter
(
false
,
false
);
||
AI
.
Utils
.
Is
OneEnemyBetter
(
);
}
return
true
;
}
...
...
@@ -486,7 +486,7 @@ namespace WindBot.Game.AI.Decks
return
true
;
}
private
bool
Ratpier
()
private
bool
Ratpier
Effect
()
{
AI
.
SelectCard
(
new
[]
{
...
...
@@ -501,46 +501,7 @@ namespace WindBot.Game.AI.Decks
{
if
(
LastChainPlayer
==
0
)
return
false
;
ClientCard
target
=
AI
.
Utils
.
GetProblematicCard
();
if
(
target
==
null
)
{
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
IsFaceup
())
{
target
=
monster
;
break
;
}
}
}
if
(
target
==
null
)
{
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFaceup
()
&&
spell
.
IsSpellNegateAttack
())
{
target
=
spell
;
break
;
}
}
}
if
(
target
==
null
)
{
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFaceup
()
&&
(
spell
.
HasType
(
CardType
.
Continuous
)
||
spell
.
HasType
(
CardType
.
Equip
)
||
spell
.
HasType
(
CardType
.
Field
)
||
spell
.
HasType
(
CardType
.
Pendulum
)))
{
target
=
spell
;
break
;
}
}
}
ClientCard
target
=
AI
.
Utils
.
GetBestEnemyCard
(
true
);
if
(
target
==
null
)
return
false
;
AI
.
SelectCard
(
new
[]
...
...
Game/AI/DefaultExecutor.cs
View file @
b225efae
...
...
@@ -124,7 +124,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultBookOfMoon
()
{
if
(
AI
.
Utils
.
Is
EnemyBetter
(
true
,
true
))
if
(
AI
.
Utils
.
Is
AllEnemyBetter
(
true
))
{
ClientCard
monster
=
Enemy
.
GetMonsters
().
GetHighestAttackMonster
();
if
(
monster
!=
null
&&
monster
.
HasType
(
CardType
.
Effect
)
&&
(
monster
.
HasType
(
CardType
.
Xyz
)
||
monster
.
Level
>
4
))
...
...
@@ -141,22 +141,19 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultCompulsoryEvacuationDevice
()
{
ClientCard
target
=
AI
.
Utils
.
GetProblematic
MonsterCard
();
ClientCard
target
=
AI
.
Utils
.
GetProblematic
EnemyMonster
();
if
(
target
!=
null
)
{
AI
.
SelectCard
(
target
);
return
true
;
}
foreach
(
ClientCard
card
in
Duel
.
ChainTargets
)
if
(
AI
.
Utils
.
IsChainTarget
(
Card
)
)
{
if
(
Card
.
Equals
(
card
))
ClientCard
monster
=
AI
.
Utils
.
GetBestEnemyMonster
();
if
(
monster
!=
null
)
{
ClientCard
monster
=
AI
.
Utils
.
GetAnyEnemyMonster
();
if
(
monster
!=
null
)
{
AI
.
SelectCard
(
monster
);
return
true
;
}
AI
.
SelectCard
(
monster
);
return
true
;
}
}
return
false
;
...
...
@@ -167,7 +164,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultCallOfTheHaunted
()
{
if
(!
AI
.
Utils
.
Is
EnemyBetter
(
true
,
true
))
if
(!
AI
.
Utils
.
Is
AllEnemyBetter
(
true
))
return
false
;
ClientCard
selected
=
null
;
int
BestAtk
=
0
;
...
...
@@ -201,7 +198,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultSolemnJudgment
()
{
return
!
(
Duel
.
ChainTargets
.
Count
==
1
&&
Card
.
Equals
(
Duel
.
ChainTargets
[
0
])
)
&&
!(
Duel
.
Player
==
0
&&
LastChainPlayer
==
-
1
)
&&
DefaultTrap
();
return
!
AI
.
Utils
.
IsChainTargetOnly
(
Card
)
&&
!(
Duel
.
Player
==
0
&&
LastChainPlayer
==
-
1
)
&&
DefaultTrap
();
}
/// <summary>
...
...
@@ -225,7 +222,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultTorrentialTribute
()
{
return
!
HasChainedTrap
(
0
)
&&
AI
.
Utils
.
Is
EnemyBetter
(
true
,
true
);
return
!
HasChainedTrap
(
0
)
&&
AI
.
Utils
.
Is
AllEnemyBetter
(
true
);
}
/// <summary>
...
...
@@ -249,7 +246,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultHammerShot
()
{
return
AI
.
Utils
.
Is
EnemyBetter
(
true
,
fals
e
);
return
AI
.
Utils
.
Is
OneEnemyBetter
(
tru
e
);
}
/// <summary>
...
...
@@ -257,7 +254,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultDarkHole
()
{
return
AI
.
Utils
.
Is
EnemyBetter
(
false
,
false
);
return
AI
.
Utils
.
Is
OneEnemyBetter
(
);
}
/// <summary>
...
...
@@ -265,7 +262,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultRaigeki
()
{
return
AI
.
Utils
.
Is
EnemyBetter
(
false
,
false
);
return
AI
.
Utils
.
Is
OneEnemyBetter
(
);
}
/// <summary>
...
...
@@ -273,7 +270,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultSmashingGround
()
{
return
AI
.
Utils
.
Is
EnemyBetter
(
false
,
false
);
return
AI
.
Utils
.
Is
OneEnemyBetter
(
);
}
/// <summary>
...
...
@@ -328,7 +325,7 @@ namespace WindBot.Game.AI
/// </summary>
protected
bool
DefaultMonsterRepos
()
{
bool
enemyBetter
=
AI
.
Utils
.
Is
EnemyBetter
(
true
,
true
);
bool
enemyBetter
=
AI
.
Utils
.
Is
AllEnemyBetter
(
true
);
if
(
Card
.
IsAttack
()
&&
enemyBetter
)
return
true
;
...
...
@@ -476,13 +473,10 @@ namespace WindBot.Game.AI
return
true
;
}
}
foreach
(
ClientCard
card
in
Duel
.
ChainTargets
)
if
(
AI
.
Utils
.
IsChainTarget
(
Card
)
)
{
if
(
Card
.
Equals
(
card
))
{
AI
.
SelectOption
(
XYZ
);
return
true
;
}
AI
.
SelectOption
(
XYZ
);
return
true
;
}
return
false
;
}
...
...
@@ -552,7 +546,7 @@ namespace WindBot.Game.AI
AI
.
SelectCard
(
card
);
return
true
;
}
card
=
AI
.
Utils
.
GetOneEnemyBetterThanValue
(
Card
.
GetDefensePower
()
,
false
);
card
=
AI
.
Utils
.
GetOneEnemyBetterThanValue
(
Card
.
GetDefensePower
());
if
(
card
!=
null
)
{
AI
.
SelectCard
(
card
);
...
...
Game/AI/Enums/DangerousMonster.cs
View file @
b225efae
namespace
WindBot.Game.AI.Enums
{
/// <summary>
/// Cards that are dangerous to attack.
/// </summary>
public
enum
DangerousMonster
{
LionHeart
=
54366836
,
Yubel
=
78371393
,
YubelIncarnate
=
4779091
,
YubelNightmare
=
31764700
,
MetaionTheTimelord
=
74530899
,
Number39Utopia
=
84013237
,
NumberS39UtopiatheLightning
=
56832966
MetaionTheTimelord
=
74530899
}
}
Game/AI/Enums/Floodgate.cs
View file @
b225efae
namespace
WindBot.Game.AI.Enums
{
/// <summary>
/// Cards that restrict player from performing some action. Bot will preferentially destroy them.
/// </summary>
public
enum
Floodgate
{
BarrierStatueoftheTorrent
=
10963799
,
...
...
@@ -24,11 +27,13 @@
LevelLimitAreaB
=
3136426
,
DimensionalFissure
=
81674782
,
Necrovalley
=
47355498
,
SavageColosseum
=
32391631
,
SecretVillageoftheSpellcasters
=
68462976
,
SwordsofRevealingLight
=
72302403
,
MessengerofPeace
=
44656491
,
KaiserColosseum
=
35059553
,
DomainoftheTrueMonarchs
=
84171830
,
ZombieWorld
=
4064256
,
ImperialOrder
=
61740673
,
MacroCosmos
=
30241314
,
MindDrain
=
68937720
,
...
...
@@ -41,6 +46,7 @@
LightImprisoningMirror
=
53341729
,
ShadowImprisoningMirror
=
99735427
,
WallofRevealingLight
=
17078030
,
GravityBind
=
85742772
,
VanitysEmptiness
=
5851097
,
Lose1Turn
=
24348804
,
Reqliate
=
20426907
,
...
...
Game/AI/Enums/InvincibleMonster.cs
View file @
b225efae
namespace
WindBot.Game.AI.Enums
{
/// <summary>
/// Cards that are invincible to battle.
/// </summary>
public
enum
InvincibleMonster
{
SpiritReaper
=
23205979
,
...
...
Game/AI/Enums/NegateAttackSpell.cs
deleted
100644 → 0
View file @
fc10fcec
namespace
WindBot.Game.AI.Enums
{
public
enum
NegateAttackSpell
{
MessengerOfPeace
=
44656491
,
SavageColosseum
=
32391631
,
GravityBind
=
85742772
,
LevelLimitAreaB
=
3136426
}
}
Game/AI/Enums/NegatesEffects.cs
deleted
100644 → 0
View file @
fc10fcec
namespace
WindBot.Game.AI.Enums
{
public
enum
NegatesEffects
{
SkillDrain
=
82732705
,
SoulDrain
=
73599290
}
}
Game/AI/Enums/NegatesSpells.cs
deleted
100644 → 0
View file @
fc10fcec
namespace
WindBot.Game.AI.Enums
{
public
enum
NegatesSpells
{
HorusLv6
=
11224103
,
HorusLv8
=
48229808
}
}
Game/AI/Enums/NegatesSummons.cs
deleted
100644 → 0
View file @
fc10fcec
namespace
WindBot.Game.AI.Enums
{
public
enum
NegatesSummons
{
Necrovalley
=
47355498
,
ImperialIronWall
=
30459350
,
ZombieWorld
=
4064256
,
DnaSurgery
=
74701381
,
MacroCosmos
=
30241314
,
DimensionalFissure
=
81674782
}
}
Game/AI/Enums/NegatesTraps.cs
deleted
100644 → 0
View file @
fc10fcec
namespace
WindBot.Game.AI.Enums
{
public
enum
NegatesTraps
{
Jinzo
=
77585513
,
RoyalDecree
=
51452091
}
}
Game/GameAI.cs
View file @
b225efae
...
...
@@ -304,7 +304,7 @@ namespace WindBot.Game
}
if
(
ShouldExecute
(
exec
,
card
,
ExecutorType
.
SummonOrSet
))
{
if
(
Utils
.
Is
EnemyBetter
(
true
,
true
)
&&
Utils
.
IsAllEnemyBetterThanValue
(
card
.
Attack
+
300
,
false
)
&&
if
(
Utils
.
Is
AllEnemyBetter
(
true
)
&&
Utils
.
IsAllEnemyBetterThanValue
(
card
.
Attack
+
300
,
false
)
&&
main
.
MonsterSetableCards
.
Contains
(
card
))
{
_dialogs
.
SendSetMonster
();
...
...
README.md
View file @
b225efae
...
...
@@ -125,4 +125,6 @@ The parameters are same as commandlines, but low cased.
*
Better new master rule support
*
Update the known card enums
*
More default common cards executor
WindBot.csproj
View file @
b225efae
...
...
@@ -114,11 +114,6 @@
<Compile
Include=
"Game\AI\Enums\OneForXyz.cs"
/>
<Compile
Include=
"Game\AI\Enums\InvincibleMonster.cs"
/>
<Compile
Include=
"Game\AI\Enums\Floodgate.cs"
/>
<Compile
Include=
"Game\AI\Enums\NegateAttackSpell.cs"
/>
<Compile
Include=
"Game\AI\Enums\NegatesEffects.cs"
/>
<Compile
Include=
"Game\AI\Enums\NegatesSpells.cs"
/>
<Compile
Include=
"Game\AI\Enums\NegatesSummons.cs"
/>
<Compile
Include=
"Game\AI\Enums\NegatesTraps.cs"
/>
<Compile
Include=
"Game\AI\Executor.cs"
/>
<Compile
Include=
"Game\AI\ExecutorType.cs"
/>
<Compile
Include=
"Game\BattlePhase.cs"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment