Yanfly's Buffs and state core State that deals damage to the enemy when he uses a skill

● ARCHIVED · READ-ONLY
Started by Klammsi 5 posts View original ↗
  1. Hey guys,

    I was hoping somebody could help me out with a custom state that I am trying to create for one of my skills.

    The skill I want to create is called Rapture, inflicting the enemy with a state that will deal damage to him every time he "moves"

    Defined as movement are all skills that considered as melee (standard attacks with melee weapons melee skills, items etc)

    After looking into Yanfly's Buffs and States Core I believe I found the correct Lunatic Mode Nottag

    <Custom Action Start Effect>
    code (I assume here I will have to list all the skills)
    code
    </Custom Action Start Effect>

    Unfortunately my Java Script knowledge is very poor so if anybody could give me a tip as to how to write the code I would be grateful!

    Thank you in advance to everyone taking their time to reply!
  2. I am having loads of issues with my RPG Maker right now, so it's difficult to test, but I could confirm that dropping this code in the state notebox (with yanflys buff and states core) makes it so physical attacks and skills cause %10 Max hp damage to the user. I'm not sure if it works with items, but if an item deals physical damage, I would imagine it works.

    The only downside is that it's showing the damage the player deals and the damage the player takes simultaneously -- which could be confusing. I can imagine this is an easy fix, but I can't do further testing until I fix whatever is going on on my end. If you want to change the percentage damage, change the decimal value and make sure it's negative or it will add HP.

    <Custom Confirm Effect>
    if (this.isPhysical()){
    user.gainHp(a.mhp * -.1)
    }
    <Custom Confirm Effect>

    If you want to make it a flat value change it to this:

    <Custom Confirm Effect>
    if (this.isPhysical()){
    user.gainHp(-10)
    }
    <Custom Confirm Effect>

    Hope this helps. Wish I could do more. If anything, this is a skeleton you can build on.
  3. @Rpgeno
    Hello mate,
    Thx for your reply. Your method is working perfectly fine, I have actually done something similar already on one of my other skills. The problem with this method is though that in order for it to work the enemy has to deal damage to the character otherwise he won't take any damage himself.

    Now at the moment characters in my project have a lot of ways to neglect damage, such as dodging, blocking, certain states etc.

    The idea behind the skill that I am trying to create is that they will receive damage regardless of the fact that they are dealing damage or not.
    Simply the fact that they are initiating a melee attack should force them to take damage.

    I have been experimenting a bit but can't seem to work it out.

    Basically what I would need is a line of code that will deal damage to the enemy when he is performing an "action", but only if the action is defined to be "melee". (All my close combat attacks have the damage element of melee)
  4. I appreciate your detailed feedback. I'm going to revisit this today and hopefully figure this out.
  5. I think I worked it out.
    This is the code I used now

    <Custom Initiate Effect>

    if (this.isPhysical() && this.item().damage.elementId !== 2){

    user.gainHp(-60)

    }

    </Custom Initiate Effect>

    element ID 2 is the damage element for Range attacks in my project.
    This code runs before any damage is dealt etc. so the enemy will take damage regardless if his action connects and deals damage.

    So as long as its a physical attack and not "Range" damage will be dealt to the enemy at the start of his action.

    The only problem with this is that you don't see the damage popup. So unless you have a plugin that shows enemy health bars or a Libra skill to scan the enemy, the player wont know that damage has been dealt.