-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* current addition of potion of healing. May include mana later. * For issue #492 : Added potion.cpp/.h for cleaner code instead of jamming all the logic in the triggerItem function which would have gotten very ugly very quickly. Also added FullHealing as well as mana and rejuvination equivalents since they had related features. * for #492, All potions and elixers added along with functions to add to attributes. * Update player.cpp * Update guimanager.cpp * Update player.cpp * added cases to satisfy the errors in appveyor * Update guimanager.cpp * Updated the add Attributes functions to use std::min() * Updated functions to use FixedPoint * Update potion.h * Update guimanager.cpp * Update potion.h * Update guimanager.cpp * Update potion.cpp * Update potion.cpp * Update playerinput.h * Update playerinput.cpp * Update playerbehaviour.cpp * Update guimanager.cpp * Update playerbehaviour.cpp * Update CMakeLists.txt * Update guimanager.cpp * compile fixes * clang-format * changelog Co-authored-by: neveza <[email protected]> Co-authored-by: Tom Mason <[email protected]>
- Loading branch information
1 parent
99e184e
commit 4ef76c1
Showing
19 changed files
with
290 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
#include "usableitem.h" | ||
#include "usableitembase.h" | ||
#include <engine/threadmanager.h> | ||
#include <misc/misc.h> | ||
|
||
namespace FAWorld | ||
{ | ||
UsableItem::UsableItem(const UsableItemBase* base) : super(base) {} | ||
|
||
const UsableItemBase* UsableItem::getBase() const { return safe_downcast<const UsableItemBase*>(mBase); } | ||
|
||
void UsableItem::applyEffect(Player& user) | ||
{ | ||
if (!getBase()->mUseSoundPath.empty()) | ||
Engine::ThreadManager::get()->playSound(getBase()->mUseSoundPath); | ||
|
||
getBase()->mEffect(user); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
#pragma once | ||
#include "itembase.h" | ||
#include <functional> | ||
|
||
namespace FAWorld | ||
{ | ||
class Player; | ||
|
||
class UsableItemBase final : public ItemBase | ||
{ | ||
using super = ItemBase; | ||
|
||
public: | ||
explicit UsableItemBase(const DiabloExe::ExeItem& exeItem); | ||
|
||
std::unique_ptr<Item> createItem() const override; | ||
|
||
bool isBeltEquippable() const; | ||
|
||
public: | ||
std::function<void(Player&)> mEffect; | ||
std::string mUseSoundPath; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.