fix(cw): award Rank SSS at 100 HP, map role damage and equipment in settlement, and fix overworld black screen
This commit is contained in:
1 parent
0995055296
commit
276cb14299
3 files changed
+82
-33
No files matched your search
@@ -82,7 +82,10 @@ func currencyWarsTerminalSettlement(catalog *common.CurrencyWarsCatalog, data *p
|
||||
if isWon && player.PPKKHHNEOHB > 0 && player.GridFightLineupHp > 0 {
|
||||
hpPercent := float64(player.GridFightLineupHp) / float64(player.PPKKHHNEOHB) * 100.0
|
||||
if hpPercent >= 100.0 || player.GridFightLineupHp >= player.PPKKHHNEOHB {
|
||||
rankType = 4 // Rank SS (flawless / 100% HP)
|
||||
rankType = 5 // Rank SSS (flawless / 100% HP)
|
||||
divisionUp = 3
|
||||
} else if hpPercent >= 90.0 {
|
||||
rankType = 4 // Rank SS
|
||||
divisionUp = 3
|
||||
} else if hpPercent >= 70.0 {
|
||||
rankType = 3 // Rank S
|
||||
@@ -95,7 +98,7 @@ func currencyWarsTerminalSettlement(catalog *common.CurrencyWarsCatalog, data *p
|
||||
divisionUp = 1
|
||||
}
|
||||
} else {
|
||||
rankType = 0
|
||||
rankType = 0 // Rank C (defeat / 0 HP)
|
||||
divisionUp = 0
|
||||
}
|
||||
|
||||
|
||||
@@ -418,21 +418,48 @@ func finishCurrencyWarsBattle(s *Session, req *pb.PVEBattleResultCsReq, current
|
||||
}
|
||||
for _, role := range current.EIGMKOJOEEI.GridGameRoleList {
|
||||
total := float64(0)
|
||||
specialID := uint32(0)
|
||||
if config, err := catalog.CapturedRoleVariant(role.RoleId, role.RoleStar); err == nil {
|
||||
specialID = config.Config.SpecialAvatarID
|
||||
}
|
||||
if specialID == 0 {
|
||||
specialID = 3700000 + role.AvatarId
|
||||
}
|
||||
|
||||
matchRole := func(id uint32) bool {
|
||||
return id == role.RoleId || id == role.AvatarId || id == role.UniqueId || id == specialID ||
|
||||
(id > 3700000 && id-3700000 == role.AvatarId)
|
||||
}
|
||||
|
||||
if req.Stt != nil && req.Stt.APAGMJNECCN != nil {
|
||||
for _, stat := range req.Stt.APAGMJNECCN.DOGMMGLBJIJ {
|
||||
if (stat.RoleId == role.RoleId || stat.RoleId == role.AvatarId || stat.RoleId == role.UniqueId) && !math.IsNaN(stat.Damage) && !math.IsInf(stat.Damage, 0) && stat.Damage > 0 {
|
||||
if matchRole(stat.RoleId) && !math.IsNaN(stat.Damage) && !math.IsInf(stat.Damage, 0) && stat.Damage > 0 {
|
||||
total += stat.Damage
|
||||
}
|
||||
}
|
||||
}
|
||||
if total == 0 && req.Stt != nil {
|
||||
for _, ba := range req.Stt.BattleAvatarList {
|
||||
if (ba.Id == role.AvatarId || ba.Id == role.RoleId) && !math.IsNaN(ba.TotalDamage) && !math.IsInf(ba.TotalDamage, 0) && ba.TotalDamage > 0 {
|
||||
if matchRole(ba.Id) && !math.IsNaN(ba.TotalDamage) && !math.IsInf(ba.TotalDamage, 0) && ba.TotalDamage > 0 {
|
||||
total += ba.TotalDamage
|
||||
}
|
||||
}
|
||||
}
|
||||
damage.EEGPILJDLBG = append(damage.EEGPILJDLBG, &pb.PLFKMENCDMM{RoleId: role.RoleId, RoleStar: role.RoleStar, TotalDamage: total, DIGNECHKINI: uint64(role.Pos) > uint64(frontMax)})
|
||||
|
||||
var eqList []uint32
|
||||
for _, eq := range role.CNIJIJMEPEF {
|
||||
if eq != nil && eq.GridFightEquipmentId != 0 {
|
||||
eqList = append(eqList, eq.GridFightEquipmentId)
|
||||
}
|
||||
}
|
||||
|
||||
damage.EEGPILJDLBG = append(damage.EEGPILJDLBG, &pb.PLFKMENCDMM{
|
||||
RoleId: role.RoleId,
|
||||
RoleStar: role.RoleStar,
|
||||
TotalDamage: total,
|
||||
DIGNECHKINI: uint64(role.Pos) > uint64(frontMax),
|
||||
GridFightEquipmentList: eqList,
|
||||
})
|
||||
}
|
||||
oldChapter, oldSection := stage.DCAHJELNJNP, stage.SectionId
|
||||
var nextNotify *pb.GridFightSyncUpdateResultScNotify
|
||||
|
||||
Reference in new issue
Block a user