Skip to content

Commit

Permalink
fix(magic): minor tweaks to magic tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Torwent committed Sep 20, 2023
1 parent ff609e2 commit 9a8b87f
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions osr/interfaces/gametabs/magic.simba
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,15 @@ Extends SRL's TRSMagic.
{$ENDIF}

(*
Magic._CastedSpell
Magic.SpellWasCast
~~~~~~~~~~~~~~~~~~
.. pascal:: function TRSMagic._CastedSpell(spell: ERSSpell): Boolean;
.. pascal:: function TRSMagic.SpellWasCast(spell: ERSSpell): Boolean;

Internal helper function for better logic of wether we casted a spell or not.
Used by WaspLib's TRSMagic.CastSpell() override.

And yes, I know casted is not a word.
Internal helper function to decide wether we cast a spell or not.
*)
function TRSMagic._CastedSpell(spell: ERSSpell): Boolean;
function TRSMagic.SpellWasCast(spell: ERSSpell): Boolean; override;
begin
if Self.IsOpen() and (Self.GetSelectedSpell() = spell) then
Exit(True);

Result := XPBar.EarnedXP() or Inventory.IsOpen();
Result := inherited() or XPBar.EarnedXP();
end;

(*
Expand All @@ -50,9 +44,9 @@ begin
if (selected <> ERSSpell.UNKNOWN) then
Self.MouseSpell(selected, MOUSE_LEFT);

XPBar.EarnedXP(); //Make sure WL.PreviousXP is set to current XP.
XPBar.EarnedXP();
Result := Self.MouseSpell(spell, MOUSE_LEFT) and
WaitUntil(Self._CastedSpell(spell), 100, SRL.TruncatedGauss(1000, 2000));
WaitUntil(Self.SpellWasCast(spell), 300, SRL.TruncatedGauss(1000, 2000));
end;


Expand Down

0 comments on commit 9a8b87f

Please sign in to comment.