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
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
MyCard
windbot
Commits
e5d5696d
Commit
e5d5696d
authored
Apr 11, 2018
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/moecube/windbot
parents
4eaca351
b2bf309b
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
844 additions
and
318 deletions
+844
-318
Decks/AI_ChainBurn.ydk
Decks/AI_ChainBurn.ydk
+3
-3
Game/AI/Decks/ChainBurnExecutor.cs
Game/AI/Decks/ChainBurnExecutor.cs
+207
-59
Game/AI/Decks/LightswornShaddoldinosourExecutor.cs
Game/AI/Decks/LightswornShaddoldinosourExecutor.cs
+424
-204
Game/AI/Decks/TrickstarExecutor.cs
Game/AI/Decks/TrickstarExecutor.cs
+161
-42
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+20
-2
Game/AI/Executor.cs
Game/AI/Executor.cs
+6
-0
Game/GameAI.cs
Game/GameAI.cs
+10
-6
Game/GameBehavior.cs
Game/GameBehavior.cs
+13
-2
No files found.
Decks/AI_ChainBurn.ydk
View file @
e5d5696d
...
@@ -37,7 +37,6 @@
...
@@ -37,7 +37,6 @@
36361633
36361633
36361633
36361633
36361633
36361633
36468556
37576645
37576645
37576645
37576645
37576645
37576645
...
@@ -52,7 +51,6 @@
...
@@ -52,7 +51,6 @@
75249652
75249652
83555666
83555666
98444741
98444741
98444741
#extra
#extra
41999284
41999284
41999284
41999284
...
@@ -66,3 +64,5 @@
...
@@ -66,3 +64,5 @@
100227025
100227025
100227025
100227025
100227025
100227025
36468556
98444741
\ No newline at end of file
Game/AI/Decks/ChainBurnExecutor.cs
View file @
e5d5696d
...
@@ -62,6 +62,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -62,6 +62,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
Waboku
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
Waboku
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
ThreateningRoar
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
ThreateningRoar
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
BlazingMirrorForce
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
BlazingMirrorForce
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
OjamaTrio
,
OjamaTrioset
);
AddExecutor
(
ExecutorType
.
SpellSet
,
BrunSpellSet
);
AddExecutor
(
ExecutorType
.
SpellSet
,
BrunSpellSet
);
//afer set
//afer set
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
CardcarD
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
CardcarD
);
...
@@ -69,7 +70,6 @@ namespace WindBot.Game.AI.Decks
...
@@ -69,7 +70,6 @@ namespace WindBot.Game.AI.Decks
//activate trap
//activate trap
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
BalanceOfJudgment
,
BalanceOfJudgmenteff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
BalanceOfJudgment
,
BalanceOfJudgmenteff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
AccuulatedFortune
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
AccuulatedFortune
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ChainStrike
,
ChainStrikeeff
);
//battle
//battle
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ThreateningRoar
,
ThreateningRoareff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ThreateningRoar
,
ThreateningRoareff
);
...
@@ -85,7 +85,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -85,7 +85,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SecretBlast
,
SecretBlasteff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SecretBlast
,
SecretBlasteff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SectetBarrel
,
SectetBarreleff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SectetBarrel
,
SectetBarreleff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
RecklessGreed
,
RecklessGreedeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
RecklessGreed
,
RecklessGreedeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ChainStrike
,
ChainStrikeeff
);
//sp
//sp
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Linkuriboh
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Linkuriboh
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Linkuriboh
,
Linkuriboheff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Linkuriboh
,
Linkuriboheff
);
...
@@ -181,10 +181,11 @@ namespace WindBot.Game.AI.Decks
...
@@ -181,10 +181,11 @@ namespace WindBot.Game.AI.Decks
};
};
}
}
public
int
[]
p
reven
t_list
()
public
int
[]
p
o
t_list
()
{
{
return
new
[]
return
new
[]
{
{
CardId
.
PotOfDesires
,
CardId
.
SandaionTheTimloard
,
CardId
.
SandaionTheTimloard
,
CardId
.
BattleFader
,
CardId
.
BattleFader
,
...
@@ -205,10 +206,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -205,10 +206,9 @@ namespace WindBot.Game.AI.Decks
}
}
return
atk
;
return
atk
;
}
}
public
bool
Has_prevent_list
(
int
id
)
public
bool
Has_prevent_list
_0
(
int
id
)
{
{
return
(
id
==
CardId
.
SandaionTheTimloard
||
return
(
id
==
CardId
.
BattleFader
||
id
==
CardId
.
Waboku
||
id
==
CardId
.
Waboku
||
id
==
CardId
.
ThreateningRoar
||
id
==
CardId
.
ThreateningRoar
||
id
==
CardId
.
MagicCylinder
||
id
==
CardId
.
MagicCylinder
||
...
@@ -216,13 +216,31 @@ namespace WindBot.Game.AI.Decks
...
@@ -216,13 +216,31 @@ namespace WindBot.Game.AI.Decks
id
==
CardId
.
RingOfDestruction
id
==
CardId
.
RingOfDestruction
);
);
}
}
bool
pot_used
=
false
;
public
bool
Has_prevent_list_1
(
int
id
)
{
return
(
id
==
CardId
.
SandaionTheTimloard
||
id
==
CardId
.
BattleFader
);
}
bool
no_sp
=
false
;
bool
one_turn_kill
=
false
;
bool
one_turn_kill_1
=
false
;
int
expected_blood
=
0
;
int
expected_blood
=
0
;
bool
prevent_used
=
false
;
bool
prevent_used
=
false
;
int
preventcount
=
0
;
int
preventcount
=
0
;
bool
battleprevent
=
false
;
bool
battleprevent
=
false
;
bool
OjamaTrioused
=
false
;
bool
OjamaTrioused
=
false
;
bool
HasAccuulatedFortune
=
false
;
bool
OjamaTrioused_draw
=
false
;
bool
drawfirst
=
false
;
int
Waboku_count
=
0
;
int
Roar_count
=
0
;
int
strike_count
=
0
;
int
greed_count
=
0
;
int
blast_count
=
0
;
int
barrel_count
=
0
;
int
just_count
=
0
;
int
Ojama_count
=
0
;
int
HasAccuulatedFortune
=
0
;
public
override
bool
OnSelectHand
()
public
override
bool
OnSelectHand
()
{
{
return
true
;
return
true
;
...
@@ -230,25 +248,24 @@ namespace WindBot.Game.AI.Decks
...
@@ -230,25 +248,24 @@ namespace WindBot.Game.AI.Decks
public
override
void
OnNewTurn
()
public
override
void
OnNewTurn
()
{
{
pot_used
=
false
;
no_sp
=
false
;
prevent_used
=
false
;
prevent_used
=
false
;
battleprevent
=
false
;
OjamaTrioused
=
false
;
}
}
public
override
void
OnNewPhase
()
public
override
void
OnNewPhase
()
{
{
preventcount
=
0
;
preventcount
=
0
;
battleprevent
=
false
;
battleprevent
=
false
;
HasAccuulatedFortune
=
false
;
OjamaTrioused
=
false
;
IList
<
ClientCard
>
trap
=
Bot
.
SpellZone
;
IList
<
ClientCard
>
trap
=
Bot
.
SpellZone
;
IList
<
ClientCard
>
monster
=
Bot
.
MonsterZone
;
IList
<
ClientCard
>
monster
=
Bot
.
MonsterZone
;
foreach
(
ClientCard
card
in
trap
)
{
if
(
card
.
Id
==
CardId
.
AccuulatedFortune
)
HasAccuulatedFortune
=
true
;
}
foreach
(
ClientCard
card
in
trap
)
foreach
(
ClientCard
card
in
trap
)
{
{
if
(
Has_prevent_list
(
card
.
Id
))
if
(
Has_prevent_list
_0
(
card
.
Id
))
{
{
preventcount
++;
preventcount
++;
battleprevent
=
true
;
battleprevent
=
true
;
...
@@ -257,13 +274,102 @@ namespace WindBot.Game.AI.Decks
...
@@ -257,13 +274,102 @@ namespace WindBot.Game.AI.Decks
}
}
foreach
(
ClientCard
card
in
monster
)
foreach
(
ClientCard
card
in
monster
)
{
{
if
(
Has_prevent_list
(
card
.
Id
))
if
(
Has_prevent_list
_1
(
card
.
Id
))
{
{
preventcount
++;
preventcount
++;
battleprevent
=
true
;
battleprevent
=
true
;
}
}
}
}
expected_blood
=
0
;
one_turn_kill
=
false
;
one_turn_kill_1
=
false
;
OjamaTrioused_draw
=
false
;
drawfirst
=
false
;
HasAccuulatedFortune
=
0
;
strike_count
=
0
;
greed_count
=
0
;
blast_count
=
0
;
barrel_count
=
0
;
just_count
=
0
;
Waboku_count
=
0
;
Roar_count
=
0
;
Ojama_count
=
0
;
IList
<
ClientCard
>
check
=
Bot
.
SpellZone
;
foreach
(
ClientCard
card
in
check
)
{
if
(
card
.
Id
==
CardId
.
AccuulatedFortune
)
HasAccuulatedFortune
++;
}
foreach
(
ClientCard
card
in
check
)
{
if
(
card
.
Id
==
CardId
.
SecretBlast
)
blast_count
++;
}
foreach
(
ClientCard
card
in
check
)
{
if
(
card
.
Id
==
CardId
.
SectetBarrel
)
barrel_count
++;
}
foreach
(
ClientCard
card
in
check
)
{
if
(
card
.
Id
==
CardId
.
JustDesserts
)
just_count
++;
}
foreach
(
ClientCard
card
in
check
)
{
if
(
card
.
Id
==
CardId
.
ChainStrike
)
strike_count
++;
}
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
{
if
(
card
.
Id
==
CardId
.
RecklessGreed
)
greed_count
++;
}
foreach
(
ClientCard
card
in
check
)
{
if
(
card
.
Id
==
CardId
.
Waboku
)
Waboku_count
++;
}
foreach
(
ClientCard
card
in
check
)
{
if
(
card
.
Id
==
CardId
.
ThreateningRoar
)
Roar_count
++;
}
if
(
Bot
.
HasInSpellZone
(
CardId
.
OjamaTrio
)
&&
Enemy
.
GetMonsterCount
()
<=
2
&&
Enemy
.
GetMonsterCount
()
>=
1
)
{
if
(
HasAccuulatedFortune
>
0
)
OjamaTrioused_draw
=
true
;
}
expected_blood
=
(
Enemy
.
GetMonsterCount
()
*
500
*
just_count
+
Enemy
.
GetFieldHandCount
()
*
200
*
barrel_count
+
Enemy
.
GetFieldCount
()
*
300
*
blast_count
);
if
(
Enemy
.
LifePoints
<=
expected_blood
)
one_turn_kill
=
true
;
if
(
greed_count
>=
2
)
greed_count
=
1
;
if
(
blast_count
>=
2
)
blast_count
=
1
;
if
(
just_count
>=
2
)
just_count
=
1
;
if
(
barrel_count
>=
2
)
barrel_count
=
1
;
if
(
Waboku_count
>=
2
)
Waboku_count
=
1
;
if
(
Roar_count
>=
2
)
Roar_count
=
1
;
if
(
strike_count
>=
2
)
strike_count
=
1
;
int
currentchain
=
0
;
if
(
OjamaTrioused_draw
)
currentchain
=
Duel
.
CurrentChain
.
Count
+
blast_count
+
just_count
+
barrel_count
+
Waboku_count
+
Waboku_count
+
Roar_count
+
greed_count
+
strike_count
+
Ojama_count
;
else
currentchain
=
Duel
.
CurrentChain
.
Count
+
blast_count
+
just_count
+
barrel_count
+
Waboku_count
+
Waboku_count
+
greed_count
+
Roar_count
+
strike_count
;
if
(
currentchain
>=
3
)
drawfirst
=
true
;
currentchain
=
Duel
.
CurrentChain
.
Count
+
blast_count
+
just_count
+
barrel_count
;
expected_blood
=
(
Enemy
.
GetMonsterCount
()
*
500
*
just_count
+
Enemy
.
GetFieldHandCount
()
*
200
*
barrel_count
+
Enemy
.
GetFieldCount
()
*
300
*
blast_count
+(
currentchain
+
1
)*
400
);
if
(
Enemy
.
LifePoints
<=
expected_blood
)
one_turn_kill_1
=
true
;
}
}
...
@@ -279,8 +385,14 @@ namespace WindBot.Game.AI.Decks
...
@@ -279,8 +385,14 @@ namespace WindBot.Game.AI.Decks
}
}
return
false
;
return
false
;
}
}
private
bool
OjamaTrioset
()
{
if
(
Bot
.
HasInSpellZone
(
CardId
.
OjamaTrio
))
return
false
;
return
true
;
}
private
bool
BrunSpellSet
()
private
bool
BrunSpellSet
()
{
{
if
(
Card
.
Id
==
CardId
.
OjamaTrio
&&
Bot
.
HasInSpellZone
(
CardId
.
OjamaTrio
))
return
false
;
return
(
Card
.
IsTrap
()
||
Card
.
HasType
(
CardType
.
QuickPlay
))
&&
Bot
.
GetSpellCountWithoutField
()
<
5
;
return
(
Card
.
IsTrap
()
||
Card
.
HasType
(
CardType
.
QuickPlay
))
&&
Bot
.
GetSpellCountWithoutField
()
<
5
;
}
}
private
bool
SandaionTheTimloard_summon
()
private
bool
SandaionTheTimloard_summon
()
...
@@ -291,7 +403,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -291,7 +403,7 @@ namespace WindBot.Game.AI.Decks
}
}
private
bool
AbouluteKingBackJacksummon
()
private
bool
AbouluteKingBackJacksummon
()
{
{
return
!
pot_used
;
return
!
no_sp
;
}
}
private
bool
AbouluteKingBackJackeff
()
private
bool
AbouluteKingBackJackeff
()
{
{
...
@@ -307,8 +419,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -307,8 +419,9 @@ namespace WindBot.Game.AI.Decks
}
}
private
bool
PotOfDualityeff
()
private
bool
PotOfDualityeff
()
{
{
pot_used
=
true
;
no_sp
=
true
;
AI
.
SelectCard
(
prevent_list
());
AI
.
SelectCard
(
pot_list
());
return
true
;
return
true
;
}
}
private
bool
BlazingMirrorForceeff
()
private
bool
BlazingMirrorForceeff
()
...
@@ -319,25 +432,29 @@ namespace WindBot.Game.AI.Decks
...
@@ -319,25 +432,29 @@ namespace WindBot.Game.AI.Decks
{
{
list
.
Add
(
monster
);
list
.
Add
(
monster
);
}
}
if
(
GetTotalATK
(
list
)
<=
3000
)
return
false
;
//if (GetTotalATK(list) / 2 >= Bot.LifePoints) return false;
if
(
GetTotalATK
(
list
)
<
3000
)
return
false
;
return
Enemy
.
HasAttackingMonster
()
&&
DefaultUniqueTrap
();
return
Enemy
.
HasAttackingMonster
()
&&
DefaultUniqueTrap
();
}
}
private
bool
ThreateningRoareff
()
private
bool
ThreateningRoareff
()
{
{
if
(
drawfirst
)
return
true
;
if
(
must_chain
())
return
true
;
if
(
must_chain
())
return
true
;
if
(
prevent_used
||
Duel
.
Phase
==
DuelPhase
.
End
||
Duel
.
Phase
==
DuelPhase
.
Main2
)
return
false
;
if
(
prevent_used
||
Duel
.
Phase
!=
DuelPhase
.
BattleStart
)
return
false
;
prevent_used
=
true
;
prevent_used
=
true
;
return
DefaultUniqueTrap
();
return
DefaultUniqueTrap
();
}
}
private
bool
SandaionTheTimloardeff
()
private
bool
SandaionTheTimloardeff
()
{
{
prevent_used
=
true
;
prevent_used
=
true
;
return
true
;
return
true
;
}
}
private
bool
Wabokueff
()
private
bool
Wabokueff
()
{
{
if
(
drawfirst
)
return
true
;
if
(
must_chain
())
return
true
;
if
(
must_chain
())
return
true
;
if
(
drawfirst
)
return
true
;
if
(
prevent_used
||
Duel
.
Player
==
0
||
Duel
.
Phase
!=
DuelPhase
.
BattleStart
)
return
false
;
if
(
prevent_used
||
Duel
.
Player
==
0
||
Duel
.
Phase
!=
DuelPhase
.
BattleStart
)
return
false
;
prevent_used
=
true
;
prevent_used
=
true
;
return
DefaultUniqueTrap
();
return
DefaultUniqueTrap
();
...
@@ -374,12 +491,27 @@ namespace WindBot.Game.AI.Decks
...
@@ -374,12 +491,27 @@ namespace WindBot.Game.AI.Decks
}
}
private
bool
RecklessGreedeff
()
private
bool
RecklessGreedeff
()
{
{
int
count
=
0
;
foreach
(
ClientCard
card
in
Bot
.
GetSpells
())
{
if
(
card
.
Id
==
CardId
.
RecklessGreed
)
count
++;
}
bool
Demiseused
=
AI
.
Utils
.
ChainContainsCard
(
CardId
.
CardOfDemise
);
if
(
drawfirst
)
return
DefaultUniqueTrap
();
if
(
must_chain
()
&&
count
>
1
)
return
true
;
if
(
Demiseused
)
return
false
;
if
(
count
>
1
)
return
true
;
if
(
Bot
.
LifePoints
<=
2000
)
return
true
;
if
(
Bot
.
LifePoints
<=
2000
)
return
true
;
if
(
Bot
.
GetHandCount
()
<
1
&&
Duel
.
Player
==
0
&&
Duel
.
Phase
!=
DuelPhase
.
Standby
)
return
true
;
if
(
Bot
.
GetHandCount
()
<
1
&&
Duel
.
Player
==
0
&&
Duel
.
Phase
!=
DuelPhase
.
Standby
)
return
true
;
return
false
;
return
false
;
}
}
private
bool
SectetBarreleff
()
private
bool
SectetBarreleff
()
{
{
if
(
drawfirst
)
return
DefaultUniqueTrap
();
if
(
one_turn_kill_1
)
return
DefaultUniqueTrap
();
if
(
one_turn_kill
)
return
DefaultUniqueTrap
();
if
(
must_chain
())
return
true
;
if
(
must_chain
())
return
true
;
int
count
=
Enemy
.
GetFieldHandCount
();
int
count
=
Enemy
.
GetFieldHandCount
();
if
(
Enemy
.
LifePoints
<
count
*
200
)
return
true
;
if
(
Enemy
.
LifePoints
<
count
*
200
)
return
true
;
...
@@ -388,6 +520,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -388,6 +520,9 @@ namespace WindBot.Game.AI.Decks
}
}
private
bool
SecretBlasteff
()
private
bool
SecretBlasteff
()
{
{
if
(
drawfirst
)
return
DefaultUniqueTrap
();
if
(
one_turn_kill_1
)
return
DefaultUniqueTrap
();
if
(
one_turn_kill
)
return
DefaultUniqueTrap
();
if
(
must_chain
())
return
true
;
if
(
must_chain
())
return
true
;
int
count
=
Enemy
.
GetFieldCount
();
int
count
=
Enemy
.
GetFieldCount
();
if
(
Enemy
.
LifePoints
<
count
*
300
)
return
true
;
if
(
Enemy
.
LifePoints
<
count
*
300
)
return
true
;
...
@@ -395,12 +530,17 @@ namespace WindBot.Game.AI.Decks
...
@@ -395,12 +530,17 @@ namespace WindBot.Game.AI.Decks
return
false
;
return
false
;
}
}
private
bool
OjamaTrioeff
()
private
bool
OjamaTrioeff
()
{
{
return
OjamaTrioused
;
return
OjamaTrioused
||
OjamaTrioused_draw
;
}
}
private
bool
JustDessertseff
()
private
bool
JustDessertseff
()
{
{
if
(
Duel
.
Player
==
0
)
return
false
;
if
(
drawfirst
)
return
DefaultUniqueTrap
();
if
(
one_turn_kill_1
)
return
DefaultUniqueTrap
();
if
(
one_turn_kill
)
return
DefaultUniqueTrap
();
if
(
must_chain
())
return
true
;
if
(
must_chain
())
return
true
;
int
count
=
Enemy
.
GetMonsterCount
();
int
count
=
Enemy
.
GetMonsterCount
();
if
(
Enemy
.
LifePoints
<=
count
*
500
)
return
true
;
if
(
Enemy
.
LifePoints
<=
count
*
500
)
return
true
;
...
@@ -414,18 +554,13 @@ namespace WindBot.Game.AI.Decks
...
@@ -414,18 +554,13 @@ namespace WindBot.Game.AI.Decks
}
}
private
bool
ChainStrikeeff
()
private
bool
ChainStrikeeff
()
{
{
if
(
drawfirst
)
return
true
;
if
(
must_chain
())
return
true
;
if
(
must_chain
())
return
true
;
int
chain
=
Duel
.
CurrentChain
.
Count
;
int
chain
=
Duel
.
CurrentChain
.
Count
;
if
(
strike_count
>=
2
&&
chain
>=
2
)
return
true
;
if
(
Enemy
.
LifePoints
<=
(
chain
+
1
)
*
400
)
return
true
;
if
(
Enemy
.
LifePoints
<=
(
chain
+
1
)
*
400
)
return
true
;
if
(
Duel
.
CurrentChain
.
Count
==
4
)
return
true
;
if
(
Duel
.
CurrentChain
.
Count
>=
3
)
return
true
;
return
false
;
}
private
bool
Ceasefireeff
()
{
if
(
must_chain
())
return
true
;
int
count
=
Bot
.
GetMonsterCount
()
+
Enemy
.
GetMonsterCount
();
if
(
Enemy
.
LifePoints
<=
count
*
500
)
return
true
;
if
(
count
>=
3
)
return
true
;
return
false
;
return
false
;
}
}
...
@@ -439,7 +574,10 @@ namespace WindBot.Game.AI.Decks
...
@@ -439,7 +574,10 @@ namespace WindBot.Game.AI.Decks
private
bool
CardOfDemiseeff
()
private
bool
CardOfDemiseeff
()
{
{
if
(
Bot
.
GetHandCount
()
==
1
&&
Bot
.
GetSpellCountWithoutField
()
<=
3
)
if
(
Bot
.
GetHandCount
()
==
1
&&
Bot
.
GetSpellCountWithoutField
()
<=
3
)
{
no_sp
=
true
;
return
true
;
return
true
;
}
return
false
;
return
false
;
}
}
private
bool
Mathematicianeff
()
private
bool
Mathematicianeff
()
...
@@ -455,25 +593,35 @@ namespace WindBot.Game.AI.Decks
...
@@ -455,25 +593,35 @@ namespace WindBot.Game.AI.Decks
private
bool
DiceJarfacedown
()
private
bool
DiceJarfacedown
()
{
{
IList
<
ClientCard
>
check
=
Bot
.
MonsterZone
;
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
card
in
check
)
{
{
if
(
card
.
Id
==
CardId
.
DiceJar
&&
card
.
IsFacedown
())
if
(
card
.
Id
==
CardId
.
DiceJar
&&
card
.
IsFacedown
())
return
true
;
return
true
;
break
;
}
}
return
false
;
return
false
;
}
}
private
bool
Ceasefire
()
private
bool
Ceasefire
eff
()
{
{
if
(
Bot
.
GetMonsterCount
()
>=
3
)
return
true
;
if
(
Enemy
.
GetMonsterCount
()
>=
3
)
return
true
;
if
(
DiceJarfacedown
())
return
false
;
if
(
DiceJarfacedown
())
return
false
;
if
((
Bot
.
GetMonsterCount
()
+
Enemy
.
GetMonsterCount
())
>=
4
)
return
true
;
if
((
Bot
.
GetMonsterCount
()
+
Enemy
.
GetMonsterCount
())
>=
4
)
return
true
;
return
false
;
return
false
;
}
}
private
bool
Linkuriboheff
()
private
bool
Linkuriboheff
()
{
{
ClientCard
lastchaincard
=
AI
.
Utils
.
GetLastChainCard
();
if
(
lastchaincard
==
null
)
return
true
;
if
(
lastchaincard
.
Id
==
CardId
.
Linkuriboh
)
return
false
;
return
true
;
return
true
;
}
}
public
override
bool
OnPreBattleBetween
(
ClientCard
attacker
,
ClientCard
defender
)
{
if
(
attacker
.
Id
==
CardId
.
Linkuriboh
&&
defender
.
IsFacedown
())
return
false
;
return
base
.
OnPreBattleBetween
(
attacker
,
defender
);
}
/*private bool SwordsOfRevealingLight()
/*private bool SwordsOfRevealingLight()
{
{
int count = Bot.SpellZone.GetCardCount(CardId.SwordsOfRevealingLight);
int count = Bot.SpellZone.GetCardCount(CardId.SwordsOfRevealingLight);
...
...
Game/AI/Decks/LightswornShaddoldinosourExecutor.cs
View file @
e5d5696d
...
@@ -41,7 +41,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -41,7 +41,7 @@ namespace WindBot.Game.AI.Decks
public
const
int
HarpiesFeatherDuster
=
18144506
;
public
const
int
HarpiesFeatherDuster
=
18144506
;
public
const
int
DoubleEvolutionPill
=
38179121
;
public
const
int
DoubleEvolutionPill
=
38179121
;
public
const
int
ShaddollFusion
=
44394295
;
public
const
int
ShaddollFusion
=
44394295
;
public
const
int
PotOfAvarice
=
671690
26
;
public
const
int
PotOfAvarice
=
671690
62
;
public
const
int
FoolishBurial
=
81439173
;
public
const
int
FoolishBurial
=
81439173
;
public
const
int
MonsterReborn
=
83764718
;
public
const
int
MonsterReborn
=
83764718
;
public
const
int
ChargeOfTheLightBrigade
=
94886282
;
public
const
int
ChargeOfTheLightBrigade
=
94886282
;
...
@@ -71,15 +71,13 @@ namespace WindBot.Game.AI.Decks
...
@@ -71,15 +71,13 @@ namespace WindBot.Game.AI.Decks
public
const
int
CrystronNeedlefiber
=
50588353
;
public
const
int
CrystronNeedlefiber
=
50588353
;
}
}
bool
Pillused
=
false
;
bool
CrystalWingSynchroDragoneff_used
=
false
;
bool
OvertexCoatlseff_used
=
false
;
public
LightswornShaddoldinosour
(
GameAI
ai
,
Duel
duel
)
public
LightswornShaddoldinosour
(
GameAI
ai
,
Duel
duel
)
:
base
(
ai
,
duel
)
:
base
(
ai
,
duel
)
{
{
//counter
//counter
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
CrystalWingSynchroDragon
,
CrystalWingSynchroDragonesp
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
GhostOgre
,
Hand_act_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
GhostOgre
,
Hand_act_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
AshBlossom
,
Hand_act_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
AshBlossom
,
Hand_act_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
MaxxC
,
MaxxC
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
MaxxC
,
MaxxC
);
...
@@ -90,8 +88,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -90,8 +88,7 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
SouleatingOviraptor
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
SouleatingOviraptor
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SouleatingOviraptor
,
SouleatingOviraptoreff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SouleatingOviraptor
,
SouleatingOviraptoreff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
AllureofDarkness
,
DefaultAllureofDarkness
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
AllureofDarkness
,
DefaultAllureofDarkness
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
PotOfAvarice
,
PotofAvarice
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
PotOfAvarice
,
PotofAvariceeff
);
// AddExecutor(ExecutorType.Activate, CardId.HarpiesFeatherDuster);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ChargeOfTheLightBrigade
,
ChargeOfTheLightBrigadeEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ChargeOfTheLightBrigade
,
ChargeOfTheLightBrigadeEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
FoolishBurial
,
FoolishBurialEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
FoolishBurial
,
FoolishBurialEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
InterruptedKaijuSlumber
,
DefaultInterruptedKaijuSlumber
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
InterruptedKaijuSlumber
,
DefaultInterruptedKaijuSlumber
);
...
@@ -101,18 +98,29 @@ namespace WindBot.Game.AI.Decks
...
@@ -101,18 +98,29 @@ namespace WindBot.Game.AI.Decks
//Normal Summon
//Normal Summon
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
Raiden
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
Raiden
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Raiden
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Raiden
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
KeeperOfDragonicMagic
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
KeeperOfDragonicMagic
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
KeeperOfDragonicMagic
,
KeeperOfDragonicMagiceff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
KeeperOfDragonicMagic
,
KeeperOfDragonicMagiceff
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
ShaddollSquamata
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
ShaddollSquamata
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
GlowUpBulb
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
GlowUpBulb
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
ShaddollHedgehog
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
ShaddollHedgehog
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
ShaddollDragon
);
AddExecutor
(
ExecutorType
.
MonsterSet
,
CardId
.
ShaddollDragon
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
FairyTailSnow
,
FairyTailSnow
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
FairyTailSnow
,
FairyTailSnow
summon
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
FairyTailSnow
,
FairyTailSnow
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
FairyTailSnow
,
FairyTailSnow
eff
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
Lumina
);
AddExecutor
(
ExecutorType
.
Summon
,
CardId
.
Lumina
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Lumina
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Lumina
);
//activate
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
GlowUpBulb
,
GlowUpBulbeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
CrystronNeedlefiber
,
CrystronNeedlefibereff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
TG_WonderMagician
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
CoralDragon
,
CoralDragoneff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
RedWyvern
,
RedWyverneff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
CrystalWingSynchroDragon
,
CrystalWingSynchroDragoneff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
BlackRoseMoonlightDragon
,
BlackRoseMoonlightDragoneff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Sdulldeat
,
Sdulldeateff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Michael
,
Michaeleff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ScarlightRedDragon
,
ScarlightRedDragoneff
);
//Sp Summon
//Sp Summon
//AddExecutor(ExecutorType.SpSummon, CardId.CrystronNeedlefiber, CrystronNeedlefibersp);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
UltimateConductorTytanno
,
UltimateConductorTytannosp
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
UltimateConductorTytanno
,
UltimateConductorTytannosp
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
UltimateConductorTytanno
,
UltimateConductorTytannoeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
UltimateConductorTytanno
,
UltimateConductorTytannoeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
DoubleEvolutionPill
,
DoubleEvolutionPilleff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
DoubleEvolutionPill
,
DoubleEvolutionPilleff
);
...
@@ -120,11 +128,6 @@ namespace WindBot.Game.AI.Decks
...
@@ -120,11 +128,6 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
MinervaTheExalte
,
MinervaTheExaltedEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
MinervaTheExalte
,
MinervaTheExaltedEffect
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
GamecieltheSeaTurtleKaiju
,
DefaultKaijuSpsummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
GamecieltheSeaTurtleKaiju
,
DefaultKaijuSpsummon
);
//activate
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
GlowUpBulb
,
GlowUpBulbeff
);
//activate chain
//activate chain
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
OvertexCoatls
,
OvertexCoatlseff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
OvertexCoatls
,
OvertexCoatlseff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ShaddollBeast
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ShaddollBeast
);
...
@@ -133,24 +136,22 @@ namespace WindBot.Game.AI.Decks
...
@@ -133,24 +136,22 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ShaddollDragon
,
ShaddollDragoneff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ShaddollDragon
,
ShaddollDragoneff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ShaddollHedgehog
,
ShaddollHedgehogeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ShaddollHedgehog
,
ShaddollHedgehogeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
GiantRex
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
GiantRex
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ElShaddollConstruct
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ElShaddollConstruct
,
ElShaddollConstructeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ElShaddollGrysra
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ElShaddollGrysra
,
ElShaddollGrysraeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ElShaddollShekhinaga
,
ElShaddollShekhinagaeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ElShaddollShekhinaga
,
ElShaddollShekhinagaeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ElShaddollWinda
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ElShaddollWinda
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
CrystalWingSynchroDragon
,
CrystalWingSynchroDragoneff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
TG_WonderMagician
);
//spellset
//spellset
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
MonsterReborn
,
spellset
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
MonsterReborn
,
spellset
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
PotOfAvarice
,
spellset
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
PotOfAvarice
,
spellset
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
ThatGrassLooksgreener
,
spellset
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
ThatGrassLooksgreener
,
spellset
);
//trap
//trap
set
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
LostWind
,
TrapSetWhenZoneFree
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
LostWind
,
TrapSetWhenZoneFree
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
SinisterShadowGames
,
TrapSetWhenZoneFree
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
SinisterShadowGames
,
TrapSetWhenZoneFree
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
ShaddollCore
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
ShaddollCore
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
infiniteTransience
,
SetIsFieldEmpty
);
AddExecutor
(
ExecutorType
.
SpellSet
,
CardId
.
infiniteTransience
,
SetIsFieldEmpty
);
//trap activate
//trap activate
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
LostWind
,
DefaultBreakthroughSkill
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
LostWind
,
LostWindeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SinisterShadowGames
,
SinisterShadowGames
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SinisterShadowGames
,
SinisterShadowGames
eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ShaddollCore
,
ShaddollCoreeff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
ShaddollCore
,
ShaddollCoreeff
);
AddExecutor
(
ExecutorType
.
Repos
,
MonsterRepos
);
AddExecutor
(
ExecutorType
.
Repos
,
MonsterRepos
);
}
}
...
@@ -218,85 +219,18 @@ namespace WindBot.Game.AI.Decks
...
@@ -218,85 +219,18 @@ namespace WindBot.Game.AI.Decks
};
};
}
}
public
override
BattlePhaseAction
OnSelectAttackTarget
(
ClientCard
attacker
,
IList
<
ClientCard
>
defenders
)
int
Ultimate_ss
=
0
;
{
bool
Pillused
=
false
;
for
(
int
i
=
0
;
i
<
defenders
.
Count
;
++
i
)
bool
CrystronNeedlefibereff_used
=
false
;
{
bool
OvertexCoatlseff_used
=
false
;
ClientCard
defender
=
defenders
[
i
];
attacker
.
RealPower
=
attacker
.
Attack
;
defender
.
RealPower
=
defender
.
GetDefensePower
();
if
(!
OnPreBattleBetween
(
attacker
,
defender
))
continue
;
if
(
attacker
.
RealPower
>
defender
.
RealPower
||
(
attacker
.
RealPower
>=
defender
.
RealPower
&&
attacker
.
IsLastAttacker
)||
attacker
.
Id
==
CardId
.
UltimateConductorTytanno
)
return
AI
.
Attack
(
attacker
,
defender
);
}
if
(
attacker
.
CanDirectAttack
)
return
AI
.
Attack
(
attacker
,
null
);
return
null
;
}
public
override
bool
OnSelectHand
()
{
return
true
;
}
public
override
void
OnNewTurn
()
public
override
void
OnNewTurn
()
{
{
Pillused
=
false
;
Pillused
=
false
;
OvertexCoatlseff_used
=
false
;
OvertexCoatlseff_used
=
false
;
Cryst
alWingSynchroDragon
eff_used
=
false
;
Cryst
ronNeedlefiber
eff_used
=
false
;
}
}
public
bool
CrystalWingSynchroDragonesp
()
{
if
(
CrystalWingSynchroDragoneff_used
)
return
false
;
if
(
Bot
.
HasInMonstersZone
(
CardId
.
FairyTailSnow
)
||
Bot
.
HasInMonstersZone
(
CardId
.
Lumina
)
||
Bot
.
HasInMonstersZone
(
CardId
.
KeeperOfDragonicMagic
)||
Bot
.
HasInMonstersZone
(
CardId
.
SouleatingOviraptor
)
)
{
AI
.
SelectCard
(
new
[]
{
CardId
.
KeeperOfDragonicMagic
,
CardId
.
Lumina
,
CardId
.
FairyTailSnow
,
CardId
.
SouleatingOviraptor
,
});
AI
.
SelectNextCard
(
CardId
.
GlowUpBulb
);
}
return
true
;
}
public
bool
CrystalWingSynchroDragoneff
()
{
if
(
Duel
.
Player
==
0
)
{
CrystalWingSynchroDragoneff_used
=
true
;
AI
.
SelectCard
(
new
[]
{
CardId
.
GhostOgre
,
CardId
.
GlowUpBulb
,
CardId
.
PlaguespreaderZombie
,
CardId
.
ShaddollFalco
});
return
true
;
}
else
if
(
AI
.
Utils
.
IsChainTarget
(
Card
)
||
AI
.
Utils
.
GetProblematicEnemySpell
()
!=
null
)
return
true
;
else
if
(
Duel
.
Player
==
1
&&
Duel
.
Phase
==
DuelPhase
.
BattleStart
&&
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
1500
,
true
))
{
if
(
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
1900
,
true
))
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
}
else
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpAttack
);
}
return
true
;
}
return
false
;
}
private
bool
UltimateConductorTytannoeff
()
private
bool
UltimateConductorTytannoeff
()
{
{
...
@@ -310,6 +244,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -310,6 +244,7 @@ namespace WindBot.Game.AI.Decks
CardId
.
ShaddollSquamata
,
CardId
.
ShaddollSquamata
,
CardId
.
ShaddollHedgehog
,
CardId
.
ShaddollHedgehog
,
CardId
.
ShaddollDragon
,
CardId
.
ShaddollDragon
,
CardId
.
ShaddollFalco
,
CardId
.
GlowUpBulb
,
CardId
.
GlowUpBulb
,
CardId
.
PlaguespreaderZombie
,
CardId
.
PlaguespreaderZombie
,
CardId
.
FairyTailSnow
,
CardId
.
FairyTailSnow
,
...
@@ -320,7 +255,6 @@ namespace WindBot.Game.AI.Decks
...
@@ -320,7 +255,6 @@ namespace WindBot.Game.AI.Decks
CardId
.
GamecieltheSeaTurtleKaiju
,
CardId
.
GamecieltheSeaTurtleKaiju
,
CardId
.
RadiantheMultidimensionalKaiju
,
CardId
.
RadiantheMultidimensionalKaiju
,
CardId
.
GiantRex
,
CardId
.
GiantRex
,
CardId
.
ShaddollSquamata
,
CardId
.
SouleatingOviraptor
,
CardId
.
SouleatingOviraptor
,
CardId
.
Raiden
,
CardId
.
Raiden
,
CardId
.
Lumina
,
CardId
.
Lumina
,
...
@@ -328,22 +262,25 @@ namespace WindBot.Game.AI.Decks
...
@@ -328,22 +262,25 @@ namespace WindBot.Game.AI.Decks
CardId
.
GhostOgre
,
CardId
.
GhostOgre
,
CardId
.
MaxxC
,
CardId
.
MaxxC
,
};
};
if
(!
Bot
.
HasInHand
(
targets
))
if
(!
Bot
.
HasInHand
(
targets
)
||
!
Bot
.
HasInMonstersZone
(
targets
))
{
if
(!
Bot
.
HasInMonstersZone
(
targets
))
{
{
return
false
;
return
false
;
}
}
}
AI
.
SelectCard
(
targets
);
AI
.
SelectCard
(
targets
);
return
true
;
}
}
if
(
Duel
.
Phase
==
DuelPhase
.
Damage
)
if
(
Duel
.
Phase
==
DuelPhase
.
BattleStart
)
{
AI
.
SelectYesNo
(
true
);
AI
.
SelectYesNo
(
true
);
return
true
;
return
true
;
}
}
return
false
;
}
private
bool
UltimateConductorTytannosp
()
private
bool
UltimateConductorTytannosp
()
{
{
Ultimate_ss
++;
Pillused
=
true
;
Pillused
=
true
;
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
{
{
...
@@ -375,13 +312,18 @@ namespace WindBot.Game.AI.Decks
...
@@ -375,13 +312,18 @@ namespace WindBot.Game.AI.Decks
private
bool
OvertexCoatlseff
()
private
bool
OvertexCoatlseff
()
{
{
if
(
OvertexCoatlseff_used
==
true
)
if
(
Card
.
Location
==
CardLocation
.
MonsterZone
)
return
false
;
return
fals
e
;
OvertexCoatlseff_used
=
tru
e
;
return
true
;
return
true
;
}
}
private
bool
DoubleEvolutionPilleff
()
private
bool
DoubleEvolutionPilleff
()
{
{
foreach
(
ClientCard
card
in
Bot
.
GetMonsters
())
{
if
(
card
.
Id
==
CardId
.
UltimateConductorTytanno
&&
card
.
IsFaceup
())
return
false
;
}
if
(
Pillused
==
true
)
return
false
;
if
(
Pillused
==
true
)
return
false
;
Pillused
=
true
;
Pillused
=
true
;
IList
<
int
>
targets
=
new
[]
{
IList
<
int
>
targets
=
new
[]
{
...
@@ -473,22 +415,16 @@ namespace WindBot.Game.AI.Decks
...
@@ -473,22 +415,16 @@ namespace WindBot.Game.AI.Decks
return
Enemy
.
GetMonsterCount
()
>=
1
;
return
Enemy
.
GetMonsterCount
()
>=
1
;
}
}
private
bool
ShaddollCoreeff
()
{
private
bool
FairyTailSnowsummon
()
if
(
Card
.
Location
==
CardLocation
.
SpellZone
)
{
if
(
Enemy
.
HasAttackingMonster
())
{
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
return
true
;
}
return
false
;
}
return
Enemy
.
GetMonsterCount
()>=
2
;
return
true
;
}
}
private
bool
FairyTailSnow
()
private
bool
FairyTailSnoweff
()
{
{
if
(
Card
.
Location
==
CardLocation
.
MonsterZone
)
if
(
Card
.
Location
==
CardLocation
.
MonsterZone
)
...
@@ -498,6 +434,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -498,6 +434,7 @@ namespace WindBot.Game.AI.Decks
return
false
;
return
false
;
}
}
private
bool
SouleatingOviraptoreff
()
private
bool
SouleatingOviraptoreff
()
{
{
if
(!
OvertexCoatlseff_used
)
if
(!
OvertexCoatlseff_used
)
...
@@ -515,58 +452,25 @@ namespace WindBot.Game.AI.Decks
...
@@ -515,58 +452,25 @@ namespace WindBot.Game.AI.Decks
private
bool
GlowUpBulbeff
()
private
bool
GlowUpBulbeff
()
{
{
/*if(Bot.HasInMonstersZone(CardId.Lumina)||
if
(
Bot
.
HasInMonstersZone
(
CardId
.
Lumina
)
||
Bot.HasInMonstersZone(CardId.FairyTailSnow)||
Bot
.
HasInMonstersZone
(
CardId
.
FairyTailSnow
)
||
Bot.HasInMonstersZone(CardId.KeeperOfDragonicMagic)||
Bot
.
HasInMonstersZone
(
CardId
.
KeeperOfDragonicMagic
)
||
Bot.HasInMonstersZone(CardId.SouleatingOviraptor)
Bot
.
HasInMonstersZone
(
CardId
.
SouleatingOviraptor
)
||
)*/
Bot
.
HasInMonstersZone
(
CardId
.
GiantRex
)
||
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
Bot
.
HasInMonstersZone
(
CardId
.
Raiden
)
return
true
;
)
}
private
bool
ShaddollFusioneff
()
{
if
(
Enemy
.
GetMonstersExtraZoneCount
()>
0
)
{
AI
.
SelectCard
(
new
[]
{
CardId
.
ElShaddollConstruct
,
CardId
.
ElShaddollShekhinaga
,
CardId
.
ElShaddollGrysra
,
CardId
.
ElShaddollWinda
});
AI
.
SelectNextCard
(
new
[]
{
{
CardId
.
ShaddollBeast
,
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
CardId
.
ShaddollSquamata
,
CardId
.
ShaddollHedgehog
,
CardId
.
ShaddollDragon
,
CardId
.
ShaddollFalco
,
});
AI
.
SelectPosition
(
CardPosition
.
FaceUpAttack
);
return
true
;
return
true
;
}
}
else
{
if
(!
Bot
.
IsFieldEmpty
())
return
false
;
return
false
;
AI
.
SelectCard
(
CardId
.
ElShaddollConstruct
);
AI
.
SelectPosition
(
CardPosition
.
FaceUpAttack
);
}
}
return
true
;
}
private
bool
ShaddollCore
()
{
return
Bot
.
HasInGraveyard
(
CardId
.
ShaddollFusion
);
}
private
bool
AllureofDarkness
()
private
bool
AllureofDarkness
()
{
{
IList
<
ClientCard
>
materials
=
Bot
.
Hand
;
IList
<
ClientCard
>
materials
=
Bot
.
Hand
;
IList
<
ClientCard
>
check
=
new
List
<
ClientCard
>();
//
IList<ClientCard> check = new List<ClientCard>();
ClientCard
mat
=
null
;
ClientCard
mat
=
null
;
foreach
(
ClientCard
card
in
materials
)
foreach
(
ClientCard
card
in
materials
)
{
{
...
@@ -582,15 +486,22 @@ namespace WindBot.Game.AI.Decks
...
@@ -582,15 +486,22 @@ namespace WindBot.Game.AI.Decks
}
}
return
false
;
return
false
;
}
}
private
bool
spellset
()
private
bool
spellset
()
{
{
return
Bot
.
Hand
.
Count
>
6
;
return
Bot
.
Hand
.
Count
>
6
;
}
}
private
bool
RebornEffect
()
private
bool
RebornEffect
()
{
{
if
(
Bot
.
HasInGraveyard
(
CardId
.
UltimateConductorTytanno
)&&
Ultimate_ss
>
0
)
{
AI
.
SelectCard
(
CardId
.
UltimateConductorTytanno
);
return
true
;
}
IList
<
int
>
targets
=
new
[]
{
IList
<
int
>
targets
=
new
[]
{
CardId
.
UltimateConductorTytanno
,
CardId
.
ElShaddollConstruct
,
CardId
.
ElShaddollConstruct
,
CardId
.
DogorantheMadFlameKaiju
,
CardId
.
DogorantheMadFlameKaiju
,
CardId
.
GamecieltheSeaTurtleKaiju
,
CardId
.
GamecieltheSeaTurtleKaiju
,
...
@@ -603,9 +514,10 @@ namespace WindBot.Game.AI.Decks
...
@@ -603,9 +514,10 @@ namespace WindBot.Game.AI.Decks
AI
.
SelectCard
(
targets
);
AI
.
SelectCard
(
targets
);
return
true
;
return
true
;
}
}
private
bool
PotofAvarice
()
{
private
bool
PotofAvariceeff
()
{
return
true
;
return
true
;
}
}
...
@@ -613,10 +525,14 @@ namespace WindBot.Game.AI.Decks
...
@@ -613,10 +525,14 @@ namespace WindBot.Game.AI.Decks
{
{
return
Duel
.
Player
==
1
;
return
Duel
.
Player
==
1
;
}
}
private
bool
SetIsFieldEmpty
()
private
bool
SetIsFieldEmpty
()
{
{
return
!
Bot
.
IsFieldEmpty
();
return
!
Bot
.
IsFieldEmpty
();
}
}
private
bool
TrapSetWhenZoneFree
()
private
bool
TrapSetWhenZoneFree
()
{
{
return
Bot
.
GetSpellCountWithoutField
()
<
4
;
return
Bot
.
GetSpellCountWithoutField
()
<
4
;
...
@@ -634,19 +550,22 @@ namespace WindBot.Game.AI.Decks
...
@@ -634,19 +550,22 @@ namespace WindBot.Game.AI.Decks
});
});
return
true
;
return
true
;
}
}
private
bool
SinisterShadowGames
()
{
AI
.
SelectCard
(
new
[]
{
CardId
.
ShaddollBeast
,
});
// all Shaddoll
private
bool
ElShaddollConstructeff
()
{
/* if (Duel.Phase == DuelPhase.Battle)
if (Enemy.BattlingMonster.Attack < 2800)
return false;*/
if
(
ActivateDescription
==-
1
)
{
AI
.
SelectCard
(
CardId
.
ShaddollSquamata
);
}
return
true
;
return
true
;
}
}
private
bool
ElShaddollShekhinagaeff
()
private
bool
ElShaddollShekhinagaeff
()
{
{
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
...
@@ -654,23 +573,119 @@ namespace WindBot.Game.AI.Decks
...
@@ -654,23 +573,119 @@ namespace WindBot.Game.AI.Decks
else
else
{
{
if
(
DefaultBreakthroughSkill
())
if
(
DefaultBreakthroughSkill
())
{
AI
.
SelectCard
(
new
[]
{
CardId
.
ShaddollBeast
,
CardId
.
ShaddollSquamata
,
CardId
.
ShaddollHedgehog
,
CardId
.
ShaddollDragon
,
CardId
.
ShaddollFalco
,
}
);
}
else
return
false
;
}
return
true
;
}
private
bool
ElShaddollGrysraeff
()
{
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
return
true
;
return
true
;
}
private
bool
ShaddollFusioneff
()
{
bool
deck_check
=
false
;
List
<
ClientCard
>
monsters
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
monster
in
monsters
)
{
if
(
monster
.
HasType
(
CardType
.
Synchro
)
||
monster
.
HasType
(
CardType
.
Fusion
)
||
monster
.
HasType
(
CardType
.
Xyz
))
deck_check
=
true
;
}
if
(
deck_check
)
{
{
AI
.
SelectCard
(
new
[]
AI
.
SelectCard
(
new
[]
{
{
CardId
.
ElShaddollConstruct
,
CardId
.
ElShaddollConstruct
,
CardId
.
ElShaddollShekhinaga
,
CardId
.
ElShaddollShekhinaga
,
CardId
.
ElShaddollGrysra
,
CardId
.
ElShaddollGrysra
,
CardId
.
ElShaddollWinda
,
CardId
.
ElShaddollWinda
});
AI
.
SelectNextCard
(
new
[]
{
CardId
.
ShaddollBeast
,
CardId
.
ShaddollSquamata
,
CardId
.
ShaddollSquamata
,
CardId
.
ShaddollHedgehog
,
CardId
.
ShaddollDragon
,
CardId
.
ShaddollFalco
,
});
AI
.
SelectPosition
(
CardPosition
.
FaceUpAttack
);
return
true
;
}
}
);
if
(!
Bot
.
IsFieldEmpty
())
return
false
;
foreach
(
ClientCard
monster
in
Bot
.
Hand
)
{
if
(
monster
.
HasAttribute
(
CardAttribute
.
Light
))
{
AI
.
SelectCard
(
CardId
.
ElShaddollConstruct
);
AI
.
SelectPosition
(
CardPosition
.
FaceUpAttack
);
return
true
;
}
}
List
<
ClientCard
>
material_1
=
Bot
.
GetMonsters
();
foreach
(
ClientCard
monster
in
material_1
)
{
if
(
monster
.
HasAttribute
(
CardAttribute
.
Light
))
{
AI
.
SelectCard
(
CardId
.
ElShaddollConstruct
);
AI
.
SelectPosition
(
CardPosition
.
FaceUpAttack
);
return
true
;
}
}
}
else
return
false
;
return
false
;
}
}
private
bool
SinisterShadowGameseff
()
{
AI
.
SelectCard
(
new
[]
{
CardId
.
ShaddollBeast
,
});
return
true
;
}
private
bool
ShaddollCoreeff
()
{
if
(
Card
.
Location
==
CardLocation
.
SpellZone
)
{
if
(
Enemy
.
HasAttackingMonster
()
&&
Duel
.
Player
==
1
&&
Duel
.
Phase
==
DuelPhase
.
BattleStart
)
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
return
true
;
return
true
;
}
}
return
false
;
}
return
true
;
}
private
bool
ShaddollFalcoeff
()
private
bool
ShaddollFalcoeff
()
{
{
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
...
@@ -690,6 +705,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -690,6 +705,8 @@ namespace WindBot.Game.AI.Decks
}
}
return
true
;
return
true
;
}
}
private
bool
ShaddollHedgehogeff
()
private
bool
ShaddollHedgehogeff
()
{
{
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
...
@@ -705,6 +722,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -705,6 +722,8 @@ namespace WindBot.Game.AI.Decks
}
}
return
true
;
return
true
;
}
}
private
bool
ShaddollDragoneff
()
private
bool
ShaddollDragoneff
()
{
{
if
(
Card
.
Location
==
CardLocation
.
MonsterZone
)
if
(
Card
.
Location
==
CardLocation
.
MonsterZone
)
...
@@ -720,6 +739,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -720,6 +739,8 @@ namespace WindBot.Game.AI.Decks
return
true
;
return
true
;
}
}
}
}
private
bool
ShaddollSquamataeff
()
private
bool
ShaddollSquamataeff
()
{
{
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
...
@@ -739,6 +760,17 @@ namespace WindBot.Game.AI.Decks
...
@@ -739,6 +760,17 @@ namespace WindBot.Game.AI.Decks
}
}
return
true
;
return
true
;
}
}
private
bool
LostWindeff
()
{
List
<
ClientCard
>
check
=
Enemy
.
GetMonsters
();
foreach
(
ClientCard
m
in
check
)
{
if
(
m
.
Attack
>=
2000
)
return
DefaultBreakthroughSkill
();
}
return
false
;
}
private
bool
FoolishBurialEffect
()
private
bool
FoolishBurialEffect
()
{
{
if
(
Bot
.
GetRemainingCount
(
CardId
.
DoubleEvolutionPill
,
3
)
>
0
)
if
(
Bot
.
GetRemainingCount
(
CardId
.
DoubleEvolutionPill
,
3
)
>
0
)
...
@@ -749,33 +781,20 @@ namespace WindBot.Game.AI.Decks
...
@@ -749,33 +781,20 @@ namespace WindBot.Game.AI.Decks
{
{
CardId
.
OvertexCoatls
,
CardId
.
OvertexCoatls
,
});
});
return
true
;
}
}
else
return
false
;
return
false
;
}
}
else
else
{
{
AI
.
SelectCard
(
new
[]
AI
.
SelectCard
(
new
[]
{
{
CardId
.
OvertexCoatls
,
CardId
.
ShaddollSquamata
,
CardId
.
ShaddollSquamata
,
CardId
.
FairyTailSnow
,
CardId
.
FairyTailSnow
,
});
});
}
return
true
;
}
}
private
bool
GoblindberghSummon
()
{
foreach
(
ClientCard
card
in
Bot
.
Hand
.
GetMonsters
())
{
if
(!
card
.
Equals
(
Card
)
&&
card
.
Level
==
4
)
return
true
;
return
true
;
}
}
return
false
;
}
public
bool
Hand_act_eff
()
public
bool
Hand_act_eff
()
...
@@ -784,6 +803,16 @@ namespace WindBot.Game.AI.Decks
...
@@ -784,6 +803,16 @@ namespace WindBot.Game.AI.Decks
if
(
Card
.
Id
==
CardId
.
GhostOgre
&&
Card
.
Location
==
CardLocation
.
Hand
&&
Bot
.
HasInMonstersZone
(
CardId
.
GhostOgre
))
return
false
;
if
(
Card
.
Id
==
CardId
.
GhostOgre
&&
Card
.
Location
==
CardLocation
.
Hand
&&
Bot
.
HasInMonstersZone
(
CardId
.
GhostOgre
))
return
false
;
return
(
Duel
.
LastChainPlayer
==
1
);
return
(
Duel
.
LastChainPlayer
==
1
);
}
}
//other extra
private
bool
Michaeleff
()
{
if
(
Card
.
Location
==
CardLocation
.
Grave
)
return
true
;
if
(
Bot
.
LifePoints
<=
1000
)
return
false
;
return
true
;
}
private
bool
MinervaTheExaltedEffect
()
private
bool
MinervaTheExaltedEffect
()
{
{
if
(
Card
.
Location
==
CardLocation
.
MonsterZone
)
if
(
Card
.
Location
==
CardLocation
.
MonsterZone
)
...
@@ -824,5 +853,196 @@ namespace WindBot.Game.AI.Decks
...
@@ -824,5 +853,196 @@ namespace WindBot.Game.AI.Decks
}
}
public
bool
CrystronNeedlefibersp
()
{
if
(
Bot
.
HasInMonstersZone
(
CardId
.
ElShaddollConstruct
)
||
Bot
.
HasInMonstersZone
(
CardId
.
ElShaddollGrysra
)
||
Bot
.
HasInMonstersZone
(
CardId
.
ElShaddollShekhinaga
)
||
Bot
.
HasInMonstersZone
(
CardId
.
ElShaddollWinda
))
return
false
;
if
(
CrystronNeedlefibereff_used
)
return
false
;
if
(
Bot
.
HasInMonstersZone
(
CardId
.
CrystronNeedlefiber
))
return
false
;
if
(
Bot
.
HasInMonstersZone
(
CardId
.
FairyTailSnow
)
||
Bot
.
HasInMonstersZone
(
CardId
.
Lumina
)
||
Bot
.
HasInMonstersZone
(
CardId
.
KeeperOfDragonicMagic
)
||
Bot
.
HasInMonstersZone
(
CardId
.
SouleatingOviraptor
)
||
Bot
.
HasInMonstersZone
(
CardId
.
Raiden
)
)
{
AI
.
SelectCard
(
new
[]
{
CardId
.
KeeperOfDragonicMagic
,
CardId
.
Lumina
,
CardId
.
FairyTailSnow
,
CardId
.
SouleatingOviraptor
,
CardId
.
Raiden
,
CardId
.
GiantRex
,
});
AI
.
SelectNextCard
(
CardId
.
GlowUpBulb
);
}
return
true
;
}
public
bool
CrystronNeedlefibereff
()
{
if
(
Duel
.
Player
==
0
)
{
CrystronNeedlefibereff_used
=
true
;
AI
.
SelectCard
(
new
[]
{
CardId
.
GhostOgre
,
CardId
.
GlowUpBulb
,
CardId
.
PlaguespreaderZombie
,
CardId
.
ShaddollFalco
});
return
true
;
}
else
if
(
AI
.
Utils
.
IsChainTarget
(
Card
)
||
AI
.
Utils
.
GetProblematicEnemySpell
()
!=
null
)
return
true
;
else
if
(
Duel
.
Player
==
1
&&
Duel
.
Phase
==
DuelPhase
.
BattleStart
&&
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
1500
,
true
))
{
if
(
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
1900
,
true
))
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
}
else
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpAttack
);
}
return
true
;
}
return
false
;
}
private
bool
ScarlightRedDragoneff
()
{
IList
<
ClientCard
>
targets
=
new
List
<
ClientCard
>();
ClientCard
target1
=
AI
.
Utils
.
GetBestEnemyMonster
();
if
(
target1
!=
null
)
{
targets
.
Add
(
target1
);
AI
.
SelectCard
(
targets
);
return
true
;
}
return
false
;
}
private
bool
CrystalWingSynchroDragoneff
()
{
return
Duel
.
LastChainPlayer
!=
0
;
}
private
bool
Sdulldeateff
()
{
/* if (snake_four_s)
{
snake_four_s = false;
AI.SelectCard(Useless_List());
return true;
}
//if (ActivateDescription == AI.Utils.GetStringId(CardId.snake, 2)) return true;
if (ActivateDescription == AI.Utils.GetStringId(CardId.snake, 1))
{
foreach (ClientCard hand in Bot.Hand)
{
if (hand.Id == CardId.Red || hand.Id == CardId.Pink)
{
AI.SelectCard(hand);
return true;
}
if (hand.Id == CardId.Urara || hand.Id == CardId.Ghost)
{
if (Tuner_ss())
{
AI.SelectCard(hand);
return true;
}
}
}
}*/
return
false
;
}
private
bool
BlackRoseMoonlightDragoneff
()
{
IList
<
ClientCard
>
targets
=
new
List
<
ClientCard
>();
ClientCard
target1
=
AI
.
Utils
.
GetBestEnemyMonster
();
if
(
target1
!=
null
)
{
targets
.
Add
(
target1
);
AI
.
SelectCard
(
targets
);
return
true
;
}
return
false
;
}
private
bool
RedWyverneff
()
{
IList
<
ClientCard
>
check
=
Enemy
.
MonsterZone
;
ClientCard
best
=
null
;
foreach
(
ClientCard
monster
in
check
)
{
if
(
monster
.
Attack
>=
2400
)
best
=
monster
;
}
if
(
best
!=
null
)
{
AI
.
SelectCard
(
best
);
return
true
;
}
return
false
;
}
private
bool
CoralDragoneff
()
{
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
return
true
;
IList
<
ClientCard
>
targets
=
new
List
<
ClientCard
>();
ClientCard
target1
=
AI
.
Utils
.
GetBestEnemyMonster
();
if
(
target1
!=
null
)
targets
.
Add
(
target1
);
ClientCard
target2
=
AI
.
Utils
.
GetBestEnemySpell
();
if
(
target2
!=
null
)
targets
.
Add
(
target2
);
else
if
(
AI
.
Utils
.
IsChainTarget
(
Card
)
||
AI
.
Utils
.
GetProblematicEnemySpell
()
!=
null
)
{
AI
.
SelectCard
(
targets
);
return
true
;
}
else
if
(
Duel
.
Player
==
1
&&
Duel
.
Phase
==
DuelPhase
.
BattleStart
&&
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
2400
,
true
))
{
AI
.
SelectCard
(
targets
);
return
true
;
}
return
false
;
}
public
override
bool
OnPreBattleBetween
(
ClientCard
attacker
,
ClientCard
defender
)
{
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
())
{
if
(
attacker
.
Id
==
CardId
.
ElShaddollConstruct
&&
!
attacker
.
IsDisabled
())
// TODO: && defender.IsSpecialSummoned
attacker
.
RealPower
=
9999
;
if
(
attacker
.
Id
==
CardId
.
UltimateConductorTytanno
&&
!
attacker
.
IsDisabled
()
&&
defender
.
IsDefense
())
attacker
.
RealPower
=
9999
;
}
return
base
.
OnPreBattleBetween
(
attacker
,
defender
);
}
public
override
bool
OnSelectHand
()
{
return
true
;
}
/*
private bool GoblindberghSummon()
{
foreach (ClientCard card in Bot.Hand.GetMonsters())
{
if (!card.Equals(Card) && card.Level == 4)
return true;
}
return false;
}*/
}
}
}
}
\ No newline at end of file
Game/AI/Decks/TrickstarExecutor.cs
View file @
e5d5696d
...
@@ -43,10 +43,10 @@ namespace WindBot.Game.AI.Decks
...
@@ -43,10 +43,10 @@ namespace WindBot.Game.AI.Decks
public
const
int
Linkspi
=
98978921
;
public
const
int
Linkspi
=
98978921
;
public
const
int
SafeDra
=
99111753
;
public
const
int
SafeDra
=
99111753
;
public
const
int
Crystal
=
50588353
;
public
const
int
Crystal
=
50588353
;
public
const
int
p
honeix
=
2857636
;
public
const
int
P
honeix
=
2857636
;
public
const
int
u
nicorn
=
38342335
;
public
const
int
U
nicorn
=
38342335
;
public
const
int
s
nake
=
74997493
;
public
const
int
S
nake
=
74997493
;
public
const
int
b
orrel
=
31833038
;
public
const
int
B
orrel
=
31833038
;
public
const
int
TG
=
98558751
;
public
const
int
TG
=
98558751
;
public
const
int
Beelze
=
34408491
;
public
const
int
Beelze
=
34408491
;
...
@@ -60,10 +60,10 @@ namespace WindBot.Game.AI.Decks
...
@@ -60,10 +60,10 @@ namespace WindBot.Game.AI.Decks
public
int
getLinkMarker
(
int
id
)
public
int
getLinkMarker
(
int
id
)
{
{
if
(
id
==
CardId
.
borrel
||
id
==
CardId
.
s
nake
)
return
4
;
if
(
id
==
CardId
.
Borrel
||
id
==
CardId
.
S
nake
)
return
4
;
else
if
(
id
==
CardId
.
Abyss
||
id
==
CardId
.
Beelze
||
id
==
CardId
.
Exterio
||
id
==
CardId
.
Ultimate
)
return
5
;
else
if
(
id
==
CardId
.
Abyss
||
id
==
CardId
.
Beelze
||
id
==
CardId
.
Exterio
||
id
==
CardId
.
Ultimate
||
id
==
CardId
.
Cardian
)
return
5
;
else
if
(
id
==
CardId
.
u
nicorn
)
return
3
;
else
if
(
id
==
CardId
.
U
nicorn
)
return
3
;
else
if
(
id
==
CardId
.
Crystal
||
id
==
CardId
.
p
honeix
||
id
==
CardId
.
SafeDra
||
id
==
CardId
.
Missus
)
return
2
;
else
if
(
id
==
CardId
.
Crystal
||
id
==
CardId
.
P
honeix
||
id
==
CardId
.
SafeDra
||
id
==
CardId
.
Missus
)
return
2
;
return
1
;
return
1
;
}
}
...
@@ -108,26 +108,26 @@ namespace WindBot.Game.AI.Decks
...
@@ -108,26 +108,26 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Tuner
,
Tuner_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Tuner
,
Tuner_eff
);
// ex ss
// ex ss
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
b
orrel
,
Borrel_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
B
orrel
,
Borrel_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Missus
,
Missus_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Missus
,
Missus_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
p
honeix
,
Phoneix_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
P
honeix
,
Phoneix_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
s
nake
,
Snake_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
S
nake
,
Snake_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Crystal
,
Crystal_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Crystal
,
Crystal_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
SafeDra
,
Safedragon_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
SafeDra
,
Safedragon_ss
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SafeDra
,
DefaultCompulsoryEvacuationDevice
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Linkuri
,
Linkuri_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Linkuri
,
Linkuri_eff
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Linkuri
,
Linkuri_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Linkuri
,
Linkuri_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
u
nicorn
,
Unicorn_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
U
nicorn
,
Unicorn_ss
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Linkspi
);
AddExecutor
(
ExecutorType
.
SpSummon
,
CardId
.
Linkspi
);
// ex_monster act
// ex_monster act
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Beelze
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Beelze
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Missus
,
Missus_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Missus
,
Missus_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Crystal
,
Crystal_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Crystal
,
Crystal_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
SafeDra
,
DefaultCompulsoryEvacuationDevice
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Phoneix
,
Phoneix_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
phoneix
,
Phoneix_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Unicorn
,
Unicorn_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
unicorn
,
Unicorn_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Snake
,
Snake_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
snake
,
Snake_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Borrel
,
Borrel_eff
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
borrel
,
Borrel_eff
);
// normal act
// normal act
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Trans
);
AddExecutor
(
ExecutorType
.
Activate
,
CardId
.
Trans
);
...
@@ -157,12 +157,18 @@ namespace WindBot.Game.AI.Decks
...
@@ -157,12 +157,18 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Repos
,
MonsterRepos
);
AddExecutor
(
ExecutorType
.
Repos
,
MonsterRepos
);
AddExecutor
(
ExecutorType
.
SummonOrSet
,
CardId
.
Red
);
AddExecutor
(
ExecutorType
.
SummonOrSet
,
CardId
.
Red
);
AddExecutor
(
ExecutorType
.
SummonOrSet
,
CardId
.
Pink
);
AddExecutor
(
ExecutorType
.
SummonOrSet
,
CardId
.
Pink
);
AddExecutor
(
ExecutorType
.
SpellSet
,
DefaultSpellSet
);
AddExecutor
(
ExecutorType
.
SpellSet
,
SpellSet
);
}
public
bool
SpellSet
()
{
if
(
Card
.
Id
==
CardId
.
Sheep
&&
Bot
.
HasInSpellZone
(
CardId
.
Sheep
))
return
false
;
return
DefaultSpellSet
();
}
}
public
bool
Has_down_arrow
(
int
id
)
public
bool
Has_down_arrow
(
int
id
)
{
{
return
(
id
==
CardId
.
Linkuri
||
id
==
CardId
.
Linkspi
||
id
==
CardId
.
u
nicorn
);
return
(
id
==
CardId
.
Linkuri
||
id
==
CardId
.
Linkspi
||
id
==
CardId
.
U
nicorn
);
}
}
public
bool
IsTrickstar
(
int
id
)
public
bool
IsTrickstar
(
int
id
)
...
@@ -212,18 +218,71 @@ namespace WindBot.Game.AI.Decks
...
@@ -212,18 +218,71 @@ namespace WindBot.Game.AI.Decks
public
bool
Grass_ss
()
public
bool
Grass_ss
()
{
{
if
(
Bot
.
ExtraDeck
.
Count
>
0
)
// judge whether can ss from exdeck
bool
judge
=
(
Bot
.
ExtraDeck
.
Count
>
0
);
if
(
Enemy
.
GetMonstersExtraZoneCount
()
>
1
)
judge
=
false
;
// exlink
if
(
Bot
.
GetMonstersExtraZoneCount
()
>=
1
)
{
foreach
(
ClientCard
card
in
Bot
.
GetMonstersInExtraZone
())
{
if
(
getLinkMarker
(
card
.
Id
)
==
5
)
judge
=
false
;
}
}
// can ss from exdeck
if
(
judge
)
{
{
bool
fornextss
=
AI
.
Utils
.
ChainContainsCard
(
CardId
.
Grass
);
IList
<
ClientCard
>
ex
=
Bot
.
ExtraDeck
;
IList
<
ClientCard
>
ex
=
Bot
.
ExtraDeck
;
ClientCard
ex_best
=
null
;
ClientCard
ex_best
=
null
;
foreach
(
ClientCard
ex_card
in
ex
)
foreach
(
ClientCard
ex_card
in
ex
)
{
if
(!
fornextss
)
{
{
if
(
ex_best
==
null
||
ex_card
.
Attack
>
ex_best
.
Attack
)
ex_best
=
ex_card
;
if
(
ex_best
==
null
||
ex_card
.
Attack
>
ex_best
.
Attack
)
ex_best
=
ex_card
;
}
}
if
(
ex_best
!=
null
)
{
else
{
if
(
getLinkMarker
(
ex_card
.
Id
)
!=
5
&&
(
ex_best
==
null
||
ex_card
.
Attack
>
ex_best
.
Attack
))
ex_best
=
ex_card
;
}
}
if
(
ex_best
!=
null
)
{
AI
.
SelectCard
(
ex_best
);
AI
.
SelectCard
(
ex_best
);
}
}
return
true
;
}
if
(!
judge
||
AI
.
Utils
.
ChainContainsCard
(
CardId
.
Grass
))
{
// cannot ss from exdeck or have more than 1 grass in chain
int
[]
secondselect
=
new
[]
{
CardId
.
Borrel
,
CardId
.
Ultimate
,
CardId
.
Abyss
,
CardId
.
Cardian
,
CardId
.
Exterio
,
CardId
.
Ghost
,
CardId
.
White
,
CardId
.
Red
,
CardId
.
Yellow
,
CardId
.
Pink
};
if
(!
AI
.
Utils
.
ChainContainsCard
(
CardId
.
Grass
))
{
if
(!
judge
&&
Bot
.
GetRemainingCount
(
CardId
.
Ghost
,
2
)
>
0
)
{
AI
.
SelectCard
(
CardId
.
Ghost
);
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
}
else
AI
.
SelectCard
(
secondselect
);
}
else
{
if
(!
judge
)
AI
.
SelectCard
(
secondselect
);
AI
.
SelectNextCard
(
secondselect
);
AI
.
SelectThirdCard
(
secondselect
);
}
}
}
return
true
;
return
true
;
}
}
...
@@ -264,10 +323,23 @@ namespace WindBot.Game.AI.Decks
...
@@ -264,10 +323,23 @@ namespace WindBot.Game.AI.Decks
return
false
;
return
false
;
}
}
public
void
RandomSort
(
List
<
ClientCard
>
list
)
{
int
n
=
list
.
Count
;
while
(
n
--
>
1
)
{
int
index
=
Program
.
Rand
.
Next
(
n
+
1
);
ClientCard
temp
=
list
[
index
];
list
[
index
]
=
list
[
n
];
list
[
n
]
=
temp
;
}
}
public
bool
Stage_Lock
()
public
bool
Stage_Lock
()
{
{
if
(
Card
.
Location
!=
CardLocation
.
SpellZone
)
return
false
;
if
(
Card
.
Location
!=
CardLocation
.
SpellZone
)
return
false
;
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
List
<
ClientCard
>
spells
=
Enemy
.
GetSpells
();
RandomSort
(
spells
);
if
(
spells
.
Count
==
0
)
return
false
;
if
(
spells
.
Count
==
0
)
return
false
;
foreach
(
ClientCard
card
in
spells
)
foreach
(
ClientCard
card
in
spells
)
{
{
...
@@ -545,6 +617,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -545,6 +617,7 @@ namespace WindBot.Game.AI.Decks
public
bool
Eater_ss
()
public
bool
Eater_ss
()
{
{
if
(
AI
.
Utils
.
GetProblematicEnemyMonster
()
==
null
&&
Bot
.
ExtraDeck
.
Count
<
5
)
return
false
;
if
(
AI
.
Utils
.
GetProblematicEnemyMonster
()
==
null
&&
Bot
.
ExtraDeck
.
Count
<
5
)
return
false
;
if
(
Bot
.
GetMonstersInMainZone
().
Count
>=
5
)
return
false
;
if
(
AI
.
Utils
.
IsTurn1OrMain2
())
return
false
;
if
(
AI
.
Utils
.
IsTurn1OrMain2
())
return
false
;
AI
.
SelectPosition
(
CardPosition
.
FaceUpAttack
);
AI
.
SelectPosition
(
CardPosition
.
FaceUpAttack
);
IList
<
ClientCard
>
targets
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
targets
=
new
List
<
ClientCard
>();
...
@@ -584,6 +657,29 @@ namespace WindBot.Game.AI.Decks
...
@@ -584,6 +657,29 @@ namespace WindBot.Game.AI.Decks
return
true
;
return
true
;
}
}
public
void
Red_SelectPos
(
ClientCard
return_card
=
null
)
{
int
self_power
=
(
Bot
.
HasInHand
(
CardId
.
White
)
&&
!
white_eff_used
)
?
3200
:
1600
;
if
(
Duel
.
Player
==
0
)
{
List
<
ClientCard
>
monster_list
=
Bot
.
GetMonsters
();
monster_list
.
Sort
(
AIFunctions
.
CompareCardAttack
);
monster_list
.
Reverse
();
foreach
(
ClientCard
card
in
monster_list
)
{
if
(
IsTrickstar
(
card
.
Id
)
&&
card
!=
return_card
&&
card
.
HasPosition
(
CardPosition
.
Attack
))
{
int
this_power
=
(
Bot
.
HasInHand
(
CardId
.
White
)
&&
!
white_eff_used
)
?
(
card
.
RealPower
+
card
.
Attack
)
:
card
.
RealPower
;
if
(
this_power
>=
self_power
)
self_power
=
this_power
;
}
else
if
(
card
.
RealPower
>=
self_power
)
self_power
=
card
.
RealPower
;
}
}
ClientCard
bestenemy
=
AI
.
Utils
.
GetOneEnemyBetterThanValue
(
self_power
,
true
);
if
(
bestenemy
!=
null
)
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
else
AI
.
SelectPosition
(
CardPosition
.
FaceUpAttack
);
return
;
}
public
bool
Red_ss
()
public
bool
Red_ss
()
{
{
if
(
red_ss_count
>=
6
)
return
false
;
if
(
red_ss_count
>=
6
)
return
false
;
...
@@ -596,6 +692,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -596,6 +692,7 @@ namespace WindBot.Game.AI.Decks
{
{
red_ss_count
+=
1
;
red_ss_count
+=
1
;
AI
.
SelectCard
(
m
);
AI
.
SelectCard
(
m
);
Red_SelectPos
();
return
true
;
return
true
;
}
}
}
}
...
@@ -615,6 +712,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -615,6 +712,7 @@ namespace WindBot.Game.AI.Decks
if
(
c
.
Attacked
)
if
(
c
.
Attacked
)
{
{
AI
.
SelectCard
(
c
);
AI
.
SelectCard
(
c
);
Red_SelectPos
(
c
);
red_ss_count
+=
1
;
red_ss_count
+=
1
;
return
true
;
return
true
;
}
}
...
@@ -625,12 +723,14 @@ namespace WindBot.Game.AI.Decks
...
@@ -625,12 +723,14 @@ namespace WindBot.Game.AI.Decks
{
{
if
(
tosolve_enemy
.
Attack
>
3200
)
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
if
(
tosolve_enemy
.
Attack
>
3200
)
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
AI
.
SelectCard
(
c
);
AI
.
SelectCard
(
c
);
Red_SelectPos
(
c
);
red_ss_count
+=
1
;
red_ss_count
+=
1
;
return
true
;
return
true
;
}
}
if
(!
Bot
.
HasInHand
(
CardId
.
White
)
&&
tosolve_enemy
.
Attack
<=
3200
&&
c
.
Id
==
CardId
.
White
)
if
(!
Bot
.
HasInHand
(
CardId
.
White
)
&&
tosolve_enemy
.
Attack
<=
3200
&&
c
.
Id
==
CardId
.
White
)
{
{
AI
.
SelectCard
(
c
);
AI
.
SelectCard
(
c
);
Red_SelectPos
(
c
);
red_ss_count
+=
1
;
red_ss_count
+=
1
;
return
true
;
return
true
;
}
}
...
@@ -647,6 +747,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -647,6 +747,7 @@ namespace WindBot.Game.AI.Decks
}
}
if
(
tosolve_enemy
.
Attack
>
1600
)
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
if
(
tosolve_enemy
.
Attack
>
1600
)
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
AI
.
SelectCard
(
c
);
AI
.
SelectCard
(
c
);
Red_SelectPos
(
c
);
red_ss_count
+=
1
;
red_ss_count
+=
1
;
return
true
;
return
true
;
}
}
...
@@ -658,21 +759,23 @@ namespace WindBot.Game.AI.Decks
...
@@ -658,21 +759,23 @@ namespace WindBot.Game.AI.Decks
{
{
if
(
Duel
.
Phase
>
DuelPhase
.
Main1
&&
Duel
.
Phase
<
DuelPhase
.
Main2
)
if
(
Duel
.
Phase
>
DuelPhase
.
Main1
&&
Duel
.
Phase
<
DuelPhase
.
Main2
)
{
{
if
(
!
Bot
.
HasInHand
(
CardId
.
White
)
&&
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
1600
,
true
)
)
if
(
AI
.
Utils
.
GetOneEnemyBetterThanMyBest
()
!=
null
)
{
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
List
<
ClientCard
>
self_monster
=
Bot
.
GetMonsters
(
);
}
self_monster
.
Sort
(
AIFunctions
.
CompareDefensePower
);
else
if
(
Bot
.
HasInHand
(
CardId
.
White
)
&&
AI
.
Utils
.
IsOneEnemyBetterThanValue
(
3200
,
true
)
)
foreach
(
ClientCard
card
in
self_monster
)
{
{
AI
.
SelectPosition
(
CardPosition
.
FaceUpDefence
);
if
(
IsTrickstar
(
card
.
Id
)
&&
card
.
Id
!=
CardId
.
Red
)
}
if
(
AI
.
Utils
.
GetOneEnemyBetterThanMyBest
()
!=
null
)
{
{
AI
.
SelectCard
(
card
);
Red_SelectPos
(
card
);
red_ss_count
+=
1
;
red_ss_count
+=
1
;
return
true
;
return
true
;
}
}
}
}
}
}
}
}
return
false
;
return
false
;
}
}
...
@@ -1408,8 +1511,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -1408,8 +1511,8 @@ namespace WindBot.Game.AI.Decks
AI
.
SelectCard
(
Useless_List
());
AI
.
SelectCard
(
Useless_List
());
return
true
;
return
true
;
}
}
//if (ActivateDescription == AI.Utils.GetStringId(CardId.
s
nake, 2)) return true;
//if (ActivateDescription == AI.Utils.GetStringId(CardId.
S
nake, 2)) return true;
if
(
ActivateDescription
==
AI
.
Utils
.
GetStringId
(
CardId
.
s
nake
,
1
))
if
(
ActivateDescription
==
AI
.
Utils
.
GetStringId
(
CardId
.
S
nake
,
1
))
{
{
foreach
(
ClientCard
hand
in
Bot
.
Hand
)
foreach
(
ClientCard
hand
in
Bot
.
Hand
)
{
{
...
@@ -1444,7 +1547,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -1444,7 +1547,7 @@ namespace WindBot.Game.AI.Decks
{
{
AI
.
SelectMaterials
(
material_list
);
AI
.
SelectMaterials
(
material_list
);
return
true
;
return
true
;
}
else
if
(
AI
.
Utils
.
GetProblematicEnemyMonster
(
2000
)
!=
null
&&
Bot
.
HasInExtra
(
CardId
.
b
orrel
)
&&
!
Bot
.
HasInMonstersZone
(
CardId
.
Missus
))
}
else
if
(
AI
.
Utils
.
GetProblematicEnemyMonster
(
2000
)
!=
null
&&
Bot
.
HasInExtra
(
CardId
.
B
orrel
)
&&
!
Bot
.
HasInMonstersZone
(
CardId
.
Missus
))
{
{
AI
.
SelectMaterials
(
material_list
);
AI
.
SelectMaterials
(
material_list
);
return
true
;
return
true
;
...
@@ -1458,7 +1561,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -1458,7 +1561,7 @@ namespace WindBot.Game.AI.Decks
{
{
CardId
.
MG
,
CardId
.
MG
,
CardId
.
Missus
,
CardId
.
Missus
,
CardId
.
s
nake
CardId
.
S
nake
});
});
return
true
;
return
true
;
}
}
...
@@ -1518,7 +1621,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -1518,7 +1621,7 @@ namespace WindBot.Game.AI.Decks
{
{
return
(
Card
.
Attack
-
enemy_monster
.
Attack
<
Enemy
.
LifePoints
);
return
(
Card
.
Attack
-
enemy_monster
.
Attack
<
Enemy
.
LifePoints
);
}
}
else
return
fals
e
;
return
tru
e
;
};
};
ClientCard
BestEnemy
=
AI
.
Utils
.
GetBestEnemyMonster
(
true
);
ClientCard
BestEnemy
=
AI
.
Utils
.
GetBestEnemyMonster
(
true
);
ClientCard
WorstBot
=
Bot
.
GetMonsters
().
GetLowestAttackMonster
();
ClientCard
WorstBot
=
Bot
.
GetMonsters
().
GetLowestAttackMonster
();
...
@@ -1568,15 +1671,30 @@ namespace WindBot.Game.AI.Decks
...
@@ -1568,15 +1671,30 @@ namespace WindBot.Game.AI.Decks
return
false
;
return
false
;
}
}
public
bool
IsAllEnemyBetter
()
{
int
bestPower
=
-
1
;
for
(
int
i
=
0
;
i
<
7
;
++
i
)
{
ClientCard
card
=
Bot
.
MonsterZone
[
i
];
if
(
card
==
null
||
card
.
Data
==
null
)
continue
;
int
newPower
=
card
.
Attack
;
if
(
IsTrickstar
(
card
.
Id
)
&&
Bot
.
HasInHand
(
CardId
.
White
)
&&
!
white_eff_used
)
newPower
+=
card
.
RealPower
;
if
(
newPower
>
bestPower
)
bestPower
=
newPower
;
}
return
AI
.
Utils
.
IsAllEnemyBetterThanValue
(
bestPower
,
true
);
}
public
bool
MonsterRepos
()
public
bool
MonsterRepos
()
{
{
if
(
Card
.
Id
==
CardId
.
Eater
&&
Card
.
IsAttack
())
return
false
;
if
(
Card
.
Id
==
CardId
.
Eater
)
return
(!
Card
.
HasPosition
(
CardPosition
.
Attack
))
;
if
(
IsTrickstar
(
Card
.
Id
)
&&
!
white_eff_used
&&
Bot
.
HasInHand
(
CardId
.
White
)
&&
Card
.
IsAttack
()
&&
Duel
.
Phase
==
DuelPhase
.
Main1
)
return
false
;
if
(
IsTrickstar
(
Card
.
Id
)
&&
!
white_eff_used
&&
Bot
.
HasInHand
(
CardId
.
White
)
&&
Card
.
IsAttack
()
&&
Duel
.
Phase
==
DuelPhase
.
Main1
)
return
false
;
if
(
Card
.
IsFaceup
()
&&
Card
.
IsDefense
()
&&
Card
.
Attack
==
0
)
if
(
Card
.
IsFaceup
()
&&
Card
.
IsDefense
()
&&
Card
.
Attack
==
0
)
return
false
;
return
false
;
bool
enemyBetter
=
AI
.
Utils
.
IsAllEnemyBetter
(
true
);
bool
enemyBetter
=
IsAllEnemyBetter
(
);
if
(
Card
.
IsAttack
()
&&
enemyBetter
)
if
(
Card
.
IsAttack
()
&&
enemyBetter
)
return
true
;
return
true
;
...
@@ -1629,7 +1747,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -1629,7 +1747,8 @@ namespace WindBot.Game.AI.Decks
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
()
&&
!
attacker
.
IsDisabled
())
if
(!
defender
.
IsMonsterHasPreventActivationEffectInBattle
()
&&
!
attacker
.
IsDisabled
())
{
{
if
((
attacker
.
Id
==
CardId
.
Eater
&&
!
defender
.
HasType
(
CardType
.
Token
)
&&
GraveCall_id
!=
CardId
.
Eater
)
||
attacker
.
Id
==
CardId
.
borrel
)
return
AI
.
Attack
(
attacker
,
defender
);
if
((
attacker
.
Id
==
CardId
.
Eater
&&
!
defender
.
HasType
(
CardType
.
Token
))
||
attacker
.
Id
==
CardId
.
Borrel
)
return
AI
.
Attack
(
attacker
,
defender
);
if
((
attacker
.
Id
==
CardId
.
Ultimate
||
attacker
.
Id
==
CardId
.
Cardian
)
&&
attacker
.
RealPower
>
defender
.
RealPower
)
return
AI
.
Attack
(
attacker
,
defender
);
}
}
if
(!
OnPreBattleBetween
(
attacker
,
defender
))
if
(!
OnPreBattleBetween
(
attacker
,
defender
))
...
@@ -1650,7 +1769,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -1650,7 +1769,7 @@ namespace WindBot.Game.AI.Decks
for
(
int
i
=
0
;
i
<
attackers
.
Count
;
++
i
)
for
(
int
i
=
0
;
i
<
attackers
.
Count
;
++
i
)
{
{
ClientCard
attacker
=
attackers
[
i
];
ClientCard
attacker
=
attackers
[
i
];
if
(
attacker
.
Id
==
CardId
.
b
orrel
||
attacker
.
Id
==
CardId
.
Eater
)
return
attacker
;
if
(
attacker
.
Id
==
CardId
.
B
orrel
||
attacker
.
Id
==
CardId
.
Eater
)
return
attacker
;
}
}
return
null
;
return
null
;
}
}
...
...
Game/AI/DefaultExecutor.cs
View file @
e5d5696d
...
@@ -127,6 +127,23 @@ namespace WindBot.Game.AI
...
@@ -127,6 +127,23 @@ namespace WindBot.Game.AI
return
true
;
return
true
;
}
}
/// <summary>
/// Called when the AI has to select a card position.
/// </summary>
/// <param name="cardId">Id of the card to position on the field.</param>
/// <param name="positions">List of available positions.</param>
/// <returns>Selected position, or 0 if no position is set for this card.</returns>
public
override
CardPosition
OnSelectPosition
(
int
cardId
,
IList
<
CardPosition
>
positions
)
{
YGOSharp
.
OCGWrapper
.
NamedCard
cardData
=
YGOSharp
.
OCGWrapper
.
NamedCard
.
Get
(
cardId
);
if
(
cardData
!=
null
)
{
if
(
cardData
.
Attack
==
0
)
return
CardPosition
.
FaceUpDefence
;
}
return
0
;
}
public
override
bool
OnSelectBattleReplay
()
public
override
bool
OnSelectBattleReplay
()
{
{
if
(
Bot
.
BattlingMonster
==
null
)
if
(
Bot
.
BattlingMonster
==
null
)
...
@@ -290,9 +307,10 @@ namespace WindBot.Game.AI
...
@@ -290,9 +307,10 @@ namespace WindBot.Game.AI
if
(
LastChainCard
==
null
)
if
(
LastChainCard
==
null
)
return
false
;
return
false
;
if
(
LastChainCard
.
Controller
!=
1
||
LastChainCard
.
Location
!=
CardLocation
.
MonsterZone
||
!
DefaultUniqueTrap
())
return
false
;
AI
.
SelectCard
(
LastChainCard
);
AI
.
SelectCard
(
LastChainCard
);
return
LastChainCard
.
Controller
==
1
&&
LastChainCard
.
Location
==
CardLocation
.
MonsterZone
&&
DefaultUniqueTrap
()
;
return
true
;
}
}
/// <summary>
/// <summary>
...
...
Game/AI/Executor.cs
View file @
e5d5696d
...
@@ -156,6 +156,12 @@ namespace WindBot.Game.AI
...
@@ -156,6 +156,12 @@ namespace WindBot.Game.AI
return
-
1
;
return
-
1
;
}
}
public
virtual
CardPosition
OnSelectPosition
(
int
cardId
,
IList
<
CardPosition
>
positions
)
{
// Overrided in DefalultExecutor
return
0
;
}
public
virtual
bool
OnSelectBattleReplay
()
public
virtual
bool
OnSelectBattleReplay
()
{
{
// Overrided in DefalultExecutor
// Overrided in DefalultExecutor
...
...
Game/GameAI.cs
View file @
e5d5696d
...
@@ -443,13 +443,17 @@ namespace WindBot.Game
...
@@ -443,13 +443,17 @@ namespace WindBot.Game
/// <returns>Selected position.</returns>
/// <returns>Selected position.</returns>
public
CardPosition
OnSelectPosition
(
int
cardId
,
IList
<
CardPosition
>
positions
)
public
CardPosition
OnSelectPosition
(
int
cardId
,
IList
<
CardPosition
>
positions
)
{
{
// Selects the selected position if available, the first available otherwise.
CardPosition
selector_selected
=
m_position
;
if
(
positions
.
Contains
(
m_position
))
{
CardPosition
old
=
m_position
;
m_position
=
CardPosition
.
FaceUpAttack
;
m_position
=
CardPosition
.
FaceUpAttack
;
return
old
;
}
CardPosition
executor_selected
=
Executor
.
OnSelectPosition
(
cardId
,
positions
);
// Selects the selected position if available, the first available otherwise.
if
(
positions
.
Contains
(
executor_selected
))
return
executor_selected
;
if
(
positions
.
Contains
(
selector_selected
))
return
selector_selected
;
return
positions
[
0
];
return
positions
[
0
];
}
}
...
...
Game/GameBehavior.cs
View file @
e5d5696d
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
...
@@ -265,6 +265,7 @@ namespace WindBot.Game
...
@@ -265,6 +265,7 @@ namespace WindBot.Game
private
void
OnDuelEnd
(
BinaryReader
packet
)
private
void
OnDuelEnd
(
BinaryReader
packet
)
{
{
Connection
.
Close
();
Connection
.
Close
();
Logger
.
DebugWriteLine
(
"********************* Duel end *********************"
);
}
}
private
void
OnChat
(
BinaryReader
packet
)
private
void
OnChat
(
BinaryReader
packet
)
...
@@ -352,6 +353,7 @@ namespace WindBot.Game
...
@@ -352,6 +353,7 @@ namespace WindBot.Game
{
{
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
count
=
packet
.
ReadByte
();
int
count
=
packet
.
ReadByte
();
Logger
.
DebugWriteLine
(
"("
+
player
.
ToString
()
+
"抽了"
+
count
.
ToString
()
+
"张卡)"
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
{
...
@@ -423,6 +425,7 @@ namespace WindBot.Game
...
@@ -423,6 +425,7 @@ namespace WindBot.Game
private
void
OnNewPhase
(
BinaryReader
packet
)
private
void
OnNewPhase
(
BinaryReader
packet
)
{
{
_duel
.
Phase
=
(
DuelPhase
)
packet
.
ReadInt16
();
_duel
.
Phase
=
(
DuelPhase
)
packet
.
ReadInt16
();
Logger
.
DebugWriteLine
(
"(进入"
+
(
_duel
.
Phase
.
ToString
())
+
")"
);
_duel
.
LastSummonPlayer
=
-
1
;
_duel
.
LastSummonPlayer
=
-
1
;
_duel
.
Fields
[
0
].
BattlingMonster
=
null
;
_duel
.
Fields
[
0
].
BattlingMonster
=
null
;
_duel
.
Fields
[
1
].
BattlingMonster
=
null
;
_duel
.
Fields
[
1
].
BattlingMonster
=
null
;
...
@@ -434,6 +437,7 @@ namespace WindBot.Game
...
@@ -434,6 +437,7 @@ namespace WindBot.Game
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
player
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
final
=
_duel
.
Fields
[
player
].
LifePoints
-
packet
.
ReadInt32
();
int
final
=
_duel
.
Fields
[
player
].
LifePoints
-
packet
.
ReadInt32
();
if
(
final
<
0
)
final
=
0
;
if
(
final
<
0
)
final
=
0
;
Logger
.
DebugWriteLine
(
"("
+
player
.
ToString
()
+
"受到了伤害,当前为"
+
final
.
ToString
()
+
")"
);
_duel
.
Fields
[
player
].
LifePoints
=
final
;
_duel
.
Fields
[
player
].
LifePoints
=
final
;
}
}
...
@@ -463,6 +467,7 @@ namespace WindBot.Game
...
@@ -463,6 +467,7 @@ namespace WindBot.Game
packet
.
ReadInt32
();
// reason
packet
.
ReadInt32
();
// reason
ClientCard
card
=
_duel
.
GetCard
(
pc
,
(
CardLocation
)
pl
,
ps
);
ClientCard
card
=
_duel
.
GetCard
(
pc
,
(
CardLocation
)
pl
,
ps
);
if
(
card
!=
null
)
Logger
.
DebugWriteLine
(
"("
+
pc
.
ToString
()
+
"的"
+
(
card
.
Name
??
"未知卡片"
)
+
"从"
+
(
CardLocation
)
pl
+
"移动到了"
+
(
CardLocation
)
cl
+
")"
);
if
((
pl
&
(
int
)
CardLocation
.
Overlay
)
!=
0
)
if
((
pl
&
(
int
)
CardLocation
.
Overlay
)
!=
0
)
{
{
...
@@ -506,6 +511,8 @@ namespace WindBot.Game
...
@@ -506,6 +511,8 @@ namespace WindBot.Game
ClientCard
attackcard
=
_duel
.
GetCard
(
ca
,
(
CardLocation
)
la
,
sa
);
ClientCard
attackcard
=
_duel
.
GetCard
(
ca
,
(
CardLocation
)
la
,
sa
);
ClientCard
defendcard
=
_duel
.
GetCard
(
cd
,
(
CardLocation
)
ld
,
sd
);
ClientCard
defendcard
=
_duel
.
GetCard
(
cd
,
(
CardLocation
)
ld
,
sd
);
if
(
defendcard
==
null
)
Logger
.
DebugWriteLine
(
"("
+
(
attackcard
.
Name
??
"未知卡片"
)
+
"直接攻击)"
);
else
Logger
.
DebugWriteLine
(
"("
+
ca
.
ToString
()
+
"的"
+
(
attackcard
.
Name
??
"未知卡片"
)
+
"攻击了"
+
cd
.
ToString
()
+
"的"
+
(
defendcard
.
Name
??
"未知卡片"
)
+
")"
);
_duel
.
Fields
[
attackcard
.
Controller
].
BattlingMonster
=
attackcard
;
_duel
.
Fields
[
attackcard
.
Controller
].
BattlingMonster
=
attackcard
;
_duel
.
Fields
[
1
-
attackcard
.
Controller
].
BattlingMonster
=
defendcard
;
_duel
.
Fields
[
1
-
attackcard
.
Controller
].
BattlingMonster
=
defendcard
;
...
@@ -525,7 +532,10 @@ namespace WindBot.Game
...
@@ -525,7 +532,10 @@ namespace WindBot.Game
int
cp
=
packet
.
ReadSByte
();
int
cp
=
packet
.
ReadSByte
();
ClientCard
card
=
_duel
.
GetCard
(
pc
,
(
CardLocation
)
pl
,
ps
);
ClientCard
card
=
_duel
.
GetCard
(
pc
,
(
CardLocation
)
pl
,
ps
);
if
(
card
!=
null
)
if
(
card
!=
null
)
{
card
.
Position
=
cp
;
card
.
Position
=
cp
;
Logger
.
DebugWriteLine
(
"("
+
(
card
.
Name
??
"未知卡片"
)
+
"改变了表示形式为"
+
(
CardPosition
)
cp
+
")"
);
}
}
}
private
void
OnChaining
(
BinaryReader
packet
)
private
void
OnChaining
(
BinaryReader
packet
)
...
@@ -537,12 +547,12 @@ namespace WindBot.Game
...
@@ -537,12 +547,12 @@ namespace WindBot.Game
int
subs
=
packet
.
ReadSByte
();
int
subs
=
packet
.
ReadSByte
();
ClientCard
card
=
_duel
.
GetCard
(
pcc
,
pcl
,
pcs
,
subs
);
ClientCard
card
=
_duel
.
GetCard
(
pcc
,
pcl
,
pcs
,
subs
);
int
cc
=
GetLocalPlayer
(
packet
.
ReadByte
());
int
cc
=
GetLocalPlayer
(
packet
.
ReadByte
());
if
(
card
!=
null
)
Logger
.
DebugWriteLine
(
"("
+
cc
.
ToString
()
+
"的"
+
(
card
.
Name
??
"未知卡片"
)
+
"发动了效果)"
);
_ai
.
OnChaining
(
card
,
cc
);
_ai
.
OnChaining
(
card
,
cc
);
_duel
.
ChainTargets
.
Clear
();
_duel
.
ChainTargets
.
Clear
();
_duel
.
LastSummonPlayer
=
-
1
;
_duel
.
LastSummonPlayer
=
-
1
;
_duel
.
CurrentChain
.
Add
(
card
);
_duel
.
CurrentChain
.
Add
(
card
);
_duel
.
LastChainPlayer
=
cc
;
_duel
.
LastChainPlayer
=
cc
;
}
}
private
void
OnChainEnd
(
BinaryReader
packet
)
private
void
OnChainEnd
(
BinaryReader
packet
)
...
@@ -632,6 +642,7 @@ namespace WindBot.Game
...
@@ -632,6 +642,7 @@ namespace WindBot.Game
/*int sseq = */
packet
.
ReadByte
();
/*int sseq = */
packet
.
ReadByte
();
ClientCard
card
=
_duel
.
GetCard
(
player
,
(
CardLocation
)
loc
,
seq
);
ClientCard
card
=
_duel
.
GetCard
(
player
,
(
CardLocation
)
loc
,
seq
);
if
(
card
==
null
)
continue
;
if
(
card
==
null
)
continue
;
Logger
.
DebugWriteLine
(
"("
+
(
CardLocation
)
loc
+
"的"
+
(
card
.
Name
??
"未知卡片"
)
+
"成为了对象)"
);
_duel
.
ChainTargets
.
Add
(
card
);
_duel
.
ChainTargets
.
Add
(
card
);
}
}
}
}
...
...
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