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
9be99836
Commit
9be99836
authored
Dec 06, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
impl onSelectIdleCmd
parent
f600e0f6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
7 deletions
+80
-7
src/reducers/duel/handsSlice.ts
src/reducers/duel/handsSlice.ts
+1
-1
src/reducers/duel/mod.ts
src/reducers/duel/mod.ts
+8
-2
src/service/duel/selectIdleCmd.ts
src/service/duel/selectIdleCmd.ts
+71
-4
No files found.
src/reducers/duel/handsSlice.ts
View file @
9be99836
...
@@ -7,7 +7,7 @@ import {
...
@@ -7,7 +7,7 @@ import {
import
{
DuelState
}
from
"
./mod
"
;
import
{
DuelState
}
from
"
./mod
"
;
import
{
RootState
}
from
"
../../store
"
;
import
{
RootState
}
from
"
../../store
"
;
import
{
fetchCard
,
CardMeta
}
from
"
../../api/cards
"
;
import
{
fetchCard
,
CardMeta
}
from
"
../../api/cards
"
;
import
{
judgeSelf
,
Card
,
Interact
Type
,
Interact
ivity
}
from
"
./util
"
;
import
{
judgeSelf
,
Card
,
Interactivity
}
from
"
./util
"
;
import
*
as
UICONFIG
from
"
../../config/ui
"
;
import
*
as
UICONFIG
from
"
../../config/ui
"
;
export
interface
Hands
{
export
interface
Hands
{
...
...
src/reducers/duel/mod.ts
View file @
9be99836
...
@@ -47,8 +47,14 @@ const duelSlice = createSlice({
...
@@ -47,8 +47,14 @@ const duelSlice = createSlice({
},
},
});
});
export
const
{
setSelfType
,
infoInit
,
updateTurn
,
updatePhase
}
=
export
const
{
duelSlice
.
actions
;
setSelfType
,
infoInit
,
updateTurn
,
updatePhase
,
clearHandsInteractivity
,
addHandsInteractivity
,
}
=
duelSlice
.
actions
;
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
export
const
selectDuelHsStart
=
(
state
:
RootState
)
=>
{
return
state
.
duel
.
meInitInfo
!=
null
;
return
state
.
duel
.
meInitInfo
!=
null
;
};
};
...
...
src/service/duel/selectIdleCmd.ts
View file @
9be99836
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
{
InteractType
}
from
"
../../reducers/duel/util
"
;
import
{
clearHandsInteractivity
,
addHandsInteractivity
,
}
from
"
../../reducers/duel/mod
"
;
import
MsgSelectIdleCmd
=
ygopro
.
StocGameMessage
.
MsgSelectIdleCmd
;
export
default
(
export
default
(
selectIdleCmd
:
MsgSelectIdleCmd
,
dispatch
:
AppDispatch
)
=>
{
selectIdleCmd
:
ygopro
.
StocGameMessage
.
MsgSelectIdleCmd
,
const
player
=
selectIdleCmd
.
player
;
dispatch
:
AppDispatch
const
cmds
=
selectIdleCmd
.
idle_cmds
;
)
=>
{};
// 先清掉之前的手牌互动性
dispatch
(
clearHandsInteractivity
(
player
));
for
(
let
cmd
of
cmds
)
{
let
interactType
;
switch
(
cmd
.
idle_type
)
{
case
MsgSelectIdleCmd
.
IdleCmd
.
IdleType
.
SUMMON
:
{
interactType
=
InteractType
.
SUMMON
;
break
;
}
case
MsgSelectIdleCmd
.
IdleCmd
.
IdleType
.
SPSUMMON
:
{
interactType
=
InteractType
.
SP_SUMMON
;
break
;
}
case
MsgSelectIdleCmd
.
IdleCmd
.
IdleType
.
POS_CHANGE
:
{
interactType
=
InteractType
.
POS_CHANGE
;
break
;
}
case
MsgSelectIdleCmd
.
IdleCmd
.
IdleType
.
MSET
:
{
interactType
=
InteractType
.
MSET
;
break
;
}
case
MsgSelectIdleCmd
.
IdleCmd
.
IdleType
.
SSET
:
{
interactType
=
InteractType
.
SSET
;
break
;
}
case
MsgSelectIdleCmd
.
IdleCmd
.
IdleType
.
ACTIVATE
:
{
interactType
=
InteractType
.
ACTIVATE
;
break
;
}
}
for
(
let
data
of
cmd
.
idle_datas
)
{
const
card_info
=
data
.
card_info
;
if
(
card_info
.
location
===
0
)
{
// 目前只处理手牌场景
if
(
interactType
===
InteractType
.
ACTIVATE
)
{
// 发动效果会多一个字段
dispatch
(
addHandsInteractivity
({
player
,
index
:
card_info
.
sequence
,
interactivity
:
{
interactType
,
activateIndex
:
data
.
effect_description
,
},
})
);
}
else
if
(
interactType
)
{
dispatch
(
addHandsInteractivity
({
player
,
index
:
card_info
.
sequence
,
interactivity
:
{
interactType
},
})
);
}
}
}
}
};
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