コード例 #1
0
        /// <summary>
        /// IS_TOT_ME を更新する
        /// </summary>
        public static void RefreshIsToTMe()
        {
            var name = IS_TOT_ME;

            var player = CombatantsManager.Instance.Player;

            if (player != null)
            {
                if (player.TargetOfTargetID != 0)
                {
                    var value = player.IsTargetOfTargetMe;
                    if (SetVariable(name, value))
                    {
                        TimelineController.RaiseLog(
                            $"{TimelineConstants.LogSymbol} set VAR['{name}'] = {value}");

                        if ((DateTime.Now - totChangedTimestamp) > TimeSpan.FromSeconds(2))
                        {
                            totChangedTimestamp = DateTime.Now;
                            TimelineController.RaiseLog(
                                $"Target-of-Target has been changed.");
                        }
                    }
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// 1B Sign の最小値をリセットする(0xFFFF)
        /// </summary>
        public static void Reset1BSignOrigin()
        {
            const int SignInitialValue = 0xFFFF;

            TimelineController.RaiseLog(
                $"{TimelineConstants.LogSymbol} set VAR['{Origin1B}'] = {SignInitialValue} ({SignInitialValue:X4})");

            SetVariable(Origin1B, SignInitialValue, TimelineController.CurrentController?.CurrentZoneName);
        }
コード例 #3
0
        /// <summary>
        /// IS_FIRST_ENMITY_ME を更新する
        /// </summary>
        public static void RefreshIsFirstEnmityMe()
        {
            var name = IS_FIRST_ENMITY_ME;

            var value = SharlayanHelper.Instance.IsFirstEnmityMe;

            if (SetVariable(name, value))
            {
                TimelineController.RaiseLog(
                    $"{TimelineConstants.LogSymbol} set VAR['{name}'] = {value}");
            }
        }
コード例 #4
0
        /// <summary>
        /// ET を更新する
        /// </summary>
        public static void RefreshET()
        {
            var name = ET;

            var value = $"{EorzeaTime.Now.Hour:00}:00";

            if (SetVariable(name, value))
            {
                TimelineController.RaiseLog(
                    $"{TimelineConstants.LogSymbol} set VAR['{name}'] = {value}");
            }
        }
コード例 #5
0
        /// <summary>
        /// カレントゾーン情報 を更新する
        /// </summary>
        public static void RefreshZone()
        {
            var zoneID   = XIVPluginHelper.Instance.GetCurrentZoneID();
            var zoneName = XIVPluginHelper.Instance.GetCurrentZoneName();

            if (SetVariable(ZoneID, zoneID))
            {
                SetVariable(ZoneName, zoneName);
                TimelineController.RaiseLog(
                    $"{TimelineConstants.LogSymbol} set VAR['{ZoneID}'] = {zoneID}");
                TimelineController.RaiseLog(
                    $"{TimelineConstants.LogSymbol} set VAR['{ZoneName}'] = {zoneName}");
            }
        }
コード例 #6
0
        /// <summary>
        /// IN_TANK_STANCE を更新する
        /// </summary>
        public static void RefreshInTankStance()
        {
            var name = IN_TANK_STANCE;

            var player = CombatantsManager.Instance.Player;

            if (player != null)
            {
                var value = player.InTankStance();
                if (SetVariable(name, value))
                {
                    TimelineController.RaiseLog(
                        $"{TimelineConstants.LogSymbol} set VAR['{name}'] = {value}");
                }
            }
        }
コード例 #7
0
        /// <summary>
        /// IS_TOT_ME を更新する
        /// </summary>
        public static void RefreshIsToTMe()
        {
            var name = IS_TOT_ME;

            var player = CombatantsManager.Instance.Player;

            if (player != null)
            {
                if (player.TargetOfTargetID != 0)
                {
                    var value = player.IsTargetOfTargetMe;
                    if (SetVariable(name, value))
                    {
                        TimelineController.RaiseLog(
                            $"{TimelineController.TLSymbol} set ENV[\"{name}\"] = {value}");
                    }
                }
            }
        }
コード例 #8
0
        /// <summary>
        /// 1B Sign の最小値の更新を試みる
        /// </summary>
        /// <param name="logLine">
        /// ログ行</param>
        public static void TryRefresh1BSignOrigin(
            string logLine)
        {
            if (string.IsNullOrEmpty(logLine))
            {
                return;
            }

#if DEBUG
            if (logLine.Contains("1B:"))
            {
                Debug.WriteLine("TryRefresh1BSignOrigin");
            }
#endif

            if (!logLine.StartsWith("1B:") &&
                !logLine.StartsWith("00:0000:Hojoring:1B:"))
            {
                return;
            }

            var match = SignRegex.Match(logLine);
            if (!match.Success)
            {
                return;
            }

            var newSign = match.Groups["sign_code"].Value;

            if (!int.TryParse(
                    newSign,
                    NumberStyles.HexNumber,
                    CultureInfo.InvariantCulture,
                    out int newSignValue))
            {
                return;
            }

            var currentSignValue = int.MaxValue;

            if (Variables.ContainsKey(Origin1B))
            {
                if (Variables[Origin1B].Value != null)
                {
                    if (Variables[Origin1B].Value is int i)
                    {
                        currentSignValue = i;
                    }
                    else
                    {
                        var currentText = Variables[Origin1B].Value.ToString();
                        if (int.TryParse(
                                currentText,
                                NumberStyles.HexNumber,
                                CultureInfo.InvariantCulture,
                                out int j))
                        {
                            currentSignValue = j;
                        }
                    }
                }
            }

            if (newSignValue < currentSignValue)
            {
                TimelineController.RaiseLog(
                    $"{TimelineConstants.LogSymbol} set VAR['{Origin1B}'] = {newSignValue} ({newSignValue:X4})");

                SetVariable(Origin1B, newSignValue, TimelineController.CurrentController?.CurrentZoneName);
            }
        }