Adds cooldowns to eating/feeding, allows attacking with reagent containers while on harm intent.

This commit is contained in:
mwerezak
2015-09-09 15:44:46 -04:00
parent af52b475ff
commit a58f70025d
4 changed files with 12 additions and 4 deletions

View File

@@ -23,6 +23,9 @@
flags |= OPENCONTAINER
attack(mob/M as mob, mob/user as mob, def_zone)
if(force && !(flags & NOBLUDGEON) && user.a_intent == I_HURT)
return ..()
if(standard_feed_mob(user, M))
return
@@ -93,10 +96,6 @@
volume = 150
flags = CONDUCT | OPENCONTAINER
/obj/item/weapon/reagent_containers/food/drinks/golden_cup/tournament_26_06_2011
desc = "A golden cup. It will be presented to a winner of tournament 26 june and name of the winner will be graved on it."
///////////////////////////////////////////////Drinks
//Notes by Darem: Drinks are simply containers that start preloaded. Unlike condiments, the contents can be ingested directly
// rather then having to add it to something else first. They should only contain liquids. They have a default container size of 50.

View File

@@ -41,6 +41,8 @@
return 0
if(istype(M, /mob/living/carbon))
//TODO: replace with standard_feed_mob() call.
var/fullness = M.nutrition + (M.reagents.get_reagent_amount("nutriment") * 25)
if(M == user) //If you're eating it yourself
if(istype(M,/mob/living/carbon/human))
@@ -53,6 +55,7 @@
user << "<span class='warning'>\The [blocked] is in the way!</span>"
return
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) //puts a limit on how fast people can eat/drink things
if (fullness <= 50)
M << "<span class='danger'>You hungrily chew out a piece of [src] and gobble it!</span>"
if (fullness > 50 && fullness <= 150)
@@ -83,6 +86,7 @@
user.visible_message("<span class='danger'>[user] cannot force anymore of [src] down [M]'s throat.</span>")
return 0
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(!do_mob(user, M)) return
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]</font>")

View File

@@ -18,6 +18,8 @@
icon_state = "pill[rand(1, 20)]"
attack(mob/M as mob, mob/user as mob, def_zone)
//TODO: replace with standard_feed_mob() call.
if(M == user)
if(istype(M, /mob/living/carbon/human))
@@ -50,6 +52,7 @@
user.visible_message("<span class='warning'>[user] attempts to force [M] to swallow \the [src].</span>")
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(!do_mob(user, M))
return