diff --git a/_maps/icebox.json b/_maps/icebox.json index 5dd03f211a6..8d92973121d 100644 --- a/_maps/icebox.json +++ b/_maps/icebox.json @@ -18,7 +18,8 @@ "Linkage": null, "Gravity": true, "Ice Ruins Underground": true, - "Baseturf": "/turf/open/lava/plasma/ice_moon" + "Baseturf": "/turf/open/lava/plasma/ice_moon", + "No Parallax": true }, { "Down": -1, @@ -27,7 +28,8 @@ "Linkage": null, "Gravity": true, "Ice Ruins Underground": true, - "Baseturf": "/turf/open/openspace/icemoon/keep_below" + "Baseturf": "/turf/open/openspace/icemoon/keep_below", + "No Parallax": true }, { "Down": -1, @@ -36,7 +38,8 @@ "Gravity": true, "Ice Ruins": true, "Weather_Snowstorm": true, - "Baseturf": "/turf/open/openspace/icemoon/keep_below" + "Baseturf": "/turf/open/openspace/icemoon/keep_below", + "No Parallax": true } ], "minetype": "none", diff --git a/code/__DEFINES/maps.dm b/code/__DEFINES/maps.dm index 015b62621be..c21a10fb7f5 100644 --- a/code/__DEFINES/maps.dm +++ b/code/__DEFINES/maps.dm @@ -120,6 +120,9 @@ Always compile, always use that verb, and always make sure that it works for wha // string - type path of the z-level's baseturf (defaults to space) #define ZTRAIT_BASETURF "Baseturf" +///boolean - does this z disable parallax? +#define ZTRAIT_NOPARALLAX "No Parallax" + // default trait definitions, used by SSmapping ///Z level traits for CentCom #define ZTRAITS_CENTCOM list(ZTRAIT_CENTCOM = TRUE, ZTRAIT_NOPHASE = TRUE) @@ -130,6 +133,7 @@ Always compile, always use that verb, and always make sure that it works for wha ///Z level traits for Lavaland #define ZTRAITS_LAVALAND list(\ ZTRAIT_MINING = TRUE, \ + ZTRAIT_NOPARALLAX = TRUE, \ ZTRAIT_ASHSTORM = TRUE, \ ZTRAIT_LAVA_RUINS = TRUE, \ ZTRAIT_BOMBCAP_MULTIPLIER = 2, \ diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index 2c3e1485cf3..feced69db09 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -117,6 +117,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list( owner.overlay_fullscreen("see_through_darkness", /atom/movable/screen/fullscreen/see_through_darkness) + AddComponent(/datum/component/zparallax, owner.client) + /datum/hud/Destroy() if(mymob.hud_used == src) mymob.hud_used = null diff --git a/code/_onclick/hud/parallax.dm b/code/_onclick/hud/parallax.dm index 47cb3645cf3..5274972a183 100755 --- a/code/_onclick/hud/parallax.dm +++ b/code/_onclick/hud/parallax.dm @@ -47,6 +47,8 @@ /datum/hud/proc/apply_parallax_pref(mob/viewmob) var/mob/screenmob = viewmob || mymob + if(SSmapping.level_trait(screenmob.z, ZTRAIT_NOPARALLAX)) + return FALSE if (SSlag_switch.measures[DISABLE_PARALLAX] && !HAS_TRAIT(viewmob, TRAIT_BYPASS_MEASURES)) return FALSE diff --git a/code/controllers/subsystem/mapping.dm b/code/controllers/subsystem/mapping.dm index c798b316878..054f7b7c457 100644 --- a/code/controllers/subsystem/mapping.dm +++ b/code/controllers/subsystem/mapping.dm @@ -67,6 +67,7 @@ SUBSYSTEM_DEF(mapping) config = old_config initialize_biomes() loadWorld() + determine_fake_sale() repopulate_sorted_areas() process_teleport_locs() //Sets up the wizard teleport locations preloadTemplates() @@ -189,6 +190,13 @@ Used by the AI doomsday and the self-destruct nuke. var/turf/open/floor/circuit/C = N C.update_appearance() +/datum/controller/subsystem/mapping/proc/determine_fake_sale() + if(length(SSmapping.levels_by_all_traits(list(ZTRAIT_STATION, ZTRAIT_NOPARALLAX)))) + GLOB.arcade_prize_pool += /obj/item/stack/tile/fakeice/loaded + else + GLOB.arcade_prize_pool += /obj/item/stack/tile/fakespace/loaded + + /datum/controller/subsystem/mapping/Recover() flags |= SS_NO_INIT initialized = SSmapping.initialized diff --git a/code/datums/components/z_parallax.dm b/code/datums/components/z_parallax.dm new file mode 100644 index 00000000000..258d177440b --- /dev/null +++ b/code/datums/components/z_parallax.dm @@ -0,0 +1,60 @@ +/** + * Component that hooks into the client, listens for COMSIG_MOVABLE_Z_CHANGED, and depending on whether or not the + * Z-level has ZTRAIT_NOPARALLAX enabled, disable or reenable parallax. + */ + +/datum/component/zparallax + dupe_mode = COMPONENT_DUPE_UNIQUE + + var/client/tracked + var/mob/client_mob + +/datum/component/zparallax/Initialize(client/tracked) + . = ..() + if(!istype(tracked)) + stack_trace("Component zparallax has been initialized outside of a client. Deleting.") + return COMPONENT_INCOMPATIBLE + + src.tracked = tracked + client_mob = tracked.mob + + RegisterSignal(client_mob, COMSIG_MOB_LOGOUT, .proc/mob_change) + RegisterSignal(client_mob, COMSIG_MOVABLE_Z_CHANGED, .proc/ztrait_checks) + RegisterSignal(client_mob, COMSIG_MOB_LOGIN, .proc/refresh_client) + +/datum/component/zparallax/Destroy() + . = ..() + unregister_signals() + + tracked = null + client_mob = null + +/datum/component/zparallax/proc/unregister_signals() + if(!client_mob) + return + + UnregisterSignal(client_mob, list(COMSIG_MOB_LOGOUT, COMSIG_MOVABLE_Z_CHANGED)) + +/datum/component/zparallax/proc/refresh_client() + tracked = client_mob.client + +/datum/component/zparallax/proc/mob_change() + SIGNAL_HANDLER + + if(client_mob.key) + return + + unregister_signals() + + client_mob = tracked.mob + + RegisterSignal(client_mob, COMSIG_MOB_LOGOUT, .proc/mob_change) + RegisterSignal(client_mob, COMSIG_MOVABLE_Z_CHANGED, .proc/ztrait_checks) + RegisterSignal(client_mob, COMSIG_MOB_LOGIN, .proc/refresh_client) + +/datum/component/zparallax/proc/ztrait_checks() + SIGNAL_HANDLER + + var/datum/hud/hud = client_mob.hud_used + + hud.update_parallax_pref(client_mob) diff --git a/code/game/machinery/computer/arcade/arcade.dm b/code/game/machinery/computer/arcade/arcade.dm index 1f6e3ecb07d..a5060704ce7 100644 --- a/code/game/machinery/computer/arcade/arcade.dm +++ b/code/game/machinery/computer/arcade/arcade.dm @@ -35,7 +35,6 @@ GLOBAL_LIST_INIT(arcade_prize_pool, list( /obj/item/toy/talking/owl = 2, /obj/item/toy/talking/griffin = 2, /obj/item/coin/antagtoken = 2, - /obj/item/stack/tile/fakespace/loaded = 2, /obj/item/stack/tile/fakepit/loaded = 2, /obj/item/stack/tile/eighties/loaded = 2, /obj/item/toy/toy_xeno = 2, diff --git a/code/game/objects/items/stacks/tiles/tile_types.dm b/code/game/objects/items/stacks/tiles/tile_types.dm index 3d8419283b4..4277eb55f5a 100644 --- a/code/game/objects/items/stacks/tiles/tile_types.dm +++ b/code/game/objects/items/stacks/tiles/tile_types.dm @@ -1,6 +1,6 @@ /** * TILE STACKS - * + * * Allows us to place a turf on a plating. */ /obj/item/stack/tile @@ -65,7 +65,7 @@ /** * Place our tile on a plating, or replace it. - * + * * Arguments: * * target_plating - Instance of the plating we want to place on. Replaced during sucessful executions. * * user - The mob doing the placing. @@ -970,6 +970,19 @@ /obj/item/stack/tile/fakepit/loaded amount = 30 +/obj/item/stack/tile/fakeice + name = "fake ice" + singular_name = "fake ice tile" + desc = "A piece of tile with a convincing ice pattern." + icon_state = "tile_ice" + inhand_icon_state = "tile-diamond" + turf_type = /turf/open/floor/fakeice + resistance_flags = FLAMMABLE + merge_type = /obj/item/stack/tile/fakeice + +/obj/item/stack/tile/fakeice/loaded + amount = 30 + //High-traction /obj/item/stack/tile/noslip name = "high-traction floor tile" diff --git a/code/game/turfs/open/floor/fancy_floor.dm b/code/game/turfs/open/floor/fancy_floor.dm index d0be8a5e753..03c5442957e 100644 --- a/code/game/turfs/open/floor/fancy_floor.dm +++ b/code/game/turfs/open/floor/fancy_floor.dm @@ -772,6 +772,12 @@ underlay_appearance.icon_state = "basalt" return TRUE +/turf/open/floor/fakeice + desc = "Is it marble, polished to a mirror finish? Or just really, really grippy ice?" + icon = 'icons/turf/floors/ice_turf.dmi' + icon_state = "ice_turf-0" + base_icon_state = "ice_turf-0" + /turf/open/floor/fakespace icon = 'icons/turf/space.dmi' icon_state = "0" diff --git a/code/modules/mapping/space_management/traits.dm b/code/modules/mapping/space_management/traits.dm index cd53a3632da..b53e2ee332a 100644 --- a/code/modules/mapping/space_management/traits.dm +++ b/code/modules/mapping/space_management/traits.dm @@ -31,23 +31,29 @@ /// Get a list of all z which have the specified trait /datum/controller/subsystem/mapping/proc/levels_by_trait(trait) - . = list() - var/list/_z_list = z_list - for(var/A in _z_list) - var/datum/space_level/S = A - if (S.traits[trait]) - . += S.z_value + var/list/final_return = list() + for(var/datum/space_level/level as anything in z_list) + if (level.traits[trait]) + final_return += level.z_value + return final_return /// Get a list of all z which have any of the specified traits /datum/controller/subsystem/mapping/proc/levels_by_any_trait(list/traits) - . = list() - var/list/_z_list = z_list - for(var/A in _z_list) - var/datum/space_level/S = A + var/list/final_return = list() + for(var/datum/space_level/level as anything in z_list) for (var/trait in traits) - if (S.traits[trait]) - . += S.z_value + if (level.traits[trait]) + final_return += level.z_value break + return final_return + +/// Get a list of all z which have all of the specified traits +/datum/controller/subsystem/mapping/proc/levels_by_all_traits(list/traits) + var/list/final_return = list() + for(var/datum/space_level/level as anything in z_list) + if(level_has_all_traits(level.z_value, traits)) + final_return += level.z_value + return final_return /// Attempt to get the turf below the provided one according to Z traits /datum/controller/subsystem/mapping/proc/get_turf_below(turf/T) diff --git a/icons/obj/tiles.dmi b/icons/obj/tiles.dmi index ca3971556ae..cf7b64830c4 100644 Binary files a/icons/obj/tiles.dmi and b/icons/obj/tiles.dmi differ diff --git a/tgstation.dme b/tgstation.dme index 2d098f298b9..ac13d97a207 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -810,6 +810,7 @@ #include "code\datums\components\vacuum.dm" #include "code\datums\components\wearertargeting.dm" #include "code\datums\components\wet_floor.dm" +#include "code\datums\components\z_parallax.dm" #include "code\datums\components\container_item\container_item.dm" #include "code\datums\components\container_item\tank_holder.dm" #include "code\datums\components\crafting\crafting.dm"