More fixes. Need to check over merging math.

This commit is contained in:
Fermi
2019-06-02 03:59:52 +01:00
parent 0fa445c153
commit fd22dbfc0d
4 changed files with 37 additions and 15 deletions

View File

@@ -61,7 +61,7 @@
..() ..()
/obj/item/ammo_casing/syringegun/dart /obj/item/ammo_casing/syringegun/dart
name = "dart gun air canister" name = "used air canister"
desc = "A small canister of compressed gas." desc = "A small canister of compressed gas."
projectile_type = /obj/item/projectile/bullet/dart/syringe/dart projectile_type = /obj/item/projectile/bullet/dart/syringe/dart
firing_effect_type = null firing_effect_type = null

View File

@@ -64,20 +64,21 @@
if(R.overdose_threshold == 0) //Is there a possible OD? if(R.overdose_threshold == 0) //Is there a possible OD?
M.reagents.add_reagent(R.id, R.volume) M.reagents.add_reagent(R.id, R.volume)
else else
var/transVol = CLAMP(R.volume, 0, (R.overdose_threshold - Rm.volume) -1) var/transVol = CLAMP(R.volume, 0, (R.overdose_threshold - Rm.volume) -1) //Doesn't work
message_admins("Merge: Adding [transVol], OD: [R.overdose_threshold], curvol [Rm.volume]")
M.reagents.add_reagent(R.id, transVol) M.reagents.add_reagent(R.id, transVol)
target.visible_message("<span class='notice'>\The [src] beeps!</span>")
return TRUE
else else
if(!R.overdose_threshold == 0) if(!R.overdose_threshold == 0)
var/transVol = CLAMP(R.volume, 0, R.overdose_threshold-1) var/transVol = CLAMP(R.volume, 0, R.overdose_threshold-1)
M.reagents.add_reagent(R.id, transVol) M.reagents.add_reagent(R.id, transVol)
else else
M.reagents.add_reagent(R.id, R.volume) 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
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 else
blocked = 100 blocked = 100
target.visible_message("<span class='danger'>\The [src] was deflected!</span>", \ target.visible_message("<span class='danger'>\The [src] was deflected!</span>", \

View File

@@ -265,12 +265,12 @@
/obj/item/reagent_containers/syringe/dart /obj/item/reagent_containers/syringe/dart
name = "medicinal smartdart" 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." 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 with a built in safety for OD."
volume = 20 volume = 20
amount_per_transfer_from_this = 20 amount_per_transfer_from_this = 20
icon = 'icons/obj/dart.dmi' //icon = 'icons/obj/dart.dmi'
item_state = "dart_0" icon_state = "empty"
//harmful = FALSE item_state = "syringe_empty"
/obj/item/reagent_containers/syringe/dart/afterattack(atom/target, mob/user , proximity) /obj/item/reagent_containers/syringe/dart/afterattack(atom/target, mob/user , proximity)
@@ -320,9 +320,30 @@
/obj/item/reagent_containers/syringe/dart/attack_self(mob/user) /obj/item/reagent_containers/syringe/dart/attack_self(mob/user)
return return
/obj/item/reagent_containers/syringe/update_icon()
cut_overlays()
var/rounded_vol
rounded_vol = "empty"
if(reagents && reagents.total_volume)
if(volume/reagents.total_volume == 1)
rounded_vol="full"
icon_state = "[rounded_vol]"
item_state = "syringe_[rounded_vol]"
if(ismob(loc))
var/mob/M = loc
var/injoverlay
switch(mode)
if (SYRINGE_DRAW)
injoverlay = "draw"
if (SYRINGE_INJECT)
injoverlay = "ready"
add_overlay(injoverlay)
M.update_inv_hands()
/obj/item/reagent_containers/syringe/dart/bluespace /obj/item/reagent_containers/syringe/dart/bluespace
name = "bluespace smartdart" 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" 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 with a built in safety for OD. Has an extended volume capacity thanks to bluespace foam."
amount_per_transfer_from_this = 20 amount_per_transfer_from_this = 50
volume = 60 volume = 50
//harmful = FALSE

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB