po-devs/pokemon-online — pull request #1152 by Fuzzysqurl (2014-05-18 05:52:15+00:00)
Title: Confuse Damage Formula rewrite

Sample from one of the tests I did. This was the shortest unedited log. I tested to make sure it varied (Diggersby did 71, 73, and 85 this battle. Furret did 101, 107, and killed itself)

The main thing is, Confuse should not be boosted by anything except stat boosts (no abilities, no weather, no items, etc). except in Gen 4 where it gets Helping Hand. It should also not be reduced by Reflect/etc.

What I did was: Took the "calculateDamage" function call and killed it. Then I went into that function and only grabbed the lines of code that mattered: The core damage formula and variation.

Long story short, no more unintended 1.5x~2x damage confuse hits.

```
Start of turn 1
The foe's Klefki used Swagger!
Diggersby's Attack sharply rose!
Diggersby became confused!

Diggersby is confused!
Diggersby used Cut!
It's not very effective...
A critical hit!
The foe's Klefki lost 38% of its health!

Start of turn 2
The foe's Klefki used Iron Defense!
The foe's Klefki's Defense sharply rose!

Diggersby is confused!
It hurt itself in its confusion!
Diggersby lost 82 HP! (21% of its health)

Fuzzysqurl: +2 252+ Atk Diggersby Return vs. 252 HP / 0 Def Diggersby: 71-84 (18.9 - 22.4%) -- possible 5HKO

Start of turn 3
Fuzzysqurl called Diggersby back!
Fuzzysqurl sent out Furret!

The foe's Klefki used Swagger!
Furret's Attack sharply rose!
Furret became confused!

Start of turn 4
The foe's Klefki used Iron Defense!
The foe's Klefki's Defense sharply rose!

Furret is confused!
It hurt itself in its confusion!
Furret lost 113 HP! (30% of its health)

Fuzzysqurl: +2 252+ Atk Furret Tackle vs. 252 HP / 0 Def Furret: 97-115 (25.9 - 30.7%) -- guaranteed 4HKO
```