Have enemies only be damaged by certain skills depending on States to the enemy applied?

Discussion in 'RPG Maker VX Ace' started by ALTERED STATE ?, Apr 28, 2015.

  1. ALTERED STATE ?

    ALTERED STATE ? They/Them Veteran

    Messages:
    183
    Likes Received:
    271
    First Language:
    English
    Primarily Uses:
    RMMV
    I am having trouble figuring out how to have enemies only be damaged by certain skills depending on States to the enemy applied, is there a way to do this with events or preexisting scripts?

    Such as having an Enemy only be damaged by the skill 'Back Slash' because it has the State 'Front Guard' applied
     
    #1
  2. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,555
    Likes Received:
    10,496
    First Language:
    English
    Primarily Uses:
    RMVXA
    Try something like this in the damage formula of your skill 'Back Slash'

    [SIZE=10.5pt]if[/SIZE] [SIZE=10.5pt]b[/SIZE][SIZE=10.5pt].[/SIZE][SIZE=10.5pt]state[/SIZE][SIZE=10.5pt]?([/SIZE][SIZE=10.5pt]x[/SIZE][SIZE=10.5pt]);[/SIZE][SIZE=10.5pt] damage formula [/SIZE][SIZE=10.5pt];[/SIZE] [SIZE=10.5pt]else[/SIZE][SIZE=10.5pt];[/SIZE][SIZE=10.5pt] 0[/SIZE][SIZE=10.5pt];[/SIZE] [SIZE=10.5pt]end[/SIZE]

    [SIZE=10.5pt]where x is the state id of 'Front Guard'[/SIZE]

    [SIZE=10.5pt]What this does is check if state x is present.  If it is, then the damage you define is applied; if not then damage = zero.  Note the semi-colons, they are important.[/SIZE]

    [SIZE=10.5pt]A neater way of putting that formula would be[/SIZE]

    [SIZE=10.5pt]b.state?(x)? damage formula : 0[/SIZE]

    [SIZE=10.5pt]The colon acts as the if/else.  The first is more obvious in its meaning, so if you don't use different formulas very often it is easier to remember what's going on.[/SIZE]
     
    Last edited by a moderator: Apr 28, 2015
    #2
  3. ALTERED STATE ?

    ALTERED STATE ? They/Them Veteran

    Messages:
    183
    Likes Received:
    271
    First Language:
    English
    Primarily Uses:
    RMMV
    That isn't exactly what I meant, what I meant was I need to have the skill be able damage enemies with and without the '--- Guard' state but have enemies with the '--- Guard' state only be able to be damaged by skills 'marked' in some way so that the skill will damage otherwise invincible enemies be damaged

    I hope I explained it better, I will still experiment with the formula to see if I can get it to work

    EDIT: I forgot other bits in your post so this post might be pointless
     
    Last edited by a moderator: Apr 28, 2015
    #3
  4. estriole

    estriole Veteran Veteran

    Messages:
    1,030
    Likes Received:
    334
    First Language:
    indonesian
    you need to alter ALL skill damage formula for that. :D .

    it would be easier to use element instead. create the front guard state which immune to all element (including physical) except one element called back stab. then in the skill back stab... use that element.

    and enemy without that state can still be damaged with the skill back stab as long as they not immune to back stab element.

    but you must careful if you create some state / equipment that reduced element resistance against physical. make it also reduce back stab element too.
     
    Last edited by a moderator: Apr 28, 2015
    #4
  5. ALTERED STATE ?

    ALTERED STATE ? They/Them Veteran

    Messages:
    183
    Likes Received:
    271
    First Language:
    English
    Primarily Uses:
    RMMV
    Thank you ksjp and Estriole for the assistance with my problem
     
    #5

Share This Page