At the head of each passage, I have a very simple health count:
Health: $health
The way my passages are written, each sentence is a clickable hook that then reveals the next sentence:
[The knight stabs you!]<stab1| (click: ?stab1)[[He stabs again!]<stab2|] (click: ?stab2)[[And again!]<stab3|]
Is there some way to make certain hooks, when clicked, incrementally lower the $health value, have the $health count at the head of the passage update live, AND reveal the next hook?
Comments
With the following code for the hook that triggers it:
The problem I have now is that all links in the passage prior to these flash intermittently (no doubt at the speed of 0.1s) which looks crazy thanks to my hover link styling, and also makes them hard to actually click. Is there a way to avoid this? I'm presuming some placement of (stop:), but I'm not sure where.
Oh! And I'm using Harlowe here.
You can use a combination of a named hook and a (replace:) macro to do this. The following example decreases the health value each time you click on the Decrease health link:
The following is one possible way to implement your multi stabbing Knight, it uses an $attack variable to determine which link to show after the first one.
note: Both of the above example include indents and extra line-breaks to make them more readable, those indents and extra line-breaks can be safely removed.