From cfefe99d35430b6d811d0b9bb0df3ab365ea6d76 Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Mon, 26 Oct 2020 17:45:43 +0000
Subject: [PATCH 01/11] okay so what if its not quirks
---
code/datums/dna.dm | 14 ++++++++------
code/modules/client/preferences.dm | 20 ++++----------------
2 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/code/datums/dna.dm b/code/datums/dna.dm
index cd90b554ac..a6510d3336 100644
--- a/code/datums/dna.dm
+++ b/code/datums/dna.dm
@@ -696,11 +696,13 @@
/datum/dna/proc/update_body_size(old_size)
if(!holder || features["body_size"] == old_size)
return
+ //new size detected
holder.resize = features["body_size"] / old_size
holder.update_transform()
- var/danger = CONFIG_GET(number/threshold_body_size_slowdown)
- if(features["body_size"] < danger)
- var/slowdown = (1 - round(features["body_size"] / danger, 0.1)) * CONFIG_GET(number/body_size_slowdown_multiplier)
- holder.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/small_stride, TRUE, slowdown)
- else if(old_size < danger)
- holder.remove_movespeed_modifier(/datum/movespeed_modifier/small_stride)
+ if(features["body_size"] < 1 && old_size >= 1)
+ holder.maxhealth -= 10 //reduce the maxhealth
+ else
+ if(old_size < 1 && features["body_size"] >= 1)
+ holder.maxhealth += 10 //give the maxhealth back
+
+
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index d817cc3a53..58e91e82c0 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -482,7 +482,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
dat += " Change
"
mutant_colors = TRUE
- if (CONFIG_GET(number/body_size_min) != CONFIG_GET(number/body_size_max))
dat += "Sprite Size: [features["body_size"]*100]%
"
if(!(NOEYES in pref_species.species_traits))
@@ -2245,21 +2244,10 @@ GLOBAL_LIST_EMPTY(preferences_datums)
gender = chosengender
if("body_size")
- var/min = CONFIG_GET(number/body_size_min)
- var/max = CONFIG_GET(number/body_size_max)
- var/danger = CONFIG_GET(number/threshold_body_size_slowdown)
- var/new_body_size = input(user, "Choose your desired sprite size: ([min*100]%-[max*100]%)\nWarning: This may make your character look distorted[danger > min ? "! Additionally, a proportional movement speed penalty will be applied to characters smaller than [danger*100]%." : "!"]", "Character Preference", features["body_size"]*100) as num|null
- if (new_body_size)
- new_body_size = clamp(new_body_size * 0.01, min, max)
- var/dorfy
- if((new_body_size + 0.01) < danger) // Adding 0.01 as a dumb fix to prevent the warning message from appearing when exactly at threshold... Not sure why that happens in the first place.
- dorfy = alert(user, "You have chosen a size below the slowdown threshold of [danger*100]%. For balancing purposes, the further you go below this percentage, the slower your character will be. Do you wish to keep this size?", "Speed Penalty Alert", "Yes", "Move it to the threshold", "No")
- if(dorfy == "Move it to the threshold")
- new_body_size = danger
- if(!dorfy) //Aborts if this var is somehow empty
- return
- if(dorfy != "No")
- features["body_size"] = new_body_size
+ var/new_body_size = input(user, "Choose your desired sprite size: (90-125%)\nWarning: This may make your character look distorted. Additionally, any size under 100% takes a 10% maximum health penalty", "Character Preference", features["body_size"]*100) as num|null
+ if(new_body_size)
+ body_size = clamp(new_body_size * 0.01, 90, 125)
+
if("tongue")
var/selected_custom_tongue = input(user, "Choose your desired tongue (none means your species tongue)", "Character Preference") as null|anything in GLOB.roundstart_tongues
if(selected_custom_tongue)
From 38313fa362f0b8050470f747d95d7a42dd8f8809 Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Mon, 26 Oct 2020 17:50:21 +0000
Subject: [PATCH 02/11] i hate dwarves
---
code/modules/client/preferences.dm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 58e91e82c0..89a4cdb650 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -2683,8 +2683,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
pref_species = new /datum/species/human
save_character()
- var/old_size = character.dna.features["body_size"]
-
character.dna.features = features.Copy()
character.set_species(chosen_species, icon_update = FALSE, pref_load = TRUE)
character.dna.species.eye_type = eye_type
@@ -2694,6 +2692,11 @@ GLOBAL_LIST_EMPTY(preferences_datums)
character.dna.nameless = character.nameless
character.dna.custom_species = character.custom_species
+ var/old_size = character.dna.features["body_size"]
+ if(isdwarf(character)
+ character.dna.features["body_size"] = 1
+ old_size = 1
+
if((parent && parent.can_have_part("meat_type")) || pref_species.mutant_bodyparts["meat_type"])
character.type_of_meat = GLOB.meat_types[features["meat_type"]]
From 2b00f2bb2f58fe8cca162b4948dc2ac752ee70fd Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Mon, 26 Oct 2020 20:27:02 +0000
Subject: [PATCH 03/11] config values
---
code/controllers/configuration/entries/game_options.dm | 4 ++--
code/datums/dna.dm | 5 +++--
code/modules/client/preferences.dm | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm
index fdf7ffd663..e79862c80c 100644
--- a/code/controllers/configuration/entries/game_options.dm
+++ b/code/controllers/configuration/entries/game_options.dm
@@ -519,10 +519,10 @@
min_val = RESIZE_DEFAULT_SIZE
integer = FALSE
-//Pun-Pun movement slowdown given to characters with a body size smaller than this value,
+//Penalties given to characters with a body size smaller than this value,
//to compensate for their smaller hitbox.
//To disable, just make sure the value is lower than 'body_size_min'
-/datum/config_entry/number/threshold_body_size_slowdown
+/datum/config_entry/number/threshold_body_size_penalty
config_entry_value = RESIZE_DEFAULT_SIZE * 0.85
min_val = 0
max_val = RESIZE_DEFAULT_SIZE
diff --git a/code/datums/dna.dm b/code/datums/dna.dm
index a6510d3336..45a9ec3bb3 100644
--- a/code/datums/dna.dm
+++ b/code/datums/dna.dm
@@ -699,10 +699,11 @@
//new size detected
holder.resize = features["body_size"] / old_size
holder.update_transform()
- if(features["body_size"] < 1 && old_size >= 1)
+ var/penalty_threshold = CONFIG_GET(number/threshold_body_size_penalty)
+ if(features["body_size"] < penalty_threshold && old_size >= penalty_threshold)
holder.maxhealth -= 10 //reduce the maxhealth
else
- if(old_size < 1 && features["body_size"] >= 1)
+ if(old_size < penalty_threshold && features["body_size"] >= penalty_threshold)
holder.maxhealth += 10 //give the maxhealth back
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 89a4cdb650..7c9708a249 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -2246,7 +2246,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if("body_size")
var/new_body_size = input(user, "Choose your desired sprite size: (90-125%)\nWarning: This may make your character look distorted. Additionally, any size under 100% takes a 10% maximum health penalty", "Character Preference", features["body_size"]*100) as num|null
if(new_body_size)
- body_size = clamp(new_body_size * 0.01, 90, 125)
+ body_size = clamp(new_body_size * 0.01, CONFIG_GET(number/body_size_min), CONFIG_GET(number/body_size_max))
if("tongue")
var/selected_custom_tongue = input(user, "Choose your desired tongue (none means your species tongue)", "Character Preference") as null|anything in GLOB.roundstart_tongues
From 4e6146898c5ae5110b459895962da13c05156692 Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Mon, 26 Oct 2020 20:27:58 +0000
Subject: [PATCH 04/11] fixes/config edits
---
code/controllers/configuration/entries/game_options.dm | 6 +++---
code/modules/client/preferences.dm | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm
index e79862c80c..4d2caf92a9 100644
--- a/code/controllers/configuration/entries/game_options.dm
+++ b/code/controllers/configuration/entries/game_options.dm
@@ -509,13 +509,13 @@
//Body size configs, the feature will be disabled if both min and max have the same value.
/datum/config_entry/number/body_size_min
- config_entry_value = RESIZE_DEFAULT_SIZE
+ config_entry_value = 0.9
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
- config_entry_value = RESIZE_DEFAULT_SIZE
+ config_entry_value = 1.25
min_val = RESIZE_DEFAULT_SIZE
integer = FALSE
@@ -523,7 +523,7 @@
//to compensate for their smaller hitbox.
//To disable, just make sure the value is lower than 'body_size_min'
/datum/config_entry/number/threshold_body_size_penalty
- config_entry_value = RESIZE_DEFAULT_SIZE * 0.85
+ config_entry_value = RESIZE_DEFAULT_SIZE
min_val = 0
max_val = RESIZE_DEFAULT_SIZE
integer = FALSE
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 7c9708a249..c2c4120925 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -2693,8 +2693,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
character.dna.custom_species = character.custom_species
var/old_size = character.dna.features["body_size"]
- if(isdwarf(character)
- character.dna.features["body_size"] = 1
+ if(isdwarf(character))
+ character.dna.features["body_size"] = RESIZE_DEFAULT_SIZE
old_size = 1
if((parent && parent.can_have_part("meat_type")) || pref_species.mutant_bodyparts["meat_type"])
From f468e4940a2cdcb322d2f5684fc3fe1caea31dfb Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Mon, 26 Oct 2020 20:33:46 +0000
Subject: [PATCH 05/11] typo
---
code/datums/dna.dm | 14 ++++++++------
code/modules/client/preferences.dm | 4 ++--
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/code/datums/dna.dm b/code/datums/dna.dm
index 45a9ec3bb3..3ca7f08fa7 100644
--- a/code/datums/dna.dm
+++ b/code/datums/dna.dm
@@ -699,11 +699,13 @@
//new size detected
holder.resize = features["body_size"] / old_size
holder.update_transform()
- var/penalty_threshold = CONFIG_GET(number/threshold_body_size_penalty)
- if(features["body_size"] < penalty_threshold && old_size >= penalty_threshold)
- holder.maxhealth -= 10 //reduce the maxhealth
- else
- if(old_size < penalty_threshold && features["body_size"] >= penalty_threshold)
- holder.maxhealth += 10 //give the maxhealth back
+ if(iscarbon(holder))
+ var/mob/living/carbon/C = holder
+ var/penalty_threshold = CONFIG_GET(number/threshold_body_size_penalty)
+ if(features["body_size"] < penalty_threshold && old_size >= penalty_threshold)
+ C.maxHealth -= 10 //reduce the maxhealth
+ else
+ if(old_size < penalty_threshold && features["body_size"] >= penalty_threshold)
+ C.maxHealth += 10 //give the maxhealth back
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index c2c4120925..4bd6122b5c 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -2246,7 +2246,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if("body_size")
var/new_body_size = input(user, "Choose your desired sprite size: (90-125%)\nWarning: This may make your character look distorted. Additionally, any size under 100% takes a 10% maximum health penalty", "Character Preference", features["body_size"]*100) as num|null
if(new_body_size)
- body_size = clamp(new_body_size * 0.01, CONFIG_GET(number/body_size_min), CONFIG_GET(number/body_size_max))
+ features["body_size"] = clamp(new_body_size * 0.01, CONFIG_GET(number/body_size_min), CONFIG_GET(number/body_size_max))
if("tongue")
var/selected_custom_tongue = input(user, "Choose your desired tongue (none means your species tongue)", "Character Preference") as null|anything in GLOB.roundstart_tongues
@@ -2695,7 +2695,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/old_size = character.dna.features["body_size"]
if(isdwarf(character))
character.dna.features["body_size"] = RESIZE_DEFAULT_SIZE
- old_size = 1
+ old_size = RESIZE_DEFAULT_SIZE
if((parent && parent.can_have_part("meat_type")) || pref_species.mutant_bodyparts["meat_type"])
character.type_of_meat = GLOB.meat_types[features["meat_type"]]
From 0fa83322a1c6b7526e7b95411dc0305a4f8db7d1 Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Mon, 26 Oct 2020 20:40:11 +0000
Subject: [PATCH 06/11] re-add slow stride but it defaults to disabled
---
code/controllers/configuration/entries/game_options.dm | 4 ++--
code/datums/dna.dm | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/code/controllers/configuration/entries/game_options.dm b/code/controllers/configuration/entries/game_options.dm
index 4d2caf92a9..67e4a97894 100644
--- a/code/controllers/configuration/entries/game_options.dm
+++ b/code/controllers/configuration/entries/game_options.dm
@@ -531,8 +531,8 @@
//multiplicative slowdown multiplier. See 'dna.update_body_size' for the operation.
//doesn't apply to floating or crawling mobs
/datum/config_entry/number/body_size_slowdown_multiplier
- config_entry_value = 0.25
- min_val = 0.1 //To encourage folks to disable the slowdown through the above config instead.
+ config_entry_value = 0
+ min_val = 0
integer = FALSE
//Allows players to set a hexadecimal color of their choice as skin tone, on top of the standard ones.
diff --git a/code/datums/dna.dm b/code/datums/dna.dm
index 3ca7f08fa7..4e9e21f70e 100644
--- a/code/datums/dna.dm
+++ b/code/datums/dna.dm
@@ -704,8 +704,11 @@
var/penalty_threshold = CONFIG_GET(number/threshold_body_size_penalty)
if(features["body_size"] < penalty_threshold && old_size >= penalty_threshold)
C.maxHealth -= 10 //reduce the maxhealth
+ var/slowdown = (1 - round(features["body_size"] / danger, 0.1)) * CONFIG_GET(number/body_size_slowdown_multiplier)
+ holder.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/small_stride, TRUE, slowdown)
else
if(old_size < penalty_threshold && features["body_size"] >= penalty_threshold)
C.maxHealth += 10 //give the maxhealth back
+ holder.remove_movespeed_modifier(/datum/movespeed_modifier/small_stride) //remove the slowdown
From 78e3eb14f9a598587180a9206524f492f5de3d32 Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Mon, 26 Oct 2020 20:42:22 +0000
Subject: [PATCH 07/11] another typo
---
code/datums/dna.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/datums/dna.dm b/code/datums/dna.dm
index 4e9e21f70e..53b24c45f9 100644
--- a/code/datums/dna.dm
+++ b/code/datums/dna.dm
@@ -704,7 +704,7 @@
var/penalty_threshold = CONFIG_GET(number/threshold_body_size_penalty)
if(features["body_size"] < penalty_threshold && old_size >= penalty_threshold)
C.maxHealth -= 10 //reduce the maxhealth
- var/slowdown = (1 - round(features["body_size"] / danger, 0.1)) * CONFIG_GET(number/body_size_slowdown_multiplier)
+ var/slowdown = (1 - round(features["body_size"] / penalty_threshold, 0.1)) * CONFIG_GET(number/body_size_slowdown_multiplier)
holder.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/small_stride, TRUE, slowdown)
else
if(old_size < penalty_threshold && features["body_size"] >= penalty_threshold)
From e22bf8cf3568ece86d5d0efbd008a4ce9fe468dc Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Mon, 26 Oct 2020 20:46:40 +0000
Subject: [PATCH 08/11] config
---
config/game_options.txt | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/config/game_options.txt b/config/game_options.txt
index bb6c5d8f01..bc5fdf940e 100644
--- a/config/game_options.txt
+++ b/config/game_options.txt
@@ -651,17 +651,17 @@ PENIS_MIN_INCHES_PREFS 1
PENIS_MAX_INCHES_PREFS 20
## Body size configs, the feature will be disabled if both min and max have the same value.
-BODY_SIZE_MIN 1
-BODY_SIZE_MAX 1
+BODY_SIZE_MIN 0.9
+BODY_SIZE_MAX 1.25
## Pun-Pun movement slowdown given to characters with a body size smaller than this value,
## to compensate for their smaller hitbox.
## To disable, just make sure the value is lower than 'body_size_min'
-THRESHOLD_BODY_SIZE_SLOWDOWN 0.85
+THRESHOLD_BODY_SIZE_PENALTY 1
## Multiplier used in the smaller strides slowdown calculation.
## Doesn't apply to floating or crawling mobs.
-BODY_SIZE_SLOWDOWN_MULTIPLIER 0.25
+BODY_SIZE_SLOWDOWN_MULTIPLIER 0
## Allows players to set a hexadecimal color of their choice as skin tone, on top of the standard ones.
ALLOW_CUSTOM_SKINTONES
From 79e81a455a336e9946f7e74fef056fe8aefcd74e Mon Sep 17 00:00:00 2001
From: timothyteakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Mon, 26 Oct 2020 23:52:20 +0000
Subject: [PATCH 09/11] old fix
---
code/modules/client/preferences.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 4bd6122b5c..7fae5a458c 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -2692,7 +2692,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
character.dna.nameless = character.nameless
character.dna.custom_species = character.custom_species
- var/old_size = character.dna.features["body_size"]
+ var/old_size = RESIZE_DEFAULT_SIZE
if(isdwarf(character))
character.dna.features["body_size"] = RESIZE_DEFAULT_SIZE
old_size = RESIZE_DEFAULT_SIZE
From 2275dde281972062b017c067415e1c5a90a655f7 Mon Sep 17 00:00:00 2001
From: timothyteakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Tue, 27 Oct 2020 00:15:58 +0000
Subject: [PATCH 10/11] prior fix didnt work this does
---
code/modules/client/preferences.dm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index 7fae5a458c..196c1ce0ed 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -2641,6 +2641,12 @@ GLOBAL_LIST_EMPTY(preferences_datums)
else if(firstspace == name_length)
real_name += "[pick(GLOB.last_names)]"
+ //reset size if applicable
+ if(character.dna.features["body_size"])
+ var/initial_old_size = character.dna.features["body_size"]
+ character.dna.features["body_size"] = RESIZE_DEFAULT_SIZE
+ character.dna.update_body_size(initial_old_size)
+
character.real_name = nameless ? "[real_name] #[rand(10000, 99999)]" : real_name
character.name = character.real_name
character.nameless = nameless
@@ -2695,7 +2701,6 @@ GLOBAL_LIST_EMPTY(preferences_datums)
var/old_size = RESIZE_DEFAULT_SIZE
if(isdwarf(character))
character.dna.features["body_size"] = RESIZE_DEFAULT_SIZE
- old_size = RESIZE_DEFAULT_SIZE
if((parent && parent.can_have_part("meat_type")) || pref_species.mutant_bodyparts["meat_type"])
character.type_of_meat = GLOB.meat_types[features["meat_type"]]
From f5804fd0e4ac2c56864a780c4a841e25c4723d19 Mon Sep 17 00:00:00 2001
From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com>
Date: Fri, 30 Oct 2020 20:41:13 +0000
Subject: [PATCH 11/11] yes
---
code/datums/dna.dm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/code/datums/dna.dm b/code/datums/dna.dm
index 53b24c45f9..fe041c41ff 100644
--- a/code/datums/dna.dm
+++ b/code/datums/dna.dm
@@ -5,7 +5,7 @@
var/uni_identity
var/blood_type
var/datum/species/species = new /datum/species/human //The type of mutant race the player is if applicable (i.e. potato-man)
- var/list/features = list("FFF") //first value is mutant color
+ var/list/features = list("FFF", "body_size" = RESIZE_DEFAULT_SIZE) //first value is mutant color
var/real_name //Stores the real name of the person who originally got this dna datum. Used primarely for changelings,
var/nameless = FALSE
var/custom_species //siiiiigh I guess this is important