Ejemplo n.º 1
0
 private void resetState(GameTime gametime)
 {
     // reset sprite frame and change state
     // start cooldown
     SkillSlots.Instance.active = false;
     spriteFrame.X = 0;
     ani_count = 0;
     SkillState = JobClasses.SkillStateBowman.None;
     SkillActive = false;
     cast_animation = null;
     skill_animation = null;
 }
Ejemplo n.º 2
0
        private void IdleState(GameTime gameTime)
        {
            if (CheckKeyDown(Keys.D1) ||
                CheckKeyDown(Keys.D2) ||
                CheckKeyDown(Keys.D3) ||
                CheckKeyDown(Keys.D4) ||
                CheckKeyDown(Keys.D5) ||
                CheckKeyDown(Keys.D6) ||
                CheckKeyDown(Keys.D7) ||
                CheckKeyDown(Keys.D8) ||
                CheckKeyDown(Keys.D9)
                )
            {
                if (!SkillSlots.Instance.active)
                {
                    // check if weapon is equiped
                    if (getPlayer().equipment.item_list.FindAll(delegate(Item item) { return item.Type == ItemType.Weapon; }).Count > 0)
                    {
                        WeaponType weapontype = getPlayer().equipment.item_list.Find(delegate(Item item) { return item.Type == ItemType.Weapon; }).WeaponType;

                        // check the weapon type
                        if (weapontype == WeaponType.Bow)
                        {
                            SkillSlots.Instance.active = true;
                            spriteFrame.X = 0;
                            ani_count = 1;              // reset for cast animations
                            state = EntityState.Skill;

                            if (CheckKeyDown(Keys.D1))
                            {
                                SkillState = JobClasses.SkillStateBowman.ArrowShower;
                                previousCastTimeMsec = (float)gameTime.ElapsedGameTime.TotalSeconds + 1.2f;
                            }
                            else if (CheckKeyDown(Keys.D2))
                            {
                                SkillState = JobClasses.SkillStateBowman.ArrowWave;
                                previousCastTimeMsec = (float)gameTime.ElapsedGameTime.TotalSeconds + 2.1f;

                                // needs to be stored in skill info:
                                arrow_count = 10; // 10 arrows
                                curving = new Vector2(0, -0.3f);
                            }
                            else if (CheckKeyDown(Keys.D3))
                            {
                                SkillState = JobClasses.SkillStateBowman.ImprovedFocus;
                                previousCastTimeMsec = (float)gameTime.ElapsedGameTime.TotalSeconds + 2.1f;
                                previousSkillTimeMsec = (float)gameTime.ElapsedGameTime.TotalSeconds;
                            }
                        }
                    }
                }
            }
        }