Custom Skill Effects

Discussion in 'RPG Maker MV' started by Moo :D, Apr 19, 2016.

  1. Moo :D

    Moo :D Veteran Veteran

    Messages:
    31
    Likes Received:
    3
    First Language:
    English
    Hi everyone! :D


    How would I go about setting a skill to behave differently according to the enemy's state?


    For example, 


    Poison Slash: If the enemy is affected by poison, this attack does 200% bonus dmg. If not, this attack does nothing.


    Thank you for taking time to check this post out! ^__^


    I am using Yanfly Engine so if there isn't a way to do this in the formula box, a yanfly lunatic mode effect would be great! I don't know enough js to utilize lunatic mode on my own T__T
     
    Last edited by a moderator: Apr 19, 2016
    #1
  2. shockra

    shockra Slightly Crazy Programmer Veteran

    Messages:
    407
    Likes Received:
    178
    Location:
    US
    First Language:
    English
    Primarily Uses:
    RMMV
    I'm not certain of the exact code, but I think it goes something like this in the Skill Notes:


    <damage formula>


    value = user.atk * 4 - target.def * 2


    if (target.isStateAffected(StateID)) {


    value *= 2}


    else {


    value *= 0};


    </damage formula>


    You'll need the Yanfly DamageCore to use this code.  Basically, what it does is set the value first (based on whatever parameters you set, what I used is an example).  Then the if statement checks if the target has the poison state, then adjusts the formula accordingly.
     
    #2
    Moo :D likes this.
  3. beenbaba

    beenbaba Slowly getting there Veteran

    Messages:
    289
    Likes Received:
    157
    Location:
    England
    First Language:
    English
    You can do it in a normal damage formula if you'd prefer using this


    b.isStateAffected(StateID)?(a.atk*4-b.def*2)*2:0


    Explanation


    b.isStateAffected(StateID)? = is the enemy effected by StateID


    (a.atk*4-b.def*2)*2 = if effected, take damage formula and multiply it by 2


    :0 = else do 0 (the : means else)      
     
    Last edited by a moderator: Apr 19, 2016
    #3
    Moo :D and boomy like this.
  4. Moo :D

    Moo :D Veteran Veteran

    Messages:
    31
    Likes Received:
    3
    First Language:
    English
    thank you both for taking the time to help me! This answers the question completely I used both of your responses to get it done, thanks!! :D
     
    #4
  5. Moo :D

    Moo :D Veteran Veteran

    Messages:
    31
    Likes Received:
    3
    First Language:
    English
    Hey yall! New question, is there anyway to alter a skills hit rate in the formula box? So for example:


    attack: if user is affected by blind, hit rate = 0, else = (normal dmg rate here)


    Edit:


    I found the answer to this question digging around the forum! Thank you all for your help once again!
     
    Last edited by a moderator: Apr 19, 2016
    #5

Share This Page