Adds can_feed proc

This commit is contained in:
atermonera
2022-01-04 18:46:32 -08:00
parent 8b5a4a3ab5
commit e3ded3f321
3 changed files with 24 additions and 30 deletions
@@ -417,3 +417,6 @@
/mob/living/silicon/has_vision()
return 0 //NOT REAL EYES
/mob/living/silicon/can_feed()
return FALSE
+3
View File
@@ -685,3 +685,6 @@ var/global/image/backplane
return
item.screen_loc = screen_place
/mob/proc/can_feed()
return TRUE
@@ -80,53 +80,41 @@
return
/obj/item/weapon/reagent_containers/proc/standard_feed_mob(var/mob/user, var/mob/target) // This goes into attack
if(!istype(target) || issilicon(target))
return 0
if(!istype(target) || !target.can_feed())
return FALSE
if(!reagents || !reagents.total_volume)
to_chat(user, "<span class='notice'>\The [src] is empty.</span>")
return 1
return TRUE
if(target == user)
if(istype(user, /mob/living/carbon/human))
var/mob/living/carbon/human/H = user
if(!H.check_has_mouth())
to_chat(user, "Where do you intend to put \the [src]? You don't have a mouth!")
return
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
to_chat(user, "<span class='warning'>\The [blocked] is in the way!</span>")
return
if(ishuman(target))
var/mob/living/carbon/human/H = target
if(!H.check_has_mouth())
to_chat(user, "Where do you intend to put \the [src]? [user == target ? "You don't" : "\The [H] doesn't"] have a mouth!")
return FALSE
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
to_chat(user, "<span class='warning'>\The [blocked] is in the way!</span>")
return FALSE
user.setClickCooldown(user.get_attack_speed(src)) //puts a limit on how fast people can eat/drink things
user.setClickCooldown(user.get_attack_speed(src)) //puts a limit on how fast people can eat/drink things
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 1
return TRUE
else
if(istype(target, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target
if(!H.check_has_mouth())
to_chat(user, "Where do you intend to put \the [src]? \The [H] doesn't have a mouth!")
return
var/obj/item/blocked = H.check_mouth_coverage()
if(blocked)
to_chat(user, "<span class='warning'>\The [blocked] is in the way!</span>")
return
other_feed_message_start(user, target)
user.setClickCooldown(user.get_attack_speed(src))
if(!do_mob(user, target))
return
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 1
return TRUE
/obj/item/weapon/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)