improve specialized box log messages
This commit is contained in:
@@ -1658,7 +1658,10 @@ ItemData ItemCreator::on_specialized_box_item_drop(uint16_t entity_id, uint32_t
|
||||
if (!this->destroyed_boxes.emplace(entity_id).second) {
|
||||
return ItemData();
|
||||
}
|
||||
return this->item_for_specialized_box(def0, def1, def2);
|
||||
}
|
||||
|
||||
ItemData ItemCreator::item_for_specialized_box(uint32_t def0, uint32_t def1, uint32_t def2) {
|
||||
ItemData item;
|
||||
item.data1[0] = (def0 >> 0x18) & 0x0F;
|
||||
item.data1[1] = (def0 >> 0x10) + ((item.data1[0] == 0x00) || (item.data1[0] == 0x01));
|
||||
|
||||
@@ -34,6 +34,8 @@ public:
|
||||
ItemData on_box_item_drop(uint16_t entity_id, uint8_t area);
|
||||
ItemData on_specialized_box_item_drop(uint16_t entity_id, uint32_t def0, uint32_t def1, uint32_t def2);
|
||||
|
||||
static ItemData item_for_specialized_box(uint32_t def0, uint32_t def1, uint32_t def2);
|
||||
|
||||
std::vector<ItemData> generate_armor_shop_contents(size_t player_level);
|
||||
std::vector<ItemData> generate_tool_shop_contents(size_t player_level);
|
||||
std::vector<ItemData> generate_weapon_shop_contents(size_t player_level);
|
||||
|
||||
+12
-4
@@ -4,6 +4,7 @@
|
||||
#include <phosg/Random.hh>
|
||||
#include <phosg/Strings.hh>
|
||||
|
||||
#include "ItemCreator.hh"
|
||||
#include "Loggers.hh"
|
||||
#include "PSOEncryption.hh"
|
||||
#include "Quest.hh"
|
||||
@@ -25,10 +26,17 @@ string Map::Enemy::str() const {
|
||||
name_for_enum(this->type), this->flags, this->last_hit_by_client_id);
|
||||
}
|
||||
|
||||
string Map::Object::str() const {
|
||||
return string_printf("[Map::Object %04hX @%04hX p1=%g (%s) p456=[%08" PRIX32 " %08" PRIX32 " %08" PRIX32 "] floor=%02hhX item_drop_checked=%s]",
|
||||
this->base_type, this->section, this->param1, (this->param1 <= 0.0f) ? "specialized" : "generic",
|
||||
this->param4, this->param5, this->param6, this->floor, this->item_drop_checked ? "true" : "false");
|
||||
string Map::Object::str(shared_ptr<const ItemNameIndex> name_index) const {
|
||||
if (this->param1 <= 0.0f) {
|
||||
auto item = ItemCreator::item_for_specialized_box(this->param4, this->param5, this->param6);
|
||||
string item_name = name_index ? name_index->describe_item(GameVersion::BB, item) : item.hex();
|
||||
return string_printf("[Map::Object %04hX @%04hX p1=%g (specialized: %s) floor=%02hhX item_drop_checked=%s]",
|
||||
this->base_type, this->section, this->param1, item_name.c_str(), this->floor, this->item_drop_checked ? "true" : "false");
|
||||
} else {
|
||||
return string_printf("[Map::Object %04hX @%04hX p1=%g (generic) p456=[%08" PRIX32 " %08" PRIX32 " %08" PRIX32 "] floor=%02hhX item_drop_checked=%s]",
|
||||
this->base_type, this->section, this->param1, this->param4, this->param5, this->param6,
|
||||
this->floor, this->item_drop_checked ? "true" : "false");
|
||||
}
|
||||
}
|
||||
|
||||
void Map::clear() {
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "BattleParamsIndex.hh"
|
||||
#include "ItemNameIndex.hh"
|
||||
#include "PSOEncryption.hh"
|
||||
#include "StaticGameData.hh"
|
||||
#include "Text.hh"
|
||||
@@ -204,7 +205,7 @@ struct Map {
|
||||
uint8_t floor;
|
||||
bool item_drop_checked;
|
||||
|
||||
std::string str() const;
|
||||
std::string str(std::shared_ptr<const ItemNameIndex> name_index) const;
|
||||
};
|
||||
|
||||
struct Enemy {
|
||||
|
||||
@@ -3777,7 +3777,7 @@ shared_ptr<Lobby> create_game_generic(
|
||||
size_t entries_loaded = game->map->objects.size() - start_offset;
|
||||
c->log.info("[Map/%zu:o] Loaded %s (%zu entries)", floor, filename.c_str(), entries_loaded);
|
||||
for (size_t z = start_offset; z < game->map->objects.size(); z++) {
|
||||
string e_str = game->map->objects[z].str();
|
||||
string e_str = game->map->objects[z].str(s->item_name_index);
|
||||
static_game_data_log.info("(K-%zX) %s", z, e_str.c_str());
|
||||
}
|
||||
any_map_loaded = true;
|
||||
|
||||
Reference in New Issue
Block a user