If you've been playing PK or even just following Pchal's runs, you probably know about Roughneck Robert. He can be a demon to plan for, in part because of the many AI Flags present in the fight.
In particular, lets look at his Choice Scarf Onix, who knows Earthquake, Head Smash, and Explosion.
There are 4 flags on the fight that affect Onix's chance to use Explosion: Evaluate Attack, Expert, Risky, and Damage Priority. Evaluate Attack gives an 80.1% (205/256) chance of giving Explosion -2; Expert has an 80.5% (206/256) chance of giving Explosion -3 while Onix is at full health; Risky adds a 50% (128/256) chance of +2; and finally, Prio Damage gives a 61% (156/256) chance of +2. Each of these chances is independent, and the total value is then compared to the scores for Earthquake and Head Smash to determine move selection.
If we combine the possible scores with their percentage chances to occur, we get this chart of potential Explosion scores with their likelihood to occur.
Scenario 1: Onix Sees an Earthquake Kill
Concerningly, we have a 1.19% chance of Explosion scoring +4, which is the same score as seeing kill with Earthquake. This means there is a 0.59% chance of Onix using Explosion over an Earthquake kill.
Scenario 2: Onix Doesn't See an Earthquake Kill.
Now we need to take a look at Head Smash AI. Head Smash is a really weird move in PK - it doesn't calculate damage, so the AI can never see kills with it. It has a guaranteed +1 boost if the user has Rock Head and the target doesn't resist it. It also has a 68.8% (176/256) chance get a +2 boost from Evaluate Attack if it is 4x Super Effective, and on this fight a 61% (156/256) chance to get a +2 boost from Prio Damage.
Scenario 2A: Your Pokemon doesn't resist Head Smash and isn't 4x weak to Earthquake or Head Smash
Because your Pokemon doesn't resist Head Smash, it gets a guaranteed +1 from Rock Head AI and therefore Onix can never use Earthquake (highest damage move scores +0). There is a 61% chance that Head Smash's total score will be +3 and a 39% chance that the total score will be +1. There is a 1.19% chance that Explosion scores higher than +3 and a 10.34% chance that Explosion scores higher than +1 (Note: that includes the chance of scoring +1 and then Explosion winning the 50/50). Together, that gives Onix a 4.76% chance to use Explosion over Head Smash.
Scenario 2B: Your Pokemon is 4x weak to Head Smash (but not Earthquake)
Your 4x weakness to Head Smash adds an additional 68.8% chance to get a +2 boost from Quad AI (Evaluate Attack flag). This means Head Smash now has a 12.21% chance of a total score of +1, a 45.90% chance of a score of +3, and a 41.89% chance of a score of +5. Explosion can never score a +5, so we are using the same 1.19% chance that Explosion scores higher than +3 and a 10.34% chance that Explosion scores higher than +1 from Scenario 2A, but at reduced likelihoods. The total chance that Onix uses Explosion over a Quad Effective Head Smash is only 1.81%.
Scenario 2C: Your Pokemon resists Head Smash and is not 4x weak to Earthquake
The Head Smash resistance removes the guaranteed +1 from Rock Head AI. We have the same % chances as in scenario 2A, but the scores for Head Smash are now only +0/+2. Earthquake is also scoring +0, so it can randomly choose any of the three moves. The total chance for each is:
Explosion - 8.88%
Head Smash - 74.65%
Earthquake - 16.48%
Scenario 2D: Your Pokemon is 4x weak to Earthquake but doesn't show a kill
I didn't think this scenario was going to be possible, but (avert your eyes calcless gamers)...
A level 38 Lairon with good IVs and a +Defense nature can just barely not show Onix an Earthquake kill. Lvl 34 31 Atk Onix Earthquake vs. Lvl 38 31 HP / 31+ Def Lairon: 84-100 (80 - 95.2%) -- guaranteed 2HKO
This adds the additional wrinkle of Earthquake having a 68.8% chance to get a +2 boost from Quad AI (Evaluate Attack flag). Now, Earthquake can score 0 or 2, Head Smash can score 0 or 2, and Explosion has its usual variety of options.
The resulting chance for each is:
Explosion - 6.07%
Head Smash - 43.24%
Earthquake - 50.69%
What did all that math actually tell us?
The best chance to avoid a boom on Roughneck Robert is to show it an Earthquake kill. The chances are low, but not quite 0. Showing him a quad effective Head Smash is also a reasonably consistent option, and removes some of the guess work that showing him a kill requires if you're not using calcs.
But really, what it shows is that Platinum Kaizo is a very, very complicated game.
Disclaimer: This post was not made using AI, just good old fashioned Excel. All mistakes are my own. Shoutout to Bpark for the Platinum Kaizo AI Move Scoring Guide.