Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
windbot
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaoye
windbot
Commits
485698e3
Commit
485698e3
authored
Dec 10, 2024
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
1f05c015
Pipeline
#31682
passed with stage
in 50 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
175 additions
and
173 deletions
+175
-173
Decks/AI_408A.ydk
Decks/AI_408A.ydk
+1
-122
Game/AI/CardContainer.cs
Game/AI/CardContainer.cs
+8
-0
Game/AI/Decks/AI408AExecutor.cs
Game/AI/Decks/AI408AExecutor.cs
+166
-51
No files found.
Decks/AI_408A.ydk
View file @
485698e3
...
@@ -40,125 +40,4 @@
...
@@ -40,125 +40,4 @@
53582587
53582587
97077563
97077563
#extra
#extra
!side
!side
83986578
\ No newline at end of file
83986578
31036355
60082869
60082869
#spare
$1224927$
$1546123$
$3136426$
$3366982$
$3773196$
$3819470$
$4178474$
$4929256$
$5758500$
$7165085$
$9156135$
$9596126$
$9637706$
$10248389$
$12538374$
$13756293$
$15800838$
$16226786$
$17449108$
$17881964$
$22046459$
$22587018$
$23171610$
$23205979$
$23995346$
$24317029$
$26205777$
$26412047$
$27174286$
$28933734$
$29401950$
$30241314$
$30461781$
$30683373$
$31036355$
$31305911$
$32807846$
$33508719$
$34853266$
$35027493$
$36468556$
$37101832$
$38275183$
$41420027$
$41544074$
$41855169$
$42703248$
$45141844$
$46411259$
$46461247$
$47355498$
$47507260$
$48092532$
$49868263$
$51452091$
$51945556$
$56120475$
$57728571$
$58528964$
$59344077$
$60229110$
$60694662$
$62279055$
$63356631$
$63519819$
$64697231$
$65403020$
$66235877$
$66788016$
$67688478$
$68005187$
$69015963$
$69162969$
$69279219$
$70074904$
$70368879$
$71218746$
$71453557$
$72302403$
$73628505$
$73915051$
$74157028$
$76515293$
$76922029$
$77585513$
$77754945$
$78700060$
$80071763$
$81510157$
$81674782$
$82732705$
$83011277$
$83986578$
$85602018$
$85684223$
$85742772$
$86099788$
$86805855$
$87621407$
$87751584$
$87910978$
$88240808$
$90140980$
$90846359$
$93016201$
$93260132$
$94853057$
$95956346$
$97017120$
$97169186$
$98045062$
#representative
$60229110$
$47606319$
$76305638$
Game/AI/CardContainer.cs
View file @
485698e3
...
@@ -7,6 +7,14 @@ namespace WindBot.Game.AI
...
@@ -7,6 +7,14 @@ namespace WindBot.Game.AI
{
{
public
static
class
CardContainer
public
static
class
CardContainer
{
{
public
static
int
CompareCardCode
(
ClientCard
cardA
,
ClientCard
cardB
)
{
if
(
cardA
.
Id
<
cardB
.
Id
)
return
-
1
;
if
(
cardA
.
Id
==
cardB
.
Id
)
return
0
;
return
1
;
}
public
static
int
CompareCardAttack
(
ClientCard
cardA
,
ClientCard
cardB
)
public
static
int
CompareCardAttack
(
ClientCard
cardA
,
ClientCard
cardB
)
{
{
if
(
cardA
.
Attack
<
cardB
.
Attack
)
if
(
cardA
.
Attack
<
cardB
.
Attack
)
...
...
Game/AI/Decks/AI408AExecutor.cs
View file @
485698e3
...
@@ -14,6 +14,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -14,6 +14,7 @@ namespace WindBot.Game.AI.Decks
public
AI408AExecutor
(
GameAI
ai
,
Duel
duel
)
public
AI408AExecutor
(
GameAI
ai
,
Duel
duel
)
:
base
(
ai
,
duel
)
:
base
(
ai
,
duel
)
{
{
AddExecutor
(
ExecutorType
.
Repos
,
OnSelectMonsterRepos
);
AddExecutor
(
ExecutorType
.
SpSummon
);
AddExecutor
(
ExecutorType
.
SpSummon
);
AddExecutor
(
ExecutorType
.
Activate
,
19613556
,
OnSelectActivate
);
AddExecutor
(
ExecutorType
.
Activate
,
19613556
,
OnSelectActivate
);
...
@@ -39,18 +40,14 @@ namespace WindBot.Game.AI.Decks
...
@@ -39,18 +40,14 @@ namespace WindBot.Game.AI.Decks
}
}
private
bool
chk_release_summon
=
false
;
private
bool
chk_release_summon
=
false
;
private
int
summonInTurn
=
0
;
private
int
summonInTurn
=
0
;
private
int
attacked_85306040
=
0
;
private
int
[]
changePosInTurn
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
};
private
int
attacked_79575620
=
0
;
private
int
[]
attacked
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
};
private
int
[]
changePosInTurn
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
};
private
int
[]
attacked
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
};
public
override
void
OnNewTurn
()
public
override
void
OnNewTurn
()
{
{
summonInTurn
=
0
;
summonInTurn
=
0
;
changePosInTurn
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
};
changePosInTurn
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
};
attacked
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
};
attacked
=
new
int
[]
{
0
,
0
,
0
,
0
,
0
,
0
};
if
(
attacked_85306040
>
0
)
attacked_85306040
--;
attacked_79575620
=
0
;
}
}
public
override
BattlePhaseAction
OnSelectAttackTarget
(
ClientCard
attacker
,
IList
<
ClientCard
>
defenders
)
public
override
BattlePhaseAction
OnSelectAttackTarget
(
ClientCard
attacker
,
IList
<
ClientCard
>
defenders
)
{
{
...
@@ -61,7 +58,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -61,7 +58,7 @@ namespace WindBot.Game.AI.Decks
}
}
if
(
attacker
.
IsCode
(
new
[]
{
37043180
,
70074904
}))
if
(
attacker
.
IsCode
(
new
[]
{
37043180
,
70074904
}))
{
{
if
(
Bot
.
GetMonsterCount
()
>
Enemy
.
GetMonsterCount
())
if
(
Bot
.
GetMonsterCount
()
>
=
Enemy
.
GetMonsterCount
())
{
{
foreach
(
ClientCard
defender
in
defenders
)
foreach
(
ClientCard
defender
in
defenders
)
{
{
...
@@ -70,7 +67,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -70,7 +67,7 @@ namespace WindBot.Game.AI.Decks
if
(!
OnPreBattleBetween
(
attacker
,
defender
))
if
(!
OnPreBattleBetween
(
attacker
,
defender
))
continue
;
continue
;
if
(
attacker
.
RealPower
<
defender
.
RealPower
&&
((
Bot
.
HasInMonstersZone
(
79575620
)
&&
attacked
_79575620
==
0
&&
Bot
.
LifePoints
>
2000
)
?
defender
.
RealPower
-
attacker
.
RealPower
<
Bot
.
LifePoints
-
2000
:
defender
.
RealPower
-
attacker
.
RealPower
<
Bot
.
LifePoints
))
if
(
attacker
.
RealPower
<
defender
.
RealPower
&&
((
Bot
.
HasInMonstersZone
(
79575620
)
&&
attacked
.
Any
(
id
=>
id
==
79575620
)
&&
Bot
.
LifePoints
>
2000
)
?
defender
.
RealPower
-
attacker
.
RealPower
<
Bot
.
LifePoints
-
2000
:
defender
.
RealPower
-
attacker
.
RealPower
<
Bot
.
LifePoints
))
{
{
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
return
AI
.
Attack
(
attacker
,
defender
);
return
AI
.
Attack
(
attacker
,
defender
);
...
@@ -92,32 +89,12 @@ namespace WindBot.Game.AI.Decks
...
@@ -92,32 +89,12 @@ namespace WindBot.Game.AI.Decks
if
((
attacker
.
RealPower
>=
defender
.
RealPower
&&
defender
.
IsAttack
())
||
(
attacker
.
RealPower
>
defender
.
RealPower
&&
!
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Any
(
c
=>
c
!=
null
&&
!
c
.
IsCode
(
79575620
)
&&
c
.
IsAttack
()
&&
(
c
.
Attack
>
defender
.
RealPower
||
(
c
.
IsCode
(
new
[]
{
37043180
,
70074904
})
&&
defender
.
RealPower
-
c
.
Attack
<
Bot
.
LifePoints
-
2000
))
&&
attacked
[
GetSequence
(
c
)]
!=
c
.
Id
)
&&
defender
.
IsDefense
()
&&
defender
.
IsFaceup
()))
if
((
attacker
.
RealPower
>=
defender
.
RealPower
&&
defender
.
IsAttack
())
||
(
attacker
.
RealPower
>
defender
.
RealPower
&&
!
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Any
(
c
=>
c
!=
null
&&
!
c
.
IsCode
(
79575620
)
&&
c
.
IsAttack
()
&&
(
c
.
Attack
>
defender
.
RealPower
||
(
c
.
IsCode
(
new
[]
{
37043180
,
70074904
})
&&
defender
.
RealPower
-
c
.
Attack
<
Bot
.
LifePoints
-
2000
))
&&
attacked
[
GetSequence
(
c
)]
!=
c
.
Id
)
&&
defender
.
IsDefense
()
&&
defender
.
IsFaceup
()))
{
{
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
attacked_79575620
++;
return
AI
.
Attack
(
attacker
,
defender
);
}
}
return
null
;
}
case
85306040
:
{
foreach
(
ClientCard
defender
in
defenders
)
{
attacker
.
RealPower
=
attacker
.
Attack
;
defender
.
RealPower
=
defender
.
GetDefensePower
();
if
(!
OnPreBattleBetween
(
attacker
,
defender
))
continue
;
if
(
attacker
.
RealPower
>
defender
.
RealPower
||
(
attacker
.
RealPower
>=
defender
.
RealPower
&&
attacker
.
IsLastAttacker
&&
defender
.
IsAttack
()))
{
attacked
[
GetSequence
(
attacker
)]
=
attacker
.
Id
;
attacked_85306040
+=
2
;
return
AI
.
Attack
(
attacker
,
defender
);
return
AI
.
Attack
(
attacker
,
defender
);
}
}
}
}
return
null
;
return
null
;
}
}
}
}
foreach
(
ClientCard
defender
in
defenders
)
foreach
(
ClientCard
defender
in
defenders
)
{
{
attacker
.
RealPower
=
attacker
.
Attack
;
attacker
.
RealPower
=
attacker
.
Attack
;
...
@@ -150,16 +127,17 @@ namespace WindBot.Game.AI.Decks
...
@@ -150,16 +127,17 @@ namespace WindBot.Game.AI.Decks
}
}
case
85306040
:
case
85306040
:
{
{
if
(
attacked_85306040
>
0
)
attacked_85306040
=
0
;
return
CardPosition
.
Attack
;
return
CardPosition
.
Attack
;
}
}
case
79575620
:
case
79575620
:
{
{
attacked_79575620
=
0
;
return
(
Bot
.
LifePoints
>
2000
?
CardPosition
.
Attack
:
CardPosition
.
Defence
);
return
(
Bot
.
LifePoints
>
2000
?
CardPosition
.
Attack
:
CardPosition
.
Defence
);
}
}
}
}
if
(
Duel
.
Player
==
1
&&
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
c
=>
c
!=
null
&&
c
.
Attack
>
cardData
.
Attack
&&
c
.
IsAttack
()))
return
CardPosition
.
Defence
;
if
(
Duel
.
Player
==
0
&&
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
c
=>
c
!=
null
&&
c
.
GetDefensePower
()
<
cardData
.
Attack
))
return
CardPosition
.
Attack
;
}
}
return
base
.
OnSelectPosition
(
cardId
,
positions
);
return
base
.
OnSelectPosition
(
cardId
,
positions
);
}
}
...
@@ -186,8 +164,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -186,8 +164,8 @@ namespace WindBot.Game.AI.Decks
}
}
if
(
currentSolvingChain
.
IsCode
(
32807846
))
if
(
currentSolvingChain
.
IsCode
(
32807846
))
{
{
if
(
cards
.
Any
(
c
=>
c
!=
null
&&
c
.
IsCode
(
new
[]
{
37043180
,
70074904
}))
&&
Bot
.
GetMonsterCount
()
>=
Enemy
.
GetMonsterCount
(
))
if
(
(
cards
.
Any
(
c
=>
c
!=
null
&&
c
.
IsCode
(
new
[]
{
37043180
,
70074904
}))
&&
Bot
.
GetMonsterCount
()
>=
Enemy
.
GetMonsterCount
())
||
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
c
=>
c
!=
null
&&
c
.
IsCode
(
new
[]
{
23205979
,
31305911
})
))
return
Util
.
CheckSelectCount
(
cards
.
Where
(
c
=>
c
!=
null
&&
c
.
IsCode
(
new
[]
{
37043180
,
70074904
}
)).
ToList
(),
cards
,
min
,
max
);
return
Util
.
CheckSelectCount
(
cards
.
Where
(
c
ard
=>
card
!=
null
&&
card
.
IsCode
(
new
[]
{
37043180
,
70074904
})
&&
!
cards
.
Any
(
c
=>
c
!=
null
&&
!
c
.
IsCode
(
card
.
Id
)
&&
c
.
Attack
>
card
.
Attack
)).
ToList
(),
cards
,
min
,
max
);
if
(
cards
.
Any
(
c
=>
c
!=
null
&&
c
.
IsCode
(
74131780
)
&&
!
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
card
=>
card
!=
null
&&
card
.
GetDefensePower
()
<
1000
))
&&
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()))
if
(
cards
.
Any
(
c
=>
c
!=
null
&&
c
.
IsCode
(
74131780
)
&&
!
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
card
=>
card
!=
null
&&
card
.
GetDefensePower
()
<
1000
))
&&
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
card
=>
card
!=
null
&&
!
card
.
IsShouldNotBeTarget
()))
return
Util
.
CheckSelectCount
(
cards
.
Where
(
c
=>
c
!=
null
&&
c
.
IsCode
(
74131780
)).
ToList
(),
cards
,
min
,
max
);
return
Util
.
CheckSelectCount
(
cards
.
Where
(
c
=>
c
!=
null
&&
c
.
IsCode
(
74131780
)).
ToList
(),
cards
,
min
,
max
);
return
Util
.
CheckSelectCount
(
cards
.
Where
(
card
=>
card
!=
null
&&
!
cards
.
Any
(
c
=>
c
!=
null
&&
!
c
.
IsCode
(
card
.
Id
)
&&
c
.
Attack
>
card
.
Attack
)).
ToList
(),
cards
,
min
,
max
);
return
Util
.
CheckSelectCount
(
cards
.
Where
(
card
=>
card
!=
null
&&
!
cards
.
Any
(
c
=>
c
!=
null
&&
!
c
.
IsCode
(
card
.
Id
)
&&
c
.
Attack
>
card
.
Attack
)).
ToList
(),
cards
,
min
,
max
);
...
@@ -200,7 +178,112 @@ namespace WindBot.Game.AI.Decks
...
@@ -200,7 +178,112 @@ namespace WindBot.Game.AI.Decks
}
}
case
45986603
:
case
45986603
:
{
{
List
<
ClientCard
>
res
=
cards
.
Where
(
card
=>
card
!=
null
&&
!
cards
.
Any
(
c
=>
c
!=
null
&&
c
.
Attack
>
card
.
Attack
)).
ToList
();
return
Util
.
CheckSelectCount
(
cards
.
Where
(
card
=>
card
!=
null
&&
!
cards
.
Any
(
c
=>
c
!=
null
&&
c
.
Attack
>
card
.
Attack
)).
ToList
(),
cards
,
min
,
max
);
}
case
74131780
:
{
return
Util
.
CheckSelectCount
(
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
Controller
==
1
&&
!
cards
.
Any
(
c
=>
c
!=
null
&&
card
.
Controller
==
1
&&
c
.
Attack
>
card
.
Attack
)).
ToList
(),
cards
,
min
,
max
);
}
case
79571449
:
{
List
<
ClientCard
>
res
=
new
List
<
ClientCard
>();
List
<
ClientCard
>
g
=
new
List
<
ClientCard
>();
int
step
=
0
;
while
(
res
.
Count
()
<
2
)
{
switch
(
step
)
{
case
0
:
{
int
ct
=
cards
.
Count
(
c
=>
c
!=
null
&&
c
.
IsCode
(
32807846
))
-
CheckCardsInDeck
(
new
[]
{
74131780
,
37043180
,
70074904
},
4
);
if
(
ct
>
0
)
{
g
=
cards
.
Where
(
c
=>
c
!=
null
&&
c
.
IsCode
(
32807846
)).
ToList
();
for
(
int
i
=
0
;
i
<
ct
;
i
++)
res
.
Add
(
g
[
i
]);
}
if
((
Bot
.
GetSpellCount
()
>
Enemy
.
GetSpellCount
()
||
(
Bot
.
HasInSpellZone
(
new
[]
{
70828912
,
45986603
,
97077563
})
&&
Enemy
.
GetSpellCount
()
<
3
))
&&
cards
.
Any
(
c
=>
c
!=
null
&&
c
.
IsCode
(
19613556
)))
res
.
AddRange
(
cards
.
Where
(
c
=>
c
!=
null
&&
c
.
IsCode
(
19613556
)).
ToList
());
if
(
cards
.
Any
(
c
=>
c
!=
null
&&
c
.
IsCode
(
42386471
))
&&
cards
.
Any
(
c
=>
c
!=
null
&&
!
c
.
IsCode
(
42386471
)
&&
c
.
HasType
(
CardType
.
Monster
)
&&
c
.
Level
<
5
))
res
.
AddRange
(
cards
.
Where
(
c
=>
c
!=
null
&&
c
.
IsCode
(
42386471
)).
ToList
());
break
;
}
case
1
:
{
if
(
Bot
.
HasInHand
(
new
[]
{
70828912
,
97077563
}))
{
g
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
HasType
(
CardType
.
Monster
)).
ToList
();
g
.
Sort
(
CardContainer
.
CompareCardAttack
);
g
.
Reverse
();
for
(
int
i
=
0
;
i
<
GetZoneCards
(
CardLocation
.
Hand
,
Bot
).
Count
(
c
=>
c
!=
null
&&
c
.
IsCode
(
new
[]
{
70828912
,
97077563
}));
i
++)
{
if
(
g
.
Count
()
-
1
<
i
)
break
;
res
.
Add
(
g
[
i
]);
}
}
break
;
}
case
2
:
{
if
(
Bot
.
HasInHand
(
new
[]
{
76305638
,
47606319
}))
{
g
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
HasType
(
CardType
.
Monster
)
&&
!
card
.
IsCode
((
new
[]
{
76305638
,
47606319
}))).
ToList
();
if
(
g
.
Count
()
==
0
)
{
g
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
HasType
(
CardType
.
Monster
)
&&
card
.
IsCode
((
new
[]
{
76305638
,
47606319
}))).
ToList
();
if
(
g
.
Count
()
<=
1
)
break
;
for
(
int
i
=
0
;
i
<
g
.
Count
()
/
2
;
i
++)
res
.
Add
(
g
[
i
]);
}
else
{
g
.
Sort
(
CardContainer
.
CompareCardAttack
);
if
(
g
[
0
].
IsCode
(
79575620
)
&&
Bot
.
LifePoints
>
2000
)
g
.
Remove
(
g
[
0
]);
if
(
g
.
Count
()
>
0
)
res
.
AddRange
(
g
);
}
}
break
;
}
case
3
:
{
g
=
cards
.
Where
(
card
=>
card
!=
null
&&
(
card
.
HasType
(
CardType
.
Monster
)
||
card
.
IsCode
(
27174286
))
&&
cards
.
Count
(
c
=>
c
!=
null
&&
c
.
IsCode
(
card
.
Id
))
>
1
).
ToList
();
if
(
g
.
Count
()
==
0
)
break
;
g
.
Sort
(
CardContainer
.
CompareCardCode
);
int
code
=
0
;
foreach
(
ClientCard
card
in
g
)
{
if
(!
card
.
IsCode
(
code
))
{
res
.
Add
(
card
);
code
=
card
.
Id
;
}
}
break
;
}
case
4
:
{
g
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
HasType
(
CardType
.
Monster
)).
ToList
();
if
(
g
.
Count
()
==
0
)
break
;
g
.
Sort
(
CardContainer
.
CompareCardAttack
);
if
(
g
[
0
].
IsCode
(
79575620
)
&&
Bot
.
LifePoints
>
2000
)
g
.
Remove
(
g
[
0
]);
if
(
g
.
Count
()
>
0
)
res
.
AddRange
(
g
);
break
;
}
case
5
:
{
foreach
(
int
id
in
new
[]
{
71044499
,
97169186
,
73915051
,
45986603
,
27174286
,
53582587
,
14087893
,
5318639
})
{
g
=
cards
.
Where
(
card
=>
card
!=
null
&&
card
.
IsCode
(
id
)).
ToList
();
if
(
g
.
Count
()
>
0
)
res
.
AddRange
(
g
);
}
break
;
}
step
++;
if
(
step
>
5
)
break
;
}
}
return
Util
.
CheckSelectCount
(
res
,
cards
,
min
,
max
);
return
Util
.
CheckSelectCount
(
res
,
cards
,
min
,
max
);
}
}
}
}
...
@@ -217,12 +300,12 @@ namespace WindBot.Game.AI.Decks
...
@@ -217,12 +300,12 @@ namespace WindBot.Game.AI.Decks
}
}
public
int
GetSequence
(
ClientCard
card
)
public
int
GetSequence
(
ClientCard
card
)
{
{
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
return
-
1
;
if
(
Card
.
Location
!=
CardLocation
.
MonsterZone
)
return
5
;
for
(
int
i
=
0
;
i
<
5
;
++
i
)
for
(
int
i
=
0
;
i
<
5
;
++
i
)
{
{
if
(
Bot
.
MonsterZone
[
i
]
==
card
)
return
i
;
if
(
Bot
.
MonsterZone
[
i
]
==
card
)
return
i
;
}
}
return
-
1
;
return
5
;
}
}
private
List
<
ClientCard
>
GetZoneCards
(
CardLocation
loc
,
ClientField
player
)
private
List
<
ClientCard
>
GetZoneCards
(
CardLocation
loc
,
ClientField
player
)
{
{
...
@@ -236,7 +319,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -236,7 +319,7 @@ namespace WindBot.Game.AI.Decks
if
((
loc
&
CardLocation
.
Extra
)
>
0
)
{
temp
=
player
.
ExtraDeck
.
Where
(
card
=>
card
!=
null
).
ToList
();
if
(
temp
.
Count
()
>
0
)
res
.
AddRange
(
temp
);
}
if
((
loc
&
CardLocation
.
Extra
)
>
0
)
{
temp
=
player
.
ExtraDeck
.
Where
(
card
=>
card
!=
null
).
ToList
();
if
(
temp
.
Count
()
>
0
)
res
.
AddRange
(
temp
);
}
return
res
;
return
res
;
}
}
private
bool
CheckCardsInDeck
(
int
code
,
int
all_ct
)
private
int
CheckCardsInDeck
(
int
code
,
int
all_ct
)
{
{
int
count
=
0
;
int
count
=
0
;
count
+=
GetZoneCards
(
CardLocation
.
SpellZone
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
count
+=
GetZoneCards
(
CardLocation
.
SpellZone
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
...
@@ -245,10 +328,32 @@ namespace WindBot.Game.AI.Decks
...
@@ -245,10 +328,32 @@ namespace WindBot.Game.AI.Decks
count
+=
GetZoneCards
(
CardLocation
.
Hand
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
count
+=
GetZoneCards
(
CardLocation
.
Hand
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
count
+=
GetZoneCards
(
CardLocation
.
Removed
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
count
+=
GetZoneCards
(
CardLocation
.
Removed
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
count
+=
GetZoneCards
(
CardLocation
.
Extra
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
count
+=
GetZoneCards
(
CardLocation
.
Extra
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
return
count
<
all_c
t
;
return
all_ct
-
coun
t
;
}
}
private
bool
MonsterRepos
(
)
private
int
CheckCardsInDeck
(
int
[]
code
,
int
all_ct
)
{
{
int
count
=
0
;
count
+=
GetZoneCards
(
CardLocation
.
SpellZone
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
count
+=
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
count
+=
GetZoneCards
(
CardLocation
.
Grave
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
count
+=
GetZoneCards
(
CardLocation
.
Hand
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
count
+=
GetZoneCards
(
CardLocation
.
Removed
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
count
+=
GetZoneCards
(
CardLocation
.
Extra
,
Bot
).
Count
(
card
=>
card
!=
null
&&
card
.
IsCode
(
code
));
return
all_ct
-
count
;
}
private
bool
OnSelectMonsterRepos
()
{
if
(
Card
.
IsCode
(
39168895
))
return
false
;
if
(
Duel
.
Phase
==
DuelPhase
.
Main1
)
{
if
((
Card
.
IsFacedown
()
||
Card
.
IsDefense
())
&&
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
c
=>
c
!=
null
&&
c
.
GetDefensePower
()
<
Card
.
Attack
))
return
true
;
}
else
if
(
Duel
.
Phase
==
DuelPhase
.
Main2
)
{
if
(
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Any
(
c
=>
c
!=
null
&&
c
.
Attack
>
Card
.
Attack
)
&&
Card
.
IsAttack
())
return
true
;
}
return
false
;
return
false
;
}
}
private
bool
OnSelectActivate
()
private
bool
OnSelectActivate
()
...
@@ -309,9 +414,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -309,9 +414,7 @@ namespace WindBot.Game.AI.Decks
int
ct
=
GetZoneCards
(
CardLocation
.
Removed
,
Bot
).
Count
(
c
=>
c
!=
null
&&
c
.
HasType
(
CardType
.
Monster
));
int
ct
=
GetZoneCards
(
CardLocation
.
Removed
,
Bot
).
Count
(
c
=>
c
!=
null
&&
c
.
HasType
(
CardType
.
Monster
));
if
(
ct
==
0
)
return
false
;
if
(
ct
==
0
)
return
false
;
if
(
ct
>
5
-
Bot
.
GetMonsterCount
())
ct
=
5
-
Bot
.
GetMonsterCount
();
if
(
ct
>
5
-
Bot
.
GetMonsterCount
())
ct
=
5
-
Bot
.
GetMonsterCount
();
if
(
Bot
.
GetMonsterCount
()
==
0
&&
Enemy
.
GetMonsterCount
()
>
0
&&
Duel
.
Phase
>
DuelPhase
.
Main1
&&
Duel
.
Phase
<
DuelPhase
.
Main2
&&
Duel
.
Player
==
1
)
if
(
Bot
.
GetMonsterCount
()
==
0
&&
Util
.
GetBestAttack
(
Enemy
)
>=
Bot
.
LifePoints
&&
Duel
.
Phase
>
DuelPhase
.
Main1
&&
Duel
.
Phase
<
DuelPhase
.
Main2
&&
Duel
.
Player
==
1
)
return
true
;
if
(
5
-
Bot
.
GetMonsterCount
()
>=
ct
&&
Duel
.
Player
==
1
&&
Duel
.
Phase
==
DuelPhase
.
End
)
return
true
;
return
true
;
if
((
5
-
Bot
.
GetMonsterCount
()
>=
ct
||
ct
>
2
)
&&
Duel
.
Player
==
0
&&
Duel
.
Phase
==
DuelPhase
.
Standby
)
if
((
5
-
Bot
.
GetMonsterCount
()
>=
ct
||
ct
>
2
)
&&
Duel
.
Player
==
0
&&
Duel
.
Phase
==
DuelPhase
.
Standby
)
return
true
;
return
true
;
...
@@ -343,6 +446,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -343,6 +446,7 @@ namespace WindBot.Game.AI.Decks
}
}
private
bool
OnSelectMonsterSet
()
private
bool
OnSelectMonsterSet
()
{
{
if
(
Card
.
IsCode
(
60229110
))
return
false
;
if
(!
GetZoneCards
(
CardLocation
.
Hand
,
Bot
).
Any
(
card
=>
card
!=
null
&&
card
.
Defense
>
Card
.
Defense
))
return
true
;
if
(!
GetZoneCards
(
CardLocation
.
Hand
,
Bot
).
Any
(
card
=>
card
!=
null
&&
card
.
Defense
>
Card
.
Defense
))
return
true
;
return
false
;
return
false
;
}
}
...
@@ -355,6 +459,11 @@ namespace WindBot.Game.AI.Decks
...
@@ -355,6 +459,11 @@ namespace WindBot.Game.AI.Decks
summonInTurn
=
Card
.
Id
;
summonInTurn
=
Card
.
Id
;
return
true
;
return
true
;
}
}
if
(
Card
.
IsCode
(
new
[]
{
37043180
,
70074904
})
&&
Bot
.
GetMonsterCount
()
>=
Enemy
.
GetMonsterCount
()
-
1
)
{
summonInTurn
=
Card
.
Id
;
return
true
;
}
}
}
else
else
{
{
...
@@ -367,23 +476,29 @@ namespace WindBot.Game.AI.Decks
...
@@ -367,23 +476,29 @@ namespace WindBot.Game.AI.Decks
chk_release_summon
=
true
;
chk_release_summon
=
true
;
return
true
;
return
true
;
}
}
List
<
ClientCard
>
g
=
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Where
(
c
=>
c
!=
null
&&
!
c
.
IsCode
(
new
[]
{
73915052
,
73915053
,
73915054
,
73915055
})).
ToList
();
g
.
Sort
(
CardContainer
.
CompareCardAttack
);
int
atk
=
g
[
0
].
Attack
;
if
(
Bot
.
LifePoints
>
2000
&&
g
[
0
].
IsCode
(
79575620
))
atk
=
g
[
1
].
Attack
;
if
(
Enemy
.
LifePoints
>
Util
.
GetBestAttack
(
Bot
)
&&
Enemy
.
LifePoints
-
Util
.
GetBestAttack
(
Bot
)
<=
2400
-
atk
&&
Enemy
.
GetMonsterCount
()
==
0
&&
!
GetZoneCards
(
CardLocation
.
Hand
,
Bot
).
Any
(
c
=>
c
!=
null
&&
c
.
Level
<
5
&&
c
.
HasType
(
CardType
.
Monster
)))
{
chk_release_summon
=
true
;
return
true
;
}
return
false
;
return
false
;
}
}
case
79575620
:
case
79575620
:
{
{
if
(
Bot
.
LifePoints
>
2000
)
if
(
Bot
.
LifePoints
>
2000
)
{
{
attacked_79575620
=
0
;
return
true
;
}
if
(
Enemy
.
LifePoints
>
Util
.
GetBestAttack
(
Bot
)
&&
Enemy
.
LifePoints
-
Util
.
GetBestAttack
(
Bot
)
<=
400
&&
Enemy
.
GetMonsterCount
()
==
0
&&
!
GetZoneCards
(
CardLocation
.
Hand
,
Bot
).
Any
(
c
=>
c
!=
null
&&
c
.
Level
<
5
&&
c
.
HasType
(
CardType
.
Monster
)))
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}
}
case
85306040
:
{
if
(
attacked_85306040
>
0
)
attacked_85306040
=
0
;
return
true
;
}
}
}
summonInTurn
=
Card
.
Id
;
summonInTurn
=
Card
.
Id
;
return
true
;
return
true
;
...
...
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