mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
Cleans up Vars
This commit is contained in:
+12
-9
@@ -1055,18 +1055,13 @@
|
||||
switch(href_list["shadowling"])
|
||||
if("clear")
|
||||
ticker.mode.update_shadow_icons_removed(src)
|
||||
current.spell_list.Cut()
|
||||
if(src in ticker.mode.shadows)
|
||||
ticker.mode.shadows -= src
|
||||
special_role = null
|
||||
to_chat(current, "<span class='userdanger'>Your powers have been quenched! You are no longer a shadowling!</span>")
|
||||
current.spell_list.Cut()
|
||||
if(current.mind)
|
||||
current.mind.spell_list.Cut()
|
||||
message_admins("[key_name_admin(usr)] has de-shadowlinged [current].")
|
||||
log_admin("[key_name(usr)] has de-shadowlinged [current].")
|
||||
remove_spell(/obj/effect/proc_holder/spell/targeted/shadowling_hatch)
|
||||
remove_spell(/obj/effect/proc_holder/spell/targeted/shadowling_ascend)
|
||||
current.spellremove(current)
|
||||
current.remove_language("Shadowling Hivemind")
|
||||
else if(src in ticker.mode.shadowling_thralls)
|
||||
ticker.mode.remove_thrall(src,0)
|
||||
@@ -1488,9 +1483,17 @@
|
||||
|
||||
return (duration <= world.time - brigged_since)
|
||||
|
||||
/datum/mind/proc/AddSpell(var/obj/effect/proc_holder/spell/spell)
|
||||
spell_list += spell
|
||||
spell.action.Grant(current)
|
||||
/datum/mind/proc/AddSpell(obj/effect/proc_holder/spell/S)
|
||||
spell_list += S
|
||||
S.action.Grant(current)
|
||||
|
||||
/datum/mind/proc/RemoveSpell(obj/effect/proc_holder/spell/spell) //To remove a specific spell from a mind
|
||||
if(!spell)
|
||||
return
|
||||
for(var/obj/effect/proc_holder/spell/S in spell_list)
|
||||
if(istype(S, spell))
|
||||
qdel(S)
|
||||
spell_list -= S
|
||||
|
||||
/datum/mind/proc/transfer_actions(var/mob/living/new_character)
|
||||
if(current && current.actions)
|
||||
|
||||
@@ -57,7 +57,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/living/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(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.spell_list))
|
||||
if(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.mob_spell_list))
|
||||
to_chat(user, "<span class='warning'>You shouldn't have this spell! Something's wrong.</span>")
|
||||
return 0
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
@@ -91,7 +91,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
|
||||
if(ishuman(user) && (invocation_type == "whisper" || invocation_type == "shout") && user.is_muzzled())
|
||||
to_chat(user, "Mmmf mrrfff!")
|
||||
return 0
|
||||
var/obj/effect/proc_holder/spell/noclothes/spell = locate() in (user.spell_list | (user.mind ? user.mind.spell_list : list()))
|
||||
var/obj/effect/proc_holder/spell/noclothes/spell = locate() in (user.mob_spell_list | (user.mind ? user.mind.spell_list : list()))
|
||||
if(clothes_req && !(spell && istype(spell)))//clothes check
|
||||
if(!istype(user, /mob/living/carbon/human))
|
||||
to_chat(user, "You aren't a human, Why are you trying to cast a human spell, silly non-human? Casting human spells is for humans.")
|
||||
@@ -360,7 +360,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
|
||||
return 1
|
||||
|
||||
/obj/effect/proc_holder/spell/proc/can_cast(mob/user = usr)
|
||||
if(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.spell_list))
|
||||
if(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.mob_spell_list))
|
||||
return 0
|
||||
|
||||
if(user.z == ZLEVEL_CENTCOMM && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel
|
||||
@@ -386,7 +386,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
|
||||
if((invocation_type == "whisper" || invocation_type == "shout") && H.is_muzzled())
|
||||
return 0
|
||||
|
||||
var/obj/effect/proc_holder/spell/noclothes/clothcheck = locate() in user.spell_list
|
||||
var/obj/effect/proc_holder/spell/noclothes/clothcheck = locate() in user.mob_spell_list
|
||||
var/obj/effect/proc_holder/spell/noclothes/clothcheck2 = locate() in user.mind.spell_list
|
||||
if(clothes_req && !(clothcheck && istype(clothcheck)) && !(clothcheck2 && istype(clothcheck2)))//clothes check
|
||||
if(!istype(H.wear_suit, /obj/item/clothing/suit/wizrobe) && !istype(H.wear_suit, /obj/item/clothing/suit/space/rig/wizard))
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
|
||||
if(L.pulling && (istype(L.pulling, /mob/living)))
|
||||
var/mob/living/M = L.pulling
|
||||
if(M.spell_list.len != 0 || (M.mind && M.mind.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)
|
||||
|
||||
@@ -19,19 +19,18 @@ Urist: I don't feel like figuring out how you store object spells so I'm leaving
|
||||
Make sure spells that are removed from spell_list are actually removed and deleted when mind transfering.
|
||||
Also, you never added distance checking after target is selected. I've went ahead and did that.
|
||||
*/
|
||||
/obj/effect/proc_holder/spell/targeted/mind_transfer/cast(list/targets,mob/user = usr)
|
||||
/obj/effect/proc_holder/spell/targeted/mind_transfer/cast(list/targets, mob/user = usr, distanceoverride)
|
||||
if(!targets.len)
|
||||
to_chat(user, "No mind found.")
|
||||
return
|
||||
|
||||
if(targets.len > 1)
|
||||
to_chat(user, "Too many minds! You're not a hive damnit!")//Whaa...aat?
|
||||
|
||||
return
|
||||
|
||||
var/mob/living/target = targets[1]
|
||||
|
||||
if(!(target in oview(range)))//If they are not in overview after selection. Do note that !() is necessary for in to work because ! takes precedence over it.
|
||||
if(!(target in oview(range)) && !distanceoverride)//If they are not in overview after selection. Do note that !() is necessary for in to work because ! takes precedence over it.
|
||||
to_chat(user, "They are too far away!")
|
||||
return
|
||||
|
||||
@@ -64,18 +63,16 @@ 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.
|
||||
caster.verbs += V
|
||||
|
||||
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(ghost.key)
|
||||
caster.key = ghost.key //have to transfer the key since the mind was not active
|
||||
qdel(ghost)
|
||||
|
||||
if(caster.mind.special_verbs.len)//If they had any special verbs, we add them here.
|
||||
for(var/V in caster.mind.special_verbs)
|
||||
|
||||
Reference in New Issue
Block a user