コード例 #1
0
        /// <summary>
        /// Initializes particle system by type
        /// </summary>
        /// <param name="type">Particle type enum</param>
        /// <param name="contentPath">Content path</param>
        /// <param name="texture">Texture</param>
        /// <param name="scale">Scale</param>
        /// <returns>Returns the new generated particle system description</returns>
        public static ParticleSystemDescription Initialize(ParticleTypes type, string contentPath, string texture, float scale = 1f)
        {
            if (type == ParticleTypes.Dust)
            {
                return(InitializeDust(contentPath, texture, scale));
            }
            if (type == ParticleTypes.Fire)
            {
                return(InitializeFire(contentPath, texture, scale));
            }
            if (type == ParticleTypes.SmokePlume)
            {
                return(InitializeSmokePlume(contentPath, texture, scale));
            }
            if (type == ParticleTypes.ProjectileTrail)
            {
                return(InitializeProjectileTrail(contentPath, texture, scale));
            }
            if (type == ParticleTypes.Explosion)
            {
                return(InitializeExplosion(contentPath, texture, scale));
            }
            if (type == ParticleTypes.ExplosionSmoke)
            {
                return(InitializeSmokeExplosion(contentPath, texture, scale));
            }

            return(null);
        }
コード例 #2
0
 public void PlaceParticle(Vector3 position, ParticleTypes type)
 {
     if (GetPrefab(type))
     {
         Instantiate(GetPrefab(type), position, Quaternion.identity);
     }
 }
コード例 #3
0
    public void SpawnParticleEffect(Vector2 where
                                    , ParticleTypes effect
                                    , Vector2?direction = null
                                    , Transform parent  = null
                                    , float lifetime    = 0
                                    , bool keepAlive    = false)
    {
        Vector2 dir = Vector2.zero;

        if (direction.HasValue)
        {
            dir = direction.Value;
        }

        GameObject particleEffect = _particleEffectList[(int)effect];
        var        particle       = Instantiate(particleEffect, where, Quaternion.Euler(dir));

        if (parent != null)
        {
            particle.transform.parent = parent;
        }

        if (lifetime > 0)
        {
            Destroy(particle, lifetime);
        }
    }
コード例 #4
0
 private GameObject GetParticle(ParticleTypes pType)
 {
     foreach (Particle particle in Particles)
     {
         if (particle.Type == pType)
         {
             return(particle.ParticleSystem);
         }
     }
     return(null);
 }
コード例 #5
0
 public void AttachParticle(Transform target, ParticleTypes type)
 {
     if (GetPrefab(type))
     {
         AttachEffect particle = Instantiate(GetPrefab(type), null).GetComponent <AttachEffect>();
         if (particle && target)
         {
             particle.target = target;
         }
     }
 }
コード例 #6
0
 public void ReadChildData(BinaryReader reader)
 {
     for (int x = 0; x < _particleTypes.Count; x++)
     {
         ParticleTypes.AddNew();
         ParticleTypes[x].Read(reader);
     }
     for (int x = 0; x < _particleTypes.Count; x++)
     {
         ParticleTypes[x].ReadChildData(reader);
     }
 }
コード例 #7
0
        public Particle(ParticleTypes type, Vector2 position, Vector2 velocity, float minAngularVelocity,
                        float maxAngularVelocity, int minLifetime, int maxLifetime)
        {
            attributes = attributeList[(int)type];

            Position        = position;
            Velocity        = velocity;
            Scale           = Vector2.One;
            Color           = Color.White;
            angularVelocity = Functions.GetRandomFloat(minAngularVelocity, maxAngularVelocity);

            lifetimeTimer = new Timer(Functions.GetRandomInt(minLifetime, maxLifetime), Destroy, false);
        }
コード例 #8
0
ファイル: Emitter.cs プロジェクト: SilverSleek/Platformer
 public EmitterAttributes(ParticleTypes particleType, int minDelay, int maxDelay, int minParticles, int maxParticles,
                          int minParticleSpeedX, int maxParticleSpeedX, int minParticleSpeedY, int maxParticleSpeedY)
 {
     ParticleType      = particleType;
     MinDelay          = minDelay;
     MaxDelay          = maxDelay;
     MinParticles      = minParticles;
     MaxParticles      = maxParticles;
     MinParticleSpeedX = minParticleSpeedX;
     MaxParticleSpeedX = maxParticleSpeedX;
     MinParticleSpeedY = minParticleSpeedY;
     MaxParticleSpeedY = maxParticleSpeedY;
 }
コード例 #9
0
            public virtual void ReadChildData(BinaryReader reader)
            {
                int x = 0;

                for (x = 0; (x < _particleTypes.Count); x = (x + 1))
                {
                    ParticleTypes.Add(new WeatherParticleTypeBlock());
                    ParticleTypes[x].Read(reader);
                }
                for (x = 0; (x < _particleTypes.Count); x = (x + 1))
                {
                    ParticleTypes[x].ReadChildData(reader);
                }
            }
コード例 #10
0
        public static void CreateParticle(ParticleTypes particleType, Vector2 position, Vector2 velocity)
        {
            Particle particle = null;

            switch (particleType)
            {
            case ParticleTypes.ASH:
                particle = new Ash(position, velocity);
                break;

            case ParticleTypes.EMBER:
                particle = new Ember(position, velocity);
                break;
            }

            particles.Add(particle);
        }
コード例 #11
0
        static Particle()
        {
            spritesheet   = ContentLoader.LoadTexture("Particles");
            attributeList = new ParticleAttributes[Enum.GetNames(typeof(ParticleTypes)).Length - 1];

            foreach (XElement particleElement in XDocument.Load(Constants.XML_FILEPATH + "Particles.xml").Root.Elements("Particle"))
            {
                ParticleTypes particleType = ConvertToParticleType(particleElement.Attribute("Type").Value);

                string[] tokens = particleElement.Value.Split(' ');

                int x      = int.Parse(tokens[0]);
                int y      = int.Parse(tokens[1]);
                int width  = int.Parse(tokens[2]);
                int height = int.Parse(tokens[3]);

                attributeList[(int)particleType] = new ParticleAttributes(new Rectangle(x, y, width, height));
            }
        }
コード例 #12
0
    private GameObject GetPrefab(ParticleTypes type)
    {
        switch (type)
        {
        case ParticleTypes.StraightShot:
            return(straightShot);

        case ParticleTypes.BounceShot:
            return(bounceShot);

        case ParticleTypes.HomingShot:
            return(homingShot);

        case ParticleTypes.SmallExplosion:
            return(smallExplosion);

        case ParticleTypes.LargeExplosion:
            return(largeExplosion);

        case ParticleTypes.HugeExplosion:
            return(hugeExplosion);

        case ParticleTypes.SmallDust:
            return(smallDust);

        case ParticleTypes.LargeDust:
            return(largeDust);

        case ParticleTypes.ArmourDestroy:
            return(armourDestroy);

        case ParticleTypes.PlayerDestroy:
            return(playerDestroy);

        case ParticleTypes.ShotgunShell:
            return(shotgunShell);

        case ParticleTypes.ShotgunShot:
            return(shotgunShot);
        }
        return(null);
    }
コード例 #13
0
    public void SpawnOneShot(ParticleTypes pParticle, Vector3 pPosition, Transform pParent = null)
    {
        if (SpawnOneShotParticles)
        {
            int        particleIndex = -1;
            GameObject tempParticle  = GetParticle(pParticle);

            if (tempParticle != null)
            {
                GameObject       newParticle = Instantiate(tempParticle, pPosition, transform.rotation);
                ParticleSystem[] particles   = newParticle.GetComponentsInChildren <ParticleSystem>();
                foreach (ParticleSystem particle in particles)
                {
                    if (particle.main.playOnAwake == true)
                    {
                        particle.Play(false);
                        Destroy(newParticle.gameObject, particle.main.duration);
                    }
                }
            }
        }
    }
コード例 #14
0
 public void ReadChildData(BinaryReader reader)
 {
     _pointPhysics.ReadString(reader);
     for (int x = 0; x < _physicsConstants.Count; x++)
     {
         PhysicsConstants.AddNew();
         PhysicsConstants[x].Read(reader);
     }
     for (int x = 0; x < _physicsConstants.Count; x++)
     {
         PhysicsConstants[x].ReadChildData(reader);
     }
     for (int x = 0; x < _particleTypes.Count; x++)
     {
         ParticleTypes.AddNew();
         ParticleTypes[x].Read(reader);
     }
     for (int x = 0; x < _particleTypes.Count; x++)
     {
         ParticleTypes[x].ReadChildData(reader);
     }
 }
コード例 #15
0
ファイル: Emitter.cs プロジェクト: SilverSleek/Platformer
        static Emitter()
        {
            AttributeList = new EmitterAttributes[Enum.GetNames(typeof(EmitterTypes)).Length - 1];

            foreach (XElement emitterElement in XDocument.Load(Constants.XML_FILEPATH + "Emitters.xml").Root.Elements("Emitter"))
            {
                EmitterTypes  emitterType  = ConvertToEmitterType(emitterElement.Attribute("Type").Value);
                ParticleTypes particleType = Particle.ConvertToParticleType(emitterElement.Element("ParticleType").Value);

                int minDelay          = int.Parse(emitterElement.Element("MinDelay").Value);
                int maxDelay          = int.Parse(emitterElement.Element("MaxDelay").Value);
                int minParticles      = int.Parse(emitterElement.Element("MinParticles").Value);
                int maxParticles      = int.Parse(emitterElement.Element("MaxParticles").Value);
                int minParticleSpeedX = int.Parse(emitterElement.Element("MinParticleSpeedX").Value);
                int maxParticleSpeedX = int.Parse(emitterElement.Element("MaxParticleSpeedX").Value);
                int minParticleSpeedY = int.Parse(emitterElement.Element("MinParticleSpeedY").Value);
                int maxParticleSpeedY = int.Parse(emitterElement.Element("MaxParticleSpeedY").Value);

                AttributeList[(int)emitterType] = new EmitterAttributes(particleType, minDelay, maxDelay, minParticles, maxParticles,
                                                                        minParticleSpeedX, maxParticleSpeedX, minParticleSpeedY, maxParticleSpeedY);
            }
        }
コード例 #16
0
    public void Spawn(ParticleTypes pParticle, Vector3 pPosition, Transform pParent = null)
    {
        if (SpawnLoopParticles)
        {
            int        particleIndex = -1;
            GameObject tempParticle  = GetParticle(pParticle);

            if (tempParticle != null)
            {
                Vector3    pos         = tempParticle.transform.localPosition;
                GameObject newParticle = Instantiate(tempParticle, Vector3.zero, tempParticle.transform.rotation, pParent);
                newParticle.transform.localPosition = pos;
                ParticleSystem[] particles = newParticle.GetComponentsInChildren <ParticleSystem>();
                foreach (ParticleSystem particle in particles)
                {
                    if (particle.main.playOnAwake == true)
                    {
                        particle.Play(false);
                    }
                }
            }
        }
    }
コード例 #17
0
            public virtual void ReadChildData(BinaryReader reader)
            {
                int x = 0;

                _pointPhysics.ReadString(reader);
                for (x = 0; (x < _physicsConstants.Count); x = (x + 1))
                {
                    PhysicsConstants.Add(new ParticleSystemPhysicsConstantsBlock());
                    PhysicsConstants[x].Read(reader);
                }
                for (x = 0; (x < _physicsConstants.Count); x = (x + 1))
                {
                    PhysicsConstants[x].ReadChildData(reader);
                }
                for (x = 0; (x < _particleTypes.Count); x = (x + 1))
                {
                    ParticleTypes.Add(new ParticleSystemTypesBlock());
                    ParticleTypes[x].Read(reader);
                }
                for (x = 0; (x < _particleTypes.Count); x = (x + 1))
                {
                    ParticleTypes[x].ReadChildData(reader);
                }
            }
コード例 #18
0
ファイル: BaseObject.cs プロジェクト: terrypaton1/Cinder
 protected static void SpawnParticles(ParticleTypes particleType, Vector3 position)
 {
     CoreConnector.GameManager.particleManager.SpawnParticleEffect(particleType, position);
 }
コード例 #19
0
	public GameObject CreateParticle(Vector3 pos, ParticleTypes particleToCreate, float sizeRatio)
	{
		int indexOfParticle = (int)particleToCreate;
		// Check to see if the particle has a ParticleRenderer component since the older particles used those. The newer ones use a
		// ParticleSystem component instead. If they have a ParticleRenderer component then they are considered a Legacy particle.

		// No need to make anything a smaller ratio than this for the overall
		// size of the particle. If you want to you could though, I just prefer
		// not to.
		if(sizeRatio < 0.4f)
			sizeRatio = 0.4f;
		GameObject newPart = Instantiate(particles[indexOfParticle], pos, particles[indexOfParticle].transform.rotation) as GameObject;
		bool isLegacyParticle = (newPart.GetComponent<ParticleSystem>() == null);

		if(isLegacyParticle)
		{
			// Here we find the particle emitter(s) on the particle being created.
			ParticleEmitter partEmitter = newPart.GetComponent<ParticleEmitter>();
			ParticleEmitter[] partEmitters = new ParticleEmitter[]{};
			if(partEmitter == null) // If there wasn't one found on the particle being created.
			{
				// Then it must be somewhere else so we find it/them in the children.
				partEmitters = newPart.transform.GetComponentsInChildren<ParticleEmitter>();
				if(partEmitters != null && partEmitters.Length > 0) // When found we then adjust them using the sizeRatio.
				{
					foreach(ParticleEmitter emitter in partEmitters)
					{
						emitter.minSize *= sizeRatio;
						emitter.maxSize *= sizeRatio;
						emitter.minEmission *= sizeRatio;
						emitter.maxEmission *= sizeRatio;
					}
				}
			}
			else if(partEmitter != null)
			{
				// This is where the sizeRatio makes its use.  It increases the size and emission of the particle to create a different size
				// and amount of the same particle.
				partEmitter.minSize *= sizeRatio;
				partEmitter.maxSize *= sizeRatio;
				partEmitter.minEmission *= sizeRatio;
				partEmitter.maxEmission *= sizeRatio;
			}
		}
		else // A Particle System component must be used instead!
		{
			ParticleSystem partSystem = newPart.GetComponent<ParticleSystem>();
			if(partSystem != null)
			{
				partSystem.startSize *= sizeRatio; // Increase the size using the Particle System's way.
				// Next I simply just change the color of the material for the
				// guard particle to blue to give it more of a blue effect. Just
				// something I wanted. This is also an example of how you can
				// edit individual particles. My guard hitspark uses a particle
				// system so editing it would go here. All particles that don't
				// use a particle system component would be edited in the above
				// part where you see partEmitter != null.
				if(particleToCreate == ParticleTypes.HitSpark_Guard)
					partSystem.GetComponent<Renderer>().material.color = Color.blue;
			}
			// Make sure the particle gets destroyed after its duration.
			Destroy (newPart, partSystem.duration + 0.1f);
		}
		return newPart; // This new particle gets returned if desired so you can access it in a script that called this method.
	}
コード例 #20
0
 /// <summary>
 /// 显示风中粒子
 /// </summary>
 /// <param name="role">所修饰角色</param>
 /// <param name="equipType">所参照的装备</param>
 /// <param name="particleType">粒子类型</param>
 /// <param name="color">颜色</param>
 /// <param name="amount">量</param>
 public void ShowWindParticles(RoleBase role, EquipTypes equipType, ParticleTypes particleType, double color, double amount)
 {
     ObjectBase equip = role.EquipEntity(equipType);
     if (!equip.IsVisible) { return; }
     int distance = 0;
     double speed = 0;
     if (role.Action == Actions.Stop) {
         distance = 40;
         speed = RandomSeed.Next(2000, 3000) * 0.01;
     } else {
         distance = 40;
         speed = RandomSeed.Next(1000, 1500) * 0.01;
     }
     int halfDistance = distance / 2;
     int obliqueDistance = distance * 2 / 3;
     Dispatcher.BeginInvoke(delegate {
         WriteableBitmap writeableBitmap = new WriteableBitmap(equip, null);
         if (writeableBitmap.Pixels.Count() != 0) {
             lock (writeableBitmap) {
                 writeableBitmap.Invalidate();
                 int z = 0;
                 if (equipType == EquipTypes.Weapon) {
                     if (role.State == States.Riding && role.Direction != Directions.South) {
                         z = role.Z + equip.Z + 5;
                     } else {
                         z = role.Z + equip.Z;
                     }
                 } else {
                     z = (role.Direction == Directions.North || role.Direction == Directions.NorthEast || role.Direction == Directions.NorthWest) ? role.Z : role.Z - 20;
                 }
                 z -= role.ZAddition;
                 Point position = equipType == EquipTypes.Overall ? role.Center : equip.Position;
                 Point2D destination = new Point2D();
                 EffectBase effect = null;
                 if (color == 0) {
                     effect = new MonoChrome() { FilterColor = Colors.White };
                 } else if (color == 1) {
                     effect = new MonoChrome() { FilterColor = Colors.Black };
                 } else {
                     effect = new ShiftHue() { HueShift = color };
                 }
                 switch (role.Direction) {
                     case Directions.North:
                         destination.X = 0; destination.Y = RandomSeed.Next(halfDistance, distance);
                         break;
                     case Directions.NorthEast:
                         destination.X = -RandomSeed.Next(halfDistance, obliqueDistance); destination.Y = RandomSeed.Next(halfDistance, obliqueDistance);
                         break;
                     case Directions.East:
                         destination.X = -RandomSeed.Next(halfDistance, distance); destination.Y = 0;
                         break;
                     case Directions.SouthEast:
                         destination.X = -RandomSeed.Next(halfDistance, obliqueDistance); destination.Y = -RandomSeed.Next(halfDistance, obliqueDistance);
                         break;
                     case Directions.South:
                         destination.X = 0; destination.Y = -RandomSeed.Next(halfDistance, distance);
                         break;
                     case Directions.SouthWest:
                         destination.X = RandomSeed.Next(halfDistance, obliqueDistance); destination.Y = -RandomSeed.Next(halfDistance, obliqueDistance);
                         break;
                     case Directions.West:
                         destination.X = RandomSeed.Next(halfDistance, distance); destination.Y = 0;
                         break;
                     case Directions.NorthWest:
                         destination.X = RandomSeed.Next(halfDistance, obliqueDistance); destination.Y = RandomSeed.Next(halfDistance, obliqueDistance);
                         break;
                 }
                 for (int i = 0; i < amount; i++) {
                     int x = RandomSeed.Next(0, writeableBitmap.PixelWidth);
                     int y = RandomSeed.Next(0, writeableBitmap.PixelHeight);
                     byte[] bytes = BitConverter.GetBytes(writeableBitmap.Pixels[writeableBitmap.PixelWidth * y + x]);
                     if (bytes[3] != 0) {
                         Particle particle = new Particle() { SpaceLayer = role.SpaceLayer, Z = z, Effect = effect, Source = GlobalMethod.GetImage(string.Format("Particle/{0}{1}.png", particleType, RandomSeed.Next(0, 3)), UriType.Project) };
                         space.Children.Add(particle);
                         EventHandler handler = null;
                         particle.Disposed += handler = (s, e) => {
                             Particle p = s as Particle;
                             p.Disposed -= handler;
                             space.Children.Remove(p);
                         };
                         double pX = (position.X - x) * particle.Scale;
                         double pY = (position.Y - y) * particle.Scale;
                         particle.Move(new Point(role.Position.X - pX, role.Position.Y - pY), new Point(role.Position.X - pX + destination.X * particle.Scale, role.Position.Y - pY + destination.Y * particle.Scale), speed, MoveModes.Opacity);
                     }
                 }
             }
         }
     });
 }
コード例 #21
0
ファイル: ParticleManager.cs プロジェクト: terrypaton1/Cinder
    public void SpawnParticleEffect(ParticleTypes effect, Vector3 position)
    {
        position.z = -0.2f;
        switch (effect)
        {
        case ParticleTypes.BallHitsBrick:
            PositionAndEmit(_brickCollisionParticleSystem, position, 5);
            break;

        case ParticleTypes.BrickExplosion:
            PositionAndEmit(_brickExplosionParticleSystem, position, 10);
            break;

        case ParticleTypes.BallHitsBat:

            PositionAndEmit(_batCollisionParticleSystem, position, 5);
            break;

        case ParticleTypes.NewBallOne:
            _newBallParticleSystem.transform.position = position;
            _newBallParticleSystem.Play();
            break;

        case ParticleTypes.NewBallTwo:
            _newBallTwoParticleSystem.transform.position = position;
            _newBallTwoParticleSystem.Play();
            break;

        case ParticleTypes.BallLost:
            PositionAndEmit(ballLostParticleSystem, position, 10);
            break;

        case ParticleTypes.PowerUpLost:
            PositionAndEmit(PowerUpLostParticles, position, 10);
            break;

        case ParticleTypes.PowerUpCollected:
            PositionAndEmit(PowerUpCollectedParticles, position, 10);
            break;

        case ParticleTypes.FallingPointsCollected:
            PositionAndEmit(FallingPointsCollectedParticles, position, 5);
            break;

        case ParticleTypes.DestroyFallingItems:
            PositionAndEmit(DestroyFallingItemsParticles, position, 5);
            break;

        case ParticleTypes.TNTExplosion:
            PositionAndEmit(TNTExplosionParticles, position, 40);
            break;

        case ParticleTypes.LaserHitsBrick:
            PositionAndEmit(LaserBulletParticles, position, 5);
            break;

        case ParticleTypes.WanderingObstacleExplosion:
            PositionAndEmit(WanderingObstacleExplosionParticles, position, 20);
            break;

        case ParticleTypes.WanderingObstacleSpawn:
            PositionAndEmit(WanderingObstacleSpawnParticles, position, 10);
            break;

        case ParticleTypes.BossExplosion:
            PositionAndEmit(BossExplosionParticles, position, 50);
            break;

        case ParticleTypes.FreezePlayer:
            PositionAndEmit(FreezePlayerParticles, position, 1);
            break;
        }
    }
コード例 #22
0
ファイル: Particle.cs プロジェクト: SanjayP9/CStrike2D
        /// <summary>
        /// Used to create an instance of a particle and based on its particle type it will have certain attributes
        /// </summary>
        /// <param name="emitVect"> Passes through the emitter vector2 </param>
        /// <param name="particleType"> Specifies what particle to create </param>
        /// <param name="playerAngle"> Specifies what angle the player is at </param>
        public Particle(Vector2 emitVect, ParticleTypes particleType, float playerAngle)
        {
            // Sets class level variables to ones retrieved in parameter
            this.ParticlePosition = emitVect;
            this.emitVect         = emitVect;
            this.Type             = particleType;

            // Bassed upon the Particle type the particle will have a specific color, velocity, scale
            switch (Type)
            {
            case ParticleTypes.Frag:

                // Particle color starts off as yellow for a frag grenade
                particleColor = new Color(250, 250, 0);
                // Direction is randomly genarated in a 360 degree radius
                particleDirection = CalcDirectionVect(CStrike2D.Rand.Next(0, 361));

                // 10% chance of having a high velocity particle
                if (CStrike2D.Rand.Next(0, 101) < 10)
                {
                    particleVelocity = 5.0f;
                }
                else
                {
                    particleVelocity = 3.0f;
                }

                // Scales the intial size to 20% and sets the initial transparency to 100%
                particleScale        = 0.2f;
                ParticleTransparency = 1.0f;
                break;

            case ParticleTypes.Smoke:

                // Updates the smoke particle every SMOKE_UPDATE_FREQ
                updateFreq = SMOKE_UPDATE_FREQ;

                // Sets initial color to Cray and randomly generates a direciton from a 360 degree radius
                particleColor     = Color.Gray;
                particleDirection = CalcDirectionVect(CStrike2D.Rand.Next(0, 361));

                // Initial velocity and transparency set to 1
                particleVelocity     = 1.0f;
                ParticleTransparency = 1.0f;
                // Initla particle scale is 150%
                particleScale = 1.5f;
                break;

            case ParticleTypes.GunSmoke:
                // Sets Color to light gray
                particleColor = new Color(120, 120, 120);
                // Gets the direction from the direciton of the player barrel
                particleDirection = CalcDirectionVect(playerAngle);

                // Has default values for velocity and transparency and scale is set to 1%
                particleVelocity     = 1.0f;
                ParticleTransparency = 1.0f;
                particleScale        = 0.01f;

                // Matches the rotation to the players angle
                rotation = playerAngle;
                break;

            case ParticleTypes.Debris:
                // Sets intial color to transparent
                particleColor = Color.White;
                break;

            case ParticleTypes.Shell:
                // No overlay color
                particleColor = Color.White;

                // randomly gets a direction from a 52 degree radius that perpendicular to the player angle
                particleDirection    = CalcDirectionVect(playerAngle + (((CStrike2D.Rand.Next(0, 52) - 52) / 100f)));
                ParticleTransparency = 1.0f;
                // random velocity from 2.5 to 3.5
                particleVelocity = CStrike2D.Rand.Next(25, 35) / 10f;

                // Texture scales to 2%
                particleScale = 0.02f;

                // Constant rotation change id randomly generated so each shell has a unique movement
                rotationChange = 0.6f * (float)(CStrike2D.Rand.NextDouble() * (CStrike2D.Rand.Next(0, 2) - 1f));
                break;

            default:
                break;
            }
        }
コード例 #23
0
ファイル: Console.cs プロジェクト: Gallardot/GallardotStorage
        /// <summary>
        /// 初始化系统控制台
        /// </summary>
        void InitializeConsole()
        {
            timer.Tick += delegate {
                //if (leader != null) {
                //    leader.FullName = ParallelDownloader.Error + " " + ParallelDownloader.error + " " + SerialDownloader.count;
                //}
                Dispatcher.BeginInvoke(() => {
                    textBlock36.Text = ObjectTracker.GetAllLiveTrackedObjects().Count().ToString();
                    if (childCanvas0.Visibility == Visibility.Visible && tabCanvas0.Visibility == Visibility.Visible) {
                        textBlock48.Text = string.Format("串行下载中[{0}] 未完成[{1}]", SerialDownloader.LoadingUri.Count, SerialDownloader.WaitingUri.Count);
                        textBlock51.Text = string.Format("并行下载中[{0}] 未完成[{1}]", ParallelDownloader.LoadingUri.Count, ParallelDownloader.WaitingUri.Count);
                        textBlock52.Text = string.Format("共完成下载[{0}] 失败[{1}]", DownloadBase.LoadedUri.Count, DownloadBase.Error);
                        rectangle0.Clip = new RectangleGeometry() { Rect = new Rect() { Width = 80 * (SerialDownloader.ProgressPercentage / 100d), Height = 10 } };
                        rectangle1.Clip = new RectangleGeometry() { Rect = new Rect() { Width = 80 * (ParallelDownloader.ProgressPercentage / 100d), Height = 10 } };
                        listBox0.Children.Clear();
                        for (int i = 0; i < SerialDownloader.LoadingUri.Count; i++) {
                            TextBlock textBlock = new TextBlock() { Text = SerialDownloader.LoadingUri[i], Foreground = new SolidColorBrush(Colors.Cyan) };
                            listBox0.Children.Add(textBlock);
                            Canvas.SetLeft(textBlock, 0);
                            Canvas.SetTop(textBlock, i * 18);
                        }
                        listBox1.Children.Clear();
                        for (int i = 0; i < ParallelDownloader.LoadingUri.Count; i++) {
                            TextBlock textBlock = new TextBlock() { Text = ParallelDownloader.LoadingUri[i], Foreground = new SolidColorBrush(Colors.Cyan) };
                            listBox1.Children.Add(textBlock);
                            Canvas.SetLeft(textBlock, 0);
                            Canvas.SetTop(textBlock, i * 16);
                            if (i > 8) { textBlock.Text = "......"; break; }
                        }
                    }
                });
            };
            timer.Start();

            ToolTipService.SetToolTip(textBlock6, "Number of roles in scene");
            ToolTipService.SetToolTip(textBlock35, "Number of objects in memory");
            ToolTipService.SetToolTip(textBlock36, "Number of objects in memory");
            ToolTipService.SetToolTip(textBlock48, "Number of serial downloads and serial waitings");
            ToolTipService.SetToolTip(textBlock51, "Number of parallel downloads and parallel waitings");
            ToolTipService.SetToolTip(textBlock52, "Number of total downloads and error downloads");

            ToolTipService.SetToolTip(rectangle0, "Serial download progress");
            ToolTipService.SetToolTip(rectangle1, "Parallel download progress");

            ToolTipService.SetToolTip(arrowButton, "Download status");

            ToolTipService.SetToolTip(tabItem0, "Scene Console");
            ToolTipService.SetToolTip(tabItem1, "Leader Console");
            ToolTipService.SetToolTip(tabItem2, "Other Console");
            ToolTipService.SetToolTip(button0, "Full Screen/Window Mode");
            ToolTipService.SetToolTip(button1, "Installed to the local");
            ToolTipService.SetToolTip(button2, "Attack");
            ToolTipService.SetToolTip(button3, "Injure");
            ToolTipService.SetToolTip(button4, "Null");
            ToolTipService.SetToolTip(button5, "Add roles to scene");
            ToolTipService.SetToolTip(button6, "Clear all roles");
            ToolTipService.SetToolTip(comboBox0, "State:Siting/Walking/Riding");
            ToolTipService.SetToolTip(comboBox1, "Profession:Archer/Assassin/Warrior/Magician");
            ToolTipService.SetToolTip(comboBox2, "Select Armor");
            ToolTipService.SetToolTip(comboBox3, "Select Weapon");
            ToolTipService.SetToolTip(comboBox4, "Select Ride");
            ToolTipService.SetToolTip(comboBox5, "Select Armor");
            ToolTipService.SetToolTip(comboBox6, "Select Weapon");
            ToolTipService.SetToolTip(comboBox7, "Select Ride");
            ToolTipService.SetToolTip(comboBox8, "Shadow:None/Simple/Simulation");
            ToolTipService.SetToolTip(comboBox9, "Day/Night/Memories");
            ToolTipService.SetToolTip(comboBox10, "Simple/Simulation");
            ToolTipService.SetToolTip(comboBox11, "Weather:None/Rain/Wind/Snow/Cloud/God Punished");
            ToolTipService.SetToolTip(comboBox12, "Body Shield");
            ToolTipService.SetToolTip(comboBox13, "Bottom Shield");
            ToolTipService.SetToolTip(comboBox14, "Rendering");
            ToolTipService.SetToolTip(comboBox15, "ChasingShadowEffect:None/Body/Armor Only/Weapon Only");
            ToolTipService.SetToolTip(comboBox16, "FlowLightEffect:None/Body/Armor Only/Weapon Only");
            ToolTipService.SetToolTip(comboBox17, "Select Armor");
            ToolTipService.SetToolTip(comboBox18, "Select Weapon");
            ToolTipService.SetToolTip(comboBox19, "Select Ride");
            ToolTipService.SetToolTip(comboBox20, "Close-up");
            ToolTipService.SetToolTip(comboBox21, "Music:OFF/ON");
            ToolTipService.SetToolTip(comboBox22, "SpaceLayer:Ground/Sky");
            ToolTipService.SetToolTip(comboBox23, "Select Armor");
            ToolTipService.SetToolTip(comboBox24, "Select Weapon");
            ToolTipService.SetToolTip(comboBox25, "Select Ride");
            ToolTipService.SetToolTip(comboBox26, "Mouse Move Hit Role:By pixel/By range");
            ToolTipService.SetToolTip(comboBox27, "Weapon emit particles:Normal/Smoke/Ice/Flame");
            ToolTipService.SetToolTip(comboBox28, "Particles Source:Body/Armor Only/Weapon Only");
            ToolTipService.SetToolTip(comboBox29, "Role located space position:Random/Ground/Sky");
            ToolTipService.SetToolTip(comboBox31, "MapViewPortMode:Synchronization/Easing");
            ToolTipService.SetToolTip(comboBox32, "Role Camp:Random/NPC Mode/KindHearted/Neutrality/Eval");
            ToolTipService.SetToolTip(comboBox33, "Role Profession:Random/Archer/Assassin/Warrior/Magician");
            ToolTipService.SetToolTip(comboBox34, "Role State:Random/Walking/Riding");
            ToolTipService.SetToolTip(comboBox35, "TacticAI:Random/Guard/GoalLeader/FreeFighting/TeamAttack/MartialBattle");
            ToolTipService.SetToolTip(comboBox36, "ActionAI:Random/Simple/Witty/Persistent/Cowardice");
            ToolTipService.SetToolTip(comboBox37, "Terrain:Static/Dynamic");
            ToolTipService.SetToolTip(comboBox38, "Mouse right button click casting:Magic Level");
            ToolTipService.SetToolTip(comboBox39, "Select magic,mouse right button click casting");
            ToolTipService.SetToolTip(comboBox40, "MouseWheel lead to viewport zooming(Rate) Mode:Continuous/SpecialEffect");

            ToolTipService.SetToolTip(slider0, "Refresh Leader/Monster Number");
            ToolTipService.SetToolTip(slider1, "Weather Strength");
            ToolTipService.SetToolTip(slider2, "Color");
            ToolTipService.SetToolTip(slider3, "Color");
            ToolTipService.SetToolTip(slider4, "Color");
            ToolTipService.SetToolTip(slider5, "Coefficient");
            ToolTipService.SetToolTip(slider6, "Color");
            ToolTipService.SetToolTip(slider7, "Coefficient");
            ToolTipService.SetToolTip(slider8, "MouseWheel lead to viewport zooming(Rate):roll up scaling and roll down restore");
            ToolTipService.SetToolTip(slider9, "Scaling");
            ToolTipService.SetToolTip(slider10, "MusicVolume");
            ToolTipService.SetToolTip(slider11, "Particle Color");
            ToolTipService.SetToolTip(slider12, "Number of particles");
            ToolTipService.SetToolTip(slider13, "Magic/Skill Casting Frequency");
            ToolTipService.SetToolTip(slider14, "Drama dialog speed");
            ToolTipService.SetToolTip(slider15, "Parallel download Limit");

            LayoutRoot.Children.Add(consoleWindow);
            consoleWindow.Position = new Point(12, 130);
            consoleWindow.BodyPosition = new Point3D(0, 25, 0);
            consoleWindow.CloserPosition = new Point3D(294, 5, 0);
            consoleWindow.Head = tabCanvas;
            //设置默认选项卡
            consoleWindow.Body = tabCanvas0; tabItem0.Effect = new MonoChrome() { FilterColor = Color.FromArgb(255, 190, 167, 113) };
            consoleWindow.Closer = closer;
            ToolTipService.SetToolTip(closer, "Hide/Display");
            closer.MouseLeftButtonDown += (s, e) => {
                if (consoleWindow.Body != null) {
                    consoleWindow.Body = null;
                    closer.Source = GlobalMethod.GetImage("UI/Close0.png", UriType.Project);
                } else {
                    consoleWindow.Body = tabCanvas0;
                    tabItem0.Effect = new MonoChrome() { FilterColor = Color.FromArgb(255, 190, 167, 113) };
                    tabItem1.Effect = null;
                    tabItem2.Effect = null;
                    closer.Source = GlobalMethod.GetImage("UI/Close1.png", UriType.Project);
                }
                e.Handled = true;
            };
            tabCanvas.Children.Add(new Rectangle() { Stroke = new SolidColorBrush(Colors.Gray), Width = 310, Height = 26, RadiusX = 5, RadiusY = 5, Fill = new SolidColorBrush(Color.FromArgb(160, 90, 90, 90)) });
            TextBlock consoleText = new TextBlock() { Text = "Console", FontSize = 18, Foreground = new SolidColorBrush(Colors.Gray) };
            tabCanvas.Children.Add(consoleText); Canvas.SetLeft(consoleText, 210); Canvas.SetTop(consoleText, 4);
            tabCanvas0.Children.Add(new Rectangle() { Stroke = new SolidColorBrush(Colors.Gray), Width = 310, Height = 290, RadiusX = 5, RadiusY = 5, Fill = new SolidColorBrush(Color.FromArgb(160, 60, 60, 60)) });
            tabCanvas0.Children.Add(arrowButton); Canvas.SetLeft(arrowButton, 298); Canvas.SetTop(arrowButton, 133); Canvas.SetZIndex(arrowButton, 10);
            arrowButton.MouseLeftButtonDown += (s, e) => {
                e.Handled = true;
                childCanvas0.Visibility = childCanvas0.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
                arrowButton.RenderTransform = childCanvas0.Visibility == Visibility.Visible ? null : new ScaleTransform() { CenterX = arrowButton.ActualWidth / 2, ScaleX = -1 };
            };
            tabCanvas1.Children.Add(new Rectangle() { Stroke = new SolidColorBrush(Colors.Gray), Width = 310, Height = 290, RadiusX = 5, RadiusY = 5, Fill = new SolidColorBrush(Color.FromArgb(160, 60, 60, 60)) });
            tabCanvas2.Children.Add(new Rectangle() { Stroke = new SolidColorBrush(Colors.Gray), Width = 310, Height = 290, RadiusX = 5, RadiusY = 5, Fill = new SolidColorBrush(Color.FromArgb(160, 60, 60, 60)) });
            childCanvas0.Children.Add(new Rectangle() { Stroke = new SolidColorBrush(Colors.Gray), Width = 160, Height = 290, RadiusX = 5, RadiusY = 5, Fill = new SolidColorBrush(Color.FromArgb(160, 60, 60, 60)) });
            tabCanvas.Children.Add(tabItem0); Canvas.SetLeft(tabItem0, 10); Canvas.SetTop(tabItem0, 4);
            tabCanvas.Children.Add(tabItem1); Canvas.SetLeft(tabItem1, 60); Canvas.SetTop(tabItem1, 4);
            tabCanvas.Children.Add(tabItem2); Canvas.SetLeft(tabItem2, 116); Canvas.SetTop(tabItem2, 4);
            tabItem0.MouseLeftButtonDown += (s, e) => {
                consoleWindow.Body = tabCanvas0;
                tabItem0.Effect = new MonoChrome() { FilterColor = Color.FromArgb(255, 190, 167, 113) };
                tabItem1.Effect = null;
                tabItem2.Effect = null;
                closer.Source = GlobalMethod.GetImage("UI/Close1.png", UriType.Project);
                e.Handled = true;
            };
            tabItem1.MouseLeftButtonDown += (s, e) => {
                consoleWindow.Body = tabCanvas1;
                tabItem0.Effect = null;
                tabItem1.Effect = new MonoChrome() { FilterColor = Color.FromArgb(255, 190, 167, 113) };
                tabItem2.Effect = null;
                closer.Source = GlobalMethod.GetImage("UI/Close1.png", UriType.Project);
                e.Handled = true;
            };
            tabItem2.MouseLeftButtonDown += (s, e) => {
                consoleWindow.Body = tabCanvas2;
                tabItem0.Effect = null;
                tabItem1.Effect = null;
                tabItem2.Effect = new MonoChrome() { FilterColor = Color.FromArgb(255, 190, 167, 113) };
                closer.Source = GlobalMethod.GetImage("UI/Close1.png", UriType.Project);
                e.Handled = true;
            };

            #region 场景部分

            tabCanvas0.Children.Add(button0); Canvas.SetLeft(button0, 10); Canvas.SetTop(button0, 6); Canvas.SetZIndex(button0, 3);
            button0.Click += (s, e) => {
                if (Application.Current.Host.Content.IsFullScreen) {
                    Application.Current.Host.Content.IsFullScreen = false;
                } else {
                    Application.Current.Host.Content.IsFullScreen = true;
                }
                Content_Resized(null, null);
            };
            tabCanvas0.Children.Add(button1); Canvas.SetLeft(button1, 70); Canvas.SetTop(button1, 6); Canvas.SetZIndex(button1, 3);
            button1.Click += (s, e) => {
                if (Application.Current.InstallState == InstallState.NotInstalled) {
                    Application.Current.Install();
                } else {
                    MessageBox.Show("本地已经安装!");
                }
            };

            tabCanvas0.Children.Add(textBlock30); Canvas.SetLeft(textBlock30, 140); Canvas.SetTop(textBlock30, 8); Canvas.SetZIndex(textBlock30, 3);
            tabCanvas0.Children.Add(comboBox26); Canvas.SetLeft(comboBox26, 190); Canvas.SetTop(comboBox26, 6); Canvas.SetZIndex(comboBox26, 3);
            comboBox26.Items.Add(new ComboBoxItem() { Tag = "0", Content = "基于像素(易错)" });
            comboBox26.Items.Add(new ComboBoxItem() { Tag = "1", Content = "基于范围(通用)", IsSelected = true });

            tabCanvas0.Children.Add(textBlock44); Canvas.SetLeft(textBlock44, 10); Canvas.SetTop(textBlock44, 34); Canvas.SetZIndex(textBlock44, 3);
            tabCanvas0.Children.Add(comboBox37); Canvas.SetLeft(comboBox37, 38); Canvas.SetTop(comboBox37, 32); Canvas.SetZIndex(comboBox37, 3);
            comboBox37.Items.Add(new ComboBoxItem() { Tag = "0", Content = "固态", IsSelected = true });
            comboBox37.Items.Add(new ComboBoxItem() { Tag = "1", Content = "动态" });
            comboBox37.SelectionChanged += (s, e) => {
                terrain.Refresh -= terrain_Refresh;
                switch (terrain.TerrainType = (TerrainTypes)Convert.ToInt32(((ComboBoxItem)comboBox37.SelectedItem).Tag)) {
                    case TerrainTypes.Fixed:
                        terrain.InitializeDynamicMatrix();
                        break;
                    case TerrainTypes.Dynamic:
                        terrain.Refresh += terrain_Refresh;
                        break;
                }
            };
            tabCanvas0.Children.Add(textBlock34); Canvas.SetLeft(textBlock34, 95); Canvas.SetTop(textBlock34, 34); Canvas.SetZIndex(textBlock34, 3);
            tabCanvas0.Children.Add(comboBox31); Canvas.SetLeft(comboBox31, 122); Canvas.SetTop(comboBox31, 32); Canvas.SetZIndex(comboBox31, 3);
            comboBox31.Items.Add(new ComboBoxItem() { Tag = "0", Content = "同步", IsSelected = true });
            comboBox31.Items.Add(new ComboBoxItem() { Tag = "1", Content = "缓动" });
            comboBox31.SelectionChanged += (s, e) => {
                space.EndEasingMapTo(leader.Position);
                space.ViewPortMoveMode = (ViewPortMoveModes)Convert.ToInt32(((ComboBoxItem)comboBox31.SelectedItem).Tag);
            };

            tabCanvas0.Children.Add(textBlock7); Canvas.SetLeft(textBlock7, 179); Canvas.SetTop(textBlock7, 34); Canvas.SetZIndex(textBlock7, 3);
            tabCanvas0.Children.Add(comboBox8); Canvas.SetLeft(comboBox8, 207); Canvas.SetTop(comboBox8, 32); Canvas.SetZIndex(comboBox8, 3);
            comboBox8.Items.Add(new ComboBoxItem() { Tag = "0", Content = "无(最快)" });
            comboBox8.Items.Add(new ComboBoxItem() { Tag = "1", Content = "简单(快)", IsSelected = true });
            comboBox8.Items.Add(new ComboBoxItem() { Tag = "2", Content = "真实(慢)" });
            comboBox8.SelectionChanged += (s, e) => {
                space.ShadowType = (ShadowTypes)Convert.ToInt32(((ComboBoxItem)comboBox8.SelectedItem).Tag);
            };

            tabCanvas0.Children.Add(textBlock8); Canvas.SetLeft(textBlock8, 10); Canvas.SetTop(textBlock8, 60); Canvas.SetZIndex(textBlock8, 3);
            tabCanvas0.Children.Add(comboBox9); Canvas.SetLeft(comboBox9, 38); Canvas.SetTop(comboBox9, 58); Canvas.SetZIndex(comboBox9, 3);
            comboBox9.Items.Add(new ComboBoxItem() { Tag = "0", Content = "白天", IsSelected = true });
            comboBox9.Items.Add(new ComboBoxItem() { Tag = "1", Content = "黑夜" });
            comboBox9.Items.Add(new ComboBoxItem() { Tag = "2", Content = "回忆" });
            comboBox9.SelectionChanged += (s, e) => {
                switch (Convert.ToInt32(((ComboBoxItem)comboBox9.SelectedItem).Tag)) {
                    case 0:
                        space.ToNormal();
                        break;
                    case 1:
                        space.ToNight();
                        break;
                    case 2:
                        space.ToMemories();
                        break;
                }
            };
            tabCanvas0.Children.Add(comboBox10); Canvas.SetLeft(comboBox10, 92); Canvas.SetTop(comboBox10, 58); Canvas.SetZIndex(comboBox10, 3);
            comboBox10.Items.Add(new ComboBoxItem() { Tag = "0", Content = "简单" });
            comboBox10.Items.Add(new ComboBoxItem() { Tag = "1", Content = "仿真", IsSelected = true });
            comboBox10.SelectionChanged += (s, e) => {
                space.WeatherEffect = (WeatherEffects)Convert.ToInt32(((ComboBoxItem)comboBox10.SelectedItem).Tag);
            };
            tabCanvas0.Children.Add(comboBox11); Canvas.SetLeft(comboBox11, 146); Canvas.SetTop(comboBox11, 58); Canvas.SetZIndex(comboBox11, 3);
            comboBox11.Items.Add(new ComboBoxItem() { Tag = "0", Content = "无", IsSelected = true });
            comboBox11.Items.Add(new ComboBoxItem() { Tag = "1", Content = "下雨" });
            comboBox11.Items.Add(new ComboBoxItem() { Tag = "2", Content = "纷飞" });
            comboBox11.Items.Add(new ComboBoxItem() { Tag = "3", Content = "飘雪" });
            comboBox11.Items.Add(new ComboBoxItem() { Tag = "4", Content = "雷电" });
            comboBox11.Items.Add(new ComboBoxItem() { Tag = "5", Content = "云雾" });
            comboBox11.Items.Add(new ComboBoxItem() { Tag = "6", Content = "天惩" });
            comboBox11.SelectionChanged += (s, e) => {
                space.RunWeather((WeatherTypes)Convert.ToInt32(((ComboBoxItem)comboBox11.SelectedItem).Tag), slider1.Value);
            };
            tabCanvas0.Children.Add(textBlock9); Canvas.SetLeft(textBlock9, 204); Canvas.SetTop(textBlock9, 60); Canvas.SetZIndex(textBlock9, 3);
            tabCanvas0.Children.Add(textBlock10); Canvas.SetLeft(textBlock10, 229); Canvas.SetTop(textBlock10, 60); Canvas.SetZIndex(textBlock10, 3);
            tabCanvas0.Children.Add(textBlock11); Canvas.SetLeft(textBlock11, 296); Canvas.SetTop(textBlock11, 60); Canvas.SetZIndex(textBlock11, 3);
            tabCanvas0.Children.Add(slider1); Canvas.SetLeft(slider1, 235); Canvas.SetTop(slider1, 60); Canvas.SetZIndex(slider1, 3);
            slider1.ValueChanged += (s, e) => { space.RunWeather((WeatherTypes)Convert.ToInt32(((ComboBoxItem)comboBox11.SelectedItem).Tag), slider1.Value); };

            tabCanvas0.Children.Add(textBlock16); Canvas.SetLeft(textBlock16, 10); Canvas.SetTop(textBlock16, 86); Canvas.SetZIndex(textBlock16, 3);
            tabCanvas0.Children.Add(comboBox14); Canvas.SetLeft(comboBox14, 38); Canvas.SetTop(comboBox14, 84); Canvas.SetZIndex(comboBox14, 3);
            comboBox14.Items.Add(new ComboBoxItem() { Tag = "0", Content = "无", IsSelected = true });
            comboBox14.Items.Add(new ComboBoxItem() { Tag = "1", Content = "马赛克" });
            comboBox14.Items.Add(new ComboBoxItem() { Tag = "2", Content = "径向模糊" });
            comboBox14.Items.Add(new ComboBoxItem() { Tag = "3", Content = "盘状模糊" });
            comboBox14.Items.Add(new ComboBoxItem() { Tag = "4", Content = "波纹" });
            comboBox14.Items.Add(new ComboBoxItem() { Tag = "5", Content = "饱和" });
            comboBox14.Items.Add(new ComboBoxItem() { Tag = "6", Content = "锐化" });
            comboBox14.Items.Add(new ComboBoxItem() { Tag = "7", Content = "玻璃" });
            comboBox14.Items.Add(new ComboBoxItem() { Tag = "8", Content = "黑噬" });
            comboBox14.SelectionChanged += (s, e) => {
                switch (Convert.ToInt32(((ComboBoxItem)comboBox14.SelectedItem).Tag)) {
                    case 0:
                        space.Effect = null;
                        break;
                    case 1:
                        GlobalMethod.RunEffectAnimation(space, new Pixelate(), false, false, "Progress", 0, 100, TimeSpan.FromMilliseconds(2000), new ExponentialEase() { EasingMode = EasingMode.EaseIn }, true);
                        break;
                    case 2:
                        GlobalMethod.RunEffectAnimation(space, new RadialBlur(), false, false, "Progress", 0, 100, TimeSpan.FromMilliseconds(2000), new ExponentialEase() { EasingMode = EasingMode.EaseIn }, true);
                        break;
                    case 3:
                        GlobalMethod.RunEffectAnimation(space, new GrowablePoissonDisk(), true, false, "DiskRadius", 0, 10, TimeSpan.FromMilliseconds(1500), null, true);
                        break;
                    case 4:
                        GlobalMethod.RunEffectAnimation(space, new Ripple(), false, false, "Progress", 0, 100, TimeSpan.FromMilliseconds(2000), new ExponentialEase() { EasingMode = EasingMode.EaseIn }, true);
                        break;
                    case 5:
                        GlobalMethod.RunEffectAnimation(space, new Saturate(), true, false, "Progress", 0, 100, TimeSpan.FromMilliseconds(1500), null, true);
                        break;
                    case 6:
                        GlobalMethod.RunEffectAnimation(space, new Sharpen(), true, false, "Amount", 0, 2, TimeSpan.FromMilliseconds(2000), null, true);
                        break;
                    case 7:
                        GlobalMethod.RunEffectAnimation(space, new GlassTiles() { Tiles = 20 }, true, false, "BevelWidth", 0, 10, TimeSpan.FromMilliseconds(1500), null, true);
                        break;
                    case 8:
                        GlobalMethod.RunEffectAnimation(space, new Bands() { BandDensity = 30 }, true, false, "BandIntensity", 0, 1, TimeSpan.FromMilliseconds(2000), null, true);
                        break;
                }
            };

            tabCanvas0.Children.Add(textBlock58); Canvas.SetLeft(textBlock58, 10); Canvas.SetTop(textBlock58, 112); Canvas.SetZIndex(textBlock58, 3);
            tabCanvas0.Children.Add(comboBox40); Canvas.SetLeft(comboBox40, 122); Canvas.SetTop(comboBox40, 110); Canvas.SetZIndex(comboBox40, 3);
            comboBox40.Items.Add(new ComboBoxItem() { Tag = "0", Content = "连续", IsSelected = true });
            comboBox40.Items.Add(new ComboBoxItem() { Tag = "1", Content = "特效" });
            comboBox40.SelectionChanged += (s, e) => {
                space.ViewPortZoomMode = (ViewPortZoomModes)Convert.ToInt32(((ComboBoxItem)comboBox40.SelectedItem).Tag);
            };
            tabCanvas0.Children.Add(textBlock25); Canvas.SetLeft(textBlock25, 181); Canvas.SetTop(textBlock25, 112); Canvas.SetZIndex(textBlock25, 3);
            tabCanvas0.Children.Add(slider8); Canvas.SetLeft(slider8, 205); Canvas.SetTop(slider8, 110); Canvas.SetZIndex(slider8, 3);
            slider8.ValueChanged += (s, e) => {
                double value = Math.Round(slider8.Value, 2);
                //space.RunWeather((WeatherTypes)Convert.ToInt32(((ComboBoxItem)comboBox11.SelectedItem).Tag), slider8.Value);
                textBlock26.Text = value.ToString();
            };
            tabCanvas0.Children.Add(textBlock26); Canvas.SetLeft(textBlock26, 276); Canvas.SetTop(textBlock26, 112); Canvas.SetZIndex(textBlock26, 3);

            //分割线
            Image image0 = new Image() { Source = GlobalMethod.GetImage("UI/RoleManagement.png", UriType.Project) };
            tabCanvas0.Children.Add(image0); Canvas.SetLeft(image0, 0); Canvas.SetTop(image0, 135); Canvas.SetZIndex(image0, 3);
            tabCanvas0.Children.Add(textBlock6); Canvas.SetLeft(textBlock6, 10); Canvas.SetTop(textBlock6, 152); Canvas.SetZIndex(textBlock6, 3);
            tabCanvas0.Children.Add(textBlock35); Canvas.SetLeft(textBlock35, 130); Canvas.SetTop(textBlock35, 152); Canvas.SetZIndex(textBlock35, 3);
            tabCanvas0.Children.Add(textBlock36); Canvas.SetLeft(textBlock36, 273); Canvas.SetTop(textBlock36, 152); Canvas.SetZIndex(textBlock36, 3);
            tabCanvas0.Children.Add(textBlock37); Canvas.SetLeft(textBlock37, 10); Canvas.SetTop(textBlock37, 181); Canvas.SetZIndex(textBlock37, 3);
            tabCanvas0.Children.Add(slider0); Canvas.SetLeft(slider0, 36); Canvas.SetTop(slider0, 180); Canvas.SetZIndex(slider0, 3);
            slider0.ValueChanged += (s, e) => {
                textBlock5.Text = ((int)slider0.Value).ToString();
            };
            tabCanvas0.Children.Add(textBlock5); Canvas.SetLeft(textBlock5, 140); Canvas.SetTop(textBlock5, 180); Canvas.SetZIndex(textBlock5, 3);
            textBlock5.Text = slider0.Value.ToString();
            tabCanvas0.Children.Add(button5); Canvas.SetLeft(button5, 220); Canvas.SetTop(button5, 178); Canvas.SetZIndex(button5, 3);
            button5.Click += (s, e) => { AddRoles(null, new AddRolesEventArgs() { Num = (int)slider0.Value, Mode = 0 }); };
            tabCanvas0.Children.Add(button6); Canvas.SetLeft(button6, 264); Canvas.SetTop(button6, 178); Canvas.SetZIndex(button6, 3);
            button6.Click += (s, e) => {
                leader.Stop();
                leader.Target = null;
                space.ClearPlayer();
                textBlock6.Text = string.Format("[场景中共{0}个角色]", space.AllRoles().Count);
            };

            tabCanvas0.Children.Add(textBlock38); Canvas.SetLeft(textBlock38, 10); Canvas.SetTop(textBlock38, 207); Canvas.SetZIndex(textBlock38, 3);
            tabCanvas0.Children.Add(comboBox32); Canvas.SetLeft(comboBox32, 38); Canvas.SetTop(comboBox32, 204); Canvas.SetZIndex(comboBox32, 3);
            comboBox32.Items.Add(new ComboBoxItem() { Tag = "-1", Content = "随机" });
            comboBox32.Items.Add(new ComboBoxItem() { Tag = "0", Content = "无" });
            comboBox32.Items.Add(new ComboBoxItem() { Tag = "1", Content = "善良" });
            comboBox32.Items.Add(new ComboBoxItem() { Tag = "2", Content = "中立" });
            comboBox32.Items.Add(new ComboBoxItem() { Tag = "3", Content = "邪恶", IsSelected = true });
            tabCanvas0.Children.Add(textBlock39); Canvas.SetLeft(textBlock39, 95); Canvas.SetTop(textBlock39, 207); Canvas.SetZIndex(textBlock39, 3);
            tabCanvas0.Children.Add(comboBox33); Canvas.SetLeft(comboBox33, 123); Canvas.SetTop(comboBox33, 204); Canvas.SetZIndex(comboBox33, 3);
            comboBox33.Items.Add(new ComboBoxItem() { Tag = "-1", Content = "随机", IsSelected = true });
            comboBox33.Items.Add(new ComboBoxItem() { Tag = "0", Content = "异使" });
            comboBox33.Items.Add(new ComboBoxItem() { Tag = "1", Content = "刺影" });
            comboBox33.Items.Add(new ComboBoxItem() { Tag = "2", Content = "甲士" });
            comboBox33.Items.Add(new ComboBoxItem() { Tag = "3", Content = "道法" });
            tabCanvas0.Children.Add(textBlock40); Canvas.SetLeft(textBlock40, 180); Canvas.SetTop(textBlock40, 207); Canvas.SetZIndex(textBlock40, 3);
            tabCanvas0.Children.Add(comboBox34); Canvas.SetLeft(comboBox34, 208); Canvas.SetTop(comboBox34, 204); Canvas.SetZIndex(comboBox34, 3);
            comboBox34.Items.Add(new ComboBoxItem() { Tag = "-1", Content = "随机" });
            comboBox34.Items.Add(new ComboBoxItem() { Tag = "1", Content = "步行", IsSelected = true });
            comboBox34.Items.Add(new ComboBoxItem() { Tag = "2", Content = "骑乘" });
            tabCanvas0.Children.Add(textBlock41); Canvas.SetLeft(textBlock41, 10); Canvas.SetTop(textBlock41, 233); Canvas.SetZIndex(textBlock41, 3);
            tabCanvas0.Children.Add(comboBox29); Canvas.SetLeft(comboBox29, 38); Canvas.SetTop(comboBox29, 230); Canvas.SetZIndex(comboBox29, 3);
            comboBox29.Items.Add(new ComboBoxItem() { Tag = "-1", Content = "随机" });
            comboBox29.Items.Add(new ComboBoxItem() { Tag = "0", Content = "地面", IsSelected = true });
            comboBox29.Items.Add(new ComboBoxItem() { Tag = "1", Content = "空中" });
            tabCanvas0.Children.Add(textBlock42); Canvas.SetLeft(textBlock42, 95); Canvas.SetTop(textBlock42, 233); Canvas.SetZIndex(textBlock42, 3);
            tabCanvas0.Children.Add(comboBox35); Canvas.SetLeft(comboBox35, 133); Canvas.SetTop(comboBox35, 230); Canvas.SetZIndex(comboBox35, 3);
            comboBox35.Items.Add(new ComboBoxItem() { Tag = "-1", Content = "随机", IsSelected = true });
            comboBox35.Items.Add(new ComboBoxItem() { Tag = "0", Content = "无(巡逻)" });
            comboBox35.Items.Add(new ComboBoxItem() { Tag = "1", Content = "目标主角" });
            comboBox35.Items.Add(new ComboBoxItem() { Tag = "2", Content = "自由战斗" });
            comboBox35.Items.Add(new ComboBoxItem() { Tag = "3", Content = "小组作战" });
            comboBox35.Items.Add(new ComboBoxItem() { Tag = "4", Content = "门派对阵" });
            tabCanvas0.Children.Add(textBlock43); Canvas.SetLeft(textBlock43, 213); Canvas.SetTop(textBlock43, 233); Canvas.SetZIndex(textBlock43, 3);
            tabCanvas0.Children.Add(comboBox36); Canvas.SetLeft(comboBox36, 251); Canvas.SetTop(comboBox36, 230); Canvas.SetZIndex(comboBox36, 3);
            comboBox36.Items.Add(new ComboBoxItem() { Tag = "-1", Content = "随机" });
            comboBox36.Items.Add(new ComboBoxItem() { Tag = "0", Content = "简单", IsSelected = true });
            comboBox36.Items.Add(new ComboBoxItem() { Tag = "1", Content = "机敏" });
            comboBox36.Items.Add(new ComboBoxItem() { Tag = "2", Content = "固执" });
            comboBox36.Items.Add(new ComboBoxItem() { Tag = "3", Content = "怯懦" });

            tabCanvas0.Children.Add(textBlock46); Canvas.SetLeft(textBlock46, 10); Canvas.SetTop(textBlock46, 259); Canvas.SetZIndex(textBlock46, 3);
            tabCanvas0.Children.Add(slider13); Canvas.SetLeft(slider13, 85); Canvas.SetTop(slider13, 259); Canvas.SetZIndex(slider13, 3);
            slider13.ValueChanged += (s, e) => {
                textBlock47.Text = string.Format("{0}%", (int)slider13.Value);
            };
            tabCanvas0.Children.Add(textBlock47); Canvas.SetLeft(textBlock47, 150); Canvas.SetTop(textBlock47, 259); Canvas.SetZIndex(textBlock47, 3);

            #endregion

            #region 主角部分

            tabCanvas1.Children.Add(textBlock1); Canvas.SetLeft(textBlock1, 10); Canvas.SetTop(textBlock1, 8); Canvas.SetZIndex(textBlock1, 3);
            tabCanvas1.Children.Add(comboBox1); Canvas.SetLeft(comboBox1, 38); Canvas.SetTop(comboBox1, 6); Canvas.SetZIndex(comboBox1, 3);
            comboBox1.Items.Add(new ComboBoxItem() { Tag = "0", Content = "异使" });
            comboBox1.Items.Add(new ComboBoxItem() { Tag = "1", Content = "刺影" });
            comboBox1.Items.Add(new ComboBoxItem() { Tag = "2", Content = "甲士", IsSelected = true });
            comboBox1.Items.Add(new ComboBoxItem() { Tag = "3", Content = "道法" });
            comboBox1.SelectionChanged += (s, e) => {
                leader.Profession = (Professions)Convert.ToInt32(((ComboBoxItem)comboBox1.SelectedItem).Tag);
                switch (leader.Profession) {
                    case Professions.Archer:
                        canvas0.Visibility = Visibility.Visible;
                        canvas1.Visibility = Visibility.Collapsed;
                        canvas2.Visibility = Visibility.Collapsed;
                        canvas3.Visibility = Visibility.Collapsed;
                        comboBox2.SelectedIndex = 1; leader.ArmorCode = 1;
                        comboBox3.SelectedIndex = 1; leader.WeaponCode = 1;
                        comboBox4.SelectedIndex = 0; leader.RideCode = 0;
                        break;
                    case Professions.Assassin:
                        canvas0.Visibility = Visibility.Collapsed;
                        canvas1.Visibility = Visibility.Visible;
                        canvas2.Visibility = Visibility.Collapsed;
                        canvas3.Visibility = Visibility.Collapsed;
                        comboBox5.SelectedIndex = 1; leader.ArmorCode = 5;
                        comboBox6.SelectedIndex = 1; leader.WeaponCode = 5;
                        comboBox7.SelectedIndex = 0; leader.RideCode = 0;
                        break;
                    case Professions.Warrior:
                        canvas0.Visibility = Visibility.Collapsed;
                        canvas1.Visibility = Visibility.Collapsed;
                        canvas2.Visibility = Visibility.Visible;
                        canvas3.Visibility = Visibility.Collapsed;
                        comboBox17.SelectedIndex = 1; leader.ArmorCode = 7;
                        comboBox18.SelectedIndex = 1; leader.WeaponCode = 7;
                        comboBox19.SelectedIndex = 0; leader.RideCode = 0;
                        break;
                    case Professions.Taoist:
                        canvas0.Visibility = Visibility.Collapsed;
                        canvas1.Visibility = Visibility.Collapsed;
                        canvas2.Visibility = Visibility.Collapsed;
                        canvas3.Visibility = Visibility.Visible;
                        comboBox23.SelectedIndex = 1; leader.ArmorCode = 9;
                        comboBox24.SelectedIndex = 1; leader.WeaponCode = 9;
                        comboBox25.SelectedIndex = 0; leader.RideCode = 0;
                        break;
                }
                comboBox0.SelectedIndex = 1;
            };
            tabCanvas1.Children.Add(textBlock0); Canvas.SetLeft(textBlock0, 98); Canvas.SetTop(textBlock0, 8); Canvas.SetZIndex(textBlock0, 3);
            tabCanvas1.Children.Add(comboBox0); Canvas.SetLeft(comboBox0, 126); Canvas.SetTop(comboBox0, 6); Canvas.SetZIndex(comboBox0, 3);
            comboBox0.Items.Add(new ComboBoxItem() { Tag = "0", Content = "打坐", IsSelected = true });
            comboBox0.Items.Add(new ComboBoxItem() { Tag = "1", Content = "步行" });
            comboBox0.Items.Add(new ComboBoxItem() { Tag = "2", Content = "骑乘" });
            comboBox0.SelectionChanged += (s, e) => {
                leader.State = (States)Convert.ToInt32(((ComboBoxItem)comboBox0.SelectedItem).Tag);
            };
            tabCanvas1.Children.Add(button2); Canvas.SetLeft(button2, 183); Canvas.SetTop(button2, 6); Canvas.SetZIndex(button2, 3);
            button2.Click += (s, e) => { leader.Attack(); };
            tabCanvas1.Children.Add(button3); Canvas.SetLeft(button3, 220); Canvas.SetTop(button3, 6); Canvas.SetZIndex(button3, 3);
            button3.Click += (s, e) => { leader.Injure(); };
            tabCanvas1.Children.Add(button4); Canvas.SetLeft(button4, 255); Canvas.SetTop(button4, 6); Canvas.SetZIndex(button4, 3);
            button4.Click += (s, e) => {

                //for (int i = 0; i < ObjectTracker.GetAllLiveTrackedObjects().Count(); i++) {
                //    //MessageBox.Show(ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i).GetType().ToString());
                //    if (ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i) is CreateRole ||
                //        ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i) is LanguageChoicer ||
                //        ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i) is Notice ||
                //        ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i) is SelectRole ||
                //        ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i) is UserLogin ||
                //         ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i) is LoginBackground ||
                //          ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i) is LoginManager ||
                //          ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i) is LoginTip ||
                //          ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i) is Loading ||
                //        ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i) is UserRegist) { MessageBox.Show(ObjectTracker.GetAllLiveTrackedObjects().ElementAt(i).GetType().ToString()); }
                //}
                //调试
                //MessageBox.Show(string.Format("{0}", ObjectTracker.GetAllLiveTrackedObjects().ElementAt(ObjectTracker.GetAllLiveTrackedObjects().Count() - 2).GetType().ToString()));
            };
            tabCanvas1.Children.Add(canvas0); Canvas.SetZIndex(canvas0, 4);
            tabCanvas1.Children.Add(textBlock2); Canvas.SetLeft(textBlock2, 10); Canvas.SetTop(textBlock2, 34); Canvas.SetZIndex(textBlock2, 3);
            canvas0.Children.Add(comboBox2); Canvas.SetLeft(comboBox2, 38); Canvas.SetTop(comboBox2, 32); Canvas.SetZIndex(comboBox2, 3);
            comboBox2.Items.Add(new ComboBoxItem() { Tag = "0", Content = "裸装" });
            comboBox2.Items.Add(new ComboBoxItem() { Tag = "1", Content = "誓珲", IsSelected = true });
            comboBox2.Items.Add(new ComboBoxItem() { Tag = "2", Content = "谟仙" });
            comboBox2.Items.Add(new ComboBoxItem() { Tag = "3", Content = "蓝凌" });
            comboBox2.Items.Add(new ComboBoxItem() { Tag = "4", Content = "释神" });
            comboBox2.SelectionChanged += (s, e) => {
                leader.ArmorCode = Convert.ToInt32(((ComboBoxItem)comboBox2.SelectedItem).Tag);
            };
            tabCanvas1.Children.Add(textBlock3); Canvas.SetLeft(textBlock3, 98); Canvas.SetTop(textBlock3, 34); Canvas.SetZIndex(textBlock3, 3);
            canvas0.Children.Add(comboBox3); Canvas.SetLeft(comboBox3, 126); Canvas.SetTop(comboBox3, 32); Canvas.SetZIndex(comboBox3, 3);
            comboBox3.Items.Add(new ComboBoxItem() { Tag = "0", Content = "空手" });
            comboBox3.Items.Add(new ComboBoxItem() { Tag = "1", Content = "火裂", IsSelected = true });
            comboBox3.Items.Add(new ComboBoxItem() { Tag = "2", Content = "妖月" });
            comboBox3.Items.Add(new ComboBoxItem() { Tag = "3", Content = "冰羽" });
            comboBox3.Items.Add(new ComboBoxItem() { Tag = "4", Content = "圣赤" });
            comboBox3.SelectionChanged += (s, e) => {
                leader.WeaponCode = Convert.ToInt32(((ComboBoxItem)comboBox3.SelectedItem).Tag);
            };
            tabCanvas1.Children.Add(textBlock4); Canvas.SetLeft(textBlock4, 185); Canvas.SetTop(textBlock4, 34); Canvas.SetZIndex(textBlock4, 3);
            canvas0.Children.Add(comboBox4); Canvas.SetLeft(comboBox4, 213); Canvas.SetTop(comboBox4, 32); Canvas.SetZIndex(comboBox4, 3);
            comboBox4.Items.Add(new ComboBoxItem() { Tag = "0", Content = "None" });
            comboBox4.Items.Add(new ComboBoxItem() { Tag = "1", Content = "翎翼", IsSelected = true });
            comboBox4.Items.Add(new ComboBoxItem() { Tag = "2", Content = "幻翼" });
            comboBox4.Items.Add(new ComboBoxItem() { Tag = "3", Content = "圣翼" });
            comboBox4.Items.Add(new ComboBoxItem() { Tag = "4", Content = "灵翼" });
            comboBox4.SelectionChanged += (s, e) => {
                leader.RideCode = Convert.ToInt32(((ComboBoxItem)comboBox4.SelectedItem).Tag);
                if (Convert.ToInt32(((ComboBoxItem)comboBox4.SelectedItem).Tag) == -1) {
                    comboBox0.SelectedIndex = 1;
                } else {
                    comboBox0.SelectedIndex = 2;
                }
            };

            tabCanvas1.Children.Add(canvas1); Canvas.SetZIndex(canvas1, 4);
            canvas1.Children.Add(comboBox5); Canvas.SetLeft(comboBox5, 38); Canvas.SetTop(comboBox5, 32); Canvas.SetZIndex(comboBox5, 3);
            comboBox5.Items.Add(new ComboBoxItem() { Tag = "0", Content = "裸装" });
            comboBox5.Items.Add(new ComboBoxItem() { Tag = "5", Content = "影侯", IsSelected = true });
            comboBox5.Items.Add(new ComboBoxItem() { Tag = "6", Content = "迷烩" });
            comboBox5.SelectionChanged += (s, e) => {
                leader.ArmorCode = Convert.ToInt32(((ComboBoxItem)comboBox5.SelectedItem).Tag);
            };
            canvas1.Children.Add(comboBox6); Canvas.SetLeft(comboBox6, 126); Canvas.SetTop(comboBox6, 32); Canvas.SetZIndex(comboBox6, 3);
            comboBox6.Items.Add(new ComboBoxItem() { Tag = "0", Content = "空手" });
            comboBox6.Items.Add(new ComboBoxItem() { Tag = "5", Content = "琅牙", IsSelected = true });
            comboBox6.Items.Add(new ComboBoxItem() { Tag = "6", Content = "穆灵" });
            comboBox6.SelectionChanged += (s, e) => {
                leader.WeaponCode = Convert.ToInt32(((ComboBoxItem)comboBox6.SelectedItem).Tag);
            };
            canvas1.Children.Add(comboBox7); Canvas.SetLeft(comboBox7, 213); Canvas.SetTop(comboBox7, 32); Canvas.SetZIndex(comboBox7, 3);
            comboBox7.Items.Add(new ComboBoxItem() { Tag = "0", Content = "None" });
            comboBox7.Items.Add(new ComboBoxItem() { Tag = "5", Content = "炯徒", IsSelected = true });
            comboBox7.Items.Add(new ComboBoxItem() { Tag = "6", Content = "釜邢" });
            comboBox7.SelectionChanged += (s, e) => {
                leader.RideCode = Convert.ToInt32(((ComboBoxItem)comboBox7.SelectedItem).Tag);
                if (Convert.ToInt32(((ComboBoxItem)comboBox7.SelectedItem).Tag) == -1) {
                    comboBox0.SelectedIndex = 1;
                } else {
                    comboBox0.SelectedIndex = 2;
                }
            };

            tabCanvas1.Children.Add(canvas2); Canvas.SetZIndex(canvas2, 4);
            canvas2.Children.Add(comboBox17); Canvas.SetLeft(comboBox17, 38); Canvas.SetTop(comboBox17, 32); Canvas.SetZIndex(comboBox17, 3);
            comboBox17.Items.Add(new ComboBoxItem() { Tag = "0", Content = "裸装" });
            comboBox17.Items.Add(new ComboBoxItem() { Tag = "7", Content = "圣甲", IsSelected = true });
            comboBox17.Items.Add(new ComboBoxItem() { Tag = "8", Content = "灭天" });
            comboBox17.SelectionChanged += (s, e) => {
                leader.ArmorCode = Convert.ToInt32(((ComboBoxItem)comboBox17.SelectedItem).Tag);
            };
            canvas2.Children.Add(comboBox18); Canvas.SetLeft(comboBox18, 126); Canvas.SetTop(comboBox18, 32); Canvas.SetZIndex(comboBox18, 3);
            comboBox18.Items.Add(new ComboBoxItem() { Tag = "0", Content = "空手" });
            comboBox18.Items.Add(new ComboBoxItem() { Tag = "7", Content = "雷霆", IsSelected = true });
            comboBox18.Items.Add(new ComboBoxItem() { Tag = "8", Content = "罗刹" });
            comboBox18.SelectionChanged += (s, e) => {
                leader.WeaponCode = Convert.ToInt32(((ComboBoxItem)comboBox18.SelectedItem).Tag);
            };
            canvas2.Children.Add(comboBox19); Canvas.SetLeft(comboBox19, 213); Canvas.SetTop(comboBox19, 32); Canvas.SetZIndex(comboBox19, 3);
            comboBox19.Items.Add(new ComboBoxItem() { Tag = "0", Content = "None" });
            comboBox19.Items.Add(new ComboBoxItem() { Tag = "7", Content = "绝影", IsSelected = true });
            comboBox19.Items.Add(new ComboBoxItem() { Tag = "8", Content = "飞电" });
            comboBox19.SelectionChanged += (s, e) => {
                leader.RideCode = Convert.ToInt32(((ComboBoxItem)comboBox19.SelectedItem).Tag);
                if (Convert.ToInt32(((ComboBoxItem)comboBox19.SelectedItem).Tag) == -1) {
                    comboBox0.SelectedIndex = 1;
                } else {
                    comboBox0.SelectedIndex = 2;
                }
            };

            tabCanvas1.Children.Add(canvas3); Canvas.SetZIndex(canvas3, 4);
            canvas3.Children.Add(comboBox23); Canvas.SetLeft(comboBox23, 38); Canvas.SetTop(comboBox23, 32); Canvas.SetZIndex(comboBox23, 3);
            comboBox23.Items.Add(new ComboBoxItem() { Tag = "0", Content = "裸装" });
            comboBox23.Items.Add(new ComboBoxItem() { Tag = "9", Content = "溢彩", IsSelected = true });
            comboBox23.Items.Add(new ComboBoxItem() { Tag = "10", Content = "焕彩" });
            comboBox23.SelectionChanged += (s, e) => {
                leader.ArmorCode = Convert.ToInt32(((ComboBoxItem)comboBox23.SelectedItem).Tag);
            };
            canvas3.Children.Add(comboBox24); Canvas.SetLeft(comboBox24, 126); Canvas.SetTop(comboBox24, 32); Canvas.SetZIndex(comboBox24, 3);
            comboBox24.Items.Add(new ComboBoxItem() { Tag = "0", Content = "空手" });
            comboBox24.Items.Add(new ComboBoxItem() { Tag = "9", Content = "法珠", IsSelected = true });
            comboBox24.Items.Add(new ComboBoxItem() { Tag = "10", Content = "道珠" });
            comboBox24.SelectionChanged += (s, e) => {
                leader.WeaponCode = Convert.ToInt32(((ComboBoxItem)comboBox24.SelectedItem).Tag);
            };
            canvas3.Children.Add(comboBox25); Canvas.SetLeft(comboBox25, 213); Canvas.SetTop(comboBox25, 32); Canvas.SetZIndex(comboBox25, 3);
            comboBox25.Items.Add(new ComboBoxItem() { Tag = "0", Content = "None" });
            comboBox25.Items.Add(new ComboBoxItem() { Tag = "9", Content = "水馨", IsSelected = true });
            comboBox25.Items.Add(new ComboBoxItem() { Tag = "10", Content = "妃饰" });
            comboBox25.SelectionChanged += (s, e) => {
                leader.RideCode = Convert.ToInt32(((ComboBoxItem)comboBox25.SelectedItem).Tag);
                if (Convert.ToInt32(((ComboBoxItem)comboBox25.SelectedItem).Tag) == -1) {
                    comboBox0.SelectedIndex = 1;
                } else {
                    comboBox0.SelectedIndex = 2;
                }
            };

            tabCanvas1.Children.Add(textBlock20); Canvas.SetLeft(textBlock20, 10); Canvas.SetTop(textBlock20, 60); Canvas.SetZIndex(textBlock20, 3);
            tabCanvas1.Children.Add(comboBox16); Canvas.SetLeft(comboBox16, 38); Canvas.SetTop(comboBox16, 58); Canvas.SetZIndex(comboBox16, 3);
            comboBox16.Items.Add(new ComboBoxItem() { Tag = "-1", Content = "无", IsSelected = true });
            comboBox16.Items.Add(new ComboBoxItem() { Tag = "0", Content = "全身" });
            comboBox16.Items.Add(new ComboBoxItem() { Tag = "1", Content = "铠甲" });
            comboBox16.Items.Add(new ComboBoxItem() { Tag = "2", Content = "武器" });
            comboBox16.SelectionChanged += (s, e) => {
                leader.ActionTrigger -= role_ShowFlowLight;
                int code = Convert.ToInt32(((ComboBoxItem)comboBox16.SelectedItem).Tag);
                if (code == -1) {
                    leader.FlowLight = false;
                } else {
                    flowLightEquipType = (EquipTypes)code;
                    leader.ActionTrigger += role_ShowFlowLight;
                }
            };
            tabCanvas1.Children.Add(textBlock21); Canvas.SetLeft(textBlock21, 98); Canvas.SetTop(textBlock21, 60); Canvas.SetZIndex(textBlock21, 3);
            tabCanvas1.Children.Add(slider6); Canvas.SetLeft(slider6, 126); Canvas.SetTop(slider6, 60); Canvas.SetZIndex(slider6, 3);
            slider6.ValueChanged += (s, e) => {
                byte r, g, b;
                double value = slider6.Value / slider6.Maximum;
                if (value == 0) {
                    r = 255; g = 255; b = 255;
                } else if (value == 1) {
                    r = 0; g = 0; b = 0;
                } else if (value < 0.167) {
                    r = 255; g = 0; b = (byte)(value / 0.167 * 255.00);
                } else if (value >= 0.167 && value < 0.333) {
                    r = (byte)((value - 0.167) / 0.167 * 255.00); g = 0; b = 255;
                } else if (value >= 0.333 && value < 0.5) {
                    r = 255; g = (byte)((value - 0.333) / 0.167 * 255.00); b = 0;
                } else if (value >= 0.5 && value < 0.667) {
                    r = 0; g = 255; b = (byte)((value - 0.5) / 0.167 * 255.00);
                } else if (value >= 0.667 && value < 0.834) {
                    r = (byte)((value - 0.667) / 0.167 * 255.00); g = 255; b = 0;
                } else { r = 0; g = (byte)((value - 0.834) / 0.167 * 255.00); b = 255; }
                flowLightColor = Color.FromArgb(255, r, g, b);
            };
            tabCanvas1.Children.Add(textBlock22); Canvas.SetLeft(textBlock22, 200); Canvas.SetTop(textBlock22, 60); Canvas.SetZIndex(textBlock22, 3);
            tabCanvas1.Children.Add(slider7); Canvas.SetLeft(slider7, 228); Canvas.SetTop(slider7, 60); Canvas.SetZIndex(slider7, 3);
            slider7.ValueChanged += (s, e) => {
                flowLightCoefficient = slider7.Value;
            };

            tabCanvas1.Children.Add(textBlock17); Canvas.SetLeft(textBlock17, 10); Canvas.SetTop(textBlock17, 88); Canvas.SetZIndex(textBlock17, 3);
            tabCanvas1.Children.Add(comboBox15); Canvas.SetLeft(comboBox15, 38); Canvas.SetTop(comboBox15, 86); Canvas.SetZIndex(comboBox15, 3);
            comboBox15.Items.Add(new ComboBoxItem() { Tag = "-1", Content = "无", IsSelected = true });
            comboBox15.Items.Add(new ComboBoxItem() { Tag = "0", Content = "全身" });
            comboBox15.Items.Add(new ComboBoxItem() { Tag = "1", Content = "铠甲" });
            comboBox15.Items.Add(new ComboBoxItem() { Tag = "2", Content = "武器" });
            comboBox15.SelectionChanged += (s, e) => {
                leader.ActionTrigger -= role_ShowChasingShadow;
                int code = Convert.ToInt32(((ComboBoxItem)comboBox15.SelectedItem).Tag);
                if (code != -1) {
                    chasingShadowEquipType = (EquipTypes)code;
                    leader.ActionTrigger += role_ShowChasingShadow;
                }
            };
            tabCanvas1.Children.Add(textBlock18); Canvas.SetLeft(textBlock18, 98); Canvas.SetTop(textBlock18, 88); Canvas.SetZIndex(textBlock18, 3);
            tabCanvas1.Children.Add(slider4); Canvas.SetLeft(slider4, 126); Canvas.SetTop(slider4, 88); Canvas.SetZIndex(slider4, 3);
            slider4.ValueChanged += (s, e) => {
                byte r, g, b;
                double value = slider4.Value / slider4.Maximum;
                if (value == 0) {
                    r = 255; g = 255; b = 255;
                } else if (value == 1) {
                    r = 0; g = 0; b = 0;
                } else if (value < 0.167) {
                    r = 255; g = 0; b = (byte)(value / 0.167 * 255.00);
                } else if (value >= 0.167 && value < 0.333) {
                    r = (byte)((value - 0.167) / 0.167 * 255.00); g = 0; b = 255;
                } else if (value >= 0.333 && value < 0.5) {
                    r = 255; g = (byte)((value - 0.333) / 0.167 * 255.00); b = 0;
                } else if (value >= 0.5 && value < 0.667) {
                    r = 0; g = 255; b = (byte)((value - 0.5) / 0.167 * 255.00);
                } else if (value >= 0.667 && value < 0.834) {
                    r = (byte)((value - 0.667) / 0.167 * 255.00); g = 255; b = 0;
                } else { r = 0; g = (byte)((value - 0.834) / 0.167 * 255.00); b = 255; }
                chasingShadowColor = Color.FromArgb(255, r, g, b);
            };
            tabCanvas1.Children.Add(textBlock19); Canvas.SetLeft(textBlock19, 200); Canvas.SetTop(textBlock19, 88); Canvas.SetZIndex(textBlock19, 3);
            tabCanvas1.Children.Add(slider5); Canvas.SetLeft(slider5, 228); Canvas.SetTop(slider5, 88); Canvas.SetZIndex(slider5, 3);
            slider5.ValueChanged += (s, e) => {
                chasingShadowCoefficient = slider5.Value;
            };

            tabCanvas1.Children.Add(textBlock31); Canvas.SetLeft(textBlock31, 10); Canvas.SetTop(textBlock31, 114); Canvas.SetZIndex(textBlock31, 3);
            tabCanvas1.Children.Add(comboBox28); Canvas.SetLeft(comboBox28, 38); Canvas.SetTop(comboBox28, 112); Canvas.SetZIndex(comboBox28, 3);
            comboBox28.Items.Add(new ComboBoxItem() { Tag = "0", Content = "全身" });
            comboBox28.Items.Add(new ComboBoxItem() { Tag = "1", Content = "铠甲" });
            comboBox28.Items.Add(new ComboBoxItem() { Tag = "2", Content = "武器", IsSelected = true });
            comboBox28.SelectionChanged += (s, e) => {
                windParticleEquipType = (EquipTypes)(Convert.ToInt32(((ComboBoxItem)comboBox28.SelectedItem).Tag));
                //测试副本用
                leader.DisplayWeaponParticle = (comboBox28.SelectedIndex == 2 && comboBox27.SelectedIndex == 2) ? true : false;
            };
            tabCanvas1.Children.Add(comboBox27); Canvas.SetLeft(comboBox27, 98); Canvas.SetTop(comboBox27, 112); Canvas.SetZIndex(comboBox27, 3);
            comboBox27.Items.Add(new ComboBoxItem() { Tag = "-1", Content = "无", IsSelected = true });
            comboBox27.Items.Add(new ComboBoxItem() { Tag = "0", Content = "标准" });
            comboBox27.Items.Add(new ComboBoxItem() { Tag = "1", Content = "烟火" });
            comboBox27.Items.Add(new ComboBoxItem() { Tag = "2", Content = "冰晶" });
            comboBox27.Items.Add(new ComboBoxItem() { Tag = "3", Content = "花雾" });
            comboBox27.Items.Add(new ComboBoxItem() { Tag = "4", Content = "星状" });
            comboBox27.Items.Add(new ComboBoxItem() { Tag = "5", Content = "光状" });
            comboBox27.Items.Add(new ComboBoxItem() { Tag = "6", Content = "球状" });
            comboBox27.Items.Add(new ComboBoxItem() { Tag = "7", Content = "闪光" });
            comboBox27.SelectionChanged += (s, e) => {
                leader.ActionTrigger -= role_ShowWindParticles;
                int code = Convert.ToInt32(((ComboBoxItem)comboBox27.SelectedItem).Tag);
                if (code != -1) {
                    windParticleType = (ParticleTypes)code;
                    leader.ActionTrigger += role_ShowWindParticles;
                }
                //测试副本用
                leader.DisplayWeaponParticle = (comboBox28.SelectedIndex == 2 && comboBox27.SelectedIndex == 2) ? true : false;
            };
            tabCanvas1.Children.Add(textBlock32); Canvas.SetLeft(textBlock32, 155); Canvas.SetTop(textBlock32, 114); Canvas.SetZIndex(textBlock32, 3);
            tabCanvas1.Children.Add(slider11); Canvas.SetLeft(slider11, 179); Canvas.SetTop(slider11, 114); Canvas.SetZIndex(slider11, 3);
            slider11.ValueChanged += (s, e) => {
                windParticleColor = slider11.Value;
            };
            tabCanvas1.Children.Add(textBlock33); Canvas.SetLeft(textBlock33, 233); Canvas.SetTop(textBlock33, 114); Canvas.SetZIndex(textBlock33, 3);
            tabCanvas1.Children.Add(slider12); Canvas.SetLeft(slider12, 247); Canvas.SetTop(slider12, 114); Canvas.SetZIndex(slider12, 3);
            slider12.ValueChanged += (s, e) => {
                windParticleCoefficient = slider12.Value;
            };

            tabCanvas1.Children.Add(textBlock12); Canvas.SetLeft(textBlock12, 10); Canvas.SetTop(textBlock12, 140); Canvas.SetZIndex(textBlock12, 3);
            tabCanvas1.Children.Add(comboBox12); Canvas.SetLeft(comboBox12, 58); Canvas.SetTop(comboBox12, 138); Canvas.SetZIndex(comboBox12, 3);
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "-1", Content = "无", IsSelected = true });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "17", Content = "王者之盾" });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "18", Content = "炎之魄" });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "19", Content = "冰护身" });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "20", Content = "道光法寰" });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "21", Content = "星环" });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "22", Content = "神之盾" });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "23", Content = "宇宙之光" });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "28", Content = "仙环石" });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "46", Content = "金圆咒印" });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "47", Content = "雷神护体" });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "48", Content = "火之怒" });
            comboBox12.Items.Add(new ComboBoxItem() { Tag = "49", Content = "金龙修身" });
            comboBox12.SelectionChanged += (s, e) => {
                int code = Convert.ToInt32(((ComboBoxItem)comboBox12.SelectedItem).Tag);
                if (code == -1) {
                    leader.RemoveEffect(EffectTypes.Surround);
                } else {
                    EventHandler handler = null;
                    AnimationBase animation = new AnimationBase() {
                        Code = Convert.ToInt32(((ComboBoxItem)comboBox12.SelectedItem).Tag),
                        Position = leader.Center,
                        Loop = true,
                        Z = 999,
                    };
                    animation.Disposed += handler = (s0, e0) => {
                        animation.Disposed -= handler;
                        leader.RemoveEffect(EffectTypes.Surround);
                    };
                    leader.AddEffect(animation, EffectTypes.Surround);
                }
            };
            tabCanvas1.Children.Add(textBlock13); Canvas.SetLeft(textBlock13, 136); Canvas.SetTop(textBlock13, 140); Canvas.SetZIndex(textBlock13, 3);
            tabCanvas1.Children.Add(slider2); Canvas.SetLeft(slider2, 163); Canvas.SetTop(slider2, 140); Canvas.SetZIndex(slider2, 3);
            slider2.ValueChanged += (s, e) => {
                leader.ShiftEffectColor(EffectTypes.Surround, slider2.Value);
            };
            tabCanvas1.Children.Add(textBlock14); Canvas.SetLeft(textBlock14, 10); Canvas.SetTop(textBlock14, 166); Canvas.SetZIndex(textBlock14, 3);
            tabCanvas1.Children.Add(comboBox13); Canvas.SetLeft(comboBox13, 58); Canvas.SetTop(comboBox13, 164); Canvas.SetZIndex(comboBox13, 3);
            comboBox13.Items.Add(new ComboBoxItem() { Tag = "-1", Content = "无", IsSelected = true });
            comboBox13.Items.Add(new ComboBoxItem() { Tag = "24", Content = "佛光" });
            comboBox13.Items.Add(new ComboBoxItem() { Tag = "25", Content = "道光" });
            comboBox13.Items.Add(new ComboBoxItem() { Tag = "26", Content = "轮回" });
            comboBox13.Items.Add(new ComboBoxItem() { Tag = "45", Content = "蓝光" });
            comboBox13.SelectionChanged += (s, e) => {
                int code = Convert.ToInt32(((ComboBoxItem)comboBox13.SelectedItem).Tag);
                if (code == -1) {
                    leader.RemoveEffect(EffectTypes.Bottom);
                } else {
                    EventHandler handler = null;
                    AnimationBase animation = new AnimationBase() {
                        Code = Convert.ToInt32(((ComboBoxItem)comboBox13.SelectedItem).Tag),
                        Position = leader.Center,
                        Z = -1,
                        Loop = true
                    };
                    animation.Disposed += handler = (s0, e0) => {
                        animation.Disposed -= handler;
                        leader.RemoveEffect(EffectTypes.Bottom);
                    };
                    leader.AddEffect(animation, EffectTypes.Bottom);
                }
            };
            tabCanvas1.Children.Add(textBlock15); Canvas.SetLeft(textBlock15, 136); Canvas.SetTop(textBlock15, 166); Canvas.SetZIndex(textBlock15, 3);
            tabCanvas1.Children.Add(slider3); Canvas.SetLeft(slider3, 163); Canvas.SetTop(slider3, 166); Canvas.SetZIndex(slider3, 3);
            slider3.ValueChanged += (s, e) => {
                leader.ShiftEffectColor(EffectTypes.Bottom, slider3.Value);
            };

            tabCanvas1.Children.Add(textBlock23); Canvas.SetLeft(textBlock23, 10); Canvas.SetTop(textBlock23, 194); Canvas.SetZIndex(textBlock23, 3);
            tabCanvas1.Children.Add(comboBox20); Canvas.SetLeft(comboBox20, 38); Canvas.SetTop(comboBox20, 192); Canvas.SetZIndex(comboBox20, 3);
            comboBox20.Items.Add(new ComboBoxItem() { Tag = "0", Content = "无", IsSelected = true });
            comboBox20.Items.Add(new ComboBoxItem() { Tag = "1", Content = "幻降" });
            comboBox20.Items.Add(new ComboBoxItem() { Tag = "2", Content = "影合" });
            comboBox20.Items.Add(new ComboBoxItem() { Tag = "3", Content = "新生" });
            comboBox20.Items.Add(new ComboBoxItem() { Tag = "4", Content = "残像" });
            comboBox20.Items.Add(new ComboBoxItem() { Tag = "5", Content = "波动" });
            comboBox20.SelectionChanged += (s, e) => {
                switch (Convert.ToInt32(((ComboBoxItem)comboBox20.SelectedItem).Tag)) {
                    case 0:
                        leader.EquipEntity(EquipTypes.Overall).Effect = null;
                        break;
                    case 1:
                        GlobalMethod.RunEffectAnimation(leader.EquipEntity(EquipTypes.Overall), new DirectionalBlur() { Angle = 90 }, false, false, "BlurAmount", -0.02, 0, TimeSpan.FromMilliseconds(400), null, true);
                        break;
                    case 2:
                        GlobalMethod.RunEffectAnimation(leader.EquipEntity(EquipTypes.Overall), new GrowablePoissonDisk() { InputSize = new Size(10, 50) }, false, false, "DiskRadius", -15, 0, TimeSpan.FromMilliseconds(500), new ExponentialEase() { EasingMode = EasingMode.EaseOut }, true);
                        break;
                    case 3:
                        GlobalMethod.RunEffectAnimation(leader.EquipEntity(EquipTypes.Overall), new CircleReveal() { FuzzyAmount = 0.1, CircleSize = 1, CenterPoint = new Point(0.5, 1), Texture2 = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/OpacityRect.png", UriType.Project) } }, false, false, "Progress", 30, 100, TimeSpan.FromMilliseconds(1500), null, true);
                        break;
                    case 4:
                        GlobalMethod.RunEffectAnimation(leader.EquipEntity(EquipTypes.Overall), new Blinds() { NumberOfBlinds = 30, Texture2 = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/OpacityRect.png", UriType.Project) } }, false, false, "Progress", 0, 100, TimeSpan.FromMilliseconds(600), null, true);
                        break;
                    case 5:
                        GlobalMethod.RunEffectAnimation(leader.EquipEntity(EquipTypes.Overall), new Ripple(), false, false, "Progress", 180, 100, TimeSpan.FromMilliseconds(600), null, true);
                        break;
                }
            };

            tabCanvas1.Children.Add(textBlock27); Canvas.SetLeft(textBlock27, 98); Canvas.SetTop(textBlock27, 194); Canvas.SetZIndex(textBlock27, 3);
            tabCanvas1.Children.Add(slider9); Canvas.SetLeft(slider9, 126); Canvas.SetTop(slider9, 194); Canvas.SetZIndex(slider9, 3);
            slider9.ValueChanged += (s, e) => {
                //leader.ShiftEffectColor(EffectTypes.Bottom, slider9.Value);
                double value = Math.Round(slider9.Value, 2);
                textBlock28.Text = value.ToString();
                leader.Scale = slider9.Value;
                space.SetShadowScale(leader, value > 1 ? slider8.Value : 1);
            };
            tabCanvas1.Children.Add(textBlock28); Canvas.SetLeft(textBlock28, 200); Canvas.SetTop(textBlock28, 194); Canvas.SetZIndex(textBlock28, 3);
            tabCanvas1.Children.Add(comboBox22); Canvas.SetLeft(comboBox22, 240); Canvas.SetTop(comboBox22, 192); Canvas.SetZIndex(comboBox22, 3);
            comboBox22.Items.Add(new ComboBoxItem() { Tag = "0", Content = "地面", IsSelected = true });
            comboBox22.Items.Add(new ComboBoxItem() { Tag = "1", Content = "空中" });
            comboBox22.SelectionChanged += (s, e) => {
                switch (leader.SpaceLayer = (SpaceLayers)Convert.ToInt32(((ComboBoxItem)comboBox22.SelectedItem).Tag)) {
                    case SpaceLayers.Ground:
                        space.Scale = 1;
                        slider8.Value = 0.7;
                        slider9.Value = 1;
                        //space.RemoveCloudLayer();
                        break;
                    case SpaceLayers.Sky:
                        space.Scale = 0.4;
                        slider8.Value = 0.4;
                        slider9.Value = 2.4;
                        comboBox11.SelectedIndex = 5;
                        //space.AddCloudLayer(); //性能方面需要考量
                        break;
                }
                space.SetRoleVisibleTo(leader);
                space.SetAnimationVisibleTo(leader);
                space.SetMaskVisibleTo(leader);
                space.EndEasingMapTo(leader.Position);
            };

            tabCanvas1.Children.Add(textBlock45); Canvas.SetLeft(textBlock45, 10); Canvas.SetTop(textBlock45, 220); Canvas.SetZIndex(textBlock45, 3);
            tabCanvas1.Children.Add(comboBox38); Canvas.SetLeft(comboBox38, 60); Canvas.SetTop(comboBox38, 218); Canvas.SetZIndex(comboBox38, 3);
            comboBox38.Items.Add(new ComboBoxItem() { Tag = "1", Content = "1级" });
            comboBox38.Items.Add(new ComboBoxItem() { Tag = "2", Content = "2级" });
            comboBox38.Items.Add(new ComboBoxItem() { Tag = "3", Content = "3级" });
            comboBox38.Items.Add(new ComboBoxItem() { Tag = "4", Content = "4级" });
            comboBox38.Items.Add(new ComboBoxItem() { Tag = "5", Content = "5级" });
            comboBox38.Items.Add(new ComboBoxItem() { Tag = "6", Content = "6级" });
            comboBox38.Items.Add(new ComboBoxItem() { Tag = "7", Content = "7级" });
            comboBox38.Items.Add(new ComboBoxItem() { Tag = "8", Content = "8级" });
            comboBox38.Items.Add(new ComboBoxItem() { Tag = "9", Content = "9级" });
            comboBox38.SelectionChanged += (s, e) => {
                leader.CurrentMagic.Level = Convert.ToInt32(((ComboBoxItem)comboBox38.SelectedItem).Tag);
            };

            tabCanvas1.Children.Add(comboBox39); Canvas.SetLeft(comboBox39, 112); Canvas.SetTop(comboBox39, 218); Canvas.SetZIndex(comboBox39, 3);
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "0", Content = "圆月斩(群体/圆环/弹开/麻痹)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "1", Content = "旋风斩(群体/持续伤害/颤栗)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "2", Content = "冰龙斩(单体/圆形/冰冻)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "3", Content = "地裂斩(群体/圆形/伤/燃烧)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "4", Content = "烈焰喷射(群体/直线波段/燃烧)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "5", Content = "冰魄轰炸(群体/多段圆环/冰冻)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "6", Content = "灭天雷(群体/圆形/麻痹)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "7", Content = "陨石坠落(群体/圆形/燃烧)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "8", Content = "幽冥夜火(群体/持续伤害/燃烧)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "9", Content = "连环闪电(单体+N次连环/电伤)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "10", Content = "火焰飞射(单体/灼烧)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "11", Content = "雷鸣箭(单体+N次连锁/麻痹)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "12", Content = "石封箭(群体/扇形/石化)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "13", Content = "冰咆哮(群体/波浪圆环/冰冻)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "14", Content = "毒雨箭(群体/扇形/毒化)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "15", Content = "轰雷斩(群体/圆形/麻痹)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "16", Content = "毒刃突刺(群体/圆环/毒化)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "17", Content = "电流辐射(单体+N次辐射/击退)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "18", Content = "魔神加护(单体/魔法加护)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "20", Content = "治愈之光(单体/魔法治愈)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "21", Content = "治愈之风(群体/魔法治愈)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "22", Content = "野蛮冲撞(群体/穿梭/多段击飞)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "23", Content = "召唤魔神(召唤辅助)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "24", Content = "召唤战神(召唤辅助)" });
            comboBox39.Items.Add(new ComboBoxItem() { Tag = "25", Content = "雷鸣斩(群体/圆环/弹开/麻痹)" });
            comboBox39.SelectionChanged += (s, e) => {
                leader.CurrentMagic.Code = Convert.ToInt32(((ComboBoxItem)comboBox39.SelectedItem).Tag);
            };

            tabCanvas1.Children.Add(button7); Canvas.SetLeft(button7, 10); Canvas.SetTop(button7, 244); Canvas.SetZIndex(button7, 3);
            button7.Click += delegate {
                if (instance != null) {
                    int x = (int)leader.Coordinate.X;
                    int y = (int)leader.Coordinate.Y;
                    if ((x >= 57 && x <= 61) && (y >= 58 && y <= 62) && leader.State == States.Riding && instance is HuntingSpiderKind) {
                        instance.TriggerOrgan[8] = true;
                    } else {
                        ShowTipText((instance is HuntingSpiderKind && ((HuntingSpiderKind)instance).Step == Components.Instance.HuntingSpiderKind.Steps.骑上马并移动到59_60附近开启封印) ? "开启条件不满足" : "当前场合无法使用");
                    }
                }
            };

            tabCanvas1.Children.Add(button8); Canvas.SetLeft(button8, 65); Canvas.SetTop(button8, 244); Canvas.SetZIndex(button8, 3);
            button8.Click += delegate {
                if (instance != null) {
                    int x = (int)leader.Coordinate.X;
                    int y = (int)leader.Coordinate.Y;
                    if (instance is GodFam && ((GodFam)instance).Step == Components.Instance.GodFam.Steps.于4个坐标处放置祭旗) {
                        if (x == 38 && y == 41) {
                            if (instance.TriggerOrgan[0]) {
                                ShowTipText("该坐标祭旗已放置,无需重复操作");
                            } else {
                                instance.TriggerOrgan[0] = true;
                                space.AddAnimation(new AnimationBase() {
                                    ID = 0,
                                    Code = 83,
                                    Position = new Point(-82, 1193),
                                    Z = 1193,
                                    Tip = "祭旗",
                                    Loop = true,
                                });
                            }
                        } else if (x == 47 && y == 41) {
                            if (instance.TriggerOrgan[1]) {
                                ShowTipText("该坐标祭旗已放置,无需重复操作");
                            } else {
                                instance.TriggerOrgan[1] = true;
                                space.AddAnimation(new AnimationBase() {
                                    ID = 0,
                                    Code = 83,
                                    Position = new Point(177, 1334),
                                    Z = 1334,
                                    Tip = "祭旗",
                                    Loop = true,
                                });
                            }
                        } else if (x == 47 && y == 31) {
                            if (instance.TriggerOrgan[2]) {
                                ShowTipText("该坐标祭旗已放置,无需重复操作");
                            } else {
                                instance.TriggerOrgan[2] = true;
                                space.AddAnimation(new AnimationBase() {
                                    ID = 0,
                                    Code = 83,
                                    Position = new Point(418, 1179),
                                    Z = 1179,
                                    Tip = "祭旗",
                                    Loop = true,
                                });
                            }
                        } else if (x == 36 && y == 31) {
                            if (instance.TriggerOrgan[3]) {
                                ShowTipText("该坐标祭旗已放置,无需重复操作");
                            } else {
                                instance.TriggerOrgan[3] = true;
                                space.AddAnimation(new AnimationBase() {
                                    ID = 0,
                                    Code = 83,
                                    Position = new Point(134, 1025),
                                    Z = 1025,
                                    Tip = "祭旗",
                                    Loop = true,
                                });
                            }
                        } else {
                            ShowTipText("放置位置不正确");
                        }
                    } else {
                        ShowTipText((instance is GodFam && ((GodFam)instance).Step == Components.Instance.GodFam.Steps.于4个坐标处放置祭旗) ? "位置不正确" : "当前场合无法使用");
                    }
                }
            };

            tabCanvas1.Children.Add(button9); Canvas.SetLeft(button9, 120); Canvas.SetTop(button9, 244); Canvas.SetZIndex(button9, 3);
            button9.Click += delegate {
                if (instance != null) {
                    int x = (int)leader.Coordinate.X;
                    int y = (int)leader.Coordinate.Y;
                    if ((x >= 41 && x <= 45) && (y >= 33 && y <= 37) && instance is GodFam && ((GodFam)instance).Step == Components.Instance.GodFam.Steps.召唤王者英灵) {
                        if (instance.TriggerOrgan[4]) {
                            ShowTipText("王者英灵已被成功召唤,无需重复操作");
                        } else {
                            instance.TriggerOrgan[4] = true;
                        }
                    } else {
                        ShowTipText((instance is GodFam && ((GodFam)instance).Step == Components.Instance.GodFam.Steps.召唤王者英灵) ? "召唤位置不正确" : "当前场合无法使用");
                    }
                }
            };

            #endregion

            #region 其他部分

            tabCanvas2.Children.Add(textBlock24); Canvas.SetLeft(textBlock24, 10); Canvas.SetTop(textBlock24, 6); Canvas.SetZIndex(textBlock24, 3);
            tabCanvas2.Children.Add(comboBox21); Canvas.SetLeft(comboBox21, 36); Canvas.SetTop(comboBox21, 4); Canvas.SetZIndex(comboBox21, 3);
            comboBox21.Items.Add(new ComboBoxItem() { Tag = "false", Content = "OFF" });
            comboBox21.Items.Add(new ComboBoxItem() { Tag = "true", Content = "ON", IsSelected = true });
            comboBox21.SelectionChanged += (s, e) => {
                space.MusicEnabled = Convert.ToBoolean(((ComboBoxItem)comboBox21.SelectedItem).Tag);
            };
            tabCanvas2.Children.Add(slider10); Canvas.SetLeft(slider10, 86); Canvas.SetTop(slider10, 6); Canvas.SetZIndex(slider10, 3);
            slider10.ValueChanged += (s, e) => {
                space.MusicVolume = slider10.Value;
                textBlock29.Text = Math.Round(slider10.Value, 2).ToString();
            };
            tabCanvas2.Children.Add(textBlock29); Canvas.SetLeft(textBlock29, 139); Canvas.SetTop(textBlock29, 6); Canvas.SetZIndex(textBlock29, 3);

            tabCanvas2.Children.Add(textBlock53); Canvas.SetLeft(textBlock53, 170); Canvas.SetTop(textBlock53, 6); Canvas.SetZIndex(textBlock53, 3);
            tabCanvas2.Children.Add(textBlock54); Canvas.SetLeft(textBlock54, 219); Canvas.SetTop(textBlock54, 6); Canvas.SetZIndex(textBlock54, 3);
            tabCanvas2.Children.Add(textBlock55); Canvas.SetLeft(textBlock55, 295); Canvas.SetTop(textBlock55, 6); Canvas.SetZIndex(textBlock55, 3);
            tabCanvas2.Children.Add(slider14); Canvas.SetLeft(slider14, 232); Canvas.SetTop(slider14, 6); Canvas.SetZIndex(slider14, 3);
            slider14.ValueChanged += (s, e) => {
                dramaDialogue.DialogSpeed = (int)slider14.Value;
            };

            tabCanvas2.Children.Add(textBlock56); Canvas.SetLeft(textBlock56, 10); Canvas.SetTop(textBlock56, 28); Canvas.SetZIndex(textBlock56, 3);
            tabCanvas2.Children.Add(textBlock57); Canvas.SetLeft(textBlock57, 242); Canvas.SetTop(textBlock57, 28); Canvas.SetZIndex(textBlock57, 3);
            tabCanvas2.Children.Add(slider15); Canvas.SetLeft(slider15, 140); Canvas.SetTop(slider15, 28); Canvas.SetZIndex(slider15, 3);
            slider15.ValueChanged += (s, e) => {
                ParallelDownloader.MaximumLimit = (int)slider15.Value;
                textBlock57.Text = ParallelDownloader.MaximumLimit.ToString();
            };

            //分割线
            Image image1 = new Image() { Source = GlobalMethod.GetImage("UI/CustomMagicPath.png", UriType.Project) };
            tabCanvas2.Children.Add(image1); Canvas.SetLeft(image1, 0); Canvas.SetTop(image1, 52); Canvas.SetZIndex(image1, 3);

            //绘制网格背景
            PathAnimationPainter[] pathAnimationPainter = new PathAnimationPainter[5];
            //切换卡
            ItemCard[] cards = new ItemCard[pathAnimationPainter.Count()];
            for (int i = 0; i < cards.Count(); i++) {
                pathAnimationPainter[i] = new PathAnimationPainter();
                tabCanvas2.Children.Add(pathAnimationPainter[i]);
                pathAnimationPainter[i].Position = new Point(10, 76);
                cards[i] = new ItemCard() { Text = (i + 1).ToString() };
                tabCanvas2.Children.Add(cards[i]);
                cards[i].Position = new Point(10 + i * 16, 66);
                cards[i].Z = 4;
                cards[i].MouseLeftButtonDown += (s,e)=> {
                    ItemCard card = s as ItemCard;
                    for (int j = 0; j < cards.Count(); j++) {
                        cards[j].IsSelected = pathAnimationPainter[j].IsSelected = cards[j] == card ? true : false;
                    }
                    e.Handled = true;
                };
            }
            cards[0].IsSelected = true;
            pathAnimationPainter[0].IsSelected = true;
            pathAnimationPainter[0].Color = Colors.White;
            pathAnimationPainter[1].Color = Colors.Yellow;
            pathAnimationPainter[2].Color = Colors.Red;
            pathAnimationPainter[3].Color = Colors.Cyan;
            pathAnimationPainter[4].Color = Colors.Orange;

            tabCanvas2.Children.Add(button10); Canvas.SetLeft(button10, 190); Canvas.SetTop(button10, 265); Canvas.SetZIndex(button10, 3);
            button10.Click += delegate {
                for (int i = 0; i < pathAnimationPainter.Count(); i++) {
                    pathAnimationPainter[i].Clear();
                }
            };
            tabCanvas2.Children.Add(button11); Canvas.SetLeft(button11, 246); Canvas.SetTop(button11, 265); Canvas.SetZIndex(button11, 3);
            button11.Click += delegate {
                for (int n = 0; n < pathAnimationPainter.Count(); n++) {
                    if (pathAnimationPainter[n].Path.Count> 1) {
                        Bullet bullet = new Bullet(new BulletDatas() { Code = pathAnimationPainter[n].AnimationCode, Loop = true, Type = BulletTypes.Animation }) { Z = 100 };
                        bullet.Center = bullet.Offset;
                        tabCanvas2.Children.Add(bullet);
                        Storyboard storyboard = new Storyboard();
                        PointAnimationUsingKeyFrames pointAnimationUsingKeyFrames = new PointAnimationUsingKeyFrames();
                        Storyboard.SetTarget(pointAnimationUsingKeyFrames, bullet);
                        Storyboard.SetTargetProperty(pointAnimationUsingKeyFrames, new PropertyPath("Position"));
                        DoubleAnimationUsingKeyFrames doubleAnimationUsingKeyFrames = new DoubleAnimationUsingKeyFrames();
                        Storyboard.SetTarget(doubleAnimationUsingKeyFrames, bullet);
                        Storyboard.SetTargetProperty(doubleAnimationUsingKeyFrames, new PropertyPath("Angle"));
                        double speed = pathAnimationPainter[n].Rate;
                        double a = 0.002; //加速系数
                        double timeSpanTemp = 0;
                        double durationTemp = 0;
                        double angleTemp = 0;
                        int circle = 0;
                        if (pathAnimationPainter[n].Easing == 2) {  //加速逆行即减速
                            for (int i = 0; i < pathAnimationPainter[n].Path.Count; i++)
                            { speed += a * i; }
                        }
                        for (int i = 0; i < pathAnimationPainter[n].Path.Count; i++) {
                            TimeSpan timeSpan = new TimeSpan();
                            Point lastPath = (i == 0 ? pathAnimationPainter[n].Path[0] : pathAnimationPainter[n].Path[i - 1]);
                            Point nowPath = pathAnimationPainter[n].Path[i];
                            Point nextPath = (i == pathAnimationPainter[n].Path.Count - 1 ? pathAnimationPainter[n].Path[pathAnimationPainter[n].Path.Count - 1] : pathAnimationPainter[n].Path[i + 1]);
                            switch (pathAnimationPainter[n].Easing) {
                                case 0:
                                    timeSpanTemp = GlobalMethod.GetDistance(lastPath, nowPath) / speed;
                                    durationTemp += timeSpanTemp;
                                    timeSpan = TimeSpan.FromMilliseconds(durationTemp);
                                    break;
                                case 1:
                                    speed += a * i;
                                    timeSpanTemp = GlobalMethod.GetDistance(lastPath, nowPath) / speed;
                                    durationTemp += timeSpanTemp;
                                    timeSpan = TimeSpan.FromMilliseconds(durationTemp);
                                    break;
                                case 2:
                                    speed -= a * (pathAnimationPainter[n].Path.Count - 1 - i);
                                    timeSpanTemp = GlobalMethod.GetDistance(lastPath, nowPath) / speed;
                                    durationTemp += timeSpanTemp;
                                    timeSpan = TimeSpan.FromMilliseconds(durationTemp);
                                    break;
                            }
                            pointAnimationUsingKeyFrames.KeyFrames.Add(
                                new LinearPointKeyFrame() {
                                    KeyTime = KeyTime.FromTimeSpan(timeSpan),
                                    Value = new Point() { X = nowPath.X * pathAnimationPainter[n].Proportion, Y = nowPath.Y * pathAnimationPainter[n].Proportion }
                                }
                            );
                            double angle = GlobalMethod.GetAngle(nowPath.Y - lastPath.Y, nowPath.X - lastPath.X) + 360 * circle;
                            //check大于0为顺时针个方向
                            double check = (nowPath.X - lastPath.X) * (nextPath.Y - nowPath.Y) - (nowPath.Y - lastPath.Y) * (nextPath.X - nowPath.X);
                            if (check > 0) {
                                if (angleTemp > 360 * circle && angle < 360 * circle) { angle += 360; } else if (angleTemp > 360 * circle + 180 && angle < angleTemp) { angle += 360; circle++; }
                            } else {
                                if (angleTemp < 360 * circle && angle > 360 * circle) { angle -= 360; } else if (angleTemp < 360 * circle - 180 && angle > angleTemp) { angle -= 360; circle--; }
                            }
                            angleTemp = angle; //用于旋转时的角度衔接
                            doubleAnimationUsingKeyFrames.KeyFrames.Add(
                                new LinearDoubleKeyFrame() {
                                    KeyTime = KeyTime.FromTimeSpan(timeSpan),
                                    Value = angle
                                }
                            );
                        }
                        pointAnimationUsingKeyFrames.Duration = new Duration(TimeSpan.FromMilliseconds(durationTemp));
                        storyboard.Children.Add(pointAnimationUsingKeyFrames);
                        if (pathAnimationPainter[n].Direction == 0) { storyboard.Children.Add(doubleAnimationUsingKeyFrames); }
                        EventHandler handler = null;
                        storyboard.Completed += handler = delegate {
                            storyboard.Completed -= handler;
                            tabCanvas2.Children.Remove(bullet);
                            bullet.Move_Completed(bullet, null);
                        };
                        storyboard.Begin();
                    }
                }
            };

            #endregion

            #region 子部分

            tabCanvas0.Children.Add(childCanvas0); Canvas.SetLeft(childCanvas0, 310); Canvas.SetTop(childCanvas0, 0); Canvas.SetZIndex(childCanvas0, 3);
            childCanvas0.Children.Add(textBlock48); Canvas.SetLeft(textBlock48, 6); Canvas.SetTop(textBlock48, 6); Canvas.SetZIndex(textBlock48, 3);
            childCanvas0.Children.Add(textBlock51); Canvas.SetLeft(textBlock51, 6); Canvas.SetTop(textBlock51, 26); Canvas.SetZIndex(textBlock51, 3);
            childCanvas0.Children.Add(textBlock52); Canvas.SetLeft(textBlock52, 6); Canvas.SetTop(textBlock52, 46); Canvas.SetZIndex(textBlock52, 3);
            childCanvas0.Children.Add(textBlock49); Canvas.SetLeft(textBlock49, 6); Canvas.SetTop(textBlock49, 66); Canvas.SetZIndex(textBlock49, 3);
            childCanvas0.Children.Add(rectangle0); Canvas.SetLeft(rectangle0, 60); Canvas.SetTop(rectangle0, 70); Canvas.SetZIndex(rectangle0, 3);
            childCanvas0.Children.Add(listBox0); Canvas.SetLeft(listBox0, 6); Canvas.SetTop(listBox0, 86); Canvas.SetZIndex(listBox0, 3);
            childCanvas0.Children.Add(textBlock50); Canvas.SetLeft(textBlock50, 6); Canvas.SetTop(textBlock50, 106); Canvas.SetZIndex(textBlock50, 3);
            childCanvas0.Children.Add(rectangle1); Canvas.SetLeft(rectangle1, 60); Canvas.SetTop(rectangle1, 110); Canvas.SetZIndex(rectangle1, 3);
            childCanvas0.Children.Add(listBox1); Canvas.SetLeft(listBox1, 6); Canvas.SetTop(listBox1, 126); Canvas.SetZIndex(listBox1, 3);

            #endregion
        }