add cheat command to remove an FC in an Ep3 battle
This commit is contained in:
@@ -536,6 +536,31 @@ bool Server::check_for_battle_end() {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void Server::force_destroy_field_character(uint8_t client_id, size_t visible_index) {
|
||||
auto ps = this->player_states[client_id];
|
||||
|
||||
// TODO: Is it possible for there to be gaps in the set cards array? If not,
|
||||
// we could just do a direct array lookup here instead of this loop
|
||||
shared_ptr<Card> set_card = nullptr;
|
||||
for (size_t set_index = 0; set_index < 8; set_index++) {
|
||||
if (!ps->set_cards[set_index]) {
|
||||
continue;
|
||||
}
|
||||
if (visible_index == 0) {
|
||||
set_card = ps->set_cards[set_index];
|
||||
break;
|
||||
} else {
|
||||
visible_index--;
|
||||
}
|
||||
}
|
||||
|
||||
if (set_card) {
|
||||
set_card->card_flags |= 2;
|
||||
this->check_for_destroyed_cards_and_send_6xB4x05_6xB4x02();
|
||||
this->check_for_battle_end();
|
||||
}
|
||||
}
|
||||
|
||||
void Server::force_battle_result(uint8_t specified_client_id, bool set_winner) {
|
||||
auto specified_ps = this->player_states[specified_client_id];
|
||||
for (size_t z = 0; z < 4; z++) {
|
||||
|
||||
@@ -100,9 +100,11 @@ public:
|
||||
this->send(&cmd, cmd.header.size * 4);
|
||||
}
|
||||
void send(const void* data, size_t size) const;
|
||||
|
||||
void send_commands_for_joining_spectator(Channel& ch, bool is_trial) const;
|
||||
|
||||
void force_battle_result(uint8_t surrendered_client_id, bool set_winner);
|
||||
void force_destroy_field_character(uint8_t client_id, size_t set_index);
|
||||
|
||||
__attribute__((format(printf, 2, 3))) void send_debug_message_printf(const char* fmt, ...) const;
|
||||
__attribute__((format(printf, 2, 3))) void send_info_message_printf(const char* fmt, ...) const;
|
||||
void send_debug_command_received_message(
|
||||
@@ -124,7 +126,6 @@ public:
|
||||
uint16_t card_id_for_card_ref(uint16_t card_ref) const;
|
||||
bool card_ref_is_empty_or_has_valid_card_id(uint16_t card_ref) const;
|
||||
bool check_for_battle_end();
|
||||
void force_battle_result(uint8_t surrendered_client_id, bool set_winner);
|
||||
void check_for_destroyed_cards_and_send_6xB4x05_6xB4x02();
|
||||
bool check_presence_entry(uint8_t client_id) const;
|
||||
void clear_player_flags_after_dice_phase();
|
||||
|
||||
Reference in New Issue
Block a user