From 5d7e7a0030fe10a9844401d8f45493046b643dce Mon Sep 17 00:00:00 2001 From: covertcorvid <17987483+covertcorvid@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:46:38 -0400 Subject: [PATCH] Ripping some stuff out and fixing some warnings --- code/modules/unit_tests/get_overmap.dm | 103 ------------------ nsv13.dme | 1 + nsv13/code/__DEFINES/overmap.dm | 9 -- .../overmap/overmapJS/components/piloting.dm | 2 +- .../overmap/overmapJS/overmap_js_physics.dm | 2 +- 5 files changed, 3 insertions(+), 114 deletions(-) diff --git a/code/modules/unit_tests/get_overmap.dm b/code/modules/unit_tests/get_overmap.dm index ef75765afda..f5848c59360 100644 --- a/code/modules/unit_tests/get_overmap.dm +++ b/code/modules/unit_tests/get_overmap.dm @@ -39,37 +39,6 @@ QDEL_NULL(fighter) . = ..() - -/* - * Reactivate when map loading system improves -/// A mob inside a sabre should have its get_overmap return the sabre -/datum/unit_test/sabre_occupant_overmap - var/obj/structure/overmap/small_craft/transport/sabre/sabre = null - var/mob/living/carbon/human/dummy = null - -/datum/unit_test/sabre_occupant_overmap/Run() - for(var/obj/structure/overmap/small_craft/transport/sabre/OM as() in SSstar_system.find_main_overmap().overmaps_in_ship) - sabre = OM - break - - if(!sabre) - var/turf/center = SSmapping.get_station_center() - ASSERT(center) - sabre = new /obj/structure/overmap/small_craft/transport/sabre(center) - - ASSERT(sabre) - var/tries = 50 - while((tries > 0) && (sabre.interior_status != 2)) - sleep(5 SECONDS) - tries-- - TEST_ASSERT_EQUAL(sabre.interior_status, 2, "The sabre's interior was not ready") - - dummy = new(get_turf(sabre)) - sabre.enter(dummy) - dummy.update_overmap() - TEST_ASSERT_EQUAL(dummy.get_overmap(), sabre, "The mob's overmap was not the sabre") -*/ - /datum/unit_test/fighter_pilot_overmap/Destroy() QDEL_NULL(dummy) . = ..() @@ -116,75 +85,3 @@ /datum/unit_test/fighter_docking/Destroy() QDEL_NULL(fighter) . = ..() - -/* This doesn't work because the interior doesn't load in a reasonable amount of time -/// A small craft that docks with an asteroid should have its get_overmap return the asteroid while inside, and then null after leaving -/datum/unit_test/asteroid_docking - var/obj/structure/overmap/small_craft/combat/light/fighter = null - -/datum/unit_test/asteroid_docking/Run() - var/start = world.time - var/time_limit = 1 MINUTES - for(var/obj/structure/overmap/small_craft/combat/light/OM as() in SSstar_system.find_main_overmap().overmaps_in_ship) - fighter = OM - break - - if(!fighter) - var/turf/center = SSmapping.get_station_center() - ASSERT(center) - fighter = new (center) - - fighter.ftl_drive = TRUE //This won't work in real life but it will for the test - var/obj/item/fighter_component/docking_computer/DC = fighter.loadout.get_slot(HARDPOINT_SLOT_DOCKING) - DC.docking_mode = TRUE - fighter.check_overmap_elegibility(ignore_position = TRUE, ignore_cooldown = TRUE) - TEST_ASSERT_EQUAL(fighter.get_overmap(), null, "The fighter's overmap was not null after entering the overmap from the ship") - - var/obj/structure/overmap/asteroid/asteroid = new(get_turf(fighter)) - fighter.docking_act(asteroid) - while((world.time - start) < time_limit) - sleep(10) - TEST_ASSERT_EQUAL(fighter.get_overmap(), asteroid, "The fighter's overmap was not the asteroid after docking") - fighter.check_overmap_elegibility(ignore_position = TRUE, ignore_cooldown = TRUE) - TEST_ASSERT_EQUAL(fighter.get_overmap(), null, "The fighter's overmap was not null after entering the overmap from the asteroid") - -/datum/unit_test/asteroid_docking/Destroy() - QDEL_NULL(fighter) - . = ..() -*/ - -/datum/unit_test/armor_quadrnt_test/Run() - // Test without ngle - var/datum/overmap/source = new /datum/overmap(0, 0, 0, 0, 0) - // Test north east - var/datum/overmap/ne = new /datum/overmap(5, 5, 0, 0, 0) - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(ne), ARMOUR_QUADRANT_NORTH_EAST, "n impct coming from the top right, should hit the north east quadrant.") - // Test north west - var/datum/overmap/nw = new /datum/overmap(-5, 5, 0, 0, 0) - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(nw), ARMOUR_QUADRANT_NORTH_WEST, "n impct coming from the top left, should hit the north west quadrant.") - // Test south west - var/datum/overmap/sw = new /datum/overmap(-5, -5, 0, 0, 0) - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(sw), ARMOUR_QUADRANT_SOUTH_WEST, "n impct coming from the bottom left, should hit the south west quadrant.") - // Test south west - var/datum/overmap/se = new /datum/overmap(5, -5, 0, 0, 0) - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(se), ARMOUR_QUADRANT_SOUTH_EAST, "n impct coming from the bottom right, should hit the south est quadrant.") - // Modify the ngle so tht we re now pointing 90 degrees to the left - // Test rotated 90 degrees to the left. This means our armour quadrants will also be 90 degrees rotated - // Imagining these ships in my head being attacked and rotated almost melted my brain, I hope n ngle of 90 mens 90 nticlockwise nd not clockwise - source = new /datum/overmap(0, 0, 0, -90, 0) - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(ne), ARMOUR_QUADRANT_SOUTH_EAST, "If the ship is rotted 90 degrees to the left, then n ttck from (1, 1) should hit the bottom right shield.") - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(nw), ARMOUR_QUADRANT_NORTH_EAST, "If the ship is rotated 90 degrees to the left, then an attack from (-1, 1) should hit the top right shield") - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(sw), ARMOUR_QUADRANT_NORTH_WEST, "If the ship is rotated 90 degrees to the left, then an attack from (-1, -1) should hit the top left shield.") - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(se), ARMOUR_QUADRANT_SOUTH_WEST, "If the ship is rotated 90 degrees to the left, then an attack from (1, -1) should hit the bottom left shield") - // Test 90 degrees to the right - source = new /datum/overmap(0, 0, 0, 90, 0) - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(ne), ARMOUR_QUADRANT_NORTH_WEST, "If the ship is rotated 90 degrees to the right, then an attack from (1, 1) should hit the top left shield") - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(nw), ARMOUR_QUADRANT_SOUTH_WEST, "If the ship is rotated 90 degrees to the right, then an attck from (-1, 1) should hit the bottom left shield") - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(sw), ARMOUR_QUADRANT_SOUTH_EAST, "If the ship is rotted 90 degrees to the right, then n ttck from (-1, -1) should hit the bottom right shield") - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(se), ARMOUR_QUADRANT_NORTH_EAST, "If the ship is rotated 90 degrees to the right, then an atatck from (1, -1) should hit the top right shield") - // Test a middle angle - // A slight rotation of 5 in either direction shouldnt ffect the answer - source = new /datum/overmap(0, 0, 0, 5, 0) - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(ne), ARMOUR_QUADRANT_NORTH_EAST, "Rotating the ship to the right shouldnt affect the attack from the north east.") - source = new /datum/overmap(0, 0, 0, -5, 0) - TEST_ASSERT_EQUAL(source.get_armour_quadrant_for_impact(ne), ARMOUR_QUADRANT_NORTH_EAST, "Rotating the ship to the left shouldnt affect the attack from the north east.") diff --git a/nsv13.dme b/nsv13.dme index 539dbbe49c6..5bbf86bea8a 100644 --- a/nsv13.dme +++ b/nsv13.dme @@ -3682,6 +3682,7 @@ #include "nsv13\code\__DEFINES\paths.dm" #include "nsv13\code\__DEFINES\research.dm" #include "nsv13\code\__DEFINES\robot_defines.dm" +#include "nsv13\code\__DEFINES\ships.dm" #include "nsv13\code\__DEFINES\skynet.dm" #include "nsv13\code\__DEFINES\starsystem.dm" #include "nsv13\code\__DEFINES\traits.dm" diff --git a/nsv13/code/__DEFINES/overmap.dm b/nsv13/code/__DEFINES/overmap.dm index 8bb8ce50961..139d009b698 100644 --- a/nsv13/code/__DEFINES/overmap.dm +++ b/nsv13/code/__DEFINES/overmap.dm @@ -105,15 +105,6 @@ GLOBAL_LIST_INIT(overmap_impact_sounds, list('nsv13/sound/effects/ship/freespace //Overmap flags #define OVERMAP_FLAG_ZLEVEL_CARRIER (1<<0) //! This overmap is meant to carry a z with it, prompting restoration in certain cases. -//Ship mass -#define MASS_TINY 1 //1 Player - Fighters -#define MASS_SMALL 2 //2-5 Players - FoB/Mining Ship -#define MASS_MEDIUM 3 //10-20 Players - Small Capital Ships -#define MASS_MEDIUM_LARGE 5 //10-20 Players - Small Capital Ships -#define MASS_LARGE 7 //20-40 Players - Medium Capital Ships -#define MASS_TITAN 150 //40+ Players - Large Capital Ships -#define MASS_IMMOBILE 200 //Things that should not be moving. See: stations - //Fun tools #define SHIELD_NOEFFECT 0 //!Shield failed to absorb hit. #define SHIELD_ABSORB 1 //!Shield absorbed hit. diff --git a/nsv13/code/modules/overmap/overmapJS/components/piloting.dm b/nsv13/code/modules/overmap/overmapJS/components/piloting.dm index 7664382e67b..035618a84f9 100644 --- a/nsv13/code/modules/overmap/overmapJS/components/piloting.dm +++ b/nsv13/code/modules/overmap/overmapJS/components/piloting.dm @@ -37,7 +37,7 @@ return if(!selected_weapon_group) return - for(var/W in selected_weapon_group.weapon_list) + for(var/W as() in selected_weapon_group.weapon_list) var/datum/overmap_weapon/weap = W if(weap.fire(target, proj_angle)) break diff --git a/nsv13/code/modules/overmap/overmapJS/overmap_js_physics.dm b/nsv13/code/modules/overmap/overmapJS/overmap_js_physics.dm index 32a58b2d5e7..0d3ae6d7cc8 100644 --- a/nsv13/code/modules/overmap/overmapJS/overmap_js_physics.dm +++ b/nsv13/code/modules/overmap/overmapJS/overmap_js_physics.dm @@ -47,7 +47,7 @@ PROCESSING_SUBSYSTEM_DEF(physics_processing) //Set up this grid. var/rows = (JS_OVERMAP_TACMAP_TOTAL_SQUARES) var/cols = (JS_OVERMAP_TACMAP_TOTAL_SQUARES) - physics_levels[z_str] = new(cols) + physics_levels[z_str] = new/list(cols) //TODO: test me for(var/y = 1; y <= rows; y++) var/list/row = new(rows)