1
This commit is contained in:
parent
08797e7f1d
commit
e7677545f8
@ -37,18 +37,6 @@ bool IsValidSlotId(int slot_id)
|
|||||||
return slot_id >= 0 && slot_id < IS_END;
|
return slot_id >= 0 && slot_id < IS_END;
|
||||||
}
|
}
|
||||||
|
|
||||||
SkillFunc_e Str2SkillFunc(const std::string& func_str)
|
|
||||||
{
|
|
||||||
if (func_str == "jump") {
|
|
||||||
return Skill_Jump;
|
|
||||||
} else if (func_str == "shot") {
|
|
||||||
return Skill_Shot;
|
|
||||||
} else if (func_str == "summon_object") {
|
|
||||||
return Skill_SummonObject;
|
|
||||||
}
|
|
||||||
return Skill_FuncNone;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool IsValidBuffEffect(int buff_effect)
|
bool IsValidBuffEffect(int buff_effect)
|
||||||
{
|
{
|
||||||
return buff_effect > BET_Begin && buff_effect < BET_End;
|
return buff_effect > BET_Begin && buff_effect < BET_End;
|
||||||
|
@ -22,6 +22,5 @@ class Global : public a8::Singleton<Global>
|
|||||||
};
|
};
|
||||||
|
|
||||||
bool IsValidSlotId(int slot_id);
|
bool IsValidSlotId(int slot_id);
|
||||||
SkillFunc_e Str2SkillFunc(const std::string& func_str);
|
|
||||||
bool IsValidBuffEffect(int buff_effect);
|
bool IsValidBuffEffect(int buff_effect);
|
||||||
bool IsValidHumanAttr(int attr_type);
|
bool IsValidHumanAttr(int attr_type);
|
||||||
|
@ -334,7 +334,7 @@ namespace MetaData
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_func", {idx}));
|
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_func", {idx}));
|
||||||
phase.func = reflection->GetString(*(metatable::Skill*)i, field_desc);
|
phase.func_id = (SkillFunc_e)reflection->GetInt32(*(metatable::Skill*)i, field_desc);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param1", {idx}));
|
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param1", {idx}));
|
||||||
@ -344,7 +344,6 @@ namespace MetaData
|
|||||||
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param2", {idx}));
|
auto field_desc = descriptor->FindFieldByName(a8::Format("phase%d_param2", {idx}));
|
||||||
phase.param2_str = reflection->GetString(*(metatable::Skill*)i, field_desc);
|
phase.param2_str = reflection->GetString(*(metatable::Skill*)i, field_desc);
|
||||||
}
|
}
|
||||||
phase.func_id = Str2SkillFunc(phase.func);
|
|
||||||
if (phase.func_id != Skill_FuncNone) {
|
if (phase.func_id != Skill_FuncNone) {
|
||||||
phase.param1 = a8::XValue(phase.param1_str);
|
phase.param1 = a8::XValue(phase.param1_str);
|
||||||
phase.param2 = a8::XValue(phase.param2_str);
|
phase.param2 = a8::XValue(phase.param2_str);
|
||||||
|
@ -137,7 +137,6 @@ namespace MetaData
|
|||||||
a8::XValue param1;
|
a8::XValue param1;
|
||||||
a8::XValue param2;
|
a8::XValue param2;
|
||||||
|
|
||||||
std::string func;
|
|
||||||
std::string param1_str;
|
std::string param1_str;
|
||||||
std::string param2_str;
|
std::string param2_str;
|
||||||
};
|
};
|
||||||
|
@ -89,6 +89,7 @@ public:
|
|||||||
f8::ReadCsvMetaFile(res_path + "parameter@parameter.csv", parameter_meta_list);
|
f8::ReadCsvMetaFile(res_path + "parameter@parameter.csv", parameter_meta_list);
|
||||||
f8::ReadCsvMetaFile(res_path + "map@map.csv", map_meta_list);
|
f8::ReadCsvMetaFile(res_path + "map@map.csv", map_meta_list);
|
||||||
f8::ReadCsvMetaFile(res_path + "safearea@safearea.csv", safearea_meta_list);
|
f8::ReadCsvMetaFile(res_path + "safearea@safearea.csv", safearea_meta_list);
|
||||||
|
f8::ReadCsvMetaFile(res_path + "tank@tank.csv", tank_meta_list);
|
||||||
f8::ReadCsvMetaFile(res_path + "item@item.csv", item_meta_list);
|
f8::ReadCsvMetaFile(res_path + "item@item.csv", item_meta_list);
|
||||||
f8::ReadCsvMetaFile(res_path + "equip@equip.csv", equip_meta_list);
|
f8::ReadCsvMetaFile(res_path + "equip@equip.csv", equip_meta_list);
|
||||||
f8::ReadCsvMetaFile(res_path + "player@player.csv", player_meta_list);
|
f8::ReadCsvMetaFile(res_path + "player@player.csv", player_meta_list);
|
||||||
@ -186,6 +187,12 @@ private:
|
|||||||
safearea_hash[item.i->id()] = &item;
|
safearea_hash[item.i->id()] = &item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (auto& meta : tank_meta_list) {
|
||||||
|
MetaData::Tank& item = a8::FastAppend(tank_list);
|
||||||
|
item.i = &meta;
|
||||||
|
tank_hash[item.i->id()] = &item;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto& meta : item_meta_list) {
|
for (auto& meta : item_meta_list) {
|
||||||
MetaData::Item& item = a8::FastAppend(item_list);
|
MetaData::Item& item = a8::FastAppend(item_list);
|
||||||
item.i = &meta;
|
item.i = &meta;
|
||||||
|
@ -431,6 +431,7 @@ void Player::_CMMove(f8::MsgHdr& hdr, const cs::CMMove& msg)
|
|||||||
}
|
}
|
||||||
if (msg.has_use_skill()) {
|
if (msg.has_use_skill()) {
|
||||||
use_skill = true;
|
use_skill = true;
|
||||||
|
skill_target_id = msg.skill_target_id();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,17 +128,17 @@ message Skill
|
|||||||
required float skill_distance = 10;
|
required float skill_distance = 10;
|
||||||
|
|
||||||
optional int32 phase1_time_offset = 20;
|
optional int32 phase1_time_offset = 20;
|
||||||
optional string phase1_func = 21;
|
optional int32 phase1_func = 21;
|
||||||
optional string phase1_param1 = 22;
|
optional string phase1_param1 = 22;
|
||||||
optional string phase1_param2 = 23;
|
optional string phase1_param2 = 23;
|
||||||
|
|
||||||
optional int32 phase2_time_offset = 30;
|
optional int32 phase2_time_offset = 30;
|
||||||
optional string phase2_func = 31;
|
optional int32 phase2_func = 31;
|
||||||
optional string phase2_param1 = 32;
|
optional string phase2_param1 = 32;
|
||||||
optional string phase2_param2 = 33;
|
optional string phase2_param2 = 33;
|
||||||
|
|
||||||
optional int32 phase3_time_offset = 40;
|
optional int32 phase3_time_offset = 40;
|
||||||
optional string phase3_func = 41;
|
optional int32 phase3_func = 41;
|
||||||
optional string phase3_param1 = 42;
|
optional string phase3_param1 = 42;
|
||||||
optional string phase3_param2 = 43;
|
optional string phase3_param2 = 43;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user