diff options
author | Thomas Leyh <leyh.thomas@web.de> | 2016-07-24 08:14:18 +0200 |
---|---|---|
committer | Thomas Leyh <leyh.thomas@web.de> | 2016-07-24 08:14:18 +0200 |
commit | ced3d03bdb3ce866d832e03fb212865140905a9a (patch) | |
tree | 2a16c2063a46d3c354ce1585029dda3124f6ad93 /V3/Objects/Sprite | |
parent | 0394dccaf06e1009e591a6ff4d645895574724c1 (diff) | |
download | V3-ced3d03bdb3ce866d832e03fb212865140905a9a.tar.gz V3-ced3d03bdb3ce866d832e03fb212865140905a9a.tar.bz2 |
Diffstat (limited to 'V3/Objects/Sprite')
41 files changed, 590 insertions, 0 deletions
diff --git a/V3/Objects/Sprite/AbstractSpriteCreature.cs b/V3/Objects/Sprite/AbstractSpriteCreature.cs new file mode 100644 index 0000000..bde139e --- /dev/null +++ b/V3/Objects/Sprite/AbstractSpriteCreature.cs @@ -0,0 +1,201 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; + +namespace V3.Objects.Sprite +{ + public abstract class AbstractSpriteCreature : ISpriteCreature + { + // How many frames are there for each animation type? + protected virtual int IdleFrames { get; } = 4; + protected virtual int MovingFrames { get; } = 8; + protected virtual int AttackingFrames { get; } = 4; + protected virtual int DyingFrames { get; } = 6; + protected virtual int SpecialFrames { get; } = 4; + + /// The row of the specific textures in the texture file. + protected virtual int IdleTextureIndex { get; } = 0; + protected virtual int MovingTextureIndex { get; } = 4; + protected virtual int AttackingTextureIndex { get; } = 12; + protected virtual int DyingTextureIndex { get; } = 18; + protected virtual int SpecialTextureIndex { get; } = 24; + + + // Specify the size of a single animation frame in pixel. + private const int SpriteWidth = 128; + private const int SpriteHeight = 128; + private readonly Point mSpriteShift = new Point(-SpriteWidth / 2, -SpriteHeight * 3 / 4); + private readonly Point mSpriteSize = new Point(SpriteWidth, SpriteHeight); + + private double mTimeSinceUpdate; + private Texture2D mTexture; + // How much time until animation frame is changed (in milliseconds). + private const int UpdatesPerMSec = 125; // 8 FPS + private MovementState mLastMovementState = MovementState.Idle; + private MovementState mCurrentMovementState = MovementState.Idle; + private int mMaxAnimationSteps; + private int mMovementStateRow; + private bool mIdleBackwardsLoop; + private int mAnimationState; + + // Fields for PlayOnce method. + private bool mPriorityAnimation; + private UpdatesPerSecond mUpS; + + protected abstract string TextureFile { get; } + + /// <summary> + /// Loads the texture file and prepares animations. + /// </summary> + /// <param name="contentManager"></param> + public void Load(ContentManager contentManager) + { + mTexture = contentManager.Load<Texture2D>("Sprites/" + TextureFile); + mMaxAnimationSteps = IdleFrames; + } + + /// <summary> + /// Draws the sprite on the screen. + /// </summary> + /// <param name="spriteBatch">Sprite batch used for drawing.</param> + /// <param name="position">Position on the screen where sprite is drawn to.</param> + /// <param name="movementState">What moveset will be used? (Moving, Attacking...)</param> + /// <param name="movementDirection">Where does the sprite face?</param> + public void Draw(SpriteBatch spriteBatch, Vector2 position, MovementState movementState, MovementDirection movementDirection) + { + mCurrentMovementState = movementState; + Point sourceLocation = new Point((mMovementStateRow + mAnimationState) * SpriteWidth, + (int) movementDirection * SpriteHeight); + Rectangle sourceRectangle = new Rectangle(sourceLocation, mSpriteSize); + spriteBatch.Draw(mTexture, position + new Vector2(mSpriteShift.X, mSpriteShift.Y), sourceRectangle, Color.White); + } + + public void DrawStatic(SpriteBatch spriteBatch, Point position, MovementState movementState, MovementDirection movementDirection) + { + Point sourceLocation = new Point((int)movementState * SpriteWidth, (int)movementDirection * SpriteHeight); + Rectangle destinationRectangle = new Rectangle(position + mSpriteShift, mSpriteSize); + Rectangle sourceRectangle = new Rectangle(sourceLocation, mSpriteSize); + spriteBatch.Draw(mTexture, destinationRectangle, sourceRectangle, Color.White); + } + + /// <summary> + /// Change the sprite to show an animation. + /// </summary> + /// <param name="gameTime">Elapsed game time is used for calculating FPS.</param> + public void PlayAnimation(GameTime gameTime) + { + // Playing a single animation cycle just once with higher priority. + if (mPriorityAnimation) + { + if (mAnimationState < mMaxAnimationSteps - 1) + { + if (mUpS.IsItTime(gameTime)) + { + mAnimationState++; + } + return; + } + mAnimationState = 0; + mCurrentMovementState = mLastMovementState; + SelectFrames(mCurrentMovementState); + mPriorityAnimation = false; + return; + } + + // Change texture for showing animations according to elapsed game time. + mTimeSinceUpdate += gameTime.ElapsedGameTime.TotalMilliseconds; + if (mTimeSinceUpdate < UpdatesPerMSec) + { + return; + } + mTimeSinceUpdate = 0; + + // Check which specific animation sprites need to be used. + // Only check if movement state is changed. + if (mCurrentMovementState != mLastMovementState) + { + SelectFrames(mCurrentMovementState); + mAnimationState = 0; + mLastMovementState = mCurrentMovementState; + } + + // Idle animation is looped back and forth. + if (mIdleBackwardsLoop) + { + mAnimationState--; + if (mAnimationState <= 0) + { + mIdleBackwardsLoop = false; + } + return; + } + + if (mAnimationState < mMaxAnimationSteps - 1) + { + mAnimationState++; + } + else + { + if (mLastMovementState == MovementState.Idle) + { + mIdleBackwardsLoop = true; + mAnimationState--; + } + else if (mLastMovementState == MovementState.Dying) + { + } + else + { + mAnimationState = 0; + } + } + } + + private void SelectFrames(MovementState currentMovementState) + { + switch (currentMovementState) + { + case MovementState.Idle: + mMaxAnimationSteps = IdleFrames; + mMovementStateRow = IdleTextureIndex; + mIdleBackwardsLoop = false; + break; + case MovementState.Moving: + mMaxAnimationSteps = MovingFrames; + mMovementStateRow = MovingTextureIndex; + break; + case MovementState.Attacking: + mMaxAnimationSteps = AttackingFrames; + mMovementStateRow = AttackingTextureIndex; + break; + case MovementState.Dying: + mMaxAnimationSteps = DyingFrames; + mMovementStateRow = DyingTextureIndex; + break; + case MovementState.Special: + mMaxAnimationSteps = SpecialFrames; + mMovementStateRow = SpecialTextureIndex; + break; + default: + mMaxAnimationSteps = 1; // No Animation if default case is reached. + break; + } + } + + /// <summary> + /// Plays the specified animation fully, but only once. + /// </summary> + /// <param name="animation">For which movement state the animation should be played.</param> + /// <param name="duration">How long (or how slow) should the animation be?</param> + public void PlayOnce(MovementState animation, TimeSpan duration) + { + mLastMovementState = mCurrentMovementState; + mCurrentMovementState = animation; + mPriorityAnimation = true; + SelectFrames(animation); + mAnimationState = 0; + mUpS = new UpdatesPerSecond(1d / (duration.TotalSeconds / mMaxAnimationSteps)); + } + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ArrowSprite.cs b/V3/Objects/Sprite/ArrowSprite.cs new file mode 100644 index 0000000..76e34b7 --- /dev/null +++ b/V3/Objects/Sprite/ArrowSprite.cs @@ -0,0 +1,42 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; + +namespace V3.Objects.Sprite +{ + /// <summary> + /// A simple arrow from different directions without animations. + /// </summary> + public sealed class ArrowSprite : ISpriteCreature + { + private Texture2D mTexture; + private const int Size = 64; + + public void Load(ContentManager contentManager) + { + mTexture = contentManager.Load<Texture2D>("Sprites/arrows"); + } + + public void Draw(SpriteBatch spriteBatch, Vector2 position, MovementState movementState, MovementDirection movementDirection) + { + spriteBatch.Draw(mTexture, position - new Vector2(Size / 2f), new Rectangle(0, Size * (int) movementDirection, Size, Size), Color.White); + } + + public void DrawStatic(SpriteBatch spriteBatch, + Point position, + MovementState movementState, + MovementDirection movementDirection) + { + Draw(spriteBatch, position.ToVector2(), movementState, movementDirection); + } + + public void PlayAnimation(GameTime gameTime) + { + } + + public void PlayOnce(MovementState animation, TimeSpan duration) + { + } + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/BucklerFemaleSprite.cs b/V3/Objects/Sprite/BucklerFemaleSprite.cs new file mode 100644 index 0000000..7d72869 --- /dev/null +++ b/V3/Objects/Sprite/BucklerFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public class BucklerFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "buckler_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/BucklerSprite.cs b/V3/Objects/Sprite/BucklerSprite.cs new file mode 100644 index 0000000..c55ed81 --- /dev/null +++ b/V3/Objects/Sprite/BucklerSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public class BucklerSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "buckler"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ChainFemaleSprite.cs b/V3/Objects/Sprite/ChainFemaleSprite.cs new file mode 100644 index 0000000..eddfe9d --- /dev/null +++ b/V3/Objects/Sprite/ChainFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class ChainFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "chain_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ChainSprite.cs b/V3/Objects/Sprite/ChainSprite.cs new file mode 100644 index 0000000..33e7042 --- /dev/null +++ b/V3/Objects/Sprite/ChainSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class ChainSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "chain"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ClothFemaleSprite.cs b/V3/Objects/Sprite/ClothFemaleSprite.cs new file mode 100644 index 0000000..3edaec1 --- /dev/null +++ b/V3/Objects/Sprite/ClothFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class ClothFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "cloth_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ClothSprite.cs b/V3/Objects/Sprite/ClothSprite.cs new file mode 100644 index 0000000..b3aaff0 --- /dev/null +++ b/V3/Objects/Sprite/ClothSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class ClothSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "cloth"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/EquipmentType.cs b/V3/Objects/Sprite/EquipmentType.cs new file mode 100644 index 0000000..611c35d --- /dev/null +++ b/V3/Objects/Sprite/EquipmentType.cs @@ -0,0 +1,10 @@ +namespace V3.Objects.Sprite +{ + /// <summary> + /// Different types of equipment slots. + /// </summary> + public enum EquipmentType + { + Body, Head, Weapon, Offhand + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/HeadBaldSprite.cs b/V3/Objects/Sprite/HeadBaldSprite.cs new file mode 100644 index 0000000..7b01e16 --- /dev/null +++ b/V3/Objects/Sprite/HeadBaldSprite.cs @@ -0,0 +1,10 @@ +using System.Diagnostics.CodeAnalysis; + +namespace V3.Objects.Sprite +{ + [SuppressMessage("ReSharper", "UnusedMember.Global")] + public sealed class HeadBaldSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "head_bald"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/HeadChainFemaleSprite.cs b/V3/Objects/Sprite/HeadChainFemaleSprite.cs new file mode 100644 index 0000000..8d8ed90 --- /dev/null +++ b/V3/Objects/Sprite/HeadChainFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public class HeadChainFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "head_chain_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/HeadChainSprite.cs b/V3/Objects/Sprite/HeadChainSprite.cs new file mode 100644 index 0000000..31476f1 --- /dev/null +++ b/V3/Objects/Sprite/HeadChainSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public class HeadChainSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "head_chain"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/HeadFemaleSprite.cs b/V3/Objects/Sprite/HeadFemaleSprite.cs new file mode 100644 index 0000000..b8649aa --- /dev/null +++ b/V3/Objects/Sprite/HeadFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class HeadFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "head_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/HeadPlateFemaleSprite.cs b/V3/Objects/Sprite/HeadPlateFemaleSprite.cs new file mode 100644 index 0000000..8ad7917 --- /dev/null +++ b/V3/Objects/Sprite/HeadPlateFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class HeadPlateFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "head_plate_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/HeadPlateSprite.cs b/V3/Objects/Sprite/HeadPlateSprite.cs new file mode 100644 index 0000000..fa237b3 --- /dev/null +++ b/V3/Objects/Sprite/HeadPlateSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class HeadPlateSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "head_plate"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/HeadSprite.cs b/V3/Objects/Sprite/HeadSprite.cs new file mode 100644 index 0000000..303bb8a --- /dev/null +++ b/V3/Objects/Sprite/HeadSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class HeadSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "head"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ISpriteCreature.cs b/V3/Objects/Sprite/ISpriteCreature.cs new file mode 100644 index 0000000..1339b2a --- /dev/null +++ b/V3/Objects/Sprite/ISpriteCreature.cs @@ -0,0 +1,53 @@ +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; + +namespace V3.Objects.Sprite +{ + /// <summary> + /// + /// </summary> + public interface ISpriteCreature + { + /// <summary> + /// Loads the texture file and prepares animations. + /// </summary> + /// <param name="contentManager">Content manager used.</param> + void Load(ContentManager contentManager); + + /// <summary> + /// Draws the sprite on the screen. + /// </summary> + /// <param name="spriteBatch">Sprite batch used for drawing.</param> + /// <param name="position">Position on the screen in pixels where the sprite should stand.</param> + /// <param name="movementState">What moveset will be used? (Moving, Attacking...)</param> + /// <param name="movementDirection">Where does the sprite face to?</param> + void Draw(SpriteBatch spriteBatch, Vector2 position, MovementState movementState, MovementDirection movementDirection); + + /// <summary> + /// Draws a static image of the sprite. No animations. + /// </summary> + /// <param name="spriteBatch">Sprite batch used for drawing.</param> + /// <param name="position">Position of the sprite in pixels. (Where are the feet of the sprite placed.</param> + /// <param name="movementState">What moveset will be used? (Moving, Attacking...)</param> + /// <param name="movementDirection">Where does the sprite face to?</param> + void DrawStatic(SpriteBatch spriteBatch, + Point position, + MovementState movementState, + MovementDirection movementDirection); + + /// <summary> + /// Change the sprite to show an animation. + /// </summary> + /// <param name="gameTime">Elapsed game time is used for calculating FPS.</param> + void PlayAnimation(GameTime gameTime); + + /// <summary> + /// Plays the specified animation fully, but only once. + /// </summary> + /// <param name="animation">For which movement state the animation should be played.</param> + /// <param name="duration">How long (or how slow) should the animation be?</param> + void PlayOnce(MovementState animation, TimeSpan duration); + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/KingSprite.cs b/V3/Objects/Sprite/KingSprite.cs new file mode 100644 index 0000000..0640514 --- /dev/null +++ b/V3/Objects/Sprite/KingSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public class KingSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "king"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/LongswordFemaleSprite.cs b/V3/Objects/Sprite/LongswordFemaleSprite.cs new file mode 100644 index 0000000..fc10b7c --- /dev/null +++ b/V3/Objects/Sprite/LongswordFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class LongswordFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "longsword_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/LongswordSprite.cs b/V3/Objects/Sprite/LongswordSprite.cs new file mode 100644 index 0000000..7ac1850 --- /dev/null +++ b/V3/Objects/Sprite/LongswordSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class LongswordSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "longsword"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/MeatballSprite.cs b/V3/Objects/Sprite/MeatballSprite.cs new file mode 100644 index 0000000..eeafbe9 --- /dev/null +++ b/V3/Objects/Sprite/MeatballSprite.cs @@ -0,0 +1,11 @@ +namespace V3.Objects.Sprite +{ + public sealed class MeatballSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "fleischklops"; + protected override int AttackingFrames { get; } = 12; + protected override int DyingFrames { get; } = 8; + protected override int AttackingTextureIndex { get; } = 12; + protected override int DyingTextureIndex { get; } = 24; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/NecromancerFemaleSprite.cs b/V3/Objects/Sprite/NecromancerFemaleSprite.cs new file mode 100644 index 0000000..ffecd74 --- /dev/null +++ b/V3/Objects/Sprite/NecromancerFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public class NecromancerFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "necromancer_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/NecromancerSprite.cs b/V3/Objects/Sprite/NecromancerSprite.cs new file mode 100644 index 0000000..494ba13 --- /dev/null +++ b/V3/Objects/Sprite/NecromancerSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class NecromancerSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "necromancer"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/NudeFemaleSprite.cs b/V3/Objects/Sprite/NudeFemaleSprite.cs new file mode 100644 index 0000000..e2aaa2f --- /dev/null +++ b/V3/Objects/Sprite/NudeFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class NudeFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "nude_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/NudeSprite.cs b/V3/Objects/Sprite/NudeSprite.cs new file mode 100644 index 0000000..1056335 --- /dev/null +++ b/V3/Objects/Sprite/NudeSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class NudeSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "nude"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/PlateFemaleSprite.cs b/V3/Objects/Sprite/PlateFemaleSprite.cs new file mode 100644 index 0000000..af3bd79 --- /dev/null +++ b/V3/Objects/Sprite/PlateFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class PlateFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "plate_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/PlateSprite.cs b/V3/Objects/Sprite/PlateSprite.cs new file mode 100644 index 0000000..c8495a0 --- /dev/null +++ b/V3/Objects/Sprite/PlateSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class PlateSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "plate"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/PrinceSprite.cs b/V3/Objects/Sprite/PrinceSprite.cs new file mode 100644 index 0000000..efe9d18 --- /dev/null +++ b/V3/Objects/Sprite/PrinceSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class PrinceSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "prince"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ShieldFemaleSprite.cs b/V3/Objects/Sprite/ShieldFemaleSprite.cs new file mode 100644 index 0000000..0e70545 --- /dev/null +++ b/V3/Objects/Sprite/ShieldFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class ShieldFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "shield_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ShieldSprite.cs b/V3/Objects/Sprite/ShieldSprite.cs new file mode 100644 index 0000000..5830a45 --- /dev/null +++ b/V3/Objects/Sprite/ShieldSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public sealed class ShieldSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "shield"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ShortswordFemaleSprite.cs b/V3/Objects/Sprite/ShortswordFemaleSprite.cs new file mode 100644 index 0000000..a046bb0 --- /dev/null +++ b/V3/Objects/Sprite/ShortswordFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public class ShortswordFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "shortsword_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ShortswordSprite.cs b/V3/Objects/Sprite/ShortswordSprite.cs new file mode 100644 index 0000000..352631f --- /dev/null +++ b/V3/Objects/Sprite/ShortswordSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public class ShortswordSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "shortsword"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/SkeletonArcherSprite.cs b/V3/Objects/Sprite/SkeletonArcherSprite.cs new file mode 100644 index 0000000..1891939 --- /dev/null +++ b/V3/Objects/Sprite/SkeletonArcherSprite.cs @@ -0,0 +1,10 @@ +namespace V3.Objects.Sprite +{ + public class SkeletonArcherSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "skeleton_archer"; + protected override int AttackingFrames { get; } = 4; + protected override int AttackingTextureIndex { get; } = 28; + protected override int DyingTextureIndex { get; } = 22; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/SkeletonEliteSprite.cs b/V3/Objects/Sprite/SkeletonEliteSprite.cs new file mode 100644 index 0000000..99aa94b --- /dev/null +++ b/V3/Objects/Sprite/SkeletonEliteSprite.cs @@ -0,0 +1,9 @@ +namespace V3.Objects.Sprite +{ + public class SkeletonEliteSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "skeleton_elite"; + protected override int AttackingFrames { get; } = 4; + protected override int DyingTextureIndex { get; } = 22; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/SkeletonHorseSprite.cs b/V3/Objects/Sprite/SkeletonHorseSprite.cs new file mode 100644 index 0000000..f26b58b --- /dev/null +++ b/V3/Objects/Sprite/SkeletonHorseSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public class SkeletonHorseSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "skeleton_horse"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/SkeletonRiderSprite.cs b/V3/Objects/Sprite/SkeletonRiderSprite.cs new file mode 100644 index 0000000..278d8c7 --- /dev/null +++ b/V3/Objects/Sprite/SkeletonRiderSprite.cs @@ -0,0 +1,10 @@ +namespace V3.Objects.Sprite +{ + public class SkeletonRiderSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "skeleton_rider"; + protected override int AttackingFrames { get; } = 5; + protected override int DyingTextureIndex { get; } = 0; + protected override int DyingFrames { get; } = 0; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/SkeletonSprite.cs b/V3/Objects/Sprite/SkeletonSprite.cs new file mode 100644 index 0000000..15f7246 --- /dev/null +++ b/V3/Objects/Sprite/SkeletonSprite.cs @@ -0,0 +1,9 @@ +namespace V3.Objects.Sprite +{ + public sealed class SkeletonSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "skeleton"; + protected override int AttackingFrames { get; } = 4; + protected override int DyingTextureIndex { get; } = 22; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/StaffFemaleSprite.cs b/V3/Objects/Sprite/StaffFemaleSprite.cs new file mode 100644 index 0000000..5e4120c --- /dev/null +++ b/V3/Objects/Sprite/StaffFemaleSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public class StaffFemaleSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "staff_female"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/StaffSprite.cs b/V3/Objects/Sprite/StaffSprite.cs new file mode 100644 index 0000000..aac7bed --- /dev/null +++ b/V3/Objects/Sprite/StaffSprite.cs @@ -0,0 +1,7 @@ +namespace V3.Objects.Sprite +{ + public class StaffSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "staff"; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ZombieSprite.cs b/V3/Objects/Sprite/ZombieSprite.cs new file mode 100644 index 0000000..0cd1a19 --- /dev/null +++ b/V3/Objects/Sprite/ZombieSprite.cs @@ -0,0 +1,11 @@ +namespace V3.Objects.Sprite +{ + public sealed class ZombieSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "zombie"; + protected override int AttackingFrames { get; } = 8; + protected override int DyingTextureIndex { get; } = 22; + protected override int SpecialTextureIndex { get; } = 36; + protected override int SpecialFrames { get; } = 8; + } +}
\ No newline at end of file diff --git a/V3/Objects/Sprite/ZombieWithClubSprite.cs b/V3/Objects/Sprite/ZombieWithClubSprite.cs new file mode 100644 index 0000000..60abc24 --- /dev/null +++ b/V3/Objects/Sprite/ZombieWithClubSprite.cs @@ -0,0 +1,11 @@ +namespace V3.Objects.Sprite +{ + public sealed class ZombieWithClubSprite : AbstractSpriteCreature + { + protected override string TextureFile { get; } = "zombie_club"; + protected override int AttackingFrames { get; } = 8; + protected override int DyingTextureIndex { get; } = 22; + protected override int SpecialTextureIndex { get; } = 36; + protected override int SpecialFrames { get; } = 8; + } +}
\ No newline at end of file |