1
This commit is contained in:
parent
ca61fb7f7e
commit
098e5cb2ac
@ -125,7 +125,6 @@ void Human::FillMFObjectFull(cs::MFObjectFull* full_data)
|
||||
p->set_max_energy_shield(max_energy_shield);
|
||||
}
|
||||
#endif
|
||||
FillBodyState(p->mutable_states());
|
||||
}
|
||||
|
||||
void Human::FillMFPlayerStats(cs::MFPlayerStats* stats_pb)
|
||||
@ -803,16 +802,15 @@ void Human::FillMFActivePlayerData(cs::MFActivePlayerData* player_data)
|
||||
if (skill_meta) {
|
||||
if (last_use_skill_frameno_ == 0) {
|
||||
player_data->set_skill_left_time(0);
|
||||
player_data->set_skill_cd_time(skill_meta->i->cd_time() * 1000);
|
||||
player_data->set_skill_cd_time(skill_meta->i->skill_cd() * 1000);
|
||||
} else {
|
||||
int passed_time = (room->frame_no - last_use_skill_frameno_) * FRAME_RATE_MS;
|
||||
int skill_left_time = std::max(0, skill_meta->i->cd_time() * 1000 - passed_time);
|
||||
int skill_left_time = std::max(0, skill_meta->i->skill_cd() * 1000 - passed_time);
|
||||
player_data->set_skill_left_time(skill_left_time);
|
||||
player_data->set_skill_cd_time(skill_meta->i->cd_time() * 1000);
|
||||
player_data->set_skill_cd_time(skill_meta->i->skill_cd() * 1000);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
FillBodyState(player_data->mutable_states());
|
||||
}
|
||||
|
||||
void Human::FillMFGasData(cs::MFGasData* gas_data)
|
||||
@ -927,21 +925,6 @@ void Human::RecoverHp(int inc_hp)
|
||||
}
|
||||
}
|
||||
|
||||
void Human::FillBodyState(::google::protobuf::RepeatedPtrField<::cs::MFBodyState>* states)
|
||||
{
|
||||
if (pain_killer_timer) {
|
||||
int passed_time = (room->frame_no - pain_killer_frameno) * FRAME_RATE_MS;
|
||||
int left_time = std::max(0, pain_killer_lastingtime * 1000 - passed_time);
|
||||
int anodyne_max_time = MetaMgr::Instance()->GetSysParamAsInt("anodyne_max_time");
|
||||
left_time = std::min(left_time, anodyne_max_time * 1000);
|
||||
|
||||
cs::MFBodyState* state = states->Add();
|
||||
state->set_state_type(1);
|
||||
state->set_left_time(left_time);
|
||||
state->set_lasting_time(anodyne_max_time * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
void Human::SummonHero()
|
||||
{
|
||||
#if 0
|
||||
|
@ -16,7 +16,6 @@ namespace MetaData
|
||||
|
||||
enum HumanStatus
|
||||
{
|
||||
HS_PainKiller = 1,
|
||||
HS_Hide = 4,
|
||||
HS_Accelerate = 5,
|
||||
HS_DamageAdd = 6,
|
||||
@ -24,6 +23,7 @@ enum HumanStatus
|
||||
HS_RecoverHP = 8,
|
||||
HS_ReflectDamage = 9,
|
||||
HS_SummonHero = 10,
|
||||
HS_Invincible = 11,
|
||||
HS_End
|
||||
};
|
||||
|
||||
@ -169,7 +169,6 @@ class Human : public Entity
|
||||
void DecInventory(int slot_id, int num);
|
||||
int GetVolume(int slot_id);
|
||||
void RecoverHp(int inc_hp);
|
||||
void FillBodyState(::google::protobuf::RepeatedPtrField<::cs::MFBodyState>* states);
|
||||
void SummonHero();
|
||||
void AddObserver(Human* observer);
|
||||
void RemoveObserver(Human* observer);
|
||||
@ -197,7 +196,6 @@ protected:
|
||||
|
||||
private:
|
||||
void ClearFrameData();
|
||||
void GenBattleReportData(a8::MutableXObject* params);
|
||||
void DeadDrop();
|
||||
void Revive();
|
||||
|
||||
|
@ -27,6 +27,11 @@ namespace MetaData
|
||||
std::string RandTemplate();
|
||||
};
|
||||
|
||||
struct Attr
|
||||
{
|
||||
const metatable::Attr* i = nullptr;
|
||||
};
|
||||
|
||||
struct MapThing
|
||||
{
|
||||
const metatable::MapThing* i = nullptr;
|
||||
|
@ -242,7 +242,7 @@ private:
|
||||
MetaData::Skill& item = a8::FastAppend(skill_list);
|
||||
item.i = &meta;
|
||||
item.Init();
|
||||
skill_hash[item.i->id()] = &item;
|
||||
skill_hash[item.i->skill_id()] = &item;
|
||||
}
|
||||
|
||||
for (auto& meta : rankreward_meta_list) {
|
||||
@ -387,6 +387,21 @@ MetaData::Skill* MetaMgr::GetSkill(int skill_id)
|
||||
return itr != loader_->skill_hash.end() ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
MetaData::Buff* MetaMgr::GetBuff(int buff_id)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MetaData::Attr* MetaMgr::GetAttrById(int attr_id)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MetaData::Attr* MetaMgr::GetAttrByName(const std::string& attr_name)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MetaData::Dress* MetaMgr::GetDress(int dress_id)
|
||||
{
|
||||
auto itr = loader_->dress_hash.find(dress_id);
|
||||
|
@ -31,6 +31,9 @@ class MetaMgr : public a8::Singleton<MetaMgr>
|
||||
std::vector<MetaData::MapTplThing>* GetMapTplThing(const std::string& map_name);
|
||||
std::vector<MetaData::MapTplThing>* GetMapBornPoints(const std::string& map_name);
|
||||
MetaData::Skill* GetSkill(int skill_id);
|
||||
MetaData::Buff* GetBuff(int buff_id);
|
||||
MetaData::Attr* GetAttrById(int attr_id);
|
||||
MetaData::Attr* GetAttrByName(const std::string& attr_name);
|
||||
MetaData::Dress* GetDress(int dress_id);
|
||||
MetaData::Tank* GetTank(int tank_id);
|
||||
float GetRankRewardParam(int rank);
|
||||
|
@ -156,7 +156,6 @@ message MFPlayerFull
|
||||
optional MFWeapon weapon = 18; //武器
|
||||
optional int32 energy_shield = 19; //能量护盾
|
||||
optional int32 max_energy_shield = 22; //最大能量护盾
|
||||
repeated MFBodyState states = 23; //角色状态
|
||||
repeated MFBuff buff_list = 24; //buff列表
|
||||
}
|
||||
|
||||
@ -417,7 +416,6 @@ message MFActivePlayerData
|
||||
optional int32 max_energy_shield = 41; //最大能量护盾
|
||||
|
||||
optional int32 spectator_count = 20;
|
||||
repeated MFBodyState states = 27; //角色状态
|
||||
|
||||
optional int32 skill_left_time = 50; //技能cd时间(剩余时间)
|
||||
optional int32 skill_cd_time = 51; //技能cd时间(总时间)
|
||||
@ -522,27 +520,6 @@ message MFAirDrop
|
||||
optional MFVector2D pos = 3; //位置
|
||||
}
|
||||
|
||||
//对象状态(只同步一次客户端自己到及时,有变化时服务器会再次下发)
|
||||
message MFBodyState
|
||||
{
|
||||
/*
|
||||
1: 止痛药持续加血
|
||||
2: 在飞机上(这时left_time、lasting_time无意义)
|
||||
3: 跳伞中
|
||||
|
||||
4: 隐身中(队友可见)
|
||||
5: 加速中
|
||||
6: 伤害加深
|
||||
7: 护盾
|
||||
8: 回血
|
||||
9: 反伤
|
||||
10: 分身
|
||||
*/
|
||||
optional int32 state_type = 1;
|
||||
optional float left_time = 2; //剩余时间(单位毫秒)
|
||||
optional float lasting_time = 3; //持续时间(总时间毫秒)
|
||||
}
|
||||
|
||||
//buff
|
||||
message MFBuff
|
||||
{
|
||||
@ -602,7 +579,9 @@ message CMMove
|
||||
optional bool interaction = 9; //是否有交互
|
||||
repeated int32 interaction_objids = 23; //交互的对象id列表
|
||||
|
||||
optional bool use_skill = 29; //使用技能
|
||||
optional bool use_skill = 27; //使用技能
|
||||
optional float skill_param1 = 28; //技能参数1
|
||||
optional float skill_param2 = 29; //技能参数2
|
||||
|
||||
optional bool spectate = 30; //自杀
|
||||
|
||||
|
@ -12,6 +12,13 @@ message Parameter
|
||||
optional string param_value = 2;
|
||||
}
|
||||
|
||||
message Attr
|
||||
{
|
||||
optional int32 attr_id = 1;
|
||||
optional string attr_cname = 2;
|
||||
optional string attr_ename = 3;
|
||||
}
|
||||
|
||||
message Map
|
||||
{
|
||||
optional int32 map_id = 1; //地图id
|
||||
@ -110,13 +117,27 @@ message Robot
|
||||
|
||||
message Skill
|
||||
{
|
||||
optional int32 id = 1;
|
||||
optional int32 release_type = 2;
|
||||
optional int32 skill_id = 1;
|
||||
optional int32 skill_type = 2;
|
||||
optional int32 skill_effect_id = 3;
|
||||
optional string value = 4;
|
||||
optional string value_up = 6;
|
||||
optional int32 cd_time = 7;
|
||||
optional string last_time = 8;
|
||||
optional int32 skill_cd = 7;
|
||||
optional int32 skill_target = 8;
|
||||
optional string buff_list = 9;
|
||||
}
|
||||
|
||||
message Buff
|
||||
{
|
||||
optional int32 buff_id = 1;
|
||||
optional int32 buff_target = 2;
|
||||
optional int32 buff_effect = 3;
|
||||
optional int32 trigger_type = 4;
|
||||
optional int32 trigger_chance = 5;
|
||||
optional string buff_param1 = 6;
|
||||
optional string buff_param2 = 7;
|
||||
optional string buff_param3 = 8;
|
||||
optional int32 duration_time = 9;
|
||||
}
|
||||
|
||||
message Drop
|
||||
@ -173,11 +194,6 @@ message Tank
|
||||
optional int32 max_lv = 3;
|
||||
}
|
||||
|
||||
message Buff
|
||||
{
|
||||
optional int32 buff_id = 1;
|
||||
}
|
||||
|
||||
//end
|
||||
|
||||
message DoorObjJson
|
||||
|
Loading…
x
Reference in New Issue
Block a user