I'm open for any requests at the moment, so if you want an explanation of an NPC's AI, feel free to leave a reply here.
Also, if the list gets too big, I will hide the entire thing in another spoiler. Don't forget that Ctrl+F is your friend.
- .ivala indicates action. -1 and lower are standing, 0 is squatting, 1 is breathing fire, 2 is hopping, 3 is Bowser Bomb, 4 and higher are changing direction.
.ivalb indicates how many more times the current action (either hopping or breathing fire) will loop until next action. Forcing the variable to a negative number or forcing ivala's value to 1 or 2 will cause the action to be looped infinitely. It also works as the speed for the Bowser Bomb, maximum being 8. Interestingly, forcing this value to 8 for when Bowser Bomb is being used actually gives Bowser's drop velocity. Any numbers lower will cause him to fall slower. I have not found any way to make him fall faster through ivals.
.ivalc indicates how many frames until current action repeats or next action occurs. Max frames is 50.
Dino Rhino/Dino Torch:
- .ivala indicates the amount of frames the NPC has been attacking. Positive values are forward attacks, and negative values are upward attacks.
.ivalb indicates how many frames have passed since last attack.
.ivalc indicates whether or not the NPC has jumped. 0 is when the NPC is jumping and 1 is when the NPC is grounded or walking off a platform.
- .ivala determines the hit animation timer, including the shaking effect. 0 is its normal state and values 1 to 30 are for when it takes damage. If this value is forced to 0, it will not shake when it takes damage, and its hurt frame will only appear for a few seconds. Values 1 to 30 are the hurt animation timer. If forced to one of these values, it will be in its damaged state infinitely, however, it can still take damage.
- .ivala seems to determine what state the NPC is in along with how long it's been in that state. 0 is when it hasn't been picked up or is currently being held by the player. When the object is thrown/dropped, this value begins to increase by 1 every frame. Once this value reaches 1000, the NPC disappears. This value also resets when the player picks the object up again. Interestingly, when this object is falling down (i.e. dropped down a pit, dropped midair, thrown upward), the value is then immediately negated for whatever reason. Probably to prevent it from disappearing when falling down?
- .ivala serves as both the amount of time the enemy has to wait before its next jump AND when it's jumping phase is active. It's value counts up to 30 whenever on the ground. The NPC seems to only jump at frame 29. When its value is at 30, this indicates that the NPC is in midair. It will not change until it lands on the ground. If you don't want a wait timer, you could force .ivala to 29 to have it constantly jump.
- .ivala serves as how long the projectile has been active in frames. As usual, each frame increments the ival by 1. Nothing else interesting happens as far as I know.
.ivalb is where it gets kinda complicated. When the value is 0, the fireball acts like Mario's or Luigi's fireballs. This is strange considering Link's fireball uses the same values as Mario & Luigi for all three ivals. For Peach's fireballs, .ivalb seems to work as a spawn shot speed? I'm not too sure on this one. The value depends on how fast the player is moving when they shoot the fireball and if they actually shot it or threw it. Positive numbers are shot to the right, negatives are shot to the left. Throwing Peach's fireball directly upwards makes this value 0. Toad and Link's are always zero.
.ivalc is also kinda complicated. For Mario, Luigi, and Link, these values are always 0. For Peach, the value is set to 5 when a fireball is shot. When it bounces off a wall, this value is set to 1 to indicate that the next time it hits the wall, it'll disappear. For Toad, this seems to work exactly the same as Peach's .ivalb, except the values are mostly different.
- .ivala works as how many times the Iceball has hit the ground, the value incrementing by 1 each bounce. If it hits the ground while this value is 2, it'll disappear. Throwing an Iceball directly upwards as Peach or Toad has this value set to 0, which will change to 2 when it hits the ground. This value isn't used for Link as his Iceballs have no gravity. You can force this value to 0 if you want Iceballs to bounce forever until they hit a wall or hit the ground when thrown upwards with Peach or Toad.
.ivalb works as the frame timer, go figure. Value increments by 1 every frame, yadayada, you know the drill by now.
.ivalc surprisingly does nothing. I thought maybe this one would've indicated if this was Link's Iceball or not.
- .ivalb, as with the Fireball and Iceball, works as the frame timer.
Peach's Bomb doesn't use ivals at all.
- .ivala is an interesting case. Not only does it work as a sort of frame timer, but it also indicates the "radius" of the Boomerang as it tries to return to Toad. Max value is 60. Force it to this value if you want to completely nerf Toad's Boomerang.
.ivalb determines the direction the Boomerang was fired. 1 is right, and -1 is left. 0 is used for when the NPC was spawned by other means.
Link's Sword Beam:
- .ivala is the frame timer for the NPC yet again. If the value reaches 29, the NPC destroys itself. Like the Iceball, if you want this to go on until it despawns offscreen, just set the value to anything below 29. Interestingly, if the value is forced to 28, it will not only go on forever, but it won't produce a sparkle trail at all. If you want Link's sword beam to be useless, force the value to 29 or higher, rendering the NPC useless aside from some sparkle effects that appear when the NPC destroys itself.
- .ivala determines if the claw is holding something or not. 0 is holding nothing, 1 is holding a player, and 2 is holding an NPC.
.ivalb determines the interval of the NPC holding another NPC or player.
.ivalc is sorta unknown. It may possibly be related to the position or speed of the swinging claw when the player is moving on it.
(ivals contributed by Victor ManuelMR)
Most updates to this thread will be either because of my own personal research, or someone requested me to analyze an NPC's AI. If you would like to keep up to date then you should subscribe to this topic, as I don't know how often I'll update it if there's no pending requests. Please feel free to make a request or notify me of any errors in this thread.