Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

1. These are all local variables that we are declaring to keep track of a state. You can create as many as you want and call them whatever you want. In the Demo Project, we mostly use _firstFlag (for effects that trigger when the first Card is played) and _lethalFlag (for effects that trigger when an enemy dies). Just remember to reset these flags in the Notetags of the End Turn Skill.

2. This is a little tricky because you will need to keep track of the types of every card you play in a turn before this card is played. Luckily we are already tracking the primary Type of a Card with _lastType variable so this would just add onto that. Please add this Card Action directly under the Eval where user._lastType is set for EVERY card in your game.

Eval user._typesPlayed = user._typesPlayed || []; if(!user._typesPlayed.includes(user._lastType)) user._typesPlayed.push(user._lastType);

This creates a new array variable which contains a list of each type that has been played during a turn. It only records every new Type that is played, so if the same Type is played twice it is not added to the array. We can now use this in a damage formula like so:

var dmg = 10; user._typesPlayed = user._typesPlayed || []; dmg *= user._typesPlayed.length; dmg

This makes it such that the Damage a Card deals is equal to 10 x the number of types played before. This does not include the card itself only types played before this card is used. So, if this is the first card played then it will be 10 x 0 because no other Cards with Types have been played before this. If, however, 3 different Types have been played before this card, it will deal 10 x 3 = 30 DMG.

Lastly, we must clear out user._typesPlayed when the Turn ends so that next turn it can start over again. Please add this Eval to the Card Actions Notetag of your End Turn Skill.

Eval user._typesPlayed = undefined;

Note: this works if there is only one type per Card. If there are multiple Types, then the code will have to be a little different to track the total number of types. Let us know if you require that and we can provide that solution for you.