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
Tang Xinwei
windbot
Commits
d1b4aec3
Commit
d1b4aec3
authored
Aug 19, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
22c9bd3b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
Game/AI/Decks/BlackwingExecutor.cs
Game/AI/Decks/BlackwingExecutor.cs
+6
-3
Game/AI/Decks/GravekeeperExecutor.cs
Game/AI/Decks/GravekeeperExecutor.cs
+4
-2
Game/GameBehavior.cs
Game/GameBehavior.cs
+16
-1
No files found.
Game/AI/Decks/BlackwingExecutor.cs
View file @
d1b4aec3
...
...
@@ -164,11 +164,14 @@ namespace WindBot.Game.AI.Decks
private
bool
攻击力上升效果
()
{
if
(
Enemy
.
GetMonsters
().
GetHighestAttackMonster
().
IsFacedown
()
||
Enemy
.
GetMonsters
().
GetHighestDefenseMonster
().
IsFacedown
()
||
Enemy
.
GetMonsterCount
()
==
0
)
ClientCard
bestMy
=
Bot
.
GetMonsters
().
GetHighestAttackMonster
();
ClientCard
bestEnemyATK
=
Enemy
.
GetMonsters
().
GetHighestAttackMonster
();
ClientCard
bestEnemyDEF
=
Enemy
.
GetMonsters
().
GetHighestDefenseMonster
();
if
(
bestMy
==
null
||
(
bestEnemyATK
==
null
&&
bestEnemyDEF
==
null
))
return
false
;
if
(
Bot
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
<
Enemy
.
GetMonsters
().
GetHighestAttackMonster
()
.
Attack
)
if
(
bestEnemyATK
!=
null
&&
bestMy
.
Attack
<
bestEnemyATK
.
Attack
)
return
true
;
if
(
Bot
.
GetMonsters
().
GetHighestAttackMonster
().
Attack
<
Enemy
.
GetMonsters
().
GetHighestDefenseMonster
()
.
Defense
)
if
(
bestEnemyDEF
!=
null
&&
bestMy
.
Attack
<
bestEnemyDEF
.
Defense
)
return
true
;
return
false
;
}
...
...
Game/AI/Decks/GravekeeperExecutor.cs
View file @
d1b4aec3
...
...
@@ -118,9 +118,11 @@ namespace WindBot.Game.AI.Decks
{
if
(!
Card
.
IsAttack
())
return
false
;
foreach
(
ClientCard
card
in
Enemy
.
MonsterZone
)
if
(
card
!=
null
&&
card
.
IsDefense
()
&&
card
.
Defense
>
1500
&&
card
.
Attack
<
1500
||
card
.
Attack
>
1500
&&
card
.
Defense
<
1500
)
foreach
(
ClientCard
card
in
Enemy
.
GetMonsters
())
{
if
(
card
.
IsDefense
()
&&
card
.
Defense
>
1500
&&
card
.
Attack
<
1500
||
card
.
Attack
>
1500
&&
card
.
Defense
<
1500
)
return
true
;
}
return
false
;
}
...
...
Game/GameBehavior.cs
View file @
d1b4aec3
...
...
@@ -73,7 +73,7 @@ namespace WindBot.Game
_packets
.
Add
(
StocMessage
.
Replay
,
OnReplay
);
_packets
.
Add
(
StocMessage
.
DuelEnd
,
OnDuelEnd
);
_packets
.
Add
(
StocMessage
.
Chat
,
OnChat
);
_packets
.
Add
(
StocMessage
.
ChangeSide
,
On
JoinGam
e
);
_packets
.
Add
(
StocMessage
.
ChangeSide
,
On
ChangeSid
e
);
_packets
.
Add
(
StocMessage
.
ErrorMsg
,
OnErrorMsg
);
_messages
.
Add
(
GameMessage
.
Retry
,
OnRetry
);
...
...
@@ -138,6 +138,21 @@ namespace WindBot.Game
_ai
.
OnJoinGame
();
}
private
void
OnChangeSide
(
BinaryReader
packet
)
{
BinaryWriter
deck
=
GamePacketFactory
.
Create
(
CtosMessage
.
UpdateDeck
);
deck
.
Write
(
Deck
.
Cards
.
Count
+
Deck
.
ExtraCards
.
Count
);
deck
.
Write
(
Deck
.
SideCards
.
Count
);
foreach
(
NamedCard
card
in
Deck
.
Cards
)
deck
.
Write
(
card
.
Id
);
foreach
(
NamedCard
card
in
Deck
.
ExtraCards
)
deck
.
Write
(
card
.
Id
);
foreach
(
NamedCard
card
in
Deck
.
SideCards
)
deck
.
Write
(
card
.
Id
);
Connection
.
Send
(
deck
);
_ai
.
OnJoinGame
();
}
private
void
OnTypeChange
(
BinaryReader
packet
)
{
int
type
=
packet
.
ReadByte
();
...
...
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