mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-21 21:17:44 +01:00
MODsuits (#59109)
This commit is contained in:
@@ -79,6 +79,7 @@
|
||||
#include "merge_type.dm"
|
||||
#include "metabolizing.dm"
|
||||
#include "mob_spawn.dm"
|
||||
#include "modsuit.dm"
|
||||
#include "ntnetwork_tests.dm"
|
||||
#include "outfit_sanity.dm"
|
||||
#include "pills.dm"
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
/// Checks all pre-equipped MODsuit paths to see if they have something set wrong.
|
||||
/datum/unit_test/modsuit_checks
|
||||
|
||||
/datum/unit_test/modsuit_checks/Run()
|
||||
var/list/paths = typesof(/obj/item/mod/control/pre_equipped)
|
||||
|
||||
for(var/modpath in paths)
|
||||
var/obj/item/mod/control/mod = new modpath()
|
||||
TEST_ASSERT(mod.theme, "[modpath] spawned without a theme.")
|
||||
TEST_ASSERT(mod.helmet, "[modpath] spawned without a helmet.")
|
||||
TEST_ASSERT(mod.chestplate, "[modpath] spawned without a chestplate.")
|
||||
TEST_ASSERT(mod.gauntlets, "[modpath] spawned without gauntlets.")
|
||||
TEST_ASSERT(mod.boots, "[modpath] spawned without boots.")
|
||||
var/list/modules = list()
|
||||
var/complexity_max = mod.complexity_max
|
||||
var/complexity = 0
|
||||
for(var/obj/item/mod/module/module as anything in mod.initial_modules)
|
||||
module = new module()
|
||||
complexity += module.complexity
|
||||
TEST_ASSERT(complexity <= complexity_max, "[modpath] starting modules reach above max complexity.")
|
||||
TEST_ASSERT(!is_type_in_list(module, mod.theme.module_blacklist), "[modpath] starting modules are in [mod.theme.type] blacklist.")
|
||||
for(var/obj/item/mod/module/module_to_check as anything in modules)
|
||||
TEST_ASSERT(!is_type_in_list(module, module_to_check.incompatible_modules), "[modpath] initial module [module.type] is incompatible with initial module [module_to_check.type]")
|
||||
TEST_ASSERT(!is_type_in_list(module_to_check, module.incompatible_modules), "[modpath] initial module [module.type] is incompatible with initial module [module_to_check.type]")
|
||||
modules += module
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#define CHECK_OUTFIT_SLOT(outfit_key, slot_name) if (outfit.##outfit_key) { \
|
||||
H.equip_to_slot_or_del(new outfit.##outfit_key(H), ##slot_name, TRUE); \
|
||||
/* We don't check the result of equip_to_slot_or_del because it returns false for random jumpsuits, as they delete themselves on init */ \
|
||||
if (!H.get_item_by_slot(##slot_name)) { \
|
||||
var/obj/item/outfit_item = H.get_item_by_slot(##slot_name); \
|
||||
if (!outfit_item) { \
|
||||
Fail("[outfit.name]'s [#outfit_key] is invalid! Could not equip a [outfit.##outfit_key] into that slot."); \
|
||||
} \
|
||||
outfit_item.on_outfit_equip(H, FALSE, ##slot_name); \
|
||||
}
|
||||
|
||||
/datum/unit_test/outfit_sanity/Run()
|
||||
@@ -19,7 +21,6 @@
|
||||
|
||||
CHECK_OUTFIT_SLOT(uniform, ITEM_SLOT_ICLOTHING)
|
||||
CHECK_OUTFIT_SLOT(suit, ITEM_SLOT_OCLOTHING)
|
||||
CHECK_OUTFIT_SLOT(back, ITEM_SLOT_BACK)
|
||||
CHECK_OUTFIT_SLOT(belt, ITEM_SLOT_BELT)
|
||||
CHECK_OUTFIT_SLOT(gloves, ITEM_SLOT_GLOVES)
|
||||
CHECK_OUTFIT_SLOT(shoes, ITEM_SLOT_FEET)
|
||||
@@ -28,11 +29,11 @@
|
||||
CHECK_OUTFIT_SLOT(neck, ITEM_SLOT_NECK)
|
||||
CHECK_OUTFIT_SLOT(ears, ITEM_SLOT_EARS)
|
||||
CHECK_OUTFIT_SLOT(glasses, ITEM_SLOT_EYES)
|
||||
CHECK_OUTFIT_SLOT(back, ITEM_SLOT_BACK)
|
||||
CHECK_OUTFIT_SLOT(id, ITEM_SLOT_ID)
|
||||
CHECK_OUTFIT_SLOT(suit_store, ITEM_SLOT_SUITSTORE)
|
||||
CHECK_OUTFIT_SLOT(l_pocket, ITEM_SLOT_LPOCKET)
|
||||
CHECK_OUTFIT_SLOT(r_pocket, ITEM_SLOT_RPOCKET)
|
||||
|
||||
CHECK_OUTFIT_SLOT(suit_store, ITEM_SLOT_SUITSTORE)
|
||||
if (outfit.backpack_contents || outfit.box)
|
||||
var/list/backpack_contents = outfit.backpack_contents?.Copy()
|
||||
if (outfit.box)
|
||||
|
||||
Reference in New Issue
Block a user