using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using System.Collections.Generic;
using System;
using System.Linq;
///
/// 道具Vo
///
public class ItemVo
{
///
/// 这个物品在玩家身上唯一的id
///
public string uid { set; get; }
///
/// 当前数量
///
public int count { set; get; }
///
/// 查询用的id
///
public string typeId { set; get; }
///
/// 是否是新道具 true:新标志
///
public bool isNew
{
get
{
if (this.nMo.subType == (int)EItemSubType.Weapon)
{
List weaponRecord = UserProxy.Instance.player.collectEquip.weaponRecord;
if (weaponRecord.Contains(this.uid))
{
return true;
}
}else if (this.nMo.subType == (int)EItemSubType.YanLing)
{
List record = UserProxy.Instance.player.collectYanling.yanlingRecord;
if (record.Contains(this.uid))
{
return true;
}
}
else
{
List record = UserProxy.Instance.player.collectItem.itemRecord;
if (record.Contains(this.typeId))
{
return true;
}
}
return false;
}
}
#region 属性(Get)方法
///
/// 模板数据
///
public sm_item_base nMo => sm_item_base.GetMoById(int.Parse(this.typeId));
///
/// 是否武器类道具
///
public bool IsWeapon => null != nMo && nMo.subType == (int)EItemSubType.Weapon;
///
/// 是否是言灵
///
public bool IsYanLing => null != nMo && nMo.subType == (int)EItemSubType.YanLing;
#endregion
#region 对外提供的某装备的额外属性加成, 静态方法....
///
/// 解析逗号+分号分隔的道具字符串(id,num;id,num;....)
///
///
///
public static List ParsItemContentStr(string content)
{
var li = new List();
if (!string.IsNullOrEmpty(content.Trim()))
{
content.Split(';').ToList().ForEach(s =>
{
var arr = s.Split(',');
var itemId = arr[0];
var num = int.Parse(arr[1]);
li.Add(new ItemVo() { typeId = itemId, count = num });
});
}
return li;
}
#endregion
}
///
/// 道具2级分类
///
public enum EItemSubType
{
None = -1,
EXP = 0, // 指挥官经验
Gold = 1, // 金币
Gem = 2, // 钻石
PVPCoin = 5, // 竞技场奖励竞技币
ActivePoint = 6, // 每日任务活跃点奖励
Weapon = 101, // 武器
Segment = 201, // 英雄碎片
YanlingBookSegement = 202, // 言灵书碎片
BuffCard = 301, // 消耗品 | 经验卡---废弃
Package = 302, // 消耗品 | 礼包----废弃
Pill = 303, // 药品(体力)----战斗里使用了
Gene = 311, // 基础材料 | 基因(角色经验丹)
StrengthStone = 312, // 基础材料 | 强化石(言灵强化)
StrengthStone_Wuqi = 313, // 基础材料 | 强化石(用于武器强化)
AdvancedStone = 321, // 进阶材料 | 进阶石(用于武器、言灵升阶)--改成 合成材料了
AdvancedFineStone = 322, // 进阶材料 | 进阶 精华石(用于武器、言灵的升阶)
ForgingMaterial = 323, // 锻造材料 | 用于武器言灵锻造
Hunqi = 324, //魂器
ElementTuPoMaterial = 325,//元素突破材料
professionTuPoMaterial = 326,//职业突破材料
YanLingAdvancedStone = 327,//言灵的突破石
YanLingAdvancedMaterial = 328,//言灵的突破材料
WuqiAdvancedStone = 329, //武器的突破石
WuqiAdvancedMaterial = 330, //武器的突破材料
Box = 331, // 活动道具 | 宝箱
commonWishCoupons = 332, //活动道具 | 普通祈愿券
ActiveWishCoupons = 333, //活动道具 | 活动祈愿券
// 备注
BattleItem_HP = 341, // 战场道具 | 血瓶
BattleItem_MP = 342, // 战场道具 | 蓝瓶
BattleItem_Box = 343, // 战场道具 | 箱子
TownPortalScroll =344, // 回城卷轴
YanlingBook = 351, // 言灵召唤书
//...合成素材等...
YanLing = 401, // 言灵
Package_limit = 501, // 限购礼包
Package_First = 502, // 首冲礼包
Package_limitTs = 503, // 限时礼包
Package_Daliy = 504, // 每日特惠礼包
TaskCard = 601, // 任务卡 default(0)
Gemstone = 701, //宝石
GemTuZhi =702, //设计图纸
GemMaterial = 703, //宝石辅助材料
}
//}
///
/// 装备(武器)2019年11月26日14:55:36 (暂时定这些字段,后面再改)
///
[Obsolete("改用UserEquipmentVo了.2020年1月2日")]
public partial class EquipeMentVo : ItemVo
{
///
/// 当前星级
///
public int starLevel;
///
/// 当前星级上限
///
public int maxStar;
///
/// 当前等级
///
public new int level;
///
/// 当前经验
///
public int exp;
///
/// 是否锁定(锁定后不会被误卖)
///
public int isLocked;
///
/// 是否使用中(装备)
///
public int WhoIsUsing;
[Obsolete("武器上此字段不可用")]
public new int count = 1;
}