From e9fbd302d3ae716a3936b35536fc149c5c41bc76 Mon Sep 17 00:00:00 2001 From: NovaBot <154629622+NovaBot13@users.noreply.github.com> Date: Sat, 16 Mar 2024 14:23:13 -0400 Subject: [PATCH 1/2] [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 <42542238+Ghommie@users.noreply.github.com> Co-authored-by: Zergspower --- _maps/map_files/Birdshot/birdshot.dmm | 2 +- .../map_files/Deltastation/DeltaStation2.dmm | 2 +- .../map_files/IceBoxStation/IceBoxStation.dmm | 2 +- _maps/map_files/MetaStation/MetaStation.dmm | 2 +- _maps/map_files/NSVBlueshift/Blueshift.dmm | 53 ++++++++++++------- _maps/map_files/NorthStar/north_star.dmm | 6 +++ _maps/map_files/VoidRaptor/VoidRaptor.dmm | 14 +++-- _maps/map_files/tramstation/tramstation.dmm | 2 +- code/game/objects/items/piggy_bank.dm | 21 +++++++- code/game/objects/structures/safe.dm | 8 +++ code/modules/unit_tests/required_map_items.dm | 1 + 11 files changed, 85 insertions(+), 28 deletions(-) diff --git a/_maps/map_files/Birdshot/birdshot.dmm b/_maps/map_files/Birdshot/birdshot.dmm index 49deea1fe47..eeb946983e8 100644 --- a/_maps/map_files/Birdshot/birdshot.dmm +++ b/_maps/map_files/Birdshot/birdshot.dmm @@ -50925,7 +50925,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{ diff --git a/_maps/map_files/Deltastation/DeltaStation2.dmm b/_maps/map_files/Deltastation/DeltaStation2.dmm index 30e548835e8..20e27418cb0 100644 --- a/_maps/map_files/Deltastation/DeltaStation2.dmm +++ b/_maps/map_files/Deltastation/DeltaStation2.dmm @@ -36847,7 +36847,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."; diff --git a/_maps/map_files/IceBoxStation/IceBoxStation.dmm b/_maps/map_files/IceBoxStation/IceBoxStation.dmm index 6637caabd3e..0e05c322e8a 100644 --- a/_maps/map_files/IceBoxStation/IceBoxStation.dmm +++ b/_maps/map_files/IceBoxStation/IceBoxStation.dmm @@ -25360,7 +25360,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, diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index 7ac2807b480..aa526f33de7 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -41714,7 +41714,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, diff --git a/_maps/map_files/NSVBlueshift/Blueshift.dmm b/_maps/map_files/NSVBlueshift/Blueshift.dmm index 27d29fdd5f1..733be852bf7 100644 --- a/_maps/map_files/NSVBlueshift/Blueshift.dmm +++ b/_maps/map_files/NSVBlueshift/Blueshift.dmm @@ -14706,10 +14706,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" = ( @@ -20520,11 +20524,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, @@ -20534,6 +20539,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" = ( @@ -21266,6 +21272,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, @@ -37187,6 +37200,7 @@ /obj/effect/turf_decal/stripes/end{ dir = 1 }, +/obj/structure/disposalpipe/segment, /turf/open/floor/catwalk_floor, /area/station/science/ordnance/testlab) "hdS" = ( @@ -47630,11 +47644,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" @@ -87678,7 +87692,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" = ( @@ -97461,6 +97475,7 @@ /obj/effect/turf_decal/stripes{ dir = 8 }, +/obj/structure/disposalpipe/segment, /turf/open/floor/catwalk_floor, /area/station/science/ordnance/testlab) "sFt" = ( @@ -232863,10 +232878,10 @@ lLn cLr eQK lLn +eQK +eQK +eQK lLn -lLn -iZl -jgT bTG iZl wfG @@ -233117,13 +233132,13 @@ ulx ulx ulx lLn -nGo +jgT hdL sFo qLn +eag +nGo iuP -iZl -iZl bTG iZl dwJ @@ -233377,10 +233392,10 @@ lLn lLn lLn lLn +eQK +eQK +eQK lLn -lLn -iZl -jgT bTG iZl wfG diff --git a/_maps/map_files/NorthStar/north_star.dmm b/_maps/map_files/NorthStar/north_star.dmm index e83a6941c88..794c0080837 100644 --- a/_maps/map_files/NorthStar/north_star.dmm +++ b/_maps/map_files/NorthStar/north_star.dmm @@ -77446,6 +77446,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" = ( @@ -80646,6 +80648,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" = ( diff --git a/_maps/map_files/VoidRaptor/VoidRaptor.dmm b/_maps/map_files/VoidRaptor/VoidRaptor.dmm index f0f06657a82..b680e54049a 100644 --- a/_maps/map_files/VoidRaptor/VoidRaptor.dmm +++ b/_maps/map_files/VoidRaptor/VoidRaptor.dmm @@ -26753,12 +26753,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) diff --git a/_maps/map_files/tramstation/tramstation.dmm b/_maps/map_files/tramstation/tramstation.dmm index ae87f6f6357..e4edbf305c6 100644 --- a/_maps/map_files/tramstation/tramstation.dmm +++ b/_maps/map_files/tramstation/tramstation.dmm @@ -44635,7 +44635,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, diff --git a/code/game/objects/items/piggy_bank.dm b/code/game/objects/items/piggy_bank.dm index 012ff91b021..8d50e8a39e8 100644 --- a/code/game/objects/items/piggy_bank.dm +++ b/code/game/objects/items/piggy_bank.dm @@ -4,7 +4,7 @@ */ /obj/item/piggy_bank name = "piggy bank" - desc = "A pig-shaped money container made of porkelain, oink. Do not throw." //pun very intended. + desc = "A pig-shaped money container made of porkelain, oink. Do not throw." //pun very intended. icon = 'icons/obj/fluff/general.dmi' icon_state = "piggy_bank" max_integrity = 8 @@ -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 @@ -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) @@ -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. Do not throw." + 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) diff --git a/code/game/objects/structures/safe.dm b/code/game/objects/structures/safe.dm index 9c1a8f1c4f3..a000dee8cd6 100644 --- a/code/game/objects/structures/safe.dm +++ b/code/game/objects/structures/safe.dm @@ -247,5 +247,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 diff --git a/code/modules/unit_tests/required_map_items.dm b/code/modules/unit_tests/required_map_items.dm index 5cbef645391..73499c83b6d 100644 --- a/code/modules/unit_tests/required_map_items.dm +++ b/code/modules/unit_tests/required_map_items.dm @@ -21,6 +21,7 @@ expected_types += /mob/living/carbon/human/species/monkey/punpun expected_types += /obj/machinery/computer/communications expected_types += /obj/machinery/drone_dispenser + expected_types += /obj/item/piggy_bank/vault /datum/unit_test/required_map_items/Run() setup_expected_types() From 1a3f7f150610c9f516af2b3e6552029380601c85 Mon Sep 17 00:00:00 2001 From: Iajret Date: Tue, 19 Mar 2024 12:08:05 +0300 Subject: [PATCH 2/2] our maps --- _maps/map_files/KiloStation2/KiloStation2.dmm | 23 +++++++++++++++---- _maps/map_files/NSSJourney/NSSJourney.dmm | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/_maps/map_files/KiloStation2/KiloStation2.dmm b/_maps/map_files/KiloStation2/KiloStation2.dmm index 34c1a35256f..5b1ec1757ec 100644 --- a/_maps/map_files/KiloStation2/KiloStation2.dmm +++ b/_maps/map_files/KiloStation2/KiloStation2.dmm @@ -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" = ( @@ -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" = ( @@ -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 }, @@ -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" = ( @@ -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" = ( @@ -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{ @@ -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" = ( @@ -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" = ( @@ -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) @@ -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 @@ -116235,7 +116250,7 @@ wAZ cQR eMo fBh -pIl +lUb mbE iSw nXu diff --git a/_maps/map_files/NSSJourney/NSSJourney.dmm b/_maps/map_files/NSSJourney/NSSJourney.dmm index fffdc892162..e5b6c7470cb 100644 --- a/_maps/map_files/NSSJourney/NSSJourney.dmm +++ b/_maps/map_files/NSSJourney/NSSJourney.dmm @@ -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,