mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 04:51:32 +01:00
Refactored the abstract meta propriety (#19797)
Refactored the abstract meta propriety into defines. It's now more easy to spot/see abstract types thanks to the macro that defines them. Added a check on initialization of atoms to avoid spawning abstract types. Made the spawn_atom proc check for abstractness. Made the spawn_atom proc use tgui_list for types list shorter than 1000 elements, which enables to search in them. It's too laggy on larger lists so above 1000 it uses the builtin input. Made the spawn_atom use a list subtraction instead of a double list, it's lighter on memory and processing.
This commit is contained in:
+1
-1
@@ -28,6 +28,7 @@
|
||||
#include "code\__DEFINES\_tick.dm"
|
||||
#include "code\__DEFINES\_unit_tests.dm"
|
||||
#include "code\__DEFINES\_world.dm"
|
||||
#include "code\__DEFINES\abstract_type.dm"
|
||||
#include "code\__DEFINES\access.dm"
|
||||
#include "code\__DEFINES\accessories.dm"
|
||||
#include "code\__DEFINES\admin.dm"
|
||||
@@ -408,7 +409,6 @@
|
||||
#include "code\controllers\subsystems\processing\psi.dm"
|
||||
#include "code\controllers\subsystems\processing\shuttle.dm"
|
||||
#include "code\controllers\subsystems\processing\tgui.dm"
|
||||
#include "code\core\datum\IsAbstract.dm"
|
||||
#include "code\datums\ai_law_sets.dm"
|
||||
#include "code\datums\ai_laws.dm"
|
||||
#include "code\datums\beam.dm"
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Abstract-ness is a meta-property of a class that is used to indicate
|
||||
* that the class is intended to be used as a base class for others, and
|
||||
* should not (or cannot) be instantiated.
|
||||
*
|
||||
* We have no such language concept in DM, and so we provide a datum member
|
||||
* that can be used to hint at abstractness for circumstances where we would
|
||||
* like that to be the case, such as base behavior providers.
|
||||
*
|
||||
* Use this macro, and only this macro, to define an abstract type.
|
||||
*/
|
||||
#define ABSTRACT_TYPE(typepath)\
|
||||
##typepath {\
|
||||
abstract_type = ##typepath; \
|
||||
}; ##typepath
|
||||
|
||||
/**
|
||||
* Returns whether the given datum/path is an abstract type
|
||||
*
|
||||
* * thing - A `datum` or `typepath` to check
|
||||
*/
|
||||
#define is_abstract(thing) (ispath(##thing) ? (##thing == initial(##thing:abstract_type)) : (##thing:type == (##thing:abstract_type)))
|
||||
// ^- The dynamic access operator is needed because we accept paths and we can't fake cast them to a hygenic typed var since we have to give a return value
|
||||
// it sucks, but it's DM, so things are bound to suck sometimes. Thanks byond. It shouldn't however give any issue, because the abstract_type var is defined
|
||||
// at the datum level, so essentially for everything, and this being a macro saves proc call overhead -- essentially, i think the tradeoff is worth it
|
||||
@@ -8,8 +8,7 @@
|
||||
*/
|
||||
|
||||
/// The base /renderer definition and defaults.
|
||||
/atom/movable/renderer
|
||||
abstract_type = /atom/movable/renderer
|
||||
ABSTRACT_TYPE(/atom/movable/renderer)
|
||||
appearance_flags = DEFAULT_RENDERER_APPEARANCE_FLAGS
|
||||
screen_loc = "CENTER"
|
||||
plane = LOWEST_PLANE
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* Abstract-ness is a meta-property of a class that is used to indicate
|
||||
* that the class is intended to be used as a base class for others, and
|
||||
* should not (or cannot) be instantiated.
|
||||
* We have no such language concept in DM, and so we provide a datum member
|
||||
* that can be used to hint at abstractness for circumstances where we would
|
||||
* like that to be the case, such as base behavior providers.
|
||||
*/
|
||||
|
||||
/// If set, a path at/above this one that expects not to be instantiated.
|
||||
/datum/var/abstract_type
|
||||
|
||||
/// If true, this datum is an instance of an abstract type. Oops.
|
||||
/datum/proc/IsAbstract()
|
||||
SHOULD_NOT_OVERRIDE(TRUE)
|
||||
return type == abstract_type
|
||||
|
||||
/// Passed a path or instance, returns whether it is abstract. Otherwise null.
|
||||
/proc/is_abstract(datum/thing)
|
||||
if (ispath(thing))
|
||||
return thing == initial(thing.abstract_type)
|
||||
if (istype(thing))
|
||||
return thing.IsAbstract()
|
||||
@@ -1,6 +1,4 @@
|
||||
/singleton/overhead_emote
|
||||
abstract_type = /singleton/overhead_emote
|
||||
|
||||
ABSTRACT_TYPE(/singleton/overhead_emote)
|
||||
var/icon = 'icons/mob/overhead_emote.dmi'
|
||||
var/icon_state = "abstract"
|
||||
|
||||
|
||||
@@ -33,6 +33,16 @@
|
||||
/// Datum level flags
|
||||
var/datum_flags = NONE
|
||||
|
||||
/**
|
||||
* If set, a path at/above this one that expects not to be instantiated
|
||||
*
|
||||
* This is a `typepath`
|
||||
*
|
||||
* Do not instantiate a datum that has the path set as its abstract_type, this indicates
|
||||
* that the datum is abstract and is not meant to be spawned/used directly
|
||||
*/
|
||||
var/abstract_type
|
||||
|
||||
/// A weak reference to another datum
|
||||
var/datum/weakref/weak_reference
|
||||
|
||||
|
||||
@@ -163,8 +163,7 @@ var/global/repository/singletons/Singletons = new
|
||||
return result
|
||||
|
||||
|
||||
/singleton
|
||||
abstract_type = /singleton
|
||||
ABSTRACT_TYPE(/singleton)
|
||||
|
||||
|
||||
/singleton/proc/Initialize()
|
||||
|
||||
@@ -144,6 +144,13 @@
|
||||
if (update_icon_on_init)
|
||||
SSicon_update.add_to_queue(src)
|
||||
|
||||
//Finally an aurora snowflake code that matters,
|
||||
//this try to ensure noone is stupid enough to instantiate an abstract type
|
||||
if(is_abstract(src))
|
||||
var/datum/space_level/L = SSmapping.get_level(z)
|
||||
stack_trace("Atom [src] ([type]) \[ X:[x] Y:[y] Z:[z] (Space level: [L ? L.name : "NOT FOUND"]) \] is abstract, but is trying to initialize!")
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
return INITIALIZE_HINT_NORMAL
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,9 +3,7 @@
|
||||
*
|
||||
* Howitzers are a field weapon capable of delivering artillery fire to a location
|
||||
*/
|
||||
/obj/machinery/howitzer
|
||||
abstract_type = /obj/machinery/howitzer
|
||||
|
||||
ABSTRACT_TYPE(/obj/machinery/howitzer)
|
||||
name = "howitzer"
|
||||
|
||||
icon = 'icons/obj/machinery/howitzer/howitzer.dmi'
|
||||
@@ -355,9 +353,7 @@
|
||||
*
|
||||
* Howitzer ammo casing is a type of ammo casing that can be loaded into howitzers.
|
||||
*/
|
||||
/obj/item/ammo_casing/howitzer
|
||||
abstract_type = /obj/item/ammo_casing/howitzer
|
||||
|
||||
ABSTRACT_TYPE(/obj/item/ammo_casing/howitzer)
|
||||
name = "howitzer ammo casing"
|
||||
icon = 'icons/obj/machinery/howitzer/howitzer_ammo.dmi'
|
||||
icon_state = "howitzer_ammo"
|
||||
@@ -381,9 +377,7 @@
|
||||
*
|
||||
* Howitzer ammo is a type of ammo that can be used in howitzers.
|
||||
*/
|
||||
/obj/projectile/howitzer
|
||||
abstract_type = /obj/projectile/howitzer
|
||||
|
||||
ABSTRACT_TYPE(/obj/projectile/howitzer)
|
||||
name = "howitzer ammo"
|
||||
icon = 'icons/obj/machinery/howitzer/howitzer_ammo.dmi'
|
||||
icon_state = "howitzer_ammo"
|
||||
@@ -426,10 +420,8 @@
|
||||
/*
|
||||
High Explosive
|
||||
*/
|
||||
/obj/item/ammo_casing/howitzer/high_explosive
|
||||
ABSTRACT_TYPE(/obj/item/ammo_casing/howitzer/high_explosive)
|
||||
name = "high explosive howitzer ammo"
|
||||
abstract_type = /obj/item/ammo_casing/howitzer/high_explosive
|
||||
|
||||
projectile_type = /obj/projectile/howitzer/high_explosive
|
||||
|
||||
/**
|
||||
@@ -437,9 +429,7 @@
|
||||
*
|
||||
* Big boom, many fragments
|
||||
*/
|
||||
/obj/projectile/howitzer/high_explosive
|
||||
abstract_type = /obj/projectile/howitzer/high_explosive
|
||||
|
||||
ABSTRACT_TYPE(/obj/projectile/howitzer/high_explosive)
|
||||
name = "high explosive howitzer ammo"
|
||||
|
||||
///The minimum number of fragments this HE shell will create
|
||||
@@ -474,9 +464,7 @@
|
||||
/*####################################
|
||||
GUNPOWDER PELLETS
|
||||
####################################*/
|
||||
/obj/item/howitzer_pellet
|
||||
abstract_type = /obj/item/howitzer_pellet
|
||||
|
||||
ABSTRACT_TYPE(/obj/item/howitzer_pellet)
|
||||
name = "howitzer pellet"
|
||||
desc = "A pellet that can be used in a howitzer to propel the projectile."
|
||||
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
*
|
||||
* A device used for rapid fabrication of things, built from a compressed matter cartridge
|
||||
*/
|
||||
/obj/item/rfd
|
||||
abstract_type = /obj/item/rfd //This is an abstract, use one of the subtypes instead
|
||||
|
||||
ABSTRACT_TYPE(/obj/item/rfd)
|
||||
name = "\improper Rapid Fabrication Device"
|
||||
desc = "A device used for rapid fabrication. The matter decompression matrix is untuned, rendering it useless."
|
||||
icon = 'icons/obj/rfd.dmi'
|
||||
|
||||
@@ -142,8 +142,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
|
||||
//////////////////
|
||||
//FINE SMOKABLES//
|
||||
//////////////////
|
||||
/obj/item/clothing/mask/smokable
|
||||
abstract_type = /obj/item/clothing/mask/smokable
|
||||
ABSTRACT_TYPE(/obj/item/clothing/mask/smokable)
|
||||
name = "smokable item"
|
||||
desc = "You're not sure what this is. You should probably ahelp it."
|
||||
icon = 'icons/obj/smokables.dmi'
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
#define MALFUNCTION_PERMANENT 2
|
||||
|
||||
|
||||
/obj/item/implant
|
||||
abstract_type = /obj/item/implant
|
||||
ABSTRACT_TYPE(/obj/item/implant)
|
||||
name = "implant"
|
||||
icon = 'icons/obj/item/implants.dmi'
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
|
||||
@@ -67,8 +67,7 @@
|
||||
name = "[street_name]"
|
||||
desc = "This sign indicates this crossing street is called [street_name]."
|
||||
|
||||
/obj/structure/stairs/urban
|
||||
abstract_type = /obj/structure/stairs/urban
|
||||
ABSTRACT_TYPE(/obj/structure/stairs/urban)
|
||||
icon = 'icons/obj/structure/urban/ledges.dmi'
|
||||
icon_state = "stairs-single"
|
||||
layer = 2.01
|
||||
@@ -92,12 +91,11 @@
|
||||
dir = SOUTH
|
||||
bound_height = 64
|
||||
|
||||
/obj/structure/stairs/urban/road_ramp
|
||||
ABSTRACT_TYPE(/obj/structure/stairs/urban/road_ramp)
|
||||
name = "inclined asphalt ramp"
|
||||
desc = "A solid asphalt ramp to allow your vehicle to traverse inclines with ease."
|
||||
icon_state = "road-ramp-center"
|
||||
layer = 2.02
|
||||
abstract_type = /obj/structure/stairs/urban/road_ramp
|
||||
|
||||
/obj/structure/stairs/urban/road_ramp/right
|
||||
dir = EAST
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
/obj/abstract
|
||||
ABSTRACT_TYPE(/obj/abstract)
|
||||
name = ""
|
||||
icon = 'icons/effects/landmarks.dmi'
|
||||
icon_state = "x2"
|
||||
simulated = FALSE
|
||||
density = FALSE
|
||||
anchored = TRUE
|
||||
abstract_type = /obj/abstract
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/obj/abstract/Initialize()
|
||||
|
||||
+19
-10
@@ -1016,27 +1016,36 @@ var/global/enabled_spooking = 0
|
||||
set desc = "(atom path) Spawn an atom"
|
||||
set name = "Spawn"
|
||||
|
||||
if(!check_rights(R_SPAWN)) return
|
||||
if(!check_rights(R_SPAWN))
|
||||
return
|
||||
|
||||
var/list/types = typesof(/atom)
|
||||
var/list/matches = new()
|
||||
var/list/matches = typesof(/atom)
|
||||
|
||||
for(var/path in types)
|
||||
if(findtext("[path]", object))
|
||||
matches += path
|
||||
for(var/path in matches)
|
||||
if(!findtext("[path]", object))
|
||||
matches -= path
|
||||
|
||||
if(matches.len==0)
|
||||
if(!length(matches))
|
||||
return
|
||||
|
||||
var/chosen
|
||||
if(matches.len==1)
|
||||
if(length(matches) == 1)
|
||||
chosen = matches[1]
|
||||
else
|
||||
chosen = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
|
||||
//TGUI input gets fucky if the list is too large, so we revert back to standard input in that case
|
||||
if(length(matches) < 1000)
|
||||
chosen = tgui_input_list(usr, "Select an atom type", "Spawn Atom", matches)
|
||||
else
|
||||
chosen = input("Select an atom type", "Spawn Atom", matches[1]) as null|anything in matches
|
||||
|
||||
if(!chosen)
|
||||
return
|
||||
|
||||
if(ispath(chosen,/turf))
|
||||
if(is_abstract(chosen))
|
||||
tgui_alert(usr, "This is an abstract type, you can't spawn it!", "Abstract Type")
|
||||
return
|
||||
|
||||
if(ispath(chosen, /turf))
|
||||
var/turf/T = get_turf(usr.loc)
|
||||
T.ChangeTurf(chosen)
|
||||
else
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/datum/gear/accessory
|
||||
abstract_type = /datum/gear/accessory
|
||||
ABSTRACT_TYPE(/datum/gear/accessory)
|
||||
sort_category = "Accessories"
|
||||
|
||||
/datum/gear/accessory/locket
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
sort_category = "Modular Computers"
|
||||
cost = 2
|
||||
|
||||
/datum/gear/computer/handheld
|
||||
abstract_type = /datum/gear/computer/handheld
|
||||
ABSTRACT_TYPE(/datum/gear/computer/handheld)
|
||||
|
||||
/datum/gear/computer/handheld/tablet
|
||||
display_name = "tablet"
|
||||
@@ -26,8 +25,7 @@
|
||||
tablets["machinist tablet"] = /obj/item/modular_computer/handheld/preset/supply/machinist
|
||||
gear_tweaks += new /datum/gear_tweak/path(tablets)
|
||||
|
||||
/datum/gear/computer/handheld/wristbound
|
||||
abstract_type = /datum/gear/computer/handheld/wristbound
|
||||
ABSTRACT_TYPE(/datum/gear/computer/handheld/wristbound)
|
||||
|
||||
/datum/gear/computer/handheld/wristbound/selection
|
||||
display_name = "wristbound computer selection"
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
/datum/gear/religion
|
||||
abstract_type = /datum/gear/religion
|
||||
ABSTRACT_TYPE(/datum/gear/religion)
|
||||
sort_category = "Religion"
|
||||
flags = GEAR_HAS_DESC_SELECTION
|
||||
|
||||
/datum/gear/religion/trinary
|
||||
abstract_type = /datum/gear/religion/trinary
|
||||
ABSTRACT_TYPE(/datum/gear/religion/trinary)
|
||||
religion = RELIGION_TRINARY
|
||||
|
||||
/datum/gear/religion/trinary/mask
|
||||
@@ -105,8 +103,7 @@
|
||||
slot = slot_tie
|
||||
flags = GEAR_HAS_DESC_SELECTION | GEAR_HAS_COLOR_SELECTION
|
||||
|
||||
/datum/gear/religion/dominia
|
||||
abstract_type = /datum/gear/religion/dominia
|
||||
ABSTRACT_TYPE(/datum/gear/religion/dominia)
|
||||
religion = RELIGION_MOROZ
|
||||
|
||||
/datum/gear/religion/dominia/robe
|
||||
@@ -219,8 +216,7 @@
|
||||
dominiaicon["icon of the martyr, valeria"] = /obj/item/sign/painting_frame/martyr/valeria
|
||||
gear_tweaks += new /datum/gear_tweak/path(dominiaicon)
|
||||
|
||||
/datum/gear/religion/assunzione
|
||||
abstract_type = /datum/gear/religion/assunzione
|
||||
ABSTRACT_TYPE(/datum/gear/religion/assunzione)
|
||||
religion = RELIGION_LUCEISM
|
||||
|
||||
/datum/gear/religion/assunzione/scripture
|
||||
|
||||
@@ -380,8 +380,7 @@
|
||||
jacket["departmental jacket, service"] = /obj/item/clothing/suit/storage/toggle/serv_dep_jacket
|
||||
gear_tweaks += new /datum/gear_tweak/path(jacket)
|
||||
|
||||
/datum/gear/suit/miscellaneous
|
||||
abstract_type = /datum/gear/suit/miscellaneous
|
||||
ABSTRACT_TYPE(/datum/gear/suit/miscellaneous)
|
||||
|
||||
/datum/gear/suit/miscellaneous/peacoat
|
||||
display_name = "peacoat"
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
flags = GEAR_NO_SELECTION
|
||||
culture_restriction = list(/singleton/origin_item/culture/diona_sol)
|
||||
|
||||
/datum/gear/suit/diona
|
||||
abstract_type = /datum/gear/suit/diona
|
||||
ABSTRACT_TYPE(/datum/gear/suit/diona)
|
||||
|
||||
/datum/gear/suit/diona/eternal
|
||||
display_name = "mesh weave robes"
|
||||
@@ -128,8 +127,7 @@
|
||||
sort_category = "Xenowear - Diona"
|
||||
culture_restriction = list(/singleton/origin_item/culture/dionae_nralakk, /singleton/origin_item/culture/xrim)
|
||||
|
||||
/datum/gear/accessory/diona
|
||||
abstract_type = /datum/gear/accessory/diona
|
||||
ABSTRACT_TYPE(/datum/gear/accessory/diona)
|
||||
|
||||
/datum/gear/accessory/diona/skrell_passport
|
||||
display_name = "dionae nralakk federation passport"
|
||||
|
||||
@@ -140,8 +140,7 @@
|
||||
goldendeep["golden deep skirtsuit"] = /obj/item/clothing/under/goldendeep/skirtsuit
|
||||
gear_tweaks += new /datum/gear_tweak/path(goldendeep)
|
||||
|
||||
/datum/gear/augment/machine
|
||||
abstract_type = /datum/gear/augment/machine
|
||||
ABSTRACT_TYPE(/datum/gear/augment/machine)
|
||||
|
||||
/datum/gear/augment/machine/gustatorial
|
||||
display_name = "gustatorial centre (tongue)"
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/datum/gear/ears/skrell
|
||||
abstract_type = /datum/gear/ears/skrell
|
||||
ABSTRACT_TYPE(/datum/gear/ears/skrell)
|
||||
|
||||
/datum/gear/ears/skrell/chains //Chains
|
||||
display_name = "headtail chain selection"
|
||||
@@ -298,8 +297,7 @@ var/datum/gear_tweak/social_credit/social_credit_tweak = new()
|
||||
outfit["iqi medical"] = /obj/item/clothing/under/skrell/nralakk/iqi/med
|
||||
gear_tweaks += new /datum/gear_tweak/path(outfit)
|
||||
|
||||
/datum/gear/suit/skrell
|
||||
abstract_type = /datum/gear/suit/skrell
|
||||
ABSTRACT_TYPE(/datum/gear/suit/skrell)
|
||||
|
||||
/datum/gear/suit/skrell/jacket
|
||||
display_name = "work jackets"
|
||||
@@ -333,8 +331,8 @@ var/datum/gear_tweak/social_credit/social_credit_tweak = new()
|
||||
jacket["iqi medical"] = /obj/item/clothing/suit/storage/toggle/skrell/iqi/med
|
||||
gear_tweaks += new /datum/gear_tweak/path(jacket)
|
||||
|
||||
/datum/gear/accessory/skrell
|
||||
abstract_type = /datum/gear/accessory/skrell
|
||||
ABSTRACT_TYPE(/datum/gear/accessory/skrell)
|
||||
|
||||
/datum/gear/accessory/skrell/starcoat
|
||||
display_name = "star coat"
|
||||
path = /obj/item/clothing/suit/storage/toggle/skrell/starcoat
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/datum/gear/shoes/tajara
|
||||
abstract_type = /datum/gear/shoes/tajara
|
||||
ABSTRACT_TYPE(/datum/gear/shoes/tajara)
|
||||
|
||||
/datum/gear/shoes/tajara/boots
|
||||
display_name = "tajaran boots selection"
|
||||
|
||||
@@ -232,8 +232,7 @@
|
||||
whitelisted = list(SPECIES_VAURCA_WORKER, SPECIES_VAURCA_WARRIOR, SPECIES_VAURCA_BREEDER, SPECIES_VAURCA_BULWARK)
|
||||
flags = GEAR_NO_SELECTION
|
||||
|
||||
/datum/gear/ears/vaurca
|
||||
abstract_type = /datum/gear/ears/vaurca
|
||||
ABSTRACT_TYPE(/datum/gear/ears/vaurca)
|
||||
|
||||
/datum/gear/ears/vaurca/rings
|
||||
display_name = "bulwark horn rings"
|
||||
|
||||
@@ -3,8 +3,7 @@
|
||||
//
|
||||
|
||||
// Pants Parent Item
|
||||
/obj/item/clothing/under/pants
|
||||
abstract_type = /obj/item/clothing/under/pants
|
||||
ABSTRACT_TYPE(/obj/item/clothing/under/pants)
|
||||
name = "pants parent item"
|
||||
desc = DESC_PARENT
|
||||
icon = 'icons/obj/item/clothing/under/pants.dmi'
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
//For things that swim and don't do much else.
|
||||
/mob/living/simple_animal/aquatic
|
||||
abstract_type = /mob/living/simple_animal/aquatic
|
||||
|
||||
ABSTRACT_TYPE(/mob/living/simple_animal/aquatic)
|
||||
name = "aquatic animal"
|
||||
desc = DESC_PARENT
|
||||
icon = 'icons/mob/npc/fish.dmi'
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/mob/living/simple_animal/hostile/commanded
|
||||
abstract_type = /mob/living/simple_animal/hostile/commanded
|
||||
|
||||
ABSTRACT_TYPE(/mob/living/simple_animal/hostile/commanded)
|
||||
name = "commanded"
|
||||
var/short_name = null
|
||||
stance = COMMANDED_STOP
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/mob/living/simple_animal/hostile
|
||||
abstract_type = /mob/living/simple_animal/hostile
|
||||
|
||||
ABSTRACT_TYPE(/mob/living/simple_animal/hostile)
|
||||
faction = "hostile"
|
||||
var/stance = HOSTILE_STANCE_IDLE //Used to determine behavior
|
||||
var/mob/living/target_mob
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
//For things that swim and don't do much else, but also bite!
|
||||
/mob/living/simple_animal/hostile/retaliate/aquatic
|
||||
abstract_type = /mob/living/simple_animal/hostile/retaliate/aquatic
|
||||
|
||||
ABSTRACT_TYPE(/mob/living/simple_animal/hostile/retaliate/aquatic)
|
||||
name = "aquatic animal"
|
||||
desc = DESC_PARENT
|
||||
icon = 'icons/mob/npc/fish.dmi'
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/mob/living/simple_animal/hostile/retaliate
|
||||
abstract_type = /mob/living/simple_animal/hostile/retaliate
|
||||
|
||||
ABSTRACT_TYPE(/mob/living/simple_animal/hostile/retaliate)
|
||||
var/list/enemies = list()
|
||||
|
||||
/mob/living/simple_animal/hostile/retaliate/Destroy()
|
||||
|
||||
@@ -68,8 +68,7 @@
|
||||
// may be opened to change power cell
|
||||
// three different channels (lighting/equipment/environ) - may each be set to on, off, or auto
|
||||
|
||||
/obj/machinery/power/apc
|
||||
abstract_type = /obj/machinery/power/apc //This is an abstract representation of the APC, use one of the subtypes for the actual APC
|
||||
ABSTRACT_TYPE(/obj/machinery/power/apc)
|
||||
name = "area power controller"
|
||||
desc = "A control terminal for the area electrical systems."
|
||||
desc_info = "An APC (Area Power Controller) regulates and supplies backup power for the area they are in. Their power channels are divided \
|
||||
|
||||
@@ -120,8 +120,7 @@
|
||||
*
|
||||
* Parent class for all alcoholic reagents, though this one shouldn't be used anywhere
|
||||
*/
|
||||
/singleton/reagent/alcohol
|
||||
abstract_type = /singleton/reagent/alcohol
|
||||
ABSTRACT_TYPE(/singleton/reagent/alcohol)
|
||||
name = null
|
||||
description = DESC_PARENT
|
||||
reagent_state = LIQUID
|
||||
|
||||
@@ -501,8 +501,7 @@
|
||||
|
||||
// Eridani
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/bowl
|
||||
abstract_type = /obj/item/reagent_containers/food/snacks/bowl
|
||||
ABSTRACT_TYPE(/obj/item/reagent_containers/food/snacks/bowl)
|
||||
name = "a bowl of item"
|
||||
desc = "If you're seeing this, something has gone wrong D:"
|
||||
icon = 'icons/obj/item/reagent_containers/food/cultural/human.dmi'
|
||||
|
||||
@@ -140,8 +140,7 @@
|
||||
reagent_data = list(/singleton/reagent/nutriment = list("spaghetti" = 5, "seasoned vegetables" = 4), /singleton/reagent/nutriment/protein= list ("ground beef" = 5))
|
||||
bitesize = 3
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/ravioli
|
||||
abstract_type = /obj/item/reagent_containers/food/snacks/ravioli
|
||||
ABSTRACT_TYPE(/obj/item/reagent_containers/food/snacks/ravioli)
|
||||
icon = 'icons/obj/item/reagent_containers/food/noodles.dmi'
|
||||
icon_state = "ravioli"
|
||||
trash = /obj/item/trash/plate
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/singleton/state_transition/weather
|
||||
abstract_type = /singleton/state_transition/weather
|
||||
ABSTRACT_TYPE(/singleton/state_transition/weather)
|
||||
var/likelihood_weighting = 100
|
||||
|
||||
/singleton/state_transition/weather/is_open(datum/holder)
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
/singleton/state/weather
|
||||
|
||||
abstract_type = /singleton/state/weather
|
||||
|
||||
ABSTRACT_TYPE(/singleton/state/weather)
|
||||
var/name = "Undefined"
|
||||
var/descriptor = "The weather is undefined."
|
||||
|
||||
|
||||
@@ -185,6 +185,10 @@ GLOBAL_VAR_INIT(running_create_and_destroy, FALSE)
|
||||
GLOB.running_create_and_destroy = TRUE
|
||||
for(var/type_path in typesof(/atom/movable, /turf) - ignore) //No areas please
|
||||
|
||||
//No abstract types
|
||||
if(is_abstract(type_path))
|
||||
continue
|
||||
|
||||
TEST_DEBUG("[name]: now creating and destroying: [type_path]")
|
||||
|
||||
if(ispath(type_path, /turf))
|
||||
|
||||
@@ -41,8 +41,7 @@ var/ascii_reset = "[ascii_esc]\[0m"
|
||||
// We list these here so we can remove them from the for loop running this.
|
||||
// Templates aren't intended to be ran but just serve as a way to create child objects of it with inheritable tests for quick test creation.
|
||||
|
||||
/datum/unit_test
|
||||
abstract_type = /datum/unit_test
|
||||
ABSTRACT_TYPE(/datum/unit_test)
|
||||
var/name = "template - should not be ran."
|
||||
var/disabled = 0 // If we want to keep a unit test in the codebase but not run it for some reason.
|
||||
var/async = 0 // If the check can be left to do it's own thing, you must define a check_result() proc if you use this.
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
################################
|
||||
# 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
|
||||
# - (fixes bugs)
|
||||
# wip
|
||||
# - (work in progress)
|
||||
# qol
|
||||
# - (quality of life)
|
||||
# soundadd
|
||||
# - (adds a sound)
|
||||
# sounddel
|
||||
# - (removes a sound)
|
||||
# rscadd
|
||||
# - (adds a feature)
|
||||
# rscdel
|
||||
# - (removes a feature)
|
||||
# imageadd
|
||||
# - (adds an image or sprite)
|
||||
# imagedel
|
||||
# - (removes an image or sprite)
|
||||
# spellcheck
|
||||
# - (fixes spelling or grammar)
|
||||
# experiment
|
||||
# - (experimental change)
|
||||
# balance
|
||||
# - (balance changes)
|
||||
# code_imp
|
||||
# - (misc internal code change)
|
||||
# refactor
|
||||
# - (refactors code)
|
||||
# config
|
||||
# - (makes a change to the config files)
|
||||
# admin
|
||||
# - (makes changes to administrator tools)
|
||||
# server
|
||||
# - (miscellaneous changes to server)
|
||||
#################################
|
||||
|
||||
# Your name.
|
||||
author: FluffyGhost
|
||||
|
||||
# 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, this gets changed to [] after reading. Just remove the brackets when you add new shit.
|
||||
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
|
||||
changes:
|
||||
- refactor: "Refactored the abstract meta propriety into defines."
|
||||
- refactor: "It's now more easy to spot/see abstract types thanks to the macro that defines them."
|
||||
- rscadd: "Added a check on initialization of atoms to avoid spawning abstract types."
|
||||
- rscadd: "Made the spawn_atom proc check for abstractness."
|
||||
- rscadd: "Made the spawn_atom proc use tgui_list for types list shorter than 1000 elements, which enables to search in them. It's too laggy on larger lists so above 1000 it uses the builtin input."
|
||||
- refactor: "Made the spawn_atom use a list subtraction instead of a double list, it's lighter on memory and processing."
|
||||
@@ -242,7 +242,6 @@
|
||||
/obj/structure/closet/cabinet,
|
||||
/obj/item/clothing/under/pants/camo,
|
||||
/obj/item/clothing/under/pants/mustang,
|
||||
/obj/item/clothing/under/pants,
|
||||
/obj/item/clothing/under/pants/tacticool,
|
||||
/obj/item/clothing/under/pants/track,
|
||||
/obj/effect/decal/cleanable/dirt,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// Hey! Listen! Update \config\away_site_blacklist.txt with your new ruins!
|
||||
|
||||
/datum/map_template/ruin/away_site
|
||||
abstract_type = /datum/map_template/ruin/away_site
|
||||
ABSTRACT_TYPE(/datum/map_template/ruin/away_site)
|
||||
prefix = "maps/away/"
|
||||
|
||||
/// If null, ignored, and exoplanet generation is not used.
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/datum/map_template/ruin/exoplanet
|
||||
abstract_type = /datum/map_template/ruin/exoplanet
|
||||
|
||||
ABSTRACT_TYPE(/datum/map_template/ruin/exoplanet)
|
||||
prefix = "maps/random_ruins/exoplanets/"
|
||||
template_flags = TEMPLATE_FLAG_NO_RUINS
|
||||
spawn_weight = 1
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Hey! Listen! Update \config\space_ruin_blacklist.txt with your new ruins!
|
||||
|
||||
/datum/map_template/ruin/space
|
||||
abstract_type = /datum/map_template/ruin/space
|
||||
|
||||
ABSTRACT_TYPE(/datum/map_template/ruin/space)
|
||||
prefix = "maps/random_ruins/space_ruins/"
|
||||
spawn_cost = 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user