Use Brutal Peeps tier table for rewards and enemy HP
This commit is contained in:
+8
-3
@@ -9,6 +9,7 @@
|
||||
#include "SendCommands.hh"
|
||||
#include "ServerState.hh"
|
||||
#include "Text.hh"
|
||||
#include "BrutalPeeps.hh"
|
||||
|
||||
bool Lobby::FloorItem::visible_to_client(uint8_t client_id) const {
|
||||
return this->flags & (1 << client_id);
|
||||
@@ -229,9 +230,13 @@ void Lobby::create_item_creator(Version logic_version) {
|
||||
rand_crypt,
|
||||
this->quest ? this->quest->meta.battle_rules : nullptr);
|
||||
if (this->brutal_peeps_tier >= 0) {
|
||||
double rare_mult = 1.25 + (static_cast<double>(this->brutal_peeps_tier) * 0.25);
|
||||
this->item_creator->set_rare_drop_rate_multiplier(rare_mult);
|
||||
this->log.info_f("Brutal Peeps +{} rare drop rate multiplier set to {:g}x", this->brutal_peeps_tier, rare_mult);
|
||||
const auto* brutal_peeps_def = brutal_peeps_tier_definition(this->brutal_peeps_tier);
|
||||
if (brutal_peeps_def) {
|
||||
this->item_creator->set_rare_drop_rate_multiplier(brutal_peeps_def->rare_drop_multiplier);
|
||||
this->log.info_f("Brutal Peeps +{} rare drop rate multiplier set to {:g}x",
|
||||
this->brutal_peeps_tier,
|
||||
brutal_peeps_def->rare_drop_multiplier);
|
||||
}
|
||||
}
|
||||
if (s->use_legacy_item_random_behavior) {
|
||||
this->item_creator->set_legacy_replay();
|
||||
|
||||
@@ -5190,13 +5190,15 @@ std::shared_ptr<Lobby> create_game_generic(
|
||||
}
|
||||
game->base_exp_multiplier = s->bb_global_exp_multiplier;
|
||||
if (game->brutal_peeps_tier >= 0) {
|
||||
float brutal_peeps_exp_multiplier = 1.0f + (static_cast<float>(game->brutal_peeps_tier) * 0.25f);
|
||||
game->base_exp_multiplier *= brutal_peeps_exp_multiplier;
|
||||
game->log.info_f("Brutal Peeps +{} EXP multiplier set to {:g}x total (BBGlobalEXPMultiplier={:g}, brutal_peeps={:g})",
|
||||
static_cast<int>(game->brutal_peeps_tier),
|
||||
game->base_exp_multiplier,
|
||||
s->bb_global_exp_multiplier,
|
||||
brutal_peeps_exp_multiplier);
|
||||
const auto* brutal_peeps_def = brutal_peeps_tier_definition(game->brutal_peeps_tier);
|
||||
if (brutal_peeps_def) {
|
||||
game->base_exp_multiplier *= brutal_peeps_def->exp_multiplier;
|
||||
game->log.info_f("Brutal Peeps +{} EXP multiplier set to {:g}x total (BBGlobalEXPMultiplier={:g}, brutal_peeps={:g})",
|
||||
static_cast<int>(game->brutal_peeps_tier),
|
||||
game->base_exp_multiplier,
|
||||
s->bb_global_exp_multiplier,
|
||||
brutal_peeps_def->exp_multiplier);
|
||||
}
|
||||
}
|
||||
game->exp_share_multiplier = s->exp_share_multiplier;
|
||||
|
||||
|
||||
+9
-9
@@ -21,6 +21,7 @@
|
||||
#include "ReceiveSubcommands.hh"
|
||||
#include "StaticGameData.hh"
|
||||
#include "Text.hh"
|
||||
#include "BrutalPeeps.hh"
|
||||
|
||||
extern const char* QUEST_BARRIER_DISCONNECT_HOOK_NAME;
|
||||
|
||||
@@ -711,20 +712,19 @@ static bool is_battle_param_stream_file_for_brutal_peeps(const std::string& file
|
||||
static std::string bb_stream_file_data_for_client(std::shared_ptr<Client> c) {
|
||||
auto s = c->require_server_state();
|
||||
|
||||
int64_t effective_brutal_peeps_hp_scale_tier = (c->selected_brutal_peeps_tier >= 0)
|
||||
? c->selected_brutal_peeps_tier
|
||||
: s->brutal_peeps_enemy_hp_scale_tier;
|
||||
int64_t effective_brutal_peeps_hp_scale_tier = c->selected_brutal_peeps_tier;
|
||||
auto l = c->lobby.lock();
|
||||
if ((effective_brutal_peeps_hp_scale_tier < 0) && l && (l->brutal_peeps_tier >= 0)) {
|
||||
effective_brutal_peeps_hp_scale_tier = l->brutal_peeps_tier;
|
||||
}
|
||||
|
||||
if (effective_brutal_peeps_hp_scale_tier < 0) {
|
||||
const auto* brutal_peeps_def = brutal_peeps_tier_definition(effective_brutal_peeps_hp_scale_tier);
|
||||
if (!brutal_peeps_def) {
|
||||
return s->bb_stream_file->data;
|
||||
}
|
||||
|
||||
effective_brutal_peeps_hp_scale_tier = std::min<int64_t>(
|
||||
s->brutal_peeps_max_tier,
|
||||
effective_brutal_peeps_hp_scale_tier);
|
||||
|
||||
std::string scaled_data = s->bb_stream_file->data;
|
||||
double mult = 1.0 + (static_cast<double>(effective_brutal_peeps_hp_scale_tier) * 0.25);
|
||||
double mult = brutal_peeps_def->enemy_hp_multiplier;
|
||||
size_t ultimate_index = static_cast<size_t>(Difficulty::ULTIMATE);
|
||||
|
||||
auto scale_u16 = [mult](uint32_t v) -> uint16_t {
|
||||
|
||||
Reference in New Issue
Block a user