So this is kind of a tricky one and I'll understand if there's really no way to do this. I'm working on a game with the main protagonist being an android, and one of his skills is basically a lock-on, which when he targets an enemy, their evasion rate is cut to a fraction of what they usually have.
I want to add a blinding state that, when inflicted on the protagonist, it also removes any and all lock-on states from enemies (since he can't see them to attack them). My end goal is this:
-Protagonist uses lock-on skill on enemy
-Enemy is inflicted with the state that lowers evasion
-Enemy uses skill that causes blinding state
-Protagonist is inflicted with blinded state
-Locked-on state is removed from enemy
Is this possible in any way, either through a script or otherwise? Please let me know, I'd greatly appreciate it!
You could possibly use one of yanfly's script that allows you to make a skill trigger another one. have the second skill as a skill that target's the caster's party and make it remove the states.
Any decent custom script will do a quick work for you, but there's at least 1 non-scripting way using battle events:
1. Make 2 common events dedicated to do what you want(I call them Start Update Status and End Update Status respectively)
2. Set all skills inflicting blind state to have an effect of Common Event [start Update Status]
3. Make a game switch dedicated to do what you want(I call it Update Status)
4. Set Update Status as ON and OFF in Start Update Status and End Update Status respectively
5. Add an event page to all related battle events and set that event page's condition as Switch [update Status] is ON and span as Moment
6. Add the below in that event page -
Conditional Branch: [Protagonist] is [blinded] inflicted
Change Enemy State: Entire Troop, - [Locked-On]
Branch End
Call Common Event: End Update Status
Now when those skills inflicting blind state are used, Start Update Status will be called and thus Update Status will be turned ON, causing the above event page to be called and its content to be executed. As its content calls End Update Status causing Update Status to be turned OFF, the condition of the above event page isn't satisfied anymore, causing its content to execute just once right after any of those skills inflicting blind state.
All this can be done without scripts or even common events. Try to make use of your damage formula.
Just add this to your blinding skill's damage formula: a.erase_state(lock-on state ID);. Of course, this means that the blinding skill will remove the lock-on state if it hits the target, regardless of whether or not the player was actually blinded. So, if the blinding chance isn't 100% or if the target of this skill can resist blind, lock-on will be removed anyway. Luckily, we can get around this little problem easily using b.state?(State ID).
Set it up like this...
if b.state?(blind state ID) ; a.erase_state(lock-on state ID) ; end
This checks to see if the target is blinded, before removing lock-on from the user. I haven't tested this, so there could be issues. Off the top of my head... Skill states are probably added after the damage formula runs, so this won't work unless maybe you use the damage formula to add the blind state as well? I don't actually know, but just in case... b.add_state(blind state ID). This works as a replacement for adding states through the a skill's effects box. You will of course need to remove the state from effects afterwards. Eh, one more example won't hurt, right?
b.add_state(blind) ; a.atk * 4 - b. def * 2 ; if b.state?(blind state ID) ; a.erase_state(lock-on state ID) ; end
Above is a normal attack that adds the blind state, checks to see if the target has the blind state, and removes the lock-on state from the user if the target was blinded.
The lock-on skill itself is pretty basic, so I'm assuming you already know how to do it. Just make a state that reduces evasion to 0%, and add it to your lock-on skill.
Another issue that I'm sure some of you have noticed... Lock-on would be removed regardless of who the enemy actually blinds. xD Honestly I didn't notice that until after I was done explaining the above. There is a way around this as well of course, however, we'll need to set things up differently.
First, we'll need two lock-on states.
User lock-on: This one can do nothing or something like increase critical chance or whatever.
Target lock-on: This one will reduce evasion to 0%
Set up your lock-on skill and use this in the damage formula.
a.add_state(User lock-on); b.add_state(Target lock-on)
It adds the above states to user and the target.
Next we'll deal with blinding skills. We need to first check if the user has lock-on: if a.state?(Target lock-on), and if the target has lock on: if b.state?(User lock-on).
if a.state(target lock) ; if b.state(user lock) ; (the rest will go here) ; end ; end
Then if these conditions are true, we check if the target is blinded.
if a.state?(target lock) ; if b.state?(user lock) ; if b.state?(blind) ; (the rest will go here) ; end ; end ; end
Finally we remove the lock-on states.
if a.state?(target lock) ; if b.state?(user lock) ; if b.state?(blind) ; a.erase_state(target lock); b.erase_state(user lock) ; end ; end ; end
Translation: Do I have target lock? Does the target have user lock? Is the target blind?. If all this is true, remove target lock from me, and user lock from the target.
-Actual Size- Feel free to copy the below and paste into a skill formula for testing.
if a.state?(0);if b.state?(0);if b.state?(0);a.erase_state(0);b.erase_state(0);end;end;end
There are advantages and disadvantages to each of these damage formula solutions, so pick your poison. I'm gonna stop typing now...
I don't think that quite meets the OP's needs. He wants ALL of party 1's members to have the lock-on state removed at the time a certain member of party 2 is hit with the blind state.
Your suggestion above (unless I missed something - I'm short on time so not looking through carefully) would only take effect on the turn AFTER the party 2 member is hit with the blind state, and would only remove the lock-on state from one member of party 1, and only IF they targeted that same party 2 member who has the blind state.
Wow, thanks for all the replies, guys!
I'll try out each method and see which one yields the effect I'm going for, but I'm pretty sure all of these would do what I'm aiming for. Many thank-yous!
Also to Shaz, I'm a she. ^^; Sorry if my icon led to confusion.