public static void GetProperties(IBaseThrowable throwable, Mobile viewer, ExtendedOPL list)
		{
			if (throwable == null || list == null)
			{
				return;
			}

			var lines = new List<string>();

			if (throwable.Consumable)
			{
				lines.Add("Consumable");
			}

			if (throwable.ClearHands)
			{
				lines.Add("Clears Hands");
			}

			if (!throwable.AllowCombat)
			{
				lines.Add("Non-Combat");
			}

			if (lines.Count > 0)
			{
				list.Add(String.Join(", ", lines).WrapUOHtmlColor(Color.Orange));
				lines.Clear();
			}

			if (throwable.RequiredSkillValue > 0)
			{
				list.Add("Required Skill: {0} - {1:F2}%", throwable.RequiredSkill, throwable.RequiredSkillValue);
			}

			DateTime now = DateTime.UtcNow, readyWhen = (throwable.ThrownLast + throwable.ThrowRecovery);
			TimeSpan diff = TimeSpan.Zero;

			if (readyWhen > now)
			{
				diff = readyWhen - now;
			}

			if (diff > TimeSpan.Zero)
			{
				list.Add("Use: {0:D2}:{1:D2}:{2:D2}".WrapUOHtmlColor(Color.LimeGreen), diff.Hours, diff.Minutes, diff.Seconds);
			}
			else if (!String.IsNullOrWhiteSpace(throwable.Usage))
			{
				list.Add("Use: {0}".WrapUOHtmlColor(Color.Cyan), throwable.Usage);
			}

			if (!String.IsNullOrWhiteSpace(throwable.Token))
			{
				list.Add("\"{0}\"".WrapUOHtmlColor(Color.Gold), throwable.Token);
			}
		}
Exemple #2
0
        private static void InternalAddTrashProperties(Mobile viewer, ExtendedOPL list)
        {
            if (!CMOptions.ModuleEnabled || !CMOptions.UseTrashedProps || viewer == null || viewer.Deleted || list == null ||
                !(viewer is PlayerMobile))
            {
                return;
            }

            var p = EnsureProfile(viewer);

            var todayTotal = p.GetTokenTotal(DateTime.UtcNow);
            var total      = p.GetTokenTotal();

            list.Add(
                "<basefont color=#{0:X6}>Total Tokens Earned: {1}",
                Color.SkyBlue.ToRgb(),
                total <= 0 ? "0" : total.ToString("#,#"));

            if (CMOptions.DailyLimit > 0)
            {
                const int blocks = 10;
                var       cur    = (Math.Max(0, Math.Min(CMOptions.DailyLimit, (double)todayTotal)) / CMOptions.DailyLimit) * 100.0;
                var       left   = (int)Math.Floor(cur / blocks);
                var       right  = blocks - left;

                list.Add("<basefont color=#{0:X6}>Tokens Earned Today:", Color.SkyBlue.ToRgb());
                list.Add(
                    "[<basefont color=#{0:X6}>{1}<basefont color=#{2:X6}>{3}<basefont color=#{4:X6}>] {5}/{6}",
                    Color.LimeGreen.ToRgb(),
                    new String('=', left),
                    Color.OrangeRed.ToRgb(),
                    new String('=', right),
                    Color.SkyBlue.ToRgb(),
                    todayTotal <= 0 ? "0" : todayTotal.ToString("#,#"),
                    CMOptions.DailyLimit.ToString("#,#"));
            }
            else
            {
                list.Add("Tokens Earned Today: {0}", todayTotal <= 0 ? "0" : todayTotal.ToString("#,#"));
            }

            list.Add("<basefont color=#ffffff>");
        }
Exemple #3
0
 public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped)
 {
     if (!String.IsNullOrEmpty(Desc))
     {
         list.Add(
             "[{0:#,0}] {1}: {2}".WrapUOHtmlColor(
                 equipped && IsActive(viewer) ? EquipmentSets.CMOptions.ModNameColorRaw : EquipmentSets.CMOptions.InactiveColorRaw),
             PartsRequired,
             Name.ToUpperWords(),
             Desc);
     }
     else
     {
         list.Add(
             "[{0:#,0}] {1}".WrapUOHtmlColor(
                 equipped && IsActive(viewer) ? EquipmentSets.CMOptions.ModNameColorRaw : EquipmentSets.CMOptions.InactiveColorRaw),
             PartsRequired,
             Name.ToUpperWords());
     }
 }
Exemple #4
0
        public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped)
        {
            if (!this.CheckExpansion())
            {
                return;
            }

            string value;

            if (String.IsNullOrEmpty(Desc))
            {
                if (String.IsNullOrWhiteSpace(Name))
                {
                    return;
                }

                value =
                    String.Format(
                        "[{0:#,0}] {1}",
                        PartsRequired,
                        Name.ToUpperWords());
            }
            else if (String.IsNullOrWhiteSpace(Name))
            {
                value =
                    String.Format(
                        "[{0:#,0}]: {1}",
                        PartsRequired,
                        Desc);
            }
            else
            {
                value =
                    String.Format(
                        "[{0:#,0}] {1}: {2}",
                        PartsRequired,
                        Name.ToUpperWords(),
                        Desc);
            }

            if (String.IsNullOrWhiteSpace(value))
            {
                return;
            }

            var color = equipped && IsActive(viewer)
                                ? EquipmentSets.CMOptions.ModNameColorRaw
                                : EquipmentSets.CMOptions.InactiveColorRaw;

            value = value.WrapUOHtmlColor(color);

            list.Add(value);
        }
        public override void GetProperties(ObjectPropertyList list)
        {
            base.GetProperties(list);

            var eopl = new ExtendedOPL(list);

            if (!Trading)
            {
                eopl.Add("Not Trading".WrapUOHtmlColor(Color.OrangeRed));
                eopl.Apply();
                return;
            }

            if (!ShowCashName)
            {
                return;
            }

            var name = CashName.GetString();

            if (!String.IsNullOrWhiteSpace(name))
            {
                eopl.Add("Trades For {0}".WrapUOHtmlColor(Color.SkyBlue), name);
            }

            var races = RequiredRaces;

            if (races != null && races.Length > 0)
            {
                foreach (var r in races)
                {
                    eopl.Add("Trades With {0}".WrapUOHtmlColor(Color.LawnGreen), r.PluralName);
                }
            }

            eopl.Apply();
        }
        public static void GetProperties(IBaseThrowable throwable, Mobile viewer, ExtendedOPL list)
        {
            if (throwable == null || list == null)
            {
                return;
            }

            var lines = new List <string>();

            if (throwable.Consumable)
            {
                lines.Add("Consumable");
            }

            if (throwable.ClearHands)
            {
                lines.Add("Clears Hands");
            }

            if (!throwable.AllowCombat)
            {
                lines.Add("Non-Combat");
            }

            if (lines.Count > 0)
            {
                string s = String.Format("<basefont color=#{0:X6}>{1}", Color.Orange.ToArgb(), String.Join(", ", lines));
                lines.Clear();
                lines.Add(s);
            }

            if (throwable.RequiredSkillValue > 0)
            {
                lines.Add(
                    String.Format(
                        "<basefont color=#ffffff>Required Skill: {0} - {1:F2}%", throwable.RequiredSkill, throwable.RequiredSkillValue));
            }

            DateTime now = DateTime.UtcNow, readyWhen = (throwable.ThrownLast + throwable.ThrowRecovery);
            TimeSpan diff = TimeSpan.Zero;

            if (readyWhen > now)
            {
                diff = readyWhen - now;
            }

            if (diff > TimeSpan.Zero)
            {
                string time = String.Format("{0:D2}:{1:D2}:{2:D2}", diff.Hours, diff.Minutes, diff.Seconds);
                lines.Add(String.Format("<basefont color=#{0:X6}>Use: {1}", Color.LimeGreen.ToArgb(), time));
            }
            else if (!String.IsNullOrWhiteSpace(throwable.Usage))
            {
                lines.Add(String.Format("<basefont color=#{0:X6}>Use: {1}", Color.Cyan.ToArgb(), throwable.Usage));
            }

            if (!String.IsNullOrWhiteSpace(throwable.Token))
            {
                lines.Add(String.Format("<basefont color=#{0:X6}>\"{1}\"", Color.Gold.ToArgb(), throwable.Token));
            }

            if (lines.Count > 0)
            {
                list.Add(String.Format("{0}<basefont color=#ffffff>", String.Join("\n", lines)));
            }

            lines.Clear();
        }
Exemple #7
0
		public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped)
		{
			if (!String.IsNullOrEmpty(Desc))
			{
				list.Add(
					"[{0:#,0}] {1}: {2}".WrapUOHtmlColor(
						equipped && IsActive(viewer) ? EquipmentSets.CMOptions.ModNameColorRaw : EquipmentSets.CMOptions.InactiveColorRaw),
					PartsRequired,
					Name.ToUpperWords(),
					Desc);
			}
			else
			{
				list.Add(
					"[{0:#,0}] {1}".WrapUOHtmlColor(
						equipped && IsActive(viewer) ? EquipmentSets.CMOptions.ModNameColorRaw : EquipmentSets.CMOptions.InactiveColorRaw),
					PartsRequired,
					Name.ToUpperWords());
			}
		}
		private static void InternalAddTrashProperties(Mobile viewer, ExtendedOPL list)
		{
			if (!CMOptions.ModuleEnabled || !CMOptions.UseTrashedProps || viewer == null || viewer.Deleted || list == null ||
				!(viewer is PlayerMobile))
			{
				return;
			}

			TrashProfile p = EnsureProfile(viewer);

			int todayTotal = p.GetTokenTotal(DateTime.UtcNow);
			int total = p.GetTokenTotal();

			list.Add(
				"<basefont color=#{0:X6}>Total Tokens Earned: {1}", Color.SkyBlue.ToArgb(), total <= 0 ? "0" : total.ToString("#,#"));

			if (CMOptions.DailyLimit > 0)
			{
				const int blocks = 10;
				double cur = (Math.Max(0, Math.Min(CMOptions.DailyLimit, (double)todayTotal)) / CMOptions.DailyLimit) * 100.0;
				int left = (int)Math.Floor(cur / blocks);
				int right = blocks - left;

				list.Add("<basefont color=#{0:X6}>Tokens Earned Today:", Color.SkyBlue.ToArgb());
				list.Add(
					"[<basefont color=#{0:X6}>{1}<basefont color=#{2:X6}>{3}<basefont color=#{4:X6}>] {5}/{6}",
					Color.LimeGreen.ToArgb(),
					new String('=', left),
					Color.OrangeRed.ToArgb(),
					new String('=', right),
					Color.SkyBlue.ToArgb(),
					todayTotal <= 0 ? "0" : todayTotal.ToString("#,#"),
					CMOptions.DailyLimit.ToString("#,#"));
			}
			else
			{
				list.Add("Tokens Earned Today: {0}", todayTotal <= 0 ? "0" : todayTotal.ToString("#,#"));
			}

			list.Add("<basefont color=#ffffff>");
		}
Exemple #9
0
		public virtual void GetProperties(Mobile viewer, ExtendedOPL list, bool equipped)
		{
			Item item;

			list.Add(
				equipped && IsEquipped(viewer, out item)
					? item.ResolveName(viewer).ToUpperWords().WrapUOHtmlColor(EquipmentSets.CMOptions.PartNameColorRaw)
					: Name.ToUpperWords().WrapUOHtmlColor(EquipmentSets.CMOptions.InactiveColorRaw));
		}
		public static void GetProperties(IBaseThrowable throwable, Mobile viewer, ExtendedOPL list)
		{
			if (throwable == null || list == null)
			{
				return;
			}

			var lines = new List<string>();

			if (throwable.Consumable)
			{
				lines.Add("Consumable");
			}

			if (throwable.ClearHands)
			{
				lines.Add("Clears Hands");
			}

			if (!throwable.AllowCombat)
			{
				lines.Add("Non-Combat");
			}

			if (lines.Count > 0)
			{
				string s = String.Format("<basefont color=#{0:X6}>{1}", Color.Orange.ToArgb(), String.Join(", ", lines));
				lines.Clear();
				lines.Add(s);
			}

			if (throwable.RequiredSkillValue > 0)
			{
				lines.Add(
					String.Format(
						"<basefont color=#ffffff>Required Skill: {0} - {1:F2}%", throwable.RequiredSkill, throwable.RequiredSkillValue));
			}

			DateTime now = DateTime.UtcNow, readyWhen = (throwable.ThrownLast + throwable.ThrowRecovery);
			TimeSpan diff = TimeSpan.Zero;

			if (readyWhen > now)
			{
				diff = readyWhen - now;
			}

			if (diff > TimeSpan.Zero)
			{
				string time = String.Format("{0:D2}:{1:D2}:{2:D2}", diff.Hours, diff.Minutes, diff.Seconds);
				lines.Add(String.Format("<basefont color=#{0:X6}>Use: {1}", Color.LimeGreen.ToArgb(), time));
			}
			else if (!String.IsNullOrWhiteSpace(throwable.Usage))
			{
				lines.Add(String.Format("<basefont color=#{0:X6}>Use: {1}", Color.Cyan.ToArgb(), throwable.Usage));
			}

			if (!String.IsNullOrWhiteSpace(throwable.Token))
			{
				lines.Add(String.Format("<basefont color=#{0:X6}>\"{1}\"", Color.Gold.ToArgb(), throwable.Token));
			}

			if (lines.Count > 0)
			{
				list.Add(String.Format("{0}<basefont color=#ffffff>", String.Join("\n", lines)));
			}

			lines.Clear();
		}