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
2766b382
Commit
2766b382
authored
Mar 07, 2024
by
nanahira
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert
parent
897dcd15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
138 additions
and
194 deletions
+138
-194
Game/AI/Decks/AutoChessExecutor.cs
Game/AI/Decks/AutoChessExecutor.cs
+138
-194
No files found.
Game/AI/Decks/AutoChessExecutor.cs
View file @
2766b382
...
...
@@ -19,7 +19,6 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
PendulumActivateFunction
);
AddExecutor
(
ExecutorType
.
Activate
,
EquipEffectActivateFunction
);
AddExecutor
(
ExecutorType
.
Activate
,
EquipActivateFunction
);
AddExecutor
(
ExecutorType
.
Activate
,
SelectOnfieldCardActivateFunction
);
AddExecutor
(
ExecutorType
.
Activate
,
ActivateFunction
);
AddExecutor
(
ExecutorType
.
Summon
,
MonsterSummon
);
...
...
@@ -111,8 +110,6 @@ namespace WindBot.Game.AI.Decks
FilpMonster(ClientCard card)
装备检测
EquipForEnemy(ClientCard card)
发动检测
OtherActivate(ClientCard card)
卡片选择检测
“以场上1张表侧表示的魔法卡为对象”的记述相关卡
EnemyCardTargetSpellFaceUp(ClientCard card)
...
...
@@ -136,10 +133,6 @@ namespace WindBot.Game.AI.Decks
EnemyCardTargetMonsterFaceDown(ClientCard card)
“以场上1只怪兽为对象”的记述相关卡
EnemyCardTargetMonster(ClientCard card)
“选场上1张卡”的记述相关卡
EnemyCardUnTarget(ClientCard card)
“选场上1只怪兽”的记述相关卡
EnemyCardUnTargetMonster(ClientCard card)
得到某个位置的卡片的函数(从神数不神那借来的)
GetZoneCards(CardLocation loc, ClientField player)
系统提示检测
...
...
@@ -151,8 +144,6 @@ namespace WindBot.Game.AI.Decks
EquipActivateFunction()
装备卡的效果的发动
EquipEffectActivateFunction()
选择场上卡片的效果的发动
SelectOnfieldCardActivateFunction()
其他
ActivateFunction()
怪兽相关函数
...
...
@@ -278,27 +269,6 @@ namespace WindBot.Game.AI.Decks
return
false
;
}
private
bool
OtherActivate
(
ClientCard
card
)
{
if
((
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
Location
==
CardLocation
.
Hand
&&
ActivateDescription
==
1160
)
||
(
card
.
HasType
(
CardType
.
Equip
)
&&
card
.
Location
==
CardLocation
.
Hand
)
||
(
card
.
Id
==
43527730
&&
card
.
Location
==
CardLocation
.
SpellZone
)
||
EnemyCardTargetSpellFaceUp
(
card
)
||
EnemyCardTargetTrapFaceUp
(
card
)
||
EnemyCardTargetSpellAndTrap
(
card
)
||
EnemyCardTargetSpellAndTrapFaceUp
(
card
)
||
EnemyCardTargetSpellAndTrapFaceDown
(
card
)
||
EnemyCardTargetMonster
(
card
)
||
EnemyCardTargetMonsterFaceUp
(
card
)
||
EnemyCardTargetMonsterFaceDown
(
card
)
||
EnemyCardTargetFaceDown
(
card
)
||
EnemyCardTargetFaceUp
(
card
)
||
EnemyCardTarget
(
card
)
)
return
true
;
return
false
;
}
private
bool
EnemyCardTargetSpellFaceUp
(
ClientCard
card
)
{
if
(
card
.
Id
==
76137614
)
...
...
@@ -519,7 +489,6 @@ namespace WindBot.Game.AI.Decks
||
(
card
.
Id
==
75147529
&&
ActivateDescription
==
Util
.
GetStringId
(
75147529
,
0
))
||
(
card
.
Id
==
53184342
&&
ActivateDescription
==
Util
.
GetStringId
(
53184342
,
1
))
||
(
card
.
Id
==
21250202
&&
card
.
Location
==
CardLocation
.
MonsterZone
)
||
(
card
.
Id
==
93713837
&&
card
.
Location
==
CardLocation
.
MonsterZone
)
||
(
card
.
Id
==
50275295
&&
card
.
Location
==
CardLocation
.
SpellZone
)
||
(
card
.
Id
==
55623480
&&
card
.
Location
==
CardLocation
.
Grave
)
)
...
...
@@ -571,57 +540,6 @@ namespace WindBot.Game.AI.Decks
return
false
;
}
private
bool
EnemyCardUnTarge
(
ClientCard
card
)
{
int
[]
cardsname
=
new
[]
{
41685633
,
17494901
,
32180819
,
44009443
,
44424095
,
50501121
,
52875873
,
58873391
,
62188962
,
66789970
,
76203291
,
85893201
};
foreach
(
int
cardname
in
cardsname
)
{
if
(
card
.
Id
==
cardname
)
return
true
;
}
if
((
card
.
Id
==
75775867
&&
ActivateDescription
==
Util
.
GetStringId
(
75775867
,
0
))
||
(
card
.
Id
==
77656797
&&
ActivateDescription
==
Util
.
GetStringId
(
77656797
,
0
))
||
(
card
.
Id
==
51316684
&&
ActivateDescription
==
Util
.
GetStringId
(
51316684
,
0
))
||
(
card
.
Id
==
83550869
&&
ActivateDescription
==
Util
.
GetStringId
(
83550869
,
0
))
||
(
card
.
Id
==
99726621
&&
ActivateDescription
==
Util
.
GetStringId
(
99726621
,
0
))
||
(
card
.
Id
==
20665527
&&
ActivateDescription
==
Util
.
GetStringId
(
20665527
,
1
))
||
(
card
.
Id
==
24070330
&&
ActivateDescription
==
Util
.
GetStringId
(
24070330
,
1
))
||
(
card
.
Id
==
40221691
&&
ActivateDescription
==
Util
.
GetStringId
(
40221691
,
1
))
||
(
card
.
Id
==
84425220
&&
ActivateDescription
==
Util
.
GetStringId
(
84425220
,
1
))
||
(
card
.
Id
==
34446231
&&
ActivateDescription
==
Util
.
GetStringId
(
34446231
,
1
))
||
(
card
.
Id
==
70636044
&&
ActivateDescription
==
Util
.
GetStringId
(
70636044
,
2
))
||
(
card
.
Id
==
92650749
&&
ActivateDescription
==
Util
.
GetStringId
(
92650749
,
3
))
||
(
card
.
Id
==
50687050
&&
ActivateDescription
==
Util
.
GetStringId
(
50687050
,
4
))
||
(
card
.
Id
==
84941194
&&
card
.
Location
==
CardLocation
.
MonsterZone
)
||
(
card
.
Id
==
99307040
&&
card
.
Location
==
CardLocation
.
MonsterZone
)
||
(
card
.
Id
==
99414629
&&
!
card
.
Location
==
CardLocation
.
Grave
)
||
(
card
.
Id
==
42620460
&&
card
.
Location
==
CardLocation
.
Grave
)
||
(
card
.
Id
==
86509711
&&
card
.
Location
==
CardLocation
.
Grave
)
)
return
true
;
return
false
;
}
private
bool
EnemyCardUnTargetMonster
(
ClientCard
card
)
{
int
[]
cardsname
=
new
[]
{
10000090
,
41685633
,
17494901
,
32180819
,
44009443
,
44424095
,
50501121
,
52875873
,
58873391
,
62188962
,
66789970
,
76203291
,
85893201
};
foreach
(
int
cardname
in
cardsname
)
{
if
(
card
.
Id
==
cardname
)
return
true
;
}
if
((
card
.
Id
==
44146295
&&
card
.
Location
==
CardLocation
.
MonsterZone
)
||
(
card
.
Id
==
26655293
&&
card
.
Location
==
CardLocation
.
MonsterZone
)
||
(
card
.
Id
==
66947913
&&
!
card
.
Location
==
CardLocation
.
Hand
)
||
card
.
Id
==
67725394
&&
ActivateDescription
==
Util
.
GetStringId
(
67725394
,
2
)
||
card
.
Id
==
83414006
&&
ActivateDescription
==
Util
.
GetStringId
(
83414006
,
2
)
)
return
true
;
return
false
;
}
private
List
<
ClientCard
>
GetZoneCards
(
CardLocation
loc
,
ClientField
player
)
{
List
<
ClientCard
>
res
=
new
List
<
ClientCard
>();
...
...
@@ -747,155 +665,82 @@ namespace WindBot.Game.AI.Decks
IList
<
ClientCard
>
cards
=
new
List
<
ClientCard
>();
if
(
Card
.
Location
==
CardLocation
.
SpellZone
&&
Card
.
Id
==
43527730
)
return
!
Card
.
EquipTarget
.
HasSetcode
(
0x18d
);
if
(
Card
.
Location
==
CardLocation
.
SpellZone
&&
Card
.
Id
==
57736667
)
{
cards
=
GetZoneCards
(
CardLocation
.
Onfield
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
(
card
.
HasType
(
CardType
.
Field
)
||
card
.
HasType
(
CardType
.
Continuous
)
||
card
.
HasType
(
CardType
.
Equip
)
||
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
Location
==
CardLocation
.
SpellZone
)
||
(
card
.
IsFacedown
()
&&
card
.
Location
==
CardLocation
.
SpellZone
)
||
card
.
Location
==
CardLocation
.
MonsterZone
)).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
return
true
;
}
}
return
false
;
}
private
bool
SelectOnfieldCard
ActivateFunction
()
private
bool
ActivateFunction
()
{
if
((
Card
.
HasType
(
CardType
.
Pendulum
)
&&
Card
.
Location
==
CardLocation
.
Hand
&&
ActivateDescription
==
1160
)
||
(
Card
.
HasType
(
CardType
.
Equip
)
&&
Card
.
Location
==
CardLocation
.
Hand
)
||
((
Card
.
Id
==
43527730
||
Card
.
Id
==
57736667
)
&&
Card
.
Location
==
CardLocation
.
SpellZone
)
)
return
false
;
IList
<
ClientCard
>
cards
=
new
List
<
ClientCard
>();
if
(
EnemyCardTargetSpellFaceUp
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
Onfield
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
card
.
IsFaceup
()
&&
((
card
.
HasType
(
CardType
.
Spell
)
&&
(
card
.
HasType
(
CardType
.
Field
)
||
card
.
HasType
(
CardType
.
Continuous
)
||
card
.
HasType
(
CardType
.
Equip
)))
||
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
Location
==
CardLocation
.
SpellZone
))).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
return
cards
.
Count
()
>
0
;
}
else
if
(
EnemyCardTargetTrapFaceUp
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
Onfield
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
(
card
.
HasType
(
CardType
.
Trap
)
&&
card
.
IsFaceup
())
&&
(
card
.
HasType
(
CardType
.
Continuous
))).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
return
cards
.
Count
()
>
0
;
}
else
if
(
EnemyCardTargetSpellAndTrapFaceUp
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
Onfield
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
card
.
IsFaceup
()
&&
(
card
.
HasType
(
CardType
.
Field
)
||
card
.
HasType
(
CardType
.
Continuous
)
||
card
.
HasType
(
CardType
.
Equip
)
||
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
Location
==
CardLocation
.
SpellZone
))).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
return
cards
.
Count
()
>
0
;
}
else
if
(
EnemyCardTargetSpellAndTrapFaceDown
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
Onfield
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
card
.
IsFacedown
()).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
return
cards
.
Count
()
>
0
;
}
else
if
(
EnemyCardTargetSpellAndTrap
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
Onfield
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
(
card
.
HasType
(
CardType
.
Field
)
||
card
.
HasType
(
CardType
.
Continuous
)
||
card
.
HasType
(
CardType
.
Equip
)
||
(
card
.
IsFacedown
()
&&
card
.
Location
==
CardLocation
.
SpellZone
)
||
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
Location
==
CardLocation
.
SpellZone
))).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
return
cards
.
Count
()
>
0
;
}
else
if
(
EnemyCardTargetFaceUp
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
Onfield
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
card
.
IsFaceup
()
&&
(
card
.
HasType
(
CardType
.
Field
)
||
card
.
HasType
(
CardType
.
Continuous
)
||
card
.
HasType
(
CardType
.
Equip
)
||
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
Location
==
CardLocation
.
SpellZone
)
||
card
.
Location
==
CardLocation
.
MonsterZone
)).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
return
cards
.
Count
()
>
0
;
}
else
if
(
EnemyCardTargetFaceDown
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
Onfield
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
card
.
IsFacedown
()).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
return
cards
.
Count
()
>
0
;
}
else
if
(
EnemyCardTarget
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
Onfield
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
(
card
.
HasType
(
CardType
.
Field
)
||
card
.
HasType
(
CardType
.
Continuous
)
||
card
.
HasType
(
CardType
.
Equip
)
||
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
Location
==
CardLocation
.
SpellZone
)
||
(
card
.
IsFacedown
()
&&
card
.
Location
==
CardLocation
.
SpellZone
)
||
card
.
Location
==
CardLocation
.
MonsterZone
)).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
return
cards
.
Count
()
>
0
;
}
else
if
(
EnemyCardTargetMonsterFaceUp
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
card
.
IsFaceup
()).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
return
cards
.
Count
()
>
0
;
}
else
if
(
EnemyCardTargetMonsterFaceDown
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()
&&
card
.
IsFacedown
()).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
return
cards
.
Count
()
>
0
;
}
else
if
(
EnemyCardTargetMonster
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
}
else
if
(
EnemyCardUnTarget
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
Onfield
,
Enemy
).
Where
(
card
=>
card
!=
null
&&
(
card
.
HasType
(
CardType
.
Field
)
||
card
.
HasType
(
CardType
.
Continuous
)
||
card
.
HasType
(
CardType
.
Equip
)
||
(
card
.
HasType
(
CardType
.
Pendulum
)
&&
card
.
Location
==
CardLocation
.
SpellZone
)
||
(
card
.
IsFacedown
()
&&
card
.
Location
==
CardLocation
.
SpellZone
)
||
card
.
Location
==
CardLocation
.
MonsterZone
)).
ToList
();
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
}
else
if
(
EnemyCardUnTargetMonster
(
Card
))
{
cards
=
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
);
if
(
cards
.
Count
()
>
0
)
{
AI
.
SelectCard
(
cards
);
AI
.
SelectNextCard
(
cards
);
return
true
;
}
return
false
;
return
cards
.
Count
()
>
0
;
}
else
if
(
Card
.
Id
==
43898403
)
{
...
...
@@ -905,7 +750,9 @@ namespace WindBot.Game.AI.Decks
else
if
(
Card
.
Id
==
60461804
)
{
if
(
Card
.
Location
==
CardLocation
.
Grave
)
{
return
true
;
}
ClientCard
target
=
Util
.
GetProblematicEnemyCard
(
2500
);
if
(
target
!=
null
&&
!
Util
.
ChainContainPlayer
(
0
))
...
...
@@ -914,16 +761,17 @@ namespace WindBot.Game.AI.Decks
AI
.
SelectNextCard
(
target
);
return
true
;
}
return
false
;
}
else
if
(
ActivateDescription
==
Util
.
GetStringId
(
84815190
,
1
))
{
return
Duel
.
LastChainPlayer
==
1
;
}
else
if
(
ActivateDescription
==
Util
.
GetStringId
(
63014935
,
0
))
{
return
Enemy
.
LifePoints
<=
1000
;
return
false
;
}
private
bool
ActivateFunction
()
{
if
(
OtherActivate
(
Card
))
return
false
;
return
DefaultDontChainMyself
();
}
private
bool
MonsterRepos
()
...
...
@@ -1033,12 +881,13 @@ namespace WindBot.Game.AI.Decks
if
(
scards
.
Count
>
0
)
return
Util
.
CheckSelectCount
(
result
,
scards
,
1
,
1
);
else
if
(
min
==
0
)
return
result
;
}
if
(
HintFunction
(
hint
,
13
,
new
[]{
506
})
&&
!
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
Controller
==
1
)
&&
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
Location
==
CardLocation
.
Hand
))
if
(
HintFunction
(
hint
,
13
,
new
[]{
506
})
&&
!
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
Controller
==
1
)
&&
!
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
Location
!=
CardLocation
.
Hand
))
{
IList
<
ClientCard
>
scards
=
cards
.
Where
(
card
=>
card
!=
null
&&
(!
card
.
HasSetcode
(
0x40
)
||
card
.
Location
!=
CardLocation
.
Hand
)).
ToList
();
IList
<
ClientCard
>
scards
=
cards
.
Where
(
card
=>
card
!=
null
&&
!
card
.
HasSetcode
(
0x40
)).
ToList
();
if
(
scards
.
Count
()
<
min
)
{
IList
<
ClientCard
>
scards2
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
HasSetcode
(
0x40
)
&&
card
.
Location
==
CardLocation
.
Hand
).
ToList
();
IList
<
ClientCard
>
scards2
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
HasSetcode
(
0x40
)).
ToList
();
if
(
scards2
.
Count
()
>
0
)
{
foreach
(
ClientCard
card
in
scards2
)
...
...
@@ -1052,6 +901,102 @@ namespace WindBot.Game.AI.Decks
return
Util
.
CheckSelectCount
(
scards
,
cards
,
min
,
max
);
}
if
((
HintFunction
(
hint
,
13
,
new
[]{
501
,
506
,
508
,
509
})
||
hint
==
573
)
&&
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
Controller
==
1
)
&&
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
Controller
==
0
)
&&
!
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
Location
!=
CardLocation
.
Onfield
))
{
IList
<
ClientCard
>
scards
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Controller
==
1
).
ToList
();
if
(
scards
.
Count
()
<
min
)
{
IList
<
ClientCard
>
scards2
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Controller
==
0
).
ToList
();
if
(
scards2
.
Count
()
>
0
)
{
foreach
(
ClientCard
card
in
scards2
)
{
if
(
scards
.
Count
()
<
min
)
scards
.
Add
(
card
);
}
}
}
if
(
scards
.
Count
()
>=
min
)
return
Util
.
CheckSelectCount
(
scards
,
cards
,
min
,
max
);
return
scards
;
}
if
((
hint
==
503
||
hint
==
507
)
&&
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
Controller
==
1
)
&&
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
Controller
==
0
)
&&
cards
.
Count
(
card
=>
card
!=
null
&&
(
card
.
Location
==
CardLocation
.
Grave
||
card
.
Location
==
CardLocation
.
Onfield
))
==
cards
.
Count
())
{
IList
<
ClientCard
>
scards
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Controller
==
1
).
ToList
();
if
(
scards
.
Count
()
<
min
)
{
IList
<
ClientCard
>
scards2
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Controller
==
0
).
ToList
();
if
(
scards2
.
Count
()
>
0
)
{
foreach
(
ClientCard
card
in
scards2
)
{
if
(
scards
.
Count
()
<
min
)
scards
.
Add
(
card
);
}
}
}
if
(
scards
.
Count
()
>=
min
)
return
Util
.
CheckSelectCount
(
scards
,
cards
,
min
,
max
);
}
if
(
HintFunction
(
hint
,
13
,
new
[]{
500
,
501
,
502
,
506
})
&&
!
cards
.
Any
(
card
=>
card
!=
null
&&
card
.
Controller
==
1
)
&&
cards
.
Count
(
card
=>
card
.
Location
==
CardLocation
.
Grave
||
card
.
Location
==
CardLocation
.
Onfield
||
card
.
Location
==
CardLocation
.
Removed
||
card
.
Location
==
CardLocation
.
Hand
||
card
.
Location
==
CardLocation
.
Deck
)
==
cards
.
Count
())
{
IList
<
ClientCard
>
scards
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
scards1
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Location
==
CardLocation
.
Deck
).
ToList
();
IList
<
ClientCard
>
scards2
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Location
==
CardLocation
.
Removed
).
ToList
();
IList
<
ClientCard
>
scards3
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Location
==
CardLocation
.
Grave
).
ToList
();
IList
<
ClientCard
>
scards4
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Location
==
CardLocation
.
Hand
).
ToList
();
IList
<
ClientCard
>
scards5
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Location
==
CardLocation
.
Onfield
).
ToList
();
if
(
scards1
.
Count
()
>
0
)
{
foreach
(
ClientCard
card
in
scards1
)
{
if
(
scards
.
Count
()
<
min
)
scards
.
Add
(
card
);
}
}
if
(
scards2
.
Count
()
>
0
)
{
foreach
(
ClientCard
card
in
scards2
)
{
if
(
scards
.
Count
()
<
min
)
scards
.
Add
(
card
);
}
}
if
(
scards3
.
Count
()
>
0
)
{
foreach
(
ClientCard
card
in
scards3
)
{
if
(
scards
.
Count
()
<
min
)
scards
.
Add
(
card
);
}
}
if
(
scards4
.
Count
()
>
0
)
{
foreach
(
ClientCard
card
in
scards4
)
{
if
(
scards
.
Count
()
<
min
)
scards
.
Add
(
card
);
}
}
if
(
scards5
.
Count
()
>
0
)
{
foreach
(
ClientCard
card
in
scards5
)
{
if
(
scards
.
Count
()
<
min
)
scards
.
Add
(
card
);
}
}
if
(
scards
.
Count
()
>=
min
)
return
Util
.
CheckSelectCount
(
scards
,
cards
,
min
,
max
);
}
if
(
HintMsgForEnemy
.
Contains
(
hint
))
{
IList
<
ClientCard
>
enemyCards
=
cards
.
Where
(
card
=>
card
.
Controller
==
1
).
ToList
();
...
...
@@ -1134,9 +1079,8 @@ namespace WindBot.Game.AI.Decks
return
new
List
<
ClientCard
>(
new
[]
{
card
});
}
}
if
(
selected
.
Count
()
>
0
)
return
selected
;
return
base
.
OnSelectCard
(
_cards
,
min
,
max
,
hint
,
cancelable
);
}
public
override
int
OnSelectOption
(
IList
<
int
>
options
)
...
...
nanahira
@nanahira
mentioned in commit
b816188f
·
Mar 08, 2024
mentioned in commit
b816188f
mentioned in commit b816188f8f7668d6910ba2323f8c57c022c61d8c
Toggle commit list
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