Hello !
I wasn't sure how to put it in the title so here is my situation :
Using YEP's multiple plugins, I am making a specific state on a battler that creates fruits on apply. Once the battler is hit, I created a Respond effect which deploys one, casting a skill onto an ally.
This part works fine, now my issue is the selection of the fruit to deploy :
There are 5 different kind of fruits that are produced when the state is applied, and each kind can be stacked up to 5 max.
So for now my state has a <Custom Respond Effect> that randomly chooses a skill according to which fruit is active on the battler (I'm aware it's clunky but I found the thread mentionned in the title after doing my tests) :
The thing I was wondering about is when there are more than 1 fruit of a kind, could I change the odds of it being selected for the skill ?
The "Skill that make user cast random skill" thread had a code which seems to be the thing I want to achieve :
I'm asking for help since I'm not sure how to include multiple instances of the same skill in the "possibleSkills" variable here :aswt2:
I wasn't sure how to put it in the title so here is my situation :
Using YEP's multiple plugins, I am making a specific state on a battler that creates fruits on apply. Once the battler is hit, I created a Respond effect which deploys one, casting a skill onto an ally.
This part works fine, now my issue is the selection of the fruit to deploy :
There are 5 different kind of fruits that are produced when the state is applied, and each kind can be stacked up to 5 max.
So for now my state has a <Custom Respond Effect> that randomly chooses a skill according to which fruit is active on the battler (I'm aware it's clunky but I found the thread mentionned in the title after doing my tests) :
Code:
<Custom Respond Effect>
if (this.isHpEffect && value > 0)
{
$gameActors.actor(7)._Deploy = $gameActors.actor(7)._Deploy || 0;
var fruitv = $gameActors.actor(7).getStateCounter(271) || 0;
if (fruitv >= 1)
$gameActors.actor(7)._Deploy += 1;
var fruitc = $gameActors.actor(7).getStateCounter(272) || 0;
if (fruitc >= 1)
$gameActors.actor(7)._Deploy += 1;
var fruitpur = $gameActors.actor(7).getStateCounter(273) || 0;
if (fruitpur >= 1)
$gameActors.actor(7)._Deploy += 1;
var fruitpro = $gameActors.actor(7).getStateCounter(274) || 0;
if (fruitpro >= 1)
$gameActors.actor(7)._Deploy += 1;
var fruitb = $gameActors.actor(7).getStateCounter(275) || 0;
if (fruitb >= 1)
$gameActors.actor(7)._Deploy += 1;
var deploy = $gameActors.actor(7)._Deploy.clamp(0, 5);
var fruitskill = Math.randomInt(deploy);
var fruitdeploy = 258 + fruitskill;
BattleManager.queueForceAction($gameActors.actor(28), fruitdeploy, target);
}
</Custom Respond Effect>
The thing I was wondering about is when there are more than 1 fruit of a kind, could I change the odds of it being selected for the skill ?
The "Skill that make user cast random skill" thread had a code which seems to be the thing I want to achieve :
Code:
var possibleSkills = [8, 9, 10]; // IDs of the skills that might be cast when you use the random spell skill
var index = Math.randomInt(possibleSkills.length);
var skillId = possibleSkills[index];
BattleManager._subject.forceAction(skillId, -2);
I'm asking for help since I'm not sure how to include multiple instances of the same skill in the "possibleSkills" variable here :aswt2: