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
d8faa653
Commit
d8faa653
authored
Feb 28, 2024
by
jwyxym
Committed by
GitHub
Feb 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update AutoChessExecutor.cs
parent
9a3a9483
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
1 deletion
+61
-1
Game/AI/Decks/AutoChessExecutor.cs
Game/AI/Decks/AutoChessExecutor.cs
+61
-1
No files found.
Game/AI/Decks/AutoChessExecutor.cs
View file @
d8faa653
...
@@ -15,7 +15,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -15,7 +15,7 @@ namespace WindBot.Game.AI.Decks
:
base
(
ai
,
duel
)
:
base
(
ai
,
duel
)
{
{
AddExecutor
(
ExecutorType
.
SpSummon
);
AddExecutor
(
ExecutorType
.
SpSummon
,
SPSummonFunction
);
AddExecutor
(
ExecutorType
.
Activate
,
PendulumActivateFunction
);
AddExecutor
(
ExecutorType
.
Activate
,
PendulumActivateFunction
);
AddExecutor
(
ExecutorType
.
Activate
,
EquipEffectActivateFunction
);
AddExecutor
(
ExecutorType
.
Activate
,
EquipEffectActivateFunction
);
AddExecutor
(
ExecutorType
.
Activate
,
EquipActivateFunction
);
AddExecutor
(
ExecutorType
.
Activate
,
EquipActivateFunction
);
...
@@ -94,6 +94,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -94,6 +94,9 @@ namespace WindBot.Game.AI.Decks
{
{
HintMsg
.
SpSummon
,
HintMsg
.
ToGrave
,
HintMsg
.
AddToHand
,
HintMsg
.
FusionMaterial
,
HintMsg
.
Destroy
HintMsg
.
SpSummon
,
HintMsg
.
ToGrave
,
HintMsg
.
AddToHand
,
HintMsg
.
FusionMaterial
,
HintMsg
.
Destroy
};
};
private
bool
p_summoning
=
false
;
/*
/*
函数目录 Function Catalogue
函数目录 Function Catalogue
卡片过滤函数
卡片过滤函数
...
@@ -125,6 +128,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -125,6 +128,8 @@ namespace WindBot.Game.AI.Decks
MonsterSummon()
MonsterSummon()
盖放
盖放
MonsterSet()
MonsterSet()
特殊召唤
SPSummonFunction()
OnSelect函数重写
OnSelect函数重写
选择卡片
选择卡片
OnSelectCard(IList<ClientCard> _cards, int min, int max, int hint, bool cancelable)
OnSelectCard(IList<ClientCard> _cards, int min, int max, int hint, bool cancelable)
...
@@ -504,6 +509,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -504,6 +509,7 @@ namespace WindBot.Game.AI.Decks
return
false
;
return
false
;
}
}
private
bool
MonsterSet
()
private
bool
MonsterSet
()
{
{
if
(
FilpMonster
(
Card
))
if
(
FilpMonster
(
Card
))
...
@@ -511,6 +517,32 @@ namespace WindBot.Game.AI.Decks
...
@@ -511,6 +517,32 @@ namespace WindBot.Game.AI.Decks
if
(
Card
.
HasSetcode
(
0x40
))
return
false
;
if
(
Card
.
HasSetcode
(
0x40
))
return
false
;
return
DefaultMonsterSummon
()
&&
(
Bot
.
LifePoints
<=
1500
||
(
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Count
()
==
0
&&
Bot
.
LifePoints
<=
4000
));
return
DefaultMonsterSummon
()
&&
(
Bot
.
LifePoints
<=
1500
||
(
GetZoneCards
(
CardLocation
.
MonsterZone
,
Bot
).
Count
()
==
0
&&
Bot
.
LifePoints
<=
4000
));
}
}
private
bool
SPSummonFunction
()
{
ClientCard
l
=
Util
.
GetPZone
(
0
,
0
);
ClientCard
r
=
Util
.
GetPZone
(
0
,
1
);
if
((
Card
==
l
||
Card
==
r
)
&&
l
!=
null
&&
r
!=
null
)
{
int
lowscales
=
0
;
int
highscales
=
0
;
if
(
l
.
LScale
>
r
.
RScale
)
{
lowscales
=
r
.
RScale
;
highscales
=
l
.
LScale
;
}
else
{
lowscales
=
l
.
LScale
;
highscales
=
r
.
RScale
;
}
List
<
ClientCard
>
cards
=
GetZoneCards
(
CardLocation
.
Hand
,
Bot
).
Where
(
card
=>
card
!=
null
&&
!
DontSummon
(
card
)
&&
card
.
Level
>
lowscales
&&
card
.
Level
<
highscales
).
ToList
();
p_summoning
=
true
;
return
cards
.
Count
()
>
0
;
}
return
true
;
}
public
override
IList
<
ClientCard
>
OnSelectCard
(
IList
<
ClientCard
>
_cards
,
int
min
,
int
max
,
int
hint
,
bool
cancelable
)
public
override
IList
<
ClientCard
>
OnSelectCard
(
IList
<
ClientCard
>
_cards
,
int
min
,
int
max
,
int
hint
,
bool
cancelable
)
{
{
if
(
Duel
.
Phase
==
DuelPhase
.
BattleStart
)
if
(
Duel
.
Phase
==
DuelPhase
.
BattleStart
)
...
@@ -605,6 +637,34 @@ namespace WindBot.Game.AI.Decks
...
@@ -605,6 +637,34 @@ namespace WindBot.Game.AI.Decks
return
new
List
<
ClientCard
>(
new
[]
{
card
});
return
new
List
<
ClientCard
>(
new
[]
{
card
});
}
}
}
}
if
(
hint
==
501
||
hint
==
504
)
{
IList
<
ClientCard
>
handCards
=
cards
.
Where
(
card
=>
card
.
Location
!=
CardLocation
.
Hand
||
!
card
.
HasSetcode
(
0x40
)).
ToList
();
if
(
handCards
.
Count
()
<
min
)
{
IList
<
ClientCard
>
handCards2
=
cards
.
Where
(
card
=>
(
card
.
Location
==
CardLocation
.
Hand
&&
card
.
HasSetcode
(
0x40
))).
ToList
();
if
(
handCards2
.
Count
()
>
0
)
{
foreach
(
ClientCard
card
in
cards
)
{
if
(
handCards
.
Count
()
<
min
)
handCards
.
Add
(
card
);
}
}
}
if
(
handCards
.
Count
()
>=
min
)
return
handCards
;
}
if
(
p_summoning
||
((
Card
==
Util
.
GetPZone
(
0
,
0
)
||
Card
==
Util
.
GetPZone
(
0
,
1
))
&&
hint
==
HintMsg
.
SpSummon
))
{
List
<
ClientCard
>
result
=
new
List
<
ClientCard
>();
List
<
ClientCard
>
scards
=
cards
.
Where
(
card
=>
card
!=
null
&&
!
DontSummon
(
card
)).
ToList
();
p_summoning
=
false
;
if
(
scards
.
Count
>
0
)
return
Util
.
CheckSelectCount
(
result
,
scards
,
1
,
1
);
else
if
(
min
==
0
)
return
result
;
}
return
selected
;
return
selected
;
}
}
...
...
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