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
f8501c1b
Commit
f8501c1b
authored
Feb 25, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'auto' of github.com:jwyxym/windbot
parents
157b7917
3f4dfcc4
Pipeline
#25580
passed with stages
in 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Game/AI/Decks/AutoChessExecutor.cs
Game/AI/Decks/AutoChessExecutor.cs
+8
-7
No files found.
Game/AI/Decks/AutoChessExecutor.cs
View file @
f8501c1b
...
@@ -256,6 +256,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -256,6 +256,9 @@ namespace WindBot.Game.AI.Decks
public
override
BattlePhaseAction
OnSelectAttackTarget
(
ClientCard
attacker
,
IList
<
ClientCard
>
defenders
)
public
override
BattlePhaseAction
OnSelectAttackTarget
(
ClientCard
attacker
,
IList
<
ClientCard
>
defenders
)
{
{
int
atk
=
attacker
.
Attack
;
int
atk
=
attacker
.
Attack
;
if
(!
attacker
.
IsAttack
())
atk
=
attacker
.
GetDefensePower
();
List
<
ClientCard
>
cards
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
!
BlackmailAttacker
(
defender
,
Enemy
)
&&
defender
.
IsFaceup
()).
ToList
();
List
<
ClientCard
>
cards
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
!
BlackmailAttacker
(
defender
,
Enemy
)
&&
defender
.
IsFaceup
()).
ToList
();
List
<
ClientCard
>
cards1
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
!
BlackmailAttacker
(
defender
,
Enemy
)
&&
defender
.
IsFaceup
()
&&
((
defender
.
IsAttack
()
&&
defender
.
Attack
>=
atk
)
||
(!
defender
.
IsAttack
()
&&
defender
.
GetDefensePower
()
>=
atk
))).
ToList
();
List
<
ClientCard
>
cards1
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
!
BlackmailAttacker
(
defender
,
Enemy
)
&&
defender
.
IsFaceup
()
&&
((
defender
.
IsAttack
()
&&
defender
.
Attack
>=
atk
)
||
(!
defender
.
IsAttack
()
&&
defender
.
GetDefensePower
()
>=
atk
))).
ToList
();
List
<
ClientCard
>
cards2
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
!
BlackmailAttacker
(
defender
,
Enemy
)
&&
defender
.
IsFaceup
()
&&
defender
.
IsAttack
()
&&
defender
.
Attack
<
atk
).
ToList
();
List
<
ClientCard
>
cards2
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
!
BlackmailAttacker
(
defender
,
Enemy
)
&&
defender
.
IsFaceup
()
&&
defender
.
IsAttack
()
&&
defender
.
Attack
<
atk
).
ToList
();
...
@@ -263,6 +266,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -263,6 +266,7 @@ namespace WindBot.Game.AI.Decks
List
<
ClientCard
>
cards3
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
!
BlackmailAttacker
(
defender
,
Enemy
)
&&
defender
.
IsFaceup
()
&&
!
defender
.
IsAttack
()
&&
defender
.
GetDefensePower
()
<
atk
).
ToList
();
List
<
ClientCard
>
cards3
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
!
BlackmailAttacker
(
defender
,
Enemy
)
&&
defender
.
IsFaceup
()
&&
!
defender
.
IsAttack
()
&&
defender
.
GetDefensePower
()
<
atk
).
ToList
();
List
<
ClientCard
>
cards4
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
defender
.
IsFacedown
()).
ToList
();
List
<
ClientCard
>
cards4
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
defender
.
IsFacedown
()).
ToList
();
List
<
ClientCard
>
cards5
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
BlackmailAttacker
(
defender
,
Enemy
)
&&
defender
.
IsFaceup
()).
ToList
();
List
<
ClientCard
>
cards5
=
defenders
.
Where
(
defender
=>
defender
!=
null
&&
BlackmailAttacker
(
defender
,
Enemy
)
&&
defender
.
IsFaceup
()).
ToList
();
if
(
BlackmailAttacker
(
attacker
,
Bot
))
if
(
BlackmailAttacker
(
attacker
,
Bot
))
{
{
if
(
attacker
.
CanDirectAttack
)
if
(
attacker
.
CanDirectAttack
)
...
@@ -303,7 +307,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -303,7 +307,7 @@ namespace WindBot.Game.AI.Decks
}
}
else
if
(
cards2
.
Count
()
>
0
)
else
if
(
cards2
.
Count
()
>
0
)
return
base
.
OnSelectAttackTarget
(
attacker
,
cards2
);
return
base
.
OnSelectAttackTarget
(
attacker
,
cards2
);
else
if
(
cards4
.
Count
()
>
0
)
else
if
(
cards4
.
Count
()
>
0
&&
(
attacker
.
Attack
>=
1500
||
Bot
.
LifePoints
>=
1000
)
)
return
AI
.
Attack
(
attacker
,
cards4
[
0
]);
return
AI
.
Attack
(
attacker
,
cards4
[
0
]);
else
if
(
cards3
.
Count
()
>
0
)
else
if
(
cards3
.
Count
()
>
0
)
return
base
.
OnSelectAttackTarget
(
attacker
,
cards3
);
return
base
.
OnSelectAttackTarget
(
attacker
,
cards3
);
...
@@ -413,12 +417,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -413,12 +417,9 @@ namespace WindBot.Game.AI.Decks
return
DefaultMonsterSummon
();
return
DefaultMonsterSummon
();
else
if
(
Bot
.
LifePoints
>
1500
)
else
if
(
Bot
.
LifePoints
>
1500
)
{
{
if
(
DontSummon
(
Card
.
Id
))
return
DefaultMonsterSummon
()
&&
!
DontSummon
(
Card
.
Id
);
return
false
;
else
return
DefaultMonsterSummon
();
}
}
else
if
(
Bot
.
LifePoints
<=
1500
&&
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Count
(
card
=>
card
!=
null
&&
card
.
Attack
<
Card
.
Attack
)
>
0
)
else
if
(
Bot
.
LifePoints
<=
1500
&&
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Count
(
card
=>
card
!=
null
&&
card
.
Attack
<
Card
.
Attack
)
>
0
||
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Count
()
==
0
||
Card
.
Attack
>=
1500
)
return
DefaultMonsterSummon
();
return
DefaultMonsterSummon
();
return
false
;
return
false
;
}
}
...
@@ -427,7 +428,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -427,7 +428,7 @@ namespace WindBot.Game.AI.Decks
if
(
Card
.
HasType
(
CardType
.
Flip
))
if
(
Card
.
HasType
(
CardType
.
Flip
))
return
DefaultMonsterSummon
();
return
DefaultMonsterSummon
();
if
(
Card
.
HasSetcode
(
0x40
))
return
false
;
if
(
Card
.
HasSetcode
(
0x40
))
return
false
;
return
DefaultMonsterSummon
()
&&
(
Bot
.
LifePoints
<=
1500
||
Card
.
HasType
(
CardType
.
Flip
)
||
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Count
()
==
0
||
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Count
()
<=
GetZoneCards
(
CardLocation
.
MonsterZone
,
Enemy
).
Count
(
));
return
DefaultMonsterSummon
()
&&
(
Bot
.
LifePoints
<=
1500
||
(
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Count
()
==
0
&&
Bot
.
LifePoints
<=
4000
));
}
}
}
}
}
}
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