forked from Bubberstation/Bubberstation
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from SPLURT-Station/sizecode
[Bounty] Ports sizecode from my codebase
- Loading branch information
Showing
38 changed files
with
1,111 additions
and
16 deletions.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* # COMSIG_MICRO_PICKUP_FEET | ||
* From /datum/element/mob_holder/micro | ||
* Used by signals for determining whether you can pick up someone with your feet, kinky. | ||
*/ | ||
#define COMSIG_MICRO_PICKUP_FEET "micro_force_grabbed" | ||
|
||
/* | ||
* # COMSIG_MOB_RESIZED | ||
* From /mob/living | ||
* Used by signals for whenever a mob has changed sizes. | ||
*/ | ||
#define COMSIG_MOB_RESIZED "mob_resized" |
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,46 @@ | ||
//I am not a coder. Please fucking tear apart my code, and insult me for how awful I am at coding. Please and thank you. -Dahlular | ||
//alright bet -BoxBoy | ||
#define RESIZE_MACRO 6 | ||
#define RESIZE_HUGE 4 | ||
#define RESIZE_BIG 2 | ||
#define RESIZE_NORMAL 1 | ||
#define RESIZE_SMALL 0.75 | ||
#define RESIZE_TINY 0.50 | ||
#define RESIZE_MICRO 0.25 | ||
|
||
//averages | ||
#define RESIZE_A_MACROHUGE (RESIZE_MACRO + RESIZE_HUGE) / 2 | ||
#define RESIZE_A_HUGEBIG (RESIZE_HUGE + RESIZE_BIG) / 2 | ||
#define RESIZE_A_BIGNORMAL (RESIZE_BIG + RESIZE_NORMAL) / 2 | ||
#define RESIZE_A_NORMALSMALL (RESIZE_NORMAL + RESIZE_SMALL) / 2 | ||
#define RESIZE_A_SMALLTINY (RESIZE_SMALL + RESIZE_TINY) / 2 | ||
#define RESIZE_A_TINYMICRO (RESIZE_TINY + RESIZE_MICRO) / 2 | ||
|
||
/* | ||
* # get_size(mob/living/target) | ||
* Grabs the size of your critter, works for any living creature even carbons with dna | ||
* Now, please don't tell me your creature has a dna but it's very snowflakey, then i say you should rewrite your mob | ||
* instead of touching this file. | ||
*/ | ||
/proc/get_size(mob/living/target) | ||
if(!target) | ||
CRASH("get_size(NULL) was called") | ||
if(!istype(target)) | ||
CRASH("get_size() called with an invalid target, only use this for /mob/living!") | ||
var/datum/dna/has_dna = target.has_dna() | ||
if(ishuman(target) && has_dna) | ||
return has_dna.features["body_size"] | ||
else | ||
return target.size_multiplier | ||
|
||
/* | ||
* # COMPARE_SIZES(mob/living/user, mob/living/target) | ||
* Returns how bigger or smaller the target is in comparison to user | ||
* Example: | ||
* - user = 2, target = 1, result = 0.5 | ||
* - user = 1, target = 2, result = 2 | ||
* Args: | ||
* - user = /mob/living | ||
* - target = /mob/living | ||
*/ | ||
#define COMPARE_SIZES(user, target) abs((get_size(user) / get_size(target))) |
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
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
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
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,11 @@ | ||
## 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 | ||
|
||
## Macro health size cap ## | ||
## Macros no longer get more health after their size reaches this value ## | ||
#MACRO_HEALTH_CAP 3.5 |
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
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
20 changes: 20 additions & 0 deletions
20
modular_zzplurt/code/controllers/configuration/entries/fetish_content.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,20 @@ | ||
//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 | ||
integer = FALSE | ||
|
||
/datum/config_entry/number/macro_health_cap | ||
default = 3.5 //21 ft | ||
integer = FALSE |
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,64 @@ | ||
/datum/dna | ||
var/last_capped_size //For some reason this feels dirty... I suppose it should go somewhere else | ||
|
||
/datum/dna/transfer_identity(mob/living/carbon/destination, transfer_SE, transfer_species) | ||
var/old_size = destination.dna.features["body_size"] | ||
. = ..() | ||
destination.update_size(get_size(destination), old_size) | ||
|
||
/mob/living/carbon/human/hardset_dna(unique_identity, list/mutation_index, list/default_mutation_genes, newreal_name, newblood_type, datum/species/mrace, newfeatures, list/mutations, force_transfer_mutations) | ||
var/old_size = dna.features["body_size"] | ||
. = ..() | ||
update_size(get_size(src), old_size) | ||
|
||
/datum/dna/copy_dna(datum/dna/new_dna) | ||
. = ..() | ||
if(holder) | ||
holder.adjust_mobsize(get_size(holder)) | ||
|
||
/datum/dna/update_body_size() | ||
if(!holder || species.body_size_restricted || current_body_size == features["body_size"]) | ||
return ..() | ||
|
||
holder.remove_movespeed_modifier(/datum/movespeed_modifier/small_stride) | ||
|
||
. = ..() | ||
|
||
if(get_size(holder) >= (RESIZE_A_BIGNORMAL + RESIZE_NORMAL) / 2) | ||
holder.small_sprite.Grant(holder) | ||
else | ||
holder.small_sprite.Remove(holder) | ||
|
||
if(!iscarbon(holder)) | ||
return | ||
|
||
/* Needs genital updates | ||
var/mob/living/carbon/C = holder | ||
for(var/obj/item/organ/genital/G in C.internal_organs) | ||
if(istype(G)) | ||
G.update() | ||
*/ | ||
|
||
var/new_slowdown = (abs(get_size(holder) - 1) * CONFIG_GET(number/body_size_slowdown_multiplier)) | ||
holder.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/small_stride, TRUE, new_slowdown) | ||
|
||
var/size_cap = CONFIG_GET(number/macro_health_cap) | ||
if((size_cap > 0) && (get_size(holder) > size_cap)) | ||
last_capped_size = (last_capped_size ? last_capped_size : current_body_size) | ||
return | ||
if(last_capped_size) | ||
current_body_size = last_capped_size | ||
last_capped_size = null | ||
var/healthmod_old = ((current_body_size * 75) - 75) | ||
var/healthmod_new = ((get_size(holder) * 75) - 75) | ||
var/healthchange = healthmod_new - healthmod_old | ||
holder.maxHealth += healthchange | ||
holder.health += healthchange | ||
|
||
/mob/living/carbon/set_species(datum/species/mrace, icon_update, pref_load, list/override_features, list/override_mutantparts, list/override_markings) | ||
. = ..() | ||
adjust_mobsize(get_size(src)) | ||
|
||
/datum/preference/choiced/species/apply_to_human(mob/living/carbon/human/target, value, datum/preferences/prefs) | ||
. = ..() | ||
target.adjust_mobsize(get_size(target)) |
Oops, something went wrong.