Merge pull request #3037 from KasparoVy/master

Adds Body Marking Customization, Head Accessories, Revises Unathi Customization, Related Minor Fixes, etc.
This commit is contained in:
Fox McCloud
2016-01-03 22:33:40 -05:00
28 changed files with 689 additions and 176 deletions
+80
View File
@@ -97,6 +97,14 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
var/undershirt = "Nude" //undershirt type
var/socks = "Nude" //socks type
var/backbag = 2 //backpack type
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
var/b_markings = 0 //Marking colour
var/h_style = "Bald" //Hair type
var/r_hair = 0 //Hair color
var/g_hair = 0 //Hair color
@@ -341,6 +349,18 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
dat += "[TextPreview(flavor_text)]...<br>"
dat += "<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> "
dat += "<br>Style: <a href='?_src_=prefs;preference=m_style;task=input'>[m_style]</a><br>"
var/hairname = "Hair"
if(species == "Machine")
hairname = "Frame Color"
@@ -1112,6 +1132,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
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
@@ -1172,6 +1195,52 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(new_h_style)
h_style = new_h_style
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("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_head_accessory_styles[head_accessory_style] = head_accessory_styles_list[head_accessory_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 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)
r_markings = hex2num(copytext(new_markings, 2, 4))
g_markings = hex2num(copytext(new_markings, 4, 6))
b_markings = hex2num(copytext(new_markings, 6, 8))
if("m_style")
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]
if( !(species in M.species_allowed))
continue
valid_markings[markingstyle] = marking_styles_list[markingstyle]
var/new_marking_style = input(user, "Choose the style of your character's body markings:", "Character Preference") as null|anything in valid_markings
if(new_marking_style)
m_style = new_marking_style
if("body_accessory")
var/list/possible_body_accessories = list()
if(check_rights(R_ADMIN, 1, user))
@@ -1597,6 +1666,17 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
character.undershirt = undershirt
character.socks = socks
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
character.b_markings = b_markings
character.m_style = m_style
if(body_accessory)
character.body_accessory = body_accessory_by_name["[body_accessory]"]
+74 -36
View File
@@ -108,6 +108,16 @@
skin_red,
skin_green,
skin_blue,
markings_red,
markings_green,
markings_blue,
head_accessory_red,
head_accessory_green,
head_accessory_blue,
hair_style_name,
facial_style_name,
marking_style_name,
head_accessory_style_name,
hair_style_name,
facial_style_name,
eyes_red,
@@ -170,47 +180,55 @@
r_skin = text2num(query.item[15])
g_skin = text2num(query.item[16])
b_skin = text2num(query.item[17])
h_style = query.item[18]
f_style = query.item[19]
r_eyes = text2num(query.item[20])
g_eyes = text2num(query.item[21])
b_eyes = text2num(query.item[22])
underwear = query.item[23]
undershirt = query.item[24]
backbag = text2num(query.item[25])
b_type = query.item[26]
r_markings = text2num(query.item[18])
g_markings = text2num(query.item[19])
b_markings = text2num(query.item[20])
r_headacc = text2num(query.item[21])
g_headacc = text2num(query.item[22])
b_headacc = text2num(query.item[23])
h_style = query.item[24]
f_style = query.item[25]
m_style = query.item[26]
ha_style = query.item[27]
r_eyes = text2num(query.item[28])
g_eyes = text2num(query.item[29])
b_eyes = text2num(query.item[30])
underwear = query.item[31]
undershirt = query.item[32]
backbag = text2num(query.item[33])
b_type = query.item[34]
//Jobs
alternate_option = text2num(query.item[27])
job_support_high = text2num(query.item[28])
job_support_med = text2num(query.item[29])
job_support_low = text2num(query.item[30])
job_medsci_high = text2num(query.item[31])
job_medsci_med = text2num(query.item[32])
job_medsci_low = text2num(query.item[33])
job_engsec_high = text2num(query.item[34])
job_engsec_med = text2num(query.item[35])
job_engsec_low = text2num(query.item[36])
job_karma_high = text2num(query.item[37])
job_karma_med = text2num(query.item[38])
job_karma_low = text2num(query.item[39])
alternate_option = text2num(query.item[35])
job_support_high = text2num(query.item[36])
job_support_med = text2num(query.item[37])
job_support_low = text2num(query.item[38])
job_medsci_high = text2num(query.item[39])
job_medsci_med = text2num(query.item[40])
job_medsci_low = text2num(query.item[41])
job_engsec_high = text2num(query.item[42])
job_engsec_med = text2num(query.item[43])
job_engsec_low = text2num(query.item[44])
job_karma_high = text2num(query.item[45])
job_karma_med = text2num(query.item[46])
job_karma_low = text2num(query.item[47])
//Miscellaneous
flavor_text = query.item[40]
med_record = query.item[41]
sec_record = query.item[42]
gen_record = query.item[43]
disabilities = text2num(query.item[44])
player_alt_titles = params2list(query.item[45])
organ_data = params2list(query.item[46])
rlimb_data = params2list(query.item[47])
nanotrasen_relation = query.item[48]
speciesprefs = text2num(query.item[49])
flavor_text = query.item[48]
med_record = query.item[49]
sec_record = query.item[50]
gen_record = query.item[51]
disabilities = text2num(query.item[52])
player_alt_titles = params2list(query.item[53])
organ_data = params2list(query.item[54])
rlimb_data = params2list(query.item[55])
nanotrasen_relation = query.item[56]
speciesprefs = text2num(query.item[57])
//socks
socks = query.item[50]
body_accessory = query.item[51]
socks = query.item[58]
body_accessory = query.item[59]
//Sanitize
metadata = sanitize_text(metadata, initial(metadata))
@@ -233,8 +251,16 @@
r_skin = sanitize_integer(r_skin, 0, 255, initial(r_skin))
g_skin = sanitize_integer(g_skin, 0, 255, initial(g_skin))
b_skin = sanitize_integer(b_skin, 0, 255, initial(b_skin))
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_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))
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))
@@ -300,8 +326,16 @@
skin_red='[r_skin]',
skin_green='[g_skin]',
skin_blue='[b_skin]',
markings_red='[r_markings]',
markings_green='[g_markings]',
markings_blue='[b_markings]',
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)]',
head_accessory_style_name='[sql_sanitize_text(ha_style)]',
eyes_red='[r_eyes]',
eyes_green='[g_eyes]',
eyes_blue='[b_eyes]',
@@ -351,7 +385,9 @@
hair_red, hair_green, hair_blue,
facial_red, facial_green, facial_blue,
skin_tone, skin_red, skin_green, skin_blue,
hair_style_name, facial_style_name,
markings_red, markings_green, markings_blue,
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,
@@ -370,7 +406,9 @@
'[r_hair]', '[g_hair]', '[b_hair]',
'[r_facial]', '[g_facial]', '[b_facial]',
'[s_tone]', '[r_skin]', '[g_skin]', '[b_skin]',
'[sql_sanitize_text(h_style)]', '[sql_sanitize_text(f_style)]',
'[r_markings]', '[g_markings]', '[b_markings]',
'[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]',