Ejemplo n.º 1
0
 /// <summary>
 /// 使用繪製物件和移動物件建立互動性活動物件
 /// </summary>
 /// <param name="drawObject">繪製物件</param>
 /// <param name="moveObject">移動物件</param>
 public ObjectActive(DrawBase drawObject, MoveBase moveObject)
     : base(drawObject, moveObject)
 {
     Skills          = new SkillCollection();
     Energy          = new CounterObject(Global.DefaultEnergyLimit, Global.DefaultEnergyLimit, false);
     EnergyGetPerSec = Global.DefaultEnergyGetPerSec;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 使用繪圖工具管理物件新增框架繪圖物件
 /// </summary>
 /// <param name="drawColor">繪圖工具管理物件</param>
 /// <param name="borderWidtrh">框線粗細</param>
 /// <param name="readius">圓角大小</param>
 /// <param name="iconDrawObject">內部繪圖物件</param>
 public DrawUIFrame(DrawColors drawColor, int borderWidtrh, int readius, DrawBase iconDrawObject)
     : base(drawColor)
 {
     BorderWidth      = borderWidtrh;
     Readius          = readius;
     DrawObjectInside = iconDrawObject;
 }
Ejemplo n.º 3
0
        public override void DoAfterDead(ObjectBase killer, ObjectDeadType deadType)
        {
            if (Owner.DrawObject == DrawNull.Value || (DeadType & deadType) != deadType)
            {
                return;
            }

            double angle = Function.GetAngle(0, 0, Owner.MoveObject.MoveX, Owner.MoveObject.MoveY);

            for (int i = 0; i < ScrapCount; i++)
            {
                int    speed          = Global.Rand.Next(ScrapSpeedMin, Math.Max(ScrapSpeedMin, ScrapSpeedMax));
                int    fadeTime       = Global.Rand.Next(ScrapLifeMin, Math.Max(ScrapLifeMin, ScrapLifeMax));
                double scrapDirection = angle + (Global.Rand.NextDouble() - 0.5) * Radiation;

                MoveStraight moveObject = new MoveStraight(null, 1, speed, 1, 0, 1);
                moveObject.Target.SetOffsetByAngle(scrapDirection, 1000);
                ObjectSmoke newObject;
                if (ScrapDrawObject == null)
                {
                    newObject = new ObjectSmoke(Owner.Layout.CenterX, Owner.Layout.CenterY, ScrapWidth, ScrapHeight, fadeTime, 1, 0, Owner.DrawObject.MainColor, moveObject);
                }
                else
                {
                    DrawBase scrapDraw = ScrapDrawObject.Copy();
                    scrapDraw.Angle = Global.Rand.Next(360);
                    newObject       = new ObjectSmoke(Owner.Layout.CenterX, Owner.Layout.CenterY, ScrapWidth, ScrapHeight, fadeTime, 1, 0, scrapDraw, moveObject);
                    newObject.Propertys.Add(new PropertyRotate(-1, Global.Rand.Next(280, 520), false, true));
                }
                moveObject.Target.SetObject(newObject);
                Owner.Container.Add(newObject);
            }

            base.DoAfterDead(killer, deadType);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// 新增框架繪圖物件
 /// </summary>
 /// <param name="borderColor">框線顏色</param>
 /// <param name="backColor">背景色</param>
 /// <param name="borderWidtrh">框線粗細</param>
 /// <param name="readius">圓角大小</param>
 /// <param name="iconDrawObject">內部繪圖物件</param>
 public DrawUIFrame(Color backColor, Color borderColor, int borderWidtrh, int readius, DrawBase iconDrawObject)
 {
     Colors.SetColor("Border", borderColor);
     Colors.SetColor("Back", backColor);
     BorderWidth      = borderWidtrh;
     Readius          = readius;
     DrawObjectInside = iconDrawObject;
 }
Ejemplo n.º 5
0
 protected override void OnDrawObjectChanged(DrawBase oldValue, DrawBase newValue)
 {
     if (!_FocusSwitch)
     {
         DrawObjectOrigin = DrawObject;
     }
     base.OnDrawObjectChanged(oldValue, newValue);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 使用繪製物件和移動物件建立基本活動物件
 /// </summary>
 /// <param name="drawObject">繪製物件</param>
 /// <param name="moveObject">移動物件</param>
 public ObjectBase(DrawBase drawObject, MoveBase moveObject)
 {
     Layout     = new LayoutSet();
     Status     = ObjectStatus.Alive;
     League     = LeagueType.None;
     Life       = new CounterObject(-1);
     Propertys  = new PropertyCollection();
     DrawObject = drawObject;
     MoveObject = moveObject;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 使用指定的定位點和移動物件建立介面物件
 /// </summary>
 /// <param name="x">物件左上位置X</param>
 /// <param name="y">物件左上位置Y</param>
 /// <param name="width">物件寬度</param>
 /// <param name="height">物件高度</param>
 /// <param name="drawObject">繪製物件</param>
 /// <param name="DrawObjectHover">滑鼠滑過時顯示的繪圖物件(null為不切換)</param>
 /// <param name="moveObject">移動物件</param>
 public ObjectUI(DirectionType anchor, int x, int y, int width, int height, DrawBase drawObject, MoveBase moveObject)
     : base(drawObject, moveObject)
 {
     Layout.CollisonShape = ShapeType.Rectangle;
     Layout.Anchor        = anchor;
     Layout.X             = x;
     Layout.Y             = y;
     Layout.Width         = width;
     Layout.Height        = height;
     Enabled = true;
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 使用指定的配置建立互動性活動物件
 /// </summary>
 /// <param name="layout">配置資訊</param>
 /// <param name="life">存活時間,小於0為永久</param>
 /// <param name="leage">物件所屬陣營,供技能或特性判定</param>
 /// <param name="drawObject">繪製物件</param>
 /// <param name="moveObject">移動物件</param>
 public ObjectActive(LayoutSet layout, int life, LeagueType leage, DrawBase drawObject, MoveBase moveObject)
     : this(drawObject, moveObject)
 {
     Layout.CollisonShape = layout.CollisonShape;
     Layout.Anchor        = layout.Anchor;
     Layout.X             = layout.X;
     Layout.Y             = layout.Y;
     Layout.Width         = layout.Width;
     Layout.Height        = layout.Height;
     League     = leage;
     Life.Limit = life;
 }
Ejemplo n.º 9
0
        public override void DoAfterAction()
        {
            if (Owner.DrawObject == null)
            {
                return;
            }

            DrawBase drawSmoke = Owner.DrawObject.Copy();

            drawSmoke.Colors.Opacity *= SmokeOpacity;
            Owner.Container.Add(new ObjectSmoke(Owner.Layout, ShrinkLimit, 0, 0, drawSmoke, MoveNull.Value));
            base.DoAfterAction();
        }
Ejemplo n.º 10
0
        /// <summary>
        /// 綁定繪製物件到另一個繪製物件(繪圖物件>物件>場景)
        /// </summary>
        /// <param name="drawBase">繪圖物件</param>
        /// <param name="bindingLock">綁定後是否鎖定綁定功能</param>
        public virtual void Binding(DrawBase drawBase, bool bindingLock = false)
        {
            if (_BindDraw == drawBase)
            {
                return;
            }
            if (BindingLock)
            {
                throw new Exception("繪製物件已被鎖定無法綁定");
            }

            BindDraw    = drawBase;
            Owner       = null;
            Scene       = null;
            BindingLock = bindingLock;
            OnBindingChanged();
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 發生於繪圖物件變更
        /// </summary>
        protected virtual void OnDrawObjectChanged(DrawBase oldValue, DrawBase newValue)
        {
            if (oldValue != null)
            {
                oldValue.BindingUnlock();
                oldValue.Binding(Scene);
            }

            if (newValue != null)
            {
                newValue.Binding(this, true);
            }

            if (DrawObjectChanged != null)
            {
                DrawObjectChanged(this, oldValue, newValue);
            }
        }
        private void GetDrawObject()
        {
            if (_BaseDrawObject != Owner.DrawObject && _DrawObject != null)
            {
                if (_DrawObject != DrawNull.Value)
                {
                    _DrawObject.Dispose();
                }
                _DrawObject = null;
            }

            if (_DrawObject == null)
            {
                _BaseDrawObject         = Owner.DrawObject;
                _DrawObject             = _BaseDrawObject.Copy();
                _DrawObject.Colors.RFix = RFix;
                _DrawObject.Colors.GFix = GFix;
                _DrawObject.Colors.BFix = BFix;
                _DrawObject.Binding(_BaseDrawObject);
            }
        }
Ejemplo n.º 13
0
        public override void DoAfterAction()
        {
            if (ScrapDrawObject == null && Owner.DrawObject == DrawNull.Value)
            {
                return;
            }

            if (BuildTime.IsFull)
            {
                for (int i = 0; i < ScrapCount; i++)
                {
                    int    speed          = Global.Rand.Next(ScrapSpeedMin, Math.Max(ScrapSpeedMin, ScrapSpeedMax) + 1);
                    int    life           = Global.Rand.Next(ScrapLifeMin, Math.Max(ScrapLifeMin, ScrapLifeMax) + 1);
                    double scrapDirection = Global.Rand.NextDouble() * 360;

                    MoveStraight moveObject = new MoveStraight(null, 1, speed, 1, 0, 1);
                    moveObject.Target.SetOffsetByAngle(scrapDirection, 1000);
                    ObjectSmoke newObject;
                    if (ScrapDrawObject == null)
                    {
                        newObject = new ObjectSmoke(Owner.Layout.CenterX, Owner.Layout.CenterY, ScrapWidth, ScrapHeight, life, 1, 0, Owner.DrawObject.MainColor, moveObject);
                    }
                    else
                    {
                        DrawBase scrapDraw = ScrapDrawObject.Copy();
                        scrapDraw.Angle = Global.Rand.Next(360);
                        newObject       = new ObjectSmoke(Owner.Layout.CenterX, Owner.Layout.CenterY, ScrapWidth, ScrapHeight, life, 1, 0, scrapDraw, moveObject);
                        newObject.Propertys.Add(new PropertyRotate(-1, Global.Rand.Next(280, 520), false, true));
                    }
                    moveObject.Target.SetObject(newObject);
                    Owner.Container.Add(newObject);
                }
                BuildTime.Value = 0;
            }
            else
            {
                BuildTime.Value += Scene.SceneIntervalOfRound;
            }
            base.DoAfterAction();
        }
Ejemplo n.º 14
0
 /// <summary>
 /// 新增破碎特性且指定碎片顏色,擁有此特性的物件死亡時會造成碎片飛散
 /// </summary>
 /// <param name="color">產生碎片顏色</param>
 /// <param name="scrapCount">產生碎片數量</param>
 /// <param name="scrapWidth">碎片寬度</param>
 /// <param name="scrapHeight">碎片高度</param>
 /// <param name="deadType">符合指定的死亡方式才會觸發</param
 /// <param name="radiation">擴散角度</param>
 /// <param name="scrapSpeedMax">碎片移動速度最大值</param>
 /// <param name="scrapSpeedMin">碎片移動速度最小值</param>
 /// <param name="scrapLifeMax">碎片生命週期最大值</param>
 /// <param name="scrapLifeMin">碎片生命週期最小值</param>
 public PropertyDeadBroken(Color color, int scrapCount, int scrapWidth, int scrapHeight, ObjectDeadType deadType, int radiation, int scrapSpeedMin, int scrapSpeedMax, int scrapLifeMin, int scrapLifeMax) :
     this(scrapCount, scrapWidth, scrapHeight, deadType, radiation, scrapSpeedMin, scrapSpeedMax, scrapLifeMin, scrapLifeMax)
 {
     ScrapDrawObject = new DrawBrush(color, ShapeType.Ellipse);
 }
Ejemplo n.º 15
0
        /// <summary>
        /// 技能生效
        /// </summary>
        public override void DoBeforeAction()
        {
            switch (Status)
            {
            case SkillStatus.Enabled:
            {
                if (Owner == null || Owner.MoveObject.Target.TargetType == TargetType.None)
                {
                    Break();
                    return;
                }

                // 新增誘餌物件
                double angle = Function.GetAngle(Owner.Layout.CenterX, Owner.Layout.CenterY, Owner.MoveObject.Target.X, Owner.MoveObject.Target.Y);

                MoveStraight move = new MoveStraight(null, Owner.MoveObject.Resistance, BaitSpeed, 1, 0, 1F);
                move.Target.SetOffsetByAngle(angle, 1000);

                DrawBase draw = Owner.DrawObject.Copy();
                draw.Colors.Opacity = 0.6F;

                ObjectActive bait = new ObjectActive(Owner.Layout, BaitLife, Owner.League, draw, move);
                move.Target.SetObject(bait);

                bait.Propertys.Add(new PropertySpeeded(-1, -(BaitSpeed / (float)BaitLife * 800)));
                bait.Propertys.Add(new PropertyCollision(0));         // 強度碰撞

                // 新增雜訊物件
                int        noiseWidth  = Owner.Layout.Width + 2;
                int        noiseHeight = (int)(Owner.Layout.Height * 1.3F + 0.5F) + 5;
                DrawNoise  drawNoise   = new DrawNoise(Owner.DrawObject.MainColor, Color.White, 1);
                ObjectWave noise       = new ObjectWave(0, 0, noiseWidth, noiseHeight, noiseWidth * 3, noiseHeight * 3, -1, 0, drawNoise, MoveNull.Value);
                noise.DiffusionOpacity = 0;
                noise.Layout.Depend.SetObject(bait);
                Owner.Container.Add(bait);
                Owner.Container.Add(noise);

                // 將目標設為誘餌
                for (int i = 0; i < Owner.Container.Count; i++)
                {
                    ObjectBase objectBase = Owner.Container[i];
                    if (objectBase.Status != ObjectStatus.Alive || Function.IsFriendly(objectBase.League, Owner.League))
                    {
                        continue;
                    }
                    if (objectBase.MoveObject.Target.Object == Owner)
                    {
                        objectBase.MoveObject.Target.SetObject(bait);
                    }
                }

                bait.Dead += (s, e, t) =>
                {
                    noise.DiffusionTime.Limit = Scene.Sec(0.2F);
                    noise.DiffusionTime.Value = 0;

                    if (Owner == null)
                    {
                        return;
                    }
                    for (int i = 0; i < Owner.Container.Count; i++)
                    {
                        ObjectBase objectBase = Owner.Container[i];
                        if (objectBase.Status != ObjectStatus.Alive)
                        {
                            continue;
                        }
                        if (objectBase.MoveObject.Target.Object == s)
                        {
                            objectBase.MoveObject.Target.SetObject(Owner);
                        }
                    }

                    SceneGaming scene = Scene as SceneGaming;
                    if (t == ObjectDeadType.LifeEnd && scene != null)
                    {
                        scene.AddScoreToPlayer("誘餌生還", 300);
                    }
                };
                Status = SkillStatus.Cooldown;
            }
            break;
            }

            base.DoBeforeAction();
        }
Ejemplo n.º 16
0
 /// <summary>
 /// 新增碎裂特性且指定炸彈外觀,擁有此特性的物件每回合會在原位置產生四散的炸彈
 /// </summary>
 /// <param name="duration">持續時間(毫秒),小於0為永久</param>
 /// <param name="buildTime">生產週期(毫秒)</param>
 /// <param name="bombDrawObject">炸彈外觀範本繪圖物件</param>
 /// <param name="bombCount">每次產生炸彈數量</param>
 /// <param name="bombWidth">炸彈寬度</param>
 /// <param name="bombHeight">炸彈高度</param>
 /// <param name="bombSpeedMax">炸彈移動速度最大值</param>
 /// <param name="bombSpeedMin">炸彈移動速度最小值</param>
 /// <param name="bombLifeMax">炸彈生命週期最大值</param>
 /// <param name="bombLifeMin">炸彈生命週期最小值</param>
 public PropertyBomber(DrawBase bombDrawObject, int duration, int buildTime, int bombCount, int bombWidth, int bombHeight, int bombSpeedMin, int bombSpeedMax, int bombLifeMin, int bombLifeMax)
     : this(duration, buildTime, bombCount, bombWidth, bombHeight, bombSpeedMin, bombSpeedMax, bombLifeMin, bombLifeMax)
 {
     BombDrawObject = bombDrawObject;
 }
Ejemplo n.º 17
0
 /// <summary>
 /// 新增碎裂特性且指定炸彈顏色,擁有此特性的物件每回合會在原位置產生四散的炸彈
 /// </summary>
 /// <param name="duration">持續時間(毫秒),小於0為永久</param>
 /// <param name="buildTime">生產週期(毫秒)</param>
 /// <param name="color">產生炸彈顏色</param>
 /// <param name="bombCount">每回合產生炸彈數量</param>
 /// <param name="bombWidth">炸彈寬度</param>
 /// <param name="bombHeight">炸彈高度</param>
 /// <param name="bombSpeedMax">炸彈移動速度最大值</param>
 /// <param name="bombSpeedMin">炸彈移動速度最小值</param>
 /// <param name="bombLifeMax">炸彈生命週期最大值</param>
 /// <param name="bombLifeMin">炸彈生命週期最小值</param>
 public PropertyBomber(Color color, int duration, int buildTime, int bombCount, int bombWidth, int bombHeight, int bombSpeedMin, int bombSpeedMax, int bombLifeMin, int bombLifeMax)
     : this(duration, buildTime, bombCount, bombWidth, bombHeight, bombSpeedMin, bombSpeedMax, bombLifeMin, bombLifeMax)
 {
     BombDrawObject = new DrawBrush(color, ShapeType.Ellipse);
 }
Ejemplo n.º 18
0
 /// <summary>
 /// 使用預設定位點(左上)建立不可移動介面物件
 /// </summary>
 /// <param name="x">物件左上位置X</param>
 /// <param name="y">物件左上位置Y</param>
 /// <param name="width">物件寬度</param>
 /// <param name="height">物件高度</param>
 /// <param name="drawObject">繪製物件</param>
 /// <param name="DrawObjectHover">滑鼠滑過時顯示的繪圖物件</param>
 /// <param name="moveObject">移動物件</param>
 public ObjectUI(int x, int y, int width, int height, DrawBase drawObject)
     : this(DirectionType.TopLeft, x, y, width, height, drawObject)
 {
 }
Ejemplo n.º 19
0
 /// <summary>
 /// 建立一個互動性活動物件
 /// </summary>
 /// <param name="x">物件中心位置X</param>
 /// <param name="y">物件中心位置Y</param>
 /// <param name="width">物件寬度</param>
 /// <param name="height">物件高度</param>
 /// <param name="life">存活時間,小於0為永久</param>
 /// <param name="collisonShape">碰撞形狀</param>
 /// <param name="leage">物件所屬陣營,供技能或特性判定</param>
 /// <param name="drawObject">繪製物件</param>
 /// <param name="moveObject">移動物件</param>
 public ObjectActive(float x, float y, int width, int height, int life, LeagueType leage, ShapeType collisonShape, DrawBase drawObject, MoveBase moveObject)
     : this(drawObject, moveObject)
 {
     Layout.CollisonShape = collisonShape;
     Layout.Anchor        = DirectionType.Center;
     Layout.X             = x;
     Layout.Y             = y;
     Layout.Width         = width;
     Layout.Height        = height;
     League     = leage;
     Life.Limit = life;
 }
Ejemplo n.º 20
0
 /// <summary>
 /// 新增虛擬物件,會逐漸縮小(放大)並淡出後消失
 /// </summary>
 /// <param name="x">物件位置X</param>
 /// <param name="y">物件位置Y</param>
 /// <param name="width">物件寬度</param>
 /// <param name="height">物件高度</param>
 /// <param name="fadeTime">淡出時間(毫秒),小於0為永久</param>
 /// <param name="finelScale">計時器結束時大小比例</param>
 /// <param name="finelOpacity">計時器結束時透明度</param>
 /// <param name="drawObject">繪製物件</param>
 /// <param name="moveObject">移動物件</param>
 public ObjectSmoke(float x, float y, int width, int height, int fadeTime, float finelScale, float finelOpacity, DrawBase drawObject, MoveBase moveObject) :
     base(drawObject, moveObject)
 {
     Layout.CollisonShape = ShapeType.Ellipse;
     Layout.Anchor        = DirectionType.Center;
     Layout.X             = x;
     Layout.Y             = y;
     Layout.Width         = width;
     Layout.Height        = height;
     Propertys.Add(new PropertyDeadSmoke(fadeTime, finelScale, finelOpacity, ObjectDeadType.All));
     Kill(null, ObjectDeadType.LifeEnd);
 }
Ejemplo n.º 21
0
        public SceneSkill()
        {
            InitializeComponent();

            _Skills = new SkillBase[]
            {
                new SkillSprint(3000, Sec(0.7F), 0, 6000, true),
                new SkillShield(1, 6000, 0, Sec(2F), Sec(3F)),
                new SkillShockwave(6000, 0, Sec(1.5F), Sec(2.5F), Sec(0.1F), 4000, 300),
                new SkillBulletTime(2000, 9000, -1, Sec(3), 1),
                new SkillBait(6000, Sec(2F), Sec(2F), 400),
                new SkillShotgun(5, 1, 60, 5000, Sec(1F))
                //new SkillSleep(3000,Sec(0.5F),Sec(0.5F))
            };

            if (DeveloperOptions.Player_NoCast)
            {
                foreach (SkillBase skill in _Skills)
                {
                    skill.CostEnergy       = 0;
                    skill.CostEnergyPerSec = 0;
                }
            }

            if (DeveloperOptions.Player_NoCooldown)
            {
                foreach (SkillBase skill in _Skills)
                {
                    skill.Cooldown.Limit = 0;
                }
            }

            int len = _Skills.Length;

            _UISkillIcons = new ObjectUI[len];
            _UISkillInfos = new ObjectUI[len];
            for (int i = 0; i < len; i++)
            {
                int              left      = i % 2 * 270 + 30;
                int              top       = i / 2 * 100 + 120;
                DrawBase         skillDraw = _Skills[i].GetDrawObject(Color.FromArgb(120, 60, 0));
                DrawUISkillFrame drawFrame = new DrawUISkillFrame(Color.White, Color.FromArgb(210, 180, 50), 2, 10, SkillKeyType.None, skillDraw)
                {
                    StaticMode = true
                };
                _UISkillIcons[i]           = new ObjectUI(left, top, 75, 75, drawFrame);
                _UISkillIcons[i].GetFocus += (s, e) =>
                {
                    (s as ObjectUI).DrawObject.Colors.SetColor("Border", Color.Chocolate);
                    (s as ObjectUI).DrawObject.Scale = 1.1F;
                };
                _UISkillIcons[i].LostFocus += (s, e) =>
                {
                    (s as ObjectUI).DrawObject.Colors.SetColor("Border", Color.FromArgb(210, 180, 50));
                    (s as ObjectUI).DrawObject.Scale = 1F;
                };
                _UISkillIcons[i].Click += IconClick;

                DrawBase infoDraw = _Skills[i].GetInfoObject(Color.Chocolate, Color.Cornsilk, Color.FromArgb(180, 210, 180, 50));
                _UISkillInfos[i] = new ObjectUI(left + 85, top + 6, 170, 75, infoDraw);

                _UISkillIcons[i].Propertys.Add(new PropertyShadow(4, 6, 1, 1, 0.2F)
                {
                    RFix = -0.3F, GFix = -0.3F, BFix = -0.3F
                });

                if (GlobalScenes.ChoiceSkill1 != null && _Skills[i].ID == GlobalScenes.ChoiceSkill1.ID)
                {
                    Skill1 = drawFrame;
                    drawFrame.DrawButton = SkillKeyType.MouseButtonLeft;
                }
                else if (GlobalScenes.ChoiceSkill2 != null && _Skills[i].ID == GlobalScenes.ChoiceSkill2.ID)
                {
                    Skill2 = drawFrame;
                    drawFrame.DrawButton = SkillKeyType.MouseButtonRight;
                }

                UIObjects.Add(_UISkillIcons[i]);
                UIObjects.Add(_UISkillInfos[i]);
            }

            DrawUIText drawCommandOK          = new DrawUIText(Color.Black, Color.WhiteSmoke, Color.FromArgb(150, 255, 255, 255), Color.Black, 2, 10, "繼續", Global.CommandFont, GlobalFormat.MiddleCenter);
            DrawUIText drawCommandCancel      = new DrawUIText(Color.Black, Color.WhiteSmoke, Color.FromArgb(150, 255, 255, 255), Color.Black, 2, 10, "返回", Global.CommandFont, GlobalFormat.MiddleCenter);
            DrawUIText drawCommandOKHover     = new DrawUIText(Color.Black, Color.WhiteSmoke, Color.FromArgb(200, 255, 255, 220), Color.Black, 2, 10, "繼續", Global.CommandFont, GlobalFormat.MiddleCenter);
            DrawUIText drawCommandCancelHover = new DrawUIText(Color.Black, Color.WhiteSmoke, Color.FromArgb(200, 255, 255, 220), Color.Black, 2, 10, "返回", Global.CommandFont, GlobalFormat.MiddleCenter);

            _UICommandOK                     = new ObjectUI(0, 0, 150, 50, drawCommandOK);
            _UICommandCancel                 = new ObjectUI(0, 0, 150, 50, drawCommandCancel);
            _UICommandOK.DrawObjectHover     = drawCommandOKHover;
            _UICommandCancel.DrawObjectHover = drawCommandCancelHover;
            _UICommandOK.Propertys.Add(new PropertyShadow(-4, 4)
            {
                RFix = 0, GFix = 0, BFix = 0
            });
            _UICommandCancel.Propertys.Add(new PropertyShadow(4, 4)
            {
                RFix = 0, GFix = 0, BFix = 0
            });

            UIObjects.Add(_UICommandOK);
            UIObjects.Add(_UICommandCancel);

            _UICommandOK.Click += (x, e) =>
            {
                GlobalScenes.ChoiceSkill1 = Skill1 == null ? null : (Skill1.DrawObjectInside as DrawSkillBase).BindingSkill;
                GlobalScenes.ChoiceSkill2 = Skill2 == null ? null : (Skill2.DrawObjectInside as DrawSkillBase).BindingSkill;
                SceneGaming scene = GlobalScenes.ChoiceScene.CreateScene(GlobalScenes.ChoiceLevel);
                OnGoScene(scene);
            };

            _UICommandCancel.Click += (x, e) =>
            {
                OnGoScene(new SceneMain()
                {
                });
            };
        }
Ejemplo n.º 22
0
 /// <summary>
 /// 使用繪圖工具管理物件新增技能框架繪圖物件
 /// </summary>
 /// <param name="borderColor">框線顏色</param>
 /// <param name="backColor">背景色</param>
 /// <param name="borderWidtrh">框線粗細</param>
 /// <param name="readius">圓角大小</param>
 /// <param name="drawButton">繪製技能熱鍵</param>
 /// <param name="iconDrawObject">技能繪製物件</param>
 public DrawUISkillFrame(Color backColor, Color borderColor, int borderWidtrh, int readius, SkillKeyType drawButton, DrawBase iconDrawObject)
     : base(backColor, borderColor, borderWidtrh, readius, iconDrawObject)
 {
     DrawButton = drawButton;
     Colors.SetColor("Button", Color.Black);
     Colors.SetColor("Channel", GlobalColors.Channeled);
 }
Ejemplo n.º 23
0
 /// <summary>
 /// 新增碎裂特性且指定碎片外觀,擁有此特性的物件每回合會在原位置產生四散的碎片
 /// </summary>
 /// <param name="duration">持續時間(毫秒),小於0為永久</param>
 /// <param name="buildTime">生產週期(毫秒)</param>
 /// <param name="scrapDrawObject">碎片外觀範本繪圖物件</param>
 /// <param name="scrapCount">每回合產生碎片數量</param>
 /// <param name="scrapWidth">碎片寬度</param>
 /// <param name="scrapHeight">碎片高度</param>
 /// <param name="scrapSpeedMax">碎片移動速度最大值</param>
 /// <param name="scrapSpeedMin">碎片移動速度最小值</param>
 /// <param name="scrapLifeMax">碎片生命週期最大值</param>
 /// <param name="scrapLifeMin">碎片生命週期最小值</param>
 public PropertyScraping(DrawBase scrapDrawObject, int duration, int buildTime, int scrapCount, int scrapWidth, int scrapHeight, int scrapSpeedMin, int scrapSpeedMax, int scrapLifeMin, int scrapLifeMax)
     : this(duration, buildTime, scrapCount, scrapWidth, scrapHeight, scrapSpeedMin, scrapSpeedMax, scrapLifeMin, scrapLifeMax)
 {
     ScrapDrawObject = scrapDrawObject;
 }
Ejemplo n.º 24
0
 /// <summary>
 /// 新增碎裂特性且指定碎片顏色,擁有此特性的物件每回合會在原位置產生四散的碎片
 /// </summary>
 /// <param name="duration">持續時間(毫秒),小於0為永久</param>
 /// <param name="buildTime">生產週期(毫秒)</param>
 /// <param name="color">產生碎片顏色</param>
 /// <param name="scrapCount">每回合產生碎片數量</param>
 /// <param name="scrapWidth">碎片寬度</param>
 /// <param name="scrapHeight">碎片高度</param>
 /// <param name="scrapSpeedMax">碎片移動速度最大值</param>
 /// <param name="scrapSpeedMin">碎片移動速度最小值</param>
 /// <param name="scrapLifeMax">碎片生命週期最大值</param>
 /// <param name="scrapLifeMin">碎片生命週期最小值</param>
 public PropertyScraping(Color color, int duration, int buildTime, int scrapCount, int scrapWidth, int scrapHeight, int scrapSpeedMin, int scrapSpeedMax, int scrapLifeMin, int scrapLifeMax)
     : this(duration, buildTime, scrapCount, scrapWidth, scrapHeight, scrapSpeedMin, scrapSpeedMax, scrapLifeMin, scrapLifeMax)
 {
     ScrapDrawObject = new DrawBrush(color, ShapeType.Ellipse);
 }
Ejemplo n.º 25
0
 /// <summary>
 /// 新增崩塌特性且指定碎片外觀,擁有此特性的物件死亡時會逐漸縮小並碎裂
 /// </summary>
 /// <param name="scrapDrawObject">碎片外觀範本繪圖物件</param>
 /// <param name="buildTime">產生碎片週期(毫秒)</param>
 /// <param name="scrapCount">每回合產生碎片數量</param>
 /// <param name="shrinkTime">縮小時間(毫秒)</param>
 /// <param name="scrapWidth">碎片寬度</param>
 /// <param name="scrapHeight">碎片高度</param>
 /// <param name="deadType">符合指定的死亡方式才會觸發</param>
 /// <param name="scrapSpeedMax">碎片移動速度最大值</param>
 /// <param name="scrapSpeedMin">碎片移動速度最小值</param>
 /// <param name="scrapLifeMax">碎片生命週期最大值</param>
 /// <param name="scrapLifeMin">碎片生命週期最小值</param>
 public PropertyDeadCollapse(DrawBase scrapDrawObject, int scrapCount, int shrinkTime, int buildTime, int scrapWidth, int scrapHeight, ObjectDeadType deadType, int scrapSpeedMin, int scrapSpeedMax, int scrapLifeMin, int scrapLifeMax)
     : this(scrapCount, shrinkTime, buildTime, scrapWidth, scrapHeight, deadType, scrapSpeedMin, scrapSpeedMax, scrapLifeMin, scrapLifeMax)
 {
     ScrapDrawObject = scrapDrawObject;
 }
Ejemplo n.º 26
0
 /// <summary>
 /// 使用指定的配置新增虛擬物件,會逐漸縮小(放大)並淡出後消失
 /// </summary>
 /// <param name="layout">配置資訊</param>
 /// <param name="fadeTime">淡出時間(毫秒),小於0為永久</param>
 /// <param name="finelScale">計時器結束時大小比例</param>
 /// <param name="finelOpacity">計時器結束時透明度</param>
 /// <param name="drawObject">繪製物件</param>
 /// <param name="moveObject">移動物件</param>
 public ObjectSmoke(LayoutSet layout, int fadeTime, float finelScale, float finelOpacity, DrawBase drawObject, MoveBase moveObject)
     : this(layout.CenterX, layout.CenterY, layout.RectWidth, layout.RectHeight, fadeTime, finelScale, finelOpacity, drawObject, moveObject)
 {
 }
Ejemplo n.º 27
0
 /// <summary>
 /// 新增破碎特性且指定碎片外觀,擁有此特性的物件死亡時會造成碎片飛散
 /// </summary>
 /// <param name="scrapDrawObject">碎片外觀範本繪圖物件</param>
 /// <param name="scrapCount">產生碎片數量</param>
 /// <param name="scrapWidth">碎片寬度</param>
 /// <param name="scrapHeight">碎片高度</param>
 /// <param name="deadType">符合指定的死亡方式才會觸發</param>
 /// <param name="radiation">擴散角度</param>
 /// <param name="scrapSpeedMax">碎片移動速度最大值</param>
 /// <param name="scrapSpeedMin">碎片移動速度最小值</param>
 /// <param name="scrapLifeMax">碎片生命週期最大值</param>
 /// <param name="scrapLifeMin">碎片生命週期最小值</param>
 public PropertyDeadBroken(DrawBase scrapDrawObject, int scrapCount, int scrapWidth, int scrapHeight, ObjectDeadType deadType, int radiation, int scrapSpeedMin, int scrapSpeedMax, int scrapLifeMin, int scrapLifeMax) :
     this(scrapCount, scrapWidth, scrapHeight, deadType, radiation, scrapSpeedMin, scrapSpeedMax, scrapLifeMin, scrapLifeMax)
 {
     ScrapDrawObject = scrapDrawObject;
 }
Ejemplo n.º 28
0
 /// <summary>
 /// 建立一個基本玩家物件範本
 /// </summary>
 /// <param name="x">物件中心位置X</param>
 /// <param name="y">物件中心位置Y</param>
 /// <param name="maxMoves">最大調整值紀錄數量</param>
 /// <param name="width">物件寬度</param>
 /// <param name="height">物件高度</param>
 /// <param name="speed">基本速度</param>
 /// <param name="leage">物件所屬陣營,供技能或特性判定</param>
 /// <param name="drawObject">繪製物件</param>
 /// <param name="moveObject">移動物件</param>
 public ObjectPlayer(float x, float y, int maxMoves, int width, int height, float speed, LeagueType leage, DrawBase drawObject, MovePlayer moveObject) :
     base(x, y, width, height, -1, leage, ShapeType.Ellipse, drawObject, moveObject)
 {
 }
Ejemplo n.º 29
0
 /// <summary>
 /// 使用指定的定位點建立不可移動介面物件
 /// </summary>
 /// <param name="anchor">定位點位置X</param>
 /// <param name="x">物件左上位置X</param>
 /// <param name="y">物件左上位置Y</param>
 /// <param name="width">物件寬度</param>
 /// <param name="height">物件高度</param>
 /// <param name="drawObject">繪製物件</param>
 /// <param name="DrawObjectHover">滑鼠滑過時顯示的繪圖物件</param>
 public ObjectUI(DirectionType anchor, int x, int y, int width, int height, DrawBase drawObject)
     : this(anchor, x, y, width, height, drawObject, MoveNull.Value)
 {
 }
Ejemplo n.º 30
0
 /// <summary>
 /// 新增崩塌特性且指定碎片顏色,擁有此特性的物件死亡時會逐漸縮小並碎裂
 /// </summary>
 /// <param name="color">產生碎片顏色</param>
 /// <param name="buildTime">產生碎片週期(毫秒)</param>
 /// <param name="scrapCount">每回合產生碎片數量</param>
 /// <param name="shrinkTime">縮小時間(毫秒)</param>
 /// <param name="scrapWidth">碎片寬度</param>
 /// <param name="scrapHeight">碎片高度</param>
 /// <param name="deadType">符合指定的死亡方式才會觸發</param>
 /// <param name="scrapSpeedMax">碎片移動速度最大值</param>
 /// <param name="scrapSpeedMin">碎片移動速度最小值</param>
 /// <param name="scrapLifeMax">碎片生命週期最大值</param>
 /// <param name="scrapLifeMin">碎片生命週期最小值</param>
 public PropertyDeadCollapse(Color color, int scrapCount, int shrinkTime, int buildTime, int scrapWidth, int scrapHeight, ObjectDeadType deadType, int scrapSpeedMin, int scrapSpeedMax, int scrapLifeMin, int scrapLifeMax)
     : this(scrapCount, shrinkTime, buildTime, scrapWidth, scrapHeight, deadType, scrapSpeedMin, scrapSpeedMax, scrapLifeMin, scrapLifeMax)
 {
     ScrapDrawObject = new DrawBrush(color, ShapeType.Ellipse);
 }