Skip to content

Commit

Permalink
hamburger
Browse files Browse the repository at this point in the history
  • Loading branch information
SandPoot committed Sep 5, 2024
1 parent ad7ac71 commit d44df1b
Show file tree
Hide file tree
Showing 20 changed files with 875 additions and 40 deletions.
13 changes: 13 additions & 0 deletions code/__DEFINES/~~~splurt_defines/dcs/signals.dm
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"
46 changes: 46 additions & 0 deletions code/__DEFINES/~~~splurt_defines/sizecode.dm
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)))
7 changes: 6 additions & 1 deletion code/datums/dna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
/datum/dna/proc/transfer_identity(mob/living/carbon/destination, transfer_SE = FALSE, transfer_species = TRUE)
if(!istype(destination))
return
var/old_size = destination.dna.features["body_size"]
destination.dna.unique_enzymes = unique_enzymes
destination.dna.unique_identity = unique_identity
destination.dna.blood_type = blood_type
Expand All @@ -145,7 +146,7 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
//SKYRAT EDIT ADDITION BEGIN - CUSTOMIZATION
destination.dna.mutant_bodyparts = mutant_bodyparts.Copy()
destination.dna.body_markings = body_markings.Copy()
destination.dna.update_body_size()
destination.update_size(get_size(destination), old_size)
//SKYRAT EDIT ADDITION END
if(transfer_SE)
destination.dna.mutation_index = mutation_index
Expand Down Expand Up @@ -647,6 +648,10 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
dna.features = newfeatures
dna.generate_unique_features()

var/old_size = dna.features["body_size"]
dna.features = newfeatures
update_size(get_size(src), old_size)

if(mrace)
var/datum/species/newrace = new mrace.type
newrace.copy_properties_from(mrace)
Expand Down
79 changes: 79 additions & 0 deletions code/datums/elements/mob_holder.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/datum/element/mob_holder
element_flags = ELEMENT_BESPOKE | ELEMENT_DETACH_ON_HOST_DESTROY
argument_hash_start_idx = 2
var/worn_state
var/alt_worn
var/right_hand
var/left_hand
var/inv_slots
var/proctype //if present, will be invoked on headwear generation.

/datum/element/mob_holder/Attach(datum/target, worn_state, alt_worn, right_hand, left_hand, inv_slots = NONE, proctype)
. = ..()

if(!isliving(target))
return ELEMENT_INCOMPATIBLE

src.worn_state = worn_state
src.alt_worn = alt_worn
src.right_hand = right_hand
src.left_hand = left_hand
src.inv_slots = inv_slots
src.proctype = proctype

RegisterSignal(target, COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, PROC_REF(on_requesting_context_from_item))
RegisterSignal(target, COMSIG_CLICK_ALT, PROC_REF(mob_try_pickup))
RegisterSignal(target, COMSIG_ATOM_EXAMINE, PROC_REF(on_examine))

/datum/element/mob_holder/Detach(datum/source, force)
. = ..()
UnregisterSignal(source, list(COMSIG_ATOM_REQUESTING_CONTEXT_FROM_ITEM, COMSIG_CLICK_ALT, COMSIG_ATOM_EXAMINE))

/datum/element/mob_holder/proc/on_examine(mob/living/source, mob/user, list/examine_list)
if(ishuman(user) && !istype(source.loc, /obj/item/clothing/head/mob_holder))
examine_list += span_notice("Looks like [source.p_they(FALSE)] can be picked up with <b>Alt+Click</b>!")

/datum/element/mob_holder/proc/on_requesting_context_from_item(
obj/source,
list/context,
obj/item/held_item,
mob/living/user,
)
SIGNAL_HANDLER

if(ishuman(user))
LAZYSET(context, SCREENTIP_CONTEXT_ALT_LMB, "Pick up")
return CONTEXTUAL_SCREENTIP_SET

/datum/element/mob_holder/proc/mob_try_pickup(mob/living/source, mob/user)
if(!ishuman(user) || !user.Adjacent(source) || user.incapacitated())
return FALSE
if(user.get_active_held_item())
to_chat(user, span_warning("Your hands are full!"))
return FALSE
if(source.buckled)
to_chat(user, span_warning("[source] is buckled to something!"))
return FALSE
if(source == user)
to_chat(user, span_warning("You can't pick yourself up."))
return FALSE
source.visible_message(span_warning("[user] starts picking up [source]."), \
span_userdanger("[user] starts picking you up!"))
if(!do_after(user, 2 SECONDS, target = source) || source.buckled)
return FALSE

source.visible_message(span_warning("[user] picks up [source]!"), \
span_userdanger("[user] picks you up!"))
to_chat(user, span_notice("You pick [source] up."))
source.drop_all_held_items()
var/obj/item/clothing/head/mob_holder/holder = new(get_turf(source), source, worn_state, alt_worn, right_hand, left_hand, inv_slots)

if(proctype)
INVOKE_ASYNC(src, proctype, source, holder, user)
user.put_in_hands(holder)
return TRUE

/datum/element/mob_holder/proc/drone_worn_icon(mob/living/basic/drone/D, obj/item/clothing/head/mob_holder/holder, mob/user)
var/new_state = "[D.visualAppearance]_hat"
holder.inhand_icon_state = new_state
holder.icon_state = new_state
3 changes: 2 additions & 1 deletion code/datums/mutations/body.dm
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@
return
// SKYRAT EDIT END
ADD_TRAIT(owner, TRAIT_GIANT, GENETIC_MUTATION)
owner.update_transform(1.25)
owner.update_size(1.25)
owner.visible_message(span_danger("[owner] suddenly grows!"), span_notice("Everything around you seems to shrink.."))

/datum/mutation/human/gigantism/on_losing(mob/living/carbon/human/owner)
Expand All @@ -212,6 +212,7 @@
REMOVE_TRAIT(owner, TRAIT_GIANT, GENETIC_MUTATION)
return
// SKYRAT EDIT END
owner.update_size(0.75)

//Clumsiness has a very large amount of small drawbacks depending on item.
/datum/mutation/human/clumsy
Expand Down
4 changes: 3 additions & 1 deletion code/modules/clothing/clothing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
// such that you never actually cared about checking if something is *edible*.
var/obj/item/food/clothing/moth_snack

var/ignore_abstract = FALSE

/obj/item/clothing/Initialize(mapload)
if(clothing_flags & VOICEBOX_TOGGLABLE)
actions_types += list(/datum/action/item_action/toggle_voice_box)
Expand All @@ -60,7 +62,7 @@
if(can_be_bloody && ((body_parts_covered & FEET) || (flags_inv & HIDESHOES)))
LoadComponent(/datum/component/bloodysoles)
AddElement(/datum/element/attack_equip)
if(!icon_state)
if(!icon_state && !ignore_abstract)
item_flags |= ABSTRACT

/obj/item/clothing/mouse_drop_dragged(atom/over_object, mob/user, src_location, over_location, params)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
animal.health = min(animal.maxHealth, animal.health * 1.5)
animal.melee_damage_lower = max((animal.melee_damage_lower * 2), 10)
animal.melee_damage_upper = max((animal.melee_damage_upper * 2), 10)
animal.update_transform(2)
animal.update_size(2)
animal.AddElement(/datum/element/wall_tearer)
to_chat(user, span_info("You increase the size of [animal], giving [animal.p_them()] a surge of strength!"))
qdel(src)
Expand Down
10 changes: 10 additions & 0 deletions code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@
if (length(status_examines))
. += status_examines

//Approximate character height based on current sprite scale
var/dispSize = round(12*get_size(src)) // gets the character's sprite size percent and converts it to the nearest half foot
if(dispSize % 2) // returns 1 or 0. 1 meaning the height is not exact and the code below will execute, 0 meaning the height is exact and the else will trigger.
dispSize = dispSize - 1 //makes it even
dispSize = dispSize / 2 //rounds it out
. += "[t_He] appear\s to be around [dispSize] and a half feet tall."
else
dispSize = dispSize / 2
. += "[t_He] appear\s to be around [dispSize] feet tall."

var/appears_dead = FALSE
var/just_sleeping = FALSE

Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,12 @@
//called when something steps onto a human
/mob/living/carbon/human/proc/on_entered(datum/source, atom/movable/AM)
SIGNAL_HANDLER

//Hyper Change - Step on people
var/mob/living/carbon/human/H = AM
if(istype(H) && resting && resolve_intent_name(H.combat_mode) != "help")
H.handle_micro_bump_other(src)

spreadFire(AM)

/mob/living/carbon/human/proc/canUseHUD()
Expand Down
16 changes: 12 additions & 4 deletions code/modules/mob/living/living.dm
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@
if(moving_diagonally)//no mob swap during diagonal moves.
return TRUE

//handle micro bumping on help intent
if(resolve_intent_name(combat_mode) == "help")
if(handle_micro_bump_helping(M))
return TRUE

if(!M.buckled && !M.has_buckled_mobs())
if(can_mobswap_with(M))
//switch our position with M
Expand Down Expand Up @@ -254,6 +259,8 @@
//not if he's not CANPUSH of course
if(!(M.status_flags & CANPUSH))
return TRUE
if(handle_micro_bump_other(M))
return TRUE
if(isliving(M))
var/mob/living/L = M
if(HAS_TRAIT(L, TRAIT_PUSHIMMUNE))
Expand Down Expand Up @@ -2045,10 +2052,11 @@ GLOBAL_LIST_EMPTY(fire_appearances)
set_body_position(var_value)
. = TRUE
if(NAMEOF(src, current_size))
if(var_value == 0) //prevents divisions of and by zero.
return FALSE
update_transform(var_value/current_size)
. = TRUE
update_size(var_value)
return TRUE
if(NAMEOF(src, size_multiplier))
update_size(var_value)
return TRUE

if(!isnull(.))
datum_flags |= DF_VAR_EDITED
Expand Down
2 changes: 1 addition & 1 deletion modular_zubbers/code/datums/components/vore/_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/// If true, prevents mobs in crit or death from engaging in vore
#define NO_DEAD TRUE
/// If true, mobs with no player cannot be pred or prey
#define REQUIRES_PLAYER TRUE
#define REQUIRES_PLAYER FALSE
/// Makes every mob spawn with a vore component, just for testing
// #define VORE_TESTING_ALL_MOBS_ARE_VORE_MOBS
/// Number of rolling backups bellies will keep
Expand Down
Loading

0 comments on commit d44df1b

Please sign in to comment.