mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-26 10:04:12 +00:00
Adds in limb replacement surgery, robolimbs, and all the crap for them. They can take more damage, require wires and welder to repair, but malfunction when they get more damaged, and explode when destroyed.
This commit is contained in:
@@ -245,7 +245,26 @@
|
||||
is_destroyed["[temp.display_name]"] = 1
|
||||
wound_flavor_text["[temp.display_name]"] = "<span class='warning'><b>[t_He] is missing [t_his] [temp.display_name].</b></span>\n"
|
||||
continue
|
||||
if(temp.wounds)
|
||||
if(temp.robot)
|
||||
if(!(temp.brute_dam + temp.burn_dam))
|
||||
wound_flavor_text["[temp.display_name]"] = "<span class='warning'>[t_He] has a robot [temp.display_name]!</span>\n"
|
||||
continue
|
||||
else
|
||||
wound_flavor_text["[temp.display_name]"] = "<span class='warning'>[t_He] has a robot [temp.display_name], it has"
|
||||
if(temp.brute_dam) switch(temp.brute_dam)
|
||||
if(0 to 20)
|
||||
wound_flavor_text["[temp.display_name]"] += " some dents"
|
||||
if(21 to INFINITY)
|
||||
wound_flavor_text["[temp.display_name]"] += pick(" a lot of dents"," severe denting")
|
||||
if(temp.brute_dam && temp.burn_dam)
|
||||
wound_flavor_text["[temp.display_name]"] += " and"
|
||||
if(temp.burn_dam) switch(temp.burn_dam)
|
||||
if(0 to 20)
|
||||
wound_flavor_text["[temp.display_name]"] += " some burns"
|
||||
if(21 to INFINITY)
|
||||
wound_flavor_text["[temp.display_name]"] += pick(" a lot of burns"," severe melting")
|
||||
wound_flavor_text["[temp.display_name]"] += "!</span>\n"
|
||||
else if(temp.wounds)
|
||||
var/list/wounds = list(list(),list(),list(),list(),list(),list())
|
||||
for(var/datum/organ/wound/w in temp.wounds)
|
||||
switch(w.healing_state)
|
||||
@@ -403,22 +422,22 @@
|
||||
switch(tally[tallied])
|
||||
if(1)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>\The [src] has[prob(10) && !(tallied in no_exclude) ? " what might be" : ""] a [tallied_rename[tallied]]"
|
||||
flavor_text += "<span class='warning'>[t_He] has[prob(10) && !(tallied in no_exclude) ? " what might be" : ""] a [tallied_rename[tallied]]"
|
||||
else
|
||||
flavor_text += "[prob(10) && !(tallied in no_exclude) ? " what might be" : ""] a [tallied_rename[tallied]]"
|
||||
if(2)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>\The [src] has[prob(10) && !(tallied in no_exclude) ? " what might be" : ""] a pair of [tallied_rename[tallied]]s"
|
||||
flavor_text += "<span class='warning'>[t_He] has[prob(10) && !(tallied in no_exclude) ? " what might be" : ""] a pair of [tallied_rename[tallied]]s"
|
||||
else
|
||||
flavor_text += "[prob(10) && !(tallied in no_exclude) ? " what might be" : ""] a pair of [tallied_rename[tallied]]s"
|
||||
if(3 to 5)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>\The [src] has several [tallied_rename[tallied]]s"
|
||||
flavor_text += "<span class='warning'>[t_He] has several [tallied_rename[tallied]]s"
|
||||
else
|
||||
flavor_text += " several [tallied_rename[tallied]]s"
|
||||
if(6 to INFINITY)
|
||||
if(!flavor_text.len)
|
||||
flavor_text += "<span class='warning'>\The [src] has a bunch of [tallied_rename[tallied]]s"
|
||||
flavor_text += "<span class='warning'>[t_He] has a bunch of [tallied_rename[tallied]]s"
|
||||
else
|
||||
flavor_text += " a ton of [tallied_rename[tallied]]s"
|
||||
if(flavor_text.len)
|
||||
@@ -434,6 +453,9 @@
|
||||
|
||||
//Handles the text strings being added to the actual description.
|
||||
//If they have something that covers the limb, and it is not missing, put flavortext. If it is covered but bleeding, add other flavortext.
|
||||
var/display_chest = 0
|
||||
var/display_shoes = 0
|
||||
var/display_gloves = 0
|
||||
if(wound_flavor_text["head"] && (is_destroyed["head"] || (!skipmask && !(wear_mask && istype(wear_mask, /obj/item/clothing/mask/gas)))))
|
||||
msg += wound_flavor_text["head"]
|
||||
else if(is_bleeding["head"])
|
||||
@@ -441,43 +463,49 @@
|
||||
if(wound_flavor_text["chest"] && !w_uniform && !skipjumpsuit) //No need. A missing chest gibs you.
|
||||
msg += wound_flavor_text["chest"]
|
||||
else if(is_bleeding["chest"])
|
||||
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["left arm"] && (is_destroyed["left arm"] || (!w_uniform && !skipjumpsuit)))
|
||||
msg += wound_flavor_text["left arm"]
|
||||
else if(is_bleeding["left arm"])
|
||||
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["left hand"] && (is_destroyed["left hand"] || (!gloves && !skipgloves)))
|
||||
msg += wound_flavor_text["left hand"]
|
||||
else if(is_bleeding["left hand"])
|
||||
msg += "<span class='warning'>[src] has blood running from under [t_his] gloves!</span>\n"
|
||||
display_gloves = 1
|
||||
if(wound_flavor_text["right arm"] && (is_destroyed["right arm"] || (!w_uniform && !skipjumpsuit)))
|
||||
msg += wound_flavor_text["right arm"]
|
||||
else if(is_bleeding["right arm"])
|
||||
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["right hand"] && (is_destroyed["right hand"] || (!gloves && !skipgloves)))
|
||||
msg += wound_flavor_text["right hand"]
|
||||
else if(is_bleeding["right hand"])
|
||||
msg += "<span class='warning'>[src] has blood running from under [t_his] gloves!</span>\n"
|
||||
display_gloves = 1
|
||||
if(wound_flavor_text["groin"] && (is_destroyed["groin"] || (!w_uniform && !skipjumpsuit)))
|
||||
msg += wound_flavor_text["groin"]
|
||||
else if(is_bleeding["groin"])
|
||||
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["left leg"] && (is_destroyed["left leg"] || (!w_uniform && !skipjumpsuit)))
|
||||
msg += wound_flavor_text["left leg"]
|
||||
else if(is_bleeding["left leg"])
|
||||
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["left foot"]&& (is_destroyed["left foot"] || (!shoes && !skipshoes)))
|
||||
msg += wound_flavor_text["left foot"]
|
||||
else if(is_bleeding["left foot"])
|
||||
msg += "<span class='warning'>[src] has blood running from [t_his] shoes!</span>\n"
|
||||
display_shoes = 1
|
||||
if(wound_flavor_text["right leg"] && (is_destroyed["right leg"] || (!w_uniform && !skipjumpsuit)))
|
||||
msg += wound_flavor_text["right leg"]
|
||||
else if(is_bleeding["right leg"])
|
||||
msg += "<span class='warning'>[src] has blood soaking through from under [t_his] clothing!</span>\n"
|
||||
display_chest = 1
|
||||
if(wound_flavor_text["right foot"]&& (is_destroyed["right foot"] || (!shoes && !skipshoes)))
|
||||
msg += wound_flavor_text["right foot"]
|
||||
else if(is_bleeding["right foot"])
|
||||
msg += "<span class='warning'>[src] has blood running from [t_his] shoes!</span>\n"
|
||||
display_shoes = 1
|
||||
if(display_chest)
|
||||
msg += "<span class='warning'><b>[src] has blood soaking through from under [t_his] clothing!</b></span>\n"
|
||||
if(display_shoes)
|
||||
msg += "<span class='warning'><b>[src] has blood running from [t_his] shoes!</b></span>\n"
|
||||
if(display_gloves)
|
||||
msg += "<span class='warning'><b>[src] has blood running from under [t_his] gloves!</b></span>\n"
|
||||
|
||||
|
||||
// if(w.bleeding)
|
||||
|
||||
@@ -1419,8 +1419,12 @@
|
||||
&& !istype(part, /datum/organ/external/chest) \
|
||||
&& !istype(part, /datum/organ/external/head) \
|
||||
&& !part.destroyed)
|
||||
stand_icon.Blend(new /icon('human.dmi', "[part.icon_name]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new /icon('human.dmi', "[part.icon_name]_l"), ICON_OVERLAY)
|
||||
var/icon/temp = new /icon('human.dmi', "[part.icon_name]_s")
|
||||
if(part.robot) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
|
||||
stand_icon.Blend(temp, ICON_OVERLAY)
|
||||
temp = new /icon('human.dmi', "[part.icon_name]_l")
|
||||
if(part.robot) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
|
||||
lying_icon.Blend(temp , ICON_OVERLAY)
|
||||
|
||||
stand_icon.Blend(new /icon('human.dmi', "groin_[g]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new /icon('human.dmi', "groin_[g]_l"), ICON_OVERLAY)
|
||||
@@ -2589,7 +2593,7 @@ It can still be worn/put on as normal.
|
||||
var/amount = 0.0
|
||||
for(var/name in organs)
|
||||
var/datum/organ/external/O = organs[name]
|
||||
amount+= O.brute_dam
|
||||
if(!O.robot) amount+= O.brute_dam
|
||||
return amount
|
||||
|
||||
/mob/living/carbon/human/adjustBruteLoss(var/amount, var/used_weapon = null)
|
||||
@@ -2602,7 +2606,7 @@ It can still be worn/put on as normal.
|
||||
var/amount = 0.0
|
||||
for(var/name in organs)
|
||||
var/datum/organ/external/O = organs[name]
|
||||
amount+= O.burn_dam
|
||||
if(!O.robot) amount+= O.burn_dam
|
||||
return amount
|
||||
|
||||
/mob/living/carbon/human/adjustFireLoss(var/amount,var/used_weapon = null)
|
||||
|
||||
@@ -83,6 +83,10 @@ emp_act
|
||||
for(var/obj/O in src)
|
||||
if(!O) continue
|
||||
O.emp_act(severity)
|
||||
for(var/named in organs)
|
||||
var/datum/organ/external/O = organs[named]
|
||||
if(O.destroyed) continue
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
|
||||
|
||||
@@ -211,6 +211,7 @@
|
||||
adjustFireLoss(-2)
|
||||
|
||||
for(var/datum/organ/external/org in organs)
|
||||
if(org.robot) continue
|
||||
org.brute_dam = max(org.brute_dam - 2, 0)
|
||||
org.burn_dam = max(org.burn_dam - 2, 0)
|
||||
updatehealth()
|
||||
@@ -843,6 +844,30 @@
|
||||
for(var/name in organs)
|
||||
var/datum/organ/external/E = organs[name]
|
||||
E.process()
|
||||
if(E.robot && prob(E.brute_dam + E.burn_dam))
|
||||
if(E.name == "l_hand" || E.name == "l_arm")
|
||||
if(hand && equipped())
|
||||
drop_item()
|
||||
emote("custom v drops what they were holding, their limb malfunctioning!")
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
spark_system.start()
|
||||
spawn(10)
|
||||
del(spark_system)
|
||||
else if(E.name == "r_hand" || E.name == "r_arm")
|
||||
if(!hand && equipped())
|
||||
drop_item()
|
||||
emote("custom v drops what they were holding, their limb malfunctioning!")
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
spark_system.start()
|
||||
spawn(10)
|
||||
del(spark_system)
|
||||
else if(E.name == "l_leg" || E.name == "l_foot" \
|
||||
|| E.name == "r_leg" || E.name == "r_foot" && !lying)
|
||||
leg_tally-- // let it fail even if just foot&leg
|
||||
if(E.broken || E.destroyed)
|
||||
if(E.name == "l_hand" || E.name == "l_arm")
|
||||
if(hand && equipped())
|
||||
|
||||
@@ -590,8 +590,12 @@
|
||||
&& !istype(part, /datum/organ/external/chest) \
|
||||
&& !istype(part, /datum/organ/external/head) \
|
||||
&& !part.destroyed)
|
||||
stand_icon.Blend(new /icon('monkey.dmi', "[part.icon_name]_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new /icon('monkey.dmi', "[part.icon_name]_l"), ICON_OVERLAY)
|
||||
var/icon/temp = new /icon('monkey.dmi', "[part.icon_name]_s")
|
||||
if(part.robot) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
|
||||
stand_icon.Blend(temp, ICON_OVERLAY)
|
||||
temp = new /icon('monkey.dmi', "[part.icon_name]_l")
|
||||
if(part.robot) temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
|
||||
lying_icon.Blend(temp , ICON_OVERLAY)
|
||||
|
||||
stand_icon.Blend(new /icon('monkey.dmi', "groin_s"), ICON_OVERLAY)
|
||||
lying_icon.Blend(new /icon('monkey.dmi', "groin_l"), ICON_OVERLAY)
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
var/mob/living/carbon/human/M = src
|
||||
for(var/name in M.organs)
|
||||
var/datum/organ/external/organ = M.organs[name]
|
||||
if(organ.destroyed || organ.open)
|
||||
if(organ.destroyed)
|
||||
src.traumatic_shock += 60
|
||||
else if(organ.broken)
|
||||
else if(organ.broken || organ.open)
|
||||
src.traumatic_shock += 30
|
||||
|
||||
if(src.traumatic_shock < 0)
|
||||
|
||||
@@ -87,8 +87,11 @@
|
||||
return 0
|
||||
if(destroyed)
|
||||
return 0
|
||||
if(robot)
|
||||
brute *= 0.66 //~2/3 damage for ROBOLIMBS
|
||||
burn *= 0.66 //~2/3 damage for ROBOLIMBS
|
||||
|
||||
if(owner) owner.pain(display_name, (brute+burn)*3, 1)
|
||||
if(owner && !robot) owner.pain(display_name, (brute+burn)*3, 1)
|
||||
if(sharp)
|
||||
var/nux = brute * rand(10,15)
|
||||
if(brute_dam >= max_damage)
|
||||
@@ -100,7 +103,7 @@
|
||||
return
|
||||
else if(prob(nux))
|
||||
createwound(max(1,min(6,round(brute/10) + rand(0,1))),0,brute)
|
||||
owner << "You feel something wet on your [display_name]"
|
||||
if(!robot) owner << "You feel something wet on your [display_name]"
|
||||
|
||||
if((brute_dam + burn_dam + brute + burn) < max_damage)
|
||||
if(brute)
|
||||
@@ -131,7 +134,7 @@
|
||||
burn = can_inflict
|
||||
burn_dam += burn
|
||||
createwound(max(1,min(6,round(burn/10) + rand(0,1))),2,burn)
|
||||
else
|
||||
else if(!robot)
|
||||
var/passed_dam = (brute + burn) - can_inflict //Getting how much overdamage we have.
|
||||
var/list/datum/organ/external/possible_points = list()
|
||||
if(parent)
|
||||
@@ -146,6 +149,8 @@
|
||||
target.take_damage(passed_dam, 0, sharp, used_weapon)
|
||||
else
|
||||
target.take_damage(0, passed_dam, sharp, used_weapon)
|
||||
else
|
||||
droplimb(1) //Robot limbs just kinda fail at full damage.
|
||||
|
||||
|
||||
if(broken)
|
||||
@@ -157,7 +162,9 @@
|
||||
return result
|
||||
|
||||
|
||||
proc/heal_damage(brute, burn, internal = 0)
|
||||
proc/heal_damage(brute, burn, internal = 0, robo_repair = 0)
|
||||
if(robot && !robo_repair)
|
||||
return
|
||||
var/brute_to_heal = 0
|
||||
var/brute_wounds = list()
|
||||
var/burn_to_heal = 0
|
||||
@@ -250,7 +257,7 @@
|
||||
destroyed = 1
|
||||
owner:update_body()
|
||||
return
|
||||
if(brute_dam > min_broken_damage)
|
||||
if(brute_dam > min_broken_damage && !robot)
|
||||
if(broken == 0)
|
||||
//owner.unlock_medal("Broke Yarrr Bones!", 0, "Break a bone.", "easy")
|
||||
owner.visible_message("\red You hear a loud cracking sound coming from [owner.name].","\red <b>Something feels like it shattered in your [display_name]!</b>","You hear a sickening crack.")
|
||||
@@ -296,7 +303,7 @@
|
||||
return 1
|
||||
return 0
|
||||
|
||||
proc/droplimb(var/override = 0)
|
||||
proc/droplimb(var/override = 0,var/no_explode = 0)
|
||||
if(override)
|
||||
destroyed = 1
|
||||
if(destroyed)
|
||||
@@ -307,7 +314,7 @@
|
||||
|
||||
for(var/datum/organ/external/I in children)
|
||||
if(I && !I.destroyed)
|
||||
I.droplimb(1)
|
||||
I.droplimb(1,1)
|
||||
var/obj/item/weapon/organ/H
|
||||
switch(body_part)
|
||||
if(UPPER_TORSO)
|
||||
@@ -372,11 +379,25 @@
|
||||
var/lol = pick(cardinal)
|
||||
step(H,lol)
|
||||
destspawn = 1
|
||||
owner.visible_message("\red [owner.name]'s [display_name] flies off in an arc.","\red <b>Your [display_name] goes flying off!</b>","You hear a terrible sound of ripping tendons and flesh.")
|
||||
if(!robot)
|
||||
owner.visible_message("\red [owner.name]'s [display_name] flies off in an arc.",\
|
||||
"\red <b>Your [display_name] goes flying off!</b>",\
|
||||
"You hear a terrible sound of ripping tendons and flesh.")
|
||||
else
|
||||
owner.visible_message("\red [owner.name]'s [display_name] explodes violently!",\
|
||||
"\red <b>Your [display_name] explodes!</b>",\
|
||||
"You hear an explosion followed by a scream!")
|
||||
if(!no_explode)
|
||||
explosion(get_turf(owner),-1,-1,2,3)
|
||||
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
spark_system.start()
|
||||
spawn(10)
|
||||
del(spark_system)
|
||||
for(var/datum/organ/wound/W in wounds)
|
||||
W.update_health()
|
||||
del(W)
|
||||
del(wounds)
|
||||
owner.update_body()
|
||||
owner.update_clothing()
|
||||
|
||||
@@ -411,6 +432,13 @@
|
||||
W.initial_dmg += damage
|
||||
W.wound_size = max(1,min(6,round(W.damage/10) + rand(0,1)))
|
||||
|
||||
proc/emp_act(severity)
|
||||
if(!robot) return
|
||||
if(prob(30*severity))
|
||||
take_damage(4(4-severity), 0, 1, used_weapon = "EMP")
|
||||
else
|
||||
droplimb(1)
|
||||
|
||||
/datum/organ/wound
|
||||
name = "wound"
|
||||
var/wound_type = 0 //0 = cut, 1 = bruise, 2 = burn
|
||||
@@ -424,6 +452,8 @@
|
||||
var/slowheal = 3
|
||||
|
||||
proc/start_close()
|
||||
if(parent.robot)
|
||||
return
|
||||
sleep(rand(1800,3000)) //3-5 minutes
|
||||
if(prob(50) && wound_size == 1)
|
||||
parent.wounds.Remove(src)
|
||||
@@ -465,6 +495,8 @@
|
||||
return 1
|
||||
|
||||
proc/become_scar()
|
||||
if(parent.robot)
|
||||
return
|
||||
healing_state = 1 //Patched
|
||||
spawn(200*slowheal) //~20-60 seconds
|
||||
update_health(5) //Heals some.
|
||||
@@ -520,6 +552,8 @@
|
||||
return
|
||||
|
||||
proc/update_health(var/percent = 1)
|
||||
if(!owner || owner.stat == 2)
|
||||
return
|
||||
damage = max(damage - damage/percent,0) //Remove that amount of the damage
|
||||
if(wound_type > 1)
|
||||
parent.burn_dam = max(parent.burn_dam - (initial_dmg - damage),0)
|
||||
|
||||
Reference in New Issue
Block a user