Trihan's lunatic notetag workshop (MV)

You could add a Custom Turn Start Effect to the state that updates the value.
After a few tests, here's the result.


Code:
<Custom Passive Condition>
  if ($gameParty._actors.contains(3))
  {condition = true;} else {condition = false;}
</Custom Passive Condition>

<Custom Apply Effect>
  target._IvannaAffinityBonus = ((($gameActors.actor(3).param(3) * 0.10) / 100) * $gameVariables.value(3));
  target._paramPlus[3] += target._IvannaAffinityBonus;
</Custom Apply Effect>

<Custom Remove Effect>
  target._paramPlus[3] -= target._IvannaAffinityBonus;
</Custom Remove Effect>

Runs smoothly and perfectly. Thanks a LOT!
So... I was trying to be polite and wait for someone else to ask for help, but both for being excited with Trihan's helpful codes and for the sake of BUMPing, I'll excuse myself and ask for some more help!

Any idea on how to make a "perfect shield" state that nullifies the next attack/spell/effect targeted into the character and then removes itself?
So... I was trying to be polite and wait for someone else to ask for help, but both for being excited with Trihan's helpful codes and for the sake of BUMPing, I'll excuse myself and ask for some more help!

Any idea on how to make a "perfect shield" state that nullifies the next attack/spell/effect targeted into the character and then removes itself?

Code:
<custom react effect>
value = 0;
target.removeState(Id of perfect shield state);
</custom react effect>
by changing "value" to 0, the damage is nullfied, huh? And for the effect immunity, all i gotta do is make the "Perfect Shield" to give resistance against states, is that it?
Ah yes, sorry. Just add 100% resistance to all negative states to the Perfect Shield state and that'll take care of that part without needing anything extra in terms of notetags.
I have taken the liberty of changing a few things about the Perfect Shield state, and here's the final result.

I gotta say, thanks again for being so capable and helpful!

For those interested, here's the "Perfect Shield" state, that nulifies damage and then removes itself.
Code:
<custom react effect>
  value = 0;
  target.removeState(51); //Perfect Shield's State.
  target.startAnimation(160); //Perfect Shield's Removal Animation.
</custom react effect>
Now for a "Element Eater" state!

How to check the element of the damage taken and, if it's a specific element, the damage gets converted into a TP gain?
Sorry Paulo, I missed this one.

Code:
<Custom React Effect>
let eatElements = [IDs of elements to convert here];
if (this.getItemElements().some(element => eatElements.contains(element))) {
  let tpGain = value;
  value = 0;
  target.gainTp(tpGain);
}
</Custom React Effect>
I always struggle with checking if equipment is equipped.

Im trying to make an accessory or shield that adds effects to guard;
ex:
Shield of mockery- adds taunt state when using guard.
Holy charm- restores 5% hp when guard is used.

I dont know the script that checks the user and not actor id, is it user.equips()?
also dont know how equipment is checked at all lol.
You're thinking of it slightly backwards: you don't check whether the equipment is equipped, you add a passive state to the equipment that checks whether Guard was used.

Put a <Passive State: X> tag on your shield and charm, where X is the ID of a state you're about to create. You'll need one for each effect; call them "mockery effect" and "holy charm effect" or whatever is most helpful for you.

For mockery effect, the notetag you want on the state is:

Code:
<Custom Initiate Effect>
if (this.item().id === user.guardSkillId()) {
  user.addState(ID of taunt state);
}
</Custom Initiate Effect>

For the Holy Charm, it'll be

Code:
<Custom Initiate Effect>
if (this.item().id === user.guardSkillId()) {
  user.gainHp(Math.floor(user.mhp * 0.05));
}
</Custom Initiate Effect>
You're thinking of it slightly backwards: you don't check whether the equipment is equipped, you add a passive state to the equipment that checks whether Guard was used.

Put a <Passive State: X> tag on your shield and charm, where X is the ID of a state you're about to create. You'll need one for each effect; call them "mockery effect" and "holy charm effect" or whatever is most helpful for you.

For mockery effect, the notetag you want on the state is:

Code:
<Custom Initiate Effect>
if (this.item().id === user.guardSkillId()) {
  user.addState(ID of taunt state);
}
</Custom Initiate Effect>

For the Holy Charm, it'll be

Code:
<Custom Initiate Effect>
if (this.item().id === user.guardSkillId()) {
  user.gainHp(Math.floor(user.mhp * 0.05));
}
</Custom Initiate Effect>

Wow, thanks. I did not think of it lol, guess im going to have lots of passive states 🙂
Alternatively, you could put passive states on the actors that do all the equipment checks, but that might get a bit wordy in the notebox.
Hey Trihan,
Been trying to figure something out with no success.
I'm trying to make a multi hit skill that if defeats an enemy will continue on to the next "proper" target if any.

I have an attack that hits 4 times the front row enemies, if on the second hit all enemies in the front row are dead the remaining two hits will continue on enemies in the second row.
Hello Trihan, I want to add a function to display the SV battle graph of party members in the MOG_SceneMenu plug-in code.
What should I do?
Hey,

If you are still accepting requests, could you help me out with a few passive state notetags? (I'm using Yanfly's Auto Passive States, as well as Buff and State Core, if that would help as well)

1. A state that recovers the owner's HP by 5% each time a party member is defeated in battle.
2. A state that, if variable 1 is greater than or equal to variable 2, grants a 5% MAT boost, otherwise grants a 5% MDF boost.
3. A state that boosts ATK by (Variable 1 multiplied by 3)%.
Hi Trihan, thanks for starting this thread. A question on "integrating" Yanfly's plugin with non-YEP plugins. I am currently using YoraeRasante/Waterguy's New Parameters plugin to create custom parameters (e.g. "skill", "dexterity", etc). However, I am not sure how to add them to YEP Stat Allocation. Not sure if this is even possible though?
I have a question similar to Vis_Mage: is there a way to have a state increase the damage dealt by the character by a %?

working on an 'offense/defense' state swap via skill. defense reduces damage taken and dealt, offense increases damage taken and dealt. i can increase damage taken, but i can't seem to figure a way to increase damage dealt.

Code:
<Custom React Effect>
value *= 1.25;
</Custom React Effect>

i would assume it looks similar to that, but i haven't found a listing for states that works on an action step by the user with the state.
I have a question similar to Vis_Mage: is there a way to have a state increase the damage dealt by the character by a %?

working on an 'offense/defense' state swap via skill. defense reduces damage taken and dealt, offense increases damage taken and dealt. i can increase damage taken, but i can't seem to figure a way to increase damage dealt.

Code:
<Custom React Effect>
value *= 1.25;
</Custom React Effect>

i would assume it looks similar to that, but i haven't found a listing for states that works on an action step by the user with the state.

Have you tried:
<Custom Confirm Effect>
value *= 1.25;
</Custom Confirm Effect>
This effect will run when the battler connects a hit and before damage
execution occurs. This effect will run after <Custom Initiate Effect> and
<Custom Select Effect> and before everything else.

React is for when you are the source of damage.
<Custom React Effect>
value -= 100;
value -= user.def;
</Custom React Effect>
This effect will run when the battler is selected as a target. This will
occur only if the action connects and will occur before damage execution.
This effect will run before damage calculation occurs and will return the
'value' variable as a damage modifier. After <Custom Confirm Effect>, this
effect will run.
@Icenick Thank you! i wasn't sure confirm effect was even available for states xD

EDIT: there is a problem. This effect is adding an additional damage step, doing another set of damage. that's not a good thing xD
EDIT 2: Now it is working. Sometimes I don't understand MV... changed to value = Math.ceil(value*x.x);

Original thread: https://forums.rpgmakerweb.com/threads/trihans-lunatic-notetag-workshop-mv.123457/