Skip to content

Commit

Permalink
Aimed swap + some tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorDinamit committed Oct 10, 2023
1 parent 006fe5a commit a5d823d
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 48 deletions.
2 changes: 1 addition & 1 deletion baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions code/__defines/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 6 additions & 4 deletions code/modules/spellbook/_spellbook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down
46 changes: 46 additions & 0 deletions code/modules/spells/aimed/swap.dm
Original file line number Diff line number Diff line change
@@ -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" : ""]."
2 changes: 1 addition & 1 deletion code/modules/spells/targeted/pestilence.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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]."
42 changes: 0 additions & 42 deletions code/modules/spells/targeted/swap.dm

This file was deleted.

0 comments on commit a5d823d

Please sign in to comment.