Something I wanna do soon is to add some Limiters operating on other limiters (NOT, AND, OR), so you could e.g. grant a bonus to all non-undead creatures except devils. Now there are multiple ways to extend the current syntax for this. Perhaps the most straight-forward would be the following:
Option 1:
"limiters" : [
{
"type" : "NOT",
"parameters" : [
{
"type" : "OR",
"parameters" : [
"IS_UNDEAD",
{
"type" : "CREATURE_TYPE_LIMITER",
"parameters" : [ "devil", true ]
}
]
}
]
}
]
or equivalently (in the logical sense)
"limiters" : [
{
"type" : "AND",
"parameters" : [
{
"type" : "NOT",
"parameters" : [ "IS_UNDEAD" ]
},
{
"type" : "NOT",
"parameters" : [
{
"type" : "CREATURE_TYPE_LIMITER",
"parameters" : [ "devil", true ]
}
]
}
]
}
]
It’s perhaps a bit bulky to write, but intuitive to use. One thing to consider for this is how to handle the array of limiters given. I can see two sub-options here:
1a) Deprecate the "limiters" : [ ... ]
syntax and instead use "limiter" : ...
, i.e. provide only a single limiter.
1b) Keep the array of limiters syntax, and combine them using an "AND"
limiter (a "OR"
limiter makes little sense as an empty limiter list should be equivalent to no limiter list) This also matches current behaviour.
Another option would be to just use binary AND and OR limiters (i.e. 2 parameters), and describe the whole expression in pre-fix notation (I don’t see infix working without adding brackets to resolve ambiguities, and that’ll become messy).
Option 2:
"limiters" : [
"NOT",
"OR",
"IS_UNDEAD",
{
"type" : "CREATURE_TYPE_LIMITER",
"parameters" : [ "devil", true ]
}
]
or equivalently
"limiters" : [
"AND",
"NOT",
"IS_UNDEAD",
"NOT",
{
"type" : "CREATURE_TYPE_LIMITER",
"parameters" : [ "devil", true ]
}
]
This approach is more compact to write, but rather less readable.
I’m strongly leaning towards Option 1, but undecided between 1a) and 1b). Maybe there’s a better way? What do others think?