示例#1
0
        /// <summary>
        /// Takes a skill out of the bar and returns it.
        /// </summary>
        /// <param name="slot">The slot to empty.</param>
        /// <returns></returns>
        public Skill Remove(int slot)
        {
            Skill skill = Skills[slot - 1];

            Skills[slot - 1] = new EmptySkill(Self);
            return(skill);
        }
示例#2
0
        public UseSkill GetAvailableSkill(string id)
        {
            var aSkill = availableSkills.Where(s => s.ID == id).FirstOrDefault();

            if (aSkill == null)
            {
                aSkill = new EmptySkill();
            }
            return(aSkill);
        }
示例#3
0
        public Skillbar(Actor self)
        {
            Self = self;
            Skill Empty = new EmptySkill(Self);

            Skills = new List <Skill>(6)
            {
                Empty, Empty, Empty, Empty, Empty, Empty
            };
        }
示例#4
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);             //Bad workaround

            boxel = new Texture2D(spriteBatch.GraphicsDevice, 1, 1, false, SurfaceFormat.Color);
            boxel.SetData(new[] { Color.White });

            retroFont = Content.Load <SpriteFont>("Font");

            EmptySkill.initEmpty();
        }
示例#5
0
 public Skillbar(Actor self, List <Skill> skills)
 {
     Self = self;
     for (int i = 0; i < Skills.Count; i++)
     {
         if (skills[i] is null)
         {
             Skills[i] = new EmptySkill(self);
         }
         else
         {
             Skills[i] = skills[i];
             Skills[i].SetUser(self);
         }
     }
 }
示例#6
0
        private void SetSkillToCharacter(GameObject heroCharacter, Characters characters)
        {
            ISkillHero skill;

            switch (characters)
            {
            case Characters.Apple:
                skill = heroCharacter.GetComponent <SkillApple>();
                break;

            case Characters.Banana:
                skill = heroCharacter.GetComponent <SkillBanana>();
                break;

            case Characters.Carrot:
                skill = heroCharacter.GetComponent <SkillCarrot>();
                break;

            default:
                skill = new EmptySkill();
                break;
            }
            HeroCharacter.Skill = skill;
        }