mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-18 18:46:24 +01:00
Whitespace Standardization [MDB IGNORE] (#15748)
* Update settings * Whitespace changes * Comment out merger hooks in gitattributes Corrupt maps would have to be resolved in repo before hooks could be updated * Revert "Whitespace changes" This reverts commitafbdd1d844. * Whitespace again minus example * Gitignore example changelog * Restore changelog merge setting * Keep older dmi hook attribute until hooks can be updated * update vscode settings too * Renormalize remaining * Revert "Gitignore example changelog" This reverts commitde22ad375d. * Attempt to normalize example.yml (and another file I guess) * Try again
This commit is contained in:
@@ -1,25 +1,25 @@
|
||||
/*
|
||||
Aoe turf spells target a ring of tiles around the user
|
||||
This ring has an outer radius (range) and an inner radius (inner_radius)
|
||||
Aoe turf spells have two useful flags: IGNOREDENSE and IGNORESPACE. These are explained in setup.dm
|
||||
*/
|
||||
|
||||
/spell/aoe_turf //affects all turfs in view or range (depends)
|
||||
spell_flags = IGNOREDENSE
|
||||
var/inner_radius = -1 //for all your ring spell needs
|
||||
|
||||
/spell/aoe_turf/choose_targets(mob/user = usr)
|
||||
var/list/targets = list()
|
||||
|
||||
for(var/turf/target in view_or_range(range, holder, selection_type))
|
||||
if(!(target in view_or_range(inner_radius, holder, selection_type)))
|
||||
if(target.density && (spell_flags & IGNOREDENSE))
|
||||
continue
|
||||
if(istype(target, /turf/space) && (spell_flags & IGNORESPACE))
|
||||
continue
|
||||
targets += target
|
||||
|
||||
if(!targets.len) //doesn't waste the spell
|
||||
return
|
||||
|
||||
/*
|
||||
Aoe turf spells target a ring of tiles around the user
|
||||
This ring has an outer radius (range) and an inner radius (inner_radius)
|
||||
Aoe turf spells have two useful flags: IGNOREDENSE and IGNORESPACE. These are explained in setup.dm
|
||||
*/
|
||||
|
||||
/spell/aoe_turf //affects all turfs in view or range (depends)
|
||||
spell_flags = IGNOREDENSE
|
||||
var/inner_radius = -1 //for all your ring spell needs
|
||||
|
||||
/spell/aoe_turf/choose_targets(mob/user = usr)
|
||||
var/list/targets = list()
|
||||
|
||||
for(var/turf/target in view_or_range(range, holder, selection_type))
|
||||
if(!(target in view_or_range(inner_radius, holder, selection_type)))
|
||||
if(target.density && (spell_flags & IGNOREDENSE))
|
||||
continue
|
||||
if(istype(target, /turf/space) && (spell_flags & IGNORESPACE))
|
||||
continue
|
||||
targets += target
|
||||
|
||||
if(!targets.len) //doesn't waste the spell
|
||||
return
|
||||
|
||||
return targets
|
||||
@@ -1,25 +1,25 @@
|
||||
//////////////////////Scrying orb//////////////////////
|
||||
|
||||
/obj/item/weapon/scrying
|
||||
name = "scrying orb"
|
||||
desc = "An incandescent orb of otherworldly energy, staring into it gives you vision beyond mortal means."
|
||||
icon = 'icons/obj/projectiles.dmi'
|
||||
icon_state = "bluespace"
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
throwforce = 10
|
||||
damtype = BURN
|
||||
force = 10
|
||||
hitsound = 'sound/items/welder2.ogg'
|
||||
|
||||
/obj/item/weapon/scrying/attack_self(mob/user as mob)
|
||||
if((user.mind && !wizards.is_antagonist(user.mind)))
|
||||
to_chat(user, "<span class='warning'>You stare into the orb and see nothing but your own reflection.</span>")
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='info'>You can see... everything!</span>")
|
||||
visible_message("<span class='danger'>[user] stares into [src], their eyes glazing over.</span>")
|
||||
|
||||
user.teleop = user.ghostize(1)
|
||||
announce_ghost_joinleave(user.teleop, 1, "You feel that they used a powerful artifact to [pick("invade","disturb","disrupt","infest","taint","spoil","blight")] this place with their presence.")
|
||||
return
|
||||
//////////////////////Scrying orb//////////////////////
|
||||
|
||||
/obj/item/weapon/scrying
|
||||
name = "scrying orb"
|
||||
desc = "An incandescent orb of otherworldly energy, staring into it gives you vision beyond mortal means."
|
||||
icon = 'icons/obj/projectiles.dmi'
|
||||
icon_state = "bluespace"
|
||||
throw_speed = 3
|
||||
throw_range = 7
|
||||
throwforce = 10
|
||||
damtype = BURN
|
||||
force = 10
|
||||
hitsound = 'sound/items/welder2.ogg'
|
||||
|
||||
/obj/item/weapon/scrying/attack_self(mob/user as mob)
|
||||
if((user.mind && !wizards.is_antagonist(user.mind)))
|
||||
to_chat(user, "<span class='warning'>You stare into the orb and see nothing but your own reflection.</span>")
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='info'>You can see... everything!</span>")
|
||||
visible_message("<span class='danger'>[user] stares into [src], their eyes glazing over.</span>")
|
||||
|
||||
user.teleop = user.ghostize(1)
|
||||
announce_ghost_joinleave(user.teleop, 1, "You feel that they used a powerful artifact to [pick("invade","disturb","disrupt","infest","taint","spoil","blight")] this place with their presence.")
|
||||
return
|
||||
|
||||
+428
-428
@@ -1,428 +1,428 @@
|
||||
/obj/item/weapon/spellbook
|
||||
name = "spell book"
|
||||
desc = "The legendary book of spells of the wizard."
|
||||
icon = 'icons/obj/library.dmi'
|
||||
icon_state ="spellbook"
|
||||
throw_speed = 1
|
||||
throw_range = 5
|
||||
w_class = ITEMSIZE_SMALL
|
||||
var/uses = 5
|
||||
var/temp = null
|
||||
var/max_uses = 5
|
||||
var/op = 1
|
||||
|
||||
/obj/item/weapon/spellbook/attack_self(mob/user = usr)
|
||||
if(!user)
|
||||
return
|
||||
if((user.mind && !wizards.is_antagonist(user.mind)))
|
||||
to_chat(usr, "<span class='warning'>You stare at the book but cannot make sense of the markings!</span>")
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if(temp)
|
||||
dat = "[temp]<BR><BR><A href='byond://?src=\ref[src];temp=1'>Clear</A>"
|
||||
else
|
||||
|
||||
// AUTOFIXED BY fix_string_idiocy.py
|
||||
dat = {"<B>The Book of Spells:</B><BR>
|
||||
Spells left to memorize: [uses]<BR>
|
||||
<HR>
|
||||
<B>Memorize which spell:</B><BR>
|
||||
<I>The number after the spell name is the cooldown time.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=magicmissile'>Magic Missile</A> (10)<BR>
|
||||
<I>This spell fires several, slow moving, magic projectiles at nearby targets. If they hit a target, it is paralyzed and takes minor damage.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=fireball'>Fireball</A> (10)<BR>
|
||||
<I>This spell fires a fireball in the direction you're facing and does not require wizard garb. Be careful not to fire it at people that are standing next to you.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=disabletech'>Disable Technology</A> (60)<BR>
|
||||
<I>This spell disables all weapons, cameras and most other technology in range.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=smoke'>Smoke</A> (10)<BR>
|
||||
<I>This spell spawns a cloud of choking smoke at your location and does not require wizard garb.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=blind'>Blind</A> (30)<BR>
|
||||
<I>This spell temporarly blinds a single person and does not require wizard garb.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=subjugation'>Subjugation</A> (30)<BR>
|
||||
<I>This spell temporarily subjugates a target's mind and does not require wizard garb.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=forcewall'>Forcewall</A> (10)<BR>
|
||||
<I>This spell creates an unbreakable wall that lasts for 30 seconds and does not need wizard garb.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=blink'>Blink</A> (2)<BR>
|
||||
<I>This spell randomly teleports you a short distance. Useful for evasion or getting into areas if you have patience.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=teleport'>Teleport</A> (60)<BR>
|
||||
<I>This spell teleports you to a type of area of your selection. Very useful if you are in danger, but has a decent cooldown, and is unpredictable.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=mutate'>Mutate</A> (60)<BR>
|
||||
<I>This spell causes you to turn into a hulk and gain telekinesis for a short while.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=etherealjaunt'>Ethereal Jaunt</A> (60)<BR>
|
||||
<I>This spell creates your ethereal form, temporarily making you invisible and able to pass through walls.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=knock'>Knock</A> (10)<BR>
|
||||
<I>This spell opens nearby doors and does not require wizard garb.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=noclothes'>Remove Clothes Requirement</A> <b>Warning: this takes away 2 spell choices.</b><BR>
|
||||
<HR>
|
||||
<B>Artefacts:</B><BR>
|
||||
Powerful items imbued with eldritch magics. Summoning one will count towards your maximum number of spells.<BR>
|
||||
It is recommended that only experienced wizards attempt to wield such artefacts.<BR>
|
||||
<HR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=mentalfocus'>Mental Focus</A><BR>
|
||||
<I>An artefact that channels the will of the user into destructive bolts of force.</I><BR>
|
||||
<HR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=soulstone'>Six Soul Stone Shards and the spell Artificer</A><BR>
|
||||
<I>Soul Stone Shards are ancient tools capable of capturing and harnessing the spirits of the dead and dying. The spell Artificer allows you to create arcane machines for the captured souls to pilot.</I><BR>
|
||||
<HR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=armor'>Mastercrafted Armor Set</A><BR>
|
||||
<I>An artefact suit of armor that allows you to cast spells while providing more protection against attacks and the void of space.</I><BR>
|
||||
<HR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=staffanimation'>Staff of Animation</A><BR>
|
||||
<I>An arcane staff capable of shooting bolts of eldritch energy which cause inanimate objects to come to life. This magic doesn't affect machines.</I><BR>
|
||||
<HR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=scrying'>Scrying Orb</A><BR>
|
||||
<I>An incandescent orb of crackling energy, using it will allow you to ghost while alive, allowing you to spy upon the station with ease. In addition, buying it will permanently grant you x-ray vision.</I><BR>
|
||||
<HR>"}
|
||||
// END AUTOFIX
|
||||
if(op)
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=rememorize'>Re-memorize Spells</A><BR>"
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
/obj/item/weapon/spellbook/Topic(href, href_list)
|
||||
..()
|
||||
var/mob/living/carbon/human/H = usr
|
||||
|
||||
if(H.stat || H.restrained())
|
||||
return
|
||||
if(!istype(H, /mob/living/carbon/human))
|
||||
return 1
|
||||
|
||||
if(H.mind.special_role == "apprentice")
|
||||
temp = "If you got caught sneaking a peak from your teacher's spellbook, you'd likely be expelled from the Wizard Academy. Better not."
|
||||
return
|
||||
|
||||
if(loc == H || (in_range(src, H) && istype(loc, /turf)))
|
||||
H.set_machine(src)
|
||||
if(href_list["spell_choice"])
|
||||
if(href_list["spell_choice"] == "rememorize")
|
||||
var/area/wizard_station/A = locate()
|
||||
if(usr in A.contents)
|
||||
uses = max_uses
|
||||
H.spellremove()
|
||||
temp = "All spells have been removed. You may now memorize a new set of spells."
|
||||
feedback_add_details("wizard_spell_learned","UM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
else
|
||||
temp = "You may only re-memorize spells whilst located inside the wizard sanctuary."
|
||||
else if(uses >= 1 && max_uses >=1)
|
||||
if(href_list["spell_choice"] == "noclothes")
|
||||
if(uses < 2)
|
||||
return
|
||||
uses--
|
||||
/*
|
||||
*/
|
||||
var/list/available_spells = list(magicmissile = "Magic Missile", fireball = "Fireball", disabletech = "Disable Tech", smoke = "Smoke", blind = "Blind", subjugation = "Subjugation", mindswap = "Mind Transfer", forcewall = "Forcewall", blink = "Blink", teleport = "Teleport", mutate = "Mutate", etherealjaunt = "Ethereal Jaunt", knock = "Knock", horseman = "Curse of the Horseman", staffchange = "Staff of Change", mentalfocus = "Mental Focus", soulstone = "Six Soul Stone Shards and the spell Artificer", armor = "Mastercrafted Armor Set", staffanimate = "Staff of Animation", noclothes = "No Clothes")
|
||||
var/already_knows = 0
|
||||
for(var/spell/aspell in H.spell_list)
|
||||
if(available_spells[href_list["spell_choice"]] == initial(aspell.name))
|
||||
already_knows = 1
|
||||
if(!aspell.can_improve())
|
||||
temp = "This spell cannot be improved further."
|
||||
uses++
|
||||
break
|
||||
else
|
||||
if(aspell.can_improve("speed") && aspell.can_improve("power"))
|
||||
switch(tgui_alert(src, "Do you want to upgrade this spell's speed or power?", "Select Upgrade", list("Speed", "Power", "Cancel")))
|
||||
if("Speed")
|
||||
temp = aspell.quicken_spell()
|
||||
if("Power")
|
||||
temp = aspell.empower_spell()
|
||||
else
|
||||
uses++
|
||||
break
|
||||
else if (aspell.can_improve("speed"))
|
||||
temp = aspell.quicken_spell()
|
||||
else if (aspell.can_improve("power"))
|
||||
temp = aspell.empower_spell()
|
||||
/*
|
||||
*/
|
||||
if(!already_knows)
|
||||
switch(href_list["spell_choice"])
|
||||
if("noclothes")
|
||||
feedback_add_details("wizard_spell_learned","NC")
|
||||
H.add_spell(new/spell/noclothes)
|
||||
temp = "This teaches you how to use your spells without your magical garb, truely you are the wizardest."
|
||||
uses--
|
||||
if("magicmissile")
|
||||
feedback_add_details("wizard_spell_learned","MM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/projectile/magic_missile)
|
||||
temp = "You have learned magic missile."
|
||||
if("fireball")
|
||||
feedback_add_details("wizard_spell_learned","FB") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/projectile/dumbfire/fireball)
|
||||
temp = "You have learned fireball."
|
||||
if("disabletech")
|
||||
feedback_add_details("wizard_spell_learned","DT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/aoe_turf/disable_tech)
|
||||
temp = "You have learned disable technology."
|
||||
if("smoke")
|
||||
feedback_add_details("wizard_spell_learned","SM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/aoe_turf/smoke)
|
||||
temp = "You have learned smoke."
|
||||
if("blind")
|
||||
feedback_add_details("wizard_spell_learned","BD") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/genetic/blind)
|
||||
temp = "You have learned blind."
|
||||
if("subjugation")
|
||||
feedback_add_details("wizard_spell_learned","SJ") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/subjugation)
|
||||
temp = "You have learned subjugate."
|
||||
// if("mindswap")
|
||||
// feedback_add_details("wizard_spell_learned","MT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
// H.add_spell(new/spell/targeted/mind_transfer)
|
||||
// temp = "You have learned mindswap."
|
||||
if("forcewall")
|
||||
feedback_add_details("wizard_spell_learned","FW") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/aoe_turf/conjure/forcewall)
|
||||
temp = "You have learned forcewall."
|
||||
if("blink")
|
||||
feedback_add_details("wizard_spell_learned","BL") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/aoe_turf/blink)
|
||||
temp = "You have learned blink."
|
||||
if("teleport")
|
||||
feedback_add_details("wizard_spell_learned","TP") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/area_teleport)
|
||||
temp = "You have learned teleport."
|
||||
if("mutate")
|
||||
feedback_add_details("wizard_spell_learned","MU") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/genetic/mutate)
|
||||
temp = "You have learned mutate."
|
||||
if("etherealjaunt")
|
||||
feedback_add_details("wizard_spell_learned","EJ") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/ethereal_jaunt)
|
||||
temp = "You have learned ethereal jaunt."
|
||||
if("knock")
|
||||
feedback_add_details("wizard_spell_learned","KN") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/aoe_turf/knock)
|
||||
temp = "You have learned knock."
|
||||
// if("horseman")
|
||||
// feedback_add_details("wizard_spell_learned","HH") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
// H.add_spell(new/spell/targeted/equip_item/horsemask)
|
||||
// temp = "You have learned curse of the horseman."
|
||||
if("mentalfocus")
|
||||
feedback_add_details("wizard_spell_learned","MF") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/weapon/gun/energy/staff/focus(get_turf(H))
|
||||
temp = "An artefact that channels the will of the user into destructive bolts of force."
|
||||
max_uses--
|
||||
if("soulstone")
|
||||
feedback_add_details("wizard_spell_learned","SS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/weapon/storage/belt/soulstone/full(get_turf(H))
|
||||
H.add_spell(new/spell/aoe_turf/conjure/construct)
|
||||
temp = "You have purchased a belt full of soulstones and have learned the artificer spell."
|
||||
max_uses--
|
||||
if("armor")
|
||||
feedback_add_details("wizard_spell_learned","HS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/clothing/shoes/sandal(get_turf(H)) //In case they've lost them.
|
||||
new /obj/item/clothing/gloves/purple(get_turf(H))//To complete the outfit
|
||||
new /obj/item/clothing/suit/space/void/wizard(get_turf(H))
|
||||
new /obj/item/clothing/head/helmet/space/void/wizard(get_turf(H))
|
||||
temp = "You have purchased a suit of wizard armor."
|
||||
max_uses--
|
||||
if("scrying")
|
||||
feedback_add_details("wizard_spell_learned","SO") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/weapon/scrying(get_turf(H))
|
||||
if (!(XRAY in H.mutations))
|
||||
H.mutations.Add(XRAY)
|
||||
H.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS)
|
||||
H.see_in_dark = 8
|
||||
H.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
to_chat(H, "<span class='notice'>The walls suddenly disappear.</span>")
|
||||
temp = "You have purchased a scrying orb, and gained x-ray vision."
|
||||
max_uses--
|
||||
else
|
||||
if(href_list["temp"])
|
||||
temp = null
|
||||
attack_self()
|
||||
|
||||
return
|
||||
|
||||
//Single Use Spellbooks//
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse
|
||||
var/spell = /spell/targeted/projectile/magic_missile //just a placeholder to avoid runtimes if someone spawned the generic
|
||||
var/spellname = "sandbox"
|
||||
var/used = 0
|
||||
name = "spellbook of "
|
||||
uses = 1
|
||||
max_uses = 1
|
||||
desc = "This template spellbook was never meant for the eyes of man..."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/New()
|
||||
..()
|
||||
name += spellname
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/attack_self(mob/user as mob)
|
||||
var/spell/S = new spell(user)
|
||||
for(var/spell/knownspell in user.spell_list)
|
||||
if(knownspell.type == S.type)
|
||||
if(user.mind)
|
||||
// TODO: Update to new antagonist system.
|
||||
if(user.mind.special_role == "apprentice" || user.mind.special_role == "Wizard")
|
||||
to_chat(user, "<span class='notice'>You're already far more versed in this spell than this flimsy how-to book can provide.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You've already read this one.</span>")
|
||||
return
|
||||
if(used)
|
||||
recoil(user)
|
||||
else
|
||||
user.add_spell(S)
|
||||
to_chat(user, "<span class='notice'>you rapidly read through the arcane book. Suddenly you realize you understand [spellname]!</span>")
|
||||
user.attack_log += text("\[[time_stamp()]\] [span_orange("[user.real_name] ([user.ckey]) learned the spell [spellname] ([S]).")]")
|
||||
onlearned(user)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/proc/recoil(mob/user as mob)
|
||||
user.visible_message("<span class='warning'>[src] glows in a black light!</span>")
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/proc/onlearned(mob/user as mob)
|
||||
used = 1
|
||||
user.visible_message("<span class='caution'>[src] glows dark for a second!</span>")
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/attackby()
|
||||
return
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/fireball
|
||||
spell = /spell/targeted/projectile/dumbfire/fireball
|
||||
spellname = "fireball"
|
||||
icon_state ="bookfireball"
|
||||
desc = "This book feels warm to the touch."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/fireball/recoil(mob/user as mob)
|
||||
..()
|
||||
explosion(user.loc, -1, 0, 2, 3, 0)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/smoke
|
||||
spell = /spell/aoe_turf/smoke
|
||||
spellname = "smoke"
|
||||
icon_state ="booksmoke"
|
||||
desc = "This book is overflowing with the dank arts."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/smoke/recoil(mob/living/user as mob)
|
||||
..()
|
||||
to_chat(user, "<span class='caution'>Your stomach rumbles...</span>")
|
||||
if(user.nutrition)
|
||||
user.adjust_nutrition(-200)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/blind
|
||||
spell = /spell/targeted/genetic/blind
|
||||
spellname = "blind"
|
||||
icon_state ="bookblind"
|
||||
desc = "This book looks blurry, no matter how you look at it."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/blind/recoil(mob/user as mob)
|
||||
..()
|
||||
to_chat(user, "<span class='warning'>You go blind!</span>")
|
||||
user.Blind(10)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/mindswap
|
||||
spell = /spell/targeted/mind_transfer
|
||||
spellname = "mindswap"
|
||||
icon_state ="bookmindswap"
|
||||
desc = "This book's cover is pristine, though its pages look ragged and torn."
|
||||
var/mob/stored_swap = null //Used in used book recoils to store an identity for mindswaps
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/mindswap/onlearned()
|
||||
spellname = pick("fireball","smoke","blind","forcewall","knock","horses","charge")
|
||||
icon_state = "book[spellname]"
|
||||
name = "spellbook of [spellname]" //Note, desc doesn't change by design
|
||||
..()
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/mindswap/recoil(mob/user as mob)
|
||||
..()
|
||||
if(stored_swap in dead_mob_list)
|
||||
stored_swap = null
|
||||
if(!stored_swap)
|
||||
stored_swap = user
|
||||
to_chat(user, "<span class='warning'>For a moment you feel like you don't even know who you are anymore.</span>")
|
||||
return
|
||||
if(stored_swap == user)
|
||||
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/observer/dead/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
|
||||
|
||||
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>")
|
||||
stored_swap = null
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/forcewall
|
||||
spell = /spell/aoe_turf/conjure/forcewall
|
||||
spellname = "forcewall"
|
||||
icon_state ="bookforcewall"
|
||||
desc = "This book has a dedication to mimes everywhere inside the front cover."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/forcewall/recoil(mob/user as mob)
|
||||
..()
|
||||
to_chat(user, "<span class='warning'>You suddenly feel very solid!</span>")
|
||||
var/obj/structure/closet/statue/S = new /obj/structure/closet/statue(user.loc, user)
|
||||
S.timer = 30
|
||||
user.drop_item()
|
||||
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/knock
|
||||
spell = /spell/aoe_turf/knock
|
||||
spellname = "knock"
|
||||
icon_state ="bookknock"
|
||||
desc = "This book is hard to hold closed properly."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/knock/recoil(mob/user as mob)
|
||||
..()
|
||||
to_chat(user, "<span class='warning'>You're knocked down!</span>")
|
||||
user.Weaken(20)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/horsemask
|
||||
spell = /spell/targeted/equip_item/horsemask
|
||||
spellname = "horses"
|
||||
icon_state ="bookhorses"
|
||||
desc = "This book is more horse than your mind has room for."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/horsemask/recoil(mob/living/carbon/user as mob)
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
to_chat(user, "<font size='15' color='red'><b>HOR-SIE HAS RISEN</b></font>")
|
||||
var/obj/item/clothing/mask/horsehead/magichead = new /obj/item/clothing/mask/horsehead
|
||||
magichead.canremove = FALSE //curses!
|
||||
magichead.flags_inv = null //so you can still see their face
|
||||
magichead.voicechange = 1 //NEEEEIIGHH
|
||||
user.drop_from_inventory(user.wear_mask)
|
||||
user.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1)
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>I say thee neigh</span>")
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/charge
|
||||
spell = /spell/aoe_turf/charge
|
||||
spellname = "charging"
|
||||
icon_state ="bookcharge"
|
||||
desc = "This book is made of 100% post-consumer wizard."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/charge/recoil(mob/user as mob)
|
||||
..()
|
||||
to_chat(user, "<span class='warning'>[src] suddenly feels very warm!</span>")
|
||||
empulse(src, 1, 1, 1, 1)
|
||||
/obj/item/weapon/spellbook
|
||||
name = "spell book"
|
||||
desc = "The legendary book of spells of the wizard."
|
||||
icon = 'icons/obj/library.dmi'
|
||||
icon_state ="spellbook"
|
||||
throw_speed = 1
|
||||
throw_range = 5
|
||||
w_class = ITEMSIZE_SMALL
|
||||
var/uses = 5
|
||||
var/temp = null
|
||||
var/max_uses = 5
|
||||
var/op = 1
|
||||
|
||||
/obj/item/weapon/spellbook/attack_self(mob/user = usr)
|
||||
if(!user)
|
||||
return
|
||||
if((user.mind && !wizards.is_antagonist(user.mind)))
|
||||
to_chat(usr, "<span class='warning'>You stare at the book but cannot make sense of the markings!</span>")
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if(temp)
|
||||
dat = "[temp]<BR><BR><A href='byond://?src=\ref[src];temp=1'>Clear</A>"
|
||||
else
|
||||
|
||||
// AUTOFIXED BY fix_string_idiocy.py
|
||||
dat = {"<B>The Book of Spells:</B><BR>
|
||||
Spells left to memorize: [uses]<BR>
|
||||
<HR>
|
||||
<B>Memorize which spell:</B><BR>
|
||||
<I>The number after the spell name is the cooldown time.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=magicmissile'>Magic Missile</A> (10)<BR>
|
||||
<I>This spell fires several, slow moving, magic projectiles at nearby targets. If they hit a target, it is paralyzed and takes minor damage.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=fireball'>Fireball</A> (10)<BR>
|
||||
<I>This spell fires a fireball in the direction you're facing and does not require wizard garb. Be careful not to fire it at people that are standing next to you.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=disabletech'>Disable Technology</A> (60)<BR>
|
||||
<I>This spell disables all weapons, cameras and most other technology in range.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=smoke'>Smoke</A> (10)<BR>
|
||||
<I>This spell spawns a cloud of choking smoke at your location and does not require wizard garb.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=blind'>Blind</A> (30)<BR>
|
||||
<I>This spell temporarly blinds a single person and does not require wizard garb.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=subjugation'>Subjugation</A> (30)<BR>
|
||||
<I>This spell temporarily subjugates a target's mind and does not require wizard garb.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=forcewall'>Forcewall</A> (10)<BR>
|
||||
<I>This spell creates an unbreakable wall that lasts for 30 seconds and does not need wizard garb.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=blink'>Blink</A> (2)<BR>
|
||||
<I>This spell randomly teleports you a short distance. Useful for evasion or getting into areas if you have patience.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=teleport'>Teleport</A> (60)<BR>
|
||||
<I>This spell teleports you to a type of area of your selection. Very useful if you are in danger, but has a decent cooldown, and is unpredictable.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=mutate'>Mutate</A> (60)<BR>
|
||||
<I>This spell causes you to turn into a hulk and gain telekinesis for a short while.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=etherealjaunt'>Ethereal Jaunt</A> (60)<BR>
|
||||
<I>This spell creates your ethereal form, temporarily making you invisible and able to pass through walls.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=knock'>Knock</A> (10)<BR>
|
||||
<I>This spell opens nearby doors and does not require wizard garb.</I><BR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=noclothes'>Remove Clothes Requirement</A> <b>Warning: this takes away 2 spell choices.</b><BR>
|
||||
<HR>
|
||||
<B>Artefacts:</B><BR>
|
||||
Powerful items imbued with eldritch magics. Summoning one will count towards your maximum number of spells.<BR>
|
||||
It is recommended that only experienced wizards attempt to wield such artefacts.<BR>
|
||||
<HR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=mentalfocus'>Mental Focus</A><BR>
|
||||
<I>An artefact that channels the will of the user into destructive bolts of force.</I><BR>
|
||||
<HR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=soulstone'>Six Soul Stone Shards and the spell Artificer</A><BR>
|
||||
<I>Soul Stone Shards are ancient tools capable of capturing and harnessing the spirits of the dead and dying. The spell Artificer allows you to create arcane machines for the captured souls to pilot.</I><BR>
|
||||
<HR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=armor'>Mastercrafted Armor Set</A><BR>
|
||||
<I>An artefact suit of armor that allows you to cast spells while providing more protection against attacks and the void of space.</I><BR>
|
||||
<HR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=staffanimation'>Staff of Animation</A><BR>
|
||||
<I>An arcane staff capable of shooting bolts of eldritch energy which cause inanimate objects to come to life. This magic doesn't affect machines.</I><BR>
|
||||
<HR>
|
||||
<A href='byond://?src=\ref[src];spell_choice=scrying'>Scrying Orb</A><BR>
|
||||
<I>An incandescent orb of crackling energy, using it will allow you to ghost while alive, allowing you to spy upon the station with ease. In addition, buying it will permanently grant you x-ray vision.</I><BR>
|
||||
<HR>"}
|
||||
// END AUTOFIX
|
||||
if(op)
|
||||
dat += "<A href='byond://?src=\ref[src];spell_choice=rememorize'>Re-memorize Spells</A><BR>"
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
/obj/item/weapon/spellbook/Topic(href, href_list)
|
||||
..()
|
||||
var/mob/living/carbon/human/H = usr
|
||||
|
||||
if(H.stat || H.restrained())
|
||||
return
|
||||
if(!istype(H, /mob/living/carbon/human))
|
||||
return 1
|
||||
|
||||
if(H.mind.special_role == "apprentice")
|
||||
temp = "If you got caught sneaking a peak from your teacher's spellbook, you'd likely be expelled from the Wizard Academy. Better not."
|
||||
return
|
||||
|
||||
if(loc == H || (in_range(src, H) && istype(loc, /turf)))
|
||||
H.set_machine(src)
|
||||
if(href_list["spell_choice"])
|
||||
if(href_list["spell_choice"] == "rememorize")
|
||||
var/area/wizard_station/A = locate()
|
||||
if(usr in A.contents)
|
||||
uses = max_uses
|
||||
H.spellremove()
|
||||
temp = "All spells have been removed. You may now memorize a new set of spells."
|
||||
feedback_add_details("wizard_spell_learned","UM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
else
|
||||
temp = "You may only re-memorize spells whilst located inside the wizard sanctuary."
|
||||
else if(uses >= 1 && max_uses >=1)
|
||||
if(href_list["spell_choice"] == "noclothes")
|
||||
if(uses < 2)
|
||||
return
|
||||
uses--
|
||||
/*
|
||||
*/
|
||||
var/list/available_spells = list(magicmissile = "Magic Missile", fireball = "Fireball", disabletech = "Disable Tech", smoke = "Smoke", blind = "Blind", subjugation = "Subjugation", mindswap = "Mind Transfer", forcewall = "Forcewall", blink = "Blink", teleport = "Teleport", mutate = "Mutate", etherealjaunt = "Ethereal Jaunt", knock = "Knock", horseman = "Curse of the Horseman", staffchange = "Staff of Change", mentalfocus = "Mental Focus", soulstone = "Six Soul Stone Shards and the spell Artificer", armor = "Mastercrafted Armor Set", staffanimate = "Staff of Animation", noclothes = "No Clothes")
|
||||
var/already_knows = 0
|
||||
for(var/spell/aspell in H.spell_list)
|
||||
if(available_spells[href_list["spell_choice"]] == initial(aspell.name))
|
||||
already_knows = 1
|
||||
if(!aspell.can_improve())
|
||||
temp = "This spell cannot be improved further."
|
||||
uses++
|
||||
break
|
||||
else
|
||||
if(aspell.can_improve("speed") && aspell.can_improve("power"))
|
||||
switch(tgui_alert(src, "Do you want to upgrade this spell's speed or power?", "Select Upgrade", list("Speed", "Power", "Cancel")))
|
||||
if("Speed")
|
||||
temp = aspell.quicken_spell()
|
||||
if("Power")
|
||||
temp = aspell.empower_spell()
|
||||
else
|
||||
uses++
|
||||
break
|
||||
else if (aspell.can_improve("speed"))
|
||||
temp = aspell.quicken_spell()
|
||||
else if (aspell.can_improve("power"))
|
||||
temp = aspell.empower_spell()
|
||||
/*
|
||||
*/
|
||||
if(!already_knows)
|
||||
switch(href_list["spell_choice"])
|
||||
if("noclothes")
|
||||
feedback_add_details("wizard_spell_learned","NC")
|
||||
H.add_spell(new/spell/noclothes)
|
||||
temp = "This teaches you how to use your spells without your magical garb, truely you are the wizardest."
|
||||
uses--
|
||||
if("magicmissile")
|
||||
feedback_add_details("wizard_spell_learned","MM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/projectile/magic_missile)
|
||||
temp = "You have learned magic missile."
|
||||
if("fireball")
|
||||
feedback_add_details("wizard_spell_learned","FB") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/projectile/dumbfire/fireball)
|
||||
temp = "You have learned fireball."
|
||||
if("disabletech")
|
||||
feedback_add_details("wizard_spell_learned","DT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/aoe_turf/disable_tech)
|
||||
temp = "You have learned disable technology."
|
||||
if("smoke")
|
||||
feedback_add_details("wizard_spell_learned","SM") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/aoe_turf/smoke)
|
||||
temp = "You have learned smoke."
|
||||
if("blind")
|
||||
feedback_add_details("wizard_spell_learned","BD") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/genetic/blind)
|
||||
temp = "You have learned blind."
|
||||
if("subjugation")
|
||||
feedback_add_details("wizard_spell_learned","SJ") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/subjugation)
|
||||
temp = "You have learned subjugate."
|
||||
// if("mindswap")
|
||||
// feedback_add_details("wizard_spell_learned","MT") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
// H.add_spell(new/spell/targeted/mind_transfer)
|
||||
// temp = "You have learned mindswap."
|
||||
if("forcewall")
|
||||
feedback_add_details("wizard_spell_learned","FW") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/aoe_turf/conjure/forcewall)
|
||||
temp = "You have learned forcewall."
|
||||
if("blink")
|
||||
feedback_add_details("wizard_spell_learned","BL") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/aoe_turf/blink)
|
||||
temp = "You have learned blink."
|
||||
if("teleport")
|
||||
feedback_add_details("wizard_spell_learned","TP") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/area_teleport)
|
||||
temp = "You have learned teleport."
|
||||
if("mutate")
|
||||
feedback_add_details("wizard_spell_learned","MU") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/genetic/mutate)
|
||||
temp = "You have learned mutate."
|
||||
if("etherealjaunt")
|
||||
feedback_add_details("wizard_spell_learned","EJ") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/targeted/ethereal_jaunt)
|
||||
temp = "You have learned ethereal jaunt."
|
||||
if("knock")
|
||||
feedback_add_details("wizard_spell_learned","KN") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
H.add_spell(new/spell/aoe_turf/knock)
|
||||
temp = "You have learned knock."
|
||||
// if("horseman")
|
||||
// feedback_add_details("wizard_spell_learned","HH") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
// H.add_spell(new/spell/targeted/equip_item/horsemask)
|
||||
// temp = "You have learned curse of the horseman."
|
||||
if("mentalfocus")
|
||||
feedback_add_details("wizard_spell_learned","MF") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/weapon/gun/energy/staff/focus(get_turf(H))
|
||||
temp = "An artefact that channels the will of the user into destructive bolts of force."
|
||||
max_uses--
|
||||
if("soulstone")
|
||||
feedback_add_details("wizard_spell_learned","SS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/weapon/storage/belt/soulstone/full(get_turf(H))
|
||||
H.add_spell(new/spell/aoe_turf/conjure/construct)
|
||||
temp = "You have purchased a belt full of soulstones and have learned the artificer spell."
|
||||
max_uses--
|
||||
if("armor")
|
||||
feedback_add_details("wizard_spell_learned","HS") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/clothing/shoes/sandal(get_turf(H)) //In case they've lost them.
|
||||
new /obj/item/clothing/gloves/purple(get_turf(H))//To complete the outfit
|
||||
new /obj/item/clothing/suit/space/void/wizard(get_turf(H))
|
||||
new /obj/item/clothing/head/helmet/space/void/wizard(get_turf(H))
|
||||
temp = "You have purchased a suit of wizard armor."
|
||||
max_uses--
|
||||
if("scrying")
|
||||
feedback_add_details("wizard_spell_learned","SO") //please do not change the abbreviation to keep data processing consistent. Add a unique id to any new spells
|
||||
new /obj/item/weapon/scrying(get_turf(H))
|
||||
if (!(XRAY in H.mutations))
|
||||
H.mutations.Add(XRAY)
|
||||
H.sight |= (SEE_MOBS|SEE_OBJS|SEE_TURFS)
|
||||
H.see_in_dark = 8
|
||||
H.see_invisible = SEE_INVISIBLE_LEVEL_TWO
|
||||
to_chat(H, "<span class='notice'>The walls suddenly disappear.</span>")
|
||||
temp = "You have purchased a scrying orb, and gained x-ray vision."
|
||||
max_uses--
|
||||
else
|
||||
if(href_list["temp"])
|
||||
temp = null
|
||||
attack_self()
|
||||
|
||||
return
|
||||
|
||||
//Single Use Spellbooks//
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse
|
||||
var/spell = /spell/targeted/projectile/magic_missile //just a placeholder to avoid runtimes if someone spawned the generic
|
||||
var/spellname = "sandbox"
|
||||
var/used = 0
|
||||
name = "spellbook of "
|
||||
uses = 1
|
||||
max_uses = 1
|
||||
desc = "This template spellbook was never meant for the eyes of man..."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/New()
|
||||
..()
|
||||
name += spellname
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/attack_self(mob/user as mob)
|
||||
var/spell/S = new spell(user)
|
||||
for(var/spell/knownspell in user.spell_list)
|
||||
if(knownspell.type == S.type)
|
||||
if(user.mind)
|
||||
// TODO: Update to new antagonist system.
|
||||
if(user.mind.special_role == "apprentice" || user.mind.special_role == "Wizard")
|
||||
to_chat(user, "<span class='notice'>You're already far more versed in this spell than this flimsy how-to book can provide.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You've already read this one.</span>")
|
||||
return
|
||||
if(used)
|
||||
recoil(user)
|
||||
else
|
||||
user.add_spell(S)
|
||||
to_chat(user, "<span class='notice'>you rapidly read through the arcane book. Suddenly you realize you understand [spellname]!</span>")
|
||||
user.attack_log += text("\[[time_stamp()]\] [span_orange("[user.real_name] ([user.ckey]) learned the spell [spellname] ([S]).")]")
|
||||
onlearned(user)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/proc/recoil(mob/user as mob)
|
||||
user.visible_message("<span class='warning'>[src] glows in a black light!</span>")
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/proc/onlearned(mob/user as mob)
|
||||
used = 1
|
||||
user.visible_message("<span class='caution'>[src] glows dark for a second!</span>")
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/attackby()
|
||||
return
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/fireball
|
||||
spell = /spell/targeted/projectile/dumbfire/fireball
|
||||
spellname = "fireball"
|
||||
icon_state ="bookfireball"
|
||||
desc = "This book feels warm to the touch."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/fireball/recoil(mob/user as mob)
|
||||
..()
|
||||
explosion(user.loc, -1, 0, 2, 3, 0)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/smoke
|
||||
spell = /spell/aoe_turf/smoke
|
||||
spellname = "smoke"
|
||||
icon_state ="booksmoke"
|
||||
desc = "This book is overflowing with the dank arts."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/smoke/recoil(mob/living/user as mob)
|
||||
..()
|
||||
to_chat(user, "<span class='caution'>Your stomach rumbles...</span>")
|
||||
if(user.nutrition)
|
||||
user.adjust_nutrition(-200)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/blind
|
||||
spell = /spell/targeted/genetic/blind
|
||||
spellname = "blind"
|
||||
icon_state ="bookblind"
|
||||
desc = "This book looks blurry, no matter how you look at it."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/blind/recoil(mob/user as mob)
|
||||
..()
|
||||
to_chat(user, "<span class='warning'>You go blind!</span>")
|
||||
user.Blind(10)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/mindswap
|
||||
spell = /spell/targeted/mind_transfer
|
||||
spellname = "mindswap"
|
||||
icon_state ="bookmindswap"
|
||||
desc = "This book's cover is pristine, though its pages look ragged and torn."
|
||||
var/mob/stored_swap = null //Used in used book recoils to store an identity for mindswaps
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/mindswap/onlearned()
|
||||
spellname = pick("fireball","smoke","blind","forcewall","knock","horses","charge")
|
||||
icon_state = "book[spellname]"
|
||||
name = "spellbook of [spellname]" //Note, desc doesn't change by design
|
||||
..()
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/mindswap/recoil(mob/user as mob)
|
||||
..()
|
||||
if(stored_swap in dead_mob_list)
|
||||
stored_swap = null
|
||||
if(!stored_swap)
|
||||
stored_swap = user
|
||||
to_chat(user, "<span class='warning'>For a moment you feel like you don't even know who you are anymore.</span>")
|
||||
return
|
||||
if(stored_swap == user)
|
||||
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/observer/dead/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
|
||||
|
||||
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>")
|
||||
stored_swap = null
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/forcewall
|
||||
spell = /spell/aoe_turf/conjure/forcewall
|
||||
spellname = "forcewall"
|
||||
icon_state ="bookforcewall"
|
||||
desc = "This book has a dedication to mimes everywhere inside the front cover."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/forcewall/recoil(mob/user as mob)
|
||||
..()
|
||||
to_chat(user, "<span class='warning'>You suddenly feel very solid!</span>")
|
||||
var/obj/structure/closet/statue/S = new /obj/structure/closet/statue(user.loc, user)
|
||||
S.timer = 30
|
||||
user.drop_item()
|
||||
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/knock
|
||||
spell = /spell/aoe_turf/knock
|
||||
spellname = "knock"
|
||||
icon_state ="bookknock"
|
||||
desc = "This book is hard to hold closed properly."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/knock/recoil(mob/user as mob)
|
||||
..()
|
||||
to_chat(user, "<span class='warning'>You're knocked down!</span>")
|
||||
user.Weaken(20)
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/horsemask
|
||||
spell = /spell/targeted/equip_item/horsemask
|
||||
spellname = "horses"
|
||||
icon_state ="bookhorses"
|
||||
desc = "This book is more horse than your mind has room for."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/horsemask/recoil(mob/living/carbon/user as mob)
|
||||
if(istype(user, /mob/living/carbon/human))
|
||||
to_chat(user, "<font size='15' color='red'><b>HOR-SIE HAS RISEN</b></font>")
|
||||
var/obj/item/clothing/mask/horsehead/magichead = new /obj/item/clothing/mask/horsehead
|
||||
magichead.canremove = FALSE //curses!
|
||||
magichead.flags_inv = null //so you can still see their face
|
||||
magichead.voicechange = 1 //NEEEEIIGHH
|
||||
user.drop_from_inventory(user.wear_mask)
|
||||
user.equip_to_slot_if_possible(magichead, slot_wear_mask, 1, 1)
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>I say thee neigh</span>")
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/charge
|
||||
spell = /spell/aoe_turf/charge
|
||||
spellname = "charging"
|
||||
icon_state ="bookcharge"
|
||||
desc = "This book is made of 100% post-consumer wizard."
|
||||
|
||||
/obj/item/weapon/spellbook/oneuse/charge/recoil(mob/user as mob)
|
||||
..()
|
||||
to_chat(user, "<span class='warning'>[src] suddenly feels very warm!</span>")
|
||||
empulse(src, 1, 1, 1, 1)
|
||||
|
||||
@@ -1,88 +1,88 @@
|
||||
/datum/mind
|
||||
var/list/learned_spells
|
||||
|
||||
/mob/Life()
|
||||
..()
|
||||
if(spell_masters && spell_masters.len)
|
||||
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
|
||||
spell_master.update_spells(0, src)
|
||||
|
||||
/mob/Login()
|
||||
..()
|
||||
if(spell_masters)
|
||||
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
|
||||
spell_master.toggle_open(1)
|
||||
client.screen -= spell_master
|
||||
|
||||
/mob/Stat()
|
||||
. = ..()
|
||||
if(. && spell_list && spell_list.len)
|
||||
for(var/spell/S in spell_list)
|
||||
if((!S.connected_button) || !statpanel(S.panel))
|
||||
continue //Not showing the noclothes spell
|
||||
switch(S.charge_type)
|
||||
if(Sp_RECHARGE)
|
||||
statpanel(S.panel,"[S.charge_counter/10.0]/[S.charge_max/10]",S.connected_button)
|
||||
if(Sp_CHARGES)
|
||||
statpanel(S.panel,"[S.charge_counter]/[S.charge_max]",S.connected_button)
|
||||
if(Sp_HOLDVAR)
|
||||
statpanel(S.panel,"[S.holder_var_type] [S.holder_var_amount]",S.connected_button)
|
||||
|
||||
/hook/clone/proc/restore_spells(var/mob/H)
|
||||
if(H.mind && H.mind.learned_spells)
|
||||
for(var/spell/spell_to_add in H.mind.learned_spells)
|
||||
H.add_spell(spell_to_add)
|
||||
|
||||
/mob/proc/add_spell(var/spell/spell_to_add, var/spell_base = "wiz_spell_ready", var/master_type = /obj/screen/movable/spell_master)
|
||||
if(!spell_masters)
|
||||
spell_masters = list()
|
||||
|
||||
if(spell_masters.len)
|
||||
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
|
||||
if(spell_master.type == master_type)
|
||||
spell_list.Add(spell_to_add)
|
||||
spell_master.add_spell(spell_to_add)
|
||||
return 1
|
||||
|
||||
var/obj/screen/movable/spell_master/new_spell_master = new master_type //we're here because either we didn't find our type, or we have no spell masters to attach to
|
||||
if(client)
|
||||
src.client.screen += new_spell_master
|
||||
new_spell_master.spell_holder = src
|
||||
new_spell_master.add_spell(spell_to_add)
|
||||
if(spell_base)
|
||||
new_spell_master.icon_state = spell_base
|
||||
spell_masters.Add(new_spell_master)
|
||||
spell_list.Add(spell_to_add)
|
||||
if(mind)
|
||||
if(!mind.learned_spells)
|
||||
mind.learned_spells = list()
|
||||
mind.learned_spells += spell_to_add
|
||||
|
||||
return 1
|
||||
|
||||
/mob/proc/remove_spell(var/spell/spell_to_remove)
|
||||
if(!spell_to_remove || !istype(spell_to_remove))
|
||||
return
|
||||
|
||||
if(!(spell_to_remove in spell_list))
|
||||
return
|
||||
|
||||
if(!spell_masters || !spell_masters.len)
|
||||
return
|
||||
|
||||
if(mind && mind.learned_spells)
|
||||
mind.learned_spells.Remove(spell_to_remove)
|
||||
spell_list.Remove(spell_to_remove)
|
||||
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
|
||||
spell_master.remove_spell(spell_to_remove)
|
||||
return 1
|
||||
|
||||
/mob/proc/silence_spells(var/amount = 0)
|
||||
if(!(amount >= 0))
|
||||
return
|
||||
|
||||
if(!spell_masters || !spell_masters.len)
|
||||
return
|
||||
|
||||
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
|
||||
spell_master.silence_spells(amount)
|
||||
/datum/mind
|
||||
var/list/learned_spells
|
||||
|
||||
/mob/Life()
|
||||
..()
|
||||
if(spell_masters && spell_masters.len)
|
||||
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
|
||||
spell_master.update_spells(0, src)
|
||||
|
||||
/mob/Login()
|
||||
..()
|
||||
if(spell_masters)
|
||||
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
|
||||
spell_master.toggle_open(1)
|
||||
client.screen -= spell_master
|
||||
|
||||
/mob/Stat()
|
||||
. = ..()
|
||||
if(. && spell_list && spell_list.len)
|
||||
for(var/spell/S in spell_list)
|
||||
if((!S.connected_button) || !statpanel(S.panel))
|
||||
continue //Not showing the noclothes spell
|
||||
switch(S.charge_type)
|
||||
if(Sp_RECHARGE)
|
||||
statpanel(S.panel,"[S.charge_counter/10.0]/[S.charge_max/10]",S.connected_button)
|
||||
if(Sp_CHARGES)
|
||||
statpanel(S.panel,"[S.charge_counter]/[S.charge_max]",S.connected_button)
|
||||
if(Sp_HOLDVAR)
|
||||
statpanel(S.panel,"[S.holder_var_type] [S.holder_var_amount]",S.connected_button)
|
||||
|
||||
/hook/clone/proc/restore_spells(var/mob/H)
|
||||
if(H.mind && H.mind.learned_spells)
|
||||
for(var/spell/spell_to_add in H.mind.learned_spells)
|
||||
H.add_spell(spell_to_add)
|
||||
|
||||
/mob/proc/add_spell(var/spell/spell_to_add, var/spell_base = "wiz_spell_ready", var/master_type = /obj/screen/movable/spell_master)
|
||||
if(!spell_masters)
|
||||
spell_masters = list()
|
||||
|
||||
if(spell_masters.len)
|
||||
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
|
||||
if(spell_master.type == master_type)
|
||||
spell_list.Add(spell_to_add)
|
||||
spell_master.add_spell(spell_to_add)
|
||||
return 1
|
||||
|
||||
var/obj/screen/movable/spell_master/new_spell_master = new master_type //we're here because either we didn't find our type, or we have no spell masters to attach to
|
||||
if(client)
|
||||
src.client.screen += new_spell_master
|
||||
new_spell_master.spell_holder = src
|
||||
new_spell_master.add_spell(spell_to_add)
|
||||
if(spell_base)
|
||||
new_spell_master.icon_state = spell_base
|
||||
spell_masters.Add(new_spell_master)
|
||||
spell_list.Add(spell_to_add)
|
||||
if(mind)
|
||||
if(!mind.learned_spells)
|
||||
mind.learned_spells = list()
|
||||
mind.learned_spells += spell_to_add
|
||||
|
||||
return 1
|
||||
|
||||
/mob/proc/remove_spell(var/spell/spell_to_remove)
|
||||
if(!spell_to_remove || !istype(spell_to_remove))
|
||||
return
|
||||
|
||||
if(!(spell_to_remove in spell_list))
|
||||
return
|
||||
|
||||
if(!spell_masters || !spell_masters.len)
|
||||
return
|
||||
|
||||
if(mind && mind.learned_spells)
|
||||
mind.learned_spells.Remove(spell_to_remove)
|
||||
spell_list.Remove(spell_to_remove)
|
||||
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
|
||||
spell_master.remove_spell(spell_to_remove)
|
||||
return 1
|
||||
|
||||
/mob/proc/silence_spells(var/amount = 0)
|
||||
if(!(amount >= 0))
|
||||
return
|
||||
|
||||
if(!spell_masters || !spell_masters.len)
|
||||
return
|
||||
|
||||
for(var/obj/screen/movable/spell_master/spell_master in spell_masters)
|
||||
spell_master.silence_spells(amount)
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
//You can set duration to 0 to have the items last forever
|
||||
|
||||
/spell/targeted/equip_item
|
||||
name = "equipment spell"
|
||||
|
||||
var/list/equipped_summons = list() //assoc list of text ids and paths to spawn
|
||||
|
||||
var/list/summoned_items = list() //list of items we summoned and will dispose when the spell runs out
|
||||
|
||||
var/delete_old = 1 //if the item previously in the slot is deleted - otherwise, it's dropped
|
||||
|
||||
/spell/targeted/equip_item/cast(list/targets, mob/user = usr)
|
||||
..()
|
||||
for(var/mob/living/L in targets)
|
||||
for(var/slot_id in equipped_summons)
|
||||
var/to_create = equipped_summons[slot_id]
|
||||
slot_id = text2num(slot_id) //because the index is text, we access this instead
|
||||
var/obj/item/new_item = summon_item(to_create)
|
||||
var/obj/item/old_item = L.get_equipped_item(slot_id)
|
||||
L.equip_to_slot(new_item, slot_id)
|
||||
if(old_item)
|
||||
L.remove_from_mob(old_item)
|
||||
if(delete_old)
|
||||
qdel(old_item)
|
||||
else
|
||||
old_item.loc = L.loc
|
||||
|
||||
if(duration)
|
||||
summoned_items += new_item //we store it in a list to remove later
|
||||
|
||||
if(duration)
|
||||
spawn(duration)
|
||||
for(var/obj/item/to_remove in summoned_items)
|
||||
if(istype(to_remove.loc, /mob))
|
||||
var/mob/M = to_remove.loc
|
||||
M.remove_from_mob(to_remove)
|
||||
qdel(to_remove)
|
||||
|
||||
/spell/targeted/equip_item/proc/summon_item(var/newtype)
|
||||
return new newtype
|
||||
//You can set duration to 0 to have the items last forever
|
||||
|
||||
/spell/targeted/equip_item
|
||||
name = "equipment spell"
|
||||
|
||||
var/list/equipped_summons = list() //assoc list of text ids and paths to spawn
|
||||
|
||||
var/list/summoned_items = list() //list of items we summoned and will dispose when the spell runs out
|
||||
|
||||
var/delete_old = 1 //if the item previously in the slot is deleted - otherwise, it's dropped
|
||||
|
||||
/spell/targeted/equip_item/cast(list/targets, mob/user = usr)
|
||||
..()
|
||||
for(var/mob/living/L in targets)
|
||||
for(var/slot_id in equipped_summons)
|
||||
var/to_create = equipped_summons[slot_id]
|
||||
slot_id = text2num(slot_id) //because the index is text, we access this instead
|
||||
var/obj/item/new_item = summon_item(to_create)
|
||||
var/obj/item/old_item = L.get_equipped_item(slot_id)
|
||||
L.equip_to_slot(new_item, slot_id)
|
||||
if(old_item)
|
||||
L.remove_from_mob(old_item)
|
||||
if(delete_old)
|
||||
qdel(old_item)
|
||||
else
|
||||
old_item.loc = L.loc
|
||||
|
||||
if(duration)
|
||||
summoned_items += new_item //we store it in a list to remove later
|
||||
|
||||
if(duration)
|
||||
spawn(duration)
|
||||
for(var/obj/item/to_remove in summoned_items)
|
||||
if(istype(to_remove.loc, /mob))
|
||||
var/mob/M = to_remove.loc
|
||||
M.remove_from_mob(to_remove)
|
||||
qdel(to_remove)
|
||||
|
||||
/spell/targeted/equip_item/proc/summon_item(var/newtype)
|
||||
return new newtype
|
||||
|
||||
@@ -1,39 +1,39 @@
|
||||
/spell/targeted/equip_item/horsemask
|
||||
name = "Curse of the Horseman"
|
||||
desc = "This spell triggers a curse on a target, causing them to wield an unremovable horse head mask. They will speak like a horse! Any masks they are wearing will be disintegrated. This spell does not require robes."
|
||||
school = "transmutation"
|
||||
charge_type = Sp_RECHARGE
|
||||
charge_max = 150
|
||||
charge_counter = 0
|
||||
spell_flags = 0
|
||||
invocation = "KN'A FTAGHU, PUCK 'BTHNK!"
|
||||
invocation_type = SpI_SHOUT
|
||||
range = 7
|
||||
max_targets = 1
|
||||
cooldown_min = 30 //30 deciseconds reduction per rank
|
||||
selection_type = "range"
|
||||
|
||||
compatible_mobs = list(/mob/living/carbon/human)
|
||||
|
||||
hud_state = "wiz_horse"
|
||||
|
||||
/spell/targeted/equip_item/horsemask/New()
|
||||
..()
|
||||
equipped_summons = list("[slot_wear_mask]" = /obj/item/clothing/mask/horsehead)
|
||||
|
||||
/spell/targeted/equip_item/horsemask/cast(list/targets, mob/user = usr)
|
||||
..()
|
||||
for(var/mob/living/target in targets)
|
||||
target.visible_message( "<span class='danger'>[target]'s face lights up in fire, and after the event a horse's head takes its place!</span>", \
|
||||
"<span class='danger'>Your face burns up, and shortly after the fire you realise you have the face of a horse!</span>")
|
||||
target.flash_eyes()
|
||||
|
||||
/spell/targeted/equip_item/horsemask/summon_item(var/new_type)
|
||||
var/obj/item/new_item = new new_type
|
||||
new_item.canremove = FALSE //curses!
|
||||
new_item.unacidable = TRUE
|
||||
if(istype(new_item, /obj/item/clothing/mask/horsehead))
|
||||
var/obj/item/clothing/mask/horsehead/magichead = new_item
|
||||
magichead.flags_inv = null //so you can still see their face
|
||||
magichead.voicechange = 1 //NEEEEIIGHH
|
||||
return new_item
|
||||
/spell/targeted/equip_item/horsemask
|
||||
name = "Curse of the Horseman"
|
||||
desc = "This spell triggers a curse on a target, causing them to wield an unremovable horse head mask. They will speak like a horse! Any masks they are wearing will be disintegrated. This spell does not require robes."
|
||||
school = "transmutation"
|
||||
charge_type = Sp_RECHARGE
|
||||
charge_max = 150
|
||||
charge_counter = 0
|
||||
spell_flags = 0
|
||||
invocation = "KN'A FTAGHU, PUCK 'BTHNK!"
|
||||
invocation_type = SpI_SHOUT
|
||||
range = 7
|
||||
max_targets = 1
|
||||
cooldown_min = 30 //30 deciseconds reduction per rank
|
||||
selection_type = "range"
|
||||
|
||||
compatible_mobs = list(/mob/living/carbon/human)
|
||||
|
||||
hud_state = "wiz_horse"
|
||||
|
||||
/spell/targeted/equip_item/horsemask/New()
|
||||
..()
|
||||
equipped_summons = list("[slot_wear_mask]" = /obj/item/clothing/mask/horsehead)
|
||||
|
||||
/spell/targeted/equip_item/horsemask/cast(list/targets, mob/user = usr)
|
||||
..()
|
||||
for(var/mob/living/target in targets)
|
||||
target.visible_message( "<span class='danger'>[target]'s face lights up in fire, and after the event a horse's head takes its place!</span>", \
|
||||
"<span class='danger'>Your face burns up, and shortly after the fire you realise you have the face of a horse!</span>")
|
||||
target.flash_eyes()
|
||||
|
||||
/spell/targeted/equip_item/horsemask/summon_item(var/new_type)
|
||||
var/obj/item/new_item = new new_type
|
||||
new_item.canremove = FALSE //curses!
|
||||
new_item.unacidable = TRUE
|
||||
if(istype(new_item, /obj/item/clothing/mask/horsehead))
|
||||
var/obj/item/clothing/mask/horsehead/magichead = new_item
|
||||
magichead.flags_inv = null //so you can still see their face
|
||||
magichead.voicechange = 1 //NEEEEIIGHH
|
||||
return new_item
|
||||
|
||||
@@ -1,145 +1,145 @@
|
||||
/*
|
||||
Targeted spells (with the exception of dumbfire) select from all the mobs in the defined range
|
||||
Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are explained in setup.dm
|
||||
*/
|
||||
|
||||
|
||||
/spell/targeted //can mean aoe for mobs (limited/unlimited number) or one target mob
|
||||
var/max_targets = 1 //leave 0 for unlimited targets in range, more for limited number of casts (can all target one guy, depends on target_ignore_prev) in range
|
||||
var/target_ignore_prev = 1 //only important if max_targets > 1, affects if the spell can be cast multiple times at one person from one cast
|
||||
|
||||
|
||||
var/amt_weakened = 0
|
||||
var/amt_paralysis = 0
|
||||
var/amt_stunned = 0
|
||||
|
||||
var/amt_dizziness = 0
|
||||
var/amt_confused = 0
|
||||
var/amt_stuttering = 0
|
||||
|
||||
//set to negatives for healing
|
||||
var/amt_dam_fire = 0
|
||||
var/amt_dam_brute = 0
|
||||
var/amt_dam_oxy = 0
|
||||
var/amt_dam_tox = 0
|
||||
|
||||
var/amt_eye_blind = 0
|
||||
var/amt_eye_blurry = 0
|
||||
|
||||
var/list/compatible_mobs = list()
|
||||
|
||||
|
||||
/spell/targeted/choose_targets(mob/user = usr)
|
||||
var/list/targets = list()
|
||||
|
||||
if(max_targets == 0) //unlimited
|
||||
if(range == -2)
|
||||
targets = living_mob_list
|
||||
else
|
||||
for(var/mob/living/target in view_or_range(range, holder, selection_type))
|
||||
targets += target
|
||||
|
||||
else if(max_targets == 1) //single target can be picked
|
||||
if((range == 0 || range == -1) && spell_flags & INCLUDEUSER)
|
||||
targets += user
|
||||
else
|
||||
var/list/possible_targets = list()
|
||||
var/list/starting_targets
|
||||
if(range == -2)
|
||||
starting_targets = living_mob_list
|
||||
else
|
||||
starting_targets = view_or_range(range, holder, selection_type)
|
||||
|
||||
for(var/mob/living/M in starting_targets)
|
||||
if(!(spell_flags & INCLUDEUSER) && M == user)
|
||||
continue
|
||||
if(compatible_mobs && compatible_mobs.len)
|
||||
if(!is_type_in_list(M, compatible_mobs)) continue
|
||||
if(compatible_mobs && compatible_mobs.len && !is_type_in_list(M, compatible_mobs))
|
||||
continue
|
||||
possible_targets += M
|
||||
|
||||
if(possible_targets.len)
|
||||
if(spell_flags & SELECTABLE) //if we are allowed to choose. see setup.dm for details
|
||||
var/mob/temp_target = tgui_input_list(user, "Choose the target for the spell.", "Targeting", possible_targets)
|
||||
if(temp_target)
|
||||
targets += temp_target
|
||||
else
|
||||
targets += pick(possible_targets)
|
||||
//Adds a safety check post-input to make sure those targets are actually in range.
|
||||
|
||||
|
||||
else
|
||||
var/list/possible_targets = list()
|
||||
var/list/starting_targets
|
||||
|
||||
if(range == -2)
|
||||
starting_targets = living_mob_list
|
||||
else
|
||||
starting_targets = view_or_range(range, holder, selection_type)
|
||||
|
||||
for(var/mob/living/target in starting_targets)
|
||||
if(!(spell_flags & INCLUDEUSER) && target == user)
|
||||
continue
|
||||
if(compatible_mobs && !is_type_in_list(target, compatible_mobs))
|
||||
continue
|
||||
possible_targets += target
|
||||
|
||||
if(spell_flags & SELECTABLE)
|
||||
for(var/i = 1; i<=max_targets, i++)
|
||||
if(!possible_targets.len)
|
||||
break
|
||||
var/mob/M = tgui_input_list(user, "Choose the target for the spell.", "Targeting", possible_targets)
|
||||
if(!M)
|
||||
break
|
||||
if(range != -2)
|
||||
if(!(M in view_or_range(range, holder, selection_type)))
|
||||
continue
|
||||
targets += M
|
||||
possible_targets -= M
|
||||
else
|
||||
for(var/i=1,i<=max_targets,i++)
|
||||
if(!possible_targets.len)
|
||||
break
|
||||
if(target_ignore_prev)
|
||||
var/target = pick(possible_targets)
|
||||
possible_targets -= target
|
||||
targets += target
|
||||
else
|
||||
targets += pick(possible_targets)
|
||||
|
||||
if(!(spell_flags & INCLUDEUSER) && (user in targets))
|
||||
targets -= user
|
||||
|
||||
if(compatible_mobs && compatible_mobs.len)
|
||||
for(var/mob/living/target in targets) //filters out all the non-compatible mobs
|
||||
if(!is_type_in_list(target, compatible_mobs))
|
||||
targets -= target
|
||||
|
||||
return targets
|
||||
|
||||
/spell/targeted/cast(var/list/targets, mob/user)
|
||||
for(var/mob/living/target in targets)
|
||||
if(range >= 0)
|
||||
if(!(target in view_or_range(range, holder, selection_type))) //filter at time of casting
|
||||
targets -= target
|
||||
continue
|
||||
apply_spell_damage(target)
|
||||
|
||||
/spell/targeted/proc/apply_spell_damage(mob/living/target)
|
||||
target.adjustBruteLoss(amt_dam_brute)
|
||||
target.adjustFireLoss(amt_dam_fire)
|
||||
target.adjustToxLoss(amt_dam_tox)
|
||||
target.adjustOxyLoss(amt_dam_oxy)
|
||||
//disabling
|
||||
target.Weaken(amt_weakened)
|
||||
target.Paralyse(amt_paralysis)
|
||||
target.Stun(amt_stunned)
|
||||
if(amt_weakened || amt_paralysis || amt_stunned)
|
||||
if(target.buckled)
|
||||
target.buckled = null
|
||||
target.Blind(amt_eye_blind)
|
||||
target.eye_blurry += amt_eye_blurry
|
||||
target.dizziness += amt_dizziness
|
||||
target.Confuse(amt_confused)
|
||||
/*
|
||||
Targeted spells (with the exception of dumbfire) select from all the mobs in the defined range
|
||||
Targeted spells have two useful flags: INCLUDEUSER and SELECTABLE. These are explained in setup.dm
|
||||
*/
|
||||
|
||||
|
||||
/spell/targeted //can mean aoe for mobs (limited/unlimited number) or one target mob
|
||||
var/max_targets = 1 //leave 0 for unlimited targets in range, more for limited number of casts (can all target one guy, depends on target_ignore_prev) in range
|
||||
var/target_ignore_prev = 1 //only important if max_targets > 1, affects if the spell can be cast multiple times at one person from one cast
|
||||
|
||||
|
||||
var/amt_weakened = 0
|
||||
var/amt_paralysis = 0
|
||||
var/amt_stunned = 0
|
||||
|
||||
var/amt_dizziness = 0
|
||||
var/amt_confused = 0
|
||||
var/amt_stuttering = 0
|
||||
|
||||
//set to negatives for healing
|
||||
var/amt_dam_fire = 0
|
||||
var/amt_dam_brute = 0
|
||||
var/amt_dam_oxy = 0
|
||||
var/amt_dam_tox = 0
|
||||
|
||||
var/amt_eye_blind = 0
|
||||
var/amt_eye_blurry = 0
|
||||
|
||||
var/list/compatible_mobs = list()
|
||||
|
||||
|
||||
/spell/targeted/choose_targets(mob/user = usr)
|
||||
var/list/targets = list()
|
||||
|
||||
if(max_targets == 0) //unlimited
|
||||
if(range == -2)
|
||||
targets = living_mob_list
|
||||
else
|
||||
for(var/mob/living/target in view_or_range(range, holder, selection_type))
|
||||
targets += target
|
||||
|
||||
else if(max_targets == 1) //single target can be picked
|
||||
if((range == 0 || range == -1) && spell_flags & INCLUDEUSER)
|
||||
targets += user
|
||||
else
|
||||
var/list/possible_targets = list()
|
||||
var/list/starting_targets
|
||||
if(range == -2)
|
||||
starting_targets = living_mob_list
|
||||
else
|
||||
starting_targets = view_or_range(range, holder, selection_type)
|
||||
|
||||
for(var/mob/living/M in starting_targets)
|
||||
if(!(spell_flags & INCLUDEUSER) && M == user)
|
||||
continue
|
||||
if(compatible_mobs && compatible_mobs.len)
|
||||
if(!is_type_in_list(M, compatible_mobs)) continue
|
||||
if(compatible_mobs && compatible_mobs.len && !is_type_in_list(M, compatible_mobs))
|
||||
continue
|
||||
possible_targets += M
|
||||
|
||||
if(possible_targets.len)
|
||||
if(spell_flags & SELECTABLE) //if we are allowed to choose. see setup.dm for details
|
||||
var/mob/temp_target = tgui_input_list(user, "Choose the target for the spell.", "Targeting", possible_targets)
|
||||
if(temp_target)
|
||||
targets += temp_target
|
||||
else
|
||||
targets += pick(possible_targets)
|
||||
//Adds a safety check post-input to make sure those targets are actually in range.
|
||||
|
||||
|
||||
else
|
||||
var/list/possible_targets = list()
|
||||
var/list/starting_targets
|
||||
|
||||
if(range == -2)
|
||||
starting_targets = living_mob_list
|
||||
else
|
||||
starting_targets = view_or_range(range, holder, selection_type)
|
||||
|
||||
for(var/mob/living/target in starting_targets)
|
||||
if(!(spell_flags & INCLUDEUSER) && target == user)
|
||||
continue
|
||||
if(compatible_mobs && !is_type_in_list(target, compatible_mobs))
|
||||
continue
|
||||
possible_targets += target
|
||||
|
||||
if(spell_flags & SELECTABLE)
|
||||
for(var/i = 1; i<=max_targets, i++)
|
||||
if(!possible_targets.len)
|
||||
break
|
||||
var/mob/M = tgui_input_list(user, "Choose the target for the spell.", "Targeting", possible_targets)
|
||||
if(!M)
|
||||
break
|
||||
if(range != -2)
|
||||
if(!(M in view_or_range(range, holder, selection_type)))
|
||||
continue
|
||||
targets += M
|
||||
possible_targets -= M
|
||||
else
|
||||
for(var/i=1,i<=max_targets,i++)
|
||||
if(!possible_targets.len)
|
||||
break
|
||||
if(target_ignore_prev)
|
||||
var/target = pick(possible_targets)
|
||||
possible_targets -= target
|
||||
targets += target
|
||||
else
|
||||
targets += pick(possible_targets)
|
||||
|
||||
if(!(spell_flags & INCLUDEUSER) && (user in targets))
|
||||
targets -= user
|
||||
|
||||
if(compatible_mobs && compatible_mobs.len)
|
||||
for(var/mob/living/target in targets) //filters out all the non-compatible mobs
|
||||
if(!is_type_in_list(target, compatible_mobs))
|
||||
targets -= target
|
||||
|
||||
return targets
|
||||
|
||||
/spell/targeted/cast(var/list/targets, mob/user)
|
||||
for(var/mob/living/target in targets)
|
||||
if(range >= 0)
|
||||
if(!(target in view_or_range(range, holder, selection_type))) //filter at time of casting
|
||||
targets -= target
|
||||
continue
|
||||
apply_spell_damage(target)
|
||||
|
||||
/spell/targeted/proc/apply_spell_damage(mob/living/target)
|
||||
target.adjustBruteLoss(amt_dam_brute)
|
||||
target.adjustFireLoss(amt_dam_fire)
|
||||
target.adjustToxLoss(amt_dam_tox)
|
||||
target.adjustOxyLoss(amt_dam_oxy)
|
||||
//disabling
|
||||
target.Weaken(amt_weakened)
|
||||
target.Paralyse(amt_paralysis)
|
||||
target.Stun(amt_stunned)
|
||||
if(amt_weakened || amt_paralysis || amt_stunned)
|
||||
if(target.buckled)
|
||||
target.buckled = null
|
||||
target.Blind(amt_eye_blind)
|
||||
target.eye_blurry += amt_eye_blurry
|
||||
target.dizziness += amt_dizziness
|
||||
target.Confuse(amt_confused)
|
||||
target.stuttering += amt_stuttering
|
||||
Reference in New Issue
Block a user