123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326 |
- 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<ItemVo> costList, Enum_CostItemStonesType type = Enum_CostItemStonesType.Wuqi)
- {
- this.costList = costList;
- this.id = id;
- this.type = type;
- }
- /// <summary>
- /// 武器id
- /// </summary>
- public int id { get; set; }
- /// <summary>
- ///消耗道具
- /// </summary>
- public List<ItemVo> costList { get; set; }
- /// <summary>
- ///
- /// </summary>
- public Enum_CostItemStonesType type { get; set; }
- /// <summary>
- /// 增加的经验值
- /// </summary>
- 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;
- }
- }
- /// <summary>
- /// 变化等级
- /// </summary>
- 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<int, Dictionary<int, sm_weapon_levelexp>> 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<int, sm_weapon_levelexp> dic = weapon_levelexp[sm_item_base.GetMoById(int.Parse(typeId)).quality];
- foreach (KeyValuePair<int, sm_weapon_levelexp> 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<int, Dictionary<int, sm_yanlingLevel_type>> 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<int, sm_yanlingLevel_type> dic = yanlingLevel_type[sm_item_base.GetMoById(int.Parse(typeId)).quality];
- foreach (KeyValuePair<int, sm_yanlingLevel_type> kv in dic)
- {
- if (kv.Key <= vo.level)
- {
- continue;
- }
- if (kv.Value.requiredExp > xp)
- {
- break;
- }
- lv += 1;
- }
- }
-
- }
- return lv;
- }
- }
- /// <summary>
- /// 变化的金币
- /// </summary>
- 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;
- }
- }
- /// <summary>
- /// 属性值
- /// </summary>
- public Dictionary<EHeroProperties, int> changeAttr
- {
- get
- {
- Dictionary<EHeroProperties, int> attr = new Dictionary<EHeroProperties, int>();
- 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;
- }
- }
- ///// <summary>
- ///// 增加的经验值
- ///// </summary>
- //public int addExp
- //{
- // get
- // {
- // return 0;
- // }
- //}
- }
|