Skills System Revival: The Things She Remembered Had Never Been Her Own (#21853)

This PR is a revisit to the previously derelict PR #20159 that has been
unfinished for sometime now. More details about it in general can be
found here:
https://github.com/orgs/Aurorastation/projects/2?pane=issue&itemId=53167153

For awhile I've been talking about "Things I've been doing but it would
be really nice to do them with a skills system", or "And here's how I
would put this into the skills system when it's done". The main thing
that was stopping me from building it myself was having poor real life
skills in UI code and in DB code. However, I've gotten permission to
resume this PR, which has already completed the steps I would not have
been able to do myself. The rest of the PR fits well into my skillset as
a dev.

I'm opening this PR as a draft so as to enable my dev environment to
locally track all the previously modified files. I'll take this PR out
of draft and give this a full writeup when I have more work to show for
the PR this weekend.

### TODO

- [x] Rework a decent chunk of the currently existing skills to no
longer require hardcoded inserts into other systems. EG, converting from
classical ss13 methods, to modern /tg/-style ECS coding methods that
work off of component-signal patterns.
- [x] Make sure all of the existing skills have actual game
functionality (I won't PR a 2016 Baystation12 situation where 90% of the
skills are fluff only)
- [x] Add the various skills not yet made but are necessary for
completion sake, EG: Pilot (Spacecraft), Gunnery, Pilot (Walkers).
- [x] Examine each existing job in the game and assess whether it should
have a skill made with it in mind, or if it's covered by an existing
skill.
- [x] TO DISCUSS, BUT NOT ESSENTIAL: Additional skill proposals not
currently in the pre-existing TODO list, proposing subcategories.
- [x] Ensure that the previous TODO list is completed.

### Current Skills
The current list of skills, checkmarked for if I've completed them/they
have actual game mechanics. Or if we're just relegating them to separate
PRs. Originally this list was going to be forced to visit for a bare
minimum "does at least one thing" requirement, but now that is being
forgone due to this PR ballooning out of control and in complexity, as
well as development time overruns.

- [x] Bartending
- [x] Cooking
- [x] Gardening
- [x] Entertaining
- [x] Electrical Engineering
- [x] Mechanical Engineering
- [x] Atmospherics Systems
- [x] Reactor Systems
- [x] Medicine
- [x] Surgery
- [x] Pharmacology
- [x] Anatomy
- [x] Forensics
- [x] Robotics
- [x] Pilot: Spacecraft
- [x] Pilot: Exosuits
- [x] Research
- [x] Xenobotany
- [x] Xenoarchaeology
- [x] Xenobiology
- [x] Unarmed Combat
- [x] Armed Combat
- [x] Firearms
- [x] Leadership

---------

Signed-off-by: VMSolidus <evilexecutive@gmail.com>
Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: FabianK3 <21039694+FabianK3@users.noreply.github.com>
Co-authored-by: Matt Atlas <mattiathebest2000@hotmail.it>
This commit is contained in:
VMSolidus
2026-04-18 14:33:48 +00:00
committed by GitHub
co-authored by Matt Atlas FabianK3 Matt Atlas
parent 2948b1dc87
commit 260f744906
107 changed files with 2965 additions and 185 deletions
@@ -242,37 +242,31 @@ INITIALIZE_IMMEDIATE(/mob/abstract/new_player)
/mob/abstract/new_player/proc/IsJobAvailable(rank)
var/datum/job/job = SSjobs.GetJob(rank)
if (!job)
return FALSE
if (!job.is_position_available())
return FALSE
if (jobban_isbanned(src,rank))
// Check if the job is open in-round.
if (!job || !job.is_position_available() \
/* check for job bans */\
|| jobban_isbanned(src,rank) \
/* check for species blacklists */\
|| (job.blacklisted_species && (GLOB.all_species[client.prefs.species].name in job.blacklisted_species)) \
/* check for citizenship restrictions */\
|| job.blacklisted_citizenship && (astype(SSrecords.citizenships[client.prefs.citizenship], /datum/citizenship).name in job.blacklisted_citizenship))
return FALSE
if(job.blacklisted_species) // check for restricted species
var/datum/species/S = GLOB.all_species[client.prefs.species]
if(S.name in job.blacklisted_species)
return FALSE
if(job.blacklisted_citizenship)
var/datum/citizenship/C = SSrecords.citizenships[client.prefs.citizenship]
if(C.name in job.blacklisted_citizenship)
return FALSE
// Checks for faction requirements.
var/datum/faction/faction = SSjobs.name_factions[client.prefs.faction] || SSjobs.default_faction
var/list/faction_allowed_roles = unpacklist(faction.allowed_role_types)
if (!(job.type in faction_allowed_roles))
if (!(job.type in faction_allowed_roles) \
|| !faction.can_select(client.prefs,src) \
|| !(client.prefs.GetPlayerAltTitle(job) in client.prefs.GetValidTitles(job)))
return FALSE
if(!faction.can_select(client.prefs,src))
return FALSE
if(!(client.prefs.GetPlayerAltTitle(job) in client.prefs.GetValidTitles(job))) // does age/species check for us!
return FALSE
// Checks for skill requirements.
for (var/key,value in job.skill_requirements)
if (key && client.prefs.skills[key] < value)
return FALSE
return TRUE
/mob/abstract/new_player/proc/AttemptLateSpawn(rank,var/spawning_at)
if(src != usr)
return 0
@@ -175,6 +175,16 @@
var/hit_zone = H.zone_sel.selecting
var/obj/item/organ/external/affecting = get_organ(hit_zone)
// Check both "attacker" and "defender" for component based responses to unarmed attacks.
var/attacker_skill_level = SKILL_LEVEL_UNFAMILIAR // Lacking any component responses, treat the attacker as 'rank 1'
var/defender_skill_level = SKILL_LEVEL_UNFAMILIAR // Lacking any component responses, treat the defender as 'rank 1'
var/miss_chance = 15 // Base chance for melee attacks targeting body parts other than the torso to fail.
var/block_chance = 20 // Chance to block incoming attacks when in Harm or Grab intent.
SEND_SIGNAL(H, COMSIG_UNARMED_HARM_ATTACKER, src, &attacker_skill_level, &miss_chance, &rand_damage, &block_chance)
SEND_SIGNAL(src, COMSIG_UNARMED_HARM_DEFENDER, H, &defender_skill_level, &miss_chance, &rand_damage, &block_chance)
if (miss_chance < 1)
accurate = TRUE
if(!affecting || affecting.is_stump())
to_chat(M, SPAN_DANGER("They are missing that limb!"))
return 1
@@ -186,7 +196,7 @@
accurate = 1
if(I_HURT, I_GRAB)
// We're in a fighting stance, there's a chance we block
if(src.canmove && src!=H && prob(20))
if(src.canmove && src!=H && block_chance >= 1 && prob(block_chance))
block = 1
if (M.grabbed_by.len)
@@ -227,9 +237,10 @@
*/
if(prob(80))
hit_zone = ran_zone(hit_zone)
if(prob(15) && hit_zone != BP_CHEST) // Missed!
if(prob(miss_chance) && hit_zone != BP_CHEST) // Missed!
if(!src.lying)
attack_message = "[H] attempted to strike [src], but missed!"
attack_message = "[H] attempted to strike [src], [attacker_skill_level - defender_skill_level <= -1 ? "but [src] [pick("dodged", "ducked")] out of the way!" : "but missed!"]"
else
attack_message = "[H] attempted to strike [src], but [src.get_pronoun("he")] rolled out of the way!"
src.set_dir(pick(GLOB.cardinals))
@@ -308,17 +319,24 @@
to_chat(M, SPAN_NOTICE("You don't want to risk hurting [src]!"))
return FALSE
var/disarm_cost
var/obj/item/organ/internal/machine/power_core/cell = M.internal_organs_by_name[BP_CELL]
var/obj/item/cell/potato
if(cell)
potato = cell.cell
var/attacker_skill_level = SKILL_LEVEL_UNFAMILIAR
var/defender_skill_level = SKILL_LEVEL_UNFAMILIAR
var/disarm_cost = 0
var/push_chance = 25
var/disarm_chance = 25
SEND_SIGNAL(H, COMSIG_UNARMED_DISARM_ATTACKER, src, &attacker_skill_level, &disarm_cost, &push_chance, &disarm_chance)
SEND_SIGNAL(src, COMSIG_UNARMED_DISARM_DEFENDER, H, &defender_skill_level, &disarm_cost, &push_chance, &disarm_chance)
var/skill_difference = attacker_skill_level - defender_skill_level
if(isipc(M))
var/obj/item/cell/potato = astype(M.internal_organs_by_name[BP_CELL], /obj/item/organ/internal/machine/power_core)?.cell
disarm_cost = potato.maxcharge / 24
if(potato.charge < disarm_cost)
to_chat(M, SPAN_DANGER("You don't have enough charge to disarm someone!"))
return FALSE
// Skill difference will be negative if the opponent is stronger than us.
if(skill_difference < 0)
disarm_cost += -(skill_difference * 50)
potato.use(disarm_cost)
else
if(M.max_stamina > 0)
@@ -330,6 +348,9 @@
if(M.stamina <= disarm_cost)
to_chat(M, SPAN_DANGER("You're too tired to disarm someone!"))
return FALSE
// Skill difference will be negative if the opponent is stronger than us.
if(skill_difference < 0)
disarm_cost = max(0, disarm_cost - (skill_difference * 5))
M.stamina = clamp(M.stamina - disarm_cost, 0, M.max_stamina) // attempting to knock something out of someone's hands, or pushing them over, is exhausting!
else if(M.max_stamina <= 0)
disarm_cost = M.max_nutrition / 6
@@ -353,14 +374,18 @@
//See if they have any weapons to retaliate with
if(src.a_intent != I_HELP)
for(var/obj/item/W in holding)
if(W && prob(holding[W]))
if(!W)
continue
var/misfire_chance = holding[W] + -(skill_difference * 10)
if(W && prob(misfire_chance))
if(istype(W, /obj/item/grab))
var/obj/item/grab/G = W
if(G.affecting && G.affecting != M)
visible_message(SPAN_WARNING("[src] repositions \the [G.affecting] to block \the [M]'s disarm attempt!"), SPAN_NOTICE("You reposition \the [G.affecting] to block \the [M]'s disarm attempt!"))
G.attack_hand(M)
return
if(istype(W,/obj/item/gun))
if(istype(W, /obj/item/gun))
var/list/turfs = list()
for(var/turf/T in view())
turfs += T
@@ -370,7 +395,7 @@
return W.afterattack(target,src)
else
if(M.Adjacent(src))
visible_message(SPAN_DANGER("[src] retaliates against [M]'s disarm attempt with [W]!"))
visible_message(SPAN_DANGER("[src] retaliates against [M]'s [attacker_skill_level == SKILL_LEVEL_UNFAMILIAR ? "inexperienced shoving" : "disarm attempt"] with [W]!"))
return M.attackby(W,src)
var/randn = rand(1, 100)
@@ -402,7 +427,7 @@
forceMove(GET_TURF_ABOVE(current_turf)) //We use GET_TURF_ABOVE so people can't cheese it by turning their sprite.
return
if(randn <= 25)
if(randn <= push_chance)
if(H.gloves && istype(H.gloves,/obj/item/clothing/gloves/force))
apply_effect(6, WEAKEN)
playsound(loc, 'sound/weapons/push_connect.ogg', 50, 1, -1)
@@ -423,8 +448,8 @@
playsound(loc, 'sound/weapons/push.ogg', 50, 1, -1)
return
if(randn <= 60)
if(H.gloves && istype(H.gloves,/obj/item/clothing/gloves/force))
if(randn <= disarm_chance)
if(H.gloves && istype(H.gloves, /obj/item/clothing/gloves/force))
playsound(loc, 'sound/weapons/push_connect.ogg', 50, 1, -1)
visible_message(SPAN_DANGER("[M] shoves, sending [src] flying!"))
step_away(src,M,15)
@@ -454,12 +479,14 @@
//No return here is intentional, as it will then try to disarm other items, and/or play a failed disarm message
playsound(loc, SFX_PUNCH_MISS, 25, 1, -1)
visible_message(SPAN_DANGER("[M] attempted to disarm [src]!"))
visible_message(SPAN_DANGER("[M] [attacker_skill_level == SKILL_LEVEL_UNFAMILIAR ? "[pick("inexpertly", "clumsily")] disarm" : "disarm"] attempted to disarm [src]!"))
return
/mob/living/carbon/human/proc/cpr(mob/living/carbon/human/H, var/starting = FALSE, var/cpr_mode)
var/obj/item/main_hand = H.get_active_hand()
var/obj/item/off_hand = H.get_inactive_hand()
var/datum/component/skill/medicine/medicine_component = H.GetComponent(MEDICINE_SKILL_COMPONENT)
var/medicine_skill = medicine_component ? medicine_component.skill_level : SKILL_LEVEL_TRAINED
if(istype(main_hand) || istype(off_hand))
cpr = FALSE
to_chat(H, SPAN_NOTICE("You cannot perform CPR with anything in your hands."))
@@ -478,7 +505,12 @@
if(!cpr_mode)
cpr = FALSE
return
to_chat(H, SPAN_NOTICE("You begin performing [cpr_mode] on \the [src]."))
var/cpr_attempt_message = SPAN_DANGER("You have no idea how to perform CPR on \the [src]... but you're going to try your best!")
if(medicine_skill > SKILL_LEVEL_UNFAMILIAR)
cpr_attempt_message = SPAN_NOTICE("You begin performing [cpr_mode] on \the [src].")
to_chat(H, cpr_attempt_message)
H.do_attack_animation(src, null, image('icons/mob/screen/generic.dmi', src, "cpr", src.layer + 1))
var/starting_pixel_y = pixel_y
@@ -490,23 +522,31 @@
cpr = FALSE //If it cancelled, cancel it. Simple.
if(cpr_mode == "Full CPR")
cpr_compressions(H)
cpr_ventilation(H)
cpr_compressions(H, medicine_skill)
cpr_ventilation(H, medicine_skill)
if(cpr_mode == "Compressions")
cpr_compressions(H)
cpr_compressions(H, medicine_skill)
if(cpr_mode == "Mouth-to-Mouth")
cpr_ventilation(H)
cpr_ventilation(H, medicine_skill)
cpr(H, FALSE, cpr_mode) //Again.
/mob/living/carbon/human/proc/cpr_compressions(mob/living/carbon/human/H)
/mob/living/carbon/human/proc/cpr_compressions(mob/living/carbon/human/H, medicine_skill)
if(is_asystole())
if(prob(5 * rand(2, 3)))
var/break_probability = 5 * rand(2,3)
if(medicine_skill < SKILL_LEVEL_FAMILIAR)
break_probability *= 3
else if(medicine_skill < SKILL_LEVEL_TRAINED)
break_probability *= 1.5
if(prob(break_probability))
var/obj/item/organ/external/chest = get_organ(BP_CHEST)
if(chest)
chest.fracture()
if(medicine_skill < SKILL_LEVEL_FAMILIAR)
to_chat(H, FONT_HUGE(SPAN_DANGER("Something crunches under your hands...!")))
var/obj/item/organ/internal/heart/heart = internal_organs_by_name[BP_HEART]
if(heart)
@@ -515,7 +555,7 @@
if(stat != DEAD && prob(10 * rand(0.5, 1)))
resuscitate()
/mob/living/carbon/human/proc/cpr_ventilation(mob/living/carbon/human/H)
/mob/living/carbon/human/proc/cpr_ventilation(mob/living/carbon/human/H, medicine_skill)
if(!H.check_has_mouth())
to_chat(H, SPAN_WARNING("You don't have a mouth, you cannot do mouth-to-mouth resuscitation!"))
return
@@ -537,6 +577,12 @@
if(L)
var/datum/gas_mixture/breath = H.get_breath_from_environment()
var/fail = L.handle_breath(breath, 1)
if(medicine_skill == SKILL_LEVEL_UNFAMILIAR)
fail = prob(80)
if(fail)
to_chat(H, SPAN_DANGER("No... that wasn't how you do it!"))
if(!fail)
if(!L.is_bruised() || (L.is_bruised() && L.rescued))
losebreath = 0
@@ -449,6 +449,13 @@
/// Which species-unique robolimb types can this species take?
var/list/valid_prosthetics
/// Modifiers for the available skill points for this species. Assoc list of SKILL_CATEGORY to number.
var/list/skill_points_modifiers = list(
SKILL_CATEGORY_EVERYDAY = 1,
SKILL_CATEGORY_OCCUPATIONAL = 1,
SKILL_CATEGORY_COMBAT = 1
)
//Sleeping stuff
/// Does this species sleep standing up?
var/sleeps_upright = FALSE
@@ -461,6 +468,9 @@
/// The default lighting alpha of this species. Override to set innate NVGs.
var/default_lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
/// Controls whether this species spawns with a Morale Component.
var/has_morale = TRUE
/datum/species/proc/get_eyes(var/mob/living/carbon/human/H)
return
@@ -591,6 +601,9 @@
if(natural_armor)
H.AddComponent(natural_armor_type, natural_armor)
if(has_morale)
H.LoadComponent(MORALE_COMPONENT)
/datum/species/proc/tap(var/mob/living/carbon/human/H,var/mob/living/target)
if(H.on_fire)
target.fire_stacks += 1
@@ -1080,5 +1093,18 @@
* This proc handles the species temperature regulation. By default, it just adds `passive_temp_gain` to the human's bodytemperature.
* Can be overridden for more complex calculations.
*/
/datum/species/proc/handle_temperature_regulation(mob/living/carbon/human/human, seconds_per_tick)
human.bodytemperature += passive_temp_gain * seconds_per_tick
/**
* Gets a modifier for a skill category based on the character age or other species things.
* Must return a list with all three skill categories to a modifier (example: list(SKILL_CATEGORY_EVERYDAY = 1.5) )
*/
/datum/species/proc/modify_skill_points(singleton/skill_category/skill_category, age)
var/list/skill_age_modifiers = list(
SKILL_CATEGORY_EVERYDAY = 1,
SKILL_CATEGORY_OCCUPATIONAL = 1,
SKILL_CATEGORY_COMBAT = 1
)
return skill_age_modifiers