Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
NPM
game_bahuang_team_client
Commits
221fdc75
Commit
221fdc75
authored
2 months ago
by
ranxiaoping
Browse files
Options
Download
Email Patches
Plain Diff
改为队伍第一个伙伴
parent
c5e0ca02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/team.ts
+4
-8
src/team.ts
with
4 additions
and
8 deletions
+4
-8
src/team.ts
+
4
-
8
View file @
221fdc75
...
...
@@ -132,7 +132,7 @@ export const getAllTeamState = async()=>{
let
_info
=
dbInfo
.
teamMap
.
get
(
no
);
if
(
_info
){
msg
.
state
=
_info
.
state
;}
//显示队伍中战斗力最高伙伴名字、头像。
const
partnerId
:
number
=
await
get
MaxPower
PartnerId
(
team
);
const
partnerId
:
number
=
await
get
First
PartnerId
(
team
);
let
cfg
=
getPartnerInfo
({
id
:
partnerId
});
msg
.
name
=
cfg
.
name
;
msg
.
icon
=
cfg
.
icon
;
...
...
@@ -198,14 +198,10 @@ const getTeamPartnerIdList = (team:any[])=>{
return
heroIdArr
;
}
//获取队伍中战力最高的伙伴配置id
const
getMaxPowerPartnerId
=
async
(
team
:
any
[])
=>
{
let
partnerList
:
number
[]
=
getTeamPartnerIdList
(
team
);
//显示队伍中战斗力最高伙伴名字、头像。
let
herosPowerList
=
await
clientRpc
(
getHerosPower
.
_$topic
,
partnerList
);
const
heroId
=
partnerList
[
herosPowerList
.
indexOf
(
Math
.
max
(...
herosPowerList
))];
//获取队伍中第一个伙伴配置id
const
getFirstPartnerId
=
async
(
team
:
any
[])
=>
{
for
(
let
value
of
team
)
{
if
(
value
.
heroId
===
heroId
)
{
if
(
value
.
heroId
>
0
)
{
return
value
.
heroTid
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help