1
This commit is contained in:
commit
cb198702a1
@ -10,6 +10,7 @@
|
||||
#include "tracemgr.h"
|
||||
|
||||
#include "mt/Map.h"
|
||||
#include "mt/MapMode.h"
|
||||
|
||||
Position BornPoint::RandPoint(Room* room) const
|
||||
{
|
||||
@ -43,9 +44,13 @@ Position BornPoint::RandPoint(Room* room) const
|
||||
return pos;
|
||||
}
|
||||
|
||||
int BornPoint::GetNum()
|
||||
int BornPoint::GetNum(Room* room)
|
||||
{
|
||||
return 4;
|
||||
if (room->GetMapModeMeta()->mapMode() == mt::kCircuitMatchMode) {
|
||||
return 1;
|
||||
} else {
|
||||
return 4;
|
||||
}
|
||||
}
|
||||
|
||||
Position BornPoint::GetSrcPoint(Room* room) const
|
||||
|
@ -13,7 +13,7 @@ struct BornPoint
|
||||
std::shared_ptr<mt::WorldObject> wo_meta;
|
||||
int side = 0;
|
||||
|
||||
int GetNum();
|
||||
int GetNum(Room* room);
|
||||
Position RandPoint(Room* room) const;
|
||||
Position GetSrcPoint(Room* room) const;
|
||||
Position NewRandPoint(Room* room, int min_radius, int max_radius) const;
|
||||
|
14
server/gameserver/mt/CircuitTime.cc
Normal file
14
server/gameserver/mt/CircuitTime.cc
Normal file
@ -0,0 +1,14 @@
|
||||
#include "precompile.h"
|
||||
|
||||
#include "mt/CircuitTime.h"
|
||||
|
||||
IMPL_TABLE(mt::CircuitTime)
|
||||
|
||||
namespace mt
|
||||
{
|
||||
|
||||
void CircuitTime::Init1()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
21
server/gameserver/mt/CircuitTime.h
Normal file
21
server/gameserver/mt/CircuitTime.h
Normal file
@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include "mt/macro.h"
|
||||
#include "mtb/CircuitTime.h"
|
||||
|
||||
namespace mt
|
||||
{
|
||||
|
||||
DECLARE_ID_TABLE(CircuitTime, mtb::CircuitTime,
|
||||
"CircuitTime@CircuitTime.json",
|
||||
"id")
|
||||
public:
|
||||
|
||||
void Init1();
|
||||
|
||||
private:
|
||||
int _start_time = 0;
|
||||
int _end_time = 0;
|
||||
};
|
||||
|
||||
}
|
@ -10,6 +10,11 @@ namespace mt
|
||||
|
||||
void MapMode::Init1()
|
||||
{
|
||||
#ifdef MYDEBUG
|
||||
if (mapMode() == 201) {
|
||||
mapMode_ = kCircuitMatchMode;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool MapMode::IsOpen() const
|
||||
|
@ -7,6 +7,7 @@ namespace mt
|
||||
{
|
||||
const int kPvpRankMode = 401;
|
||||
const int kTreasureBoxMode = 501;
|
||||
const int kCircuitMatchMode = 601;
|
||||
|
||||
DECLARE_ID_TABLE(MapMode, mtb::MapMode,
|
||||
"mapMode@mapMode.json",
|
||||
|
@ -48,6 +48,7 @@
|
||||
#include "mt/MobaRoom.h"
|
||||
#include "mt/InGameVoice.h"
|
||||
#include "mt/MapMode.h"
|
||||
#include "mt/CircuitTime.h"
|
||||
|
||||
#include "app.h"
|
||||
|
||||
@ -123,6 +124,7 @@ namespace mt
|
||||
RegMetaTable<BattleHeroGrow>(res_path_);
|
||||
RegMetaTable<InGameVoice>(res_path_);
|
||||
RegMetaTable<MapMode>(res_path_);
|
||||
RegMetaTable<CircuitTime>(res_path_);
|
||||
}
|
||||
|
||||
void MetaMgr::Load()
|
||||
|
@ -92,6 +92,14 @@ namespace mt
|
||||
s_.performance_score_weight_BR.push_back(a8::XValue(str).GetDouble());
|
||||
}
|
||||
}
|
||||
{
|
||||
std::string tmp_str = GetStringParam("performance_score_weight_circuit", "");
|
||||
std::vector<std::string> strings;
|
||||
a8::Split(tmp_str, strings, '|');
|
||||
for (auto& str : strings) {
|
||||
s_.performance_score_weight_circuit.push_back(a8::XValue(str).GetDouble());
|
||||
}
|
||||
}
|
||||
{
|
||||
std::string tmp_str = GetStringParam("block_effect_range", "");
|
||||
std::vector<std::string> strings;
|
||||
@ -132,6 +140,10 @@ namespace mt
|
||||
s_.battle_hint_view_range = GetIntParam("battle_hint_view_range", s_.battle_hint_view_range);
|
||||
s_.battle_hint_broadcast_range = GetIntParam("battle_hint_broadcast_range", s_.battle_hint_broadcast_range + 800);
|
||||
|
||||
s_.circuit_score_mult_constant = GetIntParam("circuit_score_mult_constant", s_.circuit_score_mult_constant);
|
||||
s_.circuit_score_shift_constant = GetIntParam("circuit_score_shift_constant", s_.circuit_score_shift_constant);
|
||||
s_.circuit_battle_cooldown = GetIntParam("circuit_battle_cooldown", s_.circuit_battle_cooldown);
|
||||
s_.circuit_rank_score_min = GetIntParam("circuit_rank_score_min", s_.circuit_rank_score_min);
|
||||
#ifdef MYDEBUG
|
||||
s_.match_team_time = 6;
|
||||
s_.match_robot_time = 5;
|
||||
|
@ -34,6 +34,11 @@ namespace mt
|
||||
int pickup_weapon_replace_type = 0;
|
||||
std::vector<float> performance_score_weight_4V4;
|
||||
std::vector<float> performance_score_weight_BR;
|
||||
std::vector<float> performance_score_weight_circuit;
|
||||
float circuit_score_mult_constant = 0.0f;
|
||||
float circuit_score_shift_constant = 0.0f;
|
||||
float circuit_battle_cooldown = 0.0f;
|
||||
float circuit_rank_score_min = 0.0f;
|
||||
|
||||
int downed_relive_recover_hp = 0;
|
||||
|
||||
|
40
server/gameserver/mtb/CircuitTime.h
Normal file
40
server/gameserver/mtb/CircuitTime.h
Normal file
@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <bitset>
|
||||
|
||||
namespace mtb
|
||||
{
|
||||
|
||||
class CircuitTime
|
||||
{
|
||||
public:
|
||||
|
||||
std::shared_ptr<a8::reflect::Class> GetClass() const;
|
||||
int id() const { return id_; };
|
||||
int circuit_season() const { return circuit_season_; };
|
||||
int circuit_time_type() const { return circuit_time_type_; };
|
||||
const std::string start_time() const { return start_time_; };
|
||||
const std::string end_time() const { return end_time_; };
|
||||
int cec_pool() const { return cec_pool_; };
|
||||
|
||||
bool has_id() const { return __flags__.test(0);};
|
||||
bool has_circuit_season() const { return __flags__.test(1);};
|
||||
bool has_circuit_time_type() const { return __flags__.test(2);};
|
||||
bool has_start_time() const { return __flags__.test(3);};
|
||||
bool has_end_time() const { return __flags__.test(4);};
|
||||
bool has_cec_pool() const { return __flags__.test(5);};
|
||||
|
||||
protected:
|
||||
|
||||
int id_ = 0;
|
||||
int circuit_season_ = 0;
|
||||
int circuit_time_type_ = 0;
|
||||
std::string start_time_;
|
||||
std::string end_time_;
|
||||
int cec_pool_ = 0;
|
||||
|
||||
public:
|
||||
std::bitset<6> __flags__;
|
||||
};
|
||||
|
||||
};
|
@ -49,6 +49,7 @@
|
||||
#include "mtb/Distribution.h"
|
||||
#include "mtb/LootConfig.h"
|
||||
#include "mtb/BattleHeroGrow.h"
|
||||
#include "mtb/CircuitTime.h"
|
||||
|
||||
namespace mtb
|
||||
{
|
||||
@ -1041,4 +1042,19 @@ namespace mtb
|
||||
return meta_class;
|
||||
}
|
||||
|
||||
std::shared_ptr<a8::reflect::Class> CircuitTime::GetClass() const
|
||||
{
|
||||
std::shared_ptr<a8::reflect::Class> meta_class = nullptr;
|
||||
if (!meta_class) {
|
||||
meta_class = std::make_shared<a8::reflect::Class>("CircuitTime", 6, 0);
|
||||
meta_class->SetSimpleField(0, "id", a8::reflect::ET_INT32, my_offsetof2(CircuitTime, id_));
|
||||
meta_class->SetSimpleField(1, "circuit_season", a8::reflect::ET_INT32, my_offsetof2(CircuitTime, circuit_season_));
|
||||
meta_class->SetSimpleField(2, "circuit_time_type", a8::reflect::ET_INT32, my_offsetof2(CircuitTime, circuit_time_type_));
|
||||
meta_class->SetSimpleField(3, "start_time", a8::reflect::ET_STRING, my_offsetof2(CircuitTime, start_time_));
|
||||
meta_class->SetSimpleField(4, "end_time", a8::reflect::ET_STRING, my_offsetof2(CircuitTime, end_time_));
|
||||
meta_class->SetSimpleField(5, "cec_pool", a8::reflect::ET_INT32, my_offsetof2(CircuitTime, cec_pool_));
|
||||
}
|
||||
return meta_class;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -540,10 +540,14 @@ void Room::CreateAndroid(int robot_num, std::shared_ptr<Team> team)
|
||||
hum->Initialize();
|
||||
AddToEntityHash(hum);
|
||||
AddToHumanHash(hum);
|
||||
if (team) {
|
||||
team->AddMember(hum);
|
||||
} else {
|
||||
if (GetMapModeMeta()->mapMode() != mt::kCircuitMatchMode) {
|
||||
MatchTeam(hum);
|
||||
} else {
|
||||
if (team) {
|
||||
team->AddMember(hum);
|
||||
} else {
|
||||
MatchTeam(hum);
|
||||
}
|
||||
}
|
||||
if (!hum->IsOb()) {
|
||||
IncAliveCount();
|
||||
@ -597,10 +601,14 @@ Human* Room::CreateAndroidWithCustomMember(std::shared_ptr<CustomMember> custom_
|
||||
hum->Initialize();
|
||||
AddToEntityHash(hum);
|
||||
AddToHumanHash(hum);
|
||||
if (team) {
|
||||
team->AddMember(hum);
|
||||
} else {
|
||||
if (GetMapModeMeta()->mapMode() != mt::kCircuitMatchMode) {
|
||||
MatchTeam(hum);
|
||||
} else {
|
||||
if (team) {
|
||||
team->AddMember(hum);
|
||||
} else {
|
||||
MatchTeam(hum);
|
||||
}
|
||||
}
|
||||
if (!hum->IsOb()) {
|
||||
IncAliveCount();
|
||||
@ -1854,7 +1862,8 @@ bool Room::GenSmallCircle()
|
||||
|
||||
void Room::MatchTeam(Human* hum)
|
||||
{
|
||||
if (!hum->team_uuid.empty()) {
|
||||
if (!hum->team_uuid.empty() &&
|
||||
GetMapModeMeta()->mapMode() != mt::kCircuitMatchMode) {
|
||||
{
|
||||
bool match_ok = false;
|
||||
TraverseHumanList
|
||||
@ -2082,6 +2091,9 @@ void Room::CombineTeam()
|
||||
|
||||
void Room::FillTeam()
|
||||
{
|
||||
if (GetMapModeMeta()->mapMode() == mt::kCircuitMatchMode) {
|
||||
return;
|
||||
}
|
||||
std::vector<std::shared_ptr<Team>> free_team_list;
|
||||
TraverseTeams
|
||||
(
|
||||
@ -2474,7 +2486,7 @@ std::shared_ptr<BornPoint> Room::AllocBornPoint(Human* hum)
|
||||
for (auto& pair : born_point_hash_) {
|
||||
if (pair.second != hum->GetBornPoint()) {
|
||||
if (pair.second->player_num + pair.second->android_num <
|
||||
pair.second->GetNum()) {
|
||||
pair.second->GetNum(this)) {
|
||||
point_list.push_back(pair.second);
|
||||
free_point_list.push_back(pair.second);;
|
||||
}
|
||||
@ -2504,7 +2516,7 @@ std::shared_ptr<BornPoint> Room::AllocBornPoint(Human* hum)
|
||||
std::vector<std::shared_ptr<BornPoint>> free_point_list;
|
||||
for (auto& pair : born_point_hash_) {
|
||||
if (pair.second->player_num + pair.second->android_num <
|
||||
pair.second->GetNum()) {
|
||||
pair.second->GetNum(this)) {
|
||||
free_point_list.push_back(pair.second);
|
||||
}
|
||||
}
|
||||
@ -4275,12 +4287,22 @@ void Room::CalcMvp()
|
||||
}
|
||||
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);
|
||||
if (GetMapModeMeta()->mapMode() == mt::kCircuitMatchMode) {
|
||||
if (mt::Param::s().performance_score_weight_circuit.size() >= 5) {
|
||||
kill_sco *= mt::Param::s().performance_score_weight_circuit.at(0);
|
||||
assist_sco *= mt::Param::s().performance_score_weight_circuit.at(1);
|
||||
damage_sco *= mt::Param::s().performance_score_weight_circuit.at(2);
|
||||
recover_sco *= mt::Param::s().performance_score_weight_circuit.at(3);
|
||||
alive_sco *= mt::Param::s().performance_score_weight_circuit.at(4);
|
||||
}
|
||||
} 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;
|
||||
}
|
||||
|
@ -88,6 +88,10 @@ bool Team::HasAliveMember()
|
||||
|
||||
void Team::AddMember(Human* member)
|
||||
{
|
||||
if (room->GetMapModeMeta()->mapMode() == mt::kCircuitMatchMode &&
|
||||
!members_.empty()) {
|
||||
A8_ABORT();
|
||||
}
|
||||
if (!first_member_) {
|
||||
first_member_ = member;
|
||||
init_team_member_num_ = member->init_team_member_num;
|
||||
|
@ -1289,6 +1289,9 @@ message MFSettlementMember
|
||||
optional int32 old_score = 18; //老段位积分
|
||||
optional int32 new_score = 19; //新段位积分
|
||||
|
||||
optional int32 old_circuit_score = 31; //老循环赛积分
|
||||
optional int32 new_circuit_score = 32; //新循环赛积分
|
||||
|
||||
//本次成绩
|
||||
optional int32 pvp_kill = 101; //pvp击杀敌人数
|
||||
optional int32 pvp_damage = 102; //pvp伤害总量
|
||||
|
@ -770,3 +770,13 @@ message BattleHeroGrow
|
||||
optional int32 currentSkillEffect = 10;
|
||||
optional string currentSkillDesc = 11;
|
||||
}
|
||||
|
||||
message CircuitTime
|
||||
{
|
||||
optional int32 id = 1;
|
||||
optional int32 circuit_season = 2;
|
||||
optional int32 circuit_time_type = 3;
|
||||
optional string start_time = 4;
|
||||
optional string end_time = 5;
|
||||
optional int32 cec_pool = 6;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user