Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Med Vendor Rebalance #6103

Merged
merged 34 commits into from
May 15, 2024
Merged

Med Vendor Rebalance #6103

merged 34 commits into from
May 15, 2024

Conversation

Drulikar
Copy link
Contributor

@Drulikar Drulikar commented Apr 7, 2024

About the pull request

This PR is a follow up to #5677 and does many things:

  • Disables splitting of medical items.
  • In the case of splints, to avoid splitting them via applying and removing them, recovered splints are considered contaminated. However, you can get them to not be deemed contaminated if you form a full stack with them.
  • Increases the starting stock of several medical vendors, also shifting more of the bottles to chem vendors.
  • Adds periodic automatic restocking to med linked medical vendors if they are operable.
  • Initializes groundside medical vendors with randomly reduced stock amounts and reagents (if not on WO mode).
  • Disables refilling medical items (as in use 3 splints on a vendor and get upgraded to 5). Some conveyed to me they would rather lose the refilling mechanic over the ability to split stacks.
  • Autoinjectors and bottles can still be refilled using now internal reagents tanks in the vendor. If the vendor has a medlink this will periodically recharge. The UI also displays the reagent amount much like the chem dispenser does.
  • Adds the ability to bulk restock vendors with storage items. Click drag the pack onto the vendor and all items that can restock the vendor will be placed in the vendor.
  • Adds the ability to bulk restock medical vendors with restock carts ordered from requisitions. There are two variants: one that restocks the items and another that restocks the internal reagent tanks. They can be disassembled with a wrench.
  • Adds the ability to restock partial stacks.
  • Doubles the starting energy amount for chemical dispensers by increasing the max energy amount in chem_storage and increasing the boost gained when a chemical dispenser is connected to the chem_storage.
  • Discounts all requisitions medical supplies.
  • Enables initial population scaling for blood bags (of note it wasn't intended these could restock automatically with a medlink; the supply restock cart does work on them though and I intend to keep this)

This PR also fixes some miscellaneous things:

  • Using a item on a medvendor will now try to fill the vendor with that item (rather than only performing this action with a mouse drop).
  • Fixes some of the grammar issues regarding restocking.
  • Fixes some unused squad prep vendors that were not properly adding headsets to their list of items.
  • Fixes removing nano splints creating splints with 0 amount.
  • Fixes xenos being able to restock vendors.
  • Tweaks the alignment of the images of items in vendors to be more centered vertically.
  • Tweaks the widths of tables in vendors.
  • Fixes USCM theme vendors not showing alternating backgrounds for odd rows

Of note: The restock cart sprites are temporary.

Explain why it's good for the game

The ultimate goal of this PR is to remove the infinite quantity of medical items groundside so there is more pressure on requisitions to keep groundside supplied. See https://github.com/orgs/cmss13-devs/projects/6/views/1?pane=issue&itemId=23005516 for a broader picture of the changes that this PR is helping push towards. I will finalize a design document once the remaining aspects for requisitions are decided.

It also is a little goofy that a colony that got decimated by a xenomorph infestation would have fully stocked medical supplies.

Testing Photographs and Procedure

Screenshots & Videos

Original implementation: https://youtu.be/6ES88Zre6Gg

Revised implementation: https://youtu.be/7Iyy3eKx3Ng

Bulk restocking using inventories:

bulk.restocking.mp4

Restock carts (temporary sprites for now):

image

UI polishing:
image
image

Changelog

🆑 Drathek
balance: Increased the starting stock of most medical vendors but shifts some reagent bottles from weymeds to weychems
balance: Med linked medical vendors will now automatically restock items (requires 20 minutes from round start) and reagents (no time requirement) periodically if operable
balance: Groundside medical vendors will now have random stock and reagents missing if its not WO
balance: Partial medical item stacks can no longer be refilled at vendors (autoinjectors and bottles can still be refilled pulling from internal reagent tanks)
balance: Doubles the starting energy for chemical dispensers
balance: Discounts all requisitions medical supplies
ui: Added reagent amount display to vendors that have internal reagent tanks and tweaked the icon positioning of items slightly
ui: Tweaked table widths in vendors
ui: Fixes USCM theme vendors not showing different backgrounds for odd rows
qol: Restocking a medvendor manually can now be done with just a click rather than only via mouse drop
qol: Restocking a vendor can now be performed in bulk from a storage inventory - click drag the inventory to the vendor and you will restock all the items you can
add: Vendors can accept partial stacks when restocking - when an item has a partial quantity for a stack it is denoted with an asterisk
add: Added two restock carts for bulk restocking medical vendors, one for items and the other for reagents (purchasable from requisitions - disassemble with a wrench - temporary sprites for now)
fix: Fixed some currently unused squad prep vendors
fix: Removing nano splints on a person no longer creates a 0 amount normal splint
spellcheck: Tweaked some restock messages and vendor descriptions
/:cl:

@Drulikar Drulikar added Balance Approved This PR has had its balance and gameplay-affecting aspects approved. Cry to the Head-maint about it. Roadmap "I think you're holding it upside down" labels Apr 7, 2024
@github-actions github-actions bot added Balance You need to be a professional veteran game maintainer to comprehend what is being done here. Quality of Life Make the game harder to play Fix Fix one bug, make ten more Grammar and Formatting Fixes the codebase's tpyos and grammatical's errors labels Apr 7, 2024
@Drulikar Drulikar added the Testmerge Candidate we'll test this while you're asleep and the server has 10 players label Apr 7, 2024
cm13-github added a commit that referenced this pull request Apr 7, 2024
cm13-github added a commit that referenced this pull request Apr 7, 2024
cm13-github added a commit that referenced this pull request Apr 7, 2024
cm13-github added a commit that referenced this pull request Apr 7, 2024
@Diegoflores31

This comment was marked as off-topic.

@HeresKozmos

This comment was marked as off-topic.

@Paperbell
Copy link

At last, my stingy idiot self will be free to spend my loadout points on medical supplies rather than buying basic first aid kits and abandoning my team to duplicate stuff.

Is it possible to make the medical items in the med vendor count each individual one instead? So a med vendor that would have 10 stacks of trauma kits would now show 100 trauma kits, and if you wanted to refill a stack consisting of 1 trauma kit, it would take 9 from the 100 trauma kits. Or will this be too resource intensive or difficult to do without breaking a bunch of other features?

About the splints, will there still be the option to create infinite contaminated stacks? It might never be used due to being inefficient, but it could feel immersion-breaking.

If the stacks can't be turned into individuals in the vendors, I think it's okay to remove stack refills since this pr already adds periodic restocking of medlinked vendors.

@Wintermote Wintermote mentioned this pull request Apr 8, 2024
3 tasks
@Skatuk

This comment was marked as off-topic.

cm13-github added a commit that referenced this pull request Apr 8, 2024
@Drulikar
Copy link
Contributor Author

Drulikar commented Apr 8, 2024

Is it possible to make the medical items in the med vendor count each individual one instead? So a med vendor that would have 10 stacks of trauma kits would now show 100 trauma kits, and if you wanted to refill a stack consisting of 1 trauma kit, it would take 9 from the 100 trauma kits. Or will this be too resource intensive or difficult to do without breaking a bunch of other features?

Its not that it would be resource intensive or something, but vendors don't actually hold those items in their inventory. They just have some amount of the base item. However I will be trying the exploit fix another way where splitting will become possible again, but no vendor can refill stacks.

About the splints, will there still be the option to create infinite contaminated stacks? It might never be used due to being inefficient, but it could feel immersion-breaking.

So the contaminated aspect would only come in play if you try to refill a "contaminated" stack of splints at a vendor. It wouldn't prevent use in any other way. It was purely as a measure to shore up the issue of still being able to split the stack by putting splints on a person and then removing the splints to split the stack. When the splints got removed in this way - that new stack is deemed "contaminated" to disallow refilling that stack until it ever got merged into a full stack again. But this will be removed as splitting stacks will return but refilling removed.

cm13-github added a commit that referenced this pull request Apr 8, 2024
cm13-github added a commit that referenced this pull request Apr 8, 2024
cm13-github added a commit that referenced this pull request May 10, 2024
cm13-github added a commit that referenced this pull request May 10, 2024
cm13-github added a commit that referenced this pull request May 10, 2024
cm13-github added a commit that referenced this pull request May 10, 2024
cm13-github added a commit that referenced this pull request May 11, 2024
cm13-github added a commit that referenced this pull request May 11, 2024
cm13-github added a commit that referenced this pull request May 13, 2024
cm13-github added a commit that referenced this pull request May 14, 2024
cm13-github added a commit that referenced this pull request May 14, 2024
@cm13-github cm13-github added the Merge Conflict PR can't be merged because it touched too much code label May 15, 2024
@cm13-github
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

# Conflicts:
#	code/game/machinery/vending/vendor_types/medical.dm
@cm13-github cm13-github removed the Merge Conflict PR can't be merged because it touched too much code label May 15, 2024
@cm13-github
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

cm13-github added a commit that referenced this pull request May 15, 2024
@harryob harryob added this pull request to the merge queue May 15, 2024
Merged via the queue into cmss13-devs:master with commit 71f0806 May 15, 2024
27 checks passed
cm13-github added a commit that referenced this pull request May 15, 2024
@iloveloopers
Copy link
Contributor

bro forgot to remove it from TMs

@Drulikar Drulikar deleted the Med_Vendor_Rework branch May 16, 2024 08:28
github-merge-queue bot pushed a commit that referenced this pull request Oct 13, 2024
# About the pull request

This PR fixes injectors & crystals that were fully emptied from being
refilled in any medical vendor. I'm not sure if initial volume for
injectors changed, or what situation exactly this check was trying to
handle, but as far as I can tell it can be removed to patch this exploit
without issue.

Of note, emergency injectors did not used to be refilled prior to #6103,
nor was it my intention to allow them to. The chem_refill list for each
vendor is what whitelists items that can be refilled. However I am aware
that this bug has existed a significant amount of time so I will be
evaluating if it should return in some way.

# Explain why it's good for the game

Reagents are intended to be withdrawn from vendors, and only from
vendors that refill those reagents.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

https://youtu.be/QpDpRhtcQuM

</details>


# Changelog
:cl: Drathek
fix: Fixed autoinjectors not reducing vendor reagents on refill if they
were fully emptied.
fix: Fixed crystals (and any other reagent container not whitelisted)
from being refilled in vendors
balance: This means emergency injectors do not refill again.
balance: Added tricord hypospray chem refill support to Wey-Med Plus
/:cl:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Balance Approved This PR has had its balance and gameplay-affecting aspects approved. Cry to the Head-maint about it. Balance You need to be a professional veteran game maintainer to comprehend what is being done here. Feature Feature coder badge Fix Fix one bug, make ten more Grammar and Formatting Fixes the codebase's tpyos and grammatical's errors Quality of Life Make the game harder to play Roadmap "I think you're holding it upside down" Stale Exempt PR can't go stale Testmerge Candidate we'll test this while you're asleep and the server has 10 players UI deletes nanoui/html
Projects
None yet
Development

Successfully merging this pull request may close these issues.