Generalization + Features for Other Species

Turns horns into head accessories, fixes some species checks, gets
Tajara and Vulpkanin into the mix, ensures the system cannot be
exploited, adds species-specific body markings for Tajara, Vulpkanin and
Unathi.
This commit is contained in:
KasparoVy
2015-12-28 01:02:23 -05:00
parent c6e265e410
commit 366d05f745
12 changed files with 171 additions and 129 deletions
+37 -32
View File
@@ -110,10 +110,10 @@ datum/preferences
var/undershirt = "Nude" //undershirt type
var/socks = "Nude" //socks type
var/backbag = 2 //backpack type
var/hn_style = "None" //Horn style
var/r_horns = 0 //Horn colour
var/g_horns = 0 //Horn colour
var/b_horns = 0 //Horn colour
var/ha_style = "None" //Head accessory style
var/r_headacc = 0 //Head accessory colour
var/g_headacc = 0 //Head accessory colour
var/b_headacc = 0 //Head accessory colour
var/m_style = "None" //Marking style
var/r_markings = 0 //Marking colour
var/g_markings = 0 //Marking colour
@@ -361,10 +361,13 @@ datum/preferences
dat += "[TextPreview(flavor_text)]...<br>"
dat += "<br>"
if(species == "Unathi") //Species that have horns.
dat += "<br><b>Horns</b><br>"
dat += "<a href='?_src_=prefs;preference=horns;task=input'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(r_horns, 2)][num2hex(g_horns, 2)][num2hex(b_horns, 2)]'><table style='display:inline;' bgcolor='#[num2hex(r_horns, 2)][num2hex(g_horns, 2)][num2hex(b_horns)]'><tr><td>__</td></tr></table></font> "
dat += "Style: <a href='?_src_=prefs;preference=hn_style;task=input'>[hn_style]</a><br>"
if((species in list("Unathi", "Vulpkanin", "Tajaran"))) //Species that have head accessories.
var/headaccessoryname = "Head Accessory"
if(species == "Unathi")
headaccessoryname = "Horns"
dat += "<br><b>[headaccessoryname]</b><br>"
dat += "<a href='?_src_=prefs;preference=headaccessory;task=input'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(r_headacc, 2)][num2hex(g_headacc, 2)][num2hex(b_headacc, 2)]'><table style='display:inline;' bgcolor='#[num2hex(r_headacc, 2)][num2hex(g_headacc, 2)][num2hex(b_headacc)]'><tr><td>__</td></tr></table></font> "
dat += "Style: <a href='?_src_=prefs;preference=ha_style;task=input'>[ha_style]</a><br>"
dat += "<br><b>Body Markings</b><br>"
dat += "<a href='?_src_=prefs;preference=markings;task=input'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(r_markings, 2)][num2hex(g_markings, 2)][num2hex(b_markings, 2)]'><table style='display:inline;' bgcolor='#[num2hex(r_markings, 2)][num2hex(g_markings, 2)][num2hex(b_markings)]'><tr><td>__</td></tr></table></font> "
@@ -1145,6 +1148,8 @@ datum/preferences
s_tone = 0
ha_style = "None" // No Vulp ears on Unathi
m_style = "None" // No Unathi markings on Tajara
body_accessory = null //no vulpatail on humans damnit
if("speciesprefs")//oldvox code
speciesprefs = !speciesprefs
@@ -1206,31 +1211,31 @@ datum/preferences
h_style = new_h_style
if("horns")
if(species == "Unathi") // Species with horns
var/input = "Choose the colour of your your character's horns:"
var/new_horns = input(user, input, "Character Preference", rgb(r_horns, g_horns, b_horns)) as color|null
if(new_horns)
r_horns = hex2num(copytext(new_horns, 2, 4))
g_horns = hex2num(copytext(new_horns, 4, 6))
b_horns = hex2num(copytext(new_horns, 6, 8))
if("headaccessory")
if((species in list("Unathi", "Vulpkanin", "Tajaran"))) // Species with head accessories
var/input = "Choose the colour of your your character's head accessory:"
var/new_head_accessory = input(user, input, "Character Preference", rgb(r_headacc, g_headacc, b_headacc)) as color|null
if(new_head_accessory)
r_headacc = hex2num(copytext(new_head_accessory, 2, 4))
g_headacc = hex2num(copytext(new_head_accessory, 4, 6))
b_headacc = hex2num(copytext(new_head_accessory, 6, 8))
if("hn_style")
if(species == "Unathi") // Species with horns
var/list/valid_hornstyles = list()
for(var/hornstyle in horn_styles_list)
var/datum/sprite_accessory/H = horn_styles_list[hornstyle]
if("ha_style")
if((species in list("Unathi", "Vulpkanin", "Tajaran"))) // Species with head accessories
var/list/valid_head_accessory_styles = list()
for(var/head_accessory_style in head_accessory_styles_list)
var/datum/sprite_accessory/H = head_accessory_styles_list[head_accessory_style]
if( !(species in H.species_allowed))
continue
valid_hornstyles[hornstyle] = horn_styles_list[hornstyle]
valid_head_accessory_styles[head_accessory_style] = head_accessory_styles_list[head_accessory_style]
var/new_horn_style = input(user, "Choose your character's horn style:", "Character Preference") as null|anything in valid_hornstyles
if(new_horn_style)
hn_style = new_horn_style
var/new_head_accessory_style = input(user, "Choose the style of your character's head accessory:", "Character Preference") as null|anything in valid_head_accessory_styles
if(new_head_accessory_style)
ha_style = new_head_accessory_style
if("markings")
if(species == "Unathi") // Species with markings
if((species in list("Unathi", "Vulpkanin", "Tajaran"))) // Species with markings
var/input = "Choose the colour of your your character's body markings:"
var/new_markings = input(user, input, "Character Preference", rgb(r_markings, g_markings, b_markings)) as color|null
if(new_markings)
@@ -1239,7 +1244,7 @@ datum/preferences
b_markings = hex2num(copytext(new_markings, 6, 8))
if("m_style")
if(species == "Unathi") // Species with markings
if((species in list("Unathi", "Vulpkanin", "Tajaran"))) // Species with markings
var/list/valid_markings = list()
for(var/markingstyle in marking_styles_list)
var/datum/sprite_accessory/M = marking_styles_list[markingstyle]
@@ -1671,11 +1676,11 @@ datum/preferences
character.undershirt = undershirt
character.socks = socks
if(character.species.bodyflags & HAS_HORNS)
character.r_horns = r_horns
character.g_horns = g_horns
character.b_horns = b_horns
character.hn_style = hn_style
if(character.species.bodyflags & HAS_HEAD_ACCESSORY)
character.r_headacc = r_headacc
character.g_headacc = g_headacc
character.b_headacc = b_headacc
character.ha_style = ha_style
if(character.species.bodyflags & HAS_MARKINGS)
character.r_markings = r_markings
character.g_markings = g_markings
+16 -16
View File
@@ -113,13 +113,13 @@
r_markings = text2num(query.item[21])
g_markings = text2num(query.item[22])
b_markings = text2num(query.item[23])
r_horns = text2num(query.item[24])
g_horns = text2num(query.item[25])
b_horns = text2num(query.item[26])
r_headacc = text2num(query.item[24])
g_headacc = text2num(query.item[25])
b_headacc = text2num(query.item[26])
h_style = query.item[27]
f_style = query.item[28]
m_style = query.item[29]
hn_style = query.item[30]
ha_style = query.item[30]
r_eyes = text2num(query.item[31])
g_eyes = text2num(query.item[32])
b_eyes = text2num(query.item[33])
@@ -185,13 +185,13 @@
r_markings = sanitize_integer(r_markings, 0, 255, initial(r_markings))
g_markings = sanitize_integer(g_markings, 0, 255, initial(g_markings))
b_markings = sanitize_integer(b_markings, 0, 255, initial(b_markings))
r_horns = sanitize_integer(r_horns, 0, 255, initial(r_horns))
g_horns = sanitize_integer(g_horns, 0, 255, initial(g_horns))
b_horns = sanitize_integer(b_horns, 0, 255, initial(b_horns))
r_headacc = sanitize_integer(r_headacc, 0, 255, initial(r_headacc))
g_headacc = sanitize_integer(g_headacc, 0, 255, initial(g_headacc))
b_headacc = sanitize_integer(b_headacc, 0, 255, initial(b_headacc))
h_style = sanitize_inlist(h_style, hair_styles_list, initial(h_style))
f_style = sanitize_inlist(f_style, facial_hair_styles_list, initial(f_style))
m_style = sanitize_inlist(m_style, marking_styles_list, initial(m_style))
hn_style = sanitize_inlist(hn_style, horn_styles_list, initial(hn_style))
ha_style = sanitize_inlist(ha_style, head_accessory_styles_list, initial(ha_style))
r_eyes = sanitize_integer(r_eyes, 0, 255, initial(r_eyes))
g_eyes = sanitize_integer(g_eyes, 0, 255, initial(g_eyes))
b_eyes = sanitize_integer(b_eyes, 0, 255, initial(b_eyes))
@@ -261,13 +261,13 @@
markings_red='[r_markings]',
markings_green='[g_markings]',
markings_blue='[b_markings]',
horns_red='[r_horns]',
horns_green='[g_horns]',
horns_blue='[b_horns]',
head_accessory_red='[r_headacc]',
head_accessory_green='[g_headacc]',
head_accessory_blue='[b_headacc]',
hair_style_name='[sql_sanitize_text(h_style)]',
facial_style_name='[sql_sanitize_text(f_style)]',
marking_style_name='[sql_sanitize_text(m_style)]',
horn_style_name='[sql_sanitize_text(hn_style)]',
head_accessory_style_name='[sql_sanitize_text(ha_style)]',
eyes_red='[r_eyes]',
eyes_green='[g_eyes]',
eyes_blue='[b_eyes]',
@@ -319,8 +319,8 @@
facial_red, facial_green, facial_blue,
skin_tone, skin_red, skin_green, skin_blue,
markings_red, markings_green, markings_blue,
horns_red, horns_green, horns_blue,
hair_style_name, facial_style_name, marking_style_name, horn_style_name,
head_accessory_red, head_accessory_green, head_accessory_blue,
hair_style_name, facial_style_name, marking_style_name, head_accessory_style_name,
eyes_red, eyes_green, eyes_blue,
underwear, undershirt,
backbag, b_type, alternate_option,
@@ -340,8 +340,8 @@
'[r_facial]', '[g_facial]', '[b_facial]',
'[s_tone]', '[r_skin]', '[g_skin]', '[b_skin]',
'[r_markings]', '[g_markings]', '[b_markings]',
'[r_horns]', '[g_horns]', '[b_horns]',
'[sql_sanitize_text(h_style)]', '[sql_sanitize_text(f_style)]', '[sql_sanitize_text(m_style)]', '[sql_sanitize_text(hn_style)]',
'[r_headacc]', '[g_headacc]', '[b_headacc]',
'[sql_sanitize_text(h_style)]', '[sql_sanitize_text(f_style)]', '[sql_sanitize_text(m_style)]', '[sql_sanitize_text(ha_style)]',
'[r_eyes]', '[g_eyes]', '[b_eyes]',
'[underwear]', '[undershirt]',
'[backbag]', '[b_type]', '[alternate_option]',
@@ -14,11 +14,11 @@
var/b_hair = 0
var/h_style = "Bald"
//Horns
var/r_horns = 0
var/g_horns = 0
var/b_horns = 0
var/hn_style = "None"
//Head accessory colour and style
var/r_headacc = 0
var/g_headacc = 0
var/b_headacc = 0
var/ha_style = "None"
//Facial hair colour and style
var/r_facial = 0
@@ -40,7 +40,7 @@
flags = HAS_LIPS
clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS
bodyflags = FEET_CLAWS | HAS_TAIL | HAS_HORNS | HAS_MARKINGS | HAS_SKIN_COLOR | TAIL_WAGGING
bodyflags = FEET_CLAWS | HAS_TAIL | HAS_HEAD_ACCESSORY | HAS_MARKINGS | HAS_SKIN_COLOR | TAIL_WAGGING
dietflags = DIET_CARN
cold_level_1 = 280 //Default 260 - Lower is better
@@ -95,7 +95,7 @@
flags = HAS_LIPS | CAN_BE_FAT
clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS
bodyflags = FEET_PADDED | HAS_TAIL | HAS_SKIN_COLOR | TAIL_WAGGING
bodyflags = FEET_PADDED | HAS_TAIL | HAS_HEAD_ACCESSORY | HAS_MARKINGS | HAS_SKIN_COLOR | TAIL_WAGGING
dietflags = DIET_OMNI
reagent_tag = PROCESS_ORG
flesh_color = "#AFA59E"
@@ -130,7 +130,7 @@
flags = HAS_LIPS
clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS
bodyflags = FEET_PADDED | HAS_TAIL | HAS_SKIN_COLOR | TAIL_WAGGING
bodyflags = FEET_PADDED | HAS_TAIL | HAS_HEAD_ACCESSORY | HAS_MARKINGS | HAS_SKIN_COLOR | TAIL_WAGGING
dietflags = DIET_OMNI
reagent_tag = PROCESS_ORG
flesh_color = "#966464"
@@ -121,7 +121,7 @@ Please contact me on #coderbus IRC. ~Carn x
#define SUIT_STORE_LAYER 14
#define BACK_LAYER 15
#define HAIR_LAYER 16 //TODO: make part of head layer?
#define HORN_LAYER 17
#define HEAD_ACCESSORY_LAYER 17
#define FHAIR_LAYER 18
#define FACEMASK_LAYER 19
#define HEAD_LAYER 20
@@ -353,8 +353,8 @@ var/global/list/damage_icon_parts = list()
//tail
update_tail_layer(0)
//horns
update_horns(0)
//head accessory
update_head_accessory(0)
//markings
update_markings(0)
//hair
@@ -384,42 +384,42 @@ var/global/list/damage_icon_parts = list()
markings_s.Blend(rgb(r_markings, g_markings, b_markings), ICON_ADD)
markings_standing.Blend(markings_s, ICON_OVERLAY)
else
//warning("Invalid markings for [species.name]: [horns]")
//warning("Invalid m_style for [species.name]: [m_style]")
overlays_standing[MARKINGS_LAYER] = image(markings_standing)
if(update_icons) update_icons()
//HORN OVERLAY
/mob/living/carbon/human/proc/update_horns(var/update_icons=1)
//Reset our horns
overlays_standing[HORN_LAYER] = null
//HEAD ACCESSORY OVERLAY
/mob/living/carbon/human/proc/update_head_accessory(var/update_icons=1)
//Reset our head accessory
overlays_standing[HEAD_ACCESSORY_LAYER] = null
var/obj/item/organ/external/head/head_organ = get_organ("head")
if(!head_organ || head_organ.is_stump() || (head_organ.status & ORGAN_DESTROYED) )
if(update_icons) update_icons()
return
//masks and helmets can obscure our horns
//masks and helmets can obscure our head accessory
if( (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR)))
if(update_icons) update_icons()
return
//base icons
var/icon/horns_standing = new /icon('icons/mob/body_accessory.dmi',"accessory_none_s")
var/icon/head_accessory_standing = new /icon('icons/mob/body_accessory.dmi',"accessory_none_s")
if(hn_style && !(head && (head.flags & BLOCKHEADHAIR) && !(isSynthetic()) && (src.species.bodyflags & HAS_HORNS)))
var/datum/sprite_accessory/horn_style = horn_styles_list[hn_style]
if(horn_style && horn_style.species_allowed)
if(src.species.name in horn_style.species_allowed)
var/icon/horns_s = new/icon("icon" = horn_style.icon, "icon_state" = "[horn_style.icon_state]_s")
if(horn_style.do_colouration)
horns_s.Blend(rgb(r_horns, g_horns, b_horns), ICON_ADD)
horns_standing.Blend(horns_s, ICON_OVERLAY)
if(ha_style && !(head && (head.flags & BLOCKHEADHAIR) && !(isSynthetic()) && (src.species.bodyflags & HAS_HEAD_ACCESSORY)))
var/datum/sprite_accessory/head_accessory_style = head_accessory_styles_list[ha_style]
if(head_accessory_style && head_accessory_style.species_allowed)
if(src.species.name in 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")
if(head_accessory_style.do_colouration)
head_accessory_s.Blend(rgb(r_headacc, g_headacc, b_headacc), ICON_ADD)
head_accessory_standing.Blend(head_accessory_s, ICON_OVERLAY)
else
//warning("Invalid horns for [species.name]: [horns]")
//warning("Invalid ha_style for [species.name]: [ha_style]")
overlays_standing[HORN_LAYER] = image(horns_standing)
overlays_standing[HEAD_ACCESSORY_LAYER] = image(head_accessory_standing)
if(update_icons) update_icons()
@@ -581,7 +581,7 @@ var/global/list/damage_icon_parts = list()
update_mutations(0)
update_body(0)
update_hair(0)
update_horns(0)
update_head_accessory(0)
update_fhair(0)
update_mutantrace(0)
update_inv_w_uniform(0,0)
@@ -1131,7 +1131,7 @@ var/global/list/damage_icon_parts = list()
#undef BACK_LAYER
#undef HAIR_LAYER
#undef HEAD_LAYER
#undef HORN_LAYER
#undef HEAD_ACCESSORY_LAYER
#undef FHAIR_LAYER
#undef COLLAR_LAYER
#undef HANDCUFF_LAYER
@@ -251,7 +251,7 @@ datum/preferences
//Body Markings
if(current_species && (current_species.bodyflags & HAS_MARKINGS))
var/datum/sprite_accessory/marking_style = marking_styles_list[m_style]
if(marking_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(r_markings, g_markings, b_markings), ICON_ADD)
preview_icon.Blend(markings_s, ICON_OVERLAY)
@@ -267,16 +267,16 @@ datum/preferences
hair_s.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD)
eyes_s.Blend(hair_s, ICON_OVERLAY)
//Horns
if(current_species && (current_species.bodyflags & HAS_HORNS))
var/datum/sprite_accessory/horn_style = horn_styles_list[hn_style]
if(horn_style)
var/icon/horns_s = new/icon("icon" = horn_style.icon, "icon_state" = "[horn_style.icon_state]_s")
horns_s.Blend(rgb(r_horns, g_horns, b_horns), ICON_ADD)
eyes_s.Blend(horns_s, ICON_OVERLAY)
//Head Accessory
if(current_species && (current_species.bodyflags & HAS_HEAD_ACCESSORY))
var/datum/sprite_accessory/head_accessory_style = head_accessory_styles_list[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(r_headacc, g_headacc, b_headacc), ICON_ADD)
eyes_s.Blend(head_accessory_s, ICON_OVERLAY)
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[f_style]
if(facial_hair_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(r_facial, g_facial, b_facial), ICON_ADD)
eyes_s.Blend(facial_s, ICON_OVERLAY)
@@ -930,6 +930,13 @@
//Vulpkanin
vulp_earfluff
name = "Vulpkanin Earfluff"
icon_state = "vulp_facial_earfluff"
species_allowed = list("Vulpkanin")
gender = NEUTER
vulp_blaze
name = "Blaze"
icon_state = "vulp_facial_blaze"
@@ -942,12 +949,6 @@
species_allowed = list("Vulpkanin")
gender = NEUTER
vulp_earfluff
name = "Earfluff"
icon_state = "vulp_facial_earfluff"
species_allowed = list("Vulpkanin")
gender = NEUTER
vulp_mask
name = "Mask"
icon_state = "vulp_facial_mask"
@@ -1550,52 +1551,88 @@
gender = NEUTER
species_allowed = list("Vox")
/* HORNS */
/* HEAD ACCESSORY */
/datum/sprite_accessory/horns
/datum/sprite_accessory/head_accessory
icon = 'icons/mob/body_accessory.dmi'
species_allowed = list("Unathi")
icon_state = null
/datum/sprite_accessory/horns/none
name = "None"
species_allowed = list("Unathi", "Vulpkanin", "Tajaran")
icon_state = "accessory_none"
/datum/sprite_accessory/horns/simple
/datum/sprite_accessory/head_accessory/none
name = "None"
species_allowed = list("Human","Unathi","Diona","Grey","Machine","Tajaran","Vulpkanin","Slime People","Skellington","Vox")
icon_state = "accessory_none"
/datum/sprite_accessory/head_accessory/simple
name = "Simple"
species_allowed = list("Unathi")
icon_state = "horns_simple"
/datum/sprite_accessory/horns/short
/datum/sprite_accessory/head_accessory/short
name = "Short"
species_allowed = list("Unathi")
icon_state = "horns_short"
/datum/sprite_accessory/horns/curled
/datum/sprite_accessory/head_accessory/curled
name = "Curled"
species_allowed = list("Unathi")
icon_state = "horns_curled"
/datum/sprite_accessory/horns/ram
/datum/sprite_accessory/head_accessory/ram
name = "Ram"
species_allowed = list("Unathi")
icon_state = "horns_ram"
/datum/sprite_accessory/head_accessory/vulp_earfluff
icon = 'icons/mob/human_face.dmi'
name = "Vulpkanin Earfluff"
icon_state = "vulp_facial_earfluff"
species_allowed = list("Vulpkanin")
/datum/sprite_accessory/head_accessory/taj_ears
icon = 'icons/mob/human_face.dmi'
name = "Tajaran Ears"
icon_state = "ears_plain"
species_allowed = list("Tajaran")
/* BODY MARKINGS */
/datum/sprite_accessory/body_markings
icon = 'icons/mob/body_accessory.dmi'
species_allowed = list("Unathi")
icon_state = null
species_allowed = list("Unathi", "Tajaran", "Vulpkanin")
icon_state = "accessory_none"
/datum/sprite_accessory/body_markings/none
name = "None"
species_allowed = list("Human","Unathi","Diona","Grey","Machine","Tajaran","Vulpkanin","Slime People","Skellington","Vox")
icon_state = "accessory_none"
/datum/sprite_accessory/body_markings/stripe
name = "Stripe"
species_allowed = list("Unathi")
icon_state = "markings_stripe"
/datum/sprite_accessory/body_markings/tiger
name = "Tiger Body"
species_allowed = list("Unathi", "Tajaran", "Vulpkanin")
icon_state = "markings_tiger"
/datum/sprite_accessory/body_markings/tigerhead
name = "Tiger Body + Head"
species_allowed = list("Unathi", "Tajaran", "Vulpkanin")
icon_state = "markings_tigerhead"
/datum/sprite_accessory/body_markings/tigerheadface_taj
name = "Tajaran Tiger Body + Head + Face"
species_allowed = list("Tajaran")
icon_state = "markings_tigerheadface_taj"
/datum/sprite_accessory/body_markings/tigerheadface_vulp
name = "Vulpkanin Tiger Body + Head + Face"
species_allowed = list("Vulpkanin")
icon_state = "markings_tigerheadface_vulp"
/datum/sprite_accessory/body_markings/tigerheadface_una
name = "Unathi Tiger Body + Head + Face"
species_allowed = list("Unathi")
icon_state = "markings_tigerheadface_una"