Skip to content

Instantly share code, notes, and snippets.

@Anaminus
Last active April 11, 2017 17:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Anaminus/1ec6c84e6349d8b92665 to your computer and use it in GitHub Desktop.
Save Anaminus/1ec6c84e6349d8b92665 to your computer and use it in GitHub Desktop.
Solitaire RPG

Solitaire RPG

A game about battling monsters, using a standard deck of playing cards.

Character rolling

To roll a new character, select a level to begin. The default is level 8, though you may select any level, including level 0.

Draw a number of cards equal to your chosen level. These will be your character's stats. The number of stats in your character is your character's level.

Stats

The stats of your character and monsters are determined by suit. The ranks of all cards in a suit are added together to get the value of that stat.

  • Clubs: Strength; used when attacking an enemy.
  • Spades: Armor; used when defending against an enemy.
  • Hearts: Life; determines whether you are still alive.
  • Diamonds: Initiative; determines who attacks first.

Rank

The ranks of aces are 1. The ranks of face cards are 10. Any other card is face value.

Shuffling

If at any point the deck runs out of cards, pause, and shuffle the discard pile into the deck. Then continue as usual. Thus, the deck can be treated as continuous. This applies even if there is only one card in the deck/discard pile.

Subtraction rule

Some stats will be subtracted from directly. Since the ranks of the cards that make up the stat wont necessarily match up with the number subtracted, use the following procedure.

To subtract N points from a set of cards:

  1. (Check) Move to the card with the next highest rank.
    • If N is less than or equal to 0, then goto Finish.
    • If there is no next highest card,
      1. If subtracting from armor, flip down the lowest available card.
      2. Goto Finish.
    • If N is greater than or equal to the rank of the current card,
      1. Subtract the rank from N.
      2. Flip the card down.
      3. Goto Check.
    • If N is less than the rank of the current card, then goto Check.
  2. (Finish)

The rank of the remaining face-up cards will be the approximate result of subtracting N from the total rank of the set. The result is rounded down if the set is the armor stat, and rounded up for anything else (life stat).

Modifier rule

At some points, stats will be changed temporarily with a "modifier". This involves drawing a number of cards from the deck.

For generating modifier M (which starts at 0):

  1. Draw a card from the deck.
    • If the card is black, add its rank to M.
    • If the card is red, subtract its rank from M.
  2. Discard the card.

Repeat this process for the number of cards to be drawn.

If there are no cards in the deck, then M equals 0.

Phases

The game is made up of encounters, which consist of a series of phases. The phases are cycled through until the game is won or lost. Each cycle makes one encounter. A new encounter starts with the Roll phase.

Roll phase

Draw a number of cards equal to your character's level. These will be the stats of the new monster. If you cannot draw enough cards, or there are 0 cards in the deck afterwards, then you win the game!

Next, move on to the Priority phase.

Priority phase

This phase determines whether you or the monster attacks first.

For both the player and the monster (start with whoever defended last in the previous round):

  1. Draw one card using the modifier rule.
  2. Add the result to the initiative stat.

Whoever has the greatest initiative wins. In the event of a tie, whoever defended last in the previous round gets priority.

Remove all modifiers from initiative.

Next, move on to the Attack phase.

Attack phase

The attack phase starts by running an attack procedure with whoever has priority as the attacker, and the other as the defender. The phase continues by repeatedly alternating between you and the monster as attacker and defender, until one or the other dies.

Before you attack, if your initiative is greater than 0 and at least twice the initiative of the monster (or if the monster's initiative is 0), then you can choose to run away by discarding the monster's cards and skipping to the next encounter.

Attack procedure

  1. Determine the armor modifier.
    1. Draw two cards using the modifier rule.
    2. If the modifier is less than 0, then round it to 0.
    3. Treat the final result as a single card and add its rank to the defender's armor.
      • When using the subtraction rule, the armor modifier has priority over cards of the same rank.
  2. Determine the strength modifier.
    1. Draw two cards using the modifier rule.
    2. If the modifier is less than 0, then round it to 0.
    3. Treat the final result as a single card and add its rank to the attacker's strength.
  3. Using the subtraction rule, subtract the attacker's strength from the defender's face-up armor.
    • Any remaining strength is damage to the defender's life.
  4. If the damage is greater than 0, then use the subtraction rule to subtract the damage from the defender's life.
    • If any life cards are flipped down, then flip up all of the defender's face-down armor cards.
  5. Remove all modifiers.
  6. If you were damaged, and your life is less than or equal to 0, then you lose the game.
  7. If the monster was damaged, and their life is less than or equal to 0, then skip to the Experience phase.

If no one died after both the player and the monster have attacked, then begin the next attack round by moving back to the Priority phase.

Experience phase

Flip up all face-down cards.

Draw a card. If the monster's level is 0, then add the drawn card to your stats. Otherwise, select from the monster a stat which has cards. From that stat, select the card whose rank is nearest to the rank of the drawn card. If there are two cards whose distances are equal, then select the larger of the two. Discard the drawn card, as well as the monster's remaining cards.

Begin the next encounter by proceeding to the Roll phase.

Losing

You lose the game when your life reaches 0 as a result of being damaged. That means, if your life happens to start at 0, then you will not lose immediately. You will lose only if you are damaged.

Winning

You win the game when you cannot draw enough cards to roll a monster's stats, and there aren't any more cards in the deck. For a standard 52-card deck, this implies that you are at least level 26 at the start of an encounter (you and the monster would both have 26 stats, so the deck would have 0 cards).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment