diff --git a/baystation12.dme b/baystation12.dme index 8c68d3b4dc1..c93de258710 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -3130,6 +3130,7 @@ #include "code\modules\spells\aimed\healing.dm" #include "code\modules\spells\aimed\passage.dm" #include "code\modules\spells\aimed\spark_bolt.dm" +#include "code\modules\spells\aimed\swap.dm" #include "code\modules\spells\aoe_turf\aoe_turf.dm" #include "code\modules\spells\aoe_turf\blink.dm" #include "code\modules\spells\aoe_turf\charge.dm" @@ -3181,7 +3182,6 @@ #include "code\modules\spells\targeted\shatter_mind.dm" #include "code\modules\spells\targeted\shift.dm" #include "code\modules\spells\targeted\subjugate.dm" -#include "code\modules\spells\targeted\swap.dm" #include "code\modules\spells\targeted\torment.dm" #include "code\modules\spells\targeted\equip\_equip.dm" #include "code\modules\spells\targeted\equip\burning_touch.dm" diff --git a/code/__defines/dcs/signals.dm b/code/__defines/dcs/signals.dm index 28f1073ad14..8f507cb496f 100644 --- a/code/__defines/dcs/signals.dm +++ b/code/__defines/dcs/signals.dm @@ -32,6 +32,8 @@ // /atom signals // /atom/movable signals +/// When an atom's Dispell() proc is called +#define COMSIG_ATOM_MOVABLE_DISPELL "atom_dispell" // /area signals diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index d7255676294..a623c78115e 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -351,4 +351,5 @@ /// The effect of being affected by dispells, either a projectile or AOE effects /atom/movable/proc/Dispell() + SEND_SIGNAL(src, COMSIG_ATOM_MOVABLE_DISPELL) return diff --git a/code/modules/spellbook/_spellbook.dm b/code/modules/spellbook/_spellbook.dm index 8c8ab2e3453..4e1c33fa7e6 100644 --- a/code/modules/spellbook/_spellbook.dm +++ b/code/modules/spellbook/_spellbook.dm @@ -142,12 +142,12 @@ GLOBAL_LIST_EMPTY(spells_by_categories) option = input(user, "What do you want to do?", "Options") as anything in list("Add", "Remove", "Clear") switch(option) if("Add") - var/cat = input(user, "What category do you want to add?", "Add Category") as anything in (GLOB.spell_categories - spell_categories) - if(cat && !(cat in spell_categories) && (cat in GLOB.spell_categories)) + var/cat = input(user, "What category do you want to add?", "Add Category") as anything in ("-- None --" + GLOB.spell_categories - spell_categories) + if(cat && cat != "-- None --" && !(cat in spell_categories) && (cat in GLOB.spell_categories)) spell_categories |= cat if("Remove") - var/cat = input(user, "What category do you want to remove?", "Remove Category") as anything in spell_categories - if(cat && (cat in spell_categories)) + var/cat = input(user, "What category do you want to remove?", "Remove Category") as anything in ("-- None --" + spell_categories) + if(cat && cat != "-- None --" && (cat in spell_categories)) spell_categories -= cat if("Clear") spell_categories = list() @@ -157,9 +157,11 @@ GLOBAL_LIST_EMPTY(spells_by_categories) // Being hit with any source of dispell releases any locks /obj/item/spellbook/Dispell() + . = ..() if(!istype(owner) && !(book_flags & WIZARD_ONLY) && !(book_flags & APPRENTICE_ONLY)) return visible_message(SPAN_NOTICE("\The [src] fizzles and sparks!")) + RemoveOwner() owner = null book_flags &= ~WIZARD_ONLY book_flags &= ~APPRENTICE_ONLY diff --git a/code/modules/spells/aimed/swap.dm b/code/modules/spells/aimed/swap.dm new file mode 100644 index 00000000000..2f6ee523a71 --- /dev/null +++ b/code/modules/spells/aimed/swap.dm @@ -0,0 +1,46 @@ +/datum/spell/aimed/swap + name = "Swap" + desc = "This spell swaps the positions of the wizard and a target." + + invocation = "Joyo!" + invocation_type = INVOKE_WHISPER + + level_max = list(UPGRADE_TOTAL = 2, UPGRADE_SPEED = 0, UPGRADE_POWER = 2) + + spell_flags = 0 + range = 6 + + hud_state = "wiz_swap" + + cast_sound = 'sound/magic/blink.ogg' + + spell_cost = 1 + mana_cost = 5 + + var/eye_blind = 0 + +/datum/spell/aimed/swap/TargetCastCheck(mob/living/user, mob/living/target) + if(!isliving(target)) + to_chat(user, SPAN_WARNING("The target must be a living creature!")) + return FALSE + if(get_dist(user, target) > range) + to_chat(user, SPAN_WARNING("The target is too far away!")) + return FALSE + return ..() + +/datum/spell/aimed/swap/fire_projectile(mob/living/user, mob/living/target) + . = ..() + var/turf/target_turf = get_turf(target) + var/turf/user_turf = get_turf(user) + + target.forceMove(user_turf) + user.forceMove(target_turf) + + target.eye_blind += eye_blind + +/datum/spell/aimed/swap/empower_spell() + if(!..()) + return FALSE + + eye_blind += 2 + return "The [src] spell will now blind the target[eye_blind > 2 ? " even more" : ""]." diff --git a/code/modules/spells/targeted/pestilence.dm b/code/modules/spells/targeted/pestilence.dm index da6cc63e541..fca7881f1a3 100644 --- a/code/modules/spells/targeted/pestilence.dm +++ b/code/modules/spells/targeted/pestilence.dm @@ -41,4 +41,4 @@ disease_symptoms += 1 disease_severity += 1 - return "The diseases spread with spell [src] are now more powerful." + return "The symptoms of the disease created with spell [src] are now more powerful and their amount is [disease_symptoms]." diff --git a/code/modules/spells/targeted/swap.dm b/code/modules/spells/targeted/swap.dm deleted file mode 100644 index a281d681a90..00000000000 --- a/code/modules/spells/targeted/swap.dm +++ /dev/null @@ -1,42 +0,0 @@ -/datum/spell/targeted/swap - name = "Swap" - desc = "This spell swaps the positions of the wizard and a target." - - charge_type = SPELL_HOLDVAR - holder_var_type = "brainloss" - holder_var_amount = 10 - - invocation = "Joyo!" - invocation_type = INVOKE_WHISPER - - level_max = list(UPGRADE_TOTAL = 2, UPGRADE_SPEED = 0, UPGRADE_POWER = 2) - - spell_flags = Z2NOCAST - range = 6 - max_targets = 1 - compatible_mobs = list(/mob/living) - - hud_state = "wiz_swap" - - cast_sound = 'sound/magic/mandswap.ogg' - - spell_cost = 1 - mana_cost = 5 - -/datum/spell/targeted/swap/cast(var/list/targets, mob/user) - for(var/mob/T in targets) - var/turf/aT = get_turf(T) - var/turf/bT = get_turf(user) - - T.forceMove(bT) - user.forceMove(aT) - - apply_spell_damage(T) - -/datum/spell/targeted/swap/empower_spell() - if(!..()) - return 0 - - amt_eye_blind += 2 - - return "This spell will now blind the target."