Skill modifiers datum WIP.

This commit is contained in:
Ghommie
2020-05-10 02:11:48 +02:00
parent a6ad4dc9bf
commit 300331ccb7
32 changed files with 408 additions and 193 deletions
-21
View File
@@ -185,27 +185,6 @@
#define COMSIG_MOB_SPELL_CAN_CAST "mob_spell_can_cast" //from base of /obj/effect/proc_holder/spell/can_cast(): (spell)
#define COMSIG_MOB_ACTION_SKILL_MOD "mob_action_skill_mod" //from base of /datum/skill_holder/action_skills_mod() : (proc args list, list/mod_values)
#define ACTION_SKILL_MOD_SKILL 1 //redundancy.
#define ACTION_SKILL_MOD_VALUE 2
#define ACTION_SKILL_MOD_THRESHOLD 3
#define ACTION_SKILL_MOD_IS_MULTI 4
//other mod values, kept separate from the args
#define MOD_VALUES_SKILL_MOD 1
#define COMSIG_MOB_ITEM_ACTION_SKILLS_MOD "mob_item_action_skills_mod" //from base of /datum/skill_holder/item_action_skills_mod() : (proc args list, mod_values)
#define ITEM_SKILLS_MOD_ITEM 1 //redundancy
#define ITEM_SKILLS_MOD_VALUE 2
#define ITEM_SKILLS_MOD_FLAGS 3
#define ITEM_SKILLS_MOD_BAD_FLAGS 4
#define ITEM_SKILLS_MOD_IS_MULTI 5
//other mod values, kept separate from the args
#define MOD_VALUES_ITEM_SKILLS_SUM 1
#define MOD_VALUES_ITEM_SKILLS_DIV 2
#define MOD_VALUES_ITEM_SKILLS_CHECKED 3
#define COMSIG_MOB_SKILL_GET_AFFINITY "mob_skill_get_affinity" //from base of /datum/skill_holder/get_skill_affinity(): (skill_path, list/return_value)
// /mob/living signals
#define COMSIG_LIVING_REGENERATE_LIMBS "living_regenerate_limbs" //from base of /mob/living/regenerate_limbs(): (noheal, excluded_limbs)
#define COMSIG_LIVING_RESIST "living_resist" //from base of mob/living/resist() (/mob/living)
+24 -3
View File
@@ -20,9 +20,7 @@
// Standard values for job starting skill affinities
#define STARTING_SKILL_AFFINITY_SURGERY_MEDICAL 1.2
#define STARTING_SKILL_AFFINITY_WIRING_ENGI_ROBO 1.2
#define STARTING_SKILL_AFFINITY_DEF_JOB 1.2
// Standard values for skill gain (this is multiplied by affinity)
@@ -75,3 +73,26 @@
#define DORF_SKILL_COMPETENT 3
#define DORF_SKILL_EXPERT 8
#define DORF_SKILL_MASTER 12
/// Skill modifier defines and flags.
#define MODIFIER_SKILL_VALUE (1<<0)
#define MODIFIER_SKILL_AFFINITY (1<<1)
#define MODIFIER_SKILL_LEVEL (1<<2)
///makes the skill modifier a multiplier, not an addendum.
#define MODIFIER_SKILL_MULT (1<<3)
///Sets the skill to the defined value if lower than that. Highly reccomended you don't use it with MODIFIER_SKILL_MULT.
#define MODIFIER_SKILL_VIRTUE (1<<4)
///Does the opposite of the above. combining both effectively results in the skill being locked to the specified value.
#define MODIFIER_SKILL_HANDICAP (1<<5)
///Makes it untransferred by mind.transfer_to()
#define MODIFIER_SKILL_BODYBOUND (1<<6)
///Adds the difference of the current value and the value stored at the time the modifier was added to the result.
#define MODIFIER_SKILL_ORIGIN_DIFF (1<<7)
#define MODIFIER_TARGET_VALUE "value"
#define MODIFIER_TARGET_LEVEL "level"
#define MODIFIER_TARGET_AFFINITY "affinity"
///Ascending priority defines.
#define MODIFIER_SKILL_PRIORITY_DEF 50
#define MODIFIER_SKILL_PRIORITY_MAX 100 //max priority, meant for job/antag modifiers so they don't null out any debuff
+22
View File
@@ -6,3 +6,25 @@
//More experience value getter macros
#define GET_STANDARD_LVL(lvl) XP_LEVEL(STD_XP_LVL_UP, STD_XP_LVL_MULTI, lvl)
#define GET_DORF_LVL(lvl) DORF_XP_LEVEL(DORF_XP_LVL_UP, DORF_XP_LVL_MULTI, lvl)
#define IS_SKILL_VALUE_GREATER(path, existing, new_value) GLOB.skill_datums[path].is_value_greater(existing, new_value)
#define SANITIZE_SKILL_VALUE(path, value) GLOB.skill_datums[path].sanitize_value(value)
///Doesn't automatically round the value.
#define SANITIZE_SKILL_LEVEL(path, lvl) clamp(lvl, 0, GLOB.skill_datums[path].max_levels)
/**
* A simple universal comsig for body bound skill modifiers.
* Technically they are still bound to the mind, but other signal procs will take care of adding and removing the modifier
* from/to new/old minds.
*/
#define ADD_SKILL_MODIFIER_BODY(mod, body) \
mod.RegisterSignal(body, COMSIG_MOB_ON_NEW_MIND, /datum/skill_modifier.proc/on_mob_new_mind, TRUE)
///Macro used when adding generic singleton skill modifiers.
#define ADD_SINGLETON_SKILL_MODIFIER(mind, path, id) \
if(!GLOB.skill_modifiers[id]){\
new path(id)\
};\
mind.add_skill_modifier(id ? "[path]&[id]" : path)