예제 #1
0
파일: Player.cs 프로젝트: GunnerJnr/lib9c
 private void PostConstruction(CharacterLevelSheet levelSheet, EquipmentItemSetEffectSheet equipmentItemSetEffectSheet)
 {
     AttackCountMax      = AttackCountHelper.GetCountMax(Level);
     characterLevelSheet = levelSheet;
     UpdateExp();
     Equip(Inventory.Items, equipmentItemSetEffectSheet);
 }
예제 #2
0
 public EnemyPlayer(EnemyPlayerDigest enemyPlayerDigest,
                    CharacterSheet characterSheet,
                    CharacterLevelSheet levelSheet,
                    EquipmentItemSetEffectSheet equipmentItemSetEffectSheet
                    ) : base(
         enemyPlayerDigest.Level,
         characterSheet,
         levelSheet,
         equipmentItemSetEffectSheet)
 {
     NameWithHash        = enemyPlayerDigest.NameWithHash;
     weapon              = null;
     armor               = null;
     belt                = null;
     necklace            = null;
     ring                = null;
     monsterMap          = new CollectionMap();
     eventMap            = new CollectionMap();
     hairIndex           = enemyPlayerDigest.HairIndex;
     lensIndex           = enemyPlayerDigest.LensIndex;
     earIndex            = enemyPlayerDigest.EarIndex;
     tailIndex           = enemyPlayerDigest.TailIndex;
     equipments          = enemyPlayerDigest.Equipments as List <Equipment>;
     costumes            = enemyPlayerDigest.Costumes as List <Costume>;
     characterLevelSheet = levelSheet;
     AttackCountMax      = AttackCountHelper.GetCountMax(Level);
     SetEquipmentStat(equipmentItemSetEffectSheet);
 }
예제 #3
0
파일: Player.cs 프로젝트: x86chi/lib9c
 private void PostConstruction(TableSheets sheets)
 {
     AttackCountMax      = AttackCountHelper.GetCountMax(Level);
     characterLevelSheet = sheets.CharacterLevelSheet;
     UpdateExp();
     Equip(Inventory.Items, sheets.EquipmentItemSetEffectSheet);
 }
예제 #4
0
        public void GetCountMax()
        {
            var level = 1;

            Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit, AttackCountHelper.GetCountMax(level));
            level = 20;
            Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit + 1, AttackCountHelper.GetCountMax(level));
            level = 100;
            Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit + 2, AttackCountHelper.GetCountMax(level));
            level = 250;
            Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit + 3, AttackCountHelper.GetCountMax(level));
            level = 999;
            Assert.AreEqual(AttackCountHelper.CountMaxUpperLimit, AttackCountHelper.GetCountMax(level));
        }
예제 #5
0
        public void GetAdditionalCriticalChance()
        {
            for (var i = 0; i < 2; i++)
            {
                var level = i == 0
                    ? 1
                    : 999;
                var attackCount    = 0;
                var attackCountMax = AttackCountHelper.GetCountMax(level);

                switch (level)
                {
                case 1:
                    Assert.AreEqual(AttackCountHelper.CountMaxLowerLimit, attackCountMax);
                    break;

                case 999:
                    Assert.AreEqual(AttackCountHelper.CountMaxUpperLimit, attackCountMax);
                    break;
                }

                for (var j = 0; j < attackCountMax + 1; j++)
                {
                    attackCount++;
                    if (attackCount <= attackCountMax)
                    {
                        var info = AttackCountHelper.CachedInfo[attackCountMax][attackCount];
                        Assert.AreEqual(info.AdditionalCriticalChance, AttackCountHelper.GetAdditionalCriticalChance(attackCount, attackCountMax));

                        continue;
                    }

                    Assert.Throws <ArgumentOutOfRangeException>(() => AttackCountHelper.GetAdditionalCriticalChance(attackCount, attackCountMax));
                }
            }
        }