mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* Refactor several log lines to use datum_info_line and atom_loc_line * Add default return strings from datum_info_line and atom_loc_line * Add parentheses around atom_loc_line data * Change more logs to use atom_loc_line * Add check in atom_loc_line for turfs to avoid calling get_turf on them * Re-add removed 'at' * Replace datum_info_line with key_name and atom_loc_line with loc_name * Refactor logging functions * Avoid double-logging self-interactions * Fallback to simple stringification if all else fails in key_name() * Rewrite muscle spasm logging to use log_message * Standardize logging of martial arts * Tweak individual logging panel look * Fix individual logging panel source * When I typed || I really meant && * Fix Telecomms logging always showing client logs in the panel * Reverts addition of buggy ownership log to panel * Remove colon * Fix missing log_directed_talk tag * Add warning for missing type in log_direted_talk * Change warnings to stack_traces * Add square brackets around fallthrough key_name() case to help parsing * Allow atom arguments/src in log_*() functions * Change log_combat call with null argument to log_message * Change mecha types' log_message() arguments to match atom and mob version * Add key_name() case for atoms * Fix resist_grab() unsetting pulledby before log_combat gets a chance to use it * Fix log_globally logic * Add logging for hitting objects with items * Move log_combat() to atoms.dm * Use utility functions for object stringification in log_combat() * Use utility functions for object stringification in log_combat() * Add missing logs for interacting with display cases * Rewrite log_combat() comment * Add missing space in log_combat() * Add logging for hitting grilles barehanded * Add missing ..()
125 lines
4.3 KiB
Plaintext
125 lines
4.3 KiB
Plaintext
/obj/item/reagent_containers
|
|
name = "Container"
|
|
desc = "..."
|
|
icon = 'icons/obj/chemical.dmi'
|
|
icon_state = null
|
|
w_class = WEIGHT_CLASS_TINY
|
|
var/amount_per_transfer_from_this = 5
|
|
var/list/possible_transfer_amounts = list(5,10,15,20,25,30)
|
|
var/volume = 30
|
|
var/list/list_reagents = null
|
|
var/spawned_disease = null
|
|
var/disease_amount = 20
|
|
var/spillable = FALSE
|
|
|
|
/obj/item/reagent_containers/Initialize(mapload, vol)
|
|
. = ..()
|
|
if(isnum(vol) && vol > 0)
|
|
volume = vol
|
|
create_reagents(volume)
|
|
if(spawned_disease)
|
|
var/datum/disease/F = new spawned_disease()
|
|
var/list/data = list("viruses"= list(F))
|
|
reagents.add_reagent("blood", disease_amount, data)
|
|
|
|
add_initial_reagents()
|
|
|
|
/obj/item/reagent_containers/proc/add_initial_reagents()
|
|
if(list_reagents)
|
|
reagents.add_reagent_list(list_reagents)
|
|
|
|
/obj/item/reagent_containers/attack_self(mob/user)
|
|
if(possible_transfer_amounts.len)
|
|
var/i=0
|
|
for(var/A in possible_transfer_amounts)
|
|
i++
|
|
if(A == amount_per_transfer_from_this)
|
|
if(i<possible_transfer_amounts.len)
|
|
amount_per_transfer_from_this = possible_transfer_amounts[i+1]
|
|
else
|
|
amount_per_transfer_from_this = possible_transfer_amounts[1]
|
|
to_chat(user, "<span class='notice'>[src]'s transfer amount is now [amount_per_transfer_from_this] units.</span>")
|
|
return
|
|
|
|
/obj/item/reagent_containers/attack(mob/M, mob/user, def_zone)
|
|
if(user.a_intent == INTENT_HARM)
|
|
return ..()
|
|
|
|
/obj/item/reagent_containers/proc/canconsume(mob/eater, mob/user)
|
|
if(!iscarbon(eater))
|
|
return 0
|
|
var/mob/living/carbon/C = eater
|
|
var/covered = ""
|
|
if(C.is_mouth_covered(head_only = 1))
|
|
covered = "headgear"
|
|
else if(C.is_mouth_covered(mask_only = 1))
|
|
covered = "mask"
|
|
if(covered)
|
|
var/who = (isnull(user) || eater == user) ? "your" : "[eater.p_their()]"
|
|
to_chat(user, "<span class='warning'>You have to remove [who] [covered] first!</span>")
|
|
return 0
|
|
return 1
|
|
|
|
/obj/item/reagent_containers/ex_act()
|
|
if(reagents)
|
|
for(var/datum/reagent/R in reagents.reagent_list)
|
|
R.on_ex_act()
|
|
if(!QDELETED(src))
|
|
..()
|
|
|
|
/obj/item/reagent_containers/fire_act(exposed_temperature, exposed_volume)
|
|
reagents.expose_temperature(exposed_temperature)
|
|
..()
|
|
|
|
/obj/item/reagent_containers/throw_impact(atom/target)
|
|
. = ..()
|
|
SplashReagents(target, TRUE)
|
|
|
|
/obj/item/reagent_containers/proc/bartender_check(atom/target)
|
|
. = FALSE
|
|
if(target.CanPass(src, get_turf(src)) && thrownby && thrownby.actions)
|
|
for(var/datum/action/innate/drink_fling/D in thrownby.actions)
|
|
if(D.active)
|
|
return TRUE
|
|
|
|
/obj/item/reagent_containers/proc/SplashReagents(atom/target, thrown = FALSE)
|
|
if(!reagents || !reagents.total_volume || !spillable)
|
|
return
|
|
|
|
if(ismob(target) && target.reagents)
|
|
if(thrown)
|
|
reagents.total_volume *= rand(5,10) * 0.1 //Not all of it makes contact with the target
|
|
var/mob/M = target
|
|
var/R
|
|
target.visible_message("<span class='danger'>[M] has been splashed with something!</span>", \
|
|
"<span class='userdanger'>[M] has been splashed with something!</span>")
|
|
for(var/datum/reagent/A in reagents.reagent_list)
|
|
R += A.id + " ("
|
|
R += num2text(A.volume) + "),"
|
|
|
|
if(thrownby)
|
|
log_combat(thrownby, M, "splashed", R)
|
|
reagents.reaction(target, TOUCH)
|
|
|
|
else if(bartender_check(target) && thrown)
|
|
visible_message("<span class='notice'>[src] lands onto the [target.name] without spilling a single drop.</span>")
|
|
return
|
|
|
|
else
|
|
if(isturf(target) && reagents.reagent_list.len && thrownby)
|
|
log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]", "in [AREACOORD(target)]")
|
|
log_game("[key_name(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [AREACOORD(target)].")
|
|
message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] in [ADMIN_VERBOSEJMP(target)].")
|
|
visible_message("<span class='notice'>[src] spills its contents all over [target].</span>")
|
|
reagents.reaction(target, TOUCH)
|
|
if(QDELETED(src))
|
|
return
|
|
|
|
reagents.clear_reagents()
|
|
|
|
/obj/item/reagent_containers/microwave_act(obj/machinery/microwave/M)
|
|
reagents.expose_temperature(1000)
|
|
..()
|
|
|
|
/obj/item/reagent_containers/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
|
|
reagents.expose_temperature(exposed_temperature) |