// 荣誉兑换奖励 public void AddHonorItem(BaseResponse response) { if (response.status != BaseResponse.ERROR) { SockBuyItemResponse buyItem = response as SockBuyItemResponse; if (buyItem.data.retCode == 1) { // if (ActivityNetController.tempHonorGiftId != 0) // { ItemOfReward TR = buyItem.data.p; // ItemOfReward[] tReward = new ItemOfReward[1]{ TR }; //Core.Data.itemManager.addItem(tReward); Core.Data.itemManager.AddRewardToBag(TR); // } } } }
public override void addItem(BaseResponse response) { if (response != null && response.status != BaseResponse.ERROR) { BattleResponse battleResp = response as BattleResponse; if (battleResp != null && battleResp.data != null) { if (battleResp.data.reward != null) { addEquipment(battleResp.data.reward); } if (battleResp.data.ext != null) { AddEquip(battleResp.data.ext.p); } } GetLevelRewardResponse GLRResponse = response as GetLevelRewardResponse; if (GLRResponse != null) { AddEquip(GLRResponse.data); } NewFinalTrialFightResponse fightres = response as NewFinalTrialFightResponse; if (fightres != null && fightres.data != null && fightres.data.rushResult != null && fightres.data.rushResult.award != null) { AddEquip(fightres.data.rushResult.award); } SockBuyItemResponse buyItem = response as SockBuyItemResponse; if (buyItem != null) { if (buyItem.data.retCode == 1) { ItemOfReward[] tReward = new ItemOfReward[1] { buyItem.data.p }; AddEquip(tReward); } } UsePropResponse propose = response as UsePropResponse; if (propose != null && propose.data != null && propose.data.p != null) { AddEquip(propose.data.p); } SevenDaysBuyResponse seven = response as SevenDaysBuyResponse; if (seven != null && seven.data != null) { AddEquip(seven.data.p); } GetTresureResponse GTResponse = response as GetTresureResponse; if (GTResponse != null) { AddEquip(GTResponse.data.p); } } }
/// <summary> /// Win Battle & Get Reward /// </summary> /// <param name="response">Response.</param> public override void addItem(BaseResponse response) { if (response != null && response.status != BaseResponse.ERROR) { //Boss Battle or not BattleResponse battleResp = response as BattleResponse; if (battleResp != null && battleResp.data != null) { BattleReward Rewards = battleResp.data.reward; if (Rewards != null) { addMonster(Rewards); if (Rewards.p != null) { foreach (ItemOfReward it in Rewards.p) { ConfigDataType type = DataCore.getDataType(it.pid); if (type == ConfigDataType.Gems) { Core.Data.gemsManager.AddGems(it); } } } } if (battleResp.data.ext != null) { addMonster(battleResp.data.ext.p); } } SecretShopBuyResponse secretshop = response as SecretShopBuyResponse; if (secretshop != null && secretshop.data != null && secretshop.data.p != null) { AddShopMon(secretshop.data.p); } SevenDaysBuyResponse seven = response as SevenDaysBuyResponse; if (seven != null && seven.data != null) { addMonster(seven.data.p); } GetLevelRewardResponse GLRResponse = response as GetLevelRewardResponse; if (GLRResponse != null) { AddShopMon(GLRResponse.data); } NewFinalTrialFightResponse fightres = response as NewFinalTrialFightResponse; if (fightres != null && fightres.data != null && fightres.data.rushResult != null && fightres.data.rushResult.award != null) { addMonster(fightres.data.rushResult.award); } SockBuyItemResponse buyItem = response as SockBuyItemResponse; if (buyItem != null) { if (buyItem.data.retCode == 1) { // if (ActivityNetController.tempHonorGiftId != 0) { ItemOfReward[] tReward = new ItemOfReward[1] { buyItem.data.p }; addMonster(tReward); // } } } GetTresureResponse GTResponse = response as GetTresureResponse; if (GTResponse != null) { addMonster(GTResponse.data.p); } } }