diff --git a/code/__HELPERS/names.dm b/code/__HELPERS/names.dm index e95a61cec32..49be0a12c3b 100644 --- a/code/__HELPERS/names.dm +++ b/code/__HELPERS/names.dm @@ -55,20 +55,25 @@ GLOBAL_VAR(command_name) return capitalize(name) /proc/station_name() - if(GLOB.station_name) - return GLOB.station_name + if(!GLOB.station_name) + var/newname + if(config && config.station_name) + newname = config.station_name + else + newname = new_station_name() - if(config && config.station_name) - GLOB.station_name = config.station_name - else - GLOB.station_name = new_station_name() + set_station_name(newname) + + return GLOB.station_name + +/proc/set_station_name(newname) + GLOB.station_name = newname if(config && config.server_name) world.name = "[config.server_name][config.server_name==GLOB.station_name ? "" : ": [GLOB.station_name]"]" else world.name = GLOB.station_name - return GLOB.station_name /proc/new_station_name() var/random = rand(1,5) @@ -235,10 +240,3 @@ GLOBAL_VAR(syndicate_code_response) //Code response for traitors. code_phrase += ", " return code_phrase - -/proc/change_station_name(designation) - if(config && config.server_name) - world.name = "[config.server_name]: [designation]" - else - world.name = designation - GLOB.station_name = designation diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm index 411d6f0b14e..b99b71ed336 100644 --- a/code/controllers/subsystem/events.dm +++ b/code/controllers/subsystem/events.dm @@ -179,9 +179,13 @@ SUBSYSTEM_DEF(events) if(!holidays) holidays = list() holidays[holiday.name] = holiday + else + qdel(holiday) if(holidays) holidays = shuffle(holidays) + // regenerate station name because holiday prefixes. + set_station_name(new_station_name()) world.update_status() /datum/controller/subsystem/events/proc/toggleWizardmode() diff --git a/code/game/objects/items/charter.dm b/code/game/objects/items/charter.dm index 98e03ef18ca..41a793df301 100644 --- a/code/game/objects/items/charter.dm +++ b/code/game/objects/items/charter.dm @@ -54,7 +54,7 @@ if(standard_station_regex.Find(new_name)) to_chat(user, "Your name has been automatically approved.") - rename_station(new_name, user) + rename_station(new_name, user.name, user.real_name, key_name(user)) return to_chat(user, "Your name has been sent to your employers for approval.") @@ -79,7 +79,7 @@ response_timer_id = null /obj/item/station_charter/proc/rename_station(designation, uname, ureal_name, ukey) - change_station_name(designation) + set_station_name(designation) minor_announce("[ureal_name] has designated your station as [station_name()]", "Captain's Charter", 0) log_game("[ukey] has renamed the station as [station_name()].") diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm index 74e024472bc..7f0479eac91 100644 --- a/code/modules/admin/secrets.dm +++ b/code/modules/admin/secrets.dm @@ -157,7 +157,7 @@ var/new_name = input(usr, "Please input a new name for the station.", "What?", "") as text|null if(!new_name) return - change_station_name(new_name) + set_station_name(new_name) log_admin("[key_name(usr)] renamed the station to \"[new_name]\".") message_admins("[key_name_admin(usr)] renamed the station to: [new_name].") priority_announce("[command_name()] has renamed the station to \"[new_name]\".") @@ -166,7 +166,7 @@ if(!check_rights(R_ADMIN)) return var/new_name = new_station_name() - change_station_name(new_name) + set_station_name(new_name) log_admin("[key_name(usr)] reset the station name.") message_admins("[key_name_admin(usr)] reset the station name.") priority_announce("[command_name()] has renamed the station to \"[new_name]\".") diff --git a/code/modules/events/holiday/xmas.dm b/code/modules/events/holiday/xmas.dm index c5f74ed68e6..e29888f888d 100644 --- a/code/modules/events/holiday/xmas.dm +++ b/code/modules/events/holiday/xmas.dm @@ -84,6 +84,12 @@ name = "christmas tree spawner" var/tree = /obj/structure/flora/tree/pine/xmas +/obj/effect/landmark/xmastree/Initialize(mapload) + ..() + if(FESTIVE_SEASON in SSevents.holidays) + new tree(get_turf(src)) + qdel(src) + /obj/effect/landmark/xmastree/rdrod name = "festivus pole spawner" tree = /obj/structure/festivus diff --git a/code/modules/holiday/holidays.dm b/code/modules/holiday/holidays.dm index 89892655137..a73b9efa539 100644 --- a/code/modules/holiday/holidays.dm +++ b/code/modules/holiday/holidays.dm @@ -7,6 +7,8 @@ var/end_day = 0 // Default of 0 means the holiday lasts a single day var/end_month = 0 + var/always_celebrate = FALSE // for christmas neverending, or testing. + // This proc gets run before the game starts when the holiday is activated. Do festive shit here. /datum/holiday/proc/celebrate() @@ -22,6 +24,9 @@ // Return 1 if this holidy should be celebrated today /datum/holiday/proc/shouldCelebrate(dd, mm, yy) + if(always_celebrate) + return TRUE + if(!end_day) end_day = begin_day if(!end_month) @@ -30,26 +35,26 @@ if(end_month > begin_month) //holiday spans multiple months in one year if(mm == end_month) //in final month if(dd <= end_day) - return 1 + return TRUE else if(mm == begin_month)//in first month if(dd >= begin_day) - return 1 + return TRUE else if(mm in begin_month to end_month) //holiday spans 3+ months and we're in the middle, day doesn't matter at all - return 1 + return TRUE else if(end_month == begin_month) // starts and stops in same month, simplest case if(mm == begin_month && (dd in begin_day to end_day)) - return 1 + return TRUE else // starts in one year, ends in the next if(mm >= begin_month && dd >= begin_day) // Holiday ends next year - return 1 + return TRUE if(mm <= end_month && dd <= end_day) // Holiday started last year - return 1 + return TRUE - return 0 + return FALSE // The actual holidays @@ -329,11 +334,6 @@ begin_month = DECEMBER end_day = 31 -/datum/holiday/festive_season/celebrate() - for(var/obj/effect/landmark/xmastree/XT in GLOB.landmarks_list) - new XT.tree(get_turf(XT)) - qdel(XT) - /datum/holiday/festive_season/greet() return "Have a nice festive season!" @@ -348,8 +348,8 @@ /datum/holiday/friday_thirteenth/shouldCelebrate(dd, mm, yy) if(dd == 13) if(time2text(world.timeofday, "DDD") == "Fri") - return 1 - return 0 + return TRUE + return FALSE /datum/holiday/friday_thirteenth/getStationPrefix() return pick("Mike","Friday","Evil","Myers","Murder","Deathly","Stabby")