Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: Spells can be used in MMI #6018

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_FAKEDEATH "fakedeath" //Makes the owner appear as dead to most forms of medical examination
#define TRAIT_XENO_HOST "xeno_host" //Tracks whether we're gonna be a baby alien's mummy.
#define TRAIT_LEGION_TUMOUR "legion_tumour" //used in huds for special icon
#define TRAIT_NO_SPELLS "no_spells" // Used to prevent movement spells from being used as a brain
/// Are we immune to shocks?
#define TRAIT_SHOCKIMMUNE "shock_immunity"
/// Are we immune to specifically tesla / SM shocks?
Expand Down Expand Up @@ -177,7 +178,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
/// This trait makes it so that an item literally cannot be removed at all, or at least that's how it should be. Only deleted.
#define TRAIT_NODROP "nodrop"


///Movement type traits for movables. See elements/movetype_handler.dm
#define TRAIT_MOVE_GROUND "move_ground"
#define TRAIT_MOVE_FLYING "move_flying"
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NO_SLIP_SLIDE" = TRAIT_NO_SLIP_SLIDE,
"TRAIT_NO_SLIP_WATER" = TRAIT_NO_SLIP_WATER,
"TRAIT_NO_SPECIES_EXAMINE" = TRAIT_NO_SPECIES_EXAMINE,
"TRAIT_NO_SPELLS" = TRAIT_NO_SPELLS,
"TRAIT_NO_TRANSFORM" = TRAIT_NO_TRANSFORM,
"TRAIT_OBESITY" = TRAIT_OBESITY,
"TRAIT_OPEN_MIND" = TRAIT_OPEN_MIND,
Expand Down
3 changes: 3 additions & 0 deletions code/datums/spell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,9 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell))
to_chat(user, span_warning("You shouldn't have this spell! Something's wrong."))
return FALSE

if(HAS_TRAIT(user, TRAIT_NO_SPELLS))
return FALSE

if(!centcom_cancast) //Certain spells are not allowed on the centcom zlevel
var/turf/user_turf = get_turf(user)
if(user_turf && is_admin_level(user_turf.z))
Expand Down
1 change: 0 additions & 1 deletion code/datums/spells/wizard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@
action.button_icon_state = "fireball[active]"
action.UpdateButtonIcon()


/obj/effect/proc_holder/spell/fireball/cast(list/targets, mob/living/user = usr)
var/target = targets[1] //There is only ever one target for fireball
var/turf/T = user.loc
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/brain/MMI.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
brainmob.set_stat(CONSCIOUS)
brainmob.set_invis_see(initial(brainmob.see_invisible))
held_brain = brain
ADD_TRAIT(brainmob, TRAIT_NO_SPELLS, UNIQUE_TRAIT_SOURCE(src)) // Dont use spells, little brain.
alien = istype(brain, /obj/item/organ/internal/brain/xeno)
update_appearance(UPDATE_ICON_STATE|UPDATE_NAME)
if(radio_action)
Expand Down Expand Up @@ -191,6 +192,7 @@
brainmob = null//Set mmi brainmob var to null
held_brain.forceMove(dropspot)
held_brain = null
REMOVE_TRAIT(brainmob, TRAIT_NO_SPELLS, UNIQUE_TRAIT_SOURCE(src))
timchigaming marked this conversation as resolved.
Show resolved Hide resolved
update_appearance(UPDATE_ICON_STATE|UPDATE_NAME)


Expand Down