Ramza's State Workshop OPEN (current states: 26 LATEST: Overpower + Darkness Burst)

Discussion in 'Resource Workshops' started by ramza, Aug 2, 2016.

  1. ramza

    ramza Lunatic Coder Veteran

    Messages:
    559
    Likes Received:
    309
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    Good afternoon, party people.

    One of the problems with having a class change system in your project is balancing spellcaster classes with melee classes, particularly if your system involves using job commands from your other classes, like in FF Tactics. The most obvious solution to this, is to make magic spells cost ridiculous amounts of MP, and make non-mage classes not have much to begin with. The best way to balance this out, is to give mages some options in how to have more effective MP, without inflating their actual MP pool. For this, I offer up Mind and Body, a passive effect that restores MP whenever the affected battler has his Hp restored by a healing spell.
    upload_2017-5-28_13-39-4.png

    And here is our paste code:
    Code:
    <Custom React Effect>
    if (this.isHpEffect() && value < 0 && this.isMagical()) {
     target.gainMp(-Math.floor(value * 0.05))
    }
    </Custom React Effect>
    This very simple state can go miles towards balancing your MP costs on spellcasters. You can tweak the exact numbers a bit, as well, to work better in your project, too.

    That's all for this update this week folks. See ya next time.
     
    ashikai likes this.
  2. Chaos17

    Chaos17 Dreamer Veteran

    Messages:
    1,253
    Likes Received:
    420
    Location:
    France
    First Language:
    French
    Hi,

    I've a request, I'm interested in that lunatic effect but instead of an element I would like it for CRIT instead, please.
    [​IMG]
     
    ashikai likes this.
  3. ramza

    ramza Lunatic Coder Veteran

    Messages:
    559
    Likes Received:
    309
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    It'd look something like this, used in the same way, on a state active on the attacker. The skill would give the normal amount of Tp, but would give 5 extra if the attack was a critical.
    Code:
    <Custom Confirm Effect>
    if (this.isHpEffect() && value > 0 && target.result().critical){
     user.gainTp(5)
    }
    </Custom Confirm Effect>
     
  4. ramza

    ramza Lunatic Coder Veteran

    Messages:
    559
    Likes Received:
    309
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    Alright, it's state Sunday everyone, and you know what that means? More states, of course.

    This week, I bring Overpower, a passive state that causes physical attacks to add a damage over time effect to their target. In my project, this passive pairs with the Dark Aura state posted a while back, as the offensive opposite to the Blackguard job's Dark Aura defensive state. As you may recall, the Dark Aura state had a requirement that the user has to have a shield in his offhand for the effect to be active, well this state requires the offhand to be either empty, or holding an offhand weapon, meaning no shield. This passive is designed with a strong two handed weapon in mind, but also works with dual wielding as well.

    Now you might be wondering, what makes this state so different from the bleed state I posted even longer back, so I will cover the differences here before we get started:
    • Overpower has an animation
    • Overpower deals elemental damage, while bleeding damage is non-elemental
    • Overpower can continue to stack up damage until it becomes unmanageable by the target
    • Bleed deliberately limits the amount of damage dealt, and prevents re-application if the total effect of the new bleed stack would be less than the remaining effect of the current bleed effect. Overpower just adds incoming damage to the bank.
    Also, since I've already got them made, I have a couple of bonus effects for use with Overpower as well. The first is only partially related, but causes dark elemental damage you deal to restore Hp, which Overpower does, so I included a little section in the paste code. The other effect is an active skill that consumes the remaining effect of Overpower on the target to cause damage to the afflicted target based on the remaining effect.

    So, what you need to set this up:
    • The usual plugins
    • My State Animation Damage plugin
    • Two states for the effect (244, 246), one more state for the optional damage boost (245).
    • One state for the bonus (247).
    • One skill for the second bonus effect.

    So first of all, let's get our passive state down here.

    upload_2017-6-4_15-44-10.png
    And the paste code:
    Code:
    <Custom Passive Condition>
    //this is a check to see if the state will be active
    //first it checks to make sure the user belongs to the blackguard class, and then that either the offhand is empty, or that it is a weapon
    if (user._classId == 16 && (user.equips()[1] == null || (user.equips()[1] != null && user.equips()[1].wtypeId != undefined))) {
    condition = true
    }else{
    condition = false
    }
    </Custom Passive Condition>
    <Custom Confirm Effect>
    //here is the meat of the state. this confirm effect adds to the existing shadowDot if it's there, if not it creates one.
    if (target.shadowDot == undefined) {
     target.shadowDot = 0
    }
    if (this.isHpEffect() && this.isPhysical()) {
    //this bonus section is used to add 20% if the user is affected by another state. This could be a generic shadow damage bonus, or a specific passive ability.
     if (user.isStateAffected(245)){
      var bonus = value * 0.2
     }else{
      var bonus = 0
     }
     target.shadowDot = (target.shadowDot + value + bonus)
    //sets the shadowDot to the value of the landed attack, (+bonus if applicable)
     target.addState(246)
    //adds our damage state
    }
    </Custom Confirm Effect>
    This state is active on our blackguard at all times. When he deals a physical blow to a target, it applies the damaging state to the target, and increases the shadowDot value that the damaging state uses to deal damage. Also within the paste code is a section where the shadowDot value is increased by an additional 20% if the user has state 245 active on them. This could be a temporary buff spell, a state that increases shadow damage, or any other passive state you'd like. In my project this state is used to increase the damage of all dark elemental spells, to which this technically belongs to, but doesn't occur automatically, so I've added it in here.

    Our second state is the damaging state, which causes dark damage to the afflicted battler based on the value of the shadowDot value on them (which is applied and updated by the passive state above).

    upload_2017-6-4_15-55-26.png
    Here's our paste code for this:
    Code:
    <Custom Apply Effect>
    //when this state is re-applied, it always sets the remaining duration to 3 turns
    target._stateTurns[246] = 3
    </Custom Apply Effect>
    <Custom Turn End Effect>
    //The first step is to use the state animation damage plugin to deal damage to the target
    //we're dealing damage equal to the remaining shadowDot effect divided by the number of remaining turns.
    performStateAnimationDmg(187, this, Math.floor(this.shadowDot/this._stateTurns[246]), 9);
    basedmg = (Math.floor(this.shadowDot / (this._stateTurns[246]+1)))
    //this next section is the setup for our bonus state, which heals the user when he deals dark damage.
    //read bonus below for more info
    if (origin.isStateAffected(247)) {
      healamt = Math.floor((basedmg * (3/10)))
      origin.gainHp(healamt);
      origin.startDamagePopup();
    }
    //Here we are subtracting the damage dealt to the target from the remaining shadowDot value
    this.shadowDot = this.shadowDot - basedmg
    </Custom Turn End Effect>
    <Custom Remove Effect>
    //if the state is removed, we make the shadowDot value undefined again
    target.shadowDot = undefined
    </Custom Remove Effect>
    So, currently what we have is a passive effect that adds up physical damage that you deal to a counter on the target, and adds a damaging state to that target that deals 1/3 of that stored damage per turn to that target, for three turns. Subsequent hits to the same target will add more damage to the bank, but the remaining turns on it will never exceed three. Additionally, if you are affected by state 245, this damage banked will increase by 20%.

    Example: You hit the bat for 1000 damage. You have state 245, so the damage banked is 1200. The bat hits you back. At the end of its turn, it takes 1200/3 = 400 dark elemental damage. On the next round, you swing at the bat, but miss. At the end of the bats next turn, it takes 800/2 = 400 damage. On your next turn you hit it again for another 1000 damage. This brings the damage bank up to 1200+400 = 1600 damage, and resets the turns on the state to 3. At the end of the bats next action, it takes 1600/3 = 533 damage.

    Our state is complete, and provides a way for our Blackguard to effectively double the damage output of his physical skills. Pretty neat, eh? Well, as I said above, I have a couple of bonus for this state already made up, so I'll share those too. Dark Succor causes all dark elemental damage you deal to also heal you for 30% of the effect. For most sources of dark damage, this would be automatic with the following note tags:
    Code:
    <Custom Confirm Effect>
    elements = this.getItemElements()
    if (this.isHpEffect() && elements.contains(9) && value > 0) {
     healamt = Math.floor((value * (3/10)))
     user.gainHp(healamt);
    }
    </Custom Confirm Effect>
    ...but in this case, the dark damage from Overpower is happening outside of the scope of a confirm effect. So we've included code in the damaging state above, to add hp to our origin if the origin is affected by this state (247). This add-on makes it so that our powerful blackguard is also capable of sustaining his own Hp during battle, at least a little bit.

    Our second bonus is a skill. Darkness Burst takes the remaining effect of our damaging state, and causes it immediately on the target, in much the same way Quickmend uses up the remaining Prayer of Mending stacks to cause a large heal.
    upload_2017-6-4_16-14-49.png

    One interesting thing to note about this skill in particular is that it actually double-dips on the shadow damage increase from state 245, as that state increases the damage banked, but also increases the actual damage dealt of this skill, as well. Balance accordingly.

    That's all for this update folks. See ya next weekend (probably).
     
  5. Lnik3500

    Lnik3500 Master Troll Veteran

    Messages:
    303
    Likes Received:
    47
    Location:
    Somewhere you will less expect me to be.
    First Language:
    French
    Primarily Uses:
    RMMV
    Hello @ramza I'm here with a simple request:

    Yanfly's Buffs and States Core allows buffs or debuffs to have a green / red text counting the turns and a % showing the % of the buffs / debuffs.

    DO you know how I can reproduce that? Thank you for your time and sorry for my english :p
     
  6. Iqus

    Iqus inVictor Member

    Messages:
    27
    Likes Received:
    11
    Location:
    England
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    If you read the help file for Buff & State core...
     

    Attached Files:

  7. Lnik3500

    Lnik3500 Master Troll Veteran

    Messages:
    303
    Likes Received:
    47
    Location:
    Somewhere you will less expect me to be.
    First Language:
    French
    Primarily Uses:
    RMMV
    @Iqus Thank you for your response, but I need a way to make a state show the % of the buff like it does with base parameters (when you apply an ATK buff, it shows 125% at the bottom of the icon).

    Anyway thank you for your esponse, I missed that notetag while reading the help file :p
     
  8. ramza

    ramza Lunatic Coder Veteran

    Messages:
    559
    Likes Received:
    309
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    You can use a state counter to show just about anything on the state, it doesn't necessarily have to be a stack number or whatever.
    setStateCounter(stateId, 'value') would show the word value over the state. Put that in a custom apply effect, and it'll show that on the state every time it is applied. It can show a string, or a number, or anything, really.
     
    Lnik3500 likes this.
  9. satoshi1101

    satoshi1101 A man who eats eggs and watermelon together Member

    Messages:
    19
    Likes Received:
    4
    Location:
    Strange chocolate star
    First Language:
    SuperJapanese
    Primarily Uses:
    RMMV
    Hello!
    Is state possible to stop time?
    JoJo's bizarre adventure like DIO ...
    The actor granted the time stop state wants to stop the butler's time other than the actor.
     
  10. ramza

    ramza Lunatic Coder Veteran

    Messages:
    559
    Likes Received:
    309
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    There are several ways to do this sort of thing.
    Using the YEP_X_PassiveAuras plugin, you can cause a state to add another state to all other battlers other than the caster.
    • Cast your timestop spell
    • Apply the timestop effect to the caster
    • The timestop effect causes an aura state to all allies and all enemies that has the "condition: can't move" option checked.
    • Have the timestop effect expire after a number of turns.
    • When it expires, it will automatically remove the aura from the other battlers.
    For an added bonus, you could also use the 'Immortal' default state as an aura on the timestop effect. This will make all battlers in the fight continue to take damage, but not die until the timestop effect is over, when the effect leaves, it takes the aura states with it, any enemies with 0 HP when the immortal state is removed will instantly die.

    I have a very similar mechanic in my own project, and ran into a couple of problems with it that I still didn't resolved. The major problem is that animated battlers continue to be animated when time is stopped. I got around this by causing them to be in their 'injured' animation. Not a perfect solution, but freeze-framing animations doesn't seem to be possible without a plugin that doesn't exist. I also added something to tint the whole screen to greyscale when the spell is cast, and return it to normal when it finishes, which was fine, but I wanted it to be that the user wouldn't tint or freeze, as they were the only thing running in real time, but it would seem to be impossible to tint only the background, and individually affected battlers, rather than the full screen, without the use of a plugin that either doesn't exist or hasn't been made yet.

    Anyways, the above 'works' fine, it just needs to be cleaned up a bit.
     
  11. satoshi1101

    satoshi1101 A man who eats eggs and watermelon together Member

    Messages:
    19
    Likes Received:
    4
    Location:
    Strange chocolate star
    First Language:
    SuperJapanese
    Primarily Uses:
    RMMV
    Me too.
    When the time ceased, it continued to be plagued by the problem that animated combatants continued to be animated.
    What is the way you did?
    For example, how to animate into 'injured' state.
    Is it motion of 'injured' of YEP_X_AnimatedSVEnemies?
     
  12. ramza

    ramza Lunatic Coder Veteran

    Messages:
    559
    Likes Received:
    309
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    The aura state that freezes everyone can also set their animations:

    upload_2017-12-29_7-7-2.png

    I did some other nonsense with tinting, and, custom apply and custom leave effects to desaturate the whole screen too, but I don't like the effect, and it has the side effect that if you use a skill with an action sequence that tints the screen, the tint is reset to base afterwards.
     
    satoshi1101 likes this.
  13. satoshi1101

    satoshi1101 A man who eats eggs and watermelon together Member

    Messages:
    19
    Likes Received:
    4
    Location:
    Strange chocolate star
    First Language:
    SuperJapanese
    Primarily Uses:
    RMMV
    tanks!
     
    Last edited: Jan 31, 2018
  14. SergeX

    SergeX Veteran Veteran

    Messages:
    64
    Likes Received:
    14
    First Language:
    Portuguese
    Hello Ramza! I liked the idea of your Bard skill but I was wondering if I could reach a similar but different effect .

    In my project, I have a Shamanist class that uses Aura effects. But special twist would be:

    - The Shamanist can mantain only one Aura active;
    - While the Aura is active, it consumes MP from the caster;
    - The Aura can last as long as the caster has enough MP.

    I could simply use the command in the State notebox to make the caster lose MP every turn, but the idea of %MP is not attractive - I would like to use a flat amount of MP. Also, since it's a Aura effect, it would also drain MP from the other allies, correct? And this is not the goal. Any ideas about how I could achieve this effect? I'm using Yanfly Aura Passive States plugin.

    Thanks in advance!
     
  15. ramza

    ramza Lunatic Coder Veteran

    Messages:
    559
    Likes Received:
    309
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    Boy, looking back at those bard songs, they really are a mess, right?

    So what you describe is almost exactly what my singing state does. But the YEP_X_PassiveAuras plugin really simplifies it a lot.

    Using that, we can make a pretty simple system almost exactly like my bard song states, but much much more simple.

    So you make a bunch of skills, one for each aura. Do their action sequences as desired, and have them put a unique state on the caster when used, and also remove the states from the other aura skills (Lets say you have fire and water aura, fire would add 'fire aura' to the caster, and removed 'water aura', and vice versa). This is a dirty way to implement this. Alternatively, you can do what my bard songs did earlier, which was hiding skills from use as long as a song was active, but that's a lot more work, and pretty messy by today's standards.

    Each of your aura states are going to have some note tags on them too. The first one is the passive aura state that you want the aura to provide to your allies.
    <Alive Ally Aura: x>
    This note tag makes it so that if anyone is affected by the state applied by the skill, all of his/her/its allies gain the state with id X in the database.

    Using our above example of a fire and a water aura, you'd make two more states, calling them fire effect and water effect, respectively, and giving them whatever bonus or effect you want the actual aura skill to bestow to your allies.

    The second thing we need is the note tags to maintain the upkeep Mp cost, and remove the aura state if the user doesn't have enough Mp. I covered this pretty well in the bard song state (which you've clearly read).
    Code:
    <Custom Turn Start Effect>
    if (user.mp < 5){
      user.removeState(X)
    }else{
      user.gainMp(-5)
    }
    </Custom Turn Start Effect>
    This will subtract 5 Mp from the user at the start of every turn. If he doesn't have 5 Mp, it will remove the state, and with it all the aura states on all of his allies.
     
    SergeX likes this.
  16. SergeX

    SergeX Veteran Veteran

    Messages:
    64
    Likes Received:
    14
    First Language:
    Portuguese
    That code is exactly what I couldn't do, I guess that I missed that part from your original Bard skill lol
    It looks so simple but I really struggle with customized codes hahaha
    Thanks!
     
  17. Dankovsky

    Dankovsky Veteran Veteran

    Messages:
    200
    Likes Received:
    150
    First Language:
    RU
    Primarily Uses:
    RMMV
    I love this thread :) Thank you Ramza for your great work!

    I had a state idea I thought you could help with.

    State Name:
    Heart Disease
    State Description:
    Lasts 5 turns. At the start of every turn (or at the end of every action of the affected target) the target has a 10% chance to die instantly. Every turn, the chance increases by 10%. So it has 10% chance to die at turn 1, 20% at turn 2, and up to 50% at turn 5. If it doesn't die, the state just fades away after 5 turns.
    Plugin Requirement:
    None, I think.
    Required Compatibility:
    I'm using Ellye's ATB. However I have it set up that it works fine with turn-based states so I think compatibility shouldn't be a big problem. Otherwise I'm fine with using any Yanfly's plugins.
     
  18. ramza

    ramza Lunatic Coder Veteran

    Messages:
    559
    Likes Received:
    309
    Location:
    Nova Scotia, Canada
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks @Dankovsky I appreciate that despite my not having updated the thread in forever, that people are still getting a good use out of my states. What you're requesting is actually pretty simple using lunatic tags. All we need is a state with the following settings:
    HeartDiseaseSTATE.png
    Note that the turn ends [5] setting is the only really important part of the state here... and the note box of course. The way I scripted this, it doesn't really work if the state lasts more than five turns, but you can change that by changing the 6 in the code below to a higher number.

    Anyways, here's what's in our notebox:
    Code:
    <Custom Action End Effect>
    //first we set the rate of death chance
    var turnNumber = 10 * (6 - user._stateTurns[stateId])
    //As the state lasts 5 turns, we get a 10% chance per turn it's been on from the above formula.
    var check = Math.randomInt(100)
    //Grab a random 0-100 number
    if (check <= turnNumber){
    //if the number is between 0 and the % death chance, you die
     user.addState(1)
    }
    </Custom Action End Effect>
     
    Dankovsky likes this.
  19. Dankovsky

    Dankovsky Veteran Veteran

    Messages:
    200
    Likes Received:
    150
    First Language:
    RU
    Primarily Uses:
    RMMV
    That was fast! Thank you! I'll probably be back soon enough once I stumble myself on another idea I can't figure out. Reading scripts by others is very helpful to learn to figure things out yourself.
     
  20. Mihe

    Mihe Veteran Veteran

    Messages:
    192
    Likes Received:
    71
    First Language:
    English
    Primarily Uses:
    RMMV
    State Name:
    Haven't really thought of a name, but for now let's just call it "Summon".
    State Description:
    A skill that calls forth an actor or enemy to fight alongside with you in the current battle, lasting only a couple of turns.
    Plugin Requirement:
    Not too sure if this may require something.
    Required Compatibility:
    I'm currently using Yanfly's ctb
     

Share This Page