public void GetRandomTarget(bool enemy)
{
List<Combatant> potentialTargs;
Combatant user = ORK.Game.GetGlobalObjects("user")[0].GetComponent<CombatantComponent>().combatant;
if (enemy)
{
potentialTargs = ORK.Game.Combatants.Get(user, true, Range.Infinity, Consider.Yes, Consider.No, Consider.Yes);
} else
{
potentialTargs = ORK.Game.Combatants.Get(user, true, Range.Infinity, Consider.No, Consider.No, Consider.Yes);
}
if (potentialTargs.Count != 0)
{
List<GameObject> selectedTarget = new List<GameObject>();
selectedTarget.Add(potentialTargs[Random.Range(0, potentialTargs.Count)].GameObject);
ORK.Game.ChangeGlobalObjects("target", selectedTarget, ListChangeType.Set);
}
}
It looks like you're new here. If you want to get involved, click one of these buttons!
You assign a bool game variable to your combatants with a default value of 0. When they get hit by your event, their variable is set to 1, and they can't be targeted anymore (do that with requirements). The next turn or after time has passed, their bool is reset to 0 and they can be targeted again by your event.
Same solution above, except you change the bool on the combatant to 1 when he gets hits. When another combatant gets hit, you reset it to 0. I think that could be done in your ability battle event, by checking all enemy combatant's variables present in the battle each time this attack is made.
For hitting several times in a row, a simple work around would do. In your limit break ability, you set up a variable fork with random chance, for instance if x <10, hit selected target 1 time, if x between 10 and 20, hit selected target 2 times... etc. So when a target is selected, it can hit it again randomly, or not, and you have control on the chance. That would be pretty close to your initial idea.
Hitting multiple times just requires using the Calculate node multiple times (or when using damage dealers/zones, allow the damage dealer to do multiple damages). @UserName explained a good way to do that in a cycle using variables :)
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!