From 30fec1e193d8719c076e468f793cc32745fef935 Mon Sep 17 00:00:00 2001 From: Joaquin <67109235+Taiga74164@users.noreply.github.com> Date: Fri, 29 Jul 2022 23:40:39 -0600 Subject: [PATCH] Added AutoDestroy:Plants --- cheat-library/src/user/cheat/game/filters.cpp | 7 +++++++ cheat-library/src/user/cheat/game/filters.h | 1 + cheat-library/src/user/cheat/world/AutoDestroy.cpp | 14 +++++++++----- cheat-library/src/user/cheat/world/AutoDestroy.h | 1 + 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/cheat-library/src/user/cheat/game/filters.cpp b/cheat-library/src/user/cheat/game/filters.cpp index 781c30e..3c23e4f 100644 --- a/cheat-library/src/user/cheat/game/filters.cpp +++ b/cheat-library/src/user/cheat/game/filters.cpp @@ -347,6 +347,13 @@ namespace cheat::game::filters mineral::Starsilver, mineral::WhiteIronChunk }; + SimpleFilter PlantDestroy = { + //plant::SakuraBloom, + plant::DandelionSeed, + plant::MistFlowerCorolla, + plant::FlamingFlowerStamen + }; + WhitelistFilter Doodads = { EntityType__Enum_1::Gadget, { diff --git a/cheat-library/src/user/cheat/game/filters.h b/cheat-library/src/user/cheat/game/filters.h index f5fa633..2edd84f 100644 --- a/cheat-library/src/user/cheat/game/filters.h +++ b/cheat-library/src/user/cheat/game/filters.h @@ -327,6 +327,7 @@ namespace cheat::game::filters extern SimpleFilter Oculies; extern SimpleFilter Chests; extern SimpleFilter Ores; + extern SimpleFilter PlantDestroy; extern WhitelistFilter Doodads; extern SimpleFilter Animals; extern SimpleFilter AnimalDrop; diff --git a/cheat-library/src/user/cheat/world/AutoDestroy.cpp b/cheat-library/src/user/cheat/world/AutoDestroy.cpp index 65d26a3..4ee4168 100644 --- a/cheat-library/src/user/cheat/world/AutoDestroy.cpp +++ b/cheat-library/src/user/cheat/world/AutoDestroy.cpp @@ -18,6 +18,7 @@ namespace cheat::feature NF(f_DestroyOres, "Destroy Ores", "AutoDestroy", false), NF(f_DestroyShields, "Destroy Shields", "AutoDestroy", false), NF(f_DestroyDoodads, "Destroy Doodads", "AutoDestroy", false), + NF(f_DestroyPlants, "Destroy Plants", "AutoDestroy", false), NF(f_Range, "Range", "AutoDestroy", 10.0f) { HookManager::install(app::MoleMole_LCAbilityElement_ReduceModifierDurability, LCAbilityElement_ReduceModifierDurability_Hook); @@ -43,6 +44,7 @@ namespace cheat::feature ConfigWidget("Doodads", f_DestroyDoodads, "Barrels, boxes, vases, etc."); ImGui::SameLine(); ImGui::TextColored(ImColor(255, 165, 0, 255), "Extremely risky!"); + ConfigWidget("Plants", f_DestroyPlants, "Dandelion Seeds, Sakura Bloom, etc."); ImGui::Unindent(); ConfigWidget("Range (m)", f_Range, 0.1f, 1.0f, 15.0f); } @@ -54,12 +56,13 @@ namespace cheat::feature void AutoDestroy::DrawStatus() { - ImGui::Text("Destroy [%.01fm%s%s%s%s]", + ImGui::Text("Destroy [%.01fm%s%s%s%s%s]", f_Range.value(), - f_DestroyOres || f_DestroyShields || f_DestroyDoodads ? "|" : "", + f_DestroyOres || f_DestroyShields || f_DestroyDoodads || f_DestroyPlants ? "|" : "", f_DestroyOres ? "O" : "", f_DestroyShields ? "S" : "", - f_DestroyDoodads ? "D" : ""); + f_DestroyDoodads ? "D" : "", + f_DestroyPlants ? "P" : ""); } AutoDestroy& AutoDestroy::GetInstance() @@ -86,8 +89,9 @@ namespace cheat::feature (autoDestroy.f_DestroyDoodads && game::filters::combined::Doodads.IsValid(manager.entity(entity))) || (autoDestroy.f_DestroyShields && !game::filters::combined::MonsterBosses.IsValid(manager.entity(entity)) && ( game::filters::combined::MonsterShielded.IsValid(manager.entity(entity)) || // For shields attached to monsters, e.g. abyss mage shields. - game::filters::combined::MonsterEquips.IsValid(manager.entity(entity)) // For shields/weapons equipped by monsters, e.g. rock shield. - )) + game::filters::combined::MonsterEquips.IsValid(manager.entity(entity)) || // For shields/weapons equipped by monsters, e.g. rock shield. + (autoDestroy.f_DestroyPlants && game::filters::combined::PlantDestroy.IsValid(manager.entity(entity))) // For plants e.g dandelion seeds. + )) ) ) { diff --git a/cheat-library/src/user/cheat/world/AutoDestroy.h b/cheat-library/src/user/cheat/world/AutoDestroy.h index 14e0985..d4c47a0 100644 --- a/cheat-library/src/user/cheat/world/AutoDestroy.h +++ b/cheat-library/src/user/cheat/world/AutoDestroy.h @@ -12,6 +12,7 @@ namespace cheat::feature config::Field> f_DestroyOres; config::Field> f_DestroyShields; config::Field> f_DestroyDoodads; + config::Field> f_DestroyPlants; config::Field f_Range; static AutoDestroy& GetInstance();