mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
Added a larger afro hairstyle (#78709)
## About The Pull Request It's exactly 6 months from April 1st, so this is a date for very serious PRs only. We've all seen that one tip at the beginning of the round:  So the afro must be really big, right? Having one must be a very large sacrifice in the realm of pixel-based combat, right? WRONG.  This is the largest afro currently available. Absolutely pathetic. It's not even the largest hairstyle in terms of pixel volume. Here's a bigger one.   The sprite overlaps the tile above by 6 pixels, which is noticeable, but not enough to interfere significantly with gameplay (apart from having a sacrificially larger hitbox).  This could already be done by creating a new .dmi file with larger, non-square pixel bounds, but that's a less than elegant solution. Instead, added a y offset var to hair sprite accessory datums. ## Why It's Good For The Game The self-expressive merits of having more hairstyles should be self-evident, so I will make a mathematical argument here. Everyone knows that the coolness of an afro is determined by its volume. As a 2-D sprite, the closet equivalent we have is area. An afro is, approximately, a circle, so the area can be calculated as πR^2, with R being the maximum distance from the top of the head to the top of the sprite bounding box. The current largest afro has a height of 6 pixels. This new afro has a height of 12 pixels. As a result, impressiveness increases by a factor of 4: ```math coolness_{new\ \ afro} \over coolness_{old\ \ afro} ``` ```math π12^2 \over π6^2 ``` ```math 12^2 \over 6^2 ``` ```math 144 \over 36 ``` ```math 4 ``` This means that, for the intrusion of a mere 6 pixels into our northern neighbor's bounding box, we get **quadruple** the coolness. ## Changelog 🆑 add: Added Afro (Huge) hairstyle /🆑 --------- Co-authored-by: Cruix <discoveryian2@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/proc/generate_icon_with_head_accessory(datum/sprite_accessory/sprite_accessory)
|
||||
/proc/generate_icon_with_head_accessory(datum/sprite_accessory/sprite_accessory, y_offset = 0)
|
||||
var/static/icon/head_icon
|
||||
if (isnull(head_icon))
|
||||
head_icon = icon('icons/mob/human/bodyparts_greyscale.dmi', "human_head_m")
|
||||
@@ -7,8 +7,10 @@
|
||||
var/icon/final_icon = new(head_icon)
|
||||
if (!isnull(sprite_accessory))
|
||||
ASSERT(istype(sprite_accessory))
|
||||
|
||||
|
||||
var/icon/head_accessory_icon = icon(sprite_accessory.icon, sprite_accessory.icon_state)
|
||||
if(y_offset)
|
||||
head_accessory_icon.Shift(NORTH, y_offset)
|
||||
head_accessory_icon.Blend(COLOR_DARK_BROWN, ICON_MULTIPLY)
|
||||
final_icon.Blend(head_accessory_icon, ICON_OVERLAY)
|
||||
|
||||
@@ -138,7 +140,8 @@
|
||||
return assoc_to_keys_features(GLOB.hairstyles_list)
|
||||
|
||||
/datum/preference/choiced/hairstyle/icon_for(value)
|
||||
return generate_icon_with_head_accessory(GLOB.hairstyles_list[value])
|
||||
var/datum/sprite_accessory/hair/hairstyle = GLOB.hairstyles_list[value]
|
||||
return generate_icon_with_head_accessory(hairstyle, hairstyle?.y_offset)
|
||||
|
||||
/datum/preference/choiced/hairstyle/apply_to_human(mob/living/carbon/human/target, value)
|
||||
target.set_hairstyle(value, update = FALSE)
|
||||
|
||||
Reference in New Issue
Block a user