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

Roundstart Injuries #19923

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions code/__HELPERS/global_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ GLOBAL_LIST_EMPTY(contained_clothing_species_adaption_cache)
//Disability datums
paths = subtypesof(/datum/character_disabilities)
for(var/path in paths)
if(is_abstract(path))
continue
var/datum/character_disabilities/T = new path()
GLOB.chargen_disabilities_list[T.name] = T

Expand Down
84 changes: 84 additions & 0 deletions code/modules/mob/abstract/new_player/character_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,87 @@
name = "Major Hemophilia"
desc = "Your blood lacks ALL clotting factors, causing wounds to never stop bleeding."
trait_type = TRAIT_DISABILITY_HEMOPHILIA_MAJOR


ABSTRACT_TYPE(/datum/character_disabilities/bruising)
name = "Bruised Limb"
var/affected_limb

/datum/character_disabilities/bruising/apply_self(var/mob/living/carbon/human/target)
target.apply_damage(10, DAMAGE_BRUTE, affected_limb, armor_pen = 100, silent = TRUE)

#define BRUISING_DISABILITY(LIMB_PATH, LIMB_NAME, LIMB_TAG) \
/datum/character_disabilities/bruising/##LIMB_PATH { \
name = "Bruised Limb: " + ##LIMB_NAME; \
affected_limb = ##LIMB_TAG; \
}

BRUISING_DISABILITY(head, "Head", BP_HEAD)
BRUISING_DISABILITY(torso, "Torso", BP_CHEST)
BRUISING_DISABILITY(groin, "Groin", BP_GROIN)
BRUISING_DISABILITY(left_arm, "Left Arm", BP_L_ARM)
BRUISING_DISABILITY(right_arm, "Right Arm", BP_R_ARM)
BRUISING_DISABILITY(left_hand, "Left Hand", BP_L_HAND)
BRUISING_DISABILITY(right_hand, "Right Hand", BP_R_HAND)
BRUISING_DISABILITY(left_leg, "Left Leg", BP_L_LEG)
BRUISING_DISABILITY(right_leg, "Right Leg", BP_R_LEG)
BRUISING_DISABILITY(left_foot, "Left Foot", BP_L_FOOT)
BRUISING_DISABILITY(right_foot, "Right Foot", BP_R_FOOT)

#undef BRUISING_DISABILITY


ABSTRACT_TYPE(/datum/character_disabilities/burn)
name = "Bruised Limb"
var/affected_limb

/datum/character_disabilities/burn/apply_self(var/mob/living/carbon/human/target)
target.apply_damage(10, DAMAGE_BURN, affected_limb, armor_pen = 100, silent = TRUE)

#define BURN_DISABILITY(LIMB_PATH, LIMB_NAME, LIMB_TAG) \
/datum/character_disabilities/burn/##LIMB_PATH { \
name = "Burned Limb: " + ##LIMB_NAME; \
affected_limb = ##LIMB_TAG; \
}

BURN_DISABILITY(head, "Head", BP_HEAD)
BURN_DISABILITY(torso, "Torso", BP_CHEST)
BURN_DISABILITY(groin, "Groin", BP_GROIN)
BURN_DISABILITY(left_arm, "Left Arm", BP_L_ARM)
BURN_DISABILITY(right_arm, "Right Arm", BP_R_ARM)
BURN_DISABILITY(left_hand, "Left Hand", BP_L_HAND)
BURN_DISABILITY(right_hand, "Right Hand", BP_R_HAND)
BURN_DISABILITY(left_leg, "Left Leg", BP_L_LEG)
BURN_DISABILITY(right_leg, "Right Leg", BP_R_LEG)
BURN_DISABILITY(left_foot, "Left Foot", BP_L_FOOT)
BURN_DISABILITY(right_foot, "Right Foot", BP_R_FOOT)

#undef BURN_DISABILITY


ABSTRACT_TYPE(/datum/character_disabilities/broken)
name = "Bruised Limb"
var/affected_limb

/datum/character_disabilities/broken/apply_self(var/mob/living/carbon/human/target)
var/obj/item/organ/external/affecting = target.get_organ(affected_limb)
if(affecting)
affecting.fracture(silent = TRUE)
affecting.status |= ORGAN_SPLINTED

#define BROKEN_DISABILITY(LIMB_PATH, LIMB_NAME, LIMB_TAG) \
/datum/character_disabilities/broken/##LIMB_PATH { \
name = "Broken Limb: " + ##LIMB_NAME; \
affected_limb = ##LIMB_TAG; \
}

BROKEN_DISABILITY(left_arm, "Left Arm", BP_L_ARM)
BROKEN_DISABILITY(right_arm, "Right Arm", BP_R_ARM)
BROKEN_DISABILITY(left_hand, "Left Hand", BP_L_HAND)
BROKEN_DISABILITY(right_hand, "Right Hand", BP_R_HAND)
BROKEN_DISABILITY(left_leg, "Left Leg", BP_L_LEG)
BROKEN_DISABILITY(right_leg, "Right Leg", BP_R_LEG)
BROKEN_DISABILITY(left_foot, "Left Foot", BP_L_FOOT)
BROKEN_DISABILITY(right_foot, "Right Foot", BP_R_FOOT)

#undef BROKEN_DISABILITY
21 changes: 11 additions & 10 deletions code/modules/organs/organ_external.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1170,24 +1170,25 @@ Note that amputating the affected organ does in fact remove the infection from t
W.clamped = 1
return rval

/obj/item/organ/external/proc/fracture()
/obj/item/organ/external/proc/fracture(var/silent = FALSE)
if(status & ORGAN_ROBOT)
return //ORGAN_BROKEN doesn't have the same meaning for robot limbs
if((status & ORGAN_BROKEN) || !(limb_flags & ORGAN_CAN_BREAK))
return
if(QDELETED(owner))
return

var/message = pick("broke in half", "shattered")
owner.visible_message(\
SPAN_WARNING("<font size=2>You hear a loud cracking sound coming from \the [owner]!</font>"),\
SPAN_DANGER("<font size=3>Something feels like it [message] in your [name]!</font>"),\
"You hear a sickening crack!")
if(owner.species && owner.can_feel_pain())
owner.emote("scream")
owner.flash_strong_pain()
if(!silent)
var/message = pick("broke in half", "shattered")
owner.visible_message(\
SPAN_WARNING("<font size=2>You hear a loud cracking sound coming from \the [owner]!</font>"),\
SPAN_DANGER("<font size=3>Something feels like it [message] in your [name]!</font>"),\
"You hear a sickening crack!")
if(owner.species && owner.can_feel_pain())
owner.emote("scream")
owner.flash_strong_pain()
playsound(src.loc, /singleton/sound_category/fracture_sound, 100, 1, -2)

playsound(src.loc, /singleton/sound_category/fracture_sound, 100, 1, -2)
status |= ORGAN_BROKEN
broken_description = pick("broken", "fracture", "hairline fracture")
perma_injury = brute_dam
Expand Down
6 changes: 6 additions & 0 deletions html/changelogs/geeves-injury_gaming.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
author: Geeves

delete-after: True

changes:
- rscadd: "You can now spawn with injuries, such as bruising, burns, and broken limbs. Select these via the disabilities menu."
Loading