Exemple #1
0
        void MakeSpark(Character attacker, Character target, Int32 animationnumber, Vector2 sparklocation, Boolean playeranimation)
        {
            if (attacker == null)
            {
                throw new ArgumentNullException("attacker");
            }
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            ExplodData data = new ExplodData();

            data.IsHitSpark      = true;
            data.CommonAnimation = playeranimation == false;
            data.PositionType    = PositionType.P1;
            data.AnimationNumber = animationnumber;
            data.SpritePriority  = attacker.DrawOrder + 1;
            data.RemoveTime      = -2;
            data.OwnPalFx        = false;
            data.Scale           = Vector2.One;
            data.Location        = GetSparkLocation(attacker, target, sparklocation);
            data.Creator         = attacker;
            data.Offseter        = target;

            Explod explod = new Explod(attacker.Engine, data);

            if (explod.IsValid == true)
            {
                explod.Engine.Entities.Add(explod);
            }
        }
        private void MakeSpark(Projectile projectile, Character target, int animationnumber, Vector2 sparklocation, bool playeranimation)
        {
            if (projectile == null)
            {
                throw new ArgumentNullException(nameof(projectile));
            }
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            var data = new ExplodData();

            data.IsHitSpark      = true;
            data.CommonAnimation = playeranimation == false;
            data.PositionType    = PositionType.P1;
            data.AnimationNumber = animationnumber;
            data.SpritePriority  = projectile.DrawOrder + 1;
            data.RemoveTime      = -2;
            data.OwnPalFx        = false;
            data.Scale           = Vector2.One;
            data.Location        = sparklocation;
            data.Creator         = projectile.Creator;
            data.Offseter        = projectile;

            var explod = new Explod(projectile.Engine, data);

            if (explod.IsValid)
            {
                explod.Engine.Entities.Add(explod);
            }
        }
Exemple #3
0
        public Explod(FightEngine fightengine, ExplodData data)
            : base(fightengine)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            m_data        = data;
            m_tickcount   = 0;
            m_forceremove = false;
            m_creator     = data.Creator;

            if (m_data.CommonAnimation == false)
            {
                m_spritemanager    = BasePlayer.SpriteManager.Clone();
                m_animationmanager = BasePlayer.AnimationManager.Clone();
            }
            else
            {
                m_spritemanager    = Engine.FxSprites.Clone();
                m_animationmanager = Engine.FxAnimations.Clone();
            }

            m_creationfacing = Data.Offseter.CurrentFacing;

            CurrentPalette      = Creator.CurrentPalette;
            CurrentFacing       = GetStartFacing();
            CurrentLocation     = GetStartLocation();
            CurrentVelocity     = m_data.Velocity;
            CurrentAcceleration = m_data.Acceleration;
            CurrentFlip         = SpriteEffects.None;
            CurrentScale        = m_data.Scale;
            DrawOrder           = m_data.DrawOnTop ? 11 : m_data.SpritePriority;
            Transparency        = Data.Transparency;

            var rng = Engine.GetSubSystem <Random>();

            m_random    = new Vector2();
            m_random.X += rng.NewInt(-m_data.Random.X, m_data.Random.X);
            m_random.Y += rng.NewInt(-m_data.Random.Y, m_data.Random.Y);

            m_palfx = m_data.OwnPalFx ? new PaletteFx() : Creator.PaletteFx;

            if (AnimationManager.HasAnimation(Data.AnimationNumber))
            {
                SetLocalAnimation(Data.AnimationNumber, 0);
                m_valid = true;
            }
            else
            {
                m_valid = false;
            }
        }
Exemple #4
0
		public Explod(FightEngine fightengine, ExplodData data)
			: base(fightengine)
		{
			if (data == null) throw new ArgumentNullException("data");

			m_data = data;
			m_tickcount = 0;
			m_forceremove = false;
			m_creator = data.Creator;

			if (m_data.CommonAnimation == false)
			{
				m_spritemanager = BasePlayer.SpriteManager.Clone();
				m_animationmanager = BasePlayer.AnimationManager.Clone();
			}
			else
			{
				m_spritemanager = Engine.FxSprites.Clone();
				m_animationmanager = Engine.FxAnimations.Clone();
			}

			m_creationfacing = Data.Offseter.CurrentFacing;

			CurrentPalette = Creator.CurrentPalette;
			CurrentFacing = GetStartFacing();
			CurrentLocation = GetStartLocation();
			CurrentVelocity = m_data.Velocity;
			CurrentAcceleration = m_data.Acceleration;
			CurrentFlip = SpriteEffects.None;
			CurrentScale = m_data.Scale;
			DrawOrder = (m_data.DrawOnTop == true) ? 11 : m_data.SpritePriority;
			Transparency = Data.Transparency;

			Random rng = Engine.GetSubSystem<Random>();
			m_random = new Vector2();
			m_random.X += rng.NewInt(-m_data.Random.X, m_data.Random.X);
			m_random.Y += rng.NewInt(-m_data.Random.Y, m_data.Random.Y);

			m_palfx = (m_data.OwnPalFx == true) ? new PaletteFx() : Creator.PaletteFx;

			if (AnimationManager.HasAnimation(Data.AnimationNumber) == true)
			{
				SetLocalAnimation(Data.AnimationNumber, 0);
				m_valid = true;
			}
			else
			{
				m_valid = false;
			}
		}
Exemple #5
0
		void MakeSpark(Character attacker, Character target, Int32 animationnumber, Vector2 sparklocation, Boolean playeranimation)
		{
			if (attacker == null) throw new ArgumentNullException("attacker");
			if (target == null) throw new ArgumentNullException("target");

			ExplodData data = new ExplodData();
            data.IsHitSpark = true;
            data.CommonAnimation = playeranimation == false;
			data.PositionType = PositionType.P1;
			data.AnimationNumber = animationnumber;
			data.SpritePriority = attacker.DrawOrder + 1;
			data.RemoveTime = -2;
			data.OwnPalFx = false;
			data.Scale = Vector2.One;
			data.Location = GetSparkLocation(attacker, target, sparklocation);
			data.Creator = attacker;
			data.Offseter = target;

			Explod explod = new Explod(attacker.Engine, data);
			if (explod.IsValid == true) explod.Engine.Entities.Add(explod);
		}