/// <summary> /// 开启动物 /// </summary> private void OnSetAnimalLevelData(Message obj) { var msg = obj as SetBuyAnimalObjectData; /* 扣钱 扣钱成功后修改商品数量 发送扣钱的通知和商品修改的通知 */ var animalMSS15 = GlobalDataManager.GetInstance().playerData.playerZoo.animalMSS15; Config.animalupCell animalupCell = Config.animalupConfig.getInstace().getCell(msg.goodsID); if (animalMSS15.GetAnimalProp(msg.goodsID).lv >= Config.globalConfig.getInstace().AnimalLvUpLimit) { return; } var expendDelta = LittleZooModule.GetAnimalUpLevelPriceFormula(msg.goodsID); if (!WarpAddCoin(-expendDelta)) { return; } //增加动物数据 Config.buildupCell cellBuildUp = Config.buildupConfig.getInstace().getCell(msg.littleZooID); animalMSS15.AnimalLvUp(msg.goodsID, 1); LittleZooModule.playerAnimalGoToResourceID.TryGetValue(msg.goodsID, out int playerAnimalGoToResourceID); MessageInt.Send((int)GameMessageDefine.AnimalPlayLevelUpEffect, playerAnimalGoToResourceID); GetAddNewAnimalData.Send((int)GameMessageDefine.GetAnimalLevel, msg.goodsID, msg.littleZooID); MessageManager.GetInstance().Send((int)GameMessageDefine.AnimalBuffAlterSucceed); }
/// <summary> /// 初始化属性数值 /// </summary> private void InitAnimalupCellData(int a, int b, out Config.animalupCell animalupCell, out int animalID) { animalupCell = null; animalID = 0; //LogWarp.LogErrorFormat("测试: {0} {1}", a, b); var animalatlasCell = Config.animalatlasConfig.getInstace().getCell(a + 1); int idx1 = animalatlasCell.bigtype; int idx2 = animalatlasCell.smalltypesort[b]; var animalupAllData = Config.animalupConfig.getInstace().AllData; foreach (var item in animalupAllData) { if (item.Value.bigtype == idx1 && item.Value.smalltype == idx2) { animalID = int.Parse(item.Key); animalupCell = item.Value; return; } } }