update 6x9A description
This commit is contained in:
@@ -5459,11 +5459,11 @@ struct G_SelectChallengeModeFailureOption_6x97 {
|
||||
// 6x99: Unknown
|
||||
// This subcommand is completely ignored.
|
||||
|
||||
// 6x9A: Update player stat (not valid on Episode 3)
|
||||
// 6x9A: Update entity stat (not valid on Episode 3)
|
||||
|
||||
struct G_UpdatePlayerStat_6x9A {
|
||||
G_ClientIDHeader header;
|
||||
le_uint16_t client_id2 = 0;
|
||||
struct G_UpdateEntityStat_6x9A {
|
||||
G_EntityIDHeader header;
|
||||
le_uint16_t entity_index = 0;
|
||||
// Values for what:
|
||||
// 0 = subtract HP
|
||||
// 1 = subtract TP
|
||||
@@ -5472,7 +5472,7 @@ struct G_UpdatePlayerStat_6x9A {
|
||||
// 4 = add TP
|
||||
uint8_t what = 0;
|
||||
uint8_t amount = 0;
|
||||
} __packed_ws__(G_UpdatePlayerStat_6x9A, 8);
|
||||
} __packed_ws__(G_UpdateEntityStat_6x9A, 8);
|
||||
|
||||
// 6x9B: Level up all techniques (protected on V3/V4)
|
||||
// Used in battle mode if the rules specify that techniques should level up
|
||||
|
||||
+6
-6
@@ -2520,17 +2520,17 @@ void send_resume_game(shared_ptr<Lobby> l, shared_ptr<Client> ready_client) {
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Game/cheat commands
|
||||
|
||||
static vector<G_UpdatePlayerStat_6x9A> generate_stats_change_subcommands(
|
||||
static vector<G_UpdateEntityStat_6x9A> generate_stats_change_subcommands(
|
||||
uint16_t client_id, PlayerStatsChange stat, uint32_t amount) {
|
||||
if (amount > (0x7BF8 * 0xFF) / sizeof(G_UpdatePlayerStat_6x9A)) {
|
||||
if (amount > (0x7BF8 * 0xFF) / sizeof(G_UpdateEntityStat_6x9A)) {
|
||||
throw runtime_error("stats change command is too large");
|
||||
}
|
||||
|
||||
uint8_t stat_ch = static_cast<uint8_t>(stat);
|
||||
vector<G_UpdatePlayerStat_6x9A> subs;
|
||||
vector<G_UpdateEntityStat_6x9A> subs;
|
||||
while (amount > 0) {
|
||||
uint8_t sub_amount = min<size_t>(amount, 0xFF);
|
||||
subs.emplace_back(G_UpdatePlayerStat_6x9A{{0x9A, 0x02, client_id}, 0, stat_ch, sub_amount});
|
||||
subs.emplace_back(G_UpdateEntityStat_6x9A{{0x9A, 0x02, client_id}, 0, stat_ch, sub_amount});
|
||||
amount -= sub_amount;
|
||||
}
|
||||
return subs;
|
||||
@@ -2539,12 +2539,12 @@ static vector<G_UpdatePlayerStat_6x9A> generate_stats_change_subcommands(
|
||||
void send_player_stats_change(shared_ptr<Client> c, PlayerStatsChange stat, uint32_t amount) {
|
||||
auto l = c->require_lobby();
|
||||
auto subs = generate_stats_change_subcommands(c->lobby_client_id, stat, amount);
|
||||
send_command_vt(l, (subs.size() > 0x400 / sizeof(G_UpdatePlayerStat_6x9A)) ? 0x6C : 0x60, 0x00, subs);
|
||||
send_command_vt(l, (subs.size() > 0x400 / sizeof(G_UpdateEntityStat_6x9A)) ? 0x6C : 0x60, 0x00, subs);
|
||||
}
|
||||
|
||||
void send_player_stats_change(Channel& ch, uint16_t client_id, PlayerStatsChange stat, uint32_t amount) {
|
||||
auto subs = generate_stats_change_subcommands(client_id, stat, amount);
|
||||
send_command_vt(ch, (subs.size() > 0x400 / sizeof(G_UpdatePlayerStat_6x9A)) ? 0x6C : 0x60, 0x00, subs);
|
||||
send_command_vt(ch, (subs.size() > 0x400 / sizeof(G_UpdateEntityStat_6x9A)) ? 0x6C : 0x60, 0x00, subs);
|
||||
}
|
||||
|
||||
void send_remove_negative_conditions(shared_ptr<Client> c) {
|
||||
|
||||
Reference in New Issue
Block a user