Merge pull request #3747 from Citadel-Station-13/upstream-merge-32101

[MIRROR] Refactor of catpeople mutant organs
This commit is contained in:
deathride58
2017-11-21 21:16:31 +00:00
committed by GitHub
14 changed files with 209 additions and 198 deletions
+17 -11
View File
@@ -15,7 +15,10 @@
// without external aid (earmuffs, drugs)
var/ear_damage = 0
var/bang_protect = 0 //Resistance against loud noises
//Resistance against loud noises
var/bang_protect = 0
// Multiplier for both long term and short term ear damage
var/damage_multiplier = 1
/obj/item/organ/ears/on_life()
if(!iscarbon(owner))
@@ -43,14 +46,14 @@
deaf = 1
/obj/item/organ/ears/proc/adjustEarDamage(ddmg, ddeaf)
ear_damage = max(ear_damage + ddmg, 0)
deaf = max(deaf + ddeaf, 0)
ear_damage = max(ear_damage + (ddmg*damage_multiplier), 0)
deaf = max(deaf + (ddeaf*damage_multiplier), 0)
/obj/item/organ/ears/proc/minimumDeafTicks(value)
deaf = max(deaf, value)
/obj/item/organ/ears/invincible/adjustEarDamage(ddmg, ddeaf)
return
/obj/item/organ/ears/invincible
damage_multiplier = 0
/mob/proc/restoreEars()
@@ -82,12 +85,15 @@
/obj/item/organ/ears/cat/Insert(mob/living/carbon/human/H, special = 0, drop_if_replaced = TRUE)
..()
color = H.hair_color
H.dna.features["ears"] = "Cat"
H.update_body()
if(istype(H))
color = H.hair_color
H.dna.species.mutant_bodyparts |= "ears"
H.dna.features["ears"] = "Cat"
H.update_body()
/obj/item/organ/ears/cat/Remove(mob/living/carbon/human/H, special = 0)
..()
color = H.hair_color
H.dna.features["ears"] = "None"
H.update_body()
if(istype(H))
color = H.hair_color
H.dna.species.mutant_bodyparts -= "ears"
H.update_body()
@@ -173,3 +173,9 @@
ears = new
ears.Insert(src)
if(!getorganslot(ORGAN_SLOT_TAIL))
var/obj/item/organ/tail/tail
if(dna && dna.species && dna.species.mutanttail)
tail = new dna.species.mutanttail
tail.Insert(src)
+55 -11
View File
@@ -1,23 +1,67 @@
// Note: tails only work in humans. They use human-specific parameters and rely on human code for displaying.
/obj/item/organ/tail
name = "tail"
desc = "What did you cut this off of?"
desc = "A severed tail. What did you cut this off of?"
icon_state = "severedtail"
zone = "groin"
slot = ORGAN_SLOT_TAIL
var/tail_type = "None"
/obj/item/organ/tail/Remove(mob/living/carbon/human/H, special = 0)
..()
if(istype(H))
H.endTailWag()
/obj/item/organ/tail/cat
name = "cat tail"
desc = "Who's wagging now?"
icon_state = "severedtail"
desc = "A severed cat tail. Who's wagging now?"
tail_type = "Cat"
/obj/item/organ/tail/cat/Insert(mob/living/carbon/human/H, special = 0, drop_if_replaced = TRUE)
..()
color = H.hair_color
H.dna.features["tail_human"] = "Cat"
H.update_body()
if(istype(H))
if(!("tail_human" in H.dna.species.mutant_bodyparts))
H.dna.species.mutant_bodyparts |= "tail_human"
H.dna.features["tail_human"] = tail_type
H.update_body()
/obj/item/organ/ears/cat/Remove(mob/living/carbon/human/H, special = 0)
/obj/item/organ/tail/cat/Remove(mob/living/carbon/human/H, special = 0)
..()
H.endTailWag()
H.dna.features["tail_human"] = "None"
color = H.hair_color
H.update_body()
if(istype(H))
H.dna.species.mutant_bodyparts -= "tail_human"
tail_type = H.dna.features["tail_human"]
color = H.hair_color
H.update_body()
/obj/item/organ/tail/lizard
name = "lizard tail"
desc = "A severed lizard tail. Somewhere, no doubt, a lizard hater is very pleased with themselves."
color = "#116611"
tail_type = "Smooth"
var/spines = "None"
/obj/item/organ/tail/lizard/Insert(mob/living/carbon/human/H, special = 0, drop_if_replaced = TRUE)
..()
if(istype(H))
// Checks here are necessary so it wouldn't overwrite the tail of a lizard it spawned in
if(!("tail_lizard" in H.dna.species.mutant_bodyparts))
H.dna.features["tail_lizard"] = tail_type
H.dna.species.mutant_bodyparts |= "tail_lizard"
if(!("spines" in H.dna.species.mutant_bodyparts))
H.dna.features["spines"] = spines
H.dna.species.mutant_bodyparts |= "spines"
H.update_body()
/obj/item/organ/tail/lizard/Remove(mob/living/carbon/human/H, special = 0)
..()
if(istype(H))
H.dna.species.mutant_bodyparts -= "tail_lizard"
H.dna.species.mutant_bodyparts -= "spines"
color = "#" + H.dna.features["mcolor"]
tail_type = H.dna.features["tail_lizard"]
spines = H.dna.features["spines"]
H.update_body()