public ItemBase(ItemBaseType baseType, ItemClass itemClass, AffixType[] baseAffixs, AffixType[] guaranteedAffixes, AffixPool affixPool) { BaseType = baseType; Class = itemClass; BaseAffixes = baseAffixs.Clone() as AffixType[]; GuaranteedAffixes = guaranteedAffixes.Clone() as AffixType[]; PossibleAffixes = affixPool; }
public static AffixPool GetPool(params AffixPoolPreset[] presets) { AffixPool result = new AffixPool(); foreach (AffixPoolPreset p in presets) { PresetPools[p].CombineInto(result); } return(result); }
void CreateTestPools() { AffixPool weaponPool = new AffixPool(AffixType.FireRate, AffixType.PhysDmgFlat, AffixType.Health); AffixPool armorPool = new AffixPool(AffixType.Health, AffixType.PhysDmgFlat); AffixPool ammoPool = new AffixPool(AffixType.PhysDmgFlat); AffixPool.RegisterPresetPool(AffixPoolPreset.Ammo, ammoPool); AffixPool.RegisterPresetPool(AffixPoolPreset.Armor, armorPool); AffixPool.RegisterPresetPool(AffixPoolPreset.Weapon, weaponPool); AffixPool.SavePresets(); }
void Awake() { Serializer.Initialize(); //AffixInfo healthInfo = new AffixInfo("Health", new AffixValueInfo(3.0f, 5.0f, new AffixProgression("Linear", 0, 1)), "Increases your health by {0}"); //AffixInfo physDmgFlatInfo = new AffixInfo("Flat Physical Damage", new AffixValueInfo(new AffixValueRange(1, 1.3f), new AffixValueRange(1.5f, 2f)), "Increases your physical damage by {0}"); //AffixInfo fireRateInfo = new AffixInfo("Fire Rate", new AffixValueInfo(0.5f, 0.8f), "Increases your fire rate by {0}"); //Serializer.SaveAffixInfoToDisk(healthInfo); //Serializer.SaveAffixInfoToDisk(physDmgFlatInfo); //Serializer.SaveAffixInfoToDisk(fireRateInfo); Serializer.LoadAllAffixInfosFromDisk(); //CreateTestPools(); AffixPool.LoadPresets(); }
public void CombineInto(AffixPool pool) { lottery.CombineInto(pool.lottery); }
public static void RegisterPresetPool(AffixPoolPreset preset, AffixPool pool) { PresetPools[preset] = pool; }
public ItemBase(ItemBaseType baseType, ItemClass itemClass, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, AffixPoolPreset affixPoolPreset) : this(baseType, itemClass, baseAffixes, guaranteedAffixes, AffixPool.GetPool(affixPoolPreset)) { }
public AmmoBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, AmmoClass ammoClass, AffixPoolPreset affixPoolPreset) : base(baseType, ItemClass.Ammo, baseAffixes, guaranteedAffixes, AffixPool.GetPool(affixPoolPreset)) { }
public AmmoBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, AmmoClass ammoClass, AffixPool affixPool) : base(baseType, ItemClass.Ammo, baseAffixes, guaranteedAffixes, affixPool) { AmmoClass = ammoClass; }
public ArmorBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, Slot[] slots, AffixPoolPreset affixPoolPreset) : base(baseType, ItemClass.Armor, baseAffixes, guaranteedAffixes, AffixPool.GetPool(affixPoolPreset)) { }
public ArmorBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, Slot[] slots, AffixPool affixPool) : base(baseType, ItemClass.Armor, baseAffixes, guaranteedAffixes, affixPool) { Slots = slots.Clone() as Slot[]; }
public WeaponBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, AmmoClass[] allowedAmmoTypes, AffixPoolPreset affixPoolPreset) : this(baseType, baseAffixes, guaranteedAffixes, allowedAmmoTypes, AffixPool.GetPool(affixPoolPreset)) { }
public WeaponBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, AmmoClass[] allowedAmmoTypes, AffixPool affixPool) : base(baseType, ItemClass.Weapon, baseAffixes, guaranteedAffixes, affixPool) { AllowedAmmoTypes = allowedAmmoTypes.Clone() as AmmoClass[]; }