From 906cdff38be798d0908adae5dbf43335fd61e16f Mon Sep 17 00:00:00 2001 From: Lucy Date: Thu, 4 Nov 2021 20:47:44 -0400 Subject: [PATCH 1/2] Adds the toilet bong --- code/__DEFINES/{yogs_defines}/components.dm | 4 +- config/private_default.txt | 2 +- yogstation.dme | 2 + .../code/datums/components/storage/storage.dm | 10 ++++ .../game/objects/structures/toilet_bong.dm | 54 ++++++++++++++++++ .../game/objects/structures/watercloset.dm | 18 ++++++ yogstation/icons/obj/watercloset.dmi | Bin 0 -> 1830 bytes 7 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 yogstation/code/game/objects/structures/toilet_bong.dm create mode 100644 yogstation/code/game/objects/structures/watercloset.dm create mode 100644 yogstation/icons/obj/watercloset.dmi 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..6b06fde5a2ba --- /dev/null +++ b/yogstation/code/game/objects/structures/toilet_bong.dm @@ -0,0 +1,54 @@ +/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) + +// 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 0000000000000000000000000000000000000000..26b5019750ca2fe8f931d2b116b5516937ab5e16 GIT binary patch literal 1830 zcmV+>2if?EP)3IlOXlQ6qO-*24UUPGEk&%(VTMyE37RzZAc6N47OiVBpFm7&c zJUctV!NDvz0I!k&e`)|ZyZ`{00GQzbz`($_MNc*W0004WQchCV=-0C=2JR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6#a*U0* zI5Sc+(=$pSoZ^zil2jm5sU$x$C$%IgKQCR0i!&v&s2HS^i!-e#F*g;&Hbf{bPfbn1 zrAS%9)z1a&0084KCW}#bOveBK1uscNK~!jg?O2I&(>fFt&_W9oNQ>D@2~bp1w#sEQ zdmxle(7FYzG>+r{|BH98B*&Y)G)?BcHU(BL&&@L9|{4uZmeLD*2#>*(oz$C1nuC9eEig9PuIM@QEX-s|0sgBM;5Of(*mwWnH%37I z{LKjXoHOnN;Dh@zlZk=@SuKSnofqM*NZzRAaD8sIf1C<;{33w?1nIPB32rzT~0AA$+a*>4;Acx&<(&{*s z0-o(!QXm-g@nsgU84qL?$sF{$-CnlYm?JIVDgizDK|lsY0cN`po$o`e33;+nY>t`|y3WG)^p?}3f{LJoAJ04t08S&=s+rxY4-#De zYR}Whom|Eb0?6Qj06uVX>!8+OS)Ov3A0oMV;wC6OZv2rSspbzVTKT9F4SD94TxGjj zAuw$4)FcxW`A2r4CP(8U(XOb{1_;S8ilXpngHF%SojQ4mB;0k z<<_N(7qqQEf9~w!!WkpK<_^QCOabVJ28j)NZ~bn2?auA?t+ku0H?Cj1dd0+_VjYIX zc}fA8Kxk~+dIE2cA3Y@G!RF@bebZnVnvUjZ0xw^*33>kP={7pDt##vIl37}VKm^%~ zBFrQF<=Q^He+Rzd?VHyq@XE|z54k+i&`<-PY4_7dB5ge#mtFEhilSk$27Y}1_LZQ& z1zW!}z5?)q0L(wi)xh5Fub=q21ZGqld_IoMaHuAaDau5!xBK@GemcJo_Hhm94mUl` z>ILNVLls53;jpI-Xl(0goe!@NfW02&1&ROxu21kIg%ZW6>nPAFD-SiDXDCTpOyXoyg!4yl59SQq zlZcJ%u};`Lti<8l(-9cmCE^54cpq?&WsE);|A_{m6jDZi;{2e%W0&ut*2MWy0;)*5 zOm{l`aP3t#e_H(Nr$Koko(_NV+hgf9&nM8o|Q7KW%s%g zj4lHW`i9!qA29-b8E7I9g~O(kNd)4{K!d(fXo>Lzgf&ii&oILbGt4l<4F3xL0r6$D U7kgPtG5`Po07*qoM6N<$f=sMN(*OVf literal 0 HcmV?d00001 From 9ee51ba102a0b21b0988964b0de389841cc7712d Mon Sep 17 00:00:00 2001 From: Lucy Date: Fri, 5 Nov 2021 23:55:02 -0400 Subject: [PATCH 2/2] Update icon after smoking --- yogstation/code/game/objects/structures/toilet_bong.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/yogstation/code/game/objects/structures/toilet_bong.dm b/yogstation/code/game/objects/structures/toilet_bong.dm index 6b06fde5a2ba..09121c7a4a87 100644 --- a/yogstation/code/game/objects/structures/toilet_bong.dm +++ b/yogstation/code/game/objects/structures/toilet_bong.dm @@ -47,6 +47,7 @@ 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()