Skip to content

Commit

Permalink
fixes and scaled appearance toggle
Browse files Browse the repository at this point in the history
I'm learning how to make prefs!!!
  • Loading branch information
MosleyTheMalO committed Oct 27, 2024
1 parent 893e10e commit d2a8ec4
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 8 deletions.
9 changes: 9 additions & 0 deletions code/__DEFINES/~~~splurt_defines/DNA.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
///Upstream edits
//Sizecode
#undef BODY_SIZE_MAX
#undef BODY_SIZE_MIN

#define BODY_SIZE_MAX CONFIG_GET(number/body_size_max)
#define BODY_SIZE_MIN CONFIG_GET(number/body_size_min)


///arachnid organ slots
#define ORGAN_SLOT_EXTERNAL_MANDIBLES "mandibles"
#define ORGAN_SLOT_EXTERNAL_SPINNERET "spinneret"
Expand Down
4 changes: 4 additions & 0 deletions config/splurt/fetish_content.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Body size configs, the feature will be disabled if both min and max have the same value.
BODY_SIZE_MIN 0.1
BODY_SIZE_MAX 2.00

## Multiplier used in the smaller strides slowdown calculation.
## Doesn't apply to floating or crawling mobs.
BODY_SIZE_SLOWDOWN_MULTIPLIER 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "body_size"
//SPLURT EDIT CHANGE - Sizecode
/*
minimum = BODY_SIZE_MIN
maximum = BODY_SIZE_MAX
*/
//SPLURT EDIT END
step = 0.01

/datum/preference/numeric/body_size/is_accessible(datum/preferences/preferences)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
//Body size configs, the feature will be disabled if both min and max have the same value.
/datum/config_entry/number/body_size_min
default = 0.8
min_val = 0.1 //to avoid issues with zeros and negative values.
max_val = RESIZE_DEFAULT_SIZE
integer = FALSE

/datum/config_entry/number/body_size_max
default = 1.5
min_val = RESIZE_DEFAULT_SIZE
integer = FALSE

/datum/config_entry/number/body_size_slowdown_multiplier
default = 0
min_val = 0
Expand Down
6 changes: 3 additions & 3 deletions modular_zzplurt/code/datums/elements/holder_micro.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@
switch(resolve_intent_name(user.combat_mode))
if("harm") //TO:DO, rework all of these interactions to be a lot more in depth
visible_message(span_danger("[user] slams their fist down on [M]!"))
playsound(loc, 'sound/weapons/punch1.ogg', 50, 1)
playsound(loc, 'sound/items/weapons/punch1.ogg', 50, 1)
M.adjustBruteLoss(5)
if("disarm")
visible_message(span_danger("[user] pins [M] down with a finger!"))
playsound(loc, 'sound/effects/bodyfall1.ogg', 50, 1)
playsound(loc, 'sound/effects/bodyfall/bodyfall1.ogg', 50, 1)
M.adjustStaminaLoss(10)
if("grab")
visible_message(span_danger("[user] squeezes their fist around [M]!"))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1)
playsound(loc, 'sound/items/weapons/thudswoosh.ogg', 50, 1)
M.adjustOxyLoss(5)
else
M.help_shake_act(user)
Expand Down
16 changes: 16 additions & 0 deletions modular_zzplurt/code/modules/client/preferences/body_size.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/datum/preference/numeric/body_size/create_default_value()
minimum = BODY_SIZE_MIN
maximum = BODY_SIZE_MAX
. = ..()

/datum/preference/toggle/scaled_appearance
category = PREFERENCE_CATEGORY_SECONDARY_FEATURES
savefile_identifier = PREFERENCE_CHARACTER
savefile_key = "scaled_appearance"
default_value = FALSE

/datum/preference/toggle/scaled_appearance/is_accessible(datum/preferences/preferences)
. = ..()

/datum/preference/toggle/scaled_appearance/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/preferences)
target.fuzzy = value
3 changes: 0 additions & 3 deletions modular_zzplurt/code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/mob/living
var/datum/action/sizecode_smallsprite/small_sprite = new

/// Toggle admin frozen
/mob/living/proc/toggle_admin_freeze(client/admin)
admin_frozen = !admin_frozen
Expand Down
2 changes: 2 additions & 0 deletions modular_zzplurt/code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
// Admin CC
var/admin_frozen = FALSE
var/admin_sleeping = FALSE
var/datum/action/sizecode_smallsprite/small_sprite = new
var/fuzzy = FALSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/mob/living/update_transform(resize)
appearance_flags |= PIXEL_SCALE
if(fuzzy)
appearance_flags &= ~PIXEL_SCALE
. = ..()
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
name = "Diminicillin Bottle"
desc = "An incredibly expensive bottle used by Nanotrasen command. It has golden engravings and reeks of corporate greed."
w_class = WEIGHT_CLASS_TINY
icon = 'modular_zzplurt/icons/obj/drinks/drinks.dmi'
icon = 'modular_zzplurt/icons/obj/drinks.dmi'
icon_state = "diminicillin"
list_reagents = list(/datum/reagent/shrinkchem = 15)
2 changes: 1 addition & 1 deletion modular_zzplurt/code/modules/resize/smallsprite_action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
name = "Toggle Giant Sprite"
desc = "Others will always see you as giant"
button_icon = 'icons/hud/screen_gen.dmi'
button_icon_state = "healthdoll"
button_icon_state = "healthdoll_OVERLAY"
background_icon_state = "bg_alien"
var/small = FALSE
//var/image/small_icon
Expand Down
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -9403,6 +9403,7 @@
#include "modular_zzplurt\code\modules\cargo\packs\general.dm"
#include "modular_zzplurt\code\modules\client\click.dm"
#include "modular_zzplurt\code\modules\client\client_procs.dm"
#include "modular_zzplurt\code\modules\client\preferences\body_size.dm"
#include "modular_zzplurt\code\modules\client\preferences\clothing.dm"
#include "modular_zzplurt\code\modules\client\preferences\mutant_parts.dm"
#include "modular_zzplurt\code\modules\client\preferences\player_panel.dm"
Expand Down Expand Up @@ -9431,6 +9432,7 @@
#include "modular_zzplurt\code\modules\mob\living\emote.dm"
#include "modular_zzplurt\code\modules\mob\living\living.dm"
#include "modular_zzplurt\code\modules\mob\living\living_defines.dm"
#include "modular_zzplurt\code\modules\mob\living\living_update_icons.dm"
#include "modular_zzplurt\code\modules\mob\living\basic\space_fauna\wumborian_fugu\fugu_gland.dm"
#include "modular_zzplurt\code\modules\mob\living\carbon\examine.dm"
#include "modular_zzplurt\code\modules\mob\living\carbon\human\_species.dm"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { CheckboxInput, FeatureToggle } from "../../base";

export const scaled_appearance: FeatureToggle = {
name: 'Scaled Appearance',
description: 'Make your character use a sharp or fuzzy appearance.',
component: CheckboxInput,
};

0 comments on commit d2a8ec4

Please sign in to comment.