Himework's Damage State Modifiers. Advanced Skills and States.

I have been using this Plugin and I am appalled at how underrated it is. There is so much you can do with this plugin that you can essentially eliminate having to use plugins such as "shield block plugin" or "MP wall plugin".

I want to go over some advance skills and state as well as some of my own states that I have come up with myself. Feel free to add your own here.

Original Plugin Thread: https://forums.rpgmakerweb.com/index.php?threads/state-damage-modifiers.51758/

Understanding the Plugin:

This plugin is essentially a damage modifier for states. Depending on how you code the state, the modification can be done for an attacker or a defender.

In the note box of an attack modifying state you would put:

<state damage modifier: attacker>
FORMULA
</state damage modifier>

and in a defensive modifying state you would put:

<state damage modifier: defender>
FORMULA
</state damage modifier>


The formula section is where the magic happens, and there is a great deal of things you can do.

Some things we need to go over.

this.item() is essentially the skill or item that is being tested against the state.
a. and b. cant be used as in the damage formula.
d is the damage being dealt before the plugin modifies it. So a skill that does 100 damage will have d set at 100.

Now let's focus on a simple state that double damage whenever that state is on a character named Leo for example.

<state damage modifier: attacker>
d = d * 2
</state damage modifier>

If you were to test this out, you would notice that anything the attacker does would double the damage, that includes healing, absorbing, magic, physical.

But Leo's class focuses on physical damage much more than magical spell, so it wouldn't make sense for his magic spells to be doubled.

<state damage modifier: attacker>
if (this.isPhysical())
{
return d * 2
}
else
{
return d
}
</state damage modifier>

So what you're telling the state here is, when the state is active the attacker's physical attacks and skills are doubled, anything else would stay normal, that would make more sense for Leo's class.

Syntax to use:
this.isPhysical() Skills and Attacks with Physical Hit Types
this.isMagical() Skills and Attacks with Magical Hit Types
this.isCertainHit() Skills and Attacks with Certain Hit Hit types.

a.isStateAffected(id) checks to see if attacker is affected by a state. number id of the state goes in (id). use b. for the defender.
a.isLearnedSkill(id) checks to see if attacker has learned a skill. number id of skill goes in (id). use b. for the defender.

this.item().damage.type This holds the damage type as a value. 1 is HP damage, 2 is MP damage, 3 is HP recover, 4 is MP recover, 5 is HP absorb, 6 MP absorb. Remember to use "==" to compare in an if statement example: if(this.item().damage.type == 1)

All other functions you're able to use in the damage formulas can be used here. Such as SetHP(), GainMP(), etc.
However, you can use script commands to gain items, loose items, set states, remove states, play SE with the script calls found here:
https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mv-script-call-list.46456/

Here are some states that I have made for myself, please feel to share any of yours.
--------------------------------------------------------------------------------------------------

Soul Eater State.

When this state is active, physical attacks hurt the user, but that damage is added on to the attack.

MP_Wall.png


The current code uses 10% of the attacker's current HP.

<state damage modifier: attacker>
if (this.isPhysical())
{
var hp = a.hp
a.gainHp(Math.round(0 - (a.hp/10)))
hp = (hp - a.hp)
return d = (d + hp)
}
else {
return d
}
</state damage modifier>
------------------------------------------------------------------
Spikes State:

Returns damage back to an attacker when a character with this state gets hit with with a physical attack.

The current code returns 10% of the Damage back to the attacker.

<state damage modifier: defender>
if (d > 0 && this.isPhysical())
{
a.gainHp(Math.round(0 - (d/10)))
return d
}
else {
return d
}
</state damage modifier>

--------------------------------------------------------------------

MP Wall

Some one with this state will have a portion of HP damage directed towards their MP.

25 points of damage:
MP_Wall.png


The following code directs 25% of HP damage type to MP.

<state damage modifier: defender>
if (d > 0 && this.isPhysical() && this.item().damage.type == 1)
{
var mpwall = Math.round(d / 4)
b.addState(dummy state id)
b.gainMp(0-mpwall)
b.removeState(dummy state id)
return d - mpwall
}
else
{
return d
}
</state damage modifier>

Important: b.addState(dummy state id) and b.removeState(dummy state id) is used in conjunction with a state pop up plugin in order to make the effect appear in the picture above. These lines are purely optional.

------------------------------------------------------------------------------

Salvation State

25% chance of surviving with 1 HP after a death dealing HP damage attack attack.

<state damage modifier: defender>
if ((Math.random()*100+1) > 75 && d > 0 && d > b.hp && this.item().damage.type == 1)
{
return (b.hp-1)
}
else {return d}
</state damage modifier>

--------------------------------------------------------------------------

I hope this post has been helpful. This plugin is a definite must have in order to achieve alot of special state effects.

You can get as creative as having the party gain money upon attacking or attacks having a chance of gaining a potion.

Please feel free to post any special states you may have come up with.

Thank you to Tsukihime
Synthesizer State: (perfect for an item based healer class like alchemist)

HP damaging attacks that kills an enemy creates a Potion/Hi-Potion/X-Potion (obviously depends on your game's items) depending on the overkill damage.

Using my game for example:

Potions cure 200 HP, so if overkill damage is 1 through 200 you gain a Potion.
Hi-Potions cure 1000 HP, so if overkill damage is 201 through 1000 you gain a hi-Potion.
X-Potions fully restore HP, so if overkill is 1001 and higher you gain an X potion.

MP_Wall.png


THE FOLLOWING LINES ARE PURELY OPTIONAL AND ARE USED IN CONJUNCTION WITH A STATE POP UP PLUGIN FOR THE EFFECTS IN THE PIC ABOVE. IF YOU ARE USING A STATE POP UP PLUGIN, HAVE THEM NOT POP UP ON REMOVAL:

a.addState(potion dummy state ID)
a.removeState(potion dummy state ID)


a.addState(hi potion dummy state ID)
a.removeState(hi potion dummy state ID)


a.addState(x potion dummy state ID)
a.removeState(x potion dummy state ID)



<state damage modifier: attacker>
if (d > b.hp && this.item().damage.type == 1)
{
var overkill = d - b.hp
if (overkill < 201 && overkill > 0)
{
a.addState(potion dummy state ID)
AudioManager.playSe({name: 'Item1', pan: 0, pitch: 100, volume: 100})
$gameParty.gainItem($dataItems[potion id], 1)
a.removeState(potion dummy state ID)
return d
}
else if (overkill < 1001 && d > 200)
{
a.addState(hi potion dummy state)
AudioManager.playSe({name: 'Item1', pan: 0, pitch: 100, volume: 100})
$gameParty.gainItem($dataItems[hi potion id], 1)
a.removeState(hi potion dummy)
return d
}
else
{
a.addState(x potion dummy id)
AudioManager.playSe({name: 'Item1', pan: 0, pitch: 100, volume: 100})
$gameParty.gainItem($dataItems[x potion id], 1)
a.removeState(x potion dummy id)
return d
}
}
else
{
return d
}
</state damage modifier>
Reaper State: (Should work nicely with Dark Knights and Necromancer Class types)

Overkill HP damage (physical/magical/certain hit is not taken into account) cures the attacker upon defeating an enemy.

100 points of damage vs 25 HP left on enemy:

MP_Wall.png


<state damage modifier: attacker>
if (d > b.hp && this.item().damage.type == 1)
{
var overkill = (d - b.hp)
a.gainHp(overkill)
a.addState(dummy state id)
b.removeState(dummy state id)
return d
}
else
{
return d
}
</state damage modifier>

THE FOLLOWING LINES ARE PURELY OPTIONAL AND ARE USED IN CONJUNCTION WITH A STATE POP UP PLUGIN FOR THE EFFECTS IN THE PIC ABOVE. IF YOU ARE USING A STATE POP UP PLUGIN, HAVE THEM NOT POP UP ON REMOVAL:

a.addState(dummy state ID)
a.removeState(dummy state ID)
Runic State: (Much Like Final Fantasy 6's Celes Signature Skill)

Magic HP/MP/TP damaging spells gets turned into MP recovery, MP recovery is the spells MP cost.

Battler hit with a HP damaging spell that cost 5 MP to cast:
MP_Wall.png


<state damage modifier: defender>
if (this.isMagical() && d > 1)
{
b.addState(dummy state Id)
this.item().damage.type = 4
d = (0 - this.item().mpCost)
b.removeState(dummy state Id)
return d
}
else
{
return d
}
</state damage modifier>

Original thread: https://forums.rpgmakerweb.com/threads/himeworks-damage-state-modifiers-advanced-skills-and-states.92843/