JoshuaGrams / tiny-qbn

A storylets library for Twine2/Sugarcube.
https://joshuagrams.github.io/tiny-qbn/
Other
48 stars 3 forks source link

Add support for objects (dot notation) in card requirements #8

Open mjhawkins opened 3 years ago

mjhawkins commented 3 years ago

The changes in this branch add support for objects (using dot notation) within card requirements. The changes work in both tag and comment style requirement syntax. I added minimal examples of both approaches. The comment style example is a copy of your card with covers example. The only change is that it uses of $pc.strength rather than $strength. The simple dot notation example using the text and most of logic behind that same example. However, I did not include any of the code for the covers in order to keep things as simple as possible. I added one extra option (sneak past the beast) so that the player character could have more than one property. All javascript and examples have been rebuilt, unlike my last commit.

I was unable to figure out how/where to put the object/dot notation change within the brief docs summary.

matthew30903 commented 2 years ago

I was looking for something like this. Your changes have worked well so far for one of my projects I've started working on. Thank you.