Files
2eac95b7a1 [MIRROR] Adds a small cafeteria behind the right wing shutters of the museum. (#26766)
* Adds a small cafeteria behind the right wing shutters of the museum. (#81465)

## About The Pull Request
I was thinking to contribute something to the new away mission map to
make it better. Mapping and all takes too much time for me, so I could
do little. Though it comes with its own unique gimmicks.

To reach the cafeteria, one has to complete a couple puzzles.
The first set is opened by inputing the correct PIN on the password
panel beside it. There're several clues to help you guess this fairly
easy puzzle, in the form of several number graffitis, a scrapped piece
of paper full of numbers, and a board filled with colored dots also
found just beside the panel.
The second one is opened by a keycard, and is generally lazier. To find
it, you'll need to do a bit of (toilet) searching.

As for the unique things this PR adds:
- A fire extinguisher... that actually contains welding fuel
- A (dirt-cheap) hotdog vending machine*
- A completely ornamental maneki-neko (that's the name of the
luck-bringing, paw-waving cat figurine)
- A piggy bank that carries money between rounds. It has a cap of 10k
credits worth of holochips, cash and coins, which is pretty high, but
I'm confident people will just destroy it for its contents the moment
they find it. His name is Pigston Swinelord VI.
- More, totally legit and not actually fake bombable walls :^)

*By the by, you can also find it during the national hotdog day.

Screenshots of the new location:
![museum
cafe](https://github.com/tgstation/tgstation/assets/42542238/1c0d93b7-90d5-4459-a48d-81430f0d3613)
![museum
restrooms](https://github.com/tgstation/tgstation/assets/42542238/5a9e049d-6acc-464b-998d-901e43154bae)

## Why It's Good For The Game
You know how most away missions are not that special at all? Yeah,
@ mc-oofert set an example of a pretty decent one actually, if not a tad
small. I thought it could use a touch of another mind actually
contributing to it too, because it deserves it.

Also, this sets the basis for other persistent piggy banks. I don't
think they should all have that 10k cap like this one, perhaps 1k is
enough. Beside, the code that mothblocks did for json database datum is
pretty good, so there is not a whole lot of shitcode here.

## Changelog

🆑
add: Added a cafeteria to the museum away mission, with a few special
things to it. To reach it, you'll have to complete a couple puzzles
however.
map: The museum away mission now has a couple restrooms.
add: Hotdog vending machines may spawn during the National Hot Dog Day.
/🆑

* Adds a small cafeteria behind the right wing shutters of the museum.

---------

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
2024-03-07 08:53:28 -06:00

57 lines
2.4 KiB
Plaintext

///This proc is used to initialize holochips, cash and coins inside our persistent piggy bank.
/datum/controller/subsystem/persistence/proc/load_piggy_bank(obj/item/piggy_bank/piggy)
if(isnull(piggy_banks_database))
piggy_banks_database = new("data/piggy_banks.json")
var/list/data = piggy_banks_database.get_key(piggy.persistence_id)
if(isnull(data))
return
var/total_value = 0
for(var/iteration in 1 to length(data))
var/money_path = text2path(data[iteration])
if(!money_path) //For a reason or another, it was removed.
continue
var/obj/item/spawned
if(ispath(money_path, /obj/item/holochip))
//We want to safely access the assoc of this position and not that of last key that happened to match this one.
var/list/key_and_assoc = data.Copy(iteration, iteration + 1)
var/amount = key_and_assoc["[money_path]"]
spawned = new money_path (piggy, amount)
//the operations are identical to those of chips, but they're different items, so I'll keep them separated.
else if(ispath(money_path, /obj/item/stack/spacecash))
var/list/key_and_assoc = data.Copy(iteration, iteration + 1)
var/amount = key_and_assoc["[money_path]"]
spawned = new money_path (piggy, amount)
else if(ispath(money_path, /obj/item/coin))
spawned = new money_path (piggy)
else
stack_trace("Unsupported path found in the data of a persistent piggy bank. item: [money_path], id:[piggy.persistence_id]")
continue
total_value += spawned.get_item_credit_value()
if(total_value >= piggy.maximum_value)
break
///This proc is used to save money stored inside our persistent the piggy bank for the next time it's loaded.
/datum/controller/subsystem/persistence/proc/save_piggy_bank(obj/item/piggy_bank/piggy)
if(isnull(piggy_banks_database))
return
if(queued_broken_piggy_ids)
for(var/broken_id in queued_broken_piggy_ids)
piggy_banks_database.remove(broken_id)
queued_broken_piggy_ids = null
var/list/data = list()
for(var/obj/item/item as anything in piggy.contents)
var/piggy_value = 1
if(istype(item, /obj/item/holochip))
var/obj/item/holochip/chip = item
piggy_value = chip.credits
else if(istype(item, /obj/item/stack/spacecash))
var/obj/item/stack/spacecash/cash = item
piggy_value = cash.amount
else if(!istype(item, /obj/item/coin))
continue
data += list("[item.type]" = piggy_value)
piggy_banks_database.set_key(piggy.persistence_id, data)