The time has come for me to add skill checks to my game. I still have no idea how to implement them. I know how I want them to work, but I have no idea how to explain the idea to Inform 7.
How I want this to work is that the player has a deck cards with numbered values 2-14. If the top 4 can be labeled “J,” “Q,” “K,” and “A,” then bonus, but if they’re labeled numerically, that’s fine, too. The player initially has a hand of seven cards, and when they attempt to do something that requires a skill check, their parser switches to a display of the seven cards currently in their hand. When this happens, they are unable to do anything until they have selected a card in their hand to play or chosen to redraw.
If they select a card, the card is compared to a difficulty number, which can be either hard-coded or random depending on the situation. If it’s equal to or greater than the difficulty number, the card they played is discarded, they’re told what the difficulty number was, and the story continues.
If the value of the card they played is less than the difficulty number, then they may be able to back out, but not always, and may always play another card or redraw. If they back out, then they lose their first card and exit the skill check mode without having made progress, which might be a good idea if the thing they’re doing isn’t actually necessary.
If they play a second card, its value is added to the first and compared to the difficulty again. There’s no limit to how many cards you can put down at once, so the goal is to learn the difficulties of the game to the point where you can avoid overshooting. If the difficulty is six, then playing an actual six and playing a two and a four are pretty much the same, but playing a two, a three, and a four for nine total means you’ve wasted a bunch of extra points.
If the player chooses to redraw, then they discard all remaining cards, their hand size decreases by one, and they redraw cards up to their maximum. If their maximum hand size ever hits zero, that’s game over.
Then there’s meta-effects. It should be possible to raise the hand maximum back up again outside of combat by consuming limited resources (the most stereotypical fantasy example would be drinking a health potion), but not to raise it past the original maximum of seven…except sometimes you do want to raise it past the original maximum of seven (the stereotypical fantasy example would be drinking a potion of giant strength). It should also be possible to have skill bonuses to certain types of challenges, so that you can have +1 sneaking and -1 nuclear engineering, so that a card whose printed value is 8 is worth 9 in a sneaking challenge by 7 in a nuclear engineering challenge. The skill bonus should also be displayed in the parser.
In play, it’s as simple as looking at the seven or less options in the parser, guessing what the number is based on your knowledge of what other difficulties the game has had, and playing cards to try and hit that number. But scripting it is going to be a huge deal and I don’t even know where to start.