public virtual void RemoveWings()
        {
            Vector2   wingPos  = Entity.Position;
            Animation hurtAnim = Entity.AnimManager.GetAnimation <Animation>(AnimationGlobals.HurtName);

            if (hurtAnim != null)
            {
                wingPos = hurtAnim.CurChildFrame.GetDrawnPosition(Entity.Position, Entity.SpriteFlip);
            }

            //Remove the wings from the hurt and death animations
            Animation[] animations = Entity.AnimManager.GetAnimations <Animation>(AnimationGlobals.HurtName, AnimationGlobals.DeathName);

            //Clear all child frames with wings
            for (int i = 0; i < animations.Length; i++)
            {
                animations[i].SetChildFrames(null);
            }

            //Add VFX for the wings disappearing
            Texture2D        spriteSheet = Entity.AnimManager.SpriteSheet;
            CroppedTexture2D wingSprite  = new CroppedTexture2D(spriteSheet, WingRectRegion);

            //Put the wings in the same spot as they were in the Paragoomba's last animation
            WingsDisappearVFX wingsDisappear = new WingsDisappearVFX(wingSprite, wingPos,
                                                                     Entity.EntityType != Enumerations.EntityTypes.Enemy, .1f - .01f, 500d, 500d, (1d / 30d) * Time.MsPerS);

            Entity.BManager.battleObjManager.AddBattleObject(wingsDisappear);

            //Copy the StatusProperties from the grounded entity
            //This happens here, as winged entities use their own status tables until they've been grounded
            if (GroundedEntity != null)
            {
                Entity.EntityProperties.CopyStatusProperties(GroundedEntity.EntityProperties);
            }

            //Don't modify Tattle information
            //The entity knows what its grounded version is
            //However, one thing we can do here is disable tattling if the grounded version doesn't support it
            ITattleableEntity gTattleable = GroundedEntity as ITattleableEntity;

            if (gTattleable == null)
            {
                //Disable tattling if the grounded version can't be Tattled
                ITattleableEntity entity = Entity as ITattleableEntity;
                if (entity != null)
                {
                    entity.CanBeTattled = false;
                }
            }

            //After all this set the GroundedEntity to null, as we don't need its information anymore
            GroundedEntity = null;
        }
Esempio n. 2
0
        public void RemoveWings()
        {
            Animation[] animations = AnimManager.GetAnimations(AnimationGlobals.HurtName);

            for (int i = 0; i < animations.Length; i++)
            {
                animations[i].SetChildFrames(null);
            }

            //Add VFX for the wings disappearing
            Texture2D        spriteSheet = AssetManager.Instance.LoadAsset <Texture2D>($"{ContentGlobals.SpriteRoot}/Enemies/Paratroopa");
            CroppedTexture2D wingSprite  = new CroppedTexture2D(spriteSheet, new Rectangle(66, 190, 45, 26));

            //Put the wings in the same spot as they were in the Paratroopa's last animation
            WingsDisappearVFX wingsDisappear = new WingsDisappearVFX(wingSprite, BattlePosition + new Vector2(-1, 2),
                                                                     EntityType != Enumerations.EntityTypes.Enemy, .1f - .01f, 500d, 500d, (1d / 30d) * Time.MsPerS);

            BattleVFXManager.Instance.AddVFXElement(wingsDisappear);
        }
Esempio n. 3
0
        public void RemoveWings()
        {
            //Remove the wings from the hurt and death animations
            Animation[] animations = AnimManager.GetAnimations(AnimationGlobals.HurtName, AnimationGlobals.DeathName);

            //Clear all child frames with wings
            for (int i = 0; i < animations.Length; i++)
            {
                animations[i].SetChildFrames(null);
            }

            //Add VFX for the wings disappearing
            Texture2D        spriteSheet = AssetManager.Instance.LoadAsset <Texture2D>($"{ContentGlobals.SpriteRoot}/Enemies/Paragoomba");
            CroppedTexture2D wingSprite  = new CroppedTexture2D(spriteSheet, new Rectangle(3, 166, 41, 18));

            //Put the wings in the same spot as they were in the Paragoomba's last animation
            WingsDisappearVFX wingsDisappear = new WingsDisappearVFX(wingSprite, BattlePosition + new Vector2(-4, -1),
                                                                     EntityType != Enumerations.EntityTypes.Enemy, .1f - .01f, 500d, 500d, (1d / 30d) * Time.MsPerS);

            BattleVFXManager.Instance.AddVFXElement(wingsDisappear);
        }