Inform 7 attack healing per turn.

Ok Im looking for some syntax as it doesnt seem to be working right for me.

Bassically I want to have the player/alliws and hostiles have a regeneration per turn.

ie from when you attack and when you attack again you heal 4 health.

I have the following code

Every turn: if hate is present: if the player is not killed: heal the player for 3 health; if Wingman is not killed: heal Wingman for 3 health; otherwise: repeat with X running through alive persons: fully heal X; rule succeeds.

The otherwise is to fully heal after a fight.

This does work but what is happening Im finding that when I attack 3-4 turns pass so instead of 3 points Im healing 9-12 points. I want to trim it back so only on the players attack prompt would the healing be done. Ideally Id like something other than every turn there as this is also affecting all hostiles with individual ‘every turn’ healing ranging between 1 and 4 per turn.

If you want healing to happen to the player and NPC’s right before their attacking, you can perhaps as well use a ‘before an actor attacking’ rule rather than an ‘every turn’ rule?

just tried it, and instead of defending I was able to attack (with no attack occuring) til I was full health again then defend myself… so opened a cheat that may even had been there before just it was healing too much to notice. :laughing:

Ok sorted it so its also done when the prompt is a certain way… however it heals twice what I set it to which is weird.

after the player attacking: if hate is present and the command prompt is "Act>": if the player is not killed: heal the player for 3 health; if Wingman is not killed: heal Wingman for 3 health;

The above heals the player for 6. :unamused:

Are you using ATTACK?

yes, Inform ATTACK by Victor Gijsbers.

Im not sure if its my version of the extension. The one I am using is the initial release version as this came with the manual which the newer, version does not. The link on inform7 site has a zip file with just a link in it, that leads to another version thats 5 months old.
I originally did have this newer code and then found a manual, but stuff in the manual did not work with it as it was written for the older code.

Now Im more in tune with whats happening in inform Attack and can identify the missing code I might simply add the old section thats been removed from the new in relation to flavour text and possibly other sections.

Maybe the newer code handles that regeneration property better.

I would recommend updating to the newest version. And sorry there’s no manual.

Are you wanting it to heal only after the player’s turn? I think that would produce weird results because there’s no guarantee the player will have a turn in a strict pattern. I would suggest either healing everyone a small amount after anyone has a turn, or only healing the person who has a turn.

yeah I agree that would be ideal… I just dont know how to word it ie “every turn” made it run 3-4 times between turns as the system classed all NPC turns too. Unfortunately while the suggestion to do this is in the manual the actual method is not.

Using the new (v4) proved problematic… not allowing flavour text as the flavour text rules are not in the code. Copy pasting them from the old rules did not work either. Got v3 but that heal problem continues to exist with the same code above.

Sorted it using the code:

every turn: if hate is present: if the player is the global attacker: heal the player for 3 health; if Wingman is the global attacker: heal Wingman for 3 health; … K.i7x#L219 explains most of the changes in version 4. Instead of flavour text rules it now uses report hitting rules.

This should also work in ATTACK version 3:

“Every turn when the main actor is the player:”

The “main actor” variable is specifically set to be, well, the person whose turn it is.

thanks for the help guys I have Attack 3 set up how I want it now, added a little bit to it that allows a secondary health variable that I needed in my game, tested it all out and works fine now I can crack on with other parts such as plotline and other design work.