mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-25 22:28:44 +01:00
Various Fixes (#5399)
* modularize digitigrade code * Hide glasses + tail side layering fix * pipe unwrench yeet Co-authored-by: Razgriz <razgriz1032@gmail.com>
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
// Chomp additions to character load/save logic
|
||||
// /datum/category_item/player_setup_item/general/body/content cannot be overridden here easily as the proc creates a list of html data
|
||||
// perhaps one could get that list here, and sort through sections to rewrite it's content...? that seems inefficent having to loop through the list.
|
||||
|
||||
//copy_to_mob setup proc for spawning mob from prefs
|
||||
/datum/category_item/player_setup_item/general/body/copy_to_mob(var/mob/living/carbon/human/character)
|
||||
. = ..()
|
||||
if(character.species.digi_allowed)
|
||||
character.digitigrade = pref.digitigrade
|
||||
else
|
||||
character.digitigrade = 0
|
||||
|
||||
//sanity check
|
||||
if(character.digitigrade == null)
|
||||
character.digitigrade = 0
|
||||
pref.digitigrade = 0 // given above code, if character.digi is null, pref.digi also has to be.
|
||||
|
||||
// ontopic, the proc for clicking an option in the body customisation panel
|
||||
/datum/category_item/player_setup_item/general/body/OnTopic(var/href,var/list/href_list, var/mob/user)
|
||||
if(href_list["digitigrade"])
|
||||
pref.digitigrade = !pref.digitigrade
|
||||
|
||||
return TOPIC_REFRESH_UPDATE_PREVIEW
|
||||
. = ..()
|
||||
|
||||
// Savefile additions
|
||||
// Be careful here
|
||||
|
||||
// This will add chomp-custom data to the body customisaiton page, below 'body color', above 'genetics settings'
|
||||
/datum/category_item/player_setup_item/general/body/proc/chomp_custom_additions_body(var/mob/user, var/datum/species/mob_species)
|
||||
. += "<h2>ChompStation Settings</h2>"
|
||||
|
||||
if(mob_species.digi_allowed)
|
||||
. += "<br><b>Digitigrade?:</b> <a href='?src=\ref[src];digitigrade=1'><b>[pref.digitigrade ? "Yes" : "No"]</b></a><br>"
|
||||
|
||||
return .
|
||||
|
||||
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/load_character(var/savefile/S)
|
||||
. = ..()
|
||||
S["digitigrade"] >> pref.digitigrade //CHOMPEdit
|
||||
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/save_character(var/savefile/S)
|
||||
. = ..()
|
||||
S["digitigrade"] << pref.digitigrade //CHOMPEdit
|
||||
|
||||
|
||||
/datum/category_item/player_setup_item/general/body/sanitize_character(var/savefile/S)
|
||||
. = ..()
|
||||
pref.digitigrade = sanitize_integer(pref.digitigrade, 0, 1, initial(pref.digitigrade))
|
||||
@@ -1,3 +1,17 @@
|
||||
/obj/item/clothing
|
||||
var/update_icon_define_orig = null // temp storage for original update_icon_define (if it exists)
|
||||
var/update_icon_define_digi = null
|
||||
var/fit_for_digi = FALSE // flag for if clothing has already been reskinned to digitigrade
|
||||
|
||||
/obj/item/clothing/shoes
|
||||
update_icon_define_digi = "modular_chomp/icons/inventory/feet/mob_digi.dmi"
|
||||
|
||||
/obj/item/clothing/suit
|
||||
update_icon_define_digi = "modular_chomp/icons/inventory/suit/mob_digi.dmi"
|
||||
|
||||
/obj/item/clothing/under
|
||||
update_icon_define_digi = "modular_chomp/icons/inventory/uniform/mob_digi.dmi"
|
||||
|
||||
/obj/item/clothing/shoes/MouseDrop_T(mob/living/target, mob/living/user)
|
||||
if(!istype(user)) return ..() // If the user passed in isn't a living mob, exit
|
||||
if(target != user) return ..() // If the user didn't drag themselves, exit
|
||||
@@ -17,3 +31,54 @@
|
||||
user.forceMove(src)
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
/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.digitigrade)
|
||||
|
||||
// figure out what slot we care about
|
||||
if(!update_icon_define_digi)
|
||||
return
|
||||
|
||||
// Don't reset if already set
|
||||
if(!fit_for_digi)
|
||||
fit_for_digi = TRUE // set flag even if no icon_state exists, so we don't repeat checks
|
||||
|
||||
//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
|
||||
|
||||
// only override icon if a corresponding digitigrade replacement icon_state exists
|
||||
// otherwise, keep the old non-digi icon_define (or nothing)
|
||||
if(icon_state && icon_states(update_icon_define_digi).Find(icon_state))
|
||||
update_icon_define = update_icon_define_digi
|
||||
|
||||
|
||||
// if not-digitigrade, only act if the clothing was previously fit for a digitigrade char
|
||||
else
|
||||
if(fit_for_digi)
|
||||
fit_for_digi = FALSE
|
||||
|
||||
//either reset update_icon_define to it's old value
|
||||
// or reset update_icon_define to null
|
||||
if(update_icon_define_orig)
|
||||
update_icon_define = update_icon_define_orig
|
||||
update_icon_define_orig = null
|
||||
else
|
||||
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)
|
||||
@@ -22,4 +22,11 @@
|
||||
set category = "IC"
|
||||
set desc = "Toggle headset worn icon visibility."
|
||||
hide_headset = !hide_headset
|
||||
update_inv_ears()
|
||||
update_inv_ears()
|
||||
|
||||
/mob/living/carbon/human/verb/hide_glasses()
|
||||
set name = "Show/Hide Glasses"
|
||||
set category = "IC"
|
||||
set desc = "Toggle glasses worn icon visibility."
|
||||
hide_glasses = !hide_glasses
|
||||
update_inv_glasses()
|
||||
@@ -10,5 +10,6 @@
|
||||
var/struggle_anim_stomach = FALSE
|
||||
var/struggle_anim_taur = FALSE
|
||||
var/hide_headset = FALSE
|
||||
var/hide_glasses = FALSE
|
||||
var/speech_sound_enabled = TRUE
|
||||
var/nutrition_hidden = FALSE
|
||||
|
||||
@@ -1,6 +1,22 @@
|
||||
/datum/species
|
||||
var/crit_mod = 1
|
||||
var/vore_belly_default_variant = "H"
|
||||
var/list/env_traits = list()
|
||||
var/dirtslip = FALSE
|
||||
var/photosynthesizing = FALSE
|
||||
var/grows = FALSE
|
||||
var/shrinks = FALSE
|
||||
var/rad_levels = list("safe" = 2.5, "danger_1" = 50, "danger_2" = 75, "danger_3" = 150)
|
||||
var/rad_removal_mod = 1
|
||||
var/bite_mod = 1
|
||||
var/grab_resist_divisor_victims = 1
|
||||
var/grab_resist_divisor_self = 1
|
||||
var/grab_power_victims = 0
|
||||
var/grab_power_self = 0
|
||||
var/waking_speed = 1
|
||||
var/mudking = FALSE
|
||||
var/icodigi = 'modular_chomp/icons/mob/human_races/r_digi.dmi'
|
||||
var/digi_allowed = FALSE
|
||||
|
||||
// Handles non-standard eyes when using a species that utilizes a custom base icon set.
|
||||
// Eye data is stored in the head organ, and this needs to be handled specially.
|
||||
@@ -27,4 +43,9 @@
|
||||
|
||||
if(!QDELETED(baseHead) && baseHead)
|
||||
qdel(baseHead)
|
||||
return
|
||||
|
||||
/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
|
||||
@@ -1,2 +1,74 @@
|
||||
/datum/species/unathi
|
||||
vore_belly_default_variant = "L"
|
||||
//Any species commented out here must be made restricted elsewhere. They are kept here for easy reference of what we disabled.
|
||||
//Note that at the time of this PR we are simply disabling everything new to discuss keeping versus scrapping later.
|
||||
|
||||
///datum/species/zaddat
|
||||
// spawn_flags = SPECIES_IS_RESTRICTED //Species has been enabled elsewhere.
|
||||
|
||||
///datum/species/crew_shadekin
|
||||
// spawn_flags = SPECIES_IS_RESTRICTED
|
||||
|
||||
/datum/species/human/gravworlder
|
||||
spawn_flags = SPECIES_IS_RESTRICTED
|
||||
|
||||
/datum/species/human/spacer
|
||||
spawn_flags = SPECIES_IS_RESTRICTED
|
||||
|
||||
///datum/species/alraune
|
||||
// spawn_flags = SPECIES_IS_RESTRICTED //Species has been enabled, keeping this here for reference.
|
||||
|
||||
///datum/species/werebeast
|
||||
// spawn_flags = SPECIES_IS_RESTRICTED
|
||||
|
||||
/datum/species/shadekin_yw
|
||||
spawn_flags = SPECIES_IS_RESTRICTED
|
||||
|
||||
/datum/species/shadekin
|
||||
//spawn_flags = SPECIES_IS_RESTRICTED
|
||||
|
||||
//datum/species/protean
|
||||
// spawn_flags = SPECIES_IS_RESTRICTED
|
||||
|
||||
//TFF 20/1/20 - More whitelisted species listed here. Unable to force overrides to be enabled here.
|
||||
/*
|
||||
/datum/species/xenochimera
|
||||
spawn_flags = SPECIES_CAN_JOIN | SPECIES_IS_WHITELISTED | SPECIES_WHITELIST_SELECTABLE
|
||||
|
||||
/datum/species/diona
|
||||
spawn_flags = SPECIES_CAN_JOIN | SPECIES_IS_WHITELISTED | SPECIES_WHITELIST_SELECTABLE
|
||||
|
||||
/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
|
||||
vore_belly_default_variant = "L"
|
||||
|
||||
/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
|
||||
|
||||
/datum/species/xenochimera
|
||||
digi_allowed = TRUE
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
/datum/sprite_accessory/tail
|
||||
lower_layer_dirs = list(SOUTH, WEST, EAST)
|
||||
|
||||
|
||||
/datum/sprite_accessory/tail/anthrovirus_tail
|
||||
name = "Anthro Virus Tail"
|
||||
icon = 'icons/mob/vore/tails_ch.dmi'
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/obj/machinery/clonepod/transhuman/growclone(var/datum/transhuman/body_record/current_project)
|
||||
. = ..()
|
||||
//Extra clonepod behavior
|
||||
var/mob/living/carbon/human/H = occupant
|
||||
var/datum/dna2/record/R = current_project.mydna
|
||||
|
||||
H.digitigrade = R.dna.digitigrade // ensure clone mob has digitigrade var set appropriately
|
||||
if(H.dna.digitigrade <> R.dna.digitigrade)
|
||||
H.dna.digitigrade = R.dna.digitigrade // ensure cloned DNA is set appropriately from record??? for some reason it doesn't get set right despite the override to datum/dna/Clone()
|
||||
|
||||
H.update_icons_body()
|
||||
Reference in New Issue
Block a user