using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; public class WuqiUpgradeVo { public WuqiUpgradeVo(int id,List costList, Enum_CostItemStonesType type = Enum_CostItemStonesType.Wuqi) { this.costList = costList; this.id = id; this.type = type; } /// /// 武器id /// public int id { get; set; } /// ///消耗道具 /// public List costList { get; set; } /// /// /// public Enum_CostItemStonesType type { get; set; } /// /// 增加的经验值 /// public int addExp { get { if (this.costList.Count == 0) { return 0; } int totalNum = 0; foreach (ItemVo vo in this.costList) { if (vo.nMo.itemType == 1) { int baseExp = vo.nMo.GetWeaponExt().baseExp; UserEquipmentVo equip = UserProxy.Instance.player.collectEquip.equipments[int.Parse(vo.uid)]; int exp = equip.exp; double expTemp = 1.0f * exp * 0.75; int num = baseExp + (int)expTemp; totalNum += num; } else if (vo.nMo.itemType == 4) { int baseExp = vo.nMo.GetYanlingExt().baseExp; UserYanlingVo equip = UserProxy.Instance.player.collectYanling.items[int.Parse(vo.uid)]; int exp = equip.curStarExp; double expTemp = 1.0f * exp * 0.75; int num = baseExp + (int)expTemp; totalNum += num; //totalNum += vo.nMo.GetYanlingExt().baseExp; } else { totalNum += vo.nMo.GetStoneExt().baseExp* vo.count; } } return totalNum; } } /// /// 变化等级 /// public int addLv { get { int lv = 0; if (this.type == Enum_CostItemStonesType.Wuqi) { UserEquipmentVo vo = UserProxy.Instance.player.collectEquip.equipments[this.id]; int xp = vo.exp + this.addExp; int temp = 0; Dictionary> weapon_levelexp = GameConfigData.Ins.weapon_levelexp; string typeId = UserProxy.Instance.player.collectEquip.equipments[this.id].typeId; if (weapon_levelexp.ContainsKey(sm_item_base.GetMoById(int.Parse(typeId)).quality)) { Dictionary dic = weapon_levelexp[sm_item_base.GetMoById(int.Parse(typeId)).quality]; foreach (KeyValuePair kv in dic) { if (kv.Key <= vo.level) { continue; } if (kv.Value.requiredExp > xp) { break; } lv += 1; } } } else if(this.type == Enum_CostItemStonesType.YanLing) { UserYanlingVo vo = UserProxy.Instance.player.collectYanling.items[this.id]; int xp = vo.curStarExp + this.addExp; int temp = 0; Dictionary> yanlingLevel_type = GameConfigData.Ins.yanlingLevel_type; string typeId = UserProxy.Instance.player.collectYanling.items[this.id].typeId; if (yanlingLevel_type.ContainsKey(sm_item_base.GetMoById(int.Parse(typeId)).quality)) { Dictionary dic = yanlingLevel_type[sm_item_base.GetMoById(int.Parse(typeId)).quality]; foreach (KeyValuePair kv in dic) { if (kv.Key <= vo.level) { continue; } if (kv.Value.requiredExp > xp) { break; } lv += 1; } } } return lv; } } /// /// 变化的金币 /// public int gold { get { if (this.costList.Count == 0) { return 0; } int totalNum = 0; foreach (ItemVo vo in this.costList) { if (vo.nMo.itemType == 1) { totalNum += vo.nMo.GetWeaponExt().costGold * vo.count; }else if (vo.nMo.itemType == 4) { totalNum += vo.nMo.GetYanlingExt().costGold * vo.count; } else { totalNum += vo.nMo.GetStoneExt().costGold * vo.count; } } return totalNum; } } /// /// 属性值 /// public Dictionary changeAttr { get { Dictionary attr = new Dictionary(); if (this.type == Enum_CostItemStonesType.Wuqi) { UserEquipmentVo vo = UserProxy.Instance.player.collectEquip.equipments[this.id]; int lv = vo.level + this.addLv; sm_weaponextra_level mo = sm_weaponextra_level.GetMoById(int.Parse(vo.typeId), vo.starLevel); if (vo.starLevel < 5) { if (mo.promoteLv < lv) { lv = mo.promoteLv; } } //生命 int hp = mo.hp + (lv - 1) * mo.hpRate; if (hp != 0) { attr[EHeroProperties.HP] = hp; } //暴击 int crit = mo.baoji + (lv - 1) * mo.baojiRate; if (crit != 0) { attr[EHeroProperties.CRICITAL] = crit; } //物理攻击 int phyAtk = mo.wuligongji + (lv - 1) * mo.wuligongjiRate; if (phyAtk != 0) { attr[EHeroProperties.WULIGONGJI] = phyAtk; } //防御护甲 int phyDef = mo.fangyuhujia + (lv - 1) * mo.fangyuhujiaRate; //Debug.Log("升级后等级--phyDef-----------" + phyDef); //float addPhyDef = phyDef + phyDef * 1.0f * this.Mo().GetYanlingExt().additional_phyDefend/100; if (phyDef != 0) { attr[EHeroProperties.FANGYUHUJIA] = phyDef; } //攻击速度 int atkSpeed = mo.gongjisudu + (lv - 1) * mo.gongjisuduRate; //Debug.Log("升级后等级--atkSpeed------------" + atkSpeed); //float addAtkSpeed = atkSpeed + atkSpeed * 1.0f * this.Mo().GetYanlingExt().additional_atkSpeed/100; if (atkSpeed != 0) { attr[EHeroProperties.ATKSPEED] = atkSpeed; } //法术强度 int fashuqiangdu = mo.fashuqiangdu + (lv - 1) * mo.fashuqiangduRate; //Debug.Log("升级后等级--fashuqiangdu------------" + fashuqiangdu); if (fashuqiangdu != 0) { attr[EHeroProperties.FASHUQIANGDU] = fashuqiangdu; } //魔法抗性 int mofakangxing = mo.mofakangxing + (lv - 1) * mo.mofakangxingRate; //Debug.Log("升级后等级--mofakangxing------------" + mofakangxing); if (mofakangxing != 0) { attr[EHeroProperties.MOFAKANGXING] = mofakangxing; } } else { UserYanlingVo vo = UserProxy.Instance.player.collectYanling.items[this.id]; int lv = vo.level + this.addLv; sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(vo.typeId), vo.starLv); if (vo.starLv < 5) { if (mo.promoteLv < lv) { lv = mo.promoteLv; } } //生命 int hp = mo.hp + (lv - 1) * mo.hpRate; if (hp != 0) { attr[EHeroProperties.HP] = hp; } //暴击 int crit = mo.baoji + (lv - 1) * mo.baojiRate; if (crit != 0) { attr[EHeroProperties.CRICITAL] = crit; } //物理攻击 int phyAtk = mo.wuligongji + (lv - 1) * mo.wuligongjiRate; if (phyAtk != 0) { attr[EHeroProperties.WULIGONGJI] = phyAtk; } //防御护甲 int phyDef = mo.fangyuhujia + (lv - 1) * mo.fangyuhujiaRate; if (phyDef != 0) { attr[EHeroProperties.FANGYUHUJIA] = phyDef; } //攻击速度 int atkSpeed = mo.gongjisudu + (lv - 1) * mo.gongjisuduRate; if (atkSpeed != 0) { attr[EHeroProperties.ATKSPEED] = atkSpeed; } //法术强度 int fashuqiangdu = mo.fashuqiangdu + (lv - 1) * mo.fashuqiangduRate; if (fashuqiangdu != 0) { attr[EHeroProperties.FASHUQIANGDU] = fashuqiangdu; } //魔法抗性 int mofakangxing = mo.mofakangxing + (lv - 1) * mo.mofakangxingRate; //Debug.Log("升级后等级--mofakangxing------------" + mofakangxing); if (mofakangxing != 0) { attr[EHeroProperties.MOFAKANGXING] = mofakangxing; } } return attr; } } ///// ///// 增加的经验值 ///// //public int addExp //{ // get // { // return 0; // } //} }