mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 22:19:30 +01:00
Merge pull request #1934 from RobRichards1997/30/11/2013-Toxic-Converter-Cyberlimb-Fix
Cyber limbs fixes [FIXES #1920] + [Fixes #2180] + [RUNTIME FIX]
This commit is contained in:
@@ -35,9 +35,24 @@ Bonus
|
||||
|
||||
/datum/symptom/damage_converter/proc/Convert(var/mob/living/M)
|
||||
|
||||
if(M.getFireLoss() > 0 || M.getBruteLoss() > 0)
|
||||
var/get_damage = rand(1, 2)
|
||||
M.adjustFireLoss(-get_damage)
|
||||
M.adjustBruteLoss(-get_damage)
|
||||
M.adjustToxLoss(get_damage)
|
||||
return 1
|
||||
var/get_damage = rand(1, 2)
|
||||
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
|
||||
var/parts = H.get_damaged_organs(1,1) //1,1 because it needs inputs.
|
||||
|
||||
for(var/obj/item/organ/limb/L in parts)
|
||||
L.heal_damage(get_damage, get_damage, 0)
|
||||
|
||||
else
|
||||
if(M.getFireLoss() > 0 || M.getBruteLoss() > 0)
|
||||
M.adjustFireLoss(-get_damage)
|
||||
M.adjustBruteLoss(-get_damage)
|
||||
|
||||
M.adjustToxLoss(get_damage)
|
||||
return 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ var/list/sacrificed = list()
|
||||
return fizzle()
|
||||
|
||||
for(var/obj/item/organ/limb/affecting in corpse_to_raise.organs)
|
||||
affecting.heal_damage(1000, 1000)
|
||||
affecting.heal_damage(1000, 1000, 0)
|
||||
corpse_to_raise.setToxLoss(0)
|
||||
corpse_to_raise.setOxyLoss(0)
|
||||
corpse_to_raise.SetParalysis(0)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
/obj/item/stack/medical/attack(mob/living/carbon/M as mob, mob/user as mob)
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/limb/affecting = H.get_organ("chest")
|
||||
var/obj/item/organ/limb/affecting = H.get_organ(user.zone_sel.selecting)
|
||||
|
||||
|
||||
if(affecting.status == ORGAN_ORGANIC) //Limb must be organic to be healed - RR
|
||||
@@ -63,9 +63,8 @@
|
||||
if(!istype(affecting, /obj/item/organ/limb) || affecting:burn_dam <= 0)
|
||||
affecting = H.get_organ("head")
|
||||
|
||||
if(affecting.status == ORGAN_ORGANIC) // Just in case a robotic limb SOMEHOW got down to this point of the proc all you get is a message - RR
|
||||
|
||||
if (affecting.heal_damage(src.heal_brute, src.heal_burn))
|
||||
if (affecting.heal_damage(src.heal_brute, src.heal_burn, 0))
|
||||
H.update_damage_overlays(0)
|
||||
|
||||
M.updatehealth()
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
var/heal_amt = 10
|
||||
for(var/obj/item/organ/limb/affecting in H.organs)
|
||||
if(affecting.status == ORGAN_ORGANIC) //No Bible can heal a robotic arm!
|
||||
if(affecting.heal_damage(heal_amt, heal_amt))
|
||||
if(affecting.heal_damage(heal_amt, heal_amt, 0))
|
||||
H.update_damage_overlays(0)
|
||||
return
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
var/list/obj/item/organ/limb/parts = get_damaged_organs(brute,burn)
|
||||
if(!parts.len) return
|
||||
var/obj/item/organ/limb/picked = pick(parts)
|
||||
if(picked.heal_damage(brute,burn))
|
||||
if(picked.heal_damage(brute,burn,0))
|
||||
update_damage_overlays(0)
|
||||
updatehealth()
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
var/brute_was = picked.brute_dam
|
||||
var/burn_was = picked.burn_dam
|
||||
|
||||
update |= picked.heal_damage(brute,burn)
|
||||
update |= picked.heal_damage(brute,burn,0)
|
||||
|
||||
brute -= (brute_was-picked.brute_dam)
|
||||
burn -= (burn_was-picked.burn_dam)
|
||||
|
||||
@@ -129,7 +129,7 @@ emp_act
|
||||
if(affecting.status == ORGAN_ROBOTIC)
|
||||
if (WT.remove_fuel(0))
|
||||
if(affecting.brute_dam > 0)
|
||||
affecting.heal_robotic_damage(30,0) //Repair Brute
|
||||
affecting.heal_damage(30,0,1) //Repair Brute
|
||||
update_damage_overlays(0)
|
||||
updatehealth()
|
||||
for(var/mob/O in viewers(user, null))
|
||||
@@ -147,7 +147,7 @@ emp_act
|
||||
var/obj/item/weapon/cable_coil/coil = I
|
||||
if(affecting.status == ORGAN_ROBOTIC)
|
||||
if(affecting.burn_dam > 0)
|
||||
affecting.heal_robotic_damage(0,30) //Repair Burn
|
||||
affecting.heal_damage(0,30,1) //Repair Burn
|
||||
updatehealth()
|
||||
coil.use(1)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
|
||||
@@ -13,14 +13,17 @@
|
||||
if(S.target_must_be_fat && !(FAT in M.mutations))
|
||||
continue
|
||||
|
||||
if(S.requires_organic_chest && M.getlimb(/obj/item/organ/limb/robot/chest)) //This a seperate case to below, see "***" in surgery.dm - RR
|
||||
continue
|
||||
if(istype(M, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M //So we can use get_organ and not some terriblly long Switch or something worse - RR
|
||||
|
||||
var/mob/living/carbon/human/H = M //So we can use get_organ and not some terriblly long Switch or something worse - RR
|
||||
var/obj/item/organ/limb/affecting = H.get_organ(user.zone_sel.selecting)
|
||||
if(S.requires_organic_chest && H.getlimb(/obj/item/organ/limb/robot/chest)) //This a seperate case to below, see "***" in surgery.dm - RR
|
||||
continue
|
||||
|
||||
if(affecting.status == ORGAN_ROBOTIC) //Cannot operate on Robotic organs - RR
|
||||
continue
|
||||
|
||||
var/obj/item/organ/limb/affecting = H.get_organ(user.zone_sel.selecting)
|
||||
|
||||
if(affecting.status == ORGAN_ROBOTIC) //Cannot operate on Robotic organs - RR
|
||||
continue
|
||||
|
||||
for(var/path in S.species)
|
||||
if(istype(M, path))
|
||||
|
||||
@@ -136,8 +136,13 @@
|
||||
//Heals brute and burn damage for the organ. Returns 1 if the damage-icon states changed at all.
|
||||
//Damage cannot go below zero.
|
||||
//Cannot remove negative damage (i.e. apply damage)
|
||||
/obj/item/organ/limb/proc/heal_damage(brute, burn)
|
||||
if(status == ORGAN_ROBOTIC) // This makes robolimbs not healable by chems
|
||||
/obj/item/organ/limb/proc/heal_damage(brute, burn, var/robotic)
|
||||
|
||||
if(robotic && status != ORGAN_ROBOTIC) // This makes organic limbs not heal when the proc is in Robotic mode.
|
||||
brute = max(0, brute - 3)
|
||||
burn = max(0, burn - 3)
|
||||
|
||||
if(!robotic && status == ORGAN_ROBOTIC) // This makes robolimbs not healable by chems.
|
||||
brute = max(0, brute - 3)
|
||||
burn = max(0, burn - 3)
|
||||
|
||||
@@ -146,18 +151,6 @@
|
||||
return update_organ_icon()
|
||||
|
||||
|
||||
/obj/item/organ/limb/proc/heal_robotic_damage(brute, burn) //so you can heal robotic limbs but not with the original proc - RR
|
||||
if(status == ORGAN_ORGANIC) //This is a robotic heal proc so no healing organic limbs - RR
|
||||
brute = max(0, brute - 3)
|
||||
burn = max(0, burn - 3)
|
||||
|
||||
brute_dam = max(brute_dam - brute, 0)
|
||||
burn_dam = max(burn_dam - burn, 0)
|
||||
return update_organ_icon()
|
||||
|
||||
|
||||
|
||||
|
||||
//Returns total damage...kinda pointless really
|
||||
/obj/item/organ/limb/proc/get_damage()
|
||||
return brute_dam + burn_dam
|
||||
|
||||
Reference in New Issue
Block a user