Пример #1
0
 // Start is called before the first frame update
 public override void Enter(GhostStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     //base.Enter(stateInput, transitionInfo);
     stateInput.anim.Play("Enemy_Move");
     stateInput.rb.velocity = new Vector2(-stateInput.ghost.maxSpeed, 0f);
     targetedWaypoint       = stateInput.ghost.waypoint_l;
 }
Пример #2
0
 public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     //stateInput.canDash = false;
     //stateInput.playerController.dashing = true;
     dashTimer = stateInput.playerController.dashTime;
     stateInput.playerController.canDash = false;
 }
 public override void Enter(CrushroomStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     stateInput.crushroomManager = stateInput.crushroom.GetComponent <CrushroomManager>();
     stateInput.crushroom.GetComponent <Rigidbody2D>().bodyType     = RigidbodyType2D.Dynamic;
     stateInput.crushroom.GetComponent <Rigidbody2D>().gravityScale = 2f;
     falling = true;
 }
Пример #4
0
 public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     dashTimer = stateInput.playerController.dashTime;
     dir       = stateInput.player.transform.rotation.eulerAngles.y == 180 ? -1 : 1;
     stateInput.anim.Play("Player_Dash");
     EventManager.TriggerEvent <PlayerDashEvent, Vector3>(stateInput.player.transform.position);
 }
Пример #5
0
    override public void Enter(SeleneStateInput input, CharacterStateTransitionInfo transitionInfo = null)
    {
        input.slowSprite.enabled = false;
        travelOrigin             = character.transform.position;

        //Make sure we don't teleport out of the map
        RaycastHit2D hit            = Physics2D.Raycast(travelOrigin, input.cc.LastDirection, input.maxTravelDistance, LayerMask.GetMask("Arena"));
        float        travelDistance = hit.collider ? (hit.distance - input.cc2d.radius) : input.maxTravelDistance;

        if (InputMap.Instance.GetInput(0, ActionType.RIGHT) || InputMap.Instance.GetInput(0, ActionType.LEFT) || InputMap.Instance.GetInput(0, ActionType.UP) || InputMap.Instance.GetInput(0, ActionType.DOWN))
        {
            travelDestination = travelOrigin + input.cc.LastDirection * travelDistance;
        }
        else
        {
            travelDestination = travelOrigin;
        }
        //travelDestination = travelOrigin + input.cc.LastDirection * travelDistance;

        travelTime  = travelDistance / input.maxTravelDistance * input.maxTravelTime;
        travelTimer = travelTime;

        state = Sequence.ENTER_HOLE;
        input.anim.Play("EnterHole");
        AudioManager.instance.Play("SeleneTeleportEnter");
    }
Пример #6
0
 public override void Enter(CrushroomStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     stateInput.crushroomManager = stateInput.crushroom.GetComponent <CrushroomManager>();
     originalY = stateInput.crushroomManager.GetOriginalY();
     stateInput.anim.SetBool("landed", false);
     stateInput.anim.Play("crushroom_retreat");
 }
Пример #7
0
 /// This can be called by any of this character's states in order to transition to a new one.
 /// The optional transition info provided is passed to the new state when it is Enter()-ed.
 public void ChangeState <N>(CharacterStateTransitionInfo transitionInfo = null) where N : S
 {
     state?.ForceCleanUp(input);
     state = stateMap[typeof(N)];
     softTransitionChangeState = null;
     state.Enter(input, transitionInfo);
 }
Пример #8
0
    // bosses have a sleep state that gets switched to idle when the player triggers their associated area

    public override void Enter(MajorStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
    {
        base.Enter(stateInput, transitionInfo);
        stateInput.anim.Play("major_sleep");
        stateInput.enemyController.EnemyPause(1f);
        stateInput.enemyController.isAwake = false;
    }
Пример #9
0
 /// This can be called by any of this character's states in order to transition to a new one.
 /// The optional transition info provided is passed to the new state when it is Enter()-ed.
 public void ChangeState <N>(CharacterStateTransitionInfo transitionInfo = null) where N : S
 {
     state?.ForceCleanUp(input);
     state = stateMap[typeof(N)];
     softTransitionChangeState = null;
     stateChanged.Value        = true;
     info = transitionInfo;
 }
Пример #10
0
    override public void Enter(RheaStateInput input, CharacterStateTransitionInfo transitionInfo = null)
    {
        direction   = input.cc.LastDirection.normalized;
        travelTimer = input.dashDuration;
        dashSpeed   = input.dashSpeed;

        input.anim.Play("Dash");
    }
Пример #11
0
 public override void Enter(CrushroomStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     stateInput.crushroomManager          = stateInput.crushroom.GetComponent <CrushroomManager>();
     stateInput.rb.bodyType               = RigidbodyType2D.Dynamic;
     stateInput.rb.gravityScale           = 2f;
     stateInput.rb.collisionDetectionMode = CollisionDetectionMode2D.Continuous;
     stateInput.anim.Play("crushroom_attack");
     falling = true;
 }
Пример #12
0
    public override void Enter(CrushroomStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
    {
        // base.Enter(stateInput, transitionInfo);
        // stateInput.anim.Play("Enemy_Idle");

        width  = stateInput.crushroom.GetComponent <SpriteRenderer>().bounds.size.x;
        leftX  = stateInput.crushroom.transform.position.x - (width / 2);
        rightX = stateInput.crushroom.transform.position.x + (width / 2);
    }
Пример #13
0
    override public void Enter(RheaStateInput input, CharacterStateTransitionInfo transitionInfo = null)
    {
        input.slowSprite.enabled = false;

        direction   = input.cc.LastDirection.normalized;
        travelTimer = input.dashDuration;
        dashSpeed   = input.dashSpeed;

        AudioManager.instance.Play("RheaDash");
        input.anim.Play("Dash");
    }
Пример #14
0
 /// This can be called by any of this character's states in order to transition to a new one.
 /// The optional transition info provided is passed to the new state when it is Enter()-ed.
 public void ChangeState <N>(CharacterStateTransitionInfo transitionInfo = null) where N : S
 {
     if (state != null)
     {
         state.ForceCleanUp(stateInput);
     }
     state = stateMap[typeof(N)]; //gets the numerical representation of the State you put in, then uses that as a key to get the actual instantiated state we put into the statemap before
     softTransitionChangeState = null;
     stateChanged.Value        = true;
     info = transitionInfo;
 }
Пример #15
0
 public override void Enter(MajorStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     base.Enter(stateInput, transitionInfo);
     stateInput.anim.Play("major_run");
     if (stateInput.enemyController.facingRight)
     {
         stateInput.rb.velocity = new Vector2(stateInput.major_inconvenience.moveSpeed, 0);
     }
     else
     {
         stateInput.rb.velocity = new Vector2(-stateInput.major_inconvenience.moveSpeed, 0);
     }
 }
Пример #16
0
 public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     if (transitionInfo == null)
     {
         timer = launchTime;
     }
     else
     {
         LaunchStateTransitionInfo launchTransition = (LaunchStateTransitionInfo)transitionInfo;
         timer = launchTransition.moveAfterLaunchTime;
         stateInput.playerController.launchPlayer(launchTransition.launchVelocity);
         stateInput.playerController.SetPlayerImmunity(launchTransition.invincible);
     }
     //stateInput.anim.Play("Player_Jump");
 }
Пример #17
0
    override public void Enter(SeleneStateInput input, CharacterStateTransitionInfo transitionInfo = null)
    {
        travelOrigin = character.transform.position;

        //Make sure we don't teleport out of the map
        RaycastHit2D hit            = Physics2D.Raycast(travelOrigin, input.cc.LastDirection, input.maxTravelDistance, LayerMask.GetMask("Arena"));
        float        travelDistance = hit.collider ? (hit.distance - input.cc2d.radius) : input.maxTravelDistance;

        travelDestination = travelOrigin + input.cc.LastDirection * travelDistance;

        travelTime  = travelDistance / input.maxTravelDistance * input.maxTravelTime;
        travelTimer = travelTime;

        state = Sequence.ENTER_HOLE;
        input.anim.Play("EnterHole");
    }
Пример #18
0
 override public void Enter(SeleneStateInput input, CharacterStateTransitionInfo transitionInfo = null)
 {
     input.anim.Play("Cast");
 }
Пример #19
0
 public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     dashTimer = stateInput.playerController.dashTime;
     stateInput.anim.Play("Player_Dash");
 }
Пример #20
0
 public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     stateInput.lastXDir = 0;
     stateInput.anim.Play("Player_Idle");
 }
Пример #21
0
 public override void Enter(MinorStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     base.Enter(stateInput, transitionInfo);
     // stateInput.anim.Play("Enemy_Idle");
 }
Пример #22
0
 public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     timer = launchTime;
     //stateInput.anim.Play("Player_Jump");
 }
Пример #23
0
 override public void Enter(RheaStateInput input, CharacterStateTransitionInfo transitionInfo = null)
 {
     shield = UnityEngine.Object.Instantiate(input.shieldPrefab, character.transform);
 }
Пример #24
0
 public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     stateInput.lastXDir = 0;
     stateInput.playerController.canDash = true;
     //stateInput.anim.Play("Player_Idle");
 }
Пример #25
0
 /// Gives the current state a gentle warning that it should transition as soon as possible to the given state N
 public void ChangeStateSoft <N>(CharacterStateTransitionInfo transitionInfo = null) where N : S
 {
     softTransitionChangeState = () => ChangeState <N>(transitionInfo);
     state.SoftTransitionWarning(stateInput);
 }
 override public void Enter(SeleneStateInput input, CharacterStateTransitionInfo transitionInfo = null)
 {
     this.transitionInfo = (ForceMoveTransitionInfo)transitionInfo;
     travelOrigin        = character.transform.position;
     travelTimer         = this.transitionInfo.moveTime;
 }
Пример #27
0
 override public void Enter(RheaStateInput input, CharacterStateTransitionInfo transitionInfo = null)
 {
     input.anim.Play("Cast");
     AudioManager.instance.Play("RheaSpellCasting1");
 }
Пример #28
0
 public override void Enter(BeemonStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     stateInput.anim.Play("Enemy_Move");
     stateInput.rb.velocity = new Vector2(-stateInput.beemon.maxSpeed, 0f);
 }
Пример #29
0
 public override void Enter(PlayerStateInput stateInput, CharacterStateTransitionInfo transitionInfo = null)
 {
     stateInput.anim.Play("Player_Fall");
 }
Пример #30
0
 override public void Enter(RheaStateInput input, CharacterStateTransitionInfo transitionInfo = null)
 {
     shield = UnityEngine.Object.Instantiate(input.shieldPrefab, character.transform);
     AudioManager.instance.Play("RheaIntrinsicShield");
 }