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
f3411376
Commit
f3411376
authored
Jun 11, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize attack
parent
720e5e8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
src/ui/Duel/PlayMat/Card/springs/attack.ts
src/ui/Duel/PlayMat/Card/springs/attack.ts
+6
-4
No files found.
src/ui/Duel/PlayMat/Card/springs/attack.ts
View file @
f3411376
...
@@ -22,6 +22,7 @@ export const attack = async (props: {
...
@@ -22,6 +22,7 @@ export const attack = async (props: {
let
x
=
current
.
x
;
let
x
=
current
.
x
;
let
y
=
current
.
y
;
let
y
=
current
.
y
;
let
rz
=
current
.
rz
;
if
(
directAttack
)
{
if
(
directAttack
)
{
// 直接攻击
// 直接攻击
y
=
BLOCK_HEIGHT_M
.
value
+
BLOCK_HEIGHT_S
.
value
;
y
=
BLOCK_HEIGHT_M
.
value
+
BLOCK_HEIGHT_S
.
value
;
...
@@ -41,13 +42,12 @@ export const attack = async (props: {
...
@@ -41,13 +42,12 @@ export const attack = async (props: {
y
=
BLOCK_HEIGHT_M
.
value
+
ROW_GAP
.
value
;
y
=
BLOCK_HEIGHT_M
.
value
+
ROW_GAP
.
value
;
}
}
// 往下偏移半个卡位
y
-=
BLOCK_HEIGHT_M
.
value
/
2
;
if
(
!
isMe
(
controller
))
{
if
(
!
isMe
(
controller
))
{
x
=
-
x
;
x
=
-
x
;
y
=
-
y
;
y
=
-
y
;
}
}
rz
+=
-
Math
.
atan
((
x
-
current
.
x
)
/
(
y
-
current
.
y
))
/
(
Math
.
PI
/
180
);
}
else
{
}
else
{
console
.
error
(
`<Spring/Attack>directAttack is false and target is null.`
);
console
.
error
(
`<Spring/Attack>directAttack is false and target is null.`
);
return
;
return
;
...
@@ -57,11 +57,12 @@ export const attack = async (props: {
...
@@ -57,11 +57,12 @@ export const attack = async (props: {
await
asyncStart
(
api
)({
await
asyncStart
(
api
)({
z
:
200
,
z
:
200
,
});
});
// 后撤半个卡位
// 后撤半个卡位
,并调整倾斜角
await
asyncStart
(
api
)({
await
asyncStart
(
api
)({
y
:
y
:
current
.
y
+
current
.
y
+
(
BLOCK_HEIGHT_M
.
value
/
2
)
*
(
isMe
(
card
.
location
.
controller
)
?
1
:
-
1
),
(
BLOCK_HEIGHT_M
.
value
/
2
)
*
(
isMe
(
card
.
location
.
controller
)
?
1
:
-
1
),
rz
,
});
});
// 加速前冲
// 加速前冲
await
asyncStart
(
api
)({
await
asyncStart
(
api
)({
...
@@ -76,6 +77,7 @@ export const attack = async (props: {
...
@@ -76,6 +77,7 @@ export const attack = async (props: {
x
:
current
.
x
,
x
:
current
.
x
,
y
:
current
.
y
,
y
:
current
.
y
,
z
:
current
.
z
,
z
:
current
.
z
,
rz
:
current
.
rz
,
config
:
{
config
:
{
easing
:
easings
.
easeInOutQuad
,
easing
:
easings
.
easeInOutQuad
,
},
},
...
...
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