From b032c277cf00b9788ac3bea13c6f2201e156b704 Mon Sep 17 00:00:00 2001 From: InsightfulParasite Date: Mon, 9 Dec 2024 00:21:49 -0500 Subject: [PATCH] Delivery Quest Doors ## About The Pull Request DELIVERY CODE!!! Creates doors that cannot be entered but can have parcels delivered to them. Delivery Doors can call 2 procs OrderParcel(turf where parcel is placed) OrderItems(turf where paper with request is place, item that is requested defaults to pizza) Coordinate pinpointer points to the coordinates you enter into it. Door addresses are their X and Y coordinates in the backstreets. ## Why It's Good For The Game Some people like delivering maguffins for money. ## Changelog :cl: add: delivery_doors add: coordinate pinpointer /:cl: --- ModularTegustation/delivery_doors.dm | 96 ++++++++++++++++++++++++++++ lobotomy-corp13.dme | 3 +- 2 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 ModularTegustation/delivery_doors.dm diff --git a/ModularTegustation/delivery_doors.dm b/ModularTegustation/delivery_doors.dm new file mode 100644 index 000000000000..73bbdc278d8c --- /dev/null +++ b/ModularTegustation/delivery_doors.dm @@ -0,0 +1,96 @@ +// Doors for parcels to be delivered to. Simulated mailman. +// A good way to get money without combat. +/obj/structure/delivery_door + name = "locked door" + desc = "A doorway to somewhere your not allowed to be." + icon = 'icons/obj/doors/airlocks/highsec/highsec.dmi' + icon_state = "closed" + anchored = TRUE + layer = CLOSED_DOOR_LAYER + var/address = "000" + var/list/item_order = list() + +/obj/structure/delivery_door/Initialize() + . = ..() + address = "[x]-[y]" + name += " ([address])" + +/obj/structure/delivery_door/attackby(obj/item/I, mob/user) + var/ordered_item = locate(I) in item_order + if(ordered_item) + item_order -= ordered_item + Reward(user, I, 30 + rand(-1,20)) + return + if(istype(I, /obj/item/delivery_parcel)) + // Deliver the item. + var/obj/item/delivery_parcel/D = I + if(D.address == address) + Reward(user, D, 150 + rand(-1,20)) + return + return ..() + +// Create parcel to be delivered. +/obj/structure/delivery_door/proc/OrderParcel(origin) + if(!isturf(origin) && !isatom(origin)) + return FALSE + var/obj/item/delivery_parcel/D = new (get_turf(origin)) + D.labelParcel(address) + return TRUE + +// Order items that are not safety sealed. +/obj/structure/delivery_door/proc/OrderItems(origin, obj/item/T = /obj/item/food/pizza/margherita) + if(!isturf(origin) && !isatom(origin)) + return FALSE + item_order = list(T) + var/obj/item/paper/P = new (get_turf(origin)) + P.setText("
[address] orders a [initial(T.name)].
") + return TRUE + +// Pay the pizzaman +/obj/structure/delivery_door/proc/Reward(mob/living/user, obj/item/delivery, amt) + var/obj/item/holochip/H = new (get_turf(user), amt) + user.put_in_hands(H) + to_chat(user, span_notice("The parcel is taken and payment is quickly tossed into your hand before the door locks again.")) + qdel(delivery) + playsound(get_turf(src), 'sound/effects/bin_close.ogg', 35, 3, 3) + +// Delivery Object +/obj/item/delivery_parcel + name = "delivery parcel" + desc = "A large delivery parcel that has a J corp lock on it." + icon = 'icons/obj/tank.dmi' + icon_state = "plasmaman_tank" + w_class = WEIGHT_CLASS_BULKY + slot_flags = ITEM_SLOT_BACK + worn_icon = 'icons/mob/clothing/back.dmi' + var/address = "000" + +/obj/item/delivery_parcel/proc/labelParcel(num) + address = num + name += " ([address])" + +/* +* TRACKER +*/ + +/obj/item/pinpointer/coordinate + name = "coordinate pinpointer" + desc = "Use in hand to set target cordnates." + icon_state = "pinpointer_syndicate" + custom_price = PAYCHECK_MEDIUM * 4 + custom_premium_price = PAYCHECK_MEDIUM * 6 + +/obj/item/pinpointer/cordnate/attack_self(mob/living/user) + if(active) + toggle_on() + user.visible_message(span_notice("[user] deactivates [user.p_their()] pinpointer."), span_notice("You deactivate your pinpointer.")) + return + + var/target_x = input(user, "x coordinate", "Pinpoint") as null|num + var/target_y = input(user, "y coordinate", "Pinpoint") as null|num + if(!target_x || !target_y || QDELETED(src) || !user || !user.is_holding(src) || user.incapacitated()) + return + + target = locate(target_x, target_y, user.z) + toggle_on() + user.visible_message(span_notice("[user] activates [user.p_their()] pinpointer."), span_notice("You activate your pinpointer.")) diff --git a/lobotomy-corp13.dme b/lobotomy-corp13.dme index ebe6abe2945d..fc7bc7ed26c4 100644 --- a/lobotomy-corp13.dme +++ b/lobotomy-corp13.dme @@ -2373,8 +2373,8 @@ #include "code\modules\jobs\job_types\city\civilian.dm" #include "code\modules\jobs\job_types\city\doctor.dm" #include "code\modules\jobs\job_types\city\HHPP.dm" -#include "code\modules\jobs\job_types\city\rat.dm" #include "code\modules\jobs\job_types\city\prosthetic.dm" +#include "code\modules\jobs\job_types\city\rat.dm" #include "code\modules\jobs\job_types\city\workshop.dm" #include "code\modules\jobs\job_types\city\fixer\east.dm" #include "code\modules\jobs\job_types\city\fixer\north.dm" @@ -3916,6 +3916,7 @@ #include "interface\stylesheet.dm" #include "interface\skin.dmf" #include "ModularTegustation\chair_override.dm" +#include "ModularTegustation\delivery_doors.dm" #include "ModularTegustation\engineering_bounties.dm" #include "ModularTegustation\harvestable_gardens.dm" #include "ModularTegustation\languagebooks.dm"