- Joined
- Jan 28, 2013
- Messages
- 879
- Reaction score
- 557
- First Language
- English
- Primarily Uses
- RMMV
Hey folks, it's Monday, and that means it's time for my next state to be released.
This week, I've chosen Bleed, a state which causes damage every turn to the afflicted battler, but whose damage is based on the amount of damage the ability that applied it dealt to the target.
The default damaging state, poison, deals damage based on the max hp of the target. This creates a game balancing issue, namely that boss monsters shouldn't be able to be affected by damaging states, because they would cause a massive amount of damage to a bosses' large HP pool, making fights last much less time. On the other hand, if you balance poison so that it doesn't give a huge advantage on boss fights, by lowering the % damage of the state, it becomes next to useless against non-boss monsters.
The solution to this balance issue is states that don't deal HP% damage, but deal damage based on the parameters of the attacker. In this case, bleed deals damage to the target based on the damage dealt by the attack that applied it. Today I will share how this state is applied, and how it deals damage. Feel free to adapt it to your needs.
Bleed is an effect that deals a bleedValue to the target split over a number of turns equal to bleedTurns, by default my bleed effects last three turns, but this can also be modified as necessary. For our first usage scenario, I have created the skill 'rend', a strong physical attack that causes a bleed amount equal to the damage the skill does. With the default turn duration of three, this means the attack deals 1/3 of it's initial damage at the end of each turn the afflicted takes.
For this skill, I make use of action sequences, specifically to use an eval tag to set the bleedValue and bleedTurns parameters on the target. You will need to have all three action sequence packs to use this skill.
Create a skill in your database, set the damage and icon how you like, or like it is in my sample image:

For our action sequence, I have the following:
This is a fairly basic action sequence. The eval codes in the action section are setting up our bleed effect, which will need those values to work.
The stateId 191 is our bleed state, which we will make next. Please note that you will need to change that Id to fit your project. The skill will only apply bleed effect if it is going to do more damage than one that currently exists on the target. This is to prevent a situation where a particularly strong bleed is overwritten by a very weak one. This check is not performed on the state, but rather on the skill that applies the bleed in the first place.
Next we will make our bleed state. I have several skills in my project that add this state, but they do so in the same way, and make use of the bleedValue and bleedTurns parameters we set up in the above action sequence.

The state itself doesn't contain much information aside from the note box. The lunatic code will handle removing it, so we don't need a turn end effect. I left the 'Remove at Battle End' box unticked, as I wanted the effect to persist after battle, but you can change that if you'd like.
Here is the copy+paste code for the bleed state:
Our bleed effect deals 1/3 of it's total damage each turn for three turns (because we set bleedTurns to three on our rend skill). You can make more skills that add different amounts of bleed damage, and longer or shorter intervals, by changing those values on the skill.
This was a pretty basic effect, so I will also share a passive state that adds the bleed effect to all physical actions you take. In my project, this effect is limited to only those actors who are using an axe as their weapon, but I will provide the state without this requirement so it's easier to adapt to your own project.
This state is passive meaning the actor need only know it for it to be active, via the <passive state: x> tag.
When a physical attack that dealt HP damage lands, applies a bleed effect. This effect will not be applied if the target already had a stronger effect on it.
That's all for this update folks. Feel free to keep posting states you wanna see, or anything you might need help with, state wise.
This week, I've chosen Bleed, a state which causes damage every turn to the afflicted battler, but whose damage is based on the amount of damage the ability that applied it dealt to the target.
The default damaging state, poison, deals damage based on the max hp of the target. This creates a game balancing issue, namely that boss monsters shouldn't be able to be affected by damaging states, because they would cause a massive amount of damage to a bosses' large HP pool, making fights last much less time. On the other hand, if you balance poison so that it doesn't give a huge advantage on boss fights, by lowering the % damage of the state, it becomes next to useless against non-boss monsters.
The solution to this balance issue is states that don't deal HP% damage, but deal damage based on the parameters of the attacker. In this case, bleed deals damage to the target based on the damage dealt by the attack that applied it. Today I will share how this state is applied, and how it deals damage. Feel free to adapt it to your needs.
Bleed is an effect that deals a bleedValue to the target split over a number of turns equal to bleedTurns, by default my bleed effects last three turns, but this can also be modified as necessary. For our first usage scenario, I have created the skill 'rend', a strong physical attack that causes a bleed amount equal to the damage the skill does. With the default turn duration of three, this means the attack deals 1/3 of it's initial damage at the end of each turn the afflicted takes.
For this skill, I make use of action sequences, specifically to use an eval tag to set the bleedValue and bleedTurns parameters on the target. You will need to have all three action sequence packs to use this skill.
Create a skill in your database, set the damage and icon how you like, or like it is in my sample image:

For our action sequence, I have the following:
Code:
<Setup Action>
display action
camera focus: user
zoom: 200%
wait for camera
cast animation: user
wait for animation
</Setup Action>
<Target Action>
if user.attackMotion() !== 'missile'
face user: target
move user: target, front base, 20
face user: forward
wait for move
end
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
</Target Action>
<Finish Action>
clear battle log
reset zoom
reset camera
perform finish
wait: 10
</Finish Action>
This is a fairly basic action sequence. The eval codes in the action section are setting up our bleed effect, which will need those values to work.
The stateId 191 is our bleed state, which we will make next. Please note that you will need to change that Id to fit your project. The skill will only apply bleed effect if it is going to do more damage than one that currently exists on the target. This is to prevent a situation where a particularly strong bleed is overwritten by a very weak one. This check is not performed on the state, but rather on the skill that applies the bleed in the first place.
Next we will make our bleed state. I have several skills in my project that add this state, but they do so in the same way, and make use of the bleedValue and bleedTurns parameters we set up in the above action sequence.

The state itself doesn't contain much information aside from the note box. The lunatic code will handle removing it, so we don't need a turn end effect. I left the 'Remove at Battle End' box unticked, as I wanted the effect to persist after battle, but you can change that if you'd like.
Here is the copy+paste code for the bleed state:
Code:
<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>
Our bleed effect deals 1/3 of it's total damage each turn for three turns (because we set bleedTurns to three on our rend skill). You can make more skills that add different amounts of bleed damage, and longer or shorter intervals, by changing those values on the skill.
This was a pretty basic effect, so I will also share a passive state that adds the bleed effect to all physical actions you take. In my project, this effect is limited to only those actors who are using an axe as their weapon, but I will provide the state without this requirement so it's easier to adapt to your own project.
This state is passive meaning the actor need only know it for it to be active, via the <passive state: x> tag.
Code:
<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>
When a physical attack that dealt HP damage lands, applies a bleed effect. This effect will not be applied if the target already had a stronger effect on it.
That's all for this update folks. Feel free to keep posting states you wanna see, or anything you might need help with, state wise.
Last edited: