Ejemplo n.º 1
0
        public object Convert(object?value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                return("");
            }
            var id = (ulong)value;

            return(Game.IsMe(id)
                ? Game.Me.Name
                : TccUtils.IsEntitySpawned(id)
                    ? TccUtils.GetEntityName(id)
                    : "");
        }
Ejemplo n.º 2
0
        private void AddDamageReceivedMessage(ulong source, ulong target, long diff, long maxHP, bool crit)
        {
            if (!App.Settings.ChatEnabled)
            {
                return;
            }

            if (!Game.IsMe(target) || diff > 0 || target == source || source == 0 || !TccUtils.IsEntitySpawned(source))
            {
                return;
            }
            var srcName    = TccUtils.GetEntityName(source);
            var parameters = $"@0\vAmount\v{-diff}\vPerc\v{-diff / (double) maxHP:P}{(srcName != "" ? $"\vSource\v{srcName}" : "")}";

            SystemMessagesProcessor.AnalyzeMessage(parameters, srcName == ""
                ? !crit ? "TCC_DAMAGE_RECEIVED_UNKNOWN" : "TCC_DAMAGE_RECEIVED_UNKNOWN_CRIT"
                : !crit ? "TCC_DAMAGE_RECEIVED" : "TCC_DAMAGE_RECEIVED_CRIT");
        }