#include "player.h"
+#include "pouch.h"
+#include "extern.h"
+#include "flags.h"
#include <stdlib.h>
#include <stdio.h>
armor = 1;
weapon = 1;
level = 1;
- alive = 1;
- started = 1; // Possibly deprecated
- forest_fights = 100;
+ forest_fights = forestfights;
player_fights = 3;
fight = NULL;
master = NULL;
battle = NULL;
+ flags = 0;
+ setAlive(this);
+ inventory.reset();
}
Player::Player(aClient *user)
armor = right->armor;
weapon = right->weapon;
level = right->level;
- alive = right->alive;
- started = right->started; // Possibly obsoleted
forest_fights = right->forest_fights;
player_fights = right->player_fights;
+ flags = right->flags;
+ inventory.setInventory(&right->inventory);
}
else
{
gold = m->gold;
exp = m->exp;
}
+
+long int Player::setFlags(long int newflags)
+{
+ flags = newflags;
+ return getFlags();
+}
+
+long int Player::addFlag(long int flag)
+{
+ flags |= flag;
+ return getFlags();
+}
+
+long int Player::remFlag(long int flag)
+{
+ flags &= ~flag;
+ return getFlags();
+}
+
+Pouch::Pouch(int h, int s, int d)
+{
+ setHealing(h);
+ setStrength(s);
+ setDefense(d);
+}