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
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
MyCard
windbot
Commits
f193f1f9
Commit
f193f1f9
authored
Mar 18, 2021
by
wind2009
Committed by
GitHub
Mar 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add HintMsg and operation for it in OnSelectCard() (#142)
parent
bbb765d1
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
115 additions
and
16 deletions
+115
-16
Game/AI/Decks/AltergeistExecutor.cs
Game/AI/Decks/AltergeistExecutor.cs
+1
-3
Game/AI/Decks/LuckyExecutor.cs
Game/AI/Decks/LuckyExecutor.cs
+45
-7
Game/AI/Decks/WitchcraftExecutor.cs
Game/AI/Decks/WitchcraftExecutor.cs
+6
-6
Game/AI/HintMsg.cs
Game/AI/HintMsg.cs
+62
-0
WindBot.csproj
WindBot.csproj
+1
-0
No files found.
Game/AI/Decks/AltergeistExecutor.cs
View file @
f193f1f9
...
@@ -2742,8 +2742,6 @@ namespace WindBot.Game.AI.Decks
...
@@ -2742,8 +2742,6 @@ namespace WindBot.Game.AI.Decks
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
)
{
{
int
HIINT_TOGRAVE
=
504
;
if
(
max
==
1
&&
cards
[
0
].
Location
==
CardLocation
.
Deck
if
(
max
==
1
&&
cards
[
0
].
Location
==
CardLocation
.
Deck
&&
Util
.
GetLastChainCard
()
!=
null
&&
Util
.
GetLastChainCard
().
IsCode
(
23002292
)
&&
Bot
.
GetRemainingCount
(
CardId
.
WakingtheDragon
,
1
)
>
0
)
&&
Util
.
GetLastChainCard
()
!=
null
&&
Util
.
GetLastChainCard
().
IsCode
(
23002292
)
&&
Bot
.
GetRemainingCount
(
CardId
.
WakingtheDragon
,
1
)
>
0
)
{
{
...
@@ -2764,7 +2762,7 @@ namespace WindBot.Game.AI.Decks
...
@@ -2764,7 +2762,7 @@ namespace WindBot.Game.AI.Decks
Logger
.
DebugWriteLine
(
"EvenlyMatched: min="
+
min
.
ToString
()
+
", max="
+
max
.
ToString
());
Logger
.
DebugWriteLine
(
"EvenlyMatched: min="
+
min
.
ToString
()
+
", max="
+
max
.
ToString
());
}
}
else
if
(
cards
[
0
].
Location
==
CardLocation
.
Hand
&&
cards
[
cards
.
Count
-
1
].
Location
==
CardLocation
.
Hand
else
if
(
cards
[
0
].
Location
==
CardLocation
.
Hand
&&
cards
[
cards
.
Count
-
1
].
Location
==
CardLocation
.
Hand
&&
(
hint
==
501
||
hint
==
HIINT
_TOGRAVE
)
&&
min
==
max
)
&&
(
hint
==
HintMsg
.
HINTMSG_DISCARD
||
hint
==
HintMsg
.
HINTMSG
_TOGRAVE
)
&&
min
==
max
)
{
{
if
(
Duel
.
LastChainPlayer
==
0
&&
Util
.
GetLastChainCard
().
IsCode
(
CardId
.
OneForOne
))
return
null
;
if
(
Duel
.
LastChainPlayer
==
0
&&
Util
.
GetLastChainCard
().
IsCode
(
CardId
.
OneForOne
))
return
null
;
Logger
.
DebugWriteLine
(
"Hand drop except OneForOne"
);
Logger
.
DebugWriteLine
(
"Hand drop except OneForOne"
);
...
...
Game/AI/Decks/LuckyExecutor.cs
View file @
f193f1f9
...
@@ -65,6 +65,12 @@ namespace WindBot.Game.AI.Decks
...
@@ -65,6 +65,12 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
EvilswarmExcitonKnight
,
DefaultEvilswarmExcitonKnightEffect
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
EvilswarmExcitonKnight
,
DefaultEvilswarmExcitonKnightEffect
);
}
}
public
List
<
int
>
REMOVE_HINTMSG
=
new
List
<
int
>
{
HintMsg
.
HINTMSG_RELEASE
,
HintMsg
.
HINTMSG_DESTROY
,
HintMsg
.
HINTMSG_REMOVE
,
HintMsg
.
HINTMSG_TOGRAVE
,
HintMsg
.
HINTMSG_RTOHAND
,
HintMsg
.
HINTMSG_TODECK
,
HintMsg
.
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
)
{
{
if
(
Duel
.
Phase
==
DuelPhase
.
BattleStart
)
if
(
Duel
.
Phase
==
DuelPhase
.
BattleStart
)
...
@@ -72,18 +78,50 @@ namespace WindBot.Game.AI.Decks
...
@@ -72,18 +78,50 @@ namespace WindBot.Game.AI.Decks
if
(
AI
.
HaveSelectedCards
())
if
(
AI
.
HaveSelectedCards
())
return
null
;
return
null
;
IList
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
_cards
);
IList
<
ClientCard
>
selected
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
selected
=
new
List
<
ClientCard
>();
IList
<
ClientCard
>
cards
=
new
List
<
ClientCard
>(
_cards
);
if
(
max
>
cards
.
Count
)
if
(
max
>
cards
.
Count
)
max
=
cards
.
Count
;
max
=
cards
.
Count
;
// select random cards
if
(
REMOVE_HINTMSG
.
Contains
(
hint
))
while
(
selected
.
Count
<
max
)
{
IList
<
ClientCard
>
selfCards
=
new
List
<
ClientCard
>();
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
while
(
enemyCards
.
Count
>
0
&&
selected
.
Count
<
max
)
{
ClientCard
card
=
enemyCards
[
Program
.
Rand
.
Next
(
enemyCards
.
Count
)];
selected
.
Add
(
card
);
enemyCards
.
Remove
(
card
);
}
while
(
selfCards
.
Count
>
0
&&
selected
.
Count
<
max
)
{
ClientCard
card
=
selfCards
[
Program
.
Rand
.
Next
(
selfCards
.
Count
)];
selected
.
Add
(
card
);
selfCards
.
Remove
(
card
);
}
}
else
{
{
ClientCard
card
=
cards
[
Program
.
Rand
.
Next
(
cards
.
Count
)];
// select random cards
selected
.
Add
(
card
);
while
(
selected
.
Count
<
max
)
cards
.
Remove
(
card
);
{
ClientCard
card
=
cards
[
Program
.
Rand
.
Next
(
cards
.
Count
)];
selected
.
Add
(
card
);
cards
.
Remove
(
card
);
}
}
}
return
selected
;
return
selected
;
...
...
Game/AI/Decks/WitchcraftExecutor.cs
View file @
f193f1f9
...
@@ -309,8 +309,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -309,8 +309,8 @@ namespace WindBot.Game.AI.Decks
// overwrite OnSelectCard to act normally in SelectUnselect
// overwrite OnSelectCard to act normally in SelectUnselect
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
)
{
{
// Patronus
HINTMSG_ATOHAND
// Patronus
if
(
hint
==
506
)
if
(
hint
==
HintMsg
.
HINTMSG_ATOHAND
)
{
{
bool
flag
=
true
;
bool
flag
=
true
;
foreach
(
ClientCard
card
in
cards
)
foreach
(
ClientCard
card
in
cards
)
...
@@ -334,8 +334,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -334,8 +334,8 @@ namespace WindBot.Game.AI.Decks
return
selected
;
return
selected
;
}
}
}
}
// MaxxC
HINTMSG_SPSUMMON
// MaxxC
solution
if
(
hint
==
509
&&
enemy_activate_MaxxC
)
if
(
hint
==
HintMsg
.
HINTMSG_SPSUMMON
&&
enemy_activate_MaxxC
)
{
{
// check whether SS from deck while using effect
// check whether SS from deck while using effect
bool
flag
=
true
;
bool
flag
=
true
;
...
@@ -392,8 +392,8 @@ namespace WindBot.Game.AI.Decks
...
@@ -392,8 +392,8 @@ namespace WindBot.Game.AI.Decks
}
}
}
}
}
}
// MadameVerre
HINTMSG_CONFIRM
// MadameVerre
if
(
hint
==
526
)
if
(
hint
==
HintMsg
.
HINTMSG_CONFIRM
)
{
{
Logger
.
DebugWriteLine
(
"** min-max: "
+
min
.
ToString
()
+
" / "
+
max
.
ToString
());
Logger
.
DebugWriteLine
(
"** min-max: "
+
min
.
ToString
()
+
" / "
+
max
.
ToString
());
foreach
(
ClientCard
card
in
cards
)
foreach
(
ClientCard
card
in
cards
)
...
...
Game/AI/HintMsg.cs
0 → 100644
View file @
f193f1f9
namespace
WindBot.Game.AI
{
public
static
class
HintMsg
{
public
const
int
HINTMSG_RELEASE
=
500
,
HINTMSG_DISCARD
=
501
,
HINTMSG_DESTROY
=
502
,
HINTMSG_REMOVE
=
503
,
HINTMSG_TOGRAVE
=
504
,
HINTMSG_RTOHAND
=
505
,
HINTMSG_ATOHAND
=
506
,
HINTMSG_TODECK
=
507
,
HINTMSG_SUMMON
=
508
,
HINTMSG_SPSUMMON
=
509
,
HINTMSG_SET
=
510
,
HINTMSG_FMATERIAL
=
511
,
HINTMSG_SMATERIAL
=
512
,
HINTMSG_XMATERIAL
=
513
,
HINTMSG_FACEUP
=
514
,
HINTMSG_FACEDOWN
=
515
,
HINTMSG_ATTACK
=
516
,
HINTMSG_DEFENSE
=
517
,
HINTMSG_EQUIP
=
518
,
HINTMSG_REMOVEXYZ
=
519
,
HINTMSG_CONTROL
=
520
,
HINTMSG_DESREPLACE
=
521
,
HINTMSG_FACEUPATTACK
=
522
,
HINTMSG_FACEUPDEFENSE
=
523
,
HINTMSG_FACEDOWNATTACK
=
524
,
HINTMSG_FACEDOWNDEFENSE
=
525
,
HINTMSG_CONFIRM
=
526
,
HINTMSG_TOFIELD
=
527
,
HINTMSG_POSCHANGE
=
528
,
HINTMSG_SELF
=
529
,
HINTMSG_OPPO
=
530
,
HINTMSG_TRIBUTE
=
531
,
HINTMSG_DEATTACHFROM
=
532
,
HINTMSG_LMATERIAL
=
533
,
HINTMSG_ATTACKTARGET
=
549
,
HINTMSG_EFFECT
=
550
,
HINTMSG_TARGET
=
551
,
HINTMSG_COIN
=
552
,
HINTMSG_DICE
=
553
,
HINTMSG_CARDTYPE
=
554
,
HINTMSG_OPTION
=
555
,
HINTMSG_RESOLVEEFFECT
=
556
,
HINTMSG_SELECT
=
560
,
HINTMSG_POSITION
=
561
,
HINTMSG_ATTRIBUTE
=
562
,
HINTMSG_RACE
=
563
,
HINTMSG_CODE
=
564
,
HINGMSG_NUMBER
=
565
,
HINGMSG_LVRANK
=
567
,
HINTMSG_RESOLVECARD
=
568
,
HINTMSG_ZONE
=
569
,
HINTMSG_DISABLEZONE
=
570
,
HINTMSG_TOZONE
=
571
,
HINTMSG_COUNTER
=
572
,
HINTMSG_DISABLE
=
573
,
HINTMSG_OPERATECARD
=
574
;
}
}
\ No newline at end of file
WindBot.csproj
View file @
f193f1f9
...
@@ -125,6 +125,7 @@
...
@@ -125,6 +125,7 @@
<Compile
Include=
"Game\AI\Enums\InvincibleMonster.cs"
/>
<Compile
Include=
"Game\AI\Enums\InvincibleMonster.cs"
/>
<Compile
Include=
"Game\AI\Enums\Floodgate.cs"
/>
<Compile
Include=
"Game\AI\Enums\Floodgate.cs"
/>
<Compile
Include=
"Game\AI\Executor.cs"
/>
<Compile
Include=
"Game\AI\Executor.cs"
/>
<Compile
Include=
"Game\AI\HintMsg.cs"
/>
<Compile
Include=
"Game\AI\Opcodes.cs"
/>
<Compile
Include=
"Game\AI\Opcodes.cs"
/>
<Compile
Include=
"Game\AI\Zones.cs"
/>
<Compile
Include=
"Game\AI\Zones.cs"
/>
<Compile
Include=
"Game\AI\ExecutorType.cs"
/>
<Compile
Include=
"Game\AI\ExecutorType.cs"
/>
...
...
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