diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2017-07-23 10:47:10 -0400 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2017-07-23 10:47:10 -0400 |
commit | 9e540db7d6492168cadcafddbf145ffdd7b21981 (patch) | |
tree | 8019a7a67e66a5ec87ad7872278e8ee92431251a /src/old/quest.cpp.bak | |
parent | 215e5ee6ce089c3e0d5be28fd816bc7031b6acab (diff) |
source cleanup; beginning of custom attacks
Diffstat (limited to 'src/old/quest.cpp.bak')
-rw-r--r-- | src/old/quest.cpp.bak | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/old/quest.cpp.bak b/src/old/quest.cpp.bak deleted file mode 100644 index f19359e..0000000 --- a/src/old/quest.cpp.bak +++ /dev/null @@ -1,65 +0,0 @@ -#include <algorithm>
-
-#include <quest.hpp>
-
-int QuestHandler::assign(std::string title,std::string desc,std::string req) {
- Quest tmp;
- char *tok;
-
- tmp.title = title;
- tmp.desc = desc;
-
- tok = strtok(&req[0], "\n\r\t,");
- tmp.need.emplace_back("", 0);
-
- while (tok) {
- if (!tmp.need.back().first.empty()) {
- tmp.need.back().second = atoi(tok);
- tmp.need.emplace_back("", 0);
- } else
- tmp.need.back().first = tok;
-
- tok = strtok(NULL, "\n\r\t,");
- }
-
- tmp.need.pop_back();
- current.push_back(tmp);
-
- return 0;
-}
-
-int QuestHandler::drop(std::string title) {
- current.erase(std::remove_if (current.begin(),
- current.end(),
- [&](Quest q) { return q.title == title; }),
- current.end());
-
- return 0;
-}
-
-int QuestHandler::finish(std::string t) {
- for (auto c = current.begin(); c != current.end(); c++) {
- if ((*c).title == t) {
- //for (auto &n : (*c).need) {
- //if (player->inv->hasItem(n.first) < n.second)
- return 0;
- //}
-
- //for (auto &n : (*c).need)
- //player->inv->takeItem(n.first, n.second);
- //current.erase(c);
- //return 1;
- }
- }
-
- return 0;
-}
-
-bool QuestHandler::hasQuest(std::string t) {
- for (auto &c : current) {
- if (c.title == t)
- return true;
- }
-
- return false;
-}
|