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


C# CharData.IsGuild方法代码示例

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


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

示例1: Demote

        /// <summary>
        /// Demote: Decrease the rank of a guild member.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void Demote(CharData ch, string[] str)
        {
            if( ch == null ) return;

            SocketConnection victimSocket;
            int count;
            bool loggedIn = false;

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

            if (!ch.IsGuild() || ((PC)ch).GuildRank != Guild.Rank.leader)
            {
                ch.SendText("You don't have the power to do this.\r\n");
                return;
            }

            Guild guild = ((PC)ch).GuildMembership;

            CharData victim = null;
            foreach (CharData worldChar in Database.CharList)
            {
                if (worldChar.IsNPC())
                {
                    continue;
                }
                if (MUDString.NameContainedIn(str[0], worldChar.Name))
                {
                    victim = worldChar;
                    loggedIn = true;
                    break;
                }
            }

            if (victim == null)
            {
                if (!(CharData.LoadPlayer((victimSocket = new SocketConnection()), str[0])))
                {
                    ch.SendText("Who's that?!\r\n");
                    return;
                }
                victim = victimSocket.Original ? victimSocket.Original : victimSocket.Character;
                loggedIn = false;
            }

            if (victim.IsNPC())
            {
                ch.SendText("NPCs are not guildable!\r\n");
                return;
            }

            if (!ch.IsSameGuild(victim))
            {
                SocketConnection.Act("$N&n isn't even from $t.", ch, guild.WhoName, victim, SocketConnection.MessageTarget.character);
                return;
            }

            switch (((PC)victim).GuildRank)
            {
                default:
                    ch.SendText("You can't demote this person.\r\n");
                    return;
                case Guild.Rank.normal:
                    ch.SendText("You can't demote them any further.\r\n");
                    return;
                case Guild.Rank.senior:
                case Guild.Rank.officer:
                case Guild.Rank.deputy:
                    break;
                case Guild.Rank.leader:
                    if (str.Length > 1 && MUDString.StringsNotEqual(str[1], "confirm"))
                    {
                        ch.SendText("Try 'demote leadername confirm' to demote a leader.\r\n");
                        return;
                    }
                    break;
            }

            ((PC)victim).GuildRank--;
            Guild.Rank newrank = ((PC)victim).GuildRank;

            SetTitle(victim, guild.RankNames[(int)((PC)victim).GuildRank]);

            string text = String.Format("Log {0}: demoting {1} to {2}",
                                       ch.Name,
                                       victim.Name,
                                       ((PC)ch).GuildMembership.Name);
            Database.LogGuild(text);

            text = String.Format(
                      "The grand Overlord {0} says:\r\n\r\n" +
                      "'I hereby demote you {1} to {2}!!!'\r\n" +
//.........这里部分代码省略.........
开发者ID:ramseur,项目名称:ModernMUD,代码行数:101,代码来源:Command.cs

示例2: Exile

        /// <summary>
        /// Exile a player from a guild.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void Exile(CharData ch, string[] str)
        {
            if( ch == null ) return;

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

            if (!ch.IsGuild()
                    || ((PC)ch).GuildRank != Guild.Rank.leader)
            {
                ch.SendText("You don't have the power to do this.\r\n");
                return;
            }

            Guild guild = ((PC)ch).GuildMembership;

            CharData victim = ch.GetCharWorld(str[0]);
            if (!victim)
            {
                ch.SendText("They aren't here.\r\n");
                return;
            }

            if (victim.IsNPC() || victim == ch || victim.Level > ch.Level)
                return;

            if (!ch.IsSameGuild(victim))
            {
                SocketConnection.Act("$N isn't even from $t.", ch, guild.WhoName, victim, SocketConnection.MessageTarget.character);
                return;
            }

            string text = String.Format("Log {0}: exiling {1} from {2}", ch.Name, victim.Name, ((PC)ch).GuildMembership.Name);
            Database.LogGuild(text);

            // This function handles resetting member data
            victim.RemoveFromGuild();
            ((PC)victim).GuildRank = Guild.Rank.exiled;

            text = String.Format(
                      "The grand Overlord of {0} {1} says:\r\n\r\n" +
                      "'Then so be done, you {2} shall be exiled from {3}!'\r\n" +
                      "You hear a thundering sound...\r\n\r\n" +
                      "A booming voice says: 'You have been exiled. Only the gods can allow you\r\n" +
                      "to join another clan, order or guild!'\r\n",
                      guild.WhoName,
                      guild.Overlord,
                      victim.Name,
                      guild.WhoName);

            victim.SendText(text);

            SocketConnection.Act("You have exiled $N&n from $t!", ch, guild.WhoName, victim, SocketConnection.MessageTarget.character);
            CharData.SavePlayer(victim);
            guild.Save();
            return;
        }
开发者ID:ramseur,项目名称:ModernMUD,代码行数:65,代码来源:Command.cs

示例3: Socname

        public static void Socname(CharData ch, string[] str)
        {
            if( ch == null ) return;

            string arg = String.Empty;
            Guild.Rank rank;

            if (!ch.IsGuild() || ((PC)ch).GuildRank < Guild.Rank.leader)
            {
                ch.SendText("You don't have the power to do this.\r\n");
                return;
            }

            if (arg.Length == 0)
            {
                ch.SendText("Reset the title on which rank?\r\n");
                return;
            }

            Guild guils = ((PC)ch).GuildMembership;

            try
            {
                rank = (Guild.Rank)Enum.Parse(typeof(Guild.Rank), arg, false);
            }
            catch (Exception)
            {
                ch.SendText("That's not a valid rank.\r\n");
                return;
            }

            if (str.Length == 0)
            {
                ch.SendText("Set the rank title to what?\r\n");
                return;
            }

            guils.RankNames[(int)rank] = str[0];

            ch.SendText("Done.\r\n");

            guils.Save();

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

示例4: Channels

        public static void Channels(CharData ch, string[] str)
        {
            if( ch == null ) return;

            if (str.Length == 0 || String.IsNullOrEmpty(str[0]))
            {
                if (!ch.IsNPC() && ch.HasActionBit(PC.PLAYER_SILENCE))
                {
                    ch.SendText("&nYou are silenced, cur.\r\n");
                    return;
                }

                ch.SendText("Channels:");

                ch.SendText(ch.IsListening(TalkChannel.shout)
                              ? " +SHOUT"
                              : " -shout");

                ch.SendText(ch.IsListening(TalkChannel.yell)
                              ? " +YELL"
                              : " -yell");

                if (ch.IsGuild())
                {
                    ch.SendText(ch.IsListening(TalkChannel.guild)
                                  ? " +guild"
                                  : " -guild");
                }

                if (ch.IsHero())
                {
                    ch.SendText(ch.IsListening(TalkChannel.immortal)
                                  ? " +IMMTALK"
                                  : " -immtalk");
                }

                ch.SendText(".\r\n");
            }
            else
            {
                TalkChannel bit;
                bool fClear;

                if (str[0][0] == '+')
                    fClear = true;
                else if (str[0][0] == '-')
                    fClear = false;
                else
                {
                    ch.SendText("&nChannels -channel or +channel?\r\n");
                    return;
                }

                string tmparg = String.Format("{0}", str[0]);
                if (!MUDString.StringsNotEqual(tmparg + 1, "immtalk"))
                    bit = TalkChannel.immortal;
                else if (!MUDString.StringsNotEqual(tmparg + 1, "guild"))
                    bit = TalkChannel.guild;
                else if (!MUDString.StringsNotEqual(tmparg + 1, "shout"))
                    bit = TalkChannel.shout;
                else if (!MUDString.StringsNotEqual(tmparg + 1, "yell"))
                    bit = TalkChannel.yell;
                else
                {
                    ch.SendText("&nSet or clear which channel?\r\n");
                    return;
                }

                if (fClear)
                    ch.SetListening(bit, true);
                else
                    ch.SetListening(bit, false);

                ch.SendText("&nOk.\r\n");
            }

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

示例5: Ostracize

        public static void Ostracize(CharData ch, string[] str)
        {
            if( ch == null ) return;

            string arg = String.Empty;

            if (!ch.IsGuild() || ((PC)ch).GuildRank < Guild.Rank.deputy)
            {
                ch.SendText("You don't have the power to do this.\r\n");
                return;
            }

            if (arg.Length == 0)
            {
                ch.SendText("Who do you want to ostracize?\r\n");
                return;
            }

            Guild guild = ((PC)ch).GuildMembership;

            if (MUDString.NameContainedIn(arg, guild.Ostracized))
            {
                ch.SendText("They've already been ostracized.\r\n");
                return;
            }

            string buf = String.Format("{0} {1}", guild.Ostracized, arg);

            if (!MUDString.StringsNotEqual(arg, "clear"))
            {
                buf = String.Empty;
            }

            guild.Ostracized = buf;

            ch.SendText("Done.\r\n");

            guild.Save();

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

示例6: Promote

        /// <summary>
        /// Promote target to another rank in the guild.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void Promote(CharData ch, string[] str)
        {
            if( ch == null ) return;

            SocketConnection victimSocket;
            int count;
            bool loggedIn = false;

            if (ch.IsNPC())
            {
                return;
            }

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

            if (!ch.IsGuild() || ((PC)ch).GuildRank != Guild.Rank.leader)
            {
                ch.SendText("You don't have the power to do this.  Only a leader may promote someone.\r\n");
                return;
            }

            Guild guild = ((PC)ch).GuildMembership;

            CharData victim = null;
            foreach (CharData worldChar in Database.CharList)
            {
                if (worldChar.IsNPC())
                {
                    continue;
                }
                if (MUDString.NameContainedIn(str[0], worldChar.Name))
                {
                    victim = worldChar;
                    loggedIn = true;
                    break;
                }
            }

            if (victim == null)
            {
                if (!(CharData.LoadPlayer((victimSocket = new SocketConnection()), str[0])))
                {
                    ch.SendText("Who's that?!\r\n");
                    return;
                }
                victim = victimSocket.Original ? victimSocket.Original : victimSocket.Character;
                loggedIn = false;
            }

            if (victim.IsNPC() || victim == ch)
            {
                return;
            }

            if (!ch.IsSameGuild(victim))
            {
                SocketConnection.Act("$N&n isn't even from $t.", ch, guild.WhoName, victim, SocketConnection.MessageTarget.character);
                return;
            }

            // This is technically where we would give them their guild badges.
            switch (((PC)victim).GuildRank)
            {
                default:
                    return;
                case Guild.Rank.normal:
                case Guild.Rank.officer:
                case Guild.Rank.senior:
                case Guild.Rank.deputy:
                    break;
                case Guild.Rank.leader:
                    ch.SendText("You may not promote that person any further.\r\n");
                    return;
            }

            ((PC)victim).GuildRank++;
            Guild.Rank newrank = ((PC)victim).GuildRank;

            SetTitle(victim, guild.RankNames[(int)((PC)victim).GuildRank]);

            string text = String.Format("Log {0}: promoting {1} to {2} in guild {3}",
                                       ch.Name, victim.Name, newrank, ((PC)ch).GuildMembership.Name);
            Database.LogGuild(text);

            text = String.Format(
                      "The grand Overlord {0} says:\r\n\r\nI hereby promote you {1} to {2}!'\r\n",
                      ch.Name, victim.Name, newrank);

            if (loggedIn)
            {
                victim.SendText(text);
//.........这里部分代码省略.........
开发者ID:ramseur,项目名称:ModernMUD,代码行数:101,代码来源:Command.cs

示例7: KickOut

        /// <summary>
        /// Kick a character out of a guild.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void KickOut(CharData ch, string[] str)
        {
            if( ch == null ) return;

            SocketConnection victimSocket;
            bool loggedIn = false;

            if (str.Length == 0)
            {
                ch.SendText("Kick out whom?\r\n");
                return;
            }

            if (!ch.IsGuild() || ((PC)ch).GuildRank < Guild.Rank.officer)
            {
                ch.SendText("You don't have the power to do this.\r\n");
                return;
            }

            Guild guild = ((PC)ch).GuildMembership;

            CharData victim = null;
            foreach (CharData worldChar in Database.CharList)
            {
                if (worldChar.IsNPC())
                {
                    continue;
                }
                if (MUDString.NameContainedIn(str[0], worldChar.Name))
                {
                    victim = worldChar;
                    loggedIn = true;
                    break;
                }
            }

            if (victim == null)
            {
                if (!(CharData.LoadPlayer((victimSocket = new SocketConnection()), str[0])))
                {
                    ch.SendText("Who's that?!\r\n");
                    return;
                }
                victim = victimSocket.Original ? victimSocket.Original : victimSocket.Character;
                loggedIn = false;
            }

            if (victim.IsNPC())
            {
                return;
            }

            if (victim == ch)
            {
                ch.SendText("Try &+rsociety secede&n!\r\n");
                return;
            }

            if (!ch.IsSameGuild(victim))
            {
                SocketConnection.Act("$N&n isn't even from $t.", ch, guild.WhoName, victim, SocketConnection.MessageTarget.character);
                return;
            }

            if (((PC)ch).GuildRank <= ((PC)victim).GuildRank)
            {
                ch.SendText("You don't have the power to do this.\r\n");
                return;
            }

            string text = String.Format("Log {0}: kicking {1} from {2}", ch.Name, victim.Name, ((PC)ch).GuildMembership.Name);
            Database.LogGuild(text);

            // this _function _resets member data
            victim.RemoveFromGuild();
            ((PC)victim).GuildRank = Guild.Rank.normal;

            if (loggedIn)
            {
                victim.SendText("&+RYou have been booted from your guild!&n\r\n");
            }

            ch.SendText("You have kicked them out of the guild.\r\n");

            CharData.SavePlayer(victim);
            guild.Save();

            /* Close rented chars pfile. */
            if (!loggedIn)
            {
                victimSocket = null;
            }

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

示例8: 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

示例9: Hometown

        public static void Hometown(CharData ch, string[] str)
        {
            if( ch == null ) return;

            if (ch == null)
            {
                Log.Error("Command.Hometown: No ch!", 0);
                return;
            }

            if (!ch.IsGuild() && !ch.IsImmortal())
            {
                ch.SendText("You don't have the power to do this.\r\n");
                return;
            }

            if (ch.IsNPC())
                return;

            if (!ch.InRoom.HasFlag(RoomTemplate.ROOM_GUILDROOM))
            {
                ch.SendText("You can't set your hometown here!\r\n");
                return;
            }

            if (ch.CurrentPosition == Position.fighting || ch.Fighting)
            {
                ch.SendText("No way! You are fighting.\r\n");
                return;
            }

            if (ch.CurrentPosition < Position.stunned)
            {
                ch.SendText("You're not &+RD&n&+rE&+RA&n&+rD&n yet.\r\n");
                return;
            }

            string logBuf = String.Format("{0} is resetting their hometown to {1}.", ch.Name, ch.InRoom.IndexNumber);
            Log.Trace(logBuf);

            ImmortalChat.SendImmortalChat(ch, ImmortalChat.IMMTALK_LOGINS, ch.GetTrust(), logBuf);

            // I can't see any reason why ch would not have an .in_room, but that
            // may just be shortsighted of me - Xangis
            if (!ch.InRoom)
            {
                Log.Error("Commandhometown: ch not in a room!", 0);
                return;
            }

            // Put them in the correct body
            if (ch.Socket && ch.Socket.Original)
            {
                CommandType.Interpret(ch, "return");
            }

            ch.SendText("You Reset your hometown.\r\n");
            ((PC)ch).CurrentHome = ch.InRoom.IndexNumber;

            CharData.SavePlayer(ch);

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

示例10: Initiate

        public static void Initiate(CharData ch, string[] str)
        {
            if( ch == null ) return;

            Object ring;
            bool found = false;
            int count;

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

            CharData victim = ch.GetCharRoom(str[0]);
            if (victim == null)
            {
                ch.SendText("They aren't here.\r\n");
                return;
            }

            if (victim.IsNPC())
            {
                ch.SendText("Very funny trying to enroll an NPC.\r\n");
                return;
            }

            if (!ch.IsGuild() || ((PC)ch).GuildRank < Guild.Rank.officer)
            {
                ch.SendText("You don't have the power to do this.\r\n");
                return;
            }

            Guild guild = ((PC)ch).GuildMembership;

            if (victim == ch)
            {
                return;
            }

            if (guild.Applicant != victim)
            {
                ch.SendText("They have not applied for membership to your guild.\r\n");
                return;
            }

            if (victim.IsGuild())
            {
                ch.SendText("They are already in another guild.\r\n");
                return;
            }

            if (guild.NumMembers >= 30)
            {
                ch.SendText("Your guild is full.\r\n");
                return;
            }

            for (count = 0; count < Limits.MAX_GUILD_MEMBERS; ++count)
            {
                if (guild.Members[count].Filled == false)
                {
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                ch.SendText("There are no more openings in your organization.\r\n");
                return;
            }

            /*
            if( ((PC)victim).rank == Rank.exiled )
            {
            ch.SendText( "They are an exile and may not be guilded.\r\n" );
            victim.SendText( "You are an exile and cannot be accepted into a guild.\r\n" );
            return;
            }
            */

            if (victim.Level < 25)
            {
                if (guild.TypeOfGuild == Guild.GuildType.clan && ch.Level >= 15)
                {
                }
                else if (guild.TypeOfGuild == Guild.GuildType.guild && ch.Level >= 20)
                {
                }
                else
                {
                    SocketConnection.Act("$N&n is too low level to be initiated.", ch, null, victim, SocketConnection.MessageTarget.character);
                    SocketConnection.Act("You are too weak to  be initiated to $t!", ch, guild.WhoName, victim, SocketConnection.MessageTarget.victim);
                    return;
                }
            }

            if (guild.TypeOfGuild == Guild.GuildType.guild && guild.ClassRestriction != victim.CharacterClass)
                ch.SendText("You may only initiate those of your class into a guild.\r\n");
//.........这里部分代码省略.........
开发者ID:ramseur,项目名称:ModernMUD,代码行数:101,代码来源:Command.cs

示例11: InflictSpellDamage


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

            /*
            * 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 );
            }

            /*
            * Payoff for killing things.
            */
            if( victim.CurrentPosition == Position.dead )
            {
                StopFighting( ch, false );

                if( !victim.HasActionBit(MobTemplate.ACT_NOEXP ) || !victim.IsNPC() )
                    GroupExperienceGain( ch, victim );

                if( !victim.IsNPC() )
                {
                    if( ch.IsNPC() )
                    {
                        ( (PC)victim ).MobDeaths++;
                        if( victim.IsGuild() )
                        {
                            ( (PC)victim ).GuildMembership.MonsterDeaths++;
                            ( (PC)victim ).GuildMembership.Score += CalculateDeathScore( ch, victim );
                        }
                        ( (PC)victim ).Score += CalculateDeathScore( ch, victim );
                    }
                    else
                    {
                        ( (PC)ch ).PlayerKills++;
                        ( (PC)victim ).PlayerDeaths++;

                        ( (PC)victim ).Score += CalculateDeathScore( ch, victim );
                        ( (PC)ch ).Score += CalculateKillScore( ch, victim );

                        if( ch.IsGuild()
                                && victim.IsGuild()
                                && ( (PC)ch ).GuildMembership != ( (PC)victim ).GuildMembership )
                        {
                            ( (PC)ch ).GuildMembership.PlayerKills++;
                            ( (PC)victim ).GuildMembership.PlayerDeaths++;
                            ( (PC)ch ).GuildMembership.Score += CalculateKillScore( ch, victim );
                            ( (PC)victim ).GuildMembership.Score += CalculateDeathScore( ch, victim );
                        }
                    }

                    string logBuf = String.Format( "{0}&n killed by {1}&n at {2}",
                              victim.Name,
                              ( ch.IsNPC() ? ch.ShortDescription : ch.Name ),
                              victim.InRoom.IndexNumber );
                    Log.Trace( logBuf );
                    ImmortalChat.SendImmortalChat( ch, ImmortalChat.IMMTALK_DEATHS, Limits.LEVEL_AVATAR, logBuf );
开发者ID:carriercomm,项目名称:ModernMUD,代码行数:66,代码来源:Combat.cs

示例12: InflictDamage


//.........这里部分代码省略.........
                else
                    StopFighting( victim, false );
            }

            /*
            * Payoff for killing things.
            */
            if( victim.CurrentPosition == Position.dead )
            {
                // Done in attempt to squelch the combat continuation bug
                StopFighting( victim, true );

                if( !victim.HasActionBit(MobTemplate.ACT_NOEXP ) || !victim.IsNPC() )
                    GroupExperienceGain( ch, victim );

                if( ch.IsNPC() )
                {
                    if( ch.Hunting )
                    {
                        if( ch.Hunting.Who == victim )
                            StopHunting( ch );
                    }
                    if( ch.IsHating(victim) )
                    {
                        ch.StopHating( victim );
                    }
                }

                if( !victim.IsNPC() )
                {
                    if( ch.IsNPC() )
                    {
                        ( (PC)victim ).MobDeaths++;
                        if( victim.IsGuild() )
                        {
                            ( (PC)victim ).GuildMembership.MonsterDeaths++;
                            ( (PC)victim ).GuildMembership.Score += CalculateDeathScore( ch, victim );
                        }
                        ( (PC)victim ).Score += CalculateDeathScore( ch, victim );

                    }
                    else
                    {
                        ( (PC)ch ).PlayerKills++;
                        ( (PC)victim ).PlayerDeaths++;

                        ( (PC)victim ).Score += CalculateDeathScore( ch, victim );
                        ( (PC)ch ).Score += CalculateKillScore( ch, victim );

                        if( ch.IsGuild()
                                && victim.IsGuild()
                                && ( (PC)ch ).GuildMembership != ( (PC)victim ).GuildMembership )
                        {
                            ( (PC)ch ).GuildMembership.PlayerKills++;
                            ( (PC)victim ).GuildMembership.PlayerDeaths++;
                            ( (PC)ch ).GuildMembership.Score += CalculateKillScore( ch, victim );
                            ( (PC)victim ).GuildMembership.Score += CalculateDeathScore( ch, victim );
                        }
                    }

                    string logBuf = String.Format( "{0}&n killed by {1}&n at {2}",
                              victim.Name, ( ch.IsNPC() ? ch.ShortDescription : ch.Name ),
                              victim.InRoom.IndexNumber );
                    Log.Trace( logBuf );
                    ImmortalChat.SendImmortalChat( ch, ImmortalChat.IMMTALK_DEATHS, Limits.LEVEL_AVATAR, logBuf );
开发者ID:carriercomm,项目名称:ModernMUD,代码行数:66,代码来源:Combat.cs

示例13: IsSameGuild

 /// <summary>
 /// Checks whether two characters are in the same guild.
 /// </summary>
 /// <param name="ch"></param>
 /// <returns></returns>
 public bool IsSameGuild( CharData ch )
 {
     if (IsGuild() && ch.IsGuild())
     {
         return ((PC)this).GuildMembership == ((PC)ch).GuildMembership;
     }
     return false;
 }
开发者ID:carriercomm,项目名称:ModernMUD,代码行数:13,代码来源:CharData.cs

示例14: Fine

        public static void Fine(CharData ch, string[] str)
        {
            if( ch == null ) return;

            string arg = String.Empty;
            int amount;
            int count;

            if (arg.Length == 0)
            {
                ch.SendText("Fine whom?\r\n");
                return;
            }

            if (!ch.IsGuild() || ((PC)ch).GuildRank < Guild.Rank.deputy)
            {
                ch.SendText("You don't have the power to do this.\r\n");
                return;
            }

            Guild guild = ((PC)ch).GuildMembership;

            Int32.TryParse(str[0], out amount);

            if (amount <= 0)
            {
                ch.SendText("Fine them how much?\r\n");
                return;
            }

            if (!MUDString.StringsNotEqual(arg, "all"))
            {
                for (count = 0; count < Limits.MAX_GUILD_MEMBERS; ++count)
                {
                    if (guild.Members[count].Filled == true &&
                            guild.Members[count].Rank < ((PC)ch).GuildRank)
                    {
                        guild.Members[count].Fine += amount;
                    }
                }
            }
            else
            {
                bool found = false;
                for (count = 0; count < Limits.MAX_GUILD_MEMBERS; ++count)
                {
                    if (MUDString.StringsNotEqual(guild.Members[count].Name, arg))
                        continue;
                    if (guild.Members[count].Filled == true &&
                            guild.Members[count].Rank < ((PC)ch).GuildRank)
                    {
                        guild.Members[count].Fine += amount;
                        found = true;
                    }
                }
                if (!found)
                {
                    ch.SendText("You were not able to fine them.\r\n");
                    return;
                }
            }

            ch.SendText("Done.\r\n");

            guild.Save();

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

示例15: Leave

        /// <summary>
        /// Terminate your guild membership.
        /// </summary>
        /// <param name="ch"></param>
        /// <param name="str"></param>
        public static void Leave(CharData ch, string[] str)
        {
            if( ch == null ) return;
            if (!ch.IsGuild())
            {
                ch.SendText("You aren't a guildmember.\r\n");
                return;
            }

            Guild guild = ((PC)ch).GuildMembership;

            if (((PC)ch).GuildRank == Guild.Rank.leader)
            {
                ch.SendText("Huh? An Overlord shouldn't leave his guild! Get demoted first!\r\n");
                return;
            }

            ch.RemoveFromGuild();
            ((PC)ch).GuildRank = Guild.Rank.normal;

            SocketConnection.Act("You have left guild $t.", ch, guild.WhoName, ch, SocketConnection.MessageTarget.character);
            CharData.SavePlayer(ch);
            guild.Save();

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


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