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


C# CharData.ShowNameTo方法代码示例

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


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

示例1: Cant

        /// <summary>
        /// Cant language for thieves only.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void Cant(CharData ch, string[] str)
        {
            if( ch == null ) return;

            string buf;

            if (str.Length == 0)
            {
                ch.SendText("Cant what?\r\n");
                return;
            }

            if (!ch.IsClass(CharClass.Names.thief) && !ch.IsImmortal())
            {
                ch.SendText("You speak gibberish.\r\n");
                buf = String.Format("$n says, '{0}'\r\n", NounType.RandomSentence());
                SocketConnection.Act(buf, ch, null, null, SocketConnection.MessageTarget.room);
                return;
            }

            string text = String.Join(" ", str);

            // We don't want to let them know they're drunk.
            SocketConnection.Act("You cant '&n$T&n'", ch, null, text, SocketConnection.MessageTarget.character);

            text = DrunkSpeech.MakeDrunk(text, ch);
            string random = NounType.RandomSentence();

            foreach (CharData roomChar in ch.InRoom.People)
            {
                if (roomChar == ch || roomChar.IsNPC())
                    continue;

                if (roomChar.IsImmortal() || roomChar.IsClass(CharClass.Names.thief))
                {
                    buf = String.Format("{0} cants '&n$T&n'", ch.ShowNameTo(roomChar, true));
                }
                else
                {
                    buf = String.Format("{0} says, '{1}'\r\n", ch.ShowNameTo(roomChar, true), random);
                }

                SocketConnection.Act(buf, roomChar, null, SocketConnection.TranslateText(text, ch, roomChar), SocketConnection.MessageTarget.character);
            }

            return;
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:52,代码来源:Command.cs

示例2: GroupChat

        /// <summary>
        /// Say something to the members of your group.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void GroupChat(CharData ch, string[] str)
        {
            if( ch == null ) return;

            // No arguments, no leader, no chance.
            if (!ch.GroupLeader)
            {
                ch.SendText("Tell who, yourself? You are not in a group!\r\n");
                return;
            }
            if (str.Length < 1)
            {
                ch.SendText("Tell your group what?\r\n");
                return;
            }

            if (!ch.CanSpeak())
            {
                ch.SendText("Your lips move but no sound comes out.\r\n");
                return;
            }

            String text = String.Join(" ", str, 1, (str.Length - 1));
            text = DrunkSpeech.MakeDrunk(text, ch);

            foreach (CharData groupChar in Database.CharList)
            {
                string buf;
                if (groupChar == ch)
                {
                    buf = String.Format("&+GYou tell the group '&n&+G{0}&+G'.&n\r\n", text);
                    ch.SendText(buf);
                    continue;
                }
                if (groupChar.IsSameGroup(ch)
                        && !groupChar.InRoom.HasFlag(RoomTemplate.ROOM_SILENT)
                        && !groupChar.HasInnate(Race.RACE_MUTE)
                        && !groupChar.IsAffected(Affect.AFFECT_MUTE)
                        && groupChar.IsAwake())
                {
                    buf = String.Format("&+G{0}&n&+G tells the group '&n&+G{1}&+G'.&n\r\n",
                              ch.ShowNameTo(groupChar, true), SocketConnection.TranslateText(text, ch, groupChar));
                    groupChar.SendText(buf);
                }
            }

            return;
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:53,代码来源:Command.cs

示例3: Sign

        /// <summary>
        /// Sign language for Drow only.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void Sign(CharData ch, string[] str)
        {
            if( ch == null ) return;

            if (str.Length == 0)
            {
                ch.SendText("Sign what to who?\r\n");
                return;
            }

            if (ch.GetRace() != Race.RACE_DROW && !ch.IsImmortal())
            {
                ch.SendText("You wiggle your fingers around.\r\n");
                SocketConnection.Act("$n wiggles $s fingers around, looking foolish.", ch, null, null, SocketConnection.MessageTarget.room);
                return;
            }

            string text = String.Join(" ", str, 1, (str.Length - 1));

            // We don't want to let them know they're drunk.
            SocketConnection.Act("You sign '&n$T&n'", ch, null, text, SocketConnection.MessageTarget.character);

            text = DrunkSpeech.MakeDrunk(text, ch);
            foreach (CharData roomChar in ch.InRoom.People)
            {
                if (roomChar == ch || roomChar.IsNPC())
                    continue;

                string text2;
                if (roomChar.IsImmortal() || roomChar.GetOrigRace() == Race.RACE_DROW)
                {
                    text2 = String.Format("{0} signs '&n$T&n'", ch.ShowNameTo(roomChar, true));
                }
                else
                {
                    text2 = String.Format("{0} wiggles {1} fingers around.", ch.ShowNameTo(roomChar, true),
                              ch.Gender == MobTemplate.Sex.male ? "his" :
                              ch.Gender == MobTemplate.Sex.female ? "her" : "its");
                }

                SocketConnection.Act(text, roomChar, null, text2, SocketConnection.MessageTarget.character);
            }

            //    ch.door_trigger( argument );

            return;
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:52,代码来源:Command.cs

示例4: StatHunt

        /// <summary>
        /// Print information about hunting status.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void StatHunt(CharData ch, string[] str)
        {
            if (ch == null)
            {
                return;
            }

            string text;
            string buf1 = String.Empty;
            int count = 0;

            foreach (CharData worldChar in Database.CharList)
            {
                if (!worldChar.IsNPC() || !worldChar.Hunting)
                {
                    continue;
                }
                ++count;
                if (count < 100)
                {
                    text = String.Format("{0}: {1}&n is hunting {2}&n.\r\n", count,
                              worldChar.ShowNameTo(ch, true), ch.ShowNameTo(worldChar, false));
                    buf1 += text;
                }
            }
            text = String.Format("Found {0} total hunting mobs.\r\n", count);
            buf1 += text;
            ch.SendText(buf1);
            return;
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:35,代码来源:Command.cs

示例5: ShowEnhancedPrompt

 /// <summary>
 /// Shows the graphical client-friendly version of the prompt.
 /// </summary>
 private void ShowEnhancedPrompt(CharData ch)
 {
     StringBuilder output = new StringBuilder();
     output.Append("<prompt>");
     // H = Hits.
     output.Append("H:");
     output.Append(ch.Hitpoints);
     // I = Max Hits.
     output.Append(" I:");
     output.Append(ch.GetMaxHit());
     // M = Moves.
     output.Append(" M:");
     output.Append(ch.CurrentMoves);
     // N = Max Moves.
     output.Append(" N:");
     output.Append(ch.MaxMoves);
     // A = Mana.
     output.Append(" A:");
     output.Append(ch.CurrentMana);
     // B = Max Mana
     output.Append(" B:");
     output.Append(ch.MaxMana);
     // P = Player Name.
     output.Append(" P:");
     output.Append((ch.ShowNameTo(ch, true)).Replace(' ', '_'));
     // Q = Player Condition.
     output.Append(" Q:");
     output.Append((ch.Hitpoints * 100) / ch.MaxHitpoints);
     output.Append(" R:");
     output.Append(Position.PositionString(ch.CurrentPosition));
     // T = Tank Name.
     output.Append(" T:");
     if (ch.Fighting && ch.Fighting.Fighting)
     {
         output.Append((ch.Fighting.Fighting.ShowNameTo(ch, true)).Replace(' ', '_'));
         // U = Enemy Condition.
         output.Append(" U:");
         output.Append((ch.Fighting.Fighting.Hitpoints * 100) / ch.Fighting.Fighting.GetMaxHit());
         output.Append(" V:");
         output.Append(Position.PositionString(ch.Fighting.Fighting.CurrentPosition));
     }
     else
     {
         output.Append("0 U:0 V:0");
     }
     // E = Enemy Name.
     output.Append(" E:");
     if (ch.Fighting)
     {
         output.Append((ch.Fighting.ShowNameTo(ch, true)).Replace(' ', '_'));
         // F = Enemy Condition.
         output.Append(" F:");
         output.Append((ch.Fighting.Hitpoints * 100) / ch.Fighting.GetMaxHit());
         output.Append(" G:");
         output.Append(Position.PositionString(ch.Fighting.CurrentPosition));
         output.Append(" ");
     }
     else
     {
         output.Append("0 F:0 G:0");
     }
     output.Append("</prompt>");
     ch.SendText(output.ToString());
 }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:67,代码来源:SocketConnection.cs

示例6: Say

        /// <summary>
        /// Say something out loud.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void Say(CharData ch, string[] str)
        {
            if( ch == null ) return;

            if (str.Length == 0)
            {
                ch.SendText("Say what?\r\n");
                return;
            }

            if (!ch.CanSpeak())
            {
                ch.SendText("Your lips move but no sound comes out.\r\n");
                return;
            }

            string text = String.Join(" ", str);

            text = DrunkSpeech.MakeDrunk(text, ch);

            if (ch.InRoom != null)
            {
                foreach (CharData roomChar in ch.InRoom.People)
                {
                    if (roomChar == ch || roomChar.IsNPC())
                        continue;

                    string output;
                    if (ch.IsNPC() || (!ch.IsNPC() && (((PC)ch).Speaking == Race.Language.god ||
                        ((PC)ch).Speaking == Race.Language.unknown)))
                    {
                        output = String.Format("{0} says '&n$T&n'", ch.ShowNameTo(roomChar, true));
                    }
                    else
                    {
                        output = String.Format("{0} says in {1} '&n$T&n'", ch.ShowNameTo(roomChar, true),
                                  ch.IsNPC() ? Race.LanguageTable[(int)Race.RaceList[ch.GetOrigRace()].PrimaryLanguage]
                                  : Race.LanguageTable[(int)((PC)ch).Speaking]);
                    }
                    // Add foreign language filter.
                    SocketConnection.Act(output, roomChar, null, SocketConnection.TranslateText(text, ch, roomChar), SocketConnection.MessageTarget.character);
                    // Chatterbot code.  May want to restrict chatterbots to tells, asks, and whispers.
                    if (roomChar.ChatBot != null)
                    {
                        roomChar.ChatBot.CheckConversation(roomChar, ch, text);
                    }
                }
            }

            //    MOBtrigger = false;
            SocketConnection.Act("You say '&n$T&n'", ch, null, text, SocketConnection.MessageTarget.character);
            //    prog_speech_trigger( argument, ch );
            ch.DoorTrigger(text);
            return;
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:60,代码来源:Command.cs

示例7: Act

        /// <summary>
        /// The primary output interface for formatted output.
        /// </summary>
        /// <param name="format">Format string for output.</param>
        /// <param name="actor">The actor (or TargetType, depending on format string).</param>
        /// <param name="arg1">Argument Target, use varies based on format string.</param>
        /// <param name="arg2">Argument Target, use varies based on format string</param>
        /// <param name="type">Target of Act statement.</param>
        /// <param name="capitalize">If capitalize is set, the first word of the phrase will be capitalized (after variable substitution).</param>
        public static void Act( string format, CharData actor, Target arg1, Target arg2, MessageTarget type, bool capitalize )
        {
            Object obj1 = (Object)arg1;
            Object obj2 = (Object)arg2;
            CharData victimChar = (CharData)arg2;
            string[] himHer = new[] { "it", "him", "her" };
            string[] hisHer = new[] { "its", "his", "her" };
            string str;
            // Discard null and zero-length messages.
            if( format.Length == 0 )
            {
                return;
            }

            if( actor == null )
            {
                Log.Error( "Act: null actor!", 0 );
                return;
            }

            // To prevent crashes
            if( !actor.InRoom )
            {
                Log.Error( "Act: Actor CharData (" + actor.Name + ") is not in a room!" );
                return;
            }

            List<CharData> to = actor.InRoom.People;
            if( type == MessageTarget.victim || type == MessageTarget.room_vict )
            {
                if( !victimChar )
                {
                    Log.Error( "Act: null victim with Descriptor.MessageTarget.victim.", 0 );
                    Log.Error(String.Format("Bad act string: {0}", format));
                    return;
                }
                to = victimChar.InRoom.People;
            }

            string outputBuffer;

            foreach (CharData roomChar in to)
            {
                if( !roomChar.Socket && roomChar.IsNPC() || !roomChar.IsAwake() )
                    continue;
                if( type == MessageTarget.room_vict && victimChar.FlightLevel != roomChar.FlightLevel )
                    continue;
                if( ( type == MessageTarget.room_vict || type == MessageTarget.room || type == MessageTarget.everyone_but_victim ) && actor.FlightLevel != roomChar.FlightLevel )
                    continue;
                if( type == MessageTarget.room_vict && ( roomChar == actor || roomChar == victimChar ) )
                    continue;
                if( type == MessageTarget.character && roomChar != actor )
                    continue;
                if( type == MessageTarget.victim && ( roomChar != victimChar || roomChar == actor ) )
                    continue;
                if( type == MessageTarget.room && roomChar == actor )
                    continue;
                if( type == MessageTarget.everyone_but_victim && ( roomChar == victimChar ) )
                    continue;
                if( type == MessageTarget.room_above && ( roomChar.FlightLevel <= actor.FlightLevel ) )
                    continue;
                if( type == MessageTarget.room_below && ( roomChar.FlightLevel >= actor.FlightLevel ) )
                    continue;

                str = format;

                if (str.Contains("$t"))
                    str = str.Replace("$t", (String)arg1);
                if (str.Contains("$T"))
                    str = str.Replace("$T", (String)arg2);
                if (str.Contains("$n") && actor != null)
                    str = str.Replace("$n", actor.ShowNameTo(roomChar, false));
                if (str.Contains("$N") && victimChar != null)
                    str = str.Replace("$N", victimChar.ShowNameTo(roomChar, false));
                if (str.Contains("$e") && actor != null)
                    str = str.Replace("$e", actor.GetSexPronoun());
                if (str.Contains("$E") && victimChar != null)
                    str = str.Replace("$E", victimChar.GetSexPronoun());
                if (str.Contains("$m") && actor != null)
                    str = str.Replace("$m", himHer[Macros.Range(0, (int)actor.Gender, 2)]);
                if (str.Contains("$M") && victimChar != null)
                    str = str.Replace("$M", himHer[Macros.Range(0, (int)victimChar.Gender, 2)]);
                if (str.Contains("$s") && actor != null)
                    str = str.Replace("$s", hisHer[Macros.Range(0, (int)actor.Gender, 2)]);
                if (str.Contains("$S") && victimChar != null)
                    str = str.Replace("$S", hisHer[Macros.Range(0, (int)victimChar.Gender, 2)]);
                if (str.Contains("$p") && obj1 != null)
                    str = str.Replace("$p", CharData.CanSeeObj(roomChar, obj1) ? obj1.ShortDescription : "something");
                if (str.Contains("$P") && obj1 != null)
                    str = str.Replace("$P", CharData.CanSeeObj(roomChar, obj2) ? obj2.ShortDescription : "something");
                if (str.Contains("$d"))
//.........这里部分代码省略.........
开发者ID:ramseur,项目名称:ModernMUD,代码行数:101,代码来源:SocketConnection.cs

示例8: InflictSpellDamage


//.........这里部分代码省略.........
            {
                case Position.mortally_wounded:
                    victim.SendText(
                        "&+LYou are &+Rmo&n&+rr&+Rt&n&+ral&+Rl&n&+ry&+L wounded, and will die soon, if not aided.&n\r\n" );
                    SocketConnection.Act( "$n&+L is &+Rmo&n&+rr&+Rt&n&+ral&+Rl&n&+ry&+L wounded, and will die soon, if not aided.&n",
                         victim, null, null, SocketConnection.MessageTarget.room, true );
                    StopNotVicious( victim );
                    break;

                case Position.incapacitated:
                    victim.SendText(
                        "&+LYou are incapacitated and will slowly &n&+rbl&+Re&n&+re&+Rd&+L to death, if not aided.\r\n" );
                    SocketConnection.Act( "$n&+L is incapacitated and will slowly &n&+rbl&+Re&n&+re&+Rd&+L to death, if not aided.&n",
                         victim, null, null, SocketConnection.MessageTarget.room, true );
                    StopNotVicious( victim );
                    break;

                case Position.stunned:
                    victim.SendText( "&+LYou are stunned, but will probably recover.&n\r\n" );
                    SocketConnection.Act( "$n&+L is stunned, but will probably recover.&n",
                         victim, null, null, SocketConnection.MessageTarget.room, true );
                    break;

                case Position.dead:
                    SocketConnection.Act( spell.MessageKill, ch, null, victim, SocketConnection.MessageTarget.room_vict );
                    SocketConnection.Act( spell.MessageKill, ch, null, victim, SocketConnection.MessageTarget.character );
                    if( victim == ch )
                    {
                        victim.SendText( "&+LYou have been &+Rsl&n&+ra&+Ri&n&+rn&+L!&n\r\n\r\n" );
                    }
                    else
                    {
                        string buf = String.Format( "&+LYou have been &+Rsl&n&+ra&+Ri&n&+rn&+L by&n {0}&+L!&n\r\n\r\n",
                                                    ch.ShowNameTo( victim, false ) );
                        victim.SendText( buf );
                    }
                    StopFighting( victim, true );
                    SocketConnection.Act( "$n&+L is &n&+rdead&+L!&n", victim, null, null, SocketConnection.MessageTarget.room, true );
                    break;

                default:
                    if( dam > victim.GetMaxHit() / 5 )
                        victim.SendText( "That really did &+RHURT&n!\r\n" );
                    if( victim.Hitpoints < victim.GetMaxHit() / 10 )
                        victim.SendText( "You sure are &n&+rBL&+RE&n&+rE&+RDI&n&+rN&+RG&n!\r\n" );
                    break;
            }

            /*
            * Sleep spells and extremely wounded folks.
            */
            if( !victim.IsAwake() )      /* lets make NPC's not slaughter PC's */
            {
                if( victim.Fighting
                        && victim.Fighting.Hunting
                        && victim.Fighting.Hunting.Who == victim )
                    StopHunting( victim.Fighting );
                if( victim.Fighting
                        && !victim.IsNPC()
                        && ch.IsNPC() )
                    StopFighting( victim, true );
                else
                    StopFighting( victim, false );
            }

            /*
开发者ID:carriercomm,项目名称:ModernMUD,代码行数:67,代码来源:Combat.cs

示例9: InflictDamage


//.........这里部分代码省略.........

            switch( victim.CurrentPosition )
            {
                case Position.mortally_wounded:
                    victim.SendText(
                        "&+LYou are &+Rmo&n&+rr&+Rt&n&+ral&+Rl&n&+ry&+L wounded, and will die soon, if not aided.&n\r\n" );
                    SocketConnection.Act( "$n&+L is &+Rmo&n&+rr&+Rt&n&+ral&+Rl&n&+ry&+L wounded, and will die soon, if not aided.&n",
                         victim, null, null, SocketConnection.MessageTarget.room, true );
                    StopNotVicious( victim );
                    break;

                case Position.incapacitated:
                    victim.SendText(
                        "&+LYou are incapacitated and will &n&+rbl&+Re&n&+re&+Rd&+L to death, if not aided.&n\r\n" );
                    SocketConnection.Act( "$n&+L is incapacitated and will slowly &n&+rbl&+Re&n&+re&+Rd&+L to death, if not aided.&n",
                         victim, null, null, SocketConnection.MessageTarget.room, true );
                    StopNotVicious( victim );
                    break;

                case Position.stunned:
                    victim.SendText( "&+LYou are stunned, but will probably recover.&n\r\n" );
                    SocketConnection.Act( "$n&+L is stunned, but will probably recover.&n",
                         victim, null, null, SocketConnection.MessageTarget.room, true );
                    break;

                case Position.dead:
                    if( victim == ch )
                    {
                        victim.SendText( "&+LYou have been &+Rsl&n&+ra&+Ri&n&+rn&+L!&n\r\n\r\n" );
                    }
                    else
                    {
                        string buf = String.Format( "&+LYou have been &+Rsl&n&+ra&+Ri&n&+rn&+L by&n {0}&+L!&n\r\n\r\n",
                                                    ch.ShowNameTo( victim, false ) );
                        victim.SendText( buf );
                    }
                    /* Added this to stop a bug. */
                    Combat.StopFighting( victim, true );
                    SocketConnection.Act( "$n&+L is &n&+rdead&+L!&n", victim, null, null, SocketConnection.MessageTarget.room, true );
                    break;

                default:
                    if( dam > victim.GetMaxHit() / 5 )
                        victim.SendText( "That really did &+RHURT&n!\r\n" );
                    if( victim.Hitpoints < victim.GetMaxHit() / 10 )
                        victim.SendText( "You sure are &n&+rBL&+RE&n&+rE&+RDI&n&+rN&+RG&n!\r\n" );
                    break;
            }

            // Check for weapon procs
            if( ( obj = Object.GetEquipmentOnCharacter( ch, weapon ) ) && Position.dead != victim.CurrentPosition )
            {
                if( obj.SpecFun.Count > 0 )
                    obj.CheckSpecialFunction(true);
            }

            /*
            * Sleep spells and extremely wounded folks.
            */
            if( !victim.IsAwake() )      /* lets make NPC's not slaughter PC's */
            {
                if( victim.Fighting
                        && victim.Fighting.Hunting
                        && victim.Fighting.Hunting.Who == victim )
                    StopHunting( victim.Fighting );
                if( victim.Fighting
开发者ID:carriercomm,项目名称:ModernMUD,代码行数:67,代码来源:Combat.cs

示例10: ShowCharacterToCharacterFull

        /// <summary>
        /// Show a character to another character.
        /// </summary>
        /// <param name="victim"></param>
        /// <param name="ch"></param>
        public static void ShowCharacterToCharacterFull(CharData victim, CharData ch)
        {
            Object obj;
            string text = String.Empty;
            int percent;

            if (CharData.CanSee(victim, ch))
            {
                SocketConnection.Act("$n&n looks at you.", ch, null, victim, SocketConnection.MessageTarget.victim);
                if (victim != ch)
                {
                    SocketConnection.Act("$n&n looks at $N&n.", ch, null, victim, SocketConnection.MessageTarget.everyone_but_victim);
                }
                else
                {
                    SocketConnection.Act("$n&n looks at $mself.", ch, null, victim, SocketConnection.MessageTarget.everyone_but_victim);
                }
            }

            if (victim.Riding != null)
            {
                text += String.Format("&nMounted on {0}, ", victim.Riding.ShowNameTo(ch, false));
            }
            else if (victim.Rider != null)
            {
                text += String.Format("&nRidden by {0}, ", victim.Rider.ShowNameTo(ch, false));
            }

            if (!victim.IsNPC() && victim.IsGuild())
            {
                text += String.Format("&n{0} of {1}.\r\n", ((PC)victim).GuildRank.ToString().ToUpper(),
                          ((PC)victim).GuildMembership.Name);
            }

            SocketConnection.Act(text, ch, null, victim, SocketConnection.MessageTarget.character);

            if (!String.IsNullOrEmpty(victim.Description))
            {
                ch.SendText(victim.Description);
            }
            else
            {
                SocketConnection.Act("&nYou see nothing special about $M.", ch, null, victim, SocketConnection.MessageTarget.character);
            }

            if (victim.GetMaxHit() > 0)
            {
                percent = (100 * victim.Hitpoints) / victim.GetMaxHit();
            }
            else
            {
                percent = -1;
            }

            text = victim.ShowNameTo(ch, true);

            if (percent >= 100)
                text += " &nis in perfect &n&+ghealth&n.  ";
            else if (percent >= 90)
                text += " &nis slightly &n&+yscratched&n.  ";
            else if (percent >= 80)
                text += " &nhas a &+yfew bruises&n.  ";
            else if (percent >= 70)
                text += " &nhas &+Ysome cuts&n.  ";
            else if (percent >= 60)
                text += " &nhas &+Mseveral wounds&n.  ";
            else if (percent >= 50)
                text += " &nhas &+mmany nasty wounds&n.  ";
            else if (percent >= 40)
                text += " &nis &+Rbleeding freely&n.  ";
            else if (percent >= 30)
                text += " &nis &+Rcovered in blood&n.  ";
            else if (percent >= 20)
                text += " &nis &+rleaking guts&n.  ";
            else if (percent >= 10)
                text += " &nis &+ralmost dead&n.  ";
            else
                text += " &nis &+rDYING&n.  ";

            ch.SendText(text);

            // Show size on look at someone.
            text = MUDString.CapitalizeANSIString(String.Format("{0}&n is a {1} of {2} size.\r\n", victim.GetSexPronoun(),
                Race.RaceList[victim.GetRace()].ColorName, Race.SizeString(victim.CurrentSize)));
            ch.SendText(text);

            ShowAffectLines(ch, victim);

            bool found = false;
            foreach (ObjTemplate.WearLocation location in ObjTemplate.TopDownEquipment)
            {
                obj = Object.GetEquipmentOnCharacter(victim, location);
                if (obj && CharData.CanSeeObj(ch, obj))
                {
                    if (!found)
//.........这里部分代码省略.........
开发者ID:ramseur,项目名称:ModernMUD,代码行数:101,代码来源:Look.cs

示例11: ShowCharacterToCharacterAbbreviated

        /// <summary>
        /// Show a character to another character. This is the abbreviated version used in "look room"
        /// </summary>
        /// <param name="victim"></param>
        /// <param name="ch"></param>
        public static void ShowCharacterToCharacterAbbreviated(CharData victim, CharData ch)
        {
            string text = String.Empty;

            if (!victim || !ch)
            {
                Log.Error("ShowCharacterToCharacter0(): null ch or victim.", 0);
                return;
            }

            if (victim.Rider && victim.Rider.InRoom == ch.InRoom)
            {
                return;
            }

            // If invis, show char invis symbol first.
            if (victim.IsAffected(Affect.AFFECT_INVISIBLE))
            {
                text += "&+L*&n ";
            }

            // Show the player's description.
            if (((!ch.IsNPC() && victim.CurrentPosition == Position.standing)
                    || (victim.IsNPC() && victim.MobileTemplate != null
                        && victim.CurrentPosition == victim.MobileTemplate.DefaultPosition))
                    && (!String.IsNullOrEmpty(victim.FullDescription)) && !victim.Riding)
            {
                // Added long description does not have \r\n removed.  We may want to.
                text += victim.Description + "&n";
            }
            else
            {
                // Show the player's name.
                text += victim.ShowNameTo(ch, true) + "&n";

                // Show the player's title.
                // Show the player's race, only if PC, and on the same side of the racewar or a god.
                if (!victim.IsNPC() && ((PC)victim).Title.Length > 0)
                {
                    if (MUDString.StringsNotEqual(((PC)victim).Title, " &n") && (ch.IsNPC()))
                    {
                        text += ((PC)victim).Title;
                    }
                    if (victim.IsGuild() && (ch.IsNPC()))
                    {
                        text += " " + ((PC)victim).GuildMembership.WhoName;
                    }

                    if (!ch.IsRacewar(victim) || victim.IsImmortal() || ch.IsImmortal())
                    {
                        text += " (" + Race.RaceList[victim.GetRace()].ColorName + ")";
                    }
                }

                // Show the player's condition.
                text += " is ";
                if (victim.CurrentPosition == Position.standing && victim.CanFly())
                {
                    text += "flying";
                }
                else
                {
                    text += Position.PositionString(victim.CurrentPosition);
                }
                text += " here";
                if (victim.Fighting != null)
                {
                    text += "&n fighting ";
                    if (victim.Fighting == ch)
                    {
                        text += "&nyou!";
                    }
                    else if (victim.InRoom == victim.Fighting.InRoom)
                    {
                        text += victim.Fighting.ShowNameTo(ch, false);
                    }
                    else
                    {
                        text += "&nsomeone who left??";
                    }
                }

                if (victim.Riding && victim.Riding.InRoom == victim.InRoom)
                {
                    text += "&n, mounted on " + victim.Riding.ShowNameTo(ch, false);
                }
                text += "&n.";
            }

            if (victim.IsAffected(Affect.AFFECT_CASTING))
            {
                text += "&n&+y (casting)&n";
            }

            if (victim.IsAffected(Affect.AFFECT_MINOR_PARA))
//.........这里部分代码省略.........
开发者ID:ramseur,项目名称:ModernMUD,代码行数:101,代码来源:Look.cs


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