mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-05-17 20:30:46 +01:00
d5849910e5
* Begin clickcode attack_self fix Begins the work to make everything call back to parent for attack_self so that signals are sacred. * Makes MORE things call the attack_self() parent Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'. * Finishes making the rest of attack_self call parent. As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items. * begone foul demon * some more cleanup * These * GOD this was annoying * yeh * Fix this * fLARES * Thesee too * toys! * Even more! * More fixes * Even more * rest of em * these too * Update syndie.dm * hardref clear * Update code/game/gamemodes/nuclear/pinpointer.dm * Update code/game/objects/effects/mines.dm * Update code/game/objects/items/blueprints_vr.dm * Update code/game/objects/items/blueprints_vr.dm * Update code/game/objects/items/contraband_vr.dm * Update code/game/objects/items/crayons.dm * Update code/game/objects/items/crayons.dm * Update code/game/objects/items/gunbox.dm * Update code/game/objects/items/gunbox.dm * Update code/game/objects/items/gunbox_vr.dm * Update code/game/objects/items/gunbox_vr.dm * Update code/game/objects/items/weapons/gift_wrappaper.dm * Update code/game/objects/items/crayons.dm * Update code/game/objects/items/crayons.dm * Update code/game/objects/items/gunbox.dm * these too * Update maintpanel_stack.dm * angry warning * Fixes packaged snacks. Fixes improper var default. * Special handling for these * proper poly types * Fixes magclaws Makes the 'features' it had just part of base magboots that can be adjusted via varswap. * Fixes jackets Fixes https://github.com/VOREStation/VOREStation/issues/18941 * Small bugfix Makes p_Theyre properly capitialize Makes examine show proper wording * Update gift_wrappaper.dm
183 lines
6.3 KiB
Plaintext
183 lines
6.3 KiB
Plaintext
/obj/item/reagent_containers
|
|
name = "Container"
|
|
desc = "..."
|
|
icon = 'icons/obj/chemical.dmi'
|
|
icon_state = null
|
|
w_class = ITEMSIZE_SMALL
|
|
var/amount_per_transfer_from_this = 5
|
|
var/max_transfer_amount = 30
|
|
var/min_transfer_amount = 5
|
|
var/volume = 30
|
|
var/list/starts_with
|
|
|
|
/obj/item/reagent_containers/verb/set_APTFT() //set amount_per_transfer_from_this
|
|
set name = "Set transfer amount"
|
|
set category = "Object"
|
|
set src in range(0)
|
|
var/N = tgui_input_number(usr, "Amount per transfer from this: ([min_transfer_amount]-[max_transfer_amount])","[src]",amount_per_transfer_from_this,max_transfer_amount,min_transfer_amount)
|
|
if(N)
|
|
amount_per_transfer_from_this = N
|
|
|
|
/obj/item/reagent_containers/Initialize(mapload)
|
|
. = ..()
|
|
if(!max_transfer_amount)
|
|
src.verbs -= /obj/item/reagent_containers/verb/set_APTFT
|
|
create_reagents(volume)
|
|
|
|
if(starts_with)
|
|
var/total_so_far = 0
|
|
for(var/string in starts_with)
|
|
var/amt = starts_with[string] || 1
|
|
total_so_far += amt
|
|
reagents.add_reagent(string, amt)
|
|
if(total_so_far > volume)
|
|
WARNING("[src]([src.type]) starts with more reagents than it has total volume")
|
|
starts_with = null // it should gc, since it's just strings and numbers
|
|
|
|
/obj/item/reagent_containers/afterattack(obj/target, mob/user, flag)
|
|
return
|
|
|
|
/obj/item/reagent_containers/proc/reagentlist() // For attack logs
|
|
if(reagents)
|
|
return reagents.get_reagents()
|
|
return "No reagent holder"
|
|
|
|
/obj/item/reagent_containers/proc/standard_dispenser_refill(var/mob/user, var/obj/structure/reagent_dispensers/target) // This goes into afterattack
|
|
if(!istype(target))
|
|
return 0
|
|
|
|
if(target.open_top)
|
|
return 0
|
|
|
|
if(!target.reagents || !target.reagents.total_volume)
|
|
balloon_alert(user, "[target] is empty.")
|
|
return 1
|
|
|
|
if(reagents && !reagents.get_free_space())
|
|
balloon_alert(user, "[src] is full.")
|
|
return 1
|
|
|
|
var/trans = target.reagents.trans_to_obj(src, target:amount_per_transfer_from_this)
|
|
balloon_alert(user, "[trans] units transfered to \the [src]")
|
|
return 1
|
|
|
|
/obj/item/reagent_containers/proc/standard_splash_mob(var/mob/user, var/mob/target) // This goes into afterattack
|
|
if(!istype(target))
|
|
return
|
|
|
|
if(!reagents || !reagents.total_volume)
|
|
balloon_alert(user, "[src] is empty!")
|
|
return 1
|
|
|
|
if(target.reagents && !target.reagents.get_free_space())
|
|
balloon_alert(user, "\the [target] is full!")
|
|
return 1
|
|
|
|
var/contained = reagentlist()
|
|
add_attack_logs(user,target,"Splashed with [src.name] containing [contained]")
|
|
balloon_alert_visible("[target] is splashed with something by [user]!", "splashed the solution onto [target]")
|
|
reagents.splash(target, reagents.total_volume)
|
|
return 1
|
|
|
|
/obj/item/reagent_containers/proc/self_feed_message(var/mob/user)
|
|
balloon_alert(user, "you eat \the [src]")
|
|
|
|
/obj/item/reagent_containers/proc/other_feed_message_start(var/mob/user, var/mob/target)
|
|
balloon_alert_visible(user, "[user] is trying to feed [target] \the [src]!")
|
|
|
|
/obj/item/reagent_containers/proc/other_feed_message_finish(var/mob/user, var/mob/target)
|
|
balloon_alert_visible(user, "[user] has fed [target] \the [src]!")
|
|
|
|
/obj/item/reagent_containers/proc/feed_sound(var/mob/user)
|
|
return
|
|
|
|
/obj/item/reagent_containers/proc/standard_feed_mob(var/mob/user, var/mob/target) // This goes into attack
|
|
if(!istype(target) || !target.can_feed())
|
|
return FALSE
|
|
|
|
if(!reagents || !reagents.total_volume)
|
|
balloon_alert(user, "\the [src] is empty.")
|
|
return TRUE
|
|
|
|
if(!target.consume_liquid_belly)
|
|
if(liquid_belly_check())
|
|
to_chat(user, span_infoplain("[user == target ? "you can't" : "\The [target] can't"] consume that, it contains something produced from a belly!"))
|
|
return FALSE
|
|
|
|
if(ishuman(target))
|
|
var/mob/living/carbon/human/H = target
|
|
if(!H.check_has_mouth())
|
|
balloon_alert(user, "[user == target ? "you don't" : "\the [H] doesn't"] have a mouth!")
|
|
return FALSE
|
|
var/obj/item/blocked = H.check_mouth_coverage()
|
|
if(blocked)
|
|
balloon_alert(user, "\the [blocked] is in the way!")
|
|
return FALSE
|
|
|
|
user.setClickCooldown(user.get_attack_speed(src)) //puts a limit on how fast people can eat/drink things
|
|
SEND_SIGNAL(src, COMSIG_GLASS_DRANK, target, user)
|
|
if(user == target)
|
|
self_feed_message(user)
|
|
reagents.trans_to_mob(user, issmall(user) ? CEILING(amount_per_transfer_from_this/2, 1) : amount_per_transfer_from_this, CHEM_INGEST)
|
|
feed_sound(user)
|
|
return TRUE
|
|
|
|
else
|
|
other_feed_message_start(user, target)
|
|
if(!do_after(user, 3 SECONDS, target))
|
|
return FALSE
|
|
other_feed_message_finish(user, target)
|
|
|
|
var/contained = reagentlist()
|
|
add_attack_logs(user,target,"Fed from [src.name] containing [contained]")
|
|
reagents.trans_to_mob(target, amount_per_transfer_from_this, CHEM_INGEST)
|
|
feed_sound(user)
|
|
return TRUE
|
|
|
|
/obj/item/reagent_containers/proc/standard_pour_into(var/mob/user, var/atom/target) // This goes into afterattack and yes, it's atom-level
|
|
if(!target.is_open_container() || !target.reagents)
|
|
return 0
|
|
|
|
if(!reagents || !reagents.total_volume)
|
|
balloon_alert(usr, "[src] is empty!")
|
|
return 1
|
|
|
|
if(!target.reagents.get_free_space())
|
|
balloon_alert(usr, "[target] is full!")
|
|
return 1
|
|
|
|
var/trans = reagents.trans_to(target, amount_per_transfer_from_this)
|
|
balloon_alert(user, "transfered [trans] units to [target]")
|
|
return 1
|
|
|
|
/obj/item/reagent_containers/proc/liquid_belly_check()
|
|
if(!reagents)
|
|
return FALSE
|
|
for(var/datum/reagent/R in reagents.reagent_list)
|
|
if(R.from_belly)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/obj/item/reagent_containers/extrapolator_act(mob/living/user, obj/item/extrapolator/extrapolator, dry_run = FALSE)
|
|
. = ..()
|
|
EXTRAPOLATOR_ACT_SET(., EXTRAPOLATOR_ACT_PRIORITY_ISOLATE)
|
|
var/datum/reagent/blood/blood = reagents.get_reagent(REAGENT_ID_BLOOD)
|
|
EXTRAPOLATOR_ACT_ADD_DISEASES(., blood?.get_diseases())
|
|
|
|
/obj/item/reagent_containers/proc/attempt_changeling_test(var/obj/item/W,var/mob/user)
|
|
if(is_open_container() && W.is_hot())
|
|
var/datum/reagent/blood/B = reagents.get_reagent("blood")
|
|
if(B)
|
|
balloon_alert(user, "\The [W] burns the blood in \the [src].")
|
|
B.changling_blood_test(reagents)
|
|
|
|
/obj/item/reagent_containers/click_alt(mob/user)
|
|
. = ..()
|
|
if(!Adjacent(user))
|
|
return
|
|
if(!max_transfer_amount)
|
|
return
|
|
var/N = tgui_input_number(user, "Amount per transfer from this: ([min_transfer_amount]-[max_transfer_amount])","[src]",amount_per_transfer_from_this,max_transfer_amount,min_transfer_amount)
|
|
if(N)
|
|
amount_per_transfer_from_this = N
|