Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
Windbot-408
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
神之吹息
Windbot-408
Commits
0fcae795
Commit
0fcae795
authored
Mar 18, 2021
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update LuckyExecutor OnSelectCard
parent
f0cfe743
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
31 deletions
+13
-31
Game/AI/Decks/LuckyExecutor.cs
Game/AI/Decks/LuckyExecutor.cs
+13
-31
No files found.
Game/AI/Decks/LuckyExecutor.cs
View file @
0fcae795
using
YGOSharp.OCGWrapper.Enums
;
using
YGOSharp.OCGWrapper.Enums
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
WindBot
;
using
WindBot
;
using
WindBot.Game
;
using
WindBot.Game
;
using
WindBot.Game.AI
;
using
WindBot.Game.AI
;
...
@@ -65,10 +66,10 @@ namespace WindBot.Game.AI.Decks
...
@@ -65,10 +66,10 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
EvilswarmExcitonKnight
,
DefaultEvilswarmExcitonKnightEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
EvilswarmExcitonKnight
,
DefaultEvilswarmExcitonKnightEffect
);
}
}
p
ublic
List
<
int
>
REMOVE_HINTMSG
=
new
List
<
int
>
p
rivate
List
<
int
>
HintMsgForRemove
=
new
List
<
int
>
{
{
HintMsg
.
Release
,
HintMsg
.
Destroy
,
HintMsg
.
Remove
,
HintMsg
.
ToGrave
,
HintMsg
.
Release
,
HintMsg
.
Destroy
,
HintMsg
.
Remove
,
HintMsg
.
ToGrave
,
HintMsg
.
ReturnToHand
,
HintMsg
.
ToDeck
,
HintMsg
.
ReturnToHand
,
HintMsg
.
ToDeck
,
HintMsg
.
Disable
HintMsg
.
FusionMaterial
,
HintMsg
.
SynchroMaterial
,
HintMsg
.
XyzMaterial
,
HintMsg
.
LinkMaterial
,
HintMsg
.
Disable
};
};
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
)
...
@@ -83,20 +84,9 @@ namespace WindBot.Game.AI.Decks
...
@@ -83,20 +84,9 @@ namespace WindBot.Game.AI.Decks
if
(
max
>
cards
.
Count
)
if
(
max
>
cards
.
Count
)
max
=
cards
.
Count
;
max
=
cards
.
Count
;
if
(
REMOVE_HINTMSG
.
Contains
(
hint
))
if
(
HintMsgForRemove
.
Contains
(
hint
))
{
{
IList
<
ClientCard
>
selfCards
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
enemyCards
=
cards
.
Where
(
card
=>
card
.
Controller
==
1
).
ToList
();
IList
<
ClientCard
>
enemyCards
=
new
List
<
ClientCard
>();
foreach
(
ClientCard
card
in
cards
)
{
if
(
card
?.
Controller
==
0
)
{
selfCards
.
Add
(
card
);
}
else
{
enemyCards
.
Add
(
card
);
}
}
// select enemy's card first
// select enemy's card first
while
(
enemyCards
.
Count
>
0
&&
selected
.
Count
<
max
)
while
(
enemyCards
.
Count
>
0
&&
selected
.
Count
<
max
)
...
@@ -104,25 +94,17 @@ namespace WindBot.Game.AI.Decks
...
@@ -104,25 +94,17 @@ namespace WindBot.Game.AI.Decks
ClientCard
card
=
enemyCards
[
Program
.
Rand
.
Next
(
enemyCards
.
Count
)];
ClientCard
card
=
enemyCards
[
Program
.
Rand
.
Next
(
enemyCards
.
Count
)];
selected
.
Add
(
card
);
selected
.
Add
(
card
);
enemyCards
.
Remove
(
card
);
enemyCards
.
Remove
(
card
);
cards
.
Remove
(
card
);
}
}
while
(
selfCards
.
Count
>
0
&&
selected
.
Count
<
max
)
{
ClientCard
card
=
selfCards
[
Program
.
Rand
.
Next
(
selfCards
.
Count
)];
selected
.
Add
(
card
);
selfCards
.
Remove
(
card
);
}
}
}
else
{
// select random cards
// select random cards
while
(
selected
.
Count
<
max
)
while
(
selected
.
Count
<
min
)
{
{
ClientCard
card
=
cards
[
Program
.
Rand
.
Next
(
cards
.
Count
)];
ClientCard
card
=
cards
[
Program
.
Rand
.
Next
(
cards
.
Count
)];
selected
.
Add
(
card
);
selected
.
Add
(
card
);
cards
.
Remove
(
card
);
cards
.
Remove
(
card
);
}
}
}
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