Files
vgstation13/code/modules/projectiles/projectile/change.dm
elly1989@rocketmail.com e0b538ea77 Runtime fix: getFlatIcon() - Will no longer runtime should overlays contain any nulls. (Interesting note: I was intending to fix this to try speed up update_icons() even more but it turns out BYOND really dislikes overlays += null. the optimisation took twice as long o.O)
Removed unused caching code from getFlatIcon(). We handle our own caching using datacore.dm

Runtime fix: datacore wasn't checking the type of object in the wear_id inventory slot. I've removed that so it now uses mind.assigned_role instead.
The following runtime has occured 1 time(s).
runtime error: undefined variable /obj/item/device/pda/warden/var/assignment
proc name: manifest (/obj/effect/datacore/proc/manifest)
  source file: datacore.dm,14
  usr: null
  src: the datacore (/obj/effect/datacore)

Runtime fix: staff-of-change projectiles were runtiminng when transforming somebody with implants. Cause: forgot a "continue" >.<
The following runtime has occured 4 time(s).
runtime error: Cannot modify null.layer.
proc name: wabbajack (/obj/item/projectile/change/proc/wabbajack)
  source file: change.dm,37
  usr: 0
  src: the bolt of change (/obj/item/projectile/change)



git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4412 316c924e-a436-60f5-8080-3fe189b3f50e
2012-08-14 23:46:03 +00:00

91 lines
2.7 KiB
Plaintext

/obj/item/projectile/change
name = "bolt of change"
icon_state = "ice_1"
damage = 0
damage_type = BURN
nodamage = 1
flag = "energy"
on_hit(var/atom/change)
wabbajack(change)
/obj/item/projectile/change/proc/wabbajack (mob/M as mob in living_mob_list)
if(istype(M, /mob/living) && M.stat != DEAD)
if(M.monkeyizing) return
M.monkeyizing = 1
M.canmove = 0
M.icon = null
M.overlays = null
M.invisibility = 101
if(istype(M, /mob/living/silicon/robot))
var/mob/living/silicon/robot/Robot = M
if(Robot.mmi) del(Robot.mmi)
else
for(var/obj/item/W in M)
if(istype(W, /obj/item/weapon/implant)) //TODO: Carn. give implants a dropped() or something
del(W)
continue
W.layer = initial(W.layer)
W.loc = M.loc
W.dropped(M)
var/mob/living/new_mob
var/randomize = pick("monkey","robot","metroid","xeno","human")
switch(randomize)
if("monkey")
new_mob = new /mob/living/carbon/monkey(M.loc)
new_mob.universal_speak = 1
if("robot")
new_mob = new /mob/living/silicon/robot(M.loc)
new_mob.gender = M.gender
new_mob.invisibility = 0
new_mob.job = "Cyborg"
var/mob/living/silicon/robot/Robot = new_mob
Robot.mmi = new /obj/item/device/mmi(new_mob)
Robot.mmi.transfer_identity(M) //Does not transfer key/client.
if("metroid")
if(prob(50)) new_mob = new /mob/living/carbon/metroid/adult(M.loc)
else new_mob = new /mob/living/carbon/metroid(M.loc)
new_mob.universal_speak = 1
if("xeno")
var/alien_caste = pick("Hunter","Sentinel","Drone","Larva")
switch(alien_caste)
if("Hunter") new_mob = new /mob/living/carbon/alien/humanoid/hunter(M.loc)
if("Sentinel") new_mob = new /mob/living/carbon/alien/humanoid/sentinel(M.loc)
if("Drone") new_mob = new /mob/living/carbon/alien/humanoid/drone(M.loc)
else new_mob = new /mob/living/carbon/alien/larva(M.loc)
new_mob.universal_speak = 1
if("human")
new_mob = new /mob/living/carbon/human(M.loc)
if(M.gender == MALE)
new_mob.gender = MALE
new_mob.name = pick(first_names_male)
else
new_mob.gender = FEMALE
new_mob.name = pick(first_names_female)
new_mob.name += " [pick(last_names)]"
new_mob.real_name = new_mob.name
var/datum/preferences/A = new() //Randomize appearance for the human
A.randomize_appearance_for(new_mob)
var/mob/living/carbon/human/Human = new_mob
Human.mutantrace = pick("lizard","golem","metroid","plant",4;"")
else
return
new_mob.a_intent = "hurt"
if(M.mind)
M.mind.transfer_to(new_mob)
else
new_mob.key = M.key
new_mob << "<B>Your form morphs into that of a [randomize].</B>"
del(M)
return new_mob