# Combat Methods to interact with the combat gametab: ```{figure} ../../images/combattab.png ``` - - - ## TCombat Main record responsible with handling the combat gametab. - - - ## Combat.IsOpen ```pascal function TCombat.IsOpen(): Boolean; ``` Returns true/false if the combat tab is open. Example: ```pascal WriteLn Combat.IsOpen(); ``` - - - ## Combat.Open ```pascal function TCombat.Open(): Boolean; ``` Attempts to open the combat gametab. Example: ```pascal WriteLn Combat.Open(); ``` - - - ## Combat.GetCategory ```pascal function TCombat.GetCategory(): EWeaponCategory; ``` Returns the `EWeaponCategory` of the current weapon. Example: ```pascal {$I WaspLib/main.simba} begin WriteLn Combat.GetCategory(); end. ``` - - - ## Combat.StyleBoxes ```pascal property TCombat.StyleBoxes: TBoxArray; ``` Returns the the attack style boxes available. Example: ```pascal {$I WaspLib/main.simba} begin while True do ShowOnTarget(Combat.StyleBoxes); end. ``` ```{figure} ../../images/attackstyles.gif ``` - - - ## Combat.WeaponStyle ```pascal property TCombat.WeaponStyle: EWeaponStyle; property TCombat.WeaponStyle(value: EWeaponStyle): Boolean; ``` Gets/Sets the weapon `EWeaponStyle`. Example: ```pascal {$I WaspLib/main.simba} begin WriteLn Combat.WeaponStyle; WriteLn Combat.WeaponStyle := EWeaponStyle.BLOCK; WriteLn Combat.WeaponStyle; end. ``` - - - ## Combat.MeleeStyle ```pascal property TCombat.MeleeStyle: EMeleeStyle; property TCombat.MeleeStyle(value: EMeleeStyle): Boolean; ``` Gets/Sets the combat `EMeleeStyle`. Doesn't do anything if we don't have a melee weapon. Example: ```pascal {$I WaspLib/main.simba} begin WriteLn Combat.MeleeStyle; WriteLn Combat.MeleeStyle := EMeleeStyle.SLASH; WriteLn Combat.MeleeStyle; end. ``` - - - ## Combat.AutoRetaliate ```pascal property TCombat.AutoRetaliate: Boolean; property TCombat.AutoRetaliate(value: Boolean): Boolean; ``` Gets/Sets the auto retaliate state. Example: ```pascal {$I WaspLib/main.simba} begin WriteLn Combat.AutoRetaliate; Combat.AutoRetaliate := True; WriteLn Combat.AutoRetaliate; Combat.AutoRetaliate := False; WriteLn Combat.AutoRetaliate; end. ``` - - - ## Combat.SpecialAttack ```pascal property TCombat.SpecialAttack: Boolean; property TCombat.SpecialAttack(value: Boolean): Boolean; ``` Gets/Sets the special attack state. Example: ```pascal {$I WaspLib/main.simba} begin WriteLn Combat.SpecialAttack; Combat.SpecialAttack := True; WriteLn Combat.SpecialAttack; Combat.SpecialAttack := False; WriteLn Combat.SpecialAttack; end. ``` - - - ## Combat variable Global {ref}`TCombat` variable.