Esempio n. 1
0
        public Player(string name, int hp, int level, int nextlevel, int xp, int accuracy, int strength, int speed, int gold, List<Item> inventory, Weapon weapon, Armour headArmour, Armour torsoArmour, Armour handArmour, Armour legArmour, Armour feetArmour)
        {
            this.name = name;
            this.hp = this.basemaxhp = hp;
            this.level = level;
            this.nextlevel = nextlevel;
            this.xp = xp;
            this.accuracy = accuracy;
            this.basestrength = strength;
            this.basespeed = speed;
            this.gold = gold;

            this.inventory = inventory;
            this.equipment = new Equipment();

            this.baseDamageReduction = 0;

            this.unique = true;
            this.primaryAbility = new UnarmedAttack(this, DamageType.Crushing, 0, 0, null);

            //adding some items to debug inventory controls:
            for (int i = 1; i < 7; i++)
            {
                inventory.Add(ItemGenerator.CreateItem(i));
            }
        }
Esempio n. 2
0
        public Player(SerializationInfo info, StreamingContext ctxt)
        {
            this.name = (string)info.GetValue("name", typeof(string));
            this.hp = this.basemaxhp = (int)info.GetValue("maxhp", typeof(int));
            this.level = (int)info.GetValue("level", typeof(int));
            this.nextlevel = (int)info.GetValue("nextlevel", typeof(int));
            this.xp = (int)info.GetValue("xp", typeof(int));
            this.accuracy = (int)info.GetValue("accuracy", typeof(int));
            this.basestrength = (int)info.GetValue("strength", typeof(int));
            this.basespeed = (int)info.GetValue("speed", typeof(int));
            this.gold = (int)info.GetValue("gold", typeof(int));

            this.inventory = (List<Item>)info.GetValue("inventory", typeof(List<Item>));
            this.equipment= (Equipment)info.GetValue("equipment", typeof(Equipment));
        }