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
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
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
MyCard
Neos
Commits
9e794fb0
Commit
9e794fb0
authored
Mar 18, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle selectTribute
parent
04d77b54
Pipeline
#20771
passed with stages
in 13 minutes and 43 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
0 deletions
+54
-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/selectTribute.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectTribute.ts
+45
-0
src/service/duel/selectCard.ts
src/service/duel/selectCard.ts
+2
-0
No files found.
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
9e794fb0
...
...
@@ -37,6 +37,7 @@ export const MSG_SELECT_IDLE_CMD = 11;
export
const
MSG_SELECT_PLACE
=
18
;
export
const
MSG_MOVE
=
50
;
export
const
MSG_SELECT_CARD
=
15
;
export
const
MSG_SELECT_TRIBUTE
=
20
;
export
const
MSG_SELECT_CHAIN
=
16
;
export
const
MSG_SELECT_EFFECTYN
=
12
;
export
const
MSG_SELECT_POSITION
=
19
;
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
9e794fb0
...
...
@@ -14,6 +14,7 @@ import MsgHintAdapter from "./hint";
import
MsgSelectIdleCmdAdapter
from
"
./selectIdleCmd
"
;
import
MsgSelectPlaceAdapter
from
"
./selectPlace
"
;
import
MsgSelectCardAdapter
from
"
./selectCard
"
;
import
MsgSelectTributeAdapter
from
"
./selectTribute
"
;
import
MsgSelectChainAdapter
from
"
./selectChain
"
;
import
MsgSelectEffectYnAdapter
from
"
./selectEffectYn
"
;
import
MsgSelectPositionAdapter
from
"
./selectPosition
"
;
...
...
@@ -90,6 +91,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
}
case
GAME_MSG
.
MSG_SELECT_TRIBUTE
:
{
gameMsg
.
select_card
=
MsgSelectTributeAdapter
(
gameData
);
break
;
}
case
GAME_MSG
.
MSG_SELECT_CHAIN
:
{
gameMsg
.
select_chain
=
MsgSelectChainAdapter
(
gameData
);
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectTribute.ts
0 → 100644
View file @
9e794fb0
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReaderExt
}
from
"
../../bufferIO
"
;
import
MsgSelectCard
=
ygopro
.
StocGameMessage
.
MsgSelectCard
;
/*
* Msg Select Tribute
*
* @param - see: https://code.mycard.moe/mycard/neos-protobuf/-/blob/main/idl/ocgcore.neos-protobuf
* @usage - 玩家可选择的祭品
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReaderExt
(
data
);
const
player
=
reader
.
inner
.
readUint8
();
const
cancelable
=
reader
.
inner
.
readUint8
()
!=
0
;
const
min
=
reader
.
inner
.
readUint8
();
const
max
=
reader
.
inner
.
readUint8
();
const
count
=
reader
.
inner
.
readUint8
();
const
msg
=
new
MsgSelectCard
({
player
,
cancelable
,
min
,
max
});
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
const
code
=
reader
.
inner
.
readUint32
();
const
controler
=
reader
.
inner
.
readUint8
();
const
location
=
reader
.
inner
.
readUint8
();
const
sequence
=
reader
.
inner
.
readUint8
();
const
release_param
=
reader
.
inner
.
readUint8
();
msg
.
cards
.
push
(
new
MsgSelectCard
.
SelectAbleCard
({
code
,
location
:
new
ygopro
.
CardLocation
({
controler
,
location
,
sequence
,
}),
response
:
i
,
release_param
,
})
);
}
return
msg
;
};
src/service/duel/selectCard.ts
View file @
9e794fb0
...
...
@@ -16,6 +16,8 @@ export default (selectCard: MsgSelectCard, dispatch: AppDispatch) => {
const
max
=
selectCard
.
max
;
const
cards
=
selectCard
.
cards
;
// TODO: handle release_param
dispatch
(
setCheckCardModalMinMax
({
min
,
max
}));
dispatch
(
setCheckCardModalOnSubmit
(
"
sendSelectCardResponse
"
));
...
...
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