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

[MIRROR] Adds a persistent piggy bank to the vault. #2444

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _maps/map_files/Birdshot/birdshot.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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{
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 @@ -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.";
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 @@ -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,
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 @@ -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,
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 @@ -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" = (
Expand Down Expand Up @@ -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,
Expand All @@ -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" = (
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -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" = (
Expand Down Expand Up @@ -232863,10 +232878,10 @@ lLn
cLr
eQK
lLn
eQK
eQK
eQK
lLn
lLn
iZl
jgT
bTG
iZl
wfG
Expand Down Expand Up @@ -233117,13 +233132,13 @@ ulx
ulx
ulx
lLn
nGo
jgT
hdL
sFo
qLn
eag
nGo
iuP
iZl
iZl
bTG
iZl
dwJ
Expand Down Expand Up @@ -233377,10 +233392,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 @@ -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" = (
Expand Down Expand Up @@ -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" = (
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 @@ -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)
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 @@ -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,
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 @@ -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
Loading
Loading