forked from Baystation12/Baystation12
-
Notifications
You must be signed in to change notification settings - Fork 28
Skills
sabira edited this page Jun 23, 2018
·
1 revision
- Every skill is defined via a
/decl/hierarchy/skill/skill_category/skill_name
in skill.dm. - These are initialized once and
/decl/hierarchy/skill
is stored in decls_repository. The actual skill instances are stored inGLOB.skills
(this is a list). - Every mob has a variable
mob.skillset
of typedatum/skillset
(or a subtype of that). - The skillset contains all of the skill information for that mob, along with various procs for obtaining or manipulating it.
- Using those procs, you will be able to extract skill values from the mob. These should be positive integers between
SKILL_MIN
andSKILL_MAX
. - These values each have define corresponding to them, starting with SKILL_. Use that define, not the number.
- Most mobs (i.e. not player-controlled ones) will respond
SKILL_DEFAULT
when checked for skills. - Players set up their skill preferences on a per-job basis in the player setup screen, under occupations. See below for more.
- At round start, these preferences are transferred over to the relevant mob. This is handled in the
skillset.obtain_from_client
proc. - If a player is an antag, this is bypassed. Modify the
skillset.set_antag_skills
proc to change the antag behavior. - When minds are transferred between mobs, the skillset is generally copied over to the new mob.
- Silicon mobs do not inherit skills in this way.
- The correct way of obtaining the value of a mob's skill is to use the get_skill_value proc on the mob. It takes a skill path, which should be called via a corresponding SKILL_ define.
- Do not try to get the datum instance out of decls_repository; use the type path getter instead or else find it in GLOB.skills.
- The values can be used directly to make skill checks.
- Additional helper procs may be given to mobs to convert skill values into times, probabilities, or whatever in a reusable way.
- Currently implemented examples:
-
skill_check(SKILL_PATH, SKILL_VALUE)
returns 1 if the mob's skill is >= value. -
skill_delay_mult(SKILL_PATH, factor)
gives a generic way to modify times via skills. -
do_skilled(base_delay, SKILL_PATH, atom/target, factor)
is like do_after, but modifies the time byskill_delay_mult
-
skill_fail_chance(SKILL_PATH, fail_chance, no_more_fail, factor)
modifies fail probabilities according to skill.
-
- Currently implemented examples:
- Skill setup works largely on a per-job basis, with some per-species and branch modifiers.
- For each job, a minimum value can be assigned to any skill. To do this, add an entry of
/decl/hierarchy/skill/skill_category/skill_name = min_value
to that job datums's min_skill variable (this is a list).- This minimum value is given for free to the player, and does not use up allocation points.
- For each job, a maximum value can also be assigned. Add a similar entry to the
max_skills
list. - For each job, a base number of free points can be assigned. This is given in the job datum's
skill_points
variable (should be a number). - Free point bonuses/penalties can be specified, for each species, as a function of a player's selected age.
- This can be done by overwriting species datum's
skills_from_age
proc, which takes in the age and returns an integer (positive or negative) which will be added to all jobs' available skill points.
- This can be done by overwriting species datum's
- Free point bonuses/penalties can be specified, for each species, as a function of the job.
- To do this, add the entry
/datum/job/my_job = points_to_add
to the species datum'sjob_skill_buffs
variable (this is a list). Thenpoints_to_add
(positive or negative) will be added to that job's available skill points.
- To do this, add the entry
- Generally, if the free point allocations or min/max values turn out to be negative or otherwise contradictory, this will not result in runtime errors, so make sure to test whether your changes work as intended.
- Savefiles are on a per-job basis. Only affected jobs will have their savefiles reset.
- If a savefile represents a plausable skill point allocation, it will be imported; if not, a default skill allocation is used.
- In particular, changes which increase the number of free skill points, decrease minimum allocations, or increase maximum allocations, will not break savefiles.
- Changes which increase minimum allocations or decrease maximum allocations will not reset the entire allocation, but may leave extra unassigned points if the skill cap is reached.
- Changes which decrease the number of free points (including from species/age buffs) may reset the entire job's allocation.
- The size of the savefile roughly corresponds to the number of skills with nondefault allocations; this is only significant if many jobs have nondefault skill selections.
- If you are antaging/unantaging someone via the traitor panel, this will usually change their skills.
- To make sure they have the correct skills (as in their prefs), you should check that the role (top item) is correct, in addition to their antag status.
- If you need to change their skill values directly, you can use VV on mob/skillset, in particular changing the values of the entries in skill_list.
- There is a show skills admin verb, that displays skill values of any human mob (pick from list) in a similar way to the player Show Own Skills verb.
Documentation regarding setting up and using Git.
Making heads or tails of specific GitHub pages, for the uninitiated.
Documentation regarding tools external to DM and Git.
Standards and guidelines regarding commenting, contributor conduct and coding standards.