当前位置: 首页>>代码示例>>C#>>正文


C# PlayerMobile.PrivateOverheadMessage方法代码示例

本文整理汇总了C#中Server.Mobiles.PlayerMobile.PrivateOverheadMessage方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMobile.PrivateOverheadMessage方法的具体用法?C# PlayerMobile.PrivateOverheadMessage怎么用?C# PlayerMobile.PrivateOverheadMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobiles.PlayerMobile的用法示例。


在下文中一共展示了PlayerMobile.PrivateOverheadMessage方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GrantTitle

        private void GrantTitle(PlayerMobile pm, TitleProfile p)
        {
            if (Title == null || pm == null || p == null)
            {
                return;
            }

            if (p.Contains(Title))
            {
                pm.SendMessage(0x22, "YOU ALREADY OWN THIS TITLE.  THIS SHOULDN'T HAPPEN.  PLEASE PAGE IN.");
                return;
            }

            p.Add(Title);

            pm.PrivateOverheadMessage(
                MessageType.Label, 1287, true,
                "*You have gained the title: " + (!pm.Female ? Title.MaleTitle : Title.FemaleTitle) + "*", pm.NetState);

            Delete();
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:21,代码来源:ConquestTitleScroll.cs

示例2: ExamineUndead

            private static void ExamineUndead( PlayerMobile from, PlayerMobile targ )
            {
                string message = "";

                if( from == targ ){
                    message += "You ";
                } else {
                    message += "They  ";
                }

                message += "crackle menacingly, with deep black eyesockets and an aura of hatred.";

                from.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, message, from.NetState );
            }
开发者ID:jsrn,项目名称:MidnightWatchServer,代码行数:14,代码来源:Anatomy.cs

示例3: DisplayTitle

		public static bool DisplayTitle(PlayerMobile viewer, PlayerMobile target)
		{
			if (!CMOptions.ModuleEnabled || viewer == null || viewer.Deleted || target == null || target.Deleted)
			{
				return false;
			}

			Title t;
			TitleHue h;

			if (!GetTitleAndHue(target, out t, out h) || t == null)
			{
				return false;
			}

			string title = t.ToString(target.Female);
			int hue = h != null ? h.Hue : CMOptions.DefaultTitleHue;

			if (String.IsNullOrWhiteSpace(title))
			{
				return false;
			}

			target.PrivateOverheadMessage(MessageType.Label, hue, true, title, viewer.NetState);
			return true;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:26,代码来源:CustomTitles.cs

示例4: ExamineHuman

            private static void ExamineHuman( PlayerMobile from, PlayerMobile targ )
            {
                int targetInjuryPoints = targ.getDeathPoints();

                string message = "";

                if( from == targ ){
                    message += "You ";
                } else {
                    message += "They ";
                }

                if( targetInjuryPoints == 0 )
                {
                    message += "look fine. [0/30]";
                }
                else if( targetInjuryPoints < 10 )
                {
                    message += "look a bit bruised up. [" + targetInjuryPoints + "/30]";
                }
                else if( targetInjuryPoints < 20 )
                {
                    message += "look quite badly beaten. [" + targetInjuryPoints + "/30]";
                }
                else if( targetInjuryPoints < 30 )
                {
                    message += "are badly injured! [" + targetInjuryPoints + "/30]";
                }

                targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, message, from.NetState );

                if( from == targ ){
                    int hungerAmount = ((PlayerMobile)targ).Hunger;
                    string hungerMessage = "";

                    if( hungerAmount == 0)
                        hungerMessage += "You are very hungry.";
                    else if (hungerAmount < 5)
                        hungerMessage += "You are quite hungry.";
                    else if (hungerAmount < 10)
                        hungerMessage += "You are a little hungry.";
                    else if (hungerAmount < 15)
                        hungerMessage += "You are peckish.";
                    else
                        hungerMessage += "You aren't hungry.";

                    targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, hungerMessage, from.NetState );
                }

                if( from == targ ){
                    int thirstAmount = targ.Thirst;
                    string thirstMessage = "";

                    if( thirstAmount == 0)
                        thirstMessage += "You are very thirsty.";
                    else if (thirstAmount < 5)
                        thirstMessage += "You are quite thirsty.";
                    else if (thirstAmount < 10)
                        thirstMessage += "You are a little thirsty.";
                    else if (thirstAmount < 15)
                        thirstMessage += "You are parched.";
                    else
                        thirstMessage += "You aren't thirsty.";

                    targ.PrivateOverheadMessage( MessageType.Regular, 0x3B2, true, thirstMessage, from.NetState );
                }
            }
开发者ID:jsrn,项目名称:MidnightWatchServer,代码行数:67,代码来源:Anatomy.cs

示例5: GrantHue

		private void GrantHue(PlayerMobile pm, TitleProfile p)
		{
			if (TitleHue == null || pm == null || p == null)
			{
				return;
			}

			if (p.Contains(TitleHue))
			{
				pm.SendMessage(0x22, "You already own this title hue.");
				return;
			}

			p.Add(TitleHue);

			pm.PrivateOverheadMessage(
				MessageType.Label, 1287, true, "*The scroll crumbles in your hands as you absorb its power*", pm.NetState);

			LoggingCustom.Log("HueScrollsUsed.txt", String.Format("{0} -> {1} ({2})", pm, this, TitleHue));

			Delete();
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:22,代码来源:HueScroll.cs

示例6: AutoConsume

		public bool AutoConsume(PlayerMobile m)
		{
			if (m == null || m.Deleted)
			{
				return false;
			}

			if (TitleHue == null)
			{
				m.SendMessage(0x22, "This ancient scroll has lost whatever power it once had.");
				m.PrivateOverheadMessage(MessageType.Label, 1287, true, "*The scroll disintegrates in your hands*", m.NetState);

				LoggingCustom.Log("HueScrollsInvalid.txt", String.Format("{0} -> {1} ({2})", m, this, TitleHue));

				Delete();

				return false;
			}

			if (!CanConsume(m, false))
			{
				return false;
			}

			TitleProfile p = CustomTitles.EnsureProfile(m);

			if (p == null)
			{
				return false;
			}

			GrantHue(m, p);
			return true;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:34,代码来源:HueScroll.cs

示例7: DisplayStatus

		private static void DisplayStatus(PlayerMobile target, int offset, PlayerMobile[] cams)
		{
			if (target == null || !target.Alive || cams == null || cams.Length == 0)
			{
				return;
			}

			const int red = 44; // lower than green
			const int yellow = 54; // somewhere inbetween green and red
			const int green = 69; // greater than red

			string hLabel = String.Format("{0} / {1}", target.Hits, target.HitsMax); // hits
			int hHue = offset < 0 ? red : offset > 0 ? green : yellow;
				// negative offset = red, positive = green, neutral = yellow

			/*
			double percent = target.Hits / (double)target.HitsMax;

			string pLabel = String.Format("[{0}%]", percent * 100); // percent
			int pHue = (int)(red + (green - red) * percent); // interpolate between two hues
			*/

			if (offset != 0)
			{
				hLabel += String.Format(" ({0}{1:#,0})", offset > 0 ? "+" : String.Empty, offset);
			}

			Timer.DelayCall(
				TimeSpan.FromSeconds(0.5),
				() =>
				{
					foreach (PlayerMobile cam in cams.Where(cam => cam != null && !cam.Deleted && cam.NetState != null))
					{
						target.PrivateOverheadMessage(MessageType.Regular, hHue, true, hLabel, cam.NetState); // hits
						//target.PrivateOverheadMessage(MessageType.Regular, pHue, true, pLabel, cam.NetState); // percent
					}
				});
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:38,代码来源:ActionCams.cs

示例8: CanJoinTable

        public bool CanJoinTable(PlayerMobile player, int buyin)
        {
            if (!ShardInfo.IsTestCenter && player.AccessLevel == AccessLevel.Player && Players.Any(p => p.Owner.NetState != null && player.NetState != null &&
                                       p.Owner.NetState.Address.Equals(player.NetState.Address)))
            {
                return false;
            }

            if (player.PokerJoinTimer > DateTime.UtcNow)
            {
                TimeSpan nextuse = player.PokerJoinTimer - DateTime.UtcNow;
                player.SendMessage("You cannot join another poker game for " + nextuse.Seconds + " seconds.");
                return false;
            }

            if (player.Aggressed.Any(info => (DateTime.UtcNow - info.LastCombatTime) < TimeSpan.FromSeconds(60)))
            {
                player.SendMessage("You cannot join poker while you are in combat!");
                return false;
            }

            if (player.Aggressors.Any(info => (DateTime.UtcNow - info.LastCombatTime) < TimeSpan.FromSeconds(60)))
            {
                player.SendMessage("You cannot join poker while you are in combat!");
                return false;
            }

            if (player.Party != null)
            {
                player.SendMessage("You cannot join a poker game while in a party.");
                return false;
            }

            if (!Dealer.InRange(player.Location, 8))
            {
                player.PrivateOverheadMessage(MessageType.Regular, 0x22, true, "I am too far away to do that",
                    player.NetState);
                return false;
            }

            if (IsPlayer(player))
            {
                player.SendMessage(0x22, "You are already seated at this table");
                return false;
            }

            if (Players.Count >= Dealer.MaxPlayers)
            {
                player.SendMessage(0x22, "Sorry, that table is full");
                return false;
            }

            if (!Dealer.Seats.Exists(x => !Dealer.SeatTaken(x)))
            {
                player.SendMessage(0x22, "Sorry, that table is full");
                return false;
            }

            if (!Banker.WithdrawPackAndBank(player, TypeOfCurrency, buyin))
            {
                player.SendMessage(0x22, "Your bank box lacks the funds to join this poker table.");
                return false;
            }

            return true;
        }
开发者ID:AdamUOF,项目名称:UOFTexasHoldem,代码行数:66,代码来源:PokerGame.cs


注:本文中的Server.Mobiles.PlayerMobile.PrivateOverheadMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。