Add a cash slot to vending machines #2867
Open
+238
−77
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Why / Balance
Gives ghost roles a break.
How to test
Media
Viewing a vending machine as a player character. Note both the balance and cash slot line.
![image](https://private-user-images.githubusercontent.com/166147148/410593110-3e2b9e73-9f03-49a2-9227-ef4a56bd582f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4ODQ3NjMsIm5iZiI6MTczODg4NDQ2MywicGF0aCI6Ii8xNjYxNDcxNDgvNDEwNTkzMTEwLTNlMmI5ZTczLTlmMDMtNDlhMi05MjI3LWVmNGE1NmJkNTgyZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwNlQyMzI3NDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04MmQ2YTIyNmNkYTc2NjQyY2I1M2MwMzViM2RiOTgwODIzZDQ3OGViNmQ0ZGE1OTg4ZjhjZDk0ZWIzZTBkYjQ5JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.Zh4T7sGLoGLwlTjGp2JBKlIfcBOWcyCiAFrxwERVqf0)
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](https://private-user-images.githubusercontent.com/166147148/410593330-b2c936e1-96da-4bc0-a22a-fe51d2e0a189.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4ODQ3NjMsIm5iZiI6MTczODg4NDQ2MywicGF0aCI6Ii8xNjYxNDcxNDgvNDEwNTkzMzMwLWIyYzkzNmUxLTk2ZGEtNGJjMC1hMjJhLWZlNTFkMmUwYTE4OS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwNlQyMzI3NDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01Nzc0OTFjYjRjNWFmNjZiNDQxYjFjYjcyM2ViZjRhZjExZDkzYTI4NmZmMGI0OTIwMzAwZWQyYTE4YTg5MTljJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.fzUT4oHtv21CA0fhPb8ZkjeHdGLGtnWZdry_JC7lVxM)
Requirements
Breaking changes
Changelog
🆑