コード例 #1
0
 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;
 }
コード例 #2
0
ファイル: AffixPool.cs プロジェクト: Etabli/DA-GAME
    public static AffixPool GetPool(params AffixPoolPreset[] presets)
    {
        AffixPool result = new AffixPool();

        foreach (AffixPoolPreset p in presets)
        {
            PresetPools[p].CombineInto(result);
        }
        return(result);
    }
コード例 #3
0
ファイル: Test.cs プロジェクト: Etabli/DA-GAME
    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();
    }
コード例 #4
0
ファイル: Test.cs プロジェクト: Etabli/DA-GAME
    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();
    }
コード例 #5
0
ファイル: AffixPool.cs プロジェクト: Etabli/DA-GAME
 public void CombineInto(AffixPool pool)
 {
     lottery.CombineInto(pool.lottery);
 }
コード例 #6
0
ファイル: AffixPool.cs プロジェクト: Etabli/DA-GAME
 public static void RegisterPresetPool(AffixPoolPreset preset, AffixPool pool)
 {
     PresetPools[preset] = pool;
 }
コード例 #7
0
 public ItemBase(ItemBaseType baseType, ItemClass itemClass, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, AffixPoolPreset affixPoolPreset)
     : this(baseType, itemClass, baseAffixes, guaranteedAffixes, AffixPool.GetPool(affixPoolPreset))
 { }
コード例 #8
0
 public AmmoBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, AmmoClass ammoClass, AffixPoolPreset affixPoolPreset)
     : base(baseType, ItemClass.Ammo, baseAffixes, guaranteedAffixes, AffixPool.GetPool(affixPoolPreset))
 { }
コード例 #9
0
 public AmmoBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, AmmoClass ammoClass, AffixPool affixPool)
     : base(baseType, ItemClass.Ammo, baseAffixes, guaranteedAffixes, affixPool)
 {
     AmmoClass = ammoClass;
 }
コード例 #10
0
 public ArmorBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, Slot[] slots, AffixPoolPreset affixPoolPreset)
     : base(baseType, ItemClass.Armor, baseAffixes, guaranteedAffixes, AffixPool.GetPool(affixPoolPreset))
 { }
コード例 #11
0
 public ArmorBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, Slot[] slots, AffixPool affixPool)
     : base(baseType, ItemClass.Armor, baseAffixes, guaranteedAffixes, affixPool)
 {
     Slots = slots.Clone() as Slot[];
 }
コード例 #12
0
 public WeaponBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, AmmoClass[] allowedAmmoTypes, AffixPoolPreset affixPoolPreset)
     : this(baseType, baseAffixes, guaranteedAffixes, allowedAmmoTypes, AffixPool.GetPool(affixPoolPreset))
 { }
コード例 #13
0
 public WeaponBase(ItemBaseType baseType, AffixType[] baseAffixes, AffixType[] guaranteedAffixes, AmmoClass[] allowedAmmoTypes, AffixPool affixPool)
     : base(baseType, ItemClass.Weapon, baseAffixes, guaranteedAffixes, affixPool)
 {
     AllowedAmmoTypes = allowedAmmoTypes.Clone() as AmmoClass[];
 }