Esempio n. 1
0
        public void Unequip(Armor i)
        {
            if (i == null)
            {
                return;
            }
            Armortype key = null;

            //check if it even exists in the set
            foreach (KeyValuePair <Armortype, Armor> a in this.Armors)
            {
                if (a.Value == i)
                {
                    key = a.Key;
                    break;
                }
            }
            //then remove
            if (key != null)
            {
                i.unequip();
                Armors.Remove(key);
                foreach (DamageType d in DamageType.allDamageTypes())
                {
                    increaseDamageBlock(d, -i.getArmor(d));
                }
            }
        }
Esempio n. 2
0
 public Armor(float slashArmor, float bluntarmor, float pokearmor, Armortype t, int weight, int worth, string name)
     : this(new Dictionary <DamageType, float> {
     { DamageType.Slash, slashArmor },
     { DamageType.Poke, pokearmor },
     { DamageType.Blunt, bluntarmor },
 }
            , t, weight, worth, name)
 {
 }
Esempio n. 3
0
 public Armor(Dictionary <DamageType, float> Armorvals, Armortype t, int weight, int worth, string name) : base(weight, worth, name, "Armor")
 {
     this.armorvals = Armorvals;
     type           = t;
     actions.Add(new GenericOption("equip", () => Player.getInstance().EquipArmor(this)));
 }
Esempio n. 4
0
 public Armor getItem(Armortype a)
 {
     return(this.Armors[a]);
 }