Fixes and test.
This commit is contained in:
@@ -61,8 +61,8 @@
|
||||
..()
|
||||
|
||||
/obj/item/ammo_casing/syringegun/dart
|
||||
name = "syringe gun spring"
|
||||
desc = "A high-power spring that throws syringes."
|
||||
projectile_type = /obj/item/projectile/bullet/dart/syringe
|
||||
name = "dart gun air canister"
|
||||
desc = "A small canister of compressed gas."
|
||||
projectile_type = /obj/item/projectile/bullet/dart/syringe/dart
|
||||
firing_effect_type = null
|
||||
harmful = FALSE
|
||||
|
||||
@@ -110,6 +110,7 @@
|
||||
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()
|
||||
..()
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
create_reagents(50)
|
||||
reagents.set_reacting(FALSE)
|
||||
|
||||
/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
|
||||
@@ -37,3 +39,49 @@
|
||||
/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 = "syringeproj"
|
||||
damage = 0
|
||||
|
||||
/obj/item/projectile/bullet/dart/syringe/dart/on_hit(atom/target, blocked = FALSE)
|
||||
message_admins("Dart landed!")
|
||||
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.
|
||||
..(target, blocked, TRUE)
|
||||
message_admins("Checking reagents")
|
||||
for(var/datum/reagent/R in reagents.reagent_list) //OD prevention time!
|
||||
message_admins("Reagent: [R]")
|
||||
if(istype(R, /datum/reagent/medicine)) //Is this a medicine?
|
||||
message_admins("Is a medicine")
|
||||
if(M.reagents.has_reagent(R.id))
|
||||
message_admins("reagent found! with new")
|
||||
var/datum/reagent/medicine/Rm = locate(R) in M
|
||||
if(R.overdose_threshold == 0) //Is there a possible OD?
|
||||
M.reagents.add_reagent(R.id, R.volume)
|
||||
else
|
||||
var/transVol = CLAMP(R.volume, 0, (R.overdose_threshold - Rm.volume) -1)
|
||||
M.reagents.add_reagent(R.id, transVol)
|
||||
target.visible_message("<span class='notice'>\The [src] beeps!</span>")
|
||||
return TRUE
|
||||
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, and turn around to see a smartdart embedded in your butt.</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
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
var/proj_piercing = 0 //does it pierce through thick clothes when shot with syringe gun
|
||||
materials = list(MAT_METAL=10, MAT_GLASS=20)
|
||||
container_type = TRANSPARENT
|
||||
var/Sname = "syringe"
|
||||
|
||||
/obj/item/reagent_containers/syringe/Initialize()
|
||||
. = ..()
|
||||
@@ -73,7 +72,7 @@
|
||||
if(SYRINGE_DRAW)
|
||||
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>The [Sname] is full.</span>")
|
||||
to_chat(user, "<span class='notice'>The syringe is full.</span>")
|
||||
return
|
||||
|
||||
if(L) //living mob
|
||||
@@ -138,8 +137,8 @@
|
||||
return
|
||||
if(L.reagents.total_volume >= L.reagents.maximum_volume)
|
||||
return
|
||||
L.visible_message("<span class='danger'>[user] injects [L] with the [Sname]!", \
|
||||
"<span class='userdanger'>[user] injects [L] with the [Sname]!</span>")
|
||||
L.visible_message("<span class='danger'>[user] injects [L] with the syringe!", \
|
||||
"<span class='userdanger'>[user] injects [L] with the syringe!</span>")
|
||||
|
||||
if(L != user)
|
||||
log_combat(user, L, "injected", src, addition="which had [contained]")
|
||||
@@ -148,7 +147,7 @@
|
||||
var/fraction = min(amount_per_transfer_from_this/reagents.total_volume, 1)
|
||||
reagents.reaction(L, INJECT, fraction)
|
||||
reagents.trans_to(target, amount_per_transfer_from_this)
|
||||
to_chat(user, "<span class='notice'>You inject [amount_per_transfer_from_this] units of the solution. The [Sname] now contains [reagents.total_volume] units.</span>")
|
||||
to_chat(user, "<span class='notice'>You inject [amount_per_transfer_from_this] units of the solution. The syringe now contains [reagents.total_volume] units.</span>")
|
||||
if (reagents.total_volume <= 0 && mode==SYRINGE_INJECT)
|
||||
mode = SYRINGE_DRAW
|
||||
update_icon()
|
||||
@@ -159,7 +158,7 @@
|
||||
var/rounded_vol
|
||||
if(reagents && reagents.total_volume)
|
||||
rounded_vol = CLAMP(round((reagents.total_volume / volume * 15),5), 1, 15)
|
||||
var/image/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "[Sname][rounded_vol]")
|
||||
var/image/filling_overlay = mutable_appearance('icons/obj/reagentfillings.dmi', "syringe[rounded_vol]")
|
||||
filling_overlay.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
add_overlay(filling_overlay)
|
||||
else
|
||||
@@ -265,23 +264,64 @@
|
||||
return mutable_appearance('icons/obj/clothing/belt_overlays.dmi', "pouch")
|
||||
|
||||
/obj/item/reagent_containers/syringe/dart
|
||||
name = "medicinal dart"
|
||||
desc = "A non-harmful dart that can administer medication from a range. Unable to hold any caustic or toxic chemicals without disintegrating"
|
||||
name = "medicinal smartdart"
|
||||
desc = "A non-harmful dart that can administer medication from a range. Once it hits a patient, only medicines are administered to the patient using a smart nanofilter and capillary action."
|
||||
volume = 20
|
||||
amount_per_transfer_from_this = 20
|
||||
icon = 'icons/obj/dart.dmi'
|
||||
Sname = "dart"
|
||||
item_state = "dart_0"
|
||||
//harmful = FALSE
|
||||
|
||||
/obj/item/reagent_containers/syringe/dart/afterattack(atom/target, mob/user , proximity)
|
||||
..()
|
||||
for(var/datum/reagent/R in src.reagents.reagent_list)//(!R == /datum/reagent/fermi) ||
|
||||
if((!R == /datum/reagent/medicine) || (!R == /datum/reagent/consumable))
|
||||
qdel(src)
|
||||
to_chat(user, "<span class='notice'>The dart dissolves under the caustic nature of the chems!</span>")
|
||||
|
||||
if(busy)
|
||||
return
|
||||
if(!proximity)
|
||||
return
|
||||
if(!target.reagents)
|
||||
return
|
||||
|
||||
var/mob/living/L
|
||||
if(isliving(target))
|
||||
L = target
|
||||
if(!L.can_inject(user, 1))
|
||||
return
|
||||
|
||||
switch(mode)
|
||||
if(SYRINGE_DRAW)
|
||||
|
||||
if(reagents.total_volume >= reagents.maximum_volume)
|
||||
to_chat(user, "<span class='notice'>The dart is full!</span>")
|
||||
return
|
||||
|
||||
if(L) //living mob
|
||||
to_chat(user, "<span class='warning'>You can't draw blood using a dart!</span>")
|
||||
return
|
||||
|
||||
else //if not mob
|
||||
if(!target.reagents.total_volume)
|
||||
to_chat(user, "<span class='warning'>[target] is empty!</span>")
|
||||
return
|
||||
|
||||
if(!target.is_drawable())
|
||||
to_chat(user, "<span class='warning'>You cannot directly remove reagents from [target]!</span>")
|
||||
return
|
||||
|
||||
var/trans = target.reagents.trans_to(src, amount_per_transfer_from_this) // transfer from, transfer to - who cares?
|
||||
|
||||
to_chat(user, "<span class='notice'>You soak the [src] with [trans] units of the solution. It now contains [reagents.total_volume] units.</span>")
|
||||
if (reagents.total_volume >= reagents.maximum_volume)
|
||||
mode=!mode
|
||||
update_icon()
|
||||
|
||||
if(SYRINGE_INJECT)
|
||||
src.visible_message("<span class='danger'>The smartdart gives a frustrated boop! It's ready and full; You need to shoot someone with it!</span>")
|
||||
|
||||
/obj/item/reagent_containers/syringe/dart/attack_self(mob/user)
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/syringe/dart/bluespace
|
||||
name = "bluespace dart"
|
||||
name = "bluespace smartdart"
|
||||
desc = "A non-harmful dart that can administer medication from a range, with extended 60u capacity. Unable to hold any caustic or toxic chemicals without disintegrating"
|
||||
amount_per_transfer_from_this = 20
|
||||
volume = 60
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 323 B After Width: | Height: | Size: 903 B |
Binary file not shown.
|
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Reference in New Issue
Block a user