Files
CHOMPStation2/code/game/birthday.dm
CHOMPStation2 14f0302bef [MIRROR] some more spans (#9170)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: Kashargul <KashL@t-online.de>
2024-10-06 06:59:27 +02:00

39 lines
2.4 KiB
Plaintext

/mob/living/carbon/human/proc/consider_birthday()
if(!bday_month || !bday_day) //If we don't have one of these set, don't worry about it
return
if(real_name != client.prefs.real_name) //let's not celebrate the birthday of that weird mob we got dropped into
return
if(!(client.prefs.last_birthday_notification < GLOB.world_time_year)) //you only get notified once a year // CHOMPEdit - Managed Globals
return
if((GLOB.world_time_month == bday_month) && (GLOB.world_time_day == bday_day)) //it is your birthday // CHOMPEdit - Managed Globals
birthday(1)
else if(GLOB.world_time_month > bday_month) //your birthday was in a previous month // CHOMPEdit - Managed Globals
birthday()
else if((GLOB.world_time_month == bday_month) && (GLOB.world_time_day > bday_day)) //your birthday was earlier this month // CHOMPEdit - Managed Globals
birthday()
/mob/living/carbon/human/proc/birthday(var/birthday = 0)
var/msg
var/lastyear = client.prefs.last_birthday_notification
client.prefs.last_birthday_notification = GLOB.world_time_year //We only want to ask once a year per character, this persists, update early in case of shenanigans // CHOMPEdit - Managed Globals
if(birthday) //woo
msg = "Today is your birthday! Do you want to increase your character's listed age?"
/* //Chomp DISABLE - Absolutely not.
if(client.prefs.bday_announce)
var/list/sounds = list('sound/voice/BIRTH.ogg')
var/oursound = pickweight(sounds)
command_announcement.Announce("Confirmed presence of BIRTHDAY aboard the station! It is [src.real_name]'s birthday or similar sort of celebration, name day, hatchday, WHATEVER! We encourage you to go find [src.real_name] and show them how we celebrate around here! Have a secure day!", "BIRTHDAY!", oursound)
*/ //Chomp DISABLE END
else
msg = "Your birthday has passed! Do you want to increase your character's listed age?" //sad, but thus is the life of an adult
if(tgui_alert(src, msg,"BIRTHDAY! ([bday_month]/[bday_day])",list("Level me up, baby","No way, I'mma stay young forever")) == "Level me up, baby")
if(lastyear == 0) //We've never been asked, so let's just assume you were keeping track before now and only add 1
age += 1
else
var/howmuch = GLOB.world_time_year - lastyear // CHOMPEdit - Managed Globals
age += howmuch
to_chat(src, span_notice("You are now [age]! Happy birthday!"))
client.prefs.age = age //Set the age on the character sheet
client.prefs.save_character() //Save the info