This repository has been archived by the owner on Aug 28, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4dd209
commit 408992f
Showing
8 changed files
with
100 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
namespace RotationSolver.Basic.Actions; | ||
|
||
internal class HealPotionItem : BaseItem | ||
{ | ||
readonly float _percent; | ||
readonly uint _maxHp; | ||
|
||
public uint MaxHealHp | ||
{ | ||
get | ||
{ | ||
if (Service.Player == null) return 0; | ||
return Math.Min((uint)(Service.Player.MaxHp * _percent), _maxHp); | ||
} | ||
} | ||
|
||
protected override bool CanUseThis => Service.Config.UseHealPotions; | ||
|
||
public HealPotionItem(uint row, float percent, uint maxHp, uint a4 = 65535) : base(row, a4) | ||
{ | ||
_percent = percent; | ||
_maxHp = maxHp; | ||
} | ||
|
||
public override bool CanUse(out IAction item) | ||
{ | ||
item = null; | ||
if (Service.Player == null) return false; | ||
if (Service.Player.MaxHp - Service.Player.CurrentHp < MaxHealHp) return false; | ||
return base.CanUse(out item); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
namespace RotationSolver.Basic.Actions | ||
namespace RotationSolver.Basic.Actions; | ||
|
||
public enum MedicineType : byte | ||
{ | ||
internal class MedicineItem : BaseItem | ||
{ | ||
private MedicineType _type; | ||
public MedicineItem(uint row, MedicineType type, uint a4 = 65535) : base(row, a4) | ||
{ | ||
_type = type; | ||
} | ||
Strength, | ||
Dexterity, | ||
Intelligence, | ||
Mind, | ||
} | ||
|
||
internal class MedicineItem : BaseItem | ||
{ | ||
private MedicineType _type; | ||
|
||
protected override bool CanUseThis => Service.Config.UseTinctures; | ||
|
||
internal bool InType(ICustomRotation rotation) => rotation.MedicineType == _type; | ||
public MedicineItem(uint row, MedicineType type, uint a4 = 65535) : base(row, a4) | ||
{ | ||
_type = type; | ||
} | ||
|
||
internal bool InType(ICustomRotation rotation) => rotation.MedicineType == _type; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters