Skip to content
This repository has been archived by the owner on Oct 7, 2018. It is now read-only.

Port Many prs v2 #222

Merged
merged 3 commits into from Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions code/__DEFINES/components.dm
Expand Up @@ -5,7 +5,7 @@
// How multiple components of the exact same type are handled in the same datum

#define COMPONENT_DUPE_HIGHLANDER 0 //old component is deleted (default)
#define COMPONENT_DUPE_ALLOWED 1 //duplicates allowed
#define COMPONENT_DUPE_ALLOWED 1 //duplicates allowed
#define COMPONENT_DUPE_UNIQUE 2 //new component is deleted

// All signals. Format:
Expand All @@ -14,5 +14,7 @@
#define COMSIG_COMPONENT_ADDED "component_added" //when a component is added to a datum: (datum/component)
#define COMSIG_COMPONENT_REMOVING "component_removing" //before a component is removed from a datum because of RemoveComponent: (datum/component)
#define COMSIG_PARENT_QDELETED "parent_qdeleted" //before a datum's Destroy() is called: ()
#define COMSIG_ATOM_ENTERED "atom_entered" //from base of atom/Entered(): (atom/movable, atom)
#define COMSIG_MOVABLE_CROSSED "movable_crossed" //from base of atom/movable/Crossed(): (atom/movable)
#define COMSIG_PARENT_ATTACKBY "atom_attackby" //from the base of atom/attackby: (obj/item, mob/living, params)
#define COMSIG_PARENT_EXAMINE "atom_examine" //from the base of atom/examine: (mob)
#define COMSIG_ATOM_ENTERED "atom_entered" //from base of atom/Entered(): (atom/movable, atom)
#define COMSIG_MOVABLE_CROSSED "movable_crossed" //from base of atom/movable/Crossed(): (atom/movable)
3 changes: 3 additions & 0 deletions code/__DEFINES/flags.dm
Expand Up @@ -53,6 +53,9 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204
// TESLA_IGNORE grants immunity from being targeted by tesla-style electricity
#define TESLA_IGNORE_2 512

// Stops you from putting things like an RCD or other items into an ORM or protolathe for materials.
#define NO_MAT_REDEMPTION_2 1024

//turf-only flags
#define NOJAUNT_1 1
#define UNUSED_TRANSIT_TURF_1 2
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/maps.dm
Expand Up @@ -35,7 +35,7 @@ Last space-z level = empty

//zlevel defines, can be overridden for different maps in the appropriate _maps file.
#define ZLEVEL_CENTCOM 1
#define ZLEVEL_STATION 2
#define ZLEVEL_STATION_PRIMARY 2
#define ZLEVEL_MINING 5
#define ZLEVEL_LAVALAND 5
#define ZLEVEL_EMPTY_SPACE 12
Expand Down
2 changes: 1 addition & 1 deletion code/__HELPERS/priority_announce.dm
Expand Up @@ -39,7 +39,7 @@
priority_announce("A report has been downloaded and printed out at all communications consoles.", "Incoming Classified Message", 'sound/ai/commandreport.ogg')

for(var/obj/machinery/computer/communications/C in GLOB.machines)
if(!(C.stat & (BROKEN|NOPOWER)) && C.z == ZLEVEL_STATION)
if(!(C.stat & (BROKEN|NOPOWER)) && (C.z in GLOB.station_z_levels))
var/obj/item/paper/P = new /obj/item/paper(C.loc)
P.name = "paper - '[title]'"
P.info = text
Expand Down
2 changes: 2 additions & 0 deletions code/_globalvars/lists/mapping.dm
Expand Up @@ -14,6 +14,8 @@ GLOBAL_LIST_INIT(diagonals, list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST))
//Go away Urist, I'm restoring this to the longer list. ~Errorage
GLOBAL_LIST_INIT(accessable_z_levels, list(1,3,4,5,6,7)) //Keep this to six maps, repeating z-levels is ok if needed

GLOBAL_LIST_INIT(station_z_levels, list(ZLEVEL_STATION_PRIMARY))

GLOBAL_LIST(global_map)
//list/global_map = list(list(1,5),list(4,3))//an array of map Z levels.
//Resulting sector map looks like
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/item_attack.dm
Expand Up @@ -16,10 +16,10 @@

// No comment
/atom/proc/attackby(obj/item/W, mob/user, params)
return
return SendSignal(COMSIG_PARENT_ATTACKBY, W, user, params)

/obj/attackby(obj/item/I, mob/living/user, params)
return I.attack_obj(src, user)
return ..() || I.attack_obj(src, user)

/mob/living/attackby(obj/item/I, mob/user, params)
user.changeNext_move(CLICK_CD_MELEE)
Expand Down
3 changes: 3 additions & 0 deletions code/controllers/subsystem/augury.dm
Expand Up @@ -14,6 +14,9 @@ SUBSYSTEM_DEF(augury)
/datum/controller/subsystem/augury/proc/register_doom(atom/A, severity)
doombringers[A] = severity

/datum/controller/subsystem/augury/proc/unregister_doom(atom/A)
doombringers -= A

/datum/controller/subsystem/augury/fire()
var/biggest_doom = null
var/biggest_threat = null
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/mapping.dm
Expand Up @@ -117,7 +117,7 @@ SUBSYSTEM_DEF(mapping)
var/start_time = REALTIMEOFDAY

INIT_ANNOUNCE("Loading [config.map_name]...")
TryLoadZ(config.GetFullMapPath(), FailedZs, ZLEVEL_STATION)
TryLoadZ(config.GetFullMapPath(), FailedZs, ZLEVEL_STATION_PRIMARY)
INIT_ANNOUNCE("Loaded station in [(REALTIMEOFDAY - start_time)/10]s!")
if(SSdbcore.Connect())
var/datum/DBQuery/query_round_map_name = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET map_name = '[config.map_name]' WHERE id = [GLOB.round_id]")
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/minimap.dm
Expand Up @@ -5,7 +5,7 @@ SUBSYSTEM_DEF(minimap)
var/const/MINIMAP_SIZE = 2048
var/const/TILE_SIZE = 8

var/list/z_levels = list(ZLEVEL_STATION)
var/list/z_levels = list(ZLEVEL_STATION_PRIMARY)

/datum/controller/subsystem/minimap/Initialize(timeofday)
var/hash = md5(SSmapping.config.GetFullMapPath())
Expand Down
6 changes: 3 additions & 3 deletions code/controllers/subsystem/persistence.dm
Expand Up @@ -36,7 +36,7 @@ SUBSYSTEM_DEF(persistence)
expanded_old_satchels.len = 0

var/list/free_satchels = list()
for(var/turf/T in shuffle(block(locate(TRANSITIONEDGE,TRANSITIONEDGE,ZLEVEL_STATION), locate(world.maxx-TRANSITIONEDGE,world.maxy-TRANSITIONEDGE,ZLEVEL_STATION)))) //Nontrivially expensive but it's roundstart only
for(var/turf/T in shuffle(block(locate(TRANSITIONEDGE,TRANSITIONEDGE,ZLEVEL_STATION_PRIMARY), locate(world.maxx-TRANSITIONEDGE,world.maxy-TRANSITIONEDGE,ZLEVEL_STATION_PRIMARY)))) //Nontrivially expensive but it's roundstart only
if(isfloorturf(T) && !istype(T, /turf/open/floor/plating/))
free_satchels += new /obj/item/storage/backpack/satchel/flat/secret(T)
if(!isemptylist(free_satchels) && ((free_satchels.len + placed_satchels) >= (50 - expanded_old_satchels.len) * 0.1)) //up to six tiles, more than enough to kill anything that moves
Expand All @@ -62,7 +62,7 @@ SUBSYSTEM_DEF(persistence)
var/obj/item/storage/backpack/satchel/flat/F = new()
F.x = text2num(chosen_satchel[1])
F.y = text2num(chosen_satchel[2])
F.z = ZLEVEL_STATION
F.z = ZLEVEL_STATION_PRIMARY
if(isfloorturf(F.loc) && !istype(F.loc, /turf/open/floor/plating/))
F.hide(1)
new path(F)
Expand Down Expand Up @@ -158,7 +158,7 @@ SUBSYSTEM_DEF(persistence)
/datum/controller/subsystem/persistence/proc/CollectSecretSatchels()
for(var/A in new_secret_satchels)
var/obj/item/storage/backpack/satchel/flat/F = A
if(QDELETED(F) || F.z != ZLEVEL_STATION || F.invisibility != INVISIBILITY_MAXIMUM)
if(QDELETED(F) || F.z != ZLEVEL_STATION_PRIMARY || F.invisibility != INVISIBILITY_MAXIMUM)
continue
var/list/savable_obj = list()
for(var/obj/O in F)
Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/shuttle.dm
Expand Up @@ -288,7 +288,7 @@ SUBSYSTEM_DEF(shuttle)
continue

var/turf/T = get_turf(thing)
if(T && T.z == ZLEVEL_STATION)
if(T && (T.z in GLOB.station_z_levels))
callShuttle = 0
break

Expand Down
2 changes: 1 addition & 1 deletion code/controllers/subsystem/ticker.dm
Expand Up @@ -392,7 +392,7 @@ SUBSYSTEM_DEF(ticker)
if(bomb && bomb.loc)
bombloc = bomb.z
else if(!station_missed)
bombloc = ZLEVEL_STATION
bombloc = ZLEVEL_STATION_PRIMARY

if(mode)
mode.explosion_in_progress = 0
Expand Down
2 changes: 1 addition & 1 deletion code/datums/antagonists/datum_cult.dm
Expand Up @@ -40,7 +40,7 @@
if(!GLOB.summon_spots.len)
while(GLOB.summon_spots.len < SUMMON_POSSIBILITIES)
var/area/summon = pick(GLOB.sortedAreas - GLOB.summon_spots)
if(summon && (summon.z == ZLEVEL_STATION) && summon.valid_territory)
if(summon && (summon.z in GLOB.station_z_levels) && summon.valid_territory)
GLOB.summon_spots += summon
SSticker.mode.cult_objectives += "eldergod"

Expand Down