- 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?
Thanks
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:

