diff --git a/.gitignore b/.gitignore index be3766c..03b36a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,220 @@ -/src/bin/ -/src/obj/ -/.vs +# Download this file using PowerShell v3 under Windows with the following comand: +# Invoke-WebRequest https://gist.githubusercontent.com/kmorcinek/2710267/raw/ -OutFile .gitignore +# or wget: +# wget --no-check-certificate http://gist.githubusercontent.com/kmorcinek/2710267/raw/.gitignore /src/.vs/BasicFlaskRoutine/v16/.suo + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results +[Dd]ebug/ +[Rr]elease/ +x64/ +[Bb]in/ +[Oo]bj/ +# build folder is nowadays used for build scripts and should not be ignored +#build/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# OS generated files # +.DS_Store* +Icon? + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings +modulesbin/ +tempbin/ + +# EPiServer Site file (VPP) +AppData/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# vim +*.txt~ +*.swp +*.swo + +# svn +.svn + +# CVS - Source Control +**/CVS/ + +# Remainings from resolvings conflicts in Source Control +*.orig + +# SQL Server files +**/App_Data/*.mdf +**/App_Data/*.ldf +**/App_Data/*.sdf + + +#LightSwitch generated files +GeneratedArtifacts/ +_Pvt_Extensions/ +ModelManifest.xml + +# ========================= +# Windows detritus +# ========================= + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac desktop service store files +.DS_Store + +# SASS Compiler cache +.sass-cache + +# Visual Studio 2014 CTP +**/*.sln.ide + +# Visual Studio temp something +.vs/ + +# dotnet stuff +project.lock.json + +# VS 2015+ +*.vc.vc.opendb +*.vc.db + +# Rider +.idea/ + +# Visual Studio Code +.vscode/ + +# Output folder used by Webpack or other FE stuff +**/node_modules/* +**/wwwroot/* + +# SpecFlow specific +*.feature.cs +*.feature.xlsx.* +*.Specs_*.html + +##### +# End of core ignore list, below put you custom 'per project' settings (patterns or path) +##### +/BasicFlaskRoutine.7z diff --git a/src/BasicFlaskRoutine.csproj b/BasicFlaskRoutine.csproj similarity index 89% rename from src/BasicFlaskRoutine.csproj rename to BasicFlaskRoutine.csproj index 3c16d9f..1b49368 100644 --- a/src/BasicFlaskRoutine.csproj +++ b/BasicFlaskRoutine.csproj @@ -1,217 +1,212 @@ - - - - - Debug - AnyCPU - {4EBA974C-AC8C-42A5-B8EE-5AD318B6D961} - Library - Properties - BaseTreeRoutine.Routine.BasicFlaskRoutine - BasicFlaskRoutine - v4.8 - 512 - - - - true - full - false - ..\..\PoeHelper\Plugins\Compiled\BasicFlaskRoutine\ - DEBUG;TRACE - prompt - 4 - x64 - true - - - pdbonly - true - ..\..\PoeHelper\Plugins\Compiled\BasicFlaskRoutine\ - TRACE - prompt - 4 - x64 - true - - - - ..\..\PoeHelper\ExileCore.dll - False - - - ..\..\PoeHelper\ImGui.NET.dll - False - - - False - ..\..\PoeHelper\Newtonsoft.Json.dll - False - - - ..\..\PoeHelper\SharpDX.dll - False - - - ..\..\PoeHelper\SharpDX.Desktop.dll - False - - - ..\..\PoeHelper\SharpDX.Mathematics.dll - False - - - - - - False - ..\..\ExileApi\packages\System.Numerics.Vectors.4.6.0-preview5.19224.8\lib\net46\System.Numerics.Vectors.dll - False - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - + + + + + Debug + AnyCPU + {4EBA974C-AC8C-42A5-B8EE-5AD318B6D961} + Library + Properties + BaseTreeRoutine.Routine.BasicFlaskRoutine + BasicFlaskRoutine + v4.8 + 512 + + + + true + full + false + ..\..\..\..\PoeHelper\Plugins\Compiled\BasicFlaskRoutine\ + DEBUG;TRACE + prompt + 4 + x64 + true + + + pdbonly + true + ..\..\..\..\PoeHelper\Plugins\Compiled\BasicFlaskRoutine\ + TRACE + prompt + 4 + x64 + true + + + + ..\..\..\..\PoeHelper\ImGui.NET.dll + False + + + ..\..\..\..\PoeHelper\Newtonsoft.Json.dll + False + + + ..\..\..\..\PoeHelper\SharpDX.dll + False + + + ..\..\..\..\PoeHelper\SharpDX.Mathematics.dll + False + + + + + + False + ..\..\..\..\PoeHelper\System.Numerics.Vectors.dll + False + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + + + {5539d732-34a7-44ab-9e28-116c3429b12a} + Core + False + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + \ No newline at end of file diff --git a/src/BasicFlaskRoutine/BasicFlaskRoutine.cs b/BasicFlaskRoutine/BasicFlaskRoutine.cs similarity index 71% rename from src/BasicFlaskRoutine/BasicFlaskRoutine.cs rename to BasicFlaskRoutine/BasicFlaskRoutine.cs index f57ef11..a8315b1 100644 --- a/src/BasicFlaskRoutine/BasicFlaskRoutine.cs +++ b/BasicFlaskRoutine/BasicFlaskRoutine.cs @@ -1,630 +1,785 @@ -using TreeRoutine.DefaultBehaviors.Actions; -using TreeRoutine.DefaultBehaviors.Helpers; -using TreeRoutine.FlaskComponents; -using TreeRoutine.Routine.BasicFlaskRoutine.Flask; -using System; -using System.Collections.Generic; -using SharpDX; -using System.Linq; -using TreeRoutine.Menu; -using ImGuiNET; -using System.Diagnostics; -using ExileCore; -using ExileCore.PoEMemory.Components; -using ExileCore.PoEMemory.MemoryObjects; -using ExileCore.Shared; -using ExileCore.Shared.Enums; -using TreeRoutine.TreeSharp; - -namespace TreeRoutine.Routine.BasicFlaskRoutine -{ - public class BasicFlaskRoutine : BaseTreeRoutinePlugin - { - public BasicFlaskRoutine() : base() - { - - } - - public Composite Tree { get; set; } - private Coroutine TreeCoroutine { get; set; } - public Object LoadedMonstersLock { get; set; } = new Object(); - public List LoadedMonsters { get; protected set; } = new List(); - - - private KeyboardHelper KeyboardHelper { get; set; } = null; - - private Stopwatch PlayerMovingStopwatch { get; set; } = new Stopwatch(); - - private const string basicFlaskRoutineChecker = "BasicFlaskRoutine Checker"; - - - - public override bool Initialise() - { - base.Initialise(); - - Name = "BasicFlaskRoutine"; - KeyboardHelper = new KeyboardHelper(GameController); - - Tree = CreateTree(); - - // Add this as a coroutine for this plugin - Settings.Enable.OnValueChanged += (sender, b) => - { - if (b) - { - if (Core.ParallelRunner.FindByName(basicFlaskRoutineChecker) == null) InitCoroutine(); - TreeCoroutine?.Resume(); - } - else - TreeCoroutine?.Pause(); - - }; - InitCoroutine(); - - Settings.TicksPerSecond.OnValueChanged += (sender, b) => - { - UpdateCoroutineWaitRender(); - }; - - return true; - } - - private void InitCoroutine() - { - TreeCoroutine = new Coroutine(() => TickTree(Tree), new WaitTime(1000 / Settings.TicksPerSecond), this, "BasicFlaskRoutine Tree"); - Core.ParallelRunner.Run(TreeCoroutine); - } - - private void UpdateCoroutineWaitRender() - { - TreeCoroutine.UpdateCondtion(new WaitTime(1000 / Settings.TicksPerSecond)); - } - - protected override void UpdateCache() - { - base.UpdateCache(); - - UpdatePlayerMovingStopwatch(); - } - - private void UpdatePlayerMovingStopwatch() - { - var player = GameController.Player.GetComponent(); - if (player != null && player.Address != 0 && player.isMoving) - { - if (!PlayerMovingStopwatch.IsRunning) - PlayerMovingStopwatch.Start(); - } - else - { - PlayerMovingStopwatch.Reset(); - } - } - - private Composite CreateTree() - { - return new Decorator(x => TreeHelper.CanTick() && !PlayerHelper.isPlayerDead() && - (!Cache.InHideout || Settings.EnableInHideout) && PlayerHelper.playerDoesNotHaveAnyOfBuffs(new List() { "grace_period" }), - new PrioritySelector - ( - new Decorator(x => Settings.AutoFlask, - new PrioritySelector( - CreateInstantHPPotionComposite(), - CreateHPPotionComposite(), - CreateInstantManaPotionComposite(), - CreateManaPotionComposite() - ) - ), - CreateAilmentPotionComposite(), - CreateDefensivePotionComposite(), - CreateSpeedPotionComposite(), - CreateOffensivePotionComposite() - ) - ); - } - - private Composite CreateInstantHPPotionComposite() - { - return new Decorator((x => !Settings.BossingMode && PlayerHelper.isHealthBelowPercentage(Settings.InstantHPPotion)), - new PrioritySelector( - CreateUseFlaskAction(FlaskActions.Life, true, true), - CreateUseFlaskAction(FlaskActions.Hybrid, true, true), - CreateUseFlaskAction(FlaskActions.Life), - CreateUseFlaskAction(FlaskActions.Hybrid) - ) - ); - - } - - private Composite CreateHPPotionComposite() - { - return new Decorator((x => !Settings.BossingMode && PlayerHelper.isHealthBelowPercentage(Settings.HPPotion)), - new Decorator((x => PlayerHelper.playerDoesNotHaveAnyOfBuffs(new List() { "flask_effect_life" })), - new PrioritySelector( - CreateUseFlaskAction(FlaskActions.Life, false), - CreateUseFlaskAction(FlaskActions.Hybrid, false) - ) - ) - ); - } - - private Composite CreateInstantManaPotionComposite() - { - return new Decorator((x => PlayerHelper.isManaBelowPercentage(Settings.InstantManaPotion)), - new PrioritySelector( - CreateUseFlaskAction(FlaskActions.Mana, true, true), - CreateUseFlaskAction(FlaskActions.Hybrid, true, true) - ) - ); - } - - private Composite CreateManaPotionComposite() - { - return new Decorator((x => PlayerHelper.isManaBelowPercentage(Settings.ManaPotion) || PlayerHelper.isManaBelowValue(Settings.MinManaFlask)), - new Decorator((x => PlayerHelper.playerDoesNotHaveAnyOfBuffs(new List() { "flask_effect_mana", "flask_effect_mana_not_removed_when_full" })), - new PrioritySelector( - CreateUseFlaskAction(FlaskActions.Mana, false), - CreateUseFlaskAction(FlaskActions.Hybrid, false) - ) - ) - ); - } - - private Composite CreateSpeedPotionComposite() - { - return new Decorator((x => Settings.SpeedFlaskEnable && Settings.MinMsPlayerMoving <= PlayerMovingStopwatch.ElapsedMilliseconds && (PlayerHelper.playerDoesNotHaveAnyOfBuffs(new List() { "flask_bonus_movement_speed", "flask_utility_sprint" }) || (!Settings.SilverFlaskEnable || PlayerHelper.playerDoesNotHaveAnyOfBuffs(new List() { "flask_utility_haste" })))), - new PrioritySelector( - new Decorator((x => Settings.QuicksilverFlaskEnable), CreateUseFlaskAction(FlaskActions.Speedrun)), - new Decorator((x => Settings.SilverFlaskEnable), CreateUseFlaskAction(FlaskActions.OFFENSE_AND_SPEEDRUN)) - ) - ); - } - - private Composite CreateDefensivePotionComposite() - { - return new Decorator((x => Settings.DefensiveFlaskEnable && !Settings.BossingMode && - (PlayerHelper.isHealthBelowPercentage(Settings.HPPercentDefensive) || PlayerHelper.isEnergyShieldBelowPercentage(Settings.ESPercentDefensive) || - Settings.DefensiveMonsterCount > 0 && HasEnoughNearbyMonsters(Settings.DefensiveMonsterCount, Settings.DefensiveMonsterDistance, Settings.DefensiveCountNormalMonsters, Settings.DefensiveCountRareMonsters, Settings.DefensiveCountMagicMonsters, Settings.DefensiveCountUniqueMonsters, Settings.DefensiveIgnoreFullHealthUniqueMonsters))), - new PrioritySelector( - CreateUseFlaskAction(FlaskActions.Defense), - new Decorator((x => Settings.OffensiveAsDefensiveEnable), CreateUseFlaskAction(new List { FlaskActions.OFFENSE_AND_SPEEDRUN, FlaskActions.Defense }, ignoreFlasksWithAction: (() => Settings.DisableLifeSecUse ? new List() { FlaskActions.Life, FlaskActions.Mana, FlaskActions.Hybrid } : null))) - ) - ); - } - - private Composite CreateOffensivePotionComposite() - { - return new PrioritySelector( - new Decorator((x => Settings.OffensiveFlaskEnable && !Settings.BossingMode && - (PlayerHelper.isHealthBelowPercentage(Settings.HPPercentOffensive) || PlayerHelper.isEnergyShieldBelowPercentage(Settings.ESPercentOffensive) || Settings.OffensiveMonsterCount > 0 && HasEnoughNearbyMonsters(Settings.OffensiveMonsterCount, Settings.OffensiveMonsterDistance, Settings.OffensiveCountNormalMonsters, Settings.OffensiveCountRareMonsters, Settings.OffensiveCountMagicMonsters, Settings.OffensiveCountUniqueMonsters, Settings.OffensiveIgnoreFullHealthUniqueMonsters))), - CreateUseFlaskAction(new List { FlaskActions.Offense, FlaskActions.OFFENSE_AND_SPEEDRUN }, ignoreFlasksWithAction: (() => Settings.DisableLifeSecUse ? new List() { FlaskActions.Life, FlaskActions.Mana, FlaskActions.Hybrid} : null))) - ); - } - - private Composite CreateAilmentPotionComposite() - { - return new Decorator(x => Settings.RemAilment && !Settings.BossingMode, - new PrioritySelector( - new Decorator(x => Settings.RemBleed, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Bleeding, CreateUseFlaskAction(FlaskActions.BleedImmune, isCleansing:true))), - new Decorator(x => Settings.RemBurning, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Burning, CreateUseFlaskAction(FlaskActions.IgniteImmune, isCleansing: true))), - CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Corruption, CreateUseFlaskAction(FlaskActions.BleedImmune, isCleansing: true), (() => Settings.CorruptCount)), - new Decorator(x => Settings.RemFrozen, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Frozen, CreateUseFlaskAction(FlaskActions.FreezeImmune, isCleansing: true))), - new Decorator(x => Settings.RemPoison, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Poisoned, CreateUseFlaskAction(FlaskActions.PoisonImmune, isCleansing: true))), - new Decorator(x => Settings.RemShocked, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Shocked, CreateUseFlaskAction(FlaskActions.ShockImmune, isCleansing: true))), - new Decorator(x => Settings.RemCurse, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.WeakenedSlowed, CreateUseFlaskAction(FlaskActions.CurseImmune, isCleansing: true))) - ) - ); - } - - private Composite CreateUseFlaskAction(FlaskActions flaskAction, Boolean? instant = null, Boolean ignoreBuffs = false, Func> ignoreFlasksWithAction = null, Boolean isCleansing = false) - { - return CreateUseFlaskAction(new List { flaskAction }, instant, ignoreBuffs, ignoreFlasksWithAction, isCleansing); - } - - private Composite CreateUseFlaskAction(List flaskActions, Boolean? instant = null, Boolean ignoreBuffs = false, Func> ignoreFlasksWithAction = null, Boolean isCleansing = false) - { - return new UseHotkeyAction(KeyboardHelper, x => - { - var foundFlask = FindFlaskMatchingAnyAction(flaskActions, instant, ignoreBuffs, ignoreFlasksWithAction, isCleansing); - - if (foundFlask == null) - { - return null; - } - - return Settings.FlaskSettings[foundFlask.Index].Hotkey; - }); - } - - private Boolean HasEnoughNearbyMonsters(int minimumMonsterCount, int maxDistance, bool countNormal, bool countRare, bool countMagic, bool countUnique, bool ignoreUniqueIfFullHealth) - { - var mobCount = 0; - var maxDistanceSquare = maxDistance * maxDistance; - - var playerPosition = GameController.Player.Pos; - - if (LoadedMonsters != null) - { - List localLoadedMonsters = null; - lock (LoadedMonstersLock) - { - localLoadedMonsters = new List(LoadedMonsters); - } - - // Make sure we create our own list to iterate as we may be adding/removing from the list - foreach (var monster in localLoadedMonsters) - { - if (!monster.HasComponent() || !monster.IsValid || !monster.IsAlive || !monster.IsHostile) - continue; - - var monsterType = monster.GetComponent()?.Rarity ?? null; - if (monsterType == null) continue; - // Don't count this monster type if we are ignoring it - if (monsterType == MonsterRarity.White && !countNormal - || monsterType == MonsterRarity.Rare && !countRare - || monsterType == MonsterRarity.Magic && !countMagic - || monsterType == MonsterRarity.Unique && !countUnique) - continue; - - if (monsterType == MonsterRarity.Unique && ignoreUniqueIfFullHealth) - { - Life monsterLife = monster.GetComponent(); - if (monsterLife == null) - continue; - - if (monsterLife.HPPercentage > 0.995) - continue; - } - - var monsterPosition = monster.Pos; - - var xDiff = playerPosition.X - monsterPosition.X; - var yDiff = playerPosition.Y - monsterPosition.Y; - var monsterDistanceSquare = (xDiff * xDiff + yDiff * yDiff); - - if (monsterDistanceSquare <= maxDistanceSquare) - { - mobCount++; - } - - if (mobCount >= minimumMonsterCount) - { - if (Settings.Debug) - { - Log("NearbyMonstersCondition returning true because " + mobCount + " mobs valid monsters were found nearby.", 2); - } - return true; - } - } - } else if (Settings.Debug) - { - Log("NearbyMonstersCondition returning false because mob list was invalid.", 2); - } - - if (Settings.Debug) - { - Log("NearbyMonstersCondition returning false because " + mobCount + " mobs valid monsters were found nearby.", 2); - } - return false; - } - - private PlayerFlask FindFlaskMatchingAnyAction(FlaskActions flaskAction, Boolean? instant = null, Boolean ignoreBuffs = false, Func> ignoreFlasksWithAction = null, Boolean isCleansing = false) - { - return FindFlaskMatchingAnyAction(new List { flaskAction }, instant, ignoreBuffs, ignoreFlasksWithAction, isCleansing); - } - - private PlayerFlask FindFlaskMatchingAnyAction(List flaskActions, Boolean? instant = null, Boolean ignoreBuffs = false, Func> ignoreFlasksWithAction = null, Boolean isCleansing = false) - { - var allFlasks = FlaskHelper.GetAllFlaskInfo(); - - // We have no flasks or settings for flasks? - if (allFlasks == null || Settings.FlaskSettings == null) - { - if (Settings.Debug) - { - if (allFlasks == null) - LogMessage(Name + ": No flasks to match against.", 5); - else if (Settings.FlaskSettings == null) - LogMessage(Name + ": Flask settings were null. Hopefully doesn't happen frequently.", 5); - } - - return null; - } - - if (Settings.Debug) - { - foreach (var flask in allFlasks) - { - LogMessage($"{Name}: Flask: {flask.Name} Slot: {flask.Index} Instant: {flask.InstantType} Action1: {flask.Action1} Action2: {flask.Action2}", 5); - } - } - - List ignoreFlaskActions = ignoreFlasksWithAction == null ? null : ignoreFlasksWithAction(); - - var flaskList = allFlasks - .Where(x => - Settings.FlaskSettings[x.Index].Enabled - && FlaskHasAvailableAction(flaskActions, ignoreFlaskActions, x) - && FlaskHelper.CanUsePotion(x, Settings.FlaskSettings[x.Index].ReservedUses, isCleansing) - && FlaskMatchesInstant(x, instant) - && (ignoreBuffs || MissingFlaskBuff(x)) - ).OrderByDescending(x => flaskActions.Contains(x.Action1)).ThenByDescending(x => x.TotalUses - Settings.FlaskSettings[x.Index].ReservedUses).ToList(); - - if (flaskList == null || !flaskList.Any()) - { - if (Settings.Debug) - LogError(Name + ": No flasks found for action: (instant:" + instant + ") " + flaskActions[0], 1); - return null; - } - - if (Settings.Debug) - LogMessage(Name + ": Flask(s) found for action: " + flaskActions[0] + " Flask Count: " + flaskList.Count(), 1); - - return flaskList.FirstOrDefault(); - } - - private bool FlaskHasAvailableAction(List flaskActions, List ignoreFlaskActions, PlayerFlask flask) - { - return flaskActions.Any(x => x == flask.Action1 || x == flask.Action2) - && (ignoreFlaskActions == null || !ignoreFlaskActions.Any(x => x == flask.Action1 || x == flask.Action2)); - } - - private bool FlaskMatchesInstant(PlayerFlask playerFlask, Boolean? instant) - { - return instant == null - || instant == false && CanUseFlaskAsRegen(playerFlask) - || instant == true && CanUseFlaskAsInstant(playerFlask); - } - - private bool CanUseFlaskAsInstant(PlayerFlask playerFlask) - { - // If the flask is instant, no special logic needed - return playerFlask.InstantType == FlaskInstantType.Partial - || playerFlask.InstantType == FlaskInstantType.Full - || playerFlask.InstantType == FlaskInstantType.LowLife && PlayerHelper.isHealthBelowPercentage(35); - } - - private bool CanUseFlaskAsRegen(PlayerFlask playerFlask) - { - return playerFlask.InstantType == FlaskInstantType.None - || playerFlask.InstantType == FlaskInstantType.Partial && !Settings.ForceBubblingAsInstantOnly - || playerFlask.InstantType == FlaskInstantType.LowLife && !Settings.ForcePanickedAsInstantOnly; - } - - private bool MissingFlaskBuff(PlayerFlask playerFlask) - { - return !PlayerHelper.playerHasBuffs(new List { playerFlask.BuffString1 }) || !PlayerHelper.playerHasBuffs(new List { playerFlask.BuffString2 }); - } - - private Decorator CreateCurableDebuffDecorator(Dictionary dictionary, Composite child, Func minCharges = null) - { - return new Decorator((x => - { - var life = GameController.Game.IngameState.Data.LocalPlayer.GetComponent(); - if (life == null) return false; - var buffs = life.Buffs; - foreach (var buff in buffs) - { - if (float.IsInfinity(buff.Timer)) - continue; - - int filterId = 0; - if (dictionary.TryGetValue(buff.Name, out filterId)) - { - // I'm not sure what the values are here, but this is the effective logic from the old plugin - return (filterId == 0 || filterId != 1) && (minCharges == null || buff.Charges >= minCharges()); - } - } - return false; - }), child); - } - - public override void Render() - { - base.Render(); - if (!Settings.Enable.Value) return; - if (Settings.BossingModeToggle && Settings.BossingModeHotkey.PressedOnce()) - { - Settings.BossingMode = !Settings.BossingMode; - if (Settings.BossingMode) LogMessage("BossingMode Activated! No automatic flasking until disabled.", 5, Color.Red); - else LogMessage("BossingMode deactivated.", 5); - } - } - - public override void DrawSettings() - { - //base.DrawSettings(); - - ImGuiTreeNodeFlags collapsingHeaderFlags = ImGuiTreeNodeFlags.CollapsingHeader; - - if (ImGui.TreeNodeEx("Plugin Options", collapsingHeaderFlags)) - { - Settings.EnableInHideout.Value = ImGuiExtension.Checkbox("Enable in Hideout", Settings.EnableInHideout); - ImGui.Separator(); - Settings.TicksPerSecond.Value = ImGuiExtension.IntSlider("Ticks Per Second", Settings.TicksPerSecond); ImGuiExtension.ToolTipWithText("(?)", "Determines how many times the plugin checks flasks every second.\nLower for less resources, raise for faster response (but higher chance to chug potions)."); - ImGui.Separator(); - Settings.Debug.Value = ImGuiExtension.Checkbox("Debug Mode", Settings.Debug); - ImGui.Separator(); - Settings.BossingModeToggle.Value = ImGuiExtension.Checkbox("Disable Defensive and Offensive Flasking", Settings.BossingModeToggle); - ImGui.Separator(); - Settings.BossingModeHotkey.Value = ImGuiExtension.HotkeySelector("BossingModeHotkey", Settings.BossingModeHotkey.Value); - ImGui.TreePop(); - } - - - if (ImGui.TreeNodeEx("Flask Options", collapsingHeaderFlags)) - { - if (ImGui.TreeNode("Individual Flask Settings")) - { - for (int i = 0; i < 5; i++) - { - FlaskSetting currentFlask = Settings.FlaskSettings[i]; - if (ImGui.TreeNode("Flask " + (i + 1) + " Settings")) - { - currentFlask.Enabled.Value = ImGuiExtension.Checkbox("Enable", currentFlask.Enabled); - currentFlask.Hotkey.Value = ImGuiExtension.HotkeySelector("Hotkey", currentFlask.Hotkey); - currentFlask.ReservedUses.Value = - ImGuiExtension.IntSlider("Reserved Uses", currentFlask.ReservedUses); - ImGuiExtension.ToolTipWithText("(?)", - "The absolute number of uses reserved on a flask.\nSet to 1 to always have 1 use of the flask available for manual use."); - ImGui.TreePop(); - } - } - - ImGui.TreePop(); - } - - if (ImGui.TreeNode("Health and Mana")) - { - Settings.AutoFlask.Value = ImGuiExtension.Checkbox("Enable", Settings.AutoFlask); - - ImGuiExtension.SpacedTextHeader("Settings"); - Settings.ForceBubblingAsInstantOnly.Value = - ImGuiExtension.Checkbox("Force Bubbling as Instant only", Settings.ForceBubblingAsInstantOnly); - ImGuiExtension.ToolTipWithText("(?)", - "When enabled, flasks with the Bubbling mod will only be used as an instant flask."); - Settings.ForcePanickedAsInstantOnly.Value = - ImGuiExtension.Checkbox("Force Panicked as Instant only", Settings.ForcePanickedAsInstantOnly); - ImGuiExtension.ToolTipWithText("(?)", - "When enabled, flasks with the Panicked mod will only be used as an instant flask. \nNote, Panicked will not be used until under 35%% with this enabled."); // - ImGuiExtension.SpacedTextHeader("Health Flask"); - Settings.HPPotion.Value = ImGuiExtension.IntSlider("Min Life % Auto HP Flask", Settings.HPPotion); - Settings.InstantHPPotion.Value = - ImGuiExtension.IntSlider("Min Life % Auto Instant HP Flask", Settings.InstantHPPotion); - Settings.DisableLifeSecUse.Value = - ImGuiExtension.Checkbox("Disable Life/Hybrid Flask Offensive/Defensive Usage", - Settings.DisableLifeSecUse); - - ImGuiExtension.SpacedTextHeader("Mana Flask"); - ImGui.Spacing(); - Settings.ManaPotion.Value = - ImGuiExtension.IntSlider("Min Mana % Auto Mana Flask", Settings.ManaPotion); - Settings.InstantManaPotion.Value = ImGuiExtension.IntSlider("Min Mana % Auto Instant MP Flask", - Settings.InstantManaPotion); - Settings.MinManaFlask.Value = - ImGuiExtension.IntSlider("Min Mana Auto Mana Flask", Settings.MinManaFlask); - ImGui.TreePop(); - } - - if (ImGui.TreeNode("Remove Ailments")) - { - Settings.RemAilment.Value = ImGuiExtension.Checkbox("Enable", Settings.RemAilment); - - ImGuiExtension.SpacedTextHeader("Ailments"); - Settings.RemFrozen.Value = ImGuiExtension.Checkbox("Frozen", Settings.RemFrozen); - ImGui.SameLine(); - Settings.RemBurning.Value = ImGuiExtension.Checkbox("Burning", Settings.RemBurning); - Settings.RemShocked.Value = ImGuiExtension.Checkbox("Shocked", Settings.RemShocked); - ImGui.SameLine(); - Settings.RemCurse.Value = ImGuiExtension.Checkbox("Cursed", Settings.RemCurse); - Settings.RemPoison.Value = ImGuiExtension.Checkbox("Poison", Settings.RemPoison); - ImGui.SameLine(); - Settings.RemBleed.Value = ImGuiExtension.Checkbox("Bleed", Settings.RemBleed); - Settings.CorruptCount.Value = - ImGuiExtension.IntSlider("Corrupting Blood Stacks", Settings.CorruptCount); - ImGui.TreePop(); - } - - if (ImGui.TreeNode("Speed Flasks")) - { - Settings.SpeedFlaskEnable.Value = ImGuiExtension.Checkbox("Enable", Settings.SpeedFlaskEnable); - - ImGuiExtension.SpacedTextHeader("Flasks"); - Settings.QuicksilverFlaskEnable.Value = - ImGuiExtension.Checkbox("Quicksilver Flask", Settings.QuicksilverFlaskEnable); - Settings.SilverFlaskEnable.Value = - ImGuiExtension.Checkbox("Silver Flask", Settings.SilverFlaskEnable); - - ImGuiExtension.SpacedTextHeader("Settings"); - Settings.MinMsPlayerMoving.Value = - ImGuiExtension.IntSlider("Milliseconds Spent Moving", Settings.MinMsPlayerMoving); - ImGuiExtension.ToolTipWithText("(?)", - "Milliseconds spent moving before flask will be used.\n1000 milliseconds = 1 second"); - ImGui.TreePop(); - } - - if (ImGui.TreeNode("Defensive Flasks")) - { - Settings.DefensiveFlaskEnable.Value = - ImGuiExtension.Checkbox("Enable", Settings.DefensiveFlaskEnable); - ImGui.Spacing(); - ImGui.Separator(); - Settings.HPPercentDefensive.Value = - ImGuiExtension.IntSlider("Min Life %", Settings.HPPercentDefensive); - Settings.ESPercentDefensive.Value = - ImGuiExtension.IntSlider("Min ES %", Settings.ESPercentDefensive); - Settings.OffensiveAsDefensiveEnable.Value = - ImGuiExtension.Checkbox("Use offensive flasks for defense", - Settings.OffensiveAsDefensiveEnable); - ImGui.Separator(); - - Settings.DefensiveMonsterCount.Value = - ImGuiExtension.IntSlider("Monster Count", Settings.DefensiveMonsterCount); - Settings.DefensiveMonsterDistance.Value = - ImGuiExtension.IntSlider("Monster Distance", Settings.DefensiveMonsterDistance); - Settings.DefensiveCountNormalMonsters.Value = - ImGuiExtension.Checkbox("Normal Monsters", Settings.DefensiveCountNormalMonsters); - Settings.DefensiveCountRareMonsters.Value = - ImGuiExtension.Checkbox("Rare Monsters", Settings.DefensiveCountRareMonsters); - Settings.DefensiveCountMagicMonsters.Value = - ImGuiExtension.Checkbox("Magic Monsters", Settings.DefensiveCountMagicMonsters); - Settings.DefensiveCountUniqueMonsters.Value = - ImGuiExtension.Checkbox("Unique Monsters", Settings.DefensiveCountUniqueMonsters); - Settings.DefensiveIgnoreFullHealthUniqueMonsters.Value = - ImGuiExtension.Checkbox("Ignore Full Health Unique Monsters", Settings.DefensiveIgnoreFullHealthUniqueMonsters); - ImGui.TreePop(); - } - - if (ImGui.TreeNode("Offensive Flasks")) - { - Settings.OffensiveFlaskEnable.Value = - ImGuiExtension.Checkbox("Enable", Settings.OffensiveFlaskEnable); - ImGui.Spacing(); - ImGui.Separator(); - Settings.HPPercentOffensive.Value = - ImGuiExtension.IntSlider("Min Life %", Settings.HPPercentOffensive); - Settings.ESPercentOffensive.Value = - ImGuiExtension.IntSlider("Min ES %", Settings.ESPercentOffensive); - ImGui.Separator(); - Settings.OffensiveMonsterCount.Value = - ImGuiExtension.IntSlider("Monster Count", Settings.OffensiveMonsterCount); - Settings.OffensiveMonsterDistance.Value = - ImGuiExtension.IntSlider("Monster Distance", Settings.OffensiveMonsterDistance); - Settings.OffensiveCountNormalMonsters.Value = - ImGuiExtension.Checkbox("Normal Monsters", Settings.OffensiveCountNormalMonsters); - Settings.OffensiveCountRareMonsters.Value = - ImGuiExtension.Checkbox("Rare Monsters", Settings.OffensiveCountRareMonsters); - Settings.OffensiveCountMagicMonsters.Value = - ImGuiExtension.Checkbox("Magic Monsters", Settings.OffensiveCountMagicMonsters); - Settings.OffensiveCountUniqueMonsters.Value = - ImGuiExtension.Checkbox("Unique Monsters", Settings.OffensiveCountUniqueMonsters); - Settings.OffensiveIgnoreFullHealthUniqueMonsters.Value = - ImGuiExtension.Checkbox("Ignore Full Health Unique Monsters", Settings.OffensiveIgnoreFullHealthUniqueMonsters); - ImGui.TreePop(); - } - - ImGui.TreePop(); - } - } - - public override void EntityAdded(Entity entityWrapper) - { - if (entityWrapper.HasComponent()) - { - lock (LoadedMonstersLock) - { - LoadedMonsters.Add(entityWrapper); - } - } - } - - public override void EntityRemoved(Entity entityWrapper) - { - lock (LoadedMonstersLock) - { - LoadedMonsters.Remove(entityWrapper); - } - } - } +using TreeRoutine.DefaultBehaviors.Actions; +using TreeRoutine.DefaultBehaviors.Helpers; +using TreeRoutine.FlaskComponents; +using TreeRoutine.Routine.BasicFlaskRoutine.Flask; +using System; +using System.Collections.Generic; +using SharpDX; +using System.Linq; +using TreeRoutine.Menu; +using ImGuiNET; +using System.Diagnostics; +using ExileCore; +using ExileCore.PoEMemory.Components; +using ExileCore.PoEMemory.MemoryObjects; +using ExileCore.Shared; +using ExileCore.Shared.Enums; +using TreeRoutine.TreeSharp; + +namespace TreeRoutine.Routine.BasicFlaskRoutine +{ + public class BasicFlaskRoutine : BaseTreeRoutinePlugin + { + public BasicFlaskRoutine() : base() + { + + } + + public Composite Tree { get; set; } + private Coroutine TreeCoroutine { get; set; } + public Object LoadedMonstersLock { get; set; } = new Object(); + public List LoadedMonsters { get; protected set; } = new List(); + + + private KeyboardHelper KeyboardHelper { get; set; } = null; + + private Stopwatch PlayerMovingStopwatch { get; set; } = new Stopwatch(); + + private const string basicFlaskRoutineChecker = "BasicFlaskRoutine Checker"; + + private readonly List travelingSkills = new List() + { + "Blink Arrow", + "Bodyswap", + "Dash", + "Flame Dash", + "Frostblink", + "Leap Slam", + "Lightning Warp", + "Mirror Arrow", + "Phase Run", + "Shield Charge", + "Smoke Mine", + "Vaal Lightning Warp", + "Whirling Blades", + "Withering Step" + }; + + + + public override bool Initialise() + { + base.Initialise(); + + Name = "BasicFlaskRoutine"; + KeyboardHelper = new KeyboardHelper(GameController); + + Tree = CreateTree(); + + // Add this as a coroutine for this plugin + Settings.Enable.OnValueChanged += (sender, b) => + { + if (b) + { + if (Core.ParallelRunner.FindByName(basicFlaskRoutineChecker) == null) InitCoroutine(); + TreeCoroutine?.Resume(); + } + else + TreeCoroutine?.Pause(); + + }; + InitCoroutine(); + + Settings.TicksPerSecond.OnValueChanged += (sender, b) => + { + UpdateCoroutineWaitRender(); + }; + + return true; + } + + private void InitCoroutine() + { + TreeCoroutine = new Coroutine(() => TickTree(Tree), new WaitTime(1000 / Settings.TicksPerSecond), this, "BasicFlaskRoutine Tree"); + Core.ParallelRunner.Run(TreeCoroutine); + } + + private void UpdateCoroutineWaitRender() + { + TreeCoroutine.UpdateCondition(new WaitTime(1000 / Settings.TicksPerSecond)); + } + + protected override void UpdateCache() + { + base.UpdateCache(); + + UpdatePlayerMovingStopwatch(); + } + + private void UpdatePlayerMovingStopwatch() + { + var player = GameController.Player.GetComponent(); + if (player != null && player.Address != 0 && player.isMoving + || (player.isAttacking && isTravelingSkill(player.CurrentAction.Skill))) + { + if (!PlayerMovingStopwatch.IsRunning) + PlayerMovingStopwatch.Start(); + } + else + { + PlayerMovingStopwatch.Reset(); + } + } + + private bool isTravelingSkill(ActorSkill skill) + { + return travelingSkills.Contains(skill.EffectsPerLevel.SkillGemWrapper.ActiveSkill.DisplayName); + } + + private Composite CreateTree() + { + return new Decorator(x => TreeHelper.CanTick() && !PlayerHelper.isPlayerDead() && + (!Cache.InHideout || Settings.EnableInHideout) && PlayerHelper.playerDoesNotHaveAnyOfBuffs(new List() { "grace_period" }), + new PrioritySelector + ( + new Decorator(x => Settings.AutoFlask, + new PrioritySelector( + CreateInstantHPPotionComposite(), + CreateHPPotionComposite(), + CreateInstantManaPotionComposite(), + CreateManaPotionComposite() + ) + ), + CreateAilmentPotionComposite(), + CreateDefensivePotionComposite(), + CreateSpeedPotionComposite(), + CreateOffensivePotionComposite(), + CreateUseWhenFlaskFullComposite() + ) + ); + } + + private Composite CreateInstantHPPotionComposite() + { + return new Decorator((x => !Settings.BossingMode && PlayerHelper.isHealthBelowPercentage(Settings.InstantHPPotion) + || (Settings.AllocatedSupremeDecadence && PlayerHelper.isEnergyShieldBelowPercentage(Settings.InstantESPotion)) + ), + new PrioritySelector( + CreateUseFlaskAction(FlaskActions.Life, true, true), + CreateUseFlaskAction(FlaskActions.Hybrid, true, true), + CreateUseFlaskAction(FlaskActions.Life), + CreateUseFlaskAction(FlaskActions.Hybrid) + ) + ); + + } + + private Composite CreateHPPotionComposite() + { + return new Decorator((x => !Settings.BossingMode && PlayerHelper.isHealthBelowPercentage(Settings.HPPotion) + || (Settings.AllocatedSupremeDecadence && PlayerHelper.isEnergyShieldBelowPercentage(Settings.ESPotion)) + ), + new Decorator((x => PlayerHelper.playerDoesNotHaveAnyOfBuffs(new List() { "flask_effect_life" })), + new PrioritySelector( + CreateUseFlaskAction(FlaskActions.Life, false), + CreateUseFlaskAction(FlaskActions.Hybrid, false) + ) + ) + ); + } + + private Composite CreateInstantManaPotionComposite() + { + return new Decorator((x => PlayerHelper.isManaBelowPercentage(Settings.InstantManaPotion)), + new PrioritySelector( + CreateUseFlaskAction(FlaskActions.Mana, true, true), + CreateUseFlaskAction(FlaskActions.Hybrid, true, true) + ) + ); + } + + private Composite CreateManaPotionComposite() + { + return new Decorator((x => PlayerHelper.isManaBelowPercentage(Settings.ManaPotion) || PlayerHelper.isManaBelowValue(Settings.MinManaFlask)), + new Decorator((x => PlayerHelper.playerDoesNotHaveAnyOfBuffs(new List() { "flask_effect_mana", "flask_effect_mana_not_removed_when_full" })), + new PrioritySelector( + CreateUseFlaskAction(FlaskActions.Mana, false), + CreateUseFlaskAction(FlaskActions.Hybrid, false) + ) + ) + ); + } + + private Composite CreateSpeedPotionComposite() + { + return new Decorator((x => Settings.SpeedFlaskEnable + && (Settings.MinMsPlayerMoving <= PlayerMovingStopwatch.ElapsedMilliseconds + || Settings.UseWhileCycloning + && IsCycloning() + && (Settings.CycloningMonsterCount == 0 + || HasEnoughNearbyMonsters(Settings.CycloningMonsterCount, + Settings.CycloningMonsterDistance, + Settings.CycloningCountNormalMonsters, + Settings.CycloningCountRareMonsters, + Settings.CycloningCountMagicMonsters, + Settings.CycloningCountUniqueMonsters, + Settings.CycloningIgnoreFullHealthUniqueMonsters))) + && (PlayerHelper.playerDoesNotHaveAnyOfBuffs(new List() { "flask_bonus_movement_speed", "flask_utility_sprint", "flask_utility_phase" }) + || (!Settings.SilverFlaskEnable + || PlayerHelper.playerDoesNotHaveAnyOfBuffs(new List() { "flask_utility_haste" })))), + new PrioritySelector( + new Decorator((x => Settings.QuicksilverFlaskEnable), CreateUseFlaskAction(FlaskActions.Speedrun)), + new Decorator((x => Settings.SilverFlaskEnable), CreateUseFlaskAction(FlaskActions.OFFENSE_AND_SPEEDRUN)) + ) + ); + } + + private Composite CreateDefensivePotionComposite() + { + return new Decorator((x => Settings.DefensiveFlaskEnable && !Settings.BossingMode && + (PlayerHelper.isHealthBelowPercentage(Settings.HPPercentDefensive) || PlayerHelper.isEnergyShieldBelowPercentage(Settings.ESPercentDefensive) || + Settings.DefensiveMonsterCount > 0 && HasEnoughNearbyMonsters(Settings.DefensiveMonsterCount, Settings.DefensiveMonsterDistance, Settings.DefensiveCountNormalMonsters, Settings.DefensiveCountRareMonsters, Settings.DefensiveCountMagicMonsters, Settings.DefensiveCountUniqueMonsters, Settings.DefensiveIgnoreFullHealthUniqueMonsters))), + new PrioritySelector( + CreateUseFlaskAction(FlaskActions.Defense), + new Decorator((x => Settings.OffensiveAsDefensiveEnable), CreateUseFlaskAction(new List { FlaskActions.OFFENSE_AND_SPEEDRUN, FlaskActions.Defense }, ignoreFlasksWithAction: (() => Settings.DisableLifeSecUse ? new List() { FlaskActions.Life, FlaskActions.Mana, FlaskActions.Hybrid } : null))) + ) + ); + } + + private Composite CreateOffensivePotionComposite() + { + return new PrioritySelector( + new Decorator((x => Settings.OffensiveFlaskEnable && !Settings.BossingMode && + (PlayerHelper.isHealthBelowPercentage(Settings.HPPercentOffensive) || PlayerHelper.isEnergyShieldBelowPercentage(Settings.ESPercentOffensive) || Settings.OffensiveMonsterCount > 0 && HasEnoughNearbyMonsters(Settings.OffensiveMonsterCount, Settings.OffensiveMonsterDistance, Settings.OffensiveCountNormalMonsters, Settings.OffensiveCountRareMonsters, Settings.OffensiveCountMagicMonsters, Settings.OffensiveCountUniqueMonsters, Settings.OffensiveIgnoreFullHealthUniqueMonsters))), + CreateUseFlaskAction(new List { FlaskActions.Offense, FlaskActions.OFFENSE_AND_SPEEDRUN }, ignoreFlasksWithAction: (() => Settings.DisableLifeSecUse ? new List() { FlaskActions.Life, FlaskActions.Mana, FlaskActions.Hybrid } : null))) + ); + } + + private Composite CreateUseWhenFlaskFullComposite() + { + // Fill a composite of decors based on each flask slot to use + Composite[] composites = new Composite[Settings.FlaskSettings.Length]; + for (int i = 0; i < composites.Length; i++) + { + // Localize the scope of i (for those who don't understand how lamba functions handle scopes) + int index = i; + + // Use flask when full and at least 1 use + CanRunDecoratorDelegate checkFlaskFull = x => + { + var flasks = FlaskHelper.GetAllFlaskInfo(); + if (flasks == null) + { + return false; + } + + return flasks + .Where(f => f != null && f.Index == index) + .Any(f => f.IsFull && f.TotalUses > 0); + }; + + // Press hotkey on action + var useFlaskAction = new UseHotkeyAction(KeyboardHelper, (x) => Settings.FlaskSettings[index].Hotkey); + + // Create decorator for use + var useFlaskWhenFull = new Decorator(checkFlaskFull, useFlaskAction); + + // Create decorator that first checks if enabled + var decor = new Decorator(x => Settings.FlaskSettings[index].Enabled && Settings.FlaskSettings[index].UseWhenChargesFilled, useFlaskWhenFull); + + // Set decor at that index + composites[index] = decor; + } + + // Return group of decor + return new Parallel(composites); + } + + private Composite CreateAilmentPotionComposite() + { + return new Decorator(x => Settings.RemAilment && !Settings.BossingMode, + new PrioritySelector( + new Decorator(x => Settings.RemBleed, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Bleeding, CreateUseFlaskAction(new List { FlaskActions.CorruptedBloodAndBleedImmune, FlaskActions.BleedImmune }, isCleansing: true))), + new Decorator(x => Settings.RemBurning, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Burning, CreateUseFlaskAction(FlaskActions.IgniteImmune, isCleansing: true))), + CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Corruption, CreateUseFlaskAction(FlaskActions.CorruptedBloodAndBleedImmune, isCleansing: true), () => Settings.CorruptCount, () => Settings.RemCorruptingBlood), + new Decorator(x => Settings.RemFrozen, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Frozen, CreateUseFlaskAction(FlaskActions.FreezeImmune, isCleansing: true))), + new Decorator(x => Settings.RemPoison, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Poisoned, CreateUseFlaskAction(FlaskActions.PoisonImmune, isCleansing: true))), + new Decorator(x => Settings.RemShocked, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Shocked, CreateUseFlaskAction(FlaskActions.ShockImmune, isCleansing: true))), + new Decorator(x => Settings.RemCurse, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.WeakenedSlowed, CreateUseFlaskAction(FlaskActions.CurseImmune, isCleansing: true))), + new Decorator(x => Settings.RemMaimed, CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Maimed, CreateUseFlaskAction(FlaskActions.MaimAndHinderImmune, isCleansing: true))), + CreateCurableDebuffDecorator(Cache.DebuffPanelConfig.Hindered, CreateUseFlaskAction(FlaskActions.MaimAndHinderImmune, isCleansing: true), () => Settings.HinderCount, () => Settings.RemHindered) + ) + ); + } + + private Composite CreateUseFlaskAction(FlaskActions flaskAction, Boolean? instant = null, Boolean ignoreBuffs = false, Func> ignoreFlasksWithAction = null, Boolean isCleansing = false) + { + return CreateUseFlaskAction(new List { flaskAction }, instant, ignoreBuffs, ignoreFlasksWithAction, isCleansing); + } + + private Composite CreateUseFlaskAction(List flaskActions, Boolean? instant = null, Boolean ignoreBuffs = false, Func> ignoreFlasksWithAction = null, Boolean isCleansing = false) + { + return new UseHotkeyAction(KeyboardHelper, x => + { + var foundFlask = FindFlaskMatchingAnyAction(flaskActions, instant, ignoreBuffs, ignoreFlasksWithAction, isCleansing); + + if (foundFlask == null) + { + return null; + } + + return Settings.FlaskSettings[foundFlask.Index].Hotkey; + }); + } + + private Boolean HasEnoughNearbyMonsters(int minimumMonsterCount, int maxDistance, bool countNormal, bool countRare, bool countMagic, bool countUnique, bool ignoreUniqueIfFullHealth) + { + var mobCount = 0; + var maxDistanceSquare = maxDistance * maxDistance; + + var playerPosition = GameController.Player.Pos; + + if (LoadedMonsters != null) + { + List localLoadedMonsters = null; + lock (LoadedMonstersLock) + { + localLoadedMonsters = new List(LoadedMonsters); + } + + // Make sure we create our own list to iterate as we may be adding/removing from the list + foreach (var monster in localLoadedMonsters) + { + if (!monster.HasComponent() || !monster.IsValid || !monster.IsAlive || !monster.IsHostile) + continue; + + var monsterType = monster.GetComponent()?.Rarity ?? null; + if (monsterType == null) continue; + // Don't count this monster type if we are ignoring it + if (monsterType == MonsterRarity.White && !countNormal + || monsterType == MonsterRarity.Rare && !countRare + || monsterType == MonsterRarity.Magic && !countMagic + || monsterType == MonsterRarity.Unique && !countUnique) + continue; + + if (monsterType == MonsterRarity.Unique && ignoreUniqueIfFullHealth) + { + Life monsterLife = monster.GetComponent(); + if (monsterLife == null) + continue; + + if (monsterLife.HPPercentage > 0.995) + continue; + } + + var monsterPosition = monster.Pos; + + var xDiff = playerPosition.X - monsterPosition.X; + var yDiff = playerPosition.Y - monsterPosition.Y; + var monsterDistanceSquare = (xDiff * xDiff + yDiff * yDiff); + + if (monsterDistanceSquare <= maxDistanceSquare) + { + mobCount++; + } + + if (mobCount >= minimumMonsterCount) + { + if (Settings.Debug) + { + Log("NearbyMonstersCondition returning true because " + mobCount + " mobs valid monsters were found nearby.", 2); + } + return true; + } + } + } + else if (Settings.Debug) + { + Log("NearbyMonstersCondition returning false because mob list was invalid.", 2); + } + + if (Settings.Debug) + { + Log("NearbyMonstersCondition returning false because " + mobCount + " mobs valid monsters were found nearby.", 2); + } + return false; + } + + private PlayerFlask FindFlaskMatchingAnyAction(FlaskActions flaskAction, Boolean? instant = null, Boolean ignoreBuffs = false, Func> ignoreFlasksWithAction = null, Boolean isCleansing = false) + { + return FindFlaskMatchingAnyAction(new List { flaskAction }, instant, ignoreBuffs, ignoreFlasksWithAction, isCleansing); + } + + private PlayerFlask FindFlaskMatchingAnyAction(List flaskActions, Boolean? instant = null, Boolean ignoreBuffs = false, Func> ignoreFlasksWithAction = null, Boolean isCleansing = false) + { + var allFlasks = FlaskHelper.GetAllFlaskInfo(); + + // We have no flasks or settings for flasks? + if (allFlasks == null || Settings.FlaskSettings == null) + { + if (Settings.Debug) + { + if (allFlasks == null) + LogMessage(Name + ": No flasks to match against.", 5); + else if (Settings.FlaskSettings == null) + LogMessage(Name + ": Flask settings were null. Hopefully doesn't happen frequently.", 5); + } + + return null; + } + + if (Settings.Debug) + { + foreach (var flask in allFlasks) + { + LogMessage($"{Name}: Flask: {flask.Name} Slot: {flask.Index} Instant: {flask.InstantType} Action1: {flask.Action1} Action2: {flask.Action2}", 5); + } + } + + List ignoreFlaskActions = ignoreFlasksWithAction == null ? null : ignoreFlasksWithAction(); + + var flaskList = allFlasks + .Where(x => + Settings.FlaskSettings[x.Index].Enabled + && FlaskHasAvailableAction(flaskActions, ignoreFlaskActions, x) + && FlaskHelper.CanUsePotion(x, Settings.FlaskSettings[x.Index].ReservedUses, isCleansing) + && FlaskMatchesInstant(x, instant) + && (ignoreBuffs || MissingFlaskBuff(x)) + ).OrderByDescending(x => flaskActions.Contains(x.Action1)).ThenByDescending(x => x.TotalUses - Settings.FlaskSettings[x.Index].ReservedUses).ToList(); + + if (flaskList == null || !flaskList.Any()) + { + if (Settings.Debug) + LogError(Name + ": No flasks found for action: (instant:" + instant + ") " + flaskActions[0], 1); + return null; + } + + if (Settings.Debug) + LogMessage(Name + ": Flask(s) found for action: " + flaskActions[0] + " Flask Count: " + flaskList.Count(), 1); + + return flaskList.FirstOrDefault(); + } + + private bool FlaskHasAvailableAction(List flaskActions, List ignoreFlaskActions, PlayerFlask flask) + { + return flaskActions.Any(x => x == flask.Action1 || x == flask.Action2) + && (ignoreFlaskActions == null || !ignoreFlaskActions.Any(x => x == flask.Action1 || x == flask.Action2)); + } + + private bool FlaskMatchesInstant(PlayerFlask playerFlask, Boolean? instant) + { + return instant == null + || instant == false && CanUseFlaskAsRegen(playerFlask) + || instant == true && CanUseFlaskAsInstant(playerFlask); + } + + private bool CanUseFlaskAsInstant(PlayerFlask playerFlask) + { + // If the flask is instant, no special logic needed + return playerFlask.InstantType == FlaskInstantType.Partial + || playerFlask.InstantType == FlaskInstantType.Full + || (playerFlask.InstantType == FlaskInstantType.LowLife && (PlayerHelper.isHealthBelowPercentage(50) + || Settings.AllocatedSupremeDecadence && IsReallyLowLife())); + } + + private bool CanUseFlaskAsRegen(PlayerFlask playerFlask) + { + return playerFlask.InstantType == FlaskInstantType.None + || playerFlask.InstantType == FlaskInstantType.Partial && !Settings.ForceBubblingAsInstantOnly + || playerFlask.InstantType == FlaskInstantType.LowLife && !Settings.ForcePanickedAsInstantOnly; + } + + private bool MissingFlaskBuff(PlayerFlask playerFlask) + { + return !PlayerHelper.playerHasBuffs(new List { playerFlask.BuffString1 }) || !PlayerHelper.playerHasBuffs(new List { playerFlask.BuffString2 }); + } + + private bool IsCycloning() + { + try + { + var buffs = GameController.Game.IngameState.Data.LocalPlayer.GetComponent().BuffsList; + + foreach (var buff in buffs) + if (buff.Name.ToLower().Equals("cyclone_channelled_stage")) + return float.IsInfinity(buff.Timer); + } + catch + { + if (Settings.Debug) + LogError("BasicFlaskRoutine: Using Speed Flasks while Cycloning is enabled, but cannot get player buffs. Try to update PoeHUD.", 5); + } + + return false; + } + + // When life is reserved, IngameState.Data.LocalPlayer.GetComponent().HPPercentage returns an invalid value. + private bool IsReallyLowLife() + { + var playerLife = GameController.Game.IngameState.Data.LocalPlayer.GetComponent(); + return (playerLife.CurHP / playerLife.MaxHP) * 100 < 50; + } + + private Decorator CreateCurableDebuffDecorator(Dictionary dictionary, Composite child, Func minCharges = null, Func isEnabled = null) + { + return new Decorator((x => + { + if (isEnabled != null && !isEnabled()) + { + return false; + } + + var buffs = GameController.Game.IngameState.Data.LocalPlayer.GetComponent().BuffsList; + if (buffs == null) return false; + foreach (var buff in buffs) + { + if (float.IsInfinity(buff.Timer)) + continue; + + int filterId = 0; + if (dictionary.TryGetValue(buff.Name, out filterId)) + { + // I'm not sure what the values are here, but this is the effective logic from the old plugin + return (filterId == 0 || filterId != 1) && (minCharges == null || buff.Charges >= minCharges()); + } + } + return false; + }), child); + } + + public override void Render() + { + base.Render(); + if (!Settings.Enable.Value) return; + if (Settings.BossingModeToggle && Settings.BossingModeHotkey.PressedOnce()) + { + Settings.BossingMode = !Settings.BossingMode; + if (Settings.BossingMode) LogMessage("BossingMode Activated! No automatic flasking until disabled.", 5, Color.Red); + else LogMessage("BossingMode deactivated.", 5); + } + } + + public override void DrawSettings() + { + //base.DrawSettings(); + + ImGuiTreeNodeFlags collapsingHeaderFlags = ImGuiTreeNodeFlags.CollapsingHeader; + + if (ImGui.TreeNodeEx("Plugin Options", collapsingHeaderFlags)) + { + Settings.EnableInHideout.Value = ImGuiExtension.Checkbox("Enable in Hideout", Settings.EnableInHideout); + ImGui.Separator(); + Settings.TicksPerSecond.Value = ImGuiExtension.IntSlider("Ticks Per Second", Settings.TicksPerSecond); + ImGuiExtension.ToolTipWithText("(?)", "Determines how many times the plugin checks flasks every second.\nLower for less resources, raise for faster response (but higher chance to chug potions)."); + ImGui.Separator(); + Settings.Debug.Value = ImGuiExtension.Checkbox("Debug Mode", Settings.Debug); + ImGui.Separator(); + Settings.BossingModeToggle.Value = ImGuiExtension.Checkbox("Disable Defensive and Offensive Flasking", Settings.BossingModeToggle); + ImGui.Separator(); + Settings.BossingModeHotkey.Value = ImGuiExtension.HotkeySelector("BossingModeHotkey", Settings.BossingModeHotkey.Value); + ImGui.TreePop(); + } + + + if (ImGui.TreeNodeEx("Flask Options", collapsingHeaderFlags)) + { + if (ImGui.TreeNode("Individual Flask Settings")) + { + for (int i = 0; i < 5; i++) + { + FlaskSetting currentFlask = Settings.FlaskSettings[i]; + if (ImGui.TreeNode("Flask " + (i + 1) + " Settings")) + { + currentFlask.Enabled.Value = ImGuiExtension.Checkbox("Enable", currentFlask.Enabled); + currentFlask.UseWhenChargesFilled.Value = ImGuiExtension.Checkbox("Use when Charges Reach Full (instead of relying on enchant)", currentFlask.UseWhenChargesFilled); + currentFlask.Hotkey.Value = ImGuiExtension.HotkeySelector("Hotkey", currentFlask.Hotkey); + currentFlask.ReservedUses.Value = ImGuiExtension.IntSlider("Reserved Uses", currentFlask.ReservedUses); + ImGuiExtension.ToolTipWithText("(?)", "The absolute number of uses reserved on a flask.\nSet to 1 to always have 1 use of the flask available for manual use."); + ImGui.TreePop(); + } + } + + ImGui.TreePop(); + } + + if (ImGui.TreeNode("Health and Mana")) + { + Settings.AutoFlask.Value = ImGuiExtension.Checkbox("Enable", Settings.AutoFlask); + + ImGuiExtension.SpacedTextHeader("Settings"); + Settings.ForceBubblingAsInstantOnly.Value = + ImGuiExtension.Checkbox("Force Bubbling as Instant only", Settings.ForceBubblingAsInstantOnly); + ImGuiExtension.ToolTipWithText("(?)", + "When enabled, flasks with the Bubbling mod will only be used as an instant flask."); + Settings.ForcePanickedAsInstantOnly.Value = + ImGuiExtension.Checkbox("Force Panicked as Instant only", Settings.ForcePanickedAsInstantOnly); + ImGuiExtension.ToolTipWithText("(?)", + "When enabled, flasks with the Panicked mod will only be used as an instant flask. \nNote, Panicked will not be used until under 35%% with this enabled."); // + ImGuiExtension.SpacedTextHeader("Health Flask"); + Settings.HPPotion.Value = ImGuiExtension.IntSlider("Min Life % Auto HP Flask", Settings.HPPotion); + Settings.InstantHPPotion.Value = + ImGuiExtension.IntSlider("Min Life % Auto Instant HP Flask", Settings.InstantHPPotion); + Settings.AllocatedSupremeDecadence.Value = + ImGuiExtension.Checkbox("Enable use Life/Hybrid Flasks to restore Energy Shield", Settings.AllocatedSupremeDecadence); + ImGuiExtension.ToolTipWithText("(?)", "When enabled, Life-recovery flasks will also be used to recovery Energy Shield." + + "\nWarning: Life/Hybrid Flasks without Remove Ailments affix will not be used when on full life " + + "\n (example: ~20 points non-Reserved Life is always equal full life) because it is game mechanics."); + Settings.ESPotion.Value = + ImGuiExtension.IntSlider("Min Energy Shield % Auto HP Flask", Settings.ESPotion); + Settings.InstantESPotion.Value = + ImGuiExtension.IntSlider("Min Energy Shield % Auto Instant HP Flask", Settings.InstantESPotion); + Settings.DisableLifeSecUse.Value = + ImGuiExtension.Checkbox("Disable Life/Hybrid Flask Offensive/Defensive Usage", + Settings.DisableLifeSecUse); + + ImGuiExtension.SpacedTextHeader("Mana Flask"); + ImGui.Spacing(); + Settings.ManaPotion.Value = + ImGuiExtension.IntSlider("Min Mana % Auto Mana Flask", Settings.ManaPotion); + Settings.InstantManaPotion.Value = ImGuiExtension.IntSlider("Min Mana % Auto Instant MP Flask", + Settings.InstantManaPotion); + Settings.MinManaFlask.Value = + ImGuiExtension.IntSlider("Min Mana Auto Mana Flask", Settings.MinManaFlask); + ImGui.TreePop(); + } + + if (ImGui.TreeNode("Remove Ailments")) + { + Settings.RemAilment.Value = ImGuiExtension.Checkbox("Enable", Settings.RemAilment); + + ImGuiExtension.SpacedTextHeader("Ailments"); + Settings.RemFrozen.Value = ImGuiExtension.Checkbox("Frozen", Settings.RemFrozen); + ImGui.SameLine(); + Settings.RemBurning.Value = ImGuiExtension.Checkbox("Burning", Settings.RemBurning); + + Settings.RemShocked.Value = ImGuiExtension.Checkbox("Shocked", Settings.RemShocked); + ImGui.SameLine(); + Settings.RemCurse.Value = ImGuiExtension.Checkbox("Cursed", Settings.RemCurse); + + Settings.RemPoison.Value = ImGuiExtension.Checkbox("Poisoned", Settings.RemPoison); + + Settings.RemBleed.Value = ImGuiExtension.Checkbox("Bleed", Settings.RemBleed); + ImGui.SameLine(); + Settings.RemCorruptingBlood.Value = ImGuiExtension.Checkbox("Corrupting Blood", Settings.RemCorruptingBlood); + Settings.CorruptCount.Value = ImGuiExtension.IntSlider("Corrupting Blood Stacks", Settings.CorruptCount); + + Settings.RemMaimed.Value = ImGuiExtension.Checkbox("Maimed", Settings.RemMaimed); + ImGui.SameLine(); + Settings.RemHindered.Value = ImGuiExtension.Checkbox("Hindered", Settings.RemHindered); + Settings.HinderCount.Value = ImGuiExtension.IntSlider("Hindered strength", Settings.HinderCount); + + ImGui.TreePop(); + } + + if (ImGui.TreeNode("Speed Flasks")) + { + Settings.SpeedFlaskEnable.Value = ImGuiExtension.Checkbox("Enable", Settings.SpeedFlaskEnable); + + ImGuiExtension.SpacedTextHeader("Flasks"); + Settings.QuicksilverFlaskEnable.Value = + ImGuiExtension.Checkbox("Quicksilver Flask", Settings.QuicksilverFlaskEnable); + Settings.SilverFlaskEnable.Value = + ImGuiExtension.Checkbox("Silver Flask", Settings.SilverFlaskEnable); + + ImGuiExtension.SpacedTextHeader("Settings"); + Settings.MinMsPlayerMoving.Value = + ImGuiExtension.IntSlider("Milliseconds Spent Moving", Settings.MinMsPlayerMoving); + ImGuiExtension.ToolTipWithText("(?)", + "Milliseconds spent moving before flask will be used.\n1000 milliseconds = 1 second"); + + ImGuiExtension.SpacedTextHeader("Cyclone"); + Settings.UseWhileCycloning.Value = + ImGuiExtension.Checkbox("Using Speed Flasks while Cycloning", Settings.UseWhileCycloning); + Settings.CycloningMonsterCount.Value = + ImGuiExtension.IntSlider("Monster Count", Settings.CycloningMonsterCount); + ImGuiExtension.ToolTipWithText("(?)", + "Set to 0 to disable."); + Settings.CycloningMonsterDistance.Value = + ImGuiExtension.IntSlider("Monster Distance", Settings.CycloningMonsterDistance); + Settings.CycloningCountNormalMonsters.Value = + ImGuiExtension.Checkbox("Normal Monsters", Settings.CycloningCountNormalMonsters); + Settings.CycloningCountMagicMonsters.Value = + ImGuiExtension.Checkbox("Magic Monsters", Settings.CycloningCountMagicMonsters); + Settings.CycloningCountRareMonsters.Value = + ImGuiExtension.Checkbox("Rare Monsters", Settings.CycloningCountRareMonsters); + Settings.CycloningCountUniqueMonsters.Value = + ImGuiExtension.Checkbox("Unique Monsters", Settings.CycloningCountUniqueMonsters); + Settings.CycloningIgnoreFullHealthUniqueMonsters.Value = + ImGuiExtension.Checkbox("Ignore Full Health Unique Monsters", Settings.CycloningIgnoreFullHealthUniqueMonsters); + ImGui.TreePop(); + } + + if (ImGui.TreeNode("Defensive Flasks")) + { + Settings.DefensiveFlaskEnable.Value = + ImGuiExtension.Checkbox("Enable", Settings.DefensiveFlaskEnable); + ImGui.Spacing(); + ImGui.Separator(); + Settings.HPPercentDefensive.Value = + ImGuiExtension.IntSlider("Min Life %", Settings.HPPercentDefensive); + Settings.ESPercentDefensive.Value = + ImGuiExtension.IntSlider("Min ES %", Settings.ESPercentDefensive); + Settings.OffensiveAsDefensiveEnable.Value = + ImGuiExtension.Checkbox("Use offensive flasks for defense", + Settings.OffensiveAsDefensiveEnable); + ImGui.Separator(); + + Settings.DefensiveMonsterCount.Value = + ImGuiExtension.IntSlider("Monster Count", Settings.DefensiveMonsterCount); + Settings.DefensiveMonsterDistance.Value = + ImGuiExtension.IntSlider("Monster Distance", Settings.DefensiveMonsterDistance); + Settings.DefensiveCountNormalMonsters.Value = + ImGuiExtension.Checkbox("Normal Monsters", Settings.DefensiveCountNormalMonsters); + Settings.DefensiveCountRareMonsters.Value = + ImGuiExtension.Checkbox("Rare Monsters", Settings.DefensiveCountRareMonsters); + Settings.DefensiveCountMagicMonsters.Value = + ImGuiExtension.Checkbox("Magic Monsters", Settings.DefensiveCountMagicMonsters); + Settings.DefensiveCountUniqueMonsters.Value = + ImGuiExtension.Checkbox("Unique Monsters", Settings.DefensiveCountUniqueMonsters); + Settings.DefensiveIgnoreFullHealthUniqueMonsters.Value = + ImGuiExtension.Checkbox("Ignore Full Health Unique Monsters", Settings.DefensiveIgnoreFullHealthUniqueMonsters); + ImGui.TreePop(); + } + + if (ImGui.TreeNode("Offensive Flasks")) + { + Settings.OffensiveFlaskEnable.Value = + ImGuiExtension.Checkbox("Enable", Settings.OffensiveFlaskEnable); + ImGui.Spacing(); + ImGui.Separator(); + Settings.HPPercentOffensive.Value = + ImGuiExtension.IntSlider("Min Life %", Settings.HPPercentOffensive); + Settings.ESPercentOffensive.Value = + ImGuiExtension.IntSlider("Min ES %", Settings.ESPercentOffensive); + ImGui.Separator(); + Settings.OffensiveMonsterCount.Value = + ImGuiExtension.IntSlider("Monster Count", Settings.OffensiveMonsterCount); + Settings.OffensiveMonsterDistance.Value = + ImGuiExtension.IntSlider("Monster Distance", Settings.OffensiveMonsterDistance); + Settings.OffensiveCountNormalMonsters.Value = + ImGuiExtension.Checkbox("Normal Monsters", Settings.OffensiveCountNormalMonsters); + Settings.OffensiveCountRareMonsters.Value = + ImGuiExtension.Checkbox("Rare Monsters", Settings.OffensiveCountRareMonsters); + Settings.OffensiveCountMagicMonsters.Value = + ImGuiExtension.Checkbox("Magic Monsters", Settings.OffensiveCountMagicMonsters); + Settings.OffensiveCountUniqueMonsters.Value = + ImGuiExtension.Checkbox("Unique Monsters", Settings.OffensiveCountUniqueMonsters); + Settings.OffensiveIgnoreFullHealthUniqueMonsters.Value = + ImGuiExtension.Checkbox("Ignore Full Health Unique Monsters", Settings.OffensiveIgnoreFullHealthUniqueMonsters); + ImGui.TreePop(); + } + + ImGui.TreePop(); + } + } + + public override void EntityAdded(Entity entityWrapper) + { + if (entityWrapper.HasComponent()) + { + lock (LoadedMonstersLock) + { + LoadedMonsters.Add(entityWrapper); + } + } + } + + public override void EntityRemoved(Entity entityWrapper) + { + lock (LoadedMonstersLock) + { + LoadedMonsters.Remove(entityWrapper); + } + } + } } \ No newline at end of file diff --git a/src/BasicFlaskRoutine/BasicFlaskRoutineSettings.cs b/BasicFlaskRoutine/BasicFlaskRoutineSettings.cs similarity index 73% rename from src/BasicFlaskRoutine/BasicFlaskRoutineSettings.cs rename to BasicFlaskRoutine/BasicFlaskRoutineSettings.cs index b2625bc..6dc7b34 100644 --- a/src/BasicFlaskRoutine/BasicFlaskRoutineSettings.cs +++ b/BasicFlaskRoutine/BasicFlaskRoutineSettings.cs @@ -9,12 +9,15 @@ public class BasicFlaskRoutineSettings : BaseTreeSettings public BasicFlaskRoutineSettings() { TicksPerSecond = new RangeNode(10, 1, 30); - EnableInHideout = new ToggleNode(false); + EnableInHideout = new ToggleNode(false); AutoFlask = new ToggleNode(false); ForceBubblingAsInstantOnly = new ToggleNode(false); ForcePanickedAsInstantOnly = new ToggleNode(false); HPPotion = new RangeNode(65, 0, 100); - InstantHPPotion = new RangeNode(35, 0, 100); + InstantHPPotion = new RangeNode(50, 0, 100); + AllocatedSupremeDecadence = new ToggleNode(false); + ESPotion = new RangeNode(65, 0, 100); + InstantESPotion = new RangeNode(50, 0, 100); DisableLifeSecUse = new ToggleNode(false); ManaPotion = new RangeNode(65, 0, 100); InstantManaPotion = new RangeNode(35, 0, 100); @@ -26,11 +29,23 @@ public BasicFlaskRoutineSettings() RemCurse = new ToggleNode(false); RemPoison = new ToggleNode(false); RemBleed = new ToggleNode(false); + RemCorruptingBlood = new ToggleNode(false); + RemMaimed = new ToggleNode(false); + RemMaimed = new ToggleNode(false); CorruptCount = new RangeNode(10, 0, 20); + HinderCount = new RangeNode(10, 0, 20); SpeedFlaskEnable = new ToggleNode(false); QuicksilverFlaskEnable = new ToggleNode(false); SilverFlaskEnable = new ToggleNode(false); MinMsPlayerMoving = new RangeNode(1500, 1, 10000); + UseWhileCycloning = new ToggleNode(false); + CycloningMonsterCount = new RangeNode(0, 0, 30); + CycloningMonsterDistance = new RangeNode(400, 0, 1500); + CycloningCountNormalMonsters = new ToggleNode(false); + CycloningCountMagicMonsters = new ToggleNode(false); + CycloningCountRareMonsters = new ToggleNode(false); + CycloningCountUniqueMonsters = new ToggleNode(false); + CycloningIgnoreFullHealthUniqueMonsters = new ToggleNode(false); DefensiveFlaskEnable = new ToggleNode(false); HPPercentDefensive = new RangeNode(50, 0, 100); ESPercentDefensive = new RangeNode(50, 0, 100); @@ -57,11 +72,11 @@ public BasicFlaskRoutineSettings() BossingModeHotkey = new HotkeyNode(Keys.T); FlaskSettings = new FlaskSetting[5] { - new FlaskSetting(new ToggleNode(true), new HotkeyNode(Keys.D1), new RangeNode(0, 0, 5)), - new FlaskSetting(new ToggleNode(true), new HotkeyNode(Keys.D2), new RangeNode(0, 0, 5)), - new FlaskSetting(new ToggleNode(true), new HotkeyNode(Keys.D3), new RangeNode(0, 0, 5)), - new FlaskSetting(new ToggleNode(true), new HotkeyNode(Keys.D4), new RangeNode(0, 0, 5)), - new FlaskSetting(new ToggleNode(true), new HotkeyNode(Keys.D5), new RangeNode(0, 0, 5)) + new FlaskSetting(Keys.D1), + new FlaskSetting(Keys.D2), + new FlaskSetting(Keys.D3), + new FlaskSetting(Keys.D4), + new FlaskSetting(Keys.D5) }; } @@ -76,6 +91,9 @@ public BasicFlaskRoutineSettings() public RangeNode HPPotion { get; set; } public RangeNode InstantHPPotion { get; set; } + public ToggleNode AllocatedSupremeDecadence { get; set; } + public RangeNode ESPotion { get; set; } + public RangeNode InstantESPotion { get; set; } public ToggleNode DisableLifeSecUse { get; set; } public RangeNode ManaPotion { get; set; } @@ -90,7 +108,11 @@ public BasicFlaskRoutineSettings() public ToggleNode RemCurse { get; set; } public ToggleNode RemPoison { get; set; } public ToggleNode RemBleed { get; set; } + public ToggleNode RemCorruptingBlood { get; set; } + public ToggleNode RemMaimed { get; set; } + public ToggleNode RemHindered { get; set; } public RangeNode CorruptCount { get; set; } + public RangeNode HinderCount { get; set; } public ToggleNode SpeedFlaskEnable { get; set; } @@ -98,6 +120,16 @@ public BasicFlaskRoutineSettings() public ToggleNode SilverFlaskEnable { get; set; } public RangeNode MinMsPlayerMoving { get; set; } + public ToggleNode UseWhileCycloning { get; set; } + public RangeNode CycloningMonsterCount { get; set; } + public RangeNode CycloningMonsterDistance { get; set; } + public ToggleNode CycloningCountNormalMonsters { get; set; } + public ToggleNode CycloningCountMagicMonsters { get; set; } + public ToggleNode CycloningCountRareMonsters { get; set; } + public ToggleNode CycloningCountUniqueMonsters { get; set; } + public ToggleNode CycloningIgnoreFullHealthUniqueMonsters { get; set; } + + public ToggleNode DefensiveFlaskEnable { get; set; } public RangeNode HPPercentDefensive { get; set; } public RangeNode ESPercentDefensive { get; set; } diff --git a/BasicFlaskRoutine/Flask/FlaskSetting.cs b/BasicFlaskRoutine/Flask/FlaskSetting.cs new file mode 100644 index 0000000..8ed57ee --- /dev/null +++ b/BasicFlaskRoutine/Flask/FlaskSetting.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using ExileCore.Shared.Nodes; + +namespace TreeRoutine.Routine.BasicFlaskRoutine.Flask +{ + public class FlaskSetting + { + public FlaskSetting() + { + Enabled = new ToggleNode(true); + UseWhenChargesFilled = new ToggleNode(false); + Hotkey = new HotkeyNode(); + ReservedUses = new RangeNode(0, 0, 5); + } + + public FlaskSetting(ToggleNode enabled, ToggleNode useWhenChargesField, HotkeyNode hotkey, RangeNode reservedUses) + { + Enabled = enabled; + UseWhenChargesFilled = useWhenChargesField; + Hotkey = hotkey; + ReservedUses = reservedUses; + } + public FlaskSetting(Keys hotKey, bool enabled = true, bool useWhenChargesFiled = false, int reserveUssages = 0, int maxUssage = 5) + { + Enabled = new ToggleNode(enabled); + UseWhenChargesFilled = new ToggleNode(useWhenChargesFiled); + Hotkey = new HotkeyNode(hotKey); + ReservedUses = new RangeNode(reserveUssages, 0, maxUssage); + } + + public ToggleNode Enabled { get; set; } + public ToggleNode UseWhenChargesFilled { get; set; } + public HotkeyNode Hotkey { get; set; } + public RangeNode ReservedUses { get; set; } + + } +} \ No newline at end of file diff --git a/src/BuildYourOwnRoutine/BuildYourOwnRoutineCore.cs b/BuildYourOwnRoutine/BuildYourOwnRoutineCore.cs similarity index 98% rename from src/BuildYourOwnRoutine/BuildYourOwnRoutineCore.cs rename to BuildYourOwnRoutine/BuildYourOwnRoutineCore.cs index fbe1834..5ce7eb8 100644 --- a/src/BuildYourOwnRoutine/BuildYourOwnRoutineCore.cs +++ b/BuildYourOwnRoutine/BuildYourOwnRoutineCore.cs @@ -118,7 +118,7 @@ private void UpdateCoroutineWaitRender() { if (TreeCoroutine != null) { - TreeCoroutine.UpdateCondtion(new WaitTime(1000 / Settings.TicksPerSecond)); + TreeCoroutine.UpdateCondition(new WaitTime(1000 / Settings.TicksPerSecond)); } } @@ -178,4 +178,4 @@ public override void EntityRemoved(Entity entityWrapper) LoadedMonsters.Remove(entityWrapper); } } -} \ No newline at end of file +} diff --git a/src/BuildYourOwnRoutine/BuildYourOwnRoutineSettings.cs b/BuildYourOwnRoutine/BuildYourOwnRoutineSettings.cs similarity index 100% rename from src/BuildYourOwnRoutine/BuildYourOwnRoutineSettings.cs rename to BuildYourOwnRoutine/BuildYourOwnRoutineSettings.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Actions/SendKeyAction.cs b/BuildYourOwnRoutine/Extension/Default/Actions/SendKeyAction.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Actions/SendKeyAction.cs rename to BuildYourOwnRoutine/Extension/Default/Actions/SendKeyAction.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Actions/SendKeyActionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Actions/SendKeyActionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Actions/SendKeyActionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Actions/SendKeyActionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Actions/SimpleAction.cs b/BuildYourOwnRoutine/Extension/Default/Actions/SimpleAction.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Actions/SimpleAction.cs rename to BuildYourOwnRoutine/Extension/Default/Actions/SimpleAction.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Actions/TimerAction.cs b/BuildYourOwnRoutine/Extension/Default/Actions/TimerAction.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Actions/TimerAction.cs rename to BuildYourOwnRoutine/Extension/Default/Actions/TimerAction.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Actions/TimerActionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Actions/TimerActionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Actions/TimerActionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Actions/TimerActionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskAction.cs b/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskAction.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskAction.cs rename to BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskAction.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskActionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskActionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskActionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskActionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskTypeAction.cs b/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskTypeAction.cs similarity index 91% rename from src/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskTypeAction.cs rename to BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskTypeAction.cs index dde029b..9c8930f 100644 --- a/src/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskTypeAction.cs +++ b/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskTypeAction.cs @@ -52,6 +52,9 @@ internal class UseFlaskTypeAction : ExtensionAction private bool useBleed { get; set; } = false; private const String useBleedString = "useBleed"; + private bool useCorruptedBloodAndBleed { get; set; } = false; + private const String useCorruptedBloodAndBleedString = "useCorruptedBloodAndBleed"; + private bool useCurse { get; set; } = false; private const String useCurseString = "useCurse"; @@ -64,6 +67,8 @@ internal class UseFlaskTypeAction : ExtensionAction private int reserveFlaskCharges { get; set; } = 0; private const String reserveFlaskChargesString = "reserveFlaskCharges"; + private bool useMaimAndHinder { get; set; } = false; + private const String useMaimAndHinderString = "useMaimAndHinder"; public UseFlaskTypeAction(string owner, string name) : base(owner, name) { @@ -85,10 +90,12 @@ public override void Initialise(Dictionary Parameters) useIgnite = ExtensionComponent.InitialiseParameterBoolean(useIgniteString, useIgnite, ref Parameters); useShock = ExtensionComponent.InitialiseParameterBoolean(useShockString, useShock, ref Parameters); useBleed = ExtensionComponent.InitialiseParameterBoolean(useBleedString, useBleed, ref Parameters); + useCorruptedBloodAndBleed = ExtensionComponent.InitialiseParameterBoolean(useCorruptedBloodAndBleedString, useCorruptedBloodAndBleed, ref Parameters); useCurse = ExtensionComponent.InitialiseParameterBoolean(useCurseString, useCurse, ref Parameters); useUnique = ExtensionComponent.InitialiseParameterBoolean(useUniqueString, useUnique, ref Parameters); useOffenseAndSpeedrun = ExtensionComponent.InitialiseParameterBoolean(useOffenseAndSpeedrunString, useOffenseAndSpeedrun, ref Parameters); reserveFlaskCharges = ExtensionComponent.InitialiseParameterInt32(reserveFlaskChargesString, reserveFlaskCharges, ref Parameters); + useMaimAndHinder = ExtensionComponent.InitialiseParameterBoolean(useMaimAndHinderString, useMaimAndHinder, ref Parameters); } public override bool CreateConfigurationMenu(ExtensionParameter extensionParameter, ref Dictionary Parameters) @@ -158,10 +165,16 @@ public override bool CreateConfigurationMenu(ExtensionParameter extensionParamet useBleed = ImGuiExtension.Checkbox("Bleed", useBleed); Parameters[useBleedString] = useBleed.ToString(); + useCorruptedBloodAndBleed = ImGuiExtension.Checkbox("Bleed and Corrupted Blood", useCorruptedBloodAndBleed); + Parameters[useCorruptedBloodAndBleedString] = useCorruptedBloodAndBleed.ToString(); + ImGui.SameLine(); useCurse = ImGuiExtension.Checkbox("Curse", useCurse); Parameters[useCurseString] = useCurse.ToString(); + useMaimAndHinder = ImGuiExtension.Checkbox("Maim And Hinder", useMaimAndHinder); + Parameters[useMaimAndHinderString] = useMaimAndHinder.ToString(); + ImGui.Spacing(); ImGui.Separator(); ImGui.Spacing(); @@ -187,17 +200,19 @@ public override Composite GetComposite(ExtensionParameter profileParameter) if (useIgnite) actions.Add(FlaskActions.IgniteImmune); if (useShock) actions.Add(FlaskActions.ShockImmune); if (useBleed) actions.Add(FlaskActions.BleedImmune); + if (useCorruptedBloodAndBleed) actions.Add(FlaskActions.CorruptedBloodAndBleedImmune); if (useCurse) actions.Add(FlaskActions.CurseImmune); + if (useMaimAndHinder) actions.Add(FlaskActions.MaimAndHinderImmune); if (useUnique) actions.Add(FlaskActions.UniqueFlask); if (useOffenseAndSpeedrun) actions.Add(FlaskActions.OFFENSE_AND_SPEEDRUN); - if(actions.Count == 0) + if (actions.Count == 0) { profileParameter.Plugin.Log("No actions selected.", 5); return new TreeSharp.Action(); } - bool cleansing = usePoison || useFreeze || useIgnite || useShock || useBleed || useCurse; + bool cleansing = usePoison || useFreeze || useIgnite || useShock || useBleed || useCorruptedBloodAndBleed || useCurse | useMaimAndHinder; return createUseFlaskAction(profileParameter, actions, cleansing ? null : (bool?)useInstant, useInstant, null); } @@ -320,7 +335,9 @@ public override string GetDisplayName(bool isAddingNew) if (useIgnite) displayName += ("Ignite,"); if (useShock) displayName += ("Shock,"); if (useBleed) displayName += ("Bleed,"); + if (useCorruptedBloodAndBleed) displayName += ("Corrupt Blood and Bleed,"); if (useCurse) displayName += ("Curse,"); + if (useMaimAndHinder) displayName += ("Maim and Hinder,"); if (useUnique) displayName += ("Unique,"); if (useOffenseAndSpeedrun) displayName += ("Off&Def,"); if (reserveFlaskCharges > 0) displayName += ("Reserved=" + reserveFlaskCharges); @@ -331,4 +348,4 @@ public override string GetDisplayName(bool isAddingNew) return displayName; } } -} +} \ No newline at end of file diff --git a/src/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskTypeActionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskTypeActionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskTypeActionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Actions/UseFlaskTypeActionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Actions/UseVaalSkillAction.cs b/BuildYourOwnRoutine/Extension/Default/Actions/UseVaalSkillAction.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Actions/UseVaalSkillAction.cs rename to BuildYourOwnRoutine/Extension/Default/Actions/UseVaalSkillAction.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Actions/UseVaalSkillActionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Actions/UseVaalSkillActionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Actions/UseVaalSkillActionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Actions/UseVaalSkillActionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseFlaskCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseFlaskCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseFlaskCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/CanUseFlaskCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseFlaskConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseFlaskConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseFlaskConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/CanUseFlaskConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseSkillCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseSkillCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseSkillCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/CanUseSkillCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseSkillConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseSkillConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/CanUseSkillConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/CanUseSkillConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/EnergyShieldPercentCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/EnergyShieldPercentCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/EnergyShieldPercentCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/EnergyShieldPercentCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/EnergyShieldPercentConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/EnergyShieldPercentConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/EnergyShieldPercentConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/EnergyShieldPercentConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/HasCurableAilmentCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/HasCurableAilmentCondition.cs similarity index 84% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/HasCurableAilmentCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/HasCurableAilmentCondition.cs index 1c91908..b71b83f 100644 --- a/src/BuildYourOwnRoutine/Extension/Default/Conditions/HasCurableAilmentCondition.cs +++ b/BuildYourOwnRoutine/Extension/Default/Conditions/HasCurableAilmentCondition.cs @@ -32,6 +32,12 @@ internal class HasCurableAilmentCondition : ExtensionCondition public int CorruptCount { get; set; } = 0; public string CorruptCountString { get; set; } = "CorruptCount"; + public bool RemMaim { get; set; } = false; + public string RemMaimString { get; set; } = "RemMaim"; + + public int HinderCount { get; set; } = 0; + public string HinderCountString { get; set; } = "RemHinder"; + public bool IgnoreInfiniteTimer { get; set; } = false; public string IgnoreInfiniteTimerString { get; set; } = "IgnoreInfiniteTimer"; @@ -53,6 +59,8 @@ public override void Initialise(Dictionary Parameters) RemPoison = ExtensionComponent.InitialiseParameterBoolean(RemPoisonString, RemPoison, ref Parameters); RemBleed = ExtensionComponent.InitialiseParameterBoolean(RemBleedString, RemBleed, ref Parameters); CorruptCount = ExtensionComponent.InitialiseParameterInt32(CorruptCountString, CorruptCount, ref Parameters); + RemMaim = ExtensionComponent.InitialiseParameterBoolean(RemMaimString, RemMaim, ref Parameters); + HinderCount = ExtensionComponent.InitialiseParameterInt32(HinderCountString, HinderCount, ref Parameters); IgnoreInfiniteTimer = ExtensionComponent.InitialiseParameterBoolean(IgnoreInfiniteTimerString, IgnoreInfiniteTimer, ref Parameters); } @@ -84,6 +92,12 @@ public override bool CreateConfigurationMenu(ExtensionParameter extensionParamet CorruptCount = ImGuiExtension.IntSlider("Corruption Count", CorruptCount, 0, 20); Parameters[CorruptCountString] = CorruptCount.ToString(); + RemMaim = ImGuiExtension.Checkbox("Maim", RemMaim); + Parameters[RemMaimString] = RemMaim.ToString(); + + HinderCount = ImGuiExtension.IntSlider("Hinder Count", HinderCount, 0, 20); + Parameters[HinderCountString] = HinderCount.ToString(); + IgnoreInfiniteTimer = ImGuiExtension.Checkbox("Ignore Infinite Timer", IgnoreInfiniteTimer); Parameters[IgnoreInfiniteTimerString] = IgnoreInfiniteTimer.ToString(); return true; @@ -107,6 +121,10 @@ public override Func GetCondition(ExtensionParameter extensionParameter) return true; if (CorruptCount > 0 && hasAilment(extensionParameter, extensionParameter.Plugin.Cache.DebuffPanelConfig.Corruption, () => CorruptCount)) return true; + if (RemMaim && hasAilment(extensionParameter, extensionParameter.Plugin.Cache.DebuffPanelConfig.Maimed)) + return true; + if (HinderCount > 0 && hasAilment(extensionParameter, extensionParameter.Plugin.Cache.DebuffPanelConfig.Hindered)) + return true; return false; }; @@ -114,7 +132,7 @@ public override Func GetCondition(ExtensionParameter extensionParameter) private bool hasAilment(ExtensionParameter profileParameter, Dictionary dictionary, Func minCharges = null) { - var buffs = profileParameter.Plugin.GameController.Game.IngameState.Data.LocalPlayer.GetComponent().Buffs; + var buffs = profileParameter.Plugin.GameController.Game.IngameState.Data.LocalPlayer.GetComponent().BuffsList; foreach (var buff in buffs) { if (!IgnoreInfiniteTimer && float.IsInfinity(buff.Timer)) @@ -144,6 +162,8 @@ public override string GetDisplayName(bool isAddingNew) if (RemPoison) displayName += ("Poison,"); if (RemBleed) displayName += ("Bleed,"); if (CorruptCount > 0) displayName += ("Corrupt,"); + if (RemMaim) displayName += ("Maim,"); + if (HinderCount > 0) displayName += ("Hinder,"); displayName += "]"; } @@ -151,4 +171,4 @@ public override string GetDisplayName(bool isAddingNew) return displayName; } } -} +} \ No newline at end of file diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/HasCurableAilmentConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/HasCurableAilmentConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/HasCurableAilmentConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/HasCurableAilmentConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/HasFlaskBuffCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/HasFlaskBuffCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/HasFlaskBuffCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/HasFlaskBuffCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/HasFlaskBuffConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/HasFlaskBuffConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/HasFlaskBuffConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/HasFlaskBuffConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/HealthPercentCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/HealthPercentCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/HealthPercentCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/HealthPercentCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/HealthPercentConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/HealthPercentConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/HealthPercentConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/HealthPercentConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/InHideoutConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/InHideoutConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/InHideoutConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/InHideoutConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/InTownConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/InTownConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/InTownConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/InTownConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/IsKeyPressedCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/IsKeyPressedCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/IsKeyPressedCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/IsKeyPressedCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/IsKeyPressedConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/IsKeyPressedConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/IsKeyPressedConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/IsKeyPressedConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/LoweredResistanceCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/LoweredResistanceCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/LoweredResistanceCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/LoweredResistanceCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/LoweredResistanceConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/LoweredResistanceConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/LoweredResistanceConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/LoweredResistanceConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/ManaPercentCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/ManaPercentCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/ManaPercentCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/ManaPercentCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/ManaPercentConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/ManaPercentConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/ManaPercentConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/ManaPercentConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/NearbyMonstersCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/NearbyMonstersCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/NearbyMonstersCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/NearbyMonstersCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/NearbyMonstersConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/NearbyMonstersConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/NearbyMonstersConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/NearbyMonstersConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerHasBuffCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerHasBuffCondition.cs similarity index 94% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerHasBuffCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/PlayerHasBuffCondition.cs index 9a59dfd..7d88bcc 100644 --- a/src/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerHasBuffCondition.cs +++ b/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerHasBuffCondition.cs @@ -91,7 +91,7 @@ public override Func GetCondition(ExtensionParameter extensionParameter) { if (extensionParameter.Plugin.Settings.Debug) { - var foundBuff = extensionParameter.Plugin.GameController.Game.IngameState.Data.LocalPlayer.Buffs.FirstOrDefault(x => + var foundBuff = extensionParameter.Plugin.GameController.Game.IngameState.Data.LocalPlayer.GetComponent().BuffsList.FirstOrDefault(x => x.Name == HasBuffReady); if (foundBuff != null) { @@ -102,7 +102,7 @@ public override Func GetCondition(ExtensionParameter extensionParameter) } - return extensionParameter.Plugin.GameController.Game.IngameState.Data.LocalPlayer.Buffs.Any(x => x.Name == HasBuffReady && (x.Timer >= (1.0 * RemainingDuration / 1000)) && x.Charges >= MinimumCharges); + return extensionParameter.Plugin.GameController.Game.IngameState.Data.LocalPlayer.GetComponent().BuffsList.Any(x => x.Name == HasBuffReady && (x.Timer >= (1.0 * RemainingDuration / 1000)) && x.Charges >= MinimumCharges); }; } diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerHasBuffConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerHasBuffConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerHasBuffConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/PlayerHasBuffConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerMovingCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerMovingCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerMovingCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/PlayerMovingCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerMovingConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerMovingConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/PlayerMovingConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/PlayerMovingConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/SimpleCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/SimpleCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/SimpleCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/SimpleCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/TimerCondition.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/TimerCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/TimerCondition.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/TimerCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/Conditions/TimerConditionFactory.cs b/BuildYourOwnRoutine/Extension/Default/Conditions/TimerConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/Conditions/TimerConditionFactory.cs rename to BuildYourOwnRoutine/Extension/Default/Conditions/TimerConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/Default/DefaultExtension.cs b/BuildYourOwnRoutine/Extension/Default/DefaultExtension.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Default/DefaultExtension.cs rename to BuildYourOwnRoutine/Extension/Default/DefaultExtension.cs diff --git a/src/BuildYourOwnRoutine/Extension/Extension.cs b/BuildYourOwnRoutine/Extension/Extension.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/Extension.cs rename to BuildYourOwnRoutine/Extension/Extension.cs diff --git a/src/BuildYourOwnRoutine/Extension/ExtensionAction.cs b/BuildYourOwnRoutine/Extension/ExtensionAction.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/ExtensionAction.cs rename to BuildYourOwnRoutine/Extension/ExtensionAction.cs diff --git a/src/BuildYourOwnRoutine/Extension/ExtensionActionFactory.cs b/BuildYourOwnRoutine/Extension/ExtensionActionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/ExtensionActionFactory.cs rename to BuildYourOwnRoutine/Extension/ExtensionActionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/ExtensionCache.cs b/BuildYourOwnRoutine/Extension/ExtensionCache.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/ExtensionCache.cs rename to BuildYourOwnRoutine/Extension/ExtensionCache.cs diff --git a/src/BuildYourOwnRoutine/Extension/ExtensionComponent.cs b/BuildYourOwnRoutine/Extension/ExtensionComponent.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/ExtensionComponent.cs rename to BuildYourOwnRoutine/Extension/ExtensionComponent.cs diff --git a/src/BuildYourOwnRoutine/Extension/ExtensionComponentFactory.cs b/BuildYourOwnRoutine/Extension/ExtensionComponentFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/ExtensionComponentFactory.cs rename to BuildYourOwnRoutine/Extension/ExtensionComponentFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/ExtensionComponentType.cs b/BuildYourOwnRoutine/Extension/ExtensionComponentType.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/ExtensionComponentType.cs rename to BuildYourOwnRoutine/Extension/ExtensionComponentType.cs diff --git a/src/BuildYourOwnRoutine/Extension/ExtensionCondition.cs b/BuildYourOwnRoutine/Extension/ExtensionCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/ExtensionCondition.cs rename to BuildYourOwnRoutine/Extension/ExtensionCondition.cs diff --git a/src/BuildYourOwnRoutine/Extension/ExtensionConditionFactory.cs b/BuildYourOwnRoutine/Extension/ExtensionConditionFactory.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/ExtensionConditionFactory.cs rename to BuildYourOwnRoutine/Extension/ExtensionConditionFactory.cs diff --git a/src/BuildYourOwnRoutine/Extension/ExtensionLoader.cs b/BuildYourOwnRoutine/Extension/ExtensionLoader.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/ExtensionLoader.cs rename to BuildYourOwnRoutine/Extension/ExtensionLoader.cs diff --git a/src/BuildYourOwnRoutine/Extension/ExtensionParameter.cs b/BuildYourOwnRoutine/Extension/ExtensionParameter.cs similarity index 100% rename from src/BuildYourOwnRoutine/Extension/ExtensionParameter.cs rename to BuildYourOwnRoutine/Extension/ExtensionParameter.cs diff --git a/src/BuildYourOwnRoutine/Flask/FlaskSetting.cs b/BuildYourOwnRoutine/Flask/FlaskSetting.cs similarity index 100% rename from src/BuildYourOwnRoutine/Flask/FlaskSetting.cs rename to BuildYourOwnRoutine/Flask/FlaskSetting.cs diff --git a/src/BuildYourOwnRoutine/Profile/LoadedProfile.cs b/BuildYourOwnRoutine/Profile/LoadedProfile.cs similarity index 100% rename from src/BuildYourOwnRoutine/Profile/LoadedProfile.cs rename to BuildYourOwnRoutine/Profile/LoadedProfile.cs diff --git a/src/BuildYourOwnRoutine/Profile/ProfileTreeBuilder.cs b/BuildYourOwnRoutine/Profile/ProfileTreeBuilder.cs similarity index 100% rename from src/BuildYourOwnRoutine/Profile/ProfileTreeBuilder.cs rename to BuildYourOwnRoutine/Profile/ProfileTreeBuilder.cs diff --git a/src/BuildYourOwnRoutine/Trigger/Trigger.cs b/BuildYourOwnRoutine/Trigger/Trigger.cs similarity index 100% rename from src/BuildYourOwnRoutine/Trigger/Trigger.cs rename to BuildYourOwnRoutine/Trigger/Trigger.cs diff --git a/src/BuildYourOwnRoutine/Trigger/TriggerAction.cs b/BuildYourOwnRoutine/Trigger/TriggerAction.cs similarity index 100% rename from src/BuildYourOwnRoutine/Trigger/TriggerAction.cs rename to BuildYourOwnRoutine/Trigger/TriggerAction.cs diff --git a/src/BuildYourOwnRoutine/Trigger/TriggerComposite.cs b/BuildYourOwnRoutine/Trigger/TriggerComposite.cs similarity index 100% rename from src/BuildYourOwnRoutine/Trigger/TriggerComposite.cs rename to BuildYourOwnRoutine/Trigger/TriggerComposite.cs diff --git a/src/BuildYourOwnRoutine/Trigger/TriggerCondition.cs b/BuildYourOwnRoutine/Trigger/TriggerCondition.cs similarity index 100% rename from src/BuildYourOwnRoutine/Trigger/TriggerCondition.cs rename to BuildYourOwnRoutine/Trigger/TriggerCondition.cs diff --git a/src/BuildYourOwnRoutine/Trigger/TriggerType.cs b/BuildYourOwnRoutine/Trigger/TriggerType.cs similarity index 100% rename from src/BuildYourOwnRoutine/Trigger/TriggerType.cs rename to BuildYourOwnRoutine/Trigger/TriggerType.cs diff --git a/src/BuildYourOwnRoutine/UI/MenuItem/ConfigurationMenu.cs b/BuildYourOwnRoutine/UI/MenuItem/ConfigurationMenu.cs similarity index 100% rename from src/BuildYourOwnRoutine/UI/MenuItem/ConfigurationMenu.cs rename to BuildYourOwnRoutine/UI/MenuItem/ConfigurationMenu.cs diff --git a/src/BuildYourOwnRoutine/UI/MenuItem/ProfileMenu.cs b/BuildYourOwnRoutine/UI/MenuItem/ProfileMenu.cs similarity index 100% rename from src/BuildYourOwnRoutine/UI/MenuItem/ProfileMenu.cs rename to BuildYourOwnRoutine/UI/MenuItem/ProfileMenu.cs diff --git a/src/BuildYourOwnRoutine/UI/MenuItem/SettingsMenu.cs b/BuildYourOwnRoutine/UI/MenuItem/SettingsMenu.cs similarity index 100% rename from src/BuildYourOwnRoutine/UI/MenuItem/SettingsMenu.cs rename to BuildYourOwnRoutine/UI/MenuItem/SettingsMenu.cs diff --git a/src/BuildYourOwnRoutine/UI/MenuItem/TriggerMenu.cs b/BuildYourOwnRoutine/UI/MenuItem/TriggerMenu.cs similarity index 100% rename from src/BuildYourOwnRoutine/UI/MenuItem/TriggerMenu.cs rename to BuildYourOwnRoutine/UI/MenuItem/TriggerMenu.cs diff --git a/src/Extension/AddExtensionsHere.txt b/Extension/AddExtensionsHere.txt similarity index 100% rename from src/Extension/AddExtensionsHere.txt rename to Extension/AddExtensionsHere.txt diff --git a/GitUpdateConfig.txt b/GitUpdateConfig.txt deleted file mode 100644 index 6193102..0000000 --- a/GitUpdateConfig.txt +++ /dev/null @@ -1,9 +0,0 @@ -Owner: sychotixdev -Name: BasicFlaskRoutine -Repository - -Ignore: -src -.gitignore -README.md -LICENSE \ No newline at end of file diff --git a/src/Profile/AddProfilesHere.txt b/Profile/AddProfilesHere.txt similarity index 100% rename from src/Profile/AddProfilesHere.txt rename to Profile/AddProfilesHere.txt diff --git a/src/Profile/BasicFlaskRoutine.json b/Profile/BasicFlaskRoutine.json similarity index 99% rename from src/Profile/BasicFlaskRoutine.json rename to Profile/BasicFlaskRoutine.json index febb108..8a05ee7 100644 --- a/src/Profile/BasicFlaskRoutine.json +++ b/Profile/BasicFlaskRoutine.json @@ -1,5 +1,5 @@ { - "Name":"", + "Name": "", "Composite": { "Name": "Basic Flask Routine", "Type": 0, @@ -526,6 +526,7 @@ "RemCurse": "False", "RemPoison": "False", "RemBleed": "True", + "RemCorruptingBlood": "True", "CorruptCount": "0" }, "Linker": null, @@ -558,6 +559,7 @@ "useIgnite": "False", "useShock": "False", "useBleed": "True", + "useCorruptedBloodAndBleed": "true", "useCurse": "False", "useUnique": "False", "useOffenseAndSpeedrun": "False" diff --git a/src/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs similarity index 100% rename from src/Properties/AssemblyInfo.cs rename to Properties/AssemblyInfo.cs diff --git a/README.md b/README.md index acac44b..0de840e 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,15 @@ BasicFlaskRoutine is a PoeHUD plugin example using [BaseTreeRoutine.](https://gi * Zaafar for some help with PoeHUD and giving me a good place to get started * AutoFlaskManager and all their great contributors for giving me a good place to get started. https://github.com/Xcesius/AutoFlaskManager +### Donation Addresses +* BTC: 1MTKA5qFknUcG68LGZXnmCSvDvvjMbMvRK +* BCH: 17Eu4YCs7MUnHrBuSeUggbCsnHNX7n5fNZ +* ETH: 0x38B6e014F3923B8F9aFbE4e0ff0e872beCdb5d72 +* LTC: LMXsH6DyKiqLw3JZea9ZdHDV4oXZ2Uek3W [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=72QZ2RSUMGJ8N) ### Plugin Development * Requires [PoeHUD.](https://github.com/TehCheat/PoEHUD) Either add PoeHUD.exe as a reference, or download the repository and reference the project * Requires [TreeSharp.](https://github.com/ApocDev/TreeSharp) Add this project as a reference, or add TreeSharp.dll as a reference from a completed plugin. -* Requires [BaseTreeRoutine.] (https://github.com/sychotixdev/BaseTreeRoutine) Add this project as a reference, or add BaseTreeRoutine.dll from a release as a reference. +* Requires [BaseTreeRoutine.] (https://github.com/sychotixdev/BaseTreeRoutine) Add this project as a reference, or add BaseTreeRoutine.dll from a release as a reference. \ No newline at end of file diff --git a/src/TreeRoutine/BaseTreeCache.cs b/TreeRoutine/BaseTreeCache.cs similarity index 100% rename from src/TreeRoutine/BaseTreeCache.cs rename to TreeRoutine/BaseTreeCache.cs diff --git a/src/TreeRoutine/BaseTreeRoutinePlugin.cs b/TreeRoutine/BaseTreeRoutinePlugin.cs similarity index 99% rename from src/TreeRoutine/BaseTreeRoutinePlugin.cs rename to TreeRoutine/BaseTreeRoutinePlugin.cs index d24f576..97dcada 100644 --- a/src/TreeRoutine/BaseTreeRoutinePlugin.cs +++ b/TreeRoutine/BaseTreeRoutinePlugin.cs @@ -33,7 +33,7 @@ public TSettingType LoadSettingFile(String fileName) if (!File.Exists(fileName)) { LogError("BaseTreeRoutinePlugin: Cannot find " + fileName + " file. This plugin will exit.", 10); - return default; + return default(TSettingType); } return JsonConvert.DeserializeObject(File.ReadAllText(fileName)); diff --git a/src/TreeRoutine/BaseTreeSettings.cs b/TreeRoutine/BaseTreeSettings.cs similarity index 100% rename from src/TreeRoutine/BaseTreeSettings.cs rename to TreeRoutine/BaseTreeSettings.cs diff --git a/src/TreeRoutine/Buffs/BuffsEnum.cs b/TreeRoutine/Buffs/BuffsEnum.cs similarity index 99% rename from src/TreeRoutine/Buffs/BuffsEnum.cs rename to TreeRoutine/Buffs/BuffsEnum.cs index 03a4ea7..e26ea61 100644 --- a/src/TreeRoutine/Buffs/BuffsEnum.cs +++ b/TreeRoutine/Buffs/BuffsEnum.cs @@ -934,6 +934,7 @@ public enum BuffEnums royale_pain, quick_guard, corrosive_shroud_at_max_damage, + corrosive_shroud_aura, mine_mana_reservation, cyclone_channelled_stage, Summoned_Spider_Buff, diff --git a/src/TreeRoutine/DebuffPanelConfig.cs b/TreeRoutine/DebuffPanelConfig.cs similarity index 84% rename from src/TreeRoutine/DebuffPanelConfig.cs rename to TreeRoutine/DebuffPanelConfig.cs index e11e4a6..d414c48 100644 --- a/src/TreeRoutine/DebuffPanelConfig.cs +++ b/TreeRoutine/DebuffPanelConfig.cs @@ -15,6 +15,8 @@ public class DebuffPanelConfig public Dictionary Chilled { get; set; } public Dictionary Burning { get; set; } public Dictionary Shocked { get; set; } + public Dictionary Maimed { get; set; } + public Dictionary Hindered { get; set; } public Dictionary WeakenedSlowed { get; set; } } -} +} \ No newline at end of file diff --git a/src/TreeRoutine/DefaultBehaviors/Actions/UseHotkeyAction.cs b/TreeRoutine/DefaultBehaviors/Actions/UseHotkeyAction.cs similarity index 100% rename from src/TreeRoutine/DefaultBehaviors/Actions/UseHotkeyAction.cs rename to TreeRoutine/DefaultBehaviors/Actions/UseHotkeyAction.cs diff --git a/src/TreeRoutine/DefaultBehaviors/Helpers/FlaskHelper.cs b/TreeRoutine/DefaultBehaviors/Helpers/FlaskHelper.cs similarity index 93% rename from src/TreeRoutine/DefaultBehaviors/Helpers/FlaskHelper.cs rename to TreeRoutine/DefaultBehaviors/Helpers/FlaskHelper.cs index 62bed64..30312d1 100644 --- a/src/TreeRoutine/DefaultBehaviors/Helpers/FlaskHelper.cs +++ b/TreeRoutine/DefaultBehaviors/Helpers/FlaskHelper.cs @@ -18,7 +18,7 @@ public class FlaskHelper public List GetAllFlaskInfo() { - var flaskItems = Core.GameController.Game.IngameState.ServerData.PlayerInventories + var flaskItems = Core.GameController.Game.IngameState.Data.ServerData.PlayerInventories .FirstOrDefault(x => x.Inventory.InventType == InventoryTypeE.Flask)?.Inventory?.InventorySlotItems; List flaskList = new List(); @@ -31,7 +31,7 @@ public List GetAllFlaskInfo() return flaskList; } - public PlayerFlask GetFlaskInfo(int index, Entity foundFlask=null) + public PlayerFlask GetFlaskInfo(int index, Entity foundFlask = null) { if (Core.Cache.MiscBuffInfo == null) @@ -40,7 +40,7 @@ public PlayerFlask GetFlaskInfo(int index, Entity foundFlask=null) return null; } - Entity currentFlask = foundFlask ?? Core.GameController.Game.IngameState.ServerData.PlayerInventories.FirstOrDefault(x => x.Inventory.InventType == InventoryTypeE.Flask)?.Inventory?.InventorySlotItems?.FirstOrDefault(x => x.InventoryPosition.X == index)?.Item; + var currentFlask = foundFlask ?? Core.GameController.Game.IngameState.Data.ServerData.PlayerInventories.FirstOrDefault(x => x.Inventory.InventType == InventoryTypeE.Flask)?.Inventory?.InventorySlotItems?.FirstOrDefault(x => x.InventoryPosition.X == index)?.Item; if (currentFlask == null || currentFlask.Address == 0x00) { return null; @@ -61,7 +61,7 @@ public PlayerFlask GetFlaskInfo(int index, Entity foundFlask=null) Core.LogErr(Core.Name + ": Ignoring Flask " + index + ". No base item was found! Path: " + currentFlask.Path, 5); return null; } - + simplePlayerFlask.Name = baseItem.BaseName; @@ -71,6 +71,7 @@ public PlayerFlask GetFlaskInfo(int index, Entity foundFlask=null) var useCharge = CalculateUseCharges(flaskChargesStruct.ChargesPerUse, flaskMods.ItemMods); if (useCharge > 0) simplePlayerFlask.TotalUses = flaskChargesStruct.NumCharges / useCharge; + simplePlayerFlask.IsFull = flaskChargesStruct.NumCharges >= flaskChargesStruct.ChargesMax; //TreeRoutine.LogError("Flask: " + simplePlayerFlask.Name + "Num Charges: " + flaskChargesStruct.NumCharges + " Use Charges: " + useCharge + " Charges Per use: " + flaskChargesStruct.ChargesPerUse + " Total Uses: " + simplePlayerFlask.TotalUses, 5); @@ -182,7 +183,7 @@ public Boolean CanUsePotion(int flaskIndex, int reservedUses = 0, bool ignoreAct return CanUsePotion(flask, reservedUses, ignoreActionType); } - public Boolean CanUsePotion(PlayerFlask flask, int reservedUses=0, bool ignoreActionType = false) + public Boolean CanUsePotion(PlayerFlask flask, int reservedUses = 0, bool ignoreActionType = false) { if (flask == null) { @@ -190,7 +191,7 @@ public Boolean CanUsePotion(PlayerFlask flask, int reservedUses=0, bool ignoreAc Core.Log(Core.Name + ": Cannot use a null flask.", 1); return false; } - + if (flask.TotalUses - reservedUses <= 0) { @@ -202,10 +203,10 @@ public Boolean CanUsePotion(PlayerFlask flask, int reservedUses=0, bool ignoreAc if (ignoreActionType) return true; - if (flask.Action1 == FlaskActions.Life && !Core.PlayerHelper.isHealthBelowPercentage(99)) + if (flask.Action1 == FlaskActions.Life && !(Core.PlayerHelper.isHealthBelowPercentage(99) || Core.PlayerHelper.isEnergyShieldBelowPercentage(99))) { if (Core.Settings.Debug) - Core.Log(Core.Name + ": Can't use life flask " + flask.Name + " at full health.", 1); + Core.Log(Core.Name + ": Can't use life flask " + flask.Name + " at full health and energy shiled.", 1); return false; } @@ -226,4 +227,4 @@ public Boolean CanUsePotion(PlayerFlask flask, int reservedUses=0, bool ignoreAc return true; } } -} +} \ No newline at end of file diff --git a/src/TreeRoutine/DefaultBehaviors/Helpers/KeyboardHelper.cs b/TreeRoutine/DefaultBehaviors/Helpers/KeyboardHelper.cs similarity index 95% rename from src/TreeRoutine/DefaultBehaviors/Helpers/KeyboardHelper.cs rename to TreeRoutine/DefaultBehaviors/Helpers/KeyboardHelper.cs index e633672..94fac40 100644 --- a/src/TreeRoutine/DefaultBehaviors/Helpers/KeyboardHelper.cs +++ b/TreeRoutine/DefaultBehaviors/Helpers/KeyboardHelper.cs @@ -43,7 +43,7 @@ public void KeyUp(Keys key) public bool KeyPressRelease(Keys key) { KeyDown(key); - var lat = (int)(_gameHandle.Game.IngameState.CurLatency); + var lat = (int)(_gameHandle.Game.IngameState.Data.ServerData.Latency); if (lat < 1000) { Thread.Sleep(lat); diff --git a/src/TreeRoutine/DefaultBehaviors/Helpers/PlayerHelper.cs b/TreeRoutine/DefaultBehaviors/Helpers/PlayerHelper.cs similarity index 93% rename from src/TreeRoutine/DefaultBehaviors/Helpers/PlayerHelper.cs rename to TreeRoutine/DefaultBehaviors/Helpers/PlayerHelper.cs index d97cae5..46f82f4 100644 --- a/src/TreeRoutine/DefaultBehaviors/Helpers/PlayerHelper.cs +++ b/TreeRoutine/DefaultBehaviors/Helpers/PlayerHelper.cs @@ -56,8 +56,7 @@ public Boolean playerHasBuffs(List buffs) if (buffs == null || buffs.Count == 0) return false; - var playerLife = Core.GameController.Game.IngameState.Data.LocalPlayer.GetComponent(); - var playerBuffs = playerLife.Buffs; + var playerBuffs = Core.GameController.Game.IngameState.Data.LocalPlayer.GetComponent().BuffsList; if (playerBuffs == null) return false; @@ -87,8 +86,7 @@ public Boolean playerDoesNotHaveAnyOfBuffs(List buffs) if (buffs == null || buffs.Count == 0) return true; - var playerLife = Core.GameController.Game.IngameState.Data.LocalPlayer.GetComponent(); - var playerBuffs = playerLife.Buffs; + var playerBuffs = Core.GameController.Game.IngameState.Data.LocalPlayer.GetComponent().BuffsList; if (playerBuffs == null) return true; diff --git a/src/TreeRoutine/DefaultBehaviors/Helpers/TreeHelper.cs b/TreeRoutine/DefaultBehaviors/Helpers/TreeHelper.cs similarity index 95% rename from src/TreeRoutine/DefaultBehaviors/Helpers/TreeHelper.cs rename to TreeRoutine/DefaultBehaviors/Helpers/TreeHelper.cs index 0ddd5e5..ce43d1e 100644 --- a/src/TreeRoutine/DefaultBehaviors/Helpers/TreeHelper.cs +++ b/TreeRoutine/DefaultBehaviors/Helpers/TreeHelper.cs @@ -16,7 +16,7 @@ public Boolean CanTick() Core.LogMessage("Game is loading...", 0.2f); return false; } - if (!Core.GameController.Game.IngameState.ServerData.IsInGame) + if (!Core.GameController.Game.IngameState.Data.ServerData.IsInGame) { if (Core.Settings.Debug) Core.LogMessage("Currently not in the game (Charactor selection maybe).", 0.2f); diff --git a/src/TreeRoutine/FlaskComponents/FlaskActions.cs b/TreeRoutine/FlaskComponents/FlaskActions.cs similarity index 60% rename from src/TreeRoutine/FlaskComponents/FlaskActions.cs rename to TreeRoutine/FlaskComponents/FlaskActions.cs index 9fbf94a..ff750b6 100644 --- a/src/TreeRoutine/FlaskComponents/FlaskActions.cs +++ b/TreeRoutine/FlaskComponents/FlaskActions.cs @@ -6,34 +6,36 @@ public enum FlaskActions None, // flask isn't initilized. Life, //life, Blood of the Karui Mana, //mana, Doedre's Elixir, - //Zerphi's Last Breath, Lavianga's Spirit + //Zerphi's Last Breath, Lavianga's Spirit Hybrid, //hybrid flasks, Defense, //bismuth, jade, stibnite, granite, - //amethyst, ruby, sapphire, topaz, - // aquamarine, quartz, Sin's Rebirth, - //Coruscating Elixir, Forbidden Taste,Rumi's Concoction - //MODS: iron skin, reflexes, gluttony, - // craving, resistance + //amethyst, ruby, sapphire, topaz, + // aquamarine, quartz, Sin's Rebirth, + //Coruscating Elixir, Forbidden Taste,Rumi's Concoction + //MODS: iron skin, reflexes, gluttony, + // craving, resistance Utility, //Doedre's Elixir, Zerphi's Last Breath, Lavianga's Spirit Speedrun, //quick silver, MOD: adrenaline, Offense, //silver, sulphur, basalt, diamond,Taste of Hate, - //Kiara's Determination, Lion's Roar, The Overflowing Chalice, - //The Sorrow of the Divine,Rotgut, Witchfire Brew, Atziri's Promise, - //Dying Sun,Vessel of Vinktar - //MOD: Fending + //Kiara's Determination, Lion's Roar, The Overflowing Chalice, + //The Sorrow of the Divine,Rotgut, Witchfire Brew, Atziri's Promise, + //Dying Sun,Vessel of Vinktar + //MOD: Fending PoisonImmune, // MOD: curing FreezeImmune, // MOD: heat IgniteImmune, // MOD: dousing ShockImmune, // MOD: grounding BleedImmune, // MOD: staunching + CorruptedBloodAndBleedImmune, CurseImmune, // MOD: warding + MaimAndHinderImmune, UniqueFlask, // All the milk shakes OFFENSE_AND_SPEEDRUN,//Silver Flask, for SpeedFlaskLogic and OffensiveFlask } -} +} \ No newline at end of file diff --git a/src/TreeRoutine/FlaskComponents/FlaskInformation.cs b/TreeRoutine/FlaskComponents/FlaskInformation.cs similarity index 100% rename from src/TreeRoutine/FlaskComponents/FlaskInformation.cs rename to TreeRoutine/FlaskComponents/FlaskInformation.cs diff --git a/src/TreeRoutine/FlaskComponents/MiscBuffInfo.cs b/TreeRoutine/FlaskComponents/MiscBuffInfo.cs similarity index 100% rename from src/TreeRoutine/FlaskComponents/MiscBuffInfo.cs rename to TreeRoutine/FlaskComponents/MiscBuffInfo.cs diff --git a/src/TreeRoutine/FlaskComponents/PlayerFlask.cs b/TreeRoutine/FlaskComponents/PlayerFlask.cs similarity index 96% rename from src/TreeRoutine/FlaskComponents/PlayerFlask.cs rename to TreeRoutine/FlaskComponents/PlayerFlask.cs index 7e1a432..28d9f4e 100644 --- a/src/TreeRoutine/FlaskComponents/PlayerFlask.cs +++ b/TreeRoutine/FlaskComponents/PlayerFlask.cs @@ -20,6 +20,7 @@ public class PlayerFlask public int Index { get; set; } = 0; public String Name { get; set; } = "None"; public int TotalUses { get; set; } = 0; + public bool IsFull { get; set; } public String BuffString1 { get; set; } = ""; //For Hybrid Flask as Hybrid flask have two buffs. public String BuffString2 { get; set; } = ""; diff --git a/src/TreeRoutine/Menu/ImGuiExtension.cs b/TreeRoutine/Menu/ImGuiExtension.cs similarity index 100% rename from src/TreeRoutine/Menu/ImGuiExtension.cs rename to TreeRoutine/Menu/ImGuiExtension.cs diff --git a/src/TreeRoutine/TreeSharp/Action.cs b/TreeRoutine/TreeSharp/Action.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/Action.cs rename to TreeRoutine/TreeSharp/Action.cs diff --git a/src/TreeRoutine/TreeSharp/Composite.cs b/TreeRoutine/TreeSharp/Composite.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/Composite.cs rename to TreeRoutine/TreeSharp/Composite.cs diff --git a/src/TreeRoutine/TreeSharp/Decorator.cs b/TreeRoutine/TreeSharp/Decorator.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/Decorator.cs rename to TreeRoutine/TreeSharp/Decorator.cs diff --git a/src/TreeRoutine/TreeSharp/DecoratorContinue.cs b/TreeRoutine/TreeSharp/DecoratorContinue.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/DecoratorContinue.cs rename to TreeRoutine/TreeSharp/DecoratorContinue.cs diff --git a/src/TreeRoutine/TreeSharp/GroupComposite.cs b/TreeRoutine/TreeSharp/GroupComposite.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/GroupComposite.cs rename to TreeRoutine/TreeSharp/GroupComposite.cs diff --git a/src/TreeRoutine/TreeSharp/Interrupt.cs b/TreeRoutine/TreeSharp/Interrupt.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/Interrupt.cs rename to TreeRoutine/TreeSharp/Interrupt.cs diff --git a/src/TreeRoutine/TreeSharp/Inverter.cs b/TreeRoutine/TreeSharp/Inverter.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/Inverter.cs rename to TreeRoutine/TreeSharp/Inverter.cs diff --git a/src/TreeRoutine/TreeSharp/Parallel.cs b/TreeRoutine/TreeSharp/Parallel.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/Parallel.cs rename to TreeRoutine/TreeSharp/Parallel.cs diff --git a/src/TreeRoutine/TreeSharp/ParallelSelector.cs b/TreeRoutine/TreeSharp/ParallelSelector.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/ParallelSelector.cs rename to TreeRoutine/TreeSharp/ParallelSelector.cs diff --git a/src/TreeRoutine/TreeSharp/PrioritySelector.cs b/TreeRoutine/TreeSharp/PrioritySelector.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/PrioritySelector.cs rename to TreeRoutine/TreeSharp/PrioritySelector.cs diff --git a/src/TreeRoutine/TreeSharp/RandomSelector.cs b/TreeRoutine/TreeSharp/RandomSelector.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/RandomSelector.cs rename to TreeRoutine/TreeSharp/RandomSelector.cs diff --git a/src/TreeRoutine/TreeSharp/RunStatus.cs b/TreeRoutine/TreeSharp/RunStatus.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/RunStatus.cs rename to TreeRoutine/TreeSharp/RunStatus.cs diff --git a/src/TreeRoutine/TreeSharp/Selector.cs b/TreeRoutine/TreeSharp/Selector.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/Selector.cs rename to TreeRoutine/TreeSharp/Selector.cs diff --git a/src/TreeRoutine/TreeSharp/Sequence.cs b/TreeRoutine/TreeSharp/Sequence.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/Sequence.cs rename to TreeRoutine/TreeSharp/Sequence.cs diff --git a/src/TreeRoutine/TreeSharp/Switch.cs b/TreeRoutine/TreeSharp/Switch.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/Switch.cs rename to TreeRoutine/TreeSharp/Switch.cs diff --git a/src/TreeRoutine/TreeSharp/UntilFailure.cs b/TreeRoutine/TreeSharp/UntilFailure.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/UntilFailure.cs rename to TreeRoutine/TreeSharp/UntilFailure.cs diff --git a/src/TreeRoutine/TreeSharp/UntilSuccess.cs b/TreeRoutine/TreeSharp/UntilSuccess.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/UntilSuccess.cs rename to TreeRoutine/TreeSharp/UntilSuccess.cs diff --git a/src/TreeRoutine/TreeSharp/Wait.cs b/TreeRoutine/TreeSharp/Wait.cs similarity index 100% rename from src/TreeRoutine/TreeSharp/Wait.cs rename to TreeRoutine/TreeSharp/Wait.cs diff --git a/src/config/FlaskBuffDetails.json b/config/FlaskBuffDetails.json similarity index 98% rename from src/config/FlaskBuffDetails.json rename to config/FlaskBuffDetails.json index 0d745e5..3425110 100644 --- a/src/config/FlaskBuffDetails.json +++ b/config/FlaskBuffDetails.json @@ -52,6 +52,6 @@ "Large Hybrid Flask": "flask_effect_mana", "Colossal Hybrid Flask": "flask_effect_mana", "Sacred Hybrid Flask": "flask_effect_mana", - "Hallowed Hybrid Flask": "flask_effect_mana", + "Hallowed Hybrid Flask": "flask_effect_mana" } } \ No newline at end of file diff --git a/config/debuffPanel.json b/config/debuffPanel.json new file mode 100644 index 0000000..41487cd --- /dev/null +++ b/config/debuffPanel.json @@ -0,0 +1,86 @@ +/* +Filter: +0 - any +1 - hostiles +2 - players & minions +*/ +{ + "Bleeding": { + "puncture": 0, + "puncture_moving": 0, + "physical_damage_and_bleed": 0, + "bleeding": 0 + }, + "Corruption": { + "corrupted_blood": 0, + "corrupted_blood_rain": 0 + }, + "Poisoned": { + "poison": 0, + "viper_strike_orb": 0, + "monster_aura_pus_puke_degen": 2, + "monster_aura_chaos_degen": 2, + "monster_aura_physical_degen": 2, + "ground_desecration": 0, + "caustic_cloud": 0, + "chaos_bond_in_beam": 0 + }, + "Frozen": { + "frozen": 0, + "cold_damage_and_freeze": 0 + }, + "Chilled": { + "chilled": 0, + "ground_ice_chill": 0, + "chilling_bond_in_beam": 0, + "monster_aura_chill": 2 + }, + "Burning": { + "ground_fire_burn": 0, + "ignited": 0, + "searing_bond_in_beam": 0, + "fire_damage_and_ignite": 0, + "monster_aura_burning": 2, + "demon_righteous_fire_aura": 2, + "righteous_fire_aura": 2 + }, + "Shocked": { + "shocked": 0, + "ground_lightning_shock": 0, + "seawitch_lightning_beam": 0, + "lightning_damage_and_shock": 0, + "monster_aura_shock": 2 + }, + "Maimed": { + "maimed": 0 + }, + "Hindered": { + "hindered": 0 + }, + "WeakenedSlowed": { + "monster_aura_slow": 2, + "curse_enfeeble": 0, + "curse_temporal_chains": 0, + "curse_elemental_weakness": 0, + "curse_fire_weakness": 0, + "curse_cold_weakness": 0, + "curse_lightning_weakness": 0, + "curse_warlords_mark": 0, + "curse_punishment": 0, + "curse_assassins_mark": 0, + "curse_projectile_weakness": 0, + "curse_vulnerability": 0, + "curse_poachers_mark": 0, + "beartrap_debuff": 0, + "ground_tar_slow": 0, + "blinded": 0, + "frozen_damage_increase": 0, + "piety_transformed_debuff": 0, + "ground_smoke_blind": 0, + "curse_silence": 0, + "sea_witch_screech_debuff": 0, + "pinned": 0, + "bleeding_movespeed_penalty": 0, + "stun_display_buff": 0 + } +} \ No newline at end of file diff --git a/config/flaskinfo.json b/config/flaskinfo.json new file mode 100644 index 0000000..8a7b53b --- /dev/null +++ b/config/flaskinfo.json @@ -0,0 +1,242 @@ +/* + IGNORE = 0, // ignore mods/flask type/flask name and don't give error + NONE = 1, // mod/flask type/flask name isn't found. + LIFE = 2, + MANA = 3, + HYBRID = 4, + DEFENSE = 5, + UTILITY = 6, // Doesn't actually function. + SPEEDRUN = 7, // Quicksilver Flask. Mods: of the Hare/Lynx/Cheetah + OFFENSE = 8, // Types: Sulphur Flask, Basalt Flask, Diamond Flask, and more + // Unique Names: Taste of Hate, Dying Sun Bottled Faith, Witchfire Brew, and more + // MOD: of Stinging/Piercing/Rupturing/Penetrating/Incision (Increased Crit Chance during Flask Effect) + POISON_IMMUNE = 9, // of the Skunk/Hedgehog/Opossum (Utility Flask), of the AntiToxin/Remedy/Cure/Antidote (Other Flasks) + FREEZE_IMMUNE = 10, // of the Dear/Walrus/Penguin (Utility Flask), of Convection/Thermodynamics/Entropy/Thawing (Other Flasks) + IGNITE_IMMUNE = 11, // of the Urchin/Mussel/Starfish (Utility Flask), of Damping/Quashing/Quelling/Quenching (Other Flasks) + SHOCK_IMMUNE = 12, // of the Conger/Moray/Eel (Utility Flask), of Earthing/Grounding/Insulation/the Dielectric (Other Flasks) + BLEED_IMMUNE = 13, // of the Lizard/Skink/Iguana (Utility Flask), of Sealing/Alleviation/Allaying/Assuaging (Other Flasks) + CORRUPTED_BLOOD_AND_BLEED_IMMUNE = 14 + + CURSE_IMMUNE = 15, // of Warding + MAIM_AND_HINDER_IMMUNE = 16 + UNIQUE_FLASK = 17, // Doesn't actually function. + OFFENSE_AND_SPEEDRUN = 18 // Silver flask (Onslaught provides movement and attack speed) +*/ + +{ + "UniqueFlaskNames": { + "Blood of the Karui": 2, + + "Doedre's Elixir": 3, + "Lavianga's Spirit": 3, + "Zerphi's Last Breath": 3, + + "Coruscating Elixir": 5, + "Forbidden Taste": 2, + "Rumi's Concoction": 5, + "Sin's Rebirth": 5, + + "Divination Distillate": 6, + "The Writhing Jar": 6, + "Coralito's Signature": 6, + + "Atziri's Promise": 8, + "Dying Sun": 8, + "Kiara's Determination": 8, + "Lion's Roar": 8, + "Rotgut": 18, + "Taste of Hate": 8, + "The Overflowing Chalice": 8, + "The Sorrow of the Divine": 8, + "Vessel of Vinktar": 8, + "The Wise Oak": 8, + "Witchfire Brew": 8, + "Soul Ripper": 5, + "Soul Catcher": 5, + "Cinderswallow Urn": 18 + }, + "FlaskTypes": { + "Small Life Flask": 2, + "Medium Life Flask": 2, + "Large Life Flask": 2, + "Greater Life Flask": 2, + "Grand Life Flask": 2, + "Giant Life Flask": 2, + "Colossal Life Flask": 2, + "Sacred Life Flask": 2, + "Hallowed Life Flask": 2, + "Sanctified Life Flask": 2, + "Divine Life Flask": 2, + "Eternal Life Flask": 2, + + "Small Mana Flask": 3, + "Medium Mana Flask": 3, + "Large Mana Flask": 3, + "Greater Mana Flask": 3, + "Grand Mana Flask": 3, + "Giant Mana Flask": 3, + "Colossal Mana Flask": 3, + "Sacred Mana Flask": 3, + "Hallowed Mana Flask": 3, + "Sanctified Mana Flask": 3, + "Divine Mana Flask": 3, + "Eternal Mana Flask": 3, + + "Medium Hybrid Flask": 4, + "Large Hybrid Flask": 4, + "Colossal Hybrid Flask": 4, + "Sacred Hybrid Flask": 4, + "Hallowed Hybrid Flask": 4, + + "Quicksilver Flask": 7, + "Bismuth Flask": 5, + "Stibnite Flask": 5, + "Ruby Flask": 5, + "Sapphire Flask": 5, + "Amethyst Flask": 5, + "Topaz Flask": 5, + "Silver Flask": 18, + "Aquamarine Flask": 5, + "Granite Flask": 5, + "Jade Flask": 5, + "Quartz Flask": 5, + "Sulphur Flask": 8, + "Basalt Flask": 5, + "Diamond Flask": 8, + "Corundum Flask": 5, + "Gold Flask": 6, + "Iron Flask": 5 + }, + "FlaskMods": { + "FlaskLevelRequirement": 0, + "UtilityFlaskChilledGround": 0, + "UtilityFlaskConsecrate": 0, + "UtilityFlaskOnslaught": 0, + "UtilityFlaskSmokeCloud": 0, + "UtilityFlaskTaunt": 0, + "UtilityFlaskWard": 0, + + "FlaskBuffReducedManaCostWhileHealing": 0, + "FlaskChanceRechargeOnCrit": 0, + "FlaskChargesAddedIncreasePercent": 0, + "FlaskChargesUsed": 0, + "FlaskEffectNotRemovedOnFullMana": 0, + "FlaskEffectReducedDuration": 0, + "FlaskExtraCharges": 0, + "FlaskExtraLifeCostsMana": 0, + "FlaskExtraManaCostsLife": 0, + "FlaskFullInstantRecovery": 0, + "FlaskFullRechargeOnHit": 0, + "FlaskIncreasedDuration": 0, + "FlaskIncreasedHealingCharges": 0, + "FlaskIncreasedRecoveryAmount": 0, + "FlaskIncreasedRecoveryOnLowLife": 0, + "FlaskIncreasedRecoveryReducedEffect": 0, + "FlaskIncreasedRecoverySpeed": 0, + "FlaskInstantRecoveryOnLowLife": 0, + "FlaskManaRecoveryAtEnd": 0, + "FlaskPartialInstantRecovery": 0, + "LocalLifeFlaskAdditionalLifeRecovery": 0, + "FlaskRemovesBleeding": 13, + "FlaskBleedCorruptingBloodImmunity": 14, + "FlaskBleedingAndCorruptedBloodImmunityDuringEffect": 14, + "FlaskBuffArmourWhileHealing": 5, + "FlaskBuffArmourWhileHealing1": 5, + "FlaskBuffAttackLifeLeechWhileHealing": 5, + "FlaskBuffAttackLifeLeechWhileHealing1": 5, + "FlaskBuffAttackSpeedWhileHealing": 8, + "FlaskBuffAvoidChillFreeze": 10, + "FlaskBuffAvoidIgnite": 11, + "FlaskBuffAvoidShock": 12, + "FlaskBuffAvoidStunWhileHealing": 5, + "FlaskBuffCastSpeedWhileHealing": 8, + "FlaskBuffChillFreezeDuration": 8, + "FlaskBuffCriticalChanceWhileHealing": 8, + "FlaskBuffEvasionWhileHealing": 5, + "FlaskBuffFreezeShockIgniteChanceWhileHealing": 8, + "FlaskBuffMovementSpeedWhileHealing": 7, + "FlaskBuffResistancesWhileHealing": 5, + "FlaskBuffShockEffect": 12, + "FlaskBuffSpellEnergyShieldLeechWhileHealing": 5, + "FlaskBuffStunRecoveryWhileHealing": 5, + "FlaskBuffWardWhileHealing": 5, + "FlaskChillFreezeImmunity": 10, + "FlaskCurseImmunity": 15, + "FlaskBuffCurseEffect": 15, + "FlaskFreezeAndChillImmunityDuringEffect": 10, + "FlaskHealsMinions": 0, + "FlaskIgniteImmunity": 11, + "FlaskIgniteImmunityDuringEffect": 11, + "FlaskPoisonImmunity": 9, + "FlaskPoisonImmunityDuringEffect": 9, + "FlaskShockImmunity": 12, + "FlaskShockImmunityDuringEffect": 12, + "LocalFlaskImmuneToMaimAndHinder": 16, + "LocalLifeFlaskHinderNearbyEnemies": 5, + "LocalManaFlaskHinderNearbyEnemies": 5, + + "FlaskEnchantmentInjectorAdjacentFlasks": 0, + "FlaskEnchantmentInjectorFlaskEffectEnd": 0, + "FlaskEnchantmentInjectorOnAffectedByBleed": 0, + "FlaskEnchantmentInjectorOnAffectedByChill": 0, + "FlaskEnchantmentInjectorOnAffectedByFreeze": 0, + "FlaskEnchantmentInjectorOnAffectedByIgnite": 0, + "FlaskEnchantmentInjectorOnAffectedByPoison": 0, + "FlaskEnchantmentInjectorOnAffectedByShock": 0, + "FlaskEnchantmentInjectorOnDamageBlocked": 0, + "FlaskEnchantmentInjectorOnFullCharges": 0, + "FlaskEnchantmentInjectorOnGuardSkillUsed": 0, + "FlaskEnchantmentInjectorOnHittingRareOrUnique": 0, + "FlaskEnchantmentInjectorOnTakingSavageHit": 0, + "FlaskEnchantmentInjectorOnTravelSkillUsed": 0, + "FlaskEnchantmentInjectorOnUsingLifeFlask": 0, + + "FlaskEnchantmentSealIncreasedChargesGained": 0, + "FlaskEnchantmentSealIncreasedDuration": 0, + "FlaskEnchantmentSealIncreasedEffect": 0, + "FlaskEnchantmentSealMaximumCharges": 0, + "FlaskEnchantmentSealReducedChargesUsed": 0, + + "JunMaster2LocalFlaskAvoidStunChanceAndMovementSpeedDuringFlaskEffect1__": 7, + "JunMaster2LocalFlaskAvoidStunChanceDuringFlaskEffect1": 5, + "JunMaster2LocalFlaskCriticalStrikeChanceDuringFlaskEffect1": 8, + "JunMaster2LocalFlaskItemFoundRarityDuringFlaskEffect1": 6, + "JunMaster2LocalFlaskLifeLeechOnDamageTakenPermyriadDuringFlaskEffect1": 5, + "JunMaster2LocalFlaskLifeRegenerationPerMinuteDuringFlaskEffect1_": 5, + "JunMaster2LocalFlaskSkillManaCostDuringFlaskEffect1": 8, + + "JunMasterLocalFlaskAvoidStunChanceAndMovementSpeedDuringFlaskEffect1": 7, + "JunMasterLocalFlaskCriticalStrikeChanceDuringFlaskEffect1": 8, + "JunMasterLocalFlaskItemFoundRarityDuringFlaskEffect1": 6, + "JunMasterLocalFlaskLifeLeechOnDamageTakenPermyriadDuringFlaskEffect1": 5, + "JunMasterLocalFlaskLifeRegenerationPerMinuteDuringFlaskEffect1": 5, + "JunMasterLocalFlaskSkillManaCostDuringFlaskEffect1": 8, + + "HarvestFlaskEnchantmentChargesUsedLoweredOnUse4": 0, + "HarvestFlaskEnchantmentDurationEffectLoweredOnUse2": 0, + "HarvestFlaskEnchantmentDurationLoweredOnUse1": 0, + "HarvestFlaskEnchantmentMaximumChargesLoweredOnUse3": 0, + + "FlaskLevelRequirement14Real": 0, + "FlaskLevelRequirementHybrid": 0, + "FlaskLevelRequirementUtilityResists": 0, + + "FlaskFullRechargeOnCrit": 0, + "FlaskFullRechargeOnTakeCrit": 0, + + "FlaskBuffManaLeechPermyriadWhileHealing": 0, + "FlaskBuffLifeLeechPermyriadWhileHealing": 0, + "FlaskBuffKnockbackWhileHealing": 0, + "FlaskDispellsPoison": 9, + "FlaskDispellsChill": 10, + "FlaskDispellsBurning": 11, + "FlaskDurationConsumedPerUse": 0, + "FlaskRemovesShock": 12, + + "JunMasterLocalFlaskLifeLeechOnDamageTakenPermyriadDuringFlaskEffect": 2, + "JunMasterLocalFlaskItemFoundRarityDuringFlaskEffect": 0, + "JunMasterLocalFlaskSkillManaCostDuringFlaskEffect": 8, + "JunMasterLocalFlaskAvoidStunChanceAndMovementSpeedDuringFlaskEffect": 7, + "JunMasterLocalFlaskLifeRegenerationPerMinuteDuringFlaskEffect": 8 + } +} \ No newline at end of file diff --git a/src/config/languages/Readme.txt b/config/languages/Readme.txt similarity index 100% rename from src/config/languages/Readme.txt rename to config/languages/Readme.txt diff --git a/src/config/languages/Russian/FlaskBuffDetails.json b/config/languages/Russian/FlaskBuffDetails.json similarity index 100% rename from src/config/languages/Russian/FlaskBuffDetails.json rename to config/languages/Russian/FlaskBuffDetails.json diff --git a/config/languages/Russian/flaskinfo.json b/config/languages/Russian/flaskinfo.json new file mode 100644 index 0000000..a60850d --- /dev/null +++ b/config/languages/Russian/flaskinfo.json @@ -0,0 +1,332 @@ +/* + IGNORE = 0, // ignore mods/flask type/flask name and don't give error + NONE = 1, // mod/flask type/flask name isn't found. + LIFE = 2, + MANA = 3, + HYBRID = 4, + DEFENSE = 5, + UTILITY = 6, // Doesn't actually function. + SPEEDRUN = 7, // Quicksilver Flask. Mods: of the Hare/Lynx/Cheetah + OFFENSE = 8, // Types: Sulphur Flask, Basalt Flask, Diamond Flask, and more + // Unique Names: Taste of Hate, Dying Sun Bottled Faith, Witchfire Brew, and more + // MOD: of Stinging/Piercing/Rupturing/Penetrating/Incision (Increased Crit Chance during Flask Effect) + POISON_IMMUNE = 9, // of the Skunk/Hedgehog/Opossum (Utility Flask), of the AntiToxin/Remedy/Cure/Antidote (Other Flasks) + FREEZE_IMMUNE = 10, // of the Dear/Walrus/Penguin (Utility Flask), of Convection/Thermodynamics/Entropy/Thawing (Other Flasks) + IGNITE_IMMUNE = 11, // of the Urchin/Mussel/Starfish (Utility Flask), of Damping/Quashing/Quelling/Quenching (Other Flasks) + SHOCK_IMMUNE = 12, // of the Conger/Moray/Eel (Utility Flask), of Earthing/Grounding/Insulation/the Dielectric (Other Flasks) + // of the Lizard/Skink/Iguana (Utility Flask), of Sealing/Alleviation/Allaying/Assuaging (Other Flasks) + BLEED_IMMUNE = 13, + CORRUPTED_BLOOD_AND_BLEED_IMMUNE = 14 + // of Warding + CURSE_IMMUNE = 15, + MAIM_AND_HINDER_IMMUNE = 16 + UNIQUE_FLASK = 17, // Doesn't actually function. + OFFENSE_AND_SPEEDRUN = 18 // Silver flask (Onslaught provides movement and attack speed) +*/ + + +{ + "UniqueFlaskNames": { + "Blood of the Karui": 2, + + "Doedre's Elixir": 3, + "Lavianga's Spirit": 3, + "Zerphi's Last Breath": 3, + + "Coruscating Elixir": 5, + "Forbidden Taste": 2, + "Rumi's Concoction": 5, + "Sin's Rebirth": 5, + + "Divination Distillate": 6, + "The Writhing Jar": 6, + "Coralito's Signature": 6, + + "Atziri's Promise": 8, + "Dying Sun": 8, + "Kiara's Determination": 8, + "Lion's Roar": 8, + "Rotgut": 8, + "Taste of Hate": 8, + "The Overflowing Chalice": 8, + "The Sorrow of the Divine": 8, + "Vessel of Vinktar": 8, + "The Wise Oak": 8, + "Witchfire Brew": 8, + "Soul Ripper": 5, + "Soul Catcher": 5, + "Cinderswallow Urn": 18, + + //ru names: + + "Кровь каруи": 2, + + "Эликсир Дэрии": 3, + "Дух Лавианги": 3, + "Последний вздох Зебуми": 3, + + "Сверкающий эликсир": 5, + "Запретный вкус": 2, + "Отвар Руми": 5, + "Возрождение греха": 5, + + "Чистое прорицание": 6, + "Сосуд страданий": 6, + "Почерк Корнелия": 6, + + "Обещание Азири": 8, + "Умирающее солнце": 8, + "Решимость Киары": 8, + "Львиный рев": 8, + "Пойло": 8, + "Вкус ненависти": 8, + "Переполненная чаша": 8, + "Печаль божества": 8, + "Сосуд Винктара": 8, + "Мудный дуб": 8, + "Отвар ведьмовского огня": 8, + "Жнец душ": 5, + "Душелов": 5, + "Урна глотателя пепла": 18 + }, + + "FlaskTypes": { + "Small Life Flask": 2, + "Medium Life Flask": 2, + "Large Life Flask": 2, + "Greater Life Flask": 2, + "Grand Life Flask": 2, + "Giant Life Flask": 2, + "Colossal Life Flask": 2, + "Sacred Life Flask": 2, + "Hallowed Life Flask": 2, + "Sanctified Life Flask": 2, + "Divine Life Flask": 2, + "Eternal Life Flask": 2, + + "Малый флакон жизни": 2, + "Средний флакон жизни": 2, + "Большой флакон жизни": 2, + "Вместительный флакон жизни": 2, + "Огромный флакон жизни": 2, + "Гигантский флакон жизни": 2, + "Великий флакон жизни": 2, + "Освященный флакон жизни": 2, + "Благодатный флакон жизни": 2, + "Святой флакон жизни": 2, + "Божественный флакон жизни": 2, + "Вечный флакон жизни": 2, + + "Small Mana Flask": 3, + "Medium Mana Flask": 3, + "Large Mana Flask": 3, + "Greater Mana Flask": 3, + "Grand Mana Flask": 3, + "Giant Mana Flask": 3, + "Colossal Mana Flask": 3, + "Sacred Mana Flask": 3, + "Hallowed Mana Flask": 3, + "Sanctified Mana Flask": 3, + "Divine Mana Flask": 3, + "Eternal Mana Flask": 3, + + "Малый флакон маны": 3, + "Средний флакон маны": 3, + "Большой флакон маны": 3, + "Вместительный флакон маны": 3, + "Огромный флакон маны": 3, + "Гигантский флакон маны": 3, + "Великий флакон маны": 3, + "Освященный флакон маны": 3, + "Благодатный флакон маны": 3, + "Святой флакон маны": 3, + "Божественный флакон маны": 3, + "Вечный флакон маны": 3, + + "Medium Hybrid Flask": 4, + "Large Hybrid Flask": 4, + "Colossal Hybrid Flask": 4, + "Sacred Hybrid Flask": 4, + "Hallowed Hybrid Flask": 4, + + "Малый флакон равновесия": 4, + "Средний флакон равновесия": 4, + "Большой флакон равновесия": 4, + "Великий флакон равновесия": 4, + "Освященный флакон равновесия": 4, + "Благодатный флакон равновесия": 4, + + "Quicksilver Flask": 7, + "Bismuth Flask": 5, + "Stibnite Flask": 5, + "Ruby Flask": 5, + "Sapphire Flask": 5, + "Amethyst Flask": 5, + "Topaz Flask": 5, + "Silver Flask": 18, + "Aquamarine Flask": 5, + "Granite Flask": 5, + "Jade Flask": 5, + "Quartz Flask": 5, + "Sulphur Flask": 8, + "Basalt Flask": 5, + "Diamond Flask": 8, + "Corundum Flask": 5, + "Gold Flask": 6, + "Iron Flask": 5, + + //in the same order ru names: + + "Ртутный флакон": 7, + "Висмутовый флакон": 5, + "Стибнитовый флакон": 5, + "Рубиновый флакон": 5, + "Сапфировый флакон": 5, + "Аметистовый флакон": 5, + "Топазовый флакон": 5, + "Серебряный флакон": 18, + "Аквамариновый флакон": 5, + "Гранитный флакон": 5, + "Нефритовый флакон": 5, + "Кварцевый флакон": 5, + "Серный флакон": 8, + "Базальтовый флакон": 5, + "Алмазный флакон": 8, + "Корундовый флакон": 5, + "Золотой флакон": 6, + "Железный флакон": 5 + + }, + "FlaskMods": { + "FlaskLevelRequirement": 0, + "UtilityFlaskChilledGround": 0, + "UtilityFlaskConsecrate": 0, + "UtilityFlaskOnslaught": 0, + "UtilityFlaskSmokeCloud": 0, + "UtilityFlaskTaunt": 0, + "UtilityFlaskWard": 0, + + "FlaskBuffReducedManaCostWhileHealing": 0, + "FlaskChanceRechargeOnCrit": 0, + "FlaskChargesAddedIncreasePercent": 0, + "FlaskChargesUsed": 0, + "FlaskEffectNotRemovedOnFullMana": 0, + "FlaskEffectReducedDuration": 0, + "FlaskExtraCharges": 0, + "FlaskExtraLifeCostsMana": 0, + "FlaskExtraManaCostsLife": 0, + "FlaskFullInstantRecovery": 0, + "FlaskFullRechargeOnHit": 0, + "FlaskIncreasedDuration": 0, + "FlaskIncreasedHealingCharges": 0, + "FlaskIncreasedRecoveryAmount": 0, + "FlaskIncreasedRecoveryOnLowLife": 0, + "FlaskIncreasedRecoveryReducedEffect": 0, + "FlaskIncreasedRecoverySpeed": 0, + "FlaskInstantRecoveryOnLowLife": 0, + "FlaskManaRecoveryAtEnd": 0, + "FlaskPartialInstantRecovery": 0, + "LocalLifeFlaskAdditionalLifeRecovery": 0, + "FlaskRemovesBleeding": 13, + "FlaskBleedCorruptingBloodImmunity": 14, + "FlaskBleedingAndCorruptedBloodImmunityDuringEffect": 14, + "FlaskBuffArmourWhileHealing": 5, + "FlaskBuffArmourWhileHealing1": 5, + "FlaskBuffAttackLifeLeechWhileHealing": 5, + "FlaskBuffAttackLifeLeechWhileHealing1": 5, + "FlaskBuffAttackSpeedWhileHealing": 8, + "FlaskBuffAvoidChillFreeze": 10, + "FlaskBuffAvoidIgnite": 11, + "FlaskBuffAvoidShock": 12, + "FlaskBuffAvoidStunWhileHealing": 5, + "FlaskBuffCastSpeedWhileHealing": 8, + "FlaskBuffChillFreezeDuration": 8, + "FlaskBuffCriticalChanceWhileHealing": 8, + "FlaskBuffEvasionWhileHealing": 5, + "FlaskBuffFreezeShockIgniteChanceWhileHealing": 8, + "FlaskBuffMovementSpeedWhileHealing": 7, + "FlaskBuffResistancesWhileHealing": 5, + "FlaskBuffShockEffect": 12, + "FlaskBuffSpellEnergyShieldLeechWhileHealing": 5, + "FlaskBuffStunRecoveryWhileHealing": 5, + "FlaskBuffWardWhileHealing": 5, + "FlaskChillFreezeImmunity": 10, + "FlaskCurseImmunity": 15, + "FlaskBuffCurseEffect": 15, + "FlaskFreezeAndChillImmunityDuringEffect": 10, + "FlaskHealsMinions": 0, + "FlaskIgniteImmunity": 11, + "FlaskIgniteImmunityDuringEffect": 11, + "FlaskPoisonImmunity": 9, + "FlaskPoisonImmunityDuringEffect": 9, + "FlaskShockImmunity": 12, + "FlaskShockImmunityDuringEffect": 12, + "LocalFlaskImmuneToMaimAndHinder": 16, + "LocalLifeFlaskHinderNearbyEnemies": 5, + "LocalManaFlaskHinderNearbyEnemies": 5, + + "FlaskEnchantmentInjectorAdjacentFlasks": 0, + "FlaskEnchantmentInjectorFlaskEffectEnd": 0, + "FlaskEnchantmentInjectorOnAffectedByBleed": 0, + "FlaskEnchantmentInjectorOnAffectedByChill": 0, + "FlaskEnchantmentInjectorOnAffectedByFreeze": 0, + "FlaskEnchantmentInjectorOnAffectedByIgnite": 0, + "FlaskEnchantmentInjectorOnAffectedByPoison": 0, + "FlaskEnchantmentInjectorOnAffectedByShock": 0, + "FlaskEnchantmentInjectorOnDamageBlocked": 0, + "FlaskEnchantmentInjectorOnFullCharges": 0, + "FlaskEnchantmentInjectorOnGuardSkillUsed": 0, + "FlaskEnchantmentInjectorOnHittingRareOrUnique": 0, + "FlaskEnchantmentInjectorOnTakingSavageHit": 0, + "FlaskEnchantmentInjectorOnTravelSkillUsed": 0, + "FlaskEnchantmentInjectorOnUsingLifeFlask": 0, + + "FlaskEnchantmentSealIncreasedChargesGained": 0, + "FlaskEnchantmentSealIncreasedDuration": 0, + "FlaskEnchantmentSealIncreasedEffect": 0, + "FlaskEnchantmentSealMaximumCharges": 0, + "FlaskEnchantmentSealReducedChargesUsed": 0, + + "JunMaster2LocalFlaskAvoidStunChanceAndMovementSpeedDuringFlaskEffect1__": 7, + "JunMaster2LocalFlaskAvoidStunChanceDuringFlaskEffect1": 5, + "JunMaster2LocalFlaskCriticalStrikeChanceDuringFlaskEffect1": 8, + "JunMaster2LocalFlaskItemFoundRarityDuringFlaskEffect1": 6, + "JunMaster2LocalFlaskLifeLeechOnDamageTakenPermyriadDuringFlaskEffect1": 5, + "JunMaster2LocalFlaskLifeRegenerationPerMinuteDuringFlaskEffect1_": 5, + "JunMaster2LocalFlaskSkillManaCostDuringFlaskEffect1": 8, + + "JunMasterLocalFlaskAvoidStunChanceAndMovementSpeedDuringFlaskEffect1": 7, + "JunMasterLocalFlaskCriticalStrikeChanceDuringFlaskEffect1": 8, + "JunMasterLocalFlaskItemFoundRarityDuringFlaskEffect1": 6, + "JunMasterLocalFlaskLifeLeechOnDamageTakenPermyriadDuringFlaskEffect1": 5, + "JunMasterLocalFlaskLifeRegenerationPerMinuteDuringFlaskEffect1": 5, + "JunMasterLocalFlaskSkillManaCostDuringFlaskEffect1": 8, + + "HarvestFlaskEnchantmentChargesUsedLoweredOnUse4": 0, + "HarvestFlaskEnchantmentDurationEffectLoweredOnUse2": 0, + "HarvestFlaskEnchantmentDurationLoweredOnUse1": 0, + "HarvestFlaskEnchantmentMaximumChargesLoweredOnUse3": 0, + + "FlaskLevelRequirement14Real": 0, + "FlaskLevelRequirementHybrid": 0, + "FlaskLevelRequirementUtilityResists": 0, + + "FlaskFullRechargeOnCrit": 0, + "FlaskFullRechargeOnTakeCrit": 0, + + "FlaskBuffManaLeechPermyriadWhileHealing": 0, + "FlaskBuffLifeLeechPermyriadWhileHealing": 0, + "FlaskBuffKnockbackWhileHealing": 0, + "FlaskDispellsPoison": 9, + "FlaskDispellsChill": 10, + "FlaskDispellsBurning": 11, + "FlaskDurationConsumedPerUse": 0, + "FlaskRemovesShock": 12, + + "JunMasterLocalFlaskLifeLeechOnDamageTakenPermyriadDuringFlaskEffect": 2, + "JunMasterLocalFlaskItemFoundRarityDuringFlaskEffect": 0, + "JunMasterLocalFlaskSkillManaCostDuringFlaskEffect": 8, + "JunMasterLocalFlaskAvoidStunChanceAndMovementSpeedDuringFlaskEffect": 7, + "JunMasterLocalFlaskLifeRegenerationPerMinuteDuringFlaskEffect": 8 + } +} \ No newline at end of file diff --git a/packages.config b/packages.config new file mode 100644 index 0000000..1c7106d --- /dev/null +++ b/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/.vs/BasicFlaskRoutine/v15/.suo b/src/.vs/BasicFlaskRoutine/v15/.suo deleted file mode 100644 index 7e3de97..0000000 Binary files a/src/.vs/BasicFlaskRoutine/v15/.suo and /dev/null differ diff --git a/src/BasicFlaskRoutine.sln b/src/BasicFlaskRoutine.sln deleted file mode 100644 index 278d43e..0000000 --- a/src/BasicFlaskRoutine.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30621.155 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicFlaskRoutine", "BasicFlaskRoutine.csproj", "{4EBA974C-AC8C-42A5-B8EE-5AD318B6D961}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4EBA974C-AC8C-42A5-B8EE-5AD318B6D961}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4EBA974C-AC8C-42A5-B8EE-5AD318B6D961}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4EBA974C-AC8C-42A5-B8EE-5AD318B6D961}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4EBA974C-AC8C-42A5-B8EE-5AD318B6D961}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {A0EAAE0E-C9D8-4025-B0AD-C0F41E743AE4} - EndGlobalSection -EndGlobal diff --git a/src/BasicFlaskRoutine/Flask/FlaskSetting.cs b/src/BasicFlaskRoutine/Flask/FlaskSetting.cs deleted file mode 100644 index 6f9027a..0000000 --- a/src/BasicFlaskRoutine/Flask/FlaskSetting.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows.Forms; -using ExileCore.Shared.Nodes; - -namespace TreeRoutine.Routine.BasicFlaskRoutine.Flask -{ - public class FlaskSetting - { - public FlaskSetting() - { - // Initializing this here seems to fix the deserialization issue with min/max values - ReservedUses = new RangeNode(0, 0, 5); - } - - public FlaskSetting (ToggleNode enabled, HotkeyNode hotkey, RangeNode reservedUses) - { - Enabled = enabled; - Hotkey = hotkey; - ReservedUses = reservedUses; - } - - public HotkeyNode Hotkey { get; set; } - public ToggleNode Enabled { get; set; } - public RangeNode ReservedUses { get; set; } - - } -} diff --git a/src/config/debuffPanel.json b/src/config/debuffPanel.json deleted file mode 100644 index 22f1929..0000000 --- a/src/config/debuffPanel.json +++ /dev/null @@ -1,80 +0,0 @@ -/* -Filter: -0 - any -1 - hostiles -2 - players & minions -*/ -{ -"Bleeding": { - "puncture":0, - "puncture_moving":0, - "physical_damage_and_bleed":0, - "bleeding":0 -}, -"Corruption": { - "corrupted_blood":0, - "corrupted_blood_rain":0 -}, -"Poisoned": { - "poison":0, - "viper_strike_orb":0, - "monster_aura_pus_puke_degen":2, - "monster_aura_chaos_degen":2, - "monster_aura_physical_degen":2, - "ground_desecration":0, - "caustic_cloud":0, - "chaos_bond_in_beam":0 -}, -"Frozen": { - "frozen":0, - "cold_damage_and_freeze":0 -}, -"Chilled": { - "chilled":0, - "ground_ice_chill":0, - "chilling_bond_in_beam":0, - "monster_aura_chill":2 -}, -"Burning": { - "ground_fire_burn":0, - "ignited":0, - "searing_bond_in_beam":0, - "fire_damage_and_ignite":0, - "monster_aura_burning":2, - "demon_righteous_fire_aura":2, - "righteous_fire_aura":2 -}, -"Shocked": { - "shocked":0, - "ground_lightning_shock":0, - "seawitch_lightning_beam":0, - "lightning_damage_and_shock":0, - "monster_aura_shock":2 -}, -"WeakenedSlowed": { - "monster_aura_slow":2, - "curse_enfeeble":0, - "curse_temporal_chains":0, - "curse_elemental_weakness":0, - "curse_fire_weakness":0, - "curse_cold_weakness":0, - "curse_lightning_weakness":0, - "curse_warlords_mark":0, - "curse_punishment":0, - "curse_assassins_mark":0, - "curse_projectile_weakness":0, - "curse_vulnerability":0, - "curse_poachers_mark":0, - "beartrap_debuff":0, - "ground_tar_slow":0, - "blinded":0, - "frozen_damage_increase":0, - "piety_transformed_debuff":0, - "ground_smoke_blind":0, - "curse_silence":0, - "sea_witch_screech_debuff":0, - "pinned":0, - "bleeding_movespeed_penalty":0, - "stun_display_buff":0 -} -} \ No newline at end of file diff --git a/src/config/flaskinfo.json b/src/config/flaskinfo.json deleted file mode 100644 index 80fed13..0000000 --- a/src/config/flaskinfo.json +++ /dev/null @@ -1,167 +0,0 @@ -/* - IGNORE = 0, // ignore mods/flask type/flask name and don't give error - NONE = 1, // mod/flask type/flask name isn't found. - LIFE = 2, - MANA = 3, - HYBRID = 4, - DEFENSE = 5, - UTILITY = 6, // Currently This type won't pop. - SPEEDRUN = 7, //quick silver, MOD: adrenaline, - OFFENSE = 8, //sulphur, basalt, diamond,Taste of Hate, - //Kiara's Determination, Lion's Roar, The Overflowing Chalice, - //The Sorrow of the Divine,Rotgut, Witchfire Brew, Atziri's Promise, - //Dying Sun,Vessel of Vinktar - //MOD: Fending - POISON_IMMUNE = 9, // MOD: curing - FREEZE_IMMUNE = 10, // MOD: heat - IGNITE_IMMUNE = 11, // MOD: dousing - SHOCK_IMMUNE = 12, // MOD: grounding - BLEED_IMMUNE = 13, // MOD: staunching - CURSE_IMMUNE = 14, // MOD: warding - UNIQUE_FLASK = 15, // Currently This type won't pop. - OFFENSE_AND_SPEEDRUN = 16 // Silver flask - // as Onslaught provide - // movement speed and attack speed -*/ - -{ - "UniqueFlaskNames": { - "Blood of the Karui": 2, - - "Doedre's Elixir": 3, - "Lavianga's Spirit": 3, - "Zerphi's Last Breath": 3, - - "Coruscating Elixir": 5, - "Forbidden Taste": 5, - "Rumi's Concoction": 5, - "Sin's Rebirth": 5, - - "Divination Distillate": 6, - "The Writhing Jar": 6, - "Coralito's Signature": 6, - - "Atziri's Promise": 8, - "Dying Sun": 8, - "Kiara's Determination": 8, - "Lion's Roar": 8, - "Rotgut": 8, - "Taste of Hate": 8, - "The Overflowing Chalice": 8, - "The Sorrow of the Divine": 8, - "Vessel of Vinktar": 8, - "The Wise Oak": 8, - "Witchfire Brew": 8, - "Soul Ripper": 5, - "Soul Catcher": 5, - "Cinderswallow Urn": 16 - }, - "FlaskTypes": { - "Small Life Flask": 2, - "Medium Life Flask": 2, - "Large Life Flask": 2, - "Greater Life Flask": 2, - "Grand Life Flask": 2, - "Giant Life Flask": 2, - "Colossal Life Flask": 2, - "Sacred Life Flask": 2, - "Hallowed Life Flask": 2, - "Sanctified Life Flask": 2, - "Divine Life Flask": 2, - "Eternal Life Flask": 2, - - "Small Mana Flask": 3, - "Medium Mana Flask": 3, - "Large Mana Flask": 3, - "Greater Mana Flask": 3, - "Grand Mana Flask": 3, - "Giant Mana Flask": 3, - "Colossal Mana Flask": 3, - "Sacred Mana Flask": 3, - "Hallowed Mana Flask": 3, - "Sanctified Mana Flask": 3, - "Divine Mana Flask": 3, - "Eternal Mana Flask": 3, - - "Medium Hybrid Flask": 4, - "Large Hybrid Flask": 4, - "Colossal Hybrid Flask": 4, - "Sacred Hybrid Flask": 4, - "Hallowed Hybrid Flask": 4, - - "Quicksilver Flask": 7, - "Bismuth Flask": 5, - "Stibnite Flask": 5, - "Ruby Flask": 5, - "Sapphire Flask": 5, - "Amethyst Flask": 5, - "Topaz Flask": 5, - "Silver Flask": 16, - "Aquamarine Flask": 5, - "Granite Flask": 5, - "Jade Flask": 5, - "Quartz Flask": 5, - "Sulphur Flask": 8, - "Basalt Flask": 5, - "Diamond Flask": 8 - }, - "FlaskMods": { - "FlaskLevelRequirement": 0, - "FlaskLevelRequirementHybrid": 0, - "FlaskLevelRequirementUtilityResists": 0, - "FlaskLevelRequirement14Real": 0, - "UtilityFlaskConsecrate": 0, - "UtilityFlaskSmokeCloud": 0, - "UtilityFlaskChilledGround": 0, - - "FlaskEffectReducedDuration": 0, - "FlaskExtraCharges": 0, - "FlaskFullRechargeOnCrit": 0, - "FlaskFullRechargeOnTakeCrit": 0, - "FlaskPartialInstantRecovery": 0, - "FlaskIncreasedRecoverySpeed": 0, - "FlaskExtraManaCostsLife": 0, - "FlaskIncreasedRecoveryOnLowLife": 0, - "FlaskChargesUsed": 0, - "FlaskIncreasedDuration": 0, - "FlaskInstantRecoveryOnLowLife": 0, - "FlaskChargesAddedIncreasePercent": 0, - "FlaskExtraLifeCostsMana": 0, - "FlaskIncreasedRecoveryAmount": 0, - "FlaskFullInstantRecovery": 0, - "FlaskChanceRechargeOnCrit": 0, - "FlaskIncreasedHealingCharges": 0, - - "FlaskHealsMinions": 0, - "FlaskBuffManaLeechPermyriadWhileHealing": 0, - "FlaskBuffLifeLeechPermyriadWhileHealing": 0, - "FlaskBuffSpellEnergyShieldLeechWhileHealing": 0, - "FlaskBuffKnockbackWhileHealing": 0, - "FlaskBuffStunRecoveryWhileHealing": 0, - "FlaskBuffMovementSpeedWhileHealing": 7, - "FlaskDispellsPoison": 9, - "FlaskDispellsBurning": 11, - "FlaskRemovesShock": 12, - "FlaskDispellsChill": 10, - "FlaskBuffArmourWhileHealing": 5, - "FlaskBuffEvasionWhileHealing": 5, - "FlaskBuffResistancesWhileHealing": 5, - "FlaskRemovesBleeding": 13, - "FlaskCurseImmunity": 14, - - "JunMasterLocalFlaskCriticalStrikeChanceDuringFlaskEffect": 8, - "JunMasterLocalFlaskLifeLeechOnDamageTakenPermyriadDuringFlaskEffect": 2, - "JunMasterLocalFlaskItemFoundRarityDuringFlaskEffect": 0, - "JunMasterLocalFlaskSkillManaCostDuringFlaskEffect": 8, - "JunMasterLocalFlaskAvoidStunChanceAndMovementSpeedDuringFlaskEffect": 7, - "JunMasterLocalFlaskLifeRegenerationPerMinuteDuringFlaskEffect": 8, - "FlaskBuffFreezeShockIgniteChanceWhileHealing": 0, - "FlaskBuffCastSpeedWhileHealing": 0, - "FlaskBuffAttackSpeedWhileHealing": 0, - "FlaskManaRecoveryAtEnd" : 0, - "FlaskBuffReducedManaCostWhileHealing" : 0, - "FlaskFullRechargeOnHit" : 0, - "FlaskEffectNotRemovedOnFullMana" : 0, - "FlaskBuffAttackLifeLeechWhileHealing" : 5 - } -} diff --git a/src/config/languages/Russian/flaskinfo.json b/src/config/languages/Russian/flaskinfo.json deleted file mode 100644 index 98a2cff..0000000 --- a/src/config/languages/Russian/flaskinfo.json +++ /dev/null @@ -1,252 +0,0 @@ -/* - IGNORE = 0, // ignore mods/flask type/flask name and don't give error - NONE = 1, // mod/flask type/flask name isn't found. - LIFE = 2, - MANA = 3, - HYBRID = 4, - DEFENSE = 5, - UTILITY = 6, // Currently This type won't pop. - SPEEDRUN = 7, //quick silver, MOD: adrenaline, - OFFENSE = 8, //sulphur, basalt, diamond,Taste of Hate, - //Kiara's Determination, Lion's Roar, The Overflowing Chalice, - //The Sorrow of the Divine,Rotgut, Witchfire Brew, Atziri's Promise, - //Dying Sun,Vessel of Vinktar - //MOD: Fending - POISON_IMMUNE = 9, // MOD: curing - FREEZE_IMMUNE = 10, // MOD: heat - IGNITE_IMMUNE = 11, // MOD: dousing - SHOCK_IMMUNE = 12, // MOD: grounding - BLEED_IMMUNE = 13, // MOD: staunching - CURSE_IMMUNE = 14, // MOD: warding - UNIQUE_FLASK = 15, // Currently This type won't pop. - OFFENSE_AND_SPEEDRUN = 16 // Silver flask - // as Onslaught provide - // movement speed and attack speed -*/ - -{ - "UniqueFlaskNames": { - "Blood of the Karui": 2, - - "Doedre's Elixir": 3, - "Lavianga's Spirit": 3, - "Zerphi's Last Breath": 3, - - "Coruscating Elixir": 5, - "Forbidden Taste": 5, - "Rumi's Concoction": 5, - "Sin's Rebirth": 5, - - "Divination Distillate": 6, - "The Writhing Jar": 6, - "Coralito's Signature": 6, - - "Atziri's Promise": 8, - "Dying Sun": 8, - "Kiara's Determination": 8, - "Lion's Roar": 8, - "Rotgut": 8, - "Taste of Hate": 8, - "The Overflowing Chalice": 8, - "The Sorrow of the Divine": 8, - "Vessel of Vinktar": 8, - "The Wise Oak": 8, - "Witchfire Brew": 8, - "Soul Ripper": 5, - "Soul Catcher": 5, - "Cinderswallow Urn": 16, - -//ru names: - - "Кровь каруи": 2, - - "Эликсир Дэрии": 3, - "Дух Лавианги": 3, - "Последний вздох Зебуми": 3, - - "Сверкающий эликсир": 5, - "Запретный вкус": 5, - "Отвар Руми": 5, - "Возрождение греха": 5, - - "Чистое прорицание": 6, - "Сосуд страданий": 6, - "Почерк Корнелия": 6, - - "Обещание Азири": 8, - "Умирающее солнце": 8, - "Решимость Киары": 8, - "Львиный рев": 8, - "Пойло": 8, - "Вкус ненависти": 8, - "Переполненная чаша": 8, - "Печаль божества": 8, - "Сосуд Винктара": 8, - "Мудный дуб": 8, - "Отвар ведьмовского огня": 8, - "Жнец душ": 5, - "Душелов": 5, - "Урна глотателя пепла": 16 - }, - - "FlaskTypes": { - "Small Life Flask": 2, - "Medium Life Flask": 2, - "Large Life Flask": 2, - "Greater Life Flask": 2, - "Grand Life Flask": 2, - "Giant Life Flask": 2, - "Colossal Life Flask": 2, - "Sacred Life Flask": 2, - "Hallowed Life Flask": 2, - "Sanctified Life Flask": 2, - "Divine Life Flask": 2, - "Eternal Life Flask": 2, - - "Малый флакон жизни": 2, - "Средний флакон жизни": 2, - "Большой флакон жизни": 2, - "Вместительный флакон жизни": 2, - "Огромный флакон жизни": 2, - "Гигантский флакон жизни": 2, - "Великий флакон жизни": 2, - "Освященный флакон жизни": 2, - "Благодатный флакон жизни": 2, - "Святой флакон жизни": 2, - "Божественный флакон жизни": 2, - "Вечный флакон жизни": 2, - - "Small Mana Flask": 3, - "Medium Mana Flask": 3, - "Large Mana Flask": 3, - "Greater Mana Flask": 3, - "Grand Mana Flask": 3, - "Giant Mana Flask": 3, - "Colossal Mana Flask": 3, - "Sacred Mana Flask": 3, - "Hallowed Mana Flask": 3, - "Sanctified Mana Flask": 3, - "Divine Mana Flask": 3, - "Eternal Mana Flask": 3, - - "Малый флакон маны": 3, - "Средний флакон маны": 3, - "Большой флакон маны": 3, - "Вместительный флакон маны": 3, - "Огромный флакон маны": 3, - "Гигантский флакон маны": 3, - "Великий флакон маны": 3, - "Освященный флакон маны": 3, - "Благодатный флакон маны": 3, - "Святой флакон маны": 3, - "Божественный флакон маны": 3, - "Вечный флакон маны": 3, - - "Medium Hybrid Flask": 4, - "Large Hybrid Flask": 4, - "Colossal Hybrid Flask": 4, - "Sacred Hybrid Flask": 4, - "Hallowed Hybrid Flask": 4, - - "Малый флакон равновесия": 4, - "Средний флакон равновесия": 4, - "Большой флакон равновесия": 4, - "Великий флакон равновесия": 4, - "Освященный флакон равновесия": 4, - "Благодатный флакон равновесия": 4, - - "Quicksilver Flask": 7, - "Bismuth Flask": 5, - "Stibnite Flask": 5, - "Ruby Flask": 5, - "Sapphire Flask": 5, - "Amethyst Flask": 5, - "Topaz Flask": 5, - "Silver Flask": 16, - "Aquamarine Flask": 5, - "Granite Flask": 5, - "Jade Flask": 5, - "Quartz Flask": 5, - "Sulphur Flask": 8, - "Basalt Flask": 5, - "Diamond Flask": 8, - -//in the same order ru names: - - "Ртутный флакон": 7, - "Висмутовый флакон": 5, - "Стибнитовый флакон": 5, - "Рубиновый флакон": 5, - "Сапфировый флакон": 5, - "Аметистовый флакон": 5, - "Топазовый флакон": 5, - "Серебряный флакон": 16, - "Аквамариновый флакон": 5, - "Гранитный флакон": 5, - "Нефритовый флакон": 5, - "Кварцевый флакон": 5, - "Серный флакон": 8, - "Базальтовый флакон": 5, - "Алмазный флакон": 8 - - }, - "FlaskMods": { - "FlaskLevelRequirement": 0, - "FlaskLevelRequirementHybrid": 0, - "FlaskLevelRequirementUtilityResists": 0, - "FlaskLevelRequirement14Real": 0, - "UtilityFlaskConsecrate": 0, - "UtilityFlaskSmokeCloud": 0, - "UtilityFlaskChilledGround": 0, - - "FlaskEffectReducedDuration": 0, - "FlaskExtraCharges": 0, - "FlaskFullRechargeOnCrit": 0, - "FlaskFullRechargeOnTakeCrit": 0, - "FlaskPartialInstantRecovery": 0, - "FlaskIncreasedRecoverySpeed": 0, - "FlaskExtraManaCostsLife": 0, - "FlaskIncreasedRecoveryOnLowLife": 0, - "FlaskChargesUsed": 0, - "FlaskIncreasedDuration": 0, - "FlaskInstantRecoveryOnLowLife": 0, - "FlaskChargesAddedIncreasePercent": 0, - "FlaskExtraLifeCostsMana": 0, - "FlaskIncreasedRecoveryAmount": 0, - "FlaskFullInstantRecovery": 0, - "FlaskChanceRechargeOnCrit": 0, - "FlaskIncreasedHealingCharges": 0, - - "FlaskHealsMinions": 0, - "FlaskBuffManaLeechPermyriadWhileHealing": 0, - "FlaskBuffLifeLeechPermyriadWhileHealing": 0, - "FlaskBuffKnockbackWhileHealing": 0, - "FlaskBuffStunRecoveryWhileHealing": 0, - "FlaskBuffMovementSpeedWhileHealing": 7, - "FlaskDispellsPoison": 9, - "FlaskDispellsBurning": 11, - "FlaskRemovesShock": 12, - "FlaskDispellsChill": 10, - "FlaskBuffArmourWhileHealing": 5, - "FlaskBuffEvasionWhileHealing": 5, - "FlaskBuffResistancesWhileHealing": 5, - "FlaskRemovesBleeding": 13, - "FlaskCurseImmunity": 14, - - "JunMasterLocalFlaskCriticalStrikeChanceDuringFlaskEffect": 8, - "JunMasterLocalFlaskLifeLeechOnDamageTakenPermyriadDuringFlaskEffect": 2, - "JunMasterLocalFlaskItemFoundRarityDuringFlaskEffect": 0, - "JunMasterLocalFlaskSkillManaCostDuringFlaskEffect": 8, - "JunMasterLocalFlaskAvoidStunChanceAndMovementSpeedDuringFlaskEffect": 7, - "JunMasterLocalFlaskLifeRegenerationPerMinuteDuringFlaskEffect": 8, - "FlaskBuffFreezeShockIgniteChanceWhileHealing": 0, - "FlaskBuffCastSpeedWhileHealing": 0, - "FlaskBuffAttackSpeedWhileHealing": 0, - "FlaskManaRecoveryAtEnd": 0, - "FlaskBuffReducedManaCostWhileHealing": 0, - "FlaskFullRechargeOnHit": 0, - "FlaskEffectNotRemovedOnFullMana": 0, - "FlaskBuffAttackLifeLeechWhileHealing": 5, - "FlaskBuffSpellEnergyShieldLeechWhileHealing": 5 - } -}