Feature/brutal peeps
Feature/brutal peeps live
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
|
||||
struct BrutalPeepsTierDefinition {
|
||||
int8_t tier;
|
||||
uint32_t required_level;
|
||||
float exp_multiplier;
|
||||
float enemy_hp_multiplier;
|
||||
double rare_drop_multiplier;
|
||||
};
|
||||
|
||||
static constexpr std::array<BrutalPeepsTierDefinition, 11> BRUTAL_PEEPS_TIERS = {{
|
||||
{1, 100, 1.10f, 1.10f, 1.001},
|
||||
{2, 110, 1.15f, 1.15f, 1.002},
|
||||
{3, 120, 1.20f, 1.20f, 1.005},
|
||||
{4, 130, 1.30f, 1.30f, 1.006},
|
||||
{5, 140, 1.40f, 1.40f, 1.008},
|
||||
{6, 150, 1.50f, 1.50f, 1.009},
|
||||
{7, 160, 1.75f, 1.75f, 1.010},
|
||||
{8, 170, 2.00f, 2.00f, 1.020},
|
||||
{9, 180, 2.50f, 2.50f, 1.030},
|
||||
{10, 190, 3.00f, 3.00f, 1.040},
|
||||
{11, 200, 1.00f, 4.00f, 1.050},
|
||||
}};
|
||||
|
||||
|
||||
static inline const BrutalPeepsTierDefinition* brutal_peeps_tier_definition(int64_t tier) {
|
||||
for (const auto& def : BRUTAL_PEEPS_TIERS) {
|
||||
if (def.tier == tier) {
|
||||
return &def;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
static inline int8_t max_brutal_peeps_tier_for_level(uint32_t level) {
|
||||
int8_t ret = -1;
|
||||
for (const auto& def : BRUTAL_PEEPS_TIERS) {
|
||||
if (level >= def.required_level) {
|
||||
ret = def.tier;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
+1
-1
@@ -152,7 +152,7 @@ public:
|
||||
uint8_t override_lobby_event = 0xFF; // FF = no override
|
||||
uint8_t override_lobby_number = 0x80; // 80 = no override
|
||||
int64_t override_random_seed = -1;
|
||||
int8_t selected_blueballz_tier = -1; // -1 = normal lobby/game; 0..10 = requested Blueballz tier
|
||||
int8_t selected_brutal_peeps_tier = -1; // -1 = normal lobby/game; 1..11 = requested Brutal Peeps tier
|
||||
std::unique_ptr<Variations> override_variations;
|
||||
VectorXYZF pos;
|
||||
uint32_t floor = 0x0F;
|
||||
|
||||
+9
-4
@@ -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);
|
||||
@@ -228,10 +229,14 @@ void Lobby::create_item_creator(Version logic_version) {
|
||||
effective_section_id,
|
||||
rand_crypt,
|
||||
this->quest ? this->quest->meta.battle_rules : nullptr);
|
||||
if (this->blueballz_tier >= 0) {
|
||||
double rare_mult = 1.25 + (static_cast<double>(this->blueballz_tier) * 0.25);
|
||||
this->item_creator->set_rare_drop_rate_multiplier(rare_mult);
|
||||
this->log.info_f("Blueballz +{} rare drop rate multiplier set to {:g}x", this->blueballz_tier, rare_mult);
|
||||
if (this->brutal_peeps_tier >= 0) {
|
||||
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();
|
||||
|
||||
+2
-2
@@ -81,7 +81,7 @@ struct Lobby : public std::enable_shared_from_this<Lobby> {
|
||||
START_BATTLE_PLAYER_IMMEDIATELY = 0x00010000,
|
||||
CANNOT_CHANGE_CHEAT_MODE = 0x00020000,
|
||||
USE_CREATOR_SECTION_ID = 0x00040000,
|
||||
BLUEBALLZ_PLUS0 = 0x00080000,
|
||||
BRUTAL_PEEPS_MODE = 0x00080000,
|
||||
// Flags used only for lobbies
|
||||
PUBLIC = 0x01000000,
|
||||
DEFAULT = 0x02000000,
|
||||
@@ -119,7 +119,7 @@ struct Lobby : public std::enable_shared_from_this<Lobby> {
|
||||
Episode episode = Episode::NONE;
|
||||
GameMode mode = GameMode::NORMAL;
|
||||
Difficulty difficulty = Difficulty::NORMAL;
|
||||
int8_t blueballz_tier = -1; // -1 = disabled; 0..10 = Blueballz +0..+10
|
||||
int8_t brutal_peeps_tier = -1; // -1 = disabled; 1..11 = Brutal Peeps +1..+11
|
||||
float base_exp_multiplier = 1.0f;
|
||||
float exp_share_multiplier = 0.5f;
|
||||
float challenge_exp_multiplier = 1.0f;
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ constexpr uint32_t BB_TEST_SHIP = 0x11BBBB11;
|
||||
constexpr uint32_t BB_VANILLA_SHIP = 0x11CCCC11;
|
||||
constexpr uint32_t BB_HARDCORE_SHIP = 0x11F00D11;
|
||||
constexpr uint32_t BB_DEV_SHIP = 0x11EEEE11;
|
||||
constexpr uint32_t BLUEBALLZ_PLUS0 = 0x11DDDD11;
|
||||
constexpr uint32_t BRUTAL_PEEPS_PLUS1 = 0x11DDDD11;
|
||||
} // namespace MainMenuItemID
|
||||
|
||||
namespace ClearLicenseConfirmationMenuItemID {
|
||||
|
||||
+84
-81
@@ -26,6 +26,7 @@
|
||||
#include "SendCommands.hh"
|
||||
#include "StaticGameData.hh"
|
||||
#include "Text.hh"
|
||||
#include "BrutalPeeps.hh"
|
||||
|
||||
const char* BATTLE_TABLE_DISCONNECT_HOOK_NAME = "battle_table_state";
|
||||
const char* QUEST_BARRIER_DISCONNECT_HOOK_NAME = "quest_barrier";
|
||||
@@ -306,21 +307,24 @@ static void send_main_menu(std::shared_ptr<Client> c) {
|
||||
num_players, num_games, num_compatible_games);
|
||||
},
|
||||
go_to_lobby_menu_item_flags);
|
||||
bool show_blueballz_menu_items =
|
||||
uint32_t character_level = c->character_file()
|
||||
? (c->character_file()->disp.stats.level + 1)
|
||||
: 0;
|
||||
int8_t max_brutal_peeps_menu_tier = s->enable_brutal_peeps_mode
|
||||
? max_brutal_peeps_tier_for_level(character_level)
|
||||
: -1;
|
||||
|
||||
bool show_brutal_peeps_menu_items =
|
||||
bb_destination_transport_menu &&
|
||||
s->enable_blueballz &&
|
||||
(s->blueballz_unlocked_tier_v4 >= 0);
|
||||
s->enable_brutal_peeps_mode &&
|
||||
(max_brutal_peeps_menu_tier >= 1);
|
||||
|
||||
if (show_blueballz_menu_items) {
|
||||
int64_t max_blueballz_menu_tier = std::min<int64_t>(
|
||||
s->blueballz_max_tier,
|
||||
s->blueballz_unlocked_tier_v4);
|
||||
|
||||
for (int64_t tier = 0; tier <= max_blueballz_menu_tier; tier++) {
|
||||
if (show_brutal_peeps_menu_items) {
|
||||
for (int64_t tier = 1; tier <= max_brutal_peeps_menu_tier; tier++) {
|
||||
main_menu->items.emplace_back(
|
||||
MainMenuItemID::BLUEBALLZ_PLUS0 + static_cast<uint32_t>(tier),
|
||||
std::format("Blueballz +{}", tier),
|
||||
std::format("Enter Blueballz\n+{}", tier),
|
||||
MainMenuItemID::BRUTAL_PEEPS_PLUS1 + static_cast<uint32_t>(tier - 1),
|
||||
std::format("Brutal Peeps +{}", tier),
|
||||
std::format("Enter Brutal Peeps\n+{}", tier),
|
||||
MenuItem::Flag::BB_ONLY);
|
||||
}
|
||||
}
|
||||
@@ -2735,21 +2739,27 @@ void set_lobby_quest(std::shared_ptr<Lobby> l, std::shared_ptr<const Quest> q, b
|
||||
static asio::awaitable<void> on_10_main_menu(std::shared_ptr<Client> c, uint32_t item_id) {
|
||||
auto s = c->require_server_state();
|
||||
|
||||
if ((item_id >= MainMenuItemID::BLUEBALLZ_PLUS0) &&
|
||||
(item_id <= (MainMenuItemID::BLUEBALLZ_PLUS0 + 10))) {
|
||||
int64_t tier = item_id - MainMenuItemID::BLUEBALLZ_PLUS0;
|
||||
if ((item_id >= MainMenuItemID::BRUTAL_PEEPS_PLUS1) &&
|
||||
(item_id <= (MainMenuItemID::BRUTAL_PEEPS_PLUS1 + 10))) {
|
||||
int64_t tier = (item_id - MainMenuItemID::BRUTAL_PEEPS_PLUS1) + 1;
|
||||
const auto* brutal_peeps_def = brutal_peeps_tier_definition(tier);
|
||||
uint32_t character_level = c->character_file()
|
||||
? (c->character_file()->disp.stats.level + 1)
|
||||
: 0;
|
||||
|
||||
if (!s->enable_blueballz ||
|
||||
if (!s->enable_brutal_peeps_mode ||
|
||||
!is_v4(c->version()) ||
|
||||
(tier < 0) ||
|
||||
(tier > s->blueballz_max_tier) ||
|
||||
(tier > s->blueballz_unlocked_tier_v4)) {
|
||||
send_message_box(c, std::format("$C6Blueballz +{} is not available.", tier));
|
||||
!brutal_peeps_def ||
|
||||
(character_level < brutal_peeps_def->required_level)) {
|
||||
send_message_box(c, std::format(
|
||||
"$C6Brutal Peeps +{} is not available.\n\n$C7Required level: {}",
|
||||
tier,
|
||||
brutal_peeps_def ? brutal_peeps_def->required_level : 100));
|
||||
co_return;
|
||||
}
|
||||
|
||||
c->selected_blueballz_tier = tier;
|
||||
c->log.info_f("Blueballz +{} selected from BB menu", tier);
|
||||
c->selected_brutal_peeps_tier = tier;
|
||||
c->log.info_f("Brutal Peeps +{} selected from BB menu at level {}", tier, character_level);
|
||||
|
||||
co_await send_auto_patches_if_needed(c);
|
||||
co_await enable_save_if_needed(c);
|
||||
@@ -2762,7 +2772,7 @@ static asio::awaitable<void> on_10_main_menu(std::shared_ptr<Client> c, uint32_t
|
||||
|
||||
switch (item_id) {
|
||||
case MainMenuItemID::GO_TO_LOBBY: {
|
||||
c->selected_blueballz_tier = -1;
|
||||
c->selected_brutal_peeps_tier = -1;
|
||||
co_await send_auto_patches_if_needed(c);
|
||||
co_await enable_save_if_needed(c);
|
||||
send_lobby_list(c);
|
||||
@@ -2775,21 +2785,6 @@ static asio::awaitable<void> on_10_main_menu(std::shared_ptr<Client> c, uint32_t
|
||||
break;
|
||||
}
|
||||
|
||||
case MainMenuItemID::BLUEBALLZ_PLUS0: {
|
||||
if (!s->enable_blueballz || (c->version() != Version::DC_V2) || (s->blueballz_unlocked_tier_v2 < 0)) {
|
||||
send_message_box(c, "$C6Blueballz +0 is not available.");
|
||||
break;
|
||||
}
|
||||
c->selected_blueballz_tier = 0;
|
||||
co_await send_auto_patches_if_needed(c);
|
||||
co_await enable_save_if_needed(c);
|
||||
send_lobby_list(c);
|
||||
if (!c->lobby.lock()) {
|
||||
s->add_client_to_available_lobby(c, false);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case MainMenuItemID::INFORMATION: {
|
||||
send_menu(c, s->information_menu(c->version()));
|
||||
c->set_flag(Client::Flag::IN_INFORMATION_MENU);
|
||||
@@ -2807,7 +2802,7 @@ static asio::awaitable<void> on_10_main_menu(std::shared_ptr<Client> c, uint32_t
|
||||
}
|
||||
if ((c->listener_port == 12000) || (c->listener_port == 12001) ||
|
||||
(c->listener_port == 19145) || (c->listener_port == 19146)) {
|
||||
c->selected_blueballz_tier = -1;
|
||||
c->selected_brutal_peeps_tier = -1;
|
||||
co_await send_auto_patches_if_needed(c);
|
||||
co_await enable_save_if_needed(c);
|
||||
send_lobby_list(c);
|
||||
@@ -2826,7 +2821,7 @@ static asio::awaitable<void> on_10_main_menu(std::shared_ptr<Client> c, uint32_t
|
||||
break;
|
||||
}
|
||||
if ((c->listener_port == 19345) || (c->listener_port == 19346)) {
|
||||
c->selected_blueballz_tier = -1;
|
||||
c->selected_brutal_peeps_tier = -1;
|
||||
co_await send_auto_patches_if_needed(c);
|
||||
co_await enable_save_if_needed(c);
|
||||
send_lobby_list(c);
|
||||
@@ -2847,7 +2842,7 @@ static asio::awaitable<void> on_10_main_menu(std::shared_ptr<Client> c, uint32_t
|
||||
break;
|
||||
}
|
||||
if ((c->listener_port == 19445) || (c->listener_port == 19446)) {
|
||||
c->selected_blueballz_tier = -1;
|
||||
c->selected_brutal_peeps_tier = -1;
|
||||
co_await send_auto_patches_if_needed(c);
|
||||
co_await enable_save_if_needed(c);
|
||||
send_lobby_list(c);
|
||||
@@ -2868,7 +2863,7 @@ static asio::awaitable<void> on_10_main_menu(std::shared_ptr<Client> c, uint32_t
|
||||
break;
|
||||
}
|
||||
if ((c->listener_port == 19245) || (c->listener_port == 19246)) {
|
||||
c->selected_blueballz_tier = -1;
|
||||
c->selected_brutal_peeps_tier = -1;
|
||||
co_await send_auto_patches_if_needed(c);
|
||||
co_await enable_save_if_needed(c);
|
||||
send_lobby_list(c);
|
||||
@@ -5081,27 +5076,29 @@ std::shared_ptr<Lobby> create_game_generic(
|
||||
if (creator_c->check_flag(Client::Flag::IS_CLIENT_CUSTOMIZATION)) {
|
||||
game->set_flag(Lobby::Flag::IS_CLIENT_CUSTOMIZATION);
|
||||
}
|
||||
game->log.info_f("PSO Peeps BBZ debug: created game name=[{}] version={} difficulty={} enable_blueballz={} unlocked_v4={} max_tier={}",
|
||||
uint32_t creator_character_level = creator_c->character_file()
|
||||
? (creator_c->character_file()->disp.stats.level + 1)
|
||||
: 0;
|
||||
game->log.info_f("PSO Peeps Brutal Peeps debug: created game name=[{}] version={} difficulty={} enable_brutal_peeps_mode={} creator_level={}",
|
||||
name,
|
||||
static_cast<size_t>(creator_c->version()),
|
||||
name_for_difficulty(difficulty),
|
||||
s->enable_blueballz,
|
||||
s->blueballz_unlocked_tier_v4,
|
||||
s->blueballz_max_tier);
|
||||
int8_t requested_blueballz_tier = -1;
|
||||
bool requested_blueballz = false;
|
||||
std::string requested_blueballz_source = "none";
|
||||
s->enable_brutal_peeps_mode,
|
||||
creator_character_level);
|
||||
int8_t requested_brutal_peeps_tier = -1;
|
||||
bool requested_brutal_peeps = false;
|
||||
std::string requested_brutal_peeps_source = "none";
|
||||
|
||||
if (creator_c->selected_blueballz_tier >= 0) {
|
||||
requested_blueballz = true;
|
||||
requested_blueballz_tier = creator_c->selected_blueballz_tier;
|
||||
requested_blueballz_source = "BB menu selection";
|
||||
if (creator_c->selected_brutal_peeps_tier >= 0) {
|
||||
requested_brutal_peeps = true;
|
||||
requested_brutal_peeps_tier = creator_c->selected_brutal_peeps_tier;
|
||||
requested_brutal_peeps_source = "BB menu selection";
|
||||
|
||||
} else {
|
||||
size_t bb_prefix_offset = name.find("[BB+");
|
||||
size_t bb_prefix_offset = name.find("[BP+");
|
||||
if (bb_prefix_offset != std::string::npos) {
|
||||
requested_blueballz = true;
|
||||
requested_blueballz_source = "room prefix";
|
||||
requested_brutal_peeps = true;
|
||||
requested_brutal_peeps_source = "room prefix";
|
||||
size_t tier_start_offset = bb_prefix_offset + 4;
|
||||
size_t close_offset = name.find(']', tier_start_offset);
|
||||
if (close_offset != std::string::npos) {
|
||||
@@ -5115,35 +5112,39 @@ std::shared_ptr<Lobby> create_game_generic(
|
||||
}
|
||||
if (tier_str_valid) {
|
||||
int64_t parsed_tier = std::stoll(tier_str);
|
||||
if ((parsed_tier >= 0) && (parsed_tier <= s->blueballz_max_tier)) {
|
||||
requested_blueballz_tier = parsed_tier;
|
||||
if (brutal_peeps_tier_definition(parsed_tier)) {
|
||||
requested_brutal_peeps_tier = parsed_tier;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (requested_blueballz_tier >= 0) {
|
||||
if (s->enable_blueballz &&
|
||||
if (requested_brutal_peeps_tier >= 0) {
|
||||
const auto* brutal_peeps_def = brutal_peeps_tier_definition(requested_brutal_peeps_tier);
|
||||
if (s->enable_brutal_peeps_mode &&
|
||||
is_v4(creator_c->version()) &&
|
||||
(difficulty == Difficulty::ULTIMATE) &&
|
||||
(requested_blueballz_tier <= s->blueballz_unlocked_tier_v4)) {
|
||||
game->blueballz_tier = requested_blueballz_tier;
|
||||
game->set_flag(Lobby::Flag::BLUEBALLZ_PLUS0);
|
||||
game->log.info_f("Blueballz +{} enabled for BB Ultimate game via {}",
|
||||
static_cast<int>(game->blueballz_tier),
|
||||
requested_blueballz_source);
|
||||
brutal_peeps_def &&
|
||||
(creator_character_level >= brutal_peeps_def->required_level)) {
|
||||
game->brutal_peeps_tier = requested_brutal_peeps_tier;
|
||||
game->set_flag(Lobby::Flag::BRUTAL_PEEPS_MODE);
|
||||
creator_c->selected_brutal_peeps_tier = requested_brutal_peeps_tier;
|
||||
game->log.info_f("Brutal Peeps +{} enabled for BB Ultimate game via {} at creator level {}",
|
||||
static_cast<int>(game->brutal_peeps_tier),
|
||||
requested_brutal_peeps_source,
|
||||
creator_character_level);
|
||||
} else {
|
||||
game->log.info_f("Blueballz +{} room prefix ignored; enable={}, version={}, difficulty={}, unlocked_v4={}, max_tier={}",
|
||||
static_cast<int>(requested_blueballz_tier),
|
||||
s->enable_blueballz,
|
||||
game->log.info_f("Brutal Peeps +{} room/menu request ignored; enable={}, version={}, difficulty={}, creator_level={}, required_level={}",
|
||||
static_cast<int>(requested_brutal_peeps_tier),
|
||||
s->enable_brutal_peeps_mode,
|
||||
static_cast<size_t>(creator_c->version()),
|
||||
name_for_difficulty(difficulty),
|
||||
s->blueballz_unlocked_tier_v4,
|
||||
s->blueballz_max_tier);
|
||||
creator_character_level,
|
||||
brutal_peeps_def ? brutal_peeps_def->required_level : 0);
|
||||
}
|
||||
} else if (requested_blueballz) {
|
||||
game->log.info_f("Blueballz room prefix ignored; invalid prefix in room name: {}", name);
|
||||
} else if (requested_brutal_peeps) {
|
||||
game->log.info_f("Brutal Peeps room prefix ignored; invalid prefix in room name: {}", name);
|
||||
}
|
||||
|
||||
while (game->floor_item_managers.size() < 0x12) {
|
||||
@@ -5188,14 +5189,16 @@ std::shared_ptr<Lobby> create_game_generic(
|
||||
battle_player->set_lobby(game);
|
||||
}
|
||||
game->base_exp_multiplier = s->bb_global_exp_multiplier;
|
||||
if (game->blueballz_tier >= 0) {
|
||||
float blueballz_exp_multiplier = 1.0f + (static_cast<float>(game->blueballz_tier) * 0.25f);
|
||||
game->base_exp_multiplier *= blueballz_exp_multiplier;
|
||||
game->log.info_f("Blueballz +{} EXP multiplier set to {:g}x total (BBGlobalEXPMultiplier={:g}, blueballz={:g})",
|
||||
static_cast<int>(game->blueballz_tier),
|
||||
game->base_exp_multiplier,
|
||||
s->bb_global_exp_multiplier,
|
||||
blueballz_exp_multiplier);
|
||||
if (game->brutal_peeps_tier >= 0) {
|
||||
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;
|
||||
|
||||
|
||||
+15
-15
@@ -21,6 +21,7 @@
|
||||
#include "ReceiveSubcommands.hh"
|
||||
#include "StaticGameData.hh"
|
||||
#include "Text.hh"
|
||||
#include "BrutalPeeps.hh"
|
||||
|
||||
extern const char* QUEST_BARRIER_DISCONNECT_HOOK_NAME;
|
||||
|
||||
@@ -699,7 +700,7 @@ void send_guild_card_chunk_bb(std::shared_ptr<Client> c, size_t chunk_index) {
|
||||
|
||||
|
||||
|
||||
static bool is_battle_param_stream_file_for_blueballz(const std::string& filename) {
|
||||
static bool is_battle_param_stream_file_for_brutal_peeps(const std::string& filename) {
|
||||
return (filename == "BattleParamEntry.dat") ||
|
||||
(filename == "BattleParamEntry_on.dat") ||
|
||||
(filename == "BattleParamEntry_lab.dat") ||
|
||||
@@ -711,20 +712,19 @@ static bool is_battle_param_stream_file_for_blueballz(const std::string& filenam
|
||||
static std::string bb_stream_file_data_for_client(std::shared_ptr<Client> c) {
|
||||
auto s = c->require_server_state();
|
||||
|
||||
int64_t effective_blueballz_hp_scale_tier = (c->selected_blueballz_tier >= 0)
|
||||
? c->selected_blueballz_tier
|
||||
: s->blueballz_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_blueballz_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_blueballz_hp_scale_tier = std::min<int64_t>(
|
||||
s->blueballz_max_tier,
|
||||
effective_blueballz_hp_scale_tier);
|
||||
|
||||
std::string scaled_data = s->bb_stream_file->data;
|
||||
double mult = 1.0 + (static_cast<double>(effective_blueballz_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 {
|
||||
@@ -742,19 +742,19 @@ static std::string bb_stream_file_data_for_client(std::shared_ptr<Client> c) {
|
||||
};
|
||||
|
||||
for (const auto& sf_entry : s->bb_stream_file->entries) {
|
||||
if (!is_battle_param_stream_file_for_blueballz(sf_entry.filename)) {
|
||||
if (!is_battle_param_stream_file_for_brutal_peeps(sf_entry.filename)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ((sf_entry.offset > scaled_data.size()) ||
|
||||
(sf_entry.size > (scaled_data.size() - sf_entry.offset))) {
|
||||
c->log.warning_f("Blueballz enemy HP scaling skipped for {}; invalid stream-file range",
|
||||
c->log.warning_f("Brutal Peeps enemy HP scaling skipped for {}; invalid stream-file range",
|
||||
sf_entry.filename);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sf_entry.size < sizeof(BattleParamsIndex::Table)) {
|
||||
c->log.warning_f("Blueballz enemy HP scaling skipped for {}; file is too small",
|
||||
c->log.warning_f("Brutal Peeps enemy HP scaling skipped for {}; file is too small",
|
||||
sf_entry.filename);
|
||||
continue;
|
||||
}
|
||||
@@ -767,8 +767,8 @@ static std::string bb_stream_file_data_for_client(std::shared_ptr<Client> c) {
|
||||
stats.char_stats.hp = scale_u16(stats.char_stats.hp);
|
||||
}
|
||||
|
||||
c->log.info_f("Blueballz enemy HP scaling: serving {} with tier {} ({:g}x Ultimate HP)",
|
||||
sf_entry.filename, effective_blueballz_hp_scale_tier, mult);
|
||||
c->log.info_f("Brutal Peeps enemy HP scaling: serving {} with tier {} ({:g}x Ultimate HP)",
|
||||
sf_entry.filename, effective_brutal_peeps_hp_scale_tier, mult);
|
||||
}
|
||||
|
||||
return scaled_data;
|
||||
|
||||
+1
-14
@@ -955,22 +955,9 @@ void ServerState::load_config_early() {
|
||||
this->default_switch_assist_enabled = this->config_json->get_bool("EnableSwitchAssistByDefault", false);
|
||||
this->use_game_creator_section_id = this->config_json->get_bool("UseGameCreatorSectionID", false);
|
||||
this->enable_bb_ship_selection_menu = this->config_json->get_bool("EnableBBShipSelectionMenu", false);
|
||||
this->enable_blueballz = this->config_json->get_bool("EnableBlueballz", false);
|
||||
this->enable_brutal_peeps_mode = this->config_json->get_bool("EnableBrutalPeepsMode", false);
|
||||
this->enable_hardcore_mode = this->config_json->get_bool("EnableHardcoreMode", false);
|
||||
this->enable_test_mode = this->config_json->get_bool("EnableTestMode", false);
|
||||
this->blueballz_max_tier = std::min<int64_t>(10, std::max<int64_t>(0, this->config_json->get_int("BlueballzMaxTier", 10)));
|
||||
this->blueballz_unlocked_tier_v2 = std::min<int64_t>(
|
||||
this->blueballz_max_tier,
|
||||
std::max<int64_t>(-1, this->config_json->get_int("BlueballzUnlockedTierV2", -1)));
|
||||
this->blueballz_unlocked_tier_v3 = std::min<int64_t>(
|
||||
this->blueballz_max_tier,
|
||||
std::max<int64_t>(-1, this->config_json->get_int("BlueballzUnlockedTierV3", -1)));
|
||||
this->blueballz_unlocked_tier_v4 = std::min<int64_t>(
|
||||
this->blueballz_max_tier,
|
||||
std::max<int64_t>(-1, this->config_json->get_int("BlueballzUnlockedTierV4", -1)));
|
||||
this->blueballz_enemy_hp_scale_tier = std::min<int64_t>(
|
||||
this->blueballz_max_tier,
|
||||
std::max<int64_t>(-1, this->config_json->get_int("BlueballzEnemyHPScaleTier", -1)));
|
||||
this->rare_notifs_enabled_for_client_drops = this->config_json->get_bool("RareNotificationsEnabledForClientDrops", false);
|
||||
this->default_rare_notifs_enabled_v1_v2 = this->config_json->get_bool("RareNotificationsEnabledByDefault", false);
|
||||
this->default_rare_notifs_enabled_v3_v4 = this->default_rare_notifs_enabled_v1_v2;
|
||||
|
||||
+1
-6
@@ -175,14 +175,9 @@ struct ServerState : public std::enable_shared_from_this<ServerState> {
|
||||
bool use_game_creator_section_id = false;
|
||||
bool enable_bb_ship_selection_menu = false;
|
||||
bool use_psov2_rand_crypt = false; // Used in some tests
|
||||
bool enable_blueballz = false;
|
||||
int64_t blueballz_enemy_hp_scale_tier = -1; // -1 = disabled; 0..10 = scale BB enemy HP in stream files
|
||||
bool enable_brutal_peeps_mode = false;
|
||||
bool enable_hardcore_mode = false;
|
||||
bool enable_test_mode = false;
|
||||
int8_t blueballz_max_tier = 10;
|
||||
int8_t blueballz_unlocked_tier_v2 = 0;
|
||||
int8_t blueballz_unlocked_tier_v3 = 0;
|
||||
int8_t blueballz_unlocked_tier_v4 = 0;
|
||||
bool use_legacy_item_random_behavior = false; // Used in some tests
|
||||
bool rare_notifs_enabled_for_client_drops = false;
|
||||
bool default_rare_notifs_enabled_v1_v2 = false;
|
||||
|
||||
Reference in New Issue
Block a user