Golem (Final Fantasy VII)

The Golem is an enemy from Final Fantasy VII fought in the Cosmo Area near Cosmo Canyon, and in the fourth round of the Battle Square during the time Tiny Bronco is available. When fought in the Battle Square its stats are enhanced with double the regular HP and its Attack and Magic Attack are increased by 25%.
==Stats==
==Formations==
#	Formation
 	Golem
==Locations==
Cosmo Area 	Cosmo Area
Canyon 	126
Battle Square (with Tiny Bronco available)	Battle Square (with Tiny Bronco available)
Group A - Battle 4 	126
==Battle==
Golem slowly moves closer to the party, its stats changing as it does so. In the shown template, the second tab is its stats if it doesn't advance after the first turn, while the third and fourth tabs are its stats after it advances once and twice. It only uses Finger Shot normally, and will use the powerful Megaton Punch if it gets close enough.
As a programming note, the Golem begins battle with a Magic atk stat of 5. The Golem's stats are recalculated based on its row, removing 18 when at the back, 12 when in the middle, and 6 when at the front. The Magic atk value is stored as a signed integer in a byte. This means it only can have values between 0 and 255. The AI calculations do not prevent overflow, therefore when 6 is removed from 5, the result is 255, Golem's Magic atk stat on the front row. This is likely intentional, however, Golem has no magical attacks so it does not matter.
What is likely unintentional is Golem's Magic atk stat in the Battle Square when on the front row. Magic atk stats are increased by 25% (rounded down to an integer) in the Battle Square, therefore 5 becomes 6. Thus, when 6 is removed because its on the front row, the values ends up as 0.
===Strategy===
The party should try to kill it before Golem can use Megaton Punch. L4 Suicide and Gravity spells are useful for whittling down its considerable HP, and the Enemy Skill Frog Song can be useful to inflict Sleep to keep it from attacking if it does start using Megaton Punch.
==AI script==
AI: Setup
{
:TempVar:Row = 3
:TempVar:DfltAtt = Golem's Att
:TempVar:DfltMAt = Golem's MAt
:TempVar:DfltDef = Golem's Def
:TempVar:DfltMDf = Golem's MDf
:TempVar:LastHP = Golem's HP
}
AI: Main
{
:If (TempVar:BackRowAttack == 0) Then
:{
::Choose Random Opponent
::2/3 Chance: Use <Golem Punch> on Target
::1/3 Chance: Use Finger Shot on Target
::TempVar:BackRowAttack = 1
:} Else If (TempVar:Row == 1) Then {
::Choose Random Opponent
::Use Megaton Punch on Target
:} Else {
::Choose Self
::Use <Advance> on Target
::TempVar:Row = TempVar:Row - 1
:}
:Golem's Att = TempVar:DfltAtt - TempVar:Row * 4
:Golem's MAt = TempVar:DfltMAt - TempVar:Row * 6
:Golem's Def = TempVar:DfltDef + TempVar:Row * 8
:Golem's MDf = TempVar:DfltMDf + TempVar:Row * 10
}
AI: Counter - General
{
:TempVar:DmgCounter = TempVar:DmgCounter + (TempVar:LastHP - Golem's HP)
:If (TempVar:DmgCounter > 200) Then
:{
::Choose Self
::If (TempVar:Row < 3) Then
::{
:::Use <Retreat> on Target
:::TempVar:Row = TempVar:Row + 1
:::Golem's Att = TempVar:DfltAtt - TempVar:Row * 4
:::Golem's MAt = TempVar:DfltMAt - TempVar:Row * 6
:::Golem's Def = TempVar:DfltDef + TempVar:Row * 8
:::Golem's MDf = TempVar:DfltMDf + TempVar:Row * 10
:::If (TempVar:Row == 3) Then
:::{
::::TempVar:BackRowAttack = 0
:::}
::}
::TempVar:DmgCounter = 0
:}
:TempVar:LastHP = Golem's HP
}
==Etymology==
==Related enemies==
*Armored Golem
*Ice Golem
Category:Enemies in Final Fantasy VII