diff --git a/Include/Core/Classes/Font.hpp b/Include/Core/Classes/Font.hpp new file mode 100644 index 0000000..c09cfe2 --- /dev/null +++ b/Include/Core/Classes/Font.hpp @@ -0,0 +1,20 @@ +#ifndef FONT_HPP_INCLUDED +#define FONT_HPP_INCLUDED + +#include "FontFamily.hpp" +#include "../JavaClass/Class.hpp" + +namespace Internal +{ + class Font : public FontFamily + { + public: + Font(); + Font(const void* Obj); + Font(const Font& F); + static Class GetClass(); + + }; +} + +#endif // FONT_HPP_INCLUDED diff --git a/Include/Core/Classes/FontFamily.hpp b/Include/Core/Classes/FontFamily.hpp new file mode 100644 index 0000000..0a14d3c --- /dev/null +++ b/Include/Core/Classes/FontFamily.hpp @@ -0,0 +1,28 @@ +#ifndef FONTFAMILY_HPP_INCLUDED +#define FONTFAMILY_HPP_INCLUDED + +#include "Rasterizer2D.hpp" +#include "../JavaClass/Class.hpp" +#include +#include + +namespace Internal +{ + class FontFamily : public Rasterizer2D + { + public: + FontFamily(); + FontFamily(const void* Obj); + FontFamily(const FontFamily& F); + static Class GetClass(); + + std::vector GetGlyphHeightOffsets() const; + std::vector GetGlyphHeights() const; + std::vector GetGlyphWidthOffsets() const; + std::vector GetGlyphWidths() const; + std::vector> GetGlyphs() const; + + }; +} + +#endif // FONTFAMILY_HPP_INCLUDED diff --git a/Include/Core/Classes/FontName.hpp b/Include/Core/Classes/FontName.hpp new file mode 100644 index 0000000..1197eb4 --- /dev/null +++ b/Include/Core/Classes/FontName.hpp @@ -0,0 +1,24 @@ +#ifndef FONTNAME_HPP_INCLUDED +#define FONTNAME_HPP_INCLUDED + +#include "../JavaClass/Object.hpp" +#include "../JavaClass/Class.hpp" +#include + +namespace Internal +{ + class FontName : public Object + { + public: + FontName(); + FontName(const void* Obj); + FontName(const FontName& F); + static Class GetClass(); + + std::string GetKeyName() const; + std::string GetName() const; + + }; +} + +#endif // FONTNAME_HPP_INCLUDED diff --git a/Include/Core/Classes/Fonts.hpp b/Include/Core/Classes/Fonts.hpp new file mode 100644 index 0000000..19e197e --- /dev/null +++ b/Include/Core/Classes/Fonts.hpp @@ -0,0 +1,22 @@ +#ifndef FONTS_HPP_INCLUDED +#define FONTS_HPP_INCLUDED + +#include "../JavaClass/Object.hpp" +#include "../JavaClass/Class.hpp" +#include "../JavaClass/Map.hpp" + +namespace Internal +{ + class Fonts : public Object + { + public: + Fonts(); + Fonts(const void* Obj); + Fonts(const Fonts& F); + static Class GetClass(); + + Map GetFontMap() const; + }; +} + +#endif // FONTS_HPP_INCLUDED diff --git a/Include/Core/Classes/Rasterizer2D.hpp b/Include/Core/Classes/Rasterizer2D.hpp new file mode 100644 index 0000000..68a8ebf --- /dev/null +++ b/Include/Core/Classes/Rasterizer2D.hpp @@ -0,0 +1,20 @@ +#ifndef RASTERIZER2D_HPP_INCLUDED +#define RASTERIZER2D_HPP_INCLUDED + +#include "CacheableNode.hpp" +#include "../JavaClass/Class.hpp" + +namespace Internal +{ + class Rasterizer2D : public CacheableNode + { + public: + Rasterizer2D(); + Rasterizer2D(const void* Obj); + Rasterizer2D(const Rasterizer2D& R); + static Class GetClass(); + + }; +} + +#endif // RASTERIZER2D_HPP_INCLUDED diff --git a/Include/Core/Debug.hpp b/Include/Core/Debug.hpp index 6744bf2..65435be 100644 --- a/Include/Core/Debug.hpp +++ b/Include/Core/Debug.hpp @@ -3,10 +3,6 @@ #include "../../Include/Core/Types/Logger.hpp" -#ifndef VERBOSE_LOG_MACRO -#define VERBOSE Debug::Verbose << __PRETTY_FUNCTION__ << " > " -#endif // VERBOSE_LOG_MACRO - class Debug { public: diff --git a/Include/Core/Internal.hpp b/Include/Core/Internal.hpp index 8a9e4d3..f22d787 100644 --- a/Include/Core/Internal.hpp +++ b/Include/Core/Internal.hpp @@ -45,6 +45,10 @@ #include "Classes/DirectByteBuffer.hpp" #include "Classes/DynamicObject.hpp" #include "Classes/ExchangeOffer.hpp" +#include "Classes/Font.hpp" +#include "Classes/FontFamily.hpp" +#include "Classes/FontName.hpp" +#include "Classes/Fonts.hpp" #include "Classes/Frame.hpp" #include "Classes/FrameMap.hpp" #include "Classes/Frames.hpp" @@ -103,6 +107,7 @@ namespace Internal std::int32_t GetCameraYaw(); std::int32_t GetCameraZ(); Map GetChatLineCache(); + Map GetClientFonts(); std::int32_t GetClientPlane(); Preferences GetClientPreferences(); std::int32_t GetClientX(); diff --git a/Include/Core/Types/Area.hpp b/Include/Core/Types/Area.hpp index 943cb7b..a2054b6 100644 --- a/Include/Core/Types/Area.hpp +++ b/Include/Core/Types/Area.hpp @@ -8,74 +8,25 @@ /** @addtogroup Types * @{ */ -class Area : public Convex +class Area { - public: - /** - * @brief The Plane the Area is located on - * @par Description - * The Plane the Area is located on - */ - std::int32_t Plane; + private: + std::int32_t Plane; + std::vector Vertices; - /** - * @brief Default Constructor, constructs an Area with -1 as the TopLeft and BottomRight Tile - * @par Description - * Default Constructor, constructs an Area with -1 as the TopLeft and BottomRight Tile - */ + public: Area(); - /** - * @brief Constructs an Area based on a TopLeft tile and a BottomRight tile, sets the internal Plane to the plane of the TopLeft tile - * @param Tile TopLeft Top Left tile of the Area - * @param Tile BottomRight Bottom Right tile of the Area - */ - Area(Tile TopLeft, Tile BottomRight); - /** - * @brief Constructs an Area based on a TopLeft tile and a BottomRight tile, sets the internal Plane to the plane of the TopLeft tile - * @param std::vector TileVertices - */ - Area(std::vector TileVertices); - /** - * @brief Constructs an Area, by copying another - * @param const Area& A The Area to "copy" - */ + Area(const Tile& TopLeft, const Tile& BottomRight); + Area(const std::vector& Vertices); Area(const Area& A); - /** - * @brief Returns True if the Area contains a Tile, does check the Tiles Plane - * @return True if the Area contains a Tile, does check the Tiles Plane - * @par Example - * @code - * Area A(Tile(100, 100, 0), Tile(200, 200, 0)); - * Debug::Info << A.contains(Tile(150, 150, 0)); - * @endcode - */ + bool Valid() const; bool Contains(const Tile& T) const; - /** - * @brief Returns the middle Tile of the Area - * @return The middle Tile of the Area - * @par Example - * @code - * Area A(Tile(100, 100, 0), Tile(200, 200, 0)); - * Debug::Info << A.GetMiddle()); - * @endcode - */ Tile GetMiddle() const; - /** - * @brief Returns a random Tile using Hybrid Distribution - * @return A random Tile using Hybrid Distribution - * @par Example - * @code - * Area A(Tile(100, 100, 0), Tile(200, 200, 0)); - * Debug::Info << A.GetHybridRandomTile(0.20, 0.20, 0.50, false)); - * @endcode - * @see @ref HybridRandomDocs - * @see @ref MissChanceFollowupDocs - */ - Tile GetHybridRandomTile(double ProbabilityX, double ProbabilityY, double StandardDeviationX, double StandardDeviationY, bool CheckPointGenAccuracyChance = true) const; + std::int32_t GetPlane() const; + std::vector GetVertices() const; friend std::ostream& operator<<(std::ostream& OS, const Area& A); - ~Area(); }; diff --git a/Include/Core/Types/Box.hpp b/Include/Core/Types/Box.hpp index a24511b..d5fd8d9 100644 --- a/Include/Core/Types/Box.hpp +++ b/Include/Core/Types/Box.hpp @@ -78,13 +78,10 @@ class Box * @see @ref MissChanceFollowupDocs */ Point GetNormalRandomPoint(double PercentageDeviationX, double PercentageDeviationY) const; - /** - * @brief Returns a random Point using Hybrid Distribution - * @return A random Point using Hybrid Distribution - * @see @ref HybridRandomDocs - * @see @ref MissChanceFollowupDocs - */ - Point GetHybridRandomPoint(double ProbabilityX, double ProbabilityY, double StandardDeviationX, double StandardDeviationY, bool CheckPointGenAccuracyChance = true) const; + + Point GetHybridRandomPoint(double ProbabilityX, double ProbabilityY, double StandardDeviationX, double StandardDeviationY, double PointGenAccuracy) const; + Point GetProfileHybridRandomPoint() const; + Point GetProfileHybridRandomPoint(double PointGenAccuracy) const; /** * @brief Returns True if the Box contains a Point diff --git a/Include/Core/Types/Convex.hpp b/Include/Core/Types/Convex.hpp index e2966d5..93dd308 100644 --- a/Include/Core/Types/Convex.hpp +++ b/Include/Core/Types/Convex.hpp @@ -11,47 +11,16 @@ class Convex { public: std::vector Vertices; - - /** - * @brief Default Constructor, constructs a Convex with null Vertices - * @par Description - * Default Constructor, constructs a Convex with null Vertices - */ Convex(); Convex(const std::vector& Vertices); - /** - * @brief Constructs a Convex, by copying another - * @param const Convex& C The Convex to "copy" - */ Convex(const Convex& C); - - /** - * @brief Returns True if the Convex has more than two Vertices - * @return True if the Convex has more than two Vertices - */ - virtual bool Valid() const; - /** - * @brief Returns True if the Convex contains a Point - * @return True if the Convex contains a Point - */ - virtual bool Contains(const Point& P) const; - /** - * @brief Returns the middle Point of the Convex - * @return The middle Point of the Convex - */ + bool Valid() const; + bool Contains(const Point& P) const; Point GetMiddle() const; - /** - * @brief Returns a Box of the Convex - * @return A Box of the Convex - */ Box GetBox() const; - /** - * @brief Returns a random Point using Hybrid Distribution - * @return A random Point using Hybrid Distribution - * @see @ref HybridRandomDocs - * @see @ref MissChanceFollowupDocs - */ - Point GetHybridRandomPoint(double ProbabilityX, double ProbabilityY, double StandardDeviationX, double StandardDeviationY, bool CheckPointGenAccuracyChance = true) const; + Point GetHybridRandomPoint(double ProbabilityX, double ProbabilityY, double StandardDeviationX, double StandardDeviationY, double PointGenAccuracy) const; + Point GetProfileHybridRandomPoint() const; + Point GetProfileHybridRandomPoint(double PointGenAccuracy) const; Convex operator+(const Point& P) const; Convex operator-(const Point& P) const; diff --git a/Include/Game/Core.hpp b/Include/Game/Core.hpp index 6a7782e..46f595a 100644 --- a/Include/Game/Core.hpp +++ b/Include/Game/Core.hpp @@ -17,6 +17,7 @@ #include "Interfaces/DepositBox.hpp" #include "Interfaces/Login.hpp" #include "Interfaces/Mainscreen.hpp" +#include "Interfaces/Makescreen.hpp" #include "Interfaces/Menu.hpp" #include "Interfaces/Minimap.hpp" #include "Interfaces/Trade.hpp" @@ -47,88 +48,12 @@ #include "Interactable/GameObject.hpp" #include "Interactable/GroundItem.hpp" #include "Interactable/GroundObject.hpp" +#include "Interactable/Item.hpp" #include "Interactable/NPC.hpp" #include "Interactable/Player.hpp" #include "Interactable/WallObject.hpp" #include "Interactable/Widget.hpp" -// -// DoxyGen -//======================================================= -// Pages -//======================================================= -/** -* @mainpage -* Mainpage Docs -* -* @page About About -* About -* -* @page GettingStarted Getting Started -* Getting Started -* -* @page RandomMethodDocs Random Distribution Methods -* @tableofcontents -* @section UniformRandomDocs Uniform Random Distribution -* Uniform Random Documentation -* @section BinomialRandomDocs Binomial Random Distribution -* Binomial Random Documentation -* @section NormalRandomDocs Normal Random Distribution -* Normal Random Documentation -* @section HybridRandomDocs Hybrid Random Distribution -* Hybrid Random Documentation -* @section MissChanceFollowupDocs MissChanceFollowup -* MissChanceFollowupDocs -* -* @page DetailedFuncDocs Detailed Function Documentation -* @tableofcontents -* @section ItemContainers Item Containers -* @subsection ICUsing Using Item Containers -* @subsection ICLibFunctions Lib functions that use an Internal Item Container -* Some classes have functions that Interface a class-related Item Container, an example -* being Bank::GetItemIDs(), which return an array of all ItemIDs found in the Bank Item Container. These interfaced-functions -* can be found in @ref Bank, @ref Inventory, and @ref Equipment -* -* Element positions in the returned arrays (ItemIDs, ItemNames, ItemAmounts) almost always correspond to their positions in the -* visual Game Interface. If there isn't an Item in a Container position, it's -1 for ItemIDs and Amounts, and simply a blank -* String ("") for ItemNames. Remember, arrays in C++ start at 0. -* -* Classes that Interface an Item Container will have a GetIndexOf() function, @ref Inventory::GetIndexOf() and -* @ref Bank::GetIndexOf() are examples. These two functions will return the Index of the passed Item (By ID, or Name) -* relative to the Item Container array, for example if Coins are in Inventory slot 5, using @ref Inventory::GetIndexOf("Coins") -* should return 4. -* -* Here is a more extensive example, where we grab the Item amount of Coins in our Inventory; -* -* @code -* std::int32_t CoinsIndex = Inventory::GetIndexOf("Coins"); -* std::vector Amounts = Inventory::GetItemAmounts(); -* if ((CoinsIndex != -1) && (CoindsIndex <= Amounts.size())) //A range check will never hurt -* { -* std::cout << "Coins has an Index of " << CoinsIndex << " relative to the Inventory Item Container Array" << std::endl; -* std::cout << "There are " << Amounts[Index] << " coins in our Inventory" << std::endl; -* } -* @endcode -* -* Here is a list of all class functions that Interface an internally-used Item Container. -* - Item IDs -* - @ref Bank::GetItemIDs() -* - @ref Inventory::GetItemIDs() -* - @ref Equipment::GetItemIDs() -* . -* - Item Names -* - @ref Bank::GetItemNames() -* - @ref Inventory::GetItemNames() -* - @ref Equipment::GetItemNames() -* . -* - Item Amounts -* - @ref Bank::GetItemAmounts() -* - @ref Inventory::GetItemAmounts() -* - @ref Equipment::GetItemAmounts() -* . -* @subsection Examples -* -*/ //======================================================= // Groups //======================================================= @@ -171,11 +96,5 @@ * @ingroup Interfaces * **/ -//======================================================= -// Examples -//======================================================= -/** -* @example ScriptExample.cpp -**/ #endif // CORE_HPP_INCLUDED diff --git a/Include/Game/Interactable/DecorativeObject.hpp b/Include/Game/Interactable/DecorativeObject.hpp index eeb1623..9abc1f4 100644 --- a/Include/Game/Interactable/DecorativeObject.hpp +++ b/Include/Game/Interactable/DecorativeObject.hpp @@ -8,6 +8,7 @@ #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" #include "../../Core/Input.hpp" +#include "../../Game/Tools/Camera.hpp" #include namespace Interactable @@ -26,15 +27,17 @@ namespace Interactable Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; + Point GetPoint(double PointGenAccuracy) const; double GetVisibility() const; Tile GetTile() const; - // Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west - void RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(Camera::COMPASS_DIRECTION Direction) const; + bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; - bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::string& Option, bool CheckTarget = true) const; + bool Interact(const std::vector& Options, bool CheckTarget = true) const; operator Internal::DecorativeObject() const; }; diff --git a/Include/Game/Interactable/GameObject.hpp b/Include/Game/Interactable/GameObject.hpp index 95acf94..538298b 100644 --- a/Include/Game/Interactable/GameObject.hpp +++ b/Include/Game/Interactable/GameObject.hpp @@ -8,6 +8,7 @@ #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" #include "../../Core/Input.hpp" +#include "../../Game/Tools/Camera.hpp" #include namespace Interactable @@ -26,15 +27,17 @@ namespace Interactable Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; + Point GetPoint(double PointGenAccuracy) const; double GetVisibility() const; Tile GetTile() const; - // Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west - void RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(Camera::COMPASS_DIRECTION Direction) const; + bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; - bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::string& Option, bool CheckTarget = true) const; + bool Interact(const std::vector& Options, bool CheckTarget = true) const; operator Internal::GameObject() const; }; diff --git a/Include/Game/Interactable/GroundItem.hpp b/Include/Game/Interactable/GroundItem.hpp index ca743c2..cc1bca1 100644 --- a/Include/Game/Interactable/GroundItem.hpp +++ b/Include/Game/Interactable/GroundItem.hpp @@ -8,6 +8,7 @@ #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" #include "../../Core/Input.hpp" +#include "../../Game/Tools/Camera.hpp" #include namespace Interactable @@ -28,16 +29,18 @@ namespace Interactable Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; + Point GetPoint(double PointGenAccuracy) const; double GetVisibility() const; Tile GetTile() const; Tile GetLocalTile() const; - // Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west - void RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(Camera::COMPASS_DIRECTION Direction) const; + bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; - bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::string& Option, bool CheckTarget = true) const; + bool Interact(const std::vector& Options, bool CheckTarget = true) const; operator Internal::GroundItem() const; }; diff --git a/Include/Game/Interactable/GroundObject.hpp b/Include/Game/Interactable/GroundObject.hpp index 082ad48..57c0860 100644 --- a/Include/Game/Interactable/GroundObject.hpp +++ b/Include/Game/Interactable/GroundObject.hpp @@ -8,6 +8,7 @@ #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" #include "../../Core/Input.hpp" +#include "../../Game/Tools/Camera.hpp" #include namespace Interactable @@ -26,16 +27,17 @@ namespace Interactable Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; + Point GetPoint(double PointGenAccuracy) const; double GetVisibility() const; Tile GetTile() const; - // Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west - void RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(Camera::COMPASS_DIRECTION Direction) const; + bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; - bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; - + bool Interact(const std::string& Option, bool CheckTarget = true) const; + bool Interact(const std::vector& Options, bool CheckTarget = true) const; operator Internal::GroundObject() const; }; diff --git a/Include/Game/Interactable/Item.hpp b/Include/Game/Interactable/Item.hpp new file mode 100644 index 0000000..0de4159 --- /dev/null +++ b/Include/Game/Interactable/Item.hpp @@ -0,0 +1,61 @@ +#ifndef INTERACTABLEITEM_CPP_INCLUDED +#define INTERACTABLEITEM_CPP_INCLUDED + +#include "../../Core/Classes/ItemInfo.hpp" +#include "../../Core/Classes/Sprite.hpp" +#include "../../Core/Types/Point.hpp" +#include "../../Core/Types/Box.hpp" +#include "../../Core/Types/Convex.hpp" +#include "../../Core/Input.hpp" +#include + +namespace Interactable +{ + class Item + { + public: + typedef enum ITEM_SOURCE + { + INVENTORY, + EQUIPMENT, + BANK + } ITEM_SOURCE; + + Item(); + Item(std::int32_t Index, std::int32_t ID, ITEM_SOURCE Source); + Item(const Interactable::Item& Item); + + bool Exists() const; + static bool ItemsExist(const std::vector& Items); + bool IsInterfaceOpen() const; + + std::int32_t GetID() const; + std::int32_t GetIndex() const; + ITEM_SOURCE GetSource() const; + std::string GetName() const; + std::int32_t GetStackAmount() const; + Internal::ItemInfo GetInfo() const; + + Internal::Sprite GetSprite() const; + Convex GetConvex() const; + Box GetBox() const; + Point GetPoint() const; + Point GetPoint(double PointGenAccuracy) const; + + bool Hover() const; + bool Interact(const Button& B = BUTTON_LEFT) const; + bool Interact(const std::string& Option, bool CheckTarget = false) const; + bool Interact(const std::vector& Options, bool CheckTarget = false) const; + + bool Valid() const; + operator bool() const; + + virtual ~Item(); + private: + std::int32_t Index; + std::int32_t ID; + ITEM_SOURCE Source; + }; +} + +#endif // INTERACTABLEITEM_CPP_INCLUDED diff --git a/Include/Game/Interactable/NPC.hpp b/Include/Game/Interactable/NPC.hpp index 76e8a16..484d85c 100644 --- a/Include/Game/Interactable/NPC.hpp +++ b/Include/Game/Interactable/NPC.hpp @@ -8,6 +8,7 @@ #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" #include "../../Core/Input.hpp" +#include "../../Game/Tools/Camera.hpp" #include namespace Interactable @@ -26,19 +27,21 @@ namespace Interactable Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; + Point GetPoint(double PointGenAccuracy) const; double GetVisibility() const; Tile GetTile() const; - // Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west - void RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(Camera::COMPASS_DIRECTION Direction) const; Internal::Character GetInteracting() const; bool Interacting() const; bool Interacting(const Internal::Character& C) const; + bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; - bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::string& Option, bool CheckTarget = true) const; + bool Interact(const std::vector& Options, bool CheckTarget = true) const; operator Internal::NPC() const; }; diff --git a/Include/Game/Interactable/Player.hpp b/Include/Game/Interactable/Player.hpp index eb895ec..9e809e3 100644 --- a/Include/Game/Interactable/Player.hpp +++ b/Include/Game/Interactable/Player.hpp @@ -8,6 +8,7 @@ #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" #include "../../Core/Input.hpp" +#include "../../Game/Tools/Camera.hpp" #include namespace Interactable @@ -25,19 +26,21 @@ namespace Interactable Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; + Point GetPoint(double PointGenAccuracy) const; double GetVisibility() const; Tile GetTile() const; - // Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west - void RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(Camera::COMPASS_DIRECTION Direction) const; Internal::Character GetInteracting() const; bool Interacting() const; bool Interacting(const Internal::Character& C) const; + bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; - bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::string& Option, bool CheckTarget = true) const; + bool Interact(const std::vector& Options, bool CheckTarget = true) const; operator Internal::Player() const; }; diff --git a/Include/Game/Interactable/WallObject.hpp b/Include/Game/Interactable/WallObject.hpp index e22adb7..0febb12 100644 --- a/Include/Game/Interactable/WallObject.hpp +++ b/Include/Game/Interactable/WallObject.hpp @@ -8,6 +8,7 @@ #include "../../Core/Types/Box.hpp" #include "../../Core/Types/Convex.hpp" #include "../../Core/Input.hpp" +#include "../../Game/Tools/Camera.hpp" #include namespace Interactable @@ -26,15 +27,17 @@ namespace Interactable Convex GetConvex() const; Box GetBox() const; Point GetPoint() const; + Point GetPoint(double PointGenAccuracy) const; double GetVisibility() const; Tile GetTile() const; - // Angle - Calculates the angle you the tile to be in relation to your player, 0 = north, 90 = east, 180 = south, 270 = west - void RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(std::int32_t Angle = 0) const; + bool RotateTo(Camera::COMPASS_DIRECTION Direction) const; + bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; - bool Interact(const std::string& Option) const; - bool Interact(const std::vector& Options) const; + bool Interact(const std::string& Option, bool CheckTarget = true) const; + bool Interact(const std::vector& Options, bool CheckTarget = true) const; operator Internal::WallObject() const; }; diff --git a/Include/Game/Interactable/Widget.hpp b/Include/Game/Interactable/Widget.hpp index da87b11..293a01d 100644 --- a/Include/Game/Interactable/Widget.hpp +++ b/Include/Game/Interactable/Widget.hpp @@ -24,7 +24,9 @@ namespace Interactable Box GetBox() const; Point GetPoint() const; + Point GetPoint(double PointGenAccuracy) const; + bool Hover() const; bool Interact(const Button& B = BUTTON_LEFT) const; bool Interact(const std::string& Option) const; bool Interact(const std::vector& Options) const; diff --git a/Include/Game/Interfaces/Bank.hpp b/Include/Game/Interfaces/Bank.hpp index 2bbfcf6..113b745 100644 --- a/Include/Game/Interfaces/Bank.hpp +++ b/Include/Game/Interfaces/Bank.hpp @@ -2,89 +2,124 @@ #define BANK_HPP_INCLUDED #include "../../Core/Types/Convex.hpp" +#include "../../Game/Interactable/Item.hpp" +#include #include #include #include /** @addtogroup Interfaces -* @{ */ -/** -* @note All methods require the Bank to be currently Open to successfully return a proper result +* @{ */ class Bank { public: + enum BANK_AMOUNT + { + ALL = -1, + ALL_BUT_ONE = 0 + }; + typedef enum WITHDRAW_MODE { ITEM, NOTED } WITHDRAW_MODE; + typedef enum PIN_STEP + { + FIRST, + SECOND, + THIRD, + FOURTH, + SUBMITTING, + TOO_MANY_ATTEMPTS, + BANK_OPEN + } PIN_STEP; + static bool IsOpen(); static bool Close(); - static bool EnterPin(); static std::vector GetItemIDs(); static std::vector GetItemNames(); static std::vector GetItemAmounts(); - static std::int32_t GetItemAmount(std::int32_t ID); - static std::int32_t GetItemAmount(const std::string& Name); + static std::vector GetItems(); + static std::vector GetItems(std::int32_t ID); + static std::vector GetItems(const std::string& Name); + static std::vector GetItems(const std::vector& IDs); + static std::vector GetItems(const std::vector& Names); + static std::vector GetItems(const std::function& Filter); + + static Interactable::Item GetItem(); + static Interactable::Item GetItem(std::int32_t ID); + static Interactable::Item GetItem(const std::string& Name); + static Interactable::Item GetItem(const std::vector& IDs); + static Interactable::Item GetItem(const std::vector& Names); + static Interactable::Item GetItem(const std::function& Filter); + + static std::int32_t Count(std::int32_t ID); + static std::int32_t Count(const std::string& Name); + static std::int32_t Count(const Interactable::Item& Item); static std::int32_t GetIndexOf(std::int32_t ID); static std::int32_t GetIndexOf(const std::string& Name); - static Convex GetConvexByIndex(std::int32_t Index); - static Convex GetConvexOf(std::int32_t ID); - static Convex GetConvexOf(const std::string& Name); - static bool Contains(std::int32_t ID); static bool Contains(const std::string& Name); - static bool Contains(const std::vector& IDs); - static bool Contains(const std::vector& Names); + static bool Contains(const Interactable::Item& Item); + static bool Contains(const std::vector& IDs); // true if all items are found at least once + static bool Contains(const std::vector& Names); // true if all items are found at least once + static bool Contains(const std::vector& Items); static bool ContainsAny(const std::vector& IDs); static bool ContainsAny(const std::vector& Names); + static bool ContainsAny(const std::vector& Items); static bool ContainsOnly(std::int32_t ID); static bool ContainsOnly(const std::string& Name); + static bool ContainsOnly(const Interactable::Item& Item); static bool ContainsOnly(const std::vector& IDs); static bool ContainsOnly(const std::vector& Names); + static bool ContainsOnly(const std::vector& Items); static std::int32_t GetCurrentTab(); static std::int32_t GetTabOf(std::int32_t ID); static std::int32_t GetTabOf(const std::string& Name); + static std::int32_t GetTabOf(const Interactable::Item& Item); static bool OpenTab(std::int32_t Tab); static bool ScrollTo(std::int32_t ID, bool OpenRespectiveTab = false); static bool ScrollTo(const std::string& Name, bool OpenRespectiveTab = false); + static bool ScrollTo(const Interactable::Item& Item, bool OpenRespectiveTab = false); - static bool InteractItemByIndex(std::int32_t ID, const std::string& Option); - static bool InteractItem(std::int32_t ID, const std::string& Option, bool OpenRespectiveTab = false); - static bool InteractItem(const std::string& Name, const std::string& Option, bool OpenRespectiveTab = false); + // -1 = all, 0 = all-but-one + static bool Withdraw(std::int32_t ID, std::int32_t Amount, bool OpenRespectiveTab = false); + static bool Withdraw(const std::string& Name, std::int32_t Amount, bool OpenRespectiveTab = false); + static bool Withdraw(const Interactable::Item& Item, std::int32_t Amount, bool OpenRespectiveTab = false); - static bool WithdrawXOf(std::int32_t ID, std::int32_t Amount, bool OpenRespectiveTab = false); - static bool WithdrawXOf(const std::string& Name, std::int32_t Amount, bool OpenRespectiveTab = false); - static bool WithdrawAllOf(std::int32_t ID, bool OpenRespectiveTab = false); - static bool WithdrawAllOf(const std::string& Name, bool OpenRespectiveTab = false); - static bool WithdrawAllButOneOf(std::int32_t ID, bool OpenRespectiveTab = false); - static bool WithdrawAllButOneOf(const std::string& Name, bool OpenRespectiveTab = false); + // -1 = all + static bool Deposit(std::int32_t ID, std::int32_t Amount); + static bool Deposit(const std::string& Name, std::int32_t Amount); + static bool Deposit(const Interactable::Item& Item, std::int32_t Amount); - static bool DepositAllOf(std::int32_t ID); - static bool DepositAllOf(const std::string& Name); - static bool DepositXOf(std::int32_t ID, std::int32_t Amount); - static bool DepositXOf(const std::string& Name, std::int32_t Amount); - static bool DepositAllExcept(const std::string& Name); - static bool DepositAllExcept(const std::vector& Names); static bool DepositAllExcept(std::int32_t ID); + static bool DepositAllExcept(const std::string& Name); + static bool DepositAllExcept(const Interactable::Item& Item); static bool DepositAllExcept(const std::vector& IDs); + static bool DepositAllExcept(const std::vector& Names); + static bool DepositAllExcept(const std::vector& Items); static bool DepositAll(); static bool DepositEquipment(); static WITHDRAW_MODE GetWithdrawMode(); static bool SetWithdrawMode(WITHDRAW_MODE Mode); + + static PIN_STEP GetEnterPinStep(); + static bool IsEnterPinOpen(); + static bool EnterPin(bool Terminate = true); }; /** @} */ diff --git a/Include/Game/Interfaces/GameTabs/Equipment.hpp b/Include/Game/Interfaces/GameTabs/Equipment.hpp index fa74bc3..184242a 100644 --- a/Include/Game/Interfaces/GameTabs/Equipment.hpp +++ b/Include/Game/Interfaces/GameTabs/Equipment.hpp @@ -1,16 +1,18 @@ #ifndef EQUIPMENT_HPP_INCLUDED #define EQUIPMENT_HPP_INCLUDED +#include "../../../Game/Interactable/Item.hpp" #include #include #include +#include /** @addtogroup GameTabs * @{ */ class Equipment { public: - typedef enum SLOTS + typedef enum SLOT { HEAD, CAPE, @@ -23,7 +25,7 @@ class Equipment FEET, RING, AMMO - } SLOTS; + } SLOT; static bool IsOpen(); static bool Open(); @@ -33,36 +35,54 @@ class Equipment static std::vector GetItemNames(); static std::vector GetItemAmounts(); - static std::int32_t GetItemID(SLOTS Slot); - static std::string GetItemName(SLOTS Slot); + static std::vector GetItems(); + static std::vector GetItems(std::int32_t ID); + static std::vector GetItems(const std::string& Name); + static std::vector GetItems(const std::vector& Slots); + static std::vector GetItems(const std::vector& IDs); + static std::vector GetItems(const std::vector& Names); + static std::vector GetItems(const std::function& Filter); - static std::int32_t GetItemAmount(SLOTS Slot); - static std::int32_t GetItemAmount(std::int32_t ID); - static std::int32_t GetItemAmount(const std::string& Name); + static Interactable::Item GetItem(); + static Interactable::Item GetItem(SLOT Slot); + static Interactable::Item GetItem(std::int32_t ID); + static Interactable::Item GetItem(const std::string& Name); + static Interactable::Item GetItem(const std::vector& IDs); + static Interactable::Item GetItem(const std::vector& Names); + static Interactable::Item GetItem(const std::function& Filter); - static SLOTS GetSlotOf(std::int32_t ID); - static SLOTS GetSlotOf(const std::string& Name); + static std::int32_t Count(SLOT Slot); + static std::int32_t Count(std::int32_t ID); + static std::int32_t Count(const std::string& Name); + static std::int32_t Count(const Interactable::Item& Item); + static std::int32_t Count(const std::vector& IDs); + static std::int32_t Count(const std::vector& Names); + static std::int32_t Count(const std::vector& Items); + + static SLOT GetSlotOf(std::int32_t ID); + static SLOT GetSlotOf(const std::string& Name); static bool Contains(std::int32_t ID); static bool Contains(const std::string& Name); - static bool Contains(const std::vector& IDs); - static bool Contains(const std::vector& Names); + static bool Contains(const Interactable::Item& Item); + static bool Contains(const std::vector& IDs); // true if all items are found at least once + static bool Contains(const std::vector& Names); // true if all items are found at least once + static bool Contains(const std::vector& Items); static bool ContainsAny(const std::vector& IDs); static bool ContainsAny(const std::vector& Names); + static bool ContainsAny(const std::vector& Items); static bool ContainsOnly(std::int32_t ID); static bool ContainsOnly(const std::string& Name); + static bool ContainsOnly(const Interactable::Item& Item); static bool ContainsOnly(const std::vector& IDs); static bool ContainsOnly(const std::vector& Names); + static bool ContainsOnly(const std::vector& Items); - static bool InteractItemBySlot(SLOTS Slot, const std::string& Option); - static bool InteractItem(std::int32_t ID, const std::string& Option); - static bool InteractItem(const std::string& Name, const std::string& Option); - - static bool UnequipItem(SLOTS Slot); - static bool UnequipItem(std::int32_t ID); - static bool UnequipItem(const std::string& Name); + static bool Unequip(std::int32_t ID); + static bool Unequip(const std::string& Name); + static bool Unequip(const Interactable::Item& Item); }; /** @} */ diff --git a/Include/Game/Interfaces/GameTabs/Inventory.hpp b/Include/Game/Interfaces/GameTabs/Inventory.hpp index 4e35049..4943d75 100644 --- a/Include/Game/Interfaces/GameTabs/Inventory.hpp +++ b/Include/Game/Interfaces/GameTabs/Inventory.hpp @@ -3,6 +3,8 @@ #include "../../../Core/Types/Box.hpp" #include "../../../Core/Types/Convex.hpp" +#include "../../../Game/Interactable/Item.hpp" +#include #include #include #include @@ -20,19 +22,36 @@ class Inventory static std::vector GetItemNames(); static std::vector GetItemAmounts(); + static std::vector GetItems(); + static std::vector GetItems(std::int32_t ID); + static std::vector GetItems(const std::string& Name); + static std::vector GetItems(const std::vector& IDs); + static std::vector GetItems(const std::vector& Names); + static std::vector GetItems(const std::function& Filter); + + static Interactable::Item GetItem(); + static Interactable::Item GetItem(std::int32_t ID); + static Interactable::Item GetItem(const std::string& Name); + static Interactable::Item GetItem(const std::vector& IDs); + static Interactable::Item GetItem(const std::vector& Names); + static Interactable::Item GetItem(const std::function& Filter); + static bool IsEmpty(); static bool IsFull(); static bool IsItemSelected(); static bool IsItemSelected(std::int32_t ID); static bool IsItemSelected(const std::string& Name); + static bool IsItemSelected(const Interactable::Item& Item); static std::string GetItemSelectedName(); static std::int32_t Count(std::int32_t ID); static std::int32_t Count(const std::string& Name); + static std::int32_t Count(const Interactable::Item& Item); static std::int32_t Count(const std::vector& IDs); static std::int32_t Count(const std::vector& Names); + static std::int32_t Count(const std::vector& Items); static std::int32_t CountOccupied(); static std::int32_t CountEmpty(); @@ -44,18 +63,8 @@ class Inventory static std::vector GetIndicesOf(std::int32_t ID); static std::vector GetIndicesOf(const std::string& Name); - - static Convex GetConvexByIndex(std::int32_t Index); - static Convex GetConvexOf(std::int32_t ID); - static Convex GetConvexOf(const std::string& Name); - static Convex GetConvexOf(const std::vector& IDs); // Returns first found ID Convex - static Convex GetConvexOf(const std::vector& Names); // Returns first found Name Convex - - static Box GetBoxByIndex(std::int32_t Index); - static Box GetBoxOf(std::int32_t ID); - static Box GetBoxOf(const std::string& Name); - static Box GetBoxOf(const std::vector& IDs); // Returns first found ID box - static Box GetBoxOf(const std::vector& Names); // Returns first found Name box + static std::vector GetIndicesOf(const std::vector& IDs); + static std::vector GetIndicesOf(const std::vector& Names); static std::vector GetSlotBoxes(); static std::vector GetBoxesOf(std::int32_t ID); @@ -63,34 +72,33 @@ class Inventory static bool Contains(std::int32_t ID); static bool Contains(const std::string& Name); + static bool Contains(const Interactable::Item& Item); static bool Contains(const std::vector& IDs); // true if all items are found at least once static bool Contains(const std::vector& Names); // true if all items are found at least once + static bool Contains(const std::vector& Items); static bool ContainsAny(const std::vector& IDs); static bool ContainsAny(const std::vector& Names); + static bool ContainsAny(const std::vector& Items); static bool ContainsOnly(std::int32_t ID); static bool ContainsOnly(const std::string& Name); + static bool ContainsOnly(const Interactable::Item& Item); static bool ContainsOnly(const std::vector& IDs); static bool ContainsOnly(const std::vector& Names); + static bool ContainsOnly(const std::vector& Items); - static bool InteractItemByIndex(std::int32_t Index, const std::string& Option); - static bool InteractItemByIndex(std::int32_t Index, const std::vector& Options); - static bool InteractItem(std::int32_t ID, const std::string& Option); - static bool InteractItem(const std::string& Name, const std::string& Option); - static bool InteractItem(std::int32_t ID, const std::vector& Options); - static bool InteractItem(const std::string& Name, const std::vector& Options); - static bool InteractItem(const std::vector& IDs, const std::vector& Options); //Interacts with first found ID - static bool InteractItem(const std::vector& Names, const std::vector& Options); //Interacts with first found Name + static bool Use(std::int32_t ID, std::int32_t ID2 = -1, bool UseSecondFirst = false); + static bool Use(const std::string& Name, const std::string& Name2 = "", bool UseSecondFirst = false); + static bool Use(const Interactable::Item& Item, const Interactable::Item& Item2 = Interactable::Item(), bool UseSecondFirst = false); - static bool DropItemByIndex(std::int32_t Index, bool AllowShiftClick = true); - static bool DropItem(std::int32_t ID, bool AllowShiftClick = true); - static bool DropItem(const std::string& Name, bool AllowShiftClick = true); + static bool Equip(std::int32_t ID); + static bool Equip(const std::string& Name); + static bool Equip(const Interactable::Item& Item); - static bool UseItem(std::int32_t ID); - static bool UseItem(const std::string& Name); - static bool UseItemOn(std::int32_t FirstItemID, std::int32_t SecondItemID); - static bool UseItemOn(const std::string& FirstItemName, const std::string& SecondItemName); + static bool Drop(std::int32_t ID, bool AllowShiftClick = true); + static bool Drop(const std::string& Name, bool AllowShiftClick = true); + static bool Drop(const Interactable::Item& Item, bool AllowShiftClick = true); }; /** @} */ diff --git a/Include/Game/Interfaces/Mainscreen.hpp b/Include/Game/Interfaces/Mainscreen.hpp index 5504cb7..f6ae654 100644 --- a/Include/Game/Interfaces/Mainscreen.hpp +++ b/Include/Game/Interfaces/Mainscreen.hpp @@ -42,6 +42,8 @@ class Mainscreen static bool IsUpText(const std::vector& UpTexts); static bool WaitIsUpText(std::uint32_t Duration, std::uint32_t Step, const std::string& UpText); static bool WaitUpTextContains(std::uint32_t Duration, std::uint32_t Step, const std::string& UpText); + static bool WaitUpTextContains(std::uint32_t Duration, std::uint32_t Step, const std::vector& UpTexts); + }; /** @} */ diff --git a/Include/Game/Interfaces/Makescreen.hpp b/Include/Game/Interfaces/Makescreen.hpp new file mode 100644 index 0000000..b208858 --- /dev/null +++ b/Include/Game/Interfaces/Makescreen.hpp @@ -0,0 +1,46 @@ +#ifndef MAKESCREEN_HPP_INCLUDED +#define MAKESCREEN_HPP_INCLUDED + +#include +#include + +/** @addtogroup Interfaces +* @{ */ +class Makescreen +{ + public: + + enum MAKE_AMOUNT + { + ALL = -1 + }; + + /** + * @brief Returns true if the Makescreen is open + * + * @return true if the makescreen is open + */ + + static bool IsOpen(); + + /** + * @brief Selects or enters the amount passed, and clicks the middle "Make" button, before returning true + * + * @param Amount The amount to select, before clicking the middle "Make" button, passing -1 will use the All button + * @param ClickButtonOverride Forces the function to click the needed amount button again, regardless if it's already selected + * @return true if the function succesfully clicks the "Make" button + * @return false if the makescreen isn't open, or interaction fails + */ + static bool Make(std::int32_t Amount, bool ClickButtonOverride = false); + + /** + * @brief Returns the text of the middle widget when the Makescreen is open + * + * @return Text of the middle widget when the Makescreen is open + */ + static std::string GetCraftingName(); +}; + +/** @} */ + +#endif // MAKESCREEN_HPP_INCLUDED diff --git a/Include/Game/Interfaces/Minimap.hpp b/Include/Game/Interfaces/Minimap.hpp index fc177cc..cca3738 100644 --- a/Include/Game/Interfaces/Minimap.hpp +++ b/Include/Game/Interfaces/Minimap.hpp @@ -58,6 +58,13 @@ class Minimap * @return true if the function succesfully clicks the compass, and the camera angle is 0 / North */ static bool ClickCompass(); // Clicks north + + /** + * @brief Clicks the quick-prayer orb + * + * @return true if the function succesfully clicked the orb + */ + static bool ClickQuickPrayer(); }; /** @} */ diff --git a/Library/libAlpacaLibrary.a b/Library/libAlpacaLibrary.a index 727665e..c97ec1b 100644 Binary files a/Library/libAlpacaLibrary.a and b/Library/libAlpacaLibrary.a differ