Skip to content

Battle strategy list type confirmation handling

This page describes the logic SetItem has when handling a listtype of Battle strategy.

The logic depends on the listvar option:

271 (Swap)

This acts as if 0 (Switch) was selected if there is 2 or less playerdata.

Otherwise:

  • itemarea is set to SingleAlly
  • currentchoice is set to Swap
  • helpboxid is set to -1
  • excludeself is set to true
  • If currentturn is 0, option is set to 1
  • GotoSelect without overridemax is called

2 (Do Nothing)

DoNothing is called which does the following:

  • If playerdata[currentturn].didnothing is false (the player party member didn't already did nothing), several effects can happen depending on at least 1 instance of a specific medal being equipped on the currentturn player party member (more can stack, these aren't mutually exclusive):
    • Meditation: instance.tp is incremented by the amount of medals equipped then clamped from 0 to instance.maxtp. This is followed by the Heal2 sound being played and MagicUp particles playing at playerdata[currentturn].battleentity position + (0.0, 0.5, 0.0)
    • Prayer: playerdata[currentturn].hp is incremented by the amount of medals equipped * 2 then clamped from 0 to playerdata[currentturn].maxhp. This is followed by the Heal sound being played (If no Meditation is equipped) and Heal particles playing at playerdata[currentturn].battleentity position + (0.0, 0.5, 0.0)
    • Reflection: If no Prayer or Meditation medals is equipped, the StatUp sound is played. This is followed by a StatEffect starting on the battleentity with type 1 (blue, up arrow) and if the player party member doesn't have the Reflection condition, SetCondition is called with Reflection on the player party member with a turn amount being the amount of medals equipped
  • playerdata[currentturn].didnothing is set to true which prevents the medals effects to apply on a second do nothing
  • EndPlayerTurn is called
  • CancelList is called

0 (Switch)

The Switch sound is played followed by a SwitchParty action coroutine starting switching to an uncontrolled flow.

1 (Spy)

  • ItemList's listredirect is set to -1 (this is to workaround a potential inlist issue)
  • availabletargets is set to the return of GetTattleable which is all enemydata whose notattle is false
  • If availabletargets is empty, PlayBuzzer is called followed by ReloadStrategy being called and invoked another time in 0.1 seconds. The method does the following (essentially denies the spy):
    • currentaction is set to StrategyList
    • helpboxid is set to -1
    • A couple of ItemList field are initialised (with an instance.inputcooldown of 5.0):
    • ShowItemList is called with 9 as the list type, MainManager.defaultlistpos as the position with showdescription and without sell
    • UpdateText is called
  • Otherwise (the spy is accepted):

3 (Flee)

If canflee is true, a TryFlee action coroutine is started changing to an uncontrolled flow. This ends the handler.

If it's false however (this denies the flee with a message):

  • CancelList is called
  • ItemList's listredirect is set to -1 (this is to workaround a potential inlist issue)
  • SetText is called in dialogue mode using |boxstyle,4||spd,0| followed by menutext[73] (a message informing the player they cannot flee) as the text and the following:
    • fonttype of 0 (BubblegumSans)
    • linebreak of MainManager.messagebreak
    • No tridimensional
    • position of Vector3.zero
    • No cameraoffset
    • size of Vector2.one
    • No parent
    • No caller
  • A WaitForMessage coroutine is started which yields as long as the message lock is grabbed followed by calling UpdateText followed by a frame yield
  • UpdateText is called