using Newtonsoft.Json.Linq;
using System.Collections.Generic;
using UnityEngine;
///
/// 言灵容器
///
public class GameCollectYanling
{
///
/// 言灵集合
///
public Dictionary items = new Dictionary();
///
/// 言灵记录
///
public List yanlingRecord = new List();
///
/// 查询当前英雄可用的言灵列表
///
///
///
public List FindUseableYanlings(int heroTypeid)
{
var li = new List();
foreach (var kv in items)
{
var mo = sm_item_yanling.GetMoById(int.Parse(kv.Value.typeId));
if (null != mo)
{
if (mo.CanbeUsedForHero(heroTypeid))
{
li.Add(kv.Value);
}
}
}
return li;
}
///
/// 初始化言灵数据
///
///
public void InitItemData(JObject store)
{
if (store["yanling"] != null)
{
// {uid:{typeId:"",level:x,...},uid:{...},...}
items = store["yanling"].ToObject>();
foreach (var kv in items)
{
kv.Value.uid = kv.Key.ToString();
}
}
if (store["yanlingRecord"] != null)
{
this.yanlingRecord.Clear();
JArray arr = JArray.Parse(store["yanlingRecord"].ToString());
foreach (JToken id in arr)
{
this.yanlingRecord.Add(id.ToString());
}
}
}
}
///
/// 玩家言灵数据结构
///
public class UserYanlingVo : ItemVo
{
///
/// 模板id
///
//public int typeId;
///
/// 装备此言灵的英雄的id, 默认0
///
public int herouid;
// todo: 其它字段带补充(后期加入强化后 --王刚2020年1月2日14:13:59)
///
/// 当前等阶 2020.7.29 刘海要求改为0 20220512
///
public int grade = 0;
///
/// 等级
///
public int level;
///
/// 言灵星级
///
public int starLv;
///
/// 言灵当前经验
///
public int exp;
///
/// 镶嵌的宝石--没有镶嵌默认为0
///
public int gemId;
///
/// 升下一等级的经验
///
public int nextExp
{
get
{
if (this.starLimitLv == this.level)
{
return exp;
}
var mo = GameConfigData.Ins.GetyanlingLevel_typeMo(sm_item_base.GetMoById(int.Parse(this.typeId)).quality, this.level + 1);
if (mo != null)
{
return mo.requiredExp;
}
var lastMo = GameConfigData.Ins.GetyanlingLevel_typeMo(sm_item_base.GetMoById(int.Parse(this.typeId)).quality, this.level);
if (lastMo != null)
{
return mo.requiredExp;
}
return 0;
}
}
///
/// 当前星级限制的等级
///
public int starLimitLv
{
get
{
sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv);
if (mo == null)
{
return 0;
}
return mo.promoteLv;
}
}
///
/// 突破的玩家等级限制
///
public int userLimitLv
{
get
{
if (this.starLv >= 5)
{
return 0;
}
sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv + 1);
return mo.userlvLimit;
}
}
///
/// 突破后的星级等级限制
///
public int lastStarLimitLv_Tupo
{
get
{
if (this.starLv >= 5)
{
return 0;
}
sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv + 1);
if (mo == null)
{
return 0;
}
return mo.promoteLv;
}
}
///
/// 是不是升级按钮 true:是
///
public bool isUpgrade
{
get
{
if (this.starLv >= 5)
{
return true;
}
//&& UserProxy.Instance.player.baseInfo.level >= sm_heroextra_level_tupo.GetMoById(int.Parse(this.typeId), this.curStar + 1).userlvLimit
if (this.level >= this.starLimitLv)
{
return false;
}
return true;
}
}
///
/// 升级需要的材料道具
///
public List costItem_Upgrade
{
get
{
List list = new List();
if (this.starLv >= 5)
{
return list;
}
List stonelist = sm_item_stones_type.getItemStoneList(Enum_CostItemStonesType.YanLing);
if (stonelist.Count == 0)
{
return list;
}
Dictionary collectItemDic = UserProxy.Instance.player.collectItem.collectItemDic;
foreach (sm_item_stones_type item in stonelist)
{
string typeId = item.typeId.ToString();
foreach (KeyValuePair kv in collectItemDic)
{
if (kv.Value.typeId == typeId)
{
ItemVo itVo = new ItemVo();
itVo.typeId = typeId;
itVo.count = kv.Value.count;
list.Add(itVo);
}
}
}
return list;
}
}
///
/// 消耗的道具----突破
///
public List costItem_tupo
{
get
{
List list = new List();
if (this.starLv >= 5)
{
return list;
}
sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv + 1);
string[] sList = mo.costItems.Split(';');
foreach (string item in sList)
{
string[] str = item.Split(',');
ItemVo vo = new ItemVo();
vo.typeId = str[0];
vo.count = int.Parse(str[1]);
list.Add(vo);
}
return list;
}
}
///
/// 当前星级经验
///
public int curStarExp;
///
/// 当前星升下一星需要的最大经验------------------废弃
///
public int maxStarExp
{
get
{
return sm_item_yanling.GetMoById(int.Parse(this.typeId)).maxStarExp;
}
}
public int costGold_tupo
{
get
{
if (this.starLv >= 5)
{
return 0;
}
sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv + 1);
return mo.gold;
}
}
///
/// 战力
///
public int fightPower
{
get
{
float power = 0;
Dictionary baseAttr = this.baseAttr;
Dictionary rAttr = this.randAttr;
Dictionary gRandAttr = this.gemrRandAttr;
List ylComposeAttr = this.yanlingComposeAttr;
foreach (KeyValuePairkv in baseAttr)
{
int add = 0;
if (kv.Key == EHeroProperties.HP)
{
if (rAttr.ContainsKey(EHeroAddProperties.additional_hpUpperlimit))
{
add += rAttr[EHeroAddProperties.additional_hpUpperlimit];
}
if (gRandAttr.ContainsKey(EHeroAddProperties.additional_hpUpperlimit))
{
add += gRandAttr[EHeroAddProperties.additional_hpUpperlimit];
}
if (ylComposeAttr.Count != 0)
{
foreach (yanlingComposeDataVo vo in ylComposeAttr)
{
if (vo.isShow == false)
{
continue;
}
if (vo.attr == EHeroAddProperties.additional_hpUpperlimit)
{
add += vo.val;
}
}
}
}
else if (kv.Key == EHeroProperties.NENGLIANGZHI)
{
if (rAttr.ContainsKey(EHeroAddProperties.additional_manaUpperlimit))
{
add += rAttr[EHeroAddProperties.additional_manaUpperlimit];
}
if (gRandAttr.ContainsKey(EHeroAddProperties.additional_manaUpperlimit))
{
add += gRandAttr[EHeroAddProperties.additional_manaUpperlimit];
}
if (ylComposeAttr.Count != 0)
{
foreach (yanlingComposeDataVo vo in ylComposeAttr)
{
if (vo.isShow == false)
{
continue;
}
if (vo.attr == EHeroAddProperties.additional_manaUpperlimit)
{
add += vo.val;
}
}
}
}
else if (kv.Key == EHeroProperties.WULIGONGJI)
{
if (rAttr.ContainsKey(EHeroAddProperties.additional_phyDamage))
{
add += rAttr[EHeroAddProperties.additional_phyDamage];
}
if (gRandAttr.ContainsKey(EHeroAddProperties.additional_phyDamage))
{
add += gRandAttr[EHeroAddProperties.additional_phyDamage];
}
if (ylComposeAttr.Count != 0)
{
foreach (yanlingComposeDataVo vo in ylComposeAttr)
{
if (vo.isShow == false)
{
continue;
}
if (vo.attr == EHeroAddProperties.additional_phyDamage)
{
add += vo.val;
}
}
}
}
else if (kv.Key == EHeroProperties.FANGYUHUJIA)
{
if (rAttr.ContainsKey(EHeroAddProperties.additional_phyDefend))
{
add += rAttr[EHeroAddProperties.additional_phyDefend];
}
if (gRandAttr.ContainsKey(EHeroAddProperties.additional_phyDefend))
{
add += gRandAttr[EHeroAddProperties.additional_phyDefend];
}
if (ylComposeAttr.Count != 0)
{
foreach (yanlingComposeDataVo vo in ylComposeAttr)
{
if (vo.isShow == false)
{
continue;
}
if (vo.attr == EHeroAddProperties.additional_phyDefend)
{
add += vo.val;
}
}
}
}
else if (kv.Key == EHeroProperties.CRICITAL)
{
if (rAttr.ContainsKey(EHeroAddProperties.additional_critDamage))
{
add += rAttr[EHeroAddProperties.additional_critDamage];
}
if (gRandAttr.ContainsKey(EHeroAddProperties.additional_critDamage))
{
add += gRandAttr[EHeroAddProperties.additional_critDamage];
}
if (ylComposeAttr.Count != 0)
{
foreach (yanlingComposeDataVo vo in ylComposeAttr)
{
if (vo.isShow == false)
{
continue;
}
if (vo.attr == EHeroAddProperties.additional_critDamage)
{
add += vo.val;
}
}
}
}
else if (kv.Key == EHeroProperties.FASHUQIANGDU)
{
if (rAttr.ContainsKey(EHeroAddProperties.additional_magDamage))
{
add += rAttr[EHeroAddProperties.additional_magDamage];
}
if (gRandAttr.ContainsKey(EHeroAddProperties.additional_magDamage))
{
add += gRandAttr[EHeroAddProperties.additional_magDamage];
}
if (ylComposeAttr.Count != 0)
{
foreach (yanlingComposeDataVo vo in ylComposeAttr)
{
if (vo.isShow == false)
{
continue;
}
if (vo.attr == EHeroAddProperties.additional_magDamage)
{
add += vo.val;
}
}
}
}
else if (kv.Key == EHeroProperties.MOFAKANGXING)
{
if (rAttr.ContainsKey(EHeroAddProperties.additional_magDefend))
{
add += rAttr[EHeroAddProperties.additional_magDefend];
}
if (gRandAttr.ContainsKey(EHeroAddProperties.additional_magDefend))
{
add += gRandAttr[EHeroAddProperties.additional_magDefend];
}
if (ylComposeAttr.Count != 0)
{
foreach (yanlingComposeDataVo vo in ylComposeAttr)
{
if (vo.isShow == false)
{
continue;
}
if (vo.attr == EHeroAddProperties.additional_magDefend)
{
add += vo.val;
}
}
}
}
power += 1.0f * add / 100 * kv.Value + kv.Value;
}
//sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv);
//生命
//int hp = mo.hp + (this.level - 1) * mo.hpRate;
//暴击
//int crit = mo.baoji + (this.level - 1) * mo.baojiRate;
//物理攻击
//int phyAtk = mo.wuligongji + (this.level - 1) * mo.wuligongjiRate;
//防御护甲
//int phyDef = mo.fangyuhujia + (this.level - 1) * mo.fangyuhujiaRate;
//攻击速度
//int atkSpeed = mo.gongjisudu + (this.level - 1) * mo.gongjisuduRate;
//法术强度
//int fashuqiangdu = mo.fashuqiangdu + (this.level - 1) * mo.fashuqiangduRate;
//魔法抗性
//int mofakangxing = mo.mofakangxing + (this.level - 1) * mo.mofakangxingRate;
////生命
//int hp = this.Mo().GetYanlingExt().hpBase + (this.level - 1) * this.Mo().GetYanlingExt().hpRate;
////暴击
//int crit = this.Mo().GetYanlingExt().critBase + (this.level - 1) * this.Mo().GetYanlingExt().critRate;
////物理攻击
//int phyAtk = this.Mo().GetYanlingExt().phyAtkBase + (this.level - 1) * this.Mo().GetYanlingExt().phyAtkRate;
////防御护甲
//int phyDef = this.Mo().GetYanlingExt().phyDefBase + (this.level - 1) * this.Mo().GetYanlingExt().phyDefRate;
////攻击速度
//int atkSpeed = this.Mo().GetYanlingExt().atkSpeedBase + (this.level - 1) * this.Mo().GetYanlingExt().atkSpeedRate;
////法术强度
//int fashuqiangdu = this.Mo().GetYanlingExt().fashuqiangduBase + (this.level - 1) * this.Mo().GetYanlingExt().fashuqiangduRate;
////魔法抗性
//int mofakangxing = this.Mo().GetYanlingExt().mofakangxingBase + (this.level - 1) * this.Mo().GetYanlingExt().mofakangxingRate;
return (int)power;
}
}
///
/// 基础属性---总览属性,升级
///
public Dictionary baseAttr
{
get
{
Dictionary attr = new Dictionary();
sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv);
//生命
int hp = mo.hp + (this.level - 1) * mo.hpRate;
if (hp != 0)
{
attr[EHeroProperties.HP] = hp;
}
//Mp 能量值
int nengliangzhi = mo.nengliangzhi + (this.level - 1) * mo.nengliangzhiRate;
if (nengliangzhi != 0)
{
attr[EHeroProperties.NENGLIANGZHI] = nengliangzhi;
}
//物理攻击
int phyAtk = mo.wuligongji + (this.level - 1) * mo.wuligongjiRate;
if (phyAtk != 0)
{
attr[EHeroProperties.WULIGONGJI] = phyAtk;
}
//防御护甲
int phyDef = mo.fangyuhujia + (this.level - 1) * mo.fangyuhujiaRate;
if (phyDef != 0)
{
attr[EHeroProperties.FANGYUHUJIA] = phyDef;
}
////攻击速度
//int atkSpeed = mo.gongjisudu + (this.level - 1) * mo.gongjisuduRate;
//if (atkSpeed != 0)
//{
// attr[EHeroProperties.ATKSPEED] = atkSpeed;
//}
//法术强度
int fashuqiangdu = mo.fashuqiangdu + (this.level - 1) * mo.fashuqiangduRate;
if (fashuqiangdu != 0)
{
attr[EHeroProperties.FASHUQIANGDU] = fashuqiangdu;
}
//魔法抗性
int mofakangxing = mo.mofakangxing + (this.level - 1) * mo.mofakangxingRate;
if (mofakangxing != 0)
{
attr[EHeroProperties.MOFAKANGXING] = mofakangxing;
}
//暴击
int crit = mo.baoji + (this.level - 1) * mo.baojiRate;
if (crit != 0)
{
attr[EHeroProperties.CRICITAL] = crit;
}
//抗暴击
int kangbaoji = mo.kangbaoji + (this.level - 1) * mo.kangbaojiRate;
if (kangbaoji != 0)
{
attr[EHeroProperties.KANGBAOJI] = kangbaoji;
}
//言力
int yanli = mo.yanli + (this.level - 1) * mo.yanliRate;
if (yanli != 0)
{
attr[EHeroProperties.YANLI] = yanli;
}
return attr;
//生命
//int hp = this.Mo().GetYanlingExt().hpBase + (this.level - 1) * this.Mo().GetYanlingExt().hpRate;
////float addHp = hp + hp * (1.0f*this.Mo().GetYanlingExt().additional_hpUpperlimit/100);
//if (hp != 0)
//{
// attr[EHeroProperties.HP] = hp;
//}
////暴击
//int crit = this.Mo().GetYanlingExt().critBase + (this.level - 1) * this.Mo().GetYanlingExt().critRate;
////float addCrit = crit + crit * 1.0f * this.Mo().GetYanlingExt().additional_critDamage/100;
//if (crit != 0)
//{
// attr[EHeroProperties.CRICITAL] = crit;
//}
////物理攻击
//int phyAtk = this.Mo().GetYanlingExt().phyAtkBase + (this.level - 1) * this.Mo().GetYanlingExt().phyAtkRate;
////float addPhyAtk = phyAtk + phyAtk * 1.0f * this.Mo().GetYanlingExt().additional_phyDamage/100;
//if (phyAtk != 0)
//{
// attr[EHeroProperties.WULIGONGJI] = phyAtk;
//}
////防御护甲
//int phyDef = this.Mo().GetYanlingExt().phyDefBase + (this.level - 1) * this.Mo().GetYanlingExt().phyDefRate;
////float addPhyDef = phyDef + phyDef * 1.0f * this.Mo().GetYanlingExt().additional_phyDefend/100;
//if (phyDef != 0)
//{
// attr[EHeroProperties.FANGYUHUJIA] = phyDef;
//}
////攻击速度
//int atkSpeed = this.Mo().GetYanlingExt().atkSpeedBase + (this.level - 1) * this.Mo().GetYanlingExt().atkSpeedRate;
////float addAtkSpeed = atkSpeed + atkSpeed * 1.0f * this.Mo().GetYanlingExt().additional_atkSpeed/100;
//if (atkSpeed != 0)
//{
// attr[EHeroProperties.ATKSPEED] = atkSpeed;
//}
////法术强度
//int fashuqiangdu = this.Mo().GetYanlingExt().fashuqiangduBase + (this.level - 1) * this.Mo().GetYanlingExt().fashuqiangduRate;
//if (fashuqiangdu != 0)
//{
// attr[EHeroProperties.FASHUQIANGDU] = fashuqiangdu;
//}
////魔法抗性
//int mofakangxing = this.Mo().GetYanlingExt().mofakangxingBase + (this.level - 1) * this.Mo().GetYanlingExt().mofakangxingRate;
//if (mofakangxing != 0)
//{
// attr[EHeroProperties.MOFAKANGXING] = mofakangxing;
//}
return attr;
}
}
///
/// 随机属性---总览属性,升级
///
public Dictionary randAttr
{
get
{
Dictionary randAttr = new Dictionary();
sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), this.starLv);
//hp
int hpUpperlimit = mo.additional_hpUpperlimit;
if (hpUpperlimit != 0)
{
randAttr[EHeroAddProperties.additional_hpUpperlimit] = hpUpperlimit;
}
//言能上限加成----Mp
int manaUpperlimit = mo.additional_manaUpperlimit;
if (manaUpperlimit != 0)
{
randAttr[EHeroAddProperties.additional_manaUpperlimit] = manaUpperlimit;
}
//物攻伤害加成
int phyDamage = mo.additional_phyDamage;
if (phyDamage != 0)
{
randAttr[EHeroAddProperties.additional_phyDamage] = phyDamage;
}
//防御护甲
int phyDefend = mo.additional_phyDefend;
if (phyDefend != 0)
{
randAttr[EHeroAddProperties.additional_phyDefend] = phyDefend;
}
//法术强度
int magDamage = mo.additional_magDamage;
if (magDamage != 0)
{
randAttr[EHeroAddProperties.additional_magDamage] = magDamage;
}
//魔法抗性
int magDefend = mo.additional_magDefend;
if (magDefend != 0)
{
randAttr[EHeroAddProperties.additional_magDefend] = magDefend;
}
//物伤减免加成
int phyDamagereduce = mo.additional_phyDamagereduce;
if (phyDamagereduce != 0)
{
randAttr[EHeroAddProperties.additional_phyDamagereduce] = phyDamagereduce;
}
//言伤减免加成
int magDamagereduce = mo.additional_magDamagereduce;
if (magDamagereduce != 0)
{
randAttr[EHeroAddProperties.additional_magDamagereduce] = magDamagereduce;
}
int monsterExp = mo.additional_monsterExp;
if (monsterExp != 0)
{
randAttr[EHeroAddProperties.additional_monsterExp] = monsterExp;
}
int atkSpeed = mo.additional_atkSpeed;
if (atkSpeed != 0)
{
randAttr[EHeroAddProperties.additional_atkSpeed] = atkSpeed;
}
int moveSpeed = mo.additional_moveSpeed;
if (moveSpeed != 0)
{
randAttr[EHeroAddProperties.additional_moveSpeed] = moveSpeed;
}
int critProbability = mo.additional_critProbability;
if (critProbability != 0)
{
randAttr[EHeroAddProperties.additional_critProbability] = critProbability;
}
int critDamage = mo.additional_critDamage;
if (critDamage != 0)
{
randAttr[EHeroAddProperties.additional_critDamage] = critDamage;
}
return randAttr;
}
}
///
/// 宝石加成
///
public Dictionary gemrRandAttr
{
get
{
Dictionary randAttr = new Dictionary();
if (this.gemId == 0)
{
return randAttr;
}
sm_gemProperty mo = GameConfigData.Ins.GetgemPropertyMo(this.gemId);
int additional_hpUpperlimit = mo.additional_hpUpperlimit;
if (additional_hpUpperlimit != 0)
{
randAttr[EHeroAddProperties.additional_hpUpperlimit] = additional_hpUpperlimit;
}
int additional_phyDamage = mo.additional_phyDamage;
if (additional_phyDamage != 0)
{
randAttr[EHeroAddProperties.additional_phyDamage] = additional_phyDamage;
}
int additional_magDamage = mo.additional_magDamage;
if (additional_magDamage != 0)
{
randAttr[EHeroAddProperties.additional_magDamage] = additional_magDamage;
}
int additional_critDamage = mo.additional_critDamage;
if (additional_critDamage != 0)
{
randAttr[EHeroAddProperties.additional_critDamage] = additional_critDamage;
}
int skillCoolTs = mo.skillCoolTs;
if (skillCoolTs != 0)
{
randAttr[EHeroAddProperties.skillCoolTs] = skillCoolTs;
}
return randAttr;
}
}
///
/// 突破后属性变化值
///
public Dictionary changeAttr
{
get
{
Dictionary attr = new Dictionary();
int nextStar = this.starLv + 1;
if (this.starLv >= 5)
{
nextStar = 5;
}
sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), nextStar);
//生命
int hp = mo.hp + (this.level - 1) * mo.hpRate;
if (hp != 0)
{
attr[EHeroProperties.HP] = hp;
}
//mp
int mp = mo.nengliangzhi + (this.level - 1) * mo.nengliangzhiRate;
if (mp != 0)
{
attr[EHeroProperties.NENGLIANGZHI] = mp;
}
//物理攻击
int phyAtk = mo.wuligongji + (this.level - 1) * mo.wuligongjiRate;
if (phyAtk != 0)
{
attr[EHeroProperties.WULIGONGJI] = phyAtk;
}
//防御护甲
int phyDef = mo.fangyuhujia + (this.level - 1) * mo.fangyuhujiaRate;
if (phyDef != 0)
{
attr[EHeroProperties.FANGYUHUJIA] = phyDef;
}
//攻击速度
//int atkSpeed = mo.gongjisudu + (this.level - 1) * mo.gongjisuduRate;
//if (atkSpeed != 0)
//{
// attr[EHeroProperties.ATKSPEED] = atkSpeed;
//}
//法术强度
int fashuqiangdu = mo.fashuqiangdu + (this.level - 1) * mo.fashuqiangduRate;
if (fashuqiangdu != 0)
{
attr[EHeroProperties.FASHUQIANGDU] = fashuqiangdu;
}
//魔法抗性
int mofakangxing = mo.mofakangxing + (this.level - 1) * mo.mofakangxingRate;
if (mofakangxing != 0)
{
attr[EHeroProperties.MOFAKANGXING] = mofakangxing;
}
//暴击
int crit = mo.baoji + (this.level - 1) * mo.baojiRate;
if (crit != 0)
{
attr[EHeroProperties.CRICITAL] = crit;
}
//抗暴击
int kangbaoji = mo.kangbaoji + (this.level - 1) * mo.kangbaojiRate;
if (kangbaoji != 0)
{
attr[EHeroProperties.KANGBAOJI] = kangbaoji;
}
//言力
int yanli = mo.yanli + (this.level - 1) * mo.yanliRate;
if (yanli != 0)
{
attr[EHeroProperties.YANLI] = yanli;
}
return attr;
}
}
///
/// 言灵升星前后的属性变化--------废弃
///
public Dictionary addAttr
{
get
{
Dictionary attr = new Dictionary();
//if (this.starLv >= 5)
//{
// return attr;
//}
//int nextId = this.Mo().GetYanlingExt().nextId;
//sm_item_yanling mo = sm_item_yanling.GetMoById(nextId);
////生命
//int hp = this.Mo().GetYanlingExt().hpBase + (this.level - 1) * this.Mo().GetYanlingExt().hpRate;
//int newhp = mo.hpBase + (this.level - 1) * mo.hpRate;
//if (newhp - hp != 0)
//{
// attr.Add(EHeroProperties.HP, newhp - hp);
//}
////暴击
//int crit = this.Mo().GetYanlingExt().critBase + (this.level - 1) * this.Mo().GetYanlingExt().critRate;
//int newcrit = mo.critBase + (this.level - 1) * mo.critRate;
//if (newcrit - crit != 0)
//{
// attr.Add(EHeroProperties.CRICITAL, newcrit - crit);
//}
////物理攻击
//int phyAtk = this.Mo().GetYanlingExt().phyAtkBase + (this.level - 1) * this.Mo().GetYanlingExt().phyAtkRate;
//int newphyAtk = mo.phyAtkBase + (this.level - 1) * mo.phyAtkRate;
//if (newphyAtk - phyAtk != 0)
//{
// attr.Add(EHeroProperties.WULIGONGJI, newphyAtk - phyAtk);
//}
////防御护甲
//int phyDef = this.Mo().GetYanlingExt().phyDefBase + (this.level - 1) * this.Mo().GetYanlingExt().phyDefRate;
//int newphyDef = mo.phyDefBase + (this.level - 1) * mo.phyDefRate;
//if (newphyDef - phyDef != 0)
//{
// attr.Add(EHeroProperties.FANGYUHUJIA, newphyDef - phyDef);
//}
////攻击速度
//int atkSpeed = this.Mo().GetYanlingExt().atkSpeedBase + (this.level - 1) * this.Mo().GetYanlingExt().atkSpeedRate;
//int newatkSpeed = mo.atkSpeedBase + (this.level - 1) * mo.atkSpeedRate;
//if (newatkSpeed - atkSpeed != 0)
//{
// attr.Add(EHeroProperties.ATKSPEED, newatkSpeed - atkSpeed);
//}
////法术强度
//int fashuqiangdu = this.Mo().GetYanlingExt().fashuqiangduBase + (this.level - 1) * this.Mo().GetYanlingExt().fashuqiangduRate;
//int newfashuqiangdu = mo.fashuqiangduBase + (this.level - 1) * mo.fashuqiangduRate;
//if (newfashuqiangdu - fashuqiangdu != 0)
//{
// attr.Add(EHeroProperties.FASHUQIANGDU, newfashuqiangdu - fashuqiangdu);
//}
////魔法抗性
//int mofakangxing = this.Mo().GetYanlingExt().mofakangxingBase + (this.level - 1) * this.Mo().GetYanlingExt().mofakangxingRate;
//int newmofakangxing = mo.mofakangxingBase + (this.level - 1) * mo.mofakangxingRate;
//if (newmofakangxing - mofakangxing != 0)
//{
// attr.Add(EHeroProperties.MOFAKANGXING, newmofakangxing - mofakangxing);
//}
return attr;
}
}
///
/// 突破后随机属性变化值
///
public Dictionary randAddAttr
{
get
{
Dictionary randAttr = new Dictionary();
//if (this.starLv >= 5)
//{
// return randAttr;
//}
//int nextId = this.Mo().GetYanlingExt().nextId;
//sm_item_yanling mo = sm_item_yanling.GetMoById(nextId);
int nextStar = this.starLv + 1;
if (this.starLv >= 5)
{
nextStar = 5;
}
sm_yanlingextra_level mo = sm_yanlingextra_level.GetMoById(int.Parse(this.typeId), nextStar);
if (mo.additional_hpUpperlimit != 0)
{
randAttr[EHeroAddProperties.additional_hpUpperlimit] = mo.additional_hpUpperlimit;
}
int manaUpperlimit = mo.additional_manaUpperlimit;
if (manaUpperlimit != 0)
{
randAttr[EHeroAddProperties.additional_manaUpperlimit] = manaUpperlimit;
}
int phyDamage = mo.additional_phyDamage;
if (phyDamage != 0)
{
randAttr[EHeroAddProperties.additional_phyDamage] = phyDamage;
}
int magDamage = mo.additional_magDamage;
if (magDamage != 0)
{
randAttr[EHeroAddProperties.additional_magDamage] = magDamage;
}
int phyDefend = mo.additional_phyDefend;
if (phyDefend != 0)
{
randAttr[EHeroAddProperties.additional_phyDefend] = phyDefend;
}
int magDefend = mo.additional_magDefend;
if (magDefend != 0)
{
randAttr[EHeroAddProperties.additional_magDefend] = magDefend;
}
int phyDamagereduce = mo.additional_phyDamagereduce;
if (phyDamagereduce != 0)
{
randAttr[EHeroAddProperties.additional_phyDamagereduce] = phyDamagereduce;
}
int magDamagereduce = mo.additional_magDamagereduce;
if (magDamagereduce != 0)
{
randAttr[EHeroAddProperties.additional_magDamagereduce] = magDamagereduce;
}
int monsterExp = mo.additional_monsterExp;
if (monsterExp != 0)
{
randAttr[EHeroAddProperties.additional_monsterExp] = monsterExp;
}
int atkSpeed = mo.additional_atkSpeed;
if (atkSpeed != 0)
{
randAttr[EHeroAddProperties.additional_atkSpeed] = atkSpeed;
}
int moveSpeed = mo.additional_moveSpeed;
if (moveSpeed != 0)
{
randAttr[EHeroAddProperties.additional_moveSpeed] = moveSpeed;
}
int critProbability = mo.additional_critProbability;
if (critProbability != 0)
{
randAttr[EHeroAddProperties.additional_critProbability] = critProbability;
}
int critDamage = mo.additional_critDamage;
if (critDamage != 0)
{
randAttr[EHeroAddProperties.additional_critDamage] = critDamage;
}
return randAttr;
}
}
///
/// 言灵套系属性
///
public List yanlingComposeAttr
{
get
{
List yanlingComposeAttr = new List();
int composeId = this.nMo.GetYanlingExt().composeId;
if (composeId == 0)
{
return yanlingComposeAttr;
}
sm_yanling_compose mo = GameConfigData.Ins.Getyanling_composeMo(composeId);
if (mo == null)
{
return yanlingComposeAttr;
}
int temp = 0;
if (this.herouid != 0)
{
Dictionary hero_yanling = UserProxy.Instance.player.collectHero.collectHeroDic[this.herouid.ToString()].hero_yanling;
foreach (KeyValuePair kt in hero_yanling)
{
if (kt.Value.typeId == null)
{
continue;
}
int id = kt.Value.nMo.GetYanlingExt().composeId;
if (id == composeId)
{
temp += 1;
}
}
}
string[] twoList = mo.two_compose.Split(',');
int attrType = int.Parse(twoList[0]);
yanlingComposeDataVo vo = new yanlingComposeDataVo();
vo.composeId = composeId;
vo.isShow = false;
if (temp >= 2)
{
vo.isShow = true;
}
vo.attr = (EHeroAddProperties)attrType;
vo.attrName = mo.name;
vo.desc = mo.two_desc;
vo.type = int.Parse(twoList[1]);
vo.val = int.Parse(twoList[2]);
yanlingComposeAttr.Add(vo);
string[] threeList = mo.three_compose.Split(',');
int attrType_3 = int.Parse(threeList[0]);
yanlingComposeDataVo vo_3 = new yanlingComposeDataVo();
vo_3.composeId = composeId;
vo_3.isShow = false;
if (temp >= 3)
{
vo_3.isShow = true;
}
vo_3.attr = (EHeroAddProperties)attrType_3;
vo_3.attrName = mo.name;
vo_3.desc = mo.three_desc;
vo_3.type = int.Parse(threeList[1]);
vo_3.val = int.Parse(threeList[2]);
yanlingComposeAttr.Add(vo_3);
return yanlingComposeAttr;
}
}
///
/// 1级消耗--------------废弃
///
public List singleCostList
{
get
{
List list = new List();
ItemVo gVo = new ItemVo();
gVo.typeId = 1.ToString();
gVo.count = GameConfigData.Ins.GetyanlingLeveMo(this.level).goldCost;
ItemVo pointVo = new ItemVo();
pointVo.typeId = 8.ToString();
pointVo.count = GameConfigData.Ins.GetyanlingLeveMo(this.level).pointCost;
list.Add(gVo);
list.Add(pointVo);
return list;
}
}
///
/// 5级消耗--------------废弃
///
public List multiCostList
{
get
{
int max = this.level + 5;
Dictionary dic = new Dictionary();
for (int i = this.level; i < max; i++)
{
if (!GameConfigData.Ins.yanlingLeve.ContainsKey(i))
{
break;
}
sm_yanlingLeve mo = GameConfigData.Ins.GetyanlingLeveMo(i);
if (mo == null)
{
break;
}
string cost = "1,"+mo.goldCost + ";" +"8,"+ mo.pointCost;
string[] sList = cost.Split(';');
foreach (string item in sList)
{
string[] costList = item.Split(',');
if (dic.ContainsKey(int.Parse(costList[0])))
{
dic[int.Parse(costList[0])] += int.Parse(costList[1]);
}
else
{
dic[int.Parse(costList[0])] = int.Parse(costList[1]);
}
}
}
List list = new List();
foreach (KeyValuePair kv in dic)
{
ItemVo vo = new ItemVo();
vo.count = kv.Value;
vo.typeId = kv.Key.ToString();
list.Add(vo);
}
return list;
}
}
///
/// 当前等级是否是最大值 true:是 --------------废弃
///
public bool isLevelMax
{
get
{
//Dictionary yanlingLeve = GameConfigData.Ins.yanlingLeve;
//if (this.level >= yanlingLeve.Count)
//{
// return true;
//}
return false;
}
}
///
/// 获取言灵的Mo(基础数据), 获取扩展数据请继续.GetYanlingExt();
///
///
public sm_item_base Mo()
{
return sm_item_base.GetMoById(int.Parse(this.typeId));
}
///
/// 技能id
///
public sm_skill skillMo
{
get
{
sm_item_yanling mo = this.nMo.GetYanlingExt();
if (mo!= null && mo.skill_id != 0)
{
return sm_skill.GetMoByID(mo.skill_id);
}
return null;
}
}
///
/// 查找言灵技在几级解锁
///
/// (等级, 技能id)
public (int grade, int skillId) FindSkillId()
{
if (CurGrade.skill_id > 0)
{
return (grade, CurGrade.skill_id);
}
for (var g = grade + 1; g <= 5; g++)
{
//var g = this.grade < 5 ? this.grade + 1 : this.grade;
var mo = sm_yanling_upgrade.GetMo(int.Parse(this.typeId), g);
if (null != mo && mo.skill_id > 0)
{
return (g, mo.skill_id);
}
}
return (0, 0);
}
///
/// 前一等阶的数据
///
public sm_yanling_upgrade PreGrade
{
get
{
var g = this.grade > 1 ? this.grade - 1 : this.grade;
return sm_yanling_upgrade.GetMo(int.Parse(this.typeId), g);
}
}
///
/// 当前等阶的数据
///
public sm_yanling_upgrade CurGrade => sm_yanling_upgrade.GetMo(int.Parse(this.typeId), this.grade);
///
/// 下一等阶的数据
///
public sm_yanling_upgrade NextGrade
{
get
{
var g = this.grade < 5 ? this.grade + 1 : this.grade;
return sm_yanling_upgrade.GetMo(int.Parse(this.typeId), g);
}
}
}
public class yanlingComposeDataVo
{
public int composeId { get; set; }
///
/// 是否高亮显示 true:是
///
public bool isShow { get; set; }
///
/// 属性类型
///
public EHeroAddProperties attr { get; set; }
///
/// 属性名称
///
public string attrName { get; set; }
///
/// 描述信息
///
public string desc { get; set; }
///
/// 是数值还是百分比 1:数值;2:百分比
///
public int type { get; set; }
///
/// 属性值--百分比
///
public int val { get; set; }
}