Merge branch 'master' into updates_the_nbt

# Conflicts:
#	code/__defines/misc.dm
#	code/game/machinery/machinery.dm
#	maps/_common/mapsystem/map.dm
This commit is contained in:
alberyk
2022-02-19 10:26:35 -03:00
149 changed files with 2287 additions and 581 deletions
@@ -364,7 +364,7 @@
/decl/reagent/nitroglycerin/on_heat_change(var/added_energy, var/datum/reagents/holder)
. = ..()
if(added_energy > (specific_heat * 5 / REAGENT_VOLUME(holder, type))) // heat shock
if(added_energy > (specific_heat * 5 * REAGENT_VOLUME(holder, type))) // heat shock
explode(holder)
/decl/reagent/nitroglycerin/apply_force(var/force, var/datum/reagents/holder)
@@ -126,6 +126,12 @@
icon_state = "bottle-4"
reagents_to_add = list(/decl/reagent/acid/polyacid = 60)
/obj/item/reagent_containers/glass/bottle/nitroglycerin
name = "nitroglycerin bottle"
desc = "A small bottle. Contains a small amount of Nitroglycerin."
icon_state = "bottle-4"
reagents_to_add = list(/decl/reagent/nitroglycerin = 60)
/obj/item/reagent_containers/glass/bottle/adminordrazine
name = "adminordrazine bottle"
desc = "A small bottle. Contains the liquid essence of the gods."
@@ -31,6 +31,9 @@
. = ..()
update_icon()
/obj/item/reagent_containers/hypospray/AltClick(var/mob/user)
set_APTFT()
/obj/item/reagent_containers/hypospray/on_reagent_change()
update_icon()
return
@@ -5,9 +5,8 @@
desc = "A rapid and safe way to administer small amounts of drugs into the lungs by untrained or trained personnel."
icon = 'icons/obj/syringe.dmi'
item_state = "autoinjector"
icon_state = "inhaler1"
icon_state = "autoinhaler"
center_of_mass = list("x" = 16,"y" = 11)
var/empty_state = "inhaler0"
unacidable = 1
amount_per_transfer_from_this = 5
volume = 5
@@ -16,20 +15,27 @@
flags = OPENCONTAINER
slot_flags = SLOT_BELT
center_of_mass = null
var/used = FALSE
var/name_label
var/spent = FALSE
matter = list(MATERIAL_GLASS = 400, DEFAULT_WALL_MATERIAL = 200)
/obj/item/reagent_containers/inhaler/Initialize()
. =..()
icon_state = empty_state
if(name_label)
name_unlabel = name
name = "[name] ([name_label])"
verbs += /atom/proc/remove_label
if(reagents_to_add)
flags = 0
spent = FALSE
update_icon()
/obj/item/reagent_containers/inhaler/afterattack(var/mob/living/carbon/human/H, var/mob/user, var/proximity)
/obj/item/reagent_containers/inhaler/on_reagent_change()
update_icon()
return
if (!istype(H))
return ..()
if(!proximity)
/obj/item/reagent_containers/inhaler/proc/inject(var/mob/living/carbon/human/H, var/mob/user, var/proximity)
if (!istype(H) || !proximity)
return
if(!reagents.total_volume)
@@ -47,7 +53,7 @@
playsound(src.loc, 'sound/items/stimpack.ogg', 50, 1)
user.visible_message("<span class='notice'>[user] accidentally sticks the [src] in [H]'s eyes!</span>","<span class='notice'>You accidentally stick the [src] in [H]'s eyes!</span>")
to_chat(user,"<span class='notice'>[trans] units injected. [reagents.total_volume] units remaining in \the [src].</span>")
used = TRUE
spent = TRUE
update_icon()
return
@@ -82,16 +88,25 @@
admin_inject_log(user, H, src, contained, temp, trans)
playsound(src.loc, 'sound/items/stimpack.ogg', 50, 1)
to_chat(user,"<span class='notice'>[trans] units injected. [reagents.total_volume] units remaining in \the [src].</span>")
used = TRUE
spent = TRUE
update_icon()
return TRUE
/obj/item/reagent_containers/inhaler/afterattack(var/mob/living/carbon/human/H, var/mob/user, proximity)
if (!istype(H))
return ..()
if(!proximity)
return
/obj/item/reagent_containers/inhaler/attack(mob/M as mob, mob/user as mob)
if(is_open_container())
to_chat(user,"<span class='notice'>You must secure the reagents inside \the [src] before using it!</span>")
return FALSE
else
inject(M, user, M.Adjacent(user))
. = ..()
/obj/item/reagent_containers/inhaler/attack_self(mob/user as mob)
@@ -99,6 +114,7 @@
if(LAZYLEN(reagents.reagent_volumes))
to_chat(user,"<span class='notice'>With a quick twist of \the [src]'s lid, you secure the reagents inside.</span>")
flags &= ~OPENCONTAINER
spent = FALSE
update_icon()
else
to_chat(user,"<span class='notice'>You can't secure \the [src] without putting reagents in!</span>")
@@ -115,10 +131,18 @@
. = ..()
/obj/item/reagent_containers/inhaler/update_icon()
if(reagents.total_volume > 0 && !is_open_container())
icon_state = initial(icon_state)
else
icon_state = empty_state
cut_overlays()
if(!is_open_container())
var/mutable_appearance/backing_overlay = mutable_appearance(icon, "autoinhaler_secured")
add_overlay(backing_overlay)
icon_state = "[initial(icon_state)][spent]"
item_state = "[initial(item_state)][spent]"
if(reagents.total_volume)
var/mutable_appearance/reagent_overlay = mutable_appearance(icon, "autoinhaler_reagents")
reagent_overlay.color = reagents.get_color()
add_overlay(reagent_overlay)
/obj/item/reagent_containers/inhaler/examine(mob/user)
..(user)
@@ -128,7 +152,7 @@
to_chat(user, "<span class='notice'>It is spent.</span>")
/obj/item/reagent_containers/inhaler/dexalin
name = "autoinhaler (dexalin)"
name_label = "dexalin"
desc = "A rapid and safe way to administer small amounts of drugs into the lungs by untrained or trained personnel. This one contains dexalin."
Initialize()
@@ -138,7 +162,7 @@
return
/obj/item/reagent_containers/inhaler/peridaxon
name = "autoinhaler (peridaxon)"
name_label = "peridaxon"
desc = "A rapid and safe way to administer small amounts of drugs into the lungs by untrained or trained personnel. This one contains peridaxon."
Initialize()
@@ -148,7 +172,7 @@
return
/obj/item/reagent_containers/inhaler/hyperzine
name = "autoinhaler (hyperzine)"
name_label = "hyperzine"
desc = "A rapid and safe way to administer small amounts of drugs into the lungs by untrained or trained personnel. This one contains hyperzine."
Initialize()
@@ -158,7 +182,7 @@
return
/obj/item/reagent_containers/inhaler/phoron
name = "autoinhaler (phoron)"
name_label = "phoron"
desc = "A rapid and safe way to administer small amounts of drugs into the lungs by untrained or trained personnel. This one contains phoron."
Initialize()
@@ -171,7 +195,7 @@
name = "vaurca autoinhaler (phoron)"
desc = "A strange device that contains some sort of heavy-duty bag and mouthpiece combo."
icon_state = "anthaler1"
empty_state = "anthaler0"
var/empty_state = "anthaler0"
volume = 10
Initialize()
. =..()
@@ -180,10 +204,8 @@
return
/obj/item/reagent_containers/inhaler/soporific
name = "autoinhaler (soporific)"
name_label = "soporific"
desc = "A rapid and safe way to administer small amounts of drugs into the lungs by untrained or trained personnel. This one contains soporific."
icon_state = "so_inhaler1"
empty_state = "so_inhaler0"
volume = 10
Initialize()
@@ -193,7 +215,7 @@
return
/obj/item/reagent_containers/inhaler/space_drugs
name = "autoinhaler (space drugs)"
name_label = "space drugs"
desc = "A rapid and safe way to administer small amounts of drugs into the lungs by untrained or trained personnel. This one contains space drugs."
Initialize()
@@ -203,7 +225,7 @@
return
/obj/item/reagent_containers/inhaler/ammonia
name = "autoinhaler (ammonia)"
name_label = "ammonia"
desc = "A rapid and safe way to administer small amounts of drugs into the lungs by untrained or trained personnel. This one contains ammonia."
Initialize()
@@ -213,7 +235,7 @@
return
/obj/item/reagent_containers/inhaler/pulmodeiectionem
name = "autoinhaler (pulmodeiectionem)"
name_label = "pulmodeiectionem"
desc = "A rapid and safe way to administer small amounts of drugs into the lungs by untrained or trained personnel. This one contains pulmodeiectionem."
Initialize()
@@ -223,10 +245,8 @@
return
/obj/item/reagent_containers/inhaler/pneumalin
name = "autoinhaler (pneumalin)"
name_label = "pneumalin"
desc = "A rapid and safe way to administer small amounts of drugs into the lungs by untrained or trained personnel. This one contains pneumalin."
icon_state = "so_inhaler1"
empty_state = "so_inhaler0"
volume = 10
Initialize()
@@ -5,7 +5,7 @@
name = "small inhaler cartridge"
desc = "Fill this when chemicals and attach this to personal inhalers. Contains enough aerosol for 15u of reagents. The container must be activated for aerosol reagents to mix for the use in inhalers."
icon = 'icons/obj/syringe.dmi'
item_state = "buildpipe"
item_state = "pi_cart_small"
icon_state = "pi_cart_small"
volume = 15
w_class = ITEMSIZE_TINY
@@ -18,6 +18,19 @@
matter = list(DEFAULT_WALL_MATERIAL = 250)
center_of_mass = null
/obj/item/reagent_containers/personal_inhaler_cartridge/on_reagent_change()
update_icon()
return
/obj/item/reagent_containers/personal_inhaler_cartridge/update_icon()
cut_overlays()
var/rounded_vol = round(reagents.total_volume, round(reagents.maximum_volume / (volume / 5)))
if(reagents.total_volume)
var/mutable_appearance/filling = mutable_appearance('icons/obj/syringe.dmi', "[initial(icon_state)][rounded_vol]")
filling.color = reagents.get_color()
add_overlay(filling)
/obj/item/reagent_containers/personal_inhaler_cartridge/examine(var/mob/user)
if(!..(user, 2))
return
@@ -75,7 +88,7 @@
name = "inhaler"
desc = "A safe way to administer small amounts of drugs into the lungs by trained personnel."
icon = 'icons/obj/syringe.dmi'
item_state = "buildpipe"
item_state = "pi"
icon_state = "pi"
w_class = ITEMSIZE_SMALL
slot_flags = SLOT_BELT
@@ -94,6 +107,11 @@
cut_overlays()
if(stored_cartridge)
add_overlay(stored_cartridge.icon_state)
if(stored_cartridge.reagents.total_volume)
var/rounded_vol = round(stored_cartridge.reagents.total_volume, round(stored_cartridge.reagents.maximum_volume / (stored_cartridge.volume / 5)))
var/image/filling = image(icon, "[stored_cartridge.icon_state][rounded_vol]")
filling.color = stored_cartridge.reagents.get_color()
add_overlay(filling)
/obj/item/personal_inhaler/attack_self(mob/user as mob)
if(stored_cartridge)
@@ -150,8 +168,9 @@
if(M.reagents)
var/contained = stored_cartridge.reagentlist()
var/temp = stored_cartridge.reagents.get_temperature()
var/trans = stored_cartridge.reagents.trans_to_mob(M, transfer_amount, CHEM_BREATHE, bypass_checks = TRUE)
admin_inject_log(user, M, src, contained, reagents.get_temperature(), trans)
admin_inject_log(user, M, src, contained, temp, trans)
playsound(M.loc, 'sound/items/stimpack.ogg', 50, 1)
if(eject_when_empty)
to_chat(user,"<span class='notice'>\The [stored_cartridge] automatically ejects from \the [src].</span>")
@@ -162,6 +181,7 @@
else
to_chat(user,"<span class='warning'>Nothing happens!</span>")
update_icon()
return
/obj/item/personal_inhaler/attackby(var/obj/item/reagent_containers/personal_inhaler_cartridge/cartridge as obj, var/mob/user as mob)
@@ -20,7 +20,7 @@
center_of_mass = list("x" = 16,"y" = 14)
matter = list(MATERIAL_GLASS = 150)
amount_per_transfer_from_this = 5
possible_transfer_amounts = list(1, 2, 5, 15)
possible_transfer_amounts = list(1, 2, 5, 10, 15)
volume = 15
w_class = ITEMSIZE_TINY
slot_flags = SLOT_EARS
@@ -35,6 +35,7 @@
var/image/filling //holds a reference to the current filling overlay
var/visible_name = "a syringe"
var/time = 30
var/last_jab = 0 //Spam prevention
center_of_mass = null
drop_sound = 'sound/items/drop/glass_small.ogg'
pickup_sound = 'sound/items/pickup/glass_small.ogg'
@@ -55,6 +56,9 @@
STOP_PROCESSING(SSprocessing, src)
return 1
/obj/item/reagent_containers/syringe/AltClick(var/mob/user)
set_APTFT()
/obj/item/reagent_containers/syringe/proc/infect_limb(var/obj/item/organ/external/eo)
eo.germ_level += dirtiness // only 75% of the way to an infection at max
@@ -106,6 +110,10 @@
return
/obj/item/reagent_containers/syringe/afterattack(obj/target, mob/user, proximity)
if(last_jab + time > world.time)
to_chat(usr, SPAN_WARNING("You're already using \the [src]!"))
return
if(!proximity || !target.reagents)
return
@@ -119,10 +127,19 @@
if(user.a_intent == I_GRAB && ishuman(user) && ishuman(target)) // we could add other things here eventually. trepanation maybe
var/mob/living/carbon/human/H = target
if (check_zone(user.zone_sel.selecting) == BP_CHEST) // impromptu needle thoracostomy, re-inflate a collapsed lung
var/obj/item/organ/internal/lungs/L = H.internal_organs_by_name[BP_LUNGS]
var/P = (user == target) ? "their" : (target.name + "\'s")
var/SM = (user == target) ? "your" : (target.name + "\'s")
if(!L)
return
if(L.rescued == TRUE)
to_chat(usr, SPAN_NOTICE("[H]'s ribs are already punctured!"))
return
last_jab = world.time
user.visible_message("<b>[user]</b> aims \the [src] between [P] ribs!", SPAN_NOTICE("You aim \the [src] between [SM] ribs!"))
if(!do_mob(user, target, 1.5 SECONDS))
last_jab = 0 //Resets to try again immediately
user.visible_message("<b>[user]</b> fumbles with \the [src]!", SPAN_NOTICE("You fumble with \the [src]!"))
return
var/blocked = H.get_blocked_ratio(BP_CHEST, BRUTE, DAM_SHARP, damage = 5)
if(blocked > 20)
@@ -130,10 +147,8 @@
return
user.visible_message("<b>[user]</b> jabs \the [src] between [P] ribs!", SPAN_NOTICE("You jab \the [src] between [SM] ribs!"))
H.apply_damage(3, BRUTE, BP_CHEST)
H.custom_pain("The pain in your chest is living hell!", 75, affecting = H.organs_by_name[BP_CHEST])
var/obj/item/organ/internal/lungs/L = H.internal_organs_by_name[BP_LUNGS]
if(!L)
return
H.custom_pain("The pain in your chest is living hell!", 50, affecting = H.organs_by_name[BP_CHEST])
L.oxygen_deprivation = 0
L.rescued = TRUE
return
@@ -221,6 +236,7 @@
if(ismob(target) && target != user)
var/inject_time = time
if(isliving(target))
last_jab = world.time
var/mob/living/L = target
var/inject_mod = L.can_inject(user, TRUE, user.zone_sel.selecting)
if(!inject_mod)
@@ -231,6 +247,8 @@
user.do_attack_animation(target)
if(!do_mob(user, target, inject_time))
last_jab = 0
user.visible_message("<b>[user]</b> fumbles with \the [src]!", SPAN_NOTICE("You fumble with \the [src]!"))
return
user.visible_message(SPAN_WARNING("[user] injects [target] with the syringe!"))