Exemplo n.º 1
0
        public WndHero()
        {
            icons = TextureCache.Get(Assets.BUFFS_LARGE);
            film  = new TextureFilm(icons, 16, 16);

            stats = new StatsTab(this);
            Add(stats);

            buffs = new BuffsTab(this);
            Add(buffs);

            var statsTab = new LabeledTab(this, TXT_STATS);

            statsTab.SelectAction = StatsSelect;
            Add(statsTab);

            var buffsTab = new LabeledTab(this, TXT_BUFFS);

            buffsTab.SelectAction = BuffsSelect;
            Add(buffsTab);

            foreach (var tab in Tabs)
            {
                tab.SetSize(TAB_WIDTH, TabHeight());
            }

            Resize(WIDTH, (int)Math.Max(stats.Height(), buffs.Height()));

            Select(0);
        }
Exemplo n.º 2
0
 public SpellSprite()
     : base(Assets.SPELL_ICONS)
 {
     if (_film == null)
     {
         _film = new TextureFilm(texture, Size);
     }
 }
Exemplo n.º 3
0
        public ItemSprite(int image, Glowing glowing)
            : base(Assets.ITEMS)
        {
            if (film == null)
            {
                film = new TextureFilm(texture, SIZE, SIZE);
            }

            View(image, glowing);
        }
Exemplo n.º 4
0
        public Speck()
        {
            Texture(Assets.SPECKS);

            if (_film == null)
            {
                _film = new TextureFilm(texture, Size, Size);
            }

            Origin.Set(Size / 2f);
        }
Exemplo n.º 5
0
        public static Image Image(int index)
        {
            var image = new Image(Assets.BADGES);

            if (_atlas == null)
            {
                _atlas = new TextureFilm(image.texture, 16, 16);
            }

            image.Frame(_atlas.Get(index));
            return(image);
        }
Exemplo n.º 6
0
        public PlantSprite()
            : base(Assets.PLANTS)
        {
            if (_frames == null)
            {
                // Hardcoded size
                _frames = new TextureFilm(texture, 16, 16);
            }

            // Hardcoded origin
            Origin.Set(8, 12);
        }
Exemplo n.º 7
0
        public ShopkeeperSprite()
        {
            Texture(Assets.KEEPER);
            var film = new TextureFilm(texture, 14, 14);

            IdleAnimation = new Animation(10, true);
            IdleAnimation.Frames(film, 1, 1, 1, 1, 1, 0, 0, 0, 0);

            RunAnimation    = IdleAnimation.Clone();
            DieAnimation    = IdleAnimation.Clone();
            AttackAnimation = IdleAnimation.Clone();

            Idle();
        }
Exemplo n.º 8
0
        public static TextureFilm Tiers()
        {
            if (_tiers != null)
            {
                return(_tiers);
            }

            // Sprites for All classes are the same in size
            var texture = TextureCache.Get(Assets.ROGUE);

            _tiers = new TextureFilm(texture, texture.Width, FrameHeight);

            return(_tiers);
        }
Exemplo n.º 9
0
        public GhostSprite()
        {
            Texture(Assets.GHOST);

            TextureFilm frames = new TextureFilm(texture, 14, 15);

            IdleAnimation = new Animation(5, true);
            IdleAnimation.Frames(frames, 0, 1);

            RunAnimation = new Animation(10, true);
            RunAnimation.Frames(frames, 0, 1);

            DieAnimation = new Animation(20, false);
            DieAnimation.Frames(frames, 0);

            Play(IdleAnimation);
        }
Exemplo n.º 10
0
        public WandmakerSprite()
        {
            Texture(Assets.MAKER);

            var frames = new TextureFilm(texture, 12, 14);

            IdleAnimation = new Animation(10, true);
            IdleAnimation.Frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 3, 3, 3, 2, 1);

            RunAnimation = new Animation(20, true);
            RunAnimation.Frames(frames, 0);

            DieAnimation = new Animation(20, false);
            DieAnimation.Frames(frames, 0);

            Play(IdleAnimation);
        }
Exemplo n.º 11
0
            public Pet()
                : base(Assets.PET)
            {
                var frames = new TextureFilm(texture, 16, 16);


                _idle = new Animation(2, true);
                _idle.Frames(frames, 0, 0, 0, 0, 0, 0, 1);


                _jump = new Animation(10, false);
                _jump.Frames(frames, 2, 3, 4, 5, 6);

                Listener = this;

                Play(_idle);
            }
Exemplo n.º 12
0
        public BlacksmithSprite()
        {
            Texture(Assets.TROLL);

            var frames = new TextureFilm(texture, 13, 16);

            IdleAnimation = new Animation(15, true);
            IdleAnimation.Frames(frames, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 2, 3);

            RunAnimation = new Animation(20, true);
            RunAnimation.Frames(frames, 0);

            DieAnimation = new Animation(20, false);
            DieAnimation.Frames(frames, 0);

            Play(IdleAnimation);
        }
Exemplo n.º 13
0
        public ImpSprite()
        {
            Texture(Assets.IMP);

            var frames = new TextureFilm(texture, 12, 14);

            IdleAnimation = new Animation(10, true);
            IdleAnimation.Frames(frames, 0, 1, 2, 3, 0, 1, 2, 3, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 3, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4);

            RunAnimation = new Animation(20, true);
            RunAnimation.Frames(frames, 0);

            DieAnimation = new Animation(10, false);
            DieAnimation.Frames(frames, 0, 3, 2, 1, 0, 3, 2, 1, 0);

            Play(IdleAnimation);
        }
Exemplo n.º 14
0
        public SheepSprite()
        {
            Texture(Assets.SHEEP);

            var frames = new TextureFilm(texture, 16, 15);

            IdleAnimation = new Animation(8, true);
            IdleAnimation.Frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0);

            RunAnimation    = IdleAnimation.Clone();
            AttackAnimation = IdleAnimation.Clone();

            DieAnimation = new Animation(20, false);
            DieAnimation.Frames(frames, 0);

            Play(IdleAnimation);
            curFrame = pdsharp.utils.Random.Int(curAnim.frames.Length);
        }
Exemplo n.º 15
0
        public virtual void UpdateArmor(int tier)
        {
            var film = new TextureFilm(HeroSprite.Tiers(), tier, FrameWidth, FrameHeight);

            IdleAnimation = new Animation(1, true);
            IdleAnimation.Frames(film, 0, 0, 0, 1, 0, 0, 1, 1);

            RunAnimation = new Animation(20, true);
            RunAnimation.Frames(film, 2, 3, 4, 5, 6, 7);

            DieAnimation = new Animation(20, false);
            DieAnimation.Frames(film, 0);

            AttackAnimation = new Animation(15, false);
            AttackAnimation.Frames(film, 13, 14, 15, 0);

            Idle();
        }
Exemplo n.º 16
0
        public ShieldedSprite()
        {
            Texture(Assets.BRUTE);

            var frames = new TextureFilm(texture, 12, 16);

            IdleAnimation = new Animation(2, true);
            IdleAnimation.Frames(frames, 21, 21, 21, 22, 21, 21, 22, 22);

            RunAnimation = new Animation(12, true);
            RunAnimation.Frames(frames, 25, 26, 27, 28);

            AttackAnimation = new Animation(12, false);
            AttackAnimation.Frames(frames, 23, 24);

            DieAnimation = new Animation(12, false);
            DieAnimation.Frames(frames, 29, 30, 31);

            Play(IdleAnimation);
        }
Exemplo n.º 17
0
        public GnollSprite()
        {
            Texture(Assets.GNOLL);

            var frames = new TextureFilm(texture, 12, 15);

            IdleAnimation = new Animation(2, true);
            IdleAnimation.Frames(frames, 0, 0, 0, 1, 0, 0, 1, 1);

            RunAnimation = new Animation(12, true);
            RunAnimation.Frames(frames, 4, 5, 6, 7);

            AttackAnimation = new Animation(12, false);
            AttackAnimation.Frames(frames, 2, 3, 0);

            DieAnimation = new Animation(12, false);
            DieAnimation.Frames(frames, 8, 9, 10);

            Play(IdleAnimation);
        }
Exemplo n.º 18
0
        public AlbinoSprite()
        {
            Texture(Assets.RAT);

            var frames = new TextureFilm(texture, 16, 15);

            IdleAnimation = new Animation(2, true);
            IdleAnimation.Frames(frames, 16, 16, 16, 17);

            RunAnimation = new Animation(10, true);
            RunAnimation.Frames(frames, 22, 23, 24, 25, 26);

            AttackAnimation = new Animation(15, false);
            AttackAnimation.Frames(frames, 18, 19, 20, 21);

            DieAnimation = new Animation(10, false);
            DieAnimation.Frames(frames, 27, 28, 29, 30);

            Play(IdleAnimation);
        }
Exemplo n.º 19
0
        public BanditSprite()
        {
            Texture(Assets.THIEF);

            var film = new TextureFilm(texture, 12, 13);

            IdleAnimation = new Animation(1, true);
            IdleAnimation.Frames(film, 21, 21, 21, 22, 21, 21, 21, 21, 22);

            RunAnimation = new Animation(15, true);
            RunAnimation.Frames(film, 21, 21, 23, 24, 24, 25);

            DieAnimation = new Animation(10, false);
            DieAnimation.Frames(film, 25, 27, 28, 29, 30);

            AttackAnimation = new Animation(12, false);
            AttackAnimation.Frames(film, 31, 32, 33);

            Idle();
        }
Exemplo n.º 20
0
        public KingSprite()
        {
            Texture(Assets.KING);

            var frames = new TextureFilm(texture, 16, 16);

            IdleAnimation = new Animation(12, true);
            IdleAnimation.Frames(frames, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2);

            RunAnimation = new Animation(15, true);
            RunAnimation.Frames(frames, 3, 4, 5, 6, 7, 8);

            AttackAnimation = new Animation(15, false);
            AttackAnimation.Frames(frames, 9, 10, 11);

            DieAnimation = new Animation(8, false);
            DieAnimation.Frames(frames, 12, 13, 14, 15);

            Play(IdleAnimation);
        }
Exemplo n.º 21
0
        public BatSprite()
        {
            Texture(Assets.BAT);

            TextureFilm frames = new TextureFilm(texture, 15, 15);

            IdleAnimation = new Animation(8, true);
            IdleAnimation.Frames(frames, 0, 1);

            RunAnimation = new Animation(12, true);
            RunAnimation.Frames(frames, 0, 1);

            AttackAnimation = new Animation(12, false);
            AttackAnimation.Frames(frames, 2, 3, 0, 1);

            DieAnimation = new Animation(12, false);
            DieAnimation.Frames(frames, 4, 5, 6);

            Play(IdleAnimation);
        }
Exemplo n.º 22
0
        public StatueSprite()
        {
            Texture(Assets.STATUE);

            var frames = new TextureFilm(texture, 12, 15);

            IdleAnimation = new Animation(2, true);
            IdleAnimation.Frames(frames, 0, 0, 0, 0, 0, 1, 1);

            RunAnimation = new Animation(15, true);
            RunAnimation.Frames(frames, 2, 3, 4, 5, 6, 7);

            AttackAnimation = new Animation(12, false);
            AttackAnimation.Frames(frames, 8, 9, 10);

            DieAnimation = new Animation(5, false);
            DieAnimation.Frames(frames, 11, 12, 13, 14, 15, 15);

            Play(IdleAnimation);
        }
Exemplo n.º 23
0
        public RottingFistSprite()
        {
            Texture(Assets.ROTTING);

            var frames = new TextureFilm(texture, 24, 17);

            IdleAnimation = new Animation(2, true);
            IdleAnimation.Frames(frames, 0, 0, 1);

            RunAnimation = new Animation(3, true);
            RunAnimation.Frames(frames, 0, 1);

            AttackAnimation = new Animation(2, false);
            AttackAnimation.Frames(frames, 0);

            DieAnimation = new Animation(10, false);
            DieAnimation.Frames(frames, 0, 2, 3, 4);

            Play(IdleAnimation);
        }
Exemplo n.º 24
0
        public ThiefSprite()
        {
            Texture(Assets.THIEF);

            var film = new TextureFilm(texture, 12, 13);

            IdleAnimation = new Animation(1, true);
            IdleAnimation.Frames(film, 0, 0, 0, 1, 0, 0, 0, 0, 1);

            RunAnimation = new Animation(15, true);
            RunAnimation.Frames(film, 0, 0, 2, 3, 3, 4);

            DieAnimation = new Animation(10, false);
            DieAnimation.Frames(film, 5, 6, 7, 8, 9);

            AttackAnimation = new Animation(12, false);
            AttackAnimation.Frames(film, 10, 11, 12, 0);

            Idle();
        }
Exemplo n.º 25
0
        public EyeSprite()
        {
            Texture(Assets.EYE);

            var frames = new TextureFilm(texture, 16, 18);

            IdleAnimation = new Animation(8, true);
            IdleAnimation.Frames(frames, 0, 1, 2);

            RunAnimation = new Animation(12, true);
            RunAnimation.Frames(frames, 5, 6);

            AttackAnimation = new Animation(8, false);
            AttackAnimation.Frames(frames, 4, 3);

            DieAnimation = new Animation(8, false);
            DieAnimation.Frames(frames, 7, 8, 9);

            Play(IdleAnimation);
        }
Exemplo n.º 26
0
        public YogSprite()
        {
            Texture(Assets.YOG);

            var frames = new TextureFilm(texture, 20, 19);

            IdleAnimation = new Animation(10, true);
            IdleAnimation.Frames(frames, 0, 1, 2, 2, 1, 0, 3, 4, 4, 3, 0, 5, 6, 6, 5);

            RunAnimation = new Animation(12, true);
            RunAnimation.Frames(frames, 0);

            AttackAnimation = new Animation(12, false);
            AttackAnimation.Frames(frames, 0);

            DieAnimation = new Animation(10, false);
            DieAnimation.Frames(frames, 0, 7, 8, 9);

            Play(IdleAnimation);
        }
Exemplo n.º 27
0
        public DM300Sprite()
        {
            Texture(Assets.DM300);

            var frames = new TextureFilm(texture, 22, 20);

            IdleAnimation = new Animation(10, true);
            IdleAnimation.Frames(frames, 0, 1);

            RunAnimation = new Animation(10, true);
            RunAnimation.Frames(frames, 2, 3);

            AttackAnimation = new Animation(15, false);
            AttackAnimation.Frames(frames, 4, 5, 6);

            DieAnimation = new Animation(20, false);
            DieAnimation.Frames(frames, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, 8);

            Play(IdleAnimation);
        }
Exemplo n.º 28
0
        public WraithSprite()
        {
            Texture(Assets.WRAITH);

            var frames = new TextureFilm(texture, 14, 15);

            IdleAnimation = new Animation(5, true);
            IdleAnimation.Frames(frames, 0, 1);

            RunAnimation = new Animation(10, true);
            RunAnimation.Frames(frames, 0, 1);

            AttackAnimation = new Animation(10, false);
            AttackAnimation.Frames(frames, 0, 2, 3);

            DieAnimation = new Animation(8, false);
            DieAnimation.Frames(frames, 0, 4, 5, 6, 7);

            Play(IdleAnimation);
        }
Exemplo n.º 29
0
        public RatSprite()
        {
            Texture(Assets.RAT);

            var frames = new TextureFilm(texture, 16, 15);

            IdleAnimation = new Animation(2, true);
            IdleAnimation.Frames(frames, 0, 0, 0, 1);

            RunAnimation = new Animation(10, true);
            RunAnimation.Frames(frames, 6, 7, 8, 9, 10);

            AttackAnimation = new Animation(15, false);
            AttackAnimation.Frames(frames, 2, 3, 4, 5, 0);

            DieAnimation = new Animation(10, false);
            DieAnimation.Frames(frames, 11, 12, 13, 14);

            Play(IdleAnimation);
        }
Exemplo n.º 30
0
        public PiranhaSprite()
        {
            Texture(Assets.PIRANHA);

            var frames = new TextureFilm(texture, 12, 16);

            IdleAnimation = new Animation(8, true);
            IdleAnimation.Frames(frames, 0, 1, 2, 1);

            RunAnimation = new Animation(20, true);
            RunAnimation.Frames(frames, 0, 1, 2, 1);

            AttackAnimation = new Animation(20, false);
            AttackAnimation.Frames(frames, 3, 4, 5, 6, 7, 8, 9, 10, 11);

            DieAnimation = new Animation(4, false);
            DieAnimation.Frames(frames, 12, 13, 14);

            Play(IdleAnimation);
        }