mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 11:37:40 +01:00
IPC overhaul part deux
This commit is contained in:
@@ -26,17 +26,45 @@
|
||||
tod = 0
|
||||
timeofdeath = 0
|
||||
|
||||
/mob/living/carbon/human/adjustBrainLoss(var/amount)
|
||||
if(status_flags & GODMODE) return 0 //godmode
|
||||
|
||||
if(species && species.has_organ["brain"])
|
||||
var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"]
|
||||
if(sponge)
|
||||
sponge.take_damage(amount)
|
||||
sponge.damage = min(max(sponge.damage, 0),(maxHealth*2))
|
||||
brainloss = sponge.damage
|
||||
else
|
||||
brainloss = 200
|
||||
else
|
||||
brainloss = 0
|
||||
|
||||
/mob/living/carbon/human/setBrainLoss(var/amount)
|
||||
if(status_flags & GODMODE) return 0 //godmode
|
||||
|
||||
if(species && species.has_organ["brain"])
|
||||
var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"]
|
||||
if(sponge)
|
||||
sponge.damage = min(max(amount, 0),(maxHealth*2))
|
||||
brainloss = sponge.damage
|
||||
else
|
||||
brainloss = 200
|
||||
else
|
||||
brainloss = 0
|
||||
|
||||
/mob/living/carbon/human/getBrainLoss()
|
||||
var/res = brainloss
|
||||
var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"]
|
||||
if(!sponge)
|
||||
return
|
||||
if (sponge.is_bruised())
|
||||
res += 20
|
||||
if (sponge.is_broken())
|
||||
res += 50
|
||||
res = min(res,maxHealth*2)
|
||||
return res
|
||||
if(status_flags & GODMODE) return 0 //godmode
|
||||
|
||||
if(species && species.has_organ["brain"])
|
||||
var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"]
|
||||
if(sponge)
|
||||
brainloss = min(sponge.damage,maxHealth*2)
|
||||
else
|
||||
brainloss = 200
|
||||
else
|
||||
brainloss = 0
|
||||
return brainloss
|
||||
|
||||
//These procs fetch a cumulative total damage from all organs
|
||||
/mob/living/carbon/human/getBruteLoss()
|
||||
|
||||
@@ -37,9 +37,6 @@ emp_act
|
||||
return 2
|
||||
|
||||
var/obj/item/organ/external/organ = get_organ(check_zone(def_zone))
|
||||
world << organ
|
||||
world << def_zone
|
||||
world << check_zone(def_zone)
|
||||
if(isnull(organ))
|
||||
return
|
||||
|
||||
|
||||
@@ -72,11 +72,9 @@
|
||||
|
||||
for(var/limb_tag in list("l_leg","r_leg","l_foot","r_foot"))
|
||||
var/obj/item/organ/external/E = organs_by_name[limb_tag]
|
||||
if(!E)
|
||||
stance_damage += 2
|
||||
else if (E.status & ORGAN_DESTROYED)
|
||||
stance_damage += 2 // let it fail even if just foot&leg
|
||||
else if (E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)) || !E.is_usable())
|
||||
if(!E || (E.status & (ORGAN_DESTROYED|ORGAN_DEAD)) || E.is_malfunctioning())
|
||||
stance_damage += 2 // let it fail even if just foot&leg. Also malfunctioning happens sporadically so it should impact more when it procs
|
||||
else if (E.is_broken() || !E.is_usable())
|
||||
stance_damage += 1
|
||||
|
||||
// Canes and crutches help you stand (if the latter is ever added)
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
/mob/living/carbon/human/proc/has_organ(name)
|
||||
var/obj/item/organ/external/O = organs_by_name[name]
|
||||
|
||||
return (O && !(O.status & ORGAN_DESTROYED) )
|
||||
return (O && !(O.status & ORGAN_DESTROYED) && !O.is_stump())
|
||||
|
||||
/mob/living/carbon/human/proc/has_organ_for_slot(slot)
|
||||
switch(slot)
|
||||
|
||||
@@ -968,11 +968,11 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
|
||||
if(species.vision_organ)
|
||||
vision = internal_organs_by_name[species.vision_organ]
|
||||
|
||||
if(!vision) // Presumably if a species has no vision organs, they see via some other means.
|
||||
if(!species.vision_organ) // Presumably if a species has no vision organs, they see via some other means.
|
||||
eye_blind = 0
|
||||
blinded = 0
|
||||
eye_blurry = 0
|
||||
else if(vision.is_broken()) // Vision organs cut out or broken? Permablind.
|
||||
else if(!vision || vision.is_broken()) // Vision organs cut out or broken? Permablind.
|
||||
eye_blind = 1
|
||||
blinded = 1
|
||||
eye_blurry = 1
|
||||
|
||||
@@ -452,8 +452,8 @@
|
||||
unarmed_type = /datum/unarmed_attack/punch
|
||||
|
||||
eyes = "blank_eyes"
|
||||
brute_mod = 2.5
|
||||
burn_mod = 2.5
|
||||
brute_mod = 1.5
|
||||
burn_mod = 1.5
|
||||
|
||||
cold_level_1 = 50
|
||||
cold_level_2 = -1
|
||||
@@ -495,18 +495,7 @@
|
||||
)
|
||||
|
||||
/datum/species/machine/handle_death(var/mob/living/carbon/human/H)
|
||||
H.emote("deathgasp")
|
||||
|
||||
/*H.h_style = ""
|
||||
H.h_style = ""
|
||||
spawn(100)
|
||||
if(H) H.update_hair()*/
|
||||
|
||||
for(var/organ_name in H.organs_by_name)
|
||||
if (organ_name == "head") // do the head last as that's when the user will be transfered to the posibrain
|
||||
continue
|
||||
var/obj/item/organ/external/O = H.organs_by_name[organ_name]
|
||||
if(O && (O.body_part != UPPER_TORSO) && (O.body_part != LOWER_TORSO)) // We're making them fall apart, not gibbing them!
|
||||
O.droplimb(1)
|
||||
var/obj/item/organ/external/O = H.organs_by_name["head"]
|
||||
if(O)
|
||||
O.droplimb(1)
|
||||
if(H) H.update_hair()
|
||||
|
||||
@@ -239,7 +239,7 @@
|
||||
if(!(E.status & ORGAN_ROBOT))
|
||||
continue
|
||||
organ_found = 1
|
||||
user << "[E.name]: <font color='red'>[E.brute_dam]</font> <font color='#FFA500'>[E.burn_dam]</font>"
|
||||
user << "[E.name]: <font color='red'>[round(E.brute_dam)]</font> <font color='#FFA500'>[round(E.burn_dam)]</font>"
|
||||
if(!organ_found)
|
||||
user << "<span class='warning'>No prosthetics located.</span>"
|
||||
user << "<hr>"
|
||||
@@ -250,7 +250,7 @@
|
||||
if(!(O.status & ORGAN_ROBOT))
|
||||
continue
|
||||
organ_found = 1
|
||||
user << "[O.name]: <font color='red'>[O.damage]</font>"
|
||||
user << "[capitalize(O.name)]: <font color='red'>[O.damage]</font>"
|
||||
if(!organ_found)
|
||||
user << "<span class='warning'>No prosthetics located.</span>"
|
||||
|
||||
|
||||
@@ -580,34 +580,35 @@ var/list/robot_verbs_default = list(
|
||||
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item/weapon/weldingtool))
|
||||
if(W == module_active) return
|
||||
if (istype(W, /obj/item/weapon/weldingtool) && user.a_intent == "help")
|
||||
if(W == module_active)
|
||||
return
|
||||
if (!getBruteLoss())
|
||||
user << "Nothing to fix here!"
|
||||
user << "<span class='notice'>Nothing to fix!</span>"
|
||||
return
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
user.changeNext_move(CLICK_CD_MELEE)
|
||||
if (WT.remove_fuel(0))
|
||||
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
|
||||
adjustBruteLoss(-30)
|
||||
updatehealth()
|
||||
add_fingerprint(user)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\red [user] has fixed some of the dents on [src]!"), 1)
|
||||
user.visible_message("<span class='alert'>\The [user] patches some dents on \the [src] with \the [WT].</span>")
|
||||
else
|
||||
user << "Need more welding fuel!"
|
||||
user << "<span class='warning'>Need more welding fuel!</span>"
|
||||
return
|
||||
|
||||
|
||||
else if(istype(W, /obj/item/stack/cable_coil) && (wiresexposed || istype(src,/mob/living/silicon/robot/drone)))
|
||||
else if(istype(W, /obj/item/stack/cable_coil) && user.a_intent == "help" && (wiresexposed || istype(src,/mob/living/silicon/robot/drone)))
|
||||
if (!getFireLoss())
|
||||
user << "Nothing to fix here!"
|
||||
user << "<span class='notice'>Nothing to fix!</span>"
|
||||
return
|
||||
var/obj/item/stack/cable_coil/coil = W
|
||||
adjustFireLoss(-30)
|
||||
updatehealth()
|
||||
add_fingerprint(user)
|
||||
coil.use(1)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("\red [user] has fixed some of the burnt wires on [src]!"), 1)
|
||||
user.visible_message("<span class='alert'>\The [user] fixes some of the burnt wires on \the [src] with \the [coil].</span>")
|
||||
|
||||
else if (istype(W, /obj/item/weapon/crowbar)) // crowbar means open or close the cover
|
||||
if(opened)
|
||||
|
||||
@@ -96,7 +96,7 @@
|
||||
if(prob(5))
|
||||
host.adjustBrainLoss(rand(1,2))
|
||||
|
||||
if(prob(host.brainloss/20))
|
||||
if(prob(host.getBrainLoss()/20))
|
||||
host.say("*[pick(list("blink","blink_r","choke","aflap","drool","twitch","twitch_s","gasp"))]")
|
||||
|
||||
/mob/living/simple_animal/borer/New(var/by_gamemode=0)
|
||||
@@ -188,7 +188,7 @@
|
||||
|
||||
src << "You begin delicately adjusting your connection to the host brain..."
|
||||
|
||||
spawn(300+(host.brainloss*5))
|
||||
spawn(300+(host.getBrainLoss()*5))
|
||||
|
||||
if(!host || !src || controlling)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user