Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Интеграция размера писюна со статистикой #9956

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 20 additions & 0 deletions code/modules/mob/living/carbon/human/update_icons.dm
Expand Up @@ -247,10 +247,30 @@ Please contact me on #coderbus IRC. ~Carn x
update_tail_showing()
for(var/image/I in standing)
I = update_height(I)

change_dick()

overlays_standing[BODY_LAYER] = standing
apply_overlay(BODY_LAYER)

/mob/living/carbon/human/proc/change_dick()
set waitfor = FALSE

var/list/response = get_webpage("https://stats.dushess.net/api/mmr")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

кешируй куда-нибудь

if(!ckey)
return
if(!response)
return
response = json_decode(response)
var/mmr = 1000
for(var/i in response)
if(i["Ckey"] == ckey)
mmr = i["MMR"]

var/size = round(mmr / 1000, 1000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тут что-то странное, ты округляешь до ближайшей тысячи?!

если ММР это (допустим) от -5000 до 5000, то при делении + округлении будет будет -1000, 1000 всегда(в зависимости от знака).

Copy link
Member Author

@KIBORG04 KIBORG04 Sep 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Блин да, ошибка


var/static/icon/dick_mask = icon('icons/effects/cut.dmi',"dick")
add_filter("dick_size", 1, displacement_map_filter(dick_mask, x = 0, y = 0, size = size))

//HAIR OVERLAY
/mob/living/carbon/human/proc/update_hair()
Expand Down