Esempio n. 1
0
        public Duplighost() : base(new Stats(23, 15, 0, 0, 0))
        {
            Name = "Duplighost";

            AIBehavior = new DuplighostAI(this);

            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Sleep, new StatusPropertyHolder(60, -1));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Stop, new StatusPropertyHolder(80, -1));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Dizzy, new StatusPropertyHolder(75, -1));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.DEFDown, new StatusPropertyHolder(100, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Poison, new StatusPropertyHolder(100, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Confused, new StatusPropertyHolder(100, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Fright, new StatusPropertyHolder(50, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Paralyzed, new StatusPropertyHolder(75, 1));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Lifted, new StatusPropertyHolder(80, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Tiny, new StatusPropertyHolder(75, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Blown, new StatusPropertyHolder(70, 0));

            LoadAnimations();

            //Copy animations into its original set
            OrigAnimations = new ObjAnimManager(this);
            IAnimation[] allAnims = AnimManager.GetAllAnimations();
            for (int i = 0; i < allAnims.Length; i++)
            {
                IAnimation anim = allAnims[i];
                OrigAnimations.AddAnimation(anim.Key, anim);
            }

            //Subscribe to its own StatusInflicted event
            EntityProperties.StatusInflictedEvent -= OnStatusInflicted;
            EntityProperties.StatusInflictedEvent += OnStatusInflicted;
        }
Esempio n. 2
0
        /// <summary>
        /// Copies all animations from an animation manager to the Duplighost's primary animation manager.
        /// The Duplighost's primary animation manager is cleared before copying.
        /// </summary>
        /// <param name="objAnimManager">The animation manager to copy animations from.</param>
        public void CopyEntityAnimations(ObjAnimManager objAnimManager)
        {
            AnimManager.ClearAllAnimations();

            Animation[] allAnims = objAnimManager.GetAllAnimations();
            for (int i = 0; i < allAnims.Length; i++)
            {
                Animation anim = allAnims[i];
                AnimManager.AddAnimation(anim.Key, anim);
            }
        }
 private BattleEntity()
 {
     EntityProperties = new BattleEntityProperties(this);
     AnimManager      = new ObjAnimManager(this);
 }
Esempio n. 4
0
        public Duplighost() : base(new Stats(23, 15, 0, 0, 0))
        {
            Name = "Duplighost";

            AIBehavior = new DuplighostAI(this);

            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Sleep, new StatusPropertyHolder(60, -1));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Stop, new StatusPropertyHolder(80, -1));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Dizzy, new StatusPropertyHolder(75, -1));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.DEFDown, new StatusPropertyHolder(100, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Poison, new StatusPropertyHolder(100, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Confused, new StatusPropertyHolder(100, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Fright, new StatusPropertyHolder(50, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Paralyzed, new StatusPropertyHolder(75, 1));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Lifted, new StatusPropertyHolder(80, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Tiny, new StatusPropertyHolder(75, 0));
            EntityProperties.AddStatusProperty(Enumerations.StatusTypes.Blown, new StatusPropertyHolder(70, 0));

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

            AnimManager.SetSpriteSheet(spriteSheet);

            AnimManager.AddAnimation(AnimationGlobals.IdleName, new LoopAnimation(null, AnimationGlobals.InfiniteLoop,
                                                                                  new Animation.Frame(new Rectangle(4, 4, 51, 43), 110d),
                                                                                  new Animation.Frame(new Rectangle(196, 101, 51, 42), 110d, new Vector2(0, 1)),
                                                                                  new Animation.Frame(new Rectangle(260, 98, 50, 45), 110d, new Vector2(0, -2)),
                                                                                  new Animation.Frame(new Rectangle(324, 97, 50, 46), 110d, new Vector2(0, -3))));
            AnimManager.AddAnimation(AnimationGlobals.HurtName, new Animation(null,
                                                                              new Animation.Frame(new Rectangle(1, 151, 50, 40), 110d),
                                                                              new Animation.Frame(new Rectangle(65, 151, 51, 39), 110d, new Vector2(0, 1))));
            AnimManager.AddAnimation(AnimationGlobals.DeathName, new Animation(null,
                                                                               new Animation.Frame(new Rectangle(1, 151, 50, 40), 1000d)));
            AnimManager.AddAnimation(AnimationGlobals.RunningName, new ReverseAnimation(null, AnimationGlobals.InfiniteLoop,
                                                                                        new Animation.Frame(new Rectangle(4, 98, 52, 45), 60d),
                                                                                        new Animation.Frame(new Rectangle(68, 98, 51, 45), 60d),
                                                                                        new Animation.Frame(new Rectangle(132, 100, 50, 43), 60d, new Vector2(0, 1))));

            AnimManager.AddAnimation(AnimationGlobals.DuplighostBattleAnimations.HeadbuttStartName, new Animation(null,
                                                                                                                  new Animation.Frame(new Rectangle(195, 149, 51, 42), 1000d)));
            AnimManager.AddAnimation(AnimationGlobals.DuplighostBattleAnimations.HeadbuttName, new LoopAnimation(null, AnimationGlobals.InfiniteLoop,
                                                                                                                 new Animation.Frame(new Rectangle(5, 198, 47, 37), 110d),
                                                                                                                 new Animation.Frame(new Rectangle(69, 197, 47, 39), 110d, new Vector2(0, 1))));

            AnimManager.AddAnimation(AnimationGlobals.DuplighostBattleAnimations.DisguiseStartName, new Animation(null,
                                                                                                                  new Animation.Frame(new Rectangle(67, 251, 52, 44), 110d),
                                                                                                                  new Animation.Frame(new Rectangle(193, 244, 51, 51), 110d, new Vector2(0, -7))));
            AnimManager.AddAnimation(AnimationGlobals.DuplighostBattleAnimations.DisguiseName, new LoopAnimation(null, AnimationGlobals.InfiniteLoop,
                                                                                                                 new Animation.Frame(new Rectangle(129, 247, 51, 48), 110d),
                                                                                                                 new Animation.Frame(new Rectangle(257, 248, 51, 47), 110d, new Vector2(0, 1))));

            //Use the same animation for Confused since Confused isn't in PM
            LoopAnimation dizzyAnim = new LoopAnimation(null, AnimationGlobals.InfiniteLoop,
                                                        new Animation.Frame(new Rectangle(132, 198, 52, 41), 110d),
                                                        new Animation.Frame(new Rectangle(196, 198, 52, 41), 110d),
                                                        new Animation.Frame(new Rectangle(260, 198, 52, 41), 110d),
                                                        new Animation.Frame(new Rectangle(324, 198, 52, 41), 110d));

            AnimManager.AddAnimation(AnimationGlobals.StatusBattleAnimations.DizzyName, dizzyAnim);
            AnimManager.AddAnimation(AnimationGlobals.StatusBattleAnimations.ConfusedName, dizzyAnim);

            //Copy animations into its original set
            OrigAnimations = new ObjAnimManager(this);
            Animation[] allAnims = AnimManager.GetAllAnimations();
            for (int i = 0; i < allAnims.Length; i++)
            {
                Animation anim = allAnims[i];
                OrigAnimations.AddAnimation(anim.Key, anim);
            }

            //Subscribe to its own StatusInflicted event
            StatusInflictedEvent -= OnStatusInflicted;
            StatusInflictedEvent += OnStatusInflicted;
        }
 protected BattleEntity()
 {
     EntityProperties = new BattleEntityProperties(this);
     AnimManager      = new ObjAnimManager(this);
 }