Touch of Death

Welcome to this weeks state shop update. I’d like to start by apologizing for missing the update last week. I was at a wedding on the weekend, and then some health stuff happened that wasn’t pleasant the result was some missed work, and unfortunately, a missed update. Apologies.

 

Alright, with that out of the way, let’s talk about today’s state, Touch of Death. Inspired by a similar skill of the same name in Final Fantasy XIV, touch of death is a damage over time effect that gets stronger the longer it is on the target. My example lasts 12 turns, and the damage it deals doubles each turn it is active. This effect is possible thanks to state counters, a feature of yanfly’s Buffs and States Core plugin (which we always use already).

What you need:

  • A state, and a skill to apply it.
  • The usual plugins

First, here’s a screen grab of our state. Note the turn duration, and remove at battle end.

touchofdeathstate

Now, to keep with our other damage over time states, this state will also take into account the element of it when it deals damage. In my example, I have created a variable to reduce the damage from the state as if it were a physical attack. This is the default formula that Yanfly’s Armor Scaling plugin uses. You can also change this to just about anytghing to make it work in your project, but remember that damage reduction from the armor scaling plugin doesn’t take effect on damage dealt by states in this way. It is also important to note, that because by the last turn of this state, it will be doing 12x more damage than it did on the first turn, the base damage of the state should be very low. In this example, the state deals damage equal to the actor’s attack parameter.

Here is the paste code:

<Custom Turn End Effect>
this.addStateCounter(29, 1);
if (this.getStateCounter(29) > 12) {
 this.setStateCounter(29, 12)
}
var ele = 1
var reduction = (100 / (100 + (this.def / 2)))
var formula = Math.round((origin.atk * this.getStateCounter(29)) * reduction);
var total = (Math.floor(formula * ((Math.random()*40)+80)/100) * this.elementRate(ele))
this.gainHp(-total);
this.startDamagePopup();
if (this.isDead()) {
 this.performCollapse();
}
</Custom Turn End Effect>
<Custom Leave Effect>
var ele = 1
var reduction = (100 / (100 + (this.def / 2)))
var formula = Math.round((origin.atk * 12) * reduction);
var total = (Math.floor(formula * ((Math.random()*40)+80)/100) * this.elementRate(ele))
this.gainHp(-total);
this.startDamagePopup();
if (this.isDead()) {
 this.performCollapse();
}
</Custom Leave Effect>

Note that the state Id we’re working with is 29, and this will need to updated in your own project. Also note the Math.random function is being used to add variance to the damage of the skill, in this case, 20%. When the state first does damage, it is at one stack, so it will deal 1x damage. Every turn end after, it gains one more stack, dealing more damage each turn, until it falls off on the 12th turn, dealing 12x damage. The state is designed to never exceed twelve stacks, but you can adjust that to your liking. See below for a possible strategy tip regarding this state, and others like it.

Bonus: Strategy:

This effect is mostly only useful for the start of a fight, as if the enemy dies early after receiving it, it will not have done much damage. However, as scripted, if someone re-applies the state, the turn counter will remain where it was when the state is re-applied, allowing someone to refresh the highly stacked state with a fresh 12 turn duration. This results in a Damage over time type strategy, where applying this state, and keeping it on the target becomes a very high source of damage.

 

If you don’t want this to happen in your project, you can add the line <Reapply Ignore Turns>, which will causes a skill that re-applies this state to have no effect on it. This would prevent the damage stacking of the above tip.

 

That’s all for this update folks.

 

~Ramza

Bleed Effects

Welcome back. Before I get started today, I just want to draw a little attention to a couple of links around the internet. First, there’s a link on the side bar, for my patreon page. If you like what I do, feel free to check that out, and see what else I could be doing for you (and everyone else). Secondly, I have a topic up on the rpgmakerweb forums  where I’m taking requests for custom states people want to see. I’ve already made a couple (stacking parameter buff, and Break/Topple/Daze), which you can find on that page. If you’re looking for ideas, or want some help with your own states, feel free to drop on in there and say hi.

 

Alright, so this week’s state is going to be a simpler one, bleed. In most rpgs, damaging states like poison inflict damage based on the stats of the actor that applied it. In RMMV, however, damaging states exclusively deal a percentage of the afflicted target’s HP. This presents a major balancing issue, namely, boss fights. In this scenario, a boss is susceptible to a poison status effect, but because poison does 10% of its health every turn, this boss fight won’t last more than ten turns if he’s inflicted with it. If you lower the damage of the state, the state becomes useless against normal monsters, as a lower number would lower the damage to the point where attacking is better.  The solution, is damaging states that deal damage based on the parameters of the attacker, like a normal skill, but every turn. The first of these states I created was actually poison, but that’s no fun, so bleed will be my share today.

Bleed causes damage over time to the afflicted target. When hit with a bleed effect, the total amount of damage the bleed effect will do is set by the skill that applied it. At the end of each turn the target takes afterward, he will take 1/3 of that damage. If the bleed effect is applied again, the total values are compared, and if the new effect would cause less total damage than the remaining effect of the current bleed, it will not be applied. After three turns, the bleed will have fully run its course.

Example:

Rend is a strong melee attack that adds 100% of damage done as a bleed effect.

Axe Mastery causes a small 1/3 of damage dealt bleed effect to physical attacks when an axe is equipped.

Harold performs a normal attack on Bat A, with an axe. He deals 180 damage. The bat’s bleed value is set to 60. When the bat next attacks, it takes 20 points of bleed damage after its turn, lowering the bleed total to 40. The next round, Harold uses rend, and deals 360 damage. This bleed value is higher than the one currently on the bat (40 v 360), so it overwrites the old bleed, and resets the turns to 3. The bat then takes 120 damage on it’s next turn. Harold attacks again, causing 180 damage. The new bleed effect is only 60, to the remaining 240 of the previous bleed, so it is ignored. The bat goes again and takes another 120 damage.

What You Need:

What to Do:

  • First thing we need is a state. Give it whatever icon you wish, there is nothing fancy in any of it’s default parameters. The meat of the state is coming from the note tags, as usual.
  • Some set up is required on the skill that will apply the bleed effect. I will cover that code first, below.

The Skill:

For our rend skill, we need to use the action sequence plugins to run some custom code when the attack is used. We’re using these to apply the bleed damage and number of turns to the enemy that is attacked. Text in red needs to be modified to meet your project.

<Setup Action>
display action
camera focus: user
zoom: 200%
wait for camera
cast animation: user
wait for animation
</Setup Action>
<Target Action>
wait: 20
motion attack: user
wait: 10
camera focus: target, 5
wait for camera
action animation: target
wait for animation
action effect: target
if (target.bleedValue == undefined || target.result().hpDamage > target.bleedDamage)
 eval: target.bleedValue = (target.result().hpDamage)
 eval: target.bleedTurns = 3
 add state 191: target
end
wait: 20
</Target Action>
<Finish Action>
clear battle log
reset zoom
reset camera
perform finish
wait: 10
</Finish Action>

Please note that the state applied in the action sequence above must have its ID changed to match your project.

In the actual state, we make use of those two parameters we create using the eval tags, to determine the bleed damage, and the length of the bleed effect. Those values can be modified to better fit your project,  if needed as well.The if statement in the action sequence is used to determine if the rend effect is applying a bleed that is stronger than any existing bleed effect already on the target. If it detects a bleed effect with a larger total than the one being applied, it doesn’t apply the state, or change the total.

 

State:

The state itself is pretty straightforward. Every turn, damage is dealt to the afflicted battler equal to 1/3 of the bleedValue parameter on that target. When the bleed turns hit zero, the state is removed. The apply effect has an extra check to make sure that a bleed effect that was applied by a skill that did zero damage is immediately removed.

<Custom Apply Effect>
if (target.bleedTurns == 0 || target.bleedValue == 0) {
 target.removeState(191)
 target.bleedValue = undefined
 target.bleedTurns = undefined
}
</Custom Apply Effect>
<Custom Turn End Effect>
var currentdmg = Math.floor(this.bleedValue / this.bleedTurns)
this.gainHp(-currentdmg)
this.startDamagePopup();
this.bleedValue = this.bleedValue - currentdmg
this.bleedTurns = this.bleedTurns -1
if (this.bleedTurns == 0 || this.bleedValue == 0) {
 this.removeState(191)
 this.bleedValue = undefined
 this.bleedTurns = undefined
}
if (this.isDead()){
 this.performCollapse();
}
</Custom Turn End Effect>

If the state detects that the battler is dead, it calls the collapse function, which kills it, and finishes the battle if this is the only enemy still alive.

 

Bonus State:

I will also provide a passive state, which can be used to apply bleeds to physical attacks. In my project, Axe Mastery provides a small bleed effect when using a physical skill while an axe is equipped. I have removed the axe requirement for this copy+paste to make it more accessible to everyone else.

<Custom Establish Effect>
if (this.isHpEffect() && this.isPhysical()) {
 target.addState(191)
 var bleed = Math.floor(value/3)
 if (target.bleedValue == 0 || target.bleedValue == undefined) {
  target.bleedValue = bleed
  target.bleedTurns = 3
 }else if (bleed > target.bleedValue) {
  target.bleedValue = bleed
  target.bleedTurns = 3
 }
}
</Custom Establish Effect>

The custom establish effect is only played if the attacker lands his attack, it then checks if the attack was a physical HP affecting attack, and proceeds to add the bleed effect. If there is already a stronger bleed effect present on the target, it is compared with the new one, and replaced if it is weaker.

That’s all for this update. see you next time.