Hello! This is my first post here, please tell me if it's in the wrong place again.
I'm a complete JS newbie and I was somehow solving my problems like a big girl before but I ran into something I can't solve and decided to seek for help.
I'm using a slightly modified version of Yanfly's Joint Penalty but I have a problem when it comes to AOE attacks.
I'm using Joint Penalty to manage different Boss body parts and obviously getting the main body to take x2 or more damage on AOE attacks is quite annoying.
Here is the Boss Body Parts state's notetag:
Code:
<Custom React Effect>
// Check if the damage is positive.
if (value > 0) {
// Get the living members of the same party.
var members = target.friendsUnit().aliveMembers();
// Make an empty group to list affected members.
var affected = [];
// We'll go through each member to check them.
for (var i = 0; i < members.length; ++i) {
// Getting the individual member.
var member = members[i];
// Does the member exist and is the member affected by state 43 (the Boss main body state)?
if (member && member.isStateAffected(43)) {
// If the member is affected, add it to the affected group.
affected.push(member);
}
}
// We'll go through each of the affected members now.
for (var i = 0; i < affected.length; ++i) {
// Getting the individual affected member.
var member = affected[i];
// Ignore the effect if the member is the target of attack.
if (member !== target) {
// The affected member takes damage.
member.gainHp(-value);
// Clear the results of the effect.
member.clearResult();
// Next, check to see if the member is dead.
if (member.isDead()) {
// If the member is dead, we'll make it collapse.
member.performCollapse();
}
}
}
}
</Custom React Effect>
Somehow, the condition "if (member !== target) {" doesn't prevent the body parts to share the AOE damage to the main body.
I also tried replacing that line by "if (this.item().stypeId !== 7) {" or "if ( !$dataSkills[7].stypeId) {" with Type 7 being reserved for all AOE skills, without any success.
Those two conditions would prevent the state to share the damage with the main body from any attack instead of only AOE attacks.
So... I'm kind of lost here. I don't know what I am missing or doing wrong. I bet this is something stupid, but I just can't find it with my poor knowledges!
Please tell me if you need any informations to solve this!
If anyone has a solution, I'd be glad to read it!
Thanks in advance for reading ^^'