add all BP indexes and fix incorrect RT indexes
This commit is contained in:
+22
-12
@@ -4,6 +4,7 @@
|
||||
#include <phosg/Encoding.hh>
|
||||
#include <phosg/JSON.hh>
|
||||
|
||||
#include "EnemyType.hh"
|
||||
#include "GSLArchive.hh"
|
||||
#include "PSOEncryption.hh"
|
||||
#include "StaticGameData.hh"
|
||||
@@ -15,7 +16,7 @@ public:
|
||||
class Table {
|
||||
public:
|
||||
Table() = delete;
|
||||
Table(const phosg::JSON& json, Episode episode);
|
||||
Table(std::shared_ptr<const Table> prev_table, const phosg::JSON& json, Episode episode);
|
||||
Table(const phosg::StringReader& r, bool big_endian, bool is_v3, Episode episode);
|
||||
|
||||
bool operator==(const Table& other) const = default;
|
||||
@@ -23,11 +24,15 @@ public:
|
||||
|
||||
template <typename IntT>
|
||||
struct Range {
|
||||
IntT min;
|
||||
IntT max;
|
||||
IntT min = 0;
|
||||
IntT max = 0;
|
||||
|
||||
bool operator==(const Range& other) const = default;
|
||||
bool operator!=(const Range& other) const = default;
|
||||
|
||||
inline bool empty() const {
|
||||
return ((this->min | this->max) == 0);
|
||||
}
|
||||
} __attribute__((packed));
|
||||
|
||||
Episode episode;
|
||||
@@ -37,9 +42,9 @@ public:
|
||||
parray<parray<uint8_t, 4>, 9> grind_prob_table;
|
||||
parray<uint8_t, 0x05> armor_shield_type_index_prob_table;
|
||||
parray<uint8_t, 0x05> armor_slot_count_prob_table;
|
||||
parray<Range<uint16_t>, 0x64> enemy_meseta_ranges;
|
||||
parray<uint8_t, 0x64> enemy_type_drop_probs;
|
||||
parray<uint8_t, 0x64> enemy_item_classes;
|
||||
parray<Range<uint16_t>, NUM_RT_INDEXES_V4> enemy_meseta_ranges;
|
||||
parray<uint8_t, NUM_RT_INDEXES_V4> enemy_type_drop_probs;
|
||||
parray<uint8_t, NUM_RT_INDEXES_V4> enemy_item_classes;
|
||||
parray<Range<uint16_t>, 0x0A> box_meseta_ranges;
|
||||
bool has_rare_bonus_value_prob_table;
|
||||
parray<parray<uint16_t, 6>, 0x17> bonus_value_prob_table;
|
||||
@@ -54,7 +59,7 @@ public:
|
||||
parray<uint8_t, 0x0A> unit_max_stars_table;
|
||||
parray<parray<uint8_t, 10>, 7> box_item_class_prob_table;
|
||||
|
||||
phosg::JSON json() const;
|
||||
phosg::JSON json(std::shared_ptr<const Table> prev_table) const;
|
||||
void print(FILE* stream) const;
|
||||
void print_diff(FILE* stream, const Table& other) const;
|
||||
|
||||
@@ -122,13 +127,13 @@ public:
|
||||
/* 14 */ U32T<BE> armor_slot_count_prob_table_offset;
|
||||
|
||||
// This array (indexed by enemy_type) specifies the range of meseta values that each enemy can drop.
|
||||
// V2/V3: -> parray<Range<U16T>, 0x64>
|
||||
// V2/V3: -> parray<Range<U16T>, NUM_RT_INDEXES_V3>
|
||||
/* 18 */ U32T<BE> enemy_meseta_ranges_offset;
|
||||
|
||||
// Each byte in this table (indexed by enemy_type) represents the percent chance that the enemy drops anything at
|
||||
// all. (This check is done before the rare drop check, so the chance of getting a rare item from an enemy is
|
||||
// essentially this probability multiplied by the rare drop rate.)
|
||||
// V2/V3: -> parray<uint8_t, 0x64>
|
||||
// V2/V3: -> parray<uint8_t, NUM_RT_INDEXES_V3>
|
||||
/* 1C */ U32T<BE> enemy_type_drop_probs_offset;
|
||||
|
||||
// Each byte in this table (indexed by enemy_type) represents the class of item that can drop. The values are:
|
||||
@@ -139,7 +144,7 @@ public:
|
||||
// 04 = tool
|
||||
// 05 = meseta
|
||||
// Anything else = no item
|
||||
// V2/V3: -> parray<uint8_t, 0x64>
|
||||
// V2/V3: -> parray<uint8_t, NUM_RT_INDEXES_V3>
|
||||
/* 20 */ U32T<BE> enemy_item_classes_offset;
|
||||
|
||||
// This table (indexed by area - 1) specifies the ranges of meseta values that can drop from boxes.
|
||||
@@ -248,7 +253,11 @@ public:
|
||||
bool operator==(const CommonItemSet& other) const = default;
|
||||
bool operator!=(const CommonItemSet& other) const = default;
|
||||
|
||||
std::shared_ptr<const Table> get_table(Episode episode, GameMode mode, Difficulty difficulty, uint8_t secid) const;
|
||||
std::shared_ptr<const Table> get_table(
|
||||
Episode episode, GameMode mode, Difficulty difficulty, uint8_t section_id) const;
|
||||
std::shared_ptr<const Table> get_prev_table(
|
||||
Episode episode, GameMode mode, Difficulty difficulty, uint8_t section_id) const;
|
||||
|
||||
phosg::JSON json() const;
|
||||
void print(FILE* stream) const;
|
||||
void print_diff(FILE* stream, const CommonItemSet& other) const;
|
||||
@@ -256,7 +265,8 @@ public:
|
||||
protected:
|
||||
CommonItemSet() = default;
|
||||
|
||||
static uint16_t key_for_table(Episode episode, GameMode mode, Difficulty difficulty, uint8_t secid);
|
||||
static uint16_t key_for_table(Episode episode, GameMode mode, Difficulty difficulty, uint8_t section_id);
|
||||
static std::string json_key_for_table(Episode episode, GameMode mode, Difficulty difficulty, uint8_t section_id);
|
||||
|
||||
std::unordered_map<uint16_t, std::shared_ptr<Table>> tables;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user