This commit is contained in:
aozhiwei 2023-09-25 14:09:15 +08:00
commit b3209ca555
2 changed files with 5 additions and 1 deletions

View File

@ -51,6 +51,7 @@ public:
std::shared_ptr<a8::XObject> hero_dto; std::shared_ptr<a8::XObject> hero_dto;
int spec_skill_id = 0; int spec_skill_id = 0;
int main_skill_id = 0; int main_skill_id = 0;
const mt::NpcStandard* standard_meta = nullptr;
float GetHP() float GetHP()
{ {
@ -155,7 +156,6 @@ private:
#endif #endif
} }
} else { } else {
const mt::NpcStandard* standard_meta = nullptr;
auto match_conf = c->room->GetRankMatchConf(); auto match_conf = c->room->GetRankMatchConf();
if (match_conf) { if (match_conf) {
standard_meta = mt::NpcStandard::GetByHeroAndLv standard_meta = mt::NpcStandard::GetByHeroAndLv
@ -1146,6 +1146,9 @@ float BattleDataContext::GetRecoverHpAdd()
int BattleDataContext::GetHeroLevel() int BattleDataContext::GetHeroLevel()
{ {
if (!owner_.Get()->IsPlayer() && hero_ability_ && hero_ability_->standard_meta) {
return hero_ability_->standard_meta->level();
}
return std::max(hero_lv_, 1); return std::max(hero_lv_, 1);
} }

View File

@ -110,6 +110,7 @@ void Room::InitData(RoomInitInfo& init_info)
map_meta_ = init_info.map_meta; map_meta_ = init_info.map_meta;
poly_ext_datas_ = map_instance->GetPolyExtDatas(); poly_ext_datas_ = map_instance->GetPolyExtDatas();
custom_battle_ = init_info.custom_battle; custom_battle_ = init_info.custom_battle;
rank_match_conf_ = mt::Param::GetRankModeConfByRoomType(room_type_);
} }
void Room::Init() void Room::Init()