It can be done with Yanfly's Buffs & States Core (a free plugin), I guess, but I can't figure out how.
Here's what I tried to use:
Code:
<After Eval>
// Loop through all parameters
for (var i = 0; i < 8; i++) {
if (target._buffs[i] > 0) {
// Copy the target's buffs, if they exist
user._buffs[i] = target._buffs[i];
}
// Remove the target's buffs
target._buffs[i] = 0;
}
</After Eval>
The problem I have is while I can copy buffs, I can't copy their
duration, meaning they'll expire the next turn, and I have no idea how to copy a buff's duration.
EDIT: Nevermind, there's actually a property called
_buffTurns that can be used to return the number of remaining turns of a buff. Hooray!
Code:
<After Eval>
// Loop through all parameters
for (var i = 0; i < 8; i++) {
if (target._buffs[i] > 0) {
// Copy the target's buffs, if they exist
user._buffs[i] = target._buffs[i];
// Copy the duration of the target's buffs
user._buffTurns[i] = target._buffTurns[i];
}
// Remove the target's buffs
target._buffs[i] = 0;
}
</After Eval>
SECOND EDIT: Turns out my previous code overwrites the user's current buffs. I'll change it a bit again:
Code:
<After Eval>
// Loop through all parameters
for (var i = 0; i < 8; i++) {
if (target._buffs[i] > 0) {
// Copy the target's buffs, if they exist
user._buffs[i] += target._buffs[i];
// Copy the duration of the target's buffs
user._buffTurns[i] = target._buffTurns[i];
}
// Remove the target's buffs
target._buffs[i] = 0;
}
</After Eval>
If you also want to add the duration of the target's buffs:
Code:
<After Eval>
// Loop through all parameters
for (var i = 0; i < 8; i++) {
if (target._buffs[i] > 0) {
// Copy the target's buffs, if they exist
user._buffs[i] += target._buffs[i];
// Copy the duration of the target's buffs
user._buffTurns[i] += target._buffTurns[i];
}
// Remove the target's buffs
target._buffs[i] = 0;
}
</After Eval>