- Joined
- Feb 22, 2016
- Messages
- 1,835
- Reaction score
- 1,592
- First Language
- English
- Primarily Uses
- RMMV
So I'm having trouble creating a skill/state that decreases the target's DEF by half the user's ATK. This is what I got so far...
1st a simple skill that applies the "Sunder" state is created.
The Sunder state currently has this:
However, this has some issues. Mainly, what if the caster's ATK changes in between when Sunder was applied and when it was removed? I think variable(s) may have to be used, but then how would I account for multiple actors/units potentially using this same skill (thus overwriting earlier instances of the variable)?
Edit: Maybe I have to do something like, "if the caster is party member #1 use this variable, else if it's party member #2 use this other variable, else if etc..."?
Edit2: I tried another attempt, but I don't think it's right either...
Can anyone please lend a hand? Thx!
Basically what I'm trying to say w/
Edit: Can someone plz teach me how to write "if user = $gameParty.members()[0]" correctly for use in a <Custom Execution> notetag?
Edit2:
1st a simple skill that applies the "Sunder" state is created.
The Sunder state currently has this:
JavaScript:
<Custom Apply Effect>
var x = Math.round(this.stateOrigin(4).atk / 2);
target.minusDef(x);
</Custom Apply Effect>
<Custom Remove Effect>
var x = Math.round(this.stateOrigin(4).atk / 2);
target.addDef(x);
</Custom Remove Effect>
Edit: Maybe I have to do something like, "if the caster is party member #1 use this variable, else if it's party member #2 use this other variable, else if etc..."?
Edit2: I tried another attempt, but I don't think it's right either...
JavaScript:
<Custom Apply Effect>
var x = Math.round(this.stateOrigin(4).atk / 2);
if this.stateOrigin(4).indexOf($gameParty.members()) == 0 {
$gameVariables.setValue(41, x);
target.minusDef(v[41]);
} else if this.stateOrigin(4).indexOf($gameParty.members()) == 1 {
$gameVariables.setValue(42, x);
target.minusDef(v[42]);
} else if this.stateOrigin(4).indexOf($gameParty.members()) == 2 {
$gameVariables.setValue(43, x);
target.minusDef(v[43]);
}
</Custom Apply Effect>
<Custom Remove Effect>
if this.stateOrigin(4).indexOf($gameParty.members()) == 0 {
target.addDef(v[41]);
} else if this.stateOrigin(4).indexOf($gameParty.members()) == 1 {
target.addDef(v[42]);
} else if this.stateOrigin(4).indexOf($gameParty.members()) == 2 {
target.addDef(v[43]);
}
</Custom Remove Effect>
Basically what I'm trying to say w/
if this.stateOrigin(4).indexOf($gameParty.members()) == 0
is "if the caster who applied this state is the 1st party member, do stuff". What's the correct syntax for that?Edit: Can someone plz teach me how to write "if user = $gameParty.members()[0]" correctly for use in a <Custom Execution> notetag?
Edit2:
if $gameParty.members().indexOf(user) == 0
also doesn't work, sigh...
Last edited: