I am hoping to change how the Action Times+ trait functions.
I simply want it to grant an extra action for EACH time the Action Times+ is added to the traits on an enemy, etc.
So, if the enemy has...
Action Times+ : 100%
Action Times+ : 1%
Action Times+: 52%
Then, I still want it to grant them three extra actions without fail. If it's easier to just require 100% each time, that's fine too.
JavaScript:Game_Battler.prototype.makeActionTimes = function() {
return this.actionPlusSet().reduce(function(r, p) {
return Math.random() < p ? r + 1 : r;
}, 1);
};
This is where I assume this change would take place, I am just not fully understanding what is making it do what it does, which is grant a diminishing return on the trait.
EDIT: It seems as though this code below works fine for what I was asking. Onto a new problem...
JavaScript:Game_Battler.prototype.makeActionTimes = function() {
return this.actionPlusSet().reduce(function(r, p) {
return 0 < p ? r + 1 : r;
}, 1);
};
So now that I have an enemy that has x amount of actions, I want certain ones to only be used once during the turn out of those x actions. I've set a skill that requires that a switch be ON. I set this switch to ON before the battle begins. Using that skill turns that switch OFF using an Action Sequence in Yanfly's plugin, making it so he should not use it again. He still uses this same move for every single action in the turn because it has the highest priority (9).
I assume it's because the condition to use the skill was fulfilled at the start of the turn, and therefore ignores the condition on subsequent actions. However, Yanfly's BattleAICore should allow for dynamic actions on the fly (which is already set to true). I'll go over the notetags used in every part of this.
The enemy has the notetag:
JavaScript:<AI Level: 100>
The skill has the following action sequence:
JavaScript:<setup action>
change switch 102: off
clear battle log
display action
face user: targets
animation 880: user
wait for animation
</setup action>
<target action>
clear battle log
action animation: target
wait for animation
action effect: targets
</target action>
<finish action>
perform finish
face user: targets
face targets: user
</finish action>
Lastly, the enemy's skills list has the above skill set to be used only when Switch 102 is ON (it is turned on before the battle begins, remember). The action sequence of the skill itself should be turning the switch OFF immediately, but every extra action afterwards is still this same skill.
So, what I'm looking for now is a way to make enemies re-evaluate what they can use out of their list of actions before using EACH action, and select one that has its condition still fulfilled.