mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-29 15:08:34 +01:00
Gripper fixes (#19436)
* Fixes compile warning * SANE ARGS * return YES NO * Better
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/obj/machinery/injector_maker
|
||||
name = "Ready-to-Use Medicine 3000"
|
||||
desc = "Fills plastic autoinjectors with chemicals! Molds new injectors if needed! \n Add a beaker or a bottle filled with chemicals and an autoinjector of appropriate size or sheets of plastic to use!"
|
||||
desc = "Fills plastic autoinjectors with chemicals! Molds new injectors if needed! \n Add a beaker or a bottle filled with chemicals and an autoinjector of appropriate size or sheets of plastic to use! \n Plastic can be drag-dropped into the machine."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "injector"
|
||||
use_power = USE_POWER_IDLE
|
||||
@@ -112,6 +112,26 @@
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/machinery/injector_maker/MouseDrop_T(atom/dropping, mob/user, src_location, over_location, src_control, over_control, params)
|
||||
if(!isliving(user) || user.stat || !Adjacent(user) || !Adjacent(dropping))
|
||||
return
|
||||
|
||||
if(istype(dropping, /obj/item/stack/material/plastic))
|
||||
var/obj/item/stack/material/plastic/plastic_stack = dropping
|
||||
var/input_amount = tgui_input_number(user, "How many sheets would you like to add?", "Add plastic", 0, plastic_stack.get_amount())
|
||||
if(input_amount == 0)
|
||||
return
|
||||
if(!isliving(user) || user.stat || !Adjacent(user) || !Adjacent(dropping))
|
||||
return
|
||||
var/plastic_input = input_amount * value_plastic
|
||||
var/free_space = capacity_plastic - count_plastic
|
||||
if(plastic_input > free_space)
|
||||
to_chat(user, span_warning("Storage is full! There is only [free_space] units worth of space left!"))
|
||||
else
|
||||
plastic_stack.use(input_amount)
|
||||
src.count_plastic = src.count_plastic + plastic_input
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/injector_maker/click_alt(mob/user)
|
||||
. = ..()
|
||||
if(beaker)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
reagents.add_reagent(REAGENT_ID_COFFEE, 50)
|
||||
|
||||
//Infinite Coffee
|
||||
/obj/item/reagent_containers/food/drinks/bluespace_coffee/attack(mob/M as mob, mob/user as mob, def_zone)
|
||||
/obj/item/reagent_containers/food/drinks/bluespace_coffee/attack(mob/living/M, mob/living/user, target_zone, attack_modifier)
|
||||
..()
|
||||
src.reagents.add_reagent(REAGENT_ID_COFFEE, 50)
|
||||
reagents.add_reagent(REAGENT_ID_COFFEE, 50)
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
@@ -126,20 +126,20 @@
|
||||
reagent_volumes[T] = min(reagent_volumes[T] + 5, volume)
|
||||
return 1
|
||||
|
||||
/obj/item/reagent_containers/borghypo/attack(var/mob/living/M, var/mob/user)
|
||||
/obj/item/reagent_containers/borghypo/attack(mob/living/M, mob/living/user, target_zone, attack_modifier)
|
||||
if(!istype(M))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(istype(H))
|
||||
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
|
||||
if(!affected)
|
||||
balloon_alert(user, "\the [H] is missing that limb!")
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
/* since synths have oil/coolant streams now, it only makes sense that you should be able to inject stuff. preserved for posterity.
|
||||
else if(affected.robotic >= ORGAN_ROBOT)
|
||||
to_chat(user, span_danger("You cannot inject a robotic limb."))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
*/
|
||||
|
||||
if(M.can_inject(user, 1, ignore_thickness = bypass_protection))
|
||||
@@ -160,7 +160,7 @@
|
||||
switch(result)
|
||||
if(BORGHYPO_STATUS_CONTAINERFULL)
|
||||
balloon_alert(user, "\the [M] has too many reagents in [M.p_their()] system!")
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
if(BORGHYPO_STATUS_NOCHARGE)
|
||||
if(is_dispensing_recipe)
|
||||
balloon_alert(user, "not enough reagents to inject full recipe!")
|
||||
@@ -168,10 +168,10 @@
|
||||
else
|
||||
var/datum/reagent/empty_reagent = SSchemistry.chemical_reagents[reagent_id]
|
||||
balloon_alert(user, "\the [src] doesn't have enough [empty_reagent.name]!")
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
if(BORGHYPO_STATUS_NORECIPE)
|
||||
balloon_alert(user, "recipe '[selected_recipe_id]' not found!")
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
else
|
||||
if(is_dispensing_recipe)
|
||||
balloon_alert(user, "recipe '[selected_recipe_id]' injected into \the [M].")
|
||||
@@ -179,7 +179,8 @@
|
||||
else
|
||||
balloon_alert(user, "[amount_to_add] units injected into \the [M].")
|
||||
balloon_alert(M, "you feel a tiny prick!")
|
||||
return
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
/obj/item/reagent_containers/borghypo/attack_self(mob/user) //Change the mode
|
||||
. = ..(user)
|
||||
@@ -396,8 +397,8 @@
|
||||
REAGENT_ID_WATERMELONJUICE,
|
||||
REAGENT_ID_WHISKEY)
|
||||
|
||||
/obj/item/reagent_containers/borghypo/service/attack(var/mob/M, var/mob/user)
|
||||
return
|
||||
/obj/item/reagent_containers/borghypo/service/attack(mob/living/M, mob/living/user, target_zone, attack_modifier)
|
||||
return NONE
|
||||
|
||||
/obj/item/reagent_containers/borghypo/service/afterattack(var/obj/target, var/mob/user, var/proximity)
|
||||
if(!proximity)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
flags |= OPENCONTAINER
|
||||
update_icon()
|
||||
|
||||
/obj/item/reagent_containers/glass/attack(mob/M as mob, mob/user as mob, def_zone)
|
||||
/obj/item/reagent_containers/glass/attack(mob/living/M, mob/living/user, target_zone, attack_modifier)
|
||||
if(force && !(flags & NOBLUDGEON) && user.a_intent == I_HURT)
|
||||
return ..()
|
||||
|
||||
@@ -73,9 +73,9 @@
|
||||
return attempt_snake_milking(user, M)
|
||||
|
||||
if(standard_feed_mob(user, M))
|
||||
return
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
return 0
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
/obj/item/reagent_containers/glass/standard_feed_mob(var/mob/user, var/mob/target)
|
||||
if(user.a_intent == I_HURT)
|
||||
@@ -99,16 +99,16 @@
|
||||
|
||||
if(!reagent || !amount)
|
||||
to_chat(user, span_warning("[target] does not have venom you can express. Open the beaker to drink from it."))
|
||||
return TRUE
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
if(TIMER_COOLDOWN_RUNNING(target, COOLDOWN_VENOM_MILKING))
|
||||
user.visible_message(span_warning("[user] attempts to express venom from [target], but nothing happens."), span_warning("[target] had their venom expressed too recently, try again later."))
|
||||
return TRUE
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
TIMER_COOLDOWN_START(target, COOLDOWN_VENOM_MILKING, 30 SECONDS)
|
||||
user.visible_message(span_notice("[user] expresses venom from [target]."))
|
||||
reagents.add_reagent(reagent, amount)
|
||||
return TRUE
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
/obj/item/reagent_containers/glass/afterattack(var/obj/target, var/mob/user, var/proximity)
|
||||
if(!proximity || !is_open_container()) //Is the container open & are they next to whatever they're clicking?
|
||||
|
||||
@@ -29,46 +29,42 @@
|
||||
reagents.add_reagent(r, filled_reagents[r])
|
||||
update_icon()
|
||||
|
||||
/obj/item/reagent_containers/hypospray/attack(mob/living/M as mob, mob/user as mob)
|
||||
/obj/item/reagent_containers/hypospray/attack(mob/living/M, mob/living/user, target_zone, attack_modifier)
|
||||
if(!reagents.total_volume)
|
||||
balloon_alert(user, "\the [src] is empty.")
|
||||
return
|
||||
if (!istype(M))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
if(!M.consume_liquid_belly)
|
||||
if(liquid_belly_check())
|
||||
to_chat(user, span_infoplain("[user == M ? "You can't" : "\The [M] can't"] take that, it contains something produced from a belly!"))
|
||||
return FALSE
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(istype(H))
|
||||
var/obj/item/organ/external/affected = H.get_organ(user.zone_sel.selecting)
|
||||
if(!affected)
|
||||
balloon_alert(user, "\the [H] is missing that limb!")
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
/* since synths have oil/coolant streams now, it only makes sense that you should be able to inject stuff. preserved for posterity.
|
||||
else if(affected.robotic >= ORGAN_ROBOT)
|
||||
to_chat(user, span_danger("You cannot inject a robotic limb."))
|
||||
return
|
||||
*/
|
||||
|
||||
//VOREStation Add Start - Adds Prototype Hypo functionality
|
||||
if(H != user && prototype)
|
||||
balloon_alert(user, "injecting [H] with \the [src]")
|
||||
balloon_alert(H, "[user] is trying to inject you with \the [src]")
|
||||
if(!do_after(user, 3 SECONDS, target = H))
|
||||
return
|
||||
//VOREstation Add End
|
||||
return ITEM_INTERACT_FAILURE
|
||||
else if(!H.stat && !prototype)
|
||||
if(H != user)
|
||||
if(H.a_intent != I_HELP)
|
||||
balloon_alert(user, "[H] resists your attempt to inject them with \the [src].")
|
||||
balloon_alert(H, "[user] is trying to inject you with \the [src]")
|
||||
if(!do_after(user, 3 SECONDS, target = H))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
do_injection(H, user)
|
||||
return
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
// This does the actual injection and transfer.
|
||||
/obj/item/reagent_containers/hypospray/proc/do_injection(mob/living/carbon/human/H, mob/living/user)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
var/pierce_material = FALSE // If true, the patch can be used through thick material.
|
||||
|
||||
/obj/item/reagent_containers/pill/patch/attack(mob/M as mob, mob/user as mob)
|
||||
/obj/item/reagent_containers/pill/patch/attack(mob/living/M, mob/living/user, target_zone, attack_modifier)
|
||||
var/mob/living/L = user
|
||||
|
||||
if(M == L)
|
||||
@@ -28,41 +28,41 @@
|
||||
var/obj/item/organ/external/affecting = H.get_organ(check_zone(L.zone_sel.selecting))
|
||||
if(!affecting)
|
||||
to_chat(user, span_warning("The limb is missing!"))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
if(affecting.status >= ORGAN_ROBOT)
|
||||
to_chat(user, span_notice("\The [src] won't work on a robotic limb!"))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
if(!H.can_inject(user, FALSE, L.zone_sel.selecting, pierce_material))
|
||||
to_chat(user, span_notice("\The [src] can't be applied through such a thick material!"))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
to_chat(H, span_notice("\The [src] is placed on your [affecting]."))
|
||||
M.drop_from_inventory(src) //icon update
|
||||
if(reagents.total_volume)
|
||||
reagents.trans_to_mob(M, reagents.total_volume, CHEM_TOUCH)
|
||||
qdel(src)
|
||||
return 1
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
else if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/external/affecting = H.get_organ(check_zone(L.zone_sel.selecting))
|
||||
if(!affecting)
|
||||
to_chat(user, span_warning("The limb is missing!"))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
if(affecting.status >= ORGAN_ROBOT)
|
||||
to_chat(user, span_notice("\The [src] won't work on a robotic limb!"))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
if(!H.can_inject(user, FALSE, L.zone_sel.selecting, pierce_material))
|
||||
to_chat(user, span_notice("\The [src] can't be applied through such a thick material!"))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
user.visible_message(span_warning("[user] attempts to place \the [src] onto [H]`s [affecting]."))
|
||||
|
||||
user.setClickCooldown(user.get_attack_speed(src))
|
||||
if(!do_after(user, 3 SECONDS, M))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
user.drop_from_inventory(src) //icon update
|
||||
user.visible_message(span_warning("[user] applies \the [src] to [H]."))
|
||||
@@ -77,6 +77,6 @@
|
||||
reagents.trans_to_mob(M, reagents.total_volume, CHEM_TOUCH) //CHEM_TOUCH
|
||||
qdel(src)
|
||||
|
||||
return 1
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
return 0
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
@@ -22,45 +22,45 @@
|
||||
if(!icon_state)
|
||||
icon_state = "[base_state][rand(1, 4)]" //preset pills only use colour changing or unique icons
|
||||
|
||||
/obj/item/reagent_containers/pill/attack(mob/M as mob, mob/user as mob)
|
||||
/obj/item/reagent_containers/pill/attack(mob/living/M, mob/living/user, target_zone, attack_modifier)
|
||||
if(!M.consume_liquid_belly)
|
||||
if(liquid_belly_check())
|
||||
to_chat(user, span_infoplain("[user == M ? "You can't" : "\The [M] can't"] consume that, it contains something produced from a belly!"))
|
||||
return FALSE
|
||||
return ITEM_INTERACT_FAILURE
|
||||
if(M == user)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!H.check_has_mouth())
|
||||
to_chat(user, "Where do you intend to put \the [src]? You don't have a mouth!")
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
var/obj/item/blocked = H.check_mouth_coverage()
|
||||
if(blocked)
|
||||
balloon_alert(user, "\the [blocked] is in the way!")
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
balloon_alert(user, "swallowed \the [src]")
|
||||
M.drop_from_inventory(src) //icon update
|
||||
if(reagents.total_volume)
|
||||
reagents.trans_to_mob(M, reagents.total_volume, CHEM_INGEST)
|
||||
qdel(src)
|
||||
return 1
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
else if(ishuman(M))
|
||||
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!H.check_has_mouth())
|
||||
balloon_alert(user, "\the [H] doesn't have a mouth.")
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
var/obj/item/blocked = H.check_mouth_coverage()
|
||||
if(blocked)
|
||||
balloon_alert(user, "\the [blocked] is in the way!")
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
user.balloon_alert_visible("[user] attempts to force [M] to swallow \the [src].")
|
||||
|
||||
user.setClickCooldown(user.get_attack_speed(src))
|
||||
if(!do_after(user, 3 SECONDS, M))
|
||||
return
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
user.drop_from_inventory(src) //icon update
|
||||
user.balloon_alert_visible("[user] forces [M] to swallow \the [src].")
|
||||
@@ -72,9 +72,9 @@
|
||||
reagents.trans_to_mob(M, reagents.total_volume, CHEM_INGEST)
|
||||
qdel(src)
|
||||
|
||||
return 1
|
||||
return ITEM_INTERACT_SUCCESS
|
||||
|
||||
return 0
|
||||
return ITEM_INTERACT_FAILURE
|
||||
|
||||
/obj/item/reagent_containers/pill/afterattack(obj/target, mob/user, proximity)
|
||||
if(!proximity) return
|
||||
|
||||
Reference in New Issue
Block a user