Ejemplo 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));
            }
        }
Ejemplo n.º 2
0
 private void stockshop()
 {
     for (int i = 1; i < 9; i++)
     {
         stock.Add(ItemGenerator.CreateItem(i));
     }
 }
Ejemplo n.º 3
0
 public void BuyItem(Item item)
 {
     customer.Gold -= item.Value * 15;
     if (item.Type == ItemType.Consumable && customer.PlayerHasItem(item.ID))
     {
         Consumable currentstash = (Consumable)customer.Inventory.Find(delegate(Item target){ return(target.ID == item.ID); });
         currentstash.Count++;
     }
     else
     {
         customer.Inventory.Add(ItemGenerator.CreateItem(item.ID));
     }
 }
Ejemplo n.º 4
0
        public static Player StartGame(string name)
        {
            List <Item> inventory = new List <Item>();

            inventory.Add(ItemGenerator.CreateItem(7));
            Weapon weapon      = new Weapon();
            Armour headArmour  = new Armour(ArmourLocation.Head);
            Armour torsoArmour = new Armour(ArmourLocation.Torso);
            Armour handArmour  = new Armour(ArmourLocation.Hands);
            Armour legArmour   = new Armour(ArmourLocation.Legs);
            Armour feetArmour  = new Armour(ArmourLocation.Feet);

            Player player = new Player(name, 10, 1, 100, 0, 80, 3, 7, 1001, inventory, weapon, headArmour, torsoArmour, handArmour, legArmour, feetArmour);

            GameInProgress = true;
            return(player);
        }