Say we want a Stroke It cards which ups the strokerate by one each card until say, the next instruction card:
We can use an object:
Code: Select all
{
info: {
type: "Stroke It",
text: "Hurry up! Add 1 to your strokerate every slide until the next instruction card. Also lube up!",
deck: "Supplemental",
artist: "Jack the Belter"
},
condition: { //a contion required for the card to be drawn (see initialize in the next code block)
chastity: false, //checks if the player is in chastity for example
item: {
check: "available", //checks if a certain item is available, could also be something like "equipped" or "in_use"
item: "lube"
}
},
action: {
data: "strokerate", //Or a number representing strokerate
action: "+1", //first character representing a mathamatical function + for adding, = for setting or for formula's, - for substracting, * for multiplication, etc.
on: "slide", //could be "instruction" or "all" or something else
until: "instruction" //could be "end" (of tease) or "strokit", the next stroke it card.
item: {
item: "lube" //Yes, lube up!
enabled: "true" //Put lube in use to true so other cards will be able to notice.
}
},
after: {
//instruction same-y to action for an action after completion of the card.
}
}
Code: Select all
code: {
action: {
//some action not bound to an event occuring
}
},
initialize: {
//some action on loading the card, preferably before the card is ever drawn or the order of cards is decided.
},
query: {
options: { //A query adding options to a card, could perhaps also be added in 'after' (see previous example)
1: {
text: "Yes, give it to me!",
action: {
//Some action which only happens when you select this.
}
},
2: {
text: "No, your examples are stupid.",
action: {
action: "noaction" //Nothing happens when you press this.
}
}
}
}
Pro's:
- Easy to read & write for everyone who's willing to put some time into this.
- Easy to integrate, you can have .json files just in a folder, instead of compiling them into the code.
- Easy to share, because they dont have to be compiled or anything.
- Less flexibility, because the lack of direct programming POWAA!
- New work for 0131