Exemplo n.º 1
0
 public ComboSystem(string path)
 {
     moveListFile = path;
     tempInput = new ButtonInput();
     performedMove = new Move();
     LoadMoves(Stage.Content.Load<Move[]>(moveListFile));
 }
Exemplo n.º 2
0
        public Move getAttack(ButtonInput input)
        {
            //our list contains our 3 one button moves, plus the 3 button move
            if (moveList.ContainsKey(input))
                return moveList[input];

            //no such move exists so either two buttons are pressed, or no buttons are pressed

            Move strongMove = null;
            tempMove = null;

            if (input.Red)
            {
                tempInput.Red = true;
                tempMove = moveList[tempInput]; //this is the first input we check so tempMove can't be used
                tempInput.Red = false;
            }
            if (input.Yellow)
            {
                tempInput.Yellow = true;
                if (tempMove != null)
                    strongMove = moveList[tempInput];
                else tempMove = moveList[tempInput];
                tempInput.Yellow = false;
            }
            if (input.Blue)
            {
                tempInput.Blue = true;
                strongMove = moveList[tempInput]; //this is the last input we check so tempMove must be used
                tempInput.Blue = false;
            }

            return strongMove;
            /*
            if (strongMove != null && tempMove != null)
            {
                //interpolate between the two moves
                performedMove = strongMove;
                //performedMove.FrontArea = strongMove.FrontArea;
                //performedMove.BackArea = strongMove.BackArea;
                //performedMove.Damage = strongMove.Damage + tempMove.Damage * .5f;
                performedMove.TimeBeforeSecond = tempMove.TimeBeforeAttack;
                performedMove.AnimationType = strongMove.AnimationType;
                performedMove.AnimationSecond = tempMove.AnimationType;
                //performedMove.ParticleEffect =
                //performedMove.animation
                return performedMove;
            }
            else
                tempMove = null;

            return null;
             * */
        }
Exemplo n.º 3
0
        public ButtonInput StringToButtonInput(string seq)
        {
            ButtonInput input = new ButtonInput();

            string[] seqSections;
            if (seq.Contains("|")) //split if there is a line (multi button input)
            {
                seqSections = seq.Split('|');
            }
            else //else just use the one string
            {
                seqSections = new string[] { seq };
            }

            for (int i = 0; i < seqSections.Length; i++)
            {
                seqSections[i] = seqSections[i].Trim();
                switch (seqSections[i])
                {
                    case "B": //red
                        input.Red = true;
                        break;
                    case "Y": //yellow
                        input.Yellow = true;
                        break;
                    case "X": //blue
                        input.Blue = true;
                        break;
                }
            }
            return input;
        }
Exemplo n.º 4
0
        public override void Initialize(Stage stage)
        {
            track = 0.0f;
            track = actor.PhysicsObject.Position.Z;

            Space = stage.GetQB<PhysicsQB>().Space;

            //input actions
            ControlsQB controlsQB = stage.GetQB<ControlsQB>();

            strum = controlsQB.GetInputAction("Strum");
            A = controlsQB.GetInputAction("A");
            B = controlsQB.GetInputAction("B");
            Y = controlsQB.GetInputAction("Y");
            X = controlsQB.GetInputAction("X");
            leftBumper = controlsQB.GetInputAction("LeftBumper");
            rightBumper = controlsQB.GetInputAction("RightBumper");
            triggers = controlsQB.GetInputAction("Triggers");
            leftAxisX = controlsQB.GetInputAction("MoveRight");
            guitarJump = controlsQB.GetInputAction("GuitarJump");

            //set move direction
            //TODO: look this up in a parm
            MoveDirection = PlayerDirection.Right;

            //get attack list
            attacks = new Engine.AttackSystem.ComboSystem("MoveList");

            //set camera
            CameraQB cameraQB = stage.GetQB<CameraQB>();
            PlayerCamera playerCamera = new PlayerCamera(actor.PhysicsObject, CameraQB.DefaultProjectionMatrix);
            playerCamera.Reset();
            cameraQB.JumpToCamera(playerCamera);

            //animations
            playerAnimation = actor.GetAgent<PlayerAnimationAgent>();

            State = PlayerState.Normal;
            facing = PlayerDirection.Right;

            //dashing & lock on range
            if (Player.PhysicsObject.physicsType == PhysicsObject.PhysicsType.Character)
            {
                Player.PhysicsObject.CollisionInformation.CollisionRules.Group = PhysicsQB.playerGroup;
                if (Player.Parm.HasParm("DashSpeed"))
                    Player.PhysicsObject.CharacterController.DashSpeed = Player.Parm.GetFloat("DashSpeed");
                if (Player.Parm.HasParm("DashTime"))
                    Player.PhysicsObject.CharacterController.DashTime = Player.Parm.GetFloat("DashTime");
            }

            //combat
            input = new ButtonInput();
            smash = 0;

            //support for the flow mechanic
            flow = new Flow();

            //Load the player sounds here
            AudioQB AQB = Stage.ActiveStage.GetQB<AudioQB>();
            int index = 0;
            while (Player.Parm.HasParm("Sound" + index))
            {
                AQB.AddSound(Player.Parm.GetString("Sound" + index));
                index++;
            }
            if(!Stage.Editor)
                isStrumMode = Stage.SaveGame.getStrumMode();
        }