mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
@@ -1,116 +1,111 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Droppers.
|
||||
/// Droppers. ///
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/reagent_containers/dropper
|
||||
name = "dropper"
|
||||
desc = "A dropper. Transfers 5 units."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "dropper"
|
||||
item_state = "dropper"
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = list(1,2,3,4,5)
|
||||
possible_transfer_amounts = list(1, 2, 3, 4, 5)
|
||||
volume = 5
|
||||
|
||||
/obj/item/weapon/reagent_containers/dropper/on_reagent_change()
|
||||
if(reagents.total_volume <= 0)
|
||||
if(!reagents.total_volume)
|
||||
icon_state = "[initial(icon_state)]"
|
||||
else
|
||||
icon_state = "[initial(icon_state)]1"
|
||||
|
||||
/obj/item/weapon/reagent_containers/dropper/afterattack(obj/target, mob/user , flag)
|
||||
if(!target.reagents)
|
||||
/obj/item/weapon/reagent_containers/dropper/attack(mob/living/M, mob/living/user, def_zone)
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/dropper/afterattack(atom/target, mob/user, proximity)
|
||||
if(!proximity)
|
||||
return
|
||||
var/to_transfer = 0
|
||||
if(iscarbon(target))
|
||||
var/mob/living/carbon/C = target
|
||||
if(!reagents.total_volume)
|
||||
return
|
||||
if(user != C)
|
||||
visible_message("<span class='danger'>[user] begins to drip something into [C]'s eyes!</span>")
|
||||
if(!do_mob(user, C, 30))
|
||||
return
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
var/obj/item/safe_thing = null
|
||||
|
||||
if(reagents.total_volume)
|
||||
if(H.glasses)
|
||||
safe_thing = H.glasses
|
||||
if(H.wear_mask )
|
||||
if(H.wear_mask.flags_cover & MASKCOVERSEYES)
|
||||
safe_thing = H.wear_mask
|
||||
if(H.head)
|
||||
if(H.head.flags_cover & MASKCOVERSEYES)
|
||||
safe_thing = H.head
|
||||
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is full.</span>")
|
||||
if(safe_thing)
|
||||
visible_message("<span class='danger'>[user] tries to drip something into [H]'s eyes, but fails!</span>")
|
||||
|
||||
reagents.reaction(safe_thing, TOUCH)
|
||||
to_transfer = reagents.remove_any(amount_per_transfer_from_this)
|
||||
|
||||
to_chat(user, "<span class='notice'>You transfer [to_transfer] units of the solution.</span>")
|
||||
return
|
||||
|
||||
visible_message("<span class='danger'>[user] drips something into [C]'s eyes!</span>")
|
||||
reagents.reaction(C, TOUCH)
|
||||
|
||||
var/list/injected = list()
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
injected += R.name
|
||||
var/contained = english_list(injected)
|
||||
add_logs(user, C, "dripped", src, "([contained])")
|
||||
|
||||
to_transfer = reagents.trans_to(C, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You transfer [to_transfer] units of the solution.</span>")
|
||||
|
||||
if(isobj(target))
|
||||
if(!target.reagents)
|
||||
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.
|
||||
to_chat(user, "<span class='warning'>You cannot directly fill this object.</span>")
|
||||
return
|
||||
if(reagents.total_volume)
|
||||
if(!target.is_open_container() && !(istype(target, /obj/item/weapon/reagent_containers/food) && !istype(target, /obj/item/weapon/reagent_containers/food/pill)) && !istype(target, /obj/item/clothing/mask/cigarette))
|
||||
to_chat(user, "<span class='warning'>You cannot directly fill this object.</span>")
|
||||
return
|
||||
|
||||
var/trans = 0
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
if(ismob(target))
|
||||
if(istype(target , /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/victim = target
|
||||
to_transfer = reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You transfer [to_transfer] units of the solution.</span>")
|
||||
|
||||
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
|
||||
else
|
||||
if(!target.is_open_container() && !istype(target, /obj/structure/reagent_dispensers))
|
||||
to_chat(user, "<span class='warning'>You cannot directly remove reagents from [target].</span>")
|
||||
return
|
||||
|
||||
if(safe_thing)
|
||||
if(!safe_thing.reagents)
|
||||
safe_thing.create_reagents(100)
|
||||
trans = reagents.trans_to(safe_thing, amount_per_transfer_from_this)
|
||||
if(!target.reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is empty.</span>")
|
||||
return
|
||||
|
||||
visible_message("<span class='danger'>[user] tries to squirt something into [victim]'s eyes, but fails!</span>")
|
||||
spawn(5)
|
||||
reagents.reaction(safe_thing, TOUCH)
|
||||
to_transfer = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
||||
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] units of the solution.</span>")
|
||||
return
|
||||
|
||||
|
||||
visible_message("<span class='danger'>[user] squirts something into [target]'s eyes!</span>")
|
||||
reagents.reaction(target, TOUCH)
|
||||
|
||||
var/mob/living/M = target
|
||||
|
||||
var/list/injected = list()
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
injected += R.name
|
||||
var/contained = english_list(injected)
|
||||
M.create_attack_log("<font color='orange'>Has been squirted with [name] by [key_name(user)]. Reagents: [contained]</font>")
|
||||
user.create_attack_log("<font color='red'>Used the [name] to squirt [key_name(M)]. Reagents: [contained]</font>")
|
||||
if(M.ckey)
|
||||
msg_admin_attack("[key_name_admin(user)] squirted [key_name_admin(M)] with [name]. Reagents: [contained] (INTENT: [uppertext(user.a_intent)])")
|
||||
if(!iscarbon(user))
|
||||
M.LAssailant = null
|
||||
else
|
||||
M.LAssailant = user
|
||||
|
||||
trans = reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] units of the solution.</span>")
|
||||
|
||||
else
|
||||
|
||||
if(!target.is_open_container() && !istype(target,/obj/structure/reagent_dispensers))
|
||||
to_chat(user, "<span class='warning'>You cannot directly remove reagents from [target].</span>")
|
||||
return
|
||||
|
||||
if(!target.reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is empty.</span>")
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
||||
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] units of the solution.</span>")
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [to_transfer] units of the solution.</span>")
|
||||
|
||||
/obj/item/weapon/reagent_containers/dropper/cyborg
|
||||
name = "Industrial Dropper"
|
||||
desc = "A larger dropper. Transfers 10 units."
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(1,2,3,4,5,6,7,8,9,10)
|
||||
possible_transfer_amounts = list(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
|
||||
volume = 10
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// Droppers. END
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/obj/item/weapon/reagent_containers/dropper/precision
|
||||
name = "pipette"
|
||||
desc = "A high precision pippette. Holds 1 unit."
|
||||
icon = 'icons/obj/chemical.dmi'
|
||||
icon_state = "pipette"
|
||||
amount_per_transfer_from_this = 1
|
||||
possible_transfer_amounts = list(0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1)
|
||||
possible_transfer_amounts = list(0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1)
|
||||
volume = 1
|
||||
Reference in New Issue
Block a user