From 202b517fa02d87c86264e2e54d879d4ef117f801 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Sat, 2 May 2020 02:05:56 +0200 Subject: [PATCH] Fixing more issues. --- code/__HELPERS/global_lists.dm | 23 ++++++++++ code/controllers/subsystem/atoms.dm | 23 ---------- code/game/machinery/recharger.dm | 7 ++- code/modules/clothing/under/_under.dm | 2 +- .../mining/equipment/regenerative_core.dm | 44 +++++++++---------- 5 files changed, 51 insertions(+), 48 deletions(-) diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index 38e25b04c5..bcfaa1bed2 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -88,6 +88,7 @@ init_subtypes(/datum/crafting_recipe, GLOB.crafting_recipes) INVOKE_ASYNC(GLOBAL_PROC, /proc/init_ref_coin_values) //so the current procedure doesn't sleep because of UNTIL() + INVOKE_ASYNC(GLOBAL_PROC, /proc/setupGenetics) //creates every subtype of prototype (excluding prototype) and adds it to list L. //if no list/L is provided, one is created. @@ -113,3 +114,25 @@ UNTIL(C.flags_1 & INITIALIZED_1) //we want to make sure the value is calculated and not null. GLOB.coin_values[path] = C.value qdel(C) + +/proc/setupGenetics() + var/list/mutations = subtypesof(/datum/mutation/human) + shuffle_inplace(mutations) + for(var/A in subtypesof(/datum/generecipe)) + var/datum/generecipe/GR = A + GLOB.mutation_recipes[initial(GR.required)] = initial(GR.result) + for(var/i in 1 to LAZYLEN(mutations)) + var/path = mutations[i] //byond gets pissy when we do it in one line + var/datum/mutation/human/B = new path () + B.alias = "Mutation #[i]" + GLOB.all_mutations[B.type] = B + GLOB.full_sequences[B.type] = generate_gene_sequence(B.blocks) + if(B.locked) + continue + if(B.quality == POSITIVE) + GLOB.good_mutations |= B + else if(B.quality == NEGATIVE) + GLOB.bad_mutations |= B + else if(B.quality == MINOR_NEGATIVE) + GLOB.not_good_mutations |= B + CHECK_TICK \ No newline at end of file diff --git a/code/controllers/subsystem/atoms.dm b/code/controllers/subsystem/atoms.dm index 35feab6648..c1644df9c9 100644 --- a/code/controllers/subsystem/atoms.dm +++ b/code/controllers/subsystem/atoms.dm @@ -16,7 +16,6 @@ SUBSYSTEM_DEF(atoms) /datum/controller/subsystem/atoms/Initialize(timeofday) GLOB.fire_overlay.appearance_flags = RESET_COLOR - setupGenetics() //to set the mutations' sequence. initialized = INITIALIZATION_INNEW_MAPLOAD InitializeAtoms() return ..() @@ -107,28 +106,6 @@ SUBSYSTEM_DEF(atoms) old_initialized = SSatoms.old_initialized BadInitializeCalls = SSatoms.BadInitializeCalls -/datum/controller/subsystem/atoms/proc/setupGenetics() - var/list/mutations = subtypesof(/datum/mutation/human) - shuffle_inplace(mutations) - for(var/A in subtypesof(/datum/generecipe)) - var/datum/generecipe/GR = A - GLOB.mutation_recipes[initial(GR.required)] = initial(GR.result) - for(var/i in 1 to LAZYLEN(mutations)) - var/path = mutations[i] //byond gets pissy when we do it in one line - var/datum/mutation/human/B = new path () - B.alias = "Mutation #[i]" - GLOB.all_mutations[B.type] = B - GLOB.full_sequences[B.type] = generate_gene_sequence(B.blocks) - if(B.locked) - continue - if(B.quality == POSITIVE) - GLOB.good_mutations |= B - else if(B.quality == NEGATIVE) - GLOB.bad_mutations |= B - else if(B.quality == MINOR_NEGATIVE) - GLOB.not_good_mutations |= B - CHECK_TICK - /datum/controller/subsystem/atoms/proc/InitLog() . = "" for(var/path in BadInitializeCalls) diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 24fd956677..c26c66a55f 100755 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -53,6 +53,11 @@ using_power = FALSE update_icon() +/obj/machinery/recharger/Exited(atom/movable/M, atom/newloc) + . = ..() + if(charging == M) + setCharging() + /obj/machinery/recharger/attackby(obj/item/G, mob/user, params) if(istype(G, /obj/item/wrench)) if(charging) @@ -111,13 +116,11 @@ charging.update_icon() charging.forceMove(drop_location()) user.put_in_hands(charging) - setCharging(null) /obj/machinery/recharger/attack_tk(mob/user) if(charging) charging.update_icon() charging.forceMove(drop_location()) - setCharging(null) /obj/machinery/recharger/process() if(stat & (NOPOWER|BROKEN) || !anchored) diff --git a/code/modules/clothing/under/_under.dm b/code/modules/clothing/under/_under.dm index 0d08b59be9..c1c76e1091 100644 --- a/code/modules/clothing/under/_under.dm +++ b/code/modules/clothing/under/_under.dm @@ -101,7 +101,7 @@ if((flags_inv & HIDEACCESSORY) || (A.flags_inv & HIDEACCESSORY)) return TRUE - accessory_overlay = mutable_appearance('icons/mob/clothing/accessories.dmi', "attached_accessory.icon_state") + accessory_overlay = mutable_appearance('icons/mob/clothing/accessories.dmi', attached_accessory.icon_state) accessory_overlay.alpha = attached_accessory.alpha accessory_overlay.color = attached_accessory.color diff --git a/code/modules/mining/equipment/regenerative_core.dm b/code/modules/mining/equipment/regenerative_core.dm index 47a1d84f58..7380a9135d 100644 --- a/code/modules/mining/equipment/regenerative_core.dm +++ b/code/modules/mining/equipment/regenerative_core.dm @@ -75,31 +75,31 @@ apply_healing_core(target, user) /obj/item/organ/regenerative_core/proc/apply_healing_core(atom/target, mob/user) - if(ishuman(target)) - var/mob/living/carbon/human/H = target - if(inert) - to_chat(user, "[src] has decayed and can no longer be used to heal.") - return - else - if(H.stat == DEAD) - to_chat(user, "[src] are useless on the dead.") - return - if(H != user) - H.visible_message("[user] forces [H] to apply [src]... [H.p_they()] quickly regenerate all injuries!") - SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "other")) - else - to_chat(user, "You start to smear [src] on yourself. It feels and smells disgusting, but you feel amazingly refreshed in mere moments.") - SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "self")) - if(AmBloodsucker(H)) - H.revive(full_heal = FALSE) - else - H.revive(full_heal = TRUE) - qdel(src) - user.log_message("[user] used [src] to heal [H]! Wake the fuck up, Samurai!", LOG_ATTACK, color="green") //Logging for 'old' style legion core use, when clicking on a sprite of yourself or another. + if(!user || !ishuman(target)) + return + var/mob/living/carbon/human/H = target + if(inert) + to_chat(user, "[src] has decayed and can no longer be used to heal.") + return + if(H.stat == DEAD) + to_chat(user, "[src] are useless on the dead.") + return + if(H != user) + H.visible_message("[user] forces [H] to apply [src]... [H.p_they()] quickly regenerate all injuries!") + SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "other")) + else + to_chat(user, "You start to smear [src] on yourself. It feels and smells disgusting, but you feel amazingly refreshed in mere moments.") + SSblackbox.record_feedback("nested tally", "hivelord_core", 1, list("[type]", "used", "self")) + if(AmBloodsucker(H)) + H.revive(full_heal = FALSE) + else + H.revive(full_heal = TRUE) + qdel(src) + user.log_message("[user] used [src] to heal [H == user ? "[H.p_them()]self" : H]! Wake the fuck up, Samurai!", LOG_ATTACK, color="green") //Logging for 'old' style legion core use, when clicking on a sprite of yourself or another. /obj/item/organ/regenerative_core/attack_self(mob/user) //Knouli's first hack! Allows for the use of the core in hand rather than needing to click on the target, yourself, to selfheal. Its a rip of the proc just above - but skips on distance check and only uses 'user' rather than 'target' . = ..() - apply_healing_core(user) + apply_healing_core(user, user) /obj/item/organ/regenerative_core/Insert(mob/living/carbon/M, special = 0, drop_if_replaced = TRUE)