Defines classes for characters, curses and events and includes the toJson and clone methods which allow SugarCube to deserialise them back into the proper class.
All events are now in one queue, attached to the character (Character.events), and curses are events too.
Most of the computed properties, like lewdness, assets etc. are now computed on-demand by going through the events and applying them all.
This also has the effect of decreasing size of save files.
Also includes a plethora of bug fixes found while going through the code to adapt usages to the new format.
I tried to make things as backwards-compatible as possible, so for example the curses' variation properties will still work as expected, but for higher code quality it is recommended to use the new properties with more descriptive names (e.g., hairColor). Also it's not possible for everything, so there are a few things that may not work as expected anymore.
I have to admit my implementation of the clone and toJSON methods is a bit hacky. If you have an idea for how to do it more cleanly, let me know.
The new files have numeric prefixes. These are necessary to determine the order in which tweego includes them in the result, to make sure files that depend on each other are executed in the right order.
I went through all the twee files to use the curses in the new way, but I did so fairly superficially, there are still improvements to be made, such as using the curses' new incompatibility list instead of manually checking for known incompatible curses.
I'd appreciate it if you could tell me about any operations on curses or characters you find yourself doing frequently, such as adding a curse or checking if a character has a curse, so I can make a function that does it for you, like I did for those examples to reduce the repetition in the code base.
Some future improvements that are left:
Curses like semen demon which have variants but also can be taken multiple times are still implemented using the "one curse with amount" technique. We should fix that and let the user actually take the curse multiple times.
We should move static properties of curses, like the name, into functions instead of stored properties to reduce their size.
We should move the descriptions into the curses too to have everything in the same place
We should rework choice of variant into the curse, e.g. as a list of questions and answers which can be rendered through a widget, instead of re-implementing it ad-hoc in multiple places. The curses currently have a variantPassage property which returns the name of a passage for an intermediate step, but these passages are not implemented yet.
I found a lot of code duplication in the Take on ### passages. We should probably consolidate those.
A lot of curses' appDesc is changed when you take them to reflect other changes in the MC's body, but that means they always reflect the MC's state at the time they took the curse. We should make it a getter in the curse instead, which takes a character and produces the correct description on-demand.
Some parts of the code, such as the shrines, assume that all curses can only be taken once. That is incorrect.
Cherry's luck stores the modified corruption gain in the curse[^1]. This allows us to correctly remove the corruption when the curse is removed again, however, the shrines also use that value to determine how much corruption you gain for copying or transferring it, making curses gained through cherry's luck more valuable. We may or may not want that.
[^1]: Actually it did so inconsistently, sometimes and sometimes not. I've fixed it so now it always does.
Defines classes for characters, curses and events and includes the
toJson
andclone
methods which allow SugarCube to deserialise them back into the proper class. All events are now in one queue, attached to the character (Character.events
), and curses are events too. Most of the computed properties, like lewdness, assets etc. are now computed on-demand by going through the events and applying them all. This also has the effect of decreasing size of save files. Also includes a plethora of bug fixes found while going through the code to adapt usages to the new format. I tried to make things as backwards-compatible as possible, so for example the curses'variation
properties will still work as expected, but for higher code quality it is recommended to use the new properties with more descriptive names (e.g.,hairColor
). Also it's not possible for everything, so there are a few things that may not work as expected anymore. I have to admit my implementation of theclone
andtoJSON
methods is a bit hacky. If you have an idea for how to do it more cleanly, let me know.The new files have numeric prefixes. These are necessary to determine the order in which tweego includes them in the result, to make sure files that depend on each other are executed in the right order.
I went through all the twee files to use the curses in the new way, but I did so fairly superficially, there are still improvements to be made, such as using the curses' new incompatibility list instead of manually checking for known incompatible curses.
I'd appreciate it if you could tell me about any operations on curses or characters you find yourself doing frequently, such as adding a curse or checking if a character has a curse, so I can make a function that does it for you, like I did for those examples to reduce the repetition in the code base.
Some future improvements that are left:
variantPassage
property which returns the name of a passage for an intermediate step, but these passages are not implemented yet.Take on ###
passages. We should probably consolidate those.appDesc
is changed when you take them to reflect other changes in the MC's body, but that means they always reflect the MC's state at the time they took the curse. We should make it a getter in the curse instead, which takes a character and produces the correct description on-demand.[^1]: Actually it did so inconsistently, sometimes and sometimes not. I've fixed it so now it always does.