Skip to content

Commit

Permalink
You've Got Mail! Adds Mail system (#22269)
Browse files Browse the repository at this point in the history
* heres the mail it never fails

Adds envelopes and its functions.

* It makes me want to wag my tail

Adds new envelope sprites courtesy of McRamon, makes mail bags and envelopess able to be carried by cargo clothing.

* when it comes i want to whail

Makes Wizard and Nukie equip change to off station role. Adds mail crates and functionality/logging for randomly choosing recipients of mail.

* MAAAAAAAAAAAAAAIIIL!!!!

Adds functionality for the mail scanner alongside sounds. Begins the process of making mail arrive on the shuttle.

* MAIL

* THE MAILMAN IS HERE

* MAIL IS REAL

* Give me an M, give me an A, give me an I, give me an L. What does that spell? MAIL.

Finalises pre-review mail features, adding the mail scanner to cargo tech loadout/autolathe.

* Update code/game/gamemodes/nuclear/nuclear.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/shuttle/supply.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/jobs/job/support.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/objects/items/weapons/storage/bags.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/objects/items/weapons/storage/bags.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/game/objects/structures/crates_lockers/crates.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/controllers/subsystem/SSeconomy.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* check out what you got now

Removes unused sprite bloat.

* Update code/game/objects/mail.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/game/objects/mail.dm

* Update code/game/objects/mail.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/game/objects/mail.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* Update code/game/objects/mail.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/game/objects/mail.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>

* First few Contra reviews

* Second batch

* Cl doesn't fail anymore

* Even more fucking reviews

* Doesn't quite work yet but we're almost there

* WHEN DOES IT EEEEEND

* I have no energy to make a blues clues reference

More commits to respond to reviews

* God I miss Steve

Adds hand sprites to mail scanners

* Woooo Mail works again

* Science envelopes

* Update code/game/objects/mail.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* my god it worked

II hate it

* Bread and Circuses

splits up service envelopes into two categories, addresses other reviews.

* Lewc review - needs testing

* Almost there

Changing lists and more.

* Last fix

* IT IS ALL WORKING NOW

* Mail. Is. Done.
Final pass.

* Update code/controllers/subsystem/SSeconomy.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/game/objects/mail.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* The fix

* Just this one too

* Lewc review

* mail?

yeah

* Begone, ye powersink

* Sirryan review

* Update code/__DEFINES/economy_defines.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/game/objects/mail.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/game/objects/mail.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* Update code/controllers/subsystem/SSeconomy.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* Update code/game/objects/mail.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* Update code/game/objects/mail.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* Wjpp[s

* Removes useless comment

* We ball

---------

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
  • Loading branch information
6 people authored Sep 19, 2023
1 parent e09be2b commit ecfaa26
Show file tree
Hide file tree
Showing 26 changed files with 380 additions and 20 deletions.
5 changes: 4 additions & 1 deletion code/__DEFINES/economy_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define DEPARTMENT_BALANCE_HIGH 1500

/////BASE PAY AMOUNTS///
#define CREW_BASE_PAY_LOW 125
#define CREW_BASE_PAY_LOW 100
#define CREW_PAY_MEDIUM 250
#define CREW_PAY_HIGH 300

Expand Down Expand Up @@ -62,3 +62,6 @@
#define SUPPLY_VEND 9

#define DEFAULT_CRATE_VALUE 15

/// mail deliveries
#define MAIL_DELIVERY_BONUS 100
6 changes: 6 additions & 0 deletions code/__DEFINES/misc_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -552,3 +552,9 @@
#define BLOCKED_BURROWS "Blocked Burrows"
#define CLASSIC_CAVES "Classic Caves"
#define DEADLY_DEEPROCK "Deadly Deeprock"

// Request console message priority defines

#define RQ_NONEW_MESSAGES 0 // RQ_NONEWMESSAGES = no new message
#define RQ_NORMALPRIORITY 1 // RQ_NORMALPRIORITY = normal priority
#define RQ_HIGHPRIORITY 2 // RQ_HIGHPRIORITY = high priority
8 changes: 8 additions & 0 deletions code/controllers/subsystem/SSeconomy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ SUBSYSTEM_DEF(economy)
var/next_paycheck_delay = 0
/// total paydays this round
var/payday_count = 0
/// Time until the next mail shipment
var/next_mail_delay = 0

var/global_paycheck_bonus = 0
var/global_paycheck_deduction = 0
Expand Down Expand Up @@ -132,6 +134,7 @@ SUBSYSTEM_DEF(economy)
centcom_message = "<center>---[station_time_timestamp()]---</center><br>Remember to stamp and send back the supply manifests.<hr>"

next_paycheck_delay = 30 MINUTES + world.time
next_mail_delay = 15 MINUTES + world.time

/datum/controller/subsystem/economy/fire()
if(next_paycheck_delay <= world.time)
Expand All @@ -141,6 +144,11 @@ SUBSYSTEM_DEF(economy)
next_data_check = 10 MINUTES + world.time
record_economy_data()
process_job_tasks()
if(next_mail_delay <= world.time)
if(!is_admin_level(SSshuttle.supply.z) || SSshuttle.supply.areaInstance.moving)
return
next_mail_delay = 15 MINUTES + world.time
SSshuttle.mail_delivery()

/datum/controller/subsystem/economy/proc/record_economy_data()
economy_data["totalcash"] += total_space_cash
Expand Down
21 changes: 21 additions & 0 deletions code/controllers/subsystem/SSshuttles.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ SUBSYSTEM_DEF(shuttle)

//supply shuttle stuff
var/obj/docking_port/mobile/supply/supply
/// Supply shuttle turfs to make mail be put down faster
var/static/list/supply_shuttle_turfs = list()

var/list/hidden_shuttle_turfs = list() //all turfs hidden from navigation computers associated with a list containing the image hiding them and the type of the turf they are pretending to be
var/list/hidden_shuttle_turf_images = list() //only the images from the above list
Expand Down Expand Up @@ -284,4 +286,23 @@ SUBSYSTEM_DEF(shuttle)

QDEL_LIST_CONTENTS(remove_images)

/datum/controller/subsystem/shuttle/proc/mail_delivery()
for(var/obj/machinery/requests_console/console in GLOB.allRequestConsoles)
if(console.department != "Cargo Bay")
continue
console.createMessage("Messaging and Intergalactic Letters", "New Mail Crates ready to be ordered!", "A new mail crate is able to be shipped alongside your next orders!", RQ_NORMALPRIORITY)

if(!length(supply_shuttle_turfs))
for(var/turf/simulated/T in supply.areaInstance)
if(T.density)
continue
for(var/obj/structure/structure in T.contents)
if(structure.density)
continue
supply_shuttle_turfs += T
if(!length(supply_shuttle_turfs)) // In case some nutjob walled the supply shuttle 10 minutes into the round
return
var/turf/spawn_location = pick(supply_shuttle_turfs)
new /obj/structure/closet/crate/mail(spawn_location)

#undef CALL_SHUTTLE_REASON_LENGTH
1 change: 0 additions & 1 deletion code/datums/outfits/outfit_debug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
mask = /obj/item/clothing/mask/gas/welding/advanced
shoes = /obj/item/clothing/shoes/combat/swat

// shit down here is mine
box = /obj/item/storage/box/debug/debugtools
suit_store = /obj/item/tank/internals/oxygen
gloves = /obj/item/clothing/gloves/combat
Expand Down
1 change: 1 addition & 0 deletions code/game/gamemodes/nuclear/nuclear.dm
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@
U.hidden_uplink.uplink_owner="[synd_mob.key]"
U.hidden_uplink.uses = uplink_uses
synd_mob.equip_to_slot_or_del(U, slot_in_backpack)
synd_mob.mind.offstation_role = TRUE

if(synd_mob.dna.species)
var/race = synd_mob.dna.species.name
Expand Down
1 change: 1 addition & 0 deletions code/game/gamemodes/wizard/wizard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
wizard_mob.equip_to_slot_or_del(spellbook, slot_l_hand)

wizard_mob.faction = list("wizard")
wizard_mob.mind.offstation_role = TRUE



Expand Down
2 changes: 2 additions & 0 deletions code/game/jobs/job/support.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
selection_color = "#eeddbe"
access = list(ACCESS_MAINT_TUNNELS, ACCESS_MAILSORTING, ACCESS_CARGO, ACCESS_QM, ACCESS_MINT, ACCESS_MINING, ACCESS_MINING_STATION, ACCESS_MINERAL_STOREROOM)
minimal_access = list(ACCESS_MAINT_TUNNELS, ACCESS_CARGO, ACCESS_MAILSORTING, ACCESS_MINERAL_STOREROOM)
alt_titles = list("Mail Carrier", "Courier")
outfit = /datum/outfit/job/cargo_tech

/datum/outfit/job/cargo_tech
Expand All @@ -55,6 +56,7 @@

uniform = /obj/item/clothing/under/rank/cargo/tech
shoes = /obj/item/clothing/shoes/black
l_pocket = /obj/item/mail_scanner
l_ear = /obj/item/radio/headset/headset_cargo
id = /obj/item/card/id/supply
pda = /obj/item/pda/cargo
Expand Down
11 changes: 0 additions & 11 deletions code/game/machinery/requests_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
#define COM_ROLES list("Blueshield", "NT Representative", "Head of Personnel's Desk", "Captain's Desk", "Bridge")
#define SCI_ROLES list("Robotics", "Science", "Research Director's Desk")

#define RQ_NONEW_MESSAGES 0
#define RQ_NORMALPRIORITY 1
#define RQ_HIGHPRIORITY 2

GLOBAL_LIST_EMPTY(req_console_assistance)
GLOBAL_LIST_EMPTY(req_console_supplies)
GLOBAL_LIST_EMPTY(req_console_information)
Expand All @@ -48,9 +44,6 @@ GLOBAL_LIST_EMPTY(allRequestConsoles)
var/list/message_log = list() //List of all messages
var/departmentType = 0 //Bitflag. Zero is reply-only. Map currently uses raw numbers instead of defines.
var/newmessagepriority = RQ_NONEW_MESSAGES
// RQ_NONEWMESSAGES = no new message
// RQ_NORMALPRIORITY = normal priority
// RQ_HIGHPRIORITY = high priority
var/screen = RCS_MAINMENU
var/silent = FALSE // set to TRUE for it not to beep all the time
var/announcementConsole = FALSE
Expand Down Expand Up @@ -371,7 +364,3 @@ GLOBAL_LIST_EMPTY(allRequestConsoles)
sp.sortTag = tag_index
sp.update_desc()
print_cooldown = world.time + 600 //1 minute cooldown before you can print another label, but you can still configure the next one during this time

#undef RQ_NONEW_MESSAGES
#undef RQ_NORMALPRIORITY
#undef RQ_HIGHPRIORITY
6 changes: 6 additions & 0 deletions code/game/objects/items/stacks/sheets/mineral.dm
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,9 @@ GLOBAL_LIST_INIT(sandbag_recipes, list (
materials = list(MAT_BANANIUM = MINERAL_MATERIAL_AMOUNT)
point_value = 50

/obj/item/stack/sheet/mineral/bananium/ten
amount = 10

/obj/item/stack/sheet/mineral/bananium/fifty
amount = 50

Expand All @@ -348,6 +351,9 @@ GLOBAL_LIST_INIT(sandbag_recipes, list (
wall_allowed = FALSE //no tranquilite walls in code
point_value = 50

/obj/item/stack/sheet/mineral/tranquillite/ten
amount = 10

/obj/item/stack/sheet/mineral/tranquillite/fifty
amount = 50

Expand Down
16 changes: 16 additions & 0 deletions code/game/objects/items/weapons/storage/bags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -536,3 +536,19 @@
/obj/item/reagent_containers/glass/bottle, /obj/item/reagent_containers/iv_bag,
/obj/item/reagent_containers/hypospray/autoinjector/epinephrine)
resistance_flags = FLAMMABLE

/*
* Mail bag
*/

/obj/item/storage/bag/mail
name = "mail bag"
desc = "A bag for envelopes, stamps, pens, and papers."
icon = 'icons/obj/bureaucracy.dmi'
icon_state = "mailbag"
item_state = "mailbag"
storage_slots = 14
max_combined_w_class = 28
w_class = WEIGHT_CLASS_TINY
can_hold = list(/obj/item/envelope, /obj/item/stamp, /obj/item/pen, /obj/item/paper)
resistance_flags = FLAMMABLE
Loading

0 comments on commit ecfaa26

Please sign in to comment.