@Leaferson Kenraise Conditional Branch doesn't know what a or user are.
Try BattleManager._subject.isStateAffected()
Try BattleManager._subject.isStateAffected()
$subject.isStateAffected(29)
Ah, subject! I was trying things to replace BattleManager._target.isStateAffected but wasn't sure what to change it. This worked perfectly! Thank you very much!
$gameVariables.setValue(41, $gameParty.numitems($dataItems[52]));
<JS Passive Condition>
condition = $gameParty.members().includes($gameActors.actor(42));
</JS Passive Condition>
<JS Post-Apply>
let states = target.states();
const category = "buff";
while (states.length > 0) {
const state = states.shift();
if (state.categories.contains(category.toUpperCase())) {
$gameParty.members().forEach(member => member.addState(state.id));
}
}
</JS Post-Apply>
it makes sense that it would. the code is ran every time the skill hits a target, so each time it does, it executes a loop to apply the target's states to the entire party. any state that is on a target other than the final one is applied multiple times as every later battler would have been given the state and would have it be spread off of them to everyone again (including themself). in a party of 4, any state the leader has gets applied to everyone 4 times
i dont use the battle log, but i assume that it doesnt show state changes made on any battlers other than the the immediate target and subject of the current skill. the third state that got applied to everyone and didnt show up in the log would have been applied to everyone else after theyve been targeted.
thats one way to avoid the multiple looping problem while keeping the loop as is
aliveMembers() returns an array of battlers, so you cant use functions for battlers on it. i dont know what other variations of $gameParty could mean.
try this and then apply the states to each party member
let states = [];
user.friendsUnit().aliveMembers().forEach(member =>
member.states().forEach(state => {
if (state.categories.contains("BUFF") && !states.contains(state.id))
states.push(state.id);
})
)
<JS Post-Regenerate>
$gameParty.aliveMembers().forEach(actor =>
{
if (actor != user)
{
actor.gainHp(-10);
actor.startDamagePopup();
if (actor.hp <= 0)
actor.performCollapse();
}
});
</JS Post-Regenerate>
Thank you very much!
Well I inserted the code to the notetag of the state but it doesn't seem to work. Is there something that i am missing or is there a typo in th code (that I obviously can't tell ).
Original thread: https://forums.rpgmakerweb.com/threads/the-official-visustella-notetag-help-thread.125717/