View difference between Paste ID: UUN59LJ3 and Lb7QnKVi
SHOW: | | - or go back to the newest paste.
1-
- The current damage in battle is stored in two 8-bit addresses (will be referred to as a 16-bit address from now on) so it can store values up to 65535. Anything that would make the damage overflow, caps it at 65535 instead. This damage address is shared by both players.
1+
- The current damage in battle is stored in two 8-bit addresses (will be referred to as a single 16-bit address from now on for simplicity), so it can store values up to 65535. Anything that would make the damage overflow, makes sure to cap it at 65535 instead. This damage address is shared by both players.
2-
	- The damage address isn't cleared (set to 0) when a battle starts or finishes, nor on a switch. Thus, it will be carried over between battles.
2+
	- The damage address isn't cleared (set to 0) when a battle starts or finishes, nor on a switch by any player. Thus, the stored value will be carried over between battles and might lead to a desynchronization in a link battle (e.g. with a move like Counter).
3
4-
- If the attacker hurts itself due to confusion, the damage stored in the damage address will correspond to the calculated damage that the confused Pokemon deals to itself.
4+
- If the attacker hurts itself due to confusion, the value stored in the damage address will correspond to the calculated damage that the confused Pokemon deals to itself.
5
6-
- If the turn holder is storing energy due to Bide, the content of the damage address is added to the value already stored in a separate Bide damage address (two 8-bit addresses).
6+
- If the turn holder is storing energy this turn due to Bide, the content of the damage address is added to the value already stored in a separate Bide damage address (two 8-bit addresses).
7-
	- Bide's store energy effect won't occur during a turn the Pokemon is asleep, frozen, trapped (from Wrap or a similar move), flinched, or recharging from Hyper Beam.
7+
	- Bide's store energy effect won't occur during a turn the Pokemon is asleep, frozen, trapped (from Wrap or a similar move), flinched, recharging from Hyper Beam, or attempting to use a disabled move.
8
		- Hurting oneself due to confusion, or being fully paralyzed, both cause the Bide lock to come to an end.
9
	- If energy is unleashed this turn, the content of the Bide damage address is copied to the damage address and cleared, then the damage address is doubled.
10
	- If the player Pokemon faints, the whole Bide damage address is cleared. If the enemy Pokemon faints, only the high byte of the Bide damage address is cleared (becoming the original value ANDed by 255). This could lead to a desynchronization during a link battle.
11-
	+ CONVERSION_EFFECT
11+
12-
	+ HAZE_EFFECT
12+
13-
	+ SWITCH_AND_TELEPORT_EFFECT
13+
	+ Conversion effect
14-
	+ MIST_EFFECT
14+
	+ Haze effect
15-
	+ FOCUS_ENERGY_EFFECT
15+
	+ Switch and Teleport effect (e.g. Roar, Teleport)
16-
	+ CONFUSION_EFFECT
16+
	+ Mist effect
17-
	+ HEAL_EFFECT
17+
	+ Focus Energy effect
18-
	+ TRANSFORM_EFFECT
18+
	+ Confusion effect (e.g. Supersonic)
19-
	+ LIGHT_SCREEN_EFFECT
19+
	+ Heal effect (e.g. Recover, Rest)
20-
	+ REFLECT_EFFECT
20+
	+ Transform effect
21-
	+ POISON_EFFECT
21+
	+ Light Screen effect
22-
	+ PARALYZE_EFFECT
22+
	+ Reflect effect
23-
	+ SUBSTITUTE_EFFECT
23+
	+ Poison effect (e.g. Poisonpowder, Toxic)
24-
	+ MIMIC_EFFECT
24+
	+ Paralyze effect (e.g. Thunder Wave)
25-
	+ LEECH_SEED_EFFECT
25+
	+ Substitute effect
26-
	+ SPLASH_EFFECT
26+
	+ Mimic effect
27
	+ Leech Seed effect
28
	+ Splash effect
29
	- Using a move means actually using it, and not just that its effect gets executed. 
30
		- Selecting a move and failing to use it due to being asleep, frozen, etc. is not using a move.
31
		- Recharging from Hyper Beam is not using Hyper Beam.
32
		- Charging up for a move like SolarBeam is not using the move
33
		- Bide storing energy (after the turn it's selected) is not using Bide.
34-
- If the requirements for Counter dealing damage to the target meet, the content of the damage address is doubled. The three requirements are (excluding desync and other similar glitches):
34+
35-
	- The other player's last selected move's Base Power must be non-zero.
35+
36-
	- The other player's last selected move must be either Normal- or Fighting-type, but can not be Counter.
36+
37-
	- The damage address must contain a non-zero value.
37+
- If the requirements for Counter dealing damage to the target meet, the content of the damage address is doubled. Else, the damage address is not touched. 
38
	- The three requirements are:
39
		+ The other player's last selected move's Base Power must be non-zero.
40-
- Whenever a damaging move (including fixed damage moves like Seismic Toss or Super Fang, Counter, OHKO moves like Horn Drill, and Bide's damage dealing effect) deals damage to the target, the damage dealt corresponds to the value stored in the damage address. The damage stored corresponds to the damage calculated during the last damage calculation process. 
40+
		+ The other player's last selected move must be either Normal- or Fighting-type, but can not be Counter.
41-
	- Multi-turn and multi-hit moves such as Wrap, Double Kick and Fury Attack only execute damage calculation for the first hit.
41+
		+ The damage address must contain a non-zero value.
42
	- Selecting a move means pointing to it with the cursor in the move selection menu. If the player A opens the move selection menu and then decides to switch Pokemon, the last move pointed to by the cursor has been selected even though player B hasn't been notified about it. This means player A's "PlayerSelectedMove" address and player B's "EnemySelectedMove" address may differ and a desynchronization may occur.
43
	
44
45
- Whenever a damaging move (including fixed damage moves like Seismic Toss or Super Fang, Counter, OHKO moves like Horn Drill, and Bide's damage dealing effect) deals damage to the target, the damage dealt corresponds to the value stored in the damage address. The value stored in the damage address corresponds to the damage calculated during the last damage calculation process. 
46
	- Multi-turn and multi-hit moves such as Wrap, Double Kick and Fury Attack only execute damage calculation for the first turn or hit.
47
48
- Whenever any move that goes through standard accuracy checks misses, the damage address is cleared.
49
	- Moves included are:
50
		+ Damaging moves
51-
	- Missing isn't the same as having no effect (e.g. Thunder Wave on a already statused move, Leer on a -6 Def Pokemon). 
51+
52
		+ Disable
53
		+ Mimic
54
		+ Non-damaging moves with a stat modifier down effect
55-
	- In reality, it takes damage equal to the maximum of 1, and the value stored in the damage address divided by 8 and rounded down. But because the move missed, the damage address will contain 0 and thus, damage taken will be 1. Damage taken is then written to the damage address. 
55+
56
	- Missing isn't the same as having no effect (e.g. Thunder Wave on a already statused and/or Ground-type Pokemon, Leer on a -6 Def Pokemon). 
57
	- Failing because of Mist, because the target is using Fly/Dig, or because the target is not asleep when the move used is Dream Eater, is considered missing.
58
	- Counter being unsuccessful due to not meeting the requirements seen above is NOT considered missing.
59
60
- If Jump Kick or Hi-Jump Kick misses, the attacker takes 1 damage, and 1 is written to the damage address. 
61
	- In reality, it takes damage equal to the maximum of 1, and the value stored in the damage address divided by 8 and rounded down. 	But because the move missed, the damage address will contain 0 and thus, damage taken will be 1. Damage taken is then written to the damage address. 
62
63
- If a OHKO move like Horn Drill is successful, 65535 is written to the damage address.
64
65
- If, as a result of a damage dealing move or self-confusion damage, the target is KOed, the damage stored is overwritten with the HP the Pokemon had before being KOed.
66
	- If the target's Substitute faints, the damage stored is NOT overwritten with the HP the Substitute had.
67
68
- If Absorb, Mega Drain or Leech Life is successful, the content of the damage address is halved, then 1 is written to it if it contains 0, and finally the attacker gets its HP increased by the value stored in the damage address.
69
	- HP recovery is capped to the attacker's maximum HP, but the damage address isn't updated with the actual HP healed in this case.
70
71
- If the attacker takes recoil damage due to the effect of a recoil move such as Take Down, it will take damage equal to the value stored in the damage address, divided by 4 and rounded down.
72
	- The damage address isn't updated with the recoil damage taken.