Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
srvpro
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
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
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
srvpro
Commits
c2e7bd78
Commit
c2e7bd78
authored
Nov 16, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
missing js
parent
74225e9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
72 additions
and
0 deletions
+72
-0
data-manager/entities/RandomDuelScore.js
data-manager/entities/RandomDuelScore.js
+72
-0
No files found.
data-manager/entities/RandomDuelScore.js
0 → 100644
View file @
c2e7bd78
"
use strict
"
;
var
__decorate
=
(
this
&&
this
.
__decorate
)
||
function
(
decorators
,
target
,
key
,
desc
)
{
var
c
=
arguments
.
length
,
r
=
c
<
3
?
target
:
desc
===
null
?
desc
=
Object
.
getOwnPropertyDescriptor
(
target
,
key
)
:
desc
,
d
;
if
(
typeof
Reflect
===
"
object
"
&&
typeof
Reflect
.
decorate
===
"
function
"
)
r
=
Reflect
.
decorate
(
decorators
,
target
,
key
,
desc
);
else
for
(
var
i
=
decorators
.
length
-
1
;
i
>=
0
;
i
--
)
if
(
d
=
decorators
[
i
])
r
=
(
c
<
3
?
d
(
r
)
:
c
>
3
?
d
(
target
,
key
,
r
)
:
d
(
target
,
key
))
||
r
;
return
c
>
3
&&
r
&&
Object
.
defineProperty
(
target
,
key
,
r
),
r
;
};
var
__metadata
=
(
this
&&
this
.
__metadata
)
||
function
(
k
,
v
)
{
if
(
typeof
Reflect
===
"
object
"
&&
typeof
Reflect
.
metadata
===
"
function
"
)
return
Reflect
.
metadata
(
k
,
v
);
};
Object
.
defineProperty
(
exports
,
"
__esModule
"
,
{
value
:
true
});
exports
.
RandomDuelScore
=
void
0
;
const
typeorm_1
=
require
(
"
typeorm
"
);
let
RandomDuelScore
=
class
RandomDuelScore
{
getDisplayName
()
{
return
this
.
name
.
split
(
"
$
"
)[
0
];
}
win
()
{
++
this
.
winCount
;
++
this
.
winCombo
;
}
lose
()
{
++
this
.
loseCount
;
this
.
winCombo
=
0
;
}
flee
()
{
++
this
.
fleeCount
;
this
.
lose
();
}
getScoreText
()
{
const
displayName
=
this
.
getDisplayName
();
const
total
=
this
.
winCount
+
this
.
loseCount
;
if
(
this
.
winCount
<
2
&&
total
<
3
)
{
return
`
${
displayName
}
\${random_this_not_enough}`
;
}
if
(
this
.
winCombo
>=
2
)
{
return
`\${random_this_part1}
${
displayName
}
\${random_this_part2}
${
Math
.
ceil
(
this
.
winCount
/
total
*
100
)}
\${random_this_part3}
${
Math
.
ceil
(
this
.
fleeCount
/
total
*
100
)}
\${random_this_part4_combo}
${
this
.
winCombo
}
\${random_this_part5_combo}`
;
}
else
{
//return displayName + " 的今日战绩:胜率" + Math.ceil(this.winCount/total*100) + "%,逃跑率" + Math.ceil(this.fleeCount/total*100) + "%," + this.winCombo + "连胜中!"
return
`\${random_this_part1}
${
displayName
}
\${random_this_part2}
${
Math
.
ceil
(
this
.
winCount
/
total
*
100
)}
\${random_this_part3}
${
Math
.
ceil
(
this
.
fleeCount
/
total
*
100
)}
\${random_this_part4}`
;
}
}
};
__decorate
([
typeorm_1
.
PrimaryColumn
({
type
:
"
varchar
"
,
length
:
20
}),
__metadata
(
"
design:type
"
,
String
)
],
RandomDuelScore
.
prototype
,
"
name
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelScore
.
prototype
,
"
winCount
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelScore
.
prototype
,
"
loseCount
"
,
void
0
);
__decorate
([
typeorm_1
.
Index
(),
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelScore
.
prototype
,
"
fleeCount
"
,
void
0
);
__decorate
([
typeorm_1
.
Column
(
"
int
"
,
{
unsigned
:
true
,
default
:
0
}),
__metadata
(
"
design:type
"
,
Number
)
],
RandomDuelScore
.
prototype
,
"
winCombo
"
,
void
0
);
RandomDuelScore
=
__decorate
([
typeorm_1
.
Entity
()
],
RandomDuelScore
);
exports
.
RandomDuelScore
=
RandomDuelScore
;
//# sourceMappingURL=RandomDuelScore.js.map
\ No newline at end of file
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