diff --git a/EndlessClient/Rendering/Character/CharacterTextures.cs b/EndlessClient/Rendering/Character/CharacterTextures.cs index 91cde3d69..961c6c61c 100644 --- a/EndlessClient/Rendering/Character/CharacterTextures.cs +++ b/EndlessClient/Rendering/Character/CharacterTextures.cs @@ -15,6 +15,7 @@ public class CharacterTextures : ICharacterTextures public ISpriteSheet Shield { get; private set; } public ISpriteSheet Weapon { get; private set; } public ISpriteSheet WeaponExtra { get; private set; } + public ISpriteSheet WeaponSlash{ get; private set; } public ISpriteSheet Hair { get; private set; } public ISpriteSheet Skin { get; private set; } @@ -38,6 +39,8 @@ public void Refresh(CharacterRenderProperties characterRenderProperties) Weapon = weaponTextures[0]; WeaponExtra = weaponTextures[1]; + WeaponSlash = _characterSpriteCalculator.GetWeaponSlash(characterRenderProperties); + Hair = _characterSpriteCalculator.GetHairTexture(characterRenderProperties); Skin = _characterSpriteCalculator.GetSkinTexture(characterRenderProperties); Emote = _characterSpriteCalculator.GetEmoteTexture(characterRenderProperties); diff --git a/EndlessClient/Rendering/Character/ICharacterTextures.cs b/EndlessClient/Rendering/Character/ICharacterTextures.cs index 4d9f06358..9869d503a 100644 --- a/EndlessClient/Rendering/Character/ICharacterTextures.cs +++ b/EndlessClient/Rendering/Character/ICharacterTextures.cs @@ -12,6 +12,7 @@ public interface ICharacterTextures ISpriteSheet Shield { get; } ISpriteSheet Weapon { get; } ISpriteSheet WeaponExtra { get; } + ISpriteSheet WeaponSlash { get; } ISpriteSheet Hair { get; } ISpriteSheet Skin { get; } diff --git a/EndlessClient/Rendering/CharacterProperties/CharacterPropertyRendererBuilder.cs b/EndlessClient/Rendering/CharacterProperties/CharacterPropertyRendererBuilder.cs index ae88af764..d269f11bc 100644 --- a/EndlessClient/Rendering/CharacterProperties/CharacterPropertyRendererBuilder.cs +++ b/EndlessClient/Rendering/CharacterProperties/CharacterPropertyRendererBuilder.cs @@ -63,6 +63,8 @@ public IEnumerable BuildList(ICharacterTextures text { LayerDepth = BaseLayer * (hatMaskType == HatMaskType.FaceMask ? 11 : 10) }; + + yield return new WeaponSlashRenderer(renderProperties, textures.WeaponSlash) { LayerDepth = BaseLayer * 14 }; } private bool IsShieldBehindCharacter(CharacterRenderProperties renderProperties) diff --git a/EndlessClient/Rendering/CharacterProperties/WeaponSlashRenderer.cs b/EndlessClient/Rendering/CharacterProperties/WeaponSlashRenderer.cs new file mode 100644 index 000000000..328aa6613 --- /dev/null +++ b/EndlessClient/Rendering/CharacterProperties/WeaponSlashRenderer.cs @@ -0,0 +1,46 @@ +using EndlessClient.Rendering.Metadata.Models; +using EndlessClient.Rendering.Sprites; +using EOLib; +using EOLib.Domain.Character; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace EndlessClient.Rendering.CharacterProperties +{ + public class WeaponSlashRenderer : BaseCharacterPropertyRenderer + { + private readonly ISpriteSheet _slashSheet; + + public override bool CanRender => _slashSheet.HasTexture && _renderProperties.WeaponGraphic != 0 && _renderProperties.RenderAttackFrame == 2; + + protected override bool ShouldFlip => false; + + public WeaponSlashRenderer(CharacterRenderProperties renderProperties, + ISpriteSheet slashSheet) + : base(renderProperties) + { + _slashSheet = slashSheet; + } + + public override void Render(SpriteBatch spriteBatch, Rectangle parentCharacterDrawArea, WeaponMetadata weaponMetadata) + { + if (weaponMetadata.Slash == null || weaponMetadata.Ranged) + return; + + var offsets = GetOffsets(parentCharacterDrawArea) - new Vector2(0, _renderProperties.Gender); + Render(spriteBatch, _slashSheet, parentCharacterDrawArea.Location.ToVector2() + offsets, 96); + } + + private Vector2 GetOffsets(Rectangle parentCharacterDrawArea) + { + return _renderProperties.Direction switch + { + EODirection.Down => new Vector2(-30, 4), + EODirection.Left => new Vector2(-34, -9), + EODirection.Up => new Vector2(-6, -9), + EODirection.Right => new Vector2(-10, 4), + _ => Vector2.Zero + }; + } + } +} diff --git a/EndlessClient/Rendering/Metadata/WeaponMetadataProvider.cs b/EndlessClient/Rendering/Metadata/WeaponMetadataProvider.cs index 470ada40d..95f2830a9 100644 --- a/EndlessClient/Rendering/Metadata/WeaponMetadataProvider.cs +++ b/EndlessClient/Rendering/Metadata/WeaponMetadataProvider.cs @@ -17,81 +17,81 @@ public WeaponMetadataProvider(IGFXMetadataLoader metadataLoader) { _metadata = new Dictionary { - { 0, new WeaponMetadata( null, new[] { SoundEffectID.PunchAttack }, false) }, // fist - { 1, new WeaponMetadata( 3, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // wood axe - { 2, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // sai - { 3, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // dragon blade - { 4, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // dagger - { 5, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // spear - { 6, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // saber - { 7, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // staff - { 8, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // book - { 9, new WeaponMetadata( 3, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // mace - { 10, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // spirit star - { 11, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // throw axe - { 12, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // dark katana - { 13, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // short sword - { 14, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // broadsword - { 15, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // broom - { 16, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // ninchackus - { 17, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // ancient star - { 18, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // battle axe - { 19, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // ancient sword - { 20, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // luna staff - { 21, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // lance - { 22, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // aura staff - { 23, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // forest staff - { 24, new WeaponMetadata( 1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // normal sword - { 25, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // jewel staff - { 26, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // thor's hammer - { 27, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // light katana - { 28, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // polearm - { 29, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // sickle - { 30, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // trident - { 31, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // warlock sword - { 32, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // whip - { 33, new WeaponMetadata( 5, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // ultima - { 34, new WeaponMetadata( 5, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // ice blade - { 35, new WeaponMetadata( 1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // gold defender - { 36, new WeaponMetadata( 4, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // lotus sword - { 37, new WeaponMetadata( 4, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // cristal sword - { 38, new WeaponMetadata( 5, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // killing edge - { 39, new WeaponMetadata( 7, new[] { SoundEffectID.AlternateMeleeAttack }, false) }, // dark blade - { 40, new WeaponMetadata( 7, new[] { SoundEffectID.AlternateMeleeAttack }, false) }, // reaper scyth - { 41, new WeaponMetadata( 1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // crescent staff - { 42, new WeaponMetadata( 0, new[] { SoundEffectID.AttackBow }, true) }, // bow - { 43, new WeaponMetadata( 0, new[] { SoundEffectID.AttackBow }, true) }, // xbow - { 44, new WeaponMetadata( 8, new[] { SoundEffectID.AlternateMeleeAttack }, false) }, // reaper - { 45, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // hockey stick - { 46, new WeaponMetadata( 5, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // twin blades - { 47, new WeaponMetadata( 1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // lefor mace - { 48, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // cava staff - { 49, new WeaponMetadata( 0, new[] { SoundEffectID.Harp1,SoundEffectID.Harp2,SoundEffectID.Harp3}, true) }, // harp - { 50, new WeaponMetadata( 0, new[] { SoundEffectID.Guitar1,SoundEffectID.Guitar2, SoundEffectID.Guitar3 }, true) }, // guitar - { 51, new WeaponMetadata( 5, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // battle spear - { 52, new WeaponMetadata( 1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // flail - { 53, new WeaponMetadata( 1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // war axe - { 54, new WeaponMetadata( 1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // gastro - { 55, new WeaponMetadata( 7, new[] { SoundEffectID.AlternateMeleeAttack }, false) }, // ablo staff - { 56, new WeaponMetadata( 1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // fluon sword - { 57, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // rapier - { 58, new WeaponMetadata( 0, new[] { SoundEffectID.Gun }, true) }, // gun - { 59, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // knob staff - { 60, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // fladdat staff - { 61, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // gabrasto - { 62, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // battle spear 2 - { 63, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // lens of truth - { 64, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // chopper - { 65, new WeaponMetadata( 3, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // adger - { 66, new WeaponMetadata( 1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // chains - { 67, new WeaponMetadata( 2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // mitova - { 68, new WeaponMetadata( 3, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // merhawk - { 69, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // kontra - { 70, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // jack spear - { 71, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // bazar staff - { 72, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // saw blade - { 73, new WeaponMetadata( 0, new[] { SoundEffectID.AttackBow }, true) }, // scav bow - { 74, new WeaponMetadata( 0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // fan + { 0, new WeaponMetadata(null, new[] { SoundEffectID.PunchAttack }, false) }, // fist + { 1, new WeaponMetadata(3, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // wood axe + { 2, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // sai + { 3, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // dragon blade + { 4, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // dagger + { 5, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // spear + { 6, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // saber + { 7, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // staff + { 8, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // book + { 9, new WeaponMetadata(3, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // mace + { 10, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // spirit star + { 11, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // throw axe + { 12, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // dark katana + { 13, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // short sword + { 14, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // broadsword + { 15, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // broom + { 16, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // ninchackus + { 17, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // ancient star + { 18, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // battle axe + { 19, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // ancient sword + { 20, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // luna staff + { 21, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // lance + { 22, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // aura staff + { 23, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // forest staff + { 24, new WeaponMetadata(1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // normal sword + { 25, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // jewel staff + { 26, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // thor's hammer + { 27, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // light katana + { 28, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // polearm + { 29, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // sickle + { 30, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // trident + { 31, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // warlock sword + { 32, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // whip + { 33, new WeaponMetadata(5, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // ultima + { 34, new WeaponMetadata(5, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // ice blade + { 35, new WeaponMetadata(1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // gold defender + { 36, new WeaponMetadata(4, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // lotus sword + { 37, new WeaponMetadata(4, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // cristal sword + { 38, new WeaponMetadata(5, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // killing edge + { 39, new WeaponMetadata(7, new[] { SoundEffectID.AlternateMeleeAttack }, false) }, // dark blade + { 40, new WeaponMetadata(7, new[] { SoundEffectID.AlternateMeleeAttack }, false) }, // reaper scyth + { 41, new WeaponMetadata(1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // crescent staff + { 42, new WeaponMetadata(0, new[] { SoundEffectID.AttackBow }, true) }, // bow + { 43, new WeaponMetadata(0, new[] { SoundEffectID.AttackBow }, true) }, // xbow + { 44, new WeaponMetadata(8, new[] { SoundEffectID.AlternateMeleeAttack }, false) }, // reaper + { 45, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // hockey stick + { 46, new WeaponMetadata(5, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // twin blades + { 47, new WeaponMetadata(1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // lefor mace + { 48, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // cava staff + { 49, new WeaponMetadata(0, new[] { SoundEffectID.Harp1,SoundEffectID.Harp2,SoundEffectID.Harp3}, true) }, // harp + { 50, new WeaponMetadata(0, new[] { SoundEffectID.Guitar1,SoundEffectID.Guitar2, SoundEffectID.Guitar3 }, true) }, // guitar + { 51, new WeaponMetadata(5, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // battle spear + { 52, new WeaponMetadata(1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // flail + { 53, new WeaponMetadata(1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // war axe + { 54, new WeaponMetadata(1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // gastro + { 55, new WeaponMetadata(7, new[] { SoundEffectID.AlternateMeleeAttack }, false) }, // ablo staff + { 56, new WeaponMetadata(1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // fluon sword + { 57, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // rapier + { 58, new WeaponMetadata(0, new[] { SoundEffectID.Gun }, true) }, // gun + { 59, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // knob staff + { 60, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // fladdat staff + { 61, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // gabrasto + { 62, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // battle spear 2 + { 63, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // lens of truth + { 64, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // chopper + { 65, new WeaponMetadata(3, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // adger + { 66, new WeaponMetadata(1, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // chains + { 67, new WeaponMetadata(2, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // mitova + { 68, new WeaponMetadata(3, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // merhawk + { 69, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // kontra + { 70, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // jack spear + { 71, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // bazar staff + { 72, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // saw blade + { 73, new WeaponMetadata(0, new[] { SoundEffectID.AttackBow }, true) }, // scav bow + { 74, new WeaponMetadata(0, new[] { SoundEffectID.MeleeWeaponAttack }, false) }, // fan }; _metadataLoader = metadataLoader; } diff --git a/EndlessClient/Rendering/Sprites/CharacterSpriteCalculator.cs b/EndlessClient/Rendering/Sprites/CharacterSpriteCalculator.cs index 1b33285f7..7da2d8533 100644 --- a/EndlessClient/Rendering/Sprites/CharacterSpriteCalculator.cs +++ b/EndlessClient/Rendering/Sprites/CharacterSpriteCalculator.cs @@ -287,6 +287,22 @@ public ISpriteSheet[] GetWeaponTextures(CharacterRenderProperties characterRende return retTextures; } + public ISpriteSheet GetWeaponSlash(CharacterRenderProperties characterRenderProperties) + { + const int NUM_SLASHES = 9; + + var metadata = _weaponMetadataProvider.GetValueOrDefault(characterRenderProperties.WeaponGraphic); + if (!metadata.Slash.HasValue || metadata.Ranged || characterRenderProperties.RenderAttackFrame != 2) + return new EmptySpriteSheet(); + + var sheet = _gfxManager.TextureFromResource(GFXTypes.PostLoginUI, 40, transparent: true); + return new SpriteSheet(sheet, + new Rectangle(sheet.Width / 4 * (int)characterRenderProperties.Direction, + sheet.Height / NUM_SLASHES * metadata.Slash.Value, + sheet.Width / 4, + sheet.Height / NUM_SLASHES)); + } + public ISpriteSheet GetSkinTexture(CharacterRenderProperties characterRenderProperties) { const int SheetRows = 7; diff --git a/EndlessClient/Rendering/Sprites/ICharacterSpriteCalculator.cs b/EndlessClient/Rendering/Sprites/ICharacterSpriteCalculator.cs index 70275c6c1..1fe5818ba 100644 --- a/EndlessClient/Rendering/Sprites/ICharacterSpriteCalculator.cs +++ b/EndlessClient/Rendering/Sprites/ICharacterSpriteCalculator.cs @@ -4,15 +4,16 @@ namespace EndlessClient.Rendering.Sprites { public interface ICharacterSpriteCalculator { - ISpriteSheet GetBootsTexture(CharacterRenderProperties _characterRenderProperties); - ISpriteSheet GetArmorTexture(CharacterRenderProperties _characterRenderProperties); - ISpriteSheet GetHatTexture(CharacterRenderProperties _characterRenderProperties); - ISpriteSheet GetShieldTexture(CharacterRenderProperties _characterRenderProperties); - ISpriteSheet[] GetWeaponTextures(CharacterRenderProperties _characterRenderProperties); + ISpriteSheet GetBootsTexture(CharacterRenderProperties characterRenderProperties); + ISpriteSheet GetArmorTexture(CharacterRenderProperties characterRenderProperties); + ISpriteSheet GetHatTexture(CharacterRenderProperties characterRenderProperties); + ISpriteSheet GetShieldTexture(CharacterRenderProperties characterRenderProperties); + ISpriteSheet[] GetWeaponTextures(CharacterRenderProperties characterRenderProperties); + ISpriteSheet GetWeaponSlash(CharacterRenderProperties characterRenderProperties); - ISpriteSheet GetSkinTexture(CharacterRenderProperties _characterRenderProperties); - ISpriteSheet GetHairTexture(CharacterRenderProperties _characterRenderProperties); - ISpriteSheet GetFaceTexture(CharacterRenderProperties _characterRenderProperties); - ISpriteSheet GetEmoteTexture(CharacterRenderProperties _characterRenderProperties); + ISpriteSheet GetSkinTexture(CharacterRenderProperties characterRenderProperties); + ISpriteSheet GetHairTexture(CharacterRenderProperties characterRenderProperties); + ISpriteSheet GetFaceTexture(CharacterRenderProperties characterRenderProperties); + ISpriteSheet GetEmoteTexture(CharacterRenderProperties characterRenderProperties); } }