From 37220c18fbf2f06b0587fcd1ac4c36f48fd3daa6 Mon Sep 17 00:00:00 2001 From: Time-Green Date: Sat, 28 Jan 2023 20:54:11 +0100 Subject: [PATCH] Hardcore random gets a sixpack (#72992) Have you ever really thought about how incredible ripped paraplegics must be? Moving is much more difficult and they're always using their arms ![image](https://user-images.githubusercontent.com/7501474/215131388-14075809-fa38-4986-a0b0-9b2e76fbfece.png) :cl: qol: Hardcore random gets a sixpack /:cl: ### Why is this good for the game? Everyone currently doing hardcore random gets a sixpack, it's a very obscure visual distinction that I think is fun to just mess with people with. "Why is the anemic quadruple amputee with brain cancer ripped to shreds?" This is also all just an elaborate scheme to display how the new bodypart_overlay system can be used with absolutely minimal effort --- code/__DEFINES/mobs.dm | 14 +++++++------- code/datums/bodypart_overlays/bodypart_overlay.dm | 12 ++++++------ .../bodypart_overlays/mutant_bodypart_overlay.dm | 2 +- .../bodypart_overlays/simple_bodypart_overlay.dm | 12 +++++++++++- .../mob/dead/new_player/preferences_setup.dm | 3 +++ .../mob/species/misc/bodypart_overlay_simple.dmi | Bin 0 -> 407 bytes 6 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 icons/mob/species/misc/bodypart_overlay_simple.dmi diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index ab55378a4f0..15b607c1b46 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -737,13 +737,13 @@ GLOBAL_LIST_INIT(layers_to_offset, list( // WOUND_LAYER (full body) )) -//Bitflags for the layers an external organ can draw on (organs can be drawn on multiple layers) -/// Draws organ on the BODY_FRONT_LAYER -#define EXTERNAL_FRONT (1 << 1) -/// Draws organ on the BODY_ADJ_LAYER -#define EXTERNAL_ADJACENT (1 << 2) -/// Draws organ on the BODY_BEHIND_LAYER -#define EXTERNAL_BEHIND (1 << 3) +//Bitflags for the layers a bodypart overlay can draw on (can be drawn on multiple layers) +/// Draws overlay on the BODY_FRONT_LAYER +#define EXTERNAL_FRONT (1 << 0) +/// Draws overlay on the BODY_ADJ_LAYER +#define EXTERNAL_ADJACENT (1 << 1) +/// Draws overlay on the BODY_BEHIND_LAYER +#define EXTERNAL_BEHIND (1 << 2) /// Draws organ on all EXTERNAL layers #define ALL_EXTERNAL_OVERLAYS EXTERNAL_FRONT | EXTERNAL_ADJACENT | EXTERNAL_BEHIND diff --git a/code/datums/bodypart_overlays/bodypart_overlay.dm b/code/datums/bodypart_overlays/bodypart_overlay.dm index 72b1531756e..9a8c98b5c15 100644 --- a/code/datums/bodypart_overlays/bodypart_overlay.dm +++ b/code/datums/bodypart_overlays/bodypart_overlay.dm @@ -40,22 +40,22 @@ */ /datum/bodypart_overlay/proc/mutant_bodyparts_layertext(layer) switch(layer) - if(BODY_BEHIND_LAYER) + if(-BODY_BEHIND_LAYER) return "BEHIND" - if(BODY_ADJ_LAYER) + if(-BODY_ADJ_LAYER) return "ADJ" - if(BODY_FRONT_LAYER) + if(-BODY_FRONT_LAYER) return "FRONT" ///Converts a bitflag to the right layer. I'd love to make this a static index list, but byond made an attempt on my life when i did /datum/bodypart_overlay/proc/bitflag_to_layer(layer) switch(layer) if(EXTERNAL_BEHIND) - return BODY_BEHIND_LAYER + return -BODY_BEHIND_LAYER if(EXTERNAL_ADJACENT) - return BODY_ADJ_LAYER + return -BODY_ADJ_LAYER if(EXTERNAL_FRONT) - return BODY_FRONT_LAYER + return -BODY_FRONT_LAYER ///Check whether we can draw the overlays. You generally don't want lizard snouts to draw over an EVA suit /datum/bodypart_overlay/proc/can_draw_on_bodypart(mob/living/carbon/human/human) diff --git a/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm b/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm index cb0cd8e14d6..0ed2a344104 100644 --- a/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm +++ b/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm @@ -52,7 +52,7 @@ var/finished_icon_state = icon_state_builder.Join("_") - var/mutable_appearance/appearance = mutable_appearance(sprite_datum.icon, finished_icon_state, layer = -image_layer) + var/mutable_appearance/appearance = mutable_appearance(sprite_datum.icon, finished_icon_state, layer = image_layer) if(sprite_datum.center) center_image(appearance, sprite_datum.dimension_x, sprite_datum.dimension_y) diff --git a/code/datums/bodypart_overlays/simple_bodypart_overlay.dm b/code/datums/bodypart_overlays/simple_bodypart_overlay.dm index 8584c567621..459d8628fb1 100644 --- a/code/datums/bodypart_overlays/simple_bodypart_overlay.dm +++ b/code/datums/bodypart_overlays/simple_bodypart_overlay.dm @@ -4,7 +4,7 @@ ///Icon state of the overlay var/icon_state ///Icon of the overlay - var/icon + var/icon = 'icons/mob/species/misc/bodypart_overlay_simple.dmi' ///Color we apply to our overlay (none by default) var/draw_color @@ -13,3 +13,13 @@ /datum/bodypart_overlay/simple/color_image(image/overlay, layer) overlay.color = draw_color + +/datum/bodypart_overlay/simple/generate_icon_cache() + . = ..() + + . += "[icon_state]" + +///A sixpack drawn on the chest +/datum/bodypart_overlay/simple/sixpack + icon_state = "sixpack" + layers = EXTERNAL_ADJACENT diff --git a/code/modules/mob/dead/new_player/preferences_setup.dm b/code/modules/mob/dead/new_player/preferences_setup.dm index 05e6543f4b2..665ebff0684 100644 --- a/code/modules/mob/dead/new_player/preferences_setup.dm +++ b/code/modules/mob/dead/new_player/preferences_setup.dm @@ -26,6 +26,9 @@ var/next_hardcore_score = select_hardcore_quirks() character.hardcore_survival_score = next_hardcore_score ** 1.2 //30 points would be about 60 score + //Add a sixpack because honestly + var/obj/item/bodypart/chest/chest = character.get_bodypart(BODY_ZONE_CHEST) + chest.add_bodypart_overlay(new /datum/bodypart_overlay/simple/sixpack() ) /** * Goes through all quirks that can be used in hardcore mode and select some based on a random budget. diff --git a/icons/mob/species/misc/bodypart_overlay_simple.dmi b/icons/mob/species/misc/bodypart_overlay_simple.dmi new file mode 100644 index 0000000000000000000000000000000000000000..2bc1dda5663ab74fdad6f0d5ec721fd38d08d978 GIT binary patch literal 407 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=#Z@5@B`&GO$wiq3C7Jno3=9=> zRF50-H5>4-Ua+(~Dt=QtBXaKog(-~h1g1KyS;cx(u%M=G-`mKNzYo-RT)Zr}`P4V& z#kE&b{APMHJ^rdPdC{7ce-^7w;c#18^!DN3l_$t9o+X>|Sdjv2X}2CiYPFZN74$8zU-dz(jVk?<^sLS;OXk;vd$@?2>_21qeK7z literal 0 HcmV?d00001