Lost Number (Final Fantasy VII)

The Lost Number is an optional boss in Final Fantasy VII. After entering the right combination for the safe in the Shinra Mansion, this boss will attack the player party. The Lost Number consists of two halves; the purple half which performs physical attacks and the red half which casts magic. After reducing his HP below 3,498, the Lost Number will change completely into one of his sides instead of half and half. The Lost Number changes depending on the attack that caused the reduction: If the player has obtained Cloud's Limit Break Cross-Slash, or Aeris's Limit Break Seal Evil, they can be used to paralyze Lost Number. This will make the battle a lot easier. After its defeat, the player obtains Cosmo Memory, the Odin Materia, and a key to the Mansion's basement, which can be used to recruit Vincent Valentine to the party.
 * If the damage was inflicted by a magic attack, Lost Number will turn red and gain a substantial increase in its Magic and Magic Defense stats. It will attack with powerful magic from then on. In this state, it has lower DEF, so the party should use physical attacks.
 * If the damage was inflicted by a physical attack, Lost Number will turn purple and gain a boost in Attack and Defense. It will attack with strong physical attacks from then on. This form has low MDEF, so the party should attack with spells.
 * If the damage was inflicted via Poison, no effect will happen until Lost Number takes a physical or magical attack. Thus, if the player chooses to defeat Lost Number with Poison only, he will never change form.

AI Script
AI: Setup {
 * Count = Rnd(0..2)
 * SpclChance = 6

} AI: Main {
 * If (Count == 0) Then
 * Choose Random Opponent
 * Use  on Target
 * If (Rnd(1..SpclChance) == 1) Then
 * Choose Random Opponent
 * Use  on Target
 * }
 * 1/3 Chance: Count = 2
 * 2/3 Chance: Count = 1
 * } Else If (Count == 1) Then {
 * Choose Random Opponent
 * Use  on Target
 * If ((Target doesn't have Death Status)
 * & (Rnd(1..SpclChance) == 1)) Then
 * Choose Random Opponent
 * Use  on Target
 * }
 * 1/3 Chance: Count = 2
 * 2/3 Chance: Count = 0
 * } Else {
 * If ((Lost Number's MP >= 22)
 * & (At Least One Opponent doesn't have Reflect)) Then
 * Choose Random Opponent without Reflect
 * Use Bolt2 on Target
 * } Else {
 * Choose Random Opponent
 * Use  on Target
 * }
 * If (Rnd(1..SpclChance) == 1) Then
 * If ((Lost Number's MP >= 22)
 * & (At Least One Opponent doesn't have Reflect)) Then
 * Choose Random Opponent without Reflect
 * Use Bolt2 on Target
 * } Else {
 * Choose Random Opponent
 * Use  on Target
 * }
 * }
 * 1/2 Chance: Count = 0
 * 1/2 Chance: Count = 1
 * }
 * Use  on Target
 * }
 * }
 * 1/2 Chance: Count = 0
 * 1/2 Chance: Count = 1
 * }

} AI: Counter - General {
 * If ((Lost Number's HP <= 3 * [Lost Number's Max HP / 6])
 * And (SpclChance == 4)) Then
 * SpclChance = 3
 * } Else If ((Lost Number's HP <= 4 * [Lost Number's Max HP / 6])
 * And (SpclChance == 5)) Then {
 * SpclChance = 4
 * } Else If ((Lost Number's HP <= 5 * [Lost Number's Max HP / 6])
 * And (SpclChance == 6)) Then {
 * SpclChance = 5
 * } Else {
 * SpclChance = 6
 * }
 * }

} AI: Counter - Death {
 * Remove Lost Number 
 * Remove Lost Number 

} AI: Counter - Physical {
 * If (Lost Number doesn't have Sleep, Stop or Paralysed Status) Then
 * If (SpclChance <= 3) Then
 * Choose Self
 * Use <> on Target
 * Activate Lost Number 
 * Copy Lost Number's Stats to Lost Number 
 * Remove Self
 * }
 * }
 * }
 * }

} AI: Counter - Magical {
 * If (Lost Number doesn't have Sleep, Stop or Paralysed Status) Then
 * If (SpclChance <= 3) Then
 * Choose Self
 * Use <> on Target
 * Activate Lost Number 
 * Copy Lost Number's Stats to Lost Number 
 * Remove Self
 * }
 * }
 * }
 * }

} AI: Main {
 * 1/7 Chance:
 * Choose Random Opponent
 * Use  on Target
 * }
 * 2/7 Chance:
 * If (At Least One Opponent doesn't have Reflect Status) Then
 * If (Lost Number's MP >= 36) Then
 * If (At Least One Opponent
 * has neither Reflect nor Poison Status) Then
 * Choose Random Opponent with neither Reflect nor Poison Status
 * } Else {
 * Choose Random Opponent without Reflect
 * }
 * Use Bio2 on Target
 * } Else {
 * Choose Random Opponent without Reflect with Highest MP
 * Use Aspil on Target
 * }
 * } Else {
 * Choose Random Opponent
 * Use  on Target
 * }
 * }
 * 2/7 Chance:
 * If (At Least One Opponent doesn't have Reflect Status) Then
 * If (Lost Number's MP >= 22) Then
 * Choose Random Opponent without Reflect
 * Use Bolt2 on Target
 * } Else {
 * Choose Random Opponent without Reflect with Highest MP
 * Use Aspil on Target
 * }
 * } Else {
 * Choose Random Opponent
 * Use  on Target
 * }
 * }
 * 2/7 Chance:
 * If (At Least One Opponent doesn't have Reflect Status) Then
 * If (Lost Number's MP >= 28) Then
 * Choose Random Opponent without Reflect
 * Use Quake2 on Target
 * } Else {
 * Choose Random Opponent without Reflect with Highest MP
 * Use Aspil on Target
 * }
 * } Else {
 * Choose Random Opponent
 * Use <Tentacle> on Target
 * }
 * }
 * Choose Random Opponent without Reflect
 * Use Quake2 on Target
 * } Else {
 * Choose Random Opponent without Reflect with Highest MP
 * Use Aspil on Target
 * }
 * } Else {
 * Choose Random Opponent
 * Use <Tentacle> on Target
 * }
 * }

} AI: Main {
 * 1/4 Chance:
 * Choose Random Opponent
 * Use Lost Blow on Target
 * }
 * 3/4 Chance:
 * Choose Random Opponent
 * Use <Punch> on Target
 * If (1/2 Chance) Then
 * Choose Random Opponent
 * Use <Punch> on Target
 * }
 * }
 * Use <Punch> on Target
 * }
 * }

}

Trivia

 * The Lost Number's name and appearance, as well as the location where it is fought, all imply that it is one of Professor Hojo's experiments, and most likely a failed experiment given that it does not have a number.
 * The Lost Number's appearance is similar to that of the Chocobo Eater from Final Fantasy X.