mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-16 18:45:22 +01:00
e98cb75c57
## About The Pull Request Refactor the majority of the current gasmix mole change use cases into a proc called adjust_gas which simply adds the designated mole count of the species into the gas mix while also handling asserting the gas and garbage_collect() I also added adjust_multiple_gases and convert_gas() for modifying multiple gases and within a gasmix ## Why It's Good For The Game Lemon wanted this to be done as part of the air group refactor ## Changelog 🆑 refactor: refactored majority of gas_mix mole change into adjust_gas() proc /🆑
118 lines
4.5 KiB
Plaintext
118 lines
4.5 KiB
Plaintext
/obj/structure/toiletbong
|
|
name = "toilet bong"
|
|
desc = "A repurposed toilet with re-arranged piping and an attached flamethrower. Why would anyone build this?"
|
|
icon = 'icons/obj/watercloset.dmi'
|
|
icon_state = "toiletbong"
|
|
base_icon_state = "toiletbong"
|
|
density = FALSE
|
|
anchored = TRUE
|
|
custom_materials = list(/datum/material/iron = SHEET_MATERIAL_AMOUNT * 2.05, /datum/material/glass = SMALL_MATERIAL_AMOUNT * 0.8)
|
|
var/smokeradius = 1
|
|
var/mutable_appearance/weed_overlay
|
|
|
|
/obj/structure/toiletbong/Initialize(mapload)
|
|
. = ..()
|
|
AddElement(/datum/element/simple_rotation, post_rotation_proccall = PROC_REF(post_rotation))
|
|
create_storage(storage_type = /datum/storage/toiletbong)
|
|
|
|
weed_overlay = mutable_appearance('icons/obj/watercloset.dmi', "[base_icon_state]_overlay")
|
|
START_PROCESSING(SSobj, src)
|
|
|
|
/obj/structure/toiletbong/on_craft_completion(list/components, datum/crafting_recipe/current_recipe, atom/crafter)
|
|
var/obj/structure/toilet/toilet = locate(/obj/structure/toilet) in components
|
|
if(toilet)
|
|
for(var/obj/item/cistern_item in toilet.contents)
|
|
cistern_item.forceMove(crafter.drop_location())
|
|
to_chat(crafter, span_warning("[cistern_item] falls out of the toilet!"))
|
|
setDir(toilet.dir)
|
|
forceMove(toilet.loc)
|
|
|
|
crafter.visible_message(
|
|
span_notice("[crafter] attaches the flamethrower to the repurposed toilet."),
|
|
span_notice("You attach the flamethrower to the repurposed toilet."),
|
|
)
|
|
return ..()
|
|
|
|
/obj/structure/toiletbong/update_overlays()
|
|
. = ..()
|
|
if (LAZYLEN(contents))
|
|
. += weed_overlay
|
|
|
|
/obj/structure/toiletbong/attack_hand(mob/living/carbon/user)
|
|
. = ..()
|
|
if (!anchored)
|
|
user.balloon_alert(user, "secure it first!")
|
|
return
|
|
if (!LAZYLEN(contents))
|
|
user.balloon_alert(user, "it's empty!")
|
|
return
|
|
user.visible_message(span_boldnotice("[user] takes a huge drag on the [src]."))
|
|
if (!do_after(user, 2 SECONDS, target = src))
|
|
return
|
|
var/turf/toiletbong_location = loc
|
|
toiletbong_location.hotspot_expose(1000, 5)
|
|
for (var/obj/item/item in contents)
|
|
if (item.resistance_flags & INDESTRUCTIBLE)
|
|
user.balloon_alert(user, "[item.name] is blocking the pipes!")
|
|
continue
|
|
playsound(src, 'sound/items/modsuit/flamethrower.ogg', 50)
|
|
|
|
var/smoke_amount = DIAMOND_AREA(smokeradius)
|
|
do_chem_smoke(amount = smoke_amount, holder = src, location = loc, carry = item.reagents, carry_limit = 20, smoke_type = /datum/effect_system/fluid_spread/smoke/chem/smoke_machine)
|
|
if (prob(5) && !(obj_flags & EMAGGED))
|
|
if(user.get_liked_foodtypes() & GORE)
|
|
user.balloon_alert(user, "a hidden treat!")
|
|
user.visible_message(span_danger("[user] fishes a mouse out of the pipes."))
|
|
else
|
|
to_chat(user, span_userdanger("There was something disgusting in the pipes!"))
|
|
user.visible_message(span_danger("[user] spits out a mouse."))
|
|
user.adjust_disgust(50)
|
|
user.vomit(VOMIT_CATEGORY_DEFAULT)
|
|
var/mob/living/spawned_mob = new /mob/living/basic/mouse(get_turf(user))
|
|
spawned_mob.add_faction("[REF(user)]")
|
|
if(prob(50))
|
|
for(var/j in 1 to rand(1, 3))
|
|
step(spawned_mob, pick(NORTH,SOUTH,EAST,WEST))
|
|
qdel(item)
|
|
if(!(obj_flags & EMAGGED))
|
|
break
|
|
update_appearance(UPDATE_ICON)
|
|
|
|
/obj/structure/toiletbong/wrench_act(mob/living/user, obj/item/tool)
|
|
default_unfasten_wrench(user, tool)
|
|
return ITEM_INTERACT_SUCCESS
|
|
|
|
///Called in the simple rotation's post_rotation callback, playing a sound cue to players.
|
|
/obj/structure/toiletbong/proc/post_rotation(mob/user, degrees)
|
|
playsound(src, 'sound/items/deconstruct.ogg', 50)
|
|
|
|
/obj/structure/toiletbong/crowbar_act(mob/living/user, obj/item/tool)
|
|
if(anchored)
|
|
return FALSE
|
|
tool.play_tool_sound(src)
|
|
to_chat(user, span_notice("You begin taking apart the [src]."))
|
|
if (!do_after(user, 10 SECONDS, target = src))
|
|
return FALSE
|
|
new /obj/item/flamethrower(get_turf(src))
|
|
var/obj/item/tank/internals/plasma/ptank = new /obj/item/tank/internals/plasma(get_turf(src))
|
|
ptank.air_contents.set_gas(/datum/gas/plasma, 0)
|
|
drop_custom_materials()
|
|
qdel(src)
|
|
return TRUE
|
|
|
|
/obj/structure/toiletbong/emag_act(mob/user, obj/item/card/emag/emag_card)
|
|
if(obj_flags & EMAGGED)
|
|
return FALSE
|
|
obj_flags |= EMAGGED
|
|
smokeradius = 2
|
|
playsound(src, 'sound/effects/fish_splash.ogg', 50)
|
|
balloon_alert(user, "toilet broke")
|
|
if (emag_card)
|
|
to_chat(user, span_boldwarning("The [emag_card] falls into the toilet. You fish it back out. Looks like you broke the toilet."))
|
|
return TRUE
|
|
|
|
/obj/structure/toiletbong/attackby(obj/item/attacking_item, mob/user, list/modifiers, list/attack_modifiers)
|
|
if(istype(attacking_item, /obj/item/card/emag))
|
|
return
|
|
return ..()
|