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
alstroemeria-silentlove
windbot
Commits
4ffb7f8a
Commit
4ffb7f8a
authored
Aug 30, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Bot.UnderAttack
parent
93107b9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
Game/ClientField.cs
Game/ClientField.cs
+1
-0
Game/GameBehavior.cs
Game/GameBehavior.cs
+25
-0
No files found.
Game/ClientField.cs
View file @
4ffb7f8a
...
...
@@ -17,6 +17,7 @@ namespace WindBot.Game
public
int
LifePoints
;
public
ClientCard
BattlingMonster
;
public
bool
UnderAttack
;
public
ClientField
()
{
...
...
Game/GameBehavior.cs
View file @
4ffb7f8a
...
...
@@ -103,6 +103,8 @@ namespace WindBot.Game
_messages
.
Add
(
GameMessage
.
Move
,
OnMove
);
_messages
.
Add
(
GameMessage
.
Swap
,
OnSwap
);
_messages
.
Add
(
GameMessage
.
Attack
,
OnAttack
);
_messages
.
Add
(
GameMessage
.
Battle
,
OnBattle
);
_messages
.
Add
(
GameMessage
.
AttackDisabled
,
OnAttackDisabled
);
_messages
.
Add
(
GameMessage
.
PosChange
,
OnPosChange
);
_messages
.
Add
(
GameMessage
.
Chaining
,
OnChaining
);
_messages
.
Add
(
GameMessage
.
ChainEnd
,
OnChainEnd
);
...
...
@@ -326,6 +328,14 @@ namespace WindBot.Game
int
type
=
packet
.
ReadByte
();
int
player
=
packet
.
ReadByte
();
int
data
=
packet
.
ReadInt32
();
if
(
type
==
1
)
// HINT_EVENT
{
if
(
data
==
24
)
// battling
{
_duel
.
Fields
[
0
].
UnderAttack
=
false
;
_duel
.
Fields
[
1
].
UnderAttack
=
false
;
}
}
if
(
type
==
3
)
// HINT_SELECTMSG
{
_select_hint
=
data
;
...
...
@@ -492,6 +502,8 @@ namespace WindBot.Game
_duel
.
LastSummonedCards
.
Clear
();
_duel
.
Fields
[
0
].
BattlingMonster
=
null
;
_duel
.
Fields
[
1
].
BattlingMonster
=
null
;
_duel
.
Fields
[
0
].
UnderAttack
=
false
;
_duel
.
Fields
[
1
].
UnderAttack
=
false
;
_ai
.
OnNewPhase
();
}
...
...
@@ -621,6 +633,7 @@ namespace WindBot.Game
}
_duel
.
Fields
[
attackcard
.
Controller
].
BattlingMonster
=
attackcard
;
_duel
.
Fields
[
1
-
attackcard
.
Controller
].
BattlingMonster
=
defendcard
;
_duel
.
Fields
[
1
-
attackcard
.
Controller
].
UnderAttack
=
true
;
if
(
ld
==
0
&&
ca
!=
0
)
{
...
...
@@ -628,6 +641,18 @@ namespace WindBot.Game
}
}
private
void
OnBattle
(
BinaryReader
packet
)
{
_duel
.
Fields
[
0
].
UnderAttack
=
false
;
_duel
.
Fields
[
1
].
UnderAttack
=
false
;
}
private
void
OnAttackDisabled
(
BinaryReader
packet
)
{
_duel
.
Fields
[
0
].
UnderAttack
=
false
;
_duel
.
Fields
[
1
].
UnderAttack
=
false
;
}
private
void
OnPosChange
(
BinaryReader
packet
)
{
packet
.
ReadInt32
();
// card id
...
...
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