Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oversized quirk #273

Merged
merged 7 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions code/__DEFINES/~doppler_defines/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@

/// The trait given to people with bad vibes.
#define TRAIT_BAD_VIBES "trait_bad_vibes"

/// The trait corresponding with the oversized quirk.
#define TRAIT_OVERSIZED "oversized"
carpotoxin marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_LEFT_EYE_SCAR" = TRAIT_LEFT_EYE_SCAR,
"TRAIT_RIGHT_EYE_SCAR" = TRAIT_RIGHT_EYE_SCAR,
"TRAIT_BAD_VIBES" = TRAIT_BAD_VIBES, // DOPPLER EDIT ADDITION
"TRAIT_OVERSIZED" = TRAIT_OVERSIZED, // DOPPLER EDIT ADDITION
),
/obj/item = list(
"TRAIT_APC_SHOCKING" = TRAIT_APC_SHOCKING,
Expand Down
27 changes: 27 additions & 0 deletions code/datums/components/riding/riding_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,37 @@

/datum/component/riding/creature/human/get_offsets(pass_index)
var/mob/living/carbon/human/H = parent
/* DOPPLER EDIT ADDITION BEGIN - Oversized
if(H.buckle_lying)
return list(TEXT_NORTH = list(0, 6), TEXT_SOUTH = list(0, 6), TEXT_EAST = list(0, 6), TEXT_WEST = list(0, 6))
else
return list(TEXT_NORTH = list(0, 6), TEXT_SOUTH = list(0, 6), TEXT_EAST = list(-6, 4), TEXT_WEST = list( 6, 4))
*/
if(H.buckle_lying)
return HAS_TRAIT(H, TRAIT_OVERSIZED) ? list(
TEXT_NORTH = list(0, 18),
TEXT_SOUTH = list(0, 18),
TEXT_EAST = list(0, 18),
TEXT_WEST = list(0, 18),
) : list(
TEXT_NORTH = list(0, 6),
TEXT_SOUTH = list(0, 6),
TEXT_EAST = list(0, 6),
TEXT_WEST = list(0, 6),
)

return HAS_TRAIT(H, TRAIT_OVERSIZED) ? list(
TEXT_NORTH = list(0, 18),
TEXT_SOUTH = list(0, 18),
TEXT_EAST = list(-12, 18),
TEXT_WEST = list(12, 18),
) : list(
TEXT_NORTH = list(0, 6),
TEXT_SOUTH = list(0, 6),
TEXT_EAST = list(-6, 4),
TEXT_WEST = list(6, 4)
)
// DOPPLER EDIT END

/datum/component/riding/creature/human/force_dismount(mob/living/dismounted_rider, throw_range = 8, throw_speed = 3, gentle = FALSE)
var/atom/movable/AM = parent
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/carbon/carbon_defense.dm
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,11 @@
to_chat(helper, span_notice("You shake [src] trying to pick [p_them()] up!"))
to_chat(src, span_notice("[helper] shakes you to get you up!"))
else if(check_zone(helper.zone_selected) == BODY_ZONE_HEAD && get_bodypart(BODY_ZONE_HEAD)) //Headpats!
// DOPPLER EDIT ADDITION BEGIN - Oversized
if(HAS_TRAIT(src, TRAIT_OVERSIZED) && !HAS_TRAIT(helper, TRAIT_OVERSIZED))
visible_message(span_warning("[helper] tries to pat [src] on the head, but can't reach!"))
return
// DOPPLER EDIT ADDITION END
helper.visible_message(span_notice("[helper] gives [src] a pat on the head to make [p_them()] feel better!"), \
null, span_hear("You hear a soft patter."), DEFAULT_MESSAGE_RANGE, list(helper, src))
to_chat(helper, span_notice("You give [src] a pat on the head to make [p_them()] feel better!"))
Expand Down
30 changes: 30 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,12 @@
carrydelay *= potential_spine.athletics_boost_multiplier
experience_reward += experience_reward * potential_spine.athletics_boost_multiplier

// DOPPLER EDIT ADDITION BEGIN - Oversized
if(HAS_TRAIT(target, TRAIT_OVERSIZED) && !HAS_TRAIT(src, TRAIT_OVERSIZED))
visible_message(span_warning("[src] tries to carry [target], but they are too heavy!"))
return
// DOPPLER EDIT ADDITION END

if(carrydelay <= 3 SECONDS)
skills_space = " very quickly"
else if(carrydelay <= 4 SECONDS)
Expand Down Expand Up @@ -982,6 +988,30 @@
target.visible_message(span_warning("[target] can't hang onto [src]!"))
return

// DOPPLER EDIT ADDITION BEGIN - Oversized
if(HAS_TRAIT(target, TRAIT_OVERSIZED) && !HAS_TRAIT(src, TRAIT_OVERSIZED))
target.visible_message(span_warning("[target] is too heavy for [src] to carry!"))
var/dam_zone = pick(BODY_ZONE_CHEST, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
var/obj/item/bodypart/affecting = get_bodypart(ran_zone(dam_zone))
var/wound_bon = 0
if(!affecting)
affecting = get_bodypart(BODY_ZONE_CHEST)
if(prob(50))
wound_bon = 100
to_chat(src, span_danger("You are crushed under the weight of [target]!"))
to_chat(target, span_danger("You accidentally crush [src]!"))
else
to_chat(src, span_danger("You hurt your [affecting.name] while trying to endure the weight of [target]!"))
apply_damage(25, BRUTE, affecting, wound_bonus=wound_bon)
playsound(src, 'sound/effects/splat.ogg', 50, TRUE)
AddElement(/datum/element/squish, 20 SECONDS)
Knockdown(3 SECONDS)
target.Knockdown(1)
if(get_turf(target) != get_turf(src))
target.throw_at(get_turf(src), 1, 1, spin=FALSE, quickstart=FALSE)
return
// DOPPLER EDIT ADDITION END

return buckle_mob(target, TRUE, TRUE, RIDER_NEEDS_ARMS)

/mob/living/carbon/human/buckle_mob(mob/living/target, force = FALSE, check_loc = TRUE, buckle_mob_flags= NONE)
Expand Down
22 changes: 22 additions & 0 deletions modular_doppler/modular_quirks/oversized/door.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/obj/machinery/door/airlock/Initialize(mapload)
. = ..()
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
)
AddElement(/datum/element/connect_loc, loc_connections)

/obj/machinery/door/airlock/proc/on_entered(datum/source, atom/movable/crossed_atom)
SIGNAL_HANDLER
if(!HAS_TRAIT(crossed_atom, TRAIT_OVERSIZED))
return
if(!ishuman(crossed_atom))
return
var/mob/living/carbon/human/crossing_human = crossed_atom
if(crossing_human.move_intent != MOVE_INTENT_WALK && crossing_human.body_position == STANDING_UP)
//We gonna bamf you, you tall fucker
var/affecting = crossing_human.get_bodypart(BODY_ZONE_HEAD)
crossing_human.apply_damage(15, BRUTE, affecting)
crossing_human.Knockdown(20)
crossing_human.visible_message(span_warning("[crossing_human] slams their head into the frame of [src] with a sickening thud!"), \
span_userdanger("You slam your head against [src]!"))
playsound(crossed_atom, 'sound/effects/bang.ogg', 50, TRUE)
113 changes: 113 additions & 0 deletions modular_doppler/modular_quirks/oversized/oversized.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#define OVERSIZED_SPEED_SLOWDOWN 0.5
#define OVERSIZED_HUNGER_MOD 1.5
#define OVERSIZED_HARM_DAMAGE_BONUS 5
#define OVERSIZED_KICK_EFFECTIVENESS_BONUS 5

/datum/quirk/oversized
name = "Oversized"
desc = "You have a far larger than average body, with all the benefits and consequences that result."
gain_text = span_notice("That airlock looks small...")
lose_text = span_notice("Was the ceiling always that high?")
medical_record_text = "Patient is abnormally tall."
value = 0
mob_trait = TRAIT_OVERSIZED
icon = FA_ICON_EXPAND_ARROWS_ALT
quirk_flags = QUIRK_HUMAN_ONLY|QUIRK_CHANGES_APPEARANCE
/// Saves refs to the original (normal size) organs, which are on ice in nullspace in case this quirk gets removed somehow.
var/list/obj/item/organ/old_organs

/datum/quirk/oversized/add(client/client_source)
var/mob/living/carbon/human/human_holder = quirk_holder
human_holder.mob_size = MOB_SIZE_LARGE

RegisterSignal(human_holder, COMSIG_CARBON_POST_ATTACH_LIMB, PROC_REF(on_gain_limb))

for(var/obj/item/bodypart/bodypart as anything in human_holder.bodyparts)
on_gain_limb(src, bodypart, special = FALSE)

human_holder.physiology.hunger_mod *= OVERSIZED_HUNGER_MOD //50% hungrier
human_holder.add_movespeed_modifier(/datum/movespeed_modifier/oversized)

var/translate = 16
human_holder.transform = human_holder.transform.Scale(2)
var/translate_x = translate * ( human_holder.transform.b / 2)
var/translate_y = translate * ( human_holder.transform.e / 2)
human_holder.transform = human_holder.transform.Translate(translate_x, translate_y)
human_holder.maptext_height = 64

human_holder.AddComponent(/datum/component/seethrough_mob)

/datum/quirk/oversized/remove()
var/mob/living/carbon/human/human_holder = quirk_holder
human_holder.mob_size = MOB_SIZE_HUMAN

var/translate = -16
human_holder.transform = human_holder.transform.Scale(0.5)
var/translate_x = translate * ( human_holder.transform.b / 2)
var/translate_y = translate * ( human_holder.transform.e / 2)
human_holder.transform = human_holder.transform.Translate(translate_x, translate_y)
human_holder.maptext_height = 32

var/obj/item/bodypart/arm/left/left_arm = human_holder.get_bodypart(BODY_ZONE_L_ARM)
if(left_arm)
left_arm.unarmed_damage_high = initial(left_arm.unarmed_damage_high)

var/obj/item/bodypart/arm/right/right_arm = human_holder.get_bodypart(BODY_ZONE_R_ARM)
if(right_arm)
right_arm.unarmed_damage_high = initial(right_arm.unarmed_damage_high)

var/obj/item/bodypart/leg/left_leg = human_holder.get_bodypart(BODY_ZONE_L_LEG)
if (left_leg)
left_leg.unarmed_effectiveness = initial(left_leg.unarmed_effectiveness)

var/obj/item/bodypart/leg/right_leg = human_holder.get_bodypart(BODY_ZONE_R_LEG)
if (right_leg)
right_leg.unarmed_effectiveness = initial(right_leg.unarmed_effectiveness)

for(var/obj/item/bodypart/bodypart as anything in human_holder.bodyparts)
bodypart.name = replacetext(bodypart.name, "oversized ", "")

UnregisterSignal(human_holder, COMSIG_CARBON_POST_ATTACH_LIMB)

human_holder.physiology.hunger_mod /= OVERSIZED_HUNGER_MOD
human_holder.remove_movespeed_modifier(/datum/movespeed_modifier/oversized)

for(var/obj/item/organ/organ_to_restore in old_organs)
old_organs -= organ_to_restore

if(QDELETED(organ_to_restore))
continue

var/obj/item/organ/brain/possibly_a_brain = organ_to_restore
if(istype(possibly_a_brain))
var/obj/item/organ/brain/current_brain = human_holder.get_organ_slot(ORGAN_SLOT_BRAIN)
possibly_a_brain.brainmob = current_brain.brainmob

organ_to_restore.replace_into(quirk_holder)

var/datum/component/seethrough_mob/component = human_holder.GetComponent(/datum/component/seethrough_mob)
qdel(component)

/datum/quirk/oversized/proc/on_gain_limb(datum/source, obj/item/bodypart/gained, special)
SIGNAL_HANDLER

if(findtext(gained.name, "oversized"))
return

if(istype(gained, /obj/item/bodypart/arm))
var/obj/item/bodypart/arm/new_arm = gained
new_arm.unarmed_damage_high = initial(new_arm.unarmed_damage_high) + OVERSIZED_HARM_DAMAGE_BONUS

else if(istype(gained, /obj/item/bodypart/leg))
var/obj/item/bodypart/leg/new_leg = gained
new_leg.unarmed_effectiveness = initial(new_leg.unarmed_effectiveness) + OVERSIZED_KICK_EFFECTIVENESS_BONUS

gained.name = "oversized " + gained.name

/datum/movespeed_modifier/oversized
multiplicative_slowdown = OVERSIZED_SPEED_SLOWDOWN

#undef OVERSIZED_HUNGER_MOD
#undef OVERSIZED_SPEED_SLOWDOWN
#undef OVERSIZED_HARM_DAMAGE_BONUS
#undef OVERSIZED_KICK_EFFECTIVENESS_BONUS
2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -7120,6 +7120,8 @@
#include "modular_doppler\modular_quirks\linguist\linguist.dm"
#include "modular_doppler\modular_quirks\narcolepsy\narcolepsy.dm"
#include "modular_doppler\modular_quirks\night_vision\night_vision.dm"
#include "modular_doppler\modular_quirks\oversized\door.dm"
#include "modular_doppler\modular_quirks\oversized\oversized.dm"
#include "modular_doppler\modular_quirks\overwrites\equipping.dm"
#include "modular_doppler\modular_quirks\overwrites\musician.dm"
#include "modular_doppler\modular_quirks\paycheck_rations\code\quirk.dm"
Expand Down
Loading