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
fd9b4610
Commit
fd9b4610
authored
Mar 19, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:IceYGO/windbot
parents
621bce57
7299ea0d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
13 deletions
+52
-13
Game/AI/Decks/LuckyExecutor.cs
Game/AI/Decks/LuckyExecutor.cs
+45
-10
Game/AI/DefaultExecutor.cs
Game/AI/DefaultExecutor.cs
+6
-1
Game/GameAI.cs
Game/GameAI.cs
+1
-2
No files found.
Game/AI/Decks/LuckyExecutor.cs
View file @
fd9b4610
...
...
@@ -65,16 +65,16 @@ namespace WindBot.Game.AI.Decks
AddExecutor
(
ExecutorType
.
SpSummon
,
_CardId
.
EvilswarmExcitonKnight
,
DefaultEvilswarmExcitonKnightSummon
);
AddExecutor
(
ExecutorType
.
Activate
,
_CardId
.
EvilswarmExcitonKnight
,
DefaultEvilswarmExcitonKnightEffect
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
SandaionTheTimelord
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
GabrionTheTimelord
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
MichionTheTimelord
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
ZaphionTheTimelord
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
HailonTheTimelord
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
RaphionTheTimelord
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
SadionTheTimelord
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
MetaionTheTimelord
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
KamionTheTimelord
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
LazionTheTimelord
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
SandaionTheTimelord
,
DefaultTimelordSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
GabrionTheTimelord
,
DefaultTimelordSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
MichionTheTimelord
,
DefaultTimelordSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
ZaphionTheTimelord
,
DefaultTimelordSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
HailonTheTimelord
,
DefaultTimelordSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
RaphionTheTimelord
,
DefaultTimelordSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
SadionTheTimelord
,
DefaultTimelordSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
MetaionTheTimelord
,
DefaultTimelordSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
KamionTheTimelord
,
DefaultTimelordSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
LazionTheTimelord
,
DefaultTimelordSummon
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
LeftArmofTheForbiddenOne
,
JustDontIt
);
AddExecutor
(
ExecutorType
.
Summon
,
_CardId
.
RightLegofTheForbiddenOne
,
JustDontIt
);
...
...
@@ -89,6 +89,16 @@ namespace WindBot.Game.AI.Decks
HintMsg
.
FusionMaterial
,
HintMsg
.
SynchroMaterial
,
HintMsg
.
XyzMaterial
,
HintMsg
.
LinkMaterial
,
HintMsg
.
Disable
};
private
List
<
int
>
HintMsgForDeck
=
new
List
<
int
>
{
HintMsg
.
SpSummon
,
HintMsg
.
ToGrave
,
HintMsg
.
Remove
,
HintMsg
.
AddToHand
,
HintMsg
.
FusionMaterial
};
private
List
<
int
>
HintMsgForMaxSelect
=
new
List
<
int
>
{
HintMsg
.
SpSummon
,
HintMsg
.
ToGrave
,
HintMsg
.
AddToHand
,
HintMsg
.
FusionMaterial
,
HintMsg
.
Destroy
};
public
override
IList
<
ClientCard
>
OnSelectCard
(
IList
<
ClientCard
>
_cards
,
int
min
,
int
max
,
int
hint
,
bool
cancelable
)
{
if
(
Duel
.
Phase
==
DuelPhase
.
BattleStart
)
...
...
@@ -115,6 +125,20 @@ namespace WindBot.Game.AI.Decks
}
}
if
(
HintMsgForDeck
.
Contains
(
hint
))
{
IList
<
ClientCard
>
deckCards
=
cards
.
Where
(
card
=>
card
.
Location
==
CardLocation
.
Deck
).
ToList
();
// select deck's card first
while
(
deckCards
.
Count
>
0
&&
selected
.
Count
<
max
)
{
ClientCard
card
=
deckCards
[
Program
.
Rand
.
Next
(
deckCards
.
Count
)];
selected
.
Add
(
card
);
deckCards
.
Remove
(
card
);
cards
.
Remove
(
card
);
}
}
// select random cards
while
(
selected
.
Count
<
min
)
{
...
...
@@ -123,6 +147,17 @@ namespace WindBot.Game.AI.Decks
cards
.
Remove
(
card
);
}
if
(
HintMsgForMaxSelect
.
Contains
(
hint
))
{
// select max cards
while
(
selected
.
Count
<
max
)
{
ClientCard
card
=
cards
[
Program
.
Rand
.
Next
(
cards
.
Count
)];
selected
.
Add
(
card
);
cards
.
Remove
(
card
);
}
}
return
selected
;
}
...
...
Game/AI/DefaultExecutor.cs
View file @
fd9b4610
...
...
@@ -741,7 +741,7 @@ namespace WindBot.Game.AI
(
4000
-
Card
.
Defense
)
*
2
>
(
4000
-
Card
.
Attack
))
return
true
;
bool
enemyBetter
=
Util
.
IsAllEnemyBetter
(
true
);
bool
enemyBetter
=
Util
.
IsAllEnemyBetter
();
if
(
Card
.
IsAttack
()
&&
enemyBetter
)
return
true
;
if
(
Card
.
IsDefense
()
&&
!
enemyBetter
&&
(
Card
.
Attack
>=
Card
.
Defense
||
Card
.
Attack
>=
Util
.
GetBestPower
(
Enemy
)))
...
...
@@ -1145,6 +1145,11 @@ namespace WindBot.Game.AI
return
(
selfBestAttack
<=
oppoBestAttack
&&
oppoBestAttack
<=
3000
)
||
DefaultScarlightRedDragonArchfiendEffect
();
}
protected
bool
DefaultTimelordSummon
()
{
return
Bot
.
GetMonsterCount
()
==
0
;
}
/// <summary>
/// Activate when we have less monsters than enemy, or when enemy have more than 3 monsters.
/// </summary>
...
...
Game/GameAI.cs
View file @
fd9b4610
...
...
@@ -198,8 +198,7 @@ namespace WindBot.Game
for
(
int
i
=
attackers
.
Count
-
1
;
i
>=
0
;
--
i
)
{
ClientCard
attacker
=
attackers
[
i
];
if
(
attacker
.
Attack
>
0
)
return
Attack
(
attacker
,
null
);
Attack
(
attacker
,
null
);
}
}
else
...
...
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