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
4eda5276
Commit
4eda5276
authored
Jun 02, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename location to zone
parent
3249270c
Pipeline
#22067
failed with stages
in 14 minutes and 29 seconds
Changes
15
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
25 additions
and
36 deletions
+25
-36
src/api/ocgcore/ocgAdapter/bufferIO.ts
src/api/ocgcore/ocgAdapter/bufferIO.ts
+5
-3
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/attack.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/attack.ts
+1
-1
src/api/ocgcore/ocgAdapter/util.ts
src/api/ocgcore/ocgAdapter/util.ts
+0
-6
src/service/duel/attack.ts
src/service/duel/attack.ts
+2
-2
src/service/duel/move.ts
src/service/duel/move.ts
+7
-10
src/service/duel/selectEffectYn.ts
src/service/duel/selectEffectYn.ts
+1
-1
src/stores/cardStore.ts
src/stores/cardStore.ts
+1
-1
src/stores/matStore/methods/fetchHint.ts
src/stores/matStore/methods/fetchHint.ts
+1
-1
src/stores/methods/fetchCheckCardMeta.ts
src/stores/methods/fetchCheckCardMeta.ts
+1
-2
src/ui/Duel/Message/SelectActionsModal.tsx
src/ui/Duel/Message/SelectActionsModal.tsx
+1
-2
src/ui/Duel/PlayMat/Card/index.tsx
src/ui/Duel/PlayMat/Card/index.tsx
+1
-2
src/ui/Duel/PlayMat/Card/springs/moveToDeck.ts
src/ui/Duel/PlayMat/Card/springs/moveToDeck.ts
+1
-1
src/ui/Duel/PlayMat/Card/springs/moveToGround.ts
src/ui/Duel/PlayMat/Card/springs/moveToGround.ts
+1
-2
src/ui/Duel/PlayMat/Card/springs/moveToHand.ts
src/ui/Duel/PlayMat/Card/springs/moveToHand.ts
+1
-1
src/ui/Duel/PlayMat/Card/springs/moveToOutside.ts
src/ui/Duel/PlayMat/Card/springs/moveToOutside.ts
+1
-1
No files found.
src/api/ocgcore/ocgAdapter/bufferIO.ts
View file @
4eda5276
...
...
@@ -36,15 +36,17 @@ export class BufferReaderExt {
// 超量素材
return
new
ygopro
.
CardLocation
({
controler
,
location
:
ygopro
.
CardZone
.
OVERLAY
,
zone
:
numberToCardZone
(
location
)
,
sequence
,
is_overlay
:
true
,
overlay_sequence
:
ss
,
});
}
else
{
return
new
ygopro
.
CardLocation
({
controler
,
location
:
numberToCardZone
(
location
),
zone
:
numberToCardZone
(
location
),
sequence
,
is_overlay
:
false
,
position
:
numberToCardPosition
(
ss
),
});
}
...
...
@@ -57,7 +59,7 @@ export class BufferReaderExt {
return
new
ygopro
.
CardLocation
({
controler
,
location
:
numberToCardZone
(
location
),
zone
:
numberToCardZone
(
location
),
sequence
,
});
}
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/attack.ts
View file @
4eda5276
...
...
@@ -18,7 +18,7 @@ export default (data: Uint8Array) => {
if
(
target_location
.
controler
==
0
&&
target_location
.
location
==
0
&&
target_location
.
zone
==
0
&&
target_location
.
sequence
==
0
)
{
// 全零表示直接攻击玩家
...
...
src/api/ocgcore/ocgAdapter/util.ts
View file @
4eda5276
...
...
@@ -99,9 +99,6 @@ export function cardZoneToNumber(zone: ygopro.CardZone): number {
case
ygopro
.
CardZone
.
EXTRA
:
{
return
0x40
;
}
case
ygopro
.
CardZone
.
OVERLAY
:
{
return
0x80
;
}
case
ygopro
.
CardZone
.
ONFIELD
:
{
return
0x0c
;
}
...
...
@@ -142,9 +139,6 @@ export function numberToCardZone(
case
0x40
:
{
return
ygopro
.
CardZone
.
EXTRA
;
}
case
0x80
:
{
return
ygopro
.
CardZone
.
OVERLAY
;
}
case
0x0c
:
{
return
ygopro
.
CardZone
.
ONFIELD
;
}
...
...
src/service/duel/attack.ts
View file @
4eda5276
...
...
@@ -9,7 +9,7 @@ export default async (attack: ygopro.StocGameMessage.MsgAttack) => {
});
const
attacker
=
cardStore
.
at
(
attack
.
attacker_location
.
location
,
attack
.
attacker_location
.
zone
,
attack
.
attacker_location
.
controler
,
attack
.
attacker_location
.
sequence
);
...
...
@@ -22,7 +22,7 @@ export default async (attack: ygopro.StocGameMessage.MsgAttack) => {
attacker
.
directAttack
=
false
;
}
else
{
const
target
=
cardStore
.
at
(
attack
.
target_location
.
location
,
attack
.
target_location
.
zone
,
attack
.
target_location
.
controler
,
attack
.
target_location
.
sequence
);
...
...
src/service/duel/move.ts
View file @
4eda5276
...
...
@@ -5,8 +5,7 @@ import { cardStore, CardType } from "@/stores";
import
{
REASON_MATERIAL
}
from
"
../../common
"
;
type
MsgMove
=
ygopro
.
StocGameMessage
.
MsgMove
;
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
TZONE
,
OVERLAY
}
=
ygopro
.
CardZone
;
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
TZONE
}
=
ygopro
.
CardZone
;
const
overlayStack
:
CardType
[]
=
[];
...
...
@@ -18,16 +17,14 @@ export default async (move: MsgMove) => {
// FIXME: 考虑超量素材的情况
const
fromCards
=
cardStore
.
at
(
from
.
location
,
from
.
controler
);
const
toCards
=
cardStore
.
at
(
to
.
location
,
to
.
controler
);
const
fromCards
=
cardStore
.
at
(
from
.
zone
,
from
.
controler
);
const
toCards
=
cardStore
.
at
(
to
.
zone
,
to
.
controler
);
// TODO: 这段逻辑有点迷惑,后面问问作者
const
fromZone
=
move
.
from
.
toArray
().
at
(
1
)
===
undefined
?
ygopro
.
CardZone
.
TZONE
:
from
.
location
;
move
.
from
.
toArray
().
at
(
1
)
===
undefined
?
ygopro
.
CardZone
.
TZONE
:
from
.
zone
;
const
toZone
=
move
.
to
.
toArray
().
at
(
1
)
===
undefined
?
ygopro
.
CardZone
.
TZONE
:
to
.
location
;
move
.
to
.
toArray
().
at
(
1
)
===
undefined
?
ygopro
.
CardZone
.
TZONE
:
to
.
zone
;
// log出来看看,后期删掉即可
await
(
async
()
=>
{
...
...
@@ -44,7 +41,7 @@ export default async (move: MsgMove) => {
if
(
fromZone
===
TZONE
)
{
// 召唤 token
target
=
cardStore
.
at
(
TZONE
,
from
.
controler
)[
0
];
// 必有,随便取一个没用到的token
}
else
if
(
from
Zone
===
OVERLAY
)
{
}
else
if
(
from
.
is_overlay
)
{
// 超量素材的去除
const
xyzMonster
=
cardStore
.
at
(
MZONE
,
from
.
controler
,
from
.
sequence
);
if
(
xyzMonster
)
{
...
...
@@ -80,7 +77,7 @@ export default async (move: MsgMove) => {
}
// 超量
if
(
to
Zone
===
OVERLAY
)
{
if
(
to
.
is_overlay
)
{
// 准备超量召唤,超量素材入栈
if
(
reason
==
REASON_MATERIAL
)
overlayStack
.
push
(
target
);
// 超量素材的添加
...
...
src/service/duel/selectEffectYn.ts
View file @
4eda5276
...
...
@@ -19,7 +19,7 @@ export default async (selectEffectYn: MsgSelectEffectYn) => {
)
=>
{
const
desc1
=
desc
.
replace
(
`[%ls]`
,
fetchStrings
(
"
!system
"
,
cardLocation
.
location
+
1000
)
fetchStrings
(
"
!system
"
,
cardLocation
.
zone
+
1000
)
);
const
desc2
=
desc1
.
replace
(
`[%ls]`
,
cardMeta
.
text
.
name
||
"
[?]
"
);
return
desc2
;
...
...
src/stores/cardStore.ts
View file @
4eda5276
...
...
@@ -61,7 +61,7 @@ class CardStore {
}
}
find
(
location
:
ygopro
.
CardLocation
):
CardType
|
undefined
{
return
this
.
at
(
location
.
location
,
location
.
controler
,
location
.
sequence
);
return
this
.
at
(
location
.
zone
,
location
.
controler
,
location
.
sequence
);
}
async
setChaining
(
location
:
ygopro
.
CardLocation
,
...
...
src/stores/matStore/methods/fetchHint.ts
View file @
4eda5276
...
...
@@ -65,7 +65,7 @@ export const fetchEsHintMeta = async ({
if
(
location
)
{
const
fieldMeta
=
cardStore
.
at
(
location
.
location
,
location
.
zone
,
location
.
controler
,
location
.
sequence
);
...
...
src/stores/methods/fetchCheckCardMeta.ts
View file @
4eda5276
...
...
@@ -25,8 +25,7 @@ export const fetchCheckCardMeta = async (
const
newID
=
code
!=
0
?
code
:
cardStore
.
at
(
location
.
location
,
controller
,
location
.
sequence
)?.
code
||
0
;
:
cardStore
.
at
(
location
.
zone
,
controller
,
location
.
sequence
)?.
code
||
0
;
const
meta
=
await
fetchCard
(
newID
);
const
effectDesc
=
effectDescCode
...
...
src/ui/Duel/Message/SelectActionsModal.tsx
View file @
4eda5276
...
...
@@ -10,7 +10,6 @@ import {
fetchStrings
,
sendSelectMultiResponse
,
sendSelectSingleResponse
,
ygopro
,
}
from
"
@/api
"
;
import
{
useConfig
}
from
"
@/config
"
;
import
{
clearSelectActions
,
matStore
,
messageStore
}
from
"
@/stores
"
;
...
...
@@ -60,7 +59,7 @@ export const SelectActionsModal = () => {
?
response
.
length
==
1
:
response
.
length
>=
min
&&
response
.
length
<=
max
&&
levelMatched
;
const
grouped
=
groupBy
(
selectables
,
(
option
)
=>
option
.
location
?.
location
!
);
const
grouped
=
groupBy
(
selectables
,
(
option
)
=>
option
.
location
?.
zone
!
);
return
(
<>
...
...
src/ui/Duel/PlayMat/Card/index.tsx
View file @
4eda5276
...
...
@@ -21,7 +21,7 @@ import {
const
NeosConfig
=
useConfig
();
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
,
OVERLAY
}
=
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
}
=
ygopro
.
CardZone
;
export
const
Card
:
FC
<
{
idx
:
number
}
>
=
React
.
memo
(({
idx
})
=>
{
...
...
@@ -43,7 +43,6 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
switch
(
zone
)
{
case
MZONE
:
case
SZONE
:
case
OVERLAY
:
await
moveToGround
({
card
:
state
,
api
});
break
;
case
HAND
:
...
...
src/ui/Duel/PlayMat/Card/springs/moveToDeck.ts
View file @
4eda5276
...
...
@@ -24,7 +24,7 @@ const {
DECK_CARD_HEIGHT
,
}
=
matConfig
;
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
,
OVERLAY
}
=
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
}
=
ygopro
.
CardZone
;
export
const
moveToDeck
=
async
(
props
:
{
card
:
CardType
;
api
:
SpringApi
})
=>
{
...
...
src/ui/Duel/PlayMat/Card/springs/moveToGround.ts
View file @
4eda5276
...
...
@@ -23,7 +23,7 @@ const {
DECK_ROTATE_Z
,
}
=
matConfig
;
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
,
OVERLAY
}
=
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
}
=
ygopro
.
CardZone
;
export
const
moveToGround
=
async
(
props
:
{
...
...
@@ -67,7 +67,6 @@ export const moveToGround = async (props: {
}
break
;
}
case
OVERLAY
:
case
MZONE
:
{
if
(
sequence
>
4
)
{
// 额外怪兽区
...
...
src/ui/Duel/PlayMat/Card/springs/moveToHand.ts
View file @
4eda5276
...
...
@@ -23,7 +23,7 @@ const {
DECK_ROTATE_Z
,
}
=
matConfig
;
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
,
OVERLAY
}
=
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
}
=
ygopro
.
CardZone
;
export
const
moveToHand
=
async
(
props
:
{
card
:
CardType
;
api
:
SpringApi
})
=>
{
...
...
src/ui/Duel/PlayMat/Card/springs/moveToOutside.ts
View file @
4eda5276
...
...
@@ -23,7 +23,7 @@ const {
DECK_ROTATE_Z
,
}
=
matConfig
;
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
,
OVERLAY
}
=
const
{
HAND
,
GRAVE
,
REMOVED
,
DECK
,
EXTRA
,
MZONE
,
SZONE
,
TZONE
}
=
ygopro
.
CardZone
;
export
const
moveToOutside
=
async
(
props
:
{
...
...
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