-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moves available abilities to a global list and separates the one big …
…global list of abilities into multiple, and caches stat reqs
- Loading branch information
Showing
8 changed files
with
82 additions
and
54 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
monkestation/code/modules/antagonists/vampire/abilities/discretion/cloak_of_darkness.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
/datum/vampire_ability/cloak_of_darkness | ||
name = "Cloak of Darkness" | ||
desc = "The darkness shrouds your form, making you less visibile, \ | ||
with visiblity scaling on discretion.\ | ||
Requires you to be in the dark. \ | ||
If you stay in the dark for more than half a second, you will become visible again. \" | ||
stat_reqs = list(VAMPIRE_STAT_DISCRETION = 1) | ||
granted_action = /datum/action/cooldown/vampire/cloak_of_darkness | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
monkestation/code/modules/antagonists/vampire/vampire_lists.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/// Associative list of available abilities by their unlock conditions. | ||
/// Abilities that unlock based on a stat use the define of that stat as their key. | ||
/// And ones that have a rank requirement use VAMPIRE_ABILITIES_RANK. | ||
/// There's also VAMPIRE_ABILITIES_ALL if you need it for some reason. | ||
/// The abilities in here are in typepath form. | ||
|
||
/// list of all possible vampire abilities. | ||
GLOBAL_LIST_INIT(vampire_all_abilities, init_available_vampire_abilities()) | ||
/// // Associative list of vampire abilities indexed by stat and then ability type, giving you the stat number that you need | ||
GLOBAL_LIST(vampire_abilities_reqs) | ||
/// Associative list of vampire abilities indexed by ability type containing the stat requirements | ||
GLOBAL_LIST(vampire_abilities_stat) | ||
/// Associative list of vampire abilities indexed by rank containing the abilities that unlock at that rank | ||
GLOBAL_LIST(vampire_abilities_rank) | ||
|
||
/// Initializes the list of available vampire abilities. | ||
/proc/init_available_vampire_abilities() | ||
var/list/all = subtypesof(/datum/vampire_ability) | ||
GLOB.vampire_abilities_stat = list() | ||
GLOB.vampire_abilities_reqs = list() | ||
GLOB.vampire_abilities_rank = list() | ||
|
||
for(var/datum/vampire_ability/ability_type as anything in all) | ||
var/datum/vampire_ability/ability = new ability_type | ||
if(length(ability.stat_reqs)) | ||
GLOB.vampire_abilities_reqs[ability_type] = ability.stat_reqs.Copy() | ||
|
||
if(ability.min_rank != 0) | ||
GLOB.vampire_abilities_rank["[ability.min_rank]"] += list(ability_type) | ||
|
||
for(var/stat_name in ability.stat_reqs) | ||
GLOB.vampire_abilities_stat[stat_name] += list(ability_type) | ||
|
||
qdel(ability) | ||
return all | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters