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:

![tipoftheround](https://github.com/tgstation/tgstation/assets/16478175/0d8d93a9-53c0-4983-b698-28d4656973fa)


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.

![oldAfro](https://github.com/tgstation/tgstation/assets/16478175/deba5f9d-c93b-49eb-adf3-de8b05233b45)
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.

![afros_comp](https://github.com/tgstation/tgstation/assets/16478175/d39b755e-8fb1-4a12-8089-80de3a2b7be6)

![Afros](https://github.com/tgstation/tgstation/assets/16478175/beaf307c-79a1-45c6-8d03-19ea856e8340)

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).

![Afros2](https://github.com/tgstation/tgstation/assets/16478175/4069d3ff-c08f-44c6-8275-4421c8f820ee)

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:
Cruix
2023-10-15 18:48:57 +02:00
committed by GitHub
co-authored by Cruix
parent 5e08081e5d
commit f31532ed89
8 changed files with 27 additions and 15 deletions
@@ -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)