We do need to make some tweaks to the functions to accommodate the new control system as well. The BeginAttackSequence function has been rebranded to TurnStart and adjusted slightly to hide the continue sprite:
The PlayerAttack and OppAttack functions have been updated:
PlayerAttack
Condition
On function PlayerAttack
Action
Function ▶︎ Call RandomNumberGen
Continue ▶︎ Set visibility to Visible
System ▶︎ Set CurState to "PlayerTurn"
Sub-event Condition
Player ▶︎ HP > 0
Sub-event Condition
System ▶︎ Is not PlayerMoved
Sub-event Action
System ▶︎ Set NextState to "PlayerTurn"
Sub-event Condition
System ▶︎ Compare two values ▶︎ RandomNumber ≤ Player.Acc
Sub-event Action
System ▶︎ Set NextState to "OppTurn"
System ▶︎ Set PlayerMoved to True
Opponent ▶︎ Flash ▶︎ Flash on 0.1s off 0.1s for 1 second
Opponent ▶︎ Set HP to Self.HP-Player.Attack
BattleText ▶︎ Typewriter text "Player attacked. Attack hit for " & Player.Attack & " damage!" over 2 seconds
Sub-event Condition
System ▶︎ Compare two values ▶︎ RandomNumber > Player.Acc
Sub-event Action
System ▶︎ Set NextState to "OppTurn"
System ▶︎ Set PlayerMoved to True
BattleText ▶︎ Typewriter text "Player attacked. Attack missed!" over 2 seconds
As before, the OppAttack function is mostly the same:
That about covers the changes needed to swap from mouse to keyboard controls. By no longer relying on timers, you should also be able to add in animations for example before the trigger to progress the turn becomes available. Give it a go!