diff --git a/code/__DEFINES/{yogs_defines}/components.dm b/code/__DEFINES/{yogs_defines}/components.dm index cdd80cc8b891..dc86e663d403 100644 --- a/code/__DEFINES/{yogs_defines}/components.dm +++ b/code/__DEFINES/{yogs_defines}/components.dm @@ -1,3 +1,5 @@ #define COMSIG_ALT_CLICK_ON "alt_click_on" //from base of mob/AltClickOn(): (atom/A) #define COMSIG_ATOM_POINTED_AT "atom_pointed_at" //from base of atom/pointed_at(): (mob/user) -#define COMSIG_PROCESS_MOVE "process_move" //from base of client/Move(): (num/direction) \ No newline at end of file +#define COMSIG_PROCESS_MOVE "process_move" //from base of client/Move(): (num/direction) +#define COMSIG_STORAGE_INSERTED "storage_inserted" //from base of /datum/component/storage/handle_item_insertion(): (obj/item/I, mob/M) +#define COMSIG_STORAGE_REMOVED "storage_removed" //from base of /datum/component/storage/remove_from_storage(): (atom/movable/AM, atom/new_location) diff --git a/config/private_default.txt b/config/private_default.txt index 1a1c3021d89e..cec9cc86226e 100644 --- a/config/private_default.txt +++ b/config/private_default.txt @@ -70,7 +70,7 @@ ENABLE_LOCALHOST_RANK TICK_LIMIT_MC_INIT 500 ## Should SQL be enabled? Uncomment to enable -SQL_ENABLED +#SQL_ENABLED ## Should discord based MFA be enabled for admins? Uncomment to enable #MFA_ENABLED diff --git a/yogstation.dme b/yogstation.dme index bafe565b1348..91d2723eca56 100644 --- a/yogstation.dme +++ b/yogstation.dme @@ -3306,6 +3306,8 @@ #include "yogstation\code\game\objects\structures\ladders.dm" #include "yogstation\code\game\objects\structures\table_frames.dm" #include "yogstation\code\game\objects\structures\tables_racks.dm" +#include "yogstation\code\game\objects\structures\toilet_bong.dm" +#include "yogstation\code\game\objects\structures\watercloset.dm" #include "yogstation\code\game\objects\structures\window.dm" #include "yogstation\code\game\objects\structures\bar_stuff\bar_stuff.dm" #include "yogstation\code\game\objects\structures\beds_chairs\chair.dm" diff --git a/yogstation/code/datums/components/storage/storage.dm b/yogstation/code/datums/components/storage/storage.dm index 9e1170a0cb95..cc059b6e01a5 100644 --- a/yogstation/code/datums/components/storage/storage.dm +++ b/yogstation/code/datums/components/storage/storage.dm @@ -1,3 +1,13 @@ +/datum/component/storage/handle_item_insertion(obj/item/I, prevent_warning = FALSE, mob/M, datum/component/storage/remote) + . = ..() + if (.) + SEND_SIGNAL(parent, COMSIG_STORAGE_INSERTED, I, M) + +/datum/component/storage/remove_from_storage(atom/movable/AM, atom/new_location) + . = ..() + if (.) + SEND_SIGNAL(parent, COMSIG_STORAGE_REMOVED, AM, new_location) + /datum/component/storage/RemoveComponent() // hey TG you dropped this UnregisterSignal(parent, COMSIG_CONTAINS_STORAGE) UnregisterSignal(parent, COMSIG_IS_STORAGE_LOCKED) diff --git a/yogstation/code/game/objects/structures/toilet_bong.dm b/yogstation/code/game/objects/structures/toilet_bong.dm new file mode 100644 index 000000000000..09121c7a4a87 --- /dev/null +++ b/yogstation/code/game/objects/structures/toilet_bong.dm @@ -0,0 +1,55 @@ +/obj/structure/toilet_bong + name = "toilet bong" + desc = "It's a toilet that's been fitted into a bong. It is used for exactly what you think it's for." + icon = 'yogstation/icons/obj/watercloset.dmi' + icon_state = "toiletbong" + density = FALSE + anchored = TRUE + var/mutable_appearance/weed_overlay + +/obj/structure/toilet_bong/Initialize() + . = ..() + weed_overlay = mutable_appearance('yogstation/icons/obj/watercloset.dmi', "weed") + START_PROCESSING(SSobj, src) + +/obj/structure/toilet_bong/ComponentInitialize() + . = ..() + var/datum/component/storage/STR = AddComponent(/datum/component/storage/concrete) + STR.attack_hand_interact = FALSE + STR.set_holdable(list(/obj/item/reagent_containers/food/snacks/grown/cannabis, /obj/item/reagent_containers/food/snacks/grown/tobacco)) + STR.max_w_class = WEIGHT_CLASS_SMALL + STR.max_combined_w_class = WEIGHT_CLASS_SMALL * 24 + STR.max_items = 24 + RegisterSignal(STR, COMSIG_STORAGE_INSERTED, .proc/update_icon) + RegisterSignal(STR, COMSIG_STORAGE_REMOVED, .proc/update_icon) + +/obj/structure/toilet_bong/update_icon() + . = ..() + cut_overlays() + if (LAZYLEN(contents)) + add_overlay(weed_overlay) + +/obj/structure/toilet_bong/attack_hand(mob/user) + . = ..() + if (!LAZYLEN(contents)) + to_chat(user, span_warning("[src] is empty!")) + return + if (do_after(user, 2 SECONDS, target = src)) + var/obj/item/reagent_containers/boof = contents[1] + user.visible_message(span_boldnotice("[user] takes a huge rip from [src]!"), span_boldnotice("You take a huge rip from [src]!")) + var/smoke_spread = 1 + if (prob(15)) + user.visible_message(span_danger("[user] coughs while using [src], filling the area with smoke!"), span_userdanger("You cough while using [src], filling the area with smoke!")) + smoke_spread = 5 + var/turf/location = get_turf(user) + var/datum/effect_system/smoke_spread/chem/smoke = new + smoke.attach(location) + smoke.set_up(boof.reagents, smoke_spread, location, silent = TRUE) + smoke.start() + qdel(boof) + update_icon() + +// It's a bong powered by a **flamethrower**, it's definitely an open flame!! +/obj/structure/toilet_bong/process() + var/turf/location = get_turf(src) + location.hotspot_expose(700,2) diff --git a/yogstation/code/game/objects/structures/watercloset.dm b/yogstation/code/game/objects/structures/watercloset.dm new file mode 100644 index 000000000000..2e4bdb97c2a9 --- /dev/null +++ b/yogstation/code/game/objects/structures/watercloset.dm @@ -0,0 +1,18 @@ +/obj/structure/toilet/attackby(obj/item/I, mob/living/user, params) + if (istype(I, /obj/item/flamethrower)) + if (!user.is_holding_item_of_type(/obj/item/crowbar)) + to_chat(user, span_warning("You need a crowbar to retrofit this toilet into a bong!")) + return + playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 50, 1) + user.visible_message(span_notice("[user] begins to attach [I] to [src]..."), span_notice("You begin attaching [I] to [src]...")) + if (!do_after(user, 5 SECONDS, target = src)) + return + for (var/obj/item/cistern_item in contents) + cistern_item.forceMove(loc) + visible_message(span_warning("[cistern_item] falls out of [src]!")) + var/obj/structure/toilet_bong/bong = new(loc) + bong.dir = dir + qdel(I) + qdel(src) + else + return ..() diff --git a/yogstation/icons/obj/watercloset.dmi b/yogstation/icons/obj/watercloset.dmi new file mode 100644 index 000000000000..26b5019750ca Binary files /dev/null and b/yogstation/icons/obj/watercloset.dmi differ