using JobBars.Buffs;
using JobBars.Cooldowns;
using JobBars.Cursors;
using JobBars.Data;

using JobBars.Gauges;
using JobBars.Gauges.Procs;
using JobBars.Gauges.Stacks;
using JobBars.Gauges.Timer;
using JobBars.Helper;
using JobBars.Icons;
using JobBars.UI;
using System;

namespace JobBars.Jobs {
    public static class BLM {
        public static GaugeConfig[] Gauges => new GaugeConfig[] {
            new GaugeProcsConfig($"{UIHelper.Localize(JobIds.BLM)} {UIHelper.ProcText}", GaugeVisualType.Diamond, new GaugeProcProps{
                显示文本 = true,
                进程 = new []{
                    new ProcConfig(UIHelper.Localize(BuffIds.Firestarter), BuffIds.Firestarter, UIColor.Orange),
                    new ProcConfig(UIHelper.Localize(BuffIds.Thundercloud), BuffIds.Thundercloud, UIColor.LightBlue)
                }
            }),
            new GaugeStacksConfig(UIHelper.Localize(BuffIds.Triplecast), GaugeVisualType.Diamond, new GaugeStacksProps {
                MaxStacks = 3,
                Triggers = new []{
                    new Item(BuffIds.Triplecast)
                },
                Color = UIColor.法条色
            }),
            new GaugeTimerConfig(UIHelper.Localize(BuffIds.Thunder3), GaugeVisualType.条状, new GaugeTimerProps {
                SubTimers = new[] {
                    new GaugeSubTimerProps {
                        MaxDuration = 30,
                        Color = UIColor.DarkBlue,
                        SubName = UIHelper.Localize(BuffIds.Thunder3),
                        Triggers = new []{
                            new Item(BuffIds.Thunder3),
                            new Item(BuffIds.Thunder)
                        }
                    },
                    new GaugeSubTimerProps {
                        MaxDuration = 18,
                        Color = UIColor.Purple,
                        SubName = UIHelper.Localize(BuffIds.Thunder4),
                        Triggers = new []{
                            new Item(BuffIds.Thunder4),
                            new Item(BuffIds.Thunder2)
                        }
                    }
                }
            })
        };

        public static BuffConfig[] Buffs => Array.Empty<BuffConfig>();

        public static Cursor Cursors => new(JobIds.BLM, CursorType.跳蓝, CursorType.咏唱时间);

        public static CooldownConfig[] Cooldowns => new[] {
            new CooldownConfig($"{UIHelper.Localize(ActionIds.Addle)} ({UIHelper.Localize(JobIds.BLM)})", new CooldownProps {
                Icon = ActionIds.Addle,
                Duration = 10,
                CD = 90,
                Triggers = new []{ new Item(ActionIds.Addle) }
            })
        };

        public static IconReplacer[] Icons => new[] {
            new IconBuffReplacer(UIHelper.Localize(BuffIds.Thunder3), new IconBuffProps {
                IsTimer = true,
                Icons = new [] {
                    ActionIds.Thunder,
                    ActionIds.Thunder3
                },
                Triggers = new[] {
                    new IconBuffTriggerStruct { Trigger = new Item(BuffIds.Thunder), Duration = 21 },
                    new IconBuffTriggerStruct { Trigger = new Item(BuffIds.Thunder3), Duration = 30 }
                }
            }),
            new IconBuffReplacer(UIHelper.Localize(BuffIds.Thunder4), new IconBuffProps {
                IsTimer = true,
                Icons = new [] {
                    ActionIds.Thunder2,
                    ActionIds.Thunder4
                },
                Triggers = new[] {
                    new IconBuffTriggerStruct { Trigger = new Item(BuffIds.Thunder2), Duration = 18 },
                    new IconBuffTriggerStruct { Trigger = new Item(BuffIds.Thunder4), Duration = 18 }
                }
            }),
            new IconBuffReplacer(UIHelper.Localize(BuffIds.LeyLines), new IconBuffProps {
                Icons = new [] { ActionIds.LeyLines },
                Triggers = new[] {
                    new IconBuffTriggerStruct { Trigger = new Item(BuffIds.LeyLines), Duration = 30 }
                }
            }),
            new IconBuffReplacer(UIHelper.Localize(BuffIds.Sharpcast), new IconBuffProps {
                Icons = new [] { ActionIds.Sharpcast },
                Triggers = new[] {
                    new IconBuffTriggerStruct { Trigger = new Item(BuffIds.Sharpcast), Duration = 30 }
                }
            })
        };

        public static bool MP => true;

        public static float[] MP_SEGMENTS => new[] { 0.88f }; // 3f4 (with umbral hearts) + 1f4 + 3f4
    }
}
