better digitigrade icon handling, protean digi legs, prosthetic digi legs

This commit is contained in:
Seris02
2023-01-19 20:29:42 +08:00
parent 8982fda11e
commit 5c46dc1007
6 changed files with 98 additions and 151 deletions

View File

@@ -81,6 +81,7 @@
// HUD element variable, see organ_icon.dm get_damage_hud_image() // HUD element variable, see organ_icon.dm get_damage_hud_image()
var/image/hud_damage_image var/image/hud_damage_image
var/prosthetic_digi = FALSE //CHOMPStation edit - when it's prosthetic, can it be a digitigrade
/obj/item/organ/external/Destroy() /obj/item/organ/external/Destroy()
@@ -1139,6 +1140,7 @@ Note that amputating the affected organ does in fact remove the infection from t
force_icon = R.icon force_icon = R.icon
brute_mod *= R.robo_brute_mod brute_mod *= R.robo_brute_mod
burn_mod *= R.robo_burn_mod burn_mod *= R.robo_burn_mod
prosthetic_digi = R.can_be_digitigrade //CHOMPStation edit
if(R.lifelike) if(R.lifelike)
robotic = ORGAN_LIFELIKE robotic = ORGAN_LIFELIKE
name = "[initial(name)]" name = "[initial(name)]"

View File

@@ -65,6 +65,7 @@ var/const/standard_monitor_styles = "blank=ipc_blank;\
var/list/species_cannot_use = list(SPECIES_TESHARI, SPECIES_PROMETHEAN, SPECIES_DIONA, SPECIES_XENOCHIMERA) //VOREStation Edit var/list/species_cannot_use = list(SPECIES_TESHARI, SPECIES_PROMETHEAN, SPECIES_DIONA, SPECIES_XENOCHIMERA) //VOREStation Edit
// "Species Name" = "Robolimb Company", List, when initialized, will become "Species Name" = RobolimbDatum, used for alternate species sprites. // "Species Name" = "Robolimb Company", List, when initialized, will become "Species Name" = RobolimbDatum, used for alternate species sprites.
var/list/species_alternates = list(SPECIES_TAJ = "Unbranded - Tajaran", SPECIES_UNATHI = "Unbranded - Unathi") var/list/species_alternates = list(SPECIES_TAJ = "Unbranded - Tajaran", SPECIES_UNATHI = "Unbranded - Unathi")
var/can_be_digitigrade = FALSE //CHOMPStation edit
/datum/robolimb/unbranded_monitor /datum/robolimb/unbranded_monitor
company = "Unbranded Monitor" company = "Unbranded Monitor"

View File

@@ -3,4 +3,31 @@
desc = "A VALE hound head meant for synthetics." desc = "A VALE hound head meant for synthetics."
icon = 'icons/mob/human_races/cyberlimbs/vale/vale_head.dmi' //Sprited by: Skits icon = 'icons/mob/human_races/cyberlimbs/vale/vale_head.dmi' //Sprited by: Skits
skin_tone = 1 skin_tone = 1
parts = list(BP_HEAD) parts = list(BP_HEAD)
/datum/robolimb/dsi_tajaran
can_be_digitigrade = TRUE
/datum/robolimb/dsi_lizard
can_be_digitigrade = TRUE
/datum/robolimb/dsi_sergal
can_be_digitigrade = TRUE
/datum/robolimb/dsi_nevrean
can_be_digitigrade = TRUE
/datum/robolimb/dsi_vulpkanin
can_be_digitigrade = TRUE
/datum/robolimb/dsi_akula
can_be_digitigrade = TRUE
/datum/robolimb/dsi_spider
can_be_digitigrade = TRUE
/datum/robolimb/dsi_zorren
can_be_digitigrade = TRUE
/datum/robolimb/dsi_fennec
can_be_digitigrade = TRUE

View File

@@ -171,6 +171,7 @@ VS Edit - anyone can select these. */
species_cannot_use = GLOB.all_species.Copy() species_cannot_use = GLOB.all_species.Copy()
species_cannot_use -= SPECIES_TESHARI //VOREStation add - let 'em be selected. species_cannot_use -= SPECIES_TESHARI //VOREStation add - let 'em be selected.
species_cannot_use -= SPECIES_CUSTOM //VOREStation add - let 'em be selected. species_cannot_use -= SPECIES_CUSTOM //VOREStation add - let 'em be selected.
species_cannot_use -= SPECIES_PROTEAN //CHOMPStation edit
..() ..()
/obj/item/weapon/disk/limb/dsi_teshari /obj/item/weapon/disk/limb/dsi_teshari

View File

@@ -75,3 +75,6 @@
/datum/species/xenochimera /datum/species/xenochimera
digi_allowed = TRUE digi_allowed = TRUE
/datum/species/protean
digi_allowed = TRUE

View File

@@ -5,169 +5,82 @@
// this allows limbs to be set properly when being printed in the bioprinter without an owner // this allows limbs to be set properly when being printed in the bioprinter without an owner
// this also allows the preview mannequin to update properly because customisation topic calls don't call a DNA check // this also allows the preview mannequin to update properly because customisation topic calls don't call a DNA check
if(owner) if(owner)
digitigrade = owner.digitigrade digitigrade = owner.digitigrade && (istype(src,/obj/item/organ/external/leg) || istype(src,/obj/item/organ/external/foot))
else if(dna) else if(dna)
digitigrade = dna.digitigrade digitigrade = dna.digitigrade && (istype(src,/obj/item/organ/external/leg) || istype(src,/obj/item/organ/external/foot))
if( !model && ( istype(src,/obj/item/organ/external/leg) || istype(src,/obj/item/organ/external/foot) ) ) //All leg icons go through here now. var/robotic_digi = prosthetic_digi && digitigrade //could make it so the prosthetic digi var is more of a "does this limb have a custom digitigrade sprite for its robospriting" but this is fine for now
var/gender = "m" var/gender = "m"
if(owner && owner.gender == FEMALE) if(owner && owner.gender == FEMALE)
gender = "f" gender = "f"
if(!force_icon_key)
icon_cache_key = "[icon_name]_[species ? species.get_bodytype() : SPECIES_HUMAN]" //VOREStation Edit
else
icon_cache_key = "[icon_name]_[force_icon_key]"
if(force_icon)
mob_icon = new /icon(force_icon, "[icon_name][gendered_icon ? "_[gender]" : ""]")
else
if(!dna)
mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_[gender]" : ""]")
else
if(!gendered_icon)
gender = null
else
if(dna.GetUIState(DNA_UI_GENDER))
gender = "f"
else
gender = "m"
if(skeletal)
mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else if (robotic >= ORGAN_ROBOT)
mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
apply_colouration(mob_icon)
else
if(is_hidden_by_markings())
mob_icon = new /icon('icons/mob/human_races/r_blank.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else
//Use digi icon if digitigrade, otherwise use regular icon. Ternary operator is based.
mob_icon = new /icon(digitigrade ? species.icodigi : species.get_icobase(owner, (status & ORGAN_MUTATED)), "[icon_name][gender ? "_[gender]" : ""]")
apply_colouration(mob_icon)
//Code here is copied from organ_icon.dm line 118 at time of writing (9/20/21), VOREStation edits are left in intentionally, because I think it's worth keeping track of the fact that the code is from Virgo's edits.
//Body markings, actually does not include head this time. Done separately above.
if(!istype(src,/obj/item/organ/external/head))
for(var/M in markings)
var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"]
var/isdigitype = istype(mark_style,/datum/sprite_accessory/marking/digi)
if(!(digitigrade ^ isdigitype)) //Equivalent to XNOR; this code will only run if either both digitigrade and isdigitype are true, or if both are false.
var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]")
mark_s.Blend(markings[M]["color"], mark_style.color_blend_mode) // VOREStation edit
add_overlay(mark_s) //So when it's not on your body, it has icons
mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons
icon_cache_key += "[M][markings[M]["color"]]"
if(body_hair && islist(h_col) && h_col.len >= 3)
var/cache_key = "[body_hair]-[icon_name]-[h_col[1]][h_col[2]][h_col[3]]"
if(!limb_icon_cache[cache_key])
var/icon/I = icon(species.get_icobase(owner), "[icon_name]_[body_hair]")
I.Blend(rgb(h_col[1],h_col[2],h_col[3]), ICON_MULTIPLY) //VOREStation edit
limb_icon_cache[cache_key] = I
mob_icon.Blend(limb_icon_cache[cache_key], ICON_OVERLAY)
// VOREStation edit start
if(nail_polish)
var/icon/I = new(nail_polish.icon, nail_polish.icon_state)
I.Blend(nail_polish.color, ICON_MULTIPLY)
add_overlay(I)
mob_icon.Blend(I, ICON_OVERLAY)
icon_cache_key += "_[nail_polish.icon]_[nail_polish.icon_state]_[nail_polish.color]"
// VOREStation edit end
dir = EAST
icon = mob_icon
return mob_icon
if(!force_icon_key)
icon_cache_key = "[icon_name]_[species ? species.get_bodytype() : SPECIES_HUMAN]" //VOREStation Edit
else else
//. = ..() icon_cache_key = "[icon_name]_[force_icon_key]"
//due to the wierd fact that this calls the old code, and defining it here makes a duplicate procedure error, i'm gonna have to bring the whole code here and modify it. if there is a more condensed way, it is appreciated.
var/gender = "m" if(force_icon && !robotic_digi)
if(owner && owner.gender == FEMALE) mob_icon = new /icon(force_icon, "[icon_name][gendered_icon ? "_[gender]" : ""]")
gender = "f" else
if(!dna)
if(!force_icon_key) mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_[gender]" : ""]")
icon_cache_key = "[icon_name]_[species ? species.get_bodytype() : SPECIES_HUMAN]" //VOREStation Edit
else else
icon_cache_key = "[icon_name]_[force_icon_key]"
if(force_icon) if(!gendered_icon)
mob_icon = new /icon(force_icon, "[icon_name][gendered_icon ? "_[gender]" : ""]") gender = null
else
if(!dna)
mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_[gender]" : ""]")
else else
if(!gendered_icon) if(dna.GetUIState(DNA_UI_GENDER))
gender = null gender = "f"
else else
if(dna.GetUIState(DNA_UI_GENDER)) gender = "m"
gender = "f"
else
gender = "m"
if(skeletal) if(skeletal)
mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]") mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else if (robotic >= ORGAN_ROBOT) else if (robotic >= ORGAN_ROBOT && !robotic_digi)
mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]") mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
apply_colouration(mob_icon)
else
if(is_hidden_by_markings())
mob_icon = new /icon('icons/mob/human_races/r_blank.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else
//Use digi icon if digitigrade, otherwise use regular icon. Ternary operator is based.
mob_icon = new /icon(digitigrade ? species.icodigi : species.get_icobase(owner, (status & ORGAN_MUTATED)), "[icon_name][gender ? "_[gender]" : ""]")
apply_colouration(mob_icon) apply_colouration(mob_icon)
else
if(is_hidden_by_markings())
mob_icon = new /icon('icons/mob/human_races/r_blank.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else
//Use digi icon if digitigrade, otherwise use regular icon. Ternary operator is based.
mob_icon = new /icon(species.get_icobase(owner, (status & ORGAN_MUTATED)), "[icon_name][gender ? "_[gender]" : ""]")
apply_colouration(mob_icon)
//Body markings, actually does not include head this time. Done separately above. if (model && !robotic_digi)
if(!istype(src,/obj/item/organ/external/head)) icon_cache_key += "_model_[model]"
for(var/M in markings) apply_colouration(mob_icon)
var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"]
var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]")
mark_s.Blend(markings[M]["color"], mark_style.color_blend_mode) // VOREStation edit
add_overlay(mark_s) //So when it's not on your body, it has icons
mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons
icon_cache_key += "[M][markings[M]["color"]]"
if(body_hair && islist(h_col) && h_col.len >= 3) //Code here is copied from organ_icon.dm line 118 at time of writing (9/20/21), VOREStation edits are left in intentionally, because I think it's worth keeping track of the fact that the code is from Virgo's edits.
var/cache_key = "[body_hair]-[icon_name]-[h_col[1]][h_col[2]][h_col[3]]" //Body markings, actually does not include head this time. Done separately above.
if(!limb_icon_cache[cache_key]) if((!istype(src,/obj/item/organ/external/head) && !(force_icon && !robotic_digi)) || (model && owner && owner.synth_markings))
var/icon/I = icon(species.get_icobase(owner), "[icon_name]_[body_hair]") for(var/M in markings)
I.Blend(rgb(h_col[1],h_col[2],h_col[3]), ICON_MULTIPLY) //VOREStation edit var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"]
limb_icon_cache[cache_key] = I var/isdigitype = istype(mark_style,/datum/sprite_accessory/marking/digi)
mob_icon.Blend(limb_icon_cache[cache_key], ICON_OVERLAY) if(!(digitigrade ^ isdigitype)) //Equivalent to XNOR; this code will only run if either both digitigrade and isdigitype are true, or if both are false.
var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]")
mark_s.Blend(markings[M]["color"], mark_style.color_blend_mode) // VOREStation edit
add_overlay(mark_s) //So when it's not on your body, it has icons
mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons
icon_cache_key += "[M][markings[M]["color"]]"
if(body_hair && islist(h_col) && h_col.len >= 3)
var/cache_key = "[body_hair]-[icon_name]-[h_col[1]][h_col[2]][h_col[3]]"
if(!limb_icon_cache[cache_key])
var/icon/I = icon(species.get_icobase(owner), "[icon_name]_[body_hair]")
I.Blend(rgb(h_col[1],h_col[2],h_col[3]), ICON_MULTIPLY) //VOREStation edit
limb_icon_cache[cache_key] = I
mob_icon.Blend(limb_icon_cache[cache_key], ICON_OVERLAY)
// VOREStation edit start // VOREStation edit start
if(nail_polish) if(nail_polish && (force_icon && !robotic_digi))
var/icon/I = new(nail_polish.icon, nail_polish.icon_state) var/icon/I = new(nail_polish.icon, nail_polish.icon_state)
I.Blend(nail_polish.color, ICON_MULTIPLY) I.Blend(nail_polish.color, ICON_MULTIPLY)
add_overlay(I) add_overlay(I)
mob_icon.Blend(I, ICON_OVERLAY) mob_icon.Blend(I, ICON_OVERLAY)
icon_cache_key += "_[nail_polish.icon]_[nail_polish.icon_state]_[nail_polish.color]" icon_cache_key += "_[nail_polish.icon]_[nail_polish.icon_state]_[nail_polish.color]"
// VOREStation edit end // VOREStation edit end
if(model) dir = EAST
icon_cache_key += "_model_[model]" icon = mob_icon
apply_colouration(mob_icon) return mob_icon
if(owner && owner.synth_markings)
for(var/M in markings)
var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"]
var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]")
mark_s.Blend(markings[M]["color"], mark_style.color_blend_mode) // VOREStation edit
add_overlay(mark_s) //So when it's not on your body, it has icons
mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons
icon_cache_key += "[M][markings[M]["color"]]"
if(body_hair && islist(h_col) && h_col.len >= 3)
var/cache_key = "[body_hair]-[icon_name]-[h_col[1]][h_col[2]][h_col[3]]"
if(!limb_icon_cache[cache_key])
var/icon/I = icon(species.get_icobase(owner), "[icon_name]_[body_hair]")
I.Blend(rgb(h_col[1],h_col[2],h_col[3]), ICON_MULTIPLY) //VOREStation edit
limb_icon_cache[cache_key] = I
mob_icon.Blend(limb_icon_cache[cache_key], ICON_OVERLAY)
// VOREStation edit ends here
dir = EAST
icon = mob_icon
return mob_icon