BaseAction
ChoiceInput logic¶
This page details the logic of GetChoiceInput when currentaction is BaseAction
.
All of the logic present here involves handling inputs. The input isn't processed if caninputcooldown
hasn't expired yet and nothing happens except decreasing the cooldown by MainManager.framestep
.
Input 7 (toggle HUD)¶
This input is handled specifically where pressing it will set idletimer
to 250 when pressed which will show the hexpcounter
without needing to wait 200 frames. Any other input will cause the idletimer
to be set to 0 which resets the timer.
Input 2 / 3 (left / right)¶
These inputs changes the option
by one depending on the direction (decrement if right, increment if left with wrap around from 0 to maxoptions
- 1).
Either input will have caninputcooldown
set to 2.0 frames, a Scroll
sound played on sounds[10]
and UpdateText being called.
Input 5 (cancel)¶
This input is only processed if GetFreePlayerAmmount returns more than 1 player being free to act.
caninputcooldown
is set to 2.0 frames- The
Money
sound is player with a pitch of 1.0 +currentturn
/ 10.0 which shifts the pitch slightly using a rate that depends on the selected player that we are switching away from lastoption
is set tooption
currentturn
is set to -1 which unselects the player (the new one will be cycle on the next player phase update)
Input 6 (switch party)¶
This input is only processed when AllPartyFree returns true (all playerdata
have a cantmove
of 0 or below) or GetAlivePlayerAmmount returns exactly 1 (there is only one player with an hp
above 0 with no eatenby
):
caninputcooldown
is set to 2.0- The
Switch
sound is played - The SwitchParty action coroutine is started (without fast) which changes to an uncontrolled flow
Input 4 (confirm)¶
caninputcooldown
is set to 2.0- instance.
inputcooldown
is set to 2.0 - A
Confirm
sound is played onsounds[10]
lastoption
is set tooption
vineoption
is set tomaxoptions
lastaction
is set tooption
- currentchoice is set to the
Actions
value whose numerical value isoption
From there, what happens depends on currentchoice and after, UpdateText is called.
Attack
¶
- SetTargets is called
- If there's no
availabletargets
, PlayBuzzer is called (the attack usage is denied because no targets is available) - Otherwise (the basic attack is accepted):
maxoptions
is set to the length ofavailabletargets
- currentaction is set to
SelectEnemy
- itemarea is set to
SingleEnemy
option
is set to 0
Skill
¶
excludeself
is set to falseplayerdata[currentturn].lockskills
is true or it has the Taunted or Inked condition, PlayBuzzer is called (the skill usage is denied)- Otherwise (the skill usage is accepted):
- currentaction is set to
SkillList
- MainManager.RefreshSkills is called
- A couple of ItemList fields are initialised (with an instance.
inputcooldown
of 5.0):storeid
: 0- listtype: -
currentturn
- 1 which is the skills list type of the corresponding player party member listammount
: 5listdesc
: truelistsell
: false
- ShowItemList is called with -
currentturn
- 1 as the list type, MainManager.defaultlistpos
as the position with showdescription and without sell
- currentaction is set to
Item
¶
excludeself
is set to false- GetAvaliableTargets is called with onlyground without onlyfront using -1 as the acttackid
- If instance.
items[0]
is empty (no standard items) orplayerdata[currentturn].lockitems
is true or it has the Taunted or Sticky condition, PlayBuzzer is called (the item usage is denied) - Otherwise (the item usage is accepted):
- currentaction is set to
ItemList
- A couple of ItemList field are initialised (with an instance.
inputcooldown
of 5.0):storeid
: 0- listtype: 0 which is the standard items list type
listammount
: 5listdesc
: truelistsell
: false
- ShowItemList is called with 0 as the list type, MainManager.
defaultlistpos
as the position with showdescription and without sell - UpdateText is called
- currentaction is set to
Strategy
¶
- currentaction is set to
StrategyList
- A couple of ItemList field are initialised (with an instance.
inputcooldown
of 5.0):storeid
: 0- listtype: 9 which is the battle strategy list type
listammount
: 6listdesc
: truelistsell
: false
- ShowItemList is called with 9 as the list type, MainManager.
defaultlistpos
as the position with showdescription and without sell - UpdateText is called
Relay
¶
- If there's 1 or less
playerdata
orplayerdata[currentturn].locktri
(unable to relay) orhaspassed
is true (already relayed on the same main turn) or it has the Taunted condition, PlayBuzzer is called (the relay is denied) - Otherwise (the relay is accepted):
excludeself
is set to trueoption
is set to 0helpboxid
is set to -1maxoptions
is set to the length ofplayerdata
itemarea
is set toSingleAlly
option
is incremented with wrap around tomaxoptions
- 1 repeatedly via IncreaseOption until its value iscurrentturn
- currentaction is set to
SelectPlayer
Swap
¶
excludeself
is set to trueoption
is set to 0helpboxid
is set to -1maxoptions
is set to the length ofplayerdata
option
is incremented with wrap around tomaxoptions
- 1 repeatedly via IncreaseOption until its value iscurrentturn
- currentaction is set to
SelectPlayer