Makes user explicit in spell code

This commit is contained in:
AnturK
2015-11-28 12:35:40 +01:00
parent e715e1cc57
commit 9fd9e5c21d
24 changed files with 256 additions and 257 deletions
+16 -10
View File
@@ -41,6 +41,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
var/spell_level = 0 //if a spell can be taken multiple times, this raises
var/level_max = 4 //The max possible level_max is 4
var/cooldown_min = 0 //This defines what spell quickened four times has as a cooldown. Make sure to set this for every spell
var/player_lock = 1 //If it can be used by simple mobs
var/overlay = 0
var/overlay_icon = 'icons/obj/wizard.dmi'
@@ -62,9 +63,13 @@ 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(((!user.mind) || !(src in user.mind.spell_list)) && !(src in user.mob_spell_list))
user << "<span class='warning'>You shouldn't have this spell! Something's wrong.</span>"
return 0
if(player_lock)
if(!user.mind || !(src in user.mind.spell_list) && !(src in user.mob_spell_list))
user << "<span class='warning'>You shouldn't have this spell! Something's wrong.</span>"
return 0
else
if(!(src in user.mob_spell_list))
return 0
if(user.z == ZLEVEL_CENTCOM && !centcom_cancast) //Certain spells are not allowed on the centcom zlevel
return 0
@@ -170,8 +175,9 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
/obj/effect/proc_holder/spell/proc/perform(list/targets, recharge = 1, mob/user = usr) //if recharge is started is important for the trigger spells
before_cast(targets)
invocation()
user.attack_log += text("\[[time_stamp()]\] <span class='danger'>[user.real_name] ([user.ckey]) cast the spell [name].</span>")
invocation(user)
if(user.ckey)
user.attack_log += text("\[[time_stamp()]\] <span class='danger'>[user.real_name] ([user.ckey]) cast the spell [name].</span>")
spawn(0)
if(charge_type == "recharge" && recharge)
start_recharge()
@@ -180,7 +186,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
if(prob(critfailchance))
critfail(targets)
else
cast(targets)
cast(targets,user=user)
after_cast(targets)
/obj/effect/proc_holder/spell/proc/before_cast(list/targets)
@@ -227,7 +233,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
smoke.start()
/obj/effect/proc_holder/spell/proc/cast(list/targets)
/obj/effect/proc_holder/spell/proc/cast(list/targets,mob/user = usr)
return
/obj/effect/proc_holder/spell/proc/critfail(list/targets)
@@ -334,7 +340,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
revert_cast(user)
return
perform(targets)
perform(targets,user=user)
return
@@ -349,7 +355,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
revert_cast()
return
perform(targets)
perform(targets,user=user)
return
@@ -418,7 +424,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
if(!user)
revert_cast()
return
perform(user)
perform(null,user=user)
/obj/effect/proc_holder/spell/self/basic_heal //This spell exists mainly for debugging purposes, and also to show how casting works
name = "Lesser Heal"
+9 -9
View File
@@ -32,8 +32,8 @@
return thearea
/obj/effect/proc_holder/spell/targeted/area_teleport/cast(list/targets,area/thearea)
playsound(get_turf(usr), sound1, 50,1)
/obj/effect/proc_holder/spell/targeted/area_teleport/cast(list/targets,area/thearea,mob/user = usr)
playsound(get_turf(user), sound1, 50,1)
for(var/mob/living/target in targets)
var/list/L = list()
for(var/turf/T in get_area_turfs(thearea.type))
@@ -67,22 +67,22 @@
if(!success)
target.loc = pick(L)
playsound(get_turf(usr), sound2, 50,1)
playsound(get_turf(user), sound2, 50,1)
return
/obj/effect/proc_holder/spell/targeted/area_teleport/invocation(area/chosenarea = null)
/obj/effect/proc_holder/spell/targeted/area_teleport/invocation(area/chosenarea = null,mob/user = usr)
if(!invocation_area || !chosenarea)
..()
else
switch(invocation_type)
if("shout")
usr.say("[invocation] [uppertext(chosenarea.name)]")
if(usr.gender==MALE)
playsound(usr.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1)
user.say("[invocation] [uppertext(chosenarea.name)]")
if(user.gender==MALE)
playsound(user.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1)
else
playsound(usr.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1)
playsound(user.loc, pick('sound/misc/null.ogg','sound/misc/null.ogg'), 100, 1)
if("whisper")
usr.whisper("[invocation] [uppertext(chosenarea.name)]")
user.whisper("[invocation] [uppertext(chosenarea.name)]")
return
+10 -10
View File
@@ -12,9 +12,9 @@
include_user = 1
/obj/effect/proc_holder/spell/targeted/charge/cast(list/targets)
for(var/mob/living/user in targets)
var/list/hand_items = list(user.get_active_hand(),user.get_inactive_hand())
/obj/effect/proc_holder/spell/targeted/charge/cast(list/targets,mob/user = usr)
for(var/mob/living/L in targets)
var/list/hand_items = list(L.get_active_hand(),L.get_inactive_hand())
var/charged_item = null
var/burnt_out = 0
for(var/obj/item in hand_items)
@@ -38,15 +38,15 @@
if(istype(item, /obj/item/weapon/spellbook/oneuse))
var/obj/item/weapon/spellbook/oneuse/I = item
if(prob(80))
user.visible_message("<span class='warning'>[I] catches fire!</span>")
L.visible_message("<span class='warning'>[I] catches fire!</span>")
qdel(I)
else
I.used = 0
charged_item = I
break
else
user << "<span class='caution'>Glowing red letters appear on the front cover...</span>"
user << "<span class='warning'>[pick("NICE TRY BUT NO!","CLEVER BUT NOT CLEVER ENOUGH!", "SUCH FLAGRANT CHEESING IS WHY WE ACCEPTED YOUR APPLICATION!", "CUTE!", "YOU DIDN'T THINK IT'D BE THAT EASY, DID YOU?")]</span>"
L << "<span class='caution'>Glowing red letters appear on the front cover...</span>"
L << "<span class='warning'>[pick("NICE TRY BUT NO!","CLEVER BUT NOT CLEVER ENOUGH!", "SUCH FLAGRANT CHEESING IS WHY WE ACCEPTED YOUR APPLICATION!", "CUTE!", "YOU DIDN'T THINK IT'D BE THAT EASY, DID YOU?")]</span>"
burnt_out = 1
else if(istype(item, /obj/item/weapon/gun/magic))
var/obj/item/weapon/gun/magic/I = item
@@ -86,9 +86,9 @@
charged_item = item
break
if(!charged_item)
user << "<span class='notice'>you feel magical power surging to your hands, but the feeling rapidly fades...</span>"
L << "<span class='notice'>you feel magical power surging to your hands, but the feeling rapidly fades...</span>"
else if(burnt_out)
user << "<span class='caution'>[charged_item] doesn't seem to be reacting to the spell...</span>"
L << "<span class='caution'>[charged_item] doesn't seem to be reacting to the spell...</span>"
else
playsound(get_turf(usr), "sound/magic/Charge.ogg", 50, 1)
user << "<span class='notice'>[charged_item] suddenly feels very warm!</span>"
playsound(get_turf(L), "sound/magic/Charge.ogg", 50, 1)
L << "<span class='notice'>[charged_item] suddenly feels very warm!</span>"
+2 -2
View File
@@ -15,8 +15,8 @@
var/cast_sound = 'sound/items/welder.ogg'
/obj/effect/proc_holder/spell/aoe_turf/conjure/cast(list/targets)
playsound(get_turf(usr), cast_sound, 50,1)
/obj/effect/proc_holder/spell/aoe_turf/conjure/cast(list/targets,mob/user = usr)
playsound(get_turf(user), cast_sound, 50,1)
for(var/turf/T in targets)
if(T.density && !summon_ignore_density)
targets -= T
+7 -7
View File
@@ -22,13 +22,13 @@
/obj/effect/proc_holder/spell/dumbfire/choose_targets(mob/user = usr)
var/turf/T = get_turf(usr)
var/turf/T = get_turf(user)
for(var/i = 1; i < range; i++)
var/turf/new_turf = get_step(T, usr.dir)
var/turf/new_turf = get_step(T, user.dir)
if(new_turf.density)
break
T = new_turf
perform(list(T))
perform(list(T),user = user)
/obj/effect/proc_holder/spell/dumbfire/cast(list/targets, mob/user = usr)
playMagSound()
@@ -46,7 +46,7 @@
projectile.dir = get_dir(projectile, target)
projectile.name = proj_name
var/current_loc = usr.loc
var/current_loc = user.loc
projectile.loc = current_loc
@@ -60,12 +60,12 @@
step(projectile, projectile.dir)
if(projectile.loc == current_loc || i == proj_lifespan)
projectile.cast(current_loc)
projectile.cast(current_loc,user=user)
break
var/mob/living/L = locate(/mob/living) in range(projectile, proj_trigger_range) - usr
var/mob/living/L = locate(/mob/living) in range(projectile, proj_trigger_range) - user
if(L && L.stat != DEAD)
projectile.cast(L.loc)
projectile.cast(L.loc,user=user)
break
if(proj_trail && projectile)
+2 -2
View File
@@ -8,8 +8,8 @@
action_icon_state = "emp"
sound = "sound/weapons/ZapBang.ogg"
/obj/effect/proc_holder/spell/targeted/emplosion/cast(list/targets)
playsound(get_turf(usr), sound, 50,1)
/obj/effect/proc_holder/spell/targeted/emplosion/cast(list/targets,mob/user = usr)
playsound(get_turf(user), sound, 50,1)
for(var/mob/living/target in targets)
empulse(target.loc, emp_heavy, emp_light)
+3 -3
View File
@@ -15,8 +15,8 @@
var/jaunt_duration = 50 //in deciseconds
action_icon_state = "jaunt"
/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/cast(list/targets) //magnets, so mostly hardcoded
playsound(get_turf(usr), 'sound/magic/Ethereal_Enter.ogg', 50, 1, -1)
/obj/effect/proc_holder/spell/targeted/ethereal_jaunt/cast(list/targets,mob/user = usr) //magnets, so mostly hardcoded
playsound(get_turf(user), 'sound/magic/Ethereal_Enter.ogg', 50, 1, -1)
for(var/mob/living/target in targets)
target.notransform = 1 //protects the mob from being transformed (replaced) midjaunt and getting stuck in bluespace
spawn(0)
@@ -50,7 +50,7 @@
jaunt_steam(mobloc)
target.canmove = 0
holder.reappearing = 1
playsound(get_turf(usr), 'sound/magic/Ethereal_Exit.ogg', 50, 1, -1)
playsound(get_turf(user), 'sound/magic/Ethereal_Exit.ogg', 50, 1, -1)
sleep(20)
jaunt_reappear(animation, target)
sleep(5)
+1 -1
View File
@@ -7,7 +7,7 @@
var/ex_light = 3
var/ex_flash = 4
/obj/effect/proc_holder/spell/targeted/explosion/cast(list/targets)
/obj/effect/proc_holder/spell/targeted/explosion/cast(list/targets,mob/user = usr)
for(var/mob/living/target in targets)
explosion(target.loc,ex_severe,ex_heavy,ex_light,ex_flash)
+1 -1
View File
@@ -15,7 +15,7 @@
6th bit - ?
*/
/obj/effect/proc_holder/spell/targeted/genetic/cast(list/targets)
/obj/effect/proc_holder/spell/targeted/genetic/cast(list/targets,mob/user = usr)
playMagSound()
for(var/mob/living/carbon/target in targets)
if(!target.dna)
+1 -1
View File
@@ -19,7 +19,7 @@
var/summon_type = null //this will put an obj at the target's location
/obj/effect/proc_holder/spell/targeted/inflict_handler/cast(list/targets)
/obj/effect/proc_holder/spell/targeted/inflict_handler/cast(list/targets,mob/user = usr)
for(var/mob/living/target in targets)
playsound(target,sound, 50,1)
+2 -2
View File
@@ -12,8 +12,8 @@
action_icon_state = "knock"
/obj/effect/proc_holder/spell/aoe_turf/knock/cast(list/targets)
usr << sound("sound/magic/Knock.ogg")
/obj/effect/proc_holder/spell/aoe_turf/knock/cast(list/targets,mob/user = usr)
user << sound("sound/magic/Knock.ogg")
for(var/turf/T in targets)
for(var/obj/machinery/door/door in T.contents)
spawn(1)
+22 -22
View File
@@ -34,35 +34,35 @@
ticker.mode.round_ends_with_antag_death = 1
..()
/obj/effect/proc_holder/spell/targeted/lichdom/cast(list/targets)
for(var/mob/user in targets)
/obj/effect/proc_holder/spell/targeted/lichdom/cast(list/targets,mob/user = usr)
for(var/mob/M in targets)
var/list/hand_items = list()
if(iscarbon(user))
hand_items = list(user.get_active_hand(),user.get_inactive_hand())
if(iscarbon(M))
hand_items = list(M.get_active_hand(),M.get_inactive_hand())
if(marked_item && !stat_allowed) //sanity, shouldn't happen without badminry
marked_item = null
return
if(stat_allowed) //Death is not my end!
if(user.stat == CONSCIOUS && iscarbon(user))
user << "<span class='notice'>You aren't dead enough to revive!</span>" //Usually a good problem to have
if(M.stat == CONSCIOUS && iscarbon(M))
M << "<span class='notice'>You aren't dead enough to revive!</span>" //Usually a good problem to have
charge_counter = charge_max
return
if(!marked_item || qdeleted(marked_item)) //Wait nevermind
user << "<span class='warning'>Your phylactery is gone!</span>"
M << "<span class='warning'>Your phylactery is gone!</span>"
return
var/turf/user_turf = get_turf(user)
var/turf/user_turf = get_turf(M)
var/turf/item_turf = get_turf(marked_item)
if(user_turf.z != item_turf.z)
user << "<span class='warning'>Your phylactery is out of range!</span>"
M << "<span class='warning'>Your phylactery is out of range!</span>"
return
if(isobserver(user))
var/mob/dead/observer/O = user
if(isobserver(M))
var/mob/dead/observer/O = M
O.reenter_corpse()
var/mob/living/carbon/human/lich = new /mob/living/carbon/human(item_turf)
@@ -72,8 +72,8 @@
lich.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe/black(lich), slot_wear_suit)
lich.equip_to_slot_or_del(new /obj/item/clothing/head/wizard/black(lich), slot_head)
lich.real_name = user.mind.name
user.mind.transfer_to(lich)
lich.real_name = M.mind.name
M.mind.transfer_to(lich)
lich.hardset_dna(null,null,lich.real_name,null,/datum/species/skeleton)
lich << "<span class='warning'>Your bones clatter and shutter as they're pulled back into this world!</span>"
charge_max += 600
@@ -99,15 +99,15 @@
if(ABSTRACT in item.flags || NODROP in item.flags)
continue
marked_item = item
user << "<span class='warning'>You begin to focus your very being into the [item.name]...</span>"
M << "<span class='warning'>You begin to focus your very being into the [item.name]...</span>"
break
if(!marked_item)
user << "<span class='caution'>You must hold an item you wish to make your phylactery...</span>"
M << "<span class='caution'>You must hold an item you wish to make your phylactery...</span>"
spawn(50)
if(marked_item.loc != user) //I changed my mind I don't want to put my soul in a cheeseburger!
user << "<span class='warning'>Your soul snaps back to your body as you drop the [marked_item.name]!</span>"
if(marked_item.loc != M) //I changed my mind I don't want to put my soul in a cheeseburger!
M << "<span class='warning'>Your soul snaps back to your body as you drop the [marked_item.name]!</span>"
marked_item = null
return
name = "RISE!"
@@ -118,11 +118,11 @@
marked_item.name = "Ensouled [marked_item.name]"
marked_item.desc = "A terrible aura surrounds this item, its very existence is offensive to life itself..."
marked_item.color = "#003300"
user << "<span class='userdanger'>With a hideous feeling of emptiness you watch in horrified fascination as skin sloughs off bone! Blood boils, nerves disintegrate, eyes boil in their sockets! As your organs crumble to dust in your fleshless chest you come to terms with your choice. You're a lich!</span>"
user.set_species(/datum/species/skeleton)
current_body = user.mind.current
if(ishuman(user))
var/mob/living/carbon/human/H = user
M << "<span class='userdanger'>With a hideous feeling of emptiness you watch in horrified fascination as skin sloughs off bone! Blood boils, nerves disintegrate, eyes boil in their sockets! As your organs crumble to dust in your fleshless chest you come to terms with your choice. You're a lich!</span>"
M.set_species(/datum/species/skeleton)
current_body = M.mind.current
if(ishuman(M))
var/mob/living/carbon/human/H = M
H.unEquip(H.wear_suit)
H.unEquip(H.head)
H.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe/black(H), slot_wear_suit)
+4 -4
View File
@@ -18,7 +18,7 @@
/obj/effect/proc_holder/spell/targeted/lightning/Click()
if(!ready && cast_check())
StartChargeup()
StartChargeup()
return 1
/obj/effect/proc_holder/spell/targeted/lightning/proc/StartChargeup(mob/user = usr)
@@ -27,7 +27,7 @@
Snd = new/sound('sound/magic/lightning_chargeup.ogg',channel = 7)
halo = image("icon"='icons/effects/effects.dmi',"icon_state" ="electricity","layer" = EFFECTS_LAYER)
user.overlays.Add(halo)
playsound(get_turf(usr), Snd, 50, 0)
playsound(get_turf(user), Snd, 50, 0)
if(do_mob(user,user,100,uninterruptible=1))
if(ready && cast_check(skipcharge=1))
choose_targets()
@@ -48,13 +48,13 @@
ready = 0
var/mob/living/carbon/target = targets[1]
Snd=sound(null, repeat = 0, wait = 1, channel = Snd.channel) //byond, why you suck?
playsound(get_turf(usr),Snd,50,0)// Sorry MrPerson, but the other ways just didn't do it the way i needed to work, this is the only way.
playsound(get_turf(user),Snd,50,0)// Sorry MrPerson, but the other ways just didn't do it the way i needed to work, this is the only way.
if(get_dist(user,target)>range)
user << "<span class='notice'>They are too far away!</span>"
Reset(user)
return
playsound(get_turf(usr), 'sound/magic/lightningbolt.ogg', 50, 1)
playsound(get_turf(user), 'sound/magic/lightningbolt.ogg', 50, 1)
user.Beam(target,icon_state="lightning",icon='icons/effects/effects.dmi',time=5)
Bolt(user,target,30,5,user)
+1 -1
View File
@@ -53,7 +53,7 @@
still_recharging_msg = "<span class='warning'>You'll have to wait before you can give your vow of silence again!</span>"
..()
/obj/effect/proc_holder/spell/targeted/mime/speak/cast(list/targets)
/obj/effect/proc_holder/spell/targeted/mime/speak/cast(list/targets,mob/user = usr)
for(var/mob/living/carbon/human/H in targets)
H.mind.miming=!H.mind.miming
if(H.mind.miming)
+2 -2
View File
@@ -38,7 +38,7 @@
projectile.dir = get_dir(target,projectile)
projectile.name = proj_name
var/current_loc = usr.loc
var/current_loc = user.loc
projectile.loc = current_loc
@@ -76,7 +76,7 @@
qdel(trail)
if(projectile.loc in range(target.loc,proj_trigger_range))
projectile.perform(list(target))
projectile.perform(list(target),user=user)
break
current_loc = projectile.loc
+1 -1
View File
@@ -15,7 +15,7 @@
var/list/current_shapes = list()
var/list/current_casters = list()
/obj/effect/proc_holder/spell/targeted/shapeshift/cast(list/targets)
/obj/effect/proc_holder/spell/targeted/shapeshift/cast(list/targets,mob/user = usr)
for(var/mob/living/M in targets)
if(M in current_shapes)
Restore(M)
+15 -15
View File
@@ -15,9 +15,9 @@
action_icon_state = "summons"
/obj/effect/proc_holder/spell/targeted/summonitem/cast(list/targets)
for(var/mob/living/user in targets)
var/list/hand_items = list(user.get_active_hand(),user.get_inactive_hand())
/obj/effect/proc_holder/spell/targeted/summonitem/cast(list/targets,mob/user = usr)
for(var/mob/living/L in targets)
var/list/hand_items = list(L.get_active_hand(),L.get_inactive_hand())
var/butterfingers = 0
var/message
@@ -58,7 +58,7 @@
var/obj/item/organ/internal/organ = item_to_retrive
if(organ.owner)
// If this code ever runs I will be happy
add_logs(user, organ.owner, "magically removed [organ.name] from", addition="INTENT: [uppertext(user.a_intent)]")
add_logs(L, organ.owner, "magically removed [organ.name] from", addition="INTENT: [uppertext(L.a_intent)]")
organ.Remove(organ.owner)
else
while(!isturf(item_to_retrive.loc) && infinite_recursion < 10) //if it's in something you get the whole thing.
@@ -67,7 +67,7 @@
if(issilicon(M)) //Items in silicons warp the whole silicon
M.loc.visible_message("<span class='warning'>[M] suddenly disappears!</span>")
M.loc = user.loc
M.loc = L.loc
M.loc.visible_message("<span class='caution'>[M] suddenly appears!</span>")
item_to_retrive = null
break
@@ -95,22 +95,22 @@
item_to_retrive.loc.visible_message("<span class='warning'>The [item_to_retrive.name] suddenly disappears!</span>")
if(user.hand) //left active hand
if(!user.equip_to_slot_if_possible(item_to_retrive, slot_l_hand, 0, 1, 1))
if(!user.equip_to_slot_if_possible(item_to_retrive, slot_r_hand, 0, 1, 1))
if(L.hand) //left active hand
if(!L.equip_to_slot_if_possible(item_to_retrive, slot_l_hand, 0, 1, 1))
if(!L.equip_to_slot_if_possible(item_to_retrive, slot_r_hand, 0, 1, 1))
butterfingers = 1
else //right active hand
if(!user.equip_to_slot_if_possible(item_to_retrive, slot_r_hand, 0, 1, 1))
if(!user.equip_to_slot_if_possible(item_to_retrive, slot_l_hand, 0, 1, 1))
if(!L.equip_to_slot_if_possible(item_to_retrive, slot_r_hand, 0, 1, 1))
if(!L.equip_to_slot_if_possible(item_to_retrive, slot_l_hand, 0, 1, 1))
butterfingers = 1
if(butterfingers)
item_to_retrive.loc = user.loc
item_to_retrive.loc = L.loc
item_to_retrive.loc.visible_message("<span class='caution'>The [item_to_retrive.name] suddenly appears!</span>")
playsound(get_turf(user),"sound/magic/SummonItems_generic.ogg",50,1)
playsound(get_turf(L),"sound/magic/SummonItems_generic.ogg",50,1)
else
item_to_retrive.loc.visible_message("<span class='caution'>The [item_to_retrive.name] suddenly appears in [user]'s hand!</span>")
playsound(get_turf(user),"sound/magic/SummonItems_generic.ogg",50,1)
item_to_retrive.loc.visible_message("<span class='caution'>The [item_to_retrive.name] suddenly appears in [L]'s hand!</span>")
playsound(get_turf(L),"sound/magic/SummonItems_generic.ogg",50,1)
if(message)
user << message
L << message
+3 -3
View File
@@ -14,10 +14,10 @@
return 0
..()
/obj/effect/proc_holder/spell/targeted/touch/cast(list/targets)
for(var/mob/living/carbon/user in targets)
/obj/effect/proc_holder/spell/targeted/touch/cast(list/targets,mob/user = usr)
for(var/mob/living/carbon/C in targets)
if(!attached_hand)
if(!ChargeHand(user))
if(!ChargeHand(C))
return 0
while(attached_hand) //hibernate untill the spell is actually used
charge_counter = 0
+1 -1
View File
@@ -19,7 +19,7 @@
starting_spells = null
return ..()
/obj/effect/proc_holder/spell/targeted/trigger/cast(list/targets)
/obj/effect/proc_holder/spell/targeted/trigger/cast(list/targets,mob/user = usr)
playMagSound()
for(var/mob/living/target in targets)
for(var/obj/effect/proc_holder/spell/spell in contents)
+3 -3
View File
@@ -11,8 +11,8 @@
var/sound1 = "sound/weapons/ZapBang.ogg"
var/sound2 = "sound/weapons/ZapBang.ogg"
/obj/effect/proc_holder/spell/targeted/turf_teleport/cast(list/targets)
playsound(get_turf(usr), sound1, 50,1)
/obj/effect/proc_holder/spell/targeted/turf_teleport/cast(list/targets,mob/user = usr)
playsound(get_turf(user), sound1, 50,1)
for(var/mob/living/target in targets)
var/list/turfs = new/list()
for(var/turf/T in range(target,outer_tele_radius))
@@ -41,4 +41,4 @@
if(target.buckled_mob)
target.unbuckle_mob(force=1)
target.loc = picked
playsound(get_turf(usr), sound2, 50,1)
playsound(get_turf(user), sound2, 50,1)
+5 -6
View File
@@ -273,7 +273,7 @@
action_icon_state = "fireball"
sound = "sound/magic/Fireball.ogg"
/obj/effect/proc_holder/spell/turf/fireball/cast(turf/T)
/obj/effect/proc_holder/spell/turf/fireball/cast(turf/T,mob/user = usr)
explosion(T, -1, 0, 2, 3, 0, flame_range = 2)
@@ -303,8 +303,7 @@
action_icon_state = "repulse"
/obj/effect/proc_holder/spell/aoe_turf/repulse/cast(list/targets)
var/mob/user = usr
/obj/effect/proc_holder/spell/aoe_turf/repulse/cast(list/targets,mob/user = usr)
var/list/thrownatoms = list()
var/atom/throwtarget
var/distfromcaster
@@ -351,9 +350,9 @@
action_icon_state = "tailsweep"
action_background_icon_state = "bg_alien"
/obj/effect/proc_holder/spell/aoe_turf/repulse/xeno/cast(list/targets)
if(istype(usr, /mob/living/carbon))
var/mob/living/carbon/C = usr
/obj/effect/proc_holder/spell/aoe_turf/repulse/xeno/cast(list/targets,mob/user = usr)
if(istype(user, /mob/living/carbon))
var/mob/living/carbon/C = user
playsound(C.loc, 'sound/voice/hiss5.ogg', 80, 1, 1)
C.spin(6,1)
..()
@@ -19,28 +19,28 @@
clothes_req = 0
action_icon_state = "glare"
/obj/effect/proc_holder/spell/targeted/glare/cast(list/targets)
/obj/effect/proc_holder/spell/targeted/glare/cast(list/targets,mob/user = usr)
for(var/mob/living/target in targets)
if(!ishuman(target))
usr << "<span class='warning'>You may only glare at humans!</span>"
user << "<span class='warning'>You may only glare at humans!</span>"
revert_cast()
return
if(!shadowling_check(usr))
if(!shadowling_check(user))
revert_cast()
return
if(target.stat)
usr << "<span class='warning'>[target] must be conscious!</span>"
user << "<span class='warning'>[target] must be conscious!</span>"
revert_cast()
return
if(is_shadow_or_thrall(target))
usr << "<span class='warning'>You cannot glare at allies!</span>"
user << "<span class='warning'>You cannot glare at allies!</span>"
revert_cast()
return
var/mob/living/carbon/human/M = target
usr.visible_message("<span class='warning'><b>[usr]'s eyes flash a blinding red!</b></span>")
user.visible_message("<span class='warning'><b>[user]'s eyes flash a blinding red!</b></span>")
target.visible_message("<span class='danger'>[target] freezes in place, their eyes glazing over...</span>")
if(in_range(target, usr))
target << "<span class='userdanger'>Your gaze is forcibly drawn into [usr]'s eyes, and you are mesmerized by the heavenly lights...</span>"
if(in_range(target, user))
target << "<span class='userdanger'>Your gaze is forcibly drawn into [user]'s eyes, and you are mesmerized by the heavenly lights...</span>"
else //Only alludes to the shadowling if the target is close by
target << "<span class='userdanger'>Red lights suddenly dance in your vision, and you are mesmerized by their heavenly beauty...</span>"
target.Stun(10)
@@ -80,11 +80,11 @@
blacklistLuminosity += extinguishItem(F)
H.SetLuminosity(blacklistLuminosity) //I hate lightcode for making me do it this way
/obj/effect/proc_holder/spell/aoe_turf/veil/cast(list/targets)
if(!shadowling_check(usr) && !admin_override)
/obj/effect/proc_holder/spell/aoe_turf/veil/cast(list/targets,mob/user = usr)
if(!shadowling_check(user) && !admin_override)
revert_cast()
return
usr << "<span class='shadowling'>You silently disable all nearby lights.</span>"
user << "<span class='shadowling'>You silently disable all nearby lights.</span>"
for(var/turf/T in targets)
for(var/obj/item/F in T.contents)
extinguishItem(F)
@@ -95,7 +95,7 @@
for(var/obj/machinery/computer/C in T.contents)
C.SetLuminosity(0)
C.visible_message("<span class='warning'>[C] grows dim, its screen barely readable.</span>")
for(var/obj/effect/glowshroom/G in orange(7, usr)) //High radius because glowshroom spam wrecks shadowlings
for(var/obj/effect/glowshroom/G in orange(7, user)) //High radius because glowshroom spam wrecks shadowlings
G.visible_message("<span class='warning'>[G] withers away!</span>")
qdel(G)
for(var/mob/living/H in T.contents)
@@ -142,15 +142,15 @@
action_icon_state = "icy_veins"
sound = 'sound/effects/ghost2.ogg'
/obj/effect/proc_holder/spell/aoe_turf/flashfreeze/cast(list/targets)
if(!shadowling_check(usr))
/obj/effect/proc_holder/spell/aoe_turf/flashfreeze/cast(list/targets,mob/user = usr)
if(!shadowling_check(user))
revert_cast()
return
usr << "<span class='shadowling'>You freeze the nearby air.</span>"
user << "<span class='shadowling'>You freeze the nearby air.</span>"
for(var/turf/T in targets)
for(var/mob/living/carbon/M in T.contents)
if(is_shadow_or_thrall(M))
if(M == usr) //No message for the user, of course
if(M == user) //No message for the user, of course
continue
else
M << "<span class='danger'>You feel a blast of paralyzingly cold air wrap around you and flow past, but you are unaffected!</span>"
@@ -175,79 +175,78 @@
action_icon_state = "enthrall"
var/enthralling = 0
/obj/effect/proc_holder/spell/targeted/enthrall/cast(list/targets)
var/mob/living/carbon/human/user = usr
/obj/effect/proc_holder/spell/targeted/enthrall/cast(list/targets,mob/living/carbon/human/user = usr)
listclearnulls(ticker.mode.thralls)
if(!(usr.mind in ticker.mode.shadows)) return
if(!(user.mind in ticker.mode.shadows)) return
if(user.dna.species.id != "shadowling")
if(ticker.mode.thralls.len >= 5)
revert_cast()
return
for(var/mob/living/carbon/human/target in targets)
if(!in_range(usr, target))
usr << "<span class='warning'>You need to be closer to enthrall [target]!</span>"
if(!in_range(user, target))
user << "<span class='warning'>You need to be closer to enthrall [target]!</span>"
revert_cast()
return
if(!target.key || !target.mind)
usr << "<span class='warning'>The target has no mind!</span>"
user << "<span class='warning'>The target has no mind!</span>"
revert_cast()
return
if(target.stat)
usr << "<span class='warning'>The target must be conscious!</span>"
user << "<span class='warning'>The target must be conscious!</span>"
revert_cast()
return
if(is_shadow_or_thrall(target))
usr << "<span class='warning'>You can not enthrall allies!</span>"
user << "<span class='warning'>You can not enthrall allies!</span>"
revert_cast()
return
if(!ishuman(target))
usr << "<span class='warning'>You can only enthrall humans!</span>"
user << "<span class='warning'>You can only enthrall humans!</span>"
revert_cast()
return
if(enthralling)
usr << "<span class='warning'>You are already enthralling!</span>"
user << "<span class='warning'>You are already enthralling!</span>"
revert_cast()
return
if(!target.client)
usr << "<span class='warning'>[target]'s mind is vacant of activity.</span>"
user << "<span class='warning'>[target]'s mind is vacant of activity.</span>"
enthralling = 1
usr << "<span class='danger'>This target is valid. You begin the enthralling...</span>"
target << "<span class='userdanger'>[usr] stares at you. You feel your head begin to pulse.</span>"
user << "<span class='danger'>This target is valid. You begin the enthralling...</span>"
target << "<span class='userdanger'>[user] stares at you. You feel your head begin to pulse.</span>"
for(var/progress = 0, progress <= 3, progress++)
switch(progress)
if(1)
usr << "<span class='notice'>You place your hands to [target]'s head...</span>"
usr.visible_message("<span class='warning'>[usr] places their hands onto the sides of [target]'s head!</span>")
user << "<span class='notice'>You place your hands to [target]'s head...</span>"
user.visible_message("<span class='warning'>[user] places their hands onto the sides of [target]'s head!</span>")
if(2)
usr << "<span class='notice'>You begin preparing [target]'s mind as a blank slate...</span>"
usr.visible_message("<span class='warning'>[usr]'s palms flare a bright red against [target]'s temples!</span>")
user << "<span class='notice'>You begin preparing [target]'s mind as a blank slate...</span>"
user.visible_message("<span class='warning'>[user]'s palms flare a bright red against [target]'s temples!</span>")
target << "<span class='danger'>A terrible red light floods your mind. You collapse as conscious thought is wiped away.</span>"
target.Weaken(12)
sleep(20)
if(isloyal(target))
usr << "<span class='notice'>They are enslaved by Nanotrasen. You begin to shut down the nanobot implant - this will take some time.</span>"
usr.visible_message("<span class='warning'>[usr] pauses, then dips their head in concentration!</span>")
user << "<span class='notice'>They are enslaved by Nanotrasen. You begin to shut down the nanobot implant - this will take some time.</span>"
user.visible_message("<span class='warning'>[user] pauses, then dips their head in concentration!</span>")
target << "<span class='boldannounce'>You feel your loyalties begin to weaken!</span>"
sleep(100) //10 seconds - not spawn() so the enthralling takes longer
usr << "<span class='notice'>The nanobots composing the loyalty implant have been rendered inert. Now to continue.</span>"
usr.visible_message("<span class='warning'>[user] relaxes again.</span>")
user << "<span class='notice'>The nanobots composing the loyalty implant have been rendered inert. Now to continue.</span>"
user.visible_message("<span class='warning'>[user] relaxes again.</span>")
for(var/obj/item/weapon/implant/loyalty/L in target)
if(L && L.implanted)
qdel(L)
target << "<span class='boldannounce'>Your unwavering loyalty to Nanotrasen unexpectedly falters, dims, dies.</span>"
if(3)
usr << "<span class='notice'>You begin planting the tumor that will control the new thrall...</span>"
usr.visible_message("<span class='warning'>A strange energy passes from [usr]'s hands into [target]'s head!</span>")
user << "<span class='notice'>You begin planting the tumor that will control the new thrall...</span>"
user.visible_message("<span class='warning'>A strange energy passes from [user]'s hands into [target]'s head!</span>")
target << "<span class='boldannounce'>You feel your memories twisting, morphing. A sense of horror dominates your mind.</span>"
if(!do_mob(usr, target, 70)) //around 21 seconds total for enthralling, 31 for someone with a loyalty implant
usr << "<span class='warning'>The enthralling has been interrupted - your target's mind returns to its previous state.</span>"
target << "<span class='userdanger'>You wrest yourself away from [usr]'s hands and compose yourself</span>"
if(!do_mob(user, target, 70)) //around 21 seconds total for enthralling, 31 for someone with a loyalty implant
user << "<span class='warning'>The enthralling has been interrupted - your target's mind returns to its previous state.</span>"
target << "<span class='userdanger'>You wrest yourself away from [user]'s hands and compose yourself</span>"
enthralling = 0
return
enthralling = 0
usr << "<span class='shadowling'>You have enthralled <b>[target.real_name]</b>!</span>"
user << "<span class='shadowling'>You have enthralled <b>[target.real_name]</b>!</span>"
target.visible_message("<span class='big'>[target] looks to have experienced a revelation!</span>", \
"<span class='warning'>False faces all d<b>ark not real not real not--</b></span>")
target.setOxyLoss(0) //In case the shadowling was choking them out
@@ -264,7 +263,7 @@
clothes_req = 0
action_icon_state = "commune"
/obj/effect/proc_holder/spell/self/shadowling_hivemind/cast(mob/living/user)
/obj/effect/proc_holder/spell/self/shadowling_hivemind/cast(mob/living/user,mob/user = usr)
if(!is_shadow(user))
user << "<span class='warning'>You must be a shadowling to do that!</span>"
return
@@ -273,7 +272,7 @@
return
for(var/mob/M in mob_list)
if(is_shadow_or_thrall(M) || (M in dead_mob_list))
M << "<span class='shadowling'><b>\[Shadowling\]</b><i> [usr.real_name]</i>: [text]</span>"
M << "<span class='shadowling'><b>\[Shadowling\]</b><i> [user.real_name]</i>: [text]</span>"
/obj/effect/proc_holder/spell/self/shadowling_regenarmor //Resets a shadowling's species to normal, removes genetic defects, and re-equips their armor
@@ -293,13 +292,13 @@
user.visible_message("<span class='warning'>[user]'s skin suddenly bubbles and shifts around their body!</span>", \
"<span class='shadowling'>You regenerate your protective armor and cleanse your form of defects.</span>")
user.adjustCloneLoss(user.getCloneLoss())
user.equip_to_slot_or_del(new /obj/item/clothing/under/shadowling(usr), slot_w_uniform)
user.equip_to_slot_or_del(new /obj/item/clothing/shoes/shadowling(usr), slot_shoes)
user.equip_to_slot_or_del(new /obj/item/clothing/suit/space/shadowling(usr), slot_wear_suit)
user.equip_to_slot_or_del(new /obj/item/clothing/head/shadowling(usr), slot_head)
user.equip_to_slot_or_del(new /obj/item/clothing/gloves/shadowling(usr), slot_gloves)
user.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/shadowling(usr), slot_wear_mask)
user.equip_to_slot_or_del(new /obj/item/clothing/glasses/night/shadowling(usr), slot_glasses)
user.equip_to_slot_or_del(new /obj/item/clothing/under/shadowling(user), slot_w_uniform)
user.equip_to_slot_or_del(new /obj/item/clothing/shoes/shadowling(user), slot_shoes)
user.equip_to_slot_or_del(new /obj/item/clothing/suit/space/shadowling(user), slot_wear_suit)
user.equip_to_slot_or_del(new /obj/item/clothing/head/shadowling(user), slot_head)
user.equip_to_slot_or_del(new /obj/item/clothing/gloves/shadowling(user), slot_gloves)
user.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/shadowling(user), slot_wear_mask)
user.equip_to_slot_or_del(new /obj/item/clothing/glasses/night/shadowling(user), slot_glasses)
user.set_species(/datum/species/shadow/ling)
@@ -362,8 +361,8 @@
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>"
else if(thralls >= victory_threshold)
usr << "<span class='shadowling'><b>You are now powerful enough to ascend. Use the Ascendance ability when you are ready. <i>This will kill all of your thralls.</i></span>"
usr << "<span class='shadowling'><b>You may find Ascendance in the Shadowling Evolution tab.</b></span>"
user << "<span class='shadowling'><b>You are now powerful enough to ascend. Use the Ascendance ability when you are ready. <i>This will kill all of your thralls.</i></span>"
user << "<span class='shadowling'><b>You may find Ascendance in the Shadowling Evolution tab.</b></span>"
for(M in living_mob_list)
if(is_shadow(M))
var/obj/effect/proc_holder/spell/self/collective_mind/CM
@@ -372,7 +371,7 @@
qdel(CM)
M.mind.remove_spell(/obj/effect/proc_holder/spell/self/shadowling_hatch)
M.mind.AddSpell(new /obj/effect/proc_holder/spell/self/shadowling_ascend(null))
if(M == usr)
if(M == user)
M << "<span class='shadowling'><i>You project this power to the rest of the shadowlings.</i></span>"
else
M << "<span class='shadowling'><b>[user.real_name] has coalesced the strength of the thralls. You can draw upon it at any time to ascend. (Shadowling Evolution Tab)</b></span>" //Tells all the other shadowlings
@@ -440,15 +439,15 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
action_icon_state = "screech"
sound = 'sound/effects/screech.ogg'
/obj/effect/proc_holder/spell/aoe_turf/unearthly_screech/cast(list/targets)
if(!shadowling_check(usr))
/obj/effect/proc_holder/spell/aoe_turf/unearthly_screech/cast(list/targets,mob/user = usr)
if(!shadowling_check(user))
revert_cast()
return
usr.audible_message("<span class='warning'><b>[usr] lets out a horrible scream!</b></span>")
user.audible_message("<span class='warning'><b>[user] lets out a horrible scream!</b></span>")
for(var/turf/T in targets)
for(var/mob/target in T.contents)
if(is_shadow_or_thrall(target))
if(target == usr) //No message for the user, of course
if(target == user) //No message for the user, of course
continue
else
continue
@@ -482,32 +481,32 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
var/targetsDrained
var/list/nearbyTargets
/obj/effect/proc_holder/spell/aoe_turf/drain_life/cast(list/targets, mob/living/carbon/human/U = usr)
if(!shadowling_check(U))
/obj/effect/proc_holder/spell/aoe_turf/drain_life/cast(list/targets, mob/living/carbon/human/user = usr)
if(!shadowling_check(user))
revert_cast()
return
targetsDrained = 0
nearbyTargets = list()
for(var/turf/T in targets)
for(var/mob/living/carbon/M in T.contents)
if(M == usr) continue
if(M == user) continue
targetsDrained++
nearbyTargets.Add(M)
if(!targetsDrained)
revert_cast()
usr << "<span class='warning'>There were no nearby humans for you to drain.</span>"
user << "<span class='warning'>There were no nearby humans for you to drain.</span>"
return
for(var/mob/living/carbon/M in nearbyTargets)
U.heal_organ_damage(10, 10)
U.adjustToxLoss(-10)
U.adjustOxyLoss(-10)
U.adjustStaminaLoss(-20)
U.AdjustWeakened(-1)
U.AdjustStunned(-1)
user.heal_organ_damage(10, 10)
user.adjustToxLoss(-10)
user.adjustOxyLoss(-10)
user.adjustStaminaLoss(-20)
user.AdjustWeakened(-1)
user.AdjustStunned(-1)
M.adjustOxyLoss(20)
M.adjustStaminaLoss(20)
M << "<span class='boldannounce'>You feel a wave of exhaustion and a curious draining sensation directed towards [usr]!</span>"
usr << "<span class='shadowling'>You draw life from those around you to heal your wounds.</span>"
user << "<span class='shadowling'>You draw life from those around you to heal your wounds.</span>"
/obj/effect/proc_holder/spell/targeted/revive_thrall //Completely revives a dead thrall
@@ -521,20 +520,20 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
include_user = 0
action_icon_state = "revive_thrall"
/obj/effect/proc_holder/spell/targeted/revive_thrall/cast(list/targets)
if(!shadowling_check(usr))
/obj/effect/proc_holder/spell/targeted/revive_thrall/cast(list/targets,mob/user = usr)
if(!shadowling_check(user))
revert_cast()
return
for(var/mob/living/carbon/human/thrallToRevive in targets)
var/choice = alert(usr,"Empower a living thrall or revive a dead one?",,"Empower","Revive","Cancel")
var/choice = alert(user,"Empower a living thrall or revive a dead one?",,"Empower","Revive","Cancel")
switch(choice)
if("Empower")
if(!is_thrall(thrallToRevive))
usr << "<span class='warning'>[thrallToRevive] is not a thrall.</span>"
user << "<span class='warning'>[thrallToRevive] is not a thrall.</span>"
revert_cast()
return
if(thrallToRevive.stat != CONSCIOUS)
usr << "<span class='warning'>[thrallToRevive] must be conscious to become empowered.</span>"
user << "<span class='warning'>[thrallToRevive] must be conscious to become empowered.</span>"
revert_cast()
return
var/empowered_thralls = 0
@@ -545,21 +544,21 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
if(H.dna.species.id == "l_shadowling")
empowered_thralls++
if(empowered_thralls >= EMPOWERED_THRALL_LIMIT)
usr << "<span class='warning'>You cannot spare this much energy. There are too many empowered thralls.</span>"
user << "<span class='warning'>You cannot spare this much energy. There are too many empowered thralls.</span>"
revert_cast()
return
usr.visible_message("<span class='danger'>[usr] places their hands over [thrallToRevive]'s face, red light shining from beneath.</span>", \
user.visible_message("<span class='danger'>[user] places their hands over [thrallToRevive]'s face, red light shining from beneath.</span>", \
"<span class='shadowling'>You place your hands on [thrallToRevive]'s face and begin gathering energy...</span>")
thrallToRevive << "<span class='userdanger'>[usr] places their hands over your face. You feel energy gathering. Stand still...</span>"
if(!do_mob(usr, thrallToRevive, 80))
usr << "<span class='warning'>Your concentration snaps. The flow of energy ebbs.</span>"
thrallToRevive << "<span class='userdanger'>[user] places their hands over your face. You feel energy gathering. Stand still...</span>"
if(!do_mob(user, thrallToRevive, 80))
user << "<span class='warning'>Your concentration snaps. The flow of energy ebbs.</span>"
revert_cast()
return
usr << "<span class='shadowling'><b><i>You release a massive surge of power into [thrallToRevive]!</b></i></span>"
usr.visible_message("<span class='boldannounce'><i>Red lightning surges into [thrallToRevive]'s face!</i></span>")
user << "<span class='shadowling'><b><i>You release a massive surge of power into [thrallToRevive]!</b></i></span>"
user.visible_message("<span class='boldannounce'><i>Red lightning surges into [thrallToRevive]'s face!</i></span>")
playsound(thrallToRevive, 'sound/weapons/Egloves.ogg', 50, 1)
playsound(thrallToRevive, 'sound/machines/defib_zap.ogg', 50, 1)
usr.Beam(thrallToRevive,icon_state="red_lightning",icon='icons/effects/effects.dmi',time=1)
user.Beam(thrallToRevive,icon_state="red_lightning",icon='icons/effects/effects.dmi',time=1)
thrallToRevive.Weaken(5)
thrallToRevive.visible_message("<span class='warning'><b>[thrallToRevive] collapses, their skin and face distorting!</span>", \
"<span class='userdanger'><i>AAAAAAAAAAAAAAAAAAAGH-</i></span>")
@@ -574,25 +573,25 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
thrallToRevive.mind.AddSpell(new /obj/effect/proc_holder/spell/self/shadow_walk(null))
if("Revive")
if(!is_thrall(thrallToRevive))
usr << "<span class='warning'>[thrallToRevive] is not a thrall.</span>"
user << "<span class='warning'>[thrallToRevive] is not a thrall.</span>"
revert_cast()
return
if(thrallToRevive.stat != DEAD)
usr << "<span class='warning'>[thrallToRevive] is not dead.</span>"
user << "<span class='warning'>[thrallToRevive] is not dead.</span>"
revert_cast()
return
usr.visible_message("<span class='danger'>[usr] kneels over [thrallToRevive], placing their hands on \his chest.</span>", \
user.visible_message("<span class='danger'>[user] kneels over [thrallToRevive], placing their hands on \his chest.</span>", \
"<span class='shadowling'>You crouch over the body of your thrall and begin gathering energy...</span>")
thrallToRevive.notify_ghost_cloning("Your masters are resuscitating you! Re-enter your corpse if you wish to be brought to life.", source = thrallToRevive)
if(!do_mob(usr, thrallToRevive, 30))
usr << "<span class='warning'>Your concentration snaps. The flow of energy ebbs.</span>"
if(!do_mob(user, thrallToRevive, 30))
user << "<span class='warning'>Your concentration snaps. The flow of energy ebbs.</span>"
revert_cast()
return
usr << "<span class='shadowling'><b><i>You release a massive surge of power into [thrallToRevive]!</b></i></span>"
usr.visible_message("<span class='boldannounce'><i>Red lightning surges from [usr]'s hands into [thrallToRevive]'s chest!</i></span>")
user << "<span class='shadowling'><b><i>You release a massive surge of power into [thrallToRevive]!</b></i></span>"
user.visible_message("<span class='boldannounce'><i>Red lightning surges from [user]'s hands into [thrallToRevive]'s chest!</i></span>")
playsound(thrallToRevive, 'sound/weapons/Egloves.ogg', 50, 1)
playsound(thrallToRevive, 'sound/machines/defib_zap.ogg', 50, 1)
usr.Beam(thrallToRevive,icon_state="red_lightning",icon='icons/effects/effects.dmi',time=1)
user.Beam(thrallToRevive,icon_state="red_lightning",icon='icons/effects/effects.dmi',time=1)
sleep(10)
thrallToRevive.revive()
thrallToRevive.visible_message("<span class='boldannounce'>[thrallToRevive] heaves in breath, dim red light shining in their eyes.</span>", \
@@ -615,8 +614,8 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
charge_max = 600
action_icon_state = "extend_shuttle"
/obj/effect/proc_holder/spell/targeted/shadowling_extend_shuttle/cast(list/targets, mob/living/carbon/human/U = usr)
if(!shadowling_check(U))
/obj/effect/proc_holder/spell/targeted/shadowling_extend_shuttle/cast(list/targets, mob/living/carbon/human/user = usr)
if(!shadowling_check(user))
revert_cast()
return
for(var/mob/living/carbon/human/target in targets)
@@ -624,23 +623,23 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
revert_cast()
return
if(!is_thrall(target))
usr << "<span class='warning'>[target] must be a thrall.</span>"
user << "<span class='warning'>[target] must be a thrall.</span>"
revert_cast()
return
if(SSshuttle.emergency.mode != SHUTTLE_CALL)
usr << "<span class='warning'>The shuttle must be inbound only to the station.</span>"
user << "<span class='warning'>The shuttle must be inbound only to the station.</span>"
revert_cast()
return
var/mob/living/carbon/human/M = target
U.visible_message("<span class='warning'>[U]'s eyes flash a bright red!</span>", \
user.visible_message("<span class='warning'>[user]'s eyes flash a bright red!</span>", \
"<span class='notice'>You begin to draw [M]'s life force.</span>")
M.visible_message("<span class='warning'>[M]'s face falls slack, their jaw slightly distending.</span>", \
"<span class='boldannounce'>You are suddenly transported... far, far away...</span>")
if(!do_after(U, 50, target = M))
if(!do_after(user, 50, target = M))
M << "<span class='warning'>You are snapped back to reality, your haze dissipating!</span>"
U << "<span class='warning'>You have been interrupted. The draw has failed.</span>"
user << "<span class='warning'>You have been interrupted. The draw has failed.</span>"
return
U << "<span class='notice'>You project [M]'s life force toward the approaching shuttle, extending its arrival duration!</span>"
user << "<span class='notice'>You project [M]'s life force toward the approaching shuttle, extending its arrival duration!</span>"
M.visible_message("<span class='warning'>[M]'s eyes suddenly flare red. They proceed to collapse on the floor, not breathing.</span>", \
"<span class='warning'><b>...speeding by... ...pretty blue glow... ...touch it... ...no glow now... ...no light... ...nothing at all...</span>")
M.death()
@@ -650,7 +649,7 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
timer += more_minutes
priority_announce("Major system failure aboard the emergency shuttle. This will extend its arrival time by approximately 15 minutes..", "System Failure", 'sound/misc/notice1.ogg')
SSshuttle.emergency.setTimer(timer)
U.mind.spell_list.Remove(src) //Can only be used once!
user.mind.spell_list.Remove(src) //Can only be used once!
qdel(src)
@@ -666,25 +665,25 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
clothes_req = 0
action_icon_state = "glare"
/obj/effect/proc_holder/spell/targeted/lesser_glare/cast(list/targets)
/obj/effect/proc_holder/spell/targeted/lesser_glare/cast(list/targets,mob/user = usr)
for(var/mob/living/target in targets)
if(!ishuman(target) || !target)
usr << "<span class='warning'>You nay only glare at humans!</span>"
user << "<span class='warning'>You nay only glare at humans!</span>"
revert_cast()
return
if(target.stat)
usr << "<span class='warning'>[target] must be conscious!</span>"
user << "<span class='warning'>[target] must be conscious!</span>"
revert_cast()
return
if(is_shadow_or_thrall(target))
usr << "<span class='warning'>You cannot glare at allies!</span>"
user << "<span class='warning'>You cannot glare at allies!</span>"
revert_cast()
return
var/mob/living/carbon/human/M = target
usr.visible_message("<span class='warning'><b>[usr]'s eyes flash a bright red!</b></span>")
user.visible_message("<span class='warning'><b>[user]'s eyes flash a bright red!</b></span>")
target.visible_message("<span class='danger'>[target] freezes in place, their eyes clouding...</span>")
if(in_range(target, usr))
target << "<span class='userdanger'>Your gaze is forcibly drawn into [usr]'s eyes, and you are starstruck by the heavenly lights...</span>"
if(in_range(target, user))
target << "<span class='userdanger'>Your gaze is forcibly drawn into [user]'s eyes, and you are starstruck by the heavenly lights...</span>"
else //Only alludes to the shadowling if the target is close by
target << "<span class='userdanger'>Red lights suddenly dance in your vision, and you are starstruck by their heavenly beauty...</span>"
target.Stun(5) //Roughly 50% as long as the normal one
@@ -749,7 +748,7 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
return
for(var/mob/M in mob_list)
if(is_shadow_or_thrall(M) || (M in dead_mob_list))
M << "<span class='shadowling'><b>\[Thrall\]</b><i> [usr.real_name]</i>: [text]</span>"
M << "<span class='shadowling'><b>\[Thrall\]</b><i> [user.real_name]</i>: [text]</span>"
log_say("[user.real_name]/[user.key] : [text]")
@@ -766,19 +765,17 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
action_icon_state = "annihilate"
sound = 'sound/magic/Staff_Chaos.ogg'
/obj/effect/proc_holder/spell/targeted/annihilate/cast(list/targets)
var/mob/living/simple_animal/ascendant_shadowling/SHA = usr
if(SHA.phasing)
usr << "<span class='warning'>You are not in the same plane of existence. Unphase first.</span>"
/obj/effect/proc_holder/spell/targeted/annihilate/cast(list/targets,mob/living/simple_animal/ascendant_shadowling/user = usr)
if(user.phasing)
user << "<span class='warning'>You are not in the same plane of existence. Unphase first.</span>"
revert_cast()
return
for(var/mob/living/boom in targets)
if(is_shadow(boom)) //Used to not work on thralls. Now it does so you can PUNISH THEM LIKE THE WRATHFUL GOD YOU ARE.
usr << "<span class='warning'>Making an ally explode seems unwise.<span>"
user << "<span class='warning'>Making an ally explode seems unwise.<span>"
revert_cast()
return
usr.visible_message("<span class='warning'>[usr]'s markings flare as they gesture at [boom]!</span>", \
user.visible_message("<span class='warning'>[user]'s markings flare as they gesture at [boom]!</span>", \
"<span class='shadowling'>You direct a lance of telekinetic energy into [boom].</span>")
sleep(4)
if(iscarbon(boom))
@@ -796,32 +793,31 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
clothes_req = 0
action_icon_state = "enthrall"
/obj/effect/proc_holder/spell/targeted/hypnosis/cast(list/targets)
var/mob/living/simple_animal/ascendant_shadowling/SHA = usr
if(SHA.phasing)
/obj/effect/proc_holder/spell/targeted/hypnosis/cast(list/targets,mob/living/simple_animal/ascendant_shadowling/user = usr)
if(user.phasing)
revert_cast()
usr << "<span class='warning'>You are not in the same plane of existence. Unphase first.</span>"
user << "<span class='warning'>You are not in the same plane of existence. Unphase first.</span>"
return
for(var/mob/living/carbon/human/target in targets)
if(is_shadow_or_thrall(target))
usr << "<span class='warning'>You cannot enthrall an ally.<span>"
user << "<span class='warning'>You cannot enthrall an ally.<span>"
revert_cast()
return
if(!target.ckey || !target.mind)
usr << "<span class='warning'>The target has no mind.</span>"
user << "<span class='warning'>The target has no mind.</span>"
revert_cast()
return
if(target.stat)
usr << "<span class='warning'>The target must be conscious.</span>"
user << "<span class='warning'>The target must be conscious.</span>"
revert_cast()
return
if(!ishuman(target))
usr << "<span class='warning'>You can only enthrall humans.</span>"
user << "<span class='warning'>You can only enthrall humans.</span>"
revert_cast()
return
usr << "<span class='shadowling'>You instantly rearrange <b>[target]</b>'s memories, hyptonitizing them into a thrall.</span>"
user << "<span class='shadowling'>You instantly rearrange <b>[target]</b>'s memories, hyptonitizing them into a thrall.</span>"
target << "<span class='userdanger'><font size=3>An agonizing spike of pain drives into your mind, and--</font></span>"
target.mind.special_role = "thrall"
ticker.mode.add_thrall(target.mind)
@@ -835,20 +831,19 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
clothes_req = 0
action_icon_state = "shadow_walk"
/obj/effect/proc_holder/spell/self/shadowling_phase_shift/cast(list/targets)
var/mob/living/simple_animal/ascendant_shadowling/SHA = usr
for(SHA in targets)
SHA.phasing = !SHA.phasing
if(SHA.phasing)
SHA.visible_message("<span class='danger'>[SHA] suddenly vanishes!</span>", \
/obj/effect/proc_holder/spell/self/shadowling_phase_shift/cast(list/targets,mob/living/simple_animal/ascendant_shadowling/user = usr)
for(user in targets)
user.phasing = !user.phasing
if(user.phasing)
user.visible_message("<span class='danger'>[user] suddenly vanishes!</span>", \
"<span class='shadowling'>You begin phasing through planes of existence. Use the ability again to return.</span>")
SHA.incorporeal_move = 1
SHA.alpha = 0
user.incorporeal_move = 1
user.alpha = 0
else
SHA.visible_message("<span class='danger'>[SHA] suddenly appears from nowhere!</span>", \
user.visible_message("<span class='danger'>[user] suddenly appears from nowhere!</span>", \
"<span class='shadowling'>You return from the space between worlds.</span>")
SHA.incorporeal_move = 0
SHA.alpha = 255
user.incorporeal_move = 0
user.alpha = 255
/obj/effect/proc_holder/spell/aoe_turf/ascendant_storm //Releases bolts of lightning to everyone nearby
@@ -861,13 +856,12 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
action_icon_state = "lightning_storm"
sound = 'sound/magic/lightningbolt.ogg'
/obj/effect/proc_holder/spell/aoe_turf/ascendant_storm/cast(list/targets)
var/mob/living/simple_animal/ascendant_shadowling/SHA = usr
if(SHA.phasing)
usr << "<span class='warning'>You are not in the same plane of existence. Unphase first.</span>"
/obj/effect/proc_holder/spell/aoe_turf/ascendant_storm/cast(list/targets,mob/living/simple_animal/ascendant_shadowling/user = usr)
if(user.phasing)
user << "<span class='warning'>You are not in the same plane of existence. Unphase first.</span>"
revert_cast()
return
usr.visible_message("<span class='warning'><b>A massive ball of lightning appears in [usr]'s hands and flares out!</b></span>", \
user.visible_message("<span class='warning'><b>A massive ball of lightning appears in [user]'s hands and flares out!</b></span>", \
"<span class='shadowling'>You conjure a ball of lightning and release it.</span>")
for(var/turf/T in targets)
@@ -878,7 +872,7 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
playsound(target, 'sound/magic/LightningShock.ogg', 50, 1)
target.Weaken(8)
target.take_organ_damage(0,50)
usr.Beam(target,icon_state="red_lightning",icon='icons/effects/effects.dmi',time=1)
user.Beam(target,icon_state="red_lightning",icon='icons/effects/effects.dmi',time=1)
/obj/effect/proc_holder/spell/self/shadowling_hivemind_ascendant //Large, all-caps text in shadowling chat
@@ -896,5 +890,5 @@ datum/reagent/shadowling_blindness_smoke //Reagent used for above spell
text = "<font size=4>[text]</font>"
for(var/mob/M in mob_list)
if(is_shadow_or_thrall(M) || (M in dead_mob_list))
M << "<span class='shadowling'><b>\[Ascendant\]<i> [usr.real_name]</i>: [text]</b></span>" //Bigger text for ascendants.
M << "<span class='shadowling'><b>\[Ascendant\]<i> [user.real_name]</i>: [text]</b></span>" //Bigger text for ascendants.
log_say("[user.real_name]/[user.key] : [text]")
@@ -9,8 +9,8 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N
clothes_req = 0
action_icon_state = "hatch"
/obj/effect/proc_holder/spell/self/shadowling_hatch/cast(mob/living/carbon/human/H)
if(usr.stat || !ishuman(usr) || !usr || !is_shadow(usr)) return
/obj/effect/proc_holder/spell/self/shadowling_hatch/cast(mob/living/carbon/human/H,mob/user = usr)
if(user.stat || !ishuman(user) || !user || !is_shadow(user)) return
var/hatch_or_no = alert(H,"Are you sure you want to hatch? You cannot undo this!",,"Yes","No")
switch(hatch_or_no)
if("No")
@@ -27,8 +27,8 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N
sleep(50)
var/turf/simulated/floor/F
var/turf/shadowturf = get_turf(usr)
for(F in orange(1, usr))
var/turf/shadowturf = get_turf(user)
for(F in orange(1, user))
new /obj/structure/alien/resin/wall/shadowling(F)
for(var/obj/structure/alien/resin/wall/shadowling/R in shadowturf) //extremely hacky
qdel(R)
@@ -60,7 +60,7 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N
var/newNameId = pick(possibleShadowlingNames)
possibleShadowlingNames.Remove(newNameId)
H.real_name = newNameId
H.name = usr.real_name
H.name = user.real_name
H.SetStunned(0)
H << "<i><b><font size=3>YOU LIVE!!!</i></b></font>"
@@ -107,7 +107,7 @@ var/list/possibleShadowlingNames = list("U'ruan", "Y`shej", "Nex", "Hel-uae", "N
clothes_req = 0
action_icon_state = "ascend"
/obj/effect/proc_holder/spell/self/shadowling_ascend/cast(mob/living/carbon/human/H)
/obj/effect/proc_holder/spell/self/shadowling_ascend/cast(mob/living/carbon/human/H,mob/user = usr)
if(!shadowling_check(H))
return
var/hatch_or_no = alert(H,"It is time to ascend. Are you sure about this?",,"Yes","No")
@@ -163,7 +163,7 @@
clothes_req = 0
range = 14
/obj/effect/proc_holder/spell/aoe_turf/flicker_lights/cast(list/targets)
/obj/effect/proc_holder/spell/aoe_turf/flicker_lights/cast(list/targets,mob/user = usr)
for(var/turf/T in targets)
for(var/obj/machinery/light/L in T)
L.flicker()
@@ -179,7 +179,7 @@
clothes_req = 0
range = 10
/obj/effect/proc_holder/spell/aoe_turf/blindness/cast(list/targets)
/obj/effect/proc_holder/spell/aoe_turf/blindness/cast(list/targets,mob/user = usr)
for(var/mob/living/L in living_mob_list)
var/turf/T = get_turf(L.loc)
if(T && T in targets)
@@ -198,7 +198,7 @@
range = -1
include_user = 1
/obj/effect/proc_holder/spell/targeted/night_vision/cast(list/targets)
/obj/effect/proc_holder/spell/targeted/night_vision/cast(list/targets,mob/user = usr)
for(var/mob/living/target in targets)
if(istype(target, /mob/living/carbon/human))
var/mob/living/carbon/human/H = target