Example #1
0
    public override void setupClass()
    {
        //Set up offensive Abilities
        offensiveAbilityPool = new Ability[1];

        offensiveAbilityPool[0] = new DashStrike();

        //Set up defensive Abilities
        defensiveAbilityPool = new Ability[2];

        defensiveAbilityPool[0] = new DodgeRoll();
        defensiveAbilityPool[1] = new Parry();

        //Set up basic and heavy attacks
        basicAttack = new BasicAttack();
        heavyAttack = new HeavyAttack();
    }
Example #2
0
    public override void setupClass()
    {
        //Set up offensive Abilities
        offensiveAbilityPool = new Ability[2];

        offensiveAbilityPool[0] = new LanceShot();
        offensiveAbilityPool[1] = new RicochetShot();

        //Set up defensive Abilities
        defensiveAbilityPool = new Ability[1];

        defensiveAbilityPool[0] = new DodgeRoll();

        //Set up basic and heavy attacks
        basicAttack = new BasicShoot();
        heavyAttack = new HeavyAttack();
    }
Example #3
0
    // Update is called once per frame
    void FixedUpdate()
    {
        ActionsLeftForThisFrame = MaxActionsToPop;

        if (KeyBindingsWrapper.Movement.MoveKeyPressed)
        {
            MovementAction tmp = null;

            if (KeyBindingsWrapper.Movement.DodgeRollKeyDown)
            {
                tmp = new DodgeRoll(KeyBindingsWrapper.Movement.MoveVector);
            }
            else
            {
                tmp = new Move(
                    KeyBindingsWrapper.Movement.MoveVector,
                    KeyBindingsWrapper.Movement.SprintKeyPressed);
            }

            DeclaredActions.Add(tmp);
        }

        if (KeyBindingsWrapper.Movement.JumpKeyDown)
        {
            DeclaredActions.Add(new Jump(Vector3.zero));
        }

        if (KeyBindingsWrapper.Mouse.FireMouseButtonPressed)
        {
            RaycastHit hit;
            Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);

            if (Physics.Raycast(ray, out hit, 100.0f))
            {
                DeclaredActions.Add(new FireWeapon(hit.point));
            }
        }

        if (KeyBindingsWrapper.Movement.ReloadKeyDown)
        {
            DeclaredActions.Add(new ReloadWeapon());
        }
    }
Example #4
0
    void Update()
    {
        controllerInputY = Input.GetAxis("Vertical");
        controllerInputX = Input.GetAxis("Horizontal");
        DPadX            = Input.GetAxis("DPadX");

        //This is a band-aid. When I rework glide movement I will remove the X and Y animation parameters and replace it with a single "forward" parameter.
        playerAnim.SetFloat(HashTable.controllerXParam, controllerInputX);
        playerAnim.SetFloat(HashTable.controllerYParam, controllerInputY);


        //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

        //LEFT STICK MOVEMENT
        if ((controllerInputX > .1f || controllerInputX < -.1f) || (controllerInputY > .1f || controllerInputY < -.1f))
        {
            Movement?.Invoke(controllerInputX, controllerInputY);
        }
        else
        {
            MoveCancel?.Invoke();
        }

        //JUMP/GLIDE INITIATION
        //User presses the jump input, they can be on the ground, in the air, or in the gliding state.
        if (Input.GetKeyDown("joystick button 0"))
        {//The 'A' Button
            if (playerAnim.GetCurrentAnimatorStateInfo(0).fullPathHash == HashTable.jumpState)
            {
                Glide?.Invoke();
            }
            else
            {//Cant use switch statement because animation hashes aren't constant.
                if (playerAnim.GetCurrentAnimatorStateInfo(0).fullPathHash == HashTable.glideState)
                {
                    GlideCancel?.Invoke();
                }
                else
                {
                    Jump?.Invoke();
                }
            }
        }

        //INTERACT
        if (Input.GetKeyDown("joystick button 3"))
        {
            Interact?.Invoke();
        }

        //DODGE ROLL
        if (Input.GetKeyDown("joystick button 1") && (playerAnim.GetAnimatorTransitionInfo(0).fullPathHash != HashTable.motionToDodge))
        {//The B Button
            DodgeRoll?.Invoke();
        }

        //GROUND ATTACKS
        if (Input.GetKeyDown("joystick button 2") && playerAnim.GetBool(HashTable.onGroundParam)) //This is for initiating a ground combo
        {                                                                                         //The 'X' Button
            GroundAttacks?.Invoke();
        }

        //AIR ATTACKS
        if (!playerAnim.GetBool(HashTable.onGroundParam) && Input.GetKeyDown("joystick button 2")) //This is for initiating an air combo
        {                                                                                          //The 'X' Button
            AirAttacks?.Invoke();
        }

        //CYCLE ITEMS FORWARD
        if (Mathf.Approximately(DPadX, 1f) && !alreadyDone)
        {
            alreadyDone = true;
            CycleItemsForward?.Invoke();
        }
        if (Mathf.Approximately(DPadX, 0f) && alreadyDone)
        {
            alreadyDone = false;
        }

        //CYCLE ITEMS BACKWARD
        if (Mathf.Approximately(DPadX, -1f) && !alreadyDone)
        {
            alreadyDone = true;
            CycleItemsBackward?.Invoke();
        }
        if (Mathf.Approximately(DPadX, 0f) && alreadyDone)
        {
            alreadyDone = false;
        }

        //ZOOM IN CAMERA
        if (Mathf.Approximately(Input.GetAxis("DPadY"), 1f))
        {//DPad Y "Down"
            ZoomIn?.Invoke();
        }

        //ZOOM OUT CAMERA
        if (Mathf.Approximately(Input.GetAxis("DPadY"), -1f))
        {//DPad Y "Up"
            ZoomOut?.Invoke();
        }

        //CHOOSE ITEM
        if (Input.GetKeyDown("joystick button 4"))
        {//Right Bumper
            if (playerAnim.GetCurrentAnimatorStateInfo(0).fullPathHash == HashTable.glideState)
            {
                GameManagerScript.instance.inputManager.GlideCancel();
            }
            ChooseItem?.Invoke();
        }

        //CAMERA TARGET MODE
        if (Input.GetKeyDown("joystick button 5"))
        {//Left Bumper
            CameraTargetMode?.Invoke();
        }

        //-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    }