From 8ba1e8cd33f5f850e6a429d506d21897ef308e56 Mon Sep 17 00:00:00 2001 From: Perakp Date: Fri, 10 Jan 2014 15:59:55 +0200 Subject: [PATCH] - Moves spells from the mob to the mind. - Construct spells are an exception. - Spells are transferred whenever a mind is transferred: cloning, pod cloning, borging, staff of changing. - Spells are not transferred when you create a new mind for a new mob: soul stones, golems, respawns. - To my surprise, this did not fix the issue where a mind-swapped wizard loses their spells when their original body is destroyed. I do not know why this happens. - Non-human mobs can't use spells by default. Varedit spell.human_req to do that. --- code/datums/mind.dm | 2 + code/datums/spell.dm | 11 +++-- code/datums/spells/charge.dm | 7 +++- code/datums/spells/construct_spells.dm | 6 +++ code/datums/spells/mind_transfer.dm | 12 ++---- code/game/gamemodes/wizard/artefact.dm | 16 ++++---- code/game/gamemodes/wizard/spellbook.dm | 41 +++++++++---------- code/game/gamemodes/wizard/wizard.dm | 8 ++-- code/game/jobs/job/civilian.dm | 5 ++- code/modules/admin/admin_verbs.dm | 5 ++- .../mob/living/simple_animal/constructs.dm | 2 +- code/modules/mob/mob.dm | 12 ++++-- code/modules/mob/mob_defines.dm | 4 +- code/modules/projectiles/projectile/change.dm | 3 -- code/modules/projectiles/projectile/magic.dm | 3 -- 15 files changed, 73 insertions(+), 64 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 7f78d7013dd..3a71eb2061c 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -48,6 +48,7 @@ datum/mind var/has_been_rev = 0//Tracks if this mind has been a rev or not var/list/cult_words = list() + var/list/spell_list = list() // Wizard mode & "Give Spell" badmin button. var/datum/faction/faction //associated faction var/datum/changeling/changeling //changeling holder @@ -60,6 +61,7 @@ datum/mind if(!istype(new_character)) error("transfer_to(): Some idiot has tried to transfer_to() a non mob/living mob. Please inform Carn") + if(current) //remove ourself from our old body's mind variable if(changeling) current.remove_changeling_powers() diff --git a/code/datums/spell.dm b/code/datums/spell.dm index bcce59b0be8..984e32b4ed4 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -22,7 +22,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin var/holder_var_amount = 20 //same. The amount adjusted with the mob's var when the spell is used var/clothes_req = 1 //see if it requires clothes - var/human_req = 0 //spell can only be cast by humans + var/human_req = 1 //spell can only be cast by humans var/stat_allowed = 0 //see if it requires being conscious/alive, need to set to 1 for ghostpells var/invocation = "HURP DURP" //what is uttered when the wizard casts the spell var/invocation_emote_self = null @@ -49,7 +49,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin /obj/effect/proc_holder/spell/proc/cast_check(skipcharge = 0,mob/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell - if(!(src in user.spell_list)) + if(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.mob_spell_list)) user << "You shouldn't have this spell! Something's wrong." return 0 @@ -91,7 +91,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin return 0 else if(clothes_req || human_req) - user << "This spell can only be casted by humans!" + user << "This spell can only be cast by humans!" return 0 if(!skipcharge) @@ -298,3 +298,8 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin perform(targets) return + +/obj/effect/proc_holder/spell/proc/can_be_cast_by(mob/caster) + if((human_req || clothes_req) && !ishuman(caster)) + return 0 + return 1 \ No newline at end of file diff --git a/code/datums/spells/charge.dm b/code/datums/spells/charge.dm index 2d9f6776833..1584f1e32c8 100644 --- a/code/datums/spells/charge.dm +++ b/code/datums/spells/charge.dm @@ -22,9 +22,12 @@ var/obj/item/weapon/grab/G = item if(G.affecting) var/mob/M = G.affecting - if(M.spell_list.len != 0) - for(var/obj/effect/proc_holder/spell/S in M.spell_list) + if(M.mob_spell_list.len != 0 || (M.mind && M.mind.spell_list.len != 0)) + for(var/obj/effect/proc_holder/spell/S in M.mob_spell_list) S.charge_counter = S.charge_max + if(M.mind) + for(var/obj/effect/proc_holder/spell/S in M.mind.spell_list) + S.charge_counter = S.charge_max M <<"you feel raw magic flowing through you, it feels good!" else M <<"you feel very strange for a moment, but then it passes." diff --git a/code/datums/spells/construct_spells.dm b/code/datums/spells/construct_spells.dm index ed3248d776a..df7e30ca1b6 100644 --- a/code/datums/spells/construct_spells.dm +++ b/code/datums/spells/construct_spells.dm @@ -10,6 +10,7 @@ school = "conjuration" charge_max = 20 clothes_req = 0 + human_req = 0 invocation = "none" invocation_type = "none" range = 0 @@ -23,6 +24,7 @@ school = "conjuration" charge_max = 100 clothes_req = 0 + human_req = 0 invocation = "none" invocation_type = "none" range = 0 @@ -51,6 +53,7 @@ school = "conjuration" charge_max = 3000 clothes_req = 0 + human_req = 0 invocation = "none" invocation_type = "none" range = 0 @@ -65,6 +68,7 @@ school = "transmutation" charge_max = 300 clothes_req = 0 + human_req = 0 invocation = "none" invocation_type = "none" range = 0 @@ -79,6 +83,7 @@ school = "transmutation" charge_max = 200 clothes_req = 0 + human_req = 0 invocation = "none" invocation_type = "none" range = -1 @@ -106,6 +111,7 @@ school = "evocation" charge_max = 400 clothes_req = 0 + human_req = 0 invocation = "none" invocation_type = "none" proj_lifespan = 10 diff --git a/code/datums/spells/mind_transfer.dm b/code/datums/spells/mind_transfer.dm index e04ceda8ad3..418fa1c7085 100644 --- a/code/datums/spells/mind_transfer.dm +++ b/code/datums/spells/mind_transfer.dm @@ -54,11 +54,11 @@ Also, you never added distance checking after target is selected. I've went ahea //SPELL LOSS BEGIN //NOTE: The caster must ALWAYS keep mind transfer, even when other spells are lost. - var/obj/effect/proc_holder/spell/targeted/mind_transfer/m_transfer = locate() in user.spell_list//Find mind transfer directly. - var/list/checked_spells = user.spell_list + var/obj/effect/proc_holder/spell/targeted/mind_transfer/m_transfer = locate() in user.mind.spell_list//Find mind transfer directly. + var/list/checked_spells = user.mind.spell_list checked_spells -= m_transfer //Remove Mind Transfer from the list. - if(caster.spell_list.len)//If they have any spells left over after mind transfer is taken out. If they don't, we don't need this. + if(caster.mind.spell_list.len)//If they have any spells left over after mind transfer is taken out. If they don't, we don't need this. for(var/i=spell_loss_amount,(i>0&&checked_spells.len),i--)//While spell loss amount is greater than zero and checked_spells has spells in it, run this proc. for(var/j=checked_spells.len,(j>0&&checked_spells.len),j--)//While the spell list to check is greater than zero and has spells in it, run this proc. if(prob(base_spell_loss_chance)) @@ -70,7 +70,7 @@ Also, you never added distance checking after target is selected. I've went ahea base_spell_loss_chance += spell_loss_chance_modifier checked_spells += m_transfer//Add back Mind Transfer. - user.spell_list = checked_spells//Set user spell list to whatever the new list is. + user.mind.spell_list = checked_spells//Set user spell list to whatever the new list is. //SPELL LOSS END //MIND TRANSFER BEGIN @@ -83,10 +83,7 @@ Also, you never added distance checking after target is selected. I've went ahea victim.verbs -= V var/mob/dead/observer/ghost = victim.ghostize(0) - ghost.spell_list = victim.spell_list//If they have spells, transfer them. Now we basically have a backup mob. - caster.mind.transfer_to(victim) - victim.spell_list = caster.spell_list//Now they are inside the victim's body. if(victim.mind.special_verbs.len)//To add all the special verbs for the original caster. for(var/V in caster.mind.special_verbs)//Not too important but could come into play. @@ -94,7 +91,6 @@ Also, you never added distance checking after target is selected. I've went ahea ghost.mind.transfer_to(caster) caster.key = ghost.key //have to transfer the key since the mind was not active - caster.spell_list = ghost.spell_list if(caster.mind.special_verbs.len)//If they had any special verbs, we add them here. for(var/V in caster.mind.special_verbs) diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index 27b164554a3..fc4e93e61e5 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -60,21 +60,21 @@ M << "You are the [H.real_name]'s apprentice! You are bound by magic contract to follow their orders and help them in accomplishing their goals." switch(href_list["school"]) if("destruction") - M.spell_list += new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile(M) - M.spell_list += new /obj/effect/proc_holder/spell/dumbfire/fireball(M) + M.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile(M) + M.mind.spell_list += new /obj/effect/proc_holder/spell/dumbfire/fireball(M) M << "Your service has not gone unrewarded, however. Studying under [H.real_name], you have learned powerful, destructive spells. You are able to cast magic missile and fireball." if("bluespace") - M.spell_list += new /obj/effect/proc_holder/spell/targeted/area_teleport/teleport(M) - M.spell_list += new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(M) + M.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/area_teleport/teleport(M) + M.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(M) M << "Your service has not gone unrewarded, however. Studying under [H.real_name], you have learned reality bending mobility spells. You are able to cast teleport and ethereal jaunt." if("healing") - M.spell_list += new /obj/effect/proc_holder/spell/targeted/charge(M) - M.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/forcewall(M) + M.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/charge(M) + M.mind.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/forcewall(M) M.equip_to_slot_or_del(new /obj/item/weapon/gun/magic/staff/healing(M), slot_r_hand) M << "Your service has not gone unrewarded, however. Studying under [H.real_name], you have learned livesaving survival spells. You are able to cast charge and forcewall." if("robeless") - M.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/knock(M) - M.spell_list += new /obj/effect/proc_holder/spell/targeted/mind_transfer(M) + M.mind.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/knock(M) + M.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/mind_transfer(M) M << "Your service has not gone unrewarded, however. Studying under [H.real_name], you have learned stealthy, robeless spells. You are able to cast knock and mindswap." M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_ears) M.equip_to_slot_or_del(new /obj/item/clothing/under/lightpurple(M), slot_w_uniform) diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index f0fac633940..5bdf769fe61 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -154,7 +154,7 @@ */ var/list/available_spells = list(magicmissile = "Magic Missile", fireball = "Fireball", disintegrate = "Disintegrate", disabletech = "Disable Tech", smoke = "Smoke", blind = "Blind", mindswap = "Mind Transfer", forcewall = "Forcewall", blink = "Blink", teleport = "Teleport", mutate = "Mutate", etherealjaunt = "Ethereal Jaunt", knock = "Knock", horseman = "Curse of the Horseman", fleshtostone = "Flesh to Stone", summonguns = "Summon Guns", summonmagic = "Summon Magic", staffchange = "Staff of Change", soulstone = "Six Soul Stone Shards and the spell Artificer", armor = "Mastercrafted Armor Set", staffanimate = "Staff of Animation") var/already_knows = 0 - for(var/obj/effect/proc_holder/spell/aspell in H.spell_list) + for(var/obj/effect/proc_holder/spell/aspell in H.mind.spell_list) if(available_spells[href_list["spell_choice"]] == initial(aspell.name)) already_knows = 1 if(aspell.spell_level >= aspell.level_max) @@ -188,63 +188,63 @@ switch(href_list["spell_choice"]) if("magicmissile") feedback_add_details("wizard_spell_learned","MM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile(H) temp = "You have learned magic missile." if("fireball") feedback_add_details("wizard_spell_learned","FB") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/dumbfire/fireball(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/dumbfire/fireball(H) temp = "You have learned fireball." if("disintegrate") feedback_add_details("wizard_spell_learned","DG") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/inflict_handler/disintegrate(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/inflict_handler/disintegrate(H) temp = "You have learned disintegrate." if("disabletech") feedback_add_details("wizard_spell_learned","DT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/emplosion/disable_tech(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/emplosion/disable_tech(H) temp = "You have learned disable technology." if("smoke") feedback_add_details("wizard_spell_learned","SM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/smoke(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/smoke(H) temp = "You have learned smoke." if("blind") feedback_add_details("wizard_spell_learned","BD") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/trigger/blind(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/trigger/blind(H) temp = "You have learned blind." if("mindswap") feedback_add_details("wizard_spell_learned","MT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/mind_transfer(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/mind_transfer(H) temp = "You have learned mindswap." if("forcewall") feedback_add_details("wizard_spell_learned","FW") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/forcewall(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/forcewall(H) temp = "You have learned forcewall." if("blink") feedback_add_details("wizard_spell_learned","BL") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/turf_teleport/blink(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/turf_teleport/blink(H) temp = "You have learned blink." if("teleport") feedback_add_details("wizard_spell_learned","TP") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/area_teleport/teleport(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/area_teleport/teleport(H) temp = "You have learned teleport." if("mutate") feedback_add_details("wizard_spell_learned","MU") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/genetic/mutate(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/genetic/mutate(H) temp = "You have learned mutate." if("etherealjaunt") feedback_add_details("wizard_spell_learned","EJ") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(H) temp = "You have learned ethereal jaunt." if("knock") feedback_add_details("wizard_spell_learned","KN") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/knock(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/knock(H) temp = "You have learned knock." if("horseman") feedback_add_details("wizard_spell_learned","HH") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/horsemask(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/horsemask(H) temp = "You have learned curse of the horseman." if("fleshtostone") feedback_add_details("wizard_spell_learned","FS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells - H.spell_list += new /obj/effect/proc_holder/spell/targeted/inflict_handler/flesh_to_stone(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/inflict_handler/flesh_to_stone(H) temp = "You have learned flesh to stone." if("summonguns") feedback_add_details("wizard_spell_learned","SG") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells @@ -264,7 +264,7 @@ if("soulstone") feedback_add_details("wizard_spell_learned","SS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells new /obj/item/weapon/storage/belt/soulstone/full(get_turf(H)) - H.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/construct(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/construct(H) temp = "You have purchased a belt full of soulstones and have learned the artificer spell." max_uses-- if("armor") @@ -320,7 +320,7 @@ /obj/item/weapon/spellbook/oneuse/attack_self(mob/user as mob) var/obj/effect/proc_holder/spell/S = new spell - for(var/obj/effect/proc_holder/spell/knownspell in user.spell_list) + for(var/obj/effect/proc_holder/spell/knownspell in user.mind.spell_list) if(knownspell.type == S.type) if(user.mind) if(user.mind.special_role == "apprentice" || user.mind.special_role == "Wizard") @@ -331,7 +331,7 @@ if(used) recoil(user) else - user.spell_list += S + user.mind.spell_list += S user <<"you rapidly read through the arcane book. Suddenly you realize you understand [spellname]!" user.attack_log += text("\[[time_stamp()]\] [user.real_name] ([user.ckey]) learned the spell [spellname] ([S]).") onlearned(user) @@ -416,10 +416,8 @@ stored_swap.verbs -= V var/mob/dead/observer/ghost = stored_swap.ghostize(0) - ghost.spell_list = stored_swap.spell_list user.mind.transfer_to(stored_swap) - stored_swap.spell_list = user.spell_list if(stored_swap.mind.special_verbs.len) for(var/V in user.mind.special_verbs) @@ -427,7 +425,6 @@ ghost.mind.transfer_to(user) user.key = ghost.key - user.spell_list = ghost.spell_list if(user.mind.special_verbs.len) for(var/V in user.mind.special_verbs) diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index 5bbe1a8def6..11430663e72 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -246,12 +246,12 @@ else text += "
The wizard has failed!" feedback_add_details("wizard_success","FAIL") - if(wizard.current && wizard.current.spell_list) + if(wizard.spell_list.len>0) text += "
[wizard.name] used the following spells: " var/i = 1 - for(var/obj/effect/proc_holder/spell/S in wizard.current.spell_list) + for(var/obj/effect/proc_holder/spell/S in wizard.spell_list) text += "[S.name]" - if(wizard.current.spell_list.len > i) + if(wizard.spell_list.len > i) text += ", " i++ text += "
" @@ -263,7 +263,7 @@ //To batch-remove wizard spells. Linked to mind.dm. /mob/proc/spellremove(var/mob/M as mob) - for(var/obj/effect/proc_holder/spell/spell_to_remove in src.spell_list) + for(var/obj/effect/proc_holder/spell/spell_to_remove in src.mind.spell_list) del(spell_to_remove) /*Checks if the wizard can cast spells. diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm index 15e57b79563..165098e640d 100644 --- a/code/game/jobs/job/civilian.dm +++ b/code/game/jobs/job/civilian.dm @@ -242,8 +242,9 @@ H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack) H.equip_to_slot_or_del(new /obj/item/toy/crayon/mime(H), slot_in_backpack) H.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(H), slot_in_backpack) - H.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/mime_wall(H) - H.spell_list += new /obj/effect/proc_holder/spell/targeted/mime/speak(H) + if(H.mind) + H.mind.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/conjure/mime_wall(H) + H.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/mime/speak(H) H.miming = 1 H.rename_self("mime") return 1 diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index a098cf02d2c..e82c848274d 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -472,8 +472,9 @@ var/list/admin_verbs_hideable = list( set name = "Give Spell" set desc = "Gives a spell to a mob." var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spells - if(!S) return - T.spell_list += new S + if(!S || !T.mind) + return + T.mind.spell_list += new S feedback_add_details("admin_verb","GS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! log_admin("[key_name(usr)] gave [key_name(T)] the spell [S].") message_admins("\blue [key_name_admin(usr)] gave [key_name(T)] the spell [S].", 1) diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm index 47078644b3a..0866208d401 100644 --- a/code/modules/mob/living/simple_animal/constructs.dm +++ b/code/modules/mob/living/simple_animal/constructs.dm @@ -31,7 +31,7 @@ name = text("[initial(name)] ([rand(1, 1000)])") real_name = name for(var/spell in construct_spells) - spell_list += new spell(src) + mob_spell_list += new spell(src) /mob/living/simple_animal/construct/Die() ..() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index f6da8c3b022..1ae46ffe69c 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -670,8 +670,14 @@ note dizziness decrements automatically in the mob's Life() proc. continue statpanel(listed_turf.name, null, A) - if(spell_list.len) - for(var/obj/effect/proc_holder/spell/S in spell_list) + if(mind) + add_spells_to_statpanel(mind.spell_list) + add_spells_to_statpanel(mob_spell_list) + + +/mob/proc/add_spells_to_statpanel(var/list/spells) + for(var/obj/effect/proc_holder/spell/S in spells) + if(S.can_be_cast_by(src)) switch(S.charge_type) if("recharge") statpanel("[S.panel]","[S.charge_counter/10.0]/[S.charge_max/10]",S) @@ -680,8 +686,6 @@ note dizziness decrements automatically in the mob's Life() proc. if("holdervar") statpanel("[S.panel]","[S.holder_var_type] [S.holder_var_amount]",S) - - // facing verbs /mob/proc/canface() if(!canmove) return 0 diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index f5c8e414940..af27e924a14 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -131,8 +131,8 @@ //The last mob/living/carbon to push/drag/grab this mob (mostly used by slimes friend recognition) var/mob/living/carbon/LAssailant = null -//Wizard mode, but can be used in other modes thanks to the brand new "Give Spell" badmin button - var/list/spell_list = list() + + var/list/mob_spell_list = list() //only construct spells at the moment. //Changlings, but can be used in other modes // var/obj/effect/proc_holder/changpower/list/power_list = list() diff --git a/code/modules/projectiles/projectile/change.dm b/code/modules/projectiles/projectile/change.dm index 34c03d25919..ab19b3f2a22 100644 --- a/code/modules/projectiles/projectile/change.dm +++ b/code/modules/projectiles/projectile/change.dm @@ -96,9 +96,6 @@ else return - for (var/obj/effect/proc_holder/spell/S in M.spell_list) - new_mob.spell_list += new S.type - new_mob.a_intent = "harm" if(M.mind) M.mind.transfer_to(new_mob) diff --git a/code/modules/projectiles/projectile/magic.dm b/code/modules/projectiles/projectile/magic.dm index b7d19dea00d..1cbdcf674d5 100644 --- a/code/modules/projectiles/projectile/magic.dm +++ b/code/modules/projectiles/projectile/magic.dm @@ -190,9 +190,6 @@ proc/wabbajack(mob/living/M) else return - for (var/obj/effect/proc_holder/spell/S in M.spell_list) - new_mob.spell_list += new S.type - new_mob.attack_log = M.attack_log M.attack_log += text("\[[time_stamp()]\] [M.real_name] ([M.ckey]) became [new_mob.real_name].")