Exemple #1
0
    /// <summary>
    /// 将战斗结果返回
    /// </summary>
    /// <param name="information"></param>
    //TODO
    public void DealWithBattleResult(PassedResultInformation information)
    {
        Enable();
        currentEvent.Finished();

        if (information.win)
        {
            CharacterInDungeon.Ins.currentHp = information.currentHp;
            //处理资源奖励信息
            foreach (ItemSourceAndCount reward in information.resourceReward)
            {
                switch (reward.item.id)
                {
                case 201:
                    DungeonManager.Ins.dataFrag.count += reward.count;
                    break;

                case 202:
                    CharacterInDungeon.Ins.GainExp(reward.count);
                    break;
                }
            }
            //处理卡牌信息
            foreach (CardSource cs in information.cardSourceRward)
            {
                CardContent cc = cs.GenerateCard();
                CharacterInDungeon.Ins.JoinCard(cc);
            }
            foreach (Talent t in CharacterInDungeon.Ins.activeTalents)
            {
                t.OnBattleEnd();
            }
            if (information.option != null)
            {
                information.option.AfterBattleEffect();
            }
            DungeonUI.RefreshUI();
        }
        else
        {
            LeaveDungeon();
        }
    }