Various Skill Bugfixes (#22533)

This PR fixes a bunch of skills related bugs, the biggest of which were
the result of the system being overly trusting of the database, when in
reality due to a bunch of unpredictable edge cases, the database is not
guaranteed to always have what I think it has. To fix these bugs, I've
had to slightly refactor how skills are generated on player characters
and antagonists, such that the burden of proof for skills is with the
Skills Subsystem rather than the Database.

Skills generated for a fresh character that has NO preferences saved
(Worst case scenario):

<img width="1491" height="849" alt="image"
src="https://github.com/user-attachments/assets/683fb538-106a-4679-8e2a-30dd45f456a1"
/>

Promoting that same character to Antagonist now increases certain skills
to a minimum baseline:

<img width="1315" height="830" alt="image"
src="https://github.com/user-attachments/assets/94bcc69e-cbbe-45fa-956e-f53b7f5d2779"
/>

By Mel's request, Bluespace Technicians spawn with all skills fully
maxed out for debugging purposes:

<img width="1909" height="985" alt="image"
src="https://github.com/user-attachments/assets/db4f3f65-3d87-47fc-907e-c68eae6d4cdb"
/>
This commit is contained in:
VMSolidus
2026-05-29 20:37:57 +00:00
committed by GitHub
parent 3aa4942572
commit 13f87e4a26
9 changed files with 70 additions and 21 deletions
@@ -22,13 +22,16 @@
/datum/action/leadership/proc/get_target(owner, atom/target, modifiers)
SIGNAL_HANDLER
UnregisterSignal(owner, COMSIG_MOB_CLICKON)
if (. == COMSIG_MOB_CANCEL_CLICKON)
return . // Another signal-handler already got to it.
// Both forms of deliver speech will immediately return control to the caller without blocking.
// Unfortunately StrongDMM is apparently incapable of reading that.
if (owner == target)
UNLINT(deliver_speech_area(owner))
else
UNLINT(deliver_speech_target(owner, target))
UnregisterSignal(owner, COMSIG_MOB_CLICKON)
return COMSIG_MOB_CANCEL_CLICKON
/datum/action/leadership/proc/deliver_speech_area(mob/owner)
@@ -27,22 +27,26 @@
/datum/action/ministry/proc/get_target(owner, atom/target, modifiers)
SIGNAL_HANDLER
UnregisterSignal(owner, COMSIG_MOB_CLICKON)
if (. == COMSIG_MOB_CANCEL_CLICKON)
return . // Another signal-handler already got to it somehow.
. = COMSIG_MOB_CANCEL_CLICKON
if (owner == target)
to_chat(owner, SPAN_NOTICE("You cannot offer a blessing to yourself."))
return COMSIG_MOB_CANCEL_CLICKON
return .
if (!astype(target, /mob)?.client)
to_chat(owner, SPAN_NOTICE("[target] cannot receive a blessing."))
return COMSIG_MOB_CANCEL_CLICKON
return .
if (get_dist(owner, target) >= 2)
to_chat(owner, SPAN_NOTICE("You must be adjacent to [target] to offer them a blessing."))
return COMSIG_MOB_CANCEL_CLICKON
return .
// StrongDMM for whatever ungodly reason can't tell that this proc won't block the caller.
UNLINT(try_give_blessing(target))
UnregisterSignal(owner, COMSIG_MOB_CLICKON)
return COMSIG_MOB_CANCEL_CLICKON
return .
/datum/action/ministry/proc/try_give_blessing(mob/target)
set waitfor = FALSE
+11 -3
View File
@@ -27,10 +27,18 @@
/// The sub-category of this skill. Used to better sort skills.
var/subcategory
/**
* Required skills are always included in the user's saved skills preference, even if it's at the lowest rank.
* This is needed for skills that rely on components.
* Required skills are always loaded at a minimum skill level of 1 regardless of if they were saved to the preferences.
* This is useful for skills that provide a penalty below a certain skill level.
*/
var/required = FALSE
/**
* For required skills on humanoid antags, they are always guaranteed a minimum of this skill level.
* If they have the skill previously at a lower level, their skill level is increased to this upon being promoted to antagonist.
* If they don't have the skill at all, they are given the skill at this level.
*/
var/antag_level = SKILL_LEVEL_TRAINED
/// The component datum that this skill will add during character spawning
var/component_type = null
/// Map of skill levels to level costs. How many skill points it takes to purchase this rank in a skill.
@@ -74,7 +82,7 @@
*/
/singleton/skill/proc/on_spawn(mob/owner, skill_level)
SHOULD_CALL_PARENT(TRUE)
if (!owner || !component_type)
if (!owner || !component_type || (!required && skill_level == SKILL_LEVEL_UNFAMILIAR))
return
owner.AddComponent(component_type, skill_level)