-
-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
3ee80a3
Body accessory system
tigercat2000 c606f70
Fix tail-wagging invisible tails
tigercat2000 6617ae1
Merge branch 'master' into sneks
tigercat2000 7ce1d05
Add FullofSkittle's alt. vulp tails, fixes
tigercat2000 aa508b4
Change pixel_offsets list into two variables for efficiency
tigercat2000 49b5450
Allow anyone with a body_accessory to use the tail-wag verbs.
tigercat2000 82002c1
Get rid of pointless get_ procs
tigercat2000 f01b8f1
Remove snake body until better sprite can be found
tigercat2000 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
128 changes: 128 additions & 0 deletions
128
code/modules/mob/living/carbon/human/body_accessories.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
|
||
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_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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.