AsyncEclipse / DiscordBot

GNU General Public License v3.0
0 stars 2 forks source link

UpgradeButtons base ship parts #46

Closed TaylorBoyd closed 3 days ago

TaylorBoyd commented 1 month ago

Technically you can remove any amount of ship parts for free before putting another one in. Right now a player could remove base parts to save energy for a bigger gun if they wanted which shouldn't be possible. For example you couldnt build a dread with both ion cannons removed and replaced by a single plasma cannon or something.

Add a variable called "starting_dread_parts" which is just a copy of the "dread_parts" variable, except this starting variable wont ever change. When you offer the player the option to remove an upgrade, you remove the upgrade and then lookup what started in that position and put that in

TaylorBoyd commented 1 month ago

discussion for changing the last portion as well which will have to go with this base parts fix.

which might be necessary if we do the base parts fix otherwise right now it just pulls off the first matching part in the list instead of this code and brining in "old_part" it would just have the index ready from the previous set of buttons. Easy change once we do the base ship fix

TaylorBoyd commented 1 month ago

New code progressed this along. Still a bug that needs to be worked out:

Because the index of the part chosen is always the first instance of the part, some parts cannot be removed if the index points to a base ship part first. For example, if you add an ion cannon to the open cruiser slot, but later want to remove it the index of the removed part always points to the ion cannon in slot 2 which is a base part so cannot be removed.