示例#1
0
 /// <summary>
 /// Create a skill button, with the given skill
 /// </summary>
 /// <param name="toCreate">The skill to give</param>
 /// <param name="RightTree">Whether or not to place this skill in the Right tree</param>
 public void AddSkillButton(ActionSkills toCreate, bool RightTree, Vector2 pos)
 {
     if (RightTree == false)
     {
         leftTree.Add(new SkillButton(pos, toHold, toCreate, currentLevel));
     }
     else
     {
         rightTree.Add(new SkillButton(pos, toHold, toCreate, currentLevel));
     }
 }
示例#2
0
        /// <summary>
        /// The constructor for the button class, this takes the starting position, the player, and the Playskill that this object will activate
        /// </summary>
        /// <param name="startPos">Starting Position for the object</param>
        /// <param name="toSet">The Player to pass in</param>
        /// <param name="playerSkill">The skill that this button will activate</param>
        public SkillButton(Vector2 startPos, Player toSet, ActionSkills playerSkill)
            : base(startPos, Game1.A_CreateListOfAnimations(Game1.ANIMATION_DICTIONARY["SkillBox"]), "SkillButton", true)
        {
            position   = startPos;
            skillToSet = playerSkill;
            myPlayer   = toSet;
            parent     = null;
            active     = false;

            switch (skillToSet)
            {
            case ActionSkills.ChaoticReset:
                A_GoToFrameIndex(0);
                break;

            case ActionSkills.ConfuseRay:
                A_GoToFrameIndex(1);
                break;

            case ActionSkills.Exile:
                A_GoToFrameIndex(2);
                break;

            case ActionSkills.Ghost:
                A_GoToFrameIndex(3);
                break;

            case ActionSkills.LightJump:
                A_GoToFrameIndex(4);
                break;

            case ActionSkills.LightWall:
                A_GoToFrameIndex(5);
                break;

            case ActionSkills.ShadowDagger:
                A_GoToFrameIndex(6);
                break;

            case ActionSkills.ShadowHold:
                A_GoToFrameIndex(7);
                break;

            case ActionSkills.ShadowPush:
                A_GoToFrameIndex(8);
                break;

            default:
                A_GoToFrameIndex(0);
                break;
            }
        }
示例#3
0
        /// <summary>
        /// The same as the defaul constructor except that it now takes a level to automaticaly add this object to the game.
        /// </summary>
        /// <param name="startPos">Starting position</param>
        /// <param name="toSet">the player to pass</param>
        /// <param name="playerSkill">The player skill to set</param>
        /// <param name="level">the level to add this object too</param>
        public SkillButton(Vector2 startPos, Player toSet, ActionSkills playerSkill, BaseState level)
            : base(startPos, Game1.A_CreateListOfAnimations(Game1.ANIMATION_DICTIONARY["SkillBox"]), "SkillButton", true)
        {
            position   = startPos;
            skillToSet = playerSkill;
            myPlayer   = toSet;
            parent     = null;
            active     = false;

            switch (skillToSet)
            {
            case ActionSkills.ChaoticReset:
                A_GoToFrameIndex(0);
                break;

            case ActionSkills.ConfuseRay:
                A_GoToFrameIndex(1);
                break;

            case ActionSkills.Exile:
                A_GoToFrameIndex(2);
                break;

            case ActionSkills.Ghost:
                A_GoToFrameIndex(3);
                break;

            case ActionSkills.LightJump:
                A_GoToFrameIndex(4);
                break;

            case ActionSkills.LightWall:
                A_GoToFrameIndex(5);
                break;

            case ActionSkills.ShadowDagger:
                A_GoToFrameIndex(6);
                break;

            case ActionSkills.ShadowHold:
                A_GoToFrameIndex(7);
                break;

            case ActionSkills.ShadowPush:
                A_GoToFrameIndex(8);
                break;

            case ActionSkills.Dash:
                A_GoToFrameIndex(9);
                break;

            case ActionSkills.AirMelee:
                A_GoToFrameIndex(10);
                break;

            case ActionSkills.AirRanged:
                A_GoToFrameIndex(11);
                break;

            case ActionSkills.FastFall:
                A_GoToFrameIndex(12);
                break;

            case ActionSkills.JumpHeight:
                A_GoToFrameIndex(13);
                break;

            case ActionSkills.JumpPlus:
                A_GoToFrameIndex(14);
                break;

            case ActionSkills.JumpTriple:
                A_GoToFrameIndex(14);
                break;

            case ActionSkills.Speed:
                A_GoToFrameIndex(15);
                break;

            case ActionSkills.Wings:
                A_GoToFrameIndex(16);
                break;

            default:
                A_GoToFrameIndex(0);
                break;
            }
            zOrder = -5;
            level.AddObjectToHandler("SkillButton", this);
            ShowActive();
        }