-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternate tail/body/whatever-can-fit-on-the-tail-layer system #1997
Changes from 6 commits
3ee80a3
c606f70
6617ae1
7ce1d05
aa508b4
49b5450
82002c1
f01b8f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -128,6 +128,7 @@ datum/preferences | |
var/species = "Human" | ||
var/language = "None" //Secondary language | ||
|
||
var/body_accessory = null | ||
|
||
var/speciesprefs = 0//I hate having to do this, I really do (Using this for oldvox code, making names universal I guess | ||
|
||
|
@@ -186,17 +187,17 @@ datum/preferences | |
|
||
// jukebox volume | ||
var/volume = 100 | ||
|
||
// BYOND membership | ||
var/unlock_content = 0 | ||
|
||
/datum/preferences/New(client/C) | ||
b_type = pick(4;"O-", 36;"O+", 3;"A-", 28;"A+", 1;"B-", 20;"B+", 1;"AB-", 5;"AB+") | ||
if(istype(C)) | ||
if(!IsGuestKey(C.key)) | ||
unlock_content = C.IsByondMember() | ||
if(unlock_content) | ||
max_save_slots = MAX_SAVE_SLOTS_MEMBER | ||
max_save_slots = MAX_SAVE_SLOTS_MEMBER | ||
var/loaded_preferences_successfully = load_preferences(C) | ||
if(loaded_preferences_successfully) | ||
if(load_character(C)) | ||
|
@@ -366,10 +367,14 @@ datum/preferences | |
dat += "<br><b>Eyes</b><br>" | ||
dat += "<a href='?_src_=prefs;preference=eyes;task=input'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(r_eyes, 2)][num2hex(g_eyes, 2)][num2hex(b_eyes, 2)]'><table style='display:inline;' bgcolor='#[num2hex(r_eyes, 2)][num2hex(g_eyes, 2)][num2hex(b_eyes)]'><tr><td>__</td></tr></table></font><br>" | ||
|
||
if(species == "Unathi" || species == "Tajaran" || species == "Skrell" || species == "Slime People" || species == "Vulpkanin") | ||
if(species == "Unathi" || species == "Tajaran" || species == "Skrell" || species == "Slime People" || species == "Vulpkanin" || body_accessory_by_species[species] || check_rights(R_ADMIN, 1, user)) //admins can always fuck with this, because they are admins | ||
dat += "<br><b>Body Color</b><br>" | ||
dat += "<a href='?_src_=prefs;preference=skin;task=input'>Change Color</a> <font face='fixedsys' size='3' color='#[num2hex(r_skin, 2)][num2hex(g_skin, 2)][num2hex(b_skin, 2)]'><table style='display:inline;' bgcolor='#[num2hex(r_skin, 2)][num2hex(g_skin, 2)][num2hex(b_skin)]'><tr><td>__</td></tr></table></font>" | ||
|
||
if(body_accessory_by_species[species] || check_rights(R_ADMIN, 1, user)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Second parameter probably needs to be a 0. It shouldn't notify the user of a lack of rights if that check fails. |
||
dat += "<br><b>Body Accessory</b><br>" | ||
dat += "Accessory: <a href='?_src_=prefs;preference=body_accessory;task=input'>[body_accessory ? "[body_accessory]" : "None"]</a><br>" | ||
|
||
dat += "</td></tr></table><hr><center>" | ||
|
||
if (1) // General Preferences | ||
|
@@ -387,15 +392,15 @@ datum/preferences | |
dat += "<b>Ghost radio:</b> <a href='?_src_=prefs;preference=ghost_radio'><b>[(toggles & CHAT_GHOSTRADIO) ? "Nearest Speakers" : "All Chatter"]</b></a><br>" | ||
if(config.allow_Metadata) | ||
dat += "<b>OOC notes:</b> <a href='?_src_=prefs;preference=metadata;task=input'><b>Edit</b></a><br>" | ||
|
||
if(user.client) | ||
if(user.client.holder) | ||
dat += "<b>Adminhelp sound:</b> " | ||
dat += "<a href='?_src_=prefs;preference=hear_adminhelps'><b>[(sound & SOUND_ADMINHELP)?"On":"Off"]</b></a><br>" | ||
|
||
if(check_rights(R_ADMIN,0)) | ||
dat += "<b>OOC:</b> <span style='border: 1px solid #161616; background-color: [ooccolor ? ooccolor : normal_ooc_colour];'> </span> <a href='?_src_=prefs;preference=ooccolor;task=input'><b>Change</b></a><br>" | ||
|
||
if(unlock_content) | ||
dat += "<b>BYOND Membership Publicity:</b> <a href='?_src_=prefs;preference=publicity'><b>[(toggles & MEMBER_PUBLIC) ? "Public" : "Hidden"]</b></a><br>" | ||
|
||
|
@@ -1165,10 +1170,27 @@ datum/preferences | |
|
||
valid_hairstyles[hairstyle] = hair_styles_list[hairstyle] | ||
|
||
var/new_h_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in valid_hairstyles | ||
var/new_h_style = input(user, "Choose your character's hair style:", "Character Preference") as null|anything in valid_hairstyles | ||
if(new_h_style) | ||
h_style = new_h_style | ||
|
||
if("body_accessory") | ||
var/list/possible_body_accessories = list() | ||
if(check_rights(R_ADMIN, 1, user)) | ||
possible_body_accessories = body_accessory_by_name.Copy() | ||
else | ||
for(var/B in body_accessory_by_name) | ||
var/datum/body_accessory/accessory = body_accessory_by_name[B] | ||
if(!istype(accessory)) | ||
possible_body_accessories += "None" //the only null entry should be the "None" option | ||
continue | ||
if(species in accessory.allowed_species) | ||
possible_body_accessories += B | ||
|
||
var/new_body_accessory = input(user, "Choose your body accessory:", "Character Preference") as null|anything in possible_body_accessories | ||
if(new_body_accessory) | ||
body_accessory = new_body_accessory | ||
|
||
if("facial") | ||
var/new_facial = input(user, "Choose your character's facial-hair colour:", "Character Preference") as color|null | ||
if(new_facial) | ||
|
@@ -1246,7 +1268,7 @@ datum/preferences | |
s_tone = 35 - max(min( round(new_s_tone), 220),1) | ||
|
||
if("skin") | ||
if(species == "Unathi" || species == "Tajaran" || species == "Skrell" || species == "Slime People"|| species == "Vulpkanin") | ||
if(species == "Unathi" || species == "Tajaran" || species == "Skrell" || species == "Slime People"|| species == "Vulpkanin" || body_accessory_by_species[species] || check_rights(R_ADMIN, 1, user)) | ||
var/new_skin = input(user, "Choose your character's skin colour: ", "Character Preference") as color|null | ||
if(new_skin) | ||
r_skin = hex2num(copytext(new_skin, 2, 4)) | ||
|
@@ -1381,7 +1403,7 @@ datum/preferences | |
if("publicity") | ||
if(unlock_content) | ||
toggles ^= MEMBER_PUBLIC | ||
|
||
if("gender") | ||
if(gender == MALE) | ||
gender = FEMALE | ||
|
@@ -1571,6 +1593,9 @@ datum/preferences | |
character.undershirt = undershirt | ||
character.socks = socks | ||
|
||
if(body_accessory) | ||
character.body_accessory = body_accessory_by_name["[body_accessory]"] | ||
|
||
if(backbag > 4 || backbag < 1) | ||
backbag = 1 //Same as above | ||
character.backbag = backbag | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
var/global/list/body_accessory_by_name = list("None" = null) | ||
|
||
/hook/startup/proc/initalize_body_accessories() | ||
|
||
__init_body_accessory(/datum/body_accessory/body) | ||
__init_body_accessory(/datum/body_accessory/tail) | ||
|
||
if(body_accessory_by_name.len) | ||
if(initialize_body_accessory_by_species()) | ||
return 1 | ||
|
||
return 0 //fail if no bodies are found | ||
|
||
var/global/list/body_accessory_by_species = list("None" = null) | ||
|
||
/proc/initialize_body_accessory_by_species() | ||
for(var/B in body_accessory_by_name) | ||
var/datum/body_accessory/accessory = body_accessory_by_name[B] | ||
if(!istype(accessory)) continue | ||
|
||
for(var/species in accessory.allowed_species) | ||
if(!body_accessory_by_species["[species]"]) body_accessory_by_species["[species]"] = list() | ||
body_accessory_by_species["[species]"] += accessory | ||
|
||
if(body_accessory_by_species.len) | ||
return 1 | ||
return 0 | ||
|
||
/proc/__init_body_accessory(var/ba_path) | ||
if(ispath(ba_path)) | ||
var/_added_counter = 0 | ||
|
||
for(var/A in subtypesof(ba_path)) | ||
var/datum/body_accessory/B = new A | ||
if(istype(B)) | ||
body_accessory_by_name[B.name] += B | ||
++_added_counter | ||
|
||
if(_added_counter) | ||
return 1 | ||
return 0 | ||
|
||
|
||
/datum/body_accessory | ||
var/name = "default" | ||
|
||
var/icon = null | ||
var/icon_state = "" | ||
|
||
var/animated_icon = null | ||
var/animated_icon_state = "" | ||
|
||
var/blend_mode = null | ||
|
||
var/pixel_x_offset = 0 | ||
var/pixel_y_offset = 0 | ||
|
||
var/list/allowed_species = list() | ||
|
||
/datum/body_accessory/proc/try_restrictions(var/mob/living/carbon/human/H) | ||
return 1 | ||
|
||
/datum/body_accessory/proc/get_pixel_x(var/mob/living/carbon/human/H) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This... doesn't really need to exist. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's in place for anything that needs special handling depending on the human it's attached to, I suppose I could remove it until something of the sort is actually a thing, though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah I get -why- it might be needed in the future, but atm it's literally inefficiency personified. |
||
return pixel_x_offset | ||
|
||
/datum/body_accessory/proc/get_pixel_y(var/mob/living/carbon/human/H) | ||
return pixel_y_offset | ||
|
||
/datum/body_accessory/proc/get_animated_icon() //return animated if it has it, return static if it does not. | ||
if(animated_icon) | ||
return animated_icon | ||
|
||
else return icon | ||
|
||
/datum/body_accessory/proc/get_animated_icon_state() | ||
if(animated_icon_state) | ||
return animated_icon_state | ||
|
||
else return icon_state | ||
|
||
|
||
//Bodies | ||
/datum/body_accessory/body | ||
blend_mode = ICON_MULTIPLY | ||
|
||
/datum/body_accessory/body/snake | ||
name = "Snake" | ||
|
||
icon = 'icons/mob/body_accessory_64.dmi' | ||
icon_state = "naga" | ||
|
||
pixel_x_offset = -16 | ||
|
||
//Tails | ||
/datum/body_accessory/tail | ||
icon = 'icons/mob/body_accessory.dmi' | ||
animated_icon = 'icons/mob/body_accessory.dmi' | ||
blend_mode = ICON_ADD | ||
|
||
/datum/body_accessory/tail/try_restrictions(var/mob/living/carbon/human/H) | ||
if(!H.wear_suit || !(H.wear_suit.flags_inv & HIDETAIL) && !istype(H.wear_suit, /obj/item/clothing/suit/space)) | ||
return 1 | ||
return 0 | ||
|
||
|
||
//vulpakin | ||
/datum/body_accessory/tail/vulpkanin_2 | ||
name = "Vulpkanin Alt 1 (Bushy)" | ||
|
||
icon_state = "vulptail2" | ||
animated_icon_state = "vulptail2_a" | ||
allowed_species = list("Vulpkanin") | ||
|
||
/datum/body_accessory/tail/vulpkanin_3 | ||
name = "Vulpkanin Alt 2 (Straight)" | ||
|
||
icon_state = "vulptail3" | ||
animated_icon_state = "vulptail3_a" | ||
allowed_species = list("Vulpkanin") | ||
|
||
/datum/body_accessory/tail/vulpkanin_4 | ||
name = "Vulpkanin Alt 3 (Tiny)" | ||
|
||
icon_state = "vulptail4" | ||
animated_icon_state = "vulptail4_a" | ||
allowed_species = list("Vulpkanin") | ||
|
||
/datum/body_accessory/tail/vulpkanin_5 | ||
name = "Vulpkanin Alt 4 (Short)" | ||
|
||
icon_state = "vulptail5" | ||
animated_icon_state = "vulptail5_a" | ||
allowed_species = list("Vulpkanin") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second parameter probably needs to be a 0. It shouldn't notify the user of a lack of rights if that check fails.