This commit is contained in:
aozhiwei 2023-07-21 16:52:44 +08:00
parent 76f5d09b98
commit fe45d21f94
3 changed files with 45 additions and 7 deletions

View File

@ -353,4 +353,30 @@ namespace mt
return s_.rank_mode_confs.at(s_.rank_mode_confs.size() - 1).get();
}
int Param::RandHeroLv(int room_type)
{
switch (room_type) {
case RoomType_OldBrid1:
{
return a8::RandEx(1, 1);
break;
}
case RoomType_OldBrid2:
{
return a8::RandEx(2, 10);
break;
}
case RoomType_OldBrid3:
{
return a8::RandEx(11, 15);
break;
}
default:
{
return a8::RandEx(1, 5);
break;
}
}
}
}

View File

@ -144,7 +144,7 @@ namespace mt
static int GetStarNum(int rank);
static const RankMatchConf* GetRankModeConfByElo(int elo);
static const RankMatchConf* GetRankModeConfByRoomType(int room_type);
static int RandHeroLv(int room_type);
private:
static S s_;
};

View File

@ -146,8 +146,7 @@ private:
const mt::NpcStandard* standard_meta = mt::NpcStandard::GetById
(c->room->pve_instance->gemini_lv());
if (standard_meta) {
hp_ = standard_meta->hp() * hero_meta->hp_ratio() *
c->room->pve_instance->GetHpMul(c->room->GetHumanNum());
hp_ = standard_meta->hp();
atk_ = standard_meta->damage() * hero_meta->damage_ratio();
def_ = standard_meta->defence() * hero_meta->defence_ratio();
} else {
@ -155,6 +154,23 @@ private:
abort();
#endif
}
} else {
const mt::NpcStandard* standard_meta = nullptr;
auto match_conf = c->room->GetRankMatchConf();
if (match_conf) {
standard_meta = mt::NpcStandard::GetByHeroAndLv
(hero_meta->id(),
a8::RandEx(match_conf->hero_min_lv, match_conf->hero_max_lv));
} else {
standard_meta = mt::NpcStandard::GetByHeroAndLv
(hero_meta->id(),
mt::Param::RandHeroLv(c->room->GetRoomType()));
}
if (standard_meta) {
hp_ = standard_meta->hp();
atk_ = standard_meta->damage() * hero_meta->damage_ratio();
def_ = standard_meta->defence() * hero_meta->defence_ratio();
}
}
}
@ -938,10 +954,6 @@ void BattleDataContext::Init(Creature* c)
spec_weapon.ammo = spec_weapon.GetClipVolume(c);
}
}
}
auto match_conf = owner_.Get()->room->GetRankMatchConf();
if (owner_.Get()->IsAndroid() && match_conf) {
}
c->NetInitOk();
}