Skip to content

Commit

Permalink
[MIRROR] Adds a persistent piggy bank to the vault. (#2444)
Browse files Browse the repository at this point in the history
* [MIRROR] Adds a persistent piggy bank to the vault. (#1447)

* Adds a persistent piggy bank to the vault. (#81900)

## About The Pull Request
This PR adds a **persistent** piggy bank to the station vault that,
while it can hold up to 3300 credits carried between shifts. However,
you can only insert up to 1600 (on top of the 50 creds it
auto-generates) each shift, so it does take a small, itsy bitsy of
patience to fill it to the brim.

## Why It's Good For The Game
I put some effort coding persistent piggy banks when making the
cafeteria PR for the museum away mission a while ago (which apparently
isn't enabled yet because the key holders forgot to ig). It'd be a shame
of all the existing code were only used for a single persistent piggy
bank.

* Adds a persistent piggy bank to the vault.

* 1

---------

Co-authored-by: Ghom <[email protected]>
Co-authored-by: Zergspower <[email protected]>

* our maps

---------

Co-authored-by: NovaBot <[email protected]>
Co-authored-by: Ghom <[email protected]>
Co-authored-by: Zergspower <[email protected]>
Co-authored-by: Iajret <[email protected]>
  • Loading branch information
5 people authored Mar 20, 2024
1 parent 5d6098f commit a32be7c
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 33 deletions.
2 changes: 1 addition & 1 deletion _maps/map_files/Birdshot/birdshot.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -50913,7 +50913,7 @@
/turf/open/misc/sandy_dirt,
/area/station/maintenance/starboard/aft)
"rLN" = (
/obj/structure/safe,
/obj/structure/safe/vault,
/obj/item/lazarus_injector,
/obj/effect/turf_decal/bot_white,
/obj/effect/turf_decal/siding/thinplating_new{
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/Deltastation/DeltaStation2.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -36846,7 +36846,7 @@
/turf/open/floor/iron/large,
/area/station/security/processing)
"jeZ" = (
/obj/structure/safe,
/obj/structure/safe/vault,
/obj/item/clothing/neck/stethoscope,
/obj/item/book{
desc = "An undeniably handy book.";
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/IceBoxStation/IceBoxStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -25357,7 +25357,7 @@
/turf/open/floor/plating,
/area/station/ai_monitored/turret_protected/aisat_interior)
"hPf" = (
/obj/structure/safe,
/obj/structure/safe/vault,
/obj/item/clothing/head/costume/bearpelt,
/obj/item/reagent_containers/cup/glass/drinkingglass/shotglass,
/obj/item/reagent_containers/cup/glass/drinkingglass/shotglass,
Expand Down
23 changes: 19 additions & 4 deletions _maps/map_files/KiloStation2/KiloStation2.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -8423,6 +8423,7 @@
name = "Security Customs Checkpoint"
},
/obj/effect/mapping_helpers/airlock/access/all/security/general,
/obj/structure/cable,
/turf/open/floor/iron/dark,
/area/station/security/checkpoint/customs)
"cQb" = (
Expand All @@ -8439,6 +8440,7 @@
name = "arrivals navigation beacon"
},
/obj/effect/turf_decal/tile/neutral/fourcorners,
/obj/structure/cable,
/turf/open/floor/iron,
/area/station/hallway/secondary/exit/departure_lounge)
"cQt" = (
Expand Down Expand Up @@ -11539,7 +11541,6 @@
/turf/open/floor/plating,
/area/station/maintenance/disposal/incinerator)
"dNx" = (
/obj/structure/cable,
/obj/effect/turf_decal/tile/blue{
dir = 4
},
Expand Down Expand Up @@ -15158,6 +15159,7 @@
"eZL" = (
/obj/effect/landmark/event_spawn,
/obj/effect/turf_decal/tile/neutral/fourcorners,
/obj/structure/cable,
/turf/open/floor/iron,
/area/station/hallway/secondary/exit/departure_lounge)
"fac" = (
Expand Down Expand Up @@ -23813,6 +23815,7 @@
/obj/effect/landmark/start/hangover,
/obj/effect/turf_decal/tile/blue/half/contrasted,
/obj/effect/turf_decal/tile/neutral,
/obj/structure/cable,
/turf/open/floor/iron,
/area/station/hallway/secondary/exit/departure_lounge)
"hIq" = (
Expand Down Expand Up @@ -25456,7 +25459,7 @@
"ifu" = (
/obj/effect/turf_decal/bot,
/obj/effect/decal/cleanable/cobweb,
/obj/structure/safe{
/obj/structure/safe/vault{
pixel_x = 3
},
/obj/item/book{
Expand Down Expand Up @@ -35744,6 +35747,7 @@
/obj/effect/decal/cleanable/dirt,
/obj/effect/landmark/start/hangover,
/obj/effect/turf_decal/tile/neutral/fourcorners,
/obj/structure/cable,
/turf/open/floor/iron,
/area/station/hallway/secondary/exit/departure_lounge)
"luA" = (
Expand Down Expand Up @@ -36401,6 +36405,7 @@
/turf/open/floor/iron,
/area/station/hallway/secondary/exit/departure_lounge)
"lFC" = (
/obj/structure/cable,
/turf/open/floor/iron,
/area/station/hallway/secondary/exit/departure_lounge)
"lFN" = (
Expand Down Expand Up @@ -37201,6 +37206,17 @@
/obj/effect/landmark/start/blueshield,
/turf/open/floor/carpet/royalblack,
/area/station/command/heads_quarters/captain)
"lUb" = (
/obj/machinery/door/firedoor,
/obj/machinery/door/airlock/public/glass{
name = "Departure Lounge"
},
/obj/effect/mapping_helpers/airlock/cyclelink_helper_multi{
cycle_id = "departures-entrance"
},
/obj/structure/cable,
/turf/open/floor/iron/dark,
/area/station/hallway/secondary/exit/departure_lounge)
"lUq" = (
/turf/closed/wall/r_wall/rust,
/area/station/service/chapel/storage)
Expand Down Expand Up @@ -72469,7 +72485,6 @@
/turf/open/floor/grass,
/area/station/security/prison/garden)
"xhJ" = (
/obj/structure/cable,
/obj/effect/turf_decal/tile/red,
/obj/effect/turf_decal/tile/blue{
dir = 4
Expand Down Expand Up @@ -116235,7 +116250,7 @@ wAZ
cQR
eMo
fBh
pIl
lUb
mbE
iSw
nXu
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/MetaStation/MetaStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -41711,7 +41711,7 @@
/turf/open/floor/plating,
/area/station/maintenance/solars/starboard/aft)
"oXK" = (
/obj/structure/safe,
/obj/structure/safe/vault,
/obj/item/storage/briefcase/secure/riches,
/obj/item/storage/backpack/duffelbag/syndie/hitman,
/obj/item/card/id/advanced/silver/reaper,
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/NSSJourney/NSSJourney.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -43982,7 +43982,7 @@
/turf/open/floor/iron,
/area/station/service/hydroponics/garden/abandoned)
"lxv" = (
/obj/structure/safe,
/obj/structure/safe/vault,
/obj/item/clothing/head/costume/bearpelt,
/obj/item/reagent_containers/cup/glass/drinkingglass/shotglass,
/obj/item/reagent_containers/cup/glass/drinkingglass/shotglass,
Expand Down
53 changes: 34 additions & 19 deletions _maps/map_files/NSVBlueshift/Blueshift.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -14715,10 +14715,14 @@
/obj/machinery/computer/pod/old/mass_driver_controller/ordnancedriver/longrange{
pixel_y = 28
},
/obj/machinery/door/window/left/directional/east{
name = "Mass Driver Door";
req_access = list("ordnance")
/obj/structure/railing{
dir = 8
},
/obj/structure/window/reinforced/spawner/directional/east,
/obj/structure/disposalpipe/trunk{
dir = 4
},
/obj/machinery/disposal/bin,
/turf/open/floor/iron/dark,
/area/station/science/ordnance/testlab)
"cLt" = (
Expand Down Expand Up @@ -20538,11 +20542,12 @@
/turf/open/floor/plating,
/area/station/maintenance/department/crew_quarters/bar)
"dTa" = (
/obj/structure/safe,
/obj/item/storage/briefcase/secure,
/obj/structure/safe/vault,
/obj/item/storage/briefcase/secure/riches,
/obj/item/storage/backpack/duffelbag/syndie/hitman,
/obj/item/card/id/advanced/silver/reaper,
/obj/item/lazarus_injector,
/obj/item/gun/energy/disabler,
/obj/item/gun/ballistic/revolver/russian,
/obj/item/ammo_box/a357,
/obj/item/clothing/neck/stethoscope,
Expand All @@ -20552,6 +20557,7 @@
name = "\improper A Simpleton's Guide to Safe-cracking with Stethoscopes"
},
/obj/effect/turf_decal/bot_white/left,
/obj/effect/turf_decal/tile/neutral/fourcorners,
/turf/open/floor/iron/dark,
/area/station/ai_monitored/command/nuke_storage)
"dTd" = (
Expand Down Expand Up @@ -21285,6 +21291,13 @@
},
/turf/open/floor/wood,
/area/station/service/library)
"eag" = (
/obj/structure/disposalpipe/trunk{
dir = 1
},
/obj/structure/disposaloutlet,
/turf/open/floor/catwalk_floor,
/area/station/science/ordnance/testlab)
"eak" = (
/obj/machinery/airalarm/directional/east,
/obj/structure/extinguisher_cabinet/directional/south,
Expand Down Expand Up @@ -37216,6 +37229,7 @@
/obj/effect/turf_decal/stripes/end{
dir = 1
},
/obj/structure/disposalpipe/segment,
/turf/open/floor/catwalk_floor,
/area/station/science/ordnance/testlab)
"hdS" = (
Expand Down Expand Up @@ -47680,11 +47694,11 @@
/turf/open/floor/iron,
/area/station/hallway/primary/starboard)
"jgT" = (
/obj/effect/turf_decal/arrows/red{
pixel_y = 15
/obj/structure/disposalpipe/segment{
dir = 10
},
/turf/open/floor/engine/hull,
/area/space/nearstation)
/turf/open/floor/catwalk_floor,
/area/station/science/ordnance/testlab)
"jgV" = (
/obj/effect/decal/cleanable/dirt{
icon_state = "dirt-flat-1"
Expand Down Expand Up @@ -87761,7 +87775,7 @@
/turf/open/floor/wood,
/area/station/medical/psychology)
"qLn" = (
/obj/effect/turf_decal/stripes/end,
/obj/structure/disposalpipe/segment,
/turf/open/floor/catwalk_floor,
/area/station/science/ordnance/testlab)
"qLp" = (
Expand Down Expand Up @@ -97559,6 +97573,7 @@
/obj/effect/turf_decal/stripes{
dir = 8
},
/obj/structure/disposalpipe/segment,
/turf/open/floor/catwalk_floor,
/area/station/science/ordnance/testlab)
"sFt" = (
Expand Down Expand Up @@ -232983,10 +232998,10 @@ lLn
cLr
eQK
lLn
eQK
eQK
eQK
lLn
lLn
iZl
jgT
bTG
iZl
wfG
Expand Down Expand Up @@ -233237,13 +233252,13 @@ ulx
ulx
ulx
lLn
nGo
jgT
hdL
sFo
qLn
eag
nGo
iuP
iZl
iZl
bTG
iZl
dwJ
Expand Down Expand Up @@ -233497,10 +233512,10 @@ lLn
lLn
lLn
lLn
eQK
eQK
eQK
lLn
lLn
iZl
jgT
bTG
iZl
wfG
Expand Down
6 changes: 6 additions & 0 deletions _maps/map_files/NorthStar/north_star.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -77450,6 +77450,8 @@
"tVp" = (
/obj/machinery/light_switch/directional/north,
/obj/machinery/status_display/ai/directional/east,
/obj/structure/table/reinforced/titaniumglass,
/obj/item/piggy_bank/vault,
/turf/open/floor/circuit,
/area/station/ai_monitored/command/nuke_storage)
"tVq" = (
Expand Down Expand Up @@ -80650,6 +80652,10 @@
/obj/machinery/power/apc/auto_name/directional/north,
/obj/structure/cable,
/obj/machinery/status_display/ai/directional/west,
/obj/structure/table/reinforced/titaniumglass,
/obj/item/maneki_neko{
pixel_y = 4
},
/turf/open/floor/circuit,
/area/station/ai_monitored/command/nuke_storage)
"uNp" = (
Expand Down
14 changes: 11 additions & 3 deletions _maps/map_files/VoidRaptor/VoidRaptor.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -26755,12 +26755,20 @@
/turf/open/floor/catwalk_floor/iron_smooth,
/area/station/maintenance/port)
"hIp" = (
/obj/structure/safe,
/obj/structure/safe/vault,
/obj/item/storage/briefcase/secure/riches,
/obj/item/storage/backpack/duffelbag/syndie/hitman,
/obj/item/card/id/advanced/silver/reaper,
/obj/item/lazarus_injector,
/obj/item/gun/ballistic/automatic/pistol/deagle/gold,
/obj/item/stack/spacecash/c5000,
/obj/item/gun/energy/disabler,
/obj/item/gun/ballistic/revolver/russian,
/obj/item/ammo_box/a357,
/obj/item/clothing/neck/stethoscope,
/obj/item/book{
desc = "An undeniably handy book.";
icon_state = "bookknock";
name = "\improper A Simpleton's Guide to Safe-cracking with Stethoscopes"
},
/obj/effect/turf_decal/bot,
/turf/open/floor/engine,
/area/station/ai_monitored/command/nuke_storage)
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/tramstation/tramstation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -44640,7 +44640,7 @@
/turf/open/floor/iron,
/area/station/construction/mining/aux_base)
"oQO" = (
/obj/structure/safe,
/obj/structure/safe/vault,
/obj/item/clothing/head/costume/bearpelt,
/obj/item/gun/ballistic/revolver/russian,
/obj/item/ammo_box/a357,
Expand Down
21 changes: 20 additions & 1 deletion code/game/objects/items/piggy_bank.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
/obj/item/piggy_bank
name = "piggy bank"
desc = "A pig-shaped money container made of porkelain, oink. <i> Do not throw.</i>" //pun very intended.
desc = "A pig-shaped money container made of porkelain, oink. <i>Do not throw.</i>" //pun very intended.
icon = 'icons/obj/fluff/general.dmi'
icon_state = "piggy_bank"
max_integrity = 8
Expand All @@ -20,6 +20,8 @@
var/datum/callback/persistence_cb
///How much dosh can this piggy bank hold.
var/maximum_value = PAYCHECK_COMMAND * 20
///A limit to much dosh can you put inside this piggy bank each round. If 0, there's no limit. Only applies to persistent piggies.
var/maximum_savings_per_shift = 0
///How much dosh this piggy bank spawns with.
var/initial_value = 0

Expand Down Expand Up @@ -49,6 +51,9 @@
if(initial_value && initial_value + calculate_dosh_amount() <= maximum_value)
new /obj/item/holochip(src, initial_value)

if(maximum_savings_per_shift)
maximum_value = calculate_dosh_amount() + maximum_savings_per_shift

/obj/item/piggy_bank/proc/save_cash()
SSpersistence.save_piggy_bank(src)

Expand Down Expand Up @@ -127,3 +132,17 @@
/obj/item/piggy_bank/museum/Initialize(mapload)
. = ..()
AddComponent(/datum/component/areabound) //do not steal.

/obj/item/piggy_bank/vault
name = "vault piggy bank"
desc = "A pig-shaped money container made of porkelain, containing the station's emergency funds carried between shifts, oink. <i>Do not throw.</i>"
persistence_id = "vault_piggy"
greyscale_colors = COLOR_LIGHT_ORANGE
maximum_value = PAYCHECK_COMMAND * 33
initial_value = PAYCHECK_CREW //it takes about 66 shifts for it to hit its max value on its own.
maximum_savings_per_shift = PAYCHECK_COMMAND * 16 //and 2 if you actively use it.

/obj/item/piggy_bank/vault/Initialize(mapload)
. = ..()
//one piggy bank should exist, preferibly inside the vault's safe.
REGISTER_REQUIRED_MAP_ITEM(1, 1)
8 changes: 8 additions & 0 deletions code/game/objects/structures/safe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,5 +249,13 @@ FLOOR SAFES
. = ..()
AddElement(/datum/element/undertile)

///Special safe for the station's vault. Not explicitly required, but the piggy bank inside it is.
/obj/structure/safe/vault

/obj/structure/safe/vault/Initialize(mapload)
. = ..()
var/obj/item/piggy_bank/vault/piggy = new(src)
space += piggy.w_class

#undef SOUND_CHANCE
#undef BROKEN_THRESHOLD
Loading

0 comments on commit a32be7c

Please sign in to comment.