Files
Bubberstation/code/modules/unit_tests/spell_names.dm
SkyratBot c68fea7cba [MIRROR] Completely removes proc_holders from existence. Refactors all wizard, xeno, spider, and genetics powers to be actions. Also refactors and sorts ton of accompanying code. [MDB IGNORE] (#14666)
* Completely removes `proc_holders` from existence. Refactors all wizard, xeno, spider, and genetics powers to be actions. Also refactors and sorts ton of accompanying code.

* our changes

* yes

* 0

* Update blackmesa.dmm

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
2022-07-01 20:33:30 +01:00

33 lines
1.1 KiB
Plaintext

/**
* Validates that all spells have a different name.
*
* Spell names are used for debugging in some places
* as well as an option for admins giving out spells,
* so every spell should have a distinct name.
*
* If you're making a subtype with only one or two big changes,
* consider adding an adjective to the name.
*
* "Lesser Fireball" for a subtype of Fireball with a shorter cooldown.
* "Deadly Magic Missile" for a subtype of Magic Missile that does damage, etc.
*/
/datum/unit_test/spell_names
/datum/unit_test/spell_names/Run()
var/list/types_to_test = typesof(/datum/action/cooldown/spell)
var/list/existing_names = list()
for(var/datum/action/cooldown/spell/spell_type as anything in types_to_test)
var/spell_name = initial(spell_type.name)
if(spell_name == "Spell")
continue
if(spell_name in existing_names)
Fail("Spell: [spell_name] ([spell_type]) had a name identical to another spell. \
This can cause confusion for admins giving out spells, and while debugging. \
Consider giving the name an adjective if it's a subtype. (\"Greater\", \"Lesser\", \"Deadly\".)")
continue
existing_names += spell_name