Ejemplo n.º 1
0
 void CreateSubMagic(RoleBase caster, Space space, MagicArgs args, int index)
 {
     AnimationBase animation = new AnimationBase() { Code = args.ResCode,  Z = targets[index].Z + 1, Effect = shiftHue };
     double offsetStartY = (caster.State == States.Riding ? (caster.Profession == Professions.Taoist ? 130 : 110) : 60) * caster.Scale;
     double offsetEndY = (targets[index].State == States.Riding ? 100 : 50) * caster.Scale;
     Point from = index == 0 ? new Point(args.Position.X, args.Position.Y - offsetStartY) : temp;
     Point to = new Point(targets[index].Position.X, targets[index].Position.Y - offsetEndY);
     temp = to;
     RotateTransform rotateTransform = new RotateTransform() {
         CenterX = animation.Center.X,
         CenterY = animation.Center.Y,
         Angle = GlobalMethod.GetAngle(to.Y - from.Y, to.X - from.X)
     };
     ScaleTransform scaleTransform = new ScaleTransform() {
         CenterX = animation.Center.X,
         CenterY = animation.Center.Y,
         ScaleX = (GlobalMethod.GetDistance(index == 0 ? args.Position : targets[index - 1].Position, targets[index].Position) / 440), //440为其实体宽度,这里用了硬编码
         ScaleY = caster.Scale
     };
     TransformGroup transformGroup = new TransformGroup();
     transformGroup.Children.Add(scaleTransform);
     transformGroup.Children.Add(rotateTransform);
     animation.RenderTransform = transformGroup;
     animation.Position = from;
     space.AddUIElement(animation);
     EventHandler handler = null;
     animation.End += handler = delegate {
         animation.End -= handler;
         space.RemoveAnimation(animation);
         if (index == targets.Count) { targets.Clear(); }
     };
     animation.HeartStart();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 创建子魔法元素
 /// </summary>
 void createSubMagic(RoleBase caster, Space space, MagicArgs args, double angle, double width)
 {
     double radian = GlobalMethod.GetRadian(angle);
     double x = width * Math.Cos(radian) + args.Position.X;
     double y = width * Math.Sin(radian) + args.Position.Y;
     Point position = new Point(x, y);
     Point p = space.Terrain.GetCoordinateFromPosition(position);
     //障碍物的位置不能放魔法
     if (space.Terrain.InEffectiveRange(p)) {
         if ((args.SpaceLayer == SpaceLayers.Ground && space.Terrain.Matrix[(int)p.X, (int)p.Y] != 0) || args.SpaceLayer == SpaceLayers.Sky) {
             AnimationBase magic = new AnimationBase() { Code = args.ResCode, SpaceLayer = args.SpaceLayer, Position = position, Z = (int)y };
             EventHandler handler = null;
             magic.Disposed += handler = delegate {
                 magic.Disposed -= handler;
                 space.RemoveAnimation(magic);
             };
             space.AddAnimation(magic);
             //捕获圆范围内将要伤害的精灵表
             for (int i = space.AllRoles().Count - 1; i >= 0; i--) {
                 RoleBase target = space.AllRoles()[i];
                 if (caster.IsHostileTo(target) && target.InCircle(position, args.Radius * args.Scale)) {
                     caster.CastingToEffect(target, args);
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 void CreateSubMagic(RoleBase caster,RoleBase startTarget, RoleBase endTarget, Space space, MagicArgs args)
 {
     AnimationBase animation = new AnimationBase() { Code = args.ResCode, Z = startTarget.Z + 1 };
     double offsetStartY = (startTarget.State == States.Riding ? (startTarget.Profession == Professions.Taoist ? 130 : 110) : 60) * args.Scale;
     double offsetEndY = (endTarget.State == States.Riding ? 100 : 50) * args.Scale;
     Point from = new Point(startTarget.Position.X, startTarget.Position.Y - offsetStartY);
     Point to = new Point(endTarget.Position.X, endTarget.Position.Y - offsetEndY);
     RotateTransform rotateTransform = new RotateTransform() {
         CenterX = animation.Center.X,
         CenterY = animation.Center.Y,
         Angle = GlobalMethod.GetAngle(to.Y - from.Y, to.X - from.X)
     };
     ScaleTransform scaleTransform = new ScaleTransform() {
         CenterX = animation.Center.X,
         CenterY = animation.Center.Y,
         ScaleX = (GlobalMethod.GetDistance(startTarget.Position, endTarget.Position) / Convert.ToInt32(args.Tag)),
         ScaleY = args.Scale
     };
     TransformGroup transformGroup = new TransformGroup();
     transformGroup.Children.Add(scaleTransform);
     transformGroup.Children.Add(rotateTransform);
     animation.RenderTransform = transformGroup;
     animation.Position = from;
     space.AddUIElement(animation);
     EventHandler handler = null;
     animation.End += handler = delegate {
         animation.End -= handler;
         space.RemoveAnimation(animation);
     };
     animation.HeartStart();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 显示内部动画
 /// </summary>
 public void DisplayAnimation()
 {
     sunnyAnimation = new AnimationBase() { Loop = true, Z = 2, };
     pumiceAnimation = new AnimationBase() { Loop = true, Z = 2, };
     flyBirds = new AnimationBase() { Loop = true, Z = 2, };
     flowLightAnimation = new AnimationBase() { Loop = true, Z = 2, };
     CreateAnimation(sunnyAnimation, 14, new Point(680, 0));
     CreateAnimation(pumiceAnimation, 67, new Point(810, 25));
     CreateAnimation(flyBirds, 69, new Point(570, 410));
     CreateAnimation(flowLightAnimation, 68, new Point(1760, 105));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 添加动画
 /// </summary>
 /// <param name="animation">动画对象</param>
 public void AddAnimation(AnimationBase animation)
 {
     animationList.Add(animation);
     space.Children.Add(animation);
     //ID不为0的动画则拥有阴影,且位置设定为障碍
     if (animation.ID != 0) {
         AddShadow(animation.ID, ShadowTypes.Simple);
         SetShadowVisibleTo(animation);
         SetShadowPositionTo(animation);
         Point coordinate = terrain.GetCoordinateFromPosition(animation.Position);
         terrain.Matrix[(int)coordinate.X, (int)coordinate.Y] = 0;
     }
     animation.HeartStart();
 }
Ejemplo n.º 6
0
 public override void Run(RoleBase caster, Space space, MagicArgs args)
 {
     EventHandler handler = null;
     AnimationBase animation = new AnimationBase() {
         Code = (int)args.ResCode,
         Position = args.Target.Center,
         Z = -1,
     };
     animation.Disposed += handler = delegate {
         animation.Disposed -= handler;
         args.Target.RemoveEffect(EffectTypes.Cure);
     };
     args.Target.AddEffect(animation, EffectTypes.Cure);
     caster.CastingToEffect(args.Target, args);
 }
Ejemplo n.º 7
0
 public override void Run(RoleBase caster, Space space, MagicArgs args)
 {
     args.Position = args.MagicPosition == MagicPositions.Position ? args.Position : args.Destination;
     AnimationBase magic = new AnimationBase() { Code = args.ResCode, SpaceLayer = args.SpaceLayer, Position = args.Position, Z = args.MagicLayer == MagicLayers.Ground ? -1 : (int)args.Position.Y };
     EventHandler handler = null;
     magic.Disposed += handler = delegate {
         magic.Disposed -= handler;
         space.RemoveAnimation(magic);
     };
     space.AddAnimation(magic);
     for (int i = space.AllRoles().Count - 1; i >= 0; i--) {
         RoleBase target = space.AllRoles()[i];
         if (target.InCircle(args.Position, args.Radius * args.Scale)) {
             caster.CastingToEffect(target, args);
         }
     }
 }
 public override void Run(RoleBase caster, Space space, MagicArgs args)
 {
     args.Position = args.MagicPosition == MagicPositions.Position ? args.Position : args.Destination;
     Point p = space.Terrain.GetCoordinateFromPosition(args.Position);
     if (space.Terrain.InEffectiveRange(p)) {
         if ((args.SpaceLayer == SpaceLayers.Ground && space.Terrain.Matrix[(int)p.X, (int)p.Y] != 0) || args.SpaceLayer == SpaceLayers.Sky) {
             AnimationBase magic = new AnimationBase() { Code = args.ResCode, SpaceLayer = args.SpaceLayer, Position = args.Position, Z = args.MagicLayer == MagicLayers.Ground ? -1 : (int)args.Position.Y, Loop = true };
             //magic.RenderTransform = new RotateTransform() {
             //    CenterX = magic.Center.X,
             //    CenterY = magic.Center.Y,
             //    Angle = GlobalMethod.GetAngle(args.Position.Y - caster.Position.Y, args.Position.X - caster.Position.X)
             //};
             EventHandler handler = null;
             magic.Disposed += handler = delegate {
                 magic.Disposed -= handler;
                 space.RemoveAnimation(magic);
             };
             space.AddAnimation(magic);
             int count = 0;
             DispatcherTimer timer = new DispatcherTimer() { Interval = TimeSpan.FromMilliseconds(Convert.ToInt32(args.Tag)) };
             EventHandler timerHandler = null;
             timer.Tick += timerHandler = delegate {
                 if (count == args.Number) {
                     timer.Stop();
                     timer.Tick -= timerHandler;
                     magic.Dispose(magic, null);
                 } else {
                     for (int i = space.AllRoles().Count - 1; i >= 0; i--) {
                         RoleBase target = space.AllRoles()[i];
                         if (caster.IsHostileTo(target) && target.InCircle(args.Position, args.Radius * args.Scale)) {
                             //Targets.Add(target);
                             caster.CastingToEffect(target, args);
                         }
                     }
                 }
                 count++;
             };
             timer.Start();
         }
     }
 }
 /// <summary>
 /// 创建子魔法元素
 /// </summary>
 void createSubMagic(Space space, MagicArgs args, double number, double angle, double width)
 {
     for (int i = 0; i < number; i++) {
         double tempAngle = angle + i * (360 / number);
         double tempRadian = GlobalMethod.GetRadian(tempAngle);
         double x = width * Math.Cos(tempRadian) + args.Position.X;
         double y = width * Math.Sin(tempRadian) + args.Position.Y;
         Point position = new Point(x, y);
         Point p = space.Terrain.GetCoordinateFromPosition(position);
         //障碍物的位置不能放魔法
         if (space.Terrain.InEffectiveRange(p)) {
             if ((args.SpaceLayer == SpaceLayers.Ground && space.Terrain.Matrix[(int)p.X, (int)p.Y] != 0) || args.SpaceLayer == SpaceLayers.Sky) {
                 AnimationBase magic = new AnimationBase() { Code = args.ResCode, SpaceLayer = args.SpaceLayer, Position = position, Z = (int)y };
                 EventHandler handler = null;
                 magic.Disposed += handler = delegate {
                     magic.Disposed -= handler;
                     space.RemoveAnimation(magic);
                 };
                 space.AddAnimation(magic);
             }
         }
     }
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 移除动画
 /// </summary>
 /// <param name="animation">动画对象</param>
 public void RemoveAnimation(AnimationBase animation)
 {
     animationList.Remove(animation);
     Remove(animation);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 设置动画是否可见
 /// </summary>
 /// <param name="animation"></param>
 /// <param name="visible"></param>
 void SetAnimationVisible(AnimationBase animation, bool visible)
 {
     animation.IsVisible = visible;
     if (ShadowType != ShadowTypes.None && animation.ID != 0) {
         SetShadowVisibleTo(animation);
         SetShadowPositionTo(animation);
     }
 }
Ejemplo n.º 12
0
 public override void Run(RoleBase caster, Space space, MagicArgs args)
 {
     caster.ClearAttacher();
     for (int i = 0; i < args.Number; i++) {
         Point p = new Point(caster.Coordinate.X + RandomSeed.Next(-5, 5), caster.Coordinate.Y + RandomSeed.Next(-5, 5));
         if (!space.Terrain.InEffectiveRange(p) || (args.SpaceLayer == SpaceLayers.Ground && space.Terrain.Matrix[(int)p.X, (int)p.Y] == 0)) {
             p = caster.Coordinate;
         }
         AnimationBase magic = new AnimationBase() { Code = args.ResCode, SpaceLayer = args.SpaceLayer, Position = space.Terrain.GetPositionFromCoordinate(p), Z = args.MagicLayer == MagicLayers.Ground ? -1 : (int)args.Position.Y };
         EventHandler handler = null;
         magic.Disposed += handler = delegate {
             magic.Disposed -= handler;
             space.RemoveAnimation(magic);
         };
         space.AddAnimation(magic);
         //解析配置
         XElement xMonster = Infos["Monster"].DescendantsAndSelf("Monsters").Elements().Single(X => X.Attribute("ID").Value == args.AdditionalEffect.ToString());
         Monster monster = new Monster(space.Terrain) {
             ID = (int)xMonster.Attribute("ID") + countID,
             AttachID = caster.AttachID,
             Code = (int)xMonster.Attribute("Code"),
             ArmorCode = (int)xMonster.Attribute("ArmorCode"),
             AttackRange = (int)xMonster.Attribute("AttackRange"),
             FullName = string.Format("{0}的召唤兽", caster.FullName),
             Profession = Professions.Monster,
             Direction = caster.Direction,
             State = States.Walking,
             Camp = caster.Camp,
             LifeMax = Convert.ToDouble(args.Tag),
             Life = Convert.ToDouble(args.Tag),
             SpaceLayer = caster.SpaceLayer,
             Coordinate = p,
             TacticAI = TacticAIs.GuardMaster,
             ActionAI = ActionAIs.Simple,
             FullNameColor = Colors.Orange,
             ATK = ObjectBase.RandomSeed.Next(1300, 1600),
             DEF = ObjectBase.RandomSeed.Next(600, 900),
             MAG = ObjectBase.RandomSeed.Next(400, 500),
             DEX = ObjectBase.RandomSeed.Next(0, 30),
         };
         if (xMonster.Attribute("LearnedMagic").Value != string.Empty) {
             string[] str = xMonster.Attribute("LearnedMagic").Value.Split(',');
             for (int j = 0; j < str.Count(); j++) {
                 string[] value = str[j].Split('_');
                 monster.LearnedMagic.Add(Convert.ToInt32(value[0]), Convert.ToInt32(value[1]));
             }
         }
         space.AddRole(monster, new RoleAddedEventArgs() {
             RegisterDisposedEvent = (bool)xMonster.Attribute("RegisterDisposedEvent"),
             RegisterIntervalTriggerEvent = (bool)xMonster.Attribute("RegisterIntervalTriggerEvent"),
             RegisterActionTriggerEvent = (bool)xMonster.Attribute("RegisterActionTriggerEvent"),
             RegisterDoAttackEvent = (bool)xMonster.Attribute("RegisterDoAttackEvent"),
             RegisterDoCastingEvent = (bool)xMonster.Attribute("RegisterDoCastingEvent"),
             RegisterPositionChangedEvent = (bool)xMonster.Attribute("RegisterPositionChangedEvent"),
             RegisterLifeChangedEvent = (bool)xMonster.Attribute("RegisterLifeChangedEvent"),
         });
         monster.Master = caster;
         caster.AttachRoles.Add(monster);
         countID++;
         if (countID == 10000) { countID = 0; }
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 魔法/技能攻击产生效果(伤害/治疗)
 /// </summary>
 public void CastingToEffect(RoleBase target, MagicArgs args)
 {
     //依据魔法实效类型处理
     switch (args.MagicEffectType) {
         case MagicEffectTypes.Gain:
             target.ChangeLife(Convert.ToInt32(args.Tag), ValueEffects.Increase);
             break;
         case MagicEffectTypes.Reduction:
             //模拟伤害计算
             int damage = RandomSeed.Next(this.MAG + args.EffectMin, this.MAG + args.EffectMax);
             if (RandomSeed.Next(100) > 90) {
                 target.ChangeLife(0, ValueEffects.Failure);
                 return;
             } else if (RandomSeed.Next(100) > 85) {
                 //暴击
                 target.ChangeLife(-damage * 2, ValueEffects.DoubleDecrease);
             } else {
                 target.ChangeLife(-damage, ValueEffects.Decrease);
             }
             //伤害后如果对象生命为0
             if (target.Life == 0) {
                 target.ChangeLife(0, ValueEffects.Death);
                 if (Action == Actions.Attack && !isSpecialMove) { this.Stop(); }
                 this.Target = null;
                 return;
             }
             break;
     }
     //显示魔法附加效果
     if (args.AdditionalEffect != AdditionalEffects.None) {
         EventHandler handler = null;
         AnimationBase animation = new AnimationBase() {
             Code = (int)args.AdditionalEffect,
             Position = target.Center,
             Z = 1000,
         };
         animation.Disposed += handler = (s0, e0) => {
             animation.Disposed -= handler;
             target.RemoveEffect(EffectTypes.Temporary);
         };
         target.AddEffect(animation, EffectTypes.Temporary);
     }
     //魔法特殊效果
     switch (args.SpecialEffect) {
         case SpecialEffects.Injure:
             target.Injure();
             break;
         case SpecialEffects.Bounce:
             target.BeBounce(args.Position, Convert.ToDouble(args.Tag), 500);
             break;
         case SpecialEffects.Knock:
             //target.BeKnock(40);
             break;
         case SpecialEffects.Freeze:
             //测试,50%几率命中
             if (RandomSeed.Next(100) > 50) {
                 target.BeFreeze(Convert.ToDouble(args.Tag));
             }
             break;
         case SpecialEffects.Petrifaction:
             //测试,50%几率命中
             if (RandomSeed.Next(100) > 50) {
                 target.BePetrifaction(Convert.ToDouble(args.Tag));
             }
             break;
         case SpecialEffects.Poison:
             target.BePoison(RandomSeed.Next(200, 500), Convert.ToDouble(args.Tag));
             break;
         case SpecialEffects.Quiver:
             target.Quiver(6);
             break;
     }
 }
Ejemplo n.º 14
0
        void queueDownloader_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
        {
            this.Width = 910;
            this.Height = 590;

            ImageButton faceList = new ImageButton() {
                TotalWidth = 162,
                TotalHeight = 27,
                Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/18.png", UriType.Web), Stretch = Stretch.None },
                Text = GetLanguagePackContent(25),
                TextStyle = Application.Current.Resources["TextStyle5"] as Style,
                TextHasEffect = false,
                TextBrush = new SolidColorBrush(Colors.Black),
            };
            this.Children.Add(faceList);
            Canvas.SetLeft(faceList, 0);
            Canvas.SetTop(faceList, 85);

            avatarSelector = new AnimationBase() { Code = 70, Loop = true, Z = 10, IsHitTestVisible = false };
            this.Children.Add(avatarSelector);
            avatarSelector.HeartStart();

            for (int i = 0; i <= avatar.GetUpperBound(0); i++) {
                avatar[i] = new ImageButton() {
                    Code = i,
                    TotalWidth = 74,
                    TotalHeight = 74,
                    BodyHasEffect = true,
                    BodyEffectColor = Colors.Blue,
                };
                this.Children.Add(avatar[i]);
                Canvas.SetLeft(avatar[i], 40);
                Canvas.SetTop(avatar[i], 130 + i * 85);
                Canvas.SetZIndex(avatar[i], 3);
                avatar[i].MouseLeftButtonDown += (s1, e1) => {
                    ImageButton obj =s1 as ImageButton;
                    faceCode = obj.Code;
                    avatarSelector.Visibility = Visibility.Visible;
                    avatarSelector.IsVisible = true;
                    avatarSelector.Position = obj.Position;
                };
            }
            ShowSexFace(Sex.male);
            avatarSelector.Position = avatar[0].Position;

            light = new AnimationBase { Code = 72, Loop = true, Z = 4, IsHitTestVisible = false };
            this.Children.Add(light);
            light.HeartStart();
            light.Position = new Point(190, 75);

            this.Children.Add(maleModel);
            Canvas.SetLeft(maleModel, 80);
            Canvas.SetTop(maleModel, 120);
            maleModel.MouseLeftButtonDown += (s1, e1) => {
                //waiting.Show(); Canvas.SetLeft(waiting, -400); Canvas.SetTop(waiting, 100);
                ShowSexFace(Sex.male);
                ShowRoleModel(profession, Sex.male);
                light.Position = new Point(190, 75);
            };
            this.Children.Add(femaleModel);
            Canvas.SetLeft(femaleModel, 270);
            Canvas.SetTop(femaleModel, 120);
            ShowRoleModel(profession, Sex.male);
            femaleModel.MouseLeftButtonDown += (s1, e1) => {
                //waiting.Show(); Canvas.SetLeft(waiting, -200); Canvas.SetTop(waiting, 100);
                ShowSexFace(Sex.female);
                ShowRoleModel(profession, Sex.female);
                light.Position = new Point(385, 75);
            };

            for (int i = 0; i <= professionSelector.GetUpperBound(0); i++) {
                professionSelector[i] = new ImageButton() {
                    Tag = i,
                    TotalWidth = 153,
                    TotalHeight = 32,
                    Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/5.png", UriType.Web), Stretch = Stretch.None },
                    TextStyle = Application.Current.Resources["TextStyle3"] as Style,
                    TextHasEffect = true,
                    TextEffectColor = Colors.Red,
                    TextBrush = new SolidColorBrush(Colors.White),
                    TextHoverBrush = new SolidColorBrush(Colors.Yellow),
                    Z  = 3,
                };
                this.Children.Add(professionSelector[i]);
                professionSelector[i].Position = new Point(600, 70 + 50 * i);
                professionSelector[0].Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/9.png", UriType.Web) };
                professionSelector[i].Click += (s1, e1) => {
                    for (int j = 0; j <= professionSelector.GetUpperBound(0); j++) {
                        professionSelector[j].Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/5.png", UriType.Web) };
                    }
                    ImageButton obj = s1 as ImageButton;
                    obj.Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/9.png", UriType.Web) };
                    ShowRoleModel((Professions)obj.Tag, sex);
                };
            }
            professionSelector[0].Text = GetLanguagePackContent(28);
            professionSelector[1].Text = GetLanguagePackContent(27);
            professionSelector[2].Text = GetLanguagePackContent(26);
            professionSelector[3].Text = GetLanguagePackContent(29);

            Image descriptionHead = new Image() { Source = GlobalMethod.GetImage("UI/6.png", UriType.Web) };
            Grid descriptionBody = new Grid() {
                Width = 221,
                Height = 220,
                Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/7.png", UriType.Web) }
            };
            descriptionBody.Children.Add(description);
            Image descriptionFoot = new Image() { Source = GlobalMethod.GetImage("UI/8.png", UriType.Web) };
            this.Children.Add(descriptionHead);
            this.Children.Add(descriptionFoot);
            this.Children.Add(descriptionBody);
            Canvas.SetLeft(descriptionHead, 570);
            Canvas.SetTop(descriptionHead, 280);
            Canvas.SetLeft(descriptionBody, 570);
            Canvas.SetTop(descriptionBody, 285);
            Canvas.SetLeft(descriptionFoot, 570);
            Canvas.SetTop(descriptionFoot, 455);

            TextBlock text0 = new TextBlock() { Text = GetLanguagePackContent(30), Foreground = new SolidColorBrush(Colors.White), FontSize = 18, FontWeight = FontWeights.SemiBold };
            this.Children.Add(text0);
            Canvas.SetLeft(text0, 200);
            Canvas.SetTop(text0, 545);
            TextBox roleName = new TextBox() { Width = 240, Background = new SolidColorBrush(Color.FromArgb(255, 57, 57, 57)), Style = Application.Current.Resources["TextStyle2"] as Style };
            this.Children.Add(roleName);
            Canvas.SetLeft(roleName, 285);
            Canvas.SetTop(roleName, 548);

            ImageButton createRole = new ImageButton() {
                TotalWidth = 80,
                TotalHeight = 25,
                Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/3.png", UriType.Web), Stretch = Stretch.None },
                Text = GetLanguagePackContent(31),
                TextStyle = Application.Current.Resources["TextStyle1"] as Style,
                TextHasEffect = true,
                TextEffectColor = Colors.Black,
                TextBrush = new SolidColorBrush(Color.FromArgb(255, 48, 83, 96)),
                TextHoverBrush = new SolidColorBrush(Colors.White),
            };
            this.Children.Add(createRole);
            Canvas.SetLeft(createRole, 550);
            Canvas.SetTop(createRole, 547);
            //创建角色
            createRole.MouseLeftButtonDown += (s1, e1) => {
                if (roleName.Text.Trim().Equals("") || roleName.Text.Trim().Length > 20) { LoginManager.loginTip.Show(GetLanguagePackContent(40), LoginTipMode.TipOnly); return; }
                LoginManager.loading.Show();
                WCFServiceClient wcfServiceClient = new WCFServiceClient();
                wcfServiceClient.CheckRoleExistAsync(roleName.Text.Trim());
                wcfServiceClient.CheckRoleExistCompleted += (s2, e2) => {
                    if (e2.Result == 0) {
                        wcfServiceClient.InsertRoleAsync(LoginManager.UserName, roleName.Text.Trim(), (byte)faceCode, (byte)sex, (byte)profession, 1, 0, 1, Application.Current.Host.InitParams["ClientIP"], "");
                        wcfServiceClient.InsertRoleCompleted += (s3, e3) => {
                            LoginManager.loading.Hide();
                            if (e3.Result != 0) {
                                LoginManager.loginTip.Show(string.Format("{0} {1}", roleName.Text.Trim(), GetLanguagePackContent(58)), LoginTipMode.TipOnly);
                                MouseButtonEventHandler handler = null;
                                LoginManager.loginTip.OK += handler = delegate {
                                    LoginManager.loginTip.OK -= handler;
                                    Dispose(this, null);
                                    if (RoleCreated != null) { RoleCreated(this, null); }
                                };
                                e1.Handled = true;
                            } else {
                                LoginManager.loginTip.Show(GetLanguagePackContent(38), LoginTipMode.TipOnly);
                            }
                        };
                    } else {
                        LoginManager.loading.Hide();
                        LoginManager.loginTip.Show(GetLanguagePackContent(39), LoginTipMode.TipOnly);
                    }
                    wcfServiceClient.CloseAsync();
                };
            };
            ImageButton cannel = new ImageButton() {
                TotalWidth = 80,
                TotalHeight = 25,
                Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/3.png", UriType.Web), Stretch = Stretch.None },
                Text = GetLanguagePackContent(51),
                TextStyle = Application.Current.Resources["TextStyle1"] as Style,
                TextHasEffect = true,
                TextEffectColor = Colors.Black,
                TextBrush = new SolidColorBrush(Color.FromArgb(255, 48, 83, 96)),
                TextHoverBrush = new SolidColorBrush(Colors.White),
            };
            this.Children.Add(cannel);
            Canvas.SetLeft(cannel, 650);
            Canvas.SetTop(cannel, 547);
            cannel.Click += (s1, e1) => {
                Dispose(this, null);
                if (Cannel != null) {  Cannel(this, e1); }
            };
            base.OnResourceReady(this, e);
        }
Ejemplo n.º 15
0
 /// <summary>
 /// 切换角色模型
 /// </summary>
 void ShowRoleModel(Professions profession, Sex sex)
 {
     if (this.profession == profession && this.sex == sex) { return; }
     this.profession = profession;
     this.sex = sex;
     roleAnimation.End -= roleAnimation_End;
     roleAnimation.Dispose(roleAnimation, null);
     switch (profession) {
         case Professions.Warrior:
             description.Text = GlobalMethod.GetParagraphText(GetLanguagePackContent(34), '|', "\r\t\t");
             if (sex == Sex.male) {
                 roleAnimation = new AnimationBase() { Code = 73, Loop = true, Z = 1, };
                 maleModel.Content = roleAnimation;
                 roleAnimation.HeartStart();
                 maleModel.IsHitTestVisible = false;
                 femaleModel.Content = new Image() { Source = GlobalMethod.GetImage("UI/11.png", UriType.Web), Stretch = Stretch.None };
                 Canvas.SetZIndex(femaleModel, 2);
                 femaleModel.IsHitTestVisible = true;
             } else {
                 maleModel.Content = new Image() { Source = GlobalMethod.GetImage("UI/10.png", UriType.Web), Stretch = Stretch.None };
                 Canvas.SetZIndex(maleModel, 2);
                 maleModel.IsHitTestVisible = true;
                 roleAnimation = new AnimationBase() { Code = 74, Loop = true, Z = 1, };
                 femaleModel.Content = roleAnimation;
                 roleAnimation.HeartStart();
                 femaleModel.IsHitTestVisible = false;
             }
             break;
         case Professions.Assassin:
             description.Text = GlobalMethod.GetParagraphText(GetLanguagePackContent(35), '|', "\r\t\t");
             if (sex == Sex.male) {
                 roleAnimation = new AnimationBase() { Code = 75, Loop = true, Z = 1, };
                 maleModel.Content = roleAnimation;
                 roleAnimation.HeartStart();
                 maleModel.IsHitTestVisible = false;
                 femaleModel.Content = new Image() { Source = GlobalMethod.GetImage("UI/13.png", UriType.Web), Stretch = Stretch.None };
                 Canvas.SetZIndex(femaleModel, 2);
                 femaleModel.IsHitTestVisible = true;
             } else {
                 maleModel.Content = new Image() { Source = GlobalMethod.GetImage("UI/12.png", UriType.Web), Stretch = Stretch.None };
                 Canvas.SetZIndex(maleModel, 2);
                 maleModel.IsHitTestVisible = true;
                 roleAnimation = new AnimationBase() { Code = 76, Loop = true, Z = 1, };
                 femaleModel.Content = roleAnimation;
                 roleAnimation.HeartStart();
                 femaleModel.IsHitTestVisible = false;
             }
             break;
         case Professions.Archer:
             description.Text = GlobalMethod.GetParagraphText(GetLanguagePackContent(36), '|', "\r\t\t");
             if (sex == Sex.male) {
                 roleAnimation = new AnimationBase() { Code = 77, Loop = true, Z = 1, };
                 maleModel.Content = roleAnimation;
                 roleAnimation.HeartStart();
                 maleModel.IsHitTestVisible = false;
                 femaleModel.Content = new Image() { Source = GlobalMethod.GetImage("UI/15.png", UriType.Web), Stretch = Stretch.None };
                 Canvas.SetZIndex(femaleModel, 2);
                 femaleModel.IsHitTestVisible = true;
             } else {
                 maleModel.Content = new Image() { Source = GlobalMethod.GetImage("UI/14.png", UriType.Web), Stretch = Stretch.None };
                 Canvas.SetZIndex(maleModel, 2);
                 maleModel.IsHitTestVisible = true;
                 roleAnimation = new AnimationBase() { Code = 78, Loop = true, Z = 1, };
                 femaleModel.Content = roleAnimation;
                 roleAnimation.HeartStart();
                 femaleModel.IsHitTestVisible = false;
             }
             break;
         case Professions.Taoist:
             description.Text = GlobalMethod.GetParagraphText(GetLanguagePackContent(37), '|', "\r\t\t");
             if (sex == Sex.male) {
                 roleAnimation = new AnimationBase() { Code = 79, Loop = true, Z = 1, };
                 maleModel.Content = roleAnimation;
                 roleAnimation.HeartStart();
                 maleModel.IsHitTestVisible = false;
                 femaleModel.Content = new Image() { Source = GlobalMethod.GetImage("UI/17.png", UriType.Web), Stretch = Stretch.None };
                 Canvas.SetZIndex(femaleModel, 2);
                 femaleModel.IsHitTestVisible = true;
             } else {
                 maleModel.Content = new Image() { Source = GlobalMethod.GetImage("UI/16.png", UriType.Web), Stretch = Stretch.None };
                 Canvas.SetZIndex(maleModel, 2);
                 maleModel.IsHitTestVisible = true;
                 roleAnimation = new AnimationBase() { Code = 80, Loop = true, Z = 1, };
                 femaleModel.Content = roleAnimation;
                 roleAnimation.HeartStart();
                 femaleModel.IsHitTestVisible = false;
             }
             break;
     }
     roleAnimation.End += new System.EventHandler(roleAnimation_End);
 }
Ejemplo n.º 16
0
        /// <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
        }
Ejemplo n.º 17
0
        void queueDownloader_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
        {
            this.Width = Application.Current.Host.Content.ActualWidth;
            this.Height = Application.Current.Host.Content.ActualHeight;

            ImageButton faceList = new ImageButton() {
                TotalWidth = 162,
                TotalHeight = 27,
                Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/18.png", UriType.Web), Stretch = Stretch.None },
                Text = GetLanguagePackContent(42),
                TextStyle = Application.Current.Resources["TextStyle5"] as Style,
                TextHasEffect = false,
                TextBrush = new SolidColorBrush(Colors.Black),
            };
            this.Children.Add(faceList);
            Canvas.SetLeft(faceList, 15);
            Canvas.SetTop(faceList, 85);

            for (int i = 0; i < roleMax; i++) {
                roleList[i] = new ImageButton() {
                    Tag = "",
                    TotalWidth = 168,
                    TotalHeight = 54,
                    Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/4.png", UriType.Web), Stretch = Stretch.None },
                    TextStyle = Application.Current.Resources["TextStyle6"] as Style,
                    TextHasEffect = true,
                    TextEffectColor = Colors.Red,
                    TextBrush = new SolidColorBrush(Colors.White),
                    TextHoverBrush = new SolidColorBrush(Colors.Yellow),
                };
                this.Children.Add(roleList[i]);
                Canvas.SetLeft(roleList[i], 10);
                Canvas.SetTop(roleList[i], 120 + 56 * i);
                Canvas.SetZIndex(roleList[i], 3);
                roleList[0].Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/20.png", UriType.Web) };
                roleList[i].Click += (s1, e1) => {
                    ImageButton obj = s1 as ImageButton;
                    if (obj.Tag.ToString().Equals("")) { return; }
                    for (int j = 0; j <= roleList.GetUpperBound(0); j++) {
                        roleList[j].TextBrush = new SolidColorBrush(Colors.White);
                        roleList[j].Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/4.png", UriType.Web), };
                    }
                    obj.TextBrush = new SolidColorBrush(Color.FromArgb(255, 172, 255, 140));
                    obj.Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/20.png", UriType.Web), };

                    LoginManager.RoleName = obj.Tag.ToString();
                    ChangeRole(roles.Single(X => X.RoleName == LoginManager.RoleName));
                };
            }
            roleList[0].TextBrush = new SolidColorBrush(Color.FromArgb(255, 172, 255, 140));

            aura = new AnimationBase() { Code = 71, Loop = true, IsHitTestVisible = false, Position =new Point(258,380)  };
            this.Children.Add(aura);
            aura.HeartStart();

            this.Children.Add(roleModel);
            Canvas.SetLeft(roleModel, 220);
            Canvas.SetTop(roleModel, 100);

            Image roleData = new Image() { Source = GlobalMethod.GetImage("UI/19.png", UriType.Web), };
            this.Children.Add(roleData);
            Canvas.SetLeft(roleData, 582);
            Canvas.SetTop(roleData, 40);

            this.Children.Add(avatar);
            Canvas.SetLeft(avatar, 654);
            Canvas.SetTop(avatar, 70);

            TextBlock text0 = new TextBlock() { Text = GetLanguagePackContent(43), Style = Application.Current.Resources["TextStyle7"] as Style };
            TextBlock text1 = new TextBlock() { Text = GetLanguagePackContent(44), Style = Application.Current.Resources["TextStyle7"] as Style };
            TextBlock text2 = new TextBlock() { Text = GetLanguagePackContent(45), Style = Application.Current.Resources["TextStyle7"] as Style };
            TextBlock text3 = new TextBlock() { Text = GetLanguagePackContent(46), Style = Application.Current.Resources["TextStyle7"] as Style };
            TextBlock text4 = new TextBlock() { Text = GetLanguagePackContent(47), Style = Application.Current.Resources["TextStyle7"] as Style };
            TextBlock text5 = new TextBlock() { Text = GetLanguagePackContent(48), Style = Application.Current.Resources["TextStyle7"] as Style };
            TextBlock text6 = new TextBlock() { Text = GetLanguagePackContent(49), Style = Application.Current.Resources["TextStyle7"] as Style };
            this.Children.Add(text0); Canvas.SetLeft(text0, 680); Canvas.SetTop(text0, 158);
            this.Children.Add(text1); Canvas.SetLeft(text1, 645); Canvas.SetTop(text1, 192);
            this.Children.Add(text2); Canvas.SetLeft(text2, 714); Canvas.SetTop(text2, 192);
            this.Children.Add(text3); Canvas.SetLeft(text3, 680); Canvas.SetTop(text3, 226);
            this.Children.Add(text4); Canvas.SetLeft(text4, 680); Canvas.SetTop(text4, 258);
            this.Children.Add(text5); Canvas.SetLeft(text5, 670); Canvas.SetTop(text5, 292);
            this.Children.Add(text6); Canvas.SetLeft(text6, 658); Canvas.SetTop(text6, 326);

            Grid grid0 = new Grid() { Width = 130 }; this.Children.Add(grid0); Canvas.SetLeft(grid0, 626); Canvas.SetTop(grid0, 173);
            Grid grid1 = new Grid() { Width = 60 }; this.Children.Add(grid1); Canvas.SetLeft(grid1, 626); Canvas.SetTop(grid1, 207);
            Grid grid2 = new Grid() { Width = 60 }; this.Children.Add(grid2); Canvas.SetLeft(grid2, 694); Canvas.SetTop(grid2, 207);
            Grid grid3 = new Grid() { Width = 130 }; this.Children.Add(grid3); Canvas.SetLeft(grid3, 626); Canvas.SetTop(grid3, 241);
            Grid grid4 = new Grid() { Width = 130 }; this.Children.Add(grid4); Canvas.SetLeft(grid4, 626); Canvas.SetTop(grid4, 273);
            Grid grid5 = new Grid() { Width = 130 }; this.Children.Add(grid5); Canvas.SetLeft(grid5, 626); Canvas.SetTop(grid5, 307);
            Grid grid6 = new Grid() { Width = 130 }; this.Children.Add(grid6); Canvas.SetLeft(grid6, 626); Canvas.SetTop(grid6, 341);
            roleName = new TextBlock() { Style = Application.Current.Resources["TextStyle8"] as Style };
            occupation = new TextBlock() { Style = Application.Current.Resources["TextStyle8"] as Style };
            level = new TextBlock() { Style = Application.Current.Resources["TextStyle8"] as Style };
            experience = new TextBlock() { Style = Application.Current.Resources["TextStyle8"] as Style };
            map = new TextBlock() { Style = Application.Current.Resources["TextStyle8"] as Style };
            time = new TextBlock() { Style = Application.Current.Resources["TextStyle8"] as Style };
            ip = new TextBlock() { Style = Application.Current.Resources["TextStyle8"] as Style };
            grid0.Children.Add(roleName);
            grid1.Children.Add(occupation);
            grid2.Children.Add(level);
            grid3.Children.Add(experience);
            grid4.Children.Add(map);
            grid5.Children.Add(time);
            grid6.Children.Add(ip);

            ImageButton startGame = new ImageButton() {
                TotalWidth = 80,
                TotalHeight = 25,
                Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/3.png", UriType.Web), Stretch = Stretch.None },
                Text = GetLanguagePackContent(50),
                TextStyle = Application.Current.Resources["TextStyle1"] as Style,
                TextHasEffect = true,
                TextEffectColor = Colors.Black,
                TextBrush = new SolidColorBrush(Color.FromArgb(255, 48, 83, 96)),
                TextHoverBrush = new SolidColorBrush(Colors.White),
            };
            startGame.Click += (s1, e1) => {
                Dispose(this,null);
                if (GameStart != null) { GameStart(this, e1); }
            };
            ImageButton cannel = new ImageButton() {
                TotalWidth = 80,
                TotalHeight = 25,
                Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/3.png", UriType.Web), Stretch = Stretch.None },
                Text = GetLanguagePackContent(51),
                TextStyle = Application.Current.Resources["TextStyle1"] as Style,
                TextHasEffect = true,
                TextEffectColor = Colors.Black,
                TextBrush = new SolidColorBrush(Color.FromArgb(255, 48, 83, 96)),
                TextHoverBrush = new SolidColorBrush(Colors.White),
            };
            cannel.Click += (s1, e1) => {
                Dispose(this, null);
                if (Cannel != null) { Cannel(this, e1); }
            };
            ImageButton newRole = new ImageButton() {
                TotalWidth = 80,
                TotalHeight = 25,
                Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/3.png", UriType.Web), Stretch = Stretch.None },
                Text = GetLanguagePackContent(52),
                TextStyle = Application.Current.Resources["TextStyle1"] as Style,
                TextHasEffect = true,
                TextEffectColor = Colors.Black,
                TextBrush = new SolidColorBrush(Color.FromArgb(255, 48, 83, 96)),
                TextHoverBrush = new SolidColorBrush(Colors.White),
            };
            newRole.Click += (s1, e1) => {
                LoginManager.loading.Show();
                WCFServiceClient wcf1 = new WCFServiceClient();
                wcf1.GetUserRoleNumAsync(LoginManager.UserName);
                wcf1.GetUserRoleNumCompleted += (s2, e2) => {
                    if (e2.Result == 6) {
                        LoginManager.loginTip.Show(GetLanguagePackContent(53), LoginTipMode.TipOnly);
                        LoginManager.loading.Hide();
                    } else {
                        Dispose(this, null);
                        if (CreateRole != null) { CreateRole(this, e1); }
                    }
                    wcf1.CloseAsync();
                };
            };
            delRole = new ImageButton() {
                TotalWidth = 80,
                TotalHeight = 25,
                Background = new ImageBrush() { ImageSource = GlobalMethod.GetImage("UI/3.png", UriType.Web), Stretch = Stretch.None },
                Text = GetLanguagePackContent(54),
                TextStyle = Application.Current.Resources["TextStyle1"] as Style,
                TextHasEffect = true,
                TextEffectColor = Colors.Black,
                TextBrush = new SolidColorBrush(Color.FromArgb(255, 48, 83, 96)),
                TextHoverBrush = new SolidColorBrush(Colors.White),
            };
            delRole.Click += (s1, e1) => {
                if (roles.Count() == 0) { return; }
                LoginManager.loginTip.Show(GetLanguagePackContent(59), LoginTipMode.ConfirmOrCannel);
                LoginManager.loginTip.OK += new MouseButtonEventHandler(dialog_OK);
            };
            this.Children.Add(startGame); Canvas.SetLeft(startGame, 650); Canvas.SetTop(startGame, 380);
            this.Children.Add(cannel); Canvas.SetLeft(cannel, 650); Canvas.SetTop(cannel, 415);
            this.Children.Add(newRole); Canvas.SetLeft(newRole, 650); Canvas.SetTop(newRole, 450);
            this.Children.Add(delRole); Canvas.SetLeft(delRole, 650); Canvas.SetTop(delRole, 485);

            base.OnResourceReady(this, e);
            LoadRoles(LoginManager.UserName);
        }
Ejemplo n.º 18
0
 public Bullet(BulletDatas bulletData)
 {
     switch (bulletType = bulletData.Type) {
         case BulletTypes.Common:
             this.Source = GlobalMethod.GetImage(string.Format("Bullet/{0}.png", bulletData.Code), UriType.Project);
             Offset = new Point(Source.PixelWidth, Source.PixelHeight / 2);
             break;
         case BulletTypes.Animation:
             AnimationBase animation = new AnimationBase() { Code = bulletData.Code, Loop = bulletData.Loop };
             animation.HeartStart();
             this.Children.Add(animation);
             Offset = new Point(animation.Center.X * 2, animation.Center.Y);
             break;
     }
 }
Ejemplo n.º 19
0
 /// <summary>
 /// 游戏中鼠标左键按下
 /// </summary>
 void LayoutRoot_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     leader.ActionTrigger -= role_ActionDecide;
     mouseTimer.Start();
     Point p = e.GetPosition(space);
     List<RoleBase> hitRoles = HitRole(e.GetPosition(LayoutRoot));
     if (mouseButtonClickRole is NPC) {
         NPC npc = (mouseButtonClickRole as NPC);
         if (npc.Action == Actions.Stop) { npc.TurnToDefaultDirection(); }
     }
     bool IsHitRole = false;
     for (int i = 0; i < hitRoles.Count; i++) {
         if (hitRoles[i].InEntityRange(e.GetPosition(hitRoles[i]), (EntityDetectTypes)Convert.ToInt32(((ComboBoxItem)comboBox26.SelectedItem).Tag))) {
             bool isHostile = leader.IsHostileTo(hitRoles[i]);
             if (mouseButtonClickRole != hitRoles[i]) {
                 if (mouseButtonClickRole != null) {
                     //移除上一次点中角色选中特效
                     mouseButtonClickRole.RemoveEffect(EffectTypes.Selected);
                     //移除上一次点中角色的事件
                     mouseButtonClickRole.LifeChanged -= TargetInfo_LifeChanged;
                     mouseButtonClickRole.LifeMaxChanged -= TargetInfo_LifeChanged;
                 }
                 mouseButtonClickRole = hitRoles[i];
                 //注册选中角色更新生命值事件
                 hitRoles[i].LifeChanged += TargetInfo_LifeChanged;
                 hitRoles[i].LifeMaxChanged += TargetInfo_LifeChanged;
                 //更新HUD中目标角色资料
                 targetInfo.Update(hitRoles[i].FullName, hitRoles[i].Life, hitRoles[i].LifeMax);
                 //添加选中特效
                 EventHandler handler = null;
                 AnimationBase animation = new AnimationBase() {
                     Code = isHostile ? 5 : 4,
                     Position = hitRoles[i].Center,
                     Z = -1,
                     Loop = true
                 };
                 animation.Disposed += handler = (s0, e0) => {
                     animation.Disposed -= handler;
                     hitRoles[i].RemoveEffect(EffectTypes.Selected);
                 };
                 hitRoles[i].AddEffect(animation, EffectTypes.Selected);
             }
             //假如点到的是NPC
             if (hitRoles[i] is NPC) {
                 NPC npc = hitRoles[i] as NPC;
                 if (leader.SpaceLayer == npc.SpaceLayer) {
                     leader.TurnTowardsTo(npc.Position);
                     npc.TurnTowardsTo(leader.Position);
                     dramaDialogue.Show(npc.TaskInfo);
                 }
             } else {
                 //主角向敌对目标角色移动
                 if (isHostile) {
                     leader.Target = hitRoles[i];
                     leader.ActionTrigger += role_ActionDecide;
                     if (hitRoles[i].InCircle(leader.Position, leader.AttackRange)) {
                         leader.TurnTowardsTo(hitRoles[i].Position);
                         leader.Attack();
                     } else {
                         leader.MoveTo(hitRoles[i].Position);
                     }
                 }
             }
             targetInfo.IsVisible = true;
             IsHitRole = true;
             break;
         }
     }
     if (!IsHitRole) {
         leader.Target = null;
         targetInfo.IsVisible = false;
         //主角向目标点移动
         leader.MoveTo(p);
         //加入点击水滴特效
         EventHandler handler = null;
         AnimationBase animation = new AnimationBase() {
             Code = 3,
             Position = p,
             Z = -1
         };
         animation.Disposed += handler = delegate {
             animation.Disposed -= handler;
             space.RemoveAnimation(animation);
         };
         space.AddAnimation(animation);
     }
 }
Ejemplo n.º 20
0
 /// <summary>
 /// 添加特效
 /// </summary>
 /// <param name="animation">特效动画</param>
 /// <param name="type">特效类型</param>
 public void AddEffect(AnimationBase animation, EffectTypes type)
 {
     RemoveEffect(type);
     effects.Add(type, animation);
     this.Children.Add(animation);
     animation.HeartStart();
 }
Ejemplo n.º 21
0
 void CreateAnimation(AnimationBase animation, int code, Point position)
 {
     animation.Code = code;
     animation.Position = position;
     EventHandler handler = null;
     animation.Disposed += handler = delegate {
         animation.Disposed -= handler;
         this.Children.Remove(animation);
     };
     this.Children.Add(animation);
     animation.HeartStart();
 }
Ejemplo n.º 22
0
 /// <summary>
 /// 被冻住
 /// </summary>
 /// <param name="interval">持续(单位毫秒)</param>
 public void BeFreeze(double interval)
 {
     if (!isFreeze) {
         isFreeze = true;
         Target = null;
         UnloadMoveEvent();
         HeartStop();
         AnimationBase animation = new AnimationBase() {
             Code = 36,
             Position = Center,
             Z = 1000,
             Loop = true,
         };
         AddEffect(animation, EffectTypes.Freeze);
     }
     if (frozenTimer == null) { frozenTimer = new DispatcherTimer(); }
     frozenTimer.Interval = TimeSpan.FromMilliseconds(interval);
     frozenTimer.Tick -= BeFrozen_Completed;
     frozenTimer.Tick += BeFrozen_Completed;
     frozenTimer.Start();
 }
Ejemplo n.º 23
0
 /// <summary>
 /// 被毒化
 /// </summary>
 /// <param name="damage">毒伤害</param>
 /// <param name="duration">持续时间(单位毫秒)</param>
 public void BePoison(int damage, double duration)
 {
     if (!isPoison) {
         isPoison = true;
         poisonDamage = damage;
         poisonDuration = duration;
         AnimationBase animation = new AnimationBase() {
             Code = 39,
             Position = Center,
             Z = 1000,
             Loop = true,
         };
         AddEffect(animation, EffectTypes.Poison);
     }
     if (poisonTimer == null) { poisonTimer = new DispatcherTimer(); }
     poisonTimer.Interval = TimeSpan.FromMilliseconds(1000);
     poisonTimer.Tick -= BePoison_Completed;
     poisonTimer.Tick += BePoison_Completed;
     poisonTimer.Start();
 }
Ejemplo n.º 24
0
 void BeFrozen_Completed(object sender, EventArgs e)
 {
     frozenTimer.Tick -= BeFrozen_Completed;
     frozenTimer.Stop();
     isFreeze = false;
     Stop();
     HeartStart();
     RemoveEffect(EffectTypes.Freeze);
     EventHandler handler = null;
     AnimationBase animation = new AnimationBase() {
         Code = 54,
         Position = Center,
         Z = 1000,
     };
     animation.Disposed += handler = (s0, e0) => {
         animation.Disposed -= handler;
         RemoveEffect(EffectTypes.Burst);
     };
     AddEffect(animation, EffectTypes.Burst);
 }
Ejemplo n.º 25
0
 /// <summary>
 /// 移除动画(完成后需要配合清除animationList对应的项)
 /// </summary>
 /// <param name="animation"></param>
 void Remove(AnimationBase animation)
 {
     space.Children.Remove(animation);
     if (animation.ID != 0) { RemoveShadow(animation.ID); }
     animation.Dispose(animation, null);
 }
Ejemplo n.º 26
0
 /// <summary>
 /// 角色死亡(移除)处理
 /// </summary>
 void role_Disposed(object sender, EventArgs e)
 {
     RoleBase role = sender as RoleBase;
     role.Disposed -= role_Disposed;
     role.IntervalTrigger -= role_TacticDecide;
     role.ActionTrigger -= role_ShadowSync;
     role.ActionTrigger -= role_ActionDecide;
     role.DoAttack -= role_DoAttack;
     role.DoCasting -= role_DoCasting;
     role.PositionChanged -= role_PositionChanged;
     role.LifeChanged -= role_LifeChanged;
     role.LifeChanged -= TargetInfo_LifeChanged;
     role.LifeMaxChanged -= TargetInfo_LifeChanged;
     role.Target = null;
     textBlock6.Text = string.Format("[场景中共{0}个角色]", space.AllRoles().Count);
     //蒸发动画
     EventHandler handler = null;
     AnimationBase animation = new AnimationBase() {
         Code = 2,
         SpaceLayer = role.SpaceLayer,
         Position = role.Position,
     };
     space.SetSpriteVisible(animation, animation.InSight(leader));
     animation.Disposed += handler = (s0, e0) => {
         animation.Disposed -= handler;
         space.RemoveAnimation(animation);
     };
     space.AddAnimation(animation);
 }