Skip to content
This repository has been archived by the owner on Mar 10, 2022. It is now read-only.

Commit

Permalink
add descriptor scaling, gives humans numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Spookerton committed Jun 30, 2021
1 parent 6271305 commit 68e5413
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"much taller than you",
"towering over you"
)
var/list/scale_effect = list(
SPECIES_HUMAN = list(-7, -4, 0, 4, 7)
)

/datum/mob_descriptor/build
name = "build"
Expand All @@ -43,3 +46,6 @@
"built much larger than you",
"dwarfing you"
)
var/list/scale_effect = list(
SPECIES_HUMAN = list(-7.5, 0, 0, 0, 7.5)
)
33 changes: 27 additions & 6 deletions code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,37 @@ Please contact me on #coderbus IRC. ~Carn x

overlays = overlays_to_apply

var/matrix/M = matrix()
if(lying)
var/matrix/M = new
var/list/scale = get_scale()
M.Scale(scale[1], scale[2])
if (lying)
M.Turn(90)
M.Scale(size_multiplier)
M.Translate(1, -6-default_pixel_z)
M.Translate(1, -6 - default_pixel_z)
else
M.Scale(size_multiplier)
M.Translate(0, 16*(size_multiplier-1))
M.Translate(0, 16 * (scale[2] - 1))
animate(src, transform = M, time = ANIM_LYING_TIME)


/mob/living/carbon/human/proc/get_scale()
var/h_mul = LAZYACCESS(descriptors, "height")
if (h_mul)
var/datum/mob_descriptor/height/H = species.descriptors["height"]
if (H)
var/list/scale_effect = H.scale_effect[species.name]
if (scale_effect)
h_mul = 0.01 * scale_effect[h_mul]
var/b_mul = LAZYACCESS(descriptors, "build")
if (b_mul)
var/datum/mob_descriptor/build/B = species.descriptors["build"]
if (B)
var/list/scale_effect = B.scale_effect[species.name]
if (scale_effect)
b_mul = 0.01 * scale_effect[b_mul]
return list(
(1 + b_mul) * size_multiplier,
(1 + h_mul) * size_multiplier
)

var/global/list/damage_icon_parts = list()

/mob/living/carbon/human/proc/get_lying_offset(var/image/I)
Expand Down
8 changes: 8 additions & 0 deletions code/modules/mob/new_player/preferences_setup.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,24 @@
preview_icon = icon('icons/effects/128x48.dmi', bgstate)
preview_icon.Scale(48+32, 16+32)

if(LAZYLEN(mannequin.descriptors))
for(var/entry in body_descriptors)
mannequin.descriptors[entry] = body_descriptors[entry]
var/list/scale = mannequin.get_scale()

mannequin.dir = NORTH
var/icon/stamp = getFlatIcon(mannequin, NORTH, always_use_defdir = 1)
stamp.Scale(scale[1] * stamp.Width(), scale[2] * stamp.Height())
preview_icon.Blend(stamp, ICON_OVERLAY, 25, 17)

mannequin.dir = WEST
stamp = getFlatIcon(mannequin, WEST, always_use_defdir = 1)
stamp.Scale(scale[1] * stamp.Width(), scale[2] * stamp.Height())
preview_icon.Blend(stamp, ICON_OVERLAY, 1, 9)

mannequin.dir = SOUTH
stamp = getFlatIcon(mannequin, SOUTH, always_use_defdir = 1)
stamp.Scale(scale[1] * stamp.Width(), scale[2] * stamp.Height())
preview_icon.Blend(stamp, ICON_OVERLAY, 49, 1)

preview_icon.Scale(preview_icon.Width() * 2, preview_icon.Height() * 2) // Scaling here to prevent blurring in the browser.

0 comments on commit 68e5413

Please sign in to comment.