New dialogue trial type to check the level of a skill against a flat difficulty #56896
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Infrastructure "Dialogues can now run skill checks using a given skill ID and difficulty"
Purpose of change
With NPCs becoming an increasing part of the game, I found the lack of something for this really glaring! CDDA is an RPG, and I think that it makes a lot of sense to allow for the character's skill progression to factor into talkers. This could be used in person-on-person dialogue, but can also be used for talking furniture and, later on, talking monsters and such.
Describe the solution
Added a new
trial
type, designated by the stringSKILL_CHECK
. It functions by checking the provided integerdifficulty
(already existed) against the player's current level in the skill designated by the IDskill_required
. If the level is greater than or equal todifficulty
, the check passes. Otherwise, it fails.While these kinds of checks could already be done using EOCs to only present an option if the player has a certain skill, it doesn't show potential dialogue options that would become available if the player had a different level in their skill. In addition to opening up roleplay opportunities (like trying to make a special dish and failing badly at it, for instance), this also offers a neat thing for players to observe and keep in mind for later playthroughs or engagements, especially if the dialogue isn't time-sensitive; for instance, a broken machine of a special type might not be fixable with the player's current skill, but if they see that they could fix it if they had a higher electronics skill, they might come back later when they're more experienced.
Skill checks display using the required and current skill level in the line, such as
[applied science 1/5] Test line
. If the skill level is higher than the difficulty, it uses the difficulty instead of showing the higher number; i.e. an applied science level of 8 would display[applied science 5/5] Test line
.Describe alternatives you've considered
Two things I had considered for this PR are allowing theoretical knowledge to be checked as well as practical, and possibly having multiple skills checked in a single challenge. I decided against these both to stay in a modest scope, as well as because I couldn't think of any use cases in the current game.
The trial itself also doesn't currently have inline or special syntax to show different text depending on if the player would pass or fail the check. This currently needs to be done using
truefalsetext
, which I figured was sufficient for the moment, but ideally we could have a separate text type that handles it automatically, too.Testing
I added the following response to the Hub 01 intercom's default topic.
I used an existing debug world in which I had already completed the introductory quest. First, I set my athletics to 1 and opened the chat:
The check failed when I selected it, and ended the dialogue due to the failure topic being
TALK_DONE
. Afterwards, I changed my athletics again, this time to 4, which put me above the required threshold to pass. Then I tried again:Selecting the skill challenge this time passed the check and correctly sent me to the services dialogue with the one-time response that the intercom usually gives when first opening up to the player (
"We look forward to working with you."
)Editing the trial itself and the truefalsetext condition to use nonexistent skill IDs result in the check being unpassable and displaying
nothing
for the skill name and 0 for the skill itself, but it is otherwise harmless, producing no debug messages or errors.Additional context
N/A