diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm
index 517794a587..0b27e01326 100644
--- a/code/__DEFINES/subsystems.dm
+++ b/code/__DEFINES/subsystems.dm
@@ -19,3 +19,26 @@
//For servers that can't do with any additional lag, set this to none in flightpacks.dm in subsystem/processing.
#define FLIGHTSUIT_PROCESSING_NONE 0
#define FLIGHTSUIT_PROCESSING_FULL 1
+
+// Subsystem init_order, from highest priority to lowest priority
+// The numbers just define the ordering, they are meaningless otherwise.
+
+#define INIT_ORDER_JOBS 15
+#define INIT_ORDER_EVENTS 14
+#define INIT_ORDER_TICKER 13
+#define INIT_ORDER_MAPPING 12
+#define INIT_ORDER_ATOMS 11
+#define INIT_ORDER_MACHINES 9
+#define INIT_ORDER_SHUTTLE 3
+#define INIT_ORDER_TIMER 1
+#define INIT_ORDER_DEFAULT 0
+#define INIT_ORDER_AIR -1
+#define INIT_ORDER_MINIMAP -2
+#define INIT_ORDER_ASSETS -3
+#define INIT_ORDER_ICON_SMOOTHING -5
+#define INIT_ORDER_OVERLAY -6
+#define INIT_ORDER_XKEYSCORE -10
+#define INIT_ORDER_STICKY_BAN -10
+#define INIT_ORDER_LIGHTING -20
+#define INIT_ORDER_SQUEAK -40
+#define INIT_ORDER_PERSISTENCE -100
diff --git a/code/__HELPERS/names.dm b/code/__HELPERS/names.dm
index 0e62ad1130..5074ae4e38 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/_globalvars/lists/maintenance_loot.dm b/code/_globalvars/lists/maintenance_loot.dm
new file mode 100644
index 0000000000..849c5248a0
--- /dev/null
+++ b/code/_globalvars/lists/maintenance_loot.dm
@@ -0,0 +1,108 @@
+//How to balance this table
+//-------------------------
+//The total added weight of all the entries should be (roughly) equal to the total number of lootdrops
+//(take in account those that spawn more than one object!)
+//
+//While this is random, probabilities tells us that item distribution will have a tendency to look like
+//the content of the weighted table that created them.
+//The less lootdrops, the less even the distribution.
+//
+//If you want to give items a weight <1 you can multiply all the weights by 10
+//
+//the "" entry will spawn nothing, if you increase this value,
+//ensure that you balance it with more spawn points
+
+//table data:
+//-----------
+//aft maintenance: 24 items, 18 spots 2 extra (28/08/2014)
+//asmaint: 16 items, 11 spots 0 extra (08/08/2014)
+//asmaint2: 36 items, 26 spots 2 extra (28/08/2014)
+//fpmaint: 5 items, 4 spots 0 extra (08/08/2014)
+//fpmaint2: 12 items, 11 spots 2 extra (28/08/2014)
+//fsmaint: 0 items, 0 spots 0 extra (08/08/2014)
+//fsmaint2: 40 items, 27 spots 5 extra (28/08/2014)
+//maintcentral: 2 items, 2 spots 0 extra (08/08/2014)
+//port: 5 items, 5 spots 0 extra (08/08/2014)
+
+GLOBAL_LIST_INIT(maintenance_loot, list(
+ /obj/item/bodybag = 1,
+ /obj/item/clothing/glasses/meson = 2,
+ /obj/item/clothing/glasses/sunglasses = 1,
+ /obj/item/clothing/gloves/color/fyellow = 1,
+ /obj/item/clothing/head/hardhat = 1,
+ /obj/item/clothing/head/hardhat/red = 1,
+ /obj/item/clothing/head/that = 1,
+ /obj/item/clothing/head/ushanka = 1,
+ /obj/item/clothing/head/welding = 1,
+ /obj/item/clothing/mask/gas = 15,
+ /obj/item/clothing/suit/hazardvest = 1,
+ /obj/item/clothing/under/rank/vice = 1,
+ /obj/item/device/assembly/prox_sensor = 4,
+ /obj/item/device/assembly/timer = 3,
+ /obj/item/device/flashlight = 4,
+ /obj/item/device/flashlight/pen = 1,
+ /obj/item/device/flashlight/glowstick/random = 4,
+ /obj/item/device/multitool = 2,
+ /obj/item/device/radio/off = 2,
+ /obj/item/device/t_scanner = 5,
+ /obj/item/weapon/airlock_painter = 1,
+ /obj/item/stack/cable_coil/random = 4,
+ /obj/item/stack/cable_coil/random/five = 6,
+ /obj/item/stack/medical/bruise_pack = 1,
+ /obj/item/stack/rods/ten = 9,
+ /obj/item/stack/rods/twentyfive = 1,
+ /obj/item/stack/rods/fifty = 1,
+ /obj/item/stack/sheet/cardboard = 2,
+ /obj/item/stack/sheet/metal/twenty = 1,
+ /obj/item/stack/sheet/mineral/plasma = 1,
+ /obj/item/stack/sheet/rglass = 1,
+ /obj/item/weapon/book/manual/wiki/engineering_construction = 1,
+ /obj/item/weapon/book/manual/wiki/engineering_hacking = 1,
+ /obj/item/clothing/head/cone = 1,
+ /obj/item/weapon/coin/silver = 1,
+ /obj/item/weapon/coin/twoheaded = 1,
+ /obj/item/weapon/poster/random_contraband = 1,
+ /obj/item/weapon/poster/random_official = 1,
+ /obj/item/weapon/crowbar = 1,
+ /obj/item/weapon/crowbar/red = 1,
+ /obj/item/weapon/extinguisher = 11,
+ //obj/item/weapon/gun/ballistic/revolver/russian = 1, //disabled until lootdrop is a proper world proc.
+ /obj/item/weapon/hand_labeler = 1,
+ /obj/item/weapon/paper/crumpled = 1,
+ /obj/item/weapon/pen = 1,
+ /obj/item/weapon/reagent_containers/spray/pestspray = 1,
+ /obj/item/weapon/reagent_containers/glass/rag = 3,
+ /obj/item/weapon/stock_parts/cell = 3,
+ /obj/item/weapon/storage/belt/utility = 2,
+ /obj/item/weapon/storage/box = 2,
+ /obj/item/weapon/storage/box/cups = 1,
+ /obj/item/weapon/storage/box/donkpockets = 1,
+ /obj/item/weapon/storage/box/lights/mixed = 3,
+ /obj/item/weapon/storage/box/hug/medical = 1,
+ /obj/item/weapon/storage/fancy/cigarettes/dromedaryco = 1,
+ /obj/item/weapon/storage/toolbox/mechanical = 1,
+ /obj/item/weapon/screwdriver = 3,
+ /obj/item/weapon/tank/internals/emergency_oxygen = 2,
+ /obj/item/weapon/vending_refill/cola = 1,
+ /obj/item/weapon/weldingtool = 3,
+ /obj/item/weapon/wirecutters = 1,
+ /obj/item/weapon/wrench = 4,
+ /obj/item/weapon/relic = 3,
+ /obj/item/weaponcrafting/receiver = 2,
+ /obj/item/clothing/head/cone = 2,
+ /obj/item/weapon/grenade/smokebomb = 2,
+ /obj/item/device/geiger_counter = 3,
+ /obj/item/weapon/reagent_containers/food/snacks/grown/citrus/orange = 1,
+ /obj/item/device/radio/headset = 1,
+ /obj/item/device/assembly/infra = 1,
+ /obj/item/device/assembly/igniter = 2,
+ /obj/item/device/assembly/signaler = 2,
+ /obj/item/device/assembly/mousetrap = 2,
+ /obj/item/weapon/reagent_containers/syringe = 2,
+ /obj/item/clothing/gloves/color/random = 8,
+ /obj/item/clothing/shoes/laceup = 1,
+ /obj/item/weapon/storage/secure/briefcase = 3,
+ /obj/item/weapon/storage/toolbox/artistic = 2,
+ /obj/item/toy/eightball = 1,
+ "" = 3
+ ))
diff --git a/code/controllers/subsystem.dm b/code/controllers/subsystem.dm
index dfa9984f38..f37a9159ef 100644
--- a/code/controllers/subsystem.dm
+++ b/code/controllers/subsystem.dm
@@ -2,7 +2,7 @@
/datum/controller/subsystem
// Metadata; you should define these.
name = "fire coderbus" //name of the subsystem
- var/init_order = 0 //order of initialization. Higher numbers are initialized first, lower numbers later. Can be decimal and negative values.
+ var/init_order = INIT_ORDER_DEFAULT //order of initialization. Higher numbers are initialized first, lower numbers later. Use defines in __DEFINES/subsystems.dm for easy understanding of order.
var/wait = 20 //time to wait (in deciseconds) between each call to fire(). Must be a positive integer.
var/priority = 50 //When mutiple subsystems need to run in the same tick, higher priority subsystems will run first and be given a higher share of the tick before MC_TICK_CHECK triggers a sleep
diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm
index 852e28077d..919b4cfce9 100644
--- a/code/controllers/subsystem/air.dm
+++ b/code/controllers/subsystem/air.dm
@@ -8,7 +8,7 @@
SUBSYSTEM_DEF(air)
name = "Air"
- init_order = -1
+ init_order = INIT_ORDER_AIR
priority = 20
wait = 5
flags = SS_BACKGROUND
diff --git a/code/controllers/subsystem/assets.dm b/code/controllers/subsystem/assets.dm
index ac8f51de0e..607b142c59 100644
--- a/code/controllers/subsystem/assets.dm
+++ b/code/controllers/subsystem/assets.dm
@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(assets)
name = "Assets"
- init_order = -3
+ init_order = INIT_ORDER_ASSETS
flags = SS_NO_FIRE
var/list/cache = list()
@@ -11,4 +11,4 @@ SUBSYSTEM_DEF(assets)
for(var/client/C in GLOB.clients)
addtimer(CALLBACK(GLOBAL_PROC, .proc/getFilesSlow, C, cache, FALSE), 10)
- ..()
\ No newline at end of file
+ ..()
diff --git a/code/controllers/subsystem/atoms.dm b/code/controllers/subsystem/atoms.dm
index e5cda98dd4..c687a7b0e5 100644
--- a/code/controllers/subsystem/atoms.dm
+++ b/code/controllers/subsystem/atoms.dm
@@ -4,7 +4,7 @@
SUBSYSTEM_DEF(atoms)
name = "Atoms"
- init_order = 11
+ init_order = INIT_ORDER_ATOMS
flags = SS_NO_FIRE
var/initialized = INITIALIZATION_INSSATOMS
diff --git a/code/controllers/subsystem/events.dm b/code/controllers/subsystem/events.dm
index cae880485c..b99b71ed33 100644
--- a/code/controllers/subsystem/events.dm
+++ b/code/controllers/subsystem/events.dm
@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(events)
name = "Events"
- init_order = 6
+ init_order = INIT_ORDER_EVENTS
var/list/control = list() //list of all datum/round_event_control. Used for selecting events based on weight and occurrences.
var/list/running = list() //list of all existing /datum/round_event
@@ -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/controllers/subsystem/icon_smooth.dm b/code/controllers/subsystem/icon_smooth.dm
index 83c5895018..84df089973 100644
--- a/code/controllers/subsystem/icon_smooth.dm
+++ b/code/controllers/subsystem/icon_smooth.dm
@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(icon_smooth)
name = "Icon Smoothing"
- init_order = -5
+ init_order = INIT_ORDER_ICON_SMOOTHING
wait = 1
priority = 35
flags = SS_TICKER
@@ -29,4 +29,4 @@ SUBSYSTEM_DEF(icon_smooth)
smooth_icon(A)
CHECK_TICK
- ..()
\ No newline at end of file
+ ..()
diff --git a/code/controllers/subsystem/ipintel.dm b/code/controllers/subsystem/ipintel.dm
index 0f351c8463..fca394924d 100644
--- a/code/controllers/subsystem/ipintel.dm
+++ b/code/controllers/subsystem/ipintel.dm
@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(ipintel)
name = "XKeyScore"
- init_order = -10
+ init_order = INIT_ORDER_XKEYSCORE
flags = SS_NO_FIRE
var/enabled = 0 //disable at round start to avoid checking reconnects
var/throttle = 0
diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm
index 517c72512c..68e27c9900 100644
--- a/code/controllers/subsystem/job.dm
+++ b/code/controllers/subsystem/job.dm
@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(job)
name = "Jobs"
- init_order = 14
+ init_order = INIT_ORDER_JOBS
flags = SS_NO_FIRE
var/list/occupations = list() //List of all jobs
diff --git a/code/controllers/subsystem/lighting.dm b/code/controllers/subsystem/lighting.dm
index 39147714ba..eb61e5ef39 100644
--- a/code/controllers/subsystem/lighting.dm
+++ b/code/controllers/subsystem/lighting.dm
@@ -5,7 +5,7 @@ GLOBAL_LIST_EMPTY(lighting_update_objects) // List of lighting objects queued fo
SUBSYSTEM_DEF(lighting)
name = "Lighting"
wait = 2
- init_order = -20
+ init_order = INIT_ORDER_LIGHTING
flags = SS_TICKER
var/initialized = FALSE
diff --git a/code/controllers/subsystem/machines.dm b/code/controllers/subsystem/machines.dm
index 9852752081..ab941eb1c6 100644
--- a/code/controllers/subsystem/machines.dm
+++ b/code/controllers/subsystem/machines.dm
@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(machines)
name = "Machines"
- init_order = 9
+ init_order = INIT_ORDER_MACHINES
flags = SS_KEEP_TIMING
var/list/processing = list()
var/list/currentrun = list()
@@ -61,4 +61,4 @@ SUBSYSTEM_DEF(machines)
if (istype(SSmachines.processing))
processing = SSmachines.processing
if (istype(SSmachines.powernets))
- powernets = SSmachines.powernets
\ No newline at end of file
+ powernets = SSmachines.powernets
diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm
index bae759ac3a..1499bc5029 100644
--- a/code/controllers/subsystem/mapping.dm
+++ b/code/controllers/subsystem/mapping.dm
@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(mapping)
name = "Mapping"
- init_order = 12
+ init_order = INIT_ORDER_MAPPING
flags = SS_NO_FIRE
var/list/nuke_tiles = list()
diff --git a/code/controllers/subsystem/minimap.dm b/code/controllers/subsystem/minimap.dm
index 6c3ce67dc2..10c6f8e5c4 100644
--- a/code/controllers/subsystem/minimap.dm
+++ b/code/controllers/subsystem/minimap.dm
@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(minimap)
name = "Minimap"
- init_order = -2
+ init_order = INIT_ORDER_MINIMAP
flags = SS_NO_FIRE
var/const/MINIMAP_SIZE = 2048
var/const/TILE_SIZE = 8
diff --git a/code/controllers/subsystem/mobs.dm b/code/controllers/subsystem/mobs.dm
index d9b78a77ad..f87b94bac4 100644
--- a/code/controllers/subsystem/mobs.dm
+++ b/code/controllers/subsystem/mobs.dm
@@ -1,6 +1,5 @@
SUBSYSTEM_DEF(mobs)
name = "Mobs"
- init_order = 4
priority = 100
flags = SS_KEEP_TIMING|SS_NO_INIT
@@ -26,4 +25,4 @@ SUBSYSTEM_DEF(mobs)
else
GLOB.mob_list.Remove(M)
if (MC_TICK_CHECK)
- return
\ No newline at end of file
+ return
diff --git a/code/controllers/subsystem/npcpool.dm b/code/controllers/subsystem/npcpool.dm
index d238bd2ab5..7bd412b823 100644
--- a/code/controllers/subsystem/npcpool.dm
+++ b/code/controllers/subsystem/npcpool.dm
@@ -11,7 +11,7 @@ SUBSYSTEM_DEF(npcpool)
var/list/canBeUsed = list()
var/list/needsDelegate = list()
var/list/needsAssistant = list()
-
+
var/list/processing = list()
var/list/currentrun = list()
var/stage
diff --git a/code/controllers/subsystem/persistence.dm b/code/controllers/subsystem/persistence.dm
index 80517d1e3a..e1cf992e8b 100644
--- a/code/controllers/subsystem/persistence.dm
+++ b/code/controllers/subsystem/persistence.dm
@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(persistence)
name = "Persistence"
- init_order = -100
+ init_order = INIT_ORDER_PERSISTENCE
flags = SS_NO_FIRE
var/savefile/secret_satchels
var/list/satchel_blacklist = list() //this is a typecache
diff --git a/code/controllers/subsystem/processing/overlays.dm b/code/controllers/subsystem/processing/overlays.dm
index c28dc245fa..1a42944bb5 100644
--- a/code/controllers/subsystem/processing/overlays.dm
+++ b/code/controllers/subsystem/processing/overlays.dm
@@ -3,7 +3,7 @@ PROCESSING_SUBSYSTEM_DEF(overlays)
flags = SS_TICKER|SS_FIRE_IN_LOBBY
wait = 1
priority = 500
- init_order = -6
+ init_order = INIT_ORDER_OVERLAY
stat_tag = "Ov"
currentrun = null
diff --git a/code/controllers/subsystem/radio.dm b/code/controllers/subsystem/radio.dm
index d69575f60f..de605cb554 100644
--- a/code/controllers/subsystem/radio.dm
+++ b/code/controllers/subsystem/radio.dm
@@ -1,6 +1,5 @@
SUBSYSTEM_DEF(radio)
name = "Radio"
- init_order = 18
flags = SS_NO_FIRE|SS_NO_INIT
var/list/datum/radio_frequency/frequencies = list()
@@ -39,4 +38,4 @@ SUBSYSTEM_DEF(radio)
frequency.frequency = new_frequency
frequencies[f_text] = frequency
- return frequency
\ No newline at end of file
+ return frequency
diff --git a/code/controllers/subsystem/religion.dm b/code/controllers/subsystem/religion.dm
index df772925d4..bba7dd082e 100644
--- a/code/controllers/subsystem/religion.dm
+++ b/code/controllers/subsystem/religion.dm
@@ -1,6 +1,5 @@
SUBSYSTEM_DEF(religion)
name = "Religion"
- init_order = 19
flags = SS_NO_FIRE|SS_NO_INIT
var/religion
@@ -8,4 +7,4 @@ SUBSYSTEM_DEF(religion)
var/bible_name
var/bible_icon_state
var/bible_item_state
- var/holy_weapon_type
\ No newline at end of file
+ var/holy_weapon_type
diff --git a/code/controllers/subsystem/shuttle.dm b/code/controllers/subsystem/shuttle.dm
index 66d1bdca92..b8d17cab87 100644
--- a/code/controllers/subsystem/shuttle.dm
+++ b/code/controllers/subsystem/shuttle.dm
@@ -3,7 +3,7 @@
SUBSYSTEM_DEF(shuttle)
name = "Shuttle"
wait = 10
- init_order = 3
+ init_order = INIT_ORDER_SHUTTLE
flags = SS_KEEP_TIMING|SS_NO_TICK_CHECK
var/list/mobile = list()
@@ -514,4 +514,4 @@ SUBSYSTEM_DEF(shuttle)
centcom_message = SSshuttle.centcom_message
ordernum = SSshuttle.ordernum
- points = SSshuttle.points
\ No newline at end of file
+ points = SSshuttle.points
diff --git a/code/controllers/subsystem/squeak.dm b/code/controllers/subsystem/squeak.dm
index d7ee9c31c2..eac81c1ffa 100644
--- a/code/controllers/subsystem/squeak.dm
+++ b/code/controllers/subsystem/squeak.dm
@@ -4,7 +4,7 @@
SUBSYSTEM_DEF(squeak)
name = "Squeak"
- priority = 40
+ init_order = INIT_ORDER_SQUEAK
flags = SS_NO_FIRE
var/list/exposed_wires = list()
diff --git a/code/controllers/subsystem/stickyban.dm b/code/controllers/subsystem/stickyban.dm
index b5702455b8..371cf22b3b 100644
--- a/code/controllers/subsystem/stickyban.dm
+++ b/code/controllers/subsystem/stickyban.dm
@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(stickyban)
name = "Sticky Ban"
- init_order = -10
+ init_order = INIT_ORDER_STICKY_BAN
flags = SS_NO_FIRE
var/list/cache = list()
diff --git a/code/controllers/subsystem/sun.dm b/code/controllers/subsystem/sun.dm
index 7f443aadc0..7a3528cc3d 100644
--- a/code/controllers/subsystem/sun.dm
+++ b/code/controllers/subsystem/sun.dm
@@ -1,7 +1,6 @@
SUBSYSTEM_DEF(sun)
name = "Sun"
wait = 600
- init_order = 2
flags = SS_NO_TICK_CHECK|SS_NO_INIT
var/angle
var/dx
diff --git a/code/controllers/subsystem/tgui.dm b/code/controllers/subsystem/tgui.dm
index edec49bcbb..862dfb0f98 100644
--- a/code/controllers/subsystem/tgui.dm
+++ b/code/controllers/subsystem/tgui.dm
@@ -1,7 +1,6 @@
SUBSYSTEM_DEF(tgui)
name = "tgui"
wait = 9
- init_order = 16
flags = SS_NO_INIT|SS_FIRE_IN_LOBBY
priority = 110
diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm
index c82bf8d366..f16e8c1ea0 100644
--- a/code/controllers/subsystem/ticker.dm
+++ b/code/controllers/subsystem/ticker.dm
@@ -2,7 +2,7 @@
SUBSYSTEM_DEF(ticker)
name = "Ticker"
- init_order = 13
+ init_order = INIT_ORDER_TICKER
priority = 200
flags = SS_FIRE_IN_LOBBY|SS_KEEP_TIMING
diff --git a/code/controllers/subsystem/timer.dm b/code/controllers/subsystem/timer.dm
index 6a63f090e5..55ebbfa352 100644
--- a/code/controllers/subsystem/timer.dm
+++ b/code/controllers/subsystem/timer.dm
@@ -4,7 +4,7 @@
SUBSYSTEM_DEF(timer)
name = "Timer"
wait = 1 //SS_TICKER subsystem, so wait is in ticks
- init_order = 1
+ init_order = INIT_ORDER_TIMER
flags = SS_FIRE_IN_LOBBY|SS_TICKER|SS_NO_INIT
diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm
index ba0eb13f67..ec4539e92e 100644
--- a/code/game/atoms_movable.dm
+++ b/code/game/atoms_movable.dm
@@ -124,6 +124,7 @@
var/datum/proximity_monitor/proximity_monitor = src.proximity_monitor
if(proximity_monitor)
proximity_monitor.HandleMove()
+
return 1
/atom/movable/proc/clean_on_move()
@@ -174,7 +175,7 @@
if(stationloving && force)
STOP_PROCESSING(SSinbounds, src)
-
+
QDEL_NULL(proximity_monitor)
. = ..()
@@ -625,4 +626,4 @@
/atom/movable/proc/ConveyorMove(movedir)
set waitfor = FALSE
if(!anchored && has_gravity())
- step(src, movedir)
\ No newline at end of file
+ step(src, movedir)
diff --git a/code/game/objects/effects/spawners/lootdrop.dm b/code/game/objects/effects/spawners/lootdrop.dm
index baf6383823..6403faa380 100644
--- a/code/game/objects/effects/spawners/lootdrop.dm
+++ b/code/game/objects/effects/spawners/lootdrop.dm
@@ -8,7 +8,6 @@
/obj/effect/spawner/lootdrop/Initialize(mapload)
..()
-
if(loot && loot.len)
var/turf/T = get_turf(src)
while(lootcount && loot.len)
@@ -57,114 +56,11 @@
/obj/effect/spawner/lootdrop/maintenance
name = "maintenance loot spawner"
+ // see code/_globalvars/lists/maintenance_loot.dm for loot table
- //How to balance this table
- //-------------------------
- //The total added weight of all the entries should be (roughly) equal to the total number of lootdrops
- //(take in account those that spawn more than one object!)
- //
- //While this is random, probabilities tells us that item distribution will have a tendency to look like
- //the content of the weighted table that created them.
- //The less lootdrops, the less even the distribution.
- //
- //If you want to give items a weight <1 you can multiply all the weights by 10
- //
- //the "" entry will spawn nothing, if you increase this value,
- //ensure that you balance it with more spawn points
-
- //table data:
- //-----------
- //aft maintenance: 24 items, 18 spots 2 extra (28/08/2014)
- //asmaint: 16 items, 11 spots 0 extra (08/08/2014)
- //asmaint2: 36 items, 26 spots 2 extra (28/08/2014)
- //fpmaint: 5 items, 4 spots 0 extra (08/08/2014)
- //fpmaint2: 12 items, 11 spots 2 extra (28/08/2014)
- //fsmaint: 0 items, 0 spots 0 extra (08/08/2014)
- //fsmaint2: 40 items, 27 spots 5 extra (28/08/2014)
- //maintcentral: 2 items, 2 spots 0 extra (08/08/2014)
- //port: 5 items, 5 spots 0 extra (08/08/2014)
- loot = list(
- /obj/item/bodybag = 1,
- /obj/item/clothing/glasses/meson = 2,
- /obj/item/clothing/glasses/sunglasses = 1,
- /obj/item/clothing/gloves/color/fyellow = 1,
- /obj/item/clothing/head/hardhat = 1,
- /obj/item/clothing/head/hardhat/red = 1,
- /obj/item/clothing/head/that = 1,
- /obj/item/clothing/head/ushanka = 1,
- /obj/item/clothing/head/welding = 1,
- /obj/item/clothing/mask/gas = 15,
- /obj/item/clothing/suit/hazardvest = 1,
- /obj/item/clothing/under/rank/vice = 1,
- /obj/item/device/assembly/prox_sensor = 4,
- /obj/item/device/assembly/timer = 3,
- /obj/item/device/flashlight = 4,
- /obj/item/device/flashlight/pen = 1,
- /obj/item/device/flashlight/glowstick/random = 4,
- /obj/item/device/multitool = 2,
- /obj/item/device/radio/off = 2,
- /obj/item/device/t_scanner = 5,
- /obj/item/weapon/airlock_painter = 1,
- /obj/item/stack/cable_coil/random = 4,
- /obj/item/stack/cable_coil/random{amount = 5} = 6,
- /obj/item/stack/medical/bruise_pack = 1,
- /obj/item/stack/rods{amount = 10} = 9,
- /obj/item/stack/rods{amount = 23} = 1,
- /obj/item/stack/rods{amount = 50} = 1,
- /obj/item/stack/sheet/cardboard = 2,
- /obj/item/stack/sheet/metal{amount = 20} = 1,
- /obj/item/stack/sheet/mineral/plasma = 1,
- /obj/item/stack/sheet/rglass = 1,
- /obj/item/weapon/book/manual/wiki/engineering_construction = 1,
- /obj/item/weapon/book/manual/wiki/engineering_hacking = 1,
- /obj/item/clothing/head/cone = 1,
- /obj/item/weapon/coin/silver = 1,
- /obj/item/weapon/coin/twoheaded = 1,
- /obj/item/weapon/poster/random_contraband = 1,
- /obj/item/weapon/poster/random_official = 1,
- /obj/item/weapon/crowbar = 1,
- /obj/item/weapon/crowbar/red = 1,
- /obj/item/weapon/extinguisher = 11,
- //obj/item/weapon/gun/ballistic/revolver/russian = 1, //disabled until lootdrop is a proper world proc.
- /obj/item/weapon/hand_labeler = 1,
- /obj/item/weapon/paper/crumpled = 1,
- /obj/item/weapon/pen = 1,
- /obj/item/weapon/reagent_containers/spray/pestspray = 1,
- /obj/item/weapon/reagent_containers/glass/rag = 3,
- /obj/item/weapon/stock_parts/cell = 3,
- /obj/item/weapon/storage/belt/utility = 2,
- /obj/item/weapon/storage/box = 2,
- /obj/item/weapon/storage/box/cups = 1,
- /obj/item/weapon/storage/box/donkpockets = 1,
- /obj/item/weapon/storage/box/lights/mixed = 3,
- /obj/item/weapon/storage/box/hug/medical = 1,
- /obj/item/weapon/storage/fancy/cigarettes/dromedaryco = 1,
- /obj/item/weapon/storage/toolbox/mechanical = 1,
- /obj/item/weapon/screwdriver = 3,
- /obj/item/weapon/tank/internals/emergency_oxygen = 2,
- /obj/item/weapon/vending_refill/cola = 1,
- /obj/item/weapon/weldingtool = 3,
- /obj/item/weapon/wirecutters = 1,
- /obj/item/weapon/wrench = 4,
- /obj/item/weapon/relic = 3,
- /obj/item/weaponcrafting/receiver = 2,
- /obj/item/clothing/head/cone = 2,
- /obj/item/weapon/grenade/smokebomb = 2,
- /obj/item/device/geiger_counter = 3,
- /obj/item/weapon/reagent_containers/food/snacks/grown/citrus/orange = 1,
- /obj/item/device/radio/headset = 1,
- /obj/item/device/assembly/infra = 1,
- /obj/item/device/assembly/igniter = 2,
- /obj/item/device/assembly/signaler = 2,
- /obj/item/device/assembly/mousetrap = 2,
- /obj/item/weapon/reagent_containers/syringe = 2,
- /obj/item/clothing/gloves/color/random = 8,
- /obj/item/clothing/shoes/laceup = 1,
- /obj/item/weapon/storage/secure/briefcase = 3,
- /obj/item/weapon/storage/toolbox/artistic = 2,
- /obj/item/toy/eightball = 1,
- "" = 3
- )
+/obj/effect/spawner/lootdrop/maintenance/Initialize(mapload)
+ loot = GLOB.maintenance_loot
+ ..()
/obj/effect/spawner/lootdrop/crate_spawner
name = "lootcrate spawner" //USE PROMO CODE "SELLOUT" FOR 20% OFF!
diff --git a/code/game/objects/items/charter.dm b/code/game/objects/items/charter.dm
index 98e03ef18c..41a793df30 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/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm
index 4ebafdff30..1a8257fd79 100644
--- a/code/game/objects/items/stacks/rods.dm
+++ b/code/game/objects/items/stacks/rods.dm
@@ -73,3 +73,12 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
/obj/item/stack/rods/cyborg/update_icon()
return
+
+/obj/item/stack/rods/ten
+ amount = 10
+
+/obj/item/stack/rods/twentyfive
+ amount = 25
+
+/obj/item/stack/rods/fifty
+ amount = 50
diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm
index dbd2de2e75..4abba7a431 100644
--- a/code/game/objects/items/stacks/sheets/sheet_types.dm
+++ b/code/game/objects/items/stacks/sheets/sheet_types.dm
@@ -78,6 +78,9 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
/obj/item/stack/sheet/metal/fifty
amount = 50
+/obj/item/stack/sheet/metal/twenty
+ amount = 20
+
/obj/item/stack/sheet/metal/five
amount = 5
diff --git a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm
index 74e024472b..7f0479eac9 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 c5f74ed68e..e29888f888 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/easter.dm b/code/modules/holiday/easter.dm
index 29172c9b68..067162be8c 100644
--- a/code/modules/holiday/easter.dm
+++ b/code/modules/holiday/easter.dm
@@ -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
diff --git a/code/modules/holiday/holidays.dm b/code/modules/holiday/holidays.dm
index 29d5fd7c28..a73b9efa53 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")
@@ -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)
diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm
index b5b6165699..653e3296f4 100644
--- a/code/modules/power/cable.dm
+++ b/code/modules/power/cable.dm
@@ -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
diff --git a/tgstation.dme b/tgstation.dme
index a0fdb99991..c5c8152236 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -106,6 +106,7 @@
#include "code\_globalvars\misc.dm"
#include "code\_globalvars\sensitive.dm"
#include "code\_globalvars\lists\flavor_misc.dm"
+#include "code\_globalvars\lists\maintenance_loot.dm"
#include "code\_globalvars\lists\mapping.dm"
#include "code\_globalvars\lists\mobs.dm"
#include "code\_globalvars\lists\names.dm"