allow $unset to remove assist cards too

This commit is contained in:
Martin Michelsen
2025-10-04 09:53:26 -07:00
parent d5f0c6aceb
commit d61cb1106d
3 changed files with 15 additions and 4 deletions
+1 -1
View File
@@ -654,7 +654,7 @@ Some commands only work for clients not in proxy sessions. The chat commands are
* `$warpall <floor-id>`: Warp everyone in the game to the given floor. You must be the leader to use this command, unless you're on the proxy. * `$warpall <floor-id>`: Warp everyone in the game to the given floor. You must be the leader to use this command, unless you're on the proxy.
* `$next`: Warp yourself to the next floor. * `$next`: Warp yourself to the next floor.
* `$item <desc>` (or `$i <desc>`): Create an item. `desc` may be a description of the item (e.g. "Hell Saber +5 0/10/25/0/10") or a string of hex data specifying the item code. Item codes are 16 hex bytes; at least 2 bytes must be specified, and all unspecified bytes are zeroes. If you are on the proxy, you must not be using Blue Burst for this command to work. On the game server, this command works for all versions. * `$item <desc>` (or `$i <desc>`): Create an item. `desc` may be a description of the item (e.g. "Hell Saber +5 0/10/25/0/10") or a string of hex data specifying the item code. Item codes are 16 hex bytes; at least 2 bytes must be specified, and all unspecified bytes are zeroes. If you are on the proxy, you must not be using Blue Burst for this command to work. On the game server, this command works for all versions.
* `$unset <index>` (non-proxy only): In an Episode 3 battle, removes one of your set cards from the field. `<index>` is the index of the set card as it appears on your screen - 1 is the card next to your SC's icon, 2 is the card to the right of 1, etc. This does not cause a Hunters-side SC to lose HP, as they normally do when their items are destroyed. * `$unset <index>` (non-proxy only): In an Episode 3 battle, removes one of your set cards from the field. `<index>` is the index of the set card as it appears on your screen - 1 is the card next to your SC's icon, 2 is the card to the right of 1, etc. This does not cause a Hunters-side SC to lose HP, as they normally do when their items are destroyed. You can also destroy the assist card set on yourself with `$unset 0`.
* `$dropmode [mode]` (proxy only): Change the way item drops behave in the current game, if you are not on BB. Unlike the game server version of this command, using this on the proxy requires cheats to be enabled. This works by intercepting the drop requests sent to and from the leader. (So, if you are the leader and not using server drop mode on the remote server, it affects the entire game; otherwise, it affects only items generated by your actions.) `mode` can be `none` (no drops), `default` (normal drops), or `proxy` (use newserv's drop tables instead of the remote server's). If `mode` is not given, tells you the current drop mode without changing it. * `$dropmode [mode]` (proxy only): Change the way item drops behave in the current game, if you are not on BB. Unlike the game server version of this command, using this on the proxy requires cheats to be enabled. This works by intercepting the drop requests sent to and from the leader. (So, if you are the leader and not using server drop mode on the remote server, it affects the entire game; otherwise, it affects only items generated by your actions.) `mode` can be `none` (no drops), `default` (normal drops), or `proxy` (use newserv's drop tables instead of the remote server's). If `mode` is not given, tells you the current drop mode without changing it.
* Aesthetic commands * Aesthetic commands
+6 -2
View File
@@ -2697,8 +2697,12 @@ ChatCommandDefinition cc_unset(
throw precondition_failed("$C6Battle has not\nyet begun"); throw precondition_failed("$C6Battle has not\nyet begun");
} }
size_t index = stoull(a.text) - 1; size_t index = stoull(a.text);
l->ep3_server->force_destroy_field_character(a.c->lobby_client_id, index); if (index == 0) {
l->ep3_server->force_replace_assist_card(a.c->lobby_client_id, 0xFFFF);
} else {
l->ep3_server->force_destroy_field_character(a.c->lobby_client_id, index - 1);
}
co_return; co_return;
}); });
+8 -1
View File
@@ -592,7 +592,14 @@ void Server::force_replace_assist_card(uint8_t client_id, uint16_t card_id) {
if (!ps) { if (!ps) {
throw runtime_error("player does not exist"); throw runtime_error("player does not exist");
} }
ps->replace_assist_card_by_id(card_id); if (card_id == 0xFFFF) {
ps->discard_set_assist_card();
this->check_for_destroyed_cards_and_send_6xB4x05_6xB4x02();
this->check_for_battle_end();
} else {
ps->replace_assist_card_by_id(card_id);
}
} }
void Server::force_destroy_field_character(uint8_t client_id, size_t visible_index) { void Server::force_destroy_field_character(uint8_t client_id, size_t visible_index) {