Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tx3-bang-reader
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
nanahira
tx3-bang-reader
Commits
39d8ef33
Commit
39d8ef33
authored
Jul 01, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments
parent
c3b9cca7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
src/user.ts
src/user.ts
+4
-4
tests/test.ts
tests/test.ts
+3
-1
No files found.
src/user.ts
View file @
39d8ef33
...
@@ -72,7 +72,7 @@ function getNumber(node: HTML.Node) {
...
@@ -72,7 +72,7 @@ function getNumber(node: HTML.Node) {
}
else
if
(
stringMatch
=
numberStr
.
match
(
/^
([
天地
])
魂$/
))
{
}
else
if
(
stringMatch
=
numberStr
.
match
(
/^
([
天地
])
魂$/
))
{
return
stringMatch
[
1
]
===
"
天
"
?
2
:
1
;
return
stringMatch
[
1
]
===
"
天
"
?
2
:
1
;
}
else
if
(
stringMatch
=
numberStr
.
match
(
/^
(
.+
)
天
(
.+
)
境界$/
))
{
}
else
if
(
stringMatch
=
numberStr
.
match
(
/^
(
.+
)
天
(
.+
)
境界$/
))
{
return
(
_
.
findIndex
(
chineseCapitalNumbers
,
(
m
)
=>
m
===
stringMatch
[
1
])
<<
4
)
|
_
.
findIndex
(
chineseCapitalNumbers
,
(
m
)
=>
m
===
stringMatch
[
2
]);
return
(
_
.
findIndex
(
chineseCapitalNumbers
,
(
m
)
=>
m
===
stringMatch
[
1
])
<<
8
)
|
_
.
findIndex
(
chineseCapitalNumbers
,
(
m
)
=>
m
===
stringMatch
[
2
]);
}
else
if
(
stringMatch
=
numberStr
.
match
(
/^
(\d
+
)
-
(\d
+
)
$/
))
{
}
else
if
(
stringMatch
=
numberStr
.
match
(
/^
(\d
+
)
-
(\d
+
)
$/
))
{
const
minValue
=
parseInt
(
stringMatch
[
1
]);
const
minValue
=
parseInt
(
stringMatch
[
1
]);
const
maxValue
=
parseInt
(
stringMatch
[
2
]);
const
maxValue
=
parseInt
(
stringMatch
[
2
]);
...
@@ -83,7 +83,7 @@ function getNumber(node: HTML.Node) {
...
@@ -83,7 +83,7 @@ function getNumber(node: HTML.Node) {
}
}
interface
AttackAttribute
{
interface
AttackAttribute
{
'
攻力
'
:
number
,
'
攻力
'
:
number
,
//大攻取前2字节int16,小攻取后2字节int16,法力也是这样
'
命中
'
:
number
,
'
命中
'
:
number
,
'
法力
'
:
number
,
'
法力
'
:
number
,
'
重击
'
:
number
,
'
重击
'
:
number
,
...
@@ -128,8 +128,8 @@ export class User {
...
@@ -128,8 +128,8 @@ export class User {
scoreRank
:
number
scoreRank
:
number
scoreLocalRank
:
number
;
scoreLocalRank
:
number
;
scoreCategoryRank
:
number
;
scoreCategoryRank
:
number
;
sqStage
:
number
;
sqStage
:
number
;
// 天魂:2,地魂:1,没有神启:null
sqLevel
:
number
;
sqLevel
:
number
;
// 前4位是几境界,后四位是几天
qhLevel
:
number
;
qhLevel
:
number
;
tlPoints
:
number
;
tlPoints
:
number
;
hp
:
number
;
hp
:
number
;
...
...
tests/test.ts
View file @
39d8ef33
...
@@ -2,7 +2,9 @@ import { User } from "../src/user";
...
@@ -2,7 +2,9 @@ import { User } from "../src/user";
import
fs
from
"
fs
"
;
import
fs
from
"
fs
"
;
async
function
main
()
{
async
function
main
()
{
cons
t
html
=
await
fs
.
promises
.
readFile
(
"
./tests/28_20588.html
"
,
"
utf-8
"
);
le
t
html
=
await
fs
.
promises
.
readFile
(
"
./tests/28_20588.html
"
,
"
utf-8
"
);
console
.
log
(
new
User
(
"
28_20588
"
,
html
));
console
.
log
(
new
User
(
"
28_20588
"
,
html
));
html
=
await
fs
.
promises
.
readFile
(
"
./tests/60_46782.html
"
,
"
utf-8
"
);
console
.
log
(
new
User
(
"
60_46782
"
,
html
));
}
}
main
();
main
();
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