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

Round End Credits #439

Open
wants to merge 53 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
65403f1
First Commit
RengaN02 Jan 17, 2025
4e1b129
bişeyler
RengaN02 Jan 18, 2025
63e13f7
az kaldı sanırım
RengaN02 Jan 28, 2025
774b443
Deadminlerde gözüksün
RengaN02 Jan 29, 2025
645c5cf
Bitmedi daha
RengaN02 Jan 31, 2025
f8dba89
Rare olayına gerek yok, bi tek ui kaldı
RengaN02 Jan 31, 2025
c3bb2a7
uiye gerek yok bu yeterli
RengaN02 Jan 31, 2025
d93d765
recordsu varsa ordaki iş adını alsın yoksa idsindeki adı
RengaN02 Jan 31, 2025
0521ca9
Merge branch 'master' of https://github.com/RengaN02/PsychonautStatio…
RengaN02 Jan 31, 2025
0c19600
Merge branch 'master' of https://github.com/RengaN02/PsychonautStatio…
RengaN02 Jan 31, 2025
2630368
Böyle daha iyi gibi
RengaN02 Jan 31, 2025
1c6e515
Liste boşsa gerek yok
RengaN02 Jan 31, 2025
0f6f16a
Sadece deneme için kaldırıyorum
RengaN02 Jan 31, 2025
82a87fe
Merge branch 'master' into credits
RengaN02 Jan 31, 2025
f0edb3b
Alakasızmış
RengaN02 Jan 31, 2025
b37ddf9
Bu fixler umarım
RengaN02 Jan 31, 2025
775497d
Merge branch 'credits' of https://github.com/RengaN02/PsychonautStati…
RengaN02 Jan 31, 2025
9e1a1b2
bunları neden eklemişimki
RengaN02 Jan 31, 2025
88f098d
Apiden patronları çeker
RengaN02 Feb 2, 2025
42f3f3a
6 kişi gözükcek tek sırada, yazılar artık üst üste düşmüyor.
RengaN02 Feb 3, 2025
63c953e
Böyle daha iyi
RengaN02 Feb 3, 2025
0e86500
ckey(ckey) e gerek yok sanırım
RengaN02 Feb 3, 2025
02975e9
Merge branch 'master' into credits
RengaN02 Feb 3, 2025
3b3e146
adminler içinde ekledim localde guestten girince kaydetmesin diye
RengaN02 Feb 4, 2025
8414345
Merge branch 'credits' of https://github.com/RengaN02/PsychonautStati…
RengaN02 Feb 4, 2025
9977e61
Merge branch 'master' into credits
RengaN02 Feb 9, 2025
9d97639
antag icon fixlencek
RengaN02 Feb 9, 2025
413f222
yatan kişi yatarak gözükmesin diye matrix()
RengaN02 Feb 10, 2025
4056f62
Merge branch 'credits' of https://github.com/RengaN02/PsychonautStati…
RengaN02 Feb 10, 2025
d74e341
Gereksiz boşluk
RengaN02 Feb 10, 2025
0824f5e
Buna gerek kalmadı
RengaN02 Feb 10, 2025
2a3340e
Reviewler + Türkçeleştirme
RengaN02 Feb 12, 2025
93c43ca
Böyle olsun
RengaN02 Feb 12, 2025
671ffbb
I -> İ
RengaN02 Feb 12, 2025
f1148f2
Socratic degil
RengaN02 Feb 12, 2025
0b8d108
Ğ
RengaN02 Feb 12, 2025
1b730d5
Yapay zeka çevirisi okadarda iyi degilmiş
RengaN02 Feb 12, 2025
1526d0b
Yanlıs seyi silmisim
RengaN02 Feb 12, 2025
c8e97fc
Revie
RengaN02 Feb 12, 2025
d566eb6
Merge branch 'master' into credits
RengaN02 Feb 12, 2025
c93e358
Fix + Fix
RengaN02 Feb 12, 2025
0a5adb8
Merge branch 'credits' of https://github.com/RengaN02/PsychonautStati…
RengaN02 Feb 12, 2025
a92356b
Fixin fixi
RengaN02 Feb 12, 2025
97a2aeb
Güzel bi cast ekranı yapmaya calısıcam
RengaN02 Feb 16, 2025
098e88f
Merge branch 'master' into credits
RengaN02 Feb 17, 2025
b1bf5e2
Runtime fix + cast
RengaN02 Feb 17, 2025
e5de8b4
Merge branch 'credits' of https://github.com/RengaN02/PsychonautStati…
RengaN02 Feb 17, 2025
1c0bc57
Reviewler
RengaN02 Feb 19, 2025
55fe2ee
Bitti sanırım
RengaN02 Feb 21, 2025
9a4a94b
En yüksek jobu preferencesdeki gibi seçer
RengaN02 Feb 21, 2025
9ad2e04
Kaydetmeden commit atmısım
RengaN02 Feb 21, 2025
a2a9543
Böyle olmalı
RengaN02 Feb 21, 2025
d7c8f2e
Oyundaysa preferencesden alsın olayı
RengaN02 Feb 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__DEFINES/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
#define INIT_ORDER_MINOR_MAPPING -40
#define INIT_ORDER_PATH -50
#define INIT_ORDER_EXPLOSIONS -69
#define INIT_ORDER_CREDITS -93
#define INIT_ORDER_STATPANELS -97
#define INIT_ORDER_BAN_CACHE -98
#define INIT_ORDER_INIT_PROFILER -99 //Near the end, logs the costs of initialize
Expand Down
22 changes: 17 additions & 5 deletions code/__HELPERS/roundend.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#define POPCOUNT_SURVIVORS "survivors" //Not dead at roundend
#define POPCOUNT_ESCAPEES "escapees" //Not dead and on centcom/shuttles marked as escaped
#define POPCOUNT_ESCAPEES_HUMANONLY "human_escapees"
#define POPCOUNT_ESCAPEES_HUMANONLY_LIST "human_escapees_list"
#define POPCOUNT_SHUTTLE_ESCAPEES "shuttle_escapees" //Emergency shuttle only.
#define POPCOUNT_STATION_INTEGRITY "station_integrity"
#define PERSONAL_LAST_ROUND "personal last round"
#define SERVER_LAST_ROUND "server last round"

Expand All @@ -14,7 +17,9 @@ GLOBAL_LIST_INIT(achievements_unlocked, list())
var/list/file_data = list("escapees" = list("humans" = list(), "silicons" = list(), "others" = list(), "npcs" = list()), "abandoned" = list("humans" = list(), "silicons" = list(), "others" = list(), "npcs" = list()), "ghosts" = list(), "additional data" = list())
var/num_survivors = 0 //Count of non-brain non-eye mobs with mind that are alive
var/num_escapees = 0 //Above and on centcom z
var/num_shuttle_escapees = 0 //Above and on escape shuttle
var/num_human_escapees = 0 //Above but humans only
var/num_shuttle_escapees = 0 //Above's above and on escape shuttle
var/list/list_of_human_escapees = list() //References to all escaped humans
var/list/area/shuttle_areas
if(SSshuttle?.emergency)
shuttle_areas = SSshuttle.emergency.shuttle_areas
Expand All @@ -39,6 +44,9 @@ GLOBAL_LIST_INIT(achievements_unlocked, list())
escape_status = "escapees"
if(shuttle_areas[get_area(M)])
num_shuttle_escapees++
if(ishuman(M))
num_human_escapees++
list_of_human_escapees += M
if(isliving(M))
var/mob/living/L = M
mob_data["location"] = get_area(L)
Expand Down Expand Up @@ -91,8 +99,8 @@ GLOBAL_LIST_INIT(achievements_unlocked, list())

var/datum/station_state/end_state = new /datum/station_state()
end_state.count()
var/station_integrity = min(PERCENT(GLOB.start_state.score(end_state)), 100)
file_data["additional data"]["station integrity"] = station_integrity
var/roundend_station_integrity = min(PERCENT(GLOB.start_state.score(end_state)), 100)
file_data["additional data"]["station integrity"] = roundend_station_integrity
WRITE_FILE(json_file, json_encode(file_data))

SSblackbox.record_feedback("nested tally", "round_end_stats", num_survivors, list("survivors", "total"))
Expand All @@ -102,8 +110,10 @@ GLOBAL_LIST_INIT(achievements_unlocked, list())
. = list()
.[POPCOUNT_SURVIVORS] = num_survivors
.[POPCOUNT_ESCAPEES] = num_escapees
.[POPCOUNT_ESCAPEES_HUMANONLY] = num_human_escapees
.[POPCOUNT_SHUTTLE_ESCAPEES] = num_shuttle_escapees
.["station_integrity"] = station_integrity
.[POPCOUNT_ESCAPEES_HUMANONLY_LIST] = list_of_human_escapees
.[POPCOUNT_STATION_INTEGRITY] = roundend_station_integrity

/datum/controller/subsystem/ticker/proc/gather_antag_data()
var/team_gid = 1
Expand Down Expand Up @@ -220,6 +230,9 @@ GLOBAL_LIST_INIT(achievements_unlocked, list())
LAZYCLEARLIST(round_end_events)

var/speed_round = (STATION_TIME_PASSED() <= 10 MINUTES)
popcount = gather_roundend_feedback()
SScredits.draft()
SScredits.finalize()

for(var/client/C in GLOB.clients)
if(!C?.credits)
Expand All @@ -229,7 +242,6 @@ GLOBAL_LIST_INIT(achievements_unlocked, list())
C?.give_award(/datum/award/achievement/misc/speed_round, C?.mob)
HandleRandomHardcoreScore(C)

var/popcount = gather_roundend_feedback()
display_report(popcount)

CHECK_TICK
Expand Down
94 changes: 69 additions & 25 deletions code/_onclick/hud/credits.dm
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
#define CREDIT_ROLL_SPEED 125
#define CREDIT_SPAWN_SPEED 10
#define CREDIT_ANIMATE_HEIGHT (14 * ICON_SIZE_Y)
#define CREDIT_EASE_DURATION 22
#define CREDITS_PATH "[global.config.directory]/contributors.dmi"
#define CREDIT_ROLL_SPEED 9 SECONDS
#define CREDIT_SPAWN_SPEED 1 SECONDS
#define CREDIT_ANIMATE_HEIGHT (16 * world.icon_size)
#define CREDIT_EASE_DURATION 2.2 SECONDS

/client/proc/RollCredits()
set waitfor = FALSE
if(!fexists(CREDITS_PATH))
if(!prefs?.read_preference(/datum/preference/toggle/show_roundend_credits))
return
var/icon/credits_icon = new(CREDITS_PATH)
LAZYINITLIST(credits)
var/list/_credits = credits
add_verb(src, /client/proc/ClearCredits)
var/static/list/credit_order_for_this_round
if(isnull(credit_order_for_this_round))
credit_order_for_this_round = list("Thanks for playing!") + (shuffle(icon_states(credits_icon)) - "Thanks for playing!")
var/list/credit_order_for_this_round = SScredits.credit_order_for_this_round

var/count = 0
for(var/I in credit_order_for_this_round)
if(!credits)
return
_credits += new /atom/movable/screen/credit(null, null, I, src, credits_icon)
sleep(CREDIT_SPAWN_SPEED)
if(istype(I, /obj/effect/title_card_object)) //huge image sleep
sleep(CREDIT_SPAWN_SPEED * 3.3)
count = 0
if(count && !istype(I, /atom/movable/screen/map_view/char_preview))
sleep(CREDIT_SPAWN_SPEED)

_credits += new /atom/movable/screen/credit(null, null, I, src)
if(istype(I, /atom/movable/screen/map_view/char_preview))
count++
if(count >= 6)
count = 0
sleep(CREDIT_SPAWN_SPEED)
if(!istype(I, /atom/movable/screen/map_view/char_preview))
sleep(CREDIT_SPAWN_SPEED)
count = 0
sleep(CREDIT_ROLL_SPEED - CREDIT_SPAWN_SPEED)
remove_verb(src, /client/proc/ClearCredits)
qdel(credits_icon)

/client/proc/ClearCredits()
set name = "Hide Credits"
Expand All @@ -34,32 +44,67 @@
/atom/movable/screen/credit
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
alpha = 0
screen_loc = "12,1"
plane = SPLASHSCREEN_PLANE
screen_loc = "3,1"
var/client/parent
var/matrix/target

/atom/movable/screen/credit/Initialize(mapload, datum/hud/hud_owner, credited, client/P, icon/I)
/atom/movable/screen/credit/Initialize(mapload, datum/hud/hud_owner, credited, client/P)
. = ..()
icon = I
parent = P
icon_state = credited
maptext = MAPTEXT_PIXELLARI(credited)
maptext_x = ICON_SIZE_X + 8
maptext_y = (ICON_SIZE_Y / 2) - 4
maptext_width = ICON_SIZE_X * 3
var/view = P?.view
var/list/offsets = screen_loc_to_offset("3,1", view)

if(istype(credited, /atom/movable/screen/map_view/char_preview))
var/atom/movable/screen/map_view/char_preview/choice = credited
choice.plane = plane
choice.screen_loc = screen_loc
choice.alpha = alpha
maptext_width = choice.maptext_width
maptext = choice.maptext
appearance = choice.appearance
screen_loc = offset_to_screen_loc(offsets[1] + choice.pixel_x, offsets[2] + choice.pixel_y)
add_overlay(choice)

if(istype(credited, /mutable_appearance))
var/mutable_appearance/choice = credited
choice.plane = plane
choice.screen_loc = screen_loc
choice.alpha = alpha
maptext_width = choice.maptext_width
maptext = choice.maptext
appearance = choice.appearance
screen_loc = offset_to_screen_loc(offsets[1] + choice.pixel_x, offsets[2] + choice.pixel_y)
add_overlay(choice)

if(istype(credited, /obj/effect/title_card_object))
var/obj/effect/title_card_object/choice = credited
choice.plane = plane
choice.screen_loc = screen_loc
choice.alpha = alpha
maptext_width = choice.maptext_width
maptext = choice.maptext
appearance = choice.appearance
screen_loc = offset_to_screen_loc(offsets[1] + choice.pixel_x, offsets[2] + choice.pixel_y)
add_overlay(choice)

if(istext(credited))
maptext = MAPTEXT_PIXELLARI(credited)
maptext_x = world.icon_size + 8
maptext_y = (world.icon_size / 2) - 4
maptext_width = world.icon_size * 12
maptext_height = world.icon_size * 3

var/matrix/M = matrix(transform)
M.Translate(0, CREDIT_ANIMATE_HEIGHT)
animate(src, transform = M, time = CREDIT_ROLL_SPEED)
target = M
animate(src, alpha = 255, time = CREDIT_EASE_DURATION, flags = ANIMATION_PARALLEL)
addtimer(CALLBACK(src, PROC_REF(FadeOut)), CREDIT_ROLL_SPEED - CREDIT_EASE_DURATION)
QDEL_IN(src, CREDIT_ROLL_SPEED)
if(parent)
parent.screen += src
parent?.screen += src

/atom/movable/screen/credit/Destroy()
icon = null
if(parent)
parent.screen -= src
LAZYREMOVE(parent.credits, src)
Expand All @@ -73,4 +118,3 @@
#undef CREDIT_EASE_DURATION
#undef CREDIT_ROLL_SPEED
#undef CREDIT_SPAWN_SPEED
#undef CREDITS_PATH
Loading
Loading