コード例 #1
0
 public void addSkill(Skill addSkill)
 {
     skill_list.Add(addSkill);
 }
コード例 #2
0
ファイル: Warrior.cs プロジェクト: HaKDMoDz/XNA_ScreenManager
        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);
                            }
                        }
                    }
                }
            }
        }
コード例 #3
0
ファイル: Warrior.cs プロジェクト: HaKDMoDz/XNA_ScreenManager
 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;
 }
コード例 #4
0
ファイル: Skill.cs プロジェクト: HaKDMoDz/XNA_ScreenManager
        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;
        }