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
55f137fd
Commit
55f137fd
authored
Aug 23, 2018
by
handsomekiwi
Committed by
mercury233
Aug 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Card.Sequence (#83)
parent
2616468a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
35 deletions
+38
-35
Game/ClientCard.cs
Game/ClientCard.cs
+6
-4
Game/ClientField.cs
Game/ClientField.cs
+2
-2
Game/Duel.cs
Game/Duel.cs
+23
-22
Game/GameBehavior.cs
Game/GameBehavior.cs
+7
-7
No files found.
Game/ClientCard.cs
View file @
55f137fd
...
...
@@ -12,6 +12,7 @@ namespace WindBot.Game
public
string
Name
{
get
;
private
set
;
}
public
int
Position
{
get
;
set
;
}
public
int
Sequence
{
get
;
set
;
}
public
CardLocation
Location
{
get
;
set
;
}
public
int
Alias
{
get
;
private
set
;
}
public
int
Level
{
get
;
private
set
;
}
...
...
@@ -44,14 +45,15 @@ namespace WindBot.Game
public
int
[]
ActionIndex
{
get
;
set
;
}
public
IDictionary
<
int
,
int
>
ActionActivateIndex
{
get
;
private
set
;
}
public
ClientCard
(
int
id
,
CardLocation
loc
)
:
this
(
id
,
loc
,
0
)
public
ClientCard
(
int
id
,
CardLocation
loc
,
int
sequence
)
:
this
(
id
,
loc
,
-
1
,
0
)
{
}
public
ClientCard
(
int
id
,
CardLocation
loc
,
int
position
)
public
ClientCard
(
int
id
,
CardLocation
loc
,
int
sequence
,
int
position
)
{
SetId
(
id
);
Sequence
=
sequence
;
Position
=
position
;
Overlays
=
new
List
<
int
>();
ActionIndex
=
new
int
[
16
];
...
...
@@ -189,7 +191,7 @@ namespace WindBot.Game
public
bool
IsExtraCard
()
{
return
(
HasType
(
CardType
.
Fusion
)
||
HasType
(
CardType
.
Synchro
)
||
HasType
(
CardType
.
Xyz
)
);
return
HasType
(
CardType
.
Fusion
)
||
HasType
(
CardType
.
Synchro
)
||
HasType
(
CardType
.
Xyz
)
||
HasType
(
CardType
.
Link
);
}
public
bool
IsFaceup
()
...
...
Game/ClientField.cs
View file @
55f137fd
...
...
@@ -31,9 +31,9 @@ namespace WindBot.Game
ExtraDeck
=
new
List
<
ClientCard
>();
for
(
int
i
=
0
;
i
<
deck
;
++
i
)
Deck
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Deck
));
Deck
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Deck
,
-
1
));
for
(
int
i
=
0
;
i
<
extra
;
++
i
)
ExtraDeck
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Extra
));
ExtraDeck
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Extra
,
-
1
));
}
public
int
GetMonstersExtraZoneCount
()
...
...
Game/Duel.cs
View file @
55f137fd
...
...
@@ -38,12 +38,12 @@ namespace WindBot.Game
LastSummonedCards
=
new
List
<
ClientCard
>();
}
public
ClientCard
GetCard
(
int
player
,
CardLocation
loc
,
int
index
)
public
ClientCard
GetCard
(
int
player
,
CardLocation
loc
,
int
seq
)
{
return
GetCard
(
player
,
(
int
)
loc
,
index
,
0
);
return
GetCard
(
player
,
(
int
)
loc
,
seq
,
0
);
}
public
ClientCard
GetCard
(
int
player
,
int
loc
,
int
index
,
int
subindex
)
public
ClientCard
GetCard
(
int
player
,
int
loc
,
int
seq
,
int
subSeq
)
{
if
(
player
<
0
||
player
>
1
)
return
null
;
...
...
@@ -79,51 +79,52 @@ namespace WindBot.Game
if
(
cards
==
null
)
return
null
;
if
(
index
>=
cards
.
Count
)
if
(
seq
>=
cards
.
Count
)
return
null
;
if
(
isXyz
)
{
ClientCard
card
=
cards
[
index
];
if
(
card
==
null
||
sub
index
>=
card
.
Overlays
.
Count
)
ClientCard
card
=
cards
[
seq
];
if
(
card
==
null
||
sub
Seq
>=
card
.
Overlays
.
Count
)
return
null
;
return
null
;
// TODO card.Overlays[sub
index
]
return
null
;
// TODO card.Overlays[sub
Seq
]
}
return
cards
[
index
];
return
cards
[
seq
];
}
public
void
AddCard
(
CardLocation
loc
,
int
cardId
,
int
player
,
int
zone
,
int
pos
)
public
void
AddCard
(
CardLocation
loc
,
int
cardId
,
int
player
,
int
seq
,
int
pos
)
{
switch
(
loc
)
{
case
CardLocation
.
Hand
:
Fields
[
player
].
Hand
.
Add
(
new
ClientCard
(
cardId
,
loc
,
pos
));
Fields
[
player
].
Hand
.
Add
(
new
ClientCard
(
cardId
,
loc
,
-
1
,
pos
));
break
;
case
CardLocation
.
Grave
:
Fields
[
player
].
Graveyard
.
Add
(
new
ClientCard
(
cardId
,
loc
,
pos
));
Fields
[
player
].
Graveyard
.
Add
(
new
ClientCard
(
cardId
,
loc
,
-
1
,
pos
));
break
;
case
CardLocation
.
Removed
:
Fields
[
player
].
Banished
.
Add
(
new
ClientCard
(
cardId
,
loc
,
pos
));
Fields
[
player
].
Banished
.
Add
(
new
ClientCard
(
cardId
,
loc
,
-
1
,
pos
));
break
;
case
CardLocation
.
MonsterZone
:
Fields
[
player
].
MonsterZone
[
zone
]
=
new
ClientCard
(
cardId
,
loc
,
pos
);
Fields
[
player
].
MonsterZone
[
seq
]
=
new
ClientCard
(
cardId
,
loc
,
seq
,
pos
);
break
;
case
CardLocation
.
SpellZone
:
Fields
[
player
].
SpellZone
[
zone
]
=
new
ClientCard
(
cardId
,
loc
,
pos
);
Fields
[
player
].
SpellZone
[
seq
]
=
new
ClientCard
(
cardId
,
loc
,
seq
,
pos
);
break
;
case
CardLocation
.
Deck
:
Fields
[
player
].
Deck
.
Add
(
new
ClientCard
(
cardId
,
loc
,
pos
));
Fields
[
player
].
Deck
.
Add
(
new
ClientCard
(
cardId
,
loc
,
-
1
,
pos
));
break
;
case
CardLocation
.
Extra
:
Fields
[
player
].
ExtraDeck
.
Add
(
new
ClientCard
(
cardId
,
loc
,
pos
));
Fields
[
player
].
ExtraDeck
.
Add
(
new
ClientCard
(
cardId
,
loc
,
-
1
,
pos
));
break
;
}
}
public
void
AddCard
(
CardLocation
loc
,
ClientCard
card
,
int
player
,
int
zone
,
int
pos
,
int
id
)
public
void
AddCard
(
CardLocation
loc
,
ClientCard
card
,
int
player
,
int
seq
,
int
pos
,
int
id
)
{
card
.
Location
=
loc
;
card
.
Sequence
=
seq
;
card
.
Position
=
pos
;
card
.
SetId
(
id
);
switch
(
loc
)
...
...
@@ -138,10 +139,10 @@ namespace WindBot.Game
Fields
[
player
].
Banished
.
Add
(
card
);
break
;
case
CardLocation
.
MonsterZone
:
Fields
[
player
].
MonsterZone
[
zone
]
=
card
;
Fields
[
player
].
MonsterZone
[
seq
]
=
card
;
break
;
case
CardLocation
.
SpellZone
:
Fields
[
player
].
SpellZone
[
zone
]
=
card
;
Fields
[
player
].
SpellZone
[
seq
]
=
card
;
break
;
case
CardLocation
.
Deck
:
Fields
[
player
].
Deck
.
Add
(
card
);
...
...
@@ -152,7 +153,7 @@ namespace WindBot.Game
}
}
public
void
RemoveCard
(
CardLocation
loc
,
ClientCard
card
,
int
player
,
int
zone
)
public
void
RemoveCard
(
CardLocation
loc
,
ClientCard
card
,
int
player
,
int
seq
)
{
switch
(
loc
)
{
...
...
@@ -166,10 +167,10 @@ namespace WindBot.Game
Fields
[
player
].
Banished
.
Remove
(
card
);
break
;
case
CardLocation
.
MonsterZone
:
Fields
[
player
].
MonsterZone
[
zone
]
=
null
;
Fields
[
player
].
MonsterZone
[
seq
]
=
null
;
break
;
case
CardLocation
.
SpellZone
:
Fields
[
player
].
SpellZone
[
zone
]
=
null
;
Fields
[
player
].
SpellZone
[
seq
]
=
null
;
break
;
case
CardLocation
.
Deck
:
Fields
[
player
].
Deck
.
Remove
(
card
);
...
...
Game/GameBehavior.cs
View file @
55f137fd
...
...
@@ -365,7 +365,7 @@ namespace WindBot.Game
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
_duel
.
Fields
[
player
].
Deck
.
RemoveAt
(
_duel
.
Fields
[
player
].
Deck
.
Count
-
1
);
_duel
.
Fields
[
player
].
Hand
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Hand
));
_duel
.
Fields
[
player
].
Hand
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Hand
,
-
1
));
}
_ai
.
OnDraw
(
player
);
}
...
...
@@ -436,19 +436,19 @@ namespace WindBot.Game
_duel
.
Fields
[
player
].
Deck
.
Clear
();
for
(
int
i
=
0
;
i
<
mcount
;
++
i
)
{
_duel
.
Fields
[
player
].
Deck
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Deck
));
_duel
.
Fields
[
player
].
Deck
.
Add
(
new
ClientCard
(
0
,
CardLocation
.
Deck
,
-
1
));
}
_duel
.
Fields
[
player
].
ExtraDeck
.
Clear
();
for
(
int
i
=
0
;
i
<
ecount
;
++
i
)
{
int
code
=
packet
.
ReadInt32
()
&
0x7fffffff
;
_duel
.
Fields
[
player
].
ExtraDeck
.
Add
(
new
ClientCard
(
code
,
CardLocation
.
Extra
));
_duel
.
Fields
[
player
].
ExtraDeck
.
Add
(
new
ClientCard
(
code
,
CardLocation
.
Extra
,
-
1
));
}
_duel
.
Fields
[
player
].
Hand
.
Clear
();
for
(
int
i
=
0
;
i
<
hcount
;
++
i
)
{
int
code
=
packet
.
ReadInt32
();
_duel
.
Fields
[
player
].
Hand
.
Add
(
new
ClientCard
(
code
,
CardLocation
.
Hand
));
_duel
.
Fields
[
player
].
Hand
.
Add
(
new
ClientCard
(
code
,
CardLocation
.
Hand
,-
1
));
}
}
...
...
@@ -662,7 +662,7 @@ namespace WindBot.Game
int
seq
=
packet
.
ReadByte
();
ClientCard
card
;
if
(((
int
)
loc
&
(
int
)
CardLocation
.
Overlay
)
!=
0
)
card
=
new
ClientCard
(
id
,
CardLocation
.
Overlay
);
card
=
new
ClientCard
(
id
,
CardLocation
.
Overlay
,
-
1
);
else
card
=
_duel
.
GetCard
(
controler
,
loc
,
seq
);
if
(
card
==
null
)
continue
;
...
...
@@ -850,7 +850,7 @@ namespace WindBot.Game
packet
.
ReadByte
();
// pos
ClientCard
card
;
if
(((
int
)
loc
&
(
int
)
CardLocation
.
Overlay
)
!=
0
)
card
=
new
ClientCard
(
id
,
CardLocation
.
Overlay
);
card
=
new
ClientCard
(
id
,
CardLocation
.
Overlay
,
-
1
);
else
card
=
_duel
.
GetCard
(
player
,
loc
,
seq
);
if
(
card
==
null
)
continue
;
...
...
@@ -909,7 +909,7 @@ namespace WindBot.Game
packet
.
ReadByte
();
// pos
ClientCard
card
;
if
(((
int
)
loc
&
(
int
)
CardLocation
.
Overlay
)
!=
0
)
card
=
new
ClientCard
(
id
,
CardLocation
.
Overlay
);
card
=
new
ClientCard
(
id
,
CardLocation
.
Overlay
,
-
1
);
else
card
=
_duel
.
GetCard
(
player
,
loc
,
seq
);
if
(
card
==
null
)
continue
;
...
...
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