RMMV (SOLVED) (Yanfly) How do I get the magic attack of a caster that applied a state on a target?

Status
Not open for further replies.

Bad_Muppet

Villager
Member
Joined
Oct 4, 2021
Messages
6
Reaction score
3
First Language
English
Primarily Uses
RMMV
I am trying to have the game get the magic attack of Battler A so that Battler B gets an amount of absorption barrier points every round that passes by from a custom state. I am using Yanfly's Absorption Barrier plugin and its
Code:
 <Custom Barrier Regen>
, but I don't know how to get Actor A's magic attack inside of the state's notetag. What is it that I am missing?
 

eomereolsson

Veteran
Veteran
Joined
Sep 29, 2021
Messages
165
Reaction score
142
First Language
German
Primarily Uses
RMMV
If you want to get the MAT of a specific actor you can get it via:
JavaScript:
$gameActors.actor(Actor ID).mat
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,051
Reaction score
2,468
First Language
English
Primarily Uses
RMMV
If you're using Yanfly's Buffs & States, there's an included origin variable that tracks who created the state.

So the magic attack of the caster is simply origin.mat
 

Frostorm

[]D[][]V[][]D
Veteran
Joined
Feb 22, 2016
Messages
2,660
Reaction score
2,252
First Language
English
Primarily Uses
RMMV
To add on to @ATT_Turan, if you want to forcibly set the origin to a certain unit, you can also do something like this...
JavaScript:
<Pre-Damage Eval>
target.setStateOrigin(42, user);
</Pre-Damage Eval>
I have to do this because the origin is not set automatically w/ the battle system I'm using (LeTBS).
 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
4,051
Reaction score
2,468
First Language
English
Primarily Uses
RMMV
This is applied to the state notetag, right?
To be clear, unless you're using that specific, heavily modified battle system that Frostorm referred to, there is zero reason for you to use that code.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
16,545
Reaction score
9,186
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Profile Posts

Beep-Beep-Motha-facka.gif

Just finished and uploaded the delivery truck base/sprite sheet. I've been steadily replacing the default assets with early modern alternatives. The air-ship for a biplane, horse-drawn wagon for a delivery truck, and next a sailboat for a steam-powered passenger liner (think of the SS Olympic and RMS Titanic).
I caught a shiny magikarp on pokemonGO today AND finally saw Detective Pikachu and it was so cute and I'm still so hype AHHHHH!!!
one of the coolest things I've learned from the forums is the ability to give yourself a hitbox. I have a move you can do on the fields. shoulder tackle. thanks to the forums, that tackle triggers self A switches on some events. NPC's and the environment now react to the tackle. awesome.
I really liked how this one turned out! :kaopride:
WYqMPf6.png

Character (Yes, this is a character): Nibiru the Primal Being from Yugioh.
Dragon Quest style enemy selection plugin work in progress:

Quest_Targeting.png

It's a simple targeting system from the NES era. Select an enemy group; single-target skills will target the first enemy in that group.

Quest-Targeting-Animated.gif

Forum statistics

Threads
121,936
Messages
1,145,288
Members
160,207
Latest member
RiceKun
Top