From 152941df79e627917daf6be3f6b15a3c0dc96007 Mon Sep 17 00:00:00 2001 From: DeltaFire <46569814+DeltaFire15@users.noreply.github.com> Date: Sun, 21 Apr 2024 01:45:04 +0200 Subject: [PATCH 1/3] bsa-and-sidetracking the perfect combination --- _maps/map_files/Eclipse/Eclipse1.dmm | 2 +- code/datums/dna.dm | 2 +- code/game/turfs/closed/walls.dm | 18 +++++++++++++++++- code/modules/paperwork/paper.dm | 7 ++++++- .../ship_weapons/energy_weapons/bsa.dm | 11 +++++++++++ nsv13/code/modules/overmap/traders.dm | 16 ++++++++-------- nsv13/code/modules/power/stormdrive.dm | 2 +- nsv13/code/modules/squads/squad_manager.dm | 2 +- 8 files changed, 46 insertions(+), 14 deletions(-) diff --git a/_maps/map_files/Eclipse/Eclipse1.dmm b/_maps/map_files/Eclipse/Eclipse1.dmm index 1a731eb322c..5864a40a510 100644 --- a/_maps/map_files/Eclipse/Eclipse1.dmm +++ b/_maps/map_files/Eclipse/Eclipse1.dmm @@ -262,7 +262,7 @@ "bp" = ( /obj/structure/closet/crate/large, /obj/effect/spawner/lootdrop/maintenance/four, -/obj/item/robot_module/borgi, +/obj/item/borg/upgrade/transform/borgi, /turf/open/floor/plasteel/dark/side, /area/construction) "br" = ( diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 6225bacad8b..34b12c7247a 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -51,7 +51,7 @@ destination.dna.features = features.Copy() destination.dna.real_name = real_name destination.dna.temporary_mutations = temporary_mutations.Copy() - destination.flavour_text = destination.client.prefs.active_character.flavor_text //Update the flavor_text to use new dna text //NSV13 + destination.flavour_text = holder ? holder.flavour_text : "" //Update the flavor_text to use new dna text //NSV13 if(transfer_SE) destination.dna.mutation_index = mutation_index destination.dna.default_mutation_genes = default_mutation_genes diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm index 11a7507b35f..7bf9fa59a07 100644 --- a/code/game/turfs/closed/walls.dm +++ b/code/game/turfs/closed/walls.dm @@ -37,6 +37,11 @@ var/list/dent_decals + //NSV13 - avoid runtiming from doafter stack. + ///Is this wall currently being interacted with (cleaned / deconned / etc) + var/interacting = FALSE + //NSV13 end + /turf/closed/wall/Initialize(mapload) . = ..() if(is_station_level(z)) @@ -175,13 +180,24 @@ if(!isturf(user.loc)) return //can't do this stuff whilst inside objects and such + + if(interacting) //NSV 13 - the doafters in here can change the type of the turf, which WILL runtime if you let them stack. + return + add_fingerprint(user) var/turf/T = user.loc //get user's location for delay checks + //NSV13 - src type changes which must be accounted for here. + interacting = TRUE //the istype cascade has been spread among various procs for easy overriding - if(try_clean(W, user, T) || try_wallmount(W, user, T) || try_decon(W, user, T) || try_destroy(W, user, T)) + if(try_clean(W, user, T) || try_wallmount(W, user, T)) + interacting = FALSE return + if(try_decon(W, user, T) || try_destroy(W, user, T)) + return //interacting is NOT set here because if either of these two is TRUE, this is no longer of the same type. + interacting = FALSE + //NSV13 end. return ..() diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index d3816c3e351..4ae77993a7d 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -474,7 +474,12 @@ if(clipboard.pen) holding = clipboard.pen - data["held_item_details"] = holding?.get_writing_implement_details() + //NSV13 - Old part here runtimes. + if(holding) + data["held_item_details"] = holding.get_writing_implement_details() + else + data["held_item_details"] = null //Overriding old data, otherwise data would not get changed. + //NSV13 end. // If the paper is on an unwritable noticeboard, clear the held item details so it's read-only. if(istype(loc, /obj/structure/noticeboard)) diff --git a/nsv13/code/modules/munitions/ship_weapons/energy_weapons/bsa.dm b/nsv13/code/modules/munitions/ship_weapons/energy_weapons/bsa.dm index 23d46fa0fcc..c6f5ccb71b7 100644 --- a/nsv13/code/modules/munitions/ship_weapons/energy_weapons/bsa.dm +++ b/nsv13/code/modules/munitions/ship_weapons/energy_weapons/bsa.dm @@ -205,6 +205,7 @@ impact_type = /obj/effect/projectile/impact/bsa movement_type = FLYING projectile_piercing = ALL + relay_projectile_type = /obj/item/projectile/beam/laser/heavylaser/bsa/relayed /obj/effect/projectile/muzzle/bsa alpha = 0 @@ -216,3 +217,13 @@ /obj/effect/projectile/impact/bsa name = "bsa" icon_state = "bsa_impact" + +/obj/item/projectile/beam/laser/heavylaser/bsa/relayed + projectile_piercing = PASSGLASS|PASSGRILLE|PASSTABLE + +/obj/item/projectile/beam/laser/heavylaser/bsa/relayed/on_hit(atom/target, blocked) + . = ..() + if(isliving(target)) + var/mob/living/goodbye = target + goodbye.dust(TRUE, FALSE) + explosion(get_turf(target), 6, 8, 9, 12, ignorecap = TRUE, flame_range = 6) //I have to keep myself from letting it just truncate ships because thats a bit annoying to fix for the receiving side, even if accurate to appearance. diff --git a/nsv13/code/modules/overmap/traders.dm b/nsv13/code/modules/overmap/traders.dm index 4fd02bda040..6f9a271cfd0 100644 --- a/nsv13/code/modules/overmap/traders.dm +++ b/nsv13/code/modules/overmap/traders.dm @@ -284,24 +284,24 @@ stonks -= x qdel(x) sold_items = list() - while(iter) + var/fails = 0 + while(iter && fails < 10) iter-- var/datum/trader_item/item = new var/obj/item/a_gift/anything/generator = new - var/initialtype = generator.get_gift_type() - var/obj/item/soldtype = new initialtype - if(!soldtype) //spawned something that deleted itself, try again - log_runtime("Randy failed to spawn [initialtype]!") + var/obj/item/initialtype = generator.get_gift_type() //If you put any non-items in here I will haunt you. + if(!initialtype) //failed to select something, try again + log_runtime("Randy failed to select an item!") qdel(item) iter++ + fails++ //DO NOT loop forever. continue item.unlock_path = initialtype - item.name = soldtype.name - item.desc = soldtype.desc + item.name = initial(initialtype.name) + item.desc = initial(initialtype.desc) item.price = rand(1000, 100000000) item.stock = rand(1, 5) item.owner = src - qdel(soldtype) sold_items += item var/datum/trader_item/yellow_pages/pages = new diff --git a/nsv13/code/modules/power/stormdrive.dm b/nsv13/code/modules/power/stormdrive.dm index 4d35c16cfca..be8a18393af 100644 --- a/nsv13/code/modules/power/stormdrive.dm +++ b/nsv13/code/modules/power/stormdrive.dm @@ -586,7 +586,7 @@ Control Rods var/datum/gas_mixture/air1 = airs[1] var/nucleium_power_reduction = 0 - var/fuel_check = ((air1.get_moles(GAS_PLASMA) + air1.get_moles(GAS_CONSTRICTED_PLASMA) + air1.get_moles(GAS_TRITIUM)) / air1.total_moles()) * 100 + var/fuel_check = air1.total_moles() <= 0 ? 0 : ((air1.get_moles(GAS_PLASMA) + air1.get_moles(GAS_CONSTRICTED_PLASMA) + air1.get_moles(GAS_TRITIUM)) / air1.total_moles()) * 100 if(air1.total_moles() >= reaction_rate && fuel_check >= 12.5) //1:8 ratio var/datum/gas_mixture/reaction_chamber_gases = air1.remove(reaction_rate) diff --git a/nsv13/code/modules/squads/squad_manager.dm b/nsv13/code/modules/squads/squad_manager.dm index d261d479684..8cb3240ab41 100644 --- a/nsv13/code/modules/squads/squad_manager.dm +++ b/nsv13/code/modules/squads/squad_manager.dm @@ -52,7 +52,7 @@ GLOBAL_DATUM_INIT(squad_manager, /datum/squad_manager, new) // Try to find a squad that's not already tasked that can do the job /datum/squad_manager/proc/assign_squad(role) var/datum/squad/assigned = role_squad_map[role] - if(assigned && length(assigned.members)) + if(istype(assigned) && length(assigned.members)) assigned.lowpop_retasked = TRUE assigned.access_enabled = TRUE // They won't be much help without this return From adcf4d64eefdd8be510facde574f33c30e2e29d6 Mon Sep 17 00:00:00 2001 From: DeltaFire <46569814+DeltaFire15@users.noreply.github.com> Date: Sun, 21 Apr 2024 02:14:55 +0200 Subject: [PATCH 2/3] actual fix --- nsv13/code/modules/squads/squad_manager.dm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/nsv13/code/modules/squads/squad_manager.dm b/nsv13/code/modules/squads/squad_manager.dm index 8cb3240ab41..c34635a64bf 100644 --- a/nsv13/code/modules/squads/squad_manager.dm +++ b/nsv13/code/modules/squads/squad_manager.dm @@ -51,12 +51,14 @@ GLOBAL_DATUM_INIT(squad_manager, /datum/squad_manager, new) // Try to find a squad that's not already tasked that can do the job /datum/squad_manager/proc/assign_squad(role) - var/datum/squad/assigned = role_squad_map[role] - if(istype(assigned) && length(assigned.members)) - assigned.lowpop_retasked = TRUE - assigned.access_enabled = TRUE // They won't be much help without this - return - + var/list/assigned_list = role_squad_map[role] + if(length(assigned_list)) + for(var/datum/squad/assigned in assigned_list) + if(!istype(assigned) || !length(assigned.members)) + continue + assigned.lowpop_retasked = TRUE + assigned.access_enabled = TRUE // They won't be much help without this + return //Prefer DC squads by default. Make sure there are people in them and we haven't tasked them already var/list/possible = role_squad_map[DC_SQUAD] for(var/datum/squad/S in possible) From 343db549bbfa345d0392fc2a0af3de3cead191f8 Mon Sep 17 00:00:00 2001 From: DeltaFire <46569814+DeltaFire15@users.noreply.github.com> Date: Sat, 27 Apr 2024 00:23:53 +0200 Subject: [PATCH 3/3] oops I may have forgotten rwalls. --- code/game/turfs/closed/walls.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/game/turfs/closed/walls.dm b/code/game/turfs/closed/walls.dm index 7bf9fa59a07..3414491ca0f 100644 --- a/code/game/turfs/closed/walls.dm +++ b/code/game/turfs/closed/walls.dm @@ -195,7 +195,9 @@ interacting = FALSE return if(try_decon(W, user, T) || try_destroy(W, user, T)) - return //interacting is NOT set here because if either of these two is TRUE, this is no longer of the same type. + if(istype(src, /turf/closed/wall)) //I hate this. + interacting = FALSE //Set interacting only if the wall is still a wall. + return interacting = FALSE //NSV13 end.