Пример #1
0
 public Modifier(EquipmentType type, Rarity rarity, DamageSetConfig damageSetConfig)
 {
     this.DamageSetConfig = damageSetConfig;
     this.Rarity          = rarity;
     this.EquipmentType   = type;
     this.Reference       = this.DamageSetConfig.Reference + this.EquipmentType;
 }
Пример #2
0
 public Modifier(string[] values, DamageSetConfig damageSet)
 {
     this.Reference       = values[0] + values[1];
     this.DamageSetConfig = damageSet;
     this.EquipmentType   = (EquipmentType)Enum.Parse(typeof(EquipmentType), values[1]);
     this.Rarity          = (Rarity)Enum.Parse(typeof(Rarity), values[2]);
 }
Пример #3
0
 public Equipment(BaseEquipment baseEquipment, Rarity rarity, DamageSetConfig rolledMod, int damage, bool hasQuality)
 {
     this.Base       = baseEquipment;
     this.rarity     = rarity;
     this.RolledMod  = rolledMod;
     this.Damage     = damage;
     this.HasQuality = hasQuality;
 }
Пример #4
0
    public void ChaosRerollsYellow()
    {
        Equipment yellow = new Equipment(EquipmentType.Shield);

        yellow.UseCurrency(CurrencyType.Alchemy, this.modPool);
        DamageSetConfig previousMod = yellow.RolledMod;

        Assert.True(yellow.UseCurrency(CurrencyType.Chaos, this.modPool));
        Assert.AreNotEqual(previousMod, yellow.RolledMod);
    }
Пример #5
0
    public void AlterationRerollsBlue()
    {
        Equipment blue = new Equipment(EquipmentType.Shield);

        blue.UseCurrency(CurrencyType.Transmute, this.modPool);
        DamageSetConfig previousMod = blue.RolledMod;

        Assert.True(blue.UseCurrency(CurrencyType.Alteration, this.modPool));
        Assert.AreNotEqual(previousMod, blue.RolledMod);
    }
Пример #6
0
    private static Equipment FromSave(SavedEquipment saved)
    {
        BaseEquipment   baseEquipment = Data.BaseEquipments.Get(saved.BaseReference);
        DamageSetConfig rolledMod     = null;

        if (!string.IsNullOrEmpty(saved.RolledModReference))
        {
            rolledMod = Data.DamageSets.Get(saved.RolledModReference);
        }
        return(new Equipment(baseEquipment, saved.Rarity, rolledMod, saved.Damage, saved.HasQuality));
    }
Пример #7
0
    public Modifier GetMod(EquipmentType equipmentType, Rarity rarity, DamageSetConfig previous = null)
    {
        List <Modifier> list = this.mods[new ValueTuple <EquipmentType, Rarity>(equipmentType, rarity)];

        return(list.First(a => a.DamageSetConfig != previous));
    }
Пример #8
0
 public void AddMod(EquipmentType equipmentType, Rarity rarity, DamageSetConfig damageSetConfig)
 {
     AddMod(new Modifier(equipmentType, rarity, damageSetConfig));
 }
Пример #9
0
 public void SetRolledMod(DamageSetConfig rolledMod, Rarity rarity)
 {
     this.RolledMod = rolledMod;
     this.rarity    = rarity;
 }