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: Brains in mmi can cast spells #6021

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions 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 cast or use any spells
/// Are we immune to shocks?
#define TRAIT_SHOCKIMMUNE "shock_immunity"
/// Are we immune to specifically tesla / SM shocks?
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
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 @@ -188,6 +189,7 @@
GLOB.alive_mob_list -= brainmob//Get outta here
held_brain.brainmob = brainmob//Set the brain to use the brainmob
held_brain.brainmob.cancel_camera()
REMOVE_TRAIT(brainmob, TRAIT_NO_SPELLS, UNIQUE_TRAIT_SOURCE(src))
brainmob = null//Set mmi brainmob var to null
held_brain.forceMove(dropspot)
held_brain = null
Expand Down