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)); } }
public void EquipLeftHandWeapon(Weapon weapon) { if (weapon.Size == WeaponSize.Small) { leftHandWeapon = weapon; this.OnLoadoutChanged(); } }
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); } }
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; }
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; }
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); } } }
public void EquipRightHandWeapon(Weapon weapon) { rightHandWeapon = weapon; this.OnLoadoutChanged(); }
public void UnequipRightHand() { rightHandWeapon = new Weapon(); this.OnLoadoutChanged(); }
public void UnequipLeftHand() { leftHandWeapon = new Weapon(); this.OnLoadoutChanged(); }