Esempio n. 1
0
 public void addSkill(Skill addSkill)
 {
     skill_list.Add(addSkill);
 }
Esempio n. 2
0
        private void IdleState(GameTime gameTime)
        {
            int slot = KeyToInt();

            if (slot >= 0)
            {
                if (!SkillSlots.Instance.active)
                {
                    if (getPlayer().quickslotbar.Quickslot(slot) is Skill)
                    {
                        // check if weapon is equiped
                        if (getPlayer().equipment.item_list.FindAll(delegate(Item item) { return item.Type == ItemType.Weapon; }).Count > 0)
                        {
                            SkillSlots.Instance.active = true;
                            spriteFrame.X = 0;
                            ani_count = 1;              // reset for cast animations
                            state = EntityState.Skill;

                            // new skill
                            skill = playerStore.activePlayer.quickslotbar.Quickslot(slot) as Skill;
                            previousCastTimeMsec = (float)gameTime.ElapsedGameTime.TotalSeconds + skill.CastTime;
                        }
                    }
                    else if (getPlayer().quickslotbar.Quickslot(slot) is Item)
                    {
                        Item selectedItem = getPlayer().quickslotbar.Quickslot(slot) as Item;

                        if(playerStore.activePlayer.inventory.item_list.FindAll(x => x.itemID == selectedItem.itemID).Count > 0)
                        {
                            if (!ItemActive)
                            {
                                ItemActive = true;
                                previousCastTimeMsec = (float)gameTime.ElapsedGameTime.TotalSeconds + 1.2f;
                                item_Consume(gameTime, selectedItem);
                            }
                        }
                    }
                }
            }
        }
Esempio n. 3
0
 private void resetState(GameTime gametime)
 {
     // reset sprite frame and change state
     // start cooldown
     SkillSlots.Instance.active = false;
     spriteFrame.X = 0;
     ani_count = 0;
     SkillActive = false;
     ItemActive = false;
     cast_animation = null;
     skill_animation = null;
     animationOffset = Vector2.Zero;
     skill = null;
 }
Esempio n. 4
0
        public static Skill create(int identifier, string name, SkillType type)
        {
            var skill = new Skill();

            skill.ID = identifier;
            skill.Name = name;
            skill.Type = type;
            skill.UnlockSkill = new string[4];
            skill.UnlockLevel = new int[4];
            skill.Level = 0;

            return skill;
        }