So I want to make a skill that has its power change based on how many targets it effects as just a rough example the damage would be 100 / number of targets. Is this possible?
Need help with a damage formula
● ARCHIVED · READ-ONLY
-
-
One easy option: Yanfly's Selection Control plugin offers, among other things, a <Disperse Damage> skill/item notetag that splits the skill effect evenly over all targets. It does require both Battle Engine Core and Target Core, though.
With only the default code, number of targets is defined solely in terms of the skill's scope. In that case this ought to work if pasted at the start of the damage formula:
Code:It just converts the scope into a number of targets, and stores that number in a temporary variable, t. You can then use t in your formula. Note that this approach won't account for the "target all dead allies" scope, nor, necessarily, for any new scopes added by plugins.var t = this.numTargets(); if (t === 0) { t = this.isForAll() ? target.friendsUnit().aliveMembers().length : 1 }; -
@caethyril worked like a charm thanks :)