From fc53fa0211d15b6c344619ecc3dad3922451233f Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 4 Jul 2020 01:22:22 +0200 Subject: [PATCH 1/4] i love dealing with this bullshit --- .../eldritch_cult/eldritch_effects.dm | 20 +++++++++++++++++-- .../eldritch_cult/eldritch_knowledge.dm | 4 ++-- .../living/simple_animal/eldritch_demons.dm | 4 +--- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm index eac2c97d490..ba8fbe114c6 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm @@ -5,6 +5,8 @@ icon_state = "" resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF layer = SIGIL_LAYER + ///Used mainly for summoning ritual to prevent spamming the rune to create millions of monsters. + var/list/atoms_in_use = list() /obj/effect/eldritch/attack_hand(mob/living/user) . = ..() @@ -15,7 +17,7 @@ /obj/effect/eldritch/proc/try_activate(mob/living/user) if(!IS_HERETIC(user)) return - activate(user) + INVOKE_ASYNC(src, .proc/activate , user) /obj/effect/eldritch/attacked_by(obj/item/I, mob/living/user) . = ..() @@ -39,7 +41,7 @@ if(living_in_range.stat != DEAD || living_in_range == user) // we only accept corpses, no living beings allowed. continue atoms_in_range += atom_in_range - + atoms_in_range -= atoms_in_use for(var/X in knowledge) var/datum/eldritch_knowledge/current_eldritch_knowledge = knowledge[X] @@ -70,8 +72,22 @@ flick("[icon_state]_active",src) playsound(user, 'sound/magic/castsummon.ogg', 75, TRUE) + atoms_in_use |= selected_atoms + for(var/to_disappear in atoms_in_use) + var/atom/atom_to_disappear = to_disappear + //temporary so we dont have to deal with the bs of someone picking those up when they may be deleted + atom_to_disappear.invisibility = INVISIBILITY_ABSTRACT if(current_eldritch_knowledge.on_finished_recipe(user,selected_atoms,loc)) current_eldritch_knowledge.cleanup_atoms(selected_atoms) + + listclearnulls() + + for(var/to_disappear in atoms_in_use) + var/atom/atom_to_disappear = to_disappear + //we need to reappear the item just in case the ritual didnt consume everything... or something. + atom_to_disappear.invisibility = initial(atom_to_disappear.invisibility) + + atoms_in_use = list() return to_chat(user,"Your ritual failed! You used either wrong components or are missing something important!") diff --git a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm index 65dddf1c9c0..98f179042ef 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm @@ -188,8 +188,8 @@ var/datum/antagonist/heretic/master = user.mind.has_antag_datum(/datum/antagonist/heretic) heretic_monster.set_owner(master) //delaying the returning makes the cleanup_atoms break on the rune base, so we are calling it here. - cleanup_atoms(atoms) - return FALSE + //cleanup_atoms(atoms) + return TRUE //Ascension knowledge /datum/eldritch_knowledge/final diff --git a/code/modules/mob/living/simple_animal/eldritch_demons.dm b/code/modules/mob/living/simple_animal/eldritch_demons.dm index 2caee21d8af..bfec32b118c 100644 --- a/code/modules/mob/living/simple_animal/eldritch_demons.dm +++ b/code/modules/mob/living/simple_animal/eldritch_demons.dm @@ -16,7 +16,7 @@ speed = 0 a_intent = INTENT_HARM stop_automated_movement = 1 - AIStatus = AI_ON + AIStatus = AI_OFF attack_sound = 'sound/weapons/punch1.ogg' see_in_dark = 7 lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE @@ -37,8 +37,6 @@ /mob/living/simple_animal/hostile/eldritch/Initialize() . = ..() add_spells() - //by default - mind.add_antag_datum(/datum/antagonist/heretic_monster) /** * Add_spells From 8fa5710abf07381ecb9254771764d400beb4428e Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 4 Jul 2020 01:33:24 +0200 Subject: [PATCH 2/4] E --- code/modules/antagonists/eldritch_cult/eldritch_effects.dm | 2 +- code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm index ba8fbe114c6..e82b15aa360 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm @@ -80,7 +80,7 @@ if(current_eldritch_knowledge.on_finished_recipe(user,selected_atoms,loc)) current_eldritch_knowledge.cleanup_atoms(selected_atoms) - listclearnulls() + listclearnulls(atoms_in_use) for(var/to_disappear in atoms_in_use) var/atom/atom_to_disappear = to_disappear diff --git a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm index 98f179042ef..918e46a7cc2 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm @@ -187,8 +187,6 @@ var/datum/antagonist/heretic_monster/heretic_monster = summoned.mind.has_antag_datum(/datum/antagonist/heretic_monster) var/datum/antagonist/heretic/master = user.mind.has_antag_datum(/datum/antagonist/heretic) heretic_monster.set_owner(master) - //delaying the returning makes the cleanup_atoms break on the rune base, so we are calling it here. - //cleanup_atoms(atoms) return TRUE //Ascension knowledge From 79db40e2045ff344db1f7f31995c72f8cc31b241 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 6 Jul 2020 23:21:58 +0200 Subject: [PATCH 3/4] E --- .../eldritch_cult/eldritch_effects.dm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm index e82b15aa360..a305d3e05d3 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm @@ -6,7 +6,7 @@ resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF layer = SIGIL_LAYER ///Used mainly for summoning ritual to prevent spamming the rune to create millions of monsters. - var/list/atoms_in_use = list() + var/is_in_use = FALSE /obj/effect/eldritch/attack_hand(mob/living/user) . = ..() @@ -17,7 +17,8 @@ /obj/effect/eldritch/proc/try_activate(mob/living/user) if(!IS_HERETIC(user)) return - INVOKE_ASYNC(src, .proc/activate , user) + if(!is_in_use) + INVOKE_ASYNC(src, .proc/activate , user) /obj/effect/eldritch/attacked_by(obj/item/I, mob/living/user) . = ..() @@ -25,6 +26,7 @@ qdel(src) /obj/effect/eldritch/proc/activate(mob/living/user) + is_in_use = TRUE // Have fun trying to read this proc. var/datum/antagonist/heretic/cultie = user.mind.has_antag_datum(/datum/antagonist/heretic) var/list/knowledge = cultie.get_all_knowledge() @@ -72,23 +74,23 @@ flick("[icon_state]_active",src) playsound(user, 'sound/magic/castsummon.ogg', 75, TRUE) - atoms_in_use |= selected_atoms - for(var/to_disappear in atoms_in_use) + for(var/to_disappear in selected_atoms) var/atom/atom_to_disappear = to_disappear //temporary so we dont have to deal with the bs of someone picking those up when they may be deleted atom_to_disappear.invisibility = INVISIBILITY_ABSTRACT if(current_eldritch_knowledge.on_finished_recipe(user,selected_atoms,loc)) current_eldritch_knowledge.cleanup_atoms(selected_atoms) + is_in_use = FALSE - listclearnulls(atoms_in_use) + listclearnulls(selected_atoms) - for(var/to_disappear in atoms_in_use) + for(var/to_disappear in selected_atoms) var/atom/atom_to_disappear = to_disappear //we need to reappear the item just in case the ritual didnt consume everything... or something. atom_to_disappear.invisibility = initial(atom_to_disappear.invisibility) - atoms_in_use = list() return + is_in_use = FALSE to_chat(user,"Your ritual failed! You used either wrong components or are missing something important!") /obj/effect/eldritch/big From 3f50204b4805eb2cee9fc4ee1a3d0527cbbc25e3 Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 7 Jul 2020 23:30:39 +0200 Subject: [PATCH 4/4] E --- code/modules/antagonists/eldritch_cult/eldritch_effects.dm | 1 - 1 file changed, 1 deletion(-) diff --git a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm index a305d3e05d3..8c60a1f335a 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm @@ -43,7 +43,6 @@ if(living_in_range.stat != DEAD || living_in_range == user) // we only accept corpses, no living beings allowed. continue atoms_in_range += atom_in_range - atoms_in_range -= atoms_in_use for(var/X in knowledge) var/datum/eldritch_knowledge/current_eldritch_knowledge = knowledge[X]