Skip to content

Commit

Permalink
rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsar-Salat committed Sep 2, 2024
1 parent 023f7b5 commit 0f22a4d
Show file tree
Hide file tree
Showing 56 changed files with 359 additions and 247 deletions.
16 changes: 10 additions & 6 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,16 @@ GLOBAL_LIST_INIT(available_random_trauma_list, list(
#define CALCULATE_MOB_OVERLAY_LAYER(_layer) (FLOAT_LAYER - (_layer) * ((MOB_MAX_CLOTHING_LAYER - MOB_LAYER) / TOTAL_LAYERS))

// Mob Overlays Indexes

/// KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;
#define TOTAL_LAYERS 29
/// Mutations layer - Tk headglows, cold resistance glow, etc
#define MUTATIONS_LAYER 29
/// Certain mutantrace features (tail when looking south) that must appear behind the body parts
#define BODY_BEHIND_LAYER 28
#define TOTAL_LAYERS 30

/// mutations. Tk headglows, cold resistance glow, etc
#define MUTATIONS_LAYER 30
/// certain mutantrace features (tail when looking south) that must appear behind the body parts
#define BODY_BEHIND_LAYER 29
/// Layer for bodyparts that should appear behind every other bodypart - Mostly, legs when facing WEST or EAST
#define BODYPARTS_LOW_LAYER 28
/// Initially "AUGMENTS", this was repurposed to be a catch-all bodyparts flag
#define BODYPARTS_LAYER 27
/// certain mutantrace features (snout, body markings) that must appear above the body parts
Expand All @@ -512,7 +516,7 @@ GLOBAL_LIST_INIT(available_random_trauma_list, list(
/// lmao at the idiot who put both ids and hands on the same layer
#define ID_LAYER 21
/// Hands body part layer (or is this for the arm? not sure...)
#define HANDS_PART_LAYER 20
#define BODYPARTS_HIGH_LAYER 20
/// Gloves layer
#define GLOVES_LAYER 19
/// Shoes layer
Expand Down
30 changes: 30 additions & 0 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,36 @@ world
alpha_mask.Blend(image_overlay,ICON_OR)//OR so they are lumped together in a nice overlay.
return alpha_mask//And now return the mask.

/**
* Helper proc to generate a cutout alpha mask out of an icon.
*
* Why is it a helper if it's so simple?
*
* Because BYOND's documentation is hot garbage and I don't trust anyone to actually
* figure this out on their own without sinking countless hours into it. Yes, it's that
* simple, now enjoy.
*
* But why not use filters?
*
* Filters do not allow for masks that are not the exact same on every dir. An example of a
* need for that can be found in [/proc/generate_left_leg_mask()].
*
* Arguments:
* * icon_to_mask - The icon file you want to generate an alpha mask out of.
* * icon_state_to_mask - The specific icon_state you want to generate an alpha mask out of.
*
* Returns an `/icon` that is the alpha mask of the provided icon and icon_state.
*/
/proc/generate_icon_alpha_mask(icon_to_mask, icon_state_to_mask)
var/icon/mask_icon = icon(icon_to_mask, icon_state_to_mask)
// I hate the MapColors documentation, so I'll explain what happens here.
// Basically, what we do here is that we invert the mask by using none of the original
// colors, and then the fourth group of number arguments is actually the alpha values of
// each of the original colors, which we multiply by 255 and subtract a value of 255 to the
// result for the matching pixels, while starting with a base color of white everywhere.
mask_icon.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 255,255,255,-255, 1,1,1,1)
return mask_icon

/mob/proc/AddCamoOverlay(atom/A)//A is the atom which we are using as the overlay.
var/icon/opacity_icon = new(A.icon, A.icon_state)//Don't really care for overlays/underlays.
//Now we need to culculate overlays+underlays and add them together to form an image for a mask.
Expand Down
4 changes: 2 additions & 2 deletions code/datums/components/crafting/recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@
reqs = list(/obj/item/robot_suit = 1,
/obj/item/clothing/head/helmet = 1,
/obj/item/clothing/suit/armor/vest = 1,
/obj/item/bodypart/l_leg/robot = 1,
/obj/item/bodypart/r_leg/robot = 1,
/obj/item/bodypart/leg/left/robot = 1,
/obj/item/bodypart/leg/right/robot = 1,
/obj/item/stack/sheet/iron = 1,
/obj/item/stack/cable_coil = 1,
/obj/item/gun/energy/disabler = 1,
Expand Down
8 changes: 4 additions & 4 deletions code/datums/diseases/advance/symptoms/clockwork.dm
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
qdel(O)
return TRUE
if(BODY_ZONE_L_LEG)
var/obj/item/bodypart/l_leg/robot/clockwork/B = new()
var/obj/item/bodypart/leg/left/robot/clockwork/B = new()
if(robustbits)
B.brute_reduction = 3
B.burn_reduction = 2
Expand All @@ -210,7 +210,7 @@
qdel(O)
return TRUE
if(BODY_ZONE_R_LEG)
var/obj/item/bodypart/r_leg/robot/clockwork/B = new()
var/obj/item/bodypart/leg/right/robot/clockwork/B = new()
if(robustbits)
B.brute_reduction = 3
B.burn_reduction = 2
Expand Down Expand Up @@ -376,14 +376,14 @@
brute_reduction = 0
burn_reduction = 0

/obj/item/bodypart/l_leg/robot/clockwork
/obj/item/bodypart/leg/left/robot/clockwork
name = "clockwork left leg"
desc = "An odd metal leg full of intricate mechanisms."
static_icon = 'icons/mob/augmentation/augments_clockwork.dmi'
brute_reduction = 0
burn_reduction = 0

/obj/item/bodypart/r_leg/robot/clockwork
/obj/item/bodypart/leg/right/robot/clockwork
name = "clockwork right leg"
desc = "An odd metal leg full of intricate mechanisms."
static_icon = 'icons/mob/augmentation/augments_clockwork.dmi'
Expand Down
4 changes: 2 additions & 2 deletions code/datums/traits/negative_quirk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,10 @@
prosthetic = new/obj/item/bodypart/r_arm/robot/surplus(quirk_target)
slot_string = "right arm"
if(BODY_ZONE_L_LEG)
prosthetic = new/obj/item/bodypart/l_leg/robot/surplus(quirk_target)
prosthetic = new/obj/item/bodypart/leg/left/robot/surplus(quirk_target)
slot_string = "left leg"
if(BODY_ZONE_R_LEG)
prosthetic = new/obj/item/bodypart/r_leg/robot/surplus(quirk_target)
prosthetic = new/obj/item/bodypart/leg/right/robot/surplus(quirk_target)
slot_string = "right leg"
prosthetic.replace_limb(H)
qdel(old_part)
Expand Down
4 changes: 2 additions & 2 deletions code/game/objects/effects/anomalies/anomaly_delimber.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define ANOMALY_BIOSCRAMBLER_ZONES list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_L_ARM, BODY_ZONE_R_ARM, BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
#define ANOMALY_BIOSCRAMBLER_ZONE_CHEST typesof(/obj/item/bodypart/chest)
#define ANOMALY_BIOSCRAMBLER_ZONE_HEAD typesof(/obj/item/bodypart/head)
#define ANOMALY_BIOSCRAMBLER_ZONE_L_LEG typesof(/obj/item/bodypart/l_leg)
#define ANOMALY_BIOSCRAMBLER_ZONE_R_LEG typesof(/obj/item/bodypart/r_leg)
#define ANOMALY_BIOSCRAMBLER_ZONE_L_LEG typesof(/obj/item/bodypart/leg/left)
#define ANOMALY_BIOSCRAMBLER_ZONE_R_LEG typesof(/obj/item/bodypart/leg/right)
#define ANOMALY_BIOSCRAMBLER_ZONE_L_ARM typesof(/obj/item/bodypart/l_arm)
#define ANOMALY_BIOSCRAMBLER_ZONE_R_ARM typesof(/obj/item/bodypart/r_arm)

Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/robot/robot_parts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
icon_state = "robo_suit"
var/obj/item/bodypart/l_arm/robot/l_arm = null
var/obj/item/bodypart/r_arm/robot/r_arm = null
var/obj/item/bodypart/l_leg/robot/l_leg = null
var/obj/item/bodypart/r_leg/robot/r_leg = null
var/obj/item/bodypart/leg/left/robot/l_leg = null
var/obj/item/bodypart/leg/right/robot/r_leg = null
var/obj/item/bodypart/chest/robot/chest = null
var/obj/item/bodypart/head/robot/head = null

Expand Down Expand Up @@ -153,7 +153,7 @@
else
to_chat(user, "<span class='warning'>You need one sheet of iron to start building ED-209!</span>")
return
else if(istype(W, /obj/item/bodypart/l_leg/robot))
else if(istype(W, /obj/item/bodypart/leg/left/robot))
if(l_leg)
return
if(!user.transferItemToLoc(W, src))
Expand All @@ -163,7 +163,7 @@
l_leg = W
update_icon()

else if(istype(W, /obj/item/bodypart/r_leg/robot))
else if(istype(W, /obj/item/bodypart/leg/right/robot))
if(src.r_leg)
return
if(!user.transferItemToLoc(W, src))
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/structures/crates_lockers/crates.dm
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@
new /obj/item/bodypart/l_arm/robot/surplus(src)
new /obj/item/bodypart/r_arm/robot/surplus(src)
new /obj/item/bodypart/r_arm/robot/surplus(src)
new /obj/item/bodypart/l_leg/robot/surplus(src)
new /obj/item/bodypart/l_leg/robot/surplus(src)
new /obj/item/bodypart/r_leg/robot/surplus(src)
new /obj/item/bodypart/r_leg/robot/surplus(src)
new /obj/item/bodypart/leg/left/robot/surplus(src)
new /obj/item/bodypart/leg/left/robot/surplus(src)
new /obj/item/bodypart/leg/right/robot/surplus(src)
new /obj/item/bodypart/leg/right/robot/surplus(src)

/obj/structure/closet/crate/radiation
desc = "A crate with a radiation sign on it."
Expand Down
4 changes: 2 additions & 2 deletions code/modules/antagonists/devil/true_devil/_true_devil.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
/obj/item/bodypart/head/devil,
/obj/item/bodypart/l_arm/devil,
/obj/item/bodypart/r_arm/devil,
/obj/item/bodypart/r_leg/devil,
/obj/item/bodypart/l_leg/devil
/obj/item/bodypart/leg/right/devil,
/obj/item/bodypart/leg/left/devil
)
hud_type = /datum/hud/devil
var/ascended = FALSE
Expand Down
4 changes: 2 additions & 2 deletions code/modules/antagonists/heretic/knowledge/side_ash_flesh.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
/datum/heretic_knowledge/summon/raw_prophet,
)
required_atoms = list(
/obj/item/bodypart/l_leg = 1,
/obj/item/bodypart/r_leg = 1,
/obj/item/bodypart/leg/left = 1,
/obj/item/bodypart/leg/right = 1,
/obj/item/hatchet = 1,
)
duration = 5 MINUTES
Expand Down
12 changes: 6 additions & 6 deletions code/modules/clothing/shoes/_shoes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
/obj/item/clothing/shoes/suicide_act(mob/living/carbon/user)
if(prob(50))
user.visible_message("<span class='suicide'>[user] begins tying \the [src] up waaay too tightly! It looks like [user.p_theyre()] trying to commit suicide!</span>")
var/obj/item/bodypart/l_leg = user.get_bodypart(BODY_ZONE_L_LEG)
var/obj/item/bodypart/r_leg = user.get_bodypart(BODY_ZONE_R_LEG)
if(l_leg)
l_leg.dismember()
var/obj/item/bodypart/leg/left = user.get_bodypart(BODY_ZONE_L_LEG)
var/obj/item/bodypart/leg/right = user.get_bodypart(BODY_ZONE_R_LEG)
if(left)
left.dismember()
playsound(user,pick('sound/misc/desecration-01.ogg','sound/misc/desecration-02.ogg','sound/misc/desecration-01.ogg') ,50, 1, -1)
if(r_leg)
r_leg.dismember()
if(right)
right.dismember()
playsound(user,pick('sound/misc/desecration-01.ogg','sound/misc/desecration-02.ogg','sound/misc/desecration-01.ogg') ,50, 1, -1)
return BRUTELOSS
else//didnt realize this suicide act existed (was in miscellaneous.dm) and didnt want to remove it, so made it a 50/50 chance. Why not!
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
/obj/item/bodypart/head/alien,
/obj/item/bodypart/l_arm/alien,
/obj/item/bodypart/r_arm/alien,
/obj/item/bodypart/r_leg/alien,
/obj/item/bodypart/l_leg/alien,
/obj/item/bodypart/leg/right/alien,
/obj/item/bodypart/leg/left/alien,
)
var/caste = ""
var/alt_icon = 'icons/mob/alienleap.dmi' //used to switch between the two alien icon files.
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -966,9 +966,9 @@
if(BODY_ZONE_HEAD)
limbtypes = typesof(/obj/item/bodypart/head)
if(BODY_ZONE_L_LEG)
limbtypes = typesof(/obj/item/bodypart/l_leg)
limbtypes = typesof(/obj/item/bodypart/leg/left)
if(BODY_ZONE_R_LEG)
limbtypes = typesof(/obj/item/bodypart/r_leg)
limbtypes = typesof(/obj/item/bodypart/leg/right)
switch(edit_action)
if("remove")
if(BP)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/carbon_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
/obj/item/bodypart/head,
/obj/item/bodypart/l_arm,
/obj/item/bodypart/r_arm,
/obj/item/bodypart/r_leg,
/obj/item/bodypart/l_leg
/obj/item/bodypart/leg/right,
/obj/item/bodypart/leg/left
)

//Gets filled up in create_bodyparts()
Expand Down
18 changes: 9 additions & 9 deletions code/modules/mob/living/carbon/human/species.dm
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ GLOBAL_LIST_EMPTY(features_by_species)
var/obj/item/bodypart/species_head = /obj/item/bodypart/head
var/obj/item/bodypart/species_l_arm = /obj/item/bodypart/l_arm
var/obj/item/bodypart/species_r_arm = /obj/item/bodypart/r_arm
var/obj/item/bodypart/species_r_leg = /obj/item/bodypart/r_leg
var/obj/item/bodypart/species_l_leg = /obj/item/bodypart/l_leg
var/obj/item/bodypart/species_r_leg = /obj/item/bodypart/leg/right
var/obj/item/bodypart/species_l_leg = /obj/item/bodypart/leg/left

/// if false, having no tongue makes you unable to speak
var/speak_no_tongue = TRUE
Expand Down Expand Up @@ -394,8 +394,8 @@ GLOBAL_LIST_EMPTY(features_by_species)
//Note for future: Potentionally add a new C.dna.species() to build a template species for more accurate limb replacement

if((new_species.digitigrade_customization == DIGITIGRADE_OPTIONAL && C.dna.features["legs"] == "Digitigrade Legs") || new_species.digitigrade_customization == DIGITIGRADE_FORCED)
new_species.species_r_leg = /obj/item/bodypart/r_leg/digitigrade
new_species.species_l_leg = /obj/item/bodypart/l_leg/digitigrade
new_species.species_r_leg = /obj/item/bodypart/leg/right/digitigrade
new_species.species_l_leg = /obj/item/bodypart/leg/left/digitigrade

for(var/obj/item/bodypart/old_part as() in C.bodyparts)
if(old_part.change_exempt_flags & BP_BLOCK_CHANGE_SPECIES)
Expand Down Expand Up @@ -423,12 +423,12 @@ GLOBAL_LIST_EMPTY(features_by_species)
new_part.update_limb(is_creating = TRUE)
qdel(old_part)
if(BODY_ZONE_L_LEG)
var/obj/item/bodypart/l_leg/new_part = new new_species.species_l_leg()
var/obj/item/bodypart/leg/left/new_part = new new_species.species_l_leg()
new_part.replace_limb(C, TRUE, is_creating = TRUE)
new_part.update_limb(is_creating = TRUE)
qdel(old_part)
if(BODY_ZONE_R_LEG)
var/obj/item/bodypart/r_leg/new_part = new new_species.species_r_leg()
var/obj/item/bodypart/leg/right/new_part = new new_species.species_r_leg()
new_part.replace_limb(C, TRUE, is_creating = TRUE)
new_part.update_limb(is_creating = TRUE)
qdel(old_part)
Expand Down Expand Up @@ -775,8 +775,8 @@ GLOBAL_LIST_EMPTY(features_by_species)
var/obj/item/bodypart/chest/chest = H.get_bodypart(BODY_ZONE_CHEST)
var/obj/item/bodypart/r_arm/right_arm = H.get_bodypart(BODY_ZONE_R_ARM)
var/obj/item/bodypart/l_arm/left_arm = H.get_bodypart(BODY_ZONE_L_ARM)
var/obj/item/bodypart/r_leg/right_leg = H.get_bodypart(BODY_ZONE_R_LEG)
var/obj/item/bodypart/l_leg/left_leg = H.get_bodypart(BODY_ZONE_L_LEG)
var/obj/item/bodypart/leg/right/right_leg = H.get_bodypart(BODY_ZONE_R_LEG)
var/obj/item/bodypart/leg/left/left_leg = H.get_bodypart(BODY_ZONE_L_LEG)
var/datum/sprite_accessory/markings = GLOB.moth_markings_list[H.dna.features["moth_markings"]]
var/markings_icon_state = markings.icon_state
if(ismoth(H) && HAS_TRAIT(H, TRAIT_MOTH_BURNT))
Expand Down Expand Up @@ -850,7 +850,7 @@ GLOBAL_LIST_EMPTY(features_by_species)
H.remove_overlay(BODY_ADJ_LAYER)
H.remove_overlay(BODY_FRONT_LAYER)

REMOVE_LUM_SOURCE(H, LUM_SOURCE_MUTANT_BODYPART)
//REMOVE_LUM_SOURCE(H, LUM_SOURCE_MUTANT_BODYPART)

if(!mutant_bodyparts)
return
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/species_types/IPC.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
species_head = /obj/item/bodypart/head/ipc
species_l_arm = /obj/item/bodypart/l_arm/ipc
species_r_arm = /obj/item/bodypart/r_arm/ipc
species_l_leg = /obj/item/bodypart/l_leg/ipc
species_r_leg = /obj/item/bodypart/r_leg/ipc
species_l_leg = /obj/item/bodypart/leg/left/ipc
species_r_leg = /obj/item/bodypart/leg/right/ipc

exotic_blood = /datum/reagent/oil
blood_color = "#000000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
species_head = /obj/item/bodypart/head/abductor
species_l_arm = /obj/item/bodypart/l_arm/abductor
species_r_arm = /obj/item/bodypart/r_arm/abductor
species_l_leg = /obj/item/bodypart/l_leg/abductor
species_r_leg = /obj/item/bodypart/r_leg/abductor
species_l_leg = /obj/item/bodypart/leg/left/abductor
species_r_leg = /obj/item/bodypart/leg/right/abductor

/datum/species/abductor/on_species_gain(mob/living/carbon/C, datum/species/old_species)
. = ..()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/species_types/apid.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
species_head = /obj/item/bodypart/head/apid
species_l_arm = /obj/item/bodypart/l_arm/apid
species_r_arm = /obj/item/bodypart/r_arm/apid
species_l_leg = /obj/item/bodypart/l_leg/apid
species_r_leg = /obj/item/bodypart/r_leg/apid
species_l_leg = /obj/item/bodypart/leg/left/apid
species_r_leg = /obj/item/bodypart/leg/right/apid

species_height = SPECIES_HEIGHTS(2, 1, 0)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
species_head = /obj/item/bodypart/head/ethereal
species_l_arm = /obj/item/bodypart/l_arm/ethereal
species_r_arm = /obj/item/bodypart/r_arm/ethereal
species_l_leg = /obj/item/bodypart/l_leg/ethereal
species_r_leg = /obj/item/bodypart/r_leg/ethereal
species_l_leg = /obj/item/bodypart/leg/left/ethereal
species_r_leg = /obj/item/bodypart/leg/right/ethereal

// Body temperature for ethereals is much higher then humans as they like hotter environments
bodytemp_normal = (BODYTEMP_NORMAL + 50)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
species_head = /obj/item/bodypart/head/fly
species_l_arm = /obj/item/bodypart/l_arm/fly
species_r_arm = /obj/item/bodypart/r_arm/fly
species_l_leg = /obj/item/bodypart/l_leg/fly
species_r_leg = /obj/item/bodypart/r_leg/fly
species_l_leg = /obj/item/bodypart/leg/left/fly
species_r_leg = /obj/item/bodypart/leg/right/fly

species_height = SPECIES_HEIGHTS(2, 1, 0)

Expand Down
Loading

0 comments on commit 0f22a4d

Please sign in to comment.