diff --git a/code/datums/components/species/shadekin/shadekin.dm b/code/datums/components/species/shadekin/shadekin.dm index 186a3674778..94e8473ab95 100644 --- a/code/datums/components/species/shadekin/shadekin.dm +++ b/code/datums/components/species/shadekin/shadekin.dm @@ -123,7 +123,8 @@ for(var/obj/effect/abstract/dark_maw/dm as anything in active_dark_maws) //if the component gets destroyed so does your precious maws if(!QDELETED(dm)) qdel(dm) - owner.shadekin_display.invisibility = INVISIBILITY_ABSTRACT //hide it + if(owner.shadekin_display) + owner.shadekin_display.invisibility = INVISIBILITY_ABSTRACT //hide it replace_shadekin_master() active_dark_maws.Cut() shadekin_abilities.Cut() diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm index 7f846162666..da1496ecae0 100644 --- a/code/game/objects/items/devices/defib.dm +++ b/code/game/objects/items/devices/defib.dm @@ -292,8 +292,9 @@ if(H.should_have_organ(O_BRAIN)) if(!brain) return "buzzes, \"Resuscitation failed - Patient lacks a brain. Further attempts futile without replacement.\"" - if(brain.defib_timer <= 0) - return "buzzes, \"Resuscitation failed - Patient's brain has naturally degraded past a recoverable state. Further attempts futile.\"" + else if(istype(brain, /obj/item/organ/internal/brain)) //Some species have weird 'brains' that aren't technically brains. Those don't have defib timers. + if(brain.defib_timer <= 0) + return "buzzes, \"Resuscitation failed - Patient's brain has naturally degraded past a recoverable state. Further attempts futile.\"" H.updatehealth() diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm index db5d7b9ee0c..0e0d773089f 100644 --- a/code/game/objects/structures/girders.dm +++ b/code/game/objects/structures/girders.dm @@ -152,20 +152,20 @@ if(anchored && !reinf_material) playsound(src, W.usesound, 100, 1) to_chat(user, span_notice("Now disassembling the girder...")) - if(do_after(user,(35 + round(max_health/50)) * W.toolspeed)) + if(do_after(user,(35 + round(max_health/50)) * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE)) if(!src) return to_chat(user, span_notice("You dissasembled the girder!")) dismantle() else if(!anchored) playsound(src, W.usesound, 100, 1) to_chat(user, span_notice("Now securing the girder...")) - if(do_after(user, 40 * W.toolspeed, src)) + if(do_after(user, 40 * W.toolspeed, src, exclusive = TASK_USER_EXCLUSIVE)) to_chat(user, span_notice("You secured the girder!")) reset_girder() else if(istype(W, /obj/item/pickaxe/plasmacutter)) to_chat(user, span_notice("Now slicing apart the girder...")) - if(do_after(user,30 * W.toolspeed)) + if(do_after(user,30 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE)) if(!src) return to_chat(user, span_notice("You slice apart the girder!")) dismantle() @@ -178,7 +178,7 @@ if(state == 2) playsound(src, W.usesound, 100, 1) to_chat(user, span_notice("Now unsecuring support struts...")) - if(do_after(user,40 * W.toolspeed)) + if(do_after(user,40 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE)) if(!src) return to_chat(user, span_notice("You unsecured the support struts!")) state = 1 @@ -190,7 +190,7 @@ else if(W.has_tool_quality(TOOL_WIRECUTTER) && state == 1) playsound(src, W.usesound, 100, 1) to_chat(user, span_notice("Now removing support struts...")) - if(do_after(user,40 * W.toolspeed)) + if(do_after(user,40 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE)) if(!src) return to_chat(user, span_notice("You removed the support struts!")) reinf_material.place_dismantled_product(get_turf(src)) @@ -200,7 +200,7 @@ else if(W.has_tool_quality(TOOL_CROWBAR) && state == 0 && anchored) playsound(src, W.usesound, 100, 1) to_chat(user, span_notice("Now dislodging the girder...")) - if(do_after(user, 40 * W.toolspeed)) + if(do_after(user, 40 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE)) if(!src) return to_chat(user, span_notice("You dislodged the girder!")) displace() @@ -251,7 +251,7 @@ to_chat(user, span_notice("You begin adding the plating...")) - if(!do_after(user,time_to_reinforce) || !S.use(amount_to_use)) + if(!do_after(user,time_to_reinforce, exclusive = TASK_USER_EXCLUSIVE) || !S.use(amount_to_use)) return TRUE //once we've gotten this far don't call parent attackby() if(anchored) @@ -285,7 +285,7 @@ return 0 to_chat(user, span_notice("Now reinforcing...")) - if (!do_after(user,40) || !S.use(1)) + if (!do_after(user,40, exclusive = TASK_USER_EXCLUSIVE) || !S.use(1)) return 1 //don't call parent attackby() past this point to_chat(user, span_notice("You added reinforcement!")) @@ -351,13 +351,13 @@ if(W.has_tool_quality(TOOL_WRENCH)) playsound(src, W.usesound, 100, 1) to_chat(user, span_notice("Now disassembling the girder...")) - if(do_after(user,40 * W.toolspeed)) + if(do_after(user,40 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE)) to_chat(user, span_notice("You dissasembled the girder!")) dismantle() else if(istype(W, /obj/item/pickaxe/plasmacutter)) to_chat(user, span_notice("Now slicing apart the girder...")) - if(do_after(user,30 * W.toolspeed)) + if(do_after(user,30 * W.toolspeed, exclusive = TASK_USER_EXCLUSIVE)) to_chat(user, span_notice("You slice apart the girder!")) dismantle() diff --git a/code/modules/examine/examine.dm b/code/modules/examine/examine.dm index def3dc2d82d..8f2bc0d24ea 100644 --- a/code/modules/examine/examine.dm +++ b/code/modules/examine/examine.dm @@ -120,7 +120,7 @@ if(is_antagish && antag_info_temp) . += span_details("🏴‍☠️ | Antag Information", antag_info_temp) var/list/interaction_info = A.get_description_interaction() - if(interaction_info.len > 0) + if(LAZYLEN(interaction_info)) var/temp = "" for(var/a in interaction_info) temp += a + "\n" diff --git a/code/modules/hydroponics/grown.dm b/code/modules/hydroponics/grown.dm index 976bee42cbd..47aa75df78c 100644 --- a/code/modules/hydroponics/grown.dm +++ b/code/modules/hydroponics/grown.dm @@ -47,10 +47,10 @@ if(seed.chems) for(var/rid in seed.chems) var/list/reagent_data = seed.chems[rid] - if(reagent_data && reagent_data.len) + if(reagent_data && LAZYLEN(reagent_data)) var/rtotal = reagent_data[1] var/list/data = list() - if(reagent_data.len > 1 && potency > 0) + if(LAZYLEN(reagent_data) > 1 && potency > 0) rtotal += round(potency/reagent_data[2]) if(rid == REAGENT_ID_NUTRIMENT) data[seed.seed_name] = max(1,rtotal) diff --git a/code/modules/hydroponics/seedtypes/mushrooms.dm b/code/modules/hydroponics/seedtypes/mushrooms.dm index bbdfb6a4ca9..df0e5be7666 100644 --- a/code/modules/hydroponics/seedtypes/mushrooms.dm +++ b/code/modules/hydroponics/seedtypes/mushrooms.dm @@ -44,7 +44,7 @@ seed_name = "plump helmet" display_name = "plump helmet mushrooms" mutants = list("walkingmushroom",PLANT_TOWERCAP) - chems = list(REAGENT_ID_NUTRIMENT = list(5,10), REAGENT_ID_FUNGI = 1) + chems = list(REAGENT_ID_NUTRIMENT = list(5,10), REAGENT_ID_FUNGI = list(1,5)) kitchen_tag = PLANT_PLUMPHELMET /datum/seed/mushroom/plump/New() diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm index 7c1c357a75e..95c92f4f2fc 100644 --- a/code/modules/mob/living/carbon/human/human_damage.dm +++ b/code/modules/mob/living/carbon/human/human_damage.dm @@ -124,11 +124,11 @@ if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.incoming_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*amount) amount *= M.incoming_damage_percent if(!isnull(M.incoming_brute_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*amount) amount *= M.incoming_brute_damage_percent if(nif && nif.flag_check(NIF_C_BRUTEARMOR,NIF_FLAGS_COMBAT)){amount *= 0.7} //VOREStation Edit - NIF mod for damage resistance for this type of damage @@ -146,11 +146,11 @@ if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.incoming_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*amount) amount *= M.incoming_damage_percent if(!isnull(M.incoming_fire_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*amount) amount *= M.incoming_fire_damage_percent if(nif && nif.flag_check(NIF_C_BURNARMOR,NIF_FLAGS_COMBAT)){amount *= 0.7} //VOREStation Edit - NIF mod for damage resistance for this type of damage @@ -170,11 +170,11 @@ if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.incoming_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*amount) amount *= M.incoming_damage_percent if(!isnull(M.incoming_brute_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*amount) amount *= M.incoming_brute_damage_percent if(nif && nif.flag_check(NIF_C_BRUTEARMOR,NIF_FLAGS_COMBAT)){amount *= 0.7} //VOREStation Edit - NIF mod for damage resistance for this type of damage @@ -196,11 +196,11 @@ if(amount > 0) for(var/datum/modifier/M in modifiers) if(!isnull(M.incoming_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*amount) amount *= M.incoming_damage_percent if(!isnull(M.incoming_fire_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*amount) amount *= M.incoming_fire_damage_percent if(nif && nif.flag_check(NIF_C_BURNARMOR,NIF_FLAGS_COMBAT)){amount *= 0.7} //VOREStation Edit - NIF mod for damage resistance for this type of damage @@ -331,6 +331,32 @@ else ..() +/mob/living/carbon/human/Stun(var/amount) + if(amount > 0) //only multiply it by the mod if it's positive, or else it takes longer to fade too! + amount = amount*species.stun_mod + ..(amount) + +/mob/living/carbon/human/SetStunned(var/amount) + ..() + +/mob/living/carbon/human/AdjustStunned(var/amount) + if(amount > 0) // Only multiply it if positive. + amount = amount*species.stun_mod + ..(amount) + +/mob/living/carbon/human/Weaken(var/amount) + if(amount > 0) //only multiply it by the mod if it's positive, or else it takes longer to fade too! + amount = amount*species.weaken_mod + ..(amount) + +/mob/living/carbon/human/SetWeakened(var/amount) + ..() + +/mob/living/carbon/human/AdjustWeakened(var/amount) + if(amount > 0) // Only multiply it if positive. + amount = amount*species.weaken_mod + ..(amount) + /mob/living/carbon/human/getToxLoss() if(species.flags & NO_POISON) toxloss = 0 @@ -496,37 +522,37 @@ This function restores all organs. for(var/datum/modifier/M in modifiers) //MODIFIER STUFF. It's best to do this RIGHT before armor is calculated, so it's done here! This is the 'forcefield' defence. if(damagetype == BRUTE && (!isnull(M.effective_brute_resistance))) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost * damage) damage = damage * M.effective_brute_resistance continue if((damagetype == BURN || damagetype == ELECTROCUTE) && (!isnull(M.effective_fire_resistance))) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost * damage) damage = damage * M.effective_fire_resistance continue if(damagetype == TOX && (!isnull(M.effective_tox_resistance))) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost * damage) damage = damage * M.effective_tox_resistance continue if(damagetype == OXY && (!isnull(M.effective_oxy_resistance))) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost * damage) damage = damage * M.effective_oxy_resistance continue if(damagetype == CLONE && (!isnull(M.effective_clone_resistance))) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost * damage) damage = damage * M.effective_clone_resistance continue if(damagetype == HALLOSS && (!isnull(M.effective_hal_resistance))) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost * damage) damage = damage * M.effective_hal_resistance continue if(damagetype == SEARING && (!isnull(M.effective_fire_resistance) || !isnull(M.effective_brute_resistance))) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost * damage) var/damage_mitigation = 0//Used for dual calculations. if(!isnull(M.effective_fire_resistance)) @@ -579,11 +605,11 @@ This function restores all organs. for(var/datum/modifier/M in modifiers) if(!isnull(M.incoming_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*damage) damage *= M.incoming_damage_percent if(!isnull(M.incoming_brute_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*damage) damage *= M.incoming_brute_damage_percent @@ -596,11 +622,11 @@ This function restores all organs. for(var/datum/modifier/M in modifiers) if(!isnull(M.incoming_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*damage) damage *= M.incoming_damage_percent if(!isnull(M.incoming_brute_damage_percent)) - if(M.energy_based) + if(M.energy_based && M.energy_source) M.energy_source.use(M.damage_cost*damage) damage *= M.incoming_fire_damage_percent diff --git a/code/modules/mob/living/carbon/human/species/station/protean/protean_rig.dm b/code/modules/mob/living/carbon/human/species/station/protean/protean_rig.dm index c204a2b2b29..d12b2eb05d4 100644 --- a/code/modules/mob/living/carbon/human/species/station/protean/protean_rig.dm +++ b/code/modules/mob/living/carbon/human/species/station/protean/protean_rig.dm @@ -491,8 +491,8 @@ ..() /obj/item/rig/protean/get_description_interaction() + var/list/results = list() if(dead) - var/list/results = list() switch(dead) if(1) results += "Use a screwdriver to start repairs." @@ -502,7 +502,7 @@ results += "Use some Nanopaste." if(4) results += "Use either a defib or jumper cables to start the reboot sequence." - return results + return results //Effectively a round about way of letting a Protean wear other rigs. /obj/item/rig/protean/proc/AssimilateRig(mob/user, var/obj/item/rig/R) diff --git a/code/modules/recycling/sortingmachinery.dm b/code/modules/recycling/sortingmachinery.dm index 4bdcda10b3d..53e640a2ba1 100755 --- a/code/modules/recycling/sortingmachinery.dm +++ b/code/modules/recycling/sortingmachinery.dm @@ -407,7 +407,7 @@ return /obj/machinery/disposal/deliveryChute/Bumped(var/atom/movable/AM) //Go straight into the chute - if(istype(AM, /obj/item/projectile) || istype(AM, /obj/effect) || istype(AM, /obj/mecha)) return + if(QDELETED(AM) || istype(AM, /obj/item/projectile) || istype(AM, /obj/effect) || istype(AM, /obj/mecha)) return switch(dir) if(NORTH) if(AM.loc.y != src.loc.y+1) return @@ -426,6 +426,20 @@ M.loc = src src.flush() +/obj/machinery/disposal/deliveryChute/hitby(atom/movable/AM) + if(!QDELETED(AM) || (istype(AM, /obj/item) || istype(AM, /mob/living)) && !istype(AM, /obj/item/projectile)) + switch(dir) + if(NORTH) + if(AM.loc.y != src.loc.y+1) return ..() + if(EAST) + if(AM.loc.x != src.loc.x+1) return ..() + if(SOUTH) + if(AM.loc.y != src.loc.y-1) return ..() + if(WEST) + if(AM.loc.x != src.loc.x-1) return ..() + AM.forceMove(src) + src.flush() + /obj/machinery/disposal/deliveryChute/flush() flushing = 1 flick("intake-closing", src)