Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
| | |
| | | /// 是否是装备, 这里的装备指的是: 武器, 帽子, 衣服, 下装, 鞋子, 腰带
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | public bool IsEquip(E_ItemType itemType)
|
| | | public bool IsEquip(E_DropItemType itemType)
|
| | | {
|
| | | return itemType >= E_ItemType.Equip_Weapon && itemType <= E_ItemType.Equip_Shoes;
|
| | | return itemType >= E_DropItemType.Equip_Weapon && itemType <= E_DropItemType.Equip_Shoes;
|
| | | }
|
| | |
|
| | | public void RequestWorldTick()
|
| | |
| | | private static Dictionary<int, UIEffect> dropEffectDict = new Dictionary<int, UIEffect>();
|
| | |
|
| | | static PackModel _playerPack;
|
| | | static PackModel playerPack
|
| | | {
|
| | | static PackModel playerPack {
|
| | | get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | // 背包已满,且不是铜钱不拾取
|
| | | if (playerPack.GetEmptyGridCount(PackType.Item) == 0
|
| | | && _itemModel.Type != (int)E_ItemType.DropCopper
|
| | | && _itemModel.Type != (int)E_ItemType.Copper)
|
| | | && _itemModel.Type != (int)E_DropItemType.DropCopper
|
| | | && _itemModel.Type != (int)E_DropItemType.Copper)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | // 对装备是否拾取的判断
|
| | | if (PlayerDatas.Instance.IsEquip((E_ItemType)_itemModel.Type))
|
| | | if (PlayerDatas.Instance.IsEquip((E_DropItemType)_itemModel.Type))
|
| | | {
|
| | | //Debug.LogFormat("检测装备: {0} 是否可以拾取, 颜色: {1}", _itemModel.ID, (E_ItemColor)_itemModel.ItemColor);
|
| | | // 是否配置了白色,蓝色装备不捡
|
| | |
| | | }
|
| | | }
|
| | | // 项链或者仙器
|
| | | else if (((E_ItemType)_itemModel.Type == E_ItemType.Necklace || (E_ItemType)_itemModel.Type == E_ItemType.Fariy)
|
| | | else if (
|
| | | ((E_DropItemType)_itemModel.Type == E_DropItemType.Equip_FairyCan1
|
| | | || (E_DropItemType)_itemModel.Type == E_DropItemType.Equip_FairyCan2
|
| | | || (E_DropItemType)_itemModel.Type == E_DropItemType.Equip_Jade
|
| | | || (E_DropItemType)_itemModel.Type == E_DropItemType.Equip_Neck)
|
| | | && HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.necklaces))
|
| | | {
|
| | | //Debug.Log(" |-- 配置了项链或者仙器不拾取, 这个是项链或者仙器, 不拾取");
|
| | | return true;
|
| | | }
|
| | | // 宝石
|
| | | else if ((E_ItemType)_itemModel.Type == E_ItemType.Gemstone
|
| | | else if ((E_DropItemType)_itemModel.Type == E_DropItemType.Gemstone
|
| | | && HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.gem))
|
| | | {
|
| | | //Debug.Log(" |-- 配置了项链或者仙器不拾取, 这个是项链或者仙器, 不拾取");
|
| | | return true;
|
| | | }
|
| | | // 药品
|
| | | else if ((E_ItemType)_itemModel.Type == E_ItemType.Drugs
|
| | | else if ((E_DropItemType)_itemModel.Type == E_DropItemType.Drugs
|
| | | && HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.drug))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | // 金币
|
| | | else if ((E_ItemType)_itemModel.Type == E_ItemType.DropCopper
|
| | | else if ((E_DropItemType)_itemModel.Type == E_DropItemType.DropCopper
|
| | | && HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.coins))
|
| | | {
|
| | | return true;
|
| | |
| | | // 其他
|
| | | else
|
| | | {
|
| | | if ((E_ItemType)_itemModel.Type != E_ItemType.DropCopper
|
| | | && (E_ItemType)_itemModel.Type != E_ItemType.Drugs
|
| | | && (E_ItemType)_itemModel.Type != E_ItemType.Gemstone
|
| | | && (E_ItemType)_itemModel.Type != E_ItemType.Necklace
|
| | | && (E_ItemType)_itemModel.Type != E_ItemType.Fariy
|
| | | && !PlayerDatas.Instance.IsEquip((E_ItemType)_itemModel.Type)
|
| | | if ((E_DropItemType)_itemModel.Type != E_DropItemType.DropCopper
|
| | | && (E_DropItemType)_itemModel.Type != E_DropItemType.Drugs
|
| | | && (E_DropItemType)_itemModel.Type != E_DropItemType.Gemstone
|
| | | && (E_DropItemType)_itemModel.Type != E_DropItemType.Equip_Neck
|
| | | && (E_DropItemType)_itemModel.Type != E_DropItemType.Equip_FairyCan1
|
| | | && (E_DropItemType)_itemModel.Type != E_DropItemType.Equip_Jade
|
| | | && (E_DropItemType)_itemModel.Type != E_DropItemType.Equip_FairyCan2
|
| | | && !PlayerDatas.Instance.IsEquip((E_DropItemType)_itemModel.Type)
|
| | | // 以上类型都不是且开启了其他拾取的时候
|
| | | && HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.other))
|
| | | {
|
| | |
| | | |
| | | |
| | | { |
| | | E_ItemType _itemType;translator.Get(L, 2, out _itemType); |
| | | E_DropItemType _itemType;translator.Get(L, 2, out _itemType); |
| | | |
| | | bool gen_ret = gen_to_be_invoked.IsEquip( _itemType ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | |
| | | |
| | | |
| | | { |
| | | string _equipGuid = LuaAPI.lua_tostring(L, 2); |
| | | |
| | | gen_to_be_invoked.PutOn( _equipGuid ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | |
| | | |
| | | |
| | | { |
| | | int _level = LuaAPI.xlua_tointeger(L, 2); |
| | | int _place = LuaAPI.xlua_tointeger(L, 3); |
| | | |
| | | gen_to_be_invoked.TakeOff( _level, _place ); |
| | | |
| | | |
| | | |
| | | return 0; |
| | | } |
| | |
| | | } |
| | | if(gen_param_count == 2&& translator.Assignable<Snxxz.UI.ItemModel>(L, 2)) |
| | | { |
| | | Snxxz.UI.ItemModel _model = (Snxxz.UI.ItemModel)translator.GetObject(L, 2, typeof(Snxxz.UI.ItemModel)); |
| | | |
| | | bool gen_ret = gen_to_be_invoked.IsEquip( _model ); |
| | | LuaAPI.lua_pushboolean(L, gen_ret); |
| | | |
| | | |
| | | |
| | | return 1; |
| | | } |
| | |
| | | private void OnClickUseBtn()
|
| | | {
|
| | | CloseImmediately();
|
| | | ItemOperateUtility.Instance.GotoUseItem(auctionHelpModel.ItemModel.itemInfo.index);
|
| | | //itemTipsModel.SetItemTipsModel(PackType.Item, auctionHelpModel.ItemModel.guid, false, true);
|
| | | //itemTipsModel.SetBagTipsBtn(itemTipsModel.curAttrData);
|
| | | //itemTipsModel.ShowUICtrl();
|
| | | ItemOperateUtility.Instance.UseItem(auctionHelpModel.ItemModel.guid);
|
| | | } |
| | | private void OnClickAuction()
|
| | | {
|
| | |
| | | getWays.Clear(); |
| | | } |
| | | |
| | | public void PutOn(string equipGuid) |
| | | { |
| | | var item = packModel.GetItemByGuid(equipGuid); |
| | | if (item == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var level = item.config.LV; |
| | | if (!equipSets.ContainsKey(level)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var set = equipSets[level]; |
| | | if (!set.unLocked) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | set.PutOn(equipGuid); |
| | | } |
| | | |
| | | public void TakeOff(int level, int place) |
| | | { |
| | | if (!equipSets.ContainsKey(level)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var slot = equipSets[level]; |
| | | slot.TakeOff(place); |
| | | } |
| | | |
| | | public int CompareToCurrent(string equipGuid) |
| | | { |
| | | var item = packModel.GetItemByGuid(equipGuid); |
| | |
| | | switch (type) |
| | | { |
| | | case PackType.Item: |
| | | var config = ItemConfig.Get(itemId); |
| | | var level = config.LV; |
| | | if (equipSets.ContainsKey(level)) |
| | | if (ItemLogicUtility.Instance.IsEquip(itemId)) |
| | | { |
| | | var item = packModel.GetItemByIndex(PackType.Item, index); |
| | | if (item != null) |
| | | { |
| | | equipSets[level].UpdateRedPoint(item.guid); |
| | | } |
| | | |
| | | if (selectedLevel.value > 0) |
| | | var config = ItemConfig.Get(itemId); |
| | | var level = config.LV; |
| | | UpdateRedpoint(level); |
| | | if (selectedLevel.value > 0 && selectedLevel.value == level) |
| | | { |
| | | itemDirty = true; |
| | | } |
| | |
| | | if (itemDirty) |
| | | { |
| | | RefreshCandidateEquips(selectedLevel.value); |
| | | UpdateRedpoint(selectedLevel.value); |
| | | } |
| | | |
| | | if (equipDirty) |
| | |
| | | } |
| | | } |
| | | |
| | | public void SelectPlace(int place) |
| | | { |
| | | foreach (var item in equipSlots.Values) |
| | | { |
| | | item.selected.value = item.equipPosition.y == place; |
| | | } |
| | | } |
| | | |
| | | public bool IsSlotUnLocked(int place) |
| | | { |
| | | if (!equipSlots.ContainsKey(place)) |
| | |
| | | } |
| | | |
| | | return equipSlots[place].equip.value; |
| | | } |
| | | |
| | | public void PutOn(string equipGuid) |
| | | { |
| | | var equip = packModel.GetItemByGuid(equipGuid); |
| | | if (equip == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var place = equip.config.EquipPlace; |
| | | if (!equipSlots.ContainsKey(place)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var slot = equipSlots[place]; |
| | | if (!slot.unLocked) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | if (!IsPlaceCompatible(place, equip.config.EquipPlace)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | slot.equip.value = equipGuid; |
| | | } |
| | | |
| | | public void TakeOff(int place) |
| | | { |
| | | if (!equipSlots.ContainsKey(place)) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var slot = equipSlots[place]; |
| | | slot.equip.value = null; |
| | | } |
| | | |
| | | public EquipAppearance GetAppearance() |
| | |
| | | } |
| | | |
| | | return item.score.CompareTo(currentEquip.score); |
| | | } |
| | | |
| | | public void UpdateRedPoint(string equipGuid) |
| | | { |
| | | |
| | | } |
| | | |
| | | private bool IsPlaceCompatible(int slotPlace, int equipPlace) |
| | | { |
| | | return slotPlace == equipPlace; |
| | | } |
| | | |
| | | public static Int2 ServerPlaceToClientPlace(int serverPlace) |
| | |
| | | |
| | | public int SetSellItemOrder(ItemModel startModel, ItemModel endModel) |
| | | { |
| | | bool startIsEquip = IsEquip(startModel); |
| | | bool endIsEquip = IsEquip(endModel); |
| | | bool startIsEquip = IsEquip(startModel.itemId); |
| | | bool endIsEquip = IsEquip(endModel .itemId); |
| | | if (startIsEquip.CompareTo(endIsEquip) != 0) return -startIsEquip.CompareTo(endIsEquip); |
| | | int order1 = startModel.config.Type; |
| | | int order2 = endModel.config.Type; |
| | |
| | | int code2 = endModel.itemId; |
| | | if (code1.CompareTo(code2) != 0) return -code1.CompareTo(code2); |
| | | return 0; |
| | | } |
| | | |
| | | public bool IsEquip(ItemModel model) |
| | | { |
| | | return model.config.EquipPlace != 0; |
| | | } |
| | | |
| | | public void GetOneKeySellModel() |
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (!string.IsNullOrEmpty(attrData.guid))
|
| | | {
|
| | | var item = playerPack.GetItemByGuid(attrData.guid);
|
| | | if (item.isAuction)
|
| | | {
|
| | | attrData.SetTipsFuncBtn(ItemOperateType.putAway, (ItemWinBtnType, ItemAttrData) => { ItemOperateUtility.Instance.PutAway(attrData.guid); });
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | |
|
| | | public bool isHavePutLimit { get; private set; }
|
| | |
|
| | | StrengthenModel strengthengmodel { get { return ModelCenter.Instance.GetModel<StrengthenModel>(); } }
|
| | | ItemTipsModel itemTipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | | RuneModel runeModel { get { return ModelCenter.Instance.GetModel<RuneModel>(); } }
|
| | | GodBeastModel beastModel { get { return ModelCenter.Instance.GetModel<GodBeastModel>(); } }
|
| | |
| | | Deleted = 0, // 已删除物品,弃用
|
| | | Equip = 1, // 装备
|
| | | Item = 2, // 物品
|
| | | Recycle = 3, // 垃圾桶(回收站)
|
| | | BreakItem = 4, // 拆解物品栏
|
| | | Warehouse = 5, // 仓库
|
| | | Title = 6, // 称号背包
|
| | | Compose = 7, // 合成背包
|
| | | Identify = 8, // 鉴定背包
|
| | | BreakPrepare = 9, // 拆解准备背包
|
| | | Result = 10, // 合成结果背包
|
| | | Investiture = 11, // 封爵背包
|
| | | Horse = 12, // 坐骑背包
|
| | | AnyWhere = 13, // 万能背包
|
| | | Fabao = 14, // 法宝背包
|
| | | HorseEquip = 15, // 坐骑装备背包
|
| | | CabinetDressCoat = 16, // 衣服外套背包
|
| | | CabinetWeaponCoat = 17, // 武器外套背包
|
| | | CabinetHorse = 18, // 时装坐骑背包
|
| | | JewelMerge = 19, // 宝石合成背包
|
| | | JewelMergeResult = 20, // 宝石合成结果背包
|
| | | FineSoulSlot = 21, // 精魄槽
|
| | | PetEquip1 = 22, // 宠物装备1
|
| | | PetEquip2 = 23, // 宠物装备2
|
| | | PetEquip3 = 24, // 宠物装备3
|
| | | PetEquip4 = 25, // 宠物装备4
|
| | | PetEquip5 = 26, // 宠物装备5
|
| | | PetCabinetPet = 27, // 收集系统,宠物收纳柜背包
|
| | | InterimPack = 28,//临时交换背包
|
| | | TempItem = 29,//临时存放背包
|
| | | Treasure = 30, // 寻宝背包
|
| | | PetPack = 31, //宠物背包
|
| | | DogzItem = 32, //神兽物品背包
|
| | | DogzEquip = 33, //神兽装备背包(神兽穿戴)
|
| | |
|
| | | BlastFrunacePack = 253, //炼丹背包
|
| | | GatherSoul = 254,//聚魂
|
| | | RunePack = 255,//符印背包
|
| | |
|
| | | }
|
| | |
|
| | | public enum E_ItemType
|
| | | public enum E_DropItemType
|
| | | {
|
| | | Copper = 1,// 铜钱
|
| | | Drugs = 7,// 药品
|
| | | Gemstone = 25,// 宝石
|
| | | DropCopper = 43,// 掉落铜钱
|
| | | Equip_Weapon = 101,// 武器
|
| | | Equip_Secondary,// 副手
|
| | | Equip_Hat,// 帽子
|
| | | Equip_Clothes,// 衣服
|
| | | Equip_Belt,// 腰带
|
| | | Equip_Pants,// 下装
|
| | | Equip_Shoes,// 鞋子
|
| | | Necklace,// 项链
|
| | | Fariy,// 仙器
|
| | | Equip_Wing = 111,// 翅膀
|
| | | Equip_Weapon = 101, // 主手
|
| | | Equip_Weapon2 = 102, // 副手
|
| | | Equip_Hat = 103, // 帽子
|
| | | Equip_Clothes = 104, // 衣服
|
| | | Equip_Belt = 105, // 腰带
|
| | | Equip_Trousers = 106, // 裤子
|
| | | Equip_Shoes = 107, // 鞋子
|
| | | Equip_Glove = 108, //手套
|
| | | Equip_Neck = 109, //项链
|
| | | Equip_FairyCan1 = 110, //仙器
|
| | | Equip_FairyCan2 = 111, //仙器
|
| | | Equip_Jade = 112, //玉佩
|
| | |
|
| | | Equip_Wing = 113,// 翅膀
|
| | | Guard,// 灵守
|
| | | Accessories1,// 配饰1
|
| | | Accessories2,// 配饰2
|
| | | Accessories3,// 配饰3
|
| | | Accessories4,// 配饰4
|
| | | Accessories5,// 配饰5
|
| | | Accessories6,// 配饰6
|
| | | JadeDynasty_Cloak = 128, //诛仙披风
|
| | | JadeDynasty_FaceMask = 129, //诛仙面罩
|
| | | JadeDynasty_Glove = 130, //诛仙手套
|
| | | JadeDynasty_Ruyi = 131, //诛仙如意
|
| | | JadeDynasty_Pendant = 132, //诛仙吊坠
|
| | | JadeDynasty_Ring = 133, //诛仙戒指
|
| | | JadeDynasty_Sword1 = 134, //诛仙剑
|
| | | JadeDynasty_Sword2 = 135, //戮仙剑
|
| | | JadeDynasty_Sword3 = 136, //陷仙剑
|
| | | JadeDynasty_Sword4 = 137, //绝仙剑
|
| | | }
|
| | |
|
| | | /** 物品类型 */
|
| | | public enum ItemType
|
| | | {
|
| | | Buff = 9, //Buff类型
|
| | | OfflineCard = 10, //离线挂机卡
|
| | | MountDan = 21,//坐骑丹
|
| | | MakerEquipSuitMat = 34, //装备套装材料
|
| | | ComposeSuitStone = 35, //套装石碎片
|
| | | WingsMat = 39, //合成翅膀材料,羽翼精炼材料
|
| | | DogzStrengthMat = 70, //提供神兽装备强化的经验
|
| | | VipTools = 80, //vip道具
|
| | | Box = 81, //宝箱
|
| | | Necklaces = 108, //项链
|
| | | FairyEquip = 109, //仙器
|
| | | Wings = 111, //翅膀
|
| | | SpiritAnimal = 112, //灵守
|
| | | DogzEquipType1 = 119, //神兽装备兽角
|
| | | DogzEquipType2 = 120, //神兽装备魔眼
|
| | | DogzEquipType3 = 121, //神兽装备獠牙
|
| | | DogzEquipType4 = 122, //神兽装备兽爪
|
| | | DogzEquipType5 = 123, //神兽装备鳞甲
|
| | | }
|
| | |
|
| | | /** 值为列表形式,枚举值是单数 */
|
| | |
| | | wingProgressValue = 42, //羽翼精炼值
|
| | | createTime = 44, // 时效物品的创建时间
|
| | | totalTime = 48, // 时效物品的剩余时间
|
| | | auctionItemCreateTime=50,//拍品创建时间
|
| | | auctionItemCreateTime = 50,//拍品创建时间
|
| | | #region 200~300 宠物数据用
|
| | | pet_NPCID = 200, //npcID
|
| | | pet_ClassLV = 202, // 阶级
|