From cf298ddad8570fe6a3908530b9be87795d038584 Mon Sep 17 00:00:00 2001 From: Matt Atlas Date: Sat, 13 Jan 2024 23:41:18 +0100 Subject: [PATCH] Fixes window panes, suppressors, exoplanet runtimes. (#18195) Co-authored-by: Matt Atlas --- code/__DEFINES/flags.dm | 2 + code/_onclick/adjacent.dm | 4 +- code/modules/multiz/structures.dm | 8 ++-- code/modules/overmap/exoplanets/exoplanet.dm | 12 +++++- .../overmap/exoplanets/exoplanet_flora.dm | 29 +++++++++---- code/modules/projectiles/gun.dm | 18 +++++--- code/modules/projectiles/guns/projectile.dm | 9 ++-- html/changelogs/mattatlas-fixespt1.yml | 43 +++++++++++++++++++ 8 files changed, 100 insertions(+), 25 deletions(-) create mode 100644 html/changelogs/mattatlas-fixespt1.yml diff --git a/code/__DEFINES/flags.dm b/code/__DEFINES/flags.dm index 556c9ffc736..2a2cd122f83 100644 --- a/code/__DEFINES/flags.dm +++ b/code/__DEFINES/flags.dm @@ -43,6 +43,8 @@ var/list/mimic_defines = list( #define ATOM_FLAG_POUR_CONTAINER FLAG(5) /// Should we use the initial icon for display? Mostly used by overlay only objects #define ATOM_FLAG_HTML_USE_INITIAL_ICON FLAG(6) +/// If a dense atom like a platform does not allow movement through it like a window pane BUT allows pickup. +#define ATOM_FLAG_ALWAYS_ALLOW_PICKUP FLAG(7) // Movable flags. diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm index 692dc5ead1b..583c879cff0 100644 --- a/code/_onclick/adjacent.dm +++ b/code/_onclick/adjacent.dm @@ -130,7 +130,9 @@ Quick adjacency (to turf): var/obj/structure/window/W = target_atom if(!W.is_fulltile()) //exception for breaking full tile windows on top of single pane windows return FALSE - return TRUE + if(O.atom_flags & ATOM_FLAG_ALWAYS_ALLOW_PICKUP) + return TRUE + return FALSE else if(!border_only) // dense, not on border, cannot pass over return FALSE return TRUE diff --git a/code/modules/multiz/structures.dm b/code/modules/multiz/structures.dm index 42b5aa3e0bf..a0c1fa4f310 100644 --- a/code/modules/multiz/structures.dm +++ b/code/modules/multiz/structures.dm @@ -371,12 +371,12 @@ /obj/structure/platform name = "platform" desc = "An archaic method of preventing travel along the X and Y axes if you are on a lower point on the Z-axis." - density = TRUE - anchored = TRUE - atom_flags = ATOM_FLAG_CHECKS_BORDER - climbable = TRUE icon = 'icons/obj/structure/platforms.dmi' icon_state = "platform" + density = TRUE + anchored = TRUE + atom_flags = ATOM_FLAG_CHECKS_BORDER|ATOM_FLAG_ALWAYS_ALLOW_PICKUP + climbable = TRUE color = COLOR_TILED /obj/structure/platform/dark diff --git a/code/modules/overmap/exoplanets/exoplanet.dm b/code/modules/overmap/exoplanets/exoplanet.dm index 44ea224305e..8c7e03a2450 100644 --- a/code/modules/overmap/exoplanets/exoplanet.dm +++ b/code/modules/overmap/exoplanets/exoplanet.dm @@ -37,8 +37,16 @@ var/flora_diversity = 0 var/has_trees = FALSE - var/list/small_flora_types = list() - var/list/big_flora_types = list() + + /// For generating seeds to put in big_flora_seeds. + var/list/small_flora_types + /// For generating seeds to put in small_flora_seeds. + var/list/big_flora_types + + /// This is a list of seed OBJECTS. Not types. + var/list/small_flora_seeds = list() + /// This is a list of seed OBJECTS. Not types. + var/list/big_flora_seeds = list() var/repopulating = 0 var/repopulate_types = list() // animals which have died that may come back diff --git a/code/modules/overmap/exoplanets/exoplanet_flora.dm b/code/modules/overmap/exoplanets/exoplanet_flora.dm index e9442faf968..ee6f41523b6 100644 --- a/code/modules/overmap/exoplanets/exoplanet_flora.dm +++ b/code/modules/overmap/exoplanets/exoplanet_flora.dm @@ -2,6 +2,18 @@ if(flora_diversity == 0) return + /// Generate custom seeds for lore planets. + if(islist(small_flora_types) && length(small_flora_types)) + for(var/seed_type in small_flora_types) + var/datum/seed/S = new seed_type() + small_flora_types += S + + if(islist(big_flora_types) && length(big_flora_types)) + for(var/seed_type in big_flora_types) + var/datum/seed/S = new seed_type() + big_flora_types += S + + /// Now, generate random seeds for normal planets. for(var/i = 1 to flora_diversity) var/datum/seed/S = new() if(atmosphere?.gas) @@ -16,7 +28,8 @@ color = get_random_colour(0,75,190) S.set_trait(TRAIT_PLANT_COLOUR,color) adapt_seed(S) - small_flora_types += S + small_flora_seeds += S + if(has_trees) var/tree_diversity = max(1, flora_diversity/2) for(var/i = 1 to tree_diversity) @@ -33,21 +46,21 @@ S.set_trait(TRAIT_LEAVES_COLOUR,color) S.chems[/singleton/reagent/woodpulp] = list(1) adapt_seed(S) - big_flora_types += S + big_flora_seeds += S /obj/effect/landmark/exoplanet_spawn/plant name = "spawn exoplanet plant" /obj/effect/landmark/exoplanet_spawn/plant/do_spawn(var/obj/effect/overmap/visitable/sector/exoplanet/planet) - if(length(planet.small_flora_types)) - var/seed_path = pick(planet.small_flora_types) - new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(get_turf(src), new seed_path(), TRUE) + if(length(planet.small_flora_seeds)) + var/seed_path = pick(planet.small_flora_seeds) + new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(get_turf(src), seed_path, TRUE) /obj/effect/landmark/exoplanet_spawn/large_plant name = "spawn exoplanet large plant" /obj/effect/landmark/exoplanet_spawn/large_plant/do_spawn(var/obj/effect/overmap/visitable/sector/exoplanet/planet) - if(length(planet.big_flora_types)) - var/seed_path = pick(planet.big_flora_types) - new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(get_turf(src), new seed_path(), TRUE) + if(length(planet.big_flora_seeds)) + var/seed_path = pick(planet.big_flora_seeds) + new /obj/machinery/portable_atmospherics/hydroponics/soil/invisible(get_turf(src), seed_path, TRUE) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 49f2bd0d215..e24e8ecb001 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -936,14 +936,14 @@ balloon_alert(user, "\the [I.name] doesn't fit") return ..() - if(user.l_hand != bayonet && user.r_hand != bayonet) - balloon_alert(user, "not in hand") - return - if(bayonet) balloon_alert(user, "\the [src] already has a bayonet") return TRUE + if(user.l_hand != I && user.r_hand != I) + balloon_alert(user, "not in hand") + return + user.drop_from_inventory(I,src) bayonet = I balloon_alert(user, "[I.name] attached") @@ -958,15 +958,19 @@ if(!can_ammo_display) balloon_alert(user, "\the [I.name] doesn't fit") return TRUE - if(user.l_hand != ammo_display && user.r_hand != ammo_display) - balloon_alert(user, "not in hand") - return + if(ammo_display) balloon_alert(user, "\the [src] already has an ammo display") return TRUE + + if(user.l_hand != I && user.r_hand != I) + balloon_alert(user, "not in hand") + return + if(displays_maptext) balloon_alert(user, "\the [src] is already displaying its ammo count") return TRUE + user.drop_from_inventory(I, src) ammo_display = I displays_maptext = TRUE diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index b4aa178c75d..e03563106b4 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -237,12 +237,15 @@ if(!can_suppress) balloon_alert(user, "\the [S.name] doesn't fit") return - if(user.l_hand != suppressor && user.r_hand != suppressor) - balloon_alert(user, "not in hand") - return + if(suppressed) balloon_alert(user, "already has a suppressor") return + + if(user.l_hand != S && user.r_hand != S) + balloon_alert(user, "not in hand") + return + user.drop_from_inventory(suppressor, src) balloon_alert(user, "[S.name] attached") install_suppressor(S) diff --git a/html/changelogs/mattatlas-fixespt1.yml b/html/changelogs/mattatlas-fixespt1.yml new file mode 100644 index 00000000000..9220206feb0 --- /dev/null +++ b/html/changelogs/mattatlas-fixespt1.yml @@ -0,0 +1,43 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: MattAtlas + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Fixes exoplanets runtiming a shitload of times on bootup, again." + - bugfix: "Fixes suppressors, bayonets and ammo displays having some really weird behaviour when being attached." + - bugfix: "Fixes window panes allowing you to put stuff through them."