Life refactor (#13471)

* Life Refactor WIP

* part 2

* part 3

* runtime fix

* newlines

* tweaks

* perspective checks

* fixes

* remote view tweaks

* more fixes

* robot fixes

* better updating

* cleaned up icon procs

* less proc call overhead

* performance gains

* more optimization

* shorter lists, removal of unecesary code

* gene OOP and dna styling cleanup

* oops

* axe disabilities

* typeless loop

* various tweaks and fixes

* brain checks

* runtime fixes

* cryo vision fixes
This commit is contained in:
Fox McCloud
2020-06-03 19:43:30 -06:00
committed by GitHub
parent 5d824a9c62
commit 70b46d8aea
183 changed files with 1943 additions and 2286 deletions
+2 -2
View File
@@ -19,7 +19,7 @@
return
var/mob/living/carbon/C = owner
// genetic deafness prevents the body from using the ears, even if healthy
if(C.disabilities & DEAF)
if(DEAF in C.mutations)
deaf = max(deaf, 1)
else
if(ishuman(C))
@@ -37,7 +37,7 @@
ear_damage = 0
var/mob/living/carbon/C = owner
if(istype(C) && C.disabilities & DEAF)
if(istype(C) && (DEAF in C.mutations))
deaf = 1
/obj/item/organ/internal/ears/proc/AdjustEarDamage(ddmg, ddeaf)
+6 -6
View File
@@ -9,7 +9,7 @@
var/list/colourmatrix = null
var/list/colourblind_matrix = MATRIX_GREYSCALE //Special colourblindness parameters. By default, it's black-and-white.
var/list/replace_colours = LIST_GREYSCALE_REPLACE
var/dependent_disabilities = null //Gets set by eye-dependent disabilities such as colourblindness so the eyes can transfer the disability during transplantation.
var/dependent_disabilities = list() //Gets set by eye-dependent disabilities such as colourblindness so the eyes can transfer the disability during transplantation.
var/weld_proof = null //If set, the eyes will not take damage during welding. eg. IPC optical sensors do not take damage when they weld things while all other eyes will.
var/vision_flags = 0
@@ -30,7 +30,7 @@
return eyes_icon
/obj/item/organ/internal/eyes/proc/get_colourmatrix() //Returns a special colour matrix if the eyes are organic and the mob is colourblind, otherwise it uses the current one.
if(!is_robotic() && owner.disabilities & COLOURBLIND)
if(!is_robotic() && (COLOURBLIND in owner.mutations))
return colourblind_matrix
else
return colourmatrix
@@ -44,16 +44,16 @@
if(istype(M) && eye_colour)
M.update_body() //Apply our eye colour to the target.
if(!(M.disabilities & COLOURBLIND) && (dependent_disabilities & COLOURBLIND)) //If the eyes are colourblind and we're not, carry over the gene.
dependent_disabilities &= ~COLOURBLIND
if(!(COLOURBLIND in M.mutations) && (COLOURBLIND in dependent_disabilities)) //If the eyes are colourblind and we're not, carry over the gene.
dependent_disabilities -= COLOURBLIND
M.dna.SetSEState(GLOB.colourblindblock,1)
genemutcheck(M,GLOB.colourblindblock,null,MUTCHK_FORCED)
else
M.update_client_colour() //If we're here, that means the mob acquired the colourblindness gene while they didn't have eyes. Better handle it.
/obj/item/organ/internal/eyes/remove(mob/living/carbon/human/M, special = 0)
if(!special && (M.disabilities & COLOURBLIND)) //If special is set, that means these eyes are getting deleted (i.e. during set_species())
if(!(dependent_disabilities & COLOURBLIND)) //We only want to change COLOURBLINDBLOCK and such it the eyes are being surgically removed.
if(!special && (COLOURBLIND in M.mutations)) //If special is set, that means these eyes are getting deleted (i.e. during set_species())
if(!(COLOURBLIND in dependent_disabilities)) //We only want to change COLOURBLINDBLOCK and such it the eyes are being surgically removed.
dependent_disabilities |= COLOURBLIND
M.dna.SetSEState(GLOB.colourblindblock,0)
genemutcheck(M,GLOB.colourblindblock,null,MUTCHK_FORCED)
@@ -68,7 +68,7 @@
icon_state = dead_icon
if(owner)
to_chat(owner, "<span class='notice'>You can't feel your [name] anymore...</span>")
owner.update_body(update_sprite)
owner.update_body()
if(vital)
owner.death()
@@ -672,12 +672,12 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/proc/mutate()
src.status |= ORGAN_MUTATED
if(owner)
owner.update_body(1, 1) //Forces all bodyparts to update in order to correctly render the deformed sprite.
owner.update_body(TRUE) //Forces all bodyparts to update in order to correctly render the deformed sprite.
/obj/item/organ/external/proc/unmutate()
src.status &= ~ORGAN_MUTATED
if(owner)
owner.update_body(1, 1) //Forces all bodyparts to update in order to correctly return them to normal.
owner.update_body(TRUE) //Forces all bodyparts to update in order to correctly return them to normal.
/obj/item/organ/external/proc/get_damage() //returns total damage
return max(brute_dam + burn_dam - perma_injury, perma_injury) //could use health?