Skip to content

Instantly share code, notes, and snippets.

@jmahoney
Last active July 19, 2022 07:12
Show Gist options
  • Save jmahoney/8f9a5a86760977c20b2df2fa515602b8 to your computer and use it in GitHub Desktop.
Save jmahoney/8f9a5a86760977c20b2df2fa515602b8 to your computer and use it in GitHub Desktop.
Fighting Fantasy combat in Twine
(set: $round to it + 1)\
## Round $round
---
=|=
You STAMINA: $stamina HITS: $hits
=|=
Opponent STAMINA: $opponent_stamina HITS: $opponent_hits
|==|
---
(set: _attack to $skill + (random: 2, 12))\
(set: _opponent_attack to $opponent_skill + (random: 2, 12))\
(if: _attack > _opponent_attack)[(set: $opponent_stamina to it - 2)(set: $hits to it + 1)\
### You hit your opponent for 2 points of damage]
(elseif: _attack < _opponent_attack)[(set: $stamina to it -2)(set: $opponent_hits to it + 1)\
### You are hit by your opponent and take 2 points of damage!]
(else: )[
### You both probe with your swords but neither is able to land a solid hit]
(if: $stamina < 1)[The last blow does you in. [[You see black before your body hits the ground->Dead]]]
(elseif: $opponent_stamina < 1)[Your sword pierces your opponent's armour and he is run through. [[He looks surprised, then annoyed, then dead->Win]]]
(else: )[You circle each other. This match isn't done yet.
[[Keep fighting->Fight]]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment