diff --git a/server/gameserver/mt/Param.cc b/server/gameserver/mt/Param.cc index 66560606..2fa9b34b 100644 --- a/server/gameserver/mt/Param.cc +++ b/server/gameserver/mt/Param.cc @@ -76,6 +76,22 @@ namespace mt s_.crit_effect_range.push_back(a8::XValue(str).GetDouble()); } } + { + std::string tmp_str = GetStringParam("performance_score_weight_4V4", ""); + std::vector strings; + a8::Split(tmp_str, strings, '|'); + for (auto& str : strings) { + s_.performance_score_weight_4V4.push_back(a8::XValue(str).GetDouble()); + } + } + { + std::string tmp_str = GetStringParam("performance_score_weight_BR", ""); + std::vector strings; + a8::Split(tmp_str, strings, '|'); + for (auto& str : strings) { + s_.performance_score_weight_BR.push_back(a8::XValue(str).GetDouble()); + } + } { std::string tmp_str = GetStringParam("block_effect_range", ""); std::vector strings; diff --git a/server/gameserver/mt/Param.h b/server/gameserver/mt/Param.h index 1191859e..164f9160 100644 --- a/server/gameserver/mt/Param.h +++ b/server/gameserver/mt/Param.h @@ -32,6 +32,8 @@ namespace mt float max_mount_horse_distance = 100.0f; int early_parachute_jump = 0; int pickup_weapon_replace_type = 0; + std::vector performance_score_weight_4V4; + std::vector performance_score_weight_BR; int downed_relive_recover_hp = 0; diff --git a/server/gameserver/room.cc b/server/gameserver/room.cc index a65d342a..8130395f 100644 --- a/server/gameserver/room.cc +++ b/server/gameserver/room.cc @@ -4172,12 +4172,21 @@ void Room::CalcMvp() [this, &max_kill, &max_assist, &max_damage, &max_recover, &max_level, &max_alive] (Human* hum) mutable -> bool { + #if 1 + max_kill = std::max(max_kill, (float)hum->stats->kills); + max_assist = std::max(max_assist, (float)hum->stats->assist); + max_damage = std::max(max_damage, (float)hum->stats->damage_amount_out); + max_recover = std::max(max_recover, (float)hum->stats->heal_amount); + max_level = std::max(max_level, (float)hum->GetHeroLevel()); + max_alive = std::max(max_alive, (float)hum->stats->alive_time / 1000); + #else max_kill += hum->stats->kills; max_assist += hum->stats->assist; max_damage += hum->stats->damage_amount_out; max_recover += hum->stats->heal_amount; max_level += hum->GetHeroLevel(); max_alive += hum->stats->alive_time / 1000; + #endif return true; }); @@ -4193,46 +4202,78 @@ void Room::CalcMvp() kill_sco = (param1 - param0) / (max_kill - 0) * (kill - 0) + param0; } } - float assist_sco = 0.0f; + float assist_sco = param0; { if (max_assist > 0) { float assist = hum->stats->assist; assist_sco = (param1 - param0) / (max_assist - 0) * (assist - 0) + param0; } } - float damage_sco = 0.0f; + float damage_sco = param0; { if (max_damage > 0) { float damage = hum->stats->damage_amount_out; damage_sco = (param1 - param0) / (max_damage - 0) * (damage - 0) + param0; } } - float recover_sco = 0.0f; + float recover_sco = param0; { if (max_recover > 0) { float recover = hum->stats->heal_amount; recover_sco = (param1 - param0) / (max_recover - 0) * (recover - 0) + param0; } } - float level_sco = 0.0f; + float level_sco = param0; { if (max_level > 1.00000) { float level = hum->GetHeroLevel(); level_sco = (param1 - param0) / (max_level - 0) * (level - 0) + param0; } } - float alive_sco = 0.0f; + float alive_sco = param0; { if (max_alive > 0) { float alive = hum->stats->alive_time / 1000; alive_sco = (param1 - param0) / (max_alive - 0) * (alive - 0) + param0; } } +#ifdef MYDEBUG + if (hum->IsPlayer()) { + a8::XPrintf("kill_sco:%f assist_sco:%f damage_sco:%f recover_sco:%f alive_sco:%f" + "assist:%f max_assist:%f damage:%f max_damage:%f recover:%f max_recover:%f\n", + { + kill_sco, + assist_sco, + damage_sco, + recover_sco, + alive_sco, + hum->stats->assist, + max_assist, + hum->stats->damage_amount_out, + max_damage, + hum->stats->heal_amount, + max_recover, + }); + } +#endif float battle_score = 0.0f; if (IsMobaModeRoom()) { + if (mt::Param::s().performance_score_weight_4V4.size() >= 5) { + kill_sco *= mt::Param::s().performance_score_weight_4V4.at(0); + assist_sco *= mt::Param::s().performance_score_weight_4V4.at(1); + damage_sco *= mt::Param::s().performance_score_weight_4V4.at(2); + recover_sco *= mt::Param::s().performance_score_weight_4V4.at(3); + level_sco *= mt::Param::s().performance_score_weight_4V4.at(4); + } battle_score = std::round((kill_sco + assist_sco + damage_sco + recover_sco + level_sco) * 100.0f) / 100.0f; - } else { + if (mt::Param::s().performance_score_weight_BR.size() >= 5) { + kill_sco *= mt::Param::s().performance_score_weight_BR.at(0); + assist_sco *= mt::Param::s().performance_score_weight_BR.at(1); + damage_sco *= mt::Param::s().performance_score_weight_BR.at(2); + recover_sco *= mt::Param::s().performance_score_weight_BR.at(3); + alive_sco *= mt::Param::s().performance_score_weight_BR.at(4); + } battle_score = std::round((kill_sco + assist_sco + damage_sco + recover_sco + alive_sco) * 100.0f) / 100.0f; } hum->stats->battle_score = battle_score;