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
baichixing
Neos
Commits
4d4fe7b0
Commit
4d4fe7b0
authored
Mar 19, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hand reload field
parent
b303d331
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
121 additions
and
0 deletions
+121
-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/reloadField.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/reloadField.ts
+101
-0
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+6
-0
src/service/duel/reloadField.ts
src/service/duel/reloadField.ts
+7
-0
No files found.
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
4d4fe7b0
...
...
@@ -50,3 +50,4 @@ export const MSG_PAY_LP_COST = 100;
export
const
MSG_WIN
=
5
;
export
const
MSG_WAITING
=
3
;
export
const
MSG_UPDATE_DATA
=
6
;
export
const
MSG_RELOAD_FIELD
=
162
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
4d4fe7b0
...
...
@@ -26,6 +26,7 @@ import MsgDamage from "./damage";
import
MsgRecover
from
"
./recover
"
;
import
MsgWin
from
"
./win
"
;
import
MsgUpdateDataAdapter
from
"
./updateData
"
;
import
MsgReloadFieldAdapter
from
"
./reloadField
"
;
import
PENETRATE
from
"
./penetrate
"
;
/*
...
...
@@ -154,6 +155,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
}
case
GAME_MSG
.
MSG_RELOAD_FIELD
:
{
gameMsg
.
reload_field
=
MsgReloadFieldAdapter
(
gameData
);
break
;
}
default
:
{
gameMsg
.
unimplemented
=
new
ygopro
.
StocGameMessage
.
MsgUnimplemented
({
command
:
func
,
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/reloadField.ts
0 → 100644
View file @
4d4fe7b0
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
// @ts-ignore
import
{
BufferReaderExt
}
from
"
../../bufferIO
"
;
import
MsgReloadField
=
ygopro
.
StocGameMessage
.
MsgReloadField
;
import
{
numberToCardPosition
}
from
"
../../util
"
;
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReaderExt
(
data
);
const
duel_rule
=
reader
.
inner
.
readUint8
();
const
actions
=
[];
for
(
let
player
=
0
;
player
<
2
;
player
+=
1
)
{
const
lp
=
reader
.
inner
.
readUint32
();
const
zone_actions
=
[];
// MZONE
for
(
let
sequence
=
0
;
sequence
<
7
;
sequence
+=
1
)
{
const
flag
=
reader
.
inner
.
readUint8
();
if
(
flag
)
{
const
position
=
reader
.
inner
.
readUint8
();
const
overlay_count
=
reader
.
inner
.
readUint8
();
zone_actions
.
push
(
new
MsgReloadField
.
ZoneAction
({
zone
:
ygopro
.
CardZone
.
MZONE
,
sequence
,
position
:
numberToCardPosition
(
position
),
overlay_count
,
})
);
}
}
// SZONE
for
(
let
sequence
=
0
;
sequence
<
6
;
sequence
+=
1
)
{
const
flag
=
reader
.
inner
.
readUint8
();
if
(
flag
)
{
const
position
=
reader
.
inner
.
readUint8
();
zone_actions
.
push
(
new
MsgReloadField
.
ZoneAction
({
zone
:
ygopro
.
CardZone
.
SZONE
,
sequence
,
position
:
numberToCardPosition
(
position
),
})
);
}
}
const
main_size
=
reader
.
inner
.
readUint8
();
const
hand_size
=
reader
.
inner
.
readUint8
();
const
grace_size
=
reader
.
inner
.
readUint8
();
const
removed_size
=
reader
.
inner
.
readUint8
();
const
extra_size
=
reader
.
inner
.
readUint8
();
const
extra_p_size
=
reader
.
inner
.
readUint8
();
const
chain_size
=
reader
.
inner
.
readUint8
();
const
chain_actions
=
[];
for
(
let
i
=
0
;
i
<
chain_size
;
i
+=
1
)
{
const
chain_code
=
reader
.
inner
.
readUint32
();
const
location
=
reader
.
readCardLocation
();
const
triggering_controller
=
reader
.
inner
.
readUint8
();
const
triggering_location
=
reader
.
inner
.
readUint8
();
const
triggering_sequence
=
reader
.
inner
.
readUint8
();
const
effect_description
=
reader
.
inner
.
readUint32
();
chain_actions
.
push
(
new
MsgReloadField
.
ChainAction
({
chain_code
,
location
,
triggering_controller
,
triggering_location
,
triggering_sequence
,
effect_description
,
})
);
}
actions
.
push
(
new
MsgReloadField
.
Action
({
player
,
lp
,
zone_actions
,
main_size
,
hand_size
,
grace_size
,
removed_size
,
extra_size
,
extra_p_size
,
chain_size
,
chain_actions
,
})
);
}
return
new
MsgReloadField
({
duel_rule
,
actions
,
});
};
src/service/duel/gameMsg.ts
View file @
4d4fe7b0
...
...
@@ -23,6 +23,7 @@ import onMsgWin from "./win";
import
onMsgWait
from
"
./wait
"
;
import
onUnimplemented
from
"
./unimplemented
"
;
import
onMsgUpdateData
from
"
./updateData
"
;
import
onMsgReloadField
from
"
./reloadField
"
;
import
{
setWaiting
}
from
"
../../reducers/duel/mod
"
;
const
ActiveList
=
[
...
...
@@ -157,6 +158,11 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
}
case
"
reload_field
"
:
{
onMsgReloadField
(
msg
.
reload_field
,
dispatch
);
break
;
}
case
"
unimplemented
"
:
{
onUnimplemented
(
msg
.
unimplemented
,
dispatch
);
...
...
src/service/duel/reloadField.ts
0 → 100644
View file @
4d4fe7b0
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
MsgReloadField
=
ygopro
.
StocGameMessage
.
MsgReloadField
;
export
default
(
reloadField
:
MsgReloadField
,
dispatch
:
AppDispatch
)
=>
{
console
.
log
(
reloadField
);
};
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