Skip to content

Battle/feature - Commands#1469

Draft
tomipir wants to merge 38 commits into
mainfrom
Battle/feature/Commands
Draft

Battle/feature - Commands#1469
tomipir wants to merge 38 commits into
mainfrom
Battle/feature/Commands

Conversation

@tomipir
Copy link
Copy Markdown
Contributor

@tomipir tomipir commented Apr 24, 2026

Updated ability activation, giving up and character swapping to be done with commands that are only sent when the player wants to do them instead of sending the info whether the player wants to do them every frame as normal input.

Also Added documentation for new files and updated documentation of many old files that were modified.

BattlePlayerInput.qtn

  • Removed bool AbilityActivate field
  • Removed int PlayerCharacterNumber field
  • Removed bool GiveUpInput field
  • Combined FPVector2 MovementPositionMove and FPVector2 MovementDirection to FPVector2 MovementVector
  • Renamed BattleGridPosition MovementPositionTarget to MovementGridPosition

BattleDebugUtils.cs

  • Removed input debug info from inputs that don't exist anymore
  • Updated to work with changes to BattlePlayerInput.qtn

BattleCommands.cs

  • Added public abstract class BattleComand : DeterministicCommand
  • Added public class BattleGiveUpQCommand : BattleCommand
  • Added public class BattleCharacterSwapQCommand : BattleCommand
  • Added public class BattleCharacterAbilityQCommand : BattleCommand

CommandGiveUp.cs

  • Added public class CommandGiveUp : DeterministicCommand
  • Added public void Execute(Frame f, BattlePlayerManager.PlayerHandle playerHandle) method
    • Calls BattlePlayerQSystem.HandleGiveUp method

CommandActivateAbility.cs

  • Added public unsafe class CommandActivateAbility : DeterministicCommand
  • Added public void Execute(Frame f, BattlePlayerManager.PlayerHandle playerHandle) method
    • Starts a FrameTimer in playerData's AbilityActivateBufferSec

CommandSwapCharacter.cs

  • Added public class CommandSwapCharacter : DeterministicCommand
  • Added public void Execute(Frame f, BattlePlayerManager.PlayerHandle playerHandle) method
    • Calls BattlePlayerQSystem.HandleCharacterSwapping method

CommandSetup.User.cs

  • Added CommandGiveUp command
  • Added CommandSwapCharacter command
  • Added CommandActivateAbility command

BattleGameViewController.cs

  • Updated UiInputOnLocalPlayerGiveUp method to send CommandGiveUp command
  • Updated UiInputOnCharacterSelected method to send CommandSwapCharacter command

BattlePlayerInput.cs

  • Removed private int _characterNumber field since it is not needed
  • Removed private bool _onGiveUp field since it is not needed
  • Removed public void OnCharacterSelected method since it is not needed
  • Removed public void OnGiveUp method since it is not needed
  • Removed check for _characterNumber and _onGiveUp in PollInput method since it is not needed
  • Moved check for whether ability should be activated from Input struct to bool abilityActivate since it does not use input anymore
  • Removed resetting _onGiveUp and _characterNumber since they do not exist anymore
  • Added CommandSendGiveUp, CommandSendActivateAbility and CommandSendSwapCharacter methods to send the commands
  • Renamed OnJoystickMovement method to QueueJoystickMovement
  • Renamed OnJoystickRotation method to QueueJoystickRotation
  • Updated to work with changes to BattlePlayerInput.qtn

BattlePlayerBotController.cs

  • Removed PlayerCharacterNumber, GiveUpInput and AbilityActivate from GetBotInput method since the inputs do not exist anymore
  • Updated to work with changes to BattlePlayerInput.qtn

BattlePlayerQSystem.cs

  • Set IsValid to true when creating new input in GetInput method since it was missing
  • Removed PlayerCharacterNumber, GiveUpInput and AbilityActivate from GetInput method since the inputs do not exist anymore
  • Updated Update method to check for received commands
  • HandleGiveUpLogic method
    • Replaced bool return to void
  • private bool HandleGiveUpInput(Frame f, Input* input, BattlePlayerManager.PlayerHandle playerHandle) method
    • Updated to private bool HandleGiveUp(Frame f, BattlePlayerManager.PlayerHandle playerHandle)
    • No longer checks if giveup input is given since it is called by the command
  • private bool HandleCharacterSwapping(Frame f, Input* input, BattlePlayerManager.PlayerHandle playerHandle)
    • Updated to public static bool HandleCharacterSwapping(Frame f, BattlePlayerManager.PlayerHandle playerHandle, int playerCharacterNumber)
    • No longer checks for character number change in input since the character number is provided by the command that calls it
  • Removed FrameTimer starting from HandleInPlay method since it is now done by the command
  • Updated to work with changes to BattlePlayerInput.qtn
  • Also added default case for switch in OnProjectileHitPlayerCharacter method

BattlePlayerMovementController.cs

  • Updated to work with changes to BattlePlayerInput.qtn

BattleUiGiveUpButtonHandler.cs

  • Updated give up button text

closes #1467

@tomipir tomipir self-assigned this Apr 24, 2026
@tomipir tomipir added Quantum Battle battleen liittyvät tehtävät labels Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Battle battleen liittyvät tehtävät Quantum

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Task: Syötteiden muuttaminen komennoiksi

1 participant