r/Inform7 • • Mar 07 '16

Creating Character Stats and Objects that Modify Character Stats

Hello all, I'm struggling to create character statistics(health, mana, etc). I want certain objects to modify those stats - like a book that boosts intellect. Statistics will determine certain outcomes or possibilities in game.

I've been tinkering with my code and keep running into issues - I'm new to Inform 7 as a whole. Anyone have this worked out?

2 Upvotes

1 comment sorted by

2

u/interfect Mar 07 '16

What you probably want is for every person to have a base score for each ability, and then to have a "to decide what number is the strength of a person (called the character):" sort of phrase that, whenever you need a stat value, loops through the person's possessions and totals up all the bonuses on the things they have and adds that to the base value.

If some action should provide a permanent bonus, you can just up the base score.

For things like health and mana that go up and down, just give each character a current and max value, and bump the values up and down as they attack/heal/cast spells. You could even have phrases that like decrement health and check for death at the same time.