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
nanahira
windbot
Commits
f0e083d5
Commit
f0e083d5
authored
Aug 17, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shortcut for Duel.Fields
parent
ddbdbd85
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
407 additions
and
402 deletions
+407
-402
Game/AI/AIFunctions.cs
Game/AI/AIFunctions.cs
+18
-14
Game/AI/Decks/BlackwingExecutor.cs
Game/AI/Decks/BlackwingExecutor.cs
+12
-12
Game/AI/Decks/BlueEyesExecutor.cs
Game/AI/Decks/BlueEyesExecutor.cs
+61
-61
Game/AI/Decks/BurnExecutor.cs
Game/AI/Decks/BurnExecutor.cs
+5
-5
Game/AI/Decks/CyberDragonExecutor.cs
Game/AI/Decks/CyberDragonExecutor.cs
+8
-11
Game/AI/Decks/DragunityExecutor.cs
Game/AI/Decks/DragunityExecutor.cs
+51
-53
Game/AI/Decks/FrogExecutor.cs
Game/AI/Decks/FrogExecutor.cs
+12
-12
Game/AI/Decks/GravekeeperExecutor.cs
Game/AI/Decks/GravekeeperExecutor.cs
+7
-7
Game/AI/Decks/HorusExecutor.cs
Game/AI/Decks/HorusExecutor.cs
+10
-10
Game/AI/Decks/LightswornExecutor.cs
Game/AI/Decks/LightswornExecutor.cs
+15
-15
Game/AI/Decks/NekrozExecutor.cs
Game/AI/Decks/NekrozExecutor.cs
+28
-28
Game/AI/Decks/OldSchoolExecutor.cs
Game/AI/Decks/OldSchoolExecutor.cs
+3
-3
Game/AI/Decks/QliphortExecutor.cs
Game/AI/Decks/QliphortExecutor.cs
+15
-15
Game/AI/Decks/RainbowExecutor.cs
Game/AI/Decks/RainbowExecutor.cs
+34
-34
Game/AI/Decks/Rank5Executor.cs
Game/AI/Decks/Rank5Executor.cs
+17
-17
Game/AI/Decks/ToadallyAwesomeExecutor.cs
Game/AI/Decks/ToadallyAwesomeExecutor.cs
+31
-31
Game/AI/Decks/YosenjuExecutor.cs
Game/AI/Decks/YosenjuExecutor.cs
+14
-14
Game/AI/Decks/ZexalWeaponsExecutor.cs
Game/AI/Decks/ZexalWeaponsExecutor.cs
+6
-6
Game/AI/Decks/ZoodiacExecutor.cs
Game/AI/Decks/ZoodiacExecutor.cs
+37
-37
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+16
-16
Game/AI/Executor.cs
Game/AI/Executor.cs
+7
-1
No files found.
Game/AI/AIFunctions.cs
View file @
f0e083d5
...
...
@@ -6,10 +6,14 @@ namespace WindBot.Game.AI
public
class
AIFunctions
{
public
Duel
Duel
{
get
;
private
set
;
}
public
ClientField
Bot
{
get
;
private
set
;
}
public
ClientField
Enemy
{
get
;
private
set
;
}
public
AIFunctions
(
Duel
duel
)
{
Duel
=
duel
;
Bot
=
Duel
.
Fields
[
0
];
Enemy
=
Duel
.
Fields
[
1
];
}
public
static
int
CompareCardAttack
(
ClientCard
cardA
,
ClientCard
cardB
)
...
...
@@ -55,9 +59,9 @@ namespace WindBot.Game.AI
public
bool
IsEnemyBetter
(
bool
onlyatk
,
bool
all
)
{
if
(
Duel
.
Fields
[
1
]
.
GetMonsterCount
()
==
0
)
if
(
Enemy
.
GetMonsterCount
()
==
0
)
return
false
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
monsters
.
Sort
(
CompareCardAttack
);
int
bestAtk
=
-
1
;
if
(
monsters
.
Count
>
0
)
...
...
@@ -73,7 +77,7 @@ namespace WindBot.Game.AI
bool
nomonster
=
true
;
for
(
int
i
=
0
;
i
<
7
;
++
i
)
{
ClientCard
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
[
i
];
ClientCard
card
=
Enemy
.
MonsterZone
[
i
];
if
(
card
==
null
)
continue
;
if
(
onlyatk
&&
card
.
IsDefense
())
continue
;
nomonster
=
false
;
...
...
@@ -90,7 +94,7 @@ namespace WindBot.Game.AI
bool
nomonster
=
true
;
for
(
int
i
=
0
;
i
<
7
;
++
i
)
{
ClientCard
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
[
i
];
ClientCard
card
=
Enemy
.
MonsterZone
[
i
];
if
(
card
==
null
||
card
.
Data
==
null
)
continue
;
if
(
onlyatk
&&
card
.
IsDefense
())
continue
;
nomonster
=
false
;
...
...
@@ -105,7 +109,7 @@ namespace WindBot.Game.AI
{
for
(
int
i
=
0
;
i
<
7
;
++
i
)
{
ClientCard
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
[
i
];
ClientCard
card
=
Enemy
.
MonsterZone
[
i
];
if
(
card
==
null
)
continue
;
if
(
onlyatk
&&
card
.
IsDefense
())
continue
;
int
enemyValue
=
card
.
GetDefensePower
();
...
...
@@ -117,39 +121,39 @@ namespace WindBot.Game.AI
public
ClientCard
GetProblematicCard
(
int
attack
=
0
)
{
ClientCard
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetInvincibleMonster
();
ClientCard
card
=
Enemy
.
MonsterZone
.
GetInvincibleMonster
();
if
(
card
!=
null
)
return
card
;
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetFloodgate
();
card
=
Enemy
.
MonsterZone
.
GetFloodgate
();
if
(
card
!=
null
)
return
card
;
card
=
Duel
.
Fields
[
1
]
.
SpellZone
.
GetFloodgate
();
card
=
Enemy
.
SpellZone
.
GetFloodgate
();
if
(
card
!=
null
)
return
card
;
if
(
attack
==
0
)
attack
=
GetBestAttack
(
Duel
.
Fields
[
0
]
,
true
);
attack
=
GetBestAttack
(
Bot
,
true
);
return
GetOneEnemyBetterThanValue
(
attack
,
true
);
}
public
ClientCard
GetProblematicMonsterCard
(
int
attack
=
0
)
{
ClientCard
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetInvincibleMonster
();
ClientCard
card
=
Enemy
.
MonsterZone
.
GetInvincibleMonster
();
if
(
card
!=
null
)
return
card
;
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetFloodgate
();
card
=
Enemy
.
MonsterZone
.
GetFloodgate
();
if
(
card
!=
null
)
return
card
;
if
(
attack
==
0
)
attack
=
GetBestAttack
(
Duel
.
Fields
[
0
]
,
true
);
attack
=
GetBestAttack
(
Bot
,
true
);
return
GetOneEnemyBetterThanValue
(
attack
,
true
);
}
public
ClientCard
GetProblematicSpellCard
()
{
ClientCard
card
=
Duel
.
Fields
[
1
]
.
SpellZone
.
GetNegateAttackSpell
();
ClientCard
card
=
Enemy
.
SpellZone
.
GetNegateAttackSpell
();
if
(
card
!=
null
)
return
card
;
card
=
Duel
.
Fields
[
1
]
.
SpellZone
.
GetFloodgate
();
card
=
Enemy
.
SpellZone
.
GetFloodgate
();
return
card
;
}
...
...
Game/AI/Decks/BlackwingExecutor.cs
View file @
f0e083d5
...
...
@@ -90,14 +90,14 @@ namespace WindBot.Game.AI.Decks
private
bool
苍炎之修罗
()
{
if
(
Duel
.
Fields
[
0
].
HasInMonstersZone
((
int
)
CardId
.
晓之希洛克
)
&&
Duel
.
Fields
[
0
]
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
<
3800
)
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
晓之希洛克
)
&&
Bot
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
<
3800
)
return
true
;
return
false
;
}
private
bool
黑旋风
()
{
if
(
Card
.
Location
==
CardLocation
.
Hand
&&
Duel
.
Fields
[
0
]
.
HasInSpellZone
(
Card
.
Id
))
if
(
Card
.
Location
==
CardLocation
.
Hand
&&
Bot
.
HasInSpellZone
(
Card
.
Id
))
return
false
;
if
(
ActivateDescription
==
AI
.
Utils
.
GetStringId
((
int
)
Card
.
Id
,
0
))
AI
.
SelectCard
((
int
)
CardId
.
疾风之盖尔
);
...
...
@@ -106,8 +106,8 @@ namespace WindBot.Game.AI.Decks
private
bool
晓之希洛克
()
{
int
OpponentMonster
=
Duel
.
Fields
[
1
]
.
GetMonsterCount
();
int
AIMonster
=
Duel
.
Fields
[
0
]
.
GetMonsterCount
();
int
OpponentMonster
=
Enemy
.
GetMonsterCount
();
int
AIMonster
=
Bot
.
GetMonsterCount
();
if
(
OpponentMonster
!=
0
&&
AIMonster
==
0
)
return
true
;
return
false
;
...
...
@@ -115,7 +115,7 @@ namespace WindBot.Game.AI.Decks
private
bool
黑枪之布拉斯特
()
{
List
<
ClientCard
>
monster
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monster
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
card
in
monster
)
if
(
card
!=
null
&&
card
.
Id
==
(
int
)
CardId
.
残夜之波刃剑鸟
||
card
.
Id
==
(
int
)
CardId
.
月影之卡鲁特
||
card
.
Id
==
(
int
)
CardId
.
疾风之盖尔
||
card
.
Id
==
(
int
)
CardId
.
黑枪之布拉斯特
||
card
.
Id
==
(
int
)
CardId
.
晓之希洛克
||
card
.
Id
==
(
int
)
CardId
.
苍炎之修罗
||
card
.
Id
==
(
int
)
CardId
.
极北之布利扎德
)
return
true
;
...
...
@@ -124,7 +124,7 @@ namespace WindBot.Game.AI.Decks
private
bool
月影之卡鲁特
()
{
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Hand
)
foreach
(
ClientCard
card
in
Bot
.
Hand
)
if
(
card
!=
null
&&
card
.
Id
==
(
int
)
CardId
.
残夜之波刃剑鸟
||
card
.
Id
==
(
int
)
CardId
.
疾风之盖尔
||
card
.
Id
==
(
int
)
CardId
.
黑枪之布拉斯特
||
card
.
Id
==
(
int
)
CardId
.
晓之希洛克
||
card
.
Id
==
(
int
)
CardId
.
苍炎之修罗
||
card
.
Id
==
(
int
)
CardId
.
极北之布利扎德
)
return
false
;
return
true
;
...
...
@@ -132,7 +132,7 @@ namespace WindBot.Game.AI.Decks
private
bool
极北之布利扎德
()
{
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Graveyard
)
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
if
(
card
!=
null
&&
card
.
Id
==
(
int
)
CardId
.
月影之卡鲁特
||
card
.
Id
==
(
int
)
CardId
.
黑枪之布拉斯特
||
card
.
Id
==
(
int
)
CardId
.
苍炎之修罗
||
card
.
Id
==
(
int
)
CardId
.
残夜之波刃剑鸟
)
return
true
;
return
false
;
...
...
@@ -142,7 +142,7 @@ namespace WindBot.Game.AI.Decks
{
int
Count
=
0
;
List
<
ClientCard
>
monster
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monster
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
card
in
monster
)
if
(
card
!=
null
&&
card
.
Id
==
(
int
)
CardId
.
残夜之波刃剑鸟
||
card
.
Id
==
(
int
)
CardId
.
月影之卡鲁特
||
card
.
Id
==
(
int
)
CardId
.
疾风之盖尔
||
card
.
Id
==
(
int
)
CardId
.
黑枪之布拉斯特
||
card
.
Id
==
(
int
)
CardId
.
晓之希洛克
||
card
.
Id
==
(
int
)
CardId
.
苍炎之修罗
||
card
.
Id
==
(
int
)
CardId
.
极北之布利扎德
)
Count
++;
...
...
@@ -156,7 +156,7 @@ namespace WindBot.Game.AI.Decks
{
if
(
Card
.
Position
==
(
int
)
CardPosition
.
FaceUp
)
{
AI
.
SelectCard
(
Duel
.
Fields
[
1
]
.
GetMonsters
().
GetHighestAttackMonster
());
AI
.
SelectCard
(
Enemy
.
GetMonsters
().
GetHighestAttackMonster
());
return
true
;
}
return
false
;
...
...
@@ -164,11 +164,11 @@ namespace WindBot.Game.AI.Decks
private
bool
攻击力上升效果
()
{
if
(
Duel
.
Fields
[
1
].
GetMonsters
().
GetHighestAttackMonster
().
IsFacedown
()
||
Duel
.
Fields
[
1
].
GetMonsters
().
GetHighestDefenseMonster
().
IsFacedown
()
||
Duel
.
Fields
[
1
]
.
GetMonsterCount
()
==
0
)
if
(
Enemy
.
GetMonsters
().
GetHighestAttackMonster
().
IsFacedown
()
||
Enemy
.
GetMonsters
().
GetHighestDefenseMonster
().
IsFacedown
()
||
Enemy
.
GetMonsterCount
()
==
0
)
return
false
;
if
(
Duel
.
Fields
[
0
].
GetMonsters
().
GetHighestAttackMonster
().
Attack
<
Duel
.
Fields
[
1
]
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
)
if
(
Bot
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
<
Enemy
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
)
return
true
;
if
(
Duel
.
Fields
[
0
].
GetMonsters
().
GetHighestAttackMonster
().
Attack
<
Duel
.
Fields
[
1
]
.
GetMonsters
().
GetHighestDefenseMonster
().
Defense
)
if
(
Bot
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
<
Enemy
.
GetMonsters
().
GetHighestDefenseMonster
().
Defense
)
return
true
;
return
false
;
}
...
...
Game/AI/Decks/BlueEyesExecutor.cs
View file @
f0e083d5
...
...
@@ -149,7 +149,7 @@ namespace MycardBot.Game.AI.Decks
{
Logger
.
DebugWriteLine
(
"龙觉醒检索."
);
IList
<
ClientCard
>
result
=
new
List
<
ClientCard
>();
if
(!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
青眼白龙
))
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
青眼白龙
))
{
foreach
(
ClientCard
card
in
cards
)
{
...
...
@@ -310,7 +310,7 @@ namespace MycardBot.Game.AI.Decks
(
int
)
CardId
.
太古的白石
,
(
int
)
CardId
.
传说的白石
});
if
(!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
青眼白龙
))
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
青眼白龙
))
{
Logger
.
DebugWriteLine
(
"手里没有本体,堆白石."
);
AI
.
SelectNextCard
((
int
)
CardId
.
传说的白石
);
...
...
@@ -347,12 +347,12 @@ namespace MycardBot.Game.AI.Decks
private
bool
调和的宝札效果
()
{
Logger
.
DebugWriteLine
(
"调和选要丢的卡."
);
if
(!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
青眼白龙
))
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
青眼白龙
))
{
Logger
.
DebugWriteLine
(
"手里没有本体,丢白石."
);
AI
.
SelectCard
((
int
)
CardId
.
传说的白石
);
}
else
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
抵价购物
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
抵价购物
))
{
Logger
.
DebugWriteLine
(
"手里有本体,再拿一个喂八抽."
);
AI
.
SelectCard
((
int
)
CardId
.
传说的白石
);
...
...
@@ -368,7 +368,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
抵价购物效果
()
{
Logger
.
DebugWriteLine
(
"抵价购物发动."
);
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
白色灵龙
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
白色灵龙
))
{
Logger
.
DebugWriteLine
(
"手里有白灵龙,优先丢掉."
);
AI
.
SelectCard
((
int
)
CardId
.
白色灵龙
);
...
...
@@ -386,7 +386,7 @@ namespace MycardBot.Game.AI.Decks
AI
.
SelectCard
((
int
)
CardId
.
青眼亚白龙
);
return
true
;
}
else
if
(!
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
青眼白龙
)
||
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
青眼亚白龙
))
else
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
青眼白龙
)
||
!
Bot
.
HasInHand
((
int
)
CardId
.
青眼亚白龙
))
{
Logger
.
DebugWriteLine
(
"手里没有成对的青眼和亚白,丢1个."
);
AI
.
SelectCard
(
new
[]
...
...
@@ -406,7 +406,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
青眼亚白龙效果
()
{
Logger
.
DebugWriteLine
(
"亚白龙效果."
);
ClientCard
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetFloodgate
();
ClientCard
card
=
Enemy
.
MonsterZone
.
GetFloodgate
();
if
(
card
!=
null
)
{
Logger
.
DebugWriteLine
(
"炸坑怪."
);
...
...
@@ -414,7 +414,7 @@ namespace MycardBot.Game.AI.Decks
使用过的青眼亚白龙
.
Add
(
Card
);
return
true
;
}
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetInvincibleMonster
();
card
=
Enemy
.
MonsterZone
.
GetInvincibleMonster
();
if
(
card
!=
null
)
{
Logger
.
DebugWriteLine
(
"炸打不死的怪."
);
...
...
@@ -422,7 +422,7 @@ namespace MycardBot.Game.AI.Decks
使用过的青眼亚白龙
.
Add
(
Card
);
return
true
;
}
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetDangerousMonster
();
card
=
Enemy
.
MonsterZone
.
GetDangerousMonster
();
if
(
card
!=
null
)
{
Logger
.
DebugWriteLine
(
"炸厉害的怪."
);
...
...
@@ -468,12 +468,12 @@ namespace MycardBot.Game.AI.Decks
(
int
)
CardId
.
青眼白龙
,
(
int
)
CardId
.
白色灵龙
};
if
(!
Duel
.
Fields
[
0
]
.
HasInGraveyard
(
targets
))
if
(!
Bot
.
HasInGraveyard
(
targets
))
{
return
false
;
}
ClientCard
floodgate
=
Duel
.
Fields
[
1
]
.
SpellZone
.
GetFloodgate
();
if
(
floodgate
!=
null
&&
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
白色灵龙
))
ClientCard
floodgate
=
Enemy
.
SpellZone
.
GetFloodgate
();
if
(
floodgate
!=
null
&&
Bot
.
HasInGraveyard
((
int
)
CardId
.
白色灵龙
))
{
AI
.
SelectCard
((
int
)
CardId
.
白色灵龙
);
}
...
...
@@ -486,13 +486,13 @@ namespace MycardBot.Game.AI.Decks
private
bool
强欲而贪欲之壶效果
()
{
return
Duel
.
Fields
[
0
]
.
Deck
.
Count
>
15
;
return
Bot
.
Deck
.
Count
>
15
;
}
private
bool
苍眼银龙效果
()
{
Logger
.
DebugWriteLine
(
"苍眼银龙效果."
);
if
(
Duel
.
Fields
[
1
]
.
GetSpellCount
()
>
0
)
if
(
Enemy
.
GetSpellCount
()
>
0
)
{
AI
.
SelectCard
((
int
)
CardId
.
白色灵龙
);
}
...
...
@@ -506,7 +506,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
青色眼睛的贤士通常召唤
()
{
Logger
.
DebugWriteLine
(
"手里没有白石,先贤士检索."
);
return
!
Duel
.
Fields
[
0
]
.
HasInHand
(
new
List
<
int
>
return
!
Bot
.
HasInHand
(
new
List
<
int
>
{
(
int
)
CardId
.
太古的白石
,
(
int
)
CardId
.
传说的白石
...
...
@@ -531,7 +531,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
传说的白石通常召唤
()
{
Logger
.
DebugWriteLine
(
"通招白石给贤士发手卡效果."
);
return
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
青色眼睛的贤士
);
return
Bot
.
HasInHand
((
int
)
CardId
.
青色眼睛的贤士
);
}
private
bool
青色眼睛的贤士手卡效果
()
...
...
@@ -540,11 +540,11 @@ namespace MycardBot.Game.AI.Decks
{
return
false
;
}
if
(!
Duel
.
Fields
[
0
]
.
HasInMonstersZone
(
new
List
<
int
>
if
(!
Bot
.
HasInMonstersZone
(
new
List
<
int
>
{
(
int
)
CardId
.
传说的白石
,
(
int
)
CardId
.
太古的白石
})
||
Duel
.
Fields
[
0
]
.
HasInMonstersZone
(
new
List
<
int
>
})
||
Bot
.
HasInMonstersZone
(
new
List
<
int
>
{
(
int
)
CardId
.
青眼亚白龙
,
(
int
)
CardId
.
青眼白龙
,
...
...
@@ -559,7 +559,7 @@ namespace MycardBot.Game.AI.Decks
(
int
)
CardId
.
传说的白石
,
(
int
)
CardId
.
太古的白石
});
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
if
(
spells
.
Count
==
0
)
{
Logger
.
DebugWriteLine
(
"对面没坑,跳个本体."
);
...
...
@@ -579,7 +579,7 @@ namespace MycardBot.Game.AI.Decks
if
(
ActivateDescription
==
-
1
)
{
Logger
.
DebugWriteLine
(
"白色灵龙拆后场."
);
ClientCard
target
=
Duel
.
Fields
[
1
]
.
SpellZone
.
GetFloodgate
();
ClientCard
target
=
Enemy
.
SpellZone
.
GetFloodgate
();
AI
.
SelectCard
(
target
);
return
true
;
}
...
...
@@ -599,9 +599,9 @@ namespace MycardBot.Game.AI.Decks
{
Logger
.
DebugWriteLine
(
"白色灵龙回合结束变身"
);
return
手里有足够的青眼白龙
()
&&
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
苍眼银龙
,
true
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
白色灵龙
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
青眼白龙
);
&&
Bot
.
HasInMonstersZone
((
int
)
CardId
.
苍眼银龙
,
true
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
白色灵龙
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
青眼白龙
);
}
Logger
.
DebugWriteLine
(
"白色灵龙特招手卡. 对象数量"
+
Duel
.
ChainTargets
.
Count
);
foreach
(
ClientCard
card
in
Duel
.
ChainTargets
)
...
...
@@ -664,9 +664,9 @@ namespace MycardBot.Game.AI.Decks
if
(
ActivateDescription
==
AI
.
Utils
.
GetStringId
((
int
)
CardId
.
太古的白石
,
0
))
{
Logger
.
DebugWriteLine
(
"太古白石回收效果."
);
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
抵价购物
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
青眼白龙
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
青眼亚白龙
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
抵价购物
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
青眼白龙
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
青眼亚白龙
))
{
Logger
.
DebugWriteLine
(
"回收喂八抽."
);
AI
.
SelectCard
((
int
)
CardId
.
青眼白龙
);
...
...
@@ -677,17 +677,17 @@ namespace MycardBot.Game.AI.Decks
Logger
.
DebugWriteLine
(
"已经跳过亚白龙,下回合再回收."
);
return
false
;
}
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
青眼白龙
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
青眼亚白龙
)
&&
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
青眼亚白龙
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
青眼白龙
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
青眼亚白龙
)
&&
Bot
.
HasInGraveyard
((
int
)
CardId
.
青眼亚白龙
))
{
Logger
.
DebugWriteLine
(
"缺亚白龙,回收."
);
AI
.
SelectCard
((
int
)
CardId
.
青眼亚白龙
);
return
true
;
}
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
青眼亚白龙
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
青眼白龙
)
&&
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
青眼白龙
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
青眼亚白龙
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
青眼白龙
)
&&
Bot
.
HasInGraveyard
((
int
)
CardId
.
青眼白龙
))
{
Logger
.
DebugWriteLine
(
"有亚白龙缺本体,回收."
);
AI
.
SelectCard
((
int
)
CardId
.
青眼白龙
);
...
...
@@ -699,7 +699,7 @@ namespace MycardBot.Game.AI.Decks
else
{
Logger
.
DebugWriteLine
(
"太古白石特招效果."
);
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
if
(
spells
.
Count
==
0
)
{
Logger
.
DebugWriteLine
(
"对面没坑,跳个本体."
);
...
...
@@ -724,7 +724,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
太古的白石通常召唤
()
{
Logger
.
DebugWriteLine
(
"1星怪兽通常召唤."
);
return
Duel
.
Fields
[
0
]
.
HasInMonstersZone
(
new
List
<
int
>
return
Bot
.
HasInMonstersZone
(
new
List
<
int
>
{
(
int
)
CardId
.
青色眼睛的贤士
,
(
int
)
CardId
.
太古的白石
,
...
...
@@ -743,7 +743,7 @@ namespace MycardBot.Game.AI.Decks
Logger
.
DebugWriteLine
(
"先攻不叠银河眼,叠银河巨神."
);
return
false
;
}
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
if
(
monsters
.
Count
==
1
&&
!
monsters
[
0
].
IsFacedown
()
&&
((
monsters
[
0
].
IsDefense
()
&&
monsters
[
0
].
GetDefensePower
()
>=
3000
)
&&
monsters
[
0
].
HasType
(
CardType
.
Xyz
)))
{
Logger
.
DebugWriteLine
(
"只有一个大怪兽,光波龙抢之."
);
...
...
@@ -782,9 +782,9 @@ namespace MycardBot.Game.AI.Decks
private
bool
银河眼重铠光子龙超量召唤
()
{
Logger
.
DebugWriteLine
(
"银河眼重铠光子龙超量召唤."
);
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
银河眼光波龙
))
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
银河眼光波龙
))
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
((
monster
.
IsDisabled
()
&&
monster
.
HasType
(
CardType
.
Xyz
)
&&
!
monster
.
Equals
(
使用过的光波龙
))
...
...
@@ -795,7 +795,7 @@ namespace MycardBot.Game.AI.Decks
}
}
}
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
银河眼光子龙皇
))
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
银河眼光子龙皇
))
{
if
(!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
4000
,
false
))
{
...
...
@@ -810,7 +810,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
银河眼光波刃龙超量召唤
()
{
Logger
.
DebugWriteLine
(
"银河眼光波刃龙超量召唤."
);
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
银河眼重铠光子龙
)
&&
AI
.
Utils
.
GetProblematicCard
()
!=
null
)
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
银河眼重铠光子龙
)
&&
AI
.
Utils
.
GetProblematicCard
()
!=
null
)
{
AI
.
SelectCard
((
int
)
CardId
.
银河眼重铠光子龙
);
return
true
;
...
...
@@ -821,7 +821,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
银河眼暗物质龙超量召唤
()
{
Logger
.
DebugWriteLine
(
"银河眼暗物质龙超量召唤."
);
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
银河眼重铠光子龙
))
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
银河眼重铠光子龙
))
{
AI
.
SelectCard
((
int
)
CardId
.
银河眼重铠光子龙
);
return
true
;
...
...
@@ -837,7 +837,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
银河眼光波龙效果
()
{
Logger
.
DebugWriteLine
(
"银河眼光波龙效果."
);
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
HasType
(
CardType
.
Xyz
))
...
...
@@ -863,19 +863,19 @@ namespace MycardBot.Game.AI.Decks
private
bool
银河眼重铠光子龙效果
()
{
Logger
.
DebugWriteLine
(
"重铠优先炸后场."
);
ClientCard
floodgate
=
Duel
.
Fields
[
1
]
.
SpellZone
.
GetFloodgate
();
ClientCard
floodgate
=
Enemy
.
SpellZone
.
GetFloodgate
();
if
(
floodgate
!=
null
)
{
AI
.
SelectCard
(
floodgate
);
return
true
;
}
floodgate
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetFloodgate
();
floodgate
=
Enemy
.
MonsterZone
.
GetFloodgate
();
if
(
floodgate
!=
null
)
{
AI
.
SelectCard
(
floodgate
);
return
true
;
}
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(!
spell
.
IsFacedown
())
...
...
@@ -884,7 +884,7 @@ namespace MycardBot.Game.AI.Decks
return
true
;
}
}
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
if
(
monsters
.
Count
>=
2
)
{
Logger
.
DebugWriteLine
(
"怪多就先炸守备的."
);
...
...
@@ -930,7 +930,7 @@ namespace MycardBot.Game.AI.Decks
AI
.
SelectCard
(
target
);
return
true
;
}
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
IsDefense
())
...
...
@@ -944,7 +944,7 @@ namespace MycardBot.Game.AI.Decks
AI
.
SelectCard
(
monster
);
return
true
;
}
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFacedown
())
...
...
@@ -984,8 +984,8 @@ namespace MycardBot.Game.AI.Decks
{
if
(
Duel
.
Phase
!=
DuelPhase
.
Main1
||
Duel
.
Turn
==
1
||
已发动灵魂补充
)
return
false
;
int
bestSelfAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
0
]
,
false
);
int
bestEnemyAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
1
]
,
false
);
int
bestSelfAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
false
);
int
bestEnemyAttack
=
AI
.
Utils
.
GetBestAttack
(
Enemy
,
false
);
return
bestSelfAttack
<=
bestEnemyAttack
&&
bestEnemyAttack
>
2500
&&
bestEnemyAttack
<=
3100
;
}
...
...
@@ -1046,7 +1046,7 @@ namespace MycardBot.Game.AI.Decks
Logger
.
DebugWriteLine
(
"先攻可以超量森罗的姬芽宫."
);
return
true
;
}
if
(
Duel
.
Phase
==
DuelPhase
.
Main1
&&
!
Duel
.
Fields
[
0
]
.
HasInMonstersZone
(
new
List
<
int
>
if
(
Duel
.
Phase
==
DuelPhase
.
Main1
&&
!
Bot
.
HasInMonstersZone
(
new
List
<
int
>
{
(
int
)
CardId
.
青眼亚白龙
,
(
int
)
CardId
.
青眼白龙
,
...
...
@@ -1077,10 +1077,10 @@ namespace MycardBot.Game.AI.Decks
private
bool
灵魂补充
()
{
Logger
.
DebugWriteLine
(
"灵魂补充."
);
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
青眼精灵龙
,
true
))
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
青眼精灵龙
,
true
))
return
false
;
int
count
=
Duel
.
Fields
[
0
]
.
GetGraveyardMonsters
().
Count
;
int
space
=
5
-
Duel
.
Fields
[
0
]
.
GetMonsterCount
();
int
count
=
Bot
.
GetGraveyardMonsters
().
Count
;
int
space
=
5
-
Bot
.
GetMonsterCount
();
if
(
count
<
space
)
count
=
space
;
if
(
count
<
2
||
Duel
.
LifePoints
[
0
]
<
count
*
1000
)
...
...
@@ -1089,7 +1089,7 @@ namespace MycardBot.Game.AI.Decks
{
int
attack
=
0
;
int
defence
=
0
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(!
monster
.
IsDefense
())
...
...
@@ -1097,7 +1097,7 @@ namespace MycardBot.Game.AI.Decks
attack
+=
monster
.
Attack
;
}
}
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
defence
+=
monster
.
GetDefensePower
();
...
...
@@ -1146,13 +1146,13 @@ namespace MycardBot.Game.AI.Decks
private
bool
盖卡
()
{
return
(
Card
.
IsTrap
()
||
(
Card
.
Id
==(
int
)
CardId
.
银龙的轰咆
))
&&
Duel
.
Fields
[
0
]
.
GetSpellCountWithoutField
()
<
4
;
return
(
Card
.
IsTrap
()
||
(
Card
.
Id
==(
int
)
CardId
.
银龙的轰咆
))
&&
Bot
.
GetSpellCountWithoutField
()
<
4
;
}
private
bool
手里有
2
个
(
int
id
)
{
int
num
=
0
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Hand
)
foreach
(
ClientCard
card
in
Bot
.
Hand
)
{
if
(
card
!=
null
&&
card
.
Id
==
id
)
num
++;
...
...
@@ -1162,21 +1162,21 @@ namespace MycardBot.Game.AI.Decks
private
bool
能处理青眼亚白龙
()
{
return
Duel
.
Fields
[
0
]
.
HasInMonstersZone
(
new
List
<
int
>
return
Bot
.
HasInMonstersZone
(
new
List
<
int
>
{
(
int
)
CardId
.
青色眼睛的贤士
,
(
int
)
CardId
.
太古的白石
,
(
int
)
CardId
.
传说的白石
,
(
int
)
CardId
.
青眼白龙
,
(
int
)
CardId
.
白色灵龙
})
||
Duel
.
Fields
[
0
].
GetCountCardInZone
(
Duel
.
Fields
[
0
]
.
MonsterZone
,
(
int
)
CardId
.
青眼亚白龙
)>=
2
;
})
||
Bot
.
GetCountCardInZone
(
Bot
.
MonsterZone
,
(
int
)
CardId
.
青眼亚白龙
)>=
2
;
}
private
bool
手里有足够的青眼白龙
()
{
return
手里有
2
个
((
int
)
CardId
.
青眼白龙
)
||
(
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
青眼白龙
)
&&
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
太古的白石
)
Bot
.
HasInGraveyard
((
int
)
CardId
.
青眼白龙
)
&&
Bot
.
HasInGraveyard
((
int
)
CardId
.
太古的白石
)
);
}
}
...
...
Game/AI/Decks/BurnExecutor.cs
View file @
f0e083d5
...
...
@@ -81,7 +81,7 @@ namespace DevBot.Game.AI.Decks
private
bool
SwordsOfRevealingLight
()
{
int
count
=
Duel
.
Fields
[
0
]
.
SpellZone
.
GetCardCount
((
int
)
CardId
.
SwordsOfRevealingLight
);
int
count
=
Bot
.
SpellZone
.
GetCardCount
((
int
)
CardId
.
SwordsOfRevealingLight
);
return
count
==
0
;
}
...
...
@@ -98,12 +98,12 @@ namespace DevBot.Game.AI.Decks
private
bool
ThunderShort
()
{
return
Duel
.
Fields
[
1
]
.
GetMonsterCount
()
>=
3
;
return
Enemy
.
GetMonsterCount
()
>=
3
;
}
private
bool
SetInvincibleMonster
()
{
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
{
if
(
card
.
Id
==
(
int
)
CardId
.
Marshmallon
||
card
.
Id
==
(
int
)
CardId
.
SpiritReaper
)
{
...
...
@@ -116,7 +116,7 @@ namespace DevBot.Game.AI.Decks
private
bool
LavaGolem
()
{
bool
found
=
false
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
1
]
.
GetMonsters
())
foreach
(
ClientCard
card
in
Enemy
.
GetMonsters
())
{
if
(
card
.
Attack
>
2000
)
found
=
true
;
...
...
@@ -126,7 +126,7 @@ namespace DevBot.Game.AI.Decks
private
bool
Ceasefire
()
{
return
Duel
.
Fields
[
0
].
GetMonsterCount
()
+
Duel
.
Fields
[
1
]
.
GetMonsterCount
()
>=
3
;
return
Bot
.
GetMonsterCount
()
+
Enemy
.
GetMonsterCount
()
>=
3
;
}
private
bool
ReposEverything
()
...
...
Game/AI/Decks/CyberDragonExecutor.cs
View file @
f0e083d5
...
...
@@ -9,7 +9,6 @@ namespace WindBot.Game.AI.Decks
[
Deck
(
"CyberDragon"
,
"AI_CyberDragon"
)]
public
class
CyberDragonExecutor
:
DefaultExecutor
{
ClientField
Bot
;
bool
力量结合效果
=
false
;
public
enum
CardId
...
...
@@ -46,8 +45,6 @@ namespace WindBot.Game.AI.Decks
public
CyberDragonExecutor
(
GameAI
ai
,
Duel
duel
)
:
base
(
ai
,
duel
)
{
Bot
=
Duel
.
Fields
[
0
];
AddExecutor
(
ExecutorType
.
SpellSet
,
(
int
)
CardId
.
融合解除
);
AddExecutor
(
ExecutorType
.
Activate
,
(
int
)
CardId
.
时间胶囊
,
Capsule
);
...
...
@@ -91,10 +88,10 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Repos
,
DefaultMonsterRepos
);
}
private
bool
CyberDragonInHand
()
{
return
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
电子龙
);
}
private
bool
CyberDragonInGraveyard
()
{
return
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
电子龙
);
}
private
bool
CyberDragonInMonsterZone
()
{
return
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
电子龙
);
}
private
bool
CyberDragonIsBanished
()
{
return
Duel
.
Fields
[
0
]
.
HasInBanished
((
int
)
CardId
.
电子龙
);
}
private
bool
CyberDragonInHand
()
{
return
Bot
.
HasInHand
((
int
)
CardId
.
电子龙
);
}
private
bool
CyberDragonInGraveyard
()
{
return
Bot
.
HasInGraveyard
((
int
)
CardId
.
电子龙
);
}
private
bool
CyberDragonInMonsterZone
()
{
return
Bot
.
HasInMonstersZone
((
int
)
CardId
.
电子龙
);
}
private
bool
CyberDragonIsBanished
()
{
return
Bot
.
HasInBanished
((
int
)
CardId
.
电子龙
);
}
private
bool
Capsule
()
{
...
...
@@ -130,20 +127,20 @@ namespace WindBot.Game.AI.Decks
if
(!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
Bot
.
MonsterZone
.
GetHighestAttackMonster
().
Attack
,
false
))
return
false
;
else
AI
.
SelectCard
(
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetHighestAttackMonster
());
AI
.
SelectCard
(
Enemy
.
MonsterZone
.
GetHighestAttackMonster
());
return
true
;
}
private
bool
没有电子龙可特殊召唤
()
{
if
(
CyberDragonInHand
()
&&
(
Bot
.
GetMonsterCount
()
==
0
&&
Duel
.
Fields
[
1
]
.
GetMonsterCount
()
!=
0
))
if
(
CyberDragonInHand
()
&&
(
Bot
.
GetMonsterCount
()
==
0
&&
Enemy
.
GetMonsterCount
()
!=
0
))
return
false
;
return
true
;
}
private
bool
装甲电子翼
()
{
if
(
CyberDragonInHand
()
&&
(
Bot
.
GetMonsterCount
()
==
0
&&
Duel
.
Fields
[
1
]
.
GetMonsterCount
()
!=
0
)
||
(
Bot
.
HasInHand
((
int
)
CardId
.
电子龙三型
)
||
Bot
.
HasInHand
((
int
)
CardId
.
电子凤凰
))
&&
!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
1800
,
true
))
if
(
CyberDragonInHand
()
&&
(
Bot
.
GetMonsterCount
()
==
0
&&
Enemy
.
GetMonsterCount
()
!=
0
)
||
(
Bot
.
HasInHand
((
int
)
CardId
.
电子龙三型
)
||
Bot
.
HasInHand
((
int
)
CardId
.
电子凤凰
))
&&
!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
1800
,
true
))
return
false
;
return
true
;
}
...
...
@@ -152,7 +149,7 @@ namespace WindBot.Game.AI.Decks
{
if
(
Bot
.
GetCountCardInZone
(
Bot
.
Hand
,
(
int
)
CardId
.
电子龙
)
+
Bot
.
GetCountCardInZone
(
Bot
.
MonsterZone
,
(
int
)
CardId
.
电子龙
)
+
Bot
.
GetCountCardInZone
(
Bot
.
MonsterZone
,
(
int
)
CardId
.
电子龙核
)
>=
1
&&
Bot
.
HasInHand
((
int
)
CardId
.
融合
)
||
Bot
.
GetCountCardInZone
(
Bot
.
Hand
,
(
int
)
CardId
.
电子龙
)
+
Bot
.
GetCountCardInZone
(
Bot
.
MonsterZone
,
(
int
)
CardId
.
电子龙
)
+
Bot
.
GetCountCardInZone
(
Bot
.
Graveyard
,
(
int
)
CardId
.
电子龙
)
+
Bot
.
GetCountCardInZone
(
Bot
.
Graveyard
,
(
int
)
CardId
.
电子龙核
)
>=
1
&&
Bot
.
HasInHand
((
int
)
CardId
.
力量结合
))
return
true
;
if
(
CyberDragonInHand
()
&&
(
Bot
.
GetMonsterCount
()
==
0
&&
Duel
.
Fields
[
1
]
.
GetMonsterCount
()
!=
0
)
||
(
Bot
.
HasInHand
((
int
)
CardId
.
电子龙三型
)
||
Bot
.
HasInHand
((
int
)
CardId
.
电子凤凰
))
&&
!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
1800
,
true
))
if
(
CyberDragonInHand
()
&&
(
Bot
.
GetMonsterCount
()
==
0
&&
Enemy
.
GetMonsterCount
()
!=
0
)
||
(
Bot
.
HasInHand
((
int
)
CardId
.
电子龙三型
)
||
Bot
.
HasInHand
((
int
)
CardId
.
电子凤凰
))
&&
!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
1800
,
true
))
return
false
;
return
true
;
}
...
...
Game/AI/Decks/DragunityExecutor.cs
View file @
f0e083d5
...
...
@@ -116,27 +116,25 @@ namespace DevBot.Game.AI.Decks
if
(
Card
.
Location
!=
CardLocation
.
SpellZone
)
return
false
;
ClientField
field
=
Duel
.
Fields
[
0
];
int
tributeId
=
-
1
;
if
(
field
.
HasInHand
((
int
)
CardId
.
DragunityPhalanx
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
DragunityPhalanx
))
tributeId
=
(
int
)
CardId
.
DragunityPhalanx
;
else
if
(
field
.
HasInHand
((
int
)
CardId
.
FireFormationTenki
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
FireFormationTenki
))
tributeId
=
(
int
)
CardId
.
FireFormationTenki
;
else
if
(
field
.
HasInHand
((
int
)
CardId
.
Terraforming
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
Terraforming
))
tributeId
=
(
int
)
CardId
.
Terraforming
;
else
if
(
field
.
HasInHand
((
int
)
CardId
.
DragonRavine
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
DragonRavine
))
tributeId
=
(
int
)
CardId
.
DragonRavine
;
else
if
(
field
.
HasInHand
((
int
)
CardId
.
AssaultTeleport
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
AssaultTeleport
))
tributeId
=
(
int
)
CardId
.
AssaultTeleport
;
else
if
(
field
.
HasInHand
((
int
)
CardId
.
AssaultBeast
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
AssaultBeast
))
tributeId
=
(
int
)
CardId
.
AssaultBeast
;
else
if
(
field
.
HasInHand
((
int
)
CardId
.
DragunityArmaMysletainn
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
DragunityArmaMysletainn
))
tributeId
=
(
int
)
CardId
.
DragunityArmaMysletainn
;
else
{
int
count
=
0
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Hand
)
foreach
(
ClientCard
card
in
Bot
.
Hand
)
{
if
(
card
.
Id
==
(
int
)
CardId
.
DragunityDux
)
++
count
;
...
...
@@ -144,27 +142,27 @@ namespace DevBot.Game.AI.Decks
if
(
count
>=
2
)
tributeId
=
(
int
)
CardId
.
DragunityDux
;
}
if
(
tributeId
==
-
1
&&
field
.
HasInHand
((
int
)
CardId
.
StardustDragonAssaultMode
))
if
(
tributeId
==
-
1
&&
Bot
.
HasInHand
((
int
)
CardId
.
StardustDragonAssaultMode
))
tributeId
=
(
int
)
CardId
.
StardustDragonAssaultMode
;
if
(
tributeId
==
-
1
&&
field
.
HasInHand
((
int
)
CardId
.
DragunitySpearOfDestiny
))
if
(
tributeId
==
-
1
&&
Bot
.
HasInHand
((
int
)
CardId
.
DragunitySpearOfDestiny
))
tributeId
=
(
int
)
CardId
.
StardustDragonAssaultMode
;
if
(
tributeId
==
-
1
&&
field
.
HasInHand
((
int
)
CardId
.
DragonsMirror
)
&&
Duel
.
Fields
[
0
]
.
GetMonsterCount
()
==
0
)
if
(
tributeId
==
-
1
&&
Bot
.
HasInHand
((
int
)
CardId
.
DragonsMirror
)
&&
Bot
.
GetMonsterCount
()
==
0
)
tributeId
=
(
int
)
CardId
.
StardustDragonAssaultMode
;
if
(
tributeId
==
-
1
)
return
false
;
int
needId
=
-
1
;
if
(!
field
.
HasInMonstersZone
((
int
)
CardId
.
DragunityPhalanx
)
&&
!
field
.
HasInGraveyard
((
int
)
CardId
.
DragunityPhalanx
))
if
(!
Bot
.
HasInMonstersZone
((
int
)
CardId
.
DragunityPhalanx
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
DragunityPhalanx
))
needId
=
(
int
)
CardId
.
DragunityPhalanx
;
else
if
(
field
.
GetMonsterCount
()
==
0
)
else
if
(
Bot
.
GetMonsterCount
()
==
0
)
needId
=
(
int
)
CardId
.
DragunityDux
;
else
{
/*bool hasRealMonster = false;
foreach (ClientCard card in
field
.GetMonsters())
foreach (ClientCard card in
Bot
.GetMonsters())
{
if (card.Id != (int)CardId.AssaultBeast)
{
...
...
@@ -185,13 +183,13 @@ namespace DevBot.Game.AI.Decks
needId
=
(
int
)
CardId
.
DragunityDux
;
int
remaining
=
3
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Hand
)
foreach
(
ClientCard
card
in
Bot
.
Hand
)
if
(
card
.
Id
==
needId
)
remaining
--;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Graveyard
)
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
if
(
card
.
Id
==
needId
)
remaining
--;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Banished
)
foreach
(
ClientCard
card
in
Bot
.
Banished
)
if
(
card
.
Id
==
needId
)
remaining
--;
if
(
remaining
<=
0
)
...
...
@@ -213,16 +211,16 @@ namespace DevBot.Game.AI.Decks
private
bool
Terraforming
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
DragonRavine
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
DragonRavine
))
return
false
;
if
(
Duel
.
Fields
[
0
]
.
SpellZone
[
5
]
!=
null
)
if
(
Bot
.
SpellZone
[
5
]
!=
null
)
return
false
;
return
true
;
}
private
bool
SetUselessCards
()
{
ClientField
field
=
Duel
.
Fields
[
0
]
;
ClientField
field
=
Bot
;
if
(
field
.
HasInSpellZone
((
int
)
CardId
.
FireFormationTenki
))
return
false
;
...
...
@@ -233,24 +231,24 @@ namespace DevBot.Game.AI.Decks
if
(
field
.
HasInSpellZone
((
int
)
CardId
.
DragonsMirror
))
return
false
;
return
Duel
.
Fields
[
0
]
.
GetSpellCountWithoutField
()
<
4
;
return
Bot
.
GetSpellCountWithoutField
()
<
4
;
}
private
bool
FireFormationTenki
()
{
if
(
Card
.
Location
==
CardLocation
.
Hand
)
return
Duel
.
Fields
[
0
]
.
GetSpellCountWithoutField
()
<
4
;
return
Bot
.
GetSpellCountWithoutField
()
<
4
;
return
true
;
}
private
bool
FoolishBurial
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
DragunityPhalanx
))
if
(
Bot
.
HasInGraveyard
((
int
)
CardId
.
DragunityPhalanx
))
return
false
;
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
DragunityPhalanx
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
DragunityPhalanx
))
return
false
;
int
remaining
=
3
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Banished
)
foreach
(
ClientCard
card
in
Bot
.
Banished
)
if
(
card
.
Id
==
(
int
)
CardId
.
DragunityPhalanx
)
remaining
--;
if
(
remaining
>
0
)
...
...
@@ -263,7 +261,7 @@ namespace DevBot.Game.AI.Decks
private
bool
MonsterReborn
()
{
List
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
Duel
.
Fields
[
0
]
.
Graveyard
);
List
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
Bot
.
Graveyard
);
cards
.
Sort
(
AIFunctions
.
CompareCardAttack
);
ClientCard
selectedCard
=
null
;
for
(
int
i
=
cards
.
Count
-
1
;
i
>=
0
;
--
i
)
...
...
@@ -280,7 +278,7 @@ namespace DevBot.Game.AI.Decks
break
;
}
}
cards
=
new
List
<
ClientCard
>(
Duel
.
Fields
[
1
]
.
Graveyard
);
cards
=
new
List
<
ClientCard
>(
Enemy
.
Graveyard
);
cards
.
Sort
(
AIFunctions
.
CompareCardAttack
);
for
(
int
i
=
cards
.
Count
-
1
;
i
>=
0
;
--
i
)
{
...
...
@@ -305,7 +303,7 @@ namespace DevBot.Game.AI.Decks
{
IList
<
ClientCard
>
tributes
=
new
List
<
ClientCard
>();
int
phalanxCount
=
0
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Graveyard
)
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
{
if
(
card
.
Id
==
(
int
)
CardId
.
DragunityPhalanx
)
{
...
...
@@ -322,7 +320,7 @@ namespace DevBot.Game.AI.Decks
// if we have more than one in the graveyard.
if
(
tributes
.
Count
<
5
&&
phalanxCount
>
1
)
{
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Graveyard
)
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
{
if
(
card
.
Id
==
(
int
)
CardId
.
DragunityPhalanx
)
{
...
...
@@ -356,7 +354,7 @@ namespace DevBot.Game.AI.Decks
if
(
invincible
==
null
&&
!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
2800
-
1
,
false
))
return
false
;
ClientField
field
=
Duel
.
Fields
[
0
]
;
ClientField
field
=
Bot
;
int
tributeId
=
-
1
;
if
(
field
.
HasInSpellZone
((
int
)
CardId
.
FireFormationTenki
))
...
...
@@ -374,7 +372,7 @@ namespace DevBot.Game.AI.Decks
else
if
(
field
.
HasInSpellZone
((
int
)
CardId
.
DragonRavine
))
tributeId
=
(
int
)
CardId
.
DragonRavine
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
monsters
.
Sort
(
AIFunctions
.
CompareCardAttack
);
ClientCard
destroyCard
=
invincible
;
...
...
@@ -403,9 +401,9 @@ namespace DevBot.Game.AI.Decks
private
bool
CrystalWingSynchroDragonSummon
()
{
return
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
AssaultModeActivate
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
AssaultBeast
)
&&
!
Duel
.
Fields
[
0
]
.
HasInSpellZone
((
int
)
CardId
.
AssaultModeActivate
);
return
!
Bot
.
HasInHand
((
int
)
CardId
.
AssaultModeActivate
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
AssaultBeast
)
&&
!
Bot
.
HasInSpellZone
((
int
)
CardId
.
AssaultModeActivate
);
}
private
bool
CrystalWingSynchroDragonEffect
()
...
...
@@ -415,17 +413,17 @@ namespace DevBot.Game.AI.Decks
private
bool
DragunityPhalanxSummon
()
{
return
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
DragunityArmaMysletainn
);
return
Bot
.
HasInHand
((
int
)
CardId
.
DragunityArmaMysletainn
);
}
private
bool
DragunityArmaMysletainn
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
DragunityPhalanx
))
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
DragunityPhalanx
))
{
AI
.
SelectCard
((
int
)
CardId
.
DragunityPhalanx
);
return
true
;
}
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
DragunityDux
))
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
DragunityDux
))
{
AI
.
SelectCard
((
int
)
CardId
.
DragunityDux
);
return
true
;
...
...
@@ -441,29 +439,29 @@ namespace DevBot.Game.AI.Decks
private
bool
DragunityArmaMysletainnTribute
()
{
if
((
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
AssaultBeast
)
&&
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
DragunityPhalanx
))
||
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
DragunityPhalanx
)
||
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
DragunitySpearOfDestiny
))
if
((
Bot
.
HasInMonstersZone
((
int
)
CardId
.
AssaultBeast
)
&&
Bot
.
HasInGraveyard
((
int
)
CardId
.
DragunityPhalanx
))
||
Bot
.
HasInMonstersZone
((
int
)
CardId
.
DragunityPhalanx
)
||
Bot
.
HasInHand
((
int
)
CardId
.
DragunitySpearOfDestiny
))
return
true
;
return
false
;
}
private
bool
DragunityDux
()
{
return
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
DragunityPhalanx
)
||
(
Duel
.
Fields
[
0
].
GetMonsterCount
()
==
0
&&
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
DragunityArmaMysletainn
)
||
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
DragunitySpearOfDestiny
));
return
Bot
.
HasInGraveyard
((
int
)
CardId
.
DragunityPhalanx
)
||
(
Bot
.
GetMonsterCount
()
==
0
&&
Bot
.
HasInHand
((
int
)
CardId
.
DragunityArmaMysletainn
)
||
Bot
.
HasInHand
((
int
)
CardId
.
DragunitySpearOfDestiny
));
}
private
bool
DragunityPhalanxSet
()
{
return
Duel
.
Fields
[
0
].
GetMonsterCount
()
==
0
||
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
DragunityPhalanx
);
return
Bot
.
GetMonsterCount
()
==
0
||
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
DragunityPhalanx
);
}
private
bool
AssaultBeast
()
{
if
(!
Duel
.
Fields
[
0
]
.
HasInSpellZone
((
int
)
CardId
.
AssaultModeActivate
))
if
(!
Bot
.
HasInSpellZone
((
int
)
CardId
.
AssaultModeActivate
))
return
true
;
return
false
;
}
...
...
@@ -479,7 +477,7 @@ namespace DevBot.Game.AI.Decks
{
if
(
Duel
.
Player
==
0
&&
Duel
.
Phase
==
DuelPhase
.
BattleStart
)
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
Id
==
(
int
)
CardId
.
StardustDragon
&&
monster
.
Attacked
)
...
...
@@ -494,8 +492,8 @@ namespace DevBot.Game.AI.Decks
private
ClientCard
GetProblematicCard
()
{
ClientCard
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetInvincibleMonster
();
return
card
??
Duel
.
Fields
[
1
]
.
SpellZone
.
GetFloodgate
();
ClientCard
card
=
Enemy
.
MonsterZone
.
GetInvincibleMonster
();
return
card
??
Enemy
.
SpellZone
.
GetFloodgate
();
}
}
}
\ No newline at end of file
Game/AI/Decks/FrogExecutor.cs
View file @
f0e083d5
...
...
@@ -109,7 +109,7 @@ namespace DevBot.Game.AI.Decks
return
false
;
m_swapFrogSummoned
=
-
1
;
if
(
Duel
.
Fields
[
0
]
.
GetRemainingCount
((
int
)
CardId
.
Ronintoadin
,
2
)
==
0
)
if
(
Bot
.
GetRemainingCount
((
int
)
CardId
.
Ronintoadin
,
2
)
==
0
)
return
false
;
AI
.
SelectCard
((
int
)
CardId
.
Ronintoadin
);
...
...
@@ -127,7 +127,7 @@ namespace DevBot.Game.AI.Decks
if
(
Card
.
IsDefense
()
||
m_flipFlopFrogSummoned
==
Duel
.
Turn
||
Duel
.
Phase
==
DuelPhase
.
Main2
)
{
m_flipFlopFrogSummoned
=
-
1
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
monsters
.
Sort
(
AIFunctions
.
CompareCardAttack
);
monsters
.
Reverse
();
AI
.
SelectCard
(
monsters
);
...
...
@@ -138,7 +138,7 @@ namespace DevBot.Game.AI.Decks
private
bool
Ronintoadin
()
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetGraveyardMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetGraveyardMonsters
();
if
(
monsters
.
Count
>
2
)
{
if
(
GetSpellBonus
()
==
0
)
...
...
@@ -169,7 +169,7 @@ namespace DevBot.Game.AI.Decks
cards
.
Add
((
int
)
CardId
.
FlipFlopFrog
);
}
if
(
Duel
.
Fields
[
0
]
.
SpellZone
[
5
]
==
null
)
if
(
Bot
.
SpellZone
[
5
]
==
null
)
{
cards
.
Add
((
int
)
CardId
.
Terraforming
);
cards
.
Add
((
int
)
CardId
.
Wetlands
);
...
...
@@ -195,22 +195,22 @@ namespace DevBot.Game.AI.Decks
private
bool
Terraforming
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
Wetlands
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
Wetlands
))
return
false
;
if
(
Duel
.
Fields
[
0
]
.
SpellZone
[
5
]
!=
null
)
if
(
Bot
.
SpellZone
[
5
]
!=
null
)
return
false
;
return
true
;
}
private
bool
Solidarity
()
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetGraveyardMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetGraveyardMonsters
();
return
monsters
.
Count
!=
0
;
}
private
bool
GravityBind
()
{
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
0
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Bot
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
Id
==
(
int
)
CardId
.
GravityBind
&&
!
spell
.
IsFacedown
())
...
...
@@ -235,7 +235,7 @@ namespace DevBot.Game.AI.Decks
if
(
Card
.
IsDefense
()
&&
!
enemyBetter
)
result
=
true
;
if
(!
result
&&
Card
.
Id
==
(
int
)
CardId
.
FlipFlopFrog
&&
Duel
.
Fields
[
1
]
.
GetMonsterCount
()
>
0
&&
Card
.
IsFacedown
())
if
(!
result
&&
Card
.
Id
==
(
int
)
CardId
.
FlipFlopFrog
&&
Enemy
.
GetMonsterCount
()
>
0
&&
Card
.
IsFacedown
())
result
=
true
;
if
(
Card
.
Id
==
(
int
)
CardId
.
FlipFlopFrog
&&
Card
.
IsFacedown
()
&&
result
)
...
...
@@ -247,13 +247,13 @@ namespace DevBot.Game.AI.Decks
private
int
GetSpellBonus
()
{
int
atk
=
0
;
if
(
Duel
.
Fields
[
0
]
.
SpellZone
[
5
]
!=
null
)
if
(
Bot
.
SpellZone
[
5
]
!=
null
)
atk
+=
1200
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetGraveyardMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetGraveyardMonsters
();
if
(
monsters
.
Count
!=
0
)
{
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
GetSpells
())
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
{
if
(
card
.
Id
==
(
int
)
CardId
.
Solidarity
)
atk
+=
800
;
...
...
Game/AI/Decks/GravekeeperExecutor.cs
View file @
f0e083d5
...
...
@@ -83,28 +83,28 @@ namespace WindBot.Game.AI.Decks
private
bool
王家长眠之谷的祭殿
()
{
if
(
Card
.
Location
==
CardLocation
.
Hand
&&
Duel
.
Fields
[
0
]
.
HasInSpellZone
((
int
)
Card
.
Id
))
if
(
Card
.
Location
==
CardLocation
.
Hand
&&
Bot
.
HasInSpellZone
((
int
)
Card
.
Id
))
return
false
;
return
true
;
}
private
bool
王家长眠之谷
()
{
if
(
Duel
.
Fields
[
0
]
.
SpellZone
[
5
]
!=
null
)
if
(
Bot
.
SpellZone
[
5
]
!=
null
)
return
false
;
return
true
;
}
private
bool
罪星尘龙
()
{
if
(
Duel
.
Fields
[
0
]
.
SpellZone
[
5
]
!=
null
)
if
(
Bot
.
SpellZone
[
5
]
!=
null
)
return
true
;
return
false
;
}
private
bool
守墓的司令官
()
{
if
(!
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
王家长眠之谷
)
&&
!
Duel
.
Fields
[
0
]
.
HasInSpellZone
((
int
)
CardId
.
王家长眠之谷
))
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
王家长眠之谷
)
&&
!
Bot
.
HasInSpellZone
((
int
)
CardId
.
王家长眠之谷
))
return
true
;
return
false
;
}
...
...
@@ -118,7 +118,7 @@ namespace WindBot.Game.AI.Decks
{
if
(!
Card
.
IsAttack
())
return
false
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
1
]
.
MonsterZone
)
foreach
(
ClientCard
card
in
Enemy
.
MonsterZone
)
if
(
card
!=
null
&&
card
.
IsDefense
()
&&
card
.
Defense
>
1500
&&
card
.
Attack
<
1500
||
card
.
Attack
>
1500
&&
card
.
Defense
<
1500
)
return
true
;
return
false
;
...
...
@@ -126,10 +126,10 @@ namespace WindBot.Game.AI.Decks
private
bool
守墓的末裔
()
{
int
bestatk
=
Duel
.
Fields
[
0
]
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
;
int
bestatk
=
Bot
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
;
if
(
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
bestatk
,
true
))
{
AI
.
SelectCard
(
Duel
.
Fields
[
1
]
.
GetMonsters
().
GetHighestAttackMonster
());
AI
.
SelectCard
(
Enemy
.
GetMonsters
().
GetHighestAttackMonster
());
return
true
;
}
return
false
;
...
...
Game/AI/Decks/HorusExecutor.cs
View file @
f0e083d5
...
...
@@ -68,12 +68,12 @@ namespace WindBot.Game.AI.Decks
private
bool
FoolishBurial
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
WhiteNightDragon
))
if
(
Bot
.
HasInGraveyard
((
int
)
CardId
.
WhiteNightDragon
))
return
false
;
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
WhiteNightDragon
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
WhiteNightDragon
))
return
false
;
int
remaining
=
2
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Banished
)
foreach
(
ClientCard
card
in
Bot
.
Banished
)
if
(
card
.
Id
==
(
int
)
CardId
.
WhiteNightDragon
)
remaining
--;
if
(
remaining
>
0
)
...
...
@@ -91,7 +91,7 @@ namespace WindBot.Game.AI.Decks
if
(
Duel
.
Player
==
1
&&
Duel
.
Phase
==
DuelPhase
.
End
)
return
false
;
List
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
Duel
.
Fields
[
0
]
.
Graveyard
);
List
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
Bot
.
Graveyard
);
cards
.
Sort
(
AIFunctions
.
CompareCardAttack
);
for
(
int
i
=
cards
.
Count
-
1
;
i
>=
0
;
--
i
)
{
...
...
@@ -109,7 +109,7 @@ namespace WindBot.Game.AI.Decks
private
bool
MonsterReborn
()
{
List
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
Duel
.
Fields
[
0
]
.
Graveyard
);
List
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
Bot
.
Graveyard
);
cards
.
Sort
(
AIFunctions
.
CompareCardAttack
);
ClientCard
selectedCard
=
null
;
for
(
int
i
=
cards
.
Count
-
1
;
i
>=
0
;
--
i
)
...
...
@@ -123,7 +123,7 @@ namespace WindBot.Game.AI.Decks
break
;
}
}
cards
=
new
List
<
ClientCard
>(
Duel
.
Fields
[
1
]
.
Graveyard
);
cards
=
new
List
<
ClientCard
>(
Enemy
.
Graveyard
);
cards
.
Sort
(
AIFunctions
.
CompareCardAttack
);
for
(
int
i
=
cards
.
Count
-
1
;
i
>=
0
;
--
i
)
{
...
...
@@ -147,7 +147,7 @@ namespace WindBot.Game.AI.Decks
private
bool
WhiteNightDragon
()
{
// We should summon Horus the Black Flame Dragon LV6 if he can lvlup.
if
(
Duel
.
Fields
[
1
]
.
GetMonsterCount
()
!=
0
&&
!
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2300
-
1
,
false
))
if
(
Enemy
.
GetMonsterCount
()
!=
0
&&
!
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2300
-
1
,
false
))
foreach
(
ClientCard
card
in
Main
.
SummonableCards
)
if
(
card
.
Id
==
11224103
)
return
false
;
...
...
@@ -162,7 +162,7 @@ namespace WindBot.Game.AI.Decks
private
bool
DragonsRebirth
()
{
List
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
Duel
.
Fields
[
0
]
.
GetMonsters
());
List
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
Bot
.
GetMonsters
());
if
(
cards
.
Count
==
0
)
return
false
;
cards
.
Sort
(
AIFunctions
.
CompareCardAttack
);
...
...
@@ -181,8 +181,8 @@ namespace WindBot.Game.AI.Decks
if
(
tributeCard
==
null
)
return
false
;
cards
=
new
List
<
ClientCard
>(
Duel
.
Fields
[
0
]
.
Hand
);
cards
.
AddRange
(
Duel
.
Fields
[
0
]
.
Graveyard
);
cards
=
new
List
<
ClientCard
>(
Bot
.
Hand
);
cards
.
AddRange
(
Bot
.
Graveyard
);
if
(
cards
.
Count
==
0
)
return
false
;
cards
.
Sort
(
AIFunctions
.
CompareCardAttack
);
...
...
Game/AI/Decks/LightswornExecutor.cs
View file @
f0e083d5
...
...
@@ -97,7 +97,7 @@ namespace WindBot.Game.AI.Decks
}
if
(!(
defender
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
))
{
if
(
attacker
.
Attribute
==
(
int
)
CardAttribute
.
Light
&&
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
欧尼斯特
))
if
(
attacker
.
Attribute
==
(
int
)
CardAttribute
.
Light
&&
Bot
.
HasInHand
((
int
)
CardId
.
欧尼斯特
))
attacker
.
RealPower
=
attacker
.
RealPower
+
defender
.
Attack
;
if
(
attacker
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
(
2
,
(
int
)
CardId
.
No39
希望皇霍普
))
attacker
.
RealPower
=
5000
;
...
...
@@ -142,16 +142,16 @@ namespace WindBot.Game.AI.Decks
private
bool
增援效果
()
{
if
(!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
哥布林德伯格
))
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
哥布林德伯格
))
AI
.
SelectCard
((
int
)
CardId
.
哥布林德伯格
);
else
if
(!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
光道暗杀者莱登
))
else
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
光道暗杀者莱登
))
AI
.
SelectCard
((
int
)
CardId
.
光道暗杀者莱登
);
return
true
;
}
private
bool
光之援军效果
()
{
if
(!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
光道召唤师露米娜丝
))
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
光道召唤师露米娜丝
))
AI
.
SelectCard
((
int
)
CardId
.
光道召唤师露米娜丝
);
else
AI
.
SelectCard
(
new
[]
...
...
@@ -179,7 +179,7 @@ namespace WindBot.Game.AI.Decks
private
bool
哥布林德伯格通常召唤
()
{
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Hand
)
foreach
(
ClientCard
card
in
Bot
.
Hand
)
{
if
(
card
!=
Card
&&
card
.
IsMonster
()
&&
card
.
Level
==
4
)
return
true
;
...
...
@@ -215,25 +215,25 @@ namespace WindBot.Game.AI.Decks
private
bool
励辉士入魔蝇王特殊召唤
()
{
int
selfCount
=
Duel
.
Fields
[
0
].
GetMonsterCount
()
+
Duel
.
Fields
[
0
].
GetSpellCount
()
+
Duel
.
Fields
[
0
]
.
GetHandCount
();
int
oppoCount
=
Duel
.
Fields
[
1
].
GetMonsterCount
()
+
Duel
.
Fields
[
1
].
GetSpellCount
()
+
Duel
.
Fields
[
1
]
.
GetHandCount
();
int
selfCount
=
Bot
.
GetMonsterCount
()
+
Bot
.
GetSpellCount
()
+
Bot
.
GetHandCount
();
int
oppoCount
=
Enemy
.
GetMonsterCount
()
+
Enemy
.
GetSpellCount
()
+
Enemy
.
GetHandCount
();
return
(
selfCount
-
1
<
oppoCount
)
&&
励辉士入魔蝇王效果
();
}
private
bool
励辉士入魔蝇王效果
()
{
int
selfCount
=
Duel
.
Fields
[
0
].
GetMonsterCount
()
+
Duel
.
Fields
[
0
]
.
GetSpellCount
();
int
oppoCount
=
Duel
.
Fields
[
1
].
GetMonsterCount
()
+
Duel
.
Fields
[
1
]
.
GetSpellCount
();
int
selfCount
=
Bot
.
GetMonsterCount
()
+
Bot
.
GetSpellCount
();
int
oppoCount
=
Enemy
.
GetMonsterCount
()
+
Enemy
.
GetSpellCount
();
int
selfAttack
=
0
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
selfAttack
+=
monster
.
GetDefensePower
();
}
int
oppoAttack
=
0
;
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
oppoAttack
+=
monster
.
GetDefensePower
();
...
...
@@ -244,15 +244,15 @@ namespace WindBot.Game.AI.Decks
private
bool
红莲魔龙右红痕特殊召唤
()
{
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
0
]
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
1
]
,
false
);
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Enemy
,
false
);
return
(
selfBestAttack
<=
oppoBestAttack
&&
oppoBestAttack
<=
3000
)
||
红莲魔龙右红痕效果
();
}
private
bool
红莲魔龙右红痕效果
()
{
int
selfCount
=
0
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(!
monster
.
Equals
(
Card
)
&&
monster
.
HasType
(
CardType
.
Effect
)
&&
monster
.
Attack
<=
Card
.
Attack
)
...
...
@@ -260,7 +260,7 @@ namespace WindBot.Game.AI.Decks
}
int
oppoCount
=
0
;
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
// 没有办法获取特殊召唤的状态,只好默认全部是特招的
...
...
Game/AI/Decks/NekrozExecutor.cs
View file @
f0e083d5
...
...
@@ -100,19 +100,19 @@ namespace WindBot.Game.AI.Decks
private
bool
千手神召唤
()
{
if
(!
Duel
.
Fields
[
0
].
HasInHand
(
NekrozRituelCard
)
||
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
影灵衣术士施里特
)
||
!
Duel
.
Fields
[
0
]
.
HasInHand
(
NekrozSpellCard
))
if
(!
Bot
.
HasInHand
(
NekrozRituelCard
)
||
Bot
.
HasInHand
((
int
)
CardId
.
影灵衣术士施里特
)
||
!
Bot
.
HasInHand
(
NekrozSpellCard
))
return
true
;
foreach
(
ClientCard
Card
in
Duel
.
Fields
[
0
]
.
Hand
)
if
(
Card
!=
null
&&
Card
.
Id
==
(
int
)
CardId
.
影灵衣的万华镜
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
尤尼科之影灵衣
))
foreach
(
ClientCard
Card
in
Bot
.
Hand
)
if
(
Card
!=
null
&&
Card
.
Id
==
(
int
)
CardId
.
影灵衣的万华镜
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
尤尼科之影灵衣
))
return
true
;
else
if
(
Card
.
Id
==
(
int
)
CardId
.
三叉龙之影灵衣
||
Card
.
Id
==
(
int
)
CardId
.
决战兵器之影灵衣
&&
!
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
影灵衣的降魔镜
)
||
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
影灵衣术士施里特
))
else
if
(
Card
.
Id
==
(
int
)
CardId
.
三叉龙之影灵衣
||
Card
.
Id
==
(
int
)
CardId
.
决战兵器之影灵衣
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
影灵衣的降魔镜
)
||
!
Bot
.
HasInHand
((
int
)
CardId
.
影灵衣术士施里特
))
return
true
;
return
false
;
}
private
bool
增援
()
{
if
(!
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
影灵衣术士施里特
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
影灵衣术士施里特
))
if
(!
Bot
.
HasInGraveyard
((
int
)
CardId
.
影灵衣术士施里特
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
影灵衣术士施里特
))
{
AI
.
SelectCard
((
int
)
CardId
.
影灵衣术士施里特
);
return
true
;
...
...
@@ -122,21 +122,21 @@ namespace WindBot.Game.AI.Decks
private
bool
万手神召唤
()
{
if
(!
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
千手神
)
||
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
影灵衣术士施里特
))
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
千手神
)
||
!
Bot
.
HasInHand
((
int
)
CardId
.
影灵衣术士施里特
))
return
true
;
return
false
;
}
private
bool
影灵衣舞姬召唤
()
{
if
(!
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
千手神
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
万手神
))
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
千手神
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
万手神
))
return
true
;
return
false
;
}
private
bool
混沌幻影
()
{
if
(
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
影灵衣术士施里特
)
&&
Duel
.
Fields
[
0
].
HasInHand
(
NekrozSpellCard
)
&&
Duel
.
Fields
[
0
]
.
HasInHand
(
NekrozRituelCard
))
if
(
Bot
.
HasInGraveyard
((
int
)
CardId
.
影灵衣术士施里特
)
&&
Bot
.
HasInHand
(
NekrozSpellCard
)
&&
Bot
.
HasInHand
(
NekrozRituelCard
))
return
true
;
return
false
;
}
...
...
@@ -149,14 +149,14 @@ namespace WindBot.Game.AI.Decks
private
bool
影灵衣术士施里特
()
{
if
(!
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
千手神
)
&&
!
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
万手神
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
影灵衣舞姬
))
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
千手神
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
万手神
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
影灵衣舞姬
))
return
true
;
return
false
;
}
private
bool
三叉龙之影灵衣
()
{
if
(
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2700
,
true
)
&&
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
决战兵器之影灵衣
))
if
(
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2700
,
true
)
&&
Bot
.
HasInHand
((
int
)
CardId
.
决战兵器之影灵衣
))
return
false
;
return
true
;
}
...
...
@@ -173,7 +173,7 @@ namespace WindBot.Game.AI.Decks
private
bool
励辉士入魔蝇王
()
{
if
(
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
Duel
.
Fields
[
0
]
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
,
true
))
if
(
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
Bot
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
,
true
))
{
return
true
;
}
...
...
@@ -189,9 +189,9 @@ namespace WindBot.Game.AI.Decks
private
bool
天枪龙之影灵衣
()
{
if
(
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
Duel
.
Fields
[
0
]
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
,
true
)
&&
Duel
.
Phase
==
DuelPhase
.
Main1
)
if
(
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
Bot
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
,
true
)
&&
Duel
.
Phase
==
DuelPhase
.
Main1
)
{
AI
.
SelectCard
(
Duel
.
Fields
[
1
]
.
GetMonsters
().
GetHighestAttackMonster
());
AI
.
SelectCard
(
Enemy
.
GetMonsters
().
GetHighestAttackMonster
());
return
true
;
}
return
false
;
...
...
@@ -199,32 +199,32 @@ namespace WindBot.Game.AI.Decks
private
bool
光枪龙之影灵衣
()
{
if
(!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
影灵衣术士施里特
))
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
影灵衣术士施里特
))
{
AI
.
SelectCard
((
int
)
CardId
.
影灵衣术士施里特
);
return
true
;
}
else
if
(!
Duel
.
Fields
[
0
]
.
HasInHand
(
NekrozSpellCard
))
else
if
(!
Bot
.
HasInHand
(
NekrozSpellCard
))
{
AI
.
SelectCard
((
int
)
CardId
.
影灵衣的降魔镜
);
return
true
;
}
else
if
(
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
3300
,
true
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
三叉龙之影灵衣
))
else
if
(
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
3300
,
true
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
三叉龙之影灵衣
))
{
AI
.
SelectCard
((
int
)
CardId
.
三叉龙之影灵衣
);
return
true
;
}
else
if
(
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2700
,
true
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
决战兵器之影灵衣
))
else
if
(
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2700
,
true
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
决战兵器之影灵衣
))
{
AI
.
SelectCard
((
int
)
CardId
.
决战兵器之影灵衣
);
return
true
;
}
else
if
(
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
尤尼科之影灵衣
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
影灵衣的万华镜
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
尤尼科之影灵衣
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
影灵衣的万华镜
))
{
AI
.
SelectCard
((
int
)
CardId
.
影灵衣的万华镜
);
return
true
;
}
else
if
(!
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
尤尼科之影灵衣
)
&&
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
影灵衣的万华镜
))
else
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
尤尼科之影灵衣
)
&&
Bot
.
HasInHand
((
int
)
CardId
.
影灵衣的万华镜
))
{
AI
.
SelectCard
((
int
)
CardId
.
尤尼科之影灵衣
);
return
true
;
...
...
@@ -234,17 +234,17 @@ namespace WindBot.Game.AI.Decks
private
bool
千手神效果
()
{
if
(
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
3300
,
true
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
三叉龙之影灵衣
))
if
(
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
3300
,
true
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
三叉龙之影灵衣
))
{
AI
.
SelectCard
((
int
)
CardId
.
三叉龙之影灵衣
);
return
true
;
}
else
if
(
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2700
,
true
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
决战兵器之影灵衣
))
else
if
(
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2700
,
true
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
决战兵器之影灵衣
))
{
AI
.
SelectCard
((
int
)
CardId
.
决战兵器之影灵衣
);
return
true
;
}
else
if
(!
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
尤尼科之影灵衣
)
&&
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
影灵衣的万华镜
))
else
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
尤尼科之影灵衣
)
&&
Bot
.
HasInHand
((
int
)
CardId
.
影灵衣的万华镜
))
{
AI
.
SelectCard
((
int
)
CardId
.
尤尼科之影灵衣
);
return
true
;
...
...
@@ -254,7 +254,7 @@ namespace WindBot.Game.AI.Decks
private
bool
尤尼科之影灵衣
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
影灵衣术士施里特
))
if
(
Bot
.
HasInGraveyard
((
int
)
CardId
.
影灵衣术士施里特
))
{
AI
.
SelectCard
((
int
)
CardId
.
影灵衣术士施里特
);
return
true
;
...
...
@@ -264,7 +264,7 @@ namespace WindBot.Game.AI.Decks
private
bool
辉剑鸟之影灵衣
()
{
if
(!
Duel
.
Fields
[
0
]
.
HasInHand
(
NekrozSpellCard
))
if
(!
Bot
.
HasInHand
(
NekrozSpellCard
))
{
AI
.
SelectCard
((
int
)
CardId
.
影灵衣的降魔镜
);
return
true
;
...
...
@@ -274,7 +274,7 @@ namespace WindBot.Game.AI.Decks
private
bool
IsTheLastPossibility
()
{
if
(!
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
决战兵器之影灵衣
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
三叉龙之影灵衣
))
if
(!
Bot
.
HasInHand
((
int
)
CardId
.
决战兵器之影灵衣
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
三叉龙之影灵衣
))
return
true
;
return
false
;
}
...
...
@@ -284,13 +284,13 @@ namespace WindBot.Game.AI.Decks
List
<
int
>
NekrozCard
=
new
List
<
int
>();
try
{
foreach
(
ClientCard
Card
in
Duel
.
Fields
[
0
]
.
Hand
)
foreach
(
ClientCard
Card
in
Bot
.
Hand
)
if
(
Card
!=
null
&&
NekrozRituelCard
.
Contains
((
int
)
Card
.
Id
))
NekrozCard
.
Add
(
Card
.
Id
);
foreach
(
int
Id
in
NekrozCard
)
{
if
(
Id
==
(
int
)
CardId
.
三叉龙之影灵衣
&&
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2700
,
true
)
&&
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
决战兵器之影灵衣
))
if
(
Id
==
(
int
)
CardId
.
三叉龙之影灵衣
&&
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
2700
,
true
)
&&
Bot
.
HasInHand
((
int
)
CardId
.
决战兵器之影灵衣
))
{
AI
.
SelectCard
((
int
)
CardId
.
三叉龙之影灵衣
);
return
true
;
...
...
@@ -300,7 +300,7 @@ namespace WindBot.Game.AI.Decks
AI
.
SelectCard
((
int
)
CardId
.
决战兵器之影灵衣
);
return
true
;
}
else
if
(
Id
==
(
int
)
CardId
.
尤尼科之影灵衣
&&
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
影灵衣的万华镜
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
影灵衣术士施里特
))
else
if
(
Id
==
(
int
)
CardId
.
尤尼科之影灵衣
&&
Bot
.
HasInHand
((
int
)
CardId
.
影灵衣的万华镜
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
影灵衣术士施里特
))
{
AI
.
SelectCard
((
int
)
CardId
.
尤尼科之影灵衣
);
return
true
;
...
...
Game/AI/Decks/OldSchoolExecutor.cs
View file @
f0e083d5
...
...
@@ -56,7 +56,7 @@
if
(
Main
.
SummonableCards
.
Count
==
1
&&
Main
.
SummonableCards
[
0
].
Level
<
5
)
{
bool
canTribute
=
false
;
foreach
(
ClientCard
handCard
in
Duel
.
Fields
[
0
]
.
Hand
)
foreach
(
ClientCard
handCard
in
Bot
.
Hand
)
{
if
(
handCard
.
IsMonster
()
&&
handCard
.
Level
>
4
&&
handCard
.
Level
<
6
)
canTribute
=
true
;
...
...
@@ -66,7 +66,7 @@
}
int
monsters
=
0
;
foreach
(
ClientCard
handCard
in
Duel
.
Fields
[
0
]
.
Hand
)
foreach
(
ClientCard
handCard
in
Bot
.
Hand
)
{
if
(
handCard
.
IsMonster
())
monsters
++;
...
...
@@ -80,7 +80,7 @@
private
bool
SwordsOfRevealingLight
()
{
foreach
(
ClientCard
handCard
in
Duel
.
Fields
[
1
]
.
GetMonsters
())
foreach
(
ClientCard
handCard
in
Enemy
.
GetMonsters
())
{
if
(
handCard
.
IsFacedown
())
return
true
;
...
...
Game/AI/Decks/QliphortExecutor.cs
View file @
f0e083d5
...
...
@@ -199,7 +199,7 @@ namespace WindBot.Game.AI.Decks
private
bool
优先盖不重复的坑
()
{
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
SpellZone
)
foreach
(
ClientCard
card
in
Bot
.
SpellZone
)
{
if
(
card
!=
null
&&
card
.
Id
==
Card
.
Id
)
return
false
;
...
...
@@ -209,7 +209,7 @@ namespace WindBot.Game.AI.Decks
private
bool
魔陷区有空余格子
()
{
return
Duel
.
Fields
[
0
]
.
GetSpellCountWithoutField
()
<
4
;
return
Bot
.
GetSpellCountWithoutField
()
<
4
;
}
private
bool
已发动过削命
()
...
...
@@ -249,12 +249,12 @@ namespace WindBot.Game.AI.Decks
if
(!
Card
.
HasType
(
CardType
.
Pendulum
)
||
Card
.
Location
!=
CardLocation
.
Hand
)
return
false
;
int
count
=
0
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Hand
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
Hand
.
GetMonsters
())
{
if
(!
Card
.
Equals
(
card
))
count
++;
}
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
ExtraDeck
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
ExtraDeck
.
GetMonsters
())
{
if
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
IsFaceup
())
count
++;
...
...
@@ -266,7 +266,7 @@ namespace WindBot.Game.AI.Decks
if
(
已发动削命
)
return
true
;
bool
pair
=
false
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Hand
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
Hand
.
GetMonsters
())
{
if
(
card
.
RScale
!=
Card
.
LScale
)
{
...
...
@@ -291,21 +291,21 @@ namespace WindBot.Game.AI.Decks
int
count
=
0
;
int
handcount
=
0
;
int
fieldcount
=
0
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Hand
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
Hand
.
GetMonsters
())
{
count
++;
handcount
++;
}
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
MonsterZone
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
MonsterZone
.
GetMonsters
())
{
fieldcount
++;
}
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
ExtraDeck
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
ExtraDeck
.
GetMonsters
())
{
if
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
IsFaceup
())
count
++;
}
if
(
count
>
0
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
(
低刻度
))
if
(
count
>
0
&&
!
Bot
.
HasInHand
(
低刻度
))
{
AI
.
SelectCard
(
低刻度
);
}
...
...
@@ -335,13 +335,13 @@ namespace WindBot.Game.AI.Decks
AI
.
SelectCard
(
target
);
return
true
;
}
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
AI
.
SelectCard
(
monster
);
return
true
;
}
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFacedown
())
...
...
@@ -368,7 +368,7 @@ namespace WindBot.Game.AI.Decks
AI
.
SelectCard
(
target
);
return
true
;
}
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
AI
.
SelectCard
(
monster
);
...
...
@@ -387,7 +387,7 @@ namespace WindBot.Game.AI.Decks
AI
.
SelectCard
(
target
);
return
true
;
}
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFacedown
())
...
...
@@ -411,11 +411,11 @@ namespace WindBot.Game.AI.Decks
if
(
l
!=
null
&&
r
!=
null
&&
l
.
LScale
!=
r
.
RScale
)
{
int
count
=
0
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Hand
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
Hand
.
GetMonsters
())
{
count
++;
}
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
ExtraDeck
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
ExtraDeck
.
GetMonsters
())
{
if
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
IsFaceup
())
count
++;
...
...
Game/AI/Decks/RainbowExecutor.cs
View file @
f0e083d5
...
...
@@ -161,7 +161,7 @@ namespace MycardBot.Game.AI.Decks
{
if
(
attacker
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
(
2
,
(
int
)
CardId
.
No39
希望皇霍普
))
attacker
.
RealPower
=
5000
;
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
No37
希望织龙蜘蛛鲨
,
true
,
true
))
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
No37
希望织龙蜘蛛鲨
,
true
,
true
))
attacker
.
RealPower
=
attacker
.
RealPower
+
1000
;
}
return
attacker
.
RealPower
>
defender
.
GetDefensePower
();
...
...
@@ -169,7 +169,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
粗人预料效果
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
救援兔
)
||
已通常召唤
)
if
(
Bot
.
HasInHand
((
int
)
CardId
.
救援兔
)
||
已通常召唤
)
AI
.
SelectCard
(
new
[]
{
(
int
)
CardId
.
幻壳龙
,
...
...
@@ -177,22 +177,22 @@ namespace MycardBot.Game.AI.Decks
});
else
if
(
AI
.
Utils
.
IsTurn1OrMain2
())
{
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
幻壳龙
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
幻壳龙
))
AI
.
SelectCard
((
int
)
CardId
.
幻壳龙
);
else
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
打喷嚏的河马龙
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
打喷嚏的河马龙
))
AI
.
SelectCard
((
int
)
CardId
.
打喷嚏的河马龙
);
else
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
曼陀罗天使号手
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
曼陀罗天使号手
))
AI
.
SelectCard
((
int
)
CardId
.
曼陀罗天使号手
);
}
else
{
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
打喷嚏的河马龙
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
打喷嚏的河马龙
))
AI
.
SelectCard
((
int
)
CardId
.
打喷嚏的河马龙
);
else
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
龙剑士卓辉星灵摆
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
龙剑士卓辉星灵摆
))
AI
.
SelectCard
((
int
)
CardId
.
龙剑士卓辉星灵摆
);
else
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
幻之狮鹫
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
幻之狮鹫
))
AI
.
SelectCard
((
int
)
CardId
.
幻之狮鹫
);
else
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
曼陀罗天使号手
))
else
if
(
Bot
.
HasInHand
((
int
)
CardId
.
曼陀罗天使号手
))
AI
.
SelectCard
(
new
[]
{
(
int
)
CardId
.
炼装勇士金驰
,
...
...
@@ -224,27 +224,27 @@ namespace MycardBot.Game.AI.Decks
private
bool
幻壳龙通常召唤
()
{
return
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
幻壳龙
);
return
Bot
.
HasInMonstersZone
((
int
)
CardId
.
幻壳龙
);
}
private
bool
幻之狮鹫通常召唤
()
{
return
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
幻之狮鹫
);
return
Bot
.
HasInMonstersZone
((
int
)
CardId
.
幻之狮鹫
);
}
private
bool
龙剑士卓辉星灵摆通常召唤
()
{
return
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
龙剑士卓辉星灵摆
);
return
Bot
.
HasInMonstersZone
((
int
)
CardId
.
龙剑士卓辉星灵摆
);
}
private
bool
曼陀罗天使号手通常召唤
()
{
return
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
曼陀罗天使号手
);
return
Bot
.
HasInMonstersZone
((
int
)
CardId
.
曼陀罗天使号手
);
}
private
bool
炼装勇士金驰通常召唤
()
{
return
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
炼装勇士金驰
);
return
Bot
.
HasInMonstersZone
((
int
)
CardId
.
炼装勇士金驰
);
}
private
bool
打喷嚏的河马龙通常召唤
()
{
return
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
打喷嚏的河马龙
);
return
Bot
.
HasInMonstersZone
((
int
)
CardId
.
打喷嚏的河马龙
);
}
private
bool
通常召唤
()
{
...
...
@@ -263,25 +263,25 @@ namespace MycardBot.Game.AI.Decks
private
bool
励辉士入魔蝇王特殊召唤
()
{
int
selfCount
=
Duel
.
Fields
[
0
].
GetMonsterCount
()
+
Duel
.
Fields
[
0
].
GetSpellCount
()
+
Duel
.
Fields
[
0
]
.
GetHandCount
();
int
oppoCount
=
Duel
.
Fields
[
1
].
GetMonsterCount
()
+
Duel
.
Fields
[
1
].
GetSpellCount
()
+
Duel
.
Fields
[
1
]
.
GetHandCount
();
int
selfCount
=
Bot
.
GetMonsterCount
()
+
Bot
.
GetSpellCount
()
+
Bot
.
GetHandCount
();
int
oppoCount
=
Enemy
.
GetMonsterCount
()
+
Enemy
.
GetSpellCount
()
+
Enemy
.
GetHandCount
();
return
(
selfCount
-
1
<
oppoCount
)
&&
励辉士入魔蝇王效果
();
}
private
bool
励辉士入魔蝇王效果
()
{
int
selfCount
=
Duel
.
Fields
[
0
].
GetMonsterCount
()
+
Duel
.
Fields
[
0
]
.
GetSpellCount
();
int
oppoCount
=
Duel
.
Fields
[
1
].
GetMonsterCount
()
+
Duel
.
Fields
[
1
]
.
GetSpellCount
();
int
selfCount
=
Bot
.
GetMonsterCount
()
+
Bot
.
GetSpellCount
();
int
oppoCount
=
Enemy
.
GetMonsterCount
()
+
Enemy
.
GetSpellCount
();
int
selfAttack
=
0
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
selfAttack
+=
monster
.
GetDefensePower
();
}
int
oppoAttack
=
0
;
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
oppoAttack
+=
monster
.
GetDefensePower
();
...
...
@@ -292,15 +292,15 @@ namespace MycardBot.Game.AI.Decks
private
bool
红莲魔龙右红痕特殊召唤
()
{
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
0
]
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
1
]
,
false
);
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Enemy
,
false
);
return
(
selfBestAttack
<=
oppoBestAttack
&&
oppoBestAttack
<=
3000
)
||
红莲魔龙右红痕效果
();
}
private
bool
红莲魔龙右红痕效果
()
{
int
selfCount
=
0
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(!
monster
.
Equals
(
Card
)
&&
monster
.
HasType
(
CardType
.
Effect
)
&&
monster
.
Attack
<=
Card
.
Attack
)
...
...
@@ -308,7 +308,7 @@ namespace MycardBot.Game.AI.Decks
}
int
oppoCount
=
0
;
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
// 没有办法获取特殊召唤的状态,只好默认全部是特招的
...
...
@@ -343,7 +343,7 @@ namespace MycardBot.Game.AI.Decks
return
true
;
ClientCard
target1
=
null
;
ClientCard
target2
=
AI
.
Utils
.
GetProblematicCard
();
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
HasType
(
CardType
.
Pendulum
)
&&
!
spell
.
Equals
(
target2
))
...
...
@@ -352,7 +352,7 @@ namespace MycardBot.Game.AI.Decks
break
;
}
}
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
HasType
(
CardType
.
Pendulum
)
&&
!
monster
.
Equals
(
target2
))
...
...
@@ -395,7 +395,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
电光千鸟特殊召唤
()
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
IsFacedown
())
...
...
@@ -403,7 +403,7 @@ namespace MycardBot.Game.AI.Decks
return
true
;
}
}
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFacedown
())
...
...
@@ -449,7 +449,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
芙莉西亚之虫惑魔特殊召唤
()
{
if
(
AI
.
Utils
.
IsTurn1OrMain2
()
&&
(
Duel
.
Fields
[
0
].
GetRemainingCount
((
int
)
CardId
.
奈落的落穴
,
1
)
+
Duel
.
Fields
[
0
]
.
GetRemainingCount
((
int
)
CardId
.
虫惑的落穴
,
1
))
>
0
)
if
(
AI
.
Utils
.
IsTurn1OrMain2
()
&&
(
Bot
.
GetRemainingCount
((
int
)
CardId
.
奈落的落穴
,
1
)
+
Bot
.
GetRemainingCount
((
int
)
CardId
.
虫惑的落穴
,
1
))
>
0
)
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
return
true
;
...
...
@@ -459,7 +459,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
No59
背反之料理人特殊召唤
()
{
return
((
Duel
.
Fields
[
0
].
GetMonsterCount
()
+
Duel
.
Fields
[
0
]
.
GetSpellCount
()
-
2
)
<=
1
)
&&
return
((
Bot
.
GetMonsterCount
()
+
Bot
.
GetSpellCount
()
-
2
)
<=
1
)
&&
((
AI
.
Utils
.
IsEnemyBetter
(
false
,
false
)
&&
!
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
2300
,
true
))
||
AI
.
Utils
.
IsTurn1OrMain2
());
}
...
...
@@ -475,7 +475,7 @@ namespace MycardBot.Game.AI.Decks
}
else
{
if
((
Duel
.
Fields
[
0
].
GetMonsterCount
()
+
Duel
.
Fields
[
0
]
.
GetSpellCount
()
-
1
)
<=
1
)
if
((
Bot
.
GetMonsterCount
()
+
Bot
.
GetSpellCount
()
-
1
)
<=
1
)
return
true
;
}
return
false
;
...
...
@@ -509,7 +509,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
强欲而贪欲之壶效果
()
{
return
Duel
.
Fields
[
0
]
.
Deck
.
Count
>
15
;
return
Bot
.
Deck
.
Count
>
15
;
}
private
bool
地碎效果
()
...
...
@@ -519,7 +519,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
陷阱卡覆盖
()
{
return
!
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
No59
背反之料理人
,
true
,
true
);
return
!
Bot
.
HasInMonstersZone
((
int
)
CardId
.
No59
背反之料理人
,
true
,
true
);
}
}
}
Game/AI/Decks/Rank5Executor.cs
View file @
f0e083d5
...
...
@@ -120,7 +120,7 @@ namespace DevBot.Game.AI.Decks
private
bool
特殊召唤不重复的超量怪兽
()
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
if
(
monster
.
Id
==
Card
.
Id
)
return
false
;
...
...
@@ -179,12 +179,12 @@ namespace DevBot.Game.AI.Decks
if
(
场上有
5
星怪兽
())
return
true
;
int
其他的
5
星资源数量
=
0
;
IList
<
ClientCard
>
hand
=
Duel
.
Fields
[
0
]
.
Hand
;
IList
<
ClientCard
>
hand
=
Bot
.
Hand
;
foreach
(
ClientCard
card
in
hand
)
{
if
(
card
.
Id
==
(
int
)
CardId
.
简易融合
&&
!
已发动简易融合
)
++
其他的
5
星资源数量
;
if
(
card
.
Id
==
(
int
)
CardId
.
速攻同调士
&&
Duel
.
Fields
[
0
]
.
Hand
.
ContainsMonsterWithLevel
(
4
))
if
(
card
.
Id
==
(
int
)
CardId
.
速攻同调士
&&
Bot
.
Hand
.
ContainsMonsterWithLevel
(
4
))
++
其他的
5
星资源数量
;
if
(
card
.
Id
==
(
int
)
CardId
.
迷雾恶魔
&&
!
已通常召唤
)
++
其他的
5
星资源数量
;
...
...
@@ -210,7 +210,7 @@ namespace DevBot.Game.AI.Decks
{
if
(!
已通常召唤
||
已发动二重召唤
)
return
false
;
IList
<
ClientCard
>
hand
=
Duel
.
Fields
[
0
]
.
Hand
;
IList
<
ClientCard
>
hand
=
Bot
.
Hand
;
foreach
(
ClientCard
card
in
hand
)
{
if
(
card
.
Id
==
(
int
)
CardId
.
迷雾恶魔
||
...
...
@@ -262,7 +262,7 @@ namespace DevBot.Game.AI.Decks
}
else
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
ClientCard
bestmonster
=
null
;
foreach
(
ClientCard
monster
in
monsters
)
{
...
...
@@ -285,7 +285,7 @@ namespace DevBot.Game.AI.Decks
private
bool
No61
火山恐龙效果
()
{
ClientCard
target
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetFloodgate
();
ClientCard
target
=
Enemy
.
MonsterZone
.
GetFloodgate
();
if
(
target
==
null
)
target
=
AI
.
Utils
.
GetOneEnemyBetterThanValue
(
2000
,
false
);
if
(
target
!=
null
)
...
...
@@ -310,12 +310,12 @@ namespace DevBot.Game.AI.Decks
private
bool
迅雷之骑士盖亚龙骑士特殊召唤
()
{
if
(
已发动火山恐龙
&&
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
No61
火山恐龙
))
if
(
已发动火山恐龙
&&
Bot
.
HasInMonstersZone
((
int
)
CardId
.
No61
火山恐龙
))
{
AI
.
SelectCard
((
int
)
CardId
.
No61
火山恐龙
);
return
true
;
}
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
HasType
(
CardType
.
Xyz
)
&&
!
monster
.
HasXyzMaterial
())
...
...
@@ -329,7 +329,7 @@ namespace DevBot.Game.AI.Decks
private
bool
超量苏生效果
()
{
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
SpellZone
)
foreach
(
ClientCard
card
in
Bot
.
SpellZone
)
{
if
(
card
!=
null
&&
card
.
Id
==
Card
.
Id
&&
...
...
@@ -349,7 +349,7 @@ namespace DevBot.Game.AI.Decks
private
bool
超量组件效果
()
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
return
monsters
.
Exists
(
p
=>
p
.
HasType
(
CardType
.
Xyz
));
}
...
...
@@ -361,13 +361,13 @@ namespace DevBot.Game.AI.Decks
AI
.
SelectCard
(
target
);
return
true
;
}
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
AI
.
SelectCard
(
monster
);
return
true
;
}
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFacedown
())
...
...
@@ -386,13 +386,13 @@ namespace DevBot.Game.AI.Decks
private
bool
超量遮护罩效果
()
{
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
0
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Bot
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
Id
==
(
int
)
CardId
.
超量遮护罩
&&
!
spell
.
IsFacedown
())
return
false
;
}
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
HasType
(
CardType
.
Xyz
))
...
...
@@ -403,7 +403,7 @@ namespace DevBot.Game.AI.Decks
private
bool
场上有
5
星怪兽
()
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
HasType
(
CardType
.
Monster
)
&&
...
...
@@ -421,10 +421,10 @@ namespace DevBot.Game.AI.Decks
ClientCard
card
=
AI
.
Utils
.
GetProblematicCard
();
if
(
card
!=
null
)
return
card
;
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetHighestAttackMonster
();
card
=
Enemy
.
MonsterZone
.
GetHighestAttackMonster
();
if
(
card
!=
null
)
return
card
;
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
if
(
spells
.
Count
>
0
)
return
spells
[
0
];
return
null
;
...
...
Game/AI/Decks/ToadallyAwesomeExecutor.cs
View file @
f0e083d5
...
...
@@ -127,11 +127,11 @@ namespace WindBot.Game.AI.Decks
private
bool
冰结界的纹章效果
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInHand
(
new
List
<
int
>
if
(
Bot
.
HasInHand
(
new
List
<
int
>
{
(
int
)
CardId
.
冰结界的术者
,
(
int
)
CardId
.
冰结界的水影
})
||
Duel
.
Fields
[
0
]
.
HasInMonstersZone
(
new
List
<
int
>
})
||
Bot
.
HasInMonstersZone
(
new
List
<
int
>
{
(
int
)
CardId
.
冰结界的术者
,
(
int
)
CardId
.
冰结界的水影
...
...
@@ -179,11 +179,11 @@ namespace WindBot.Game.AI.Decks
private
bool
愚蠢的埋葬效果
()
{
if
(
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
小灰篮史莱姆
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
小灰篮史莱姆
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
小灰篮史莱姆
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
小灰篮史莱姆
))
AI
.
SelectCard
((
int
)
CardId
.
小灰篮史莱姆
);
else
if
(
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
粹蛙
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
))
else
if
(
Bot
.
HasInGraveyard
((
int
)
CardId
.
粹蛙
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
))
AI
.
SelectCard
((
int
)
CardId
.
魔知青蛙
);
else
if
(
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
粹蛙
))
else
if
(
Bot
.
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
粹蛙
))
AI
.
SelectCard
((
int
)
CardId
.
粹蛙
);
else
AI
.
SelectCard
(
new
[]
...
...
@@ -212,11 +212,11 @@ namespace WindBot.Game.AI.Decks
private
bool
鬼青蛙特殊召唤
()
{
if
(
Duel
.
Fields
[
0
].
GetCountCardInZone
(
Duel
.
Fields
[
0
].
Hand
,
(
int
)
CardId
.
小灰篮史莱姆
)>=
2
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
小灰篮史莱姆
))
if
(
Bot
.
GetCountCardInZone
(
Bot
.
Hand
,
(
int
)
CardId
.
小灰篮史莱姆
)>=
2
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
小灰篮史莱姆
))
AI
.
SelectCard
((
int
)
CardId
.
小灰篮史莱姆
);
else
if
(
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
粹蛙
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
))
else
if
(
Bot
.
HasInGraveyard
((
int
)
CardId
.
粹蛙
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
))
AI
.
SelectCard
((
int
)
CardId
.
魔知青蛙
);
else
if
(
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
粹蛙
))
else
if
(
Bot
.
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
粹蛙
))
AI
.
SelectCard
((
int
)
CardId
.
粹蛙
);
else
AI
.
SelectCard
(
new
[]
...
...
@@ -240,7 +240,7 @@ namespace WindBot.Game.AI.Decks
}
else
{
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
魔知青蛙
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
魔知青蛙
))
{
AI
.
SelectCard
(
new
[]
{
...
...
@@ -256,7 +256,7 @@ namespace WindBot.Game.AI.Decks
private
bool
小灰篮史莱姆优先通常召唤
()
{
return
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
小灰篮史莱姆
);
return
Bot
.
HasInGraveyard
((
int
)
CardId
.
小灰篮史莱姆
);
}
private
bool
小灰篮史莱姆效果
()
...
...
@@ -284,7 +284,7 @@ namespace WindBot.Game.AI.Decks
private
bool
低攻怪兽通常召唤
()
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
Level
==
2
)
...
...
@@ -297,19 +297,19 @@ namespace WindBot.Game.AI.Decks
private
bool
冰结界下级通常召唤
()
{
return
Duel
.
Fields
[
0
].
GetCountCardInZone
(
Duel
.
Fields
[
0
]
.
Hand
,
(
int
)
CardId
.
冰结界的传道师
)
>
0
;
return
Bot
.
GetCountCardInZone
(
Bot
.
Hand
,
(
int
)
CardId
.
冰结界的传道师
)
>
0
;
}
private
bool
冰结界的传道师通常召唤
()
{
return
Duel
.
Fields
[
0
].
GetCountCardInZone
(
Duel
.
Fields
[
0
]
.
Hand
,
(
int
)
CardId
.
冰结界的传道师
)
>=
2
;
return
Bot
.
GetCountCardInZone
(
Bot
.
Hand
,
(
int
)
CardId
.
冰结界的传道师
)
>=
2
;
}
private
bool
饼蛙效果
()
{
if
(
CurrentChain
.
Count
>
0
)
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
List
<
int
>
合适的
COST
=
new
List
<
int
>
{
(
int
)
CardId
.
鬼青蛙
,
(
int
)
CardId
.
粹蛙
,
...
...
@@ -325,7 +325,7 @@ namespace WindBot.Game.AI.Decks
return
true
;
}
}
bool
有水舞台
=
Duel
.
Fields
[
0
]
.
HasInSpellZone
((
int
)
CardId
.
水舞台
,
true
);
bool
有水舞台
=
Bot
.
HasInSpellZone
((
int
)
CardId
.
水舞台
,
true
);
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
Id
==
(
int
)
CardId
.
魔知青蛙
&&
!
有水舞台
)
...
...
@@ -334,8 +334,8 @@ namespace WindBot.Game.AI.Decks
return
true
;
}
}
monsters
=
(
List
<
ClientCard
>)
Duel
.
Fields
[
0
]
.
Hand
;
bool
手里有
2
个史莱姆
=
Duel
.
Fields
[
0
].
GetCountCardInZone
(
Duel
.
Fields
[
0
]
.
Hand
,
(
int
)
CardId
.
小灰篮史莱姆
)
>=
2
;
monsters
=
(
List
<
ClientCard
>)
Bot
.
Hand
;
bool
手里有
2
个史莱姆
=
Bot
.
GetCountCardInZone
(
Bot
.
Hand
,
(
int
)
CardId
.
小灰篮史莱姆
)
>=
2
;
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
Id
==
(
int
)
CardId
.
小灰篮史莱姆
&&
手里有
2
个史莱姆
)
...
...
@@ -344,7 +344,7 @@ namespace WindBot.Game.AI.Decks
return
true
;
}
}
bool
需要丢魔知
=
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
粹蛙
)
&&
!
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
鬼青蛙
);
bool
需要丢魔知
=
Bot
.
HasInGraveyard
((
int
)
CardId
.
粹蛙
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
鬼青蛙
);
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
Id
==
(
int
)
CardId
.
魔知青蛙
&&
需要丢魔知
)
...
...
@@ -370,7 +370,7 @@ namespace WindBot.Game.AI.Decks
}
else
if
(
Card
.
Location
==
CardLocation
.
Grave
)
{
if
(!
Duel
.
Fields
[
0
]
.
HasInExtra
((
int
)
CardId
.
饼蛙
))
if
(!
Bot
.
HasInExtra
((
int
)
CardId
.
饼蛙
))
{
AI
.
SelectCard
((
int
)
CardId
.
饼蛙
);
}
...
...
@@ -420,14 +420,14 @@ namespace WindBot.Game.AI.Decks
private
bool
猫鲨特殊召唤
()
{
bool
should
=
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
饼蛙
)
bool
should
=
Bot
.
HasInMonstersZone
((
int
)
CardId
.
饼蛙
)
&&
((
AI
.
Utils
.
IsEnemyBetter
(
true
,
false
)
&&
!
Duel
.
Fields
[
0
]
.
HasInMonstersZone
(
new
List
<
int
>
&&
!
Bot
.
HasInMonstersZone
(
new
List
<
int
>
{
(
int
)
CardId
.
猫鲨
,
(
int
)
CardId
.
神骑矢车菊圣人马
},
true
,
true
))
||
!
Duel
.
Fields
[
0
]
.
HasInExtra
((
int
)
CardId
.
饼蛙
));
||
!
Bot
.
HasInExtra
((
int
)
CardId
.
饼蛙
));
if
(
should
)
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
...
...
@@ -438,7 +438,7 @@ namespace WindBot.Game.AI.Decks
private
bool
猫鲨效果
()
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
Id
==
(
int
)
CardId
.
饼蛙
&&
monster
.
Attack
<=
2200
)
...
...
@@ -472,7 +472,7 @@ namespace WindBot.Game.AI.Decks
private
bool
神骑矢车菊圣人马特殊召唤
()
{
int
num
=
0
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
Level
==
2
)
...
...
@@ -481,9 +481,9 @@ namespace WindBot.Game.AI.Decks
}
}
return
AI
.
Utils
.
IsEnemyBetter
(
true
,
false
)
&&
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
1
]
,
true
)
>
2200
&&
AI
.
Utils
.
GetBestAttack
(
Enemy
,
true
)
>
2200
&&
num
<
4
&&
!
Duel
.
Fields
[
0
]
.
HasInMonstersZone
(
new
List
<
int
>
&&
!
Bot
.
HasInMonstersZone
(
new
List
<
int
>
{
(
int
)
CardId
.
神骑矢车菊圣人马
},
true
,
true
);
...
...
@@ -495,7 +495,7 @@ namespace WindBot.Game.AI.Decks
{
int
attack
=
0
;
int
defence
=
0
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(!
monster
.
IsDefense
())
...
...
@@ -503,7 +503,7 @@ namespace WindBot.Game.AI.Decks
attack
+=
monster
.
Attack
;
}
}
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
defence
+=
monster
.
GetDefensePower
();
...
...
@@ -563,11 +563,11 @@ namespace WindBot.Game.AI.Decks
private
void
选择取除超量素材
(
List
<
int
>
Overlays
)
{
if
(
Overlays
.
Contains
((
int
)
CardId
.
小灰篮史莱姆
)
&&
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
小灰篮史莱姆
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
小灰篮史莱姆
))
if
(
Overlays
.
Contains
((
int
)
CardId
.
小灰篮史莱姆
)
&&
Bot
.
HasInHand
((
int
)
CardId
.
小灰篮史莱姆
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
小灰篮史莱姆
))
AI
.
SelectCard
((
int
)
CardId
.
小灰篮史莱姆
);
else
if
(
Overlays
.
Contains
((
int
)
CardId
.
魔知青蛙
)
&&
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
粹蛙
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
))
else
if
(
Overlays
.
Contains
((
int
)
CardId
.
魔知青蛙
)
&&
Bot
.
HasInGraveyard
((
int
)
CardId
.
粹蛙
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
))
AI
.
SelectCard
((
int
)
CardId
.
魔知青蛙
);
else
if
(
Overlays
.
Contains
((
int
)
CardId
.
粹蛙
)
&&
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
)
&&
!
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
粹蛙
))
else
if
(
Overlays
.
Contains
((
int
)
CardId
.
粹蛙
)
&&
Bot
.
HasInGraveyard
((
int
)
CardId
.
魔知青蛙
)
&&
!
Bot
.
HasInGraveyard
((
int
)
CardId
.
粹蛙
))
AI
.
SelectCard
((
int
)
CardId
.
粹蛙
);
else
AI
.
SelectCard
(
new
[]
...
...
Game/AI/Decks/YosenjuExecutor.cs
View file @
f0e083d5
...
...
@@ -184,7 +184,7 @@ namespace WindBot.Game.AI.Decks
}
if
(!(
defender
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
))
{
if
(
attacker
.
Attribute
==
(
int
)
CardAttribute
.
Wind
&&
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
妖仙兽辻斩风
))
if
(
attacker
.
Attribute
==
(
int
)
CardAttribute
.
Wind
&&
Bot
.
HasInHand
((
int
)
CardId
.
妖仙兽辻斩风
))
attacker
.
RealPower
=
attacker
.
RealPower
+
1000
;
if
(
attacker
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
(
2
,
(
int
)
CardId
.
No39
希望皇霍普
))
attacker
.
RealPower
=
5000
;
...
...
@@ -269,7 +269,7 @@ namespace WindBot.Game.AI.Decks
private
bool
优先出重复的妖仙兽
()
{
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Hand
)
foreach
(
ClientCard
card
in
Bot
.
Hand
)
{
if
(
card
!=
null
&&
!
card
.
Equals
(
Card
)
&&
card
.
Id
==
Card
.
Id
)
return
true
;
...
...
@@ -279,7 +279,7 @@ namespace WindBot.Game.AI.Decks
private
bool
优先盖不重复的坑
()
{
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
SpellZone
)
foreach
(
ClientCard
card
in
Bot
.
SpellZone
)
{
if
(
card
!=
null
&&
card
.
Id
==
Card
.
Id
)
return
false
;
...
...
@@ -289,7 +289,7 @@ namespace WindBot.Game.AI.Decks
private
bool
魔陷区有空余格子
()
{
return
Duel
.
Fields
[
0
]
.
GetSpellCountWithoutField
()
<
4
;
return
Bot
.
GetSpellCountWithoutField
()
<
4
;
}
private
bool
已发动过削命
()
...
...
@@ -320,7 +320,7 @@ namespace WindBot.Game.AI.Decks
private
bool
我我我枪手特殊召唤
()
{
if
(
Duel
.
LifePoints
[
1
]
<=
800
||
(
Duel
.
Fields
[
0
]
.
GetMonsterCount
()>=
4
&&
Duel
.
LifePoints
[
1
]
<=
1600
))
if
(
Duel
.
LifePoints
[
1
]
<=
800
||
(
Bot
.
GetMonsterCount
()>=
4
&&
Duel
.
LifePoints
[
1
]
<=
1600
))
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
return
true
;
...
...
@@ -330,28 +330,28 @@ namespace WindBot.Game.AI.Decks
private
bool
励辉士入魔蝇王特殊召唤
()
{
int
selfCount
=
Duel
.
Fields
[
0
].
GetMonsterCount
()
+
Duel
.
Fields
[
0
].
GetSpellCount
()
+
Duel
.
Fields
[
0
]
.
GetHandCount
();
int
oppoCount
=
Duel
.
Fields
[
1
].
GetMonsterCount
()
+
Duel
.
Fields
[
1
].
GetSpellCount
()
+
Duel
.
Fields
[
1
]
.
GetHandCount
();
int
selfCount
=
Bot
.
GetMonsterCount
()
+
Bot
.
GetSpellCount
()
+
Bot
.
GetHandCount
();
int
oppoCount
=
Enemy
.
GetMonsterCount
()
+
Enemy
.
GetSpellCount
()
+
Enemy
.
GetHandCount
();
return
(
selfCount
-
1
<
oppoCount
)
&&
励辉士入魔蝇王效果
();
}
private
bool
励辉士入魔蝇王效果
()
{
int
selfCount
=
Duel
.
Fields
[
0
].
GetMonsterCount
()
+
Duel
.
Fields
[
0
]
.
GetSpellCount
();
int
oppoCount
=
Duel
.
Fields
[
1
].
GetMonsterCount
()
+
Duel
.
Fields
[
1
]
.
GetSpellCount
();
int
selfCount
=
Bot
.
GetMonsterCount
()
+
Bot
.
GetSpellCount
();
int
oppoCount
=
Enemy
.
GetMonsterCount
()
+
Enemy
.
GetSpellCount
();
return
selfCount
<
oppoCount
;
}
private
bool
暗叛逆超量龙特殊召唤
()
{
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
0
]
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
1
]
,
true
);
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Enemy
,
true
);
return
selfBestAttack
<=
oppoBestAttack
;
}
private
bool
暗叛逆超量龙效果
()
{
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
1
]
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Enemy
,
true
);
ClientCard
target
=
AI
.
Utils
.
GetOneEnemyBetterThanValue
(
oppoBestAttack
,
true
);
if
(
target
!=
null
)
{
...
...
@@ -362,8 +362,8 @@ namespace WindBot.Game.AI.Decks
private
bool
电光皇特殊召唤
()
{
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
0
]
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
1
]
,
false
);
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Enemy
,
false
);
return
selfBestAttack
<=
oppoBestAttack
;
}
...
...
Game/AI/Decks/ZexalWeaponsExecutor.cs
View file @
f0e083d5
...
...
@@ -134,7 +134,7 @@ namespace DevBot.Game.AI.Decks
}
if
(!(
defender
.
Id
==
(
int
)
CardId
.
NumberS39UtopiatheLightning
))
{
if
(
attacker
.
Attribute
==
(
int
)
CardAttribute
.
Light
&&
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
Honest
))
if
(
attacker
.
Attribute
==
(
int
)
CardAttribute
.
Light
&&
Bot
.
HasInHand
((
int
)
CardId
.
Honest
))
attacker
.
RealPower
=
attacker
.
RealPower
+
defender
.
Attack
;
if
(
attacker
.
Id
==
(
int
)
CardId
.
NumberS39UtopiatheLightning
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
(
2
,
(
int
)
CardId
.
Number39Utopia
))
attacker
.
RealPower
=
5000
;
...
...
@@ -180,7 +180,7 @@ namespace DevBot.Game.AI.Decks
{
if
(
Duel
.
LifePoints
[
0
]
<=
1000
)
return
false
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
int
count4
=
0
;
int
count5
=
0
;
foreach
(
ClientCard
card
in
monsters
)
...
...
@@ -220,7 +220,7 @@ namespace DevBot.Game.AI.Decks
private
bool
GoblindberghFirst
()
{
IList
<
ClientCard
>
hand
=
Duel
.
Fields
[
0
]
.
Hand
;
IList
<
ClientCard
>
hand
=
Bot
.
Hand
;
foreach
(
ClientCard
card
in
hand
)
{
if
(
card
!=
Card
&&
card
.
IsMonster
()
&&
card
.
Level
==
4
)
...
...
@@ -243,8 +243,8 @@ namespace DevBot.Game.AI.Decks
private
bool
SummonerMonkEffect
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
InstantFusion
)
||
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
MysticalSpaceTyphoon
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
InstantFusion
)
||
Bot
.
HasInHand
((
int
)
CardId
.
MysticalSpaceTyphoon
))
{
AI
.
SelectCard
(
new
[]
{
...
...
@@ -266,7 +266,7 @@ namespace DevBot.Game.AI.Decks
private
bool
SolarWindJammer
()
{
if
(!
Duel
.
Fields
[
0
]
.
HasInHand
(
new
List
<
int
>
{
if
(!
Bot
.
HasInHand
(
new
List
<
int
>
{
(
int
)
CardId
.
StarDrawing
,
(
int
)
CardId
.
InstantFusion
}))
...
...
Game/AI/Decks/ZoodiacExecutor.cs
View file @
f0e083d5
...
...
@@ -142,7 +142,7 @@ namespace MycardBot.Game.AI.Decks
}
if
(!(
defender
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
))
{
//if (attacker.HasType(CardType.Fusion) &&
Duel.Fields[0]
.HasInHand((int)CardId.召唤师阿莱斯特))
//if (attacker.HasType(CardType.Fusion) &&
Bot
.HasInHand((int)CardId.召唤师阿莱斯特))
// attacker.RealPower = attacker.RealPower + 1000;
if
(
attacker
.
Id
==
(
int
)
CardId
.
闪光
No39
希望皇霍普电光皇
&&
!
attacker
.
IsDisabled
()
&&
attacker
.
HasXyzMaterial
(
2
,
(
int
)
CardId
.
No39
希望皇霍普
))
attacker
.
RealPower
=
5000
;
...
...
@@ -192,18 +192,18 @@ namespace MycardBot.Game.AI.Decks
(
int
)
CardId
.
怒炎坏兽多哥兰
,
(
int
)
CardId
.
对坏兽用决战兵器超级机械多哥兰
};
foreach
(
ClientCard
monster
in
Duel
.
Fields
[
1
]
.
GetMonsters
())
foreach
(
ClientCard
monster
in
Enemy
.
GetMonsters
())
{
if
(
kaijus
.
Contains
(
monster
.
Id
))
return
Card
.
GetDefensePower
()
>
monster
.
GetDefensePower
();
}
ClientCard
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetFloodgate
();
ClientCard
card
=
Enemy
.
MonsterZone
.
GetFloodgate
();
if
(
card
!=
null
)
{
AI
.
SelectCard
(
card
);
return
true
;
}
card
=
Duel
.
Fields
[
1
]
.
MonsterZone
.
GetDangerousMonster
();
card
=
Enemy
.
MonsterZone
.
GetDangerousMonster
();
if
(
card
!=
null
)
{
AI
.
SelectCard
(
card
);
...
...
@@ -220,16 +220,16 @@ namespace MycardBot.Game.AI.Decks
private
bool
电光皇特殊召唤
()
{
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
0
]
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Duel
.
Fields
[
1
]
,
false
);
int
selfBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Bot
,
true
);
int
oppoBestAttack
=
AI
.
Utils
.
GetBestAttack
(
Enemy
,
false
);
return
selfBestAttack
<
oppoBestAttack
;
}
private
bool
光子斩击者特殊召唤
()
{
return
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
召唤师阿莱斯特
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
十二兽鼠骑
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
十二兽马剑
);
return
Bot
.
HasInHand
((
int
)
CardId
.
召唤师阿莱斯特
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
十二兽鼠骑
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
十二兽马剑
);
}
private
bool
召唤师阿莱斯特效果
()
...
...
@@ -250,8 +250,8 @@ namespace MycardBot.Game.AI.Decks
{
if
(
Card
.
Location
==
CardLocation
.
Grave
)
return
true
;
IList
<
ClientCard
>
materials0
=
Duel
.
Fields
[
0
]
.
Graveyard
;
IList
<
ClientCard
>
materials1
=
Duel
.
Fields
[
1
]
.
Graveyard
;
IList
<
ClientCard
>
materials0
=
Bot
.
Graveyard
;
IList
<
ClientCard
>
materials1
=
Enemy
.
Graveyard
;
ClientCard
mat
=
null
;
foreach
(
ClientCard
card
in
materials0
)
{
...
...
@@ -306,8 +306,8 @@ namespace MycardBot.Game.AI.Decks
private
void
选择墓地里的召唤师
()
{
IList
<
ClientCard
>
materials0
=
Duel
.
Fields
[
0
]
.
Graveyard
;
IList
<
ClientCard
>
materials1
=
Duel
.
Fields
[
1
]
.
Graveyard
;
IList
<
ClientCard
>
materials0
=
Bot
.
Graveyard
;
IList
<
ClientCard
>
materials1
=
Enemy
.
Graveyard
;
foreach
(
ClientCard
card
in
materials1
)
{
if
(
card
.
Id
==
(
int
)
CardId
.
召唤师阿莱斯特
)
...
...
@@ -329,7 +329,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
十二兽狗环特殊召唤
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
十二兽鼠骑
)
&&
!
已特殊召唤狗环
)
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
十二兽鼠骑
)
&&
!
已特殊召唤狗环
)
{
AI
.
SelectCard
((
int
)
CardId
.
十二兽鼠骑
);
AI
.
SelectYesNo
(
true
);
...
...
@@ -337,7 +337,7 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤狗环
=
true
;
return
true
;
}
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
十二兽牛犄
)
&&
!
已特殊召唤狗环
)
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
十二兽牛犄
)
&&
!
已特殊召唤狗环
)
{
AI
.
SelectCard
((
int
)
CardId
.
十二兽牛犄
);
AI
.
SelectYesNo
(
true
);
...
...
@@ -350,7 +350,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
十二兽狗环效果
()
{
if
(
Duel
.
Fields
[
0
].
HasInGraveyard
((
int
)
CardId
.
十二兽蛇笞
)
||
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
十二兽马剑
))
if
(
Bot
.
HasInGraveyard
((
int
)
CardId
.
十二兽蛇笞
)
||
Bot
.
HasInGraveyard
((
int
)
CardId
.
十二兽马剑
))
{
AI
.
SelectCard
(
new
[]
{
...
...
@@ -373,7 +373,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
十二兽虎炮特殊召唤
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
十二兽狗环
)
&&
!
已特殊召唤虎炮
)
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
十二兽狗环
)
&&
!
已特殊召唤虎炮
)
{
AI
.
SelectCard
((
int
)
CardId
.
十二兽狗环
);
AI
.
SelectYesNo
(
true
);
...
...
@@ -381,7 +381,7 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤虎炮
=
true
;
return
true
;
}
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
十二兽鼠骑
)
&&
!
已特殊召唤虎炮
)
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
十二兽鼠骑
)
&&
!
已特殊召唤虎炮
)
{
AI
.
SelectCard
((
int
)
CardId
.
十二兽鼠骑
);
AI
.
SelectYesNo
(
true
);
...
...
@@ -389,8 +389,8 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤虎炮
=
true
;
return
true
;
}
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
十二兽马剑
)
&&
!
已特殊召唤虎炮
&&
Duel
.
Fields
[
0
]
.
HasInGraveyard
(
new
List
<
int
>
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
十二兽马剑
)
&&
!
已特殊召唤虎炮
&&
Bot
.
HasInGraveyard
(
new
List
<
int
>
{
(
int
)
CardId
.
十二兽蛇笞
,
(
int
)
CardId
.
十二兽鼠骑
...
...
@@ -401,8 +401,8 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤虎炮
=
true
;
return
true
;
}
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
十二兽蛇笞
)
&&
!
已特殊召唤虎炮
&&
Duel
.
Fields
[
0
]
.
HasInGraveyard
((
int
)
CardId
.
十二兽鼠骑
))
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
十二兽蛇笞
)
&&
!
已特殊召唤虎炮
&&
Bot
.
HasInGraveyard
((
int
)
CardId
.
十二兽鼠骑
))
{
AI
.
SelectCard
((
int
)
CardId
.
十二兽蛇笞
);
AI
.
SelectYesNo
(
true
);
...
...
@@ -414,7 +414,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
十二兽虎炮效果
()
{
//if (Card.HasXyzMaterial((int)CardId.十二兽鼠骑) || !
Duel.Fields[0]
.HasInGraveyard((int)CardId.十二兽鼠骑))
//if (Card.HasXyzMaterial((int)CardId.十二兽鼠骑) || !
Bot
.HasInGraveyard((int)CardId.十二兽鼠骑))
// return false;
AI
.
SelectCard
((
int
)
CardId
.
十二兽狗环
);
AI
.
SelectNextCard
((
int
)
CardId
.
十二兽虎炮
);
...
...
@@ -429,7 +429,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
十二兽牛犄特殊召唤
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
十二兽虎炮
)
&&
!
已特殊召唤牛犄
)
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
十二兽虎炮
)
&&
!
已特殊召唤牛犄
)
{
AI
.
SelectCard
((
int
)
CardId
.
十二兽虎炮
);
AI
.
SelectYesNo
(
true
);
...
...
@@ -437,7 +437,7 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤牛犄
=
true
;
return
true
;
}
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
十二兽狗环
)
&&
!
已特殊召唤牛犄
)
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
十二兽狗环
)
&&
!
已特殊召唤牛犄
)
{
AI
.
SelectCard
((
int
)
CardId
.
十二兽狗环
);
AI
.
SelectYesNo
(
true
);
...
...
@@ -445,7 +445,7 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤牛犄
=
true
;
return
true
;
}
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
十二兽鼠骑
)
&&
!
已特殊召唤牛犄
)
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
十二兽鼠骑
)
&&
!
已特殊召唤牛犄
)
{
AI
.
SelectCard
((
int
)
CardId
.
十二兽鼠骑
);
AI
.
SelectYesNo
(
true
);
...
...
@@ -453,7 +453,7 @@ namespace MycardBot.Game.AI.Decks
已特殊召唤牛犄
=
true
;
return
true
;
}
if
(
Duel
.
Fields
[
0
]
.
HasInMonstersZone
((
int
)
CardId
.
十二兽马剑
)
&&
!
已特殊召唤牛犄
)
if
(
Bot
.
HasInMonstersZone
((
int
)
CardId
.
十二兽马剑
)
&&
!
已特殊召唤牛犄
)
{
AI
.
SelectCard
((
int
)
CardId
.
十二兽马剑
);
AI
.
SelectYesNo
(
true
);
...
...
@@ -474,7 +474,7 @@ namespace MycardBot.Game.AI.Decks
(
int
)
CardId
.
召唤师阿莱斯特
,
(
int
)
CardId
.
光子斩击者
});
if
(
Duel
.
Fields
[
0
].
HasInHand
((
int
)
CardId
.
十二兽蛇笞
)
&&
!
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
十二兽鼠骑
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
十二兽蛇笞
)
&&
!
Bot
.
HasInHand
((
int
)
CardId
.
十二兽鼠骑
))
AI
.
SelectNextCard
((
int
)
CardId
.
十二兽鼠骑
);
else
AI
.
SelectNextCard
((
int
)
CardId
.
十二兽蛇笞
);
...
...
@@ -524,7 +524,7 @@ namespace MycardBot.Game.AI.Decks
if
(
Card
.
IsDisabled
()
||
蛇笞发动次数
>=
3
)
return
false
;
ClientCard
target
=
null
;
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
0
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
IsFaceup
()
&&
monster
.
Id
==
(
int
)
CardId
.
十二兽龙枪
&&
!
monster
.
HasXyzMaterial
())
...
...
@@ -573,7 +573,7 @@ namespace MycardBot.Game.AI.Decks
ClientCard
target
=
AI
.
Utils
.
GetProblematicCard
();
if
(
target
==
null
)
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
IsFaceup
())
...
...
@@ -585,7 +585,7 @@ namespace MycardBot.Game.AI.Decks
}
if
(
target
==
null
)
{
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFaceup
()
&&
spell
.
IsSpellNegateAttack
())
...
...
@@ -597,7 +597,7 @@ namespace MycardBot.Game.AI.Decks
}
if
(
target
==
null
)
{
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
IsFaceup
()
&&
(
spell
.
HasType
(
CardType
.
Continuous
)
...
...
@@ -627,7 +627,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
大薰风骑士翠玉特殊召唤
()
{
return
Duel
.
Fields
[
0
]
.
GetGraveyardMonsters
().
Count
>=
3
;
return
Bot
.
GetGraveyardMonsters
().
Count
>=
3
;
}
private
bool
大薰风骑士翠玉效果
()
...
...
@@ -648,9 +648,9 @@ namespace MycardBot.Game.AI.Decks
private
bool
炎舞天玑效果
()
{
if
(
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
十二兽的会局
)
||
Duel
.
Fields
[
0
]
.
HasInSpellZone
((
int
)
CardId
.
十二兽的会局
)
||
Duel
.
Fields
[
0
]
.
HasInHand
((
int
)
CardId
.
十二兽鼠骑
))
if
(
Bot
.
HasInHand
((
int
)
CardId
.
十二兽的会局
)
||
Bot
.
HasInSpellZone
((
int
)
CardId
.
十二兽的会局
)
||
Bot
.
HasInHand
((
int
)
CardId
.
十二兽鼠骑
))
{
AI
.
SelectCard
((
int
)
CardId
.
十二兽蛇笞
);
}
...
...
@@ -664,7 +664,7 @@ namespace MycardBot.Game.AI.Decks
private
bool
十二兽的会局效果
()
{
IList
<
ClientCard
>
spells
=
Duel
.
Fields
[
0
]
.
GetSpells
();
IList
<
ClientCard
>
spells
=
Bot
.
GetSpells
();
foreach
(
ClientCard
spell
in
spells
)
{
if
(
spell
.
Id
==
(
int
)
CardId
.
十二兽的会局
&&
!
Card
.
Equals
(
spell
))
...
...
Game/AI/DefaultExecutor.cs
View file @
f0e083d5
...
...
@@ -29,11 +29,11 @@ namespace WindBot.Game.AI
protected
bool
DefaultStampingDestruction
()
{
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
if
(
spells
.
Count
==
0
)
return
false
;
ClientCard
selected
=
Duel
.
Fields
[
1
]
.
SpellZone
.
GetFloodgate
();
ClientCard
selected
=
Enemy
.
SpellZone
.
GetFloodgate
();
if
(
selected
==
null
)
{
...
...
@@ -55,14 +55,14 @@ namespace WindBot.Game.AI
protected
bool
DefaultGalaxyCyclone
()
{
List
<
ClientCard
>
spells
=
Duel
.
Fields
[
1
]
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
if
(
spells
.
Count
==
0
)
return
false
;
ClientCard
selected
=
null
;
if
(
Card
.
Location
==
CardLocation
.
Grave
)
{
selected
=
Duel
.
Fields
[
1
]
.
SpellZone
.
GetFloodgate
();
selected
=
Enemy
.
SpellZone
.
GetFloodgate
();
if
(
selected
==
null
)
{
foreach
(
ClientCard
card
in
spells
)
...
...
@@ -98,7 +98,7 @@ namespace WindBot.Game.AI
{
if
(
AI
.
Utils
.
IsEnemyBetter
(
true
,
true
))
{
ClientCard
monster
=
Duel
.
Fields
[
1
]
.
GetMonsters
().
GetHighestAttackMonster
();
ClientCard
monster
=
Enemy
.
GetMonsters
().
GetHighestAttackMonster
();
if
(
monster
!=
null
&&
monster
.
HasType
(
CardType
.
Effect
)
&&
(
monster
.
HasType
(
CardType
.
Xyz
)
||
monster
.
Level
>
4
))
{
AI
.
SelectCard
(
monster
);
...
...
@@ -120,7 +120,7 @@ namespace WindBot.Game.AI
{
if
(
Card
.
Equals
(
card
))
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
AI
.
SelectCard
(
monster
);
...
...
@@ -137,7 +137,7 @@ namespace WindBot.Game.AI
return
false
;
ClientCard
selected
=
null
;
int
BestAtk
=
0
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
Graveyard
)
foreach
(
ClientCard
card
in
Bot
.
Graveyard
)
{
if
(
card
.
Attack
>
BestAtk
)
{
...
...
@@ -156,7 +156,7 @@ namespace WindBot.Game.AI
protected
bool
DefaultHeavyStorm
()
{
return
Duel
.
Fields
[
0
].
GetSpellCount
()
<
Duel
.
Fields
[
1
]
.
GetSpellCount
();
return
Bot
.
GetSpellCount
()
<
Enemy
.
GetSpellCount
();
}
protected
bool
DefaultHammerShot
()
...
...
@@ -176,12 +176,12 @@ namespace WindBot.Game.AI
protected
bool
DefaultSpellSet
()
{
return
Card
.
IsTrap
()
&&
Duel
.
Fields
[
0
]
.
GetSpellCountWithoutField
()
<
4
;
return
Card
.
IsTrap
()
&&
Bot
.
GetSpellCountWithoutField
()
<
4
;
}
protected
bool
DefaultTributeSummon
()
{
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
SpellZone
)
foreach
(
ClientCard
card
in
Bot
.
SpellZone
)
{
if
(
card
!=
null
&&
card
.
Id
==
Card
.
Id
&&
...
...
@@ -191,7 +191,7 @@ namespace WindBot.Game.AI
int
tributecount
=
(
int
)
Math
.
Ceiling
((
Card
.
Level
-
4.0d
)
/
2.0d
);
for
(
int
j
=
0
;
j
<
7
;
++
j
)
{
ClientCard
tributeCard
=
Duel
.
Fields
[
0
]
.
MonsterZone
[
j
];
ClientCard
tributeCard
=
Bot
.
MonsterZone
[
j
];
if
(
tributeCard
==
null
)
continue
;
if
(
tributeCard
.
Attack
<
Card
.
Attack
)
tributecount
--;
...
...
@@ -201,7 +201,7 @@ namespace WindBot.Game.AI
protected
bool
DefaultField
()
{
return
Duel
.
Fields
[
0
]
.
SpellZone
[
5
]
==
null
;
return
Bot
.
SpellZone
[
5
]
==
null
;
}
protected
bool
DefaultMonsterRepos
()
...
...
@@ -225,7 +225,7 @@ namespace WindBot.Game.AI
if
(
HasChainedTrap
(
0
))
return
false
;
foreach
(
ClientCard
card
in
Duel
.
Fields
[
0
]
.
SpellZone
)
foreach
(
ClientCard
card
in
Bot
.
SpellZone
)
{
if
(
card
!=
null
&&
card
.
Id
==
Card
.
Id
&&
...
...
@@ -257,7 +257,7 @@ namespace WindBot.Game.AI
{
if
(
Duel
.
Player
!=
0
)
{
List
<
ClientCard
>
monsters
=
Duel
.
Fields
[
1
]
.
GetMonsters
();
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
int
[]
levels
=
new
int
[
13
];
bool
tuner
=
false
;
bool
nontuner
=
false
;
...
...
@@ -287,8 +287,8 @@ namespace WindBot.Game.AI
return
true
;
}
}
ClientCard
l
=
Duel
.
Fields
[
1
]
.
SpellZone
[
6
];
ClientCard
r
=
Duel
.
Fields
[
1
]
.
SpellZone
[
7
];
ClientCard
l
=
Enemy
.
SpellZone
[
6
];
ClientCard
r
=
Enemy
.
SpellZone
[
7
];
if
(
l
!=
null
&&
r
!=
null
&&
l
.
LScale
!=
r
.
RScale
)
{
AI
.
SelectOption
(
4
);
...
...
Game/AI/Executor.cs
View file @
f0e083d5
...
...
@@ -19,7 +19,10 @@ namespace WindBot.Game.AI
protected
int
ActivateDescription
{
get
;
private
set
;
}
protected
int
LastChainPlayer
{
get
;
private
set
;
}
protected
IList
<
ClientCard
>
CurrentChain
{
get
;
private
set
;
}
protected
IList
<
ClientCard
>
CurrentChain
{
get
;
private
set
;
}
public
ClientField
Bot
{
get
;
private
set
;
}
public
ClientField
Enemy
{
get
;
private
set
;
}
protected
Executor
(
GameAI
ai
,
Duel
duel
)
{
...
...
@@ -29,6 +32,9 @@ namespace WindBot.Game.AI
LastChainPlayer
=
-
1
;
CurrentChain
=
new
List
<
ClientCard
>();
Bot
=
Duel
.
Fields
[
0
];
Enemy
=
Duel
.
Fields
[
1
];
}
public
virtual
bool
OnSelectHand
()
...
...
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