This is proof that I can get things done if I'm really bored. It's only a first draft, so any corrections/suggestions/additions/whatever are accepted.
General Battle Stuff
Instant Wins
In some cases, when you get into a fight with a weak enemy, you automatically win without going into battle. This is based on your speed, offense, and status. Only the chosen four matter for this; NPCs such as Flying Man are not counted.
You can't instantly win in a red swirl or in a fight triggered by dialogue (such as a boss fight). If the number of enemies is greater than the number of characters who aren't unconscious, diamondized, paralyzed, nauseous, poisoned, and don't have a sunstroke or a cold (as well as 2 other statuses I haven't figured out), you can't instantly win.
In a black swirl, the highest speed among enemies is compared to the lowest speed among your current party members (even if unconscious). Each enemy's HP+defense is then compared to the lowest offense among your current party members (even if unconscious). If your party's stats are greater (not equal) in both cases, you instantly win the fight.
In a green swirl, your characters who do not suffer from the aforementioned statuses are sorted by offense in descending order, and the enemies are sorted by HP in descending order. In turn, each character "attacks" the first enemy which is still "alive", dealing exactly 2*offense-defense "damage". If every enemy is "killed" this way, you instantly win the fight.
Turn Order
At the beginning of each turn, each character has their speed adjusted by +/- 50% to determine the turn order. In the case of a tie, later characters act first, and enemies act before allies. If an enemy tries to steal, they will always act last.
General note about randomness
Whenever numbers are adjusted by +/- 25% or +/- 50%, the result follows a pyramid-shaped distribution. The number is more likely to be near the middle of the range than near either end, when considering intervals of equal length.
Battle Actions
Physical Attacks
Attacks are dealt with as follows:
1. Miss
Each weapon and NPC/enemy has a miss rate. Unarmed PCs have a miss rate of 1/16. Crying and/or nausea will increase this miss rate by 8/16. If the weapon misses, skip the remaining steps.
2. SMAAAASH!
With the Bash command or Bash-like enemy/NPC attacks, the probability of a SMAAAASH! is equal to guts/500 or 1/20, whichever is greater. If a SMAAAASH is successful, it deals 4*offense-defense damage, and skip the remaining steps. (Yes, even step 5.) This damage is still affected by defending if applicable. If the target had a physical shield, it will be depleted.
3. Dodging
The target has a (2*target speed - attacker speed)/500 chance of dodging the attack. If the enemy dodges, skip the remaining steps.
4. Damage
The attack will deal (attack level * offense - defense) +/- 25% damage. Bash, Shoot, and enemy/NPC projectile attacks have attack level 2, while Bash-like attacks can attack levels 1, 2, 3, and 4, depending on the attack.
5. Status
If the attack was Bash or a Bash-like enemy/NPC attack, the target will stop feeling strange if it was feeling strange.
Defend
Defending halves the damage taken from some attacks.
Pray
Praying has one of several random effects:
5/16: subtle light, heals each PC by 1/16 of maximum HP, rounded down
2/16: warm light, heals each PC by 1/8 of maximum HP, rounded down
1/16: mysterious light, restores (5 +/- 50%) PP to each PC
1/16: golden light, heals a random living PC by the difference between their maximum HP and Paula's current HP
1/16: dazzling light, same effect as Rockin beta to a random enemy
2/16: dazzling light, same effect as Flash alpha to all allies and enemies
1/16: rainbow-colored light, revives all dead allies and enemies to full HP
1/16: mysterious aroma, put all allies and enemies to sleep
1/16: heaven rending sound, make all allies and enemies feel strange
1/16: heavy air, same effect as Defense down alpha to all allies and enemies
The mysterious aroma and heaven rending sound ignore resistance to Hypnosis and Brainshock respectively.
Auto Fight
Paula and Jeff will always attack a random enemy. If Ness/Poo is not feeling strange or unable to concentrate, he will attempt to use PSI if applicable. The possible PSI commands for Ness and Poo in Auto Fight are used in the following priority order. As soon as an action is reached which is possible and fits the conditions, it is used and the rest are not considered. If both Ness and Poo use PSI, they will not target the same character. Lifeup Omega isn't considered to target anyone for this purpose. When more than one character can be targeted, the character with the lowest absolute HP has priority. A character is considered to be at low HP if his/her HP is less than 1/4 of maximum.
1. Lifeup Omega if more than one PC is alive and all have low HP
2. Lifeup gamma on someone with low HP
3. Lifeup beta on someone with low HP
4. Lifeup alpha on someone with low HP
5. Healing Omega on an unconscious character
6. Healing gamma on a paralyzed character
7. Healing gamma on a diamondized character
8. Healing gamma on an unconscious character
9. Healing beta on a poisoned character
10. Healing beta on a nauseated character
11. Healing beta on a crying character
12. Healing beta on a character who is feeling strange
13. Healing alpha on a character with a cold
14. Healing alpha on a character with sunstroke
15. Healing alpha on a sleeping character
If none of these options are available, Ness/Poo will attack a random enemy.
Run Away
The probability of successfully running away from a fight is (highest speed among PCs - highest speed among enemies + 10*turn number)%. Some enemies prevent you from running away regardless of your speed.
PSI
Rockin
Rockin has a (2*target speed - Ness's speed)/500 chance of missing.
Flash
For each enemy it hits, it causes one of several effects, depending on which Flash you used.
Flash alpha7/8: uncontrollable crying
1/8: feeling strange
5/8: uncontrollable crying
1/8: feeling strange
1/8: paralysis
1/8: instant death
4/8: uncontrollable crying
1/8: feeling strange
1/8: paralysis
2/8: instant death
3/8: uncontrollable crying
1/8: feeling strange
1/8: paralysis
3/8: instant death
Freeze
Has a 25% chance of solidifying the target
Thunder
Thunder randomly chooses a target, then tries to affect it. The probability of Thunder working is (number of enemies)/4. If Thunder kills an enemy and still has some shots left, this probability will not decrease. If Thunder hits an enemy with a PSI shield, the shield will be depleted.
Magnet
Magnet drains an amount of PP in the range 2-8 with a pyramid-shaped distribution. It can't drain more PP than the target has. Magnet Omega will ignore NPCs, while alpha merely fails due to lack of PP.
Offense Up
Offense up will fail if the target is a NPC. Otherwise, it will increase the target's offense by 1/16 of its current value, rounded down and capped below at 1, up to a maximum of 5/4 of the target's unmodified offense.
Defense Down
Defense down will fail with probability luck/80, or always if it targets a NPC. If it hits, it will reduce the target's defense by 1/16 of its current value, rounded down and capped below at 1, down to a minimum of 3/4 of the target's unmodified defense.
Healing gamma
Healing gamma has a 3/4 chance of reviving an unconscious character.
Items
Bottle Rockets
A standard bottle rocket will miss with probability (2*target's speed - Jeff's speed)%. If it hits, it will deal (120 +/- 25%) damage.
Big bottle rockets and Multi bottle rockets will try to hit 5 and 20 times respectively, with the same miss rate. When they hit, they deal ((120*number of hits) +/- 25%) damage.
Bombs/Bazookas
Bombs and Super Bombs will deal (90 +/- 50%) and (270 +/- 50%) damage respectively to the target. They also deal splash damage to the characters or enemies on either side of the main target, with damage equal to ((average damage to main target)/2 +/- 50%).
Dragonite
This deals 800 +/- 25% damage to each enemy, and is fire elemental.
Level Up
When you gain a level, the increase of stats other than HP and PP is given by the formula
Stat gain = ((growth rate * old level) - ((stat-2) * 10)) * r/50
r is given by one of the following:
* If the stat is vitality or IQ, and the new level is 10 or lower, r=5.
* Otherwise, if the new level is divisible by 4, r is a random number from 7 to 10.
* Otherwise, r is a random number from 3 to 6.
HP and PP are based on vitality and IQ respectively. HP tries to increase to 15*vitality, and PP tries to increase to 5*IQ normally or 10*IQ for Ness after Magicant. If either of these results in a gain of less than 2, the stat instead gains by a random number in the range 1-3 (HP) or 0-2 (PP).
Status
Overwriting statuses
Some combinations of statuses can't coexist. When an effect tries to add a status to someone who already has a status of the same type, the one with the lower number wins. The statuses are:
[EDIT: FIXED]
Permanent statuses:
1. Unconsciousness
2. Diamondization
3. Paralysis
4. Nausea
5. Poison
6. Sunstroke
7. Cold
(think of a name for these) statuses:
1. Mashroomization
2. Possession
In-battle statuses:
1. Sleep
2. Uncontrollable crying
3. Immobilization
4. Solidification
Other statuses, such as homesickness, feeling strange, or being unable to concentrate, are stored separately from the other statuses and can coexist freely.
Diamondization
Uses the same resistance probability as Paralysis.
Sunstroke
Approximately every 20 seconds, if you're in a desert area and you don't have any permanent status ailments other than a cold, you have a (30-guts)% chance of getting a sunstroke, with a minimum of 1%.
Homesickness
Whenever you win a battle (but not an instant win), Ness has a certain probability of becoming homesick. The probability depends on Ness's level.
Level 1-15: 0/256
Level 16-30: 3/256
Level 31-75: 2/256
Level 76-99: 0/256
If Ness is homesick, he has a 1/8 [EDIT: was 1/4] chance of losing his turn in battle.
Sleep
A sleeping character can't do anything. A sleeping character has a 1/4 chance of waking up on his/her/its turn.
Immobilization
An immobilized character can't use weapons or items, much like being paralyzed. An immobilized character has an 85% chance of becoming able to move on his/her/its turn.
Solidification
A solidified character can't do anything. A solidified character will always become able to move on his/her/its turn.