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:
Fluffy
2024-08-23 10:49:28 +00:00
committed by GitHub
parent cc5a31ab59
commit 41a05bc196
43 changed files with 177 additions and 146 deletions
@@ -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()