Beispiel #1
0
    // Token: 0x06001099 RID: 4249 RVA: 0x00062D34 File Offset: 0x00060F34
    public void PerformDoubleJump()
    {
        if (this.Sein.Abilities.ChargeJump)
        {
            this.Sein.Abilities.ChargeJump.OnDoubleJump();
        }
        this.PlatformMovement.LocalSpeedY = this.JumpStrength * RandomizerBonus.Jumpscale;
        this.m_numberOfJumpsAvailable--;
        this.Sein.PlatformBehaviour.Visuals.Animation.PlayRandom(this.DoubleJumpAnimation, 10, new Func <bool>(this.ShouldDoubleJumpAnimationKeepPlaying));
        this.m_doubleJumpSound = Sound.Play(this.DoubleJumpSound.GetSound(null), this.Sein.PlatformBehaviour.PlatformMovement.Position, delegate
        {
            this.m_doubleJumpSound = null;
        });
        SeinDoubleJump.OnDoubleJumpEvent(this.JumpStrength * RandomizerBonus.Jumpscale);
        GameObject original = this.DoubleJumpAfterShock;

        if (this.m_numberOfJumpsAvailable == 0 && this.ExtraJumpsAvailable == 2)
        {
            original = this.TrippleJumpAfterShock;
        }
        Vector2 worldSpeed = this.PlatformMovement.WorldSpeed;
        float   num        = Mathf.Atan2(worldSpeed.x, worldSpeed.y) * 57.29578f;

        InstantiateUtility.Instantiate(original, this.Sein.Position, Quaternion.Euler(0f, 0f, -num));
        JumpFlipPlatform.OnSeinDoubleJumpEvent();
    }
Beispiel #2
0
    // Token: 0x06000FFE RID: 4094 RVA: 0x00060A40 File Offset: 0x0005EC40
    public void PerformChargeJump()
    {
        float chargedJumpStrength = this.ChargedJumpStrength + this.ChargedJumpStrength * .10f * RandomizerBonus.Velocity();

        this.PlatformMovement.LocalSpeedY = chargedJumpStrength;
        this.OnJumpEvent(chargedJumpStrength);
        Sound.Play(this.JumpSound.GetSound(null), this.Sein.PlatformBehaviour.PlatformMovement.Position, null);
        this.UpwardsDeceleration.Deceleration = this.Deceleration;
        this.Sein.Mortality.DamageReciever.MakeInvincibleToEnemies(this.JumpDuration);
        this.ChangeState(SeinChargeJump.State.Jumping);
        this.Sein.PlatformBehaviour.Visuals.Animation.Play(this.JumpAnimation, 10, new Func <bool>(this.ShouldChargeJumpAnimationKeepPlaying));
        this.Sein.PlatformBehaviour.Visuals.SpriteRotater.BeginTiltLeftRightInAir(1.5f);
        if (this.Sein.PlatformBehaviour.JumpSustain)
        {
            this.Sein.PlatformBehaviour.JumpSustain.SetAmountOfSpeedToLose(this.PlatformMovement.LocalSpeedY, 1f);
        }
        this.Sein.Abilities.ChargeJumpCharging.EndCharge();
        JumpFlipPlatform.OnSeinChargeJumpEvent();
    }
    // Token: 0x0600124B RID: 4683 RVA: 0x00069BA4 File Offset: 0x00067DA4
    public void PerformChargeJump()
    {
        float chargedJumpStrength = this.ChargedJumpStrength + this.ChargedJumpStrength * 0.08f * (float)(RandomizerBonus.Velocity() + RandomizerBonus.Jumpgrades());

        this.PlatformMovement.LocalSpeedX = chargedJumpStrength * this.Arrow.transform.right.x;
        this.PlatformMovement.LocalSpeedY = chargedJumpStrength * this.Arrow.transform.right.y;
        Vector2 normalized = this.m_sein.PlatformBehaviour.PlatformMovement.LocalSpeed.normalized;

        this.m_angleDirection = Mathf.Atan2(normalized.y, Mathf.Abs(normalized.x)) * 57.29578f * (float)((normalized.x >= 0f) ? 1 : -1);
        Sound.Play(this.JumpSound.GetSound(null), this.m_sein.PlatformBehaviour.PlatformMovement.Position, null);
        this.m_sein.Mortality.DamageReciever.MakeInvincibleToEnemies(this.AntiGravityDuration);
        this.ChangeState(SeinWallChargeJump.State.Jumping);
        this.m_sein.FaceLeft = (this.PlatformMovement.LocalSpeedX < 0f);
        CharacterAnimationSystem.CharacterAnimationState characterAnimationState = this.m_sein.PlatformBehaviour.Visuals.Animation.Play(this.JumpAnimation, 10, new Func <bool>(this.ShouldChargeJumpAnimationKeepPlaying));
        characterAnimationState.OnStartPlaying = new Action(this.OnAnimationStart);
        characterAnimationState.OnStopPlaying  = new Action(this.OnAnimationEnd);
        this.m_sein.PlatformBehaviour.Visuals.SpriteRotater.BeginTiltUpDownInAir(1.5f);
        if (this.m_sein.Abilities.Glide)
        {
            this.m_sein.Abilities.Glide.NeedsRightTriggerReleased = true;
        }
        JumpFlipPlatform.OnSeinChargeJumpEvent();
        this.m_sein.Abilities.ChargeJumpCharging.EndCharge();
    }
	// Token: 0x060011C6 RID: 4550 RVA: 0x000696A8 File Offset: 0x000678A8
	public void PerformJump()
	{
		this.m_currentJumpingMaterial = SurfaceToSoundProviderMap.ColliderMaterialToSurfaceMaterialType(this.Sein.PlatformBehaviour.PlatformMovementListOfColliders.GroundCollider);
		if (this.Sein.Controller.IsCrouching)
		{
			this.PerformCrouchJump();
			Sound.Play(this.JumpSoundProvider.GetSoundForMaterial(this.m_currentJumpingMaterial, null), this.Sein.PlatformBehaviour.PlatformMovement.Position, null);
		}
		else if (this.HasSharplyTurnedAround)
		{
			this.PerformTurnAroundBackFlipJump();
			Sound.Play(this.FlipJumpSoundProvider.GetSoundForMaterial(this.m_currentJumpingMaterial, null), this.Sein.PlatformBehaviour.PlatformMovement.Position, null);
		}
		else if (this.Sein.PlatformBehaviour.LeftRightMovement.HorizontalInput == 0f || this.PlatformMovement.IsOnWall)
		{
			if (this.PlatformMovement.IsOnWall && this.Sein.PlayerAbilities.WallJump.HasAbility && this.Sein.Abilities.WallSlide.IsOnWall)
			{
				this.PerformWallSlideJump();
				Sound.Play(this.JumpSoundProvider.GetSoundForMaterial(this.m_currentJumpingMaterial, null), this.Sein.PlatformBehaviour.PlatformMovement.Position, null);
			}
			else
			{
				this.PerformIdleJump();
			}
		}
		else
		{
			this.PerformRunningJump();
		}
		GameObject gameObject = (GameObject)InstantiateUtility.Instantiate(this.JumpParticleEffect, this.Sein.PlatformBehaviour.PlatformMovement.FeetPosition, Quaternion.identity);
		gameObject.transform.eulerAngles = new Vector3(0f, 0f, MoonMath.Angle.AngleFromVector(-this.Sein.PlatformBehaviour.PlatformMovement.LocalSpeed));
		this.Sein.PlatformBehaviour.Force.ApplyGroundForce(Vector3.down * this.JumpImpulse, 1);
		this.OnJumpEvent(this.PlatformMovement.LocalSpeedY);
		JumpFlipPlatform.OnSeinJumpEvent();
		this.m_timeWeCanJumpRemaining = 0f;
	}
    // Token: 0x0600127E RID: 4734 RVA: 0x0006C838 File Offset: 0x0006AA38
    public void PerformWallJumpRight()
    {
        if (this.m_hasWallJumpedRight)
        {
            return;
        }
        if (this.DontAllowJumpingTowardsWall && this.LeftRightMovement.BaseHorizontalInput < 0f)
        {
            return;
        }
        if (this.LeftRightMovement.BaseHorizontalInput < 0f && this.DoubleJump)
        {
            this.DoubleJump.LockForDuration(this.LockDoubleJumpTowardsDuration);
        }
        if (this.LimitWallJumping)
        {
            this.m_hasWallJumpedRight = true;
        }
        this.m_hasWallJumpedLeft          = false;
        this.PlatformMovement.LocalSpeedX = this.JumpStrength.x * RandomizerBonus.Jumpscale;
        this.PlatformMovement.LocalSpeedY = this.JumpStrength.y * RandomizerBonus.Jumpscale;
        Vector2 localSpeed = this.PlatformMovement.LocalSpeed;

        this.ApplyImpulseToWall(localSpeed);
        if (this.Sein.Input.NormalizedHorizontal > 0)
        {
            this.CharacterSpriteMirror.FaceLeft = false;
            CharacterAnimationSystem.CharacterAnimationState characterAnimationState = this.Sein.PlatformBehaviour.Visuals.Animation.PlayRandom(this.AwayAnimation, 10, new Func <bool>(this.ShouldKeepPlayingWallJumpRightAwayAnimation));
            characterAnimationState.OnStopPlaying  = new Action(this.OnAnimationEnd);
            characterAnimationState.OnStartPlaying = new Action(this.OnAnimationStart);
        }
        else if (this.Sein.Input.NormalizedHorizontal < 0)
        {
            Vector3 origin      = this.PlatformMovement.Position + Vector3.up * 2f;
            float   maxDistance = this.PlatformMovement.CapsuleCollider.radius + 2f;
            Ray     ray         = new Ray(origin, this.PlatformMovement.LocalToWorld(Vector3.left));
            if (Physics.Raycast(ray, maxDistance))
            {
                CharacterAnimationSystem.CharacterAnimationState characterAnimationState2 = this.Sein.PlatformBehaviour.Visuals.Animation.PlayRandom(this.TowardsAnimation, 10, new Func <bool>(this.ShouldKeepPlayingWallJumpRightTowardsAnimation));
                characterAnimationState2.OnStopPlaying = new Action(this.OnAnimationEnd);
                base.StartCoroutine(this.RoutineForMegWhoPlaysMarioAndSucksAtWallJumping());
            }
            else
            {
                CharacterAnimationSystem.CharacterAnimationState characterAnimationState3 = this.Sein.PlatformBehaviour.Visuals.Animation.PlayRandom(this.EdgeJumpAnimation, 10, new Func <bool>(this.ShouldKeepPlayingWallJumpRightTowardsAnimation));
                characterAnimationState3.OnStopPlaying = new Action(this.OnAnimationEnd);
                localSpeed.y = 0f;
            }
        }
        else
        {
            CharacterAnimationSystem.CharacterAnimationState characterAnimationState4 = this.Sein.PlatformBehaviour.Visuals.Animation.PlayRandom(this.RegularAnimation, 10, new Func <bool>(this.ShouldKeepPlayingWallJumpRightRegularAnimation));
            characterAnimationState4.OnStopPlaying  = new Action(this.OnAnimationEnd);
            characterAnimationState4.OnStartPlaying = new Action(this.OnAnimationStart);
        }
        Sound.Play(this.WallJumpSound.GetSoundForMaterial(this.Sein.PlatformBehaviour.WallSurfaceMaterialType, null), this.Sein.PlatformBehaviour.PlatformMovement.Position, null);
        this.OnWallJumpEvent(localSpeed);
        if (this.Sein.PlatformBehaviour.JumpSustain)
        {
            this.Sein.PlatformBehaviour.JumpSustain.SetAmountOfSpeedToLose(localSpeed.y, 1f);
        }
        this.Sein.PlatformBehaviour.AirNoDeceleration.NoDeceleration = true;
        this.Sein.ResetAirLimits();
        JumpFlipPlatform.OnSeinWallJumpEvent();
    }