private void CalcWinResult()
    {
        DataMission mission  = DataManager.instance.dataMissionGroup.GetMission(_multiFightRequest.missionId);
        int         gotExp   = mission.exp;
        int         gotHonor = mission.honor;

        InstancePlayer.instance.model_User.UpdateHonor(gotHonor * _multiFightRequest.num);

        Model_HeroGroup heroGroup = InstancePlayer.instance.model_User.model_heroGroup;
        Model_Formation formation = InstancePlayer.instance.model_User.model_Formation;

        int[] HeroesId = formation.GetSelectTeamHeroesId();

        for (int i = 0; i < _multiFightRequest.num; ++i)
        {
            List <Model_HeroGroup.ExpChangeResult> result = new List <Model_HeroGroup.ExpChangeResult> ();
            InstancePlayer.instance.multiFightHeroGotExp.Add(result);

            foreach (int heroId in HeroesId)
            {
                if (heroId > 0)
                {
                    Model_HeroGroup.ExpChangeResult r = heroGroup.AddExp(heroId, gotExp);
                    result.Add(r);
                }
            }
        }
    }
Beispiel #2
0
    override protected void DisposeContent(UseItemResponse content)
    {
        dropPrizeItems = content.prizeItems;


        DataItem item = DataManager.instance.dataItemGroup.GetItem(_request.itemId);

        DataDropGroup.DROP_TYPE dropType = DataDropGroup.CheckDropType(item.dropGroup);
        if (dropType == DataDropGroup.DROP_TYPE.EXP)
        {
            SlgPB.PrizeItem prizeItem = dropPrizeItems [0];
            Assert.assert(prizeItem.type == (int)DataConfig.DATA_TYPE.Exp);

            int             exp            = prizeItem.num;
            int             targetHeroId   = _request.target;
            Model_HeroGroup modelHeroGroup = InstancePlayer.instance.model_User.model_heroGroup;
            modelHeroGroup.AddExp(targetHeroId, exp);
        }

        InstancePlayer.instance.model_User.model_itemGroup.AddItemCount(_request.itemId, -_request.num);
    }