Example #1
0
        /// <summary>
        /// Gets the EquipStats of the given item. This accounts for all factors that effect the item's stats.
        /// </summary>
        public static EquipStats GetGearStats(Item item)
        {
            EquipStats baseStats = GetGearBaseStats(item);
            EquipStats stats     = baseStats;

            if (statModifiers.ContainsKey(StatModifierType.Flat))
            {
                foreach (StatModifier modifier in statModifiers[StatModifierType.Flat])
                {
                    stats += modifier(item);
                }
            }
            if (statModifiers.ContainsKey(StatModifierType.AddMult))
            {
                EquipStats newStats = stats;
                foreach (StatModifier modifier in statModifiers[StatModifierType.AddMult])
                {
                    newStats += stats * modifier(item);
                }
                stats = newStats;
            }
            if (statModifiers.ContainsKey(StatModifierType.ExpMult))
            {
                foreach (StatModifier modifier in statModifiers[StatModifierType.ExpMult])
                {
                    stats *= modifier(item);
                }
            }
            return(stats);
        }
Example #2
0
 /// <summary>
 /// Use to create a new ChipInfo. Make sure to call Register on it to register your Chip.
 /// </summary>
 public ChipInfo(ChipType Type, string Name, string Desc, int Cost, Material Mat, EquipStats Stats = default, ChipCostType CostType = ChipCostType.MANA)
 {
     this.Type     = Type;
     this.Name     = Name;
     this.Desc     = Desc;
     this.Mat      = Mat;
     this.Cost     = Cost;
     this.Stats    = Stats;
     this.CostType = CostType;
 }
Example #3
0
 /// <summary>
 /// Use to create a new ChipInfo. Make sure to call Register on it to register your Chip.
 /// </summary>
 public ChipInfo(ChipType Type, string Name, string Desc, int Cost, Texture Tex, EquipStats Stats = default, ChipCostType CostType = ChipCostType.MANA)
 {
     this.Type     = Type;
     this.Name     = Name;
     this.Desc     = Desc;
     this.Tex      = Tex;
     this.Cost     = Cost;
     this.Stats    = Stats;
     this.CostType = CostType;
 }
 /// <summary>
 /// Use to create a new RaceInfo. Make sure to call Register on it to register your Race. Note that there must be at least one variant provided, as this is the default form of the race.
 /// </summary>
 public CharacterRaceInfo(string Name, string Desc, string UnlockCondition, EquipStats RaceStats, Material SelectorIconMat, params Material[] VariantMats) : base(Name, Desc, UnlockCondition, SelectorIconMat, VariantMats[0])
 {
     this.RaceStats   = RaceStats;
     this.VariantMats = VariantMats;
 }
 /// <summary>
 /// Use to create a new RaceInfo. Make sure to call Register on it to register your Race. Note that there must be at least one variant provided, as this is the default form of the race.
 /// </summary>
 public CharacterRaceInfo(string Name, string Desc, string UnlockCondition, EquipStats RaceStats, Texture SelectorIconTex, params Texture[] VariantTexes) : base(Name, Desc, UnlockCondition, SelectorIconTex, VariantTexes[0])
 {
     this.RaceStats    = RaceStats;
     this.VariantTexes = VariantTexes;
 }
Example #6
0
 /// <summary>
 /// Creates a new instance of EquipStats that has the same stats as the given EquipStats.
 /// </summary>
 public EquipStats(EquipStats stats)
 {
     this.stats = stats.stats;
 }