This commit is contained in:
Ghommie
2019-07-03 03:24:28 +02:00
328 changed files with 9909 additions and 6862 deletions
@@ -59,3 +59,20 @@
S.forceMove(D)
D.injector = S
..()
/obj/item/ammo_casing/syringegun/dart
name = "used air canister"
desc = "A small canister of compressed gas."
projectile_type = /obj/item/projectile/bullet/dart/syringe/dart
firing_effect_type = null
harmful = FALSE
/obj/item/ammo_casing/syringegun/dart/ready_proj(atom/target, mob/living/user, quiet, zone_override = "")
..()
var/obj/item/gun/syringe/SG = loc
if(!SG.syringes.len)
return
var/obj/item/reagent_containers/syringe/dart/S = SG.syringes[1]
if(S.emptrig == TRUE)
var/obj/item/projectile/bullet/dart/syringe/dart/D = BB
D.emptrig = TRUE
@@ -116,7 +116,7 @@
new /obj/effect/temp_visual/heal(get_turf(target), "#80F5FF")
target.adjustBruteLoss(-4)
target.adjustFireLoss(-4)
target.adjustToxLoss(-1)
target.adjustToxLoss(-1, forced = TRUE)
target.adjustOxyLoss(-1)
return
@@ -102,3 +102,23 @@
else
to_chat(user, "<span class='warning'>[src] cannot hold more syringes!</span>")
return FALSE
/obj/item/gun/syringe/dart
name = "dart gun"
desc = "A compressed air gun, designed to fit medicinal darts for application of medicine for those patients just out of reach."
icon_state = "dartgun"
item_state = "dartgun"
materials = list(MAT_METAL=2000, MAT_GLASS=500)
suppressed = TRUE //Softer fire sound
can_unsuppress = FALSE
/obj/item/gun/syringe/dart/Initialize()
..()
chambered = new /obj/item/ammo_casing/syringegun/dart(src)
/obj/item/gun/syringe/dart/attackby(obj/item/A, mob/user, params, show_msg = TRUE)
if(istype(A, /obj/item/reagent_containers/syringe/dart))
..()
else
to_chat(user, "<span class='notice'>You can't put the [A] into \the [src]!</span>")
return FALSE
@@ -8,12 +8,14 @@
. = ..()
create_reagents(50, NO_REACT)
/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = FALSE)
/obj/item/projectile/bullet/dart/on_hit(atom/target, blocked = FALSE, skip = FALSE)
if(iscarbon(target))
var/mob/living/carbon/M = target
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.
..()
if(skip == TRUE)
return
reagents.reaction(M, INJECT)
reagents.trans_to(M, reagents.total_volume)
return TRUE
@@ -36,3 +38,44 @@
/obj/item/projectile/bullet/dart/syringe
name = "syringe"
icon_state = "syringeproj"
//I am in a mess of my own making
/obj/item/projectile/bullet/dart/syringe/dart
name = "Smartdart"
icon_state = "dartproj"
damage = 0
var/emptrig = FALSE
/obj/item/projectile/bullet/dart/syringe/dart/on_hit(atom/target, blocked = FALSE)
if(iscarbon(target))
var/mob/living/carbon/M = target
if(blocked != 100)
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.
..(target, blocked, TRUE)
for(var/datum/reagent/R in reagents.reagent_list) //OD prevention time!
if(istype(R, /datum/reagent/medicine)) //Is this a medicine?
if(M.reagents.has_reagent(R.id))
if(R.overdose_threshold == 0 || emptrig == TRUE) //Is there a possible OD?
M.reagents.add_reagent(R.id, R.volume)
else
var/transVol = CLAMP(R.volume, 0, (R.overdose_threshold - M.reagents.get_reagent_amount(R.id)) -1)
M.reagents.add_reagent(R.id, transVol)
else
if(!R.overdose_threshold == 0)
var/transVol = CLAMP(R.volume, 0, R.overdose_threshold-1)
M.reagents.add_reagent(R.id, transVol)
else
M.reagents.add_reagent(R.id, R.volume)
target.visible_message("<span class='notice'>\The [src] beeps!</span>")
to_chat("<span class='notice'><i>You feel a tiny prick as a smartdart embeds itself in you with a beep.</i></span>")
return TRUE
else
blocked = 100
target.visible_message("<span class='danger'>\The [src] was deflected!</span>", \
"<span class='userdanger'>You see a [src] bounce off you, booping sadly!</span>")
target.visible_message("<span class='danger'>\The [src] fails to land on target!</span>")
return TRUE