Merge pull request #545 from Citadel-Station-13/upstream-merge-26397

[MIRROR] Fixes easter eggs spawning during non-easter; SSevent now inits before SSticker
This commit is contained in:
LetterJay
2017-04-25 01:02:38 -05:00
committed by GitHub
39 changed files with 227 additions and 178 deletions

View File

@@ -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("<span class='adminnotice'>[key_name_admin(usr)] renamed the station to: [new_name].</span>")
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("<span class='adminnotice'>[key_name_admin(usr)] reset the station name.</span>")
priority_announce("[command_name()] has renamed the station to \"[new_name]\".")

View File

@@ -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

View File

@@ -140,10 +140,6 @@
containsPrize = FALSE
qdel(src)
/obj/effect/spawner/lootdrop/maintenance/New()
..()
loot += list(/obj/item/weapon/reagent_containers/food/snacks/egg/loaded = 15, /obj/item/weapon/storage/bag/easterbasket = 15)
//Easter Recipes + food
/obj/item/weapon/reagent_containers/food/snacks/hotcrossbun
bitesize = 2

View File

@@ -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")
@@ -422,3 +422,9 @@
// to_chat(world, "Easter calculates to be on [begin_day] of [begin_month] ([days_early] early) to [end_day] of [end_month] ([days_extra] extra) for 20[yy]")
return ..()
/datum/holiday/easter/celebrate()
..()
GLOB.maintenance_loot += list(
/obj/item/weapon/reagent_containers/food/snacks/egg/loaded = 15,
/obj/item/weapon/storage/bag/easterbasket = 15)

View File

@@ -826,3 +826,6 @@ GLOBAL_LIST_INIT(cable_coil_recipes, list (new/datum/stack_recipe("cable restrai
item_color = pick("red","orange","yellow","green","cyan","blue","pink","white")
icon_state = "coil_[item_color]"
..()
/obj/item/stack/cable_coil/random/five
amount = 5