summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/items.h58
-rw-r--r--src/object.h44
-rw-r--r--src/skill.h2
3 files changed, 101 insertions, 3 deletions
diff --git a/src/items.h b/src/items.h
new file mode 100644
index 00000000..69c44185
--- /dev/null
+++ b/src/items.h
@@ -0,0 +1,58 @@
+/*
+ * The Mana World Server
+ * Copyright 2004 The Mana World Development Team
+ *
+ * This file is part of The Mana World.
+ *
+ * The Mana World is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * The Mana World is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with The Mana World; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * $Id$
+ */
+
+#ifndef ITEMS_H
+#define ITEMS_H
+
+#include "script.h"
+#include "object.h"
+
+//General Item Definition
+class Item
+{
+ //Statistics modifier
+ Statistics stats;
+
+ //Item type
+ unsigned int type;
+
+ public:
+ //Item type definitions
+ static enum {
+ Usable,
+ Equipment
+ };
+
+ virtual ~Item() { }
+
+ //Use item
+ void use() { };
+
+ //Accessors
+ unsigned int getType() { return type; }
+
+ //Get statistics information
+ const Statistics& getStatistics() { return stats; }
+};
+
+#endif
diff --git a/src/object.h b/src/object.h
index 671a68f7..50b854da 100644
--- a/src/object.h
+++ b/src/object.h
@@ -26,6 +26,19 @@
#define OBJECT_H
#include <iostream>
+#include "script.h"
+
+//Usable Statistics Definition (not unsigned to allow for negative; used for
+//summative statistics)
+struct Statistics
+{
+ int health;
+ int attack;
+ int defense;
+ int magic;
+ int accuracy;
+ int speed;
+};
/*
* Generic In-Game Object Definition
@@ -46,7 +59,6 @@ class Object
*/
class Being : public Object
{
- public:
//Being name
std::string name;
@@ -67,12 +79,40 @@ class Being : public Object
unsigned int dexterity;
unsigned int luck;
+ //Derived statistics (derived from above)
+ Statistics stats;
+
//Being inventory/equiped items
//Inventory inventory;
//Equipment equipment;
+ Script *script;
+
+ public:
~Being() { } //empty definition
- void update() { } //empty definition
+
+ //update
+ void update() {
+ //Generate statistics
+ stats.health = 20 + (20 * vitality);
+ stats.attack = 10 + strength;
+ stats.defense = 10 + strength;
+ stats.magic = 10 + intelligence;
+ stats.accuracy = 50 + dexterity;
+ stats.speed = dexterity;
+
+ //Update scipt
+ script->update();
+ }
+
+ //accessors
+ const std::string& getName() { return name; }
+ unsigned int getGender() { return gender; }
+ unsigned int getLevel() { return level; }
+ unsigned int getMoney() { return money; }
+
+ //Get statistics information
+ const Statistics& getStatistics() { return stats; }
};
#endif
diff --git a/src/skill.h b/src/skill.h
index 8b90767b..305d4e19 100644
--- a/src/skill.h
+++ b/src/skill.h
@@ -49,7 +49,7 @@ class Skill
std::vector<Skill*> children;
/*
- * Skill properties/weighting
+ * Skill properties/weighting (used when calculating player class)
*/
float light;
float dark;