diff --git a/code/modules/antagonists/eldritch_cult/eldritch_effects.dm b/code/modules/antagonists/eldritch_cult/eldritch_effects.dm index eac2c97d490..8c60a1f335a 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/is_in_use = FALSE /obj/effect/eldritch/attack_hand(mob/living/user) . = ..() @@ -15,7 +17,8 @@ /obj/effect/eldritch/proc/try_activate(mob/living/user) if(!IS_HERETIC(user)) return - activate(user) + if(!is_in_use) + INVOKE_ASYNC(src, .proc/activate , user) /obj/effect/eldritch/attacked_by(obj/item/I, mob/living/user) . = ..() @@ -23,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() @@ -39,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 - for(var/X in knowledge) var/datum/eldritch_knowledge/current_eldritch_knowledge = knowledge[X] @@ -70,9 +73,23 @@ flick("[icon_state]_active",src) playsound(user, 'sound/magic/castsummon.ogg', 75, TRUE) + 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(selected_atoms) + + 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) + 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 diff --git a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm index 29387e08b78..8e026387b51 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_knowledge.dm @@ -187,9 +187,7 @@ 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 FALSE + 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