protected override bool PerformInit(TasSayEventArgs e, string[] words, out string question, out int winCount)
        {
            winCount = 0;
            question = null;
            if (words.Length == 0)
            {
                if (ah.BossName == "")
                {
                    ah.Respond(e, "there is currently no boss to remove");
                    return(false);
                }
                else
                {
                    player   = "";
                    question = "Remove current boss " + ah.BossName + "?";
                    return(true);
                }
            }

            string[] players;
            int[]    indexes;
            if (AutoHost.FilterUsers(words, tas, spring, out players, out indexes) > 0)
            {
                player = players[0];
                if (player == tas.UserName)
                {
                    ah.Respond(e, "you flatter me, but no");
                    return(false);
                }
                else
                {
                    question = "Elect " + player + " for the boss?";
                    return(true);
                }
            }
            else
            {
                AutoHost.Respond(tas, spring, e, "Cannot find such player");
                return(false);
            }
        }
        protected override bool PerformInit(TasSayEventArgs e, string[] words, out string question, out int winCount)
        {
            question = null;
            winCount = 0;
            if (words.Length == 0)
            {
                ah.Respond(e, "You must specify player name");
                return(false);
            }

            string[] players;
            int[]    indexes;
            if (AutoHost.FilterUsers(new[] { words[0] }, tas, spring, out players, out indexes) > 0)
            {
                player = players[0];
                if (player == tas.UserName)
                {
                    ah.Respond(e, "won't kick myself, not in suicidal mood today");
                    return(false);
                }
                else
                {
                    string reason = (words.Length > 1 && words[1] != "for") ? " for" : "";
                    for (var i = 1; i < words.Length; i++)
                    {
                        reason += " " + words[i];
                    }
                    question = "Kick " + player + reason + "?";
                    return(true);
                }
            }
            else
            {
                AutoHost.Respond(tas, spring, e, "Cannot find such player");
                return(false);
            }
        }
Beispiel #3
0
        protected override bool PerformInit(TasSayEventArgs e, string[] words, out string question, out int winCount)
        {
            winCount = 0;
            question = null;
            if (words.Length == 0)
            {
                AutoHost.Respond(tas, spring, e, "You must specify player name");
                return(false);
            }

            string[] players;
            int[]    indexes;
            if (AutoHost.FilterUsers(words, tas, spring, out players, out indexes) > 0)
            {
                player   = players[0];
                question = "Spectate " + player + "?";
                return(true);
            }
            else
            {
                AutoHost.Respond(tas, spring, e, "Cannot find such player");
                return(false);
            }
        }