Unmodularize MkII hyposprays and other reagent items sprites.

This commit is contained in:
Ghommie
2019-10-26 19:14:28 +02:00
parent b9bf7b726d
commit bf92aa2ffb
14 changed files with 420 additions and 448 deletions

View File

@@ -196,3 +196,317 @@
volume = 250
list_reagents = list("holywater" = 150, "tiresolution" = 50, "dizzysolution" = 50)
amount_per_transfer_from_this = 50
#define HYPO_SPRAY 0
#define HYPO_INJECT 1
#define WAIT_SPRAY 25
#define WAIT_INJECT 25
#define SELF_SPRAY 15
#define SELF_INJECT 15
#define DELUXE_WAIT_SPRAY 20
#define DELUXE_WAIT_INJECT 20
#define DELUXE_SELF_SPRAY 10
#define DELUXE_SELF_INJECT 10
#define COMBAT_WAIT_SPRAY 0
#define COMBAT_WAIT_INJECT 0
#define COMBAT_SELF_SPRAY 0
#define COMBAT_SELF_INJECT 0
//A vial-loaded hypospray. Cartridge-based!
/obj/item/hypospray/mkii
name = "hypospray mk.II"
icon_state = "hypo2"
desc = "A new development from DeForest Medical, this hypospray takes 30-unit vials as the drug supply for easy swapping."
w_class = WEIGHT_CLASS_TINY
var/list/allowed_containers = list(/obj/item/reagent_containers/glass/bottle/vial/tiny, /obj/item/reagent_containers/glass/bottle/vial/small)
var/mode = HYPO_INJECT
var/obj/item/reagent_containers/glass/bottle/vial/vial
var/start_vial = /obj/item/reagent_containers/glass/bottle/vial/small
var/spawnwithvial = TRUE
var/inject_wait = WAIT_INJECT
var/spray_wait = WAIT_SPRAY
var/spray_self = SELF_SPRAY
var/inject_self = SELF_INJECT
var/quickload = FALSE
var/penetrates = FALSE
/obj/item/hypospray/mkii/brute
start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/bicaridine
/obj/item/hypospray/mkii/toxin
start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/antitoxin
/obj/item/hypospray/mkii/oxygen
start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/dexalin
/obj/item/hypospray/mkii/burn
start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/kelotane
/obj/item/hypospray/mkii/tricord
start_vial = /obj/item/reagent_containers/glass/bottle/vial/small/preloaded/tricord
/obj/item/hypospray/mkii/enlarge
spawnwithvial = FALSE
/obj/item/hypospray/mkii/CMO
name = "hypospray mk.II deluxe"
allowed_containers = list(/obj/item/reagent_containers/glass/bottle/vial/tiny, /obj/item/reagent_containers/glass/bottle/vial/small, /obj/item/reagent_containers/glass/bottle/vial/large)
icon_state = "cmo2"
desc = "The Deluxe Hypospray can take larger-size vials. It also acts faster and delivers more reagents per spray."
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
start_vial = /obj/item/reagent_containers/glass/bottle/vial/large/preloaded/CMO
inject_wait = DELUXE_WAIT_INJECT
spray_wait = DELUXE_WAIT_SPRAY
spray_self = DELUXE_SELF_SPRAY
inject_self = DELUXE_SELF_INJECT
/obj/item/hypospray/mkii/CMO/combat
name = "combat hypospray mk.II"
desc = "A combat-ready deluxe hypospray that acts almost instantly. It can be tactically reloaded by using a vial on it."
icon_state = "combat2"
start_vial = /obj/item/reagent_containers/glass/bottle/vial/large/preloaded/combat
inject_wait = COMBAT_WAIT_INJECT
spray_wait = COMBAT_WAIT_SPRAY
spray_self = COMBAT_SELF_SPRAY
inject_self = COMBAT_SELF_INJECT
quickload = TRUE
penetrates = TRUE
/obj/item/hypospray/mkii/Initialize()
. = ..()
if(!spawnwithvial)
update_icon()
return
if(start_vial)
vial = new start_vial
update_icon()
/obj/item/hypospray/mkii/update_icon()
..()
icon_state = "[initial(icon_state)][vial ? "" : "-e"]"
if(ismob(loc))
var/mob/M = loc
M.update_inv_hands()
return
/obj/item/hypospray/mkii/examine(mob/user)
. = ..()
if(vial)
to_chat(user, "[vial] has [vial.reagents.total_volume]u remaining.")
else
to_chat(user, "It has no vial loaded in.")
to_chat(user, "[src] is set to [mode ? "Inject" : "Spray"] contents on application.")
/obj/item/hypospray/mkii/proc/unload_hypo(obj/item/I, mob/user)
if((istype(I, /obj/item/reagent_containers/glass/bottle/vial)))
var/obj/item/reagent_containers/glass/bottle/vial/V = I
V.forceMove(user.loc)
user.put_in_hands(V)
to_chat(user, "<span class='notice'>You remove [vial] from [src].</span>")
vial = null
update_icon()
playsound(loc, 'sound/weapons/empty.ogg', 50, 1)
else
to_chat(user, "<span class='notice'>This hypo isn't loaded!</span>")
return
/obj/item/hypospray/mkii/attackby(obj/item/I, mob/living/user)
if((istype(I, /obj/item/reagent_containers/glass/bottle/vial) && vial != null))
if(!quickload)
to_chat(user, "<span class='warning'>[src] can not hold more than one vial!</span>")
return FALSE
unload_hypo(vial, user)
if((istype(I, /obj/item/reagent_containers/glass/bottle/vial)))
var/obj/item/reagent_containers/glass/bottle/vial/V = I
if(!is_type_in_list(V, allowed_containers))
to_chat(user, "<span class='notice'>[src] doesn't accept this type of vial.</span>")
return FALSE
if(!user.transferItemToLoc(V,src))
return FALSE
vial = V
user.visible_message("<span class='notice'>[user] has loaded a vial into [src].</span>","<span class='notice'>You have loaded [vial] into [src].</span>")
update_icon()
playsound(loc, 'sound/weapons/autoguninsert.ogg', 35, 1)
return TRUE
else
to_chat(user, "<span class='notice'>This doesn't fit in [src].</span>")
return FALSE
return FALSE
/obj/item/hypospray/mkii/AltClick(mob/user)
if(vial)
vial.attack_self(user)
// Gunna allow this for now, still really don't approve - Pooj
/obj/item/hypospray/mkii/emag_act(mob/user)
. = ..()
if(obj_flags & EMAGGED)
to_chat(user, "[src] happens to be already overcharged.")
return
inject_wait = COMBAT_WAIT_INJECT
spray_wait = COMBAT_WAIT_SPRAY
spray_self = COMBAT_SELF_INJECT
inject_self = COMBAT_SELF_SPRAY
penetrates = TRUE
to_chat(user, "You overcharge [src]'s control circuit.")
obj_flags |= EMAGGED
return TRUE
/obj/item/hypospray/mkii/attack_hand(mob/user)
. = ..() //Don't bother changing this or removing it from containers will break.
/obj/item/hypospray/mkii/attack(obj/item/I, mob/user, params)
return
/obj/item/hypospray/mkii/afterattack(atom/target, mob/user, proximity)
if(!vial)
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))
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>")
return
if(affecting.status != BODYPART_ORGANIC)
to_chat(user, "<span class='notice'>Medicine won't work on a robotic limb!</span>")
return
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>")
return
/obj/item/hypospray/mkii/attack_self(mob/living/user)
if(user)
if(user.incapacitated())
return
else if(!vial)
to_chat(user, "This Hypo needs to be loaded first!")
return
else
unload_hypo(vial,user)
/obj/item/hypospray/mkii/verb/modes()
set name = "Toggle Application Mode"
set category = "Object"
set src in usr
var/mob/M = usr
switch(mode)
if(HYPO_SPRAY)
mode = HYPO_INJECT
to_chat(M, "[src] is now set to inject contents on application.")
if(HYPO_INJECT)
mode = HYPO_SPRAY
to_chat(M, "[src] is now set to spray contents on application.")
#undef HYPO_SPRAY
#undef HYPO_INJECT
#undef WAIT_SPRAY
#undef WAIT_INJECT
#undef SELF_SPRAY
#undef SELF_INJECT
#undef DELUXE_WAIT_SPRAY
#undef DELUXE_WAIT_INJECT
#undef DELUXE_SELF_SPRAY
#undef DELUXE_SELF_INJECT
#undef COMBAT_WAIT_SPRAY
#undef COMBAT_WAIT_INJECT
#undef COMBAT_SELF_SPRAY
#undef COMBAT_SELF_INJECT

View File

@@ -0,0 +1,199 @@
//hypovials used with the MkII hypospray. See hypospray.dm.
/obj/item/reagent_containers/glass/bottle/vial
name = "broken hypovial"
desc = "A hypovial compatible with most hyposprays."
icon_state = "hypovial"
spillable = FALSE
var/comes_with = list() //Easy way of doing this.
volume = 10
possible_transfer_amounts = list(1,2,5,10)
obj_flags = UNIQUE_RENAME
unique_reskin = list("hypovial" = "hypovial",
"red hypovial" = "hypovial-b",
"blue hypovial" = "hypovial-d",
"green hypovial" = "hypovial-a",
"orange hypovial" = "hypovial-k",
"purple hypovial" = "hypovial-p",
"black hypovial" = "hypovial-t",
"pink hypovial" = "hypovial-pink"
)
always_reskinnable = TRUE
/obj/item/reagent_containers/glass/bottle/vial/Initialize()
. = ..()
if(!icon_state)
icon_state = "hypovial"
for(var/R in comes_with)
reagents.add_reagent(R,comes_with[R])
update_icon()
/obj/item/reagent_containers/glass/bottle/vial/on_reagent_change()
update_icon()
/obj/item/reagent_containers/glass/bottle/vial/update_icon()
cut_overlays()
if(reagents.total_volume)
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "hypovial10")
var/percent = round((reagents.total_volume / volume) * 100)
switch(percent)
if(0 to 9)
filling.icon_state = "hypovial10"
if(10 to 29)
filling.icon_state = "hypovial25"
if(30 to 49)
filling.icon_state = "hypovial50"
if(50 to 85)
filling.icon_state = "hypovial75"
if(86 to INFINITY)
filling.icon_state = "hypovial100"
filling.color = mix_color_from_reagents(reagents.reagent_list)
add_overlay(filling)
/obj/item/reagent_containers/glass/bottle/vial/tiny
name = "small hypovial"
//Shouldn't be possible to get this without adminbuse
/obj/item/reagent_containers/glass/bottle/vial/small
name = "hypovial"
volume = 60
possible_transfer_amounts = list(5,10)
/obj/item/reagent_containers/glass/bottle/vial/small/bluespace
volume = 120
possible_transfer_amounts = list(5,10)
name = "bluespace hypovial"
icon_state = "hypovialbs"
unique_reskin = null
/obj/item/reagent_containers/glass/bottle/vial/large
name = "large hypovial"
desc = "A large hypovial, for deluxe hypospray models."
icon_state = "hypoviallarge"
volume = 120
possible_transfer_amounts = list(5,10,15,20)
unique_reskin = list("large hypovial" = "hypoviallarge",
"large red hypovial" = "hypoviallarge-b",
"large blue hypovial" = "hypoviallarge-d",
"large green hypovial" = "hypoviallarge-a",
"large orange hypovial" = "hypoviallarge-k",
"large purple hypovial" = "hypoviallarge-p",
"large black hypovial" = "hypoviallarge-t"
)
/obj/item/reagent_containers/glass/bottle/vial/large/update_icon()
cut_overlays()
if(reagents.total_volume)
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "hypoviallarge10")
var/percent = round((reagents.total_volume / volume) * 100)
switch(percent)
if(0 to 9)
filling.icon_state = "hypoviallarge10"
if(10 to 29)
filling.icon_state = "hypoviallarge25"
if(30 to 49)
filling.icon_state = "hypoviallarge50"
if(50 to 85)
filling.icon_state = "hypoviallarge75"
if(86 to INFINITY)
filling.icon_state = "hypoviallarge100"
filling.color = mix_color_from_reagents(reagents.reagent_list)
add_overlay(filling)
/obj/item/reagent_containers/glass/bottle/vial/large/bluespace
possible_transfer_amounts = list(5,10,15,20)
name = "bluespace large hypovial"
volume = 240
icon_state = "hypoviallargebs"
unique_reskin = null
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/bicaridine
name = "red hypovial (bicaridine)"
icon_state = "hypovial-b"
comes_with = list("bicaridine" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/antitoxin
name = "green hypovial (Anti-Tox)"
icon_state = "hypovial-a"
comes_with = list("antitoxin" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/kelotane
name = "orange hypovial (kelotane)"
icon_state = "hypovial-k"
comes_with = list("kelotane" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/dexalin
name = "blue hypovial (dexalin)"
icon_state = "hypovial-d"
comes_with = list("dexalin" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/tricord
name = "hypovial (tricordrazine)"
icon_state = "hypovial"
comes_with = list("tricordrazine" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/breastreduction
name = "pink hypovial (breast treatment)"
icon_state = "hypovial-pink"
comes_with = list("BEsmaller_hypo" = 30)
/obj/item/reagent_containers/glass/bottle/vial/small/preloaded/penisreduction
name = "pink hypovial (penis treatment)"
icon_state = "hypovial-pink"
comes_with = list("PEsmaller_hypo" = 30)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/CMO
name = "deluxe hypovial"
icon_state = "hypoviallarge-cmos"
comes_with = list("omnizine" = 20, "leporazine" = 20, "atropine" = 20)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/bicaridine
name = "large red hypovial (bicaridine)"
icon_state = "hypoviallarge-b"
comes_with = list("bicaridine" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/antitoxin
name = "large green hypovial (anti-tox)"
icon_state = "hypoviallarge-a"
comes_with = list("antitoxin" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/kelotane
name = "large orange hypovial (kelotane)"
icon_state = "hypoviallarge-k"
comes_with = list("kelotane" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/dexalin
name = "large blue hypovial (dexalin)"
icon_state = "hypoviallarge-d"
comes_with = list("dexalin" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/charcoal
name = "large black hypovial (charcoal)"
icon_state = "hypoviallarge-t"
comes_with = list("charcoal" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/tricord
name = "large hypovial (tricord)"
icon_state = "hypoviallarge"
comes_with = list("tricordrazine" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/salglu
name = "large green hypovial (salglu)"
icon_state = "hypoviallarge-a"
comes_with = list("salglu_solution" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/synthflesh
name = "large orange hypovial (synthflesh)"
icon_state = "hypoviallarge-k"
comes_with = list("synthflesh" = 60)
/obj/item/reagent_containers/glass/bottle/vial/large/preloaded/combat
name = "combat hypovial"
icon_state = "hypoviallarge-t"
comes_with = list("epinephrine" = 3, "omnizine" = 19, "leporazine" = 19, "atropine" = 19) //Epinephrine's main effect here is to kill suff damage, so we don't need much given atropine

View File

@@ -186,7 +186,6 @@
/obj/item/reagent_containers/pill/antirad_plus
name = "prussian blue pill"
desc = "Used to treat heavy radition poisoning."
icon = 'modular_citadel/icons/obj/modularpills.dmi'
icon_state = "prussian_blue"
list_reagents = list("prussian_blue" = 25, "water" = 10)
roundstart = 1
@@ -194,7 +193,6 @@
/obj/item/reagent_containers/pill/mutarad
name = "radiation treatment deluxe pill"
desc = "Used to treat heavy radition poisoning and genetic defects."
icon = 'modular_citadel/icons/obj/modularpills.dmi'
icon_state = "anit_rad_fixgene"
list_reagents = list("prussian_blue" = 15, "potass_iodide" = 15, "mutadone" = 15, "water" = 5)
roundstart = 1