Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
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
love_飞影
Neos
Commits
736cdaf0
Commit
736cdaf0
authored
Dec 25, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add MsgSelectPlaceAdapter
parent
aecacf42
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
0 deletions
+82
-0
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+1
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+6
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPlace.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPlace.ts
+75
-0
No files found.
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
736cdaf0
...
@@ -32,3 +32,4 @@ export const MSG_NEW_TURN = 40;
...
@@ -32,3 +32,4 @@ export const MSG_NEW_TURN = 40;
export
const
MSG_NEW_PHASE
=
41
;
export
const
MSG_NEW_PHASE
=
41
;
export
const
MSG_HINT
=
2
;
export
const
MSG_HINT
=
2
;
export
const
MSG_SELECT_IDLE_CMD
=
11
;
export
const
MSG_SELECT_IDLE_CMD
=
11
;
export
const
MSG_SELECT_PLACE
=
18
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
736cdaf0
...
@@ -12,6 +12,7 @@ import MsgNewTurnAdapter from "./newTurn";
...
@@ -12,6 +12,7 @@ import MsgNewTurnAdapter from "./newTurn";
import
MsgNewPhaseAdapter
from
"
./newPhase
"
;
import
MsgNewPhaseAdapter
from
"
./newPhase
"
;
import
MsgHintAdapter
from
"
./hint
"
;
import
MsgHintAdapter
from
"
./hint
"
;
import
MsgSelectIdleCmdAdapter
from
"
./selectIdleCmd
"
;
import
MsgSelectIdleCmdAdapter
from
"
./selectIdleCmd
"
;
import
MsgSelectPlaceAdapter
from
"
./selectPlace
"
;
/*
/*
* STOC GameMsg
* STOC GameMsg
...
@@ -67,6 +68,11 @@ export default class GameMsgAdapter implements StocAdapter {
...
@@ -67,6 +68,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
break
;
}
}
case
GAME_MSG
.
MSG_SELECT_PLACE
:
{
gameMsg
.
select_place
=
MsgSelectPlaceAdapter
(
gameData
);
break
;
}
default
:
{
default
:
{
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectPlace.ts
View file @
736cdaf0
...
@@ -21,4 +21,79 @@ export default (data: Uint8Array) => {
...
@@ -21,4 +21,79 @@ export default (data: Uint8Array) => {
if
(
count
==
0
)
{
if
(
count
==
0
)
{
count
=
1
;
count
=
1
;
}
}
const
msg
=
new
MsgSelectPlace
({
player
,
count
,
places
:
[],
});
for
(
let
i
=
0
;
i
<
2
;
i
++
)
{
const
controler
=
i
==
0
?
player
:
1
-
player
;
const
field
=
i
==
0
?
_field
&
0xffff
:
_field
>>
16
;
if
((
field
&
0x7f
)
!=
0
)
{
// 怪兽区
const
zone
=
ygopro
.
CardZone
.
MZONE
;
const
filter
=
field
&
0x7f
;
for
(
let
sequence
=
0
;
sequence
<
7
;
sequence
++
)
{
if
((
filter
&
(
1
<<
sequence
))
!=
0
)
{
msg
.
places
.
push
(
new
MsgSelectPlace
.
SelectAblePlace
({
controler
,
zone
,
sequence
:
sequence
,
})
);
}
}
}
if
((
field
&
0x1f00
)
!=
0
)
{
// 魔法陷阱区
const
zone
=
ygopro
.
CardZone
.
SZONE
;
const
filter
=
(
field
>>
8
)
&
0x1f
;
for
(
let
sequence
=
0
;
sequence
<
5
;
sequence
++
)
{
if
((
filter
&
(
1
<<
sequence
))
!=
0
)
{
msg
.
places
.
push
(
new
MsgSelectPlace
.
SelectAblePlace
({
controler
,
zone
,
sequence
,
})
);
}
}
}
if
((
field
&
0xc000
)
!=
0
)
{
// 灵摆区?
const
zone
=
ygopro
.
CardZone
.
SZONE
;
const
filter
=
(
field
>>
14
)
&
0x3
;
if
((
filter
&
0x1
)
!=
0
)
{
msg
.
places
.
push
(
new
MsgSelectPlace
.
SelectAblePlace
({
controler
,
zone
,
sequence
:
6
,
})
);
}
if
((
filter
&
0x2
)
!=
0
)
{
msg
.
places
.
push
(
new
MsgSelectPlace
.
SelectAblePlace
({
controler
,
zone
,
sequence
:
7
,
})
);
}
}
}
return
msg
;
};
};
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