Cleans up Vars

This commit is contained in:
Fox-McCloud
2016-07-21 01:43:16 -04:00
parent 220b4294c6
commit 1ac09a962c
30 changed files with 161 additions and 285 deletions
+12 -9
View File
@@ -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)
+4 -4
View File
@@ -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))
+2 -2
View File
@@ -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)
+5 -8
View File
@@ -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)
+4 -4
View File
@@ -92,14 +92,14 @@
var/obj/effect/proc_holder/spell/spelltype
/datum/dna/gene/basic/grant_spell/activate(var/mob/M, var/connected, var/flags)
M.AddSpell(new spelltype(M))
M.AddSpell(new spelltype(null))
..()
return 1
/datum/dna/gene/basic/grant_spell/deactivate(var/mob/M, var/connected, var/flags)
for(var/obj/effect/proc_holder/spell/S in M.spell_list)
if(istype(S,spelltype))
M.spell_list.Remove(S)
for(var/obj/effect/proc_holder/spell/S in M.mob_spell_list)
if(istype(S, spelltype))
M.RemoveSpell(S)
..()
return 1
@@ -179,7 +179,7 @@
..()
if(M.mind)
M.bloodcrawl = 0
M.mind.remove_spell(/obj/effect/proc_holder/spell/bloodcrawl)
M.mind.RemoveSpell(/obj/effect/proc_holder/spell/bloodcrawl)
/obj/item/organ/internal/heart/demon/Stop()
return 0 // Always beating.
+6 -6
View File
@@ -132,7 +132,7 @@ Made by Xhuis
/datum/game_mode/proc/finalize_shadowling(var/datum/mind/shadow_mind)
var/mob/living/carbon/human/S = shadow_mind.current
shadow_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowling_hatch)
shadow_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowling_hatch(null))
spawn(0)
shadow_mind.current.add_language("Shadowling Hivemind")
update_shadow_icons_added(shadow_mind)
@@ -149,9 +149,9 @@ Made by Xhuis
update_shadow_icons_added(new_thrall_mind)
new_thrall_mind.current.attack_log += "\[[time_stamp()]\] <span class='danger'>Became a thrall</span>"
new_thrall_mind.current.add_language("Shadowling Hivemind")
new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/lesser_glare)
new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/lesser_shadow_walk)
new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_vision/thrall)
new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/lesser_glare(null))
new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/lesser_shadow_walk(null))
new_thrall_mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_vision/thrall(null))
to_chat(new_thrall_mind.current, "<span class='shadowling'><b>You see the truth. Reality has been torn away and you realize what a fool you've been.</b></span>")
to_chat(new_thrall_mind.current, "<span class='shadowling'><b>The shadowlings are your masters.</b> Serve them above all else and ensure they complete their goals.</span>")
to_chat(new_thrall_mind.current, "<span class='shadowling'>You may not harm other thralls or the shadowlings. However, you do not need to obey other thralls.</span>")
@@ -171,7 +171,7 @@ Made by Xhuis
thrall_mind.special_role = null
update_shadow_icons_removed(thrall_mind)
for(var/obj/effect/proc_holder/spell/S in thrall_mind.spell_list)
thrall_mind.remove_spell(S)
thrall_mind.RemoveSpell(S)
thrall_mind.current.remove_language("Shadowling Hivemind")
if(kill && ishuman(thrall_mind.current)) //If dethrallization surgery fails, kill the mob as well as dethralling them
var/mob/living/carbon/human/H = thrall_mind.current
@@ -215,7 +215,7 @@ Made by Xhuis
ling_mind.current.attack_log += "\[[time_stamp()]\] <span class='danger'>Deshadowlinged</span>"
ling_mind.special_role = null
for(var/obj/effect/proc_holder/spell/S in ling_mind.spell_list)
ling_mind.remove_spell(S)
ling_mind.RemoveSpell(S)
var/mob/living/M = ling_mind.current
if(issilicon(M))
M.audible_message("<span class='notice'>[M] lets out a short blip.</span>", \
@@ -438,24 +438,24 @@
if(thralls >= 3 && !screech_acquired)
screech_acquired = 1
to_chat(user, "<span class='shadowling'><i>The power of your thralls has granted you the <b>Sonic Screech</b> ability. This ability will shatter nearby windows and deafen enemies, plus stunning silicon lifeforms.</span>")
user.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/unearthly_screech)
user.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/unearthly_screech(null))
if(thralls >= 5 && !blind_smoke_acquired)
blind_smoke_acquired = 1
to_chat(user, "<span class='shadowling'><i>The power of your thralls has granted you the <b>Blinding Smoke</b> ability. \
It will create a choking cloud that will blind any non-thralls who enter.</i></span>")
user.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/blindness_smoke)
user.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/blindness_smoke(null))
if(thralls >= 7 && !drainLifeAcquired)
drainLifeAcquired = 1
to_chat(user, "<span class='shadowling'><i>The power of your thralls has granted you the <b>Drain Life</b> ability. You can now drain the health of nearby humans to heal yourself.</i></span>")
user.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/drainLife)
user.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/drainLife(null))
if(thralls >= 9 && !reviveThrallAcquired)
reviveThrallAcquired = 1
to_chat(user, "<span class='shadowling'><i>The power of your thralls has granted you the <b>Black Recuperation</b> ability. \
This will, after a short time, bring a dead thrall completely back to life with no bodily defects.</i></span>")
user.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/reviveThrall)
user.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/reviveThrall(null))
if(thralls < victory_threshold)
to_chat(user, "<span class='shadowling'>You do not have the power to ascend. You require [victory_threshold] thralls, but only [thralls] living thralls are present.</span>")
@@ -469,8 +469,8 @@
if(CM in M.mind.spell_list)
M.mind.spell_list -= CM
qdel(CM)
M.mind.remove_spell(/obj/effect/proc_holder/spell/targeted/shadowling_hatch)
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowling_ascend)
M.mind.RemoveSpell(/obj/effect/proc_holder/spell/targeted/shadowling_hatch)
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowling_ascend(null))
if(M == usr)
to_chat(M, "<span class='shadowling'><i>You project this power to the rest of the shadowlings.</i></span>")
else
@@ -674,10 +674,10 @@
"<span class='shadowling'><b>You feel new power flow into you. You have been gifted by your masters. You now closely resemble them. You are empowered in \
darkness but wither slowly in light. In addition, Lesser Glare and Guise have been upgraded into their true forms.</b></span>")
thrallToRevive.set_species("Lesser Shadowling")
thrallToRevive.mind.remove_spell(/obj/effect/proc_holder/spell/targeted/lesser_glare)
thrallToRevive.mind.remove_spell(/obj/effect/proc_holder/spell/targeted/lesser_shadow_walk)
thrallToRevive.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/glare)
thrallToRevive.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_walk)
thrallToRevive.mind.RemoveSpell(/obj/effect/proc_holder/spell/targeted/lesser_glare)
thrallToRevive.mind.RemoveSpell(/obj/effect/proc_holder/spell/targeted/lesser_shadow_walk)
thrallToRevive.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/glare(null))
thrallToRevive.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_walk(null))
if("Revive")
if(!is_thrall(thrallToRevive))
to_chat(usr, "<span class='warning'>[thrallToRevive] is not a thrall.</span>")
@@ -92,19 +92,19 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/shadowling(usr), slot_glasses)
H.set_species("Shadowling") //can't be a shadowling without being a shadowling
H.mind.remove_spell(src)
H.mind.RemoveSpell(src)
sleep(10)
to_chat(H, "<span class='shadowling'><b><i>Your powers are awoken. You may now live to your fullest extent. Remember your goal. Cooperate with your thralls and allies.</b></i></span>")
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_vision)
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/enthrall)
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/glare)
H.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/veil)
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_walk)
H.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/flashfreeze)
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/collective_mind)
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowling_regenarmor)
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowling_extend_shuttle)
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_vision(null))
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/enthrall(null))
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/glare(null))
H.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/veil(null))
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadow_walk(null))
H.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/flashfreeze(null))
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/collective_mind(null))
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowling_regenarmor(null))
H.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowling_extend_shuttle(null))
/obj/effect/proc_holder/spell/targeted/shadowling_ascend
name = "Ascend"
@@ -162,15 +162,15 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N
var/mob/A = new /mob/living/simple_animal/ascendant_shadowling(H.loc)
for(var/obj/effect/proc_holder/spell/S in H.mind.spell_list)
if(S == src) continue
H.mind.remove_spell(S)
H.mind.RemoveSpell(S)
H.mind.transfer_to(A)
A.name = H.real_name
A.languages = H.languages
A.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/annihilate)
A.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/hypnosis)
A.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowling_phase_shift)
A.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/ascendant_storm)
A.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowlingAscendantTransmit)
A.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/annihilate(null))
A.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/hypnosis(null))
A.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowling_phase_shift(null))
A.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/ascendant_storm(null))
A.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/shadowlingAscendantTransmit(null))
if(A.real_name)
A.real_name = H.real_name
H.invisibility = 60 //This is pretty bad, but is also necessary for the shuttle call to function properly
@@ -179,5 +179,5 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N
if(!ticker.mode.shadowling_ascended)
shuttle_master.emergency.request(null, 0.3)
ticker.mode.shadowling_ascended = 1
A.mind.remove_spell(src)
A.mind.RemoveSpell(src)
qdel(H)
+8 -8
View File
@@ -59,21 +59,21 @@
to_chat(M, "<B>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.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile(M))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/dumbfire/fireball(M))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile(null))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/dumbfire/fireball(null))
to_chat(M, "<B>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.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/area_teleport/teleport(M))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(M))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/area_teleport/teleport(null))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(null))
to_chat(M, "<B>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.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/charge(M))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/conjure/forcewall(M))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/charge(null))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/conjure/forcewall(null))
M.equip_to_slot_or_del(new /obj/item/weapon/gun/magic/staff/healing(M), slot_r_hand)
to_chat(M, "<B>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.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/knock(M))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/mind_transfer(M))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/knock(null))
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/mind_transfer(null))
to_chat(M, "<B>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_l_ear)
+7 -30
View File
@@ -684,9 +684,9 @@
/obj/item/weapon/spellbook/oneuse/Initialize() //No need to init
return
/obj/item/weapon/spellbook/oneuse/attack_self(mob/user as mob)
/obj/item/weapon/spellbook/oneuse/attack_self(mob/user)
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")
@@ -703,10 +703,10 @@
onlearned(user)
/obj/item/weapon/spellbook/oneuse/proc/recoil(mob/user as mob)
/obj/item/weapon/spellbook/oneuse/proc/recoil(mob/user)
user.visible_message("<span class='warning'>[src] glows in a black light!</span>")
/obj/item/weapon/spellbook/oneuse/proc/onlearned(mob/user as mob)
/obj/item/weapon/spellbook/oneuse/proc/onlearned(mob/user)
used = 1
user.visible_message("<span class='caution'>[src] glows dark for a second!</span>")
@@ -762,7 +762,7 @@
name = "spellbook of [spellname]" //Note, desc doesn't change by design
..()
/obj/item/weapon/spellbook/oneuse/mindswap/recoil(mob/user as mob)
/obj/item/weapon/spellbook/oneuse/mindswap/recoil(mob/user)
..()
if(stored_swap in dead_mob_list)
stored_swap = null
@@ -774,31 +774,8 @@
to_chat(user, "<span class='notice'>You stare at the book some more, but there doesn't seem to be anything else to learn...</span>")
return
if(user.mind.special_verbs.len)
for(var/V in user.mind.special_verbs)
user.verbs -= V
if(stored_swap.mind.special_verbs.len)
for(var/V in stored_swap.mind.special_verbs)
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)
user.verbs += V
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)
user.verbs += V
var/obj/effect/proc_holder/spell/targeted/mind_transfer/swapper = new
swapper.cast(user, stored_swap, 1)
to_chat(stored_swap, "<span class='warning'>You're suddenly somewhere else... and someone else?!</span>")
to_chat(user, "<span class='warning'>Suddenly you're staring at [src] again... where are you, who are you?!</span>")
+7 -8
View File
@@ -240,20 +240,19 @@
//OTHER PROCS
//To batch-remove wizard spells. Linked to mind.dm.
//To batch-remove wizard spells. Linked to mind.dm
/mob/proc/spellremove(mob/M)
if(!mind)
return
for(var/obj/effect/proc_holder/spell/spell_to_remove in src.mind.spell_list)
for(var/obj/effect/proc_holder/spell/spell_to_remove in mind.spell_list)
qdel(spell_to_remove)
mind.spell_list -= spell_to_remove
/datum/mind/proc/remove_spell(var/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
//To batch-remove mob spells.
/mob/proc/mobspellremove(mob/M)
for(var/obj/effect/proc_holder/spell/spell_to_remove in mob_spell_list)
qdel(spell_to_remove)
mob_spell_list -= spell_to_remove
/*Checks if the wizard can cast spells.
Made a proc so this is not repeated 14 (or more) times.*/
+1 -1
View File
@@ -36,7 +36,7 @@ var/list/image/ghost_darkness_images = list() //this is a list of images for thi
verbs += /mob/dead/observer/proc/dead_tele
// Our new boo spell.
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/boo(src))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/boo(null))
can_reenter_corpse = flags & GHOST_CAN_REENTER
started_as_observer = flags & GHOST_IS_OBSERVER
@@ -59,7 +59,7 @@
blinded = 1
silent = 0
else //ALIVE. LIGHTS ARE ON
if(health < config.health_threshold_dead || brain_op_stage == 4.0)
if(health < config.health_threshold_dead || !get_int_organ(/obj/item/organ/internal/brain))
death()
blinded = 1
stat = DEAD
@@ -88,37 +88,4 @@
icon_state = "queen_s"
for(var/image/I in overlays_standing)
overlays += I
/*
/mob/living/carbon/alien/humanoid/queen/verb/evolve() // -- TLE
set name = "Evolve (1000)"
set desc = "The ultimate transformation. Become an alien Empress. Only one empress can exist at a time."
set category = "Alien"
if(powerc(1000))
// Queen check
var/no_queen = 1
for(var/mob/living/carbon/alien/humanoid/empress/E in living_mob_list)
if(!E.key && E.brain_op_stage != 4)
continue
no_queen = 0
if(no_queen)
adjustToxLoss(-1000)
to_chat(src, "<span class='noticealien'>You begin to evolve!</span>")
for(var/mob/O in viewers(src, null))
O.show_message(text("<span class='alertalien'>[src] begins to twist and contort!</span>"), 1)
var/mob/living/carbon/alien/humanoid/empress/new_xeno = new(loc)
if(mind)
mind.transfer_to(new_xeno)
else
new_xeno.key = key
new_xeno.mind.name = new_xeno.name
qdel(src)
else
to_chat(src, "<span class='notice'>We already have an alive empress.</span>")
return
*/
overlays += I
@@ -19,7 +19,7 @@
blinded = 1
silent = 0
else //ALIVE. LIGHTS ARE ON
if(health < -25 || brain_op_stage == 4.0)
if(health < -25 || !get_int_organ(/obj/item/organ/internal/brain))
death()
blinded = 1
silent = 0
@@ -183,7 +183,6 @@
src.brainmob.container = src
src.brainmob.stat = 0
src.brainmob.silent = 0
src.brainmob.brain_op_stage = 4.0
dead_mob_list -= src.brainmob
..()
@@ -1,15 +1,12 @@
/mob/living/carbon/
/mob/living/carbon
gender = MALE
hud_possible = list(HEALTH_HUD,STATUS_HUD,SPECIALROLE_HUD)
var/list/stomach_contents = list()
var/list/internal_organs = list()
var/brain_op_stage = 0.0
var/antibodies = 0
var/last_eating = 0 //Not sure what this does... I found it hidden in food.dm
var/life_tick = 0 // The amount of life ticks that have processed on this mob.
var/analgesic = 0 // when this is set, the mob isn't affected by shock or pain
// life should decrease this by 1 every tick
// total amount of wounds on mob, used to spread out healing and the like over all wounds
var/number_wounds = 0
var/obj/item/handcuffed = null //Whether or not the mob is handcuffed
+4 -5
View File
@@ -816,9 +816,6 @@
handle_organs()
handle_blood()
//the analgesic effect wears off slowly
analgesic = max(0, analgesic - 1)
if(paralysis)
blinded = 1
stat = UNCONSCIOUS
@@ -987,8 +984,10 @@
/mob/living/carbon/human/handle_shock()
..()
if(status_flags & GODMODE) return 0 //godmode
if(analgesic || (species && species.flags & NO_PAIN)) return // analgesic avoids all traumatic shock temporarily
if(status_flags & GODMODE)
return 0 //godmode
if(species && species.flags & NO_PAIN)
return
if(health <= config.health_threshold_softcrit)// health 0 makes you immediately collapse
shock_stage = max(shock_stage, 61)
@@ -615,25 +615,22 @@
/datum/species/proc/handle_hud_icons(mob/living/carbon/human/H)
if(H.healths)
if(H.analgesic)
H.healths.icon_state = "health_health_numb"
if(H.stat == DEAD)
H.healths.icon_state = "health7"
else
if(H.stat == DEAD)
H.healths.icon_state = "health7"
else
switch(H.hal_screwyhud)
if(1) H.healths.icon_state = "health6"
if(2) H.healths.icon_state = "health7"
if(5) H.healths.icon_state = "health0"
else
switch(100 - ((flags & NO_PAIN) ? 0 : H.traumatic_shock) - H.staminaloss)
if(100 to INFINITY) H.healths.icon_state = "health0"
if(80 to 100) H.healths.icon_state = "health1"
if(60 to 80) H.healths.icon_state = "health2"
if(40 to 60) H.healths.icon_state = "health3"
if(20 to 40) H.healths.icon_state = "health4"
if(0 to 20) H.healths.icon_state = "health5"
else H.healths.icon_state = "health6"
switch(H.hal_screwyhud)
if(1) H.healths.icon_state = "health6"
if(2) H.healths.icon_state = "health7"
if(5) H.healths.icon_state = "health0"
else
switch(100 - ((flags & NO_PAIN) ? 0 : H.traumatic_shock) - H.staminaloss)
if(100 to INFINITY) H.healths.icon_state = "health0"
if(80 to 100) H.healths.icon_state = "health1"
if(60 to 80) H.healths.icon_state = "health2"
if(40 to 60) H.healths.icon_state = "health3"
if(20 to 40) H.healths.icon_state = "health4"
if(0 to 20) H.healths.icon_state = "health5"
else H.healths.icon_state = "health6"
if(H.healthdoll)
H.healthdoll.overlays.Cut()
-2
View File
@@ -16,8 +16,6 @@
src.traumatic_shock -= R.shock_reduction // now you too can varedit cyanide to reduce shock by 1000 - Iamgoofball
if(src.slurring)
src.traumatic_shock -= 10
if(src.analgesic)
src.traumatic_shock = 0
// broken or ripped off organs will add quite a bit of pain
if(istype(src,/mob/living/carbon/human))
@@ -33,8 +33,9 @@
if(default_spells.len)
for(var/spell in default_spells)
var/obj/effect/proc_holder/spell/S = spell
if(!S) return
H.AddSpell(new S)
if(!S)
return
H.mind.AddSpell(new S(null))
/datum/superheroes/proc/assign_id(var/mob/living/carbon/human/H)
var/obj/item/weapon/card/id/syndicate/W = new(H)
+5 -11
View File
@@ -7,10 +7,10 @@
//Damage related vars, NOTE: THESE SHOULD ONLY BE MODIFIED BY PROCS
var/bruteloss = 0.0 //Brutal damage caused by brute force (punching, being clubbed by a toolbox ect... this also accounts for pressure damage)
var/oxyloss = 0.0 //Oxygen depravation damage (no air in lungs)
var/toxloss = 0.0 //Toxic damage caused by being poisoned or radiated
var/fireloss = 0.0 //Burn damage caused by being way too hot, too cold or burnt.
var/bruteloss = 0 //Brutal damage caused by brute force (punching, being clubbed by a toolbox ect... this also accounts for pressure damage)
var/oxyloss = 0 //Oxygen depravation damage (no air in lungs)
var/toxloss = 0 //Toxic damage caused by being poisoned or radiated
var/fireloss = 0 //Burn damage caused by being way too hot, too cold or burnt.
var/cloneloss = 0 //Damage caused by being cloned or ejected from the cloner early. slimes also deal cloneloss damage to victims
var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot.
var/staminaloss = 0 //Stamina damage, or exhaustion. You recover it slowly naturally, and are stunned if it gets too high. Holodeck and hallucinations deal this.
@@ -23,11 +23,6 @@
//Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects.
var/incorporeal_move = 0 //0 is off, 1 is normal, 2 is for ninjas.
var/t_plasma = null
var/t_oxygen = null
var/t_sl_gas = null
var/t_n2 = null
var/now_pushing = null
var/atom/movable/cameraFollow = null
@@ -36,9 +31,8 @@
var/fire_stacks = 0 //Tracks how many stacks of fire we have on, max is usually 20
var/update_slimes = 1
var/specialsauce = 0 //Has this person consumed enough special sauce? IF so they're a ticking time bomb of death.
var/implanting = 0 //Used for the mind-slave implant
var/silent = null //Can't talk. Value goes down every life proc.
var/silent = 0 //Can't talk. Value goes down every life proc. //NOTE TO FUTURE CODERS: DO NOT INITIALIZE NUMERICAL VARS AS NULL OR I WILL MURDER YOU.
var/floating = 0
var/nightvision = 0
@@ -27,7 +27,7 @@
name = text("[initial(name)] ([rand(1, 1000)])")
real_name = name
for(var/spell in construct_spells)
AddSpell(new spell(src))
AddSpell(new spell(null))
updateglow()
/mob/living/simple_animal/construct/death()
@@ -52,9 +52,9 @@
/mob/living/simple_animal/hostile/statue/New(loc, var/mob/living/creator)
..()
// Give spells
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/flicker_lights(src))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/blindness(src))
AddSpell(new /obj/effect/proc_holder/spell/targeted/night_vision(src))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/flicker_lights(null))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/blindness(null))
AddSpell(new /obj/effect/proc_holder/spell/targeted/night_vision(null))
// Give nightvision
see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING
+15 -18
View File
@@ -6,6 +6,7 @@
hud_used = null
if(mind && mind.current == src)
spellremove(src)
mobspellremove(src)
for(var/infection in viruses)
qdel(infection)
ghostize()
@@ -158,8 +159,6 @@
/mob/proc/Life()
// handle_typing_indicator()
// if(organStructure)
// organStructure.ProcessOrgans()
return
@@ -960,8 +959,8 @@ var/list/slot_equipment_priority = list( \
if(mind && mind.changeling)
add_stings_to_statpanel(mind.changeling.purchasedpowers)
if(spell_list && spell_list.len)
for(var/obj/effect/proc_holder/spell/S in spell_list)
if(mob_spell_list && mob_spell_list.len)
for(var/obj/effect/proc_holder/spell/S in mob_spell_list)
add_spell_to_statpanel(S)
if(mind && istype(src, /mob/living) && mind.spell_list && mind.spell_list.len)
for(var/obj/effect/proc_holder/spell/S in mind.spell_list)
@@ -994,6 +993,7 @@ var/list/slot_equipment_priority = list( \
for(var/obj/effect/proc_holder/changeling/S in stings)
if(S.chemical_cost >=0 && S.can_be_used_by(src))
statpanel("[S.panel]",((S.chemical_cost > 0) ? "[S.chemical_cost]" : ""),S)
/mob/proc/add_spell_to_statpanel(var/obj/effect/proc_holder/spell/S)
switch(S.charge_type)
if("recharge")
@@ -1002,17 +1002,6 @@ var/list/slot_equipment_priority = list( \
statpanel(S.panel,"[S.charge_counter]/[S.charge_max]",S)
if("holdervar")
statpanel(S.panel,"[S.holder_var_type] [S.holder_var_amount]",S)
/* // Why have a duplicate set of turfs in the stat panel?
if(listed_turf)
if(get_dist(listed_turf,src) > 1)
listed_turf = null
else
statpanel(listed_turf.name,listed_turf.name,listed_turf)
for(var/atom/A in listed_turf)
if(A.invisibility > see_invisible)
continue
statpanel(listed_turf.name,A.name,A)
*/
// facing verbs
@@ -1366,9 +1355,17 @@ mob/proc/yank_out_object()
/mob/proc/setEarDamage()
return
/mob/proc/AddSpell(var/obj/effect/proc_holder/spell/spell)
spell_list += spell
spell.action.Grant(src)
/mob/proc/AddSpell(obj/effect/proc_holder/spell/S)
mob_spell_list += S
S.action.Grant(src)
/mob/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 mob_spell_list)
if(istype(S, spell))
qdel(S)
mob_spell_list -= S
//override to avoid rotating pixel_xy on mobs
/mob/shuttleRotate(rotation)
+23 -41
View File
@@ -2,15 +2,11 @@
density = 1
layer = 4.0
animate_movement = 2
// flags = NOREACT
pressure_resistance = 8
var/datum/mind/mind
var/stat = 0 //Whether a mob is alive or dead. TODO: Move this to living - Nodrak
//Not in use yet
var/obj/effect/organstructure/organStructure = null
var/obj/screen/hands = null
var/obj/screen/pullin = null
var/obj/screen/i_select = null
@@ -34,11 +30,9 @@
var/lastattacker = null
var/lastattacked = null
var/attack_log = list( )
var/already_placed = 0.0
var/obj/machinery/machine = null
var/other_mobs = null
var/memory = ""
var/poll_answer = 0.0
var/sdisabilities = 0 //Carbon
var/disabilities = 0 //Carbon
var/atom/movable/pulling = null
@@ -46,12 +40,12 @@
var/notransform = null //Carbon
var/other = 0.0
var/hand = null
var/eye_blind = null //Carbon
var/eye_blurry = null //Carbon
var/ear_deaf = null //Carbon
var/ear_damage = null //Carbon
var/stuttering = null //Carbon
var/slurring = null //Carbon
var/eye_blind = 0 //Carbon
var/eye_blurry = 0 //Carbon
var/ear_deaf = 0 //Carbon
var/ear_damage = 0 //Carbon
var/stuttering = 0 //Carbon
var/slurring = 0 //Carbon
var/real_name = null
var/flavor_text = ""
var/med_record = ""
@@ -63,8 +57,6 @@
var/druggy = 0 //Carbon
var/confused = 0 //Carbon
var/drunk = 0
var/antitoxs = null
var/plasma = null
var/sleeping = 0 //Carbon
var/resting = 0 //Carbon
var/lying = 0
@@ -95,11 +87,11 @@
var/nutrition = 400.0//Carbon
var/overeatduration = 0 // How long this guy is overeating //Carbon
var/paralysis = 0.0
var/stunned = 0.0
var/weakened = 0.0
var/paralysis = 0
var/stunned = 0
var/weakened = 0
var/slowed = 0
var/losebreath = 0.0//Carbon
var/losebreath = 0 //Carbon
var/intent = null//Living
var/shakecamera = 0
var/a_intent = I_HELP//Living
@@ -123,8 +115,8 @@
var/research_scanner = 0 //For research scanner equipped mobs. Enable to show research data when examining.
var/list/grabbed_by = list( )
var/list/requests = list( )
var/list/grabbed_by = list()
var/list/requests = list()
var/list/mapobjs = list()
@@ -134,17 +126,10 @@
var/emote_cd = 0 // Used to supress emote spamming. 1 if on CD, 2 if disabled by admin (manually set), else 0
var/music_lastplayed = "null"
var/job = null//Living
var/const/blindness = 1//Carbon
var/const/deafness = 2//Carbon
var/const/muteness = 4//Carbon
var/datum/dna/dna = null//Carbon
var/radiation = 0.0//Carbon
var/radiation = 0 //Carbon
var/list/mutations = list() //Carbon -- Doohl
//see: setup.dm for list of mutations
@@ -157,24 +142,24 @@
var/has_enabled_antagHUD = 0
var/antagHUD = 0
//Generic list for proc holders. Only way I can see to enable certain verbs/procs. Should be modified if needed.
var/proc_holder_list[] = list()//Right now unused.
//Also unlike the spell list, this would only store the object in contents, not an object in itself.
/* Add this line to whatever stat module you need in order to use the proc holder list.
//Generic list for proc holders. Only way I can see to enable certain verbs/procs. Should be modified if needed.
var/proc_holder_list[] = list()
/* //Also unlike the spell list, this would only store the object in contents, not an object in itself.
Add this line to whatever stat module you need in order to use the proc holder list.
Unlike the object spell system, it's also possible to attach verb procs from these objects to right-click menus.
This requires creating a verb for the object proc holder.
if(proc_holder_list.len)//Generic list for proc_holder objects.
for(var/obj/effect/proc_holder/P in proc_holder_list)
statpanel("[P.panel]","",P)
*/
statpanel("[P.panel]","",P)*/
//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/obj/effect/proc_holder/spell/list/spell_list = list()
var/list/mob_spell_list = list() //construct spells and mime spells. Spells that do not transfer from one mob to another and can not be lost in mindswap.
//Changlings, but can be used in other modes
// var/obj/effect/proc_holder/changpower/list/power_list = list()
@@ -195,9 +180,6 @@
var/has_unlimited_silicon_privilege = 0 // Can they interact with station electronics
var/list/radar_blips = list() // list of screen objects, radar blips
var/radar_open = 0 // nonzero is radar is open
var/atom/movable/remote_control //Calls relaymove() to whatever it is
var/remote_view = 0 // Set to 1 to prevent view resets on Life
@@ -219,11 +201,11 @@
var/turf/listed_turf = null //the current turf being examined in the stat panel
var/list/shouldnt_see = list(/atom/movable/lighting_overlay) //list of objects that this mob shouldn't see in the stat panel. this silliness is needed because of AI alt+click and cult blood runes
var/kills=0
var/kills = 0
var/stance_damage = 0 //Whether this mob's ability to stand has been affected
var/list/active_genes=list()
var/list/active_genes = list()
var/last_movement = -100 // Last world.time the mob actually moved of its own accord.
+3 -3
View File
@@ -4,9 +4,9 @@
/mob/spirit/mask/New()
..()
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/conjure/create_talisman(src))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/blood_speech(src))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/shatter_lights(src))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/conjure/create_talisman(null))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/blood_speech(null))
AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/shatter_lights(null))
/mob/spirit/mask/verb/go_to_follower()
-6
View File
@@ -12,8 +12,6 @@ mob/living/carbon/proc/pain(var/partname, var/amount, var/force, var/burning = 0
return
if(reagents.has_reagent("hydrocodone"))
return
if(analgesic)
return
if(world.time < next_pain_time && !force)
return
if(amount > 10 && istype(src,/mob/living/carbon/human))
@@ -55,8 +53,6 @@ mob/living/carbon/human/proc/custom_pain(var/message, var/flash_strength)
return
if(reagents.has_reagent("hydrocodone"))
return
if(analgesic)
return
var/msg = "\red <b>[message]</b>"
if(flash_strength >= 1)
msg = "\red <font size=3><b>[message]</b></font>"
@@ -94,8 +90,6 @@ mob/living/carbon/human/proc/handle_pain()
return
if(reagents.has_reagent("hydrocodone"))
return
if(analgesic)
return
var/maxdam = 0
var/obj/item/organ/external/damaged_organ = null
for(var/obj/item/organ/external/E in organs)
-25
View File
@@ -282,31 +282,6 @@ var/world_topic_spam_protect_time = world.timeofday
sleep_check = world.timeofday
waiting++
//#undef INACTIVITY_KICK
/*
#define DISCONNECTED_DELETE 6000 //10 minutes in ticks (approx)
/world/proc/KickDisconnectedClients()
spawn(-1)
//set background = 1
while(1)
sleep(DISCONNECTED_DELETE)
for(var/mob/living/carbon/human/C in living_mob_list)
if(dd_hasprefix(C.key,@)) return
if(!C.client && C.brain_op_stage!=4.0 && C.lastKnownIP)
sleep(600)
if(!C.client && C.stat != DEAD && C.brain_op_stage!=4.0)
job_master.FreeRole(C.job)
message_admins("[key_name_admin(C)], the [C.job] has been freed due to (<font color='#ffcc00'><b>Client disconnect for 10 minutes</b></font>)\n")
for(var/obj/item/W in C)
C.unEquip(W)
del(C)
else if(!C.key && C.stat != DEAD && C.brain_op_stage!=4.0)
job_master.FreeRole(C.job)
message_admins("[key_name_admin(C)], the [C.job] has been freed due to (<font color='#ffcc00'><b>Client quit BYOND</b></font>)\n")
for(var/obj/item/W in C)
C.unEquip(W)
del(C)
#undef INACTIVITY_KICK
*/
/hook/startup/proc/loadMode()
world.load_mode()