From b39cc82d7a2175e5d74396aa06d34ebb3c33c19b Mon Sep 17 00:00:00 2001 From: "noisomehollow@lycos.com" Date: Sat, 8 Jan 2011 07:19:14 +0000 Subject: [PATCH] Added descriptions to wizard spells. Beefed up Mind Transfer. Can now swap with traitors/revs/etc. Limited to humans and monkeys, and may not transfer to changelings, wizards, or cultists. Targets must still have a mind and a client for this to work (must also be alive). Mind Transfer now correctly works for mime targets or other targets with special verbs. Added a proper spell book for wizards. Changelings are now properly assigned their special role at round start. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@810 316c924e-a436-60f5-8080-3fe189b3f50e --- code/defines/obj/weapon.dm | 11 ++ code/game/gamemodes/changeling/changeling.dm | 1 + code/game/gamemodes/wizard/spells.dm | 110 ++++++++------- code/game/gamemodes/wizard/wizard.dm | 141 +++++++++++++++++-- code/game/jobs/jobprocs.dm | 2 + 5 files changed, 207 insertions(+), 58 deletions(-) diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 3b88864f8d..ffd6f6c4c7 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -985,6 +985,17 @@ Total SMES charging rate should not exceed total power generation rate, or an ov throw_range = 20 m_amt = 100 +/obj/item/weapon/spellbook + name = "Spell Book" + icon = 'library.dmi' + icon_state ="book" + throw_speed = 1 + throw_range = 5 + w_class = 1.0 + flags = FPRINT | TABLEPASS + var/uses = 4.0 + var/temp = null + /obj/item/weapon/staff name = "wizards staff" icon = 'wizard.dmi' diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 80b6b01e11..6ed1ec699a 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -60,6 +60,7 @@ grant_changeling_powers(changeling.current) + changeling.special_role = "Changeling" changelings += changeling //OBJECTIVES - Always absorb 5 genomes, plus random traitor objectives. diff --git a/code/game/gamemodes/wizard/spells.dm b/code/game/gamemodes/wizard/spells.dm index dc5fd5a77b..bf7a8f8c2c 100644 --- a/code/game/gamemodes/wizard/spells.dm +++ b/code/game/gamemodes/wizard/spells.dm @@ -3,6 +3,7 @@ /client/proc/blind(mob/M as mob in oview()) set category = "Spells" set name = "Blind" + set desc = "This spell temporarly blinds a single person and does not require wizard garb." // if(!usr.casting()) return usr.verbs -= /client/proc/blind spawn(300) @@ -35,7 +36,7 @@ /client/proc/magicmissile() set category = "Spells" set name = "Magic missile" - set desc="Whom" + set desc = "This spell fires several, slow moving, magic projectiles at nearby targets." if(!usr.casting()) return usr.say("FORTI GY AMA") @@ -80,7 +81,7 @@ set category = "Spells" set name = "Smoke" - set desc = "Creates a cloud of smoke" + set desc = "This spell spawns a cloud of choking smoke at your location and does not require wizard garb." // if(!usr.casting()) return usr.verbs -= /client/proc/smokecloud spawn(120) @@ -105,7 +106,7 @@ set category = "Spells" set name = "Forcewall" - set desc = "Create a forcewall on your location." + set desc = "This spell creates an unbreakable wall that lasts for 30 seconds and does not need wizard garb." // if(!usr.casting()) return @@ -127,7 +128,7 @@ /client/proc/fireball(mob/T as mob in oview()) set category = "Spells" set name = "Fireball" - set desc="Fireball target:" + set desc = "This spell fires a fireball at a target and does not require wizard garb." // if(!usr.casting()) return usr.verbs -= /client/proc/fireball @@ -162,6 +163,7 @@ /client/proc/knock() set category = "Spells" set name = "Knock" + set desc = "This spell opens nearby doors and does not require wizard garb." // if(!usr.casting()) return usr.verbs -= /client/proc/knock spawn(100) @@ -180,6 +182,7 @@ /mob/proc/kill(mob/M as mob in oview(1)) set category = "Spells" set name = "Disintegrate" + set desc = "This spell instantly kills somebody adjacent to you with the vilest of magick." if(!usr.casting()) return usr.verbs -= /mob/proc/kill spawn(600) @@ -199,6 +202,7 @@ /mob/proc/tech() set category = "Spells" set name = "Disable Technology" + set desc = "This spell disables all weapons, cameras and most other technology in range." if(!usr.casting()) return usr.verbs -= /mob/proc/tech spawn(400) @@ -388,7 +392,7 @@ /client/proc/blink() set category = "Spells" set name = "Blink" - set desc="Blink" + set desc = "This spell randomly teleports you a short distance." if(!usr.casting()) return var/list/turfs = new/list() for(var/turf/T in orange(6)) @@ -413,7 +417,7 @@ /mob/proc/teleport() set category = "Spells" set name = "Teleport" - set desc="Teleport" + set desc = "This spell teleports you to a type of area of your selection." if(!usr.casting()) return var/A usr.verbs -= /mob/proc/teleport @@ -490,6 +494,7 @@ /client/proc/jaunt() set category = "Spells" set name = "Ethereal Jaunt" + set desc = "This spell creates your ethereal form, temporarily making you invisible and able to pass through walls." if(!usr.casting()) return usr.verbs -= /client/proc/jaunt spawn(300) @@ -574,6 +579,7 @@ /client/proc/mutate() set category = "Spells" set name = "Mutate" + set desc = "This spell causes you to turn into a hulk and gain telekinesis for a short while." if(!usr.casting()) return usr.verbs -= /client/proc/mutate spawn(400) @@ -592,66 +598,76 @@ if (usr.mutations & 8) usr.mutations &= ~8 return -//BODY SWAP +//BODY SWAP /N /mob/proc/swap(mob/M as mob in oview()) set category = "Spells" - set name = "Body Swap" + set name = "Mind Transfer" + set desc = "This spell allows the user to switch bodies with a target." if(M.client && M.mind) - if(!M.mind.special_role && (istype(M, /mob/living/carbon/human))) - var/mob/living/carbon/human/H = M - var/mob/living/carbon/human/U = src + if(M.mind.special_role != "Wizard" || "Changeling" || "Cultist")//Wizards, changelings, and cultists are protected. + if( (istype(M, /mob/living/carbon/human)) || (istype(M, /mob/living/carbon/monkey)) && M.stat != 2) + var/mob/living/carbon/human/H = M //so it does not freak out when looking at the variables. + var/mob/living/carbon/human/U = src - U.whisper("GIN'YU CAPAN") - U.verbs -= /mob/proc/swap - if(U.mind.special_verbs.len) - for(var/V in U.mind.special_verbs) - U.verbs -= V + U.whisper("GIN'YU CAPAN") + U.verbs -= /mob/proc/swap + if(U.mind.special_verbs.len) + for(var/V in U.mind.special_verbs) + U.verbs -= V - var/mob/dead/observer/G = new /mob/dead/observer(H) //To properly transfer clients so no-one gets kicked off the game. + var/mob/dead/observer/G = new /mob/dead/observer(H) //To properly transfer clients so no-one gets kicked off the game. - H.client.mob = G - G.mind = H.mind + H.client.mob = G + if(H.mind.special_verbs.len) + for(var/V in H.mind.special_verbs) + H.verbs -= V + G.mind = H.mind - U.client.mob = H - H.mind = U.mind - if(H.mind.special_verbs.len) - var/spell_loss = 1 - var/probability = 95 - for(var/V in H.mind.special_verbs) - if(spell_loss == 0) - H.verbs += V - else - if(prob(probability)) + U.client.mob = H + H.mind = U.mind + if(H.mind.special_verbs.len) + var/spell_loss = 1//Can lose only one spell during transfer. + var/probability = 95 //To determine the chance of wizard losing their spell. + for(var/V in H.mind.special_verbs) + if(spell_loss == 0) H.verbs += V - probability -= 7 else - spell_loss = 0 - H.mind.special_verbs -= V - spawn(500) - H << "The mind transfer has robbed you of a spell." + if(prob(probability)) + H.verbs += V + probability -= 7//Chance of of keeping spells goes down each time a spell is added. Less spells means less chance of losing them. + else + spell_loss = 0 + H.mind.special_verbs -= V + spawn(500) + H << "The mind transfer has robbed you of a spell." + G.client.mob = U + U.mind = G.mind + if(U.mind.special_verbs.len)//Basic fix to swap verbs for any mob if needed. + for(var/V in U.mind.special_verbs) + U.verbs += V - G.client.mob = U - U.mind = G.mind + U.mind.current = U + H.mind.current = H + spawn(500) + U << "Something about your body doesn't seem quite right..." - U.mind.current = U - H.mind.current = H - spawn(500) - U << "Something about your body doesn't seem quite right..." + U.paralysis += 20 + H.paralysis += 20 - U.paralysis += 20 - H.paralysis += 20 + spawn(600) + H.verbs += /mob/proc/swap - spawn(600) - H.verbs += /mob/proc/swap - - del(G) + del(G) + else + src << "Their mind is not compatible." + return else src << "Their mind is resisting your spell." return else - src << "Their mind is not compatible." + src << "They appear to be brain-dead." return \ No newline at end of file diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index 8d97963e93..b738f0b956 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -165,7 +165,7 @@ wizard_mob.equip_if_possible(new /obj/item/weapon/storage/backpack(wizard_mob), wizard_mob.slot_back) // wizard_mob.equip_if_possible(new /obj/item/weapon/scrying_gem(wizard_mob), wizard_mob.slot_l_store) For scrying gem. wizard_mob.equip_if_possible(new /obj/item/weapon/teleportation_scroll(wizard_mob), wizard_mob.slot_r_store) - wizard_mob.equip_if_possible(new /obj/item/weapon/SWF_uplink(wizard_mob), wizard_mob.slot_l_hand) + wizard_mob.equip_if_possible(new /obj/item/weapon/spellbook(wizard_mob), wizard_mob.slot_r_hand) wizard_mob << "You will find a list of available spells in your spell book. Choose your magic arsenal carefully." wizard_mob << "In your pockets you will find two more important, magical artifacts. Use them as needed." @@ -254,17 +254,136 @@ else return ..() +//SPELL BOOK PROCS -/obj/item/weapon/spellbook - name = "Spell Book" - icon = 'library.dmi' - icon_state ="book" - throw_speed = 1 - throw_range = 5 - w_class = 1.0 - flags = FPRINT | TABLEPASS - //WIP +/obj/item/weapon/spellbook/attack_self(mob/user as mob) + user.machine = src + var/dat + if (src.temp) + dat = "[src.temp]

Clear" + else + dat = "The Book of Spells:
" + dat += "Spells left to memorize: [src.uses]
" + dat += "
" + dat += "Memorize which spell:
" + dat += "The number after the spell name is the cooldown time.
" + dat += "Magic Missile (10)
" + dat += "Fireball (10)
" + dat += "Disintegrate (60)
" + dat += "Disable Technology (60)
" + dat += "Smoke (10)
" + dat += "Blind (30)
" + dat += "Mind Transfer (60)
" + dat += "Forcewall (10)
" + dat += "Blink (2)
" + dat += "Teleport (60)
" + dat += "Mutate (60)
" + dat += "Ethereal Jaunt (60)
" + dat += "Knock (10)
" + dat += "
" + user << browse(dat, "window=radio") + onclose(user, "radio") + return +/obj/item/weapon/spellbook/Topic(href, href_list) + ..() + if (usr.stat || usr.restrained()) + return + var/mob/living/carbon/human/H = usr + if (!( istype(H, /mob/living/carbon/human))) + return 1 + if ((usr.contents.Find(src) || (in_range(src,usr) && istype(src.loc, /turf)))) + usr.machine = src + switch(href_list["spell_choice"]) + if ("1") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /client/proc/magicmissile + usr.mind.special_verbs += /client/proc/magicmissile + src.temp = "This spell fires several, slow moving, magic projectiles at nearby targets. If they hit a target, it is paralyzed and takes minor damage." + if ("2") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /client/proc/fireball + usr.mind.special_verbs += /client/proc/fireball + src.temp = "This spell fires a fireball at a target and does not require wizard garb. Be careful not to fire it at people that are standing next to you." + if ("3") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /mob/proc/kill + usr.mind.special_verbs += /mob/proc/kill + src.temp = "This spell instantly kills somebody adjacent to you with the vilest of magick. It has a long cooldown." + if ("4") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /mob/proc/tech + usr.mind.special_verbs += /mob/proc/tech + src.temp = "This spell disables all weapons, cameras and most other technology in range." + if ("5") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /client/proc/smokecloud + usr.mind.special_verbs += /client/proc/smokecloud + src.temp = "This spell spawns a cloud of choking smoke at your location and does not require wizard garb." + if ("6") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /client/proc/blind + usr.mind.special_verbs += /client/proc/blind + src.temp = "This spell temporarly blinds a single person and does not require wizard garb." + if ("7") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /mob/proc/swap + src.temp = "This spell allows the user to switch bodies with a target. Careful to not lose your memory in the process." + if ("8") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /client/proc/forcewall + usr.mind.special_verbs += /client/proc/forcewall + src.temp = "This spell creates an unbreakable wall that lasts for 30 seconds and does not need wizard garb." + if ("9") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /client/proc/blink + usr.mind.special_verbs += /client/proc/blink + src.temp = "This spell randomly teleports you a short distance. Useful for evasion or getting into areas if you have patience." + if ("10") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /mob/proc/teleport + usr.mind.special_verbs += /mob/proc/teleport + src.temp = "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." + if ("11") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /client/proc/mutate + usr.mind.special_verbs += /client/proc/mutate + src.temp = "This spell causes you to turn into a hulk and gain telekinesis for a short while." + if ("12") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /client/proc/jaunt + usr.mind.special_verbs += /client/proc/jaunt + src.temp = "This spell creates your ethereal form, temporarily making you invisible and able to pass through walls." + if ("13") + if (src.uses >= 1) + src.uses -= 1 + usr.verbs += /client/proc/knock + usr.mind.special_verbs += /client/proc/knock + src.temp = "This spell opens nearby doors and does not require wizard garb." + else + if (href_list["temp"]) + src.temp = null + if (istype(src.loc, /mob)) + attack_self(src.loc) + else + for(var/mob/M in viewers(1, src)) + if (M.client) + src.attack_self(M) + return + +//SWF UPLINK PROCS /obj/item/weapon/SWF_uplink/attack_self(mob/user as mob) user.machine = src var/dat @@ -285,7 +404,7 @@ dat += "Disable Technology (60)
" dat += "Smoke (10)
" dat += "Blind (30)
" - dat += "Body Swap (60)
" + dat += "Mind Transfer (60)
" dat += "Forcewall (10)
" dat += "Blink (2)
" dat += "Teleport (60)
" diff --git a/code/game/jobs/jobprocs.dm b/code/game/jobs/jobprocs.dm index 54bf529351..8f7c4dfba5 100644 --- a/code/game/jobs/jobprocs.dm +++ b/code/game/jobs/jobprocs.dm @@ -321,6 +321,8 @@ src.equip_if_possible(new /obj/item/clothing/belt/suspenders(src), slot_belt) src.verbs += /client/proc/mimespeak src.verbs += /client/proc/mimewall + src.mind.special_verbs += /client/proc/mimespeak + src.mind.special_verbs += /client/proc/mimewall src.miming = 1 if ("Station Engineer")