Merge branch 'master' into TGUIs_Nexties
This commit is contained in:
@@ -171,7 +171,7 @@
|
||||
|
||||
return master
|
||||
|
||||
/datum/reagents/proc/trans_to(obj/target, amount=1, multiplier=1, preserve_data=1, no_react = 0)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
|
||||
/datum/reagents/proc/trans_to(obj/target, amount = 1, multiplier = 1, preserve_data = 1, no_react = 0, log = FALSE)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
|
||||
var/list/cached_reagents = reagent_list
|
||||
if(!target || !total_volume)
|
||||
return
|
||||
@@ -188,17 +188,23 @@
|
||||
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
|
||||
var/part = amount / src.total_volume
|
||||
var/trans_data = null
|
||||
var/list/transferred = list()
|
||||
for(var/reagent in cached_reagents)
|
||||
var/datum/reagent/T = reagent
|
||||
var/transfer_amount = T.volume * part
|
||||
if(preserve_data)
|
||||
trans_data = copy_data(T)
|
||||
|
||||
transferred += "[T] - [transfer_amount]"
|
||||
|
||||
R.add_reagent(T.type, transfer_amount * multiplier, trans_data, chem_temp, T.purity, pH, no_react = TRUE, ignore_pH = TRUE) //we only handle reaction after every reagent has been transfered.
|
||||
|
||||
remove_reagent(T.type, transfer_amount, ignore_pH = TRUE)
|
||||
|
||||
if(log && amount > 0)
|
||||
var/atom/us = my_atom
|
||||
var/atom/them = R.my_atom
|
||||
var/location_string = "FROM [(us && "[us] ([REF(us)]) [COORD(us)]") || "NULL"] TO [(them && "[them] ([REF(them)]) [COORD(them)]") || "NULL"]"
|
||||
log_reagent_transfer("[location_string] - [key_name(usr)][istext(log) ? " - [log]" : ""]: trans_to with arguments [target] [amount] [multiplier] [preserve_data] [no_react] and reagents [english_list(transferred)]")
|
||||
|
||||
update_total()
|
||||
R.update_total()
|
||||
if(!no_react)
|
||||
@@ -237,7 +243,7 @@
|
||||
src.handle_reactions()
|
||||
return amount
|
||||
|
||||
/datum/reagents/proc/trans_id_to(obj/target, reagent, amount=1, preserve_data=1)//Not sure why this proc didn't exist before. It does now! /N
|
||||
/datum/reagents/proc/trans_id_to(obj/target, reagent, amount = 1, preserve_data = TRUE, log = FALSE)//Not sure why this proc didn't exist before. It does now! /N
|
||||
var/list/cached_reagents = reagent_list
|
||||
if (!target)
|
||||
return
|
||||
@@ -257,8 +263,12 @@
|
||||
if(preserve_data)
|
||||
trans_data = current_reagent.data
|
||||
R.add_reagent(current_reagent.type, amount, trans_data, chem_temp, current_reagent.purity, pH, no_react = TRUE)
|
||||
|
||||
remove_reagent(current_reagent.type, amount, 1)
|
||||
if(log && amount > 0)
|
||||
var/atom/us = my_atom
|
||||
var/atom/them = R.my_atom
|
||||
var/location_string = "FROM [(us && "[us] ([REF(us)]) [COORD(us)]") || "NULL"] TO [(them && "[them] ([REF(them)]) [COORD(them)]") || "NULL"]"
|
||||
log_reagent_transfer("[location_string] - [key_name(usr)][istext(log) ? " - [log]" : ""]: trans_id_to with arguments [target] [reagent] [amount] [preserve_data]")
|
||||
break
|
||||
|
||||
src.update_total()
|
||||
|
||||
@@ -148,8 +148,8 @@
|
||||
|
||||
/obj/machinery/chem_master/on_deconstruction()
|
||||
var/atom/A = drop_location()
|
||||
beaker.forceMove(A)
|
||||
bottle.forceMove(A)
|
||||
beaker?.forceMove(A)
|
||||
bottle?.forceMove(A)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/chem_master/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
|
||||
@@ -887,7 +887,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
/datum/reagent/consumable/ethanol/barefoot/on_mob_life(mob/living/carbon/M)
|
||||
if(ishuman(M)) //Barefoot causes the imbiber to quickly regenerate brute trauma if they're not wearing shoes.
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!H.shoes)
|
||||
if(!H.shoes || !(H.shoes.body_parts_covered & FEET))
|
||||
H.adjustBruteLoss(-3, 0)
|
||||
. = 1
|
||||
return ..() || .
|
||||
|
||||
@@ -153,20 +153,37 @@
|
||||
color = "#669900" // rgb: 102, 153, 0
|
||||
toxpwr = 0.5
|
||||
taste_description = "death"
|
||||
var/fakedeath_active = FALSE
|
||||
pH = 13
|
||||
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
L.fakedeath(type)
|
||||
ADD_TRAIT(L, TRAIT_FAKEDEATH, type)
|
||||
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_end_metabolize(mob/living/L)
|
||||
L.cure_fakedeath(type)
|
||||
..()
|
||||
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_life(mob/living/carbon/M)
|
||||
M.adjustOxyLoss(0.5*REM, 0)
|
||||
/datum/reagent/toxin/zombiepowder/reaction_mob(mob/living/L, method=TOUCH, reac_volume)
|
||||
L.adjustOxyLoss(0.5*REM, 0)
|
||||
if(method == INGEST)
|
||||
fakedeath_active = TRUE
|
||||
L.fakedeath(type)
|
||||
|
||||
/datum/reagent/toxin/zombiepowder/on_mob_life(mob/living/M)
|
||||
..()
|
||||
. = 1
|
||||
if(fakedeath_active)
|
||||
return TRUE
|
||||
switch(current_cycle)
|
||||
if(1 to 5)
|
||||
M.confused += 1
|
||||
M.drowsyness += 1
|
||||
M.slurring += 3
|
||||
if(5 to 8)
|
||||
M.adjustStaminaLoss(40, 0)
|
||||
if(9 to INFINITY)
|
||||
fakedeath_active = TRUE
|
||||
M.fakedeath(type)
|
||||
|
||||
/datum/reagent/toxin/ghoulpowder
|
||||
name = "Ghoul Powder"
|
||||
|
||||
@@ -70,6 +70,14 @@
|
||||
required_other = TRUE
|
||||
required_container = /obj/item/slime_extract/green
|
||||
|
||||
/datum/chemical_reaction/slime/slimemammal
|
||||
name = "Mammal Mutation Toxin"
|
||||
id = /datum/reagent/mutationtoxin/mammal
|
||||
results = list(/datum/reagent/mutationtoxin/mammal = 1)
|
||||
required_reagents = list(/datum/reagent/water = 1)
|
||||
required_other = TRUE
|
||||
required_container = /obj/item/slime_extract/green
|
||||
|
||||
//Metal
|
||||
/datum/chemical_reaction/slime/slimemetal
|
||||
name = "Slime Metal"
|
||||
|
||||
@@ -186,6 +186,7 @@ GLOBAL_LIST_INIT(food_reagents, build_reagents_to_food()) //reagentid = related
|
||||
var/datum/chemical_reaction/recipe = get_chemical_reaction(recipe_id)
|
||||
if(!recipe)
|
||||
info = "This recipe is illegible."
|
||||
return
|
||||
var/list/dat = list("<ul>")
|
||||
for(var/rid in recipe.required_reagents)
|
||||
var/datum/reagent/R = GLOB.chemical_reagents_list[rid]
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
#define PH_WEAK (1 << 0)
|
||||
#define TEMP_WEAK (1 << 1)
|
||||
|
||||
/obj/item/reagent_containers
|
||||
name = "Container"
|
||||
desc = "..."
|
||||
@@ -9,14 +6,13 @@
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
var/amount_per_transfer_from_this = 5
|
||||
var/list/possible_transfer_amounts = list(5,10,15,20,25,30)
|
||||
var/APTFT_altclick = TRUE //will the set amount_per_transfer_from_this proc be called on AltClick() ?
|
||||
var/volume = 30
|
||||
var/reagent_flags
|
||||
var/reagent_flags //used to determine the reagent holder flags on add_initial_reagents()
|
||||
var/list/list_reagents = null
|
||||
var/spawned_disease = null
|
||||
var/disease_amount = 20
|
||||
var/spillable = FALSE
|
||||
var/beaker_weakness_bitflag = NONE//Bitflag!
|
||||
var/container_flags = APTFT_ALTCLICK|APTFT_VERB //the container item flags
|
||||
var/container_HP = 2
|
||||
var/cached_icon
|
||||
|
||||
@@ -24,7 +20,7 @@
|
||||
. = ..()
|
||||
if(isnum(vol) && vol > 0)
|
||||
volume = vol
|
||||
if(length(possible_transfer_amounts))
|
||||
if(container_flags & APTFT_VERB && length(possible_transfer_amounts))
|
||||
verbs += /obj/item/reagent_containers/proc/set_APTFT
|
||||
create_reagents(volume, reagent_flags)
|
||||
if(spawned_disease)
|
||||
@@ -37,12 +33,12 @@
|
||||
. = ..()
|
||||
if(length(possible_transfer_amounts) > 1)
|
||||
. += "Currently transferring [amount_per_transfer_from_this] units per use."
|
||||
if(APTFT_altclick && user.Adjacent(src))
|
||||
if(container_flags & APTFT_ALTCLICK && user.Adjacent(src))
|
||||
. += "<span class='notice'>Alt-click it to set its transfer amount.</span>"
|
||||
|
||||
/obj/item/reagent_containers/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(APTFT_altclick && length(possible_transfer_amounts) > 1 && user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
|
||||
if(container_flags & APTFT_ALTCLICK && length(possible_transfer_amounts) > 1 && user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
|
||||
set_APTFT()
|
||||
return TRUE
|
||||
|
||||
@@ -108,10 +104,12 @@
|
||||
|
||||
/obj/item/reagent_containers/proc/bartender_check(atom/target)
|
||||
. = FALSE
|
||||
if(target.CanPass(src, get_turf(src)) && thrownby && thrownby.actions)
|
||||
for(var/datum/action/innate/drink_fling/D in thrownby.actions)
|
||||
if(D.active)
|
||||
return TRUE
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T || target.CanPass(src, T) || !thrownby || !thrownby.actions)
|
||||
return
|
||||
for(var/datum/action/innate/drink_fling/D in thrownby.actions)
|
||||
if(D.active)
|
||||
return TRUE
|
||||
|
||||
/obj/item/reagent_containers/proc/ForceResetRotation()
|
||||
transform = initial(transform)
|
||||
@@ -155,7 +153,7 @@
|
||||
//melts plastic beakers
|
||||
/obj/item/reagent_containers/microwave_act(obj/machinery/microwave/M)
|
||||
reagents.expose_temperature(1000)
|
||||
if(beaker_weakness_bitflag & TEMP_WEAK)
|
||||
if(container_flags & TEMP_WEAK)
|
||||
var/list/seen = viewers(5, get_turf(src))
|
||||
var/iconhtml = icon2html(src, seen)
|
||||
for(var/mob/H in seen)
|
||||
@@ -170,13 +168,13 @@
|
||||
temp_check()
|
||||
|
||||
/obj/item/reagent_containers/proc/temp_check()
|
||||
if(beaker_weakness_bitflag & TEMP_WEAK)
|
||||
if(container_flags & TEMP_WEAK)
|
||||
if(reagents.chem_temp >= 444)//assuming polypropylene
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
//melts glass beakers
|
||||
/obj/item/reagent_containers/proc/pH_check()
|
||||
if(beaker_weakness_bitflag & PH_WEAK)
|
||||
if(container_flags & PH_WEAK)
|
||||
if((reagents.pH < 1.5) || (reagents.pH > 12.5))
|
||||
START_PROCESSING(SSobj, src)
|
||||
else if((reagents.pH < -3) || (reagents.pH > 17))
|
||||
@@ -190,7 +188,7 @@
|
||||
cached_icon = icon_state
|
||||
var/damage
|
||||
var/cause
|
||||
if(beaker_weakness_bitflag & PH_WEAK)
|
||||
if(container_flags & PH_WEAK)
|
||||
if(reagents.pH < 2)
|
||||
damage = (2 - reagents.pH)/20
|
||||
cause = "from the extreme pH"
|
||||
@@ -201,7 +199,7 @@
|
||||
cause = "from the extreme pH"
|
||||
playsound(get_turf(src), 'sound/FermiChem/bufferadd.ogg', 50, 1)
|
||||
|
||||
if(beaker_weakness_bitflag & TEMP_WEAK)
|
||||
if(container_flags & TEMP_WEAK)
|
||||
if(reagents.chem_temp >= 444)
|
||||
if(damage)
|
||||
damage += (reagents.chem_temp/444)/5
|
||||
|
||||
@@ -21,13 +21,9 @@
|
||||
|
||||
if(istype(M))
|
||||
if(user.a_intent == INTENT_HARM)
|
||||
var/R
|
||||
M.visible_message("<span class='danger'>[user] splashes the contents of [src] onto [M]!</span>", \
|
||||
"<span class='userdanger'>[user] splashes the contents of [src] onto [M]!</span>")
|
||||
if(reagents)
|
||||
for(var/datum/reagent/A in reagents.reagent_list)
|
||||
R += A.type + " ("
|
||||
R += num2text(A.volume) + "),"
|
||||
var/R = reagents?.log_list()
|
||||
if(isturf(target) && reagents.reagent_list.len && thrownby)
|
||||
log_combat(thrownby, target, "splashed (thrown) [english_list(reagents.reagent_list)]")
|
||||
message_admins("[ADMIN_LOOKUPFLW(thrownby)] splashed (thrown) [english_list(reagents.reagent_list)] on [target] at [ADMIN_VERBOSEJMP(target)].")
|
||||
@@ -35,7 +31,8 @@
|
||||
log_combat(user, M, "splashed", R)
|
||||
reagents.clear_reagents()
|
||||
else
|
||||
if(M != user)
|
||||
var/self_fed = M == user
|
||||
if(!self_fed)
|
||||
M.visible_message("<span class='danger'>[user] attempts to feed something to [M].</span>", \
|
||||
"<span class='userdanger'>[user] attempts to feed something to you.</span>")
|
||||
if(!do_mob(user, M))
|
||||
@@ -48,7 +45,7 @@
|
||||
to_chat(user, "<span class='notice'>You swallow a gulp of [src].</span>")
|
||||
var/fraction = min(5/reagents.total_volume, 1)
|
||||
reagents.reaction(M, INGEST, fraction)
|
||||
addtimer(CALLBACK(reagents, /datum/reagents.proc/trans_to, M, 5), 5)
|
||||
addtimer(CALLBACK(reagents, /datum/reagents.proc/trans_to, M, 5, null, null, null, self_fed? "self swallowed" : "fed by [user]"), 5)
|
||||
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
|
||||
|
||||
/obj/item/reagent_containers/glass/afterattack(obj/target, mob/user, proximity)
|
||||
@@ -65,7 +62,7 @@
|
||||
to_chat(user, "<span class='warning'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
var/trans = reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
var/trans = reagents.trans_to(target, amount_per_transfer_from_this, log = "reagentcontainer-glass afterattack transfer to")
|
||||
to_chat(user, "<span class='notice'>You transfer [trans] unit\s of the solution to [target].</span>")
|
||||
|
||||
else if(target.is_drainable()) //A dispenser. Transfer FROM it TO us.
|
||||
@@ -77,7 +74,7 @@
|
||||
to_chat(user, "<span class='warning'>[src] is full.</span>")
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this)
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this, log = "reagentcontainer-glass afterattack fill from")
|
||||
to_chat(user, "<span class='notice'>You fill [src] with [trans] unit\s of the contents of [target].</span>")
|
||||
|
||||
else if(reagents.total_volume)
|
||||
@@ -100,7 +97,7 @@
|
||||
to_chat(user, "<span class='notice'>[src] is full.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You break [E] in [src].</span>")
|
||||
E.reagents.trans_to(src, E.reagents.total_volume)
|
||||
E.reagents.trans_to(src, E.reagents.total_volume, log = "reagentcontainer-glass break egg in")
|
||||
qdel(E)
|
||||
return
|
||||
..()
|
||||
@@ -114,7 +111,7 @@
|
||||
item_state = "beaker"
|
||||
materials = list(MAT_GLASS=500)
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,50,60)
|
||||
beaker_weakness_bitflag = PH_WEAK
|
||||
container_flags = PH_WEAK|APTFT_ALTCLICK|APTFT_VERB
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/Initialize()
|
||||
. = ..()
|
||||
@@ -207,11 +204,7 @@
|
||||
volume = 180
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,40,50,60,120,180)
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/plastic/Initialize()
|
||||
beaker_weakness_bitflag &= ~PH_WEAK
|
||||
beaker_weakness_bitflag |= TEMP_WEAK
|
||||
. = ..()
|
||||
container_flags = TEMP_WEAK|APTFT_ALTCLICK|APTFT_VERB
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/plastic/update_icon()
|
||||
icon_state = "beakerlarge" // hack to lets us reuse the large beaker reagent fill states
|
||||
@@ -226,10 +219,7 @@
|
||||
volume = 240
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,40,50,60,120,200,240)
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/meta/Initialize() // why the fuck can't you just set the beaker weakness bitflags to nothing? fuck you
|
||||
beaker_weakness_bitflag &= ~PH_WEAK
|
||||
. = ..()
|
||||
container_flags = APTFT_ALTCLICK|APTFT_VERB
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/noreact
|
||||
name = "cryostasis beaker"
|
||||
@@ -240,13 +230,9 @@
|
||||
reagent_flags = OPENCONTAINER | NO_REACT
|
||||
volume = 50
|
||||
amount_per_transfer_from_this = 10
|
||||
container_flags = APTFT_ALTCLICK|APTFT_VERB
|
||||
container_HP = 10//shouldn't be needed
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/noreact/Initialize()
|
||||
beaker_weakness_bitflag &= ~PH_WEAK
|
||||
. = ..()
|
||||
//reagents.set_reacting(FALSE) was this removed in a recent pr?
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/bluespace
|
||||
name = "bluespace beaker"
|
||||
desc = "A bluespace beaker, powered by experimental bluespace technology \
|
||||
@@ -314,18 +300,15 @@
|
||||
SLOT_L_STORE, SLOT_R_STORE,\
|
||||
SLOT_GENERC_DEXTROUS_STORAGE
|
||||
)
|
||||
container_flags = APTFT_ALTCLICK|APTFT_VERB
|
||||
container_HP = 1
|
||||
|
||||
/obj/item/reagent_containers/glass/bucket/Initialize()
|
||||
beaker_weakness_bitflag |= TEMP_WEAK
|
||||
. = ..()
|
||||
|
||||
/obj/item/reagent_containers/glass/bucket/attackby(obj/O, mob/user, params)
|
||||
if(istype(O, /obj/item/mop))
|
||||
if(reagents.total_volume < 1)
|
||||
to_chat(user, "<span class='warning'>[src] is out of water!</span>")
|
||||
else
|
||||
reagents.trans_to(O, 5)
|
||||
reagents.trans_to(O, 5, log = "reagentcontainer-bucket fill mop")
|
||||
to_chat(user, "<span class='notice'>You wet [O] in [src].</span>")
|
||||
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
|
||||
else if(isprox(O))
|
||||
@@ -369,12 +352,9 @@
|
||||
volume = 50
|
||||
amount_per_transfer_from_this = 10
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,50)
|
||||
container_flags = TEMP_WEAK|APTFT_ALTCLICK|APTFT_VERB
|
||||
container_HP = 1
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/waterbottle/Initialize()
|
||||
beaker_weakness_bitflag |= TEMP_WEAK
|
||||
. = ..()
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/waterbottle/empty
|
||||
list_reagents = list()
|
||||
|
||||
|
||||
@@ -362,30 +362,14 @@
|
||||
return
|
||||
|
||||
/obj/item/hypospray/mkii/afterattack(atom/target, mob/user, proximity)
|
||||
if(!vial)
|
||||
if(!vial || !proximity || !isliving(target))
|
||||
return
|
||||
var/mob/living/L = target
|
||||
|
||||
if(!L.reagents || !L.can_inject(user, TRUE, user.zone_selected, penetrates))
|
||||
return
|
||||
|
||||
if(!proximity)
|
||||
return
|
||||
|
||||
if(!ismob(target))
|
||||
return
|
||||
|
||||
var/mob/living/L
|
||||
if(isliving(target))
|
||||
L = target
|
||||
if(!penetrates && !L.can_inject(user, 1)) //This check appears another four times, since otherwise the penetrating sprays will break in do_mob.
|
||||
return
|
||||
|
||||
if(!L && !target.is_injectable()) //only checks on non-living mobs, due to how can_inject() handles
|
||||
to_chat(user, "<span class='warning'>You cannot directly fill [target]!</span>")
|
||||
return
|
||||
|
||||
if(target.reagents.total_volume >= target.reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>[target] is full.</span>")
|
||||
return
|
||||
|
||||
if(ishuman(L))
|
||||
if(iscarbon(L))
|
||||
var/obj/item/bodypart/affecting = L.get_bodypart(check_zone(user.zone_selected))
|
||||
if(!affecting)
|
||||
to_chat(user, "<span class='warning'>The limb is missing!</span>")
|
||||
@@ -394,84 +378,40 @@
|
||||
to_chat(user, "<span class='notice'>Medicine won't work on a robotic limb!</span>")
|
||||
return
|
||||
|
||||
//Always log attemped injections for admins
|
||||
var/contained = vial.reagents.log_list()
|
||||
log_combat(user, L, "attemped to inject", src, addition="which had [contained]")
|
||||
//Always log attemped injections for admins
|
||||
if(vial != null)
|
||||
switch(mode)
|
||||
if(HYPO_INJECT)
|
||||
if(L) //living mob
|
||||
if(L != user)
|
||||
L.visible_message("<span class='danger'>[user] is trying to inject [L] with [src]!</span>", \
|
||||
"<span class='userdanger'>[user] is trying to inject [L] with [src]!</span>")
|
||||
if(!do_mob(user, L, inject_wait))
|
||||
return
|
||||
if(!penetrates && !L.can_inject(user, 1))
|
||||
return
|
||||
if(!vial.reagents.total_volume)
|
||||
return
|
||||
if(L.reagents.total_volume >= L.reagents.maximum_volume)
|
||||
return
|
||||
L.visible_message("<span class='danger'>[user] uses the [src] on [L]!</span>", \
|
||||
"<span class='userdanger'>[user] uses the [src] on [L]!</span>")
|
||||
else
|
||||
if(!do_mob(user, L, inject_self))
|
||||
return
|
||||
if(!penetrates && !L.can_inject(user, 1))
|
||||
return
|
||||
if(!vial.reagents.total_volume)
|
||||
return
|
||||
if(L.reagents.total_volume >= L.reagents.maximum_volume)
|
||||
return
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) applied [src] to [L.name] ([L.ckey]), which had [contained] (INTENT: [uppertext(user.a_intent)]) (MODE: [src.mode])</font>")
|
||||
L.log_message("<font color='orange'>applied [src] to themselves ([contained]).</font>", INDIVIDUAL_ATTACK_LOG)
|
||||
|
||||
var/fraction = min(vial.amount_per_transfer_from_this/vial.reagents.total_volume, 1)
|
||||
vial.reagents.reaction(L, INJECT, fraction)
|
||||
vial.reagents.trans_to(target, vial.amount_per_transfer_from_this)
|
||||
if(vial.amount_per_transfer_from_this >= 15)
|
||||
playsound(loc,'sound/items/hypospray_long.ogg',50, 1, -1)
|
||||
if(vial.amount_per_transfer_from_this < 15)
|
||||
playsound(loc, pick('sound/items/hypospray.ogg','sound/items/hypospray2.ogg'), 50, 1, -1)
|
||||
to_chat(user, "<span class='notice'>You inject [vial.amount_per_transfer_from_this] units of the solution. The hypospray's cartridge now contains [vial.reagents.total_volume] units.</span>")
|
||||
|
||||
if(HYPO_SPRAY)
|
||||
if(L) //living mob
|
||||
if(L != user)
|
||||
L.visible_message("<span class='danger'>[user] is trying to spray [L] with [src]!</span>", \
|
||||
"<span class='userdanger'>[user] is trying to spray [L] with [src]!</span>")
|
||||
if(!do_mob(user, L, spray_wait))
|
||||
return
|
||||
if(!penetrates && !L.can_inject(user, 1))
|
||||
return
|
||||
if(!vial.reagents.total_volume)
|
||||
return
|
||||
if(L.reagents.total_volume >= L.reagents.maximum_volume)
|
||||
return
|
||||
L.visible_message("<span class='danger'>[user] uses the [src] on [L]!</span>", \
|
||||
"<span class='userdanger'>[user] uses the [src] on [L]!</span>")
|
||||
else
|
||||
if(!do_mob(user, L, spray_self))
|
||||
return
|
||||
if(!penetrates && !L.can_inject(user, 1))
|
||||
return
|
||||
if(!vial.reagents.total_volume)
|
||||
return
|
||||
if(L.reagents.total_volume >= L.reagents.maximum_volume)
|
||||
return
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) applied [src] to [L.name] ([L.ckey]), which had [contained] (INTENT: [uppertext(user.a_intent)]) (MODE: [src.mode])</font>")
|
||||
L.log_message("<font color='orange'>applied [src] to themselves ([contained]).</font>", INDIVIDUAL_ATTACK_LOG)
|
||||
var/fraction = min(vial.amount_per_transfer_from_this/vial.reagents.total_volume, 1)
|
||||
vial.reagents.reaction(L, PATCH, fraction)
|
||||
vial.reagents.trans_to(target, vial.amount_per_transfer_from_this)
|
||||
if(vial.amount_per_transfer_from_this >= 15)
|
||||
playsound(loc,'sound/items/hypospray_long.ogg',50, 1, -1)
|
||||
if(vial.amount_per_transfer_from_this < 15)
|
||||
playsound(loc, pick('sound/items/hypospray.ogg','sound/items/hypospray2.ogg'), 50, 1, -1)
|
||||
to_chat(user, "<span class='notice'>You spray [vial.amount_per_transfer_from_this] units of the solution. The hypospray's cartridge now contains [vial.reagents.total_volume] units.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>[src] doesn't work here!</span>")
|
||||
if(!vial)
|
||||
to_chat(user, "<span class='notice'>[src] doesn't have any vial installed!</span>")
|
||||
return
|
||||
if(!vial.reagents.total_volume)
|
||||
to_chat(user, "<span class='notice'>[src]'s vial is empty!</span>")
|
||||
return
|
||||
|
||||
var/fp_verb = mode == HYPO_SPRAY ? "spray" : "inject"
|
||||
var/method = mode == HYPO_SPRAY ? TOUCH : INJECT
|
||||
|
||||
if(L != user)
|
||||
L.visible_message("<span class='danger'>[user] is trying to [fp_verb] [L] with [src]!</span>", \
|
||||
"<span class='userdanger'>[user] is trying to [fp_verb] you with [src]!</span>")
|
||||
if(!do_mob(user, L, inject_wait, extra_checks = CALLBACK(L, /mob/living/proc/can_inject, user, FALSE, user.zone_selected, penetrates)))
|
||||
return
|
||||
if(!vial.reagents.total_volume)
|
||||
return
|
||||
log_attack("<font color='red'>[user.name] ([user.ckey]) applied [src] to [L.name] ([L.ckey]), which had [contained] (INTENT: [uppertext(user.a_intent)]) (MODE: [mode])</font>")
|
||||
if(L != user)
|
||||
L.visible_message("<span class='danger'>[user] uses the [src] on [L]!</span>", \
|
||||
"<span class='userdanger'>[user] uses the [src] on you!</span>")
|
||||
else
|
||||
L.log_message("<font color='orange'>applied [src] to themselves ([contained]).</font>", INDIVIDUAL_ATTACK_LOG)
|
||||
|
||||
var/fraction = min(vial.amount_per_transfer_from_this/vial.reagents.total_volume, 1)
|
||||
vial.reagents.reaction(L, method, fraction)
|
||||
vial.reagents.trans_to(target, vial.amount_per_transfer_from_this)
|
||||
var/long_sound = vial.amount_per_transfer_from_this >= 15
|
||||
playsound(loc, long_sound ? 'sound/items/hypospray_long.ogg' : pick('sound/items/hypospray.ogg','sound/items/hypospray2.ogg'), 50, 1, -1)
|
||||
to_chat(user, "<span class='notice'>You [fp_verb] [vial.amount_per_transfer_from_this] units of the solution. The hypospray's cartridge now contains [vial.reagents.total_volume] units.</span>")
|
||||
|
||||
/obj/item/hypospray/mkii/attack_self(mob/living/user)
|
||||
if(user)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
spillable = FALSE
|
||||
volume = 10
|
||||
possible_transfer_amounts = list(1,2,5,10)
|
||||
APTFT_altclick = FALSE
|
||||
container_flags = APTFT_VERB
|
||||
obj_flags = UNIQUE_RENAME
|
||||
unique_reskin = list("hypovial" = "hypovial",
|
||||
"red hypovial" = "hypovial-b",
|
||||
@@ -25,9 +25,6 @@
|
||||
if(!icon_state)
|
||||
icon_state = "hypovial"
|
||||
update_icon()
|
||||
// beaker_weakness_bitflag |= PH_WEAK // fuck you if you're using these like beakers
|
||||
// beaker_weakness_bitflag |= TEMP_WEAK
|
||||
|
||||
|
||||
/obj/item/reagent_containers/glass/bottle/vial/on_reagent_change()
|
||||
update_icon()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
reagent_flags = REFILLABLE | DRAINABLE
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = list()
|
||||
APTFT_altclick = FALSE
|
||||
container_flags = APTFT_VERB
|
||||
volume = 5
|
||||
spillable = FALSE
|
||||
var/wipe_sound
|
||||
@@ -118,6 +118,7 @@
|
||||
item_flags = NOBLUDGEON | NO_UNIFORM_REQUIRED //so it can be worn on the belt slot even with no uniform.
|
||||
force = 1
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
mutantrace_variation = STYLE_DIGITIGRADE
|
||||
attack_verb = list("whipped")
|
||||
hitsound = 'sound/items/towelwhip.ogg'
|
||||
volume = 10
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
amount_per_transfer_from_this = 5
|
||||
volume = 250
|
||||
possible_transfer_amounts = list(5,10,15,20,25,30,50,100)
|
||||
container_flags = NONE //APTFT is alternated between the initial value and stream_amount and shouldn't be exploited.
|
||||
|
||||
/obj/item/reagent_containers/spray/afterattack(atom/A, mob/user)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user