Skip to content

Standard items list type confirmation handling

This page describes the logic SetItem has when handling a listtype of standard items.

  • We first check if the item is usable. There are 2 ways in which an item may not be usable:
    • Any ItemUse from itemdata has an UsageType of None
    • The AttackArea from itemdata is AllEnemies or SingleEnemy and GetAvaliableTargets for attackid -1 without onlyground or onlyground, but with excludeunderground causes availabletargets to become empty (in other words, the item affects one or all enemy party members, but there's no one above ground to be targetted)
  • If the item isn't usable, ReturnToMainSelect is called which does the following:
    • The Cancel sound is played on AudioSource 10
    • currentaction is set to BaseAction
    • option is set to lastoption
    • selecteditem is set to -1
    • DestroyHelpBox is called which sets helpboxid to -1 and destroys helpbox if it existed in 0.5 seconds with shrink before setting it to null
    • SetMaxOptions is called
    • UpdateText is called
  • Otherwise, if the item is usable: