Esempio n. 1
0
        public override bool OnTileCollide(Vector2 oldVelocity)
        {
            if (this.projectile.npcProj)
            {
                return(true);
            }

            Player plr = Main.player[this.projectile.owner];

            SpiritWalkFlightLogic.ApplySpiritWalkCollisionFriction(plr);
            SpiritWalkFxLogic.ApplySpiritWalkCollisionFriction(plr);

            //

            /*Vector2 newDir = this.projectile.velocity;
             * bool velocityChanged = false;
             *
             * if( this.projectile.velocity.X != oldVelocity.X && Math.Abs(oldVelocity.X) > 1f ) {
             *      newDir.X = oldVelocity.X * -1f;
             *      velocityChanged = true;
             * }
             * if( this.projectile.velocity.Y != oldVelocity.Y && Math.Abs(oldVelocity.Y) > 1f ) {
             *      newDir.Y = oldVelocity.Y * -1f;
             *      velocityChanged = true;
             * }
             *
             * if( velocityChanged ) {
             *      var myplayer = plr.GetModPlayer<SpiritWalkingPlayer>();
             *
             *      float length = myplayer.FlightDirection.Length();
             *      float newAngle = newDir.ToRotation();
             *      float dirAngle = myplayer.FlightDirection.ToRotation();
             *      float newDirAngle = Utils.AngleLerp( dirAngle, newAngle, 0.1f );
             *
             *      myplayer.FlightDirection = newDirAngle.ToRotationVector2();
             *      myplayer.FlightDirection *= length;
             * }*/

            //

            return(false);
        }
Esempio n. 2
0
        ////////////////

        public override void ModifyDrawLayers(List <PlayerLayer> layers)
        {
            SpiritWalkFxLogic.UpdateDrawLayers(this, layers, this.IsSpiritWalking);
        }
Esempio n. 3
0
 public override void FrameEffects()
 {
     SpiritWalkFxLogic.UpdateFrameEffects(this, this.IsSpiritWalking);
 }
Esempio n. 4
0
        ////////////////

        public override void UpdateBiomeVisuals()
        {
            SpiritWalkFxLogic.UpdateBiomeVisuals(this, this.IsSpiritWalking);
        }