コード例 #1
0
        public Paratroopa()
        {
            Name = "Paratroopa";

            BattleStats.Level = 9;

            EntityProperties.SetVulnerableDamageEffects(EntityProperties.GetVulnerableDamageEffects() | Enumerations.DamageEffects.RemovesWings);

            ChangeHeightState(Enumerations.HeightStates.Airborne);

            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Dizzy, new StatusPropertyHolder(120d, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Blown, new StatusPropertyHolder(110d, 0));

            Texture2D spriteSheet = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.SpriteRoot}/Enemies/Paratroopa.png");

            AnimManager.SetSpriteSheet(spriteSheet);

            //The Paratroopa uses the same in shell animation as a Koopa Troopa for Shell Shot, but rotates itself differently
            AnimManager.AddAnimation(AnimationGlobals.ParatroopaBattleAnimations.ShellShotName, new Animation(spriteSheet,
                                                                                                              new Animation.Frame(new Rectangle(2, 222, 28, 25), 1000d)));

            //This animation uses the same rectangle for every frame. However, the wings are different on those frames and the
            //Paratroopa has varying heights on each frame
            AnimManager.AddAnimation(AnimationGlobals.WingedBattleAnimations.WingedIdleName, new LoopAnimation(spriteSheet, AnimationGlobals.InfiniteLoop,
                                                                                                               new Animation.Frame(new Rectangle(56, 4, 32, 48), 100d),
                                                                                                               new Animation.Frame(new Rectangle(56, 4, 32, 48), 100d, new Vector2(0, -1)),
                                                                                                               new Animation.Frame(new Rectangle(56, 4, 32, 48), 100d, new Vector2(0, -2)),
                                                                                                               new Animation.Frame(new Rectangle(56, 4, 32, 48), 100d, new Vector2(0, -1))));
            AnimManager.AddAnimationChildFrames(AnimationGlobals.WingedBattleAnimations.WingedIdleName,
                                                new Animation.Frame(new Rectangle(72, 156, 19, 27), 100d, new Vector2(25, -4)),
                                                new Animation.Frame(new Rectangle(104, 220, 23, 23), 100d, new Vector2(25, 4)),
                                                new Animation.Frame(new Rectangle(40, 219, 18, 28), 100d, new Vector2(25, 16)),
                                                new Animation.Frame(new Rectangle(248, 190, 21, 23), 100d, new Vector2(25, 13)));

            //NOTE: Incomplete wing frames; the wings on the left of the Paratroopa will require more work to get in due to the way the wings are stored

            //Same story with this one
            AnimManager.AddAnimation(AnimationGlobals.WingedBattleAnimations.FlyingName, new LoopAnimation(spriteSheet, AnimationGlobals.InfiniteLoop,
                                                                                                           new Animation.Frame(new Rectangle(103, 4, 33, 51), 80d),
                                                                                                           new Animation.Frame(new Rectangle(103, 4, 33, 51), 80d, new Vector2(0, -1)),
                                                                                                           new Animation.Frame(new Rectangle(103, 4, 33, 51), 80d, new Vector2(0, -2)),
                                                                                                           new Animation.Frame(new Rectangle(103, 4, 33, 51), 80d, new Vector2(0, -1))));
            AnimManager.AddAnimationChildFrames(AnimationGlobals.WingedBattleAnimations.FlyingName,
                                                new Animation.Frame(new Rectangle(72, 156, 19, 27), 80d, new Vector2(26, -4)),
                                                new Animation.Frame(new Rectangle(104, 220, 23, 23), 80d, new Vector2(26, 4)),
                                                new Animation.Frame(new Rectangle(40, 219, 18, 28), 80d, new Vector2(26, 16)),
                                                new Animation.Frame(new Rectangle(248, 190, 21, 23), 80d, new Vector2(26, 13)));

            AnimManager.AddAnimation(AnimationGlobals.HurtName, new Animation(spriteSheet,
                                                                              new Animation.Frame(new Rectangle(5, 59, 39, 44), 250d),
                                                                              new Animation.Frame(new Rectangle(200, 3, 36, 43), 250d)));
            //NOTE: Not accurate - in PM, it looks like the wings are rotated slightly to match the Paratroopa's pose in its hurt animation
            AnimManager.AddAnimationChildFrames(AnimationGlobals.HurtName,
                                                new Animation.Frame(new Rectangle(66, 190, 45, 26), 250d, new Vector2(-1, 2), -.01f),
                                                new Animation.Frame(new Rectangle(66, 190, 45, 26), 250d, new Vector2(-1, 2), -.01f));
        }
コード例 #2
0
        public Shell(int hp, int maxHP) : base(new Stats(0, maxHP, 0, 0, 0))
        {
            Name = "Shell";

            EntityType = EntityTypes.Neutral;

            //Set the HP to the amount of HP the Shell should have
            int hpDiff = BattleStats.MaxHP - hp;

            if (hpDiff > 0)
            {
                LoseHP(hpDiff);
            }

            //The Shell doesn't take turns
            BaseTurns = -99;

            //The Shell isn't targetable by normal means. It makes all attacks target it instead of the normal BattleEntity when active
            this.AddIntAdditionalProperty(AdditionalProperty.Untargetable, 1);

            AddStatusImmunities();

            Texture2D spriteSheet = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.SpriteRoot}/Neutral/ShellShieldShell.png");

            AnimManager.SetSpriteSheet(spriteSheet);

            AnimManager.AddAnimation(AnimationGlobals.ShellBattleAnimations.FullHealthStateName, new Animation(spriteSheet,
                                                                                                               new Animation.Frame(new Rectangle(7, 3, 186, 130), 1000d)));

            AnimManager.AddAnimation(AnimationGlobals.ShellBattleAnimations.MildlyDamagedStateName, new Animation(spriteSheet,
                                                                                                                  new Animation.Frame(new Rectangle(7, 153, 186, 130), 1000d)));
            AnimManager.AddAnimationChildFrames(AnimationGlobals.ShellBattleAnimations.MildlyDamagedStateName,
                                                new Animation.Frame(new Rectangle(217, 4, 13, 47), 1000d, new Vector2(44, 1)));

            AnimManager.AddAnimation(AnimationGlobals.ShellBattleAnimations.SeverelyDamagedStateName, new Animation(spriteSheet,
                                                                                                                    new Animation.Frame(new Rectangle(7, 153, 186, 130), 1000d)));
            AnimManager.AddAnimationChildFrames(AnimationGlobals.ShellBattleAnimations.SeverelyDamagedStateName,
                                                new Animation.Frame(new Rectangle(242, 4, 42, 98), 1000d, new Vector2(36, 1)));

            Scale = new Vector2(.5f, .5f);
            Layer = .15f;

            //Subscribe to the removed event so we can remove the protection and clear the entity reference if it's removed
            BattleManager.Instance.EntityRemovedEvent -= EntityRemoved;
            BattleManager.Instance.EntityRemovedEvent += EntityRemoved;

            //Play the idle anim
            AnimManager.PlayAnimation(GetIdleAnim());
        }
コード例 #3
0
        public Paragoomba()
        {
            Name = "Paragoomba";

            EntityProperties.SetVulnerableDamageEffects(Enumerations.DamageEffects.RemovesWings);

            AIBehavior = new ParagoombaAI(this);

            ChangeHeightState(Enumerations.HeightStates.Airborne);

            Texture2D spriteSheet = AssetManager.Instance.LoadRawTexture2D($"{ContentGlobals.SpriteRoot}/Enemies/Paragoomba.png");

            AnimManager.SetSpriteSheet(spriteSheet);

            AnimManager.AddAnimation(AnimationGlobals.WingedBattleAnimations.WingedIdleName, new LoopAnimation(spriteSheet, AnimationGlobals.InfiniteLoop,
                                                                                                               new Animation.Frame(new Rectangle(129, 45, 27, 28), 200d),
                                                                                                               new Animation.Frame(new Rectangle(1, 7, 27, 30), 200d)));
            AnimManager.AddAnimation(AnimationGlobals.WingedBattleAnimations.FlyingName, new LoopAnimation(spriteSheet, AnimationGlobals.InfiniteLoop,
                                                                                                           new Animation.Frame(new Rectangle(129, 45, 27, 28), 100d),
                                                                                                           new Animation.Frame(new Rectangle(1, 7, 27, 30), 100d)));
            AnimManager.AddAnimation(AnimationGlobals.HurtName, new Animation(spriteSheet,
                                                                              new Animation.Frame(new Rectangle(97, 48, 29, 27), 80d),
                                                                              new Animation.Frame(new Rectangle(98, 89, 27, 26), 80d)));
            AnimManager.AddAnimation(AnimationGlobals.DeathName, new Animation(spriteSheet, new Animation.Frame(new Rectangle(98, 89, 27, 26), 1000d)));

            AnimManager.AddAnimation(AnimationGlobals.ParagoombaBattleAnimations.DiveKickName, new Animation(spriteSheet,
                                                                                                             new Animation.Frame(new Rectangle(33, 89, 27, 30), 1000d)));

            //Wings (for the first idle frame, at least) are offset (-7, -1 (or left 7, up 1)) from the Paragoomba's body
            //Both Wings for each frame are in a single cropped texture
            //The wings are rendered underneath the Paragoomba's body

            AnimManager.AddAnimationChildFrames(AnimationGlobals.WingedBattleAnimations.WingedIdleName,
                                                new Animation.Frame(new Rectangle(3, 166, 41, 18), 200d, new Vector2(-7, -1), -.01f),
                                                new Animation.Frame(new Rectangle(50, 161, 41, 14), 200d, new Vector2(-7, 13), -.01f));
            AnimManager.AddAnimationChildFrames(AnimationGlobals.WingedBattleAnimations.FlyingName,
                                                new Animation.Frame(new Rectangle(3, 166, 41, 18), 100d, new Vector2(-7, -1), -.01f),
                                                new Animation.Frame(new Rectangle(50, 161, 41, 14), 100d, new Vector2(-7, 13), -.01f));
            AnimManager.AddAnimationChildFrames(AnimationGlobals.HurtName,
                                                new Animation.Frame(new Rectangle(3, 166, 41, 18), 80d, new Vector2(-4, -1), -.01f),
                                                new Animation.Frame(new Rectangle(3, 166, 41, 18), 80d, new Vector2(-4, -1), -.01f));
            AnimManager.AddAnimationChildFrames(AnimationGlobals.DeathName,
                                                new Animation.Frame(new Rectangle(3, 166, 41, 18), 1000d, new Vector2(-4, -1), -.01f));

            AnimManager.AddAnimationChildFrames(AnimationGlobals.ParagoombaBattleAnimations.DiveKickName,
                                                new Animation.Frame(new Rectangle(120, 121, 31, 21), 1000d, new Vector2(-1, -9), -.01f));
        }