mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-29 11:32:13 +00:00
Initial
This commit is contained in:
@@ -150,6 +150,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
S["r_wing3"] >> pref.r_wing3
|
||||
S["g_wing3"] >> pref.g_wing3
|
||||
S["b_wing3"] >> pref.b_wing3
|
||||
S["digitigrade"] >> pref.digitigrade //CHOMPEdit
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/save_character(var/savefile/S)
|
||||
S["species"] << pref.species
|
||||
@@ -220,6 +221,7 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
S["r_wing3"] << pref.r_wing3
|
||||
S["g_wing3"] << pref.g_wing3
|
||||
S["b_wing3"] << pref.b_wing3
|
||||
S["digitigrade"] << pref.digitigrade //CHOMPEdit
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/sanitize_character(var/savefile/S)
|
||||
if(!pref.species || !(pref.species in GLOB.playable_species))
|
||||
@@ -580,6 +582,11 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
. += "<br><b>Body Color</b><br>"
|
||||
. += "<a href='?src=\ref[src];skin_color=1'>Change Color</a> [color_square(pref.r_skin, pref.g_skin, pref.b_skin)]<br>"
|
||||
|
||||
//CHOMPEdit START
|
||||
if(mob_species.digi_allowed)
|
||||
. += "<br><b>Digitigrade?:</b> <a href='?src=\ref[src];digitigrade=1'><b>[pref.digitigrade ? "Yes" : "No"]</b></a><br>"
|
||||
//CHOMPEdit END
|
||||
|
||||
. += "<h2>Genetics Settings</h2>"
|
||||
|
||||
var/list/ear_styles = pref.get_available_styles(global.ear_styles_list)
|
||||
@@ -1290,6 +1297,21 @@ var/global/list/valid_bloodtypes = list("A+", "A-", "B+", "B-", "AB+", "AB-", "O
|
||||
pref.g_wing3 = hex2num(copytext(new_wingc3, 4, 6))
|
||||
pref.b_wing3 = hex2num(copytext(new_wingc3, 6, 8))
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
|
||||
//CHOMPEdit START
|
||||
else if(href_list["digitigrade"])
|
||||
pref.digitigrade = !pref.digitigrade
|
||||
|
||||
//I don't know how else to force a sprite update that doing the stupid thing below
|
||||
pref.r_skin = 0
|
||||
pref.b_skin = 0
|
||||
if(pref.g_skin != 128)
|
||||
pref.g_skin = 128
|
||||
else
|
||||
pref.g_skin = 135
|
||||
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
//CHOMPEdit END
|
||||
return ..()
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/proc/reset_limbs()
|
||||
|
||||
2
code/modules/client/preferences_ch.dm
Normal file
2
code/modules/client/preferences_ch.dm
Normal file
@@ -0,0 +1,2 @@
|
||||
/datum/preferences
|
||||
var/digitigrade = 0
|
||||
60
code/modules/clothing/clothing_ch.dm
Normal file
60
code/modules/clothing/clothing_ch.dm
Normal file
@@ -0,0 +1,60 @@
|
||||
//CHOMP Overrides for if holder is digitigrade
|
||||
/obj/item/clothing
|
||||
var/update_icon_define_orig = null
|
||||
|
||||
/obj/item/clothing/proc/handle_digitigrade(var/mob/user)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
|
||||
// if digitigrade-use flag is set
|
||||
if(H.species.digitigrade)
|
||||
|
||||
// figure out what slot we care about
|
||||
var/update_icon_define_digi = null
|
||||
|
||||
if(istype(src, /obj/item/clothing/shoes))
|
||||
update_icon_define_digi = "icons/inventory/feet/mob_digi_ch.dmi"
|
||||
else if(istype(src, /obj/item/clothing/suit)) //suit
|
||||
update_icon_define_digi = "icons/inventory/suit/mob_digi_ch.dmi"
|
||||
else if(istype(src, /obj/item/clothing/under)) //uniform
|
||||
update_icon_define_digi = "icons/inventory/uniform/mob_digi_ch.dmi"
|
||||
else
|
||||
return
|
||||
|
||||
// only override icon if a corresponding digitigrade replacement icon_state exists
|
||||
// otherwise, keep the old non-digi icon
|
||||
if(icon_state && icon_states(update_icon_define_digi).Find(icon_state))
|
||||
|
||||
// Don't reset if already set
|
||||
if(update_icon_define <> update_icon_define_digi)
|
||||
|
||||
//if update_icon_define is already set to something, place it in a var to hold it temporarily
|
||||
if(update_icon_define)
|
||||
update_icon_define_orig = update_icon_define
|
||||
|
||||
//set digi-leg sprite
|
||||
update_icon_define = update_icon_define_digi
|
||||
|
||||
|
||||
// if not-digitigrade and update_icon_define set by previous digi-user, replacing an 'original' value
|
||||
else if(update_icon_define_orig)
|
||||
update_icon_define = update_icon_define_orig
|
||||
update_icon_define_orig = null
|
||||
|
||||
|
||||
else if(update_icon_define)
|
||||
// if not-digitigrade and update_icon_define set by previous digi-user, but nothing replaced
|
||||
update_icon_define = null
|
||||
|
||||
|
||||
/obj/item/clothing/shoes/equipped(var/mob/user, var/slot)
|
||||
. = ..()
|
||||
handle_digitigrade(user)
|
||||
|
||||
/obj/item/clothing/suit/equipped(var/mob/user, var/slot)
|
||||
. = ..()
|
||||
handle_digitigrade(user)
|
||||
|
||||
/obj/item/clothing/under/equipped(var/mob/user, var/slot)
|
||||
. = ..()
|
||||
handle_digitigrade(user)
|
||||
@@ -13,8 +13,19 @@
|
||||
var/grab_power_self = 0
|
||||
var/waking_speed = 1
|
||||
var/mudking = FALSE
|
||||
var/icodigi = 'icons/mob/human_races/r_digi_ch.dmi'
|
||||
var/digitigrade = FALSE
|
||||
var/digi_allowed = FALSE
|
||||
|
||||
/datum/species/handle_environment_special(var/mob/living/carbon/human/H)
|
||||
for(var/datum/trait/env_trait in env_traits)
|
||||
env_trait.handle_environment_special(H)
|
||||
return
|
||||
|
||||
// On creation, grab the preference of the creator's client, if possible.
|
||||
/datum/species/New()
|
||||
. = ..()
|
||||
if(istype(usr, /mob) && digi_allowed)
|
||||
var/mob/M = usr
|
||||
if(M.client)
|
||||
digitigrade = M.client.prefs.digitigrade
|
||||
|
||||
@@ -39,3 +39,31 @@
|
||||
/datum/species/vox
|
||||
spawn_flags = SPECIES_CAN_JOIN | SPECIES_IS_WHITELISTED | SPECIES_WHITELIST_SELECTABLE
|
||||
*/
|
||||
|
||||
//Can use digitigrade flags
|
||||
/datum/species/custom
|
||||
digi_allowed = TRUE
|
||||
|
||||
/datum/species/unathi
|
||||
digi_allowed = TRUE
|
||||
|
||||
/datum/species/tajaran
|
||||
digi_allowed = TRUE
|
||||
|
||||
/datum/species/hi_zoxxen
|
||||
digi_allowed = TRUE
|
||||
|
||||
/datum/species/sergal
|
||||
digi_allowed = TRUE
|
||||
|
||||
/datum/species/akula
|
||||
digi_allowed = TRUE
|
||||
|
||||
/datum/species/nevrean
|
||||
digi_allowed = TRUE
|
||||
|
||||
/datum/species/vulpkanin
|
||||
digi_allowed = TRUE
|
||||
|
||||
/datum/species/xenohybrid
|
||||
digi_allowed = TRUE
|
||||
39
code/modules/mob/living/carbon/human/update_icons_ch.dm
Normal file
39
code/modules/mob/living/carbon/human/update_icons_ch.dm
Normal file
@@ -0,0 +1,39 @@
|
||||
// Expand shoe layer to allow changing the icon for digi legs
|
||||
// For some reason, suit and uniform already has this funcitonality, but shoes do not.
|
||||
|
||||
#define SHOES_LAYER_ALT 7 //Shoe-slot item (when set to be under uniform via verb)
|
||||
#define SHOES_LAYER 10 //Shoe-slot item
|
||||
|
||||
/mob/living/carbon/human/update_inv_shoes()
|
||||
//. = ..()
|
||||
remove_layer(SHOES_LAYER)
|
||||
remove_layer(SHOES_LAYER_ALT) //Dumb alternate layer for shoes being under the uniform.
|
||||
|
||||
if(!shoes || (wear_suit && wear_suit.flags_inv & HIDESHOES) || (w_uniform && w_uniform.flags_inv & HIDESHOES))
|
||||
return //Either nothing to draw, or it'd be hidden.
|
||||
|
||||
for(var/f in list(BP_L_FOOT, BP_R_FOOT))
|
||||
var/obj/item/organ/external/foot/foot = get_organ(f)
|
||||
if(istype(foot) && foot.is_hidden_by_tail()) //If either foot is hidden by the tail, don't render footwear.
|
||||
return
|
||||
|
||||
var/obj/item/clothing/shoes/shoe = shoes
|
||||
var/shoe_sprite
|
||||
|
||||
if(istype(shoe) && !isnull(shoe.update_icon_define))
|
||||
shoe_sprite = shoe.update_icon_define
|
||||
else
|
||||
shoe_sprite = INV_FEET_DEF_ICON
|
||||
|
||||
//Allow for shoe layer toggle nonsense
|
||||
var/shoe_layer = SHOES_LAYER
|
||||
if(istype(shoes, /obj/item/clothing/shoes))
|
||||
var/obj/item/clothing/shoes/ushoes = shoes
|
||||
if(ushoes.shoes_under_pants == 1)
|
||||
shoe_layer = SHOES_LAYER_ALT
|
||||
|
||||
//NB: the use of a var for the layer on this one
|
||||
overlays_standing[shoe_layer] = shoes.make_worn_icon(body_type = species.get_bodytype(src), slot_name = slot_shoes_str, default_icon = shoe_sprite, default_layer = shoe_layer)
|
||||
|
||||
apply_layer(SHOES_LAYER)
|
||||
apply_layer(SHOES_LAYER_ALT)
|
||||
11
code/modules/organs/organ_icon_ch.dm
Normal file
11
code/modules/organs/organ_icon_ch.dm
Normal file
@@ -0,0 +1,11 @@
|
||||
// override the organ icon getting proc
|
||||
// if species.digitigrade is set, inject the sprites for digitigrade for appropriate organs
|
||||
|
||||
/obj/item/organ/external/get_icon(var/skeletal)
|
||||
if( species.digitigrade && ( istype(src,/obj/item/organ/external/leg) || istype(src,/obj/item/organ/external/foot) ) )
|
||||
var/IB = species.icobase
|
||||
species.icobase = species.icodigi
|
||||
. = ..()
|
||||
species.icobase = IB
|
||||
else
|
||||
. = ..()
|
||||
BIN
icons/inventory/feet/mob_digi_ch.dmi
Normal file
BIN
icons/inventory/feet/mob_digi_ch.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
BIN
icons/inventory/suit/mob_digi_ch.dmi
Normal file
BIN
icons/inventory/suit/mob_digi_ch.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 336 KiB |
BIN
icons/inventory/uniform/mob_digi_ch.dmi
Normal file
BIN
icons/inventory/uniform/mob_digi_ch.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 294 KiB |
BIN
icons/mob/human_races/r_digi_ch.dmi
Normal file
BIN
icons/mob/human_races/r_digi_ch.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 532 B |
@@ -1935,6 +1935,7 @@
|
||||
#include "code\modules\client\client procs_vr.dm"
|
||||
#include "code\modules\client\movement.dm"
|
||||
#include "code\modules\client\preferences.dm"
|
||||
#include "code\modules\client\preferences_ch.dm"
|
||||
#include "code\modules\client\preferences_factions.dm"
|
||||
#include "code\modules\client\preferences_savefile.dm"
|
||||
#include "code\modules\client\preferences_spawnpoints.dm"
|
||||
@@ -2024,6 +2025,7 @@
|
||||
#include "code\modules\clothing\chameleon.dm"
|
||||
#include "code\modules\clothing\clothing.dm"
|
||||
#include "code\modules\clothing\clothing_accessories.dm"
|
||||
#include "code\modules\clothing\clothing_ch.dm"
|
||||
#include "code\modules\clothing\clothing_icons.dm"
|
||||
#include "code\modules\clothing\clothing_vr.dm"
|
||||
#include "code\modules\clothing\ears\earrings.dm"
|
||||
@@ -2932,6 +2934,7 @@
|
||||
#include "code\modules\mob\living\carbon\human\stripping.dm"
|
||||
#include "code\modules\mob\living\carbon\human\unarmed_attack.dm"
|
||||
#include "code\modules\mob\living\carbon\human\update_icons.dm"
|
||||
#include "code\modules\mob\living\carbon\human\update_icons_ch.dm"
|
||||
#include "code\modules\mob\living\carbon\human\ai_controlled\ai_controlled.dm"
|
||||
#include "code\modules\mob\living\carbon\human\descriptors\_descriptors.dm"
|
||||
#include "code\modules\mob\living\carbon\human\descriptors\descriptors_generic.dm"
|
||||
@@ -3474,6 +3477,7 @@
|
||||
#include "code\modules\organs\organ_external.dm"
|
||||
#include "code\modules\organs\organ_external_vr.dm"
|
||||
#include "code\modules\organs\organ_icon.dm"
|
||||
#include "code\modules\organs\organ_icon_ch.dm"
|
||||
#include "code\modules\organs\organ_stump.dm"
|
||||
#include "code\modules\organs\pain.dm"
|
||||
#include "code\modules\organs\robolimbs.dm"
|
||||
|
||||
Reference in New Issue
Block a user