Merge pull request #8647 from Kelenius/ofStaffsAndChange

Of staffs and change
This commit is contained in:
PsiOmegaDelta
2015-03-30 13:18:51 +02:00

View File

@@ -6,36 +6,44 @@
nodamage = 1 nodamage = 1
check_armour = "energy" check_armour = "energy"
on_hit(var/atom/change) /obj/item/projectile/change/on_hit(var/atom/change)
wabbajack(change) wabbajack(change)
/obj/item/projectile/change/proc/wabbajack(var/mob/M)
/obj/item/projectile/change/proc/wabbajack (mob/M as mob in living_mob_list)
if(istype(M, /mob/living) && M.stat != DEAD) if(istype(M, /mob/living) && M.stat != DEAD)
if(M.monkeyizing) return if(M.monkeyizing)
if(M.has_brain_worms()) return //Borer stuff - RR return
if(M.has_brain_worms())
M.monkeyizing = 1 return //Borer stuff - RR
M.canmove = 0
M.icon = null
M.overlays.Cut()
M.invisibility = 101
if(istype(M, /mob/living/silicon/robot)) if(istype(M, /mob/living/silicon/robot))
var/mob/living/silicon/robot/Robot = M var/mob/living/silicon/robot/Robot = M
if(Robot.mmi) del(Robot.mmi) if(Robot.mmi)
del(Robot.mmi)
else else
for(var/obj/item/W in M) for(var/obj/item/W in M)
if(istype(W, /obj/item/weapon/implant)) //TODO: Carn. give implants a dropped() or something if(istype(W, /obj/item/weapon/implant)) //TODO: Carn. give implants a dropped() or something
del(W) del(W)
continue continue
W.layer = initial(W.layer) M.drop_from_inventory(W)
W.loc = M.loc
W.dropped(M)
var/mob/living/new_mob var/mob/living/new_mob
var/randomize = pick("robot","slime","xeno","human") var/options = list("robot", "slime")
for(var/t in all_species)
options += t
options -= "Xenomorph Queen"
options -= "Xenomorph"
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.species)
options -= H.species.name
else if(isrobot(M))
options -= "robot"
else if(isslime(M))
options -= "slime"
var/randomize = pick(options)
switch(randomize) switch(randomize)
if("robot") if("robot")
new_mob = new /mob/living/silicon/robot(M.loc) new_mob = new /mob/living/silicon/robot(M.loc)
@@ -48,26 +56,29 @@
if("slime") if("slime")
new_mob = new /mob/living/carbon/slime(M.loc) new_mob = new /mob/living/carbon/slime(M.loc)
new_mob.universal_speak = 1 new_mob.universal_speak = 1
if("xeno") else
var/alien_caste = pick("Hunter","Sentinel","Drone","Larva") var/mob/living/carbon/human/H
new_mob = create_new_xenomorph(alien_caste,M.loc) if(ishuman(M))
new_mob.universal_speak = 1 H = M
if("human") else
new_mob = new /mob/living/carbon/human(M.loc, pick(all_species)) new_mob = new /mob/living/carbon/human(M.loc)
H = new_mob
if(M.gender == MALE) if(M.gender == MALE)
new_mob.gender = MALE H.gender = MALE
new_mob.name = pick(first_names_male) H.name = pick(first_names_male)
else else
new_mob.gender = FEMALE H.gender = FEMALE
new_mob.name = pick(first_names_female) H.name = pick(first_names_female)
new_mob.name += " [pick(last_names)]" H.name += " [pick(last_names)]"
new_mob.real_name = new_mob.name H.real_name = H.name
H.set_species(randomize)
H.universal_speak = 1
var/datum/preferences/A = new() //Randomize appearance for the human var/datum/preferences/A = new() //Randomize appearance for the human
A.randomize_appearance_for(new_mob) A.randomize_appearance_for(H)
else
return
if(new_mob)
for (var/obj/effect/proc_holder/spell/S in M.spell_list) for (var/obj/effect/proc_holder/spell/S in M.spell_list)
new_mob.spell_list += new S.type new_mob.spell_list += new S.type
@@ -77,7 +88,10 @@
else else
new_mob.key = M.key new_mob.key = M.key
new_mob << "<B>Your form morphs into that of a [randomize].</B>" new_mob << "<span class='warning'>Your form morphs into that of \a [lowertext(randomize)].</span>"
del(M) del(M)
return new_mob return
else
M << "<span class='warning'>Your form morphs into that of \a [lowertext(randomize)].</span>"
return