Beispiel #1
0
        private void Equip(IReadOnlyList <Inventory.Item> items, EquipmentItemSetEffectSheet sheet)
        {
            _costumes = items.Select(i => i.item)
                        .OfType <Costume>()
                        .Where(e => e.equipped)
                        .ToList();
            _equipments = items.Select(i => i.item)
                          .OfType <Equipment>()
                          .Where(e => e.equipped)
                          .ToList();
            foreach (var equipment in _equipments)
            {
                switch (equipment.ItemSubType)
                {
                case ItemSubType.Weapon:
                    weapon = equipment as Weapon;
                    break;

                case ItemSubType.Armor:
                    armor          = equipment as Armor;
                    defElementType = equipment.ElementalType;
                    break;

                case ItemSubType.Belt:
                    belt = equipment as Belt;
                    break;

                case ItemSubType.Necklace:
                    necklace = equipment as Necklace;
                    break;

                case ItemSubType.Ring:
                    ring = equipment as Ring;
                    break;

                default:
                    throw new RequiredBlockIndexException();
                }
            }

            Stats.SetEquipments(_equipments, sheet);

            foreach (var skill in _equipments.SelectMany(equipment => equipment.Skills))
            {
                Skills.Add(skill);
            }

            foreach (var buffSkill in _equipments.SelectMany(equipment => equipment.BuffSkills))
            {
                Skills.Add(buffSkill);
            }
        }
Beispiel #2
0
        protected sealed override void SetSkill()
        {
            base.SetSkill();

            var dmg      = (int)(ATK * 0.3m);
            var skillIds = StageSimulator.EnemySkillSheet.Values.Where(r => r.characterId == RowData.Id)
                           .Select(r => r.skillId).ToList();
            var enemySkills = Simulator.SkillSheet.Values.Where(r => skillIds.Contains(r.Id))
                              .ToList();

            foreach (var skillRow in enemySkills)
            {
                var skill = SkillFactory.Get(skillRow, dmg, 100);
                Skills.Add(skill);
            }
        }
Beispiel #3
0
        protected void SetEquipmentStat(EquipmentItemSetEffectSheet sheet)
        {
            foreach (var equipment in equipments)
            {
                switch (equipment.ItemSubType)
                {
                case ItemSubType.Weapon:
                    weapon = equipment as Weapon;
                    break;

                case ItemSubType.Armor:
                    armor          = equipment as Armor;
                    defElementType = equipment.ElementalType;
                    break;

                case ItemSubType.Belt:
                    belt = equipment as Belt;
                    break;

                case ItemSubType.Necklace:
                    necklace = equipment as Necklace;
                    break;

                case ItemSubType.Ring:
                    ring = equipment as Ring;
                    break;

                default:
                    throw new RequiredBlockIndexException();
                }
            }

            Stats.SetEquipments(equipments, sheet);

            foreach (var skill in equipments.SelectMany(equipment => equipment.Skills))
            {
                Skills.Add(skill);
            }

            foreach (var buffSkill in equipments.SelectMany(equipment => equipment.BuffSkills))
            {
                Skills.Add(buffSkill);
            }
        }
Beispiel #4
0
        public void Use(List <Guid> consumableIds)
        {
            var consumables = Inventory.Items
                              .Select(i => i.item)
                              .OfType <Consumable>()
                              .Where(i => consumableIds.Contains(i.ItemId))
                              .ToList();

            Stats.SetConsumables(consumables);
            foreach (var food in consumables)
            {
                foreach (var skill in food.Skills)
                {
                    Skills.Add(skill);
                }

                foreach (var buffSkill in food.BuffSkills)
                {
                    BuffSkills.Add(buffSkill);
                }

                Inventory.RemoveNonFungibleItem(food);
            }
        }
Beispiel #5
0
 public void OverrideSkill(Skill.Skill skill)
 {
     Skills.Clear();
     Skills.Add(skill);
 }
Beispiel #6
0
 public void AddSkill(Skill.Skill skill)
 {
     Skills.Add(skill);
 }