Beispiel #1
0
        private void DrawSkill(Graphics g, Battler battler, CustomSkill item, Rectangle skillrect, Point offset)
        {
            if (0 < skillrect.Width)
            {
                var drawrect = new Rectangle(skillrect.X + offset.X, skillrect.Y + offset.Y, skillrect.Width, skillrect.Height);

                var color = GetColor(item);
                LinearGradientBrush gb = new LinearGradientBrush(
                    drawrect, color, Color.White, LinearGradientMode.Horizontal);

                g.FillRectangle(gb, drawrect);
                g.DrawRectangle(Pens.DarkGray, drawrect);
                if (item.darty)
                {
                    var flute = drawrect;
                    flute.Inflate(1, 1);
                    g.DrawRectangle(Pens.DarkGray, flute);
                }

                if (item.name != null && item.Type != SkillType.Attack)
                {
                    var clip = g.ClipBounds;
                    g.SetClip(drawrect);
                    g.DrawString(item.name, this.Font, Brushes.Black, drawrect.X + 1, drawrect.Y + 1);
                    g.SetClip(clip);
                }
            }
        }
Beispiel #2
0
        public Battler(Avatar avatar)
        {
            this.avatar = avatar;

            float time = 0.0f;

            Skill skill = null;

            foreach (var next in avatar.ActionOrder())
            {
                if (next == null)
                {
                    break;
                }
                if (120f < time)
                {
                    break;
                }

                if (skill != null)
                {
                    CustomSkill cskill = new CustomSkill(skill, next.type);
                    timeline.Add(cskill);
                    var acttime = skill.GetActTime(next.type);
                    time += acttime.interval;
                }

                skill = next;
            }
            CreateBuffline();
        }
Beispiel #3
0
        private Color GetColor(CustomSkill skill)
        {
            switch (skill.Type)
            {
            case SkillType.Opening:
                return(Color.White);

            case SkillType.Attack:
                return(Color.LightBlue);

            case SkillType.Skill1:
                return(Color.Orange);

            case SkillType.Skill2:
                return(Color.LightPink);

            case SkillType.UnionBurst:
                return(Color.Red);

            case SkillType.Bind:
                return(Color.LightYellow);

            case SkillType.Dead:
                return(Color.DarkGray);

            default:
                return(Color.White);
            }
        }
Beispiel #4
0
        public List <Battler> DeSerialize()
        {
            var battlelist = new List <Battler>();

            foreach (var item in blist)
            {
                var avatar  = avatarlist.Find(n => n.aliasName == item.aliasName);
                var battler = new Battler(avatar);
                battlelist.Add(battler);

                foreach (var ssketch in item.skillsketch)
                {
                    var battlerskill = battler.timeline[ssketch.index];
                    if (ssketch.type == battlerskill.Type)
                    {
                        battlerskill.adjustment = ssketch.adjustment;
                    }
                    else
                    {
                        var skill       = avatar.GetSkill(ssketch.type);
                        var insertskill = new CustomSkill(skill, SkillType.Default);
                        insertskill.adjustment = ssketch.adjustment;
                        battler.timeline.Insert(ssketch.index, insertskill);
                    }
                }
            }
            return(battlelist);
        }
Beispiel #5
0
 public DragPoint(float start, Rectangle rect, TimelineType dragpoint, CustomSkill skill)
 {
     this.start        = start;
     this.rect         = rect;
     this.dragpoint    = dragpoint;
     this.skill        = skill;
     this.attackresult = null;
 }
Beispiel #6
0
        private void deadToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var bind        = clickpoint.battler.avatar.GetSkill(Data.SkillType.Dead);
            var customskill = new CustomSkill(bind);

            AddCustomerSkill(clickpoint, customskill);

            CreatePoint();
        }
Beispiel #7
0
        private void unionburstToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var ub          = clickpoint.battler.avatar.GetSkill(Data.SkillType.UnionBurst);
            var customskill = new CustomSkill(ub);

            AddCustomerSkill(clickpoint, customskill);

            CreatePoint();
        }
Beispiel #8
0
 private void AddDragPoint(float time, CustomSkill current, Rectangle skillrect, CustomSkill before)
 {
     if (0 < skillrect.Width)
     {
         dragablepoint.Add(new DragPoint(
                               time, skillrect, TimelineType.Interval, current)
                           );
     }
 }
Beispiel #9
0
 private void AddCustomerSkill(ClickPoint cb, CustomSkill skill)
 {
     if (cb != null)
     {
         var addindex = cb.battler.timeline.FindIndex(n => n == cb.skill);
         if (0 <= addindex)
         {
             cb.battler.timeline.Insert(addindex + 1, skill);
         }
     }
 }
Beispiel #10
0
        private bool Deleteable(CustomSkill skill)
        {
            switch (skill.Type)
            {
            case SkillType.UnionBurst:
            case SkillType.Bind:
            case SkillType.Dead:
                return(true);

            default:
                return(false);
            }
        }
Beispiel #11
0
 private void AddClickPoint(Battler battler, CustomSkill skill, Rectangle skillrect, CustomSkill before)
 {
     if (0 < skillrect.Width)
     {
         clickablepoint.Add(new ClickPoint()
         {
             battler = battler,
             rect    = skillrect,
             skill   = skill,
             before  = before
         });
     }
 }
Beispiel #12
0
        public void CreatePoint()
        {
            SetWindowSize();
            dragablepoint.Clear();
            clickablepoint.Clear();

            CalcDamage();

            int bindex = 0;

            foreach (var battler in battlerlist)
            {
                CustomSkill before = null;
                float       time   = 0f;

                foreach (var(skill, srect) in SkillRectangle(battler.timeline, secondsize))
                {
                    var rect = new Rectangle(srect.X, srect.Y + TimeHeader + IconSize * bindex, srect.Width, srect.Height);

                    AddDragPoint(time, skill, rect, before);
                    AddClickPoint(battler, skill, rect, before);
                    before = skill;
                    time  += skill.interval;
                }
                bindex++;
            }

            var size = new Size(IconSize + righttime * secondsize, TimeHeader + IconSize * battlerlist.Count);

            var image = new Bitmap(size.Width, size.Height);

            CreatePicture(Graphics.FromImage(image), new Rectangle(Point.Empty, image.Size));
            pictureBox1.Image = image;

            Invalidate();
        }
Beispiel #13
0
 public SkillSketch(int index, CustomSkill skill)
 {
     this.index      = index;
     this.type       = skill.Type;
     this.adjustment = skill.adjustment;
 }