Ejemplo n.º 1
0
 private void RenderSword(SpriteBatch spriteBatch, PlayerAnimation xAnim, Vector2 v2TruPos, SpriteEffectWrapper.RenderSpan enEffectSpan, bool bGlowPass = false)
 {
     if (!this.bRenderWeapon)
     {
         return;
     }
     if (!bGlowPass)
     {
         spriteBatch.End();
         RenderMaster.ChangeClothingSetInShader(Program.GetTheGame().dsxEffects["ColorReplace"].xEffect, this.av4ClothingColors);
         spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null, Program.GetTheGame().dsxEffects["ColorReplace"].xEffect);
     }
     if (xAnim.xTextureSet.txWeapon != null)
     {
         spriteBatch.Draw(this.dixAnimations[this.iActiveAnimation].xTextureSet.txWeapon, v2TruPos, new Rectangle?(this.dixAnimations[this.iActiveAnimation].recCurrentFrame), Color.White, this.fRotation, this.dixAnimations[this.iActiveAnimation].v2PositionOffset, base.fScale, this.enSpriteEffect, 0f);
     }
     else if (Utility.IsWithinRange((int)xAnim.iID, 570, 573))
     {
         if (HatAnimation.dixLibrary.ContainsKey(this.iActiveAnimation))
         {
             Vector2 v2RenderPos = v2TruPos + this.v2OffsetRenderPos - this.dixAnimations[this.iActiveAnimation].v2PositionOffset + HatAnimation.dixLibrary[this.iActiveAnimation].av2Offsets[this.GetCurrentAnimation().iRenderedFrame];
             Rectangle recSource;
             if (this.xOwnerObject.byAnimationDirection == 0)
             {
                 recSource = new Rectangle(0, 0, 30, 36);
             }
             else if (this.xOwnerObject.byAnimationDirection == 2)
             {
                 recSource = new Rectangle(0, 0, 28, 38);
             }
             else
             {
                 recSource = new Rectangle(0, 0, 31, 37);
             }
             spriteBatch.Draw(this.dixAnimations[(ushort)(554 + (int)this.GetCurrentAnimation().byAnimationDirection)].xTextureSet.txWeapon, Utility.Vector2_ToInts(v2RenderPos), new Rectangle?(recSource), this.cColor, 0f, WeaponInfo.av2OneHandedOffsets[(int)this.GetCurrentAnimation().byAnimationDirection], base.fScale, this.enSpriteEffect, 0f);
         }
     }
     else if (Utility.IsWithinRange((int)xAnim.iID, 662, 665) && HatAnimation.dixLibrary.ContainsKey(this.iActiveAnimation))
     {
         Vector2 v2RenderPos2 = v2TruPos + this.v2OffsetRenderPos - this.dixAnimations[this.iActiveAnimation].v2PositionOffset + HatAnimation.dixLibrary[this.iActiveAnimation].av2Offsets[this.GetCurrentAnimation().iRenderedFrame];
         Rectangle recSource2;
         if (this.xOwnerObject.byAnimationDirection == 0)
         {
             recSource2 = new Rectangle(0, 0, 60, 36);
         }
         else if (this.xOwnerObject.byAnimationDirection == 2)
         {
             recSource2 = new Rectangle(0, 0, 67, 42);
         }
         else
         {
             recSource2 = new Rectangle(0, 0, 50, 37);
         }
         spriteBatch.Draw(this.dixAnimations[(ushort)(658 + (int)this.GetCurrentAnimation().byAnimationDirection)].xTextureSet.txWeapon, Utility.Vector2_ToInts(v2RenderPos2), new Rectangle?(recSource2), this.cColor, 0f, WeaponInfo.av2TwoHandedOffsets[(int)this.GetCurrentAnimation().byAnimationDirection], base.fScale, this.enSpriteEffect, 0f);
     }
     if (!bGlowPass)
     {
         spriteBatch.End();
         spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null);
     }
 }
Ejemplo n.º 2
0
 private void RenderShield(SpriteBatch spriteBatch, PlayerAnimation xAnim, Vector2 v2TruPos, SpriteEffectWrapper.RenderSpan enEffectSpan)
 {
     if (xAnim.xTextureSet.txShield != null)
     {
         if (enEffectSpan == SpriteEffectWrapper.RenderSpan.ShieldOnly)
         {
             spriteBatch.End();
             spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null, base.xEffectWrapper.xEffect);
         }
         spriteBatch.Draw(this.dixAnimations[this.iActiveAnimation].xTextureSet.txShield, v2TruPos, new Rectangle?(this.dixAnimations[this.iActiveAnimation].recCurrentFrame), Color.White, this.fRotation, this.dixAnimations[this.iActiveAnimation].v2PositionOffset, base.fScale, this.enSpriteEffect, 0f);
         if (enEffectSpan == SpriteEffectWrapper.RenderSpan.ShieldOnly)
         {
             spriteBatch.End();
             spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null);
             return;
         }
     }
     else if ((Utility.IsWithinRange((int)xAnim.iID, 28, 31) || Utility.IsWithinRange((int)xAnim.iID, 32, 35)) && HatAnimation.dixLibrary.ContainsKey(this.iActiveAnimation))
     {
         Vector2 v2RenderPos = v2TruPos + this.v2OffsetRenderPos - this.dixAnimations[this.iActiveAnimation].v2PositionOffset + HatAnimation.dixLibrary[this.iActiveAnimation].av2Offsets[this.GetCurrentAnimation().iRenderedFrame];
         Vector2 v2PosOffset;
         if (this.xOwnerObject.byAnimationDirection == 0)
         {
             v2PosOffset = new Vector2(0f, 1f);
         }
         else if (this.xOwnerObject.byAnimationDirection == 1)
         {
             v2PosOffset = new Vector2(6f, 2f);
         }
         else if (this.xOwnerObject.byAnimationDirection == 2)
         {
             v2PosOffset = new Vector2(2f, -7f);
         }
         else
         {
             v2PosOffset = new Vector2(1f, 2f);
         }
         if (Utility.IsWithinRange((int)xAnim.iID, 32, 35) && xAnim.iRenderedFrame == 0)
         {
             if (this.xOwnerObject.byAnimationDirection == 0)
             {
                 v2PosOffset.Y += 1f;
             }
             else if (this.xOwnerObject.byAnimationDirection == 1)
             {
                 v2PosOffset.X -= 1f;
             }
             else if (this.xOwnerObject.byAnimationDirection == 2)
             {
                 v2PosOffset.Y -= 1f;
             }
             else
             {
                 v2PosOffset.X += 1f;
             }
         }
         if (this.xOwnerObject.byAnimationDirection == 0)
         {
             new Rectangle(0, 0, 25, 33);
         }
         else if (this.xOwnerObject.byAnimationDirection == 2)
         {
             new Rectangle(0, 0, 26, 41);
         }
         else
         {
             new Rectangle(0, 0, 23, 34);
         }
         if (enEffectSpan == SpriteEffectWrapper.RenderSpan.ShieldOnly)
         {
             spriteBatch.End();
             spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null, base.xEffectWrapper.xEffect);
         }
         spriteBatch.Draw(this.dixAnimations[(ushort)(20 + this.GetCurrentAnimation().byAnimationDirection)].xTextureSet.txShield, Utility.Vector2_ToInts(v2RenderPos + v2PosOffset), null, this.cColor, 0f, WeaponInfo.av2OneHandedOffsets[(int)this.GetCurrentAnimation().byAnimationDirection], base.fScale, this.enSpriteEffect, 0f);
         if (enEffectSpan == SpriteEffectWrapper.RenderSpan.ShieldOnly)
         {
             spriteBatch.End();
             spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, DepthStencilState.Default, null);
         }
     }
 }