Enemy targets an actor with a certain state

Hi!

Is there a way that I can make it so when an enemy uses a skill, it only targets enemies with a certain state applied?

A LOT of enemies in my game have tells for their attacks, which apply an "invisible" state too an actor, than their attacks are supposed too target the actor with the state.

Currently, i accomplish this by controlling enemy actions with skills that call common events, however this seems a roundabout

way of doing it, and messes up the timing for other states applied too enemies (like poison)

Is there a better way of doing this? thanks!
Put this line into the Formula: line for a skill that targets all enemies:

if b.state?(2); dmg = 100; else; dmg = 0; end; dmgReplace the 2 with the id of the state you want to target, and replace the 100 with the damage formula.
This still causes a message too be displayd that the un-targeted actors take no damage.

Since the idea is basicly that the attack is only targeting one actor, this doesn't really work for me.
😛 Ohh ok!

This line will work the way you want:

Code:
if b.state?(2); dmg = 100; else; b.result.used = false; end; dmg
well, you can get yanfly's anti-fail script so it doesn't show a message for 0 damages
Thanks much!

the second line worked very good.
I attempted this using the same formulas, and I'm encountering issues.

Basically, I have a boss that uses two moves, Hell Gaze, and Miasma.

Hell Gaze is used every 2+3 * X turns, with Miasma right behind it at 2+4 * X turns.

What I want to happen is that Hell Gaze causes a status ailment called Fear (50% chance), and then after casting Hell Gaze the boss uses Miasma, which does damage to enemies with Fear. I tried DuncanS' formulas, but I end up with the boss in question casting Miasma before Hell Gaze, preventing the desired effect.

Here's what the skills look like:

Hell Gaze: 

  • Damage: a.mat * 3 - b.mdf * 2
  • Effects: Add State [Fear] 50%
Miasma:

  • Damage: if b.state?(27); dmg = a.atk * 4 - b.def * 2; else; dmg = 0; end; dmg
  • Effects: None
Please assist.
Rikard

The problem sounds like an issue with your enemy Action Pattern.

This does not sound like a formula issue.

You will have to show the enemies Action Pattern screen to get help, but from what you stated it sounds like the problem is the Turn No. you selected.

Hell Gaze: Every 2+3 Turns - Means the enemy will use it on turn 2,5,8... etc

Miasma : Every 2+4 Turns - Means the enemy will use it on turn 2, 6, 10... etc

So you have 2 problems:

1. Both are set to turn 2, which means the one with a higher rating will go off instead (looks like Miasma is higher rated in this case)

2. They will not go off one after the other with the turn order you put it at.

I would suggest this changin the Turn to this:

Hell Gaze: Every 2+3 Turns - Means the enemy will use it on turn 2,5,8... etc

Miasma : Every 3+3 Turns - Means the enemy will use it on turn 3, 6, 9... etc

Hope that I understood it correctly! Goodluck

~ Dinhbat
Here's his attack pattern.

[IMG]http://i278.photobucket.com/albums/kk83/infidel775/RPGMAKER%20Screens/attackpattern_zps9d244afb.png[/IMG]

I'll try your suggestion and see if it works. ^^

Edit: Changed the R status to 5 for both skills while I was at it; now he uses them properly, with your advice. Just need to balance the damage and Fear state.
rikardhyuga, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


Please create your own thread for your own issue, instead of adding one to someone else's very old and unrelated thread.

Original thread: https://forums.rpgmakerweb.com/threads/enemy-targets-an-actor-with-a-certain-state.18384/