May I ask how to identify hit and evasion in Yanfly's action sequence?

● ARCHIVED · READ-ONLY
Started by AnNihilate 3 posts View original ↗
  1. Hello guys!

    I apologize for my poor English firstly, but if I could get some help, I would appreciate it.

    Actually, I'm now trying to work out how to identify whether actors hit the target or not with yanfly's action sequence. The problem is that whatever the basic attack or skill hit the target or is evaded, states will absolutely be added to targets if "add state x" command is included. In this case, I'm looking for a solution that I could identify the attack is hit or evaded. If it's hit, then states will be added to that target while it's not, states won't be added.

    The reason why I don't just put states in the effect list is that I designed a weapon. If it is equipped by an actor, then the actor's attack will 100% add one state randomly from the states list every time. In other words, if user has this weapon, his every single attack can add different states with 100% rate. So, it can not be achieved if I just add states to the effect list on the skills page or to the traits list.

    That's the reason why I want to distinguish hit and evasion for attack. Actually, I don't know how to write the syntax correctly because I'm not professional at JS.

    Following spoiler is my action sequence code. Could someone do me a favour? Hope I could get solutions for modifying the code because you guys are intelligent! :)
    Spoiler
    <setup action>
    immortal: target, true
    camera focus: user
    zoom: 150%, 15
    wait for zoom
    move user: point, 740, 400, 20
    wait for movement
    face user: target
    </setup action>

    <target action>
    perform action
    motion wait: user
    reset camera
    camera pan: left, 200, 15
    wait for camera
    animation 11: target
    wait for animation
    reset zoom: 5
    wait for zoom
    reset camera: 10
    wait for camera
    action effect
    </target action>

    <follow action>
    wait for effect
    immortal: target, false
    if user. isLearnedSkill(31) && target. isDead()
    tp +5%: user
    end
    if target.result().isHit
    change variable 20 = Math.random()*10
    if $gameVariables.value(20) >= 0 && $gameVariables.value(20) < 3
    add state 1: target
    if $gameVariables.value(20) >= 3 && $gameVariables.value(20) < 6
    add state 2: target
    if $gameVariables.value(20) >= 6 && $gameVariables.value(20) < 10
    add state 3: target
    end

    </follow action>

    <finish action>
    move user: RETURN, 30
    wait for movement
    clear battle log
    </finish action>
  2. I'm a bit rusty with action sequences, but try this:

    if target.result().missed || target.result().evaded
    break action (or leave blank)
    else
    add states here
    end
  3. zaraku said:
    I'm a bit rusty with action sequences, but try this:

    if target.result().missed || target.result().evaded
    break action (or leave blank)
    else
    add states here
    end
    Hello! Sorry for the late response and thank you for replying me.

    Yeah, I've already inset the code into the plugin directly then it works.
    thank you very much