State with different stacks (A-counter Yugioh)

optiprimeful

Veteran
Veteran
Joined
Aug 27, 2017
Messages
78
Reaction score
6
First Language
English
Primarily Uses
RMMV
I want to recreate the A-counter system (alien archetype) from yugioh (Place a A-counter on the target and when you attack they lose attack points for each counter placed on them, max 3). The counters need to be removed from the target to activate some cards (skills).

In my case, I want the A-counters to decrease luck, hit rate and evasion rate and have the debuffs increase with each stack.

Is there a way to customize yanfly organic deconstruction script to achieve that?

Code:
<Custom Confirm Effect>
// The State ID used for stage 1.
var stage1 = 122;
// The Stage ID used for stage 2.
var stage2 = 123;
// Check to see if the action is an attack.
if (this.isAttack()) {
  // Check if the target is affected by stage 1.
  if (target.isStateAffected(stage1)) {
    // Set the number of turns for stage 1 to 3.
    target.setStateTurns(stage1, 3);
  // Check if the target is affected by stage 2.
  } else if (target.isStateAffected(stage2)) {
    // Set the number of turns for stage 2 to 3.
    target.setStateTurns(stage2, 3);
  }
// Check if the action is a skill and if the target and user are on opposite teams.
} else if (this.isSkill() && target.isActor() !== user.isActor()) {
  // Check if the target is NOT affected by stage 1 and stage 2.
  if (!target.isStateAffected(stage1) && !target.isStateAffected(stage2)) {
    // Add stage 1 to the target.
    target.addState(stage1);
  // Check if the target is affected by stage 1.
  } else if (target.isStateAffected(stage1)) {
    // Remove stage 1.
    target.removeState(stage1);
    // Apply stage 2.
    target.addState(stage2);
  // Check if the target is affected by stage 2.
  } else if (target.isStateAffected(stage2)) {
    // Remove stage 2.
    target.removeState(stage2);
    // Calculate the damage to be dealt.
    var damage = user.mat * 10;
    // Store the damage dealt.
    target._deconstructDamage = damage;
  }
}
</Custom Confirm Effect>

<Custom Conclude Effect>
// After effects have taken place, check for any stored damage.
if (target._deconstructDamage) {
  // Check if the target is alive.
  if (target.isAlive()) {
    // Play animation 101 on target.
    target.startAnimation(101);
    // Target takes damage equal to the stored damage.
    target.gainHp(-target._deconstructDamage);
    // Start the damage popup.
    target.startDamagePopup();
    // Clear the damage result.
    target.clearResult();
    // Check if the target is dead.
    if (target.isDead()) {
      // If the target is dead, make it collapse.
      target.performCollapse();
    }
  }
  // Clear the stored damage.
  target._deconstructDamage = undefined;
}
</Custom Conclude Effect>

Thanks
 
Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,975
Members
137,563
Latest member
cexojow
Top