1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class UpgradeVo
- {
- public UpgradeVo(int id,int itemId,int num)
- {
- this.itemId = itemId;
- this.num = num;
- this.id = id;
- }
- /// <summary>
- /// 唤灵是id
- /// </summary>
- public int id { get; set; }
- /// <summary>
- /// 消耗道具id
- /// </summary>
- public int itemId { get; set; }
- /// <summary>
- /// 消耗数量
- /// </summary>
- public int num { get; set; }
- /// <summary>
- /// 增加的经验值
- /// </summary>
- public int addExp
- {
- get
- {
- int totalNum = sm_item_stones.GetMoById(this.itemId).baseExp * this.num;
- return totalNum;
- }
- }
-
- /// <summary>
- /// 变化等级
- /// </summary>
- public int addLv
- {
- get
- {
- if (!UserProxy.Instance.player.collectHero.collectHeroDic.ContainsKey(this.id.ToString()))
- {
- return 0;
- }
- GameHeroVo vo = UserProxy.Instance.player.collectHero.collectHeroDic[this.id.ToString()];
- int xp = vo.xp+this.addExp;
- int lv = 0;
- int temp = 0;
- Dictionary<int, sm_hero_levelexp> dic = GameConfigData.Ins.hero_levelexp;
- foreach (KeyValuePair<int,sm_hero_levelexp>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
- {
- int gold = sm_item_stones.GetMoById(this.itemId).costGold * this.num;
- return gold;
- }
- }
- ///// <summary>
- ///// 增加的经验值
- ///// </summary>
- //public int addExp
- //{
- // get
- // {
- // return 0;
- // }
- //}
- }
|