[MIRROR] [READY]syriniver nerfix / syringe projectile fix + various fixes requested by maintainer (#190)

* [READY]syriniver nerfix /  syringe projectile fix + various fixes requested by maintainer (#52019)

* syringe projectile fix

* greenman review

* oversight fix

* [READY]syriniver nerfix /  syringe projectile fix + various fixes requested by maintainer

Co-authored-by: Krysonism <49783092+Krysonism@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-08-04 12:18:41 +02:00
committed by GitHub
co-authored by Krysonism
parent 418778e7cb
commit 724f9632b5
13 changed files with 19 additions and 39 deletions
+1 -2
View File
@@ -306,8 +306,7 @@
if(chem in spray_chems)
var/datum/reagents/holder = new()
holder.add_reagent(chem_buttons[chem], 10) //I hope this is the correct way to do this.
holder.expose(occupant, VAPOR, 0)
holder.trans_to(occupant, 10)
holder.trans_to(occupant, 10, method = VAPOR)
playsound(src.loc, 'sound/effects/spray2.ogg', 50, TRUE, -6)
if(user)
log_combat(user, occupant, "sprayed [chem] into", addition = "via [src]")
@@ -331,8 +331,7 @@
R += "[A.name] ([num2text(A.volume)]"
mechsyringe.icon_state = initial(mechsyringe.icon_state)
mechsyringe.icon = initial(mechsyringe.icon)
mechsyringe.reagents.expose(M, INJECT)
mechsyringe.reagents.trans_to(M, mechsyringe.reagents.total_volume, transfered_by = originaloccupant)
mechsyringe.reagents.trans_to(M, mechsyringe.reagents.total_volume, transfered_by = originaloccupant, method = INJECT)
M.take_bodypart_damage(2)
log_combat(originaloccupant, M, "shot", "syringegun")
break
+4 -11
View File
@@ -427,8 +427,7 @@
if(affected_turfs.len)
fraction /= affected_turfs.len
for(var/t in affected_turfs)
reagents.expose(t, TOUCH, fraction * volume_multiplier)
reagents.trans_to(t, ., volume_multiplier, transfered_by = user)
reagents.trans_to(t, ., volume_multiplier, transfered_by = user, method = TOUCH)
check_empty(user)
/obj/item/toy/crayon/attack(mob/M, mob/user)
@@ -447,9 +446,7 @@
var/eaten = use_charges(user, 5, FALSE)
if(check_empty(user)) //Prevents divsion by zero
return
var/fraction = min(eaten / reagents.total_volume, 1)
reagents.expose(M, INGEST, fraction * volume_multiplier)
reagents.trans_to(M, eaten, volume_multiplier, transfered_by = user)
reagents.trans_to(M, eaten, volume_multiplier, transfered_by = user, method = INGEST)
// check_empty() is called during afterattack
else
..()
@@ -673,9 +670,7 @@
H.lip_color = paint_color
H.update_body()
var/used = use_charges(user, 10, FALSE)
var/fraction = min(1, used / reagents.maximum_volume)
reagents.expose(user, VAPOR, fraction * volume_multiplier)
reagents.trans_to(user, used, volume_multiplier, transfered_by = user)
reagents.trans_to(user, used, volume_multiplier, transfered_by = user, method = VAPOR)
return (OXYLOSS)
@@ -742,9 +737,7 @@
else
target.set_opacity(initial(target.opacity))
. = use_charges(user, 2)
var/fraction = min(1, . / reagents.maximum_volume)
reagents.expose(target, TOUCH, fraction * volume_multiplier)
reagents.trans_to(target, ., volume_multiplier, transfered_by = user)
reagents.trans_to(target, ., volume_multiplier, transfered_by = user, method = VAPOR)
if(pre_noise || post_noise)
playsound(user.loc, 'sound/effects/spray.ogg', 5, TRUE, 5)
+1 -2
View File
@@ -419,8 +419,7 @@
return
var/used_amount = injection_amount/usage_ratio
reagents.expose(user, INJECT,injection_amount,0)
reagents.trans_to(user,used_amount,multiplier=usage_ratio)
reagents.trans_to(user,used_amount,multiplier=usage_ratio, method = INJECT)
update_icon()
user.update_inv_back() //for overlays update
@@ -234,8 +234,7 @@
mob_occupant.Unconscious((mob_occupant.bodytemperature * unconscious_factor) * 2000)
if(beaker)
if(reagent_transfer == 0) // Magically transfer reagents. Because cryo magic.
beaker.reagents.trans_to(occupant, 1, efficiency * 0.25) // Transfer reagents.
beaker.reagents.expose(occupant, VAPOR)
beaker.reagents.trans_to(occupant, 1, efficiency * 0.25, method = VAPOR) // Transfer reagents.
air1.gases[/datum/gas/oxygen][MOLES] -= max(0,air1.gases[/datum/gas/oxygen][MOLES] - 2 / efficiency) //Let's use gas for this
air1.garbage_collect()
if(++reagent_transfer >= 10 * efficiency) // Throttle reagent transfer (higher efficiency will transfer the same amount but consume less from the beaker).
@@ -47,8 +47,7 @@
SEND_SIGNAL(src, COMSIG_DRINK_DRANK, M, user)
var/fraction = min(gulp_size/reagents.total_volume, 1)
checkLiked(fraction, M)
reagents.expose(M, INGEST, fraction)
reagents.trans_to(M, gulp_size, transfered_by = user)
reagents.trans_to(M, gulp_size, transfered_by = user, method = INGEST)
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), TRUE)
if(iscarbon(M))
var/mob/living/carbon/carbon_drinker = M
@@ -90,10 +90,7 @@
M.visible_message("<span class='warning'>[user] fed [M] from [src].</span>", \
"<span class='warning'>[user] fed you from [src].</span>")
log_combat(user, M, "fed", reagents.log_list())
var/fraction = min(10/reagents.total_volume, 1)
reagents.expose(M, INGEST, fraction)
reagents.trans_to(M, 10, transfered_by = user)
reagents.trans_to(M, 10, transfered_by = user, method = INGEST)
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), TRUE)
return 1
@@ -485,9 +485,7 @@
if(iscarbon(loc))
var/mob/living/carbon/C = loc
if (src == C.wear_mask) // if it's in the human/monkey mouth, transfer reagents to the mob
var/fraction = min(REAGENTS_METABOLISM/reagents.total_volume, 1)
reagents.expose(C, INGEST, fraction)
if(!reagents.trans_to(C, REAGENTS_METABOLISM))
if(!reagents.trans_to(C, REAGENTS_METABOLISM, method = INGEST))
reagents.remove_any(REAGENTS_METABOLISM)
return
reagents.remove_any(REAGENTS_METABOLISM)
+1 -3
View File
@@ -456,9 +456,7 @@
var/mob/living/L = target
if(L.reagents && L.can_inject(null, 0))
var/injecting_amount = max(1, G.seed.potency*0.2) // Minimum of 1, max of 20
var/fraction = min(injecting_amount/G.reagents.total_volume, 1)
G.reagents.expose(L, INJECT, fraction)
G.reagents.trans_to(L, injecting_amount)
G.reagents.trans_to(L, injecting_amount, method = INJECT)
to_chat(target, "<span class='danger'>You are pricked by [G]!</span>")
log_combat(G, L, "pricked and attempted to inject reagents from [G] to [L]. Last touched by: [G.fingerprintslast].")
+2 -2
View File
@@ -181,8 +181,8 @@
if(..())
if(reagents.total_volume)
if(M.reagents)
reagents.expose(M, INJECT, reagents.total_volume)
reagents.trans_to(M, reagents.total_volume, transfered_by = user)
reagents.trans_to(M, reagents.total_volume, transfered_by = user, method = INJECT)
/obj/item/pen/sleepy/Initialize()
@@ -15,8 +15,7 @@
if(blocked != 100) // not completely blocked
if(M.can_inject(null, FALSE, def_zone, piercing)) // Pass the hit zone to see if it can inject by whether it hit the head or the body.
..()
reagents.expose(M, INJECT)
reagents.trans_to(M, reagents.total_volume)
reagents.trans_to(M, reagents.total_volume, method = INJECT)
return BULLET_ACT_HIT
else
blocked = 100
@@ -40,13 +40,14 @@
to_chat(M, "<span class='warning'>You feel a tiny prick!</span>")
to_chat(user, "<span class='notice'>You inject [M] with [src].</span>")
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)
reagents.expose(M, INJECT, fraction)
if(M.reagents)
var/trans = 0
if(!infinite)
trans = reagents.trans_to(M, amount_per_transfer_from_this, transfered_by = user)
trans = reagents.trans_to(M, amount_per_transfer_from_this, transfered_by = user, method = INJECT)
else
reagents.expose(M, INJECT, fraction)
trans = reagents.copy_to(M, amount_per_transfer_from_this)
to_chat(user, "<span class='notice'>[trans] unit\s injected. [reagents.total_volume] unit\s remaining in [src].</span>")
log_combat(user, M, "injected", src, "([contained])")
+1 -2
View File
@@ -38,7 +38,6 @@
to_chat(owner, "<span class='notice'>You grit your teeth and burst the implanted [target.name]!</span>")
log_combat(owner, null, "swallowed an implanted pill", target)
if(target.reagents.total_volume)
target.reagents.expose(owner, INGEST)
target.reagents.trans_to(owner, target.reagents.total_volume, transfered_by = owner)
target.reagents.trans_to(owner, target.reagents.total_volume, transfered_by = owner, method = INGEST)
qdel(target)
return TRUE