Exemple #1
0
 public static void PrintAreaBossInfo(AreaBossInfo boss, MainWindowViewModel viewModel)
 {
     string history = "";
     history += String.Format("{0}的{1}出现了!", boss.areaName, boss.name) + Environment.NewLine;
     history += String.Format("血量:{0} / {1}", boss.hp - boss.totalDamage, boss.hp) + Environment.NewLine;
     viewModel.History = history;
 }
Exemple #2
0
        public AstrumClient()
        {
            ViewModel = new MainWindowViewModel();
            ViewModel.PropertyChanged += ViewModel_PropertyChanged;

            _questHandler = new QuestHandler(this);
            _raidHandler = new RaidHandler(this);
            _furyRaidHandler = new FuryRaidHandler(this);
            _limitedRaidHandler = new LimitedRaidHandler(this);
            _breedingHandler = new BreedingHandler(this);
            _guildBattleHandler = new GuildBattleHandler(this);
            _mypageHandler = new MypageHandler(this);
            _giftHandler = new GiftHandler(this);
            _itemHandler = new ItemHandler(this);
            _gachaHandler = new GachaHandler(this);
            _trainingHandler = new TraningHandler(this);
            _specialAreaHandler = new SpecialAreaHandler(this);
            _talkHandler = new TalkHandler(this);

            ViewModel.IsQuestEnable = true;
            ViewModel.IsGuildBattleEnable = false;
            ViewModel.IsSpecialAreaEnable = false;

            ViewModel.MinStaminaStock = DEFAULT_STOCK;
            ViewModel.MinBpStock = DEFAULT_STOCK;
            ViewModel.KeepStamina = DEFAULT_KEEP_STAMINA;

            ViewModel.BaseDamage = DEFAULT_BASE_DAMAGE;
        }
Exemple #3
0
 public static void UpdateBpAfterRaidBattle(RaidBattleInfo battleInfo, MainWindowViewModel viewModel)
 {
     if (battleInfo.isPlaying || battleInfo.isWin || battleInfo.isLose)
     {
         viewModel.BpValue = battleInfo.bpValue;
         viewModel.BpMax = battleInfo.bpMax;
     }
 }
Exemple #4
0
        public static void PrintBreedingEventInfo(BreedingEventInfo info, MainWindowViewModel viewModel)
        {
            string history = "";
            history += info.name + Environment.NewLine;
            history += String.Format("{0} : {1}", info.breedingPointName, info.breedingPoint) + Environment.NewLine;
            history += String.Format("{0} : {1}", "交换pt", info.exchangePoint) + Environment.NewLine;

            history += String.Format("个人讨伐{0}, 还差{1}次获得{2}", info.totalRewards.user.total, info.totalRewards.user.next.requirement - info.totalRewards.user.total, info.totalRewards.user.next.name) + Environment.NewLine;
            history += String.Format("工会讨伐{0}, 还差{1}次获得{2}", info.totalRewards.guild.total, info.totalRewards.guild.next.requirement - info.totalRewards.guild.total, info.totalRewards.guild.next.name) + Environment.NewLine;

            viewModel.History = history;
        }
Exemple #5
0
 public static void UpdateBattleDamage(BossBattleResultInfo resultInfo, MainWindowViewModel viewModel)
 {
     if (!resultInfo.isEnd)
     {
         var atkSum = resultInfo.result.afterDeck.Sum(deck => deck.Value.atk);
         if (AstrumClient.FULL.Equals(resultInfo.init.bpType))
         {
             viewModel.BaseDamage = atkSum;
         }
         else
         {
             viewModel.BaseDamage = atkSum * 5;
         }
     }
 }
Exemple #6
0
 public static void UpdateItemStock(ItemInfo item, MainWindowViewModel viewModel)
 {
     if (AstrumClient.INSTANT_HALF_STAMINA.Equals(item._id))
     {
         viewModel.StaminaHalfStock = item.stock;
     }
     else if (AstrumClient.INSTANT_STAMINA.Equals(item._id))
     {
         viewModel.StaminaStock = item.stock;
     }
     else if (AstrumClient.INSTANT_MINI_BP.Equals(item._id))
     {
         viewModel.BpMiniStock = item.stock;
     }
     else if (AstrumClient.INSTANT_BP.Equals(item._id))
     {
         viewModel.BpStock = item.stock;
     }
 }
Exemple #7
0
        public static void PrintBossBattleResult(BossBattleResultInfo resultInfo, MainWindowViewModel viewModel)
        {
            string history = "";

            if (!resultInfo.isEnd)
            {
                string resultType = "";
                switch (resultInfo.result.resultType)
                {
                    case "draw":
                        resultType = "平局";
                        break;
                    case "win":
                        resultType = "勝利";
                        break;
                    case "lose":
                        resultType = "失敗";
                        break;
                }

                history += String.Format("战斗结束:{0}", resultType) + Environment.NewLine;
                history += String.Format("BOSS血量:{0} / {1}", resultInfo.result.afterBoss.hp, resultInfo.result.afterBoss.maxHp) + Environment.NewLine;

                var damage = resultInfo.init.boss.hp - resultInfo.result.afterBoss.hp;
                var atkSum = resultInfo.result.afterDeck.Sum(deck => deck.Value.atk);

                if (AstrumClient.FULL.Equals(resultInfo.init.bpType))
                {
                    history += String.Format("全力傷害:{0}", atkSum * 5) + Environment.NewLine;
                    history += String.Format("実際傷害:{0}", damage) + Environment.NewLine;
                }
                else
                {
                    history += String.Format("  傷害:{0}", atkSum * 5) + Environment.NewLine;
                    history += String.Format("実際傷害:{0}", damage) + Environment.NewLine;
                }

                viewModel.History = history;
            }
        }
Exemple #8
0
 public static void UpdateItemStock(UseItemResult item, MainWindowViewModel viewModel)
 {
     if (AstrumClient.INSTANT_HALF_STAMINA.Equals(item._id))
     {
         viewModel.StaminaHalfStock = item.stock.after;
         viewModel.StaminaValue = item.value.after;
     }
     else if (AstrumClient.INSTANT_STAMINA.Equals(item._id))
     {
         viewModel.StaminaStock = item.stock.after;
         viewModel.StaminaValue = item.value.after;
     }
     else if (AstrumClient.INSTANT_MINI_BP.Equals(item._id))
     {
         viewModel.BpMiniStock = item.stock.after;
         viewModel.BpValue = item.value.after;
     }
     else if (AstrumClient.INSTANT_BP.Equals(item._id))
     {
         viewModel.BpStock = item.stock.after;
         viewModel.BpValue = item.value.after;
     }
 }
Exemple #9
0
        public static void PrintGachaResult(GachaResult result, MainWindowViewModel viewModel)
        {
            string history = "";
            foreach (var item in result.list)
            {

                if ("item".Equals(item.type))
                {
                    history += String.Format("{0} x {1}", item.name, item.value) + Environment.NewLine;
                }
                else if ("card".Equals(item.type))
                {
                    string rare = "";
                    switch (item.rare)
                    {
                        case 4:
                            rare = "[欧皇]";
                            break;
                        case 3:
                            rare = "[脸帝]";
                            break;
                        case 2:
                            rare = "[狗粮]";
                            break;
                        case 1:
                            rare = "[渣渣]";
                            break;
                        default:
                            rare = "[????]";
                            break;
                    }

                    history += String.Format("{0}{1} x {2}", rare, item.name, item.value) + Environment.NewLine;
                }
            }
            viewModel.History = history;
        }
Exemple #10
0
        public static void PrintGiftResult(GiftResult giftResult, MainWindowViewModel viewModel)
        {
            string history = "";
            if (giftResult.item > 0)
            {
                history += String.Format("   获得道具:{0}", giftResult.item) + Environment.NewLine;
            }
            if (giftResult.lilu > 0)
            {
                history += String.Format("   获得ルピ:{0}", giftResult.lilu) + Environment.NewLine;
            }
            if (giftResult.card > 0)
            {
                history += String.Format("   获得少女:{0}", giftResult.card) + Environment.NewLine;
            }
            if (giftResult.practice > 0)
            {
                history += String.Format("  获得摸擬戦:{0}", giftResult.practice) + Environment.NewLine;
            }
            if (giftResult.enhance != null)
            {
                if (giftResult.enhance.strength > 0)
                {
                    history += String.Format("  获得强化像:{0}", giftResult.enhance.strength) + Environment.NewLine;
                }
                if (giftResult.enhance.ability > 0)
                {
                    history += String.Format("  获得技能書:{0}", giftResult.enhance.ability) + Environment.NewLine;
                }
                if (giftResult.enhance.limitbreak > 0)
                {
                    history += String.Format(" 获得开花结晶:{0}", giftResult.enhance.limitbreak) + Environment.NewLine;
                }
            }

            if (giftResult.gacha != null)
            {
                if (giftResult.gacha.ContainsKey(AstrumClient.INSTANT_PLATINUM_GACHA_POINT))
                {
                    var value = giftResult.gacha[AstrumClient.INSTANT_PLATINUM_GACHA_POINT].value;
                    history += String.Format("   获得星钻:{0}", value) + Environment.NewLine;
                }
                if (giftResult.gacha.ContainsKey(AstrumClient.INSTANT_PLATINUM_GACHA_TICKET))
                {
                    var value = giftResult.gacha[AstrumClient.INSTANT_PLATINUM_GACHA_TICKET].value;
                    history += String.Format(" 获得非洲护照:{0}", value) + Environment.NewLine;
                }
                if (giftResult.gacha.ContainsKey(AstrumClient.INSTANT_RARE_RAID_MEDAL))
                {
                    var value = giftResult.gacha[AstrumClient.INSTANT_RARE_RAID_MEDAL].value;
                    history += String.Format("获得稀有魔星币:{0}", value) + Environment.NewLine;
                }
                if (giftResult.gacha.ContainsKey(AstrumClient.INSTANT_RAID_MEDAL))
                {
                    var value = giftResult.gacha[AstrumClient.INSTANT_RAID_MEDAL].value;
                    history += String.Format("  获得魔星币:{0}", value) + Environment.NewLine;
                }
            }

            viewModel.History = history;
        }
Exemple #11
0
        public static void UpdateRaiseItemInfo(RaiseInfo raiseItemInfo, MainWindowViewModel viewModel)
        {
            viewModel.AbilityBookGoldStock = 0;
            viewModel.AbilityBookGoldAvailable = 0;
            viewModel.AbilityBookSilverStock = 0;
            viewModel.AbilityBookSilverAvailable = 0;
            viewModel.AbilityBookBronzeStock = 0;
            viewModel.AbilityBookBronzeAvailable = 0;
            viewModel.StrengthStatueGoldStock = 0;
            viewModel.StrengthStatueGoldAvailable = 0;
            viewModel.StrengthStatueSilverStock = 0;
            viewModel.StrengthStatueSilverAvailable = 0;
            viewModel.StrengthStatueBronzeStock = 0;
            viewModel.StrengthStatueBronzeAvailable = 0;

            if (raiseItemInfo.items != null)
            {
                if (raiseItemInfo.items.ability != null)
                {
                    foreach (var item in raiseItemInfo.items.ability)
                    {
                        switch (item._id)
                        {
                            case AstrumClient.INSTANT_ABILITY_BOOK_GOLD:
                                viewModel.AbilityBookGoldStock = item.stock;
                                viewModel.AbilityBookGoldAvailable = item.available;
                                break;
                            case AstrumClient.INSTANT_ABILITY_BOOK_SILVER:
                                viewModel.AbilityBookSilverStock = item.stock;
                                viewModel.AbilityBookSilverAvailable = item.available;
                                break;
                            case AstrumClient.INSTANT_ABILITY_BOOK_BRONZE:
                                viewModel.AbilityBookBronzeStock = item.stock;
                                viewModel.AbilityBookBronzeAvailable = item.available;
                                break;
                        }
                    }
                }

                if (raiseItemInfo.items.exp != null)
                {
                    foreach (var item in raiseItemInfo.items.exp)
                    {
                        switch (item._id)
                        {
                            case AstrumClient.INSTANT_STRENGTH_STATUE_GOLD:
                                viewModel.StrengthStatueGoldStock = item.stock;
                                viewModel.StrengthStatueGoldAvailable = item.available;
                                break;
                            case AstrumClient.INSTANT_STRENGTH_STATUE_SILVER:
                                viewModel.StrengthStatueSilverStock = item.stock;
                                viewModel.StrengthStatueSilverAvailable = item.available;
                                break;
                            case AstrumClient.INSTANT_STRENGTH_STATUE_BRONZE:
                                viewModel.StrengthStatueBronzeStock = item.stock;
                                viewModel.StrengthStatueBronzeAvailable = item.available;
                                break;
                        }
                    }
                }
            }
        }
Exemple #12
0
        public static void UpdateRaiseInfo(RaiseInfo raiseInfo,MainWindowViewModel viewModel)
        {
            viewModel.CardQuantity = raiseInfo.card.value;
            viewModel.CardMax = raiseInfo.card.max;

            viewModel.TrainingBase = raiseInfo.@base;
            viewModel.TrainingBaseId = raiseInfo.@base._id;
            viewModel.TrainingBaseRare = [email protected];
            viewModel.TrainingBaseName = [email protected];
            viewModel.TrainingBaseLevel = [email protected];
            viewModel.TrainingBaseMaxLevel = [email protected];
            viewModel.TrainingBaseAbilityLevel = [email protected];
            viewModel.TrainingBaseMaxAbilityLevel = [email protected];
            viewModel.TrainingBaseExpGrowth = [email protected];
            viewModel.TrainingBaseAbilityGrowth = [email protected];
        }
Exemple #13
0
        internal static void PrintFuryRaidInfo(FuryRaidEventInfo info, MainWindowViewModel viewModel)
        {
            string history = "";
            history += info.name + Environment.NewLine;
            history += String.Format("Fever:{0} %", info.fever.progress) + Environment.NewLine;
            if (info.totalRewards.user.next != null)
            {
                history += String.Format("个人讨伐{0}, 还差{1}次获得{2}", info.totalRewards.user.total, info.totalRewards.user.next.requirement - info.totalRewards.user.total, info.totalRewards.user.next.name) + Environment.NewLine;
            }

            viewModel.History = history;
        }
Exemple #14
0
 internal static void PrintRankingInfo(RankingInfo ranking, MainWindowViewModel viewModel)
 {
     string history = viewModel.History;
     history += String.Format("Point:{0} Ranking:{1}", ranking.point,ranking.ranking) + Environment.NewLine;
     viewModel.History = history;
 }
Exemple #15
0
        public static void PrintRaidBattleInfo(RaidBattleInfo battleInfo, MainWindowViewModel viewModel)
        {
            if (battleInfo.isPlaying || battleInfo.isWin || battleInfo.isLose)
            {
                string history = "";
                history += battleInfo.Boss + Environment.NewLine;
                history += String.Format("血量: {0} / {1}", battleInfo.hp - battleInfo.totalDamage, battleInfo.hp) + Environment.NewLine;

                switch (battleInfo.type)
                {
                    case AstrumClient.FIND:
                        history += "类型:发现" + Environment.NewLine;
                        break;
                    case AstrumClient.RESCUE:
                        history += "类型:救援" + Environment.NewLine;
                        break;
                }

                viewModel.History = history;
            }
        }
Exemple #16
0
        public static void PrintStageInfo(StageInfo stage, MainWindowViewModel viewModel)
        {
            string history = "";
            history += String.Format("场景:{0}[{1}] ({2})", stage.name, stage.stage, stage.isBossStage ? "BOSS" : stage.progress + "%") + Environment.NewLine;

            if (stage.status != null)
            {
                history += String.Format("体力:{0} / {1}", stage.status.stamina.value, stage.status.stamina.max) + Environment.NewLine;
                history += String.Format("经验:{0} / {1}", stage.status.exp.value, stage.status.exp.max) + Environment.NewLine;
                history += String.Format(" BP:{0} / {1}", stage.status.bp.value, stage.status.bp.max) + Environment.NewLine;
                history += String.Format(" TP:{0} / {1}", stage.status.tp.value, stage.status.tp.max) + Environment.NewLine;
            }
            viewModel.History = history;
        }
Exemple #17
0
        public static void UpdateStageView(StageInfo stage, MainWindowViewModel viewModel)
        {
            if (stage.status != null)
            {
                viewModel.Level = stage.status.level;

                viewModel.StaminaValue = stage.status.stamina.value;
                viewModel.StaminaMax = stage.status.stamina.max;

                viewModel.ExpValue = stage.status.exp.value;
                viewModel.ExpMin = stage.status.exp.min;
                viewModel.ExpMax = stage.status.exp.max;

                viewModel.BpValue = stage.status.bp.value;
                viewModel.BpMax = stage.status.bp.max;

                viewModel.TpValue = stage.status.tp.value;
                viewModel.TpMax = stage.status.tp.max;

                if (viewModel.IsFuryRaidEnable)
                {
                    viewModel.Fever = stage.status.furyraid != null && stage.status.furyraid.fever != null;
                }

                if (viewModel.IsLimitedRaidEnable)
                {
                    viewModel.Fever = stage.status.limitedraid != null && stage.status.limitedraid.fever != null && stage.status.limitedraid.fever.gachaTicket != null;
                }

                if (viewModel.IsBreedingEnable)
                {
                    viewModel.Fever = stage.status.breeding != null && stage.status.breeding.fever != null && stage.status.breeding.fever.breedingPoint != null;
                }
            }
        }
Exemple #18
0
        public static void PrintMypage(MypageInfo mypage, MainWindowViewModel viewModel)
        {
            string history = "";
            history += String.Format("  角色:{0} (L{1})", mypage.status.name, mypage.status.level) + Environment.NewLine;
            history += String.Format(" 总战力:{0}", mypage.total) + Environment.NewLine;
            history += String.Format("  攻击:{0},  防御:{1}", mypage.status.atk, mypage.status.df) + Environment.NewLine;
            history += String.Format("必杀攻击:{0},必杀防御:{1}", mypage.status.mat, mypage.status.mdf) + Environment.NewLine;
            history += String.Format("所属工会:{0}, 工会排行:{1}", mypage.guild.name, mypage.guild.rank) + Environment.NewLine;

            viewModel.History = history;
        }
Exemple #19
0
        public static void PrintGuildBattleInfo(GuildBattleInfo battleInfo, MainWindowViewModel viewModel)
        {
            string history = "";

            foreach (var guild in battleInfo.guilds)
            {
                history += String.Format("{0}:{1}", guild.name, guild.point) + Environment.NewLine;
                history += String.Format("普通攻击:{0}", guild.combo.attack.count) + Environment.NewLine;
                history += String.Format("远程攻击:{0}", guild.combo.remote.count) + Environment.NewLine;
                history += String.Format("必杀攻击:{0}", guild.combo.special.count) + Environment.NewLine;
                history += String.Format("  应援:{0}", guild.combo.yell.count) + Environment.NewLine;
                history += Environment.NewLine;
            }
            viewModel.History = history;
        }
Exemple #20
0
        public static void PrintGuildBattleCmdResult(CmdResult result, MainWindowViewModel viewModel)
        {
            var status = result.battlestate.status;

            string history = "";

            history += String.Format("{0} (Combo {1})", result.cmd.name, result.history.combo) + Environment.NewLine;

            viewModel.History = history;
        }
Exemple #21
0
        public static void UpdateMypageView(MypageInfo mypage, MainWindowViewModel viewModel)
        {
            viewModel.HasTalk = mypage.talk;

            viewModel.Name = mypage.status.name;
            viewModel.Level = mypage.status.level;

            viewModel.StaminaValue = mypage.status.stamina_value;
            viewModel.StaminaMax = mypage.status.stamina_max;

            viewModel.ExpValue = mypage.status.exp_value;
            viewModel.ExpMin = mypage.status.exp_min;
            viewModel.ExpMax = mypage.status.exp_max;

            viewModel.BpValue = mypage.status.bp_value;
            viewModel.BpMax = mypage.status.bp_max;

            viewModel.TpValue = mypage.status.tp_value;
            viewModel.TpMax = mypage.status.tp_max;

            viewModel.CardQuantity = mypage.status.card_quantity;
            viewModel.CardMax = mypage.status.card_max;
        }
Exemple #22
0
 public static void UpdateGachaResult(GachaResult result, MainWindowViewModel viewModel)
 {
     viewModel.CardQuantity = result.card.value;
     viewModel.CardMax = result.card.max;
 }
Exemple #23
0
 public static void UpdateGuildBattleStatus(GuildBattleStatus status, MainWindowViewModel viewModel)
 {
     viewModel.TpValue = status.tp.value;
     viewModel.TpMax = status.tp.max;
 }