mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-04-02 18:31:07 +01:00
* Makes condiments their own subtype, fixes geese, prepares for merging * Fixes geese checking drink type instead of edible foodtype to eat gross food. * Renames foodtype var on drinks to drink_types to prevent above from happening again because it KEEPS HAPPENING. DRINKS AREN'T FOOD! * Makes Condiments their own subtype of reagent_containers because they don't make any use of being a subtype of food, at all. * Starts moving things from food to /food/drink subtype in preparation for merging /food/drink with /drink * fully removes Food subtype * /reagent_containers/drinks are now /reagent_containers/cup - This is so it's no longer confused with eachother. * /food/drinks is now /reagent_containers/cup/drinks, so we can keep their special abilities. * Fixes a LOT of errors with food, which are STILL checking the reagent_containers, despite ACTUAL food being refactored away from it a long time ago. This doesn't compile yet, but I do want to make sure my progress is well tracked. * remove copypaste code, changes soda cans * Removes most copy paste code between the two drinks, moving most stuff to parent whenever needed. * Made soda cans their own subtype since they didn't share anything with glass bottles anyways. * Fixes more problems with food/drinks, especially with geese. Geese really were just broken this whole time and no one said a word... * Removes a snowflake signal, now that both drink types share a common one. * Adds everything to the .dme Currently my goal is to get this all compiling, then remove isGlass var by making glass be all glass ones only. * Moves all icons into a single drinks dmi I'm not that great at icon stuff, hopefully I didn't forget/break anything. * Turns juices into their own subtype This allows us to let them check for type in molotov, to both get rid of a use of isGlass, and so non-glass non-cartons don't show up as 'carton'. * fixes compile issues, adds updatepaths * a better updatepaths * updates the damn maps now * properly names the updatepath * how did that get there * i suck at handling merge conflicts * how am i this bad * code improvement and soda fix * more fixes * Don't be a timer Ports from old food bottles to trans the reagents, rather than add a timer to. * Merge conflicts and fixes bottle smashing * Bottle smashing is now consistently functional regardless of how much liquid they have in them, when before it would spill first, then smash on the second hit. * runs updatepaths again
135 lines
4.7 KiB
Plaintext
135 lines
4.7 KiB
Plaintext
/obj/effect/decal/cleanable
|
|
gender = PLURAL
|
|
layer = ABOVE_NORMAL_TURF_LAYER
|
|
var/list/random_icon_states = null
|
|
///I'm sorry but cleanable/blood code is ass, and so is blood_DNA
|
|
var/blood_state = ""
|
|
///0-100, amount of blood in this decal, used for making footprints and affecting the alpha of bloody footprints
|
|
var/bloodiness = 0
|
|
///When two of these are on a same tile or do we need to merge them into just one?
|
|
var/mergeable_decal = TRUE
|
|
var/beauty = 0
|
|
///The type of cleaning required to clean the decal. See __DEFINES/cleaning.dm for the options
|
|
var/clean_type = CLEAN_TYPE_LIGHT_DECAL
|
|
///The reagent this decal holds. Leave blank for none.
|
|
var/datum/reagent/decal_reagent
|
|
///The amount of reagent this decal holds, if decal_reagent is defined
|
|
var/reagent_amount = 0
|
|
|
|
/obj/effect/decal/cleanable/Initialize(mapload, list/datum/disease/diseases)
|
|
. = ..()
|
|
if (random_icon_states && (icon_state == initial(icon_state)) && length(random_icon_states) > 0)
|
|
icon_state = pick(random_icon_states)
|
|
create_reagents(300)
|
|
if(decal_reagent)
|
|
reagents.add_reagent(decal_reagent, reagent_amount)
|
|
if(loc && isturf(loc))
|
|
for(var/obj/effect/decal/cleanable/C in loc)
|
|
if(C != src && C.type == type && !QDELETED(C))
|
|
if (replace_decal(C))
|
|
handle_merge_decal(C)
|
|
return INITIALIZE_HINT_QDEL
|
|
|
|
if(LAZYLEN(diseases))
|
|
var/list/datum/disease/diseases_to_add = list()
|
|
for(var/datum/disease/D in diseases)
|
|
if(D.spread_flags & DISEASE_SPREAD_CONTACT_FLUIDS)
|
|
diseases_to_add += D
|
|
if(LAZYLEN(diseases_to_add))
|
|
AddComponent(/datum/component/infective, diseases_to_add)
|
|
|
|
AddElement(/datum/element/beauty, beauty)
|
|
|
|
var/turf/T = get_turf(src)
|
|
if(T && is_station_level(T.z))
|
|
SSblackbox.record_feedback("tally", "station_mess_created", 1, name)
|
|
var/static/list/loc_connections = list(
|
|
COMSIG_ATOM_ENTERED = .proc/on_entered,
|
|
)
|
|
AddElement(/datum/element/connect_loc, loc_connections)
|
|
|
|
/obj/effect/decal/cleanable/Destroy()
|
|
var/turf/T = get_turf(src)
|
|
if(T && is_station_level(T.z))
|
|
SSblackbox.record_feedback("tally", "station_mess_destroyed", 1, name)
|
|
return ..()
|
|
|
|
/obj/effect/decal/cleanable/proc/replace_decal(obj/effect/decal/cleanable/C) // Returns true if we should give up in favor of the pre-existing decal
|
|
if(mergeable_decal)
|
|
return TRUE
|
|
|
|
/obj/effect/decal/cleanable/attackby(obj/item/W, mob/user, params)
|
|
if((istype(W, /obj/item/reagent_containers/cup) && !istype(W, /obj/item/reagent_containers/cup/rag)) || istype(W, /obj/item/reagent_containers/cup/glass))
|
|
if(src.reagents && W.reagents)
|
|
. = 1 //so the containers don't splash their content on the src while scooping.
|
|
if(!src.reagents.total_volume)
|
|
to_chat(user, span_notice("[src] isn't thick enough to scoop up!"))
|
|
return
|
|
if(W.reagents.total_volume >= W.reagents.maximum_volume)
|
|
to_chat(user, span_notice("[W] is full!"))
|
|
return
|
|
to_chat(user, span_notice("You scoop up [src] into [W]!"))
|
|
reagents.trans_to(W, reagents.total_volume, transfered_by = user)
|
|
if(!reagents.total_volume) //scooped up all of it
|
|
qdel(src)
|
|
return
|
|
if(W.get_temperature()) //todo: make heating a reagent holder proc
|
|
if(istype(W, /obj/item/clothing/mask/cigarette))
|
|
return
|
|
else
|
|
var/hotness = W.get_temperature()
|
|
reagents.expose_temperature(hotness)
|
|
to_chat(user, span_notice("You heat [name] with [W]!"))
|
|
else
|
|
return ..()
|
|
|
|
/obj/effect/decal/cleanable/fire_act(exposed_temperature, exposed_volume)
|
|
if(reagents)
|
|
reagents.expose_temperature(exposed_temperature)
|
|
..()
|
|
|
|
|
|
//Add "bloodiness" of this blood's type, to the human's shoes
|
|
//This is on /cleanable because fuck this ancient mess
|
|
/obj/effect/decal/cleanable/proc/on_entered(datum/source, atom/movable/AM)
|
|
SIGNAL_HANDLER
|
|
if(iscarbon(AM) && blood_state && bloodiness >= 40)
|
|
SEND_SIGNAL(AM, COMSIG_STEP_ON_BLOOD, src)
|
|
update_appearance()
|
|
|
|
/obj/effect/decal/cleanable/wash(clean_types)
|
|
. = ..()
|
|
if (. || (clean_types & clean_type))
|
|
qdel(src)
|
|
return TRUE
|
|
return .
|
|
|
|
/**
|
|
* Checks if this decal is a valid decal that can be blood crawled in.
|
|
*/
|
|
/obj/effect/decal/cleanable/proc/can_bloodcrawl_in()
|
|
if((blood_state != BLOOD_STATE_OIL) && (blood_state != BLOOD_STATE_NOT_BLOODY))
|
|
return bloodiness
|
|
|
|
return FALSE
|
|
|
|
/**
|
|
* Gets the color associated with the any blood present on this decal. If there is no blood, returns null.
|
|
*/
|
|
/obj/effect/decal/cleanable/proc/get_blood_color()
|
|
switch(blood_state)
|
|
if(BLOOD_STATE_HUMAN)
|
|
return rgb(149, 10, 10)
|
|
if(BLOOD_STATE_XENO)
|
|
return rgb(43, 186, 0)
|
|
if(BLOOD_STATE_OIL)
|
|
return rgb(22, 22, 22)
|
|
|
|
return null
|
|
|
|
/obj/effect/decal/cleanable/proc/handle_merge_decal(obj/effect/decal/cleanable/merger)
|
|
if(!merger)
|
|
return
|
|
if(merger.reagents && reagents)
|
|
reagents.trans_to(merger, reagents.total_volume)
|