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
723f6bfa
Commit
723f6bfa
authored
Mar 09, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add stoc adapter
parent
a8834c1d
Pipeline
#20537
passed with stages
in 6 minutes and 25 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
0 deletions
+56
-0
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+2
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/damage.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/damage.ts
+21
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+12
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/recover.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/recover.ts
+21
-0
No files found.
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
723f6bfa
...
...
@@ -42,3 +42,5 @@ export const MSG_SELECT_POSITION = 19;
export
const
MSG_SELECT_OPTION
=
14
;
export
const
MSG_SELECT_BATTLE_CMD
=
10
;
export
const
MSG_SELECT_UNSELECT_CARD
=
26
;
export
const
MSG_DAMAGE
=
91
;
export
const
MSG_RECOVER
=
92
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/damage.ts
0 → 100644
View file @
723f6bfa
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
../../bufferIO
"
;
/*
* Msg Damage
*
* @param player - 玩家编号
* @param value - 减少的Hp数值
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReader
(
data
,
true
);
const
player
=
reader
.
readUint8
();
const
value
=
reader
.
readInt32
();
return
new
ygopro
.
StocGameMessage
.
MsgUpdateHp
({
player
,
type_
:
ygopro
.
StocGameMessage
.
MsgUpdateHp
.
ActionType
.
DAMAGE
,
value
,
});
};
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
723f6bfa
...
...
@@ -20,6 +20,8 @@ import MsgSelectPositionAdapter from "./selectPosition";
import
MsgSelectOptionAdapter
from
"
./selectOption
"
;
import
MsgSelectBattleCmdAdapter
from
"
./selectBattleCmd
"
;
import
MsgSelectUnselectCardAdapter
from
"
./selectUnselectCard
"
;
import
MsgDamage
from
"
./damage
"
;
import
MsgRecover
from
"
./recover
"
;
import
PENETRATE
from
"
./penetrate
"
;
/*
...
...
@@ -117,6 +119,16 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
}
case
GAME_MSG
.
MSG_DAMAGE
:
{
gameMsg
.
update_up
=
MsgDamage
(
gameData
);
break
;
}
case
GAME_MSG
.
MSG_RECOVER
:
{
gameMsg
.
update_up
=
MsgRecover
(
gameData
);
break
;
}
default
:
{
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/recover.ts
0 → 100644
View file @
723f6bfa
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
../../bufferIO
"
;
/*
* Msg Recover
*
* @param player - 玩家编号
* @param value - 回复的Hp数值
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReader
(
data
,
true
);
const
player
=
reader
.
readUint8
();
const
value
=
reader
.
readInt32
();
return
new
ygopro
.
StocGameMessage
.
MsgUpdateHp
({
player
,
type_
:
ygopro
.
StocGameMessage
.
MsgUpdateHp
.
ActionType
.
RECOVER
,
value
,
});
};
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