コード例 #1
0
        public static void HandleChatMessage(Bot bot, ChatClientMultiMessage message)
        {
            if (message.content == ".gather on")
            {
                message.BlockNetworkSend();// do not send this message to the server

                if (!bot.Character.Jobs.Any(x => x.JobTemplate.id == GatherTest.FARMER_JOB))
                {
                    bot.Character.SendMessage("You haven't the farmer job");
                }
                else
                {
                    bot.AddFrame(new GatherTest(bot));
                    bot.Character.SendMessage("Gathering ...");
                }
            }
            else if (message.content == ".gather off")
            {
                message.BlockNetworkSend();// do not send this message to the server


                bot.RemoveFrame <GatherTest>();
                bot.Character.SendMessage("Stop gathering ...");
            }
        }
コード例 #2
0
 public static void OnCharacterSelectedSuccessMessage(Bot bot, CharacterSelectedSuccessMessage message)
 {
     if (bot.Dispatcher is NetworkMessageDispatcher)
     {
         bot.AddFrame(new WindowDetector(bot));
     }
 }
コード例 #3
0
        public void EnterMap(Map map)
        {
            Map     = map;
            Context = map;

            Bot.AddFrame(new RolePlayHandler(Bot));
            OnMapJoined(map);
        }
コード例 #4
0
 public static void HandleChatClientMultiMessage(Bot bot, ChatClientMultiMessage message)
 {
     if (message.content.StartsWith(".compare pathfinder"))
     {
         message.BlockNetworkSend();
         if (bot.HasFrame <PathfindersComparer>())
         {
             bot.RemoveFrame <PathfindersComparer>();
         }
         else
         {
             bot.AddFrame(new PathfindersComparer(bot));
         }
     }
 }
コード例 #5
0
        public void EnterFight(GameFightJoinMessage message)
        {
            if (IsFighting())
            {
                throw new Exception("Player already fighting !");
            }

            var fight = new Fight(message, Map);

            Fighter = new PlayedFighter(this, fight);

            Context = Fight;
            Bot.AddFrame(new FightHandler(Bot));
            OnFightJoined(Fight);
        }
コード例 #6
0
 static void SetFrame(Bot bot, Mode mode)
 {
     if (bot.HasFrame <FFight>())
     {
         bot.Character.SendInformation("Set existing FFight to {0} mode", mode);
         bot.GetFrame <FFight>().Mode = mode;
     }
     else
     if (bot.AddFrame(new FFight(bot, mode)))
     {
         bot.Character.SendInformation("Experimental AI fight started in {0} mode", mode);
     }
     else
     {
         bot.Character.SendInformation("Failed to start a new FFight frame !");
     }
 }
コード例 #7
0
        public static void HandleChatMessage(Bot bot, ChatClientMultiMessage message)
        {
            if (message.content == ".fight on")
            {
                message.BlockNetworkSend();// do not send this message to the server

                bot.AddFrame(new AutoFight(bot));
                bot.Character.SendMessage("Auto fight started");
            }
            else if (message.content == ".fight off")
            {
                message.BlockNetworkSend();// do not send this message to the server


                bot.RemoveFrame <AutoFight>();
                bot.Character.SendMessage("Auto fight stopped");
            }
        }
コード例 #8
0
 public static void HandleCharacterSelectedSuccessMessage(Bot bot, CharacterSelectedSuccessMessage message)
 {
     bot.AddFrame(new ChatViewModel(bot));
 }
コード例 #9
0
 public static void HandleCharacterSelectedSuccessMessage(Bot bot, CharacterSelectedSuccessMessage message)
 {
     bot.AddFrame(new NeighboursChecker(bot));
 }
コード例 #10
0
 public static void HandleServersListMessage(Bot bot, ServersListMessage message)
 {
     bot.AddFrame(new ServerSelectorModelView(bot));
 }
コード例 #11
0
 public static void HandleCharactersListMessage(Bot bot, CharactersListMessage message)
 {
     bot.AddFrame(new CharacterSelectionViewModel(bot));
 }
コード例 #12
0
 public static void HandleCharacterSelectedSuccessMessage(Bot bot, CharacterSelectedSuccessMessage message)
 {
     bot.AddFrame(new FFight(bot, Mode.Follower));
 }