Files
Paradise/code/datums/datacore.dm
KasparoVy b6af0dd02b TAIL FIX! Squashing all those commits...
- Adds blank icons with standardized timings for species tail wagging,
used in icon generation.
- Fixes tails overlapping arms/limbs + gloves, etc. when facing EAST or
WEST.
- Ensures tails will overlap stuff as normal only when facing NORTH so
as to avoid unwanted interference with the base sprite.
- Tails now appear in ID cards, overlaying things correctly.
- Tails now overlay and are overlaid by things correctly in preview
icons.
- Modifies the positioning of tail icon generation in the ID card
preview icon generation file.
- Modifies the positioning of tail icon generation in the player
preferences preview icon generation file.
- Breaks limb generation into its own layer, breaks tail generation into
a second layer that can be overlaid by limbs.
- TAIL_LAYER will now overlay the NORTH direction sprite of a tail now,
while TAIL_UNDERLIMBS_LAYER gets all remaining directions.

**AIMS TO DO THE FOLLOWING:**
- *ELIMINATE THE ISSUE IN #3183 WITH DUPLICATE TAIL ICON GENERATION*
- *ELIMINATE THE ISSUE IN #3183 WITH TAILS WAGGING TOO FAST/INCORRECTLY*
- *ELIMINATE THE ISSUE IN #3183 WITH BODY ICONS NOT RENDERING*

Missed a spot

Occurred when reformatting the code and reducing the number of pointless
variables

Missed a spot 2

Crash Fix

Fixes Spontaneous Tail Overlapping Limbs

Tiny Unathi Sprite Corrections

One pixel on the Unathi right arm east direction sprite was miscoloured
(used left arm west direction as a reference), and the animated Unathi
tails previously did not meet the body while naked-- appearing to float.

Fixes both

Finalizes Changelog

Cleans up Vox puke

Accommodates Admin Overrides to body_accessory Species Checks & Fix

Does the above
Elaborating on accommodation: Species getting body accessories that
wouldn't normally be getting body accessories will inherit the
Vulpkanin's default animation template as those are currently the only
tails we have to worry about right now
Elaborating on Fix: Adds a default animation template for Vulpkanin in
body_accessory as the animation timings for Vulpkanin tails there are
different from those in effects/species.dmi

Unathi Static Tail Fix

Adjusts north-direction Unathi static tail sprite, now attaches to the
body in the correct location.

This PR is now on Sale!

Significantly cheaper.

Now, it will only generate tail icons on a per-direction basis if the
user's species is flagged to have a tail that is overlapped by limbs
(TAIL_OVERLAPPED).

Otherwise, it just uses the traditional cheapo method of icon
generation.

This way, we have fixed wagging Voxtails at a lower cost.

Even Cheaper

If the user's species isn't flagged to have a tail that needs to be
overlapped by limbs, it won't divert limbs into their own layer as it's
unnecessary. Tested by spawning a member of every species, walking
around to see if there was any directional issues, wagging and *swagging
all tails-- all is still working as it should be.
2016-01-17 19:32:22 -05:00

341 lines
15 KiB
Plaintext

/hook/startup/proc/createDatacore()
data_core = new /obj/effect/datacore()
return 1
/obj/effect/datacore/proc/manifest(var/nosleep = 0)
spawn()
if(!nosleep)
sleep(40)
for(var/mob/living/carbon/human/H in player_list)
manifest_inject(H)
return
/obj/effect/datacore/proc/manifest_modify(var/name, var/assignment)
if(PDA_Manifest.len)
PDA_Manifest.Cut()
var/datum/data/record/foundrecord
var/real_title = assignment
for(var/datum/data/record/t in data_core.general)
if (t)
if(t.fields["name"] == name)
foundrecord = t
break
var/list/all_jobs = get_job_datums()
for(var/datum/job/J in all_jobs)
var/list/alttitles = get_alternate_titles(J.title)
if(!J) continue
if(assignment in alttitles)
real_title = J.title
break
if(foundrecord)
foundrecord.fields["rank"] = assignment
foundrecord.fields["real_rank"] = real_title
/obj/effect/datacore/proc/manifest_inject(var/mob/living/carbon/human/H)
if(PDA_Manifest.len)
PDA_Manifest.Cut()
if(H.mind && (H.mind.assigned_role != "MODE"))
var/assignment
if(H.mind.role_alt_title)
assignment = H.mind.role_alt_title
else if(H.mind.assigned_role)
assignment = H.mind.assigned_role
else if(H.job)
assignment = H.job
else
assignment = "Unassigned"
var/id = add_zero(num2hex(rand(1, 1.6777215E7)), 6) //this was the best they could come up with? A large random number? *sigh*
//General Record
var/datum/data/record/G = new()
G.fields["id"] = id
G.fields["name"] = H.real_name
G.fields["real_rank"] = H.mind.assigned_role
G.fields["rank"] = assignment
G.fields["age"] = H.age
G.fields["fingerprint"] = md5(H.dna.uni_identity)
G.fields["p_stat"] = "Active"
G.fields["m_stat"] = "Stable"
G.fields["sex"] = capitalize(H.gender)
G.fields["species"] = H.get_species()
G.fields["photo"] = get_id_photo(H)
if(H.gen_record && !jobban_isbanned(H, "Records"))
G.fields["notes"] = H.gen_record
else
G.fields["notes"] = "No notes found."
general += G
//Medical Record
var/datum/data/record/M = new()
M.fields["id"] = id
M.fields["name"] = H.real_name
M.fields["b_type"] = H.b_type
M.fields["b_dna"] = H.dna.unique_enzymes
M.fields["mi_dis"] = "None"
M.fields["mi_dis_d"] = "No minor disabilities have been declared."
M.fields["ma_dis"] = "None"
M.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
M.fields["alg"] = "None"
M.fields["alg_d"] = "No allergies have been detected in this patient."
M.fields["cdi"] = "None"
M.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
if(H.med_record && !jobban_isbanned(H, "Records"))
M.fields["notes"] = H.med_record
else
M.fields["notes"] = "No notes found."
medical += M
//Security Record
var/datum/data/record/S = new()
S.fields["id"] = id
S.fields["name"] = H.real_name
S.fields["criminal"] = "None"
S.fields["mi_crim"] = "None"
S.fields["mi_crim_d"] = "No minor crime convictions."
S.fields["ma_crim"] = "None"
S.fields["ma_crim_d"] = "No major crime convictions."
S.fields["notes"] = "No notes."
if(H.sec_record && !jobban_isbanned(H, "Records"))
S.fields["notes"] = H.sec_record
else
S.fields["notes"] = "No notes."
security += S
//Locked Record
var/datum/data/record/L = new()
L.fields["id"] = md5("[H.real_name][H.mind.assigned_role]")
L.fields["name"] = H.real_name
L.fields["rank"] = H.mind.assigned_role
L.fields["age"] = H.age
L.fields["sex"] = capitalize(H.gender)
L.fields["b_type"] = H.b_type
L.fields["b_dna"] = H.dna.unique_enzymes
L.fields["enzymes"] = H.dna.SE // Used in respawning
L.fields["identity"] = H.dna.UI // "
L.fields["image"] = getFlatIcon(H) //This is god-awful
locked += L
return
proc/get_id_photo(var/mob/living/carbon/human/H)
var/icon/preview_icon = null
var/g = "m"
if (H.gender == FEMALE)
g = "f"
var/icon/icobase = H.species.icobase
preview_icon = new /icon(icobase, "torso_[g]")
var/icon/temp
temp = new /icon(icobase, "groin_[g]")
preview_icon.Blend(temp, ICON_OVERLAY)
temp = new /icon(icobase, "head_[g]")
preview_icon.Blend(temp, ICON_OVERLAY)
//Tail
if(H.species.tail && H.species.flags & HAS_TAIL)
temp = new/icon("icon" = 'icons/effects/species.dmi', "icon_state" = "[H.species.tail]_s")
preview_icon.Blend(temp, ICON_OVERLAY)
for(var/obj/item/organ/external/E in H.organs)
preview_icon.Blend(E.get_icon(), ICON_OVERLAY)
// Skin tone
if(H.species.bodyflags & HAS_SKIN_TONE)
if (H.s_tone >= 0)
preview_icon.Blend(rgb(H.s_tone, H.s_tone, H.s_tone), ICON_ADD)
else
preview_icon.Blend(rgb(-H.s_tone, -H.s_tone, -H.s_tone), ICON_SUBTRACT)
/* Commented out due to broken-ness, see below comment
// Skin color
if(H.species.flags & HAS_SKIN_TONE)
if(!H.species || H.species.flags & HAS_SKIN_COLOR)
preview_icon.Blend(rgb(H.r_skin, H.g_skin, H.b_skin), ICON_ADD)
*/
// Proper Skin color - Fix, you can't have HAS_SKIN_TONE *and* HAS_SKIN_COLOR
if(H.species.bodyflags & HAS_SKIN_COLOR)
preview_icon.Blend(rgb(H.r_skin, H.g_skin, H.b_skin), ICON_ADD)
var/icon/eyes_s = new/icon("icon" = 'icons/mob/human_face.dmi', "icon_state" = H.species ? H.species.eyes : "eyes_s")
eyes_s.Blend(rgb(H.r_eyes, H.g_eyes, H.b_eyes), ICON_ADD)
var/datum/sprite_accessory/hair_style = hair_styles_list[H.h_style]
if(hair_style)
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
hair_s.Blend(rgb(H.r_hair, H.g_hair, H.b_hair), ICON_ADD)
eyes_s.Blend(hair_s, ICON_OVERLAY)
//Head Accessory
if(H.species.bodyflags & HAS_HEAD_ACCESSORY)
var/datum/sprite_accessory/head_accessory_style = head_accessory_styles_list[H.ha_style]
if(head_accessory_style && head_accessory_style.species_allowed)
var/icon/head_accessory_s = new/icon("icon" = head_accessory_style.icon, "icon_state" = "[head_accessory_style.icon_state]_s")
head_accessory_s.Blend(rgb(H.r_headacc, H.g_headacc, H.b_headacc), ICON_ADD)
eyes_s.Blend(head_accessory_s, ICON_OVERLAY)
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[H.f_style]
if(facial_hair_style && facial_hair_style.species_allowed)
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
facial_s.Blend(rgb(H.r_facial, H.g_facial, H.b_facial), ICON_ADD)
eyes_s.Blend(facial_s, ICON_OVERLAY)
//Markings
if(H.species.bodyflags & HAS_MARKINGS)
var/datum/sprite_accessory/marking_style = marking_styles_list[H.m_style]
if(marking_style && marking_style.species_allowed)
var/icon/markings_s = new/icon("icon" = marking_style.icon, "icon_state" = "[marking_style.icon_state]_s")
markings_s.Blend(rgb(H.r_markings, H.g_markings, H.b_markings), ICON_ADD)
eyes_s.Blend(markings_s, ICON_OVERLAY)
preview_icon.Blend(eyes_s, ICON_OVERLAY)
var/icon/clothes_s = null
switch(H.mind.assigned_role)
if("Head of Personnel")
clothes_s = new /icon('icons/mob/uniform.dmi', "hop_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
if("Nanotrasen Representative")
clothes_s = new /icon('icons/mob/uniform.dmi', "officer_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "laceups"), ICON_UNDERLAY)
if("Blueshield")
clothes_s = new /icon('icons/mob/uniform.dmi', "officer_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/hands.dmi', "swat_gl"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "blueshield"), ICON_OVERLAY)
if("Magistrate")
clothes_s = new /icon('icons/mob/uniform.dmi', "really_black_suit_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "laceups"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "judge"), ICON_OVERLAY)
if("Bartender")
clothes_s = new /icon('icons/mob/uniform.dmi', "ba_suit_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
if("Botanist")
clothes_s = new /icon('icons/mob/uniform.dmi', "hydroponics_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
if("Chef")
clothes_s = new /icon('icons/mob/uniform.dmi', "chef_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
if("Janitor")
clothes_s = new /icon('icons/mob/uniform.dmi', "janitor_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
if("Librarian")
clothes_s = new /icon('icons/mob/uniform.dmi', "red_suit_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
if("Quartermaster")
clothes_s = new /icon('icons/mob/uniform.dmi', "qm_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
if("Cargo Technician")
clothes_s = new /icon('icons/mob/uniform.dmi', "cargotech_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
if("Shaft Miner")
clothes_s = new /icon('icons/mob/uniform.dmi', "miner_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
if("Lawyer")
clothes_s = new /icon('icons/mob/uniform.dmi', "internalaffairs_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
if("Chaplain")
clothes_s = new /icon('icons/mob/uniform.dmi', "chapblack_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
if("Research Director")
clothes_s = new /icon('icons/mob/uniform.dmi', "director_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY)
if("Scientist")
clothes_s = new /icon('icons/mob/uniform.dmi', "toxinswhite_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_tox_open"), ICON_OVERLAY)
if("Chemist")
clothes_s = new /icon('icons/mob/uniform.dmi', "chemistrywhite_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_chem_open"), ICON_OVERLAY)
if("Chief Medical Officer")
clothes_s = new /icon('icons/mob/uniform.dmi', "cmo_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_cmo_open"), ICON_OVERLAY)
if("Medical Doctor")
clothes_s = new /icon('icons/mob/uniform.dmi', "medical_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY)
if("Geneticist")
clothes_s = new /icon('icons/mob/uniform.dmi', "geneticswhite_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_gen_open"), ICON_OVERLAY)
if("Virologist")
clothes_s = new /icon('icons/mob/uniform.dmi', "virologywhite_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_vir_open"), ICON_OVERLAY)
if("Psychiatrist")
clothes_s = new /icon('icons/mob/uniform.dmi', "psych_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "laceups"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_UNDERLAY)
if("Paramedic")
clothes_s = new /icon('icons/mob/uniform.dmi', "paramedic_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
if("Captain")
clothes_s = new /icon('icons/mob/uniform.dmi', "captain_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
if("Head of Security")
clothes_s = new /icon('icons/mob/uniform.dmi', "hosred_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
if("Warden")
clothes_s = new /icon('icons/mob/uniform.dmi', "warden_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
if("Detective")
clothes_s = new /icon('icons/mob/uniform.dmi', "detective_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "detective"), ICON_OVERLAY)
if("Security Pod Pilot")
clothes_s = new /icon('icons/mob/uniform.dmi', "secred_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "bomber"), ICON_OVERLAY)
if("Brig Physician")
clothes_s = new /icon('icons/mob/uniform.dmi', "medical_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "white"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "fr_jacket_open"), ICON_OVERLAY)
if("Security Officer")
clothes_s = new /icon('icons/mob/uniform.dmi', "secred_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "jackboots"), ICON_UNDERLAY)
if("Chief Engineer")
clothes_s = new /icon('icons/mob/uniform.dmi', "chief_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "brown"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY)
if("Station Engineer")
clothes_s = new /icon('icons/mob/uniform.dmi', "engine_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "orange"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY)
if("Life Support Specialist")
clothes_s = new /icon('icons/mob/uniform.dmi', "atmos_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY)
if("Mechanic")
clothes_s = new /icon('icons/mob/uniform.dmi', "mechanic_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "orange"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/belt.dmi', "utility"), ICON_OVERLAY)
if("Roboticist")
clothes_s = new /icon('icons/mob/uniform.dmi', "robotics_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
clothes_s.Blend(new /icon('icons/mob/suit.dmi', "labcoat_open"), ICON_OVERLAY)
else if(H.mind.assigned_role in get_all_centcom_jobs())
clothes_s = new /icon('icons/mob/uniform.dmi', "officer_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "laceups"), ICON_UNDERLAY)
else
clothes_s = new /icon('icons/mob/uniform.dmi', "grey_s")
clothes_s.Blend(new /icon('icons/mob/feet.dmi', "black"), ICON_UNDERLAY)
if(!H.species.bodyflags & NO_EYES)
preview_icon.Blend(eyes_s, ICON_OVERLAY)
if(clothes_s)
preview_icon.Blend(clothes_s, ICON_OVERLAY)
qdel(eyes_s)
qdel(clothes_s)
return preview_icon