Merge pull request #2087 from CIB/bugfix

Fixed a bug with EMP's and robolimbs.
This commit is contained in:
Hawk-v3
2012-12-20 06:42:54 -08:00

View File

@@ -426,8 +426,22 @@
else else
H.icon_state = initial(H.icon_state)+"_l" H.icon_state = initial(H.icon_state)+"_l"
if(status & ORGAN_ROBOT)
del H
switch(body_part)
if(LEG_RIGHT)
H = new /obj/item/robot_parts/r_leg(owner.loc)
if(LEG_LEFT)
H = new /obj/item/robot_parts/l_leg(owner.loc)
if(ARM_RIGHT)
H = new /obj/item/robot_parts/r_arm(owner.loc)
if(ARM_LEFT)
H = new /obj/item/robot_parts/l_arm(owner.loc)
if(H)
var/lol = pick(cardinal) var/lol = pick(cardinal)
step(H,lol) step(H,lol)
destspawn = 1 destspawn = 1
if(status & ORGAN_ROBOT) if(status & ORGAN_ROBOT)
owner.visible_message("\red \The [owner]'s [display_name] explodes violently!",\ owner.visible_message("\red \The [owner]'s [display_name] explodes violently!",\
@@ -514,10 +528,15 @@
proc/emp_act(severity) proc/emp_act(severity)
if(!(status & ORGAN_ROBOT)) if(!(status & ORGAN_ROBOT))
return return
if(prob(30*severity)) var/probability = 30
var/damage = 15
if(severity == 2)
probability = 1
damage = 3
if(prob(probability))
droplimb(1) droplimb(1)
else else
take_damage(4(4-severity), 0, 1, used_weapon = "EMP") take_damage(damage, 0, 1, used_weapon = "EMP")
proc/getDisplayName() proc/getDisplayName()
switch(name) switch(name)