Files
Aurora.3/code/modules/organs/organ_icon.dm
T
LordFowlandErki 76372c4b15 [Ready for Review] Unapologetic Vaurca Buffs III: Revenge of the Buffs (#4885)
Implements various changes at the behest of lore-dev BygoneHero, namely:

Vaurca can now wear specially modified softsuits.
Vaurca now have their own special rigsuit a la the breacher: the combat exoskeleton. It comes with various special modules, including a boring laser that allows them to dig below themselves rapidly, a vaurca variant of the combat injector which includes phoron and k'ois paste, and a neural lattice which reduces halloss by sharing it with everyone else wearing a neural lattice.
Vaurca also have received various other currently unavailable event items, including a variant of the tactical mask that filters out nitrogen and allows the Vaurca wearing it to eat, tachyon rifles and carbines which penetrate up to three layers of walls and possess other fringe benefits, the gauss rifle which is a semi-automatic variant of the crossbow with greater power and a 6 rod magazine, the energy zweihander, commando armor and scout armor.
Introduces a general climbing mechanic. Climbing can be initiated by clicking on a wall or an open turf, and it is a percentage chance that is modified by the amount of stable/large items beneath you, and decreased by the amount of unstable/small items. Vaurca are naturally proficient and always succeed at climbing.
Changes Vaurca to see in blue-green vision. Their vision is generally brighter and reddish colors are converted to a blue-green color.
Adds the Sedantis flag, an interhive flag that celebrates the universal longing for Sedantis and is a symbol of the Vaurca diaspora.
2018-07-22 19:17:03 +03:00

219 lines
7.0 KiB
Plaintext

/obj/item/organ/external/set_dir()
return
/obj/item/organ/external/proc/compile_icon()
cut_overlays()
// This is a kludge, only one icon has more than one generation of children though.
for(var/obj/item/organ/external/organ in contents)
if(organ.children && organ.children.len)
for(var/obj/item/organ/external/child in organ.children)
add_overlay(child.mob_icon)
add_overlay(organ.mob_icon)
/obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/human)
s_tone = null
skin_color = null
hair_color = null
if(status & ORGAN_ROBOT && !(isipc(human)))
return
if(species && human.species && species.name != human.species.name)
return
if(!isnull(human.s_tone) && (human.species.appearance_flags & HAS_SKIN_TONE))
s_tone = human.s_tone
if(human.species.appearance_flags & HAS_SKIN_COLOR)
skin_color = rgb(human.r_skin, human.g_skin, human.b_skin)
hair_color = rgb(human.r_hair, human.g_hair, human.b_hair)
/obj/item/organ/external/proc/sync_colour_to_dna()
s_tone = null
skin_color = null
hair_color = null
if(status & ORGAN_ROBOT && !force_skintone)
return
if(!isnull(dna.GetUIValue(DNA_UI_SKIN_TONE)) && (species.appearance_flags & HAS_SKIN_TONE))
s_tone = dna.GetUIValue(DNA_UI_SKIN_TONE)
if(species.appearance_flags & HAS_SKIN_COLOR)
skin_color = rgb(dna.GetUIValue(DNA_UI_SKIN_R), dna.GetUIValue(DNA_UI_SKIN_G), dna.GetUIValue(DNA_UI_SKIN_B))
hair_color = rgb(dna.GetUIValue(DNA_UI_HAIR_R),dna.GetUIValue(DNA_UI_HAIR_G),dna.GetUIValue(DNA_UI_HAIR_B))
/obj/item/organ/external/head/sync_colour_to_human(var/mob/living/carbon/human/human)
..()
var/obj/item/organ/eyes/eyes = owner.get_eyes()
if(eyes)
eyes.update_colour()
/obj/item/organ/external/head/removed()
get_icon()
..()
/obj/item/organ/external/head/get_icon()
..()
cut_overlays()
if(!owner || !owner.species)
return
if(owner.species.has_organ[owner.species.vision_organ])
var/obj/item/organ/eyes/eyes = owner.get_eyes()
if(eyes && species.eyes)
var/eyecolor
if (eyes.eye_colour)
eyecolor = rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3])
var/cache_key = "[species.eyes]_[eyecolor || "nocolor"]"
var/icon/eyes_icon = SSicon_cache.human_eye_cache[cache_key]
if (!eyes_icon)
eyes_icon = new/icon(species.eyes_icons, species.eyes)
if(eyecolor)
eyes_icon.Blend(eyecolor, species.eyes_icon_blend)
else
eyes_icon.Blend(rgb(128,0,0), species.eyes_icon_blend)
SSicon_cache.human_eye_cache[cache_key] = eyes_icon
mob_icon.Blend(eyes_icon, ICON_OVERLAY)
add_overlay(eyes_icon)
if(owner.lip_style && (species && (species.appearance_flags & HAS_LIPS)))
var/icon/lip_icon = SSicon_cache.human_lip_cache["[owner.lip_style]"]
if (!lip_icon)
lip_icon = new/icon('icons/mob/human_face/lips.dmi', "[owner.lip_style]")
SSicon_cache.human_lip_cache["[owner.lip_style]"] = lip_icon
add_overlay(lip_icon)
mob_icon.Blend(lip_icon, ICON_OVERLAY)
apply_markings()
add_overlay(owner.generate_hair_icon())
compile_overlays()
return mob_icon
/obj/item/organ/external/proc/apply_markings(restrict_to_robotic = FALSE)
if (!cached_markings)
update_marking_cache()
if (LAZYLEN(cached_markings))
for(var/M in cached_markings)
var/datum/sprite_accessory/marking/mark_style = cached_markings[M]["datum"]
if (restrict_to_robotic && !mark_style.is_painted)
continue
var/m_color = cached_markings[M]["color"]
var/cache_key = "[mark_style.icon]-[mark_style.icon_state]-[limb_name]-[m_color]"
var/icon/finished_icon = SSicon_cache.markings_cache[cache_key]
if (!finished_icon)
finished_icon = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[limb_name]")
finished_icon.Blend(m_color, mark_style.icon_blend_mode)
SSicon_cache.markings_cache[cache_key] = finished_icon
add_overlay(finished_icon) //So when it's not on your body, it has icons
mob_icon.Blend(finished_icon, ICON_OVERLAY) //So when it's on your body, it has icons
/obj/item/organ/external/proc/get_icon(var/skeletal)
var/gender = "f"
if(owner && owner.gender == MALE)
gender = "m"
if(force_icon)
mob_icon = new /icon(force_icon, "[icon_name][gendered_icon ? "_[gender]" : ""]")
if(painted && skin_color)
mob_icon.Blend(skin_color, ICON_ADD)
apply_markings(restrict_to_robotic = TRUE)
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 (status & ORGAN_ROBOT && !force_skintone)
mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else
if (status & ORGAN_MUTATED)
mob_icon = new /icon(species.deform, "[icon_name][gender ? "_[gender]" : ""]")
else
mob_icon = new /icon(species.icobase, "[icon_name][gender ? "_[gender]" : ""]")
if(status & ORGAN_DEAD)
mob_icon.ColorTone(rgb(10,50,0))
mob_icon.SetIntensity(0.7)
if(!isnull(s_tone))
if(s_tone >= 0)
mob_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
else
mob_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
else if(skin_color)
mob_icon.Blend(skin_color, ICON_ADD)
apply_markings()
if(body_hair && hair_color)
var/list/limb_icon_cache = SSicon_cache.body_hair_cache
var/cache_key = "[body_hair]-[icon_name]-[hair_color]"
if(!limb_icon_cache[cache_key])
var/icon/I = icon(species.icobase, "[icon_name]_[body_hair]")
I.Blend(hair_color, ICON_ADD)
limb_icon_cache[cache_key] = I
mob_icon.Blend(limb_icon_cache[cache_key], ICON_OVERLAY)
dir = EAST
icon = mob_icon
return mob_icon
// new damage icon system
// adjusted to set damage_state to brute/burn code only (without r_name0 as before)
/obj/item/organ/external/update_icon()
var/n_is = damage_state_text()
if (n_is != damage_state)
damage_state = n_is
return 1
return 0
// This is NOT safe for caching the organ's own icon, it's only meant to be used for the mob icon cache.
/obj/item/organ/external/proc/get_mob_cache_key()
var/list/keyparts = list()
if (is_stump())
keyparts += "stump"
else if (status & ORGAN_ROBOT)
keyparts += "robot:[model || "nomodel"]"
else if (status & ORGAN_DEAD)
keyparts += "dead"
else
keyparts += "norm"
keyparts += "[species.race_key]"
keyparts += "[dna.GetUIState(DNA_UI_GENDER)]"
keyparts += "[dna.GetUIValue(DNA_UI_SKIN_TONE)]"
if (skin_color)
keyparts += "[skin_color]"
if (body_hair && hair_color)
keyparts += "[hair_color]"
if (!cached_markings)
update_marking_cache()
for (var/marking in cached_markings)
keyparts += "[marking][cached_markings[marking]["color"]]"
. = keyparts.Join("_")
/obj/item/organ/external/proc/update_marking_cache()
if (LAZYLEN(genetic_markings))
LAZYADD(cached_markings, genetic_markings)
if (LAZYLEN(temporary_markings))
LAZYADD(cached_markings, temporary_markings)