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

Add a cash slot to vending machines #2867

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

whatston3
Copy link
Contributor

About the PR

Adds a cash slot to vending machines, so any player character capable of complex interactions (e.g. Pun Pun) that lacks a bank account can make purchases from vendors.

The cash slot is optional, so for machines that don't want to support them (e.g. the ContraVend pending #2687), they can be removed. Currency is currently configurable, though the bank account side of things is always valued in spesos, and there is no configuration to stop checking the bank account.

This is a bit jankier than I'd like in its state as of writing, scrutinize this one a bit harder than usual.

Other related changes:

  1. Bank ATMs now have a message when failing to insert an item into them (minor QOL)
  2. Bank ATMs no longer accept items with Currency component (server-only, no more funny telecrystals in the machine)
  3. Fixing warnings in VendingMachineSystem.
  4. Admin logs for vendor purchases now happen on eject regardless of the state of the bank withdrawal/cash slot check.

Why / Balance

Gives ghost roles a break.

How to test

  1. Spawn as a player character. Buy something from a vendor as normal. Should work fine.
  2. Insert a few spesos (less than a purchase). Try to purchase something that costs more than the cash in machine but less than your bank balance - the cash should be removed and the remainder should come from your bank account.
  3. Insert a few spesos, try to buy an item that costs more than you have in your bank. It should not work.
  4. Repeat step 3 but ensure that your bank plus the money in the machine is exactly the cost of the item, it should work, the money should be gone, and your bank balance should be zero.
  5. Spawn and control Pun Pun.
  6. Insert some money in the machine, try to buy something more expensive than you

Media

Viewing a vending machine as a player character. Note both the balance and cash slot line.
image

Viewing that same machine (with the same cash in the slot) as Yip Yip. Note the lack of a balance. Vending still works in this case.
image

Requirements

Breaking changes

Changelog

🆑

  • add: Vending machines now have cash slots for roles without bank accounts to insert money to buy items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant