mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-13 10:23:15 +00:00
Removed the "feature" to have something log in an atom's vv attack log, but not the file attack log. all attack log items will go to the file as well as vv. Replaced all hard coded src.name/name for attack log's object argument with an actual object (src) except where it made more sense not to. All attack logging *should* happen AFTER damage is applied now. Removed the confusing attack entry for when a changeling stings another changeling. Tweaked how punch attack logs worked
93 lines
3.4 KiB
Plaintext
93 lines
3.4 KiB
Plaintext
/obj/item/weapon/reagent_containers/dropper
|
|
name = "dropper"
|
|
desc = "A dropper. Holds up to 5 units."
|
|
icon = 'icons/obj/chemical.dmi'
|
|
icon_state = "dropper0"
|
|
amount_per_transfer_from_this = 5
|
|
possible_transfer_amounts = list(1, 2, 3, 4, 5)
|
|
volume = 5
|
|
|
|
/obj/item/weapon/reagent_containers/dropper/afterattack(obj/target, mob/user , proximity)
|
|
if(!proximity) return
|
|
if(!target.reagents) return
|
|
|
|
if(reagents.total_volume > 0)
|
|
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
|
user << "<span class='notice'>[target] is full.</span>"
|
|
return
|
|
|
|
if(!target.is_open_container() && !ismob(target) && !istype(target,/obj/item/weapon/reagent_containers/food) && !istype(target, /obj/item/clothing/mask/cigarette)) //You can inject humans and food but you cant remove the shit.
|
|
user << "<span class='warning'>You cannot directly fill [target]!</span>"
|
|
return
|
|
|
|
var/trans = 0
|
|
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)
|
|
|
|
if(ismob(target))
|
|
if(istype(target , /mob/living/carbon/human))
|
|
var/mob/living/carbon/human/victim = target
|
|
|
|
var/obj/item/safe_thing = null
|
|
if(victim.wear_mask)
|
|
if(victim.wear_mask.flags_cover & MASKCOVERSEYES)
|
|
safe_thing = victim.wear_mask
|
|
if(victim.head)
|
|
if(victim.head.flags_cover & MASKCOVERSEYES)
|
|
safe_thing = victim.head
|
|
if(victim.glasses)
|
|
if(!safe_thing)
|
|
safe_thing = victim.glasses
|
|
|
|
if(safe_thing)
|
|
if(!safe_thing.reagents)
|
|
safe_thing.create_reagents(100)
|
|
|
|
reagents.reaction(safe_thing, TOUCH, fraction)
|
|
trans = reagents.trans_to(safe_thing, amount_per_transfer_from_this)
|
|
|
|
target.visible_message("<span class='danger'>[user] tries to squirt something into [target]'s eyes, but fails!</span>", \
|
|
"<span class='userdanger'>[user] tries to squirt something into [target]'s eyes, but fails!</span>")
|
|
|
|
user << "<span class='notice'>You transfer [trans] unit\s of the solution.</span>"
|
|
update_icon()
|
|
return
|
|
|
|
target.visible_message("<span class='danger'>[user] squirts something into [target]'s eyes!</span>", \
|
|
"<span class='userdanger'>[user] squirts something into [target]'s eyes!</span>")
|
|
|
|
reagents.reaction(target, TOUCH, fraction)
|
|
var/mob/M = target
|
|
var/R
|
|
if(reagents)
|
|
for(var/datum/reagent/A in src.reagents.reagent_list)
|
|
R += A.id + " ("
|
|
R += num2text(A.volume) + "),"
|
|
add_logs(user, M, "squirted", R)
|
|
|
|
trans = src.reagents.trans_to(target, amount_per_transfer_from_this)
|
|
user << "<span class='notice'>You transfer [trans] unit\s of the solution.</span>"
|
|
update_icon()
|
|
|
|
else
|
|
|
|
if(!target.is_open_container() && !istype(target,/obj/structure/reagent_dispensers))
|
|
user << "<span class='notice'>You cannot directly remove reagents from [target].</span>"
|
|
return
|
|
|
|
if(!target.reagents.total_volume)
|
|
user << "<span class='warning'>[target] is empty!</span>"
|
|
return
|
|
|
|
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
|
|
|
user << "<span class='notice'>You fill [src] with [trans] unit\s of the solution.</span>"
|
|
|
|
update_icon()
|
|
|
|
/obj/item/weapon/reagent_containers/dropper/update_icon()
|
|
overlays.Cut()
|
|
if(reagents.total_volume)
|
|
var/image/filling = image('icons/obj/reagentfillings.dmi', src, "dropper")
|
|
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
|
overlays += filling
|