Ooops. Forgot those two.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1382 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
uporotiy
2011-04-05 20:35:43 +00:00
parent be85fc280d
commit f60a04c234
2 changed files with 112 additions and 0 deletions

View File

@@ -0,0 +1,89 @@
/obj/spell/mind_transfer
name = "Mind Transfer"
desc = "This spell allows the user to switch bodies with a target."
school = "transmutation"
charge_max = 600
clothes_req = 0
invocation = "GIN'YU CAPAN"
invocation_type = "whisper"
range = 7
var/list/protected_roles = list("Wizard","Fake Wizard","Changeling","Cultist","Space Ninja") //which roles are immune to the spell
var/list/compatible_mobs = list("/mob/living/carbon/human","/mob/living/carbon/monkey") //which types of mobs are affected by the spell. NOTE: change at your own risk
var/base_spell_loss_chance = 5 //base probability of the wizard losing a spell in the process
var/spell_loss_chance_modifier = 7 //amount of probability of losing a spell added per spell (mind_transfer included)
var/spell_loss_amount = 1 //the maximum amount of spells possible to lose during a single transfer
var/msg_wait = 500 //how long in deciseconds it waits before telling that body doesn't feel right or mind swap robbed of a spell
var/paralysis_amount_caster = 20 //how much the caster is paralysed for after the spell
var/paralysis_amount_victim = 20 //how much the victim is paralysed for after the spell
/obj/spell/mind_transfer/Click()
..()
if(!cast_check())
return
var/mob/target = input("Choose whom to transfer your mind to", "ABRAKADABRA") as mob in oview(usr,range)
if(!target.client || !target.mind)
usr << "They appear to be brain-dead."
return
if(target.mind.special_role in protected_roles)
usr << "Their mind is resisting your spell."
return
if(!target.type in compatible_mobs)
usr << "Their mind isn't compatible with yours."
return
if(target.stat == 2)
usr << "You didn't study necromancy back at the Space Wizard Federation academy."
return
invocation()
var/mob/victim = target //mostly copypastaed, I have little idea how this works
var/mob/caster = usr
//losing spells
if(usr.spell_list.len)
for(var/i=1,i<=spell_loss_amount,i++)
var/spell_loss_chance = base_spell_loss_chance
var/list/checked_spells = usr.spell_list
checked_spells -= src //MT can't be lost
for(var/j=1,j<=checked_spells.len,j++)
if(prob(spell_loss_chance))
if(checked_spells.len)
usr.spell_list -= pick(checked_spells)
spawn(msg_wait)
caster << "The mind transfer has robbed you of a spell."
break
else
spell_loss_chance += spell_loss_chance_modifier
var/mob/dead/observer/temp_ghost = new /mob/dead/observer(target) //To properly transfer clients so no-one gets kicked off the game.
victim.client.mob = temp_ghost
temp_ghost.spell_list = victim.spell_list
temp_ghost.mind = victim.mind
caster.client.mob = victim
victim.spell_list = caster.spell_list
victim.mind = caster.mind
temp_ghost.client.mob = caster
caster.spell_list = temp_ghost.spell_list
caster.mind = temp_ghost.mind
caster.mind.current = caster
victim.mind.current = victim
caster.paralysis += paralysis_amount_caster
victim.paralysis += paralysis_amount_victim
spawn(msg_wait)
victim << "Your body doesn't feel like itself."
del(temp_ghost)

View File

@@ -0,0 +1,23 @@
/obj/spell/smoke
name = "Smoke"
desc = "This spell spawns a cloud of choking smoke at your location and does not require wizard garb."
school = "conjuration"
charge_max = 120
clothes_req = 0
invocation = "none"
invocation_type = "none"
range = -1 //originates from the user and I don't give a shit atm
var/smoke_amount = 10 //above 10 gets reduced to 10 anyway by the set_up proc
/obj/spell/smoke/Click()
..()
if(!cast_check())
return
invocation()
var/datum/effects/system/bad_smoke_spread/smoke = new /datum/effects/system/bad_smoke_spread()
smoke.set_up(smoke_amount, 0, usr.loc)
smoke.start()