示例#1
0
        public void Run()
        {
            var responseString = _client.GetXHR("http://astrum.amebagames.com/_/mypage");
            var mypage         = JsonConvert.DeserializeObject <MypageInfo>(responseString);

            InfoPrinter.PrintMypage(mypage, _client.ViewModel);
            InfoUpdater.UpdateMypageView(mypage, _client.ViewModel);

            _client.Access("mypage");

            if (mypage.loginBonus != null)
            {
                if (mypage.loginBonus.basic)
                {
                    LoginBonusBasic();
                }
                if (mypage.loginBonus.@event)
                {
                    LoginBonusEvent();
                }
                if (mypage.loginBonus.longLogin)
                {
                    LoginBonusLongLogin();
                }
            }
        }
示例#2
0
        private GuildBattleInfo GuildBattle(string battleId)
        {
            var             result     = _client.GetXHR("http://astrum.amebagames.com/_/guildbattle?_id=" + battleId);
            GuildBattleInfo battleInfo = JsonConvert.DeserializeObject <GuildBattleInfo>(result);


            var guild1 = battleInfo.guilds[0];

            _client.ViewModel.GuildName1              = guild1.name;
            _client.ViewModel.GuildBattlePoint1       = guild1.point;
            _client.ViewModel.GuildBattleAttackCombo1 = guild1.combo.attack.count;
            _client.ViewModel.GuildBattleYellCombo1   = guild1.combo.yell.count;

            var guild2 = battleInfo.guilds[1];

            _client.ViewModel.GuildName2              = guild2.name;
            _client.ViewModel.GuildBattlePoint2       = guild2.point;
            _client.ViewModel.GuildBattleAttackCombo2 = guild2.combo.attack.count;
            _client.ViewModel.GuildBattleYellCombo2   = guild2.combo.yell.count;

            InfoPrinter.PrintGuildBattleInfo(battleInfo, _client.ViewModel);
            InfoUpdater.UpdateGuildBattleStatus(battleInfo.status, _client.ViewModel);

            _client.DelayShort();
            return(battleInfo);
        }
示例#3
0
        public void Run(string gachaId, bool sequence)
        {
            var result = GachaResult(gachaId, sequence);

            InfoPrinter.PrintGachaResult(result, _client.ViewModel);
            InfoUpdater.UpdateGachaResult(result, _client.ViewModel);

            initGachaList();
        }
示例#4
0
        public void StartTraining(string baseId)
        {
            RaiseInfo raiseInfo = RaiseSearch(baseId, 1);

            InfoUpdater.UpdateRaiseInfo(raiseInfo, _client.ViewModel);

            RaiseInfo raiseItemInfo = RaiseItem(_client.ViewModel.TrainingBaseId);

            InfoUpdater.UpdateRaiseItemInfo(raiseItemInfo, _client.ViewModel);
        }
示例#5
0
        private RaidBattleInfo BreedingRaidBattleInfo(string raidId)
        {
            var result     = _client.GetXHR("http://astrum.amebagames.com/_/breeding/battle?_id=" + Uri.EscapeDataString(raidId));
            var battleInfo = JsonConvert.DeserializeObject <RaidBattleInfo>(result);

            InfoPrinter.PrintRaidBattleInfo(battleInfo, _client.ViewModel);
            InfoUpdater.UpdateBpAfterRaidBattle(battleInfo, _client.ViewModel);

            _client.DelayShort();
            return(battleInfo);
        }
示例#6
0
        protected virtual StageInfo EnterStage()
        {
            var result = _client.GetXHR("http://astrum.amebagames.com/_/stage");
            var stage  = JsonConvert.DeserializeObject <StageInfo>(result);

            InfoPrinter.PrintStageInfo(stage, _client.ViewModel);
            InfoUpdater.UpdateStageView(stage.initial, _client.ViewModel);
            _client.DelayShort();

            return(stage);
        }
示例#7
0
        private GuildBattleCmdInfo GuildBattleCmd(string battleId, string type)
        {
            var result = _client.GetXHR("http://astrum.amebagames.com/_/guildbattle/cmd?_id=" + battleId + "&type=" + type);
            GuildBattleCmdInfo cmdInfo = JsonConvert.DeserializeObject <GuildBattleCmdInfo>(result);

            //PrintCmdInfo(cmdInfo);
            InfoUpdater.UpdateGuildBattleStatus(cmdInfo.status, _client.ViewModel);

            _client.DelayShort();

            return(cmdInfo);
        }
示例#8
0
        private GuildBattleInfo GuildBattle(string battleId)
        {
            var             result     = _client.GetXHR("http://astrum.amebagames.com/_/guildbattle?_id=" + battleId);
            GuildBattleInfo battleInfo = JsonConvert.DeserializeObject <GuildBattleInfo>(result);


            InfoPrinter.PrintGuildBattleInfo(battleInfo, _client.ViewModel);
            InfoUpdater.UpdateGuildBattleStatus(battleInfo.status, _client.ViewModel);

            _client.DelayShort();
            return(battleInfo);
        }
示例#9
0
        public void Run()
        {
            var responseString = _client.GetXHR("http://astrum.amebagames.com/_/item");
            var itemList       = JsonConvert.DeserializeObject <ItemList>(responseString);

            _client.Access("item");

            foreach (var item in itemList.list)
            {
                InfoUpdater.UpdateItemStock(item, _client.ViewModel);
            }
        }
示例#10
0
        private StageInfo ForwardTpStage()
        {
            var values = new Dictionary <string, object>
            {
                { "areaId", "recovery_tp" }
            };
            var result = _client.PostXHR("http://astrum.amebagames.com/_/stage/tp", values);
            var stage  = JsonConvert.DeserializeObject <StageInfo>(result);

            InfoPrinter.PrintStageInfo(stage, _client.ViewModel);
            InfoUpdater.UpdateStageView(stage, _client.ViewModel);
            _client.DelayShort();

            return(stage);
        }
示例#11
0
        private void BreedingRaidBattleAttack(string raidId, string attackType)
        {
            var values = new Dictionary <string, object>
            {
                { "_id", raidId },
                { "attackType", attackType }
            };
            //first
            var battleResult     = _client.PostXHR("http://astrum.amebagames.com/_/breeding/battle", values);
            var battleResultInfo = JsonConvert.DeserializeObject <BossBattleResultInfo>(battleResult);

            InfoPrinter.PrintBossBattleResult(battleResultInfo, _client.ViewModel);
            InfoUpdater.UpdateBattleDamage(battleResultInfo, _client.ViewModel);

            _client.DelayLong();
        }
示例#12
0
        public StageInfo EnterBreedingStage()
        {
            var areaId = "breeding0001-1";
            //MapInfo map = BreedingMap();
            //var areaId = map.list[0]._id;

            var url    = string.Format("http://astrum.amebagames.com/_/breeding/stage?areaId={0}&eventId={1}", areaId, Uri.EscapeDataString(_client.ViewModel.BreedingEventId));
            var result = _client.GetXHR(url);

            var stage = JsonConvert.DeserializeObject <StageInfo>(result);

            InfoPrinter.PrintStageInfo(stage, _client.ViewModel);
            InfoUpdater.UpdateStageView(stage.initial, _client.ViewModel);

            _client.DelayShort();
            return(stage);
        }
示例#13
0
        public void UseItem(string type, string itemId, int value)
        {
            var responseString = _client.GetXHR("http://astrum.amebagames.com/_/item/common?type=" + type);
            var itemList       = JsonConvert.DeserializeObject <ItemList>(responseString);

            var item = itemList.list.Find(e => itemId.Equals(e._id));

            if (item.stock >= value)
            {
                var values = new Dictionary <string, object>
                {
                    { "itemId", item._id },
                    { "value", value }
                };
                string result        = _client.PostXHR("http://astrum.amebagames.com/_/item/common", values);
                var    useItemResult = JsonConvert.DeserializeObject <UseItemResult>(result);

                InfoUpdater.UpdateItemStock(useItemResult, _client.ViewModel);
            }
        }
示例#14
0
        private void GuildBattleCmd(string battleId, string abilityId, string cmd)
        {
            var values = new Dictionary <string, object>
            {
                { "_id", battleId },
                { "abilityId", abilityId },
                { "cmd", cmd }
            };
            string result    = _client.PostXHR("http://astrum.amebagames.com/_/guildbattle/cmd", values);
            var    cmdResult = JsonConvert.DeserializeObject <CmdResult>(result);


            if ("success".Equals(cmdResult.commandResult))
            {
                InfoPrinter.PrintGuildBattleCmdResult(cmdResult, _client.ViewModel);
                InfoUpdater.UpdateGuildBattleStatus(cmdResult.battlestate.status, _client.ViewModel);
            }


            _client.DelayLong();
        }
示例#15
0
        protected virtual StageInfo ForwardStage(string areaId)
        {
            var values = new Dictionary <string, object>
            {
                { "areaId", areaId }
            };
            var result = _client.PostXHR("http://astrum.amebagames.com/_/stage", values);
            var stage  = JsonConvert.DeserializeObject <StageInfo>(result);

            InfoPrinter.PrintStageInfo(stage, _client.ViewModel);

            var feverBefore = _client.ViewModel.Fever;

            InfoUpdater.UpdateStageView(stage, _client.ViewModel);
            if (_client.ViewModel.Fever && feverBefore != _client.ViewModel.Fever)
            {
                _client.RaiseNotificationEvent("Fever start", AstrumClient.SECOND * 60);
            }

            _client.DelayShort();
            return(stage);
        }
示例#16
0
        protected override StageInfo EnterStage()
        {
            AreaInfo area = FindArea();

            var areaId = area._id;

            if (area.status == 1)
            {
                OpenStage(area);
            }

            var url    = string.Format("http://astrum.amebagames.com/_/stage?areaId={0}", areaId);
            var result = _client.GetXHR(url);

            var stage = JsonConvert.DeserializeObject <StageInfo>(result);

            InfoPrinter.PrintStageInfo(stage, _client.ViewModel);
            InfoUpdater.UpdateStageView(stage.initial, _client.ViewModel);

            _client.DelayShort();
            return(stage);
        }