コード例 #1
0
 public DistanceWeaponComponent(EquipableComponent equip, WeaponWieldType wieldType, DistanceWeaponType distType, byte shootT, byte range = 2, byte hitChance = 100, byte manaCost = 0) : base(equip)
 {
     WieldType          = wieldType;
     DistanceWeaponType = distType;
     ShootType          = shootT;
     Range     = range;
     HitChance = hitChance;
     ManaCost  = manaCost;
 }
コード例 #2
0
 public MeleeWeaponComponent(EquipableComponent equip, byte weaponT, byte wieldT, uint attack) : base(equip)
 {
     //MeleeWeaponType = weaponT;
     //WieldType = wieldT;
     Attack = attack;
 }
コード例 #3
0
        // check which sub area the item was dropped in
        public void OnDragItemDropped()
        {
            Vector2   mLoc = ScreenToConsoleCoord(engine.mouseData.CellX, engine.mouseData.CellY);
            Entity    e;
            Hoverable hoverable;

            if (dragdrop.data is Hoverable)
            {
                hoverable = (Hoverable)dragdrop.data;
                e         = hoverable.entity;
            }
            else
            {
                return;
            }

            SkillComponent     skillComp = e.Get <SkillComponent>();
            EquipableComponent equipComp = e.Get <EquipableComponent>();

            // entity was dropped in the skill drop section, try to equip it as a skill
            if (IsMouseInSubSection(skillDropSection, mLoc))
            {
                if (skillComp != null && !equippedSkills.Contains(e))
                {
                    // check there is room to equip this skill
                    if (equippedSkills.Count + 1 <= MAX_EQUIP_SKILLS)
                    {
                        equippedSkills.Add(e);

                        // put the hoverable in the skill subsection
                        hoverable.origin.y = skillDropSection.origin.Y + equippedSkills.Count;
                    }
                }
            }
            else if (IsMouseInSubSection(skillSelectSection, mLoc))
            {
                if (skillComp != null && equippedSkills.Contains(e))
                {
                    equippedSkills.Remove(e);

                    // returnt eh hoverable to its location in the dfaults section
                    int i = defaultSkills.IndexOf(e);
                    hoverable.origin.y = skillSelectSection.origin.Y + i + 1;
                }
            }

            // otherwise if it was in the item drop section
            if (IsMouseInSubSection(itemDropSection, mLoc))
            {
                if (equipComp != null && !equippedItems.Contains(e))
                {
                    // check there is room to equip this item
                    if (equippedItems.Count + 1 <= MAX_EQUIPABLES)
                    {
                        equippedItems.Add(e);

                        // put the hoverable in the skill subsection
                        hoverable.origin.y = itemDropSection.origin.Y + equippedItems.Count;
                    }
                }
            }
            else if (IsMouseInSubSection(itemSelectSection, mLoc))
            {
                if (equipComp != null && equippedItems.Contains(e))
                {
                    equippedItems.Remove(e);

                    // return the hoverable to its location in the dfaults section
                    int i = defaultItems.IndexOf(e);
                    hoverable.origin.y = itemSelectSection.origin.Y + i + 1;
                }
            }
        }
コード例 #4
0
 public JewelComponent(EquipableComponent equip, byte charges = 0) : base(equip)
 {
     Charges = charges;
 }