Loading

Bonus Action on Crit

  1. <Custom Establish Effect>
  2. // If you want to use a knockdown state, put that state ID instead of 0
  3. var knockDownState = 0;
  4. // Max number of bonus actions per round
  5. var maxBonusActions = 10;
  6. // Check to see if a damaging skill was a critical hit
  7. if (target.result().critical && value > 0) {
  8.  // If the number of bonus actions is less than the max
  9.  if (user._bonusTurn < maxBonusActions) {
  10.   // If a knockdown state is set, and the target is not inflicted with it
  11.   if (!knockDownState || !target.isStateAffected(knockDownState)) {
  12.    // Give the user an extra action
  13.    user.addITBActions(1);
  14.    BattleManager.addBattler(user);
  15.    // Keep track of their bonus turns
  16.    user._bonusTurn += 1;
  17.   }
  18.  }
  19.  // If a knockdown state is set, inflict the target with it
  20.  if (knockDownState) target.addState(knockDownState);
  21. };
  22. </Custom Establish Effect>
  23. <Custom Battle Effect>
  24.  this._bonusTurn = 0;
  25. </Custom Battle Effect>
  26. <Custom Turn Start Effect>
  27.  this._bonusTurn = 0;
  28. </Custom Turn Start Effect>