示例#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));
            }
        }
示例#2
0
 public void EquipLeftHandWeapon(Weapon weapon)
 {
     if (weapon.Size == WeaponSize.Small)
     {
         leftHandWeapon = weapon;
         this.OnLoadoutChanged();
     }
 }
示例#3
0
 public Equipment()
 {
     this.rightHandWeapon = new Weapon();
     this.leftHandWeapon = new Weapon();
     this.equippedArmour = new Dictionary<ArmourLocation, Armour>();
     foreach (ArmourLocation location in Enum.GetValues(typeof(ArmourLocation)))
     {
         this.equippedArmour[location] = new Armour(location);
     }
 }
示例#4
0
 public WeaponAttack(Warrior Attacker, Weapon Weapon)
 {
     this.name = weapon.Name;
     this.effectType = EffectType.Attack;
     this.attacker = Attacker;
     this.weapon = Weapon;
     this.speedBonus = this.weapon.Speed;
     this.effectiveness = this.attacker.Strength + this.weapon.Damage;
     this.damageType = this.weapon.DamageType;
     this.proc = this.weapon.Proc;
 }
示例#5
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;
        }
示例#6
0
 private void equipButtonClicked(object sender, EventArgs e)
 {
     if (item.Type == Logic.ItemType.Armour)
     {
         player.Equipment.EquipArmour(item as Logic.Armour);
         this.ShowItemInfo();
     }
     if (item.Type == Logic.ItemType.Weapon)
     {
         Logic.Weapon weapon = item as Logic.Weapon;
         if (weapon.Size != Logic.WeaponSize.Small)
         {
             player.Equipment.EquipRightHandWeapon(weapon);
         }
     }
 }
示例#7
0
 public void EquipRightHandWeapon(Weapon weapon)
 {
     rightHandWeapon = weapon;
     this.OnLoadoutChanged();
 }
示例#8
0
 public void UnequipRightHand()
 {
     rightHandWeapon = new Weapon();
     this.OnLoadoutChanged();
 }
示例#9
0
 public void UnequipLeftHand()
 {
     leftHandWeapon = new Weapon();
     this.OnLoadoutChanged();
 }