게임 Item 데이터 내부통신을 위한 구조체.
示例#1
0
文件: ItemInfo.cs 项目: windwp/mytool
        public static ItemInfo ParseItemInfo(string itemdata)
        {
            try
            {
                var item = new ItemInfo();
                var sdata = itemdata.Split(',');
                var index = 0;
                item.Id = int.Parse(sdata[index++]);
                item.BotId = int.Parse(sdata[index++]);
                item.Time = float.Parse(sdata[index++]);
                item.ItemType = int.Parse(sdata[index++]);
                item.px = float.Parse(sdata[index++]);
                item.py = float.Parse(sdata[index++]);
                if (sdata.Length > index)
                {
                    item.Itemdata = string.Join(",", sdata, index, sdata.Length - index);
                }
                return item;
            }
            catch (System.Exception)
            {

                return null;
            }
        }
示例#2
0
 public void Init(ItemInfo info, int num, bool showValue, bool showTips)
 {
     this.itemInfo = info;
     this.count = num;
     this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.itemInfo.Value2);
     if (this.petInfo == null)
     {
         global::Debug.LogError(new object[]
         {
             string.Format("PetDict.GetInfo, ID = {0}", this.itemInfo.Value2)
         });
         base.gameObject.SetActive(false);
         return;
     }
     UISprite component = base.GetComponent<UISprite>();
     component.spriteName = Tools.GetItemQualityIcon(this.petInfo.Quality);
     UISprite uISprite = GameUITools.FindUISprite("icon", base.gameObject);
     uISprite.spriteName = this.petInfo.Icon;
     UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject);
     if (showValue)
     {
         uILabel.text = this.count.ToString();
     }
     else
     {
         uILabel.gameObject.SetActive(false);
     }
     if (showTips)
     {
         UIEventListener expr_FD = UIEventListener.Get(base.gameObject);
         expr_FD.onClick = (UIEventListener.VoidDelegate)Delegate.Combine(expr_FD.onClick, new UIEventListener.VoidDelegate(this.OnRewardClick));
     }
 }
示例#3
0
        public static bool FindClosestTreeInRadius(Vector3D fromPosition, float radius, out ItemInfo result)
        {
            result = default(ItemInfo);

            BoundingSphereD sphere = new BoundingSphereD(fromPosition, (double)radius);
            var entities = MyEntities.GetEntitiesInSphere(ref sphere);

            double closestDistanceSq = double.MaxValue;

            foreach (MyEntity entity in entities)
            {
                MyTrees trees = entity as MyTrees;
                if (trees == null) continue;

                trees.GetPhysicalItemsInRadius(fromPosition, radius, m_tmpEnvItemList);

                foreach (var tree in m_tmpEnvItemList)
                {
                    double distanceSq = Vector3D.DistanceSquared(fromPosition, tree.Transform.Position);
                    if (distanceSq < closestDistanceSq)
                    {
                        result.ItemsEntityId = entity.EntityId;
                        result.ItemId = tree.LocalId;
                        result.Target = tree.Transform.Position;
                        closestDistanceSq = distanceSq;
                    }
                }
            }

			entities.Clear();

            return closestDistanceSq != double.MaxValue;
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string key = core.Http["key"];

            try
            {
                ItemInfo info = new ItemInfo(core, key);

                // about to redirect, preserve the referer

                string urlreferer = Request.QueryString["urlreferer"];
                if (!string.IsNullOrEmpty(urlreferer))
                {
                    // update the session record
                    db.UpdateQuery(string.Format("UPDATE user_sessions SET session_http_referer = '{2}' WHERE session_string = '{1}' AND session_ip = '{0}';",
                    core.Session.IPAddress.ToString(), core.Session.SessionId, urlreferer));
                }

                core.Http.StatusCode = 301;
                core.Http.ForceDomain = true;
                core.Http.Redirect(info.Uri);
            }
            catch (InvalidIteminfoException)
            {
                core.Functions.Generate404();
            }
            /*catch
            {
                core.Functions.Generate404();
            }*/
        }
示例#5
0
    public void SetItemInfo( ItemInfo itemInfo )
    {
        //셋팅된 아이템 정보 물린다.
        this.itemInfo = itemInfo;

        //아이템이 해제되었다면..
        if (this.itemInfo == null)
        {
            this.itemImage.enabled = false;
        }

        //아이템이 셋팅되었다면..
        else
        {
            //ㅅ활성화 시키고
            this.itemImage.enabled = true;

            //셋팅된 아이템 이미지로 교체
            this.itemImage.spriteName =
                ItemInfo.ItemType[this.itemInfo.type];

        }
        

    }
 private void Init(ItemInfo info, int num)
 {
     if (info.Type != 3 || info.SubType != 3)
     {
         global::Debug.LogErrorFormat("Use reward type error {0}", new object[]
         {
             (EItemType)info.Type
         });
         base.gameObject.SetActive(false);
         return;
     }
     this.itemInfo = info;
     this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.itemInfo.Value2);
     if (this.lopetInfo == null)
     {
         global::Debug.LogError(new object[]
         {
             string.Format("LopetDict.GetInfo, ID = {0}", this.itemInfo.Value2)
         });
         base.gameObject.SetActive(false);
         return;
     }
     UISprite uISprite = GameUITools.FindUISprite("Quality", base.gameObject);
     uISprite.spriteName = Tools.GetItemQualityIcon(this.lopetInfo.Quality);
     UISprite component = base.GetComponent<UISprite>();
     component.spriteName = this.lopetInfo.Icon;
     UILabel uILabel = GameUITools.FindUILabel("num", base.gameObject);
     uILabel.text = string.Format("{0}{1}[-] [FFFFFF]x{2}", Tools.GetItemQualityColorHex(this.lopetInfo.Quality), this.itemInfo.Name, num);
 }
 public CommonSourceItemData(int sceneID, ItemInfo itemInfo, ulong index)
 {
     this.mSourceType = EItemSource.EISource_SceneLoot;
     this.mSceneID = sceneID;
     this.mItemInfo = itemInfo;
     this.id = index;
 }
 public void Refresh(ItemInfo itemInfo, bool isMask)
 {
     this.mPetInfo = null;
     this.mItemInfo = itemInfo;
     this.mIsActive = isMask;
     this.Refresh();
 }
示例#9
0
    public void AddItem()
    {
        if (this.bAddAble == false) return;

        //셋팅된 정보대로 ItemInfo 를 만든다.

        ItemInfo newItemInfo = new ItemInfo();

        newItemInfo.name = inputName.value;             //입력된 이름

        if (inputPopup.value.CompareTo("Type0") == 0 )
            newItemInfo.type = 0;

        else if (inputPopup.value.CompareTo("Type1") == 0)
            newItemInfo.type = 1;

        else if (inputPopup.value.CompareTo("Type2") == 0)
            newItemInfo.type = 2;


        this.itemList.AddItem(newItemInfo);


        //한번 추가된 이후로 중복 추가 안되게.
        this.bAddAble = false;



    }
 public GUITrialRewardItemData(ERewardType et, ItemInfo iInfo, int num, int dNum)
 {
     this.mERewardType = et;
     this.mItemInfo = iInfo;
     this.mItemNum = num;
     this.mDaiBiNum = dNum;
 }
示例#11
0
 public void Refresh(PetInfo petInfo, int curPetCount, int needPetCount)
 {
     this.mItemInfo = null;
     this.mPetInfo = petInfo;
     this.mLopetInfo = null;
     this.IsEnough = (curPetCount >= needPetCount);
     if (petInfo != null)
     {
         this.mIcon.gameObject.SetActive(true);
         this.mQualityMask.gameObject.SetActive(true);
         this.mIcon.spriteName = petInfo.Icon;
         this.mQualityMask.spriteName = Tools.GetItemQualityIcon(petInfo.Quality);
     }
     else
     {
         this.mIcon.gameObject.SetActive(false);
         this.mQualityMask.gameObject.SetActive(false);
     }
     this.mSb.Remove(0, this.mSb.Length);
     if (curPetCount < needPetCount)
     {
         this.mSb.Append("[ff0000]");
     }
     else
     {
         this.mSb.Append("[ffffff]");
     }
     this.mSb.Append(curPetCount).Append("[-]/").Append(needPetCount);
     this.mNum.text = this.mSb.ToString();
 }
示例#12
0
 public Item(int id, bool isEqueped, ItemInfo info)
 {
     this.id = id;
     this.count = 1;
     this.info = info;
     this.isEqueped = isEqueped;
 }
示例#13
0
 public void Init(ItemInfo itemInfo)
 {
     BagIndex = itemInfo.BagIndex;
     Quality = ItemModeLocator.Instance.GetQuality(itemInfo.TmplId);
     DateTime expireTime = Utils.ConvertFromJavaTimestamp(itemInfo.ExpireTime);
     TimeRemain = expireTime.Subtract(DateTime.Now);
 }
示例#14
0
        private void ItemUsedOnBlock(World world, Coordinates3D coordinates, BlockFace face, Coordinates3D cursor, ItemInfo item)
        {
            var info = world.GetBlockInfo(coordinates);
            if (Block.GetIsSolidOnFace(info, face) == false)
                return;
            
            coordinates += MathHelper.BlockFaceToCoordinates(face);

            switch (face)
            {
                case BlockFace.NegativeZ:
                    world.SetBlockId(coordinates, item.ItemId);
                    world.SetMetadata(coordinates, (byte)Orientation.FacingNorth);
                    break;
                case BlockFace.PositiveZ:
                    world.SetBlockId(coordinates, item.ItemId);
                    world.SetMetadata(coordinates, (byte)Orientation.FacingSouth);
                    break;
                case BlockFace.NegativeX:
                    world.SetBlockId(coordinates, item.ItemId);
                    world.SetMetadata(coordinates, (byte)Orientation.FacingWest);
                    break;
                case BlockFace.PositiveX:
                    world.SetBlockId(coordinates, item.ItemId);
                    world.SetMetadata(coordinates, (byte)Orientation.FacingEast);
                    break;
                default:
                    // Ladders can't be placed lying flat.
                    break;
            }
        }
示例#15
0
 public Item(int id, int count, ItemInfo info)
 {
     this.id = id;
     this.count = count;
     this.info = info;
     this.isEqueped = false;
 }
示例#16
0
 private void Refresh()
 {
     if (this.mLootData != null)
     {
         if (this.mLootData.RewardType == 1)
         {
             this.mItemIcon.spriteName = "M101";
             this.mItemQuality.spriteName = Tools.GetItemQualityIcon(0);
             this.mItemNum.text = this.mLootData.RewardValue1.ToString();
             this.mItemInfo = null;
         }
         else if (this.mLootData.RewardType == 2)
         {
             this.mItemIcon.spriteName = "M102";
             this.mItemQuality.spriteName = Tools.GetItemQualityIcon(2);
             this.mItemNum.text = this.mLootData.RewardValue1.ToString();
             this.mItemInfo = null;
         }
         else if (this.mLootData.RewardType == 3)
         {
             this.mItemInfo = Globals.Instance.AttDB.ItemDict.GetInfo(this.mLootData.RewardValue1);
             if (this.mItemInfo != null)
             {
                 this.mItemIcon.spriteName = this.mItemInfo.Icon;
                 this.mItemQuality.spriteName = Tools.GetItemQualityIcon(this.mItemInfo.Quality);
                 this.mItemNum.text = this.mLootData.RewardValue2.ToString();
             }
         }
     }
 }
示例#17
0
 public void Refresh(ItemInfo info, ItemInfo parentInfo, bool ifEnough = false)
 {
     if (ifEnough)
     {
         this.mListPanel.CheckIfEnough(info);
     }
     else
     {
         this.mListPanel.Refresh(info, parentInfo);
         if (Globals.Instance.AttDB.AwakeRecipeDict.GetInfo(info.ID) == null)
         {
             this.mCreateInfoLayer.gameObject.SetActive(false);
             this.mSourceInfoLayer.gameObject.SetActive(true);
             this.mSourceBG.enabled = true;
             this.mSourceInfoLayer.Refresh(info);
         }
         else
         {
             this.mCreateInfoLayer.gameObject.SetActive(true);
             this.mSourceInfoLayer.gameObject.SetActive(false);
             this.mSourceBG.enabled = false;
             this.mCreateInfoLayer.Refresh(info, parentInfo);
         }
     }
 }
    void OnGUI()
    {
        m_Type = (ItemType)EditorGUILayout.EnumPopup("Item Type", m_Type);
        m_strName = EditorGUILayout.TextField("Name", m_strName);
        m_strDescription = EditorGUILayout.TextField("Description", m_strDescription);

        ScriptableObject target = this;
        SerializedObject so = new SerializedObject(target);
        SerializedProperty sp_picNames = so.FindProperty("m_strPicNames");
        SerializedProperty sp_childItems = so.FindProperty("m_iChildItems");

        EditorGUILayout.PropertyField(sp_picNames, true);
        EditorGUILayout.PropertyField(sp_childItems, true);
        so.ApplyModifiedProperties();


        if (GUILayout.Button("Create"))
        {
            ItemInfo info = new ItemInfo();
            info.m_iID = 0;
            info.m_Type = m_Type;
            info.m_strName = m_strName;
            info.m_strDescription = m_strDescription;
            info.m_iPhotoIDs = m_iPhotoIDs;
            info.m_iChildIDs = m_iChildIDs;

            WriteItemInfo(info);
        }
    }
示例#19
0
 public override void InitPopUp(ItemInfo info)
 {
     if (info == null)
     {
         return;
     }
     this.Refresh(info);
 }
示例#20
0
文件: ItemInfo.cs 项目: windwp/mytool
 public static ItemInfo WeapontemInfo()
 {
     var item = new ItemInfo();
     item.ItemType = 1;
     item.Itemdata = "1:1:1";
     item.ItemName = "Weapon";
     return item;
 }
示例#21
0
文件: ItemInfo.cs 项目: windwp/mytool
 public static ItemInfo BloodItemInfo()
 {
     var item = new ItemInfo();
     item.ItemType = 2;
     item.Itemdata = "100";
     item.ItemName = "BLood";
     return item;
 }
示例#22
0
文件: ItemInfo.cs 项目: windwp/mytool
 public static ItemInfo LifeItemInfo()
 {
     var item = new ItemInfo();
     item.ItemType = 3;
     item.Itemdata = "1";
     item.ItemName = "Life";
     return item;
 }
示例#23
0
文件: ItemInfo.cs 项目: windwp/mytool
 public static ItemInfo BulletItemInfo()
 {
     var item = new ItemInfo();
     item.ItemType = 4;
     item.Itemdata = "";
     item.ItemName = "Bulllet";
     return item;
 }
示例#24
0
文件: ItemInfo.cs 项目: windwp/mytool
 public static ItemInfo FlyBagItemInfo()
 {
     var item = new ItemInfo();
     item.ItemType = 5;
     item.Itemdata = "";
     item.ItemName = "FlyBag"; 
     return item;
 }
示例#25
0
 private void Refresh(ItemInfo info)
 {
     this.mEquipIconItem.Refresh(info, false, false, false);
     this.mName.text = info.Name;
     this.mName.color = Tools.GetItemQualityColor(info.Quality);
     this.mNumValue.text = Globals.Instance.Player.ItemSystem.GetItemCount(info.ID).ToString();
     this.mDesc.text = info.Desc;
 }
示例#26
0
 private bool increaseItemCountInInventory(ItemInfo itmInf)
 {
     ItemInfo inventoryItem = items.Find (x => x.itemName == itmInf.itemName);
     Debug.Log (inventoryItem.getAmount ());
     inventoryItem.increaseAmountBy (itmInf.getAmount ());
     Debug.Log (inventoryItem.getAmount ());
     return true;
 }
示例#27
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            Item = null;
            ShowItem = null;

            DisposeCountLabel();
        }
示例#28
0
    //快速添加消费
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        string itemName = this.ItemNameEmpIns.Text.Trim();
        string itemType = this.ItemTypeEmpIns.SelectedValue;
        int catTypeId = Convert.ToInt32(this.CatTypeEmpIns.SelectedValue);
        string itemPrice = this.ItemPriceEmpIns.Text.Trim();
        DateTime itemBuyDate = Convert.ToDateTime(this.ItemBuyDateEmpIns.Text.Trim() + " " + DateTime.Now.ToString("HH:mm:ss"));
        int cardId = Convert.ToInt32(this.CardEmpIns.SelectedValue);

        if (itemName == "")
        {
            Utility.Alert(this, "商品名称未填写!");
            return;
        }

        Response.Cookies["CatTypeID"].Value = catTypeId.ToString();
        Response.Cookies["CatTypeID"].Expires = DateTime.MaxValue;

        Response.Cookies["CardID"].Value = cardId.ToString();
        Response.Cookies["CardID"].Expires = DateTime.MaxValue;

        if (!ValidHelper.CheckDouble(itemPrice))
        {
            Utility.Alert(this, "商品价格填写错误!");
            return;
        }

        ItemInfo item = new ItemInfo();
        item.ItemType = itemType;
        item.ItemName = itemName;
        item.CategoryTypeID = catTypeId;
        item.ItemPrice = Convert.ToDecimal(itemPrice);
        item.ItemBuyDate = itemBuyDate;
        item.UserID = userId;
        item.RegionID = 0;
        item.RegionType = "";
        item.Synchronize = 1;
        item.ZhuanTiID = ztId;
        item.ModifyDate = DateTime.Now;
        item.CardID = cardId;

        bool success = item_bll.InsertItem(item);
        if (success)
        {
            Session["TodayDate"] = itemBuyDate.ToString("yyyy-MM-dd");
            this.ItemNameEmpIns.Text = "";
            this.ItemPriceEmpIns.Text = "";

            List.EditIndex = -1;
            BindGrid();
        }
        else
        {
            Utility.Alert(this, "添加失败!");
            return;
        }
    }
示例#29
0
        void InternalSetSelected(ItemInfo info, bool fromProperty)
        {
            if (info == SelectedInfo) return;

            SelectedInfo = info;

            OnSelectedChanged(fromProperty);
            SelectedChanged.Invoke();
        }
示例#30
0
    protected string DisplayIconImage(ItemInfo item)
    {
        if (item != null && !string.IsNullOrEmpty(item.IconUrl))
        {
            return string.Format("<img alt=\"{1}\" border=\"0\" src=\"{0}\" height=\"90\" width=\"120\" />", item.IconUrl, Util.RemoveHtml(item.Description, 200));
        }

        return string.Empty;
    }
 public void UpdatePlayerProperties()
 {
     this.m_player.BeginChanges();
     try
     {
         int    attack          = 0;
         int    defence         = 0;
         int    agility         = 0;
         int    lucky           = 0;
         int    strengthenLevel = 0;
         string style           = "";
         string color           = "";
         string skin            = "";
         object @lock;
         Monitor.Enter(@lock = this.m_lock);
         try
         {
             style = ((this.m_items[0] == null) ? "" : this.m_items[0].TemplateID.ToString());
             color = ((this.m_items[0] == null) ? "" : this.m_items[0].Color);
             skin  = ((this.m_items[5] == null) ? "" : this.m_items[5].Skin);
             ItemInfo weapon = this.m_items[6];
             for (int i = 0; i < 31; i++)
             {
                 ItemInfo item = this.m_items[i];
                 if (item != null && item.IsValidItem())
                 {
                     attack         += item.Attack;
                     defence        += item.Defence;
                     agility        += item.Agility;
                     lucky          += item.Luck;
                     strengthenLevel = ((strengthenLevel > item.StrengthenLevel) ? strengthenLevel : item.StrengthenLevel);
                     this.AddProperty(item, ref attack, ref defence, ref agility, ref lucky);
                 }
             }
             this.EquipBuffer();
             for (int i = 0; i < PlayerEquipInventory.StyleIndex.Length; i++)
             {
                 style += ",";
                 color += ",";
                 if (this.m_items[PlayerEquipInventory.StyleIndex[i]] != null)
                 {
                     style += this.m_items[PlayerEquipInventory.StyleIndex[i]].TemplateID;
                     color += this.m_items[PlayerEquipInventory.StyleIndex[i]].Color;
                 }
             }
         }
         finally
         {
             Monitor.Exit(@lock);
         }
         this.m_player.UpdateBaseProperties(attack, defence, agility, lucky);
         this.m_player.UpdateStyle(style, color, skin);
         this.GetUserNimbus();
         this.m_player.ApertureEquip(strengthenLevel);
         this.m_player.UpdateWeapon(this.m_items[6]);
         this.m_player.UpdateSecondWeapon(this.m_items[15]);
         this.m_player.UpdateFightPower();
     }
     finally
     {
         this.m_player.CommitChanges();
     }
 }
示例#32
0
 public bool AddItem(ItemInfo item)
 {
     return(AddItem(item, m_beginSlot));
 }
示例#33
0
    private void PrepareSlots()
    {
        if (characterScript.rangedId != "")   //Spawnar vapen i weaponSlot
        {
            ItemO = Instantiate(Item);
            ItemO.transform.SetParent(weaponSlot.transform, false);

            rangedId = characterScript.rangedId;
            foreach (WeaponObject weapon in Assets.assets.weaponTemp)
            {
                if (weapon.name == rangedId)
                {
                    itemInfo = ItemO.GetComponent <ItemInfo>();
                    itemInfo.GetData(weapon.icon, weapon.weaponName, weapon.description, weapon.name, weapon.cost, txtDescName, txtDescDesc);
                    weaponSlot.GetComponent <ItemSlotScript>().GetItem(weapon.weaponName, weapon.description, DescParent);
                }
            }
        }

        if (characterScript.clothId != "")
        {
            ItemO = Instantiate(Item);
            ItemO.transform.SetParent(clothSlot.transform, false);
            ItemO.transform.localScale = new Vector3(50, 50, 1);

            clothId = characterScript.clothId;
            foreach (ClothItemObject cloth in Assets.assets.clothTemp)
            {
                if (cloth.name == clothId)
                {
                    itemInfo = ItemO.GetComponent <ItemInfo>();
                    itemInfo.GetData(cloth.icon, cloth.itemName, cloth.description, cloth.name, cloth.cost, txtDescName, txtDescDesc);
                    clothSlot.GetComponent <ItemSlotScript>().GetItem(cloth.itemName, cloth.description, DescParent);
                }
            }
        }

        if (characterScript.headId != "")
        {
            ItemO = Instantiate(Item);
            ItemO.transform.SetParent(headSlot.transform, false);

            headId = characterScript.headId;
            foreach (ClothItemObject cloth in Assets.assets.clothTemp)
            {
                if (cloth.name == headId)
                {
                    itemInfo = ItemO.GetComponent <ItemInfo>();
                    itemInfo.GetData(cloth.icon, cloth.itemName, cloth.description, cloth.name, cloth.cost, txtDescName, txtDescDesc);
                    headSlot.GetComponent <ItemSlotScript>().GetItem(cloth.itemName, cloth.description, DescParent);
                }
            }
        }

        if (characterScript.healingId != "")
        {
            ItemO = Instantiate(Item);
            ItemO.transform.SetParent(healingSlot.transform, false);
            ItemO.transform.localScale = new Vector3(50, 50, 1);

            healingId = characterScript.healingId;
            foreach (HealingItemObject healingItem in Assets.assets.healingTemp)
            {
                if (healingItem.name == healingId)
                {
                    itemInfo = ItemO.GetComponent <ItemInfo>();
                    itemInfo.GetData(healingItem.icon, healingItem.itemName, healingItem.description, healingItem.name, healingItem.cost, txtDescName, txtDescDesc);
                    healingSlot.GetComponent <ItemSlotScript>().GetItem(healingItem.itemName, healingItem.description, DescParent);
                }
            }
        }

        if (characterScript.combatId != "")
        {
            ItemO = Instantiate(Item);
            ItemO.transform.SetParent(combatSlot.transform, false);
            ItemO.transform.localScale = new Vector3(50, 50, 1);

            combatId = characterScript.combatId;
            foreach (CombatItemObject combatItem in Assets.assets.combatTemp)
            {
                if (combatItem.name == combatId)
                {
                    itemInfo = ItemO.GetComponent <ItemInfo>();
                    itemInfo.GetData(combatItem.icon, combatItem.itemName, combatItem.description, combatItem.name, combatItem.cost, txtDescName, txtDescDesc);
                    combatSlot.GetComponent <ItemSlotScript>().GetItem(combatItem.itemName, combatItem.description, DescParent);
                }
            }
        }
    }
示例#34
0
    void ParseJson(bool ishd)
    {
        if (rootJson != null)
        {
            return;
        }

        //string strDir = Common.GAME_DATA_DIR + "/config";
        string strDir = Common.RES_CONFIG_DATA + "/config";

        string fileName = "config_ios";

        //Defualt
        fileName = "config_" + osDefault;
        if (osDefault == Source.ANDROID)
        {
            fileName = "config_android";
        }
        if (osDefault == Source.IOS)
        {
            fileName = "config_ios";
        }
        if (osDefault == Source.WIN)
        {
        }


        if (Common.isAndroid)
        {
            fileName = "config_android";
        }
        if (Common.isWinUWP)
        {
            fileName = "config_" + Source.WIN;
        }

        if (ishd)//AppVersion.appForPad
        {
            fileName += "_hd";
        }
        fileName += ".json";

        string json = FileUtil.ReadStringFromResources(strDir + "/" + fileName);//ReadStringAsset

        rootJson = JsonMapper.ToObject(json);

        //appid

        JsonData jsonAppId = rootJson["APPID"];

        foreach (string key in jsonAppId.Keys)
        {
            string value = (string)jsonAppId[key];
            Debug.Log("APPID:key=" + key + " value=" + value);
            ItemInfo iteminfo = new ItemInfo();
            iteminfo.source = key;
            iteminfo.appid  = value;
            listAppStore.Add(iteminfo);
        }



        jsonShare = rootJson["SHARE"];
        jsonPay   = rootJson["PAY"];

        if (listSharePlatform == null)
        {
            listSharePlatform = new List <SharePlatformInfo>();
        }

        JsonData jsonPlatform = jsonShare["platform"];

        foreach (JsonData data in jsonPlatform)
        {
            SharePlatformInfo info = new SharePlatformInfo();
            info.source = (string)data["source"];
            info.appId  = (string)data["id"];
            info.appKey = (string)data["key"];
            if (info.appId == "0")
            {
                continue;
            }
            listSharePlatform.Add(info);
            if (info.source == Source.WEIXIN)
            {
                //同时添加朋友圈
                AddShareBrother(Source.WEIXINFRIEND, info.appId, info.appKey);
            }

            if (info.source == Source.QQ)
            {
                //同时添加qq空间
                AddShareBrother(Source.QQZONE, info.appId, info.appKey);
            }
        }

        //统一添加email和短信
        AddShareBrother(Source.EMAIL, "0", "0");
        AddShareBrother(Source.SMS, "0", "0");
    }
示例#35
0
        internal void UpdateFrozenContainerInfos(ItemInfo info)
        {
            this.shouldGenerateFrozenContainer = true;
            if (!this.EnableFrozenDecorators)
            {
                return;
            }

            var itemInfo = info;

            // We take the last frozen line for this level
            var frozenInfosToGenerateByLevel = this.frozenDecoratorsToGenerate.Where(c => c.Level == itemInfo.Level);
            var frozenInfosToGenerateBySlot  = frozenInfosToGenerateByLevel.Where(c => c.Slot != itemInfo.Slot);

            if (frozenInfosToGenerateBySlot.Any())
            {
                ItemInfo frozenInfoToGenerate = frozenInfosToGenerateBySlot.First();

                // We take the length of the frozen decorators up to our level.
                double frozenLengthUpToLevel = this.GetFrozenLengthUpToLevel(itemInfo.Level - 1);

                // Take the position of the current decorator (as if not frozen).
                double currentFrozenHeaderOffset = itemInfo.Slot - 1 >= 0 ? this.Layout.PhysicalOffsetFromSlot(itemInfo.Slot - 1) : 0;

                // We should generate another frozen decorator if the current one will push the previous frozen frozen decorator or if we haven't done so.
                bool lastFrozenDecoratorIsHidden = currentFrozenHeaderOffset - this.Owner.ScrollOffset < frozenLengthUpToLevel;

                if (lastFrozenDecoratorIsHidden)
                {
                    this.frozenDecoratorsToGenerate.Remove(itemInfo);
                }

                this.shouldGenerateFrozenContainer = !frozenInfosToGenerateByLevel.Any() || lastFrozenDecoratorIsHidden;
            }

            if (this.shouldGenerateFrozenContainer && itemInfo.ItemType == GroupType.Subheading)
            {
                if (!frozenInfosToGenerateByLevel.Any())
                {
                    this.frozenDecoratorsToGenerate.Add(itemInfo);
                }
                else
                {
                    var index = this.frozenDecoratorsToGenerate.IndexOf(frozenInfosToGenerateByLevel.First());

                    // TODO: This is valid for top frozen containers. Revisit if at some point we need frozen containers at bottom.
                    if (itemInfo.Slot > this.frozenDecoratorsToGenerate[index].Slot)
                    {
                        this.frozenDecoratorsToGenerate[index] = itemInfo;
                    }
                }

                double desiredLength;
                List <GeneratedItemModel> generatedContainersForSlot;

                if (this.generatedContainers.TryGetValue(itemInfo.Slot, out generatedContainersForSlot))
                {
                    var generatedContainer = generatedContainersForSlot.Last();
                    desiredLength = this.IsHorizontal ? generatedContainer.DesiredSize.Width : generatedContainer.DesiredSize.Height;
                }
                else
                {
                    desiredLength = this.Layout.PhysicalLengthForSlot(itemInfo.Slot);
                }

                this.frozenDecoratorLengthPerLevel[itemInfo.Level] = desiredLength;
            }
        }
示例#36
0
        private void ShowLableView()
        {
            if (!loadSign)
            {
                return;
            }
            int      showClickCount = 0;
            ItemInfo itemInfo       = BagLogic.GetInstance().bagItems[itemPos];

            ////判断是否可以显示
            if (itemInfo.CanUse != 0)
            {
                ++showClickCount;
                useLabel.gameObject.SetActive(true);
            }
            else
            {
                useLabel.gameObject.SetActive(false);
            }

            //判断拆分是否显示
            if (itemInfo.CurNum > 1)
            {
                ++showClickCount;
                useallLabel.transform.localPosition
                    = new Vector3(useLabel.transform.localPosition.x,
                                  useLabel.transform.localPosition.y - (showClickCount - 1) * space,
                                  useallLabel.transform.localPosition.z);
                useallLabel.gameObject.SetActive(true);

                ++showClickCount;
                partLabel.transform.localPosition
                    = new Vector3(partLabel.transform.localPosition.x,
                                  useLabel.transform.localPosition.y - (showClickCount - 1) * (space),
                                  partLabel.transform.localPosition.z);
                partLabel.gameObject.SetActive(true);
            }
            else
            {
                useallLabel.gameObject.SetActive(false);
                partLabel.gameObject.SetActive(false);
            }


            //判断是否可以出售,丢弃
            //if (itemInfo.CanDrop != 0)
            //{
            ++showClickCount;
            saleLabel.transform.localPosition
                = new Vector3(saleLabel.transform.localPosition.x,
                              useLabel.transform.localPosition.y - (showClickCount - 1) * (space),
                              saleLabel.transform.localPosition.z);
            //}
            //else
            //{
            //    saleLabel.gameObject.SetActive(false);
            //}

            //展示
            ++showClickCount;
            showLabel.transform.localPosition = new Vector3(saleLabel.transform.localPosition.x,
                                                            useLabel.transform.localPosition.y - (showClickCount - 1) * (space),
                                                            saleLabel.transform.localPosition.z);

            //if (itemInfo.CanDrop != 0)
            //{
            ++showClickCount;
            dropLabel.transform.localPosition
                = new Vector3(dropLabel.transform.localPosition.x,
                              useLabel.transform.localPosition.y - (showClickCount - 1) * (space),
                              dropLabel.transform.localPosition.z);
            //}
            //else
            //{
            //    dropLabel.gameObject.SetActive(false);
            //}

            //设置背景大小
            background.width  = useLabel.width;
            background.height = (showClickCount - 1) * useLabel.height + 5;
            background.transform.localPosition = new Vector3(useLabel.transform.localPosition.x
                                                             , useLabel.transform.localPosition.y + space, 0);

            uiPanel.transform.position      = transform.position;
            uiPanel.transform.localPosition = new Vector3(uiPanel.transform.localPosition.x, uiPanel.transform.localPosition.y - 45, transform.transform.localPosition.z);

            Show();
        }
示例#37
0
    void Start()
    {
        GameScene gameSceneScript = new GameScene();

        //Sound
        BGMSESwitch bgm = new BGMSESwitch();

        bgm.StopSEVolume();
        bgm.StopKassenBGMVolume();

        //Taiko
        StartCoroutine("taikoMusic");

        //Kill Prevous BGM
        KillOtherBGM kill = new KillOtherBGM();

        kill.Start();

        //Giveup button
        bool isAttackedFlg = PlayerPrefs.GetBool("isAttackedFlg");

        if (isAttackedFlg)
        {
            GameObject.Find("GiveupBtn").SetActive(false);
        }

        //Auto button
        bool Auto2Flg = PlayerPrefs.GetBool("Auto2Flg");

        if (Auto2Flg)
        {
            GameObject.Find("AutoBtn").transform.FindChild("Num").GetComponent <Text>().text = "2";
            GameObject.Find("AutoBtn").GetComponent <AutoAttack>().speed = 2;
        }

        //Dinamic Map
        activeKuniId  = PlayerPrefs.GetInt("activeKuniId");
        activeStageId = PlayerPrefs.GetInt("activeStageId");
        GameObject wall = Instantiate(wallPrefab);

        wall.name = "wall";
        kaisenWeatherHandling(map);

        //Get Minus Status
        float rainMinusRatio = PlayerPrefs.GetFloat("rainMinusStatus", 0);
        float snowMinusRatio = PlayerPrefs.GetFloat("snowMinusStatus", 0);

        /*Player Setting*/
        int        jinkei      = PlayerPrefs.GetInt("jinkei", 0);
        List <int> myBusyoList = new List <int>();

        if (jinkei == 1)
        {
            soudaisyo = PlayerPrefs.GetInt("soudaisyo1");
            if (PlayerPrefs.HasKey("1map1"))
            {
                int mapId = 1;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map2"))
            {
                int mapId = 2;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map7"))
            {
                int mapId = 7;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map8"))
            {
                int mapId = 8;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map11"))
            {
                int mapId = 11;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map12"))
            {
                int mapId = 12;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map13"))
            {
                int mapId = 13;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map14"))
            {
                int mapId = 14;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map17"))
            {
                int mapId = 17;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map18"))
            {
                int mapId = 18;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map21"))
            {
                int mapId = 21;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("1map22"))
            {
                int mapId = 22;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
        }
        else if (jinkei == 2)
        {
            soudaisyo = PlayerPrefs.GetInt("soudaisyo2");

            if (PlayerPrefs.HasKey("2map3"))
            {
                int mapId = 3;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map4"))
            {
                int mapId = 4;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map5"))
            {
                int mapId = 5;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map7"))
            {
                int mapId = 7;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map8"))
            {
                int mapId = 8;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map11"))
            {
                int mapId = 11;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map12"))
            {
                int mapId = 12;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map17"))
            {
                int mapId = 17;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map18"))
            {
                int mapId = 18;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map23"))
            {
                int mapId = 23;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map24"))
            {
                int mapId = 24;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("2map25"))
            {
                int mapId = 25;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
        }
        else if (jinkei == 3)
        {
            soudaisyo = PlayerPrefs.GetInt("soudaisyo3");

            if (PlayerPrefs.HasKey("3map3"))
            {
                int mapId = 3;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map7"))
            {
                int mapId = 7;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map8"))
            {
                int mapId = 8;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map9"))
            {
                int mapId = 9;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map11"))
            {
                int mapId = 11;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map12"))
            {
                int mapId = 12;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map14"))
            {
                int mapId = 14;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map15"))
            {
                int mapId = 15;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map16"))
            {
                int mapId = 16;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map20"))
            {
                int mapId = 20;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map21"))
            {
                int mapId = 21;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("3map25"))
            {
                int mapId = 25;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
        }
        else if (jinkei == 4)
        {
            soudaisyo = PlayerPrefs.GetInt("soudaisyo4");

            if (PlayerPrefs.HasKey("4map1"))
            {
                int mapId = 1;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map2"))
            {
                int mapId = 2;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map7"))
            {
                int mapId = 7;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map8"))
            {
                int mapId = 8;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map12"))
            {
                int mapId = 12;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map13"))
            {
                int mapId = 13;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map14"))
            {
                int mapId = 14;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map18"))
            {
                int mapId = 18;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map19"))
            {
                int mapId = 19;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map20"))
            {
                int mapId = 20;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map24"))
            {
                int mapId = 24;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
            if (PlayerPrefs.HasKey("4map25"))
            {
                int mapId = 25;
                myBusyoList.Add(getStsAndMakeInstance(jinkei, mapId, rainMinusRatio, snowMinusRatio));
            }
        }

        //Saku
        BusyoInfoGet info     = new BusyoInfoGet();
        StatusGet    sts      = new StatusGet();
        GameObject   content  = GameObject.Find("Content").gameObject;
        string       slotPath = "Prefabs/Saku/Slot";
        Saku         saku     = new Saku();

        foreach (Transform n in content.transform)
        {
            GameObject.Destroy(n.gameObject);
        }

        foreach (int busyoId in myBusyoList)
        {
            List <string> sakuList = new List <string>();
            sakuList = saku.getSakuInfo(busyoId);

            if (saku.getSakuShipFlg(int.Parse(sakuList[0])))
            {
                GameObject slot     = Instantiate(Resources.Load(slotPath)) as GameObject;
                string     sakuPath = "Prefabs/Saku/saku" + sakuList[0];
                GameObject sakuIcon = Instantiate(Resources.Load(sakuPath)) as GameObject;
                sakuIcon.transform.SetParent(slot.transform);
                sakuIcon.transform.localScale            = new Vector2(0.45f, 0.45f);
                sakuIcon.GetComponent <Button>().enabled = false;

                slot.transform.SetParent(content.transform);
                slot.transform.localScale = new Vector2(1, 1);

                slot.GetComponent <Saku>().sakuId     = int.Parse(sakuList[0]);
                slot.GetComponent <Saku>().sakuEffect = int.Parse(sakuList[4]);

                if (sakuList[0] == "3")
                {
                    //hukuhei
                    //Heisyu
                    slot.GetComponent <Saku>().sakuHeisyu = info.getHeisyu(busyoId);
                    //Hei Status
                    string heiId   = "hei" + busyoId.ToString();
                    string chParam = PlayerPrefs.GetString(heiId, "0");
                    if (chParam == "0" || chParam == "")
                    {
                        StatusGet statusScript  = new StatusGet();
                        string    chParamHeisyu = statusScript.getHeisyu(busyoId);
                        chParam = chParamHeisyu + ":1:1:1";
                        PlayerPrefs.SetString(heiId, chParam);
                        PlayerPrefs.Flush();
                    }

                    char[]   delimiterChars = { ':' };
                    string[] ch_list        = chParam.Split(delimiterChars);
                    slot.GetComponent <Saku>().sakuHeiSts  = float.Parse(ch_list[3]);
                    slot.GetComponent <Saku>().sakuBusyoId = busyoId;

                    //Busyo Speed
                    int   sakuBusyoLv = PlayerPrefs.GetInt(busyoId.ToString());
                    float adjSpd      = (float)sts.getSpd(busyoId, sakuBusyoLv) / 10;
                    slot.GetComponent <Saku>().sakuBusyoSpeed = adjSpd;
                }
            }
        }

        //Nanban
        string        nanbanString = PlayerPrefs.GetString("nanbanItem");
        List <string> nanbanList   = new List <string>();

        char[] delimiterChars3 = { ',' };
        nanbanList = new List <string>(nanbanString.Split(delimiterChars3));

        for (int i = 0; i < nanbanList.Count; i++)
        {
            int qty = int.Parse(nanbanList[i]);
            if (qty != 0)
            {
                if (i == 0 || i == 1)
                {
                    GameObject slot = Instantiate(Resources.Load(slotPath)) as GameObject;

                    string nanbanPath = "";
                    if (i == 0)
                    {
                        nanbanPath = "Prefabs/Saku/saku8";
                    }
                    else if (i == 1)
                    {
                        nanbanPath = "Prefabs/Saku/saku9";
                    }

                    GameObject sakuIcon = Instantiate(Resources.Load(nanbanPath)) as GameObject;
                    sakuIcon.transform.SetParent(slot.transform);
                    sakuIcon.transform.localScale            = new Vector2(0.45f, 0.45f);
                    sakuIcon.GetComponent <Button>().enabled = false;

                    slot.transform.SetParent(content.transform);
                    slot.transform.localScale = new Vector2(1, 1);

                    if (i == 0)
                    {
                        slot.GetComponent <Saku>().sakuId = 8;
                    }
                    else if (i == 1)
                    {
                        slot.GetComponent <Saku>().sakuId = 9;
                    }
                    else if (i == 2)
                    {
                        slot.GetComponent <Saku>().sakuId = 10;
                    }

                    int      temp   = i + 1;
                    ItemInfo item   = new ItemInfo();
                    string   itemCd = "nanban" + temp.ToString();
                    int      effect = item.getItemEffect(itemCd);
                    slot.GetComponent <Saku>().sakuEffect = effect;
                }
            }
        }


        /*エネミー配置*/
        int linkNo = PlayerPrefs.GetInt("activeLink", 0);

        enemySoudaisyo = PlayerPrefs.GetInt("enemySoudaisyo");

        if (PlayerPrefs.HasKey("emap1"))
        {
            int mapId = 1;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap2"))
        {
            int mapId = 2;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap3"))
        {
            int mapId = 3;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap4"))
        {
            int mapId = 4;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap5"))
        {
            int mapId = 5;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap6"))
        {
            int mapId = 6;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap7"))
        {
            int mapId = 7;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap8"))
        {
            int mapId = 8;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap9"))
        {
            int mapId = 9;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap10"))
        {
            int mapId = 10;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap11"))
        {
            int mapId = 11;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap12"))
        {
            int mapId = 12;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap13"))
        {
            int mapId = 13;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap14"))
        {
            int mapId = 14;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap15"))
        {
            int mapId = 15;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap16"))
        {
            int mapId = 16;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap17"))
        {
            int mapId = 17;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap18"))
        {
            int mapId = 18;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap19"))
        {
            int mapId = 19;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap20"))
        {
            int mapId = 20;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap21"))
        {
            int mapId = 21;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap22"))
        {
            int mapId = 22;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap23"))
        {
            int mapId = 23;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap24"))
        {
            int mapId = 24;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }
        if (PlayerPrefs.HasKey("emap25"))
        {
            int mapId = 25;
            getEnemyStsAndMakeInstance(linkNo, mapId, rainMinusRatio, snowMinusRatio);
        }

        /*Dynamic Enemy Setting Finish*/
        //合戦開始エフェクト
        string     pathBack = "Prefabs/PreKassen/backGround";
        GameObject back     = Instantiate(Resources.Load(pathBack)) as GameObject;

        back.transform.localScale = new Vector2(30, 15);

        string     pathLight = "Prefabs/PreKassen/lightning";
        GameObject light     = Instantiate(Resources.Load(pathLight)) as GameObject;

        light.transform.localScale = new Vector2(10, 10);
    }
示例#38
0
文件: Player.cs 项目: sherr-99/YMMD
    private void Update()
    {
        // freeze player when playing dialogue
        if (InkDialogueManager.GetInstance().dialogueIsPlaying)
        {
            actionFreeze = true;
            animator.SetBool("isWalking", false);
        }
        else
        {
            actionFreeze = false;
        }

        if (!actionFreeze)
        {
            horizontalInput = Input.GetAxisRaw("Horizontal");
            if (animator != null)
            {
                if (Mathf.Abs(horizontalInput) > 0.01f)
                {
                    animator.SetBool("isWalking", true);
                }
                else
                {
                    animator.SetBool("isWalking", false);
                }
            }

            if (horizontalInput < 0 && !sprite.flipX)
            {
                sprite.flipX = true;
            }
            if (horizontalInput > 0 && sprite.flipX)
            {
                sprite.flipX = false;
            }


            if (Input.GetKeyDown(KeyCode.I))
            {
                showInventory = !showInventory;
                uiInventory.gameObject.SetActive(showInventory);
            }
            if (enterInteractable && !InkDialogueManager.GetInstance().dialogueIsPlaying)
            {
                if (Input.GetKeyDown(KeyCode.E))
                {
                    if (interactItem)
                    {
                        interactItem.TriggerDialogue();

                        if (interactItem.destroyOnInteract)
                        {
                            interactItem.DestroySelf();
                        }
                        //interactItem.SetInteractable(false);// disable object after interation
                        interactItem      = null;
                        enterInteractable = false;
                    }

                    uiManager.HideInteractPrompt();
                }
            }
        }
    }
示例#39
0
        public int HandlePacket(GameClient client, GSPacketIn packet)
        {
            AASInfo aASInfo = new AASInfo();

            aASInfo.UserID = client.Player.PlayerCharacter.ID;
            bool flag  = false;
            bool flag2 = packet.ReadBoolean();
            bool flag3;

            if (flag2)
            {
                aASInfo.Name     = "";
                aASInfo.IDNumber = "";
                aASInfo.State    = 0;
                flag3            = true;
            }
            else
            {
                aASInfo.Name     = packet.ReadString();
                aASInfo.IDNumber = packet.ReadString();
                flag3            = this.CheckIDNumber(aASInfo.IDNumber);
                if (aASInfo.IDNumber != "")
                {
                    client.Player.IsAASInfo = true;
                    int num   = Convert.ToInt32(aASInfo.IDNumber.Substring(6, 4));
                    int value = Convert.ToInt32(aASInfo.IDNumber.Substring(10, 2));
                    if (DateTime.Now.Year.CompareTo(num + 18) > 0 || (DateTime.Now.Year.CompareTo(num + 18) == 0 && DateTime.Now.Month.CompareTo(value) >= 0))
                    {
                        client.Player.IsMinor = false;
                    }
                }
                if (aASInfo.Name != "" && flag3)
                {
                    aASInfo.State = 1;
                }
                else
                {
                    aASInfo.State = 0;
                }
            }
            if (flag3)
            {
                client.Out.SendAASState(false);
                using (ProduceBussiness produceBussiness = new ProduceBussiness())
                {
                    flag = produceBussiness.AddAASInfo(aASInfo);
                    client.Out.SendAASInfoSet(flag);
                }
            }
            if (flag && aASInfo.State == 1)
            {
                ItemTemplateInfo itemTemplateInfo = ItemMgr.FindItemTemplate(11019);
                if (itemTemplateInfo != null)
                {
                    ItemInfo itemInfo = ItemInfo.CreateFromTemplate(itemTemplateInfo, 1, 107);
                    if (itemInfo != null)
                    {
                        itemInfo.IsBinds = true;
                        AbstractInventory itemInventory = client.Player.GetItemInventory(itemInfo.Template);
                        if (itemInventory.AddItem(itemInfo, itemInventory.BeginSlot))
                        {
                            client.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("ASSInfoSetHandle.Success", new object[]
                            {
                                itemInfo.Template.Name
                            }));
                        }
                        else
                        {
                            client.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("ASSInfoSetHandle.NoPlace", new object[0]));
                        }
                    }
                }
            }
            return(0);
        }
示例#40
0
 protected abstract FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService);
示例#41
0
    private void LoadItemXML(string sFileName)
    {
        if (ItemInfoMng.Instance.set)
        {
            return;
        }
        //XML파일을 텍스트에셋으로 불러오기
        TextAsset textAsset = (TextAsset)Resources.Load("XML/" + sFileName);
        //불러온 텍스트에셋을 XmlDocument 형식으로 불러오는 작업
        XmlDocument xmlDoc = new XmlDocument();

        xmlDoc.LoadXml(textAsset.text);

        //아이템 노드 리스트 불러오기
        XmlNodeList ItemNodes = xmlDoc.SelectNodes("ItemInfo/Item/Field");

        foreach (XmlNode node in ItemNodes)
        {
            //노드의 내용물 불러와서 아이템 정보에 저장 후 아이템 매니져에 추가하는 작업
            byte id = byte.Parse(node.Attributes.GetNamedItem("id").Value);
            byte.TryParse(node.Attributes.GetNamedItem("id").InnerText, out id);
            string name       = node.Attributes.GetNamedItem("name").InnerText;
            string icon       = node.Attributes.GetNamedItem("icon").InnerText;
            string gameobject = node.Attributes.GetNamedItem("gameobject").InnerText;

            eItemType type = eItemType.Block;

            switch (node.Attributes.GetNamedItem("type").InnerText)
            {
            case "Block":
                type = eItemType.Block;
                break;

            case "Resource":
                type = eItemType.Resource;
                break;

            case "Tool":
                type = eItemType.Tool;
                break;

            case "Equip":
                type = eItemType.Equip;
                break;
            }

            int size = int.Parse(node.Attributes.GetNamedItem("size").InnerText);

            ItemInfo info = new ItemInfo(id, name, icon, type, gameobject, size);
            ItemInfoMng.Instance.AddItem(info);
        }

        //블록 노드 리스트 불러오기
        XmlNodeList BlockNodes = xmlDoc.SelectNodes("ItemInfo/Block/Field");

        foreach (XmlNode node in BlockNodes)
        {
            //노드의 내용물 불러와서 블록 정보에 저장 후 블록 매니져에 추가하는 작업
            byte   id      = byte.Parse(node.Attributes.GetNamedItem("id").InnerText);
            string name    = node.Attributes.GetNamedItem("name").InnerText;
            string texture = node.Attributes.GetNamedItem("texture").InnerText;

            string color = node.Attributes.GetNamedItem("color").InnerText;

            int strength = int.Parse(node.Attributes.GetNamedItem("strength").InnerText);

            BlockInfo info = new BlockInfo(id, name, texture, color, strength);
            BlockInfoMng.Instance.AddBlock(info);
        }
    }
示例#42
0
        /// <summary>
        /// Spawns the property for the given item.
        /// </summary>
        /// <param name="itemLayout">The item layout.</param>
        /// <param name="itemValues">The item values.</param>
        /// <param name="item">The item.</param>
        protected virtual void SpawnProperty(LayoutElementsContainer itemLayout, ValueContainer itemValues, ItemInfo item)
        {
            int labelIndex = 0;

            if ((item.IsReadOnly || item.VisibleIf != null) &&
                itemLayout.Children.Count > 0 &&
                itemLayout.Children[itemLayout.Children.Count - 1] is PropertiesListElement propertiesListElement)
            {
                labelIndex = propertiesListElement.Labels.Count;
            }

            itemLayout.Property(item.DisplayName, itemValues, item.OverrideEditor, item.TooltipText);

            if (item.IsReadOnly && itemLayout.Children.Count > 0)
            {
                PropertiesListElement list  = null;
                int  firstChildControlIndex = 0;
                bool disableSingle          = true;
                var  control = itemLayout.Children[itemLayout.Children.Count - 1];
                if (control is GroupElement group && group.Children.Count > 0)
                {
                    list          = group.Children[0] as PropertiesListElement;
                    disableSingle = false; // Disable all nested editors
                }
                else if (control is PropertiesListElement list1)
                {
                    list = list1;
                    firstChildControlIndex = list.Labels[labelIndex].FirstChildControlIndex;
                }

                if (list != null)
                {
                    // Disable controls added to the editor
                    var count = list.Properties.Children.Count;
                    for (int j = firstChildControlIndex; j < count; j++)
                    {
                        var child = list.Properties.Children[j];
                        if (disableSingle && child is PropertyNameLabel)
                        {
                            break;
                        }

                        if (child != null)
                        {
                            child.Enabled = false;
                        }
                    }
                }
            }
示例#43
0
 protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
 {
     return(directoryService.GetFile(PlaylistXmlSaver.GetSavePath(info.Path, FileSystem)));
 }
示例#44
0
        /// <summary>
        /// Executes a vehicle produce item
        /// </summary>
        private bool produceItem(Player client, Computer computer, VehInfo.Computer.ComputerProduct product, int ammoUsed)
        {       //Are we spawning an item or a vehicle?
            if (product.ProductToCreate > 0)
            {   //Inventory item, get the item type
                ItemInfo item = _server._assets.getItemByID(product.ProductToCreate);
                if (item == null)
                {
                    Log.write(TLog.Error, "Produce item {0} referenced invalid item id #{1}", product.Title, product.ProductToCreate);
                    return(false);
                }

                //Add the appropriate amount of items to the player's inventory
                int itemsCreated = (product.Quantity < 0) ? (ammoUsed * Math.Abs(product.Quantity)) : product.Quantity;

                //Lets check for a team item first
                if (product.Team > 0)
                {
                    //It is, lets add it to the team's inventory
                    if (client._team.inventoryModify(item, itemsCreated))
                    {
                        //Lets notify the team
                        client.sendTeamMessage(0, item.name + " has been added to your team's inventory.");
                        return(true);
                    }
                    else
                    {
                        client.sendMessage(-1, "Unable to add " + item.name + " to the team's inventory.");
                        return(false);
                    }
                }

                //Not for the team, give to the player instead
                if (client.inventoryModify(item, itemsCreated))
                {
                    client.sendMessage(0, item.name + " has been added to your inventory.");
                    return(true);
                }
                else
                {
                    client.sendMessage(-1, "Unable to add " + item.name + " to your inventory.");
                    return(false);
                }
            }
            else if (product.ProductToCreate < 0)
            {   //It's a vehicle! Get the vehicle type
                VehInfo vehInfo = _server._assets.getVehicleByID(-product.ProductToCreate);
                if (vehInfo == null)
                {
                    Log.write(TLog.Error, "Produce item {0} referenced invalid vehicle id #{1}", product.Title, -product.ProductToCreate);
                    return(false);
                }

                //What sort of vehicle is it?
                switch (vehInfo.Type)
                {
                case VehInfo.Types.Computer:
                {
                    //Lets destroy the vehicle being morphed
                    //      Vehicle ve = client._arena._vehicles.getObjByID(computer._id);
                    //       if (ve != null)
                    //          ve.destroy(true);

                    //Spawn new vehicle
                    Vehicle vehicle = newVehicle(vehInfo, client._team, client, client._state);
                    if (vehicle != null)
                    {
                        return(true);
                    }

                    return(false);
                }

                case VehInfo.Types.Car:
                {               //Create the new vehicle next to the player
                    Vehicle vehicle = newVehicle(vehInfo, client._team, client, client._state);

                    //Lets destroy the morphing vehicle
                    //         Vehicle ve = client._arena._vehicles.getObjByID(computer._id);
                    //         if (ve != null)
                    //             ve.destroy(true);

                    //Place him in the vehicle!
                    return(client.enterVehicle(vehicle));
                }

                default:
                    Log.write(TLog.Error, "Produce item {0} attempted to produce invalid vehicle {1}", product.Title, vehInfo.Name);
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
示例#45
0
        private static void Main(string[] args)
        {
            const string zoneStb = "list_zone.stb";

            var itemDataFiles = new ItemInfo[14];

            itemDataFiles[00].set("list_faceitem.stb", "list_faceitem_s.stl");
            itemDataFiles[01].set("list_cap.stb", "list_cap_s.stl");
            itemDataFiles[02].set("list_body.stb", "list_body_s.stl");
            itemDataFiles[03].set("list_arms.stb", "list_arms_s.stl");
            itemDataFiles[04].set("list_foot.stb", "list_foot_s.stl");
            itemDataFiles[05].set("list_back.stb", "list_back_s.stl");
            itemDataFiles[06].set("list_jewel.stb", "list_jewel_s.stl");
            itemDataFiles[07].set("list_weapon.stb", "list_weapon_s.stl");
            itemDataFiles[08].set("list_subwpn.stb", "list_subwpn_s.stl");
            itemDataFiles[09].set("list_useitem.stb", "list_useitem_s.stl");
            itemDataFiles[10].set("list_jemitem.stb", "list_jemitem_s.stl");
            itemDataFiles[11].set("list_natural.stb", "list_natural_s.stl");
            itemDataFiles[12].set("list_questitem.stb", "list_questitem_s.stl");
            itemDataFiles[13].set("list_pat.stb", "list_pat_s.stl");

            (new FileInfo("srv_data\\scripts\\root.lua")).Directory.Create();
            var luaFile = new System.IO.StreamWriter("srv_data\\scripts\\root.lua", false);

            luaFile.Write("include(\"npc_scripts.lua\");\n");
            luaFile.Write("include(\"npc_spawns.lua\");\n");
            luaFile.Close();

            (new FileInfo("srv_data\\scripts\\npc_spawns.lua")).Directory.Create();
            luaFile = new System.IO.StreamWriter("srv_data\\scripts\\npc_spawns.lua", false);
            luaFile.Close();

            (new FileInfo("srv_data\\scripts\\npc_scripts.lua")).Directory.Create();
            luaFile = new System.IO.StreamWriter("srv_data\\scripts\\npc_scripts.lua", false);
            luaFile.Close();

            int typeIdx = 0;
            var sqlFile = new System.IO.StreamWriter("srv_data\\item_db.sql", false);

            sqlFile.Close();

            sqlFile = new System.IO.StreamWriter("srv_data\\skill_db.sql", false);
            sqlFile.Close();
            foreach (var itemDataFile in itemDataFiles)
            {
                var itemData = new ItemData();
                itemData.Load((ItemData.ItemType)(++typeIdx), Globals.stbroot + itemDataFile.DataFile, Globals.stbroot + itemDataFile.StringFile);
            }

            const string skillStb  = "list_skill.stb";
            const string skillStl  = "list_skill_s.stl";
            var          skillFile = new SkillData();

            skillFile.Load(Globals.stbroot + skillStb, Globals.stbroot + skillStl);

            const string npcStb  = "list_npc.stb";
            const string npcStl  = "list_npc_s.stl";
            var          mobFile = new MobData();

            mobFile.Load(Globals.stbroot + npcStb, Globals.stbroot + npcStl);

            var dataFile = new DataFile();

            dataFile.Load(Globals.stbroot + zoneStb);
            for (var i = 1; i < dataFile.RowCount; i++)
            {
                if (!("../" + dataFile[i][2]).Contains(".zon"))
                {
                    continue;
                }

                Console.Write("Attempting to load \"" + dataFile[i][1] + "\" - ");
                var zone = new ZoneData();
                zone.Load("../" + dataFile[i][2], i);
            }

            Console.Write("Done extracting. Press any key to exit...\n");
            Console.ReadLine();
        }
示例#46
0
        private void processSource(bool replaceSource)
        {
            int originalCount = _items.Count;

            if (_sourceReadAndSubscribed)
            {
                Utils.disposeExpressionItemInfos(_itemInfos, _selectorExpressionCallCount, this);
                Utils.removeDownstreamConsumedComputing(_itemInfos, this);

                Utils.disposeSource(
                    _sourceScalar,
                    _source,
                    out _itemInfos,
                    out _sourcePositions,
                    _sourceAsList,
                    handleSourceCollectionChanged,
                    replaceSource);

                _sourceReadAndSubscribed = false;
            }

            if (replaceSource)
            {
                Utils.replaceSource(ref _source, _sourceScalar, _downstreamConsumedComputings, _consumers, this, out _sourceAsList, false);
            }

            if (_source != null && _isActive)
            {
                if (replaceSource)
                {
                    Utils.subscribeSource(
                        _source,
                        ref _sourceAsList,
                        ref _rootSourceWrapper,
                        ref _lastProcessedSourceTickTackVersion,
                        handleSourceCollectionChanged);
                }

                int count = _sourceAsList.Count;

                TSourceItem[] sourceCopy = new TSourceItem[count];
                _sourceAsList.CopyTo(sourceCopy, 0);

                int sourceIndex;
                for (sourceIndex = 0; sourceIndex < count; sourceIndex++)
                {
                    ItemInfo itemInfo = registerSourceItem(sourceCopy[sourceIndex], sourceIndex);

                    if (originalCount > sourceIndex)
                    {
                        _items[sourceIndex] = applySelector(itemInfo, sourceCopy[sourceIndex]);
                    }
                    else
                    {
                        _items.Insert(sourceIndex, applySelector(itemInfo, sourceCopy[sourceIndex]));
                    }
                }

                for (int index = originalCount - 1; index >= sourceIndex; index--)
                {
                    _items.RemoveAt(index);
                }

                _sourceReadAndSubscribed = true;
            }
            else
            {
                _items.Clear();
            }

            reset();
        }
    public Item[] GetItemsOfPreset(BulkSpawnPreset preset, byte flag0 = 0x20)
    {
        List <Item> toRet = new List <Item>();

        switch (preset)
        {
        case BulkSpawnPreset.Music:
            toRet.AddRange(GetItemsOfKind(Kind_Music));
            break;

        case BulkSpawnPreset.DIYRecipesAlphabetical:
            toRet.AddRange(GetDIYRecipes());
            break;

        case BulkSpawnPreset.DIYRecipesSequential:
            toRet.AddRange(GetDIYRecipes(false));
            break;

        case BulkSpawnPreset.Fossils:
            toRet.AddRange(GetItemsOfKind(Kind_Fossil));
            break;

        case BulkSpawnPreset.GenericMaterials:
            toRet.AddRange(GetItemsOfKind(Kind_Ore, Kind_CraftMaterial));
            break;

        case BulkSpawnPreset.SeasonalMaterials:
            toRet.AddRange(GetItemsOfKind(Kind_Vegetable, Kind_Sakurapetal, Kind_ShellDrift, Kind_TreeSeedling, Kind_CraftMaterial, Kind_Mushroom, Kind_AutumnLeaf, Kind_SnowCrystal));
            break;

        case BulkSpawnPreset.RealArt:
            toRet.AddRange(GetItemsOfKind(Kind_Picture, Kind_Sculpture));
            break;

        case BulkSpawnPreset.FakeArt:
            toRet.AddRange(GetItemsOfKind(Kind_PictureFake, Kind_SculptureFake));
            break;

        case BulkSpawnPreset.Bugs:
            toRet.AddRange(GetItemsOfKind(Kind_Insect));
            break;

        case BulkSpawnPreset.Fish:
            toRet.AddRange(GetItemsOfKind(Kind_Fish, Kind_ShellFish, Kind_DiveFish));
            break;

        case BulkSpawnPreset.BugsAndFish:
            toRet.AddRange(GetItemsOfKind(Kind_Fish, Kind_ShellFish, Kind_DiveFish));
            toRet.AddRange(GetItemsOfKind(Kind_Insect));
            break;

        case BulkSpawnPreset.AllPosters:
            toRet.AddRange(GetItemsOfKind(Kind_Poster));
            break;

        case BulkSpawnPreset.VillagerPhotos:
            toRet.AddRange(GetItemsOfKind(Kind_Bromide));
            break;

        case BulkSpawnPreset.InventoryOfApp:
            toRet.AddRange(GetInventoryClone());
            break;

        case BulkSpawnPreset.CustomFile:
            toRet.AddRange(fileLoadedItems);
            break;

        default:
            toRet.Add(new Item(0x09C4));     // tree branch
            break;
        }

        if (preset != BulkSpawnPreset.CustomFile)
        {
            foreach (Item i in toRet)
            {
                i.SystemParam = flag0;

                // try stacking to max
                var kind = ItemInfo.GetItemKind(i);
                if (kind != Kind_DIYRecipe && kind != Kind_MessageBottle && kind != Kind_Fossil)
                {
                    if (ItemInfo.TryGetMaxStackCount(i, out var max))
                    {
                        i.Count = --max;
                    }
                }
            }
        }

        int mul = Multiplier;

        if (mul != 1)
        {
            List <Item> multipliedItemList = new List <Item>();
            foreach (var item in toRet)
            {
                for (int i = 0; i < mul; ++i)
                {
                    multipliedItemList.Add(item); // references are fine, should be copied from
                }
            }
            toRet = multipliedItemList;
        }

        return(toRet.ToArray());
    }
示例#48
0
 protected override FileSystemInfo GetXmlFile(ItemInfo info, IDirectoryService directoryService)
 {
     return MovieNfoSaver.GetMovieSavePaths(info, FileSystem)
         .Select(directoryService.GetFile)
         .FirstOrDefault(i => i != null);
 }
示例#49
0
 public override bool CanUse(User user, ItemInfo info)
 {
     return(false);
 }
        public void GetUserNimbus()
        {
            int i = 0;
            int j = 0;

            for (int k = 0; k < 31; k++)
            {
                ItemInfo item = this.GetItemAt(k);
                if (item != null)
                {
                    if (item.StrengthenLevel >= 1 && item.StrengthenLevel <= 3)
                    {
                        if (item.Template.CategoryID == 1 || item.Template.CategoryID == 5)
                        {
                            i = 1;
                        }
                        if (item.Template.CategoryID == 7)
                        {
                            j = 1;
                        }
                    }
                    else if (item.StrengthenLevel >= 4 && item.StrengthenLevel <= 6)
                    {
                        if (item.Template.CategoryID == 1 || item.Template.CategoryID == 5)
                        {
                            i = 2;
                        }
                        if (item.Template.CategoryID == 7)
                        {
                            j = 2;
                        }
                    }
                    else if (item.StrengthenLevel >= 7 && item.StrengthenLevel <= 9)
                    {
                        if (item.Template.CategoryID == 1 || item.Template.CategoryID == 5)
                        {
                            {
                                i = 3;
                            }
                        }
                        if (item.Template.CategoryID == 7)
                        {
                            {
                                j = 3;
                            }
                        }
                    }
                    else if (item.StrengthenLevel >= 10 && item.StrengthenLevel <= 12)
                    {
                        if (item.Template.CategoryID == 1 || item.Template.CategoryID == 5)
                        {
                            {
                                i = 4;
                            }
                        }
                        if (item.Template.CategoryID == 7)
                        {
                            {
                                j = 4;
                            }
                        }
                    }
                    else if (item.StrengthenLevel >= 13 && item.StrengthenLevel <= 15)
                    {
                        if (item.Template.CategoryID == 1 || item.Template.CategoryID == 5)
                        {
                            {
                                i = 5;
                            }
                        }
                        if (item.Template.CategoryID == 7)
                        {
                            {
                                j = 5;
                            }
                        }
                    }
                    else if (item.StrengthenLevel >= 16 && item.StrengthenLevel <= 18)
                    {
                        if (item.Template.CategoryID == 1 || item.Template.CategoryID == 5)
                        {
                            {
                                i = 6;
                            }
                        }
                        if (item.Template.CategoryID == 7)
                        {
                            {
                                j = 6;
                            }
                        }
                    }
                    else if (item.StrengthenLevel >= 19)
                    {
                        if (item.Template.CategoryID == 1 || item.Template.CategoryID == 5)
                        {
                            {
                                i = 7;
                            }
                        }
                        if (item.Template.CategoryID == 7)
                        {
                            {
                                j = 7;
                            }
                        }
                    }
                }
            }
            this.m_player.PlayerCharacter.Nimbus = i * 100 + j;
            this.m_player.Out.SendUpdatePublicPlayer(this.m_player.PlayerCharacter);
        }
示例#51
0
        /// <summary>
        /// Provides an easy means of routing movement update messages between players
        /// </summary>
        static public void Update_RoutePlayer(Player update, CS_PlayerUpdate pkt, int updateTick, int oldPosX, int oldPosY)
        {               //Prepare the appropriate packets
            SC_PlayerTeamUpdate tu = new SC_PlayerTeamUpdate();

            tu.tickUpdate = updateTick;
            tu.player     = update;
            tu.vehicle    = update.ActiveVehicle;
            tu.itemID     = pkt.itemID;

            tu.activeEquip = pkt.activeEquip;

            SC_PlayerUpdate up = new SC_PlayerUpdate();

            up.tickUpdate = updateTick;
            up.player     = update;
            up.vehicle    = update.ActiveVehicle;
            up.itemID     = pkt.itemID;

            up.activeEquip = pkt.activeEquip;

            //Get the routing audience

            bool itemUpdate        = false;
            bool itemRouteFriendly = false;
            int  weaponRouteRange  = 0;

            if (pkt.itemID != 0)
            {
                itemUpdate = true;
                ItemInfo item = _server._assets.getItemByID(pkt.itemID);
                if (item != null)
                {
                    itemRouteFriendly = item.routeFriendly;
                    item.getRouteRange(out weaponRouteRange);
                }
                else
                {
                    Log.write(TLog.Warning, "Update_RoutePlayer(): item is null");
                }
            }

            List <Player> audience = getRouteList(update._arena, update._state, itemUpdate, weaponRouteRange, update._spectators, oldPosX, oldPosY);

            //Send our updates..
            foreach (Player player in audience)
            {                   //Don't send duplicates
                if (player == update)
                {
                    continue;
                }

                //Are we updating an item?
                if (itemUpdate)
                {
                    //Route friendly?
                    if (itemRouteFriendly)
                    {
                        //Route only to teammates.
                        if (player._team == update._team)
                        {
                            player._client.send(tu);
                        }
                        continue;
                    }
                }

                if (player.IsSpectator || player._team == update._team)
                {
                    player._client.send(tu);
                }
                else
                {
                    player._client.send(up);
                }
            }
        }
 protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
 {
     return(directoryService.GetFile(Path.Combine(info.Path, "album.nfo")));
 }
示例#53
0
        protected virtual async Task <RefreshResult> RefreshWithProviders(TItemType item,
                                                                          TIdType id,
                                                                          MetadataRefreshOptions options,
                                                                          List <IMetadataProvider> providers,
                                                                          ItemImageProvider imageService,
                                                                          CancellationToken cancellationToken)
        {
            var refreshResult = new RefreshResult
            {
                UpdateType = ItemUpdateType.None,
                Providers  = providers.Select(i => i.GetType().FullName.GetMD5()).ToList()
            };

            var customProviders = providers.OfType <ICustomMetadataProvider <TItemType> >().ToList();
            var logName         = item.LocationType == LocationType.Remote ? item.Name ?? item.Path : item.Path ?? item.Name;

            foreach (var provider in customProviders.Where(i => i is IPreRefreshProvider))
            {
                await RunCustomProvider(provider, item, logName, options, refreshResult, cancellationToken).ConfigureAwait(false);
            }

            var temp = CreateNew();

            temp.Path = item.Path;
            var successfulProviderCount = 0;
            var failedProviderCount     = 0;

            // If replacing all metadata, run internet providers first
            if (options.ReplaceAllMetadata)
            {
                var remoteResult = await ExecuteRemoteProviders(item, temp, logName, id, providers.OfType <IRemoteMetadataProvider <TItemType, TIdType> >(), cancellationToken)
                                   .ConfigureAwait(false);

                refreshResult.UpdateType   = refreshResult.UpdateType | remoteResult.UpdateType;
                refreshResult.Status       = remoteResult.Status;
                refreshResult.ErrorMessage = remoteResult.ErrorMessage;
                successfulProviderCount   += remoteResult.Successes;
                failedProviderCount       += remoteResult.Failures;
            }

            var hasLocalMetadata = false;
            var userDataList     = new List <UserItemData>();
            var localProviders   = providers.OfType <ILocalMetadataProvider <TItemType> >().ToList();

            foreach (var provider in localProviders)
            {
                var providerName = provider.GetType().Name;
                Logger.Debug("Running {0} for {1}", providerName, logName);

                var itemInfo = new ItemInfo {
                    Path = item.Path, IsInMixedFolder = item.IsInMixedFolder
                };

                try
                {
                    var localItem = await provider.GetMetadata(itemInfo, options.DirectoryService, cancellationToken).ConfigureAwait(false);

                    if (localItem.HasMetadata)
                    {
                        if (imageService.MergeImages(item, localItem.Images))
                        {
                            refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.ImageUpdate;
                        }

                        userDataList = localItem.UserDataLIst;

                        MergeData(localItem.Item, temp, new List <MetadataFields>(), !options.ReplaceAllMetadata, true);
                        refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataImport;

                        // Only one local provider allowed per item
                        if (IsFullLocalMetadata(localItem.Item))
                        {
                            hasLocalMetadata = true;
                        }
                        successfulProviderCount++;
                        break;
                    }

                    Logger.Debug("{0} returned no metadata for {1}", providerName, logName);
                }
                catch (OperationCanceledException)
                {
                    throw;
                }
                catch (Exception ex)
                {
                    failedProviderCount++;

                    Logger.ErrorException("Error in {0}", ex, provider.Name);

                    // If a local provider fails, consider that a failure
                    refreshResult.Status       = ProviderRefreshStatus.Failure;
                    refreshResult.ErrorMessage = ex.Message;

                    if (options.MetadataRefreshMode != MetadataRefreshMode.FullRefresh)
                    {
                        // If the local provider fails don't continue with remote providers because the user's saved metadata could be lost
                        return(refreshResult);
                    }
                }
            }

            // Local metadata is king - if any is found don't run remote providers
            if (!options.ReplaceAllMetadata && (!hasLocalMetadata || options.MetadataRefreshMode == MetadataRefreshMode.FullRefresh))
            {
                var remoteResult = await ExecuteRemoteProviders(item, temp, logName, id, providers.OfType <IRemoteMetadataProvider <TItemType, TIdType> >(), cancellationToken)
                                   .ConfigureAwait(false);

                refreshResult.UpdateType = refreshResult.UpdateType | remoteResult.UpdateType;
                if (remoteResult.Status != ProviderRefreshStatus.Success)
                {
                    refreshResult.Status       = remoteResult.Status;
                    refreshResult.ErrorMessage = remoteResult.ErrorMessage;
                }
                successfulProviderCount += remoteResult.Successes;
            }

            if (providers.Any(i => !(i is ICustomMetadataProvider)))
            {
                // If no local providers and doing a full refresh, take data from item itself
                if (options.MetadataRefreshMode == MetadataRefreshMode.FullRefresh &&
                    localProviders.Count == 0 &&
                    refreshResult.UpdateType > ItemUpdateType.None)
                {
                    // TODO: If the new metadata from above has some blank data, this can cause old data to get filled into those empty fields
                    MergeData(item, temp, new List <MetadataFields>(), false, true);
                }

                if (refreshResult.UpdateType > ItemUpdateType.None)
                {
                    MergeData(temp, item, item.LockedFields, true, true);
                }
            }

            var isUnidentified = failedProviderCount > 0 && successfulProviderCount == 0;

            if (item.IsUnidentified != isUnidentified)
            {
                item.IsUnidentified      = isUnidentified;
                refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataImport;
            }

            foreach (var provider in customProviders.Where(i => !(i is IPreRefreshProvider)))
            {
                await RunCustomProvider(provider, item, logName, options, refreshResult, cancellationToken).ConfigureAwait(false);
            }

            await ImportUserData(item, userDataList, cancellationToken).ConfigureAwait(false);

            return(refreshResult);
        }
示例#54
0
    IEnumerator SpawnItem(ItemInfo ItemInfo)
    {
        yield return(new WaitForSeconds(spawnDelay));

        Instantiate(itemPrefab, ItemInfo.spawnPosition, Quaternion.identity);
    }
        public static void DoDestroyJunk()
        {
            if (LastUpdate + 2000 < (uint)Environment.TickCount)
            {
                LastUpdate = (uint)Environment.TickCount;
            }
            else
            {
                return;
            }

            WoWSpell mount = null;
            uint     FNBS  = Me.FreeNormalBagSlots;

//            Logging.Write("SpellManager.HasSpell(61425):" + SpellManager.HasSpell(61425));
            if (Mount.CanMount() && ((uint)Environment.TickCount - LastSellTry > 30000) && (FNBS <= 2))
            {
                if (Me.Mounted)         // optional
                {
                    Mount.Dismount();
                    Thread.Sleep(4400); // Gnimo does not disappear instantly
                }
//                if () // Sell to mamoth
                {
                    mount = WoWSpell.FromId(61425);
                    mount.Cast();
                    Thread.Sleep(500);
                    if (Me.IsCasting)
                    {
                        Thread.Sleep(2500);
                        ObjectManager.Update();
                    }
                }
                LastSellTry = (uint)Environment.TickCount;
                if (Me.Mounted)
                {
                    // todo: debug sell procedure
                    IsDone = false; SellDone = false;
                    while (!SellDone && ((uint)Environment.TickCount - LastSellTry < 8000))
                    {
                        Logging.Write("attempting trade..." + (uint)Environment.TickCount);
                        SellDone = InteractAndSell(32639, SellItemActionType.Whites, 0, 0);  // SellItemActionType.Whites
                        Thread.Sleep(1000);
                    }
                }
            }
            else
            {
                List <WoWItem> targetItems = ObjectManager.Me.BagItems;

                uint TotalCount = 0;
                for (int a = targetItems.Count - 1; a >= 0; a--)
                {
                    if (targetItems[a] != null && targetItems[a].IsValid)
                    {
                        ItemInfo       info    = ItemInfo.FromId(targetItems[a].Entry);
                        WoWItemQuality quality = targetItems[a].Quality;

                        if (!ProtectedItems.Contains(targetItems[a].Entry) && (quality == WoWItemQuality.Uncommon && (info.Level < 290) || quality == WoWItemQuality.Common || quality == WoWItemQuality.Poor))
                        {
                            WoWMovement.MoveStop();
                            Logging.Write("[Allrounder] Destroying " + targetItems[a].Entry + " \"" + targetItems[a].Name + "\"...");
                            Lua.DoString("UseItemByName(\"" + targetItems[a].Name + "\")");
//                                Lua.DoString("UseContainerItem({0}, {1})", targetItems[a].BagIndex + 1, targetItems[a].BagSlot + 1);
                            Lua.DoString("PickupContainerItem({0}, {1})", targetItems[a].BagIndex + 1, targetItems[a].BagSlot + 1);
                            Thread.Sleep(900);
                            Lua.DoString("DeleteCursorItem();");
                        }
                    }
                }
            }
        }
示例#56
0
 public void ItemCollectedInfo(ItemInfo ItemInfo)
 {
     StartCoroutine(SpawnItem(ItemInfo));
 }
示例#57
0
 /// <summary>
 /// 丢弃物品,不可用,注册DiscardBagItemCallBack
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="itemInfo"></param>
 private void DiscardItemCallBack(object obj, ItemInfo itemInfo)
 {
     DiscardBagItemCallBack(obj, itemInfo);
     bagCapacity++;
 }
示例#58
0
 internal void AddItemAt(int index, ItemInfo info)
 {
     ContentArray[index] = info;
     LocalUserInfo.Me.ClientCharacter.UpdateProgress(info.Key, info.Stack);
 }
 public void EquipBuffer()
 {
     this.m_player.EquipEffect.Clear();
     for (int i = 0; i < 31; i++)
     {
         ItemInfo item = this.GetItemAt(i);
         if (item != null)
         {
             string[] hole = item.Template.Hole.Split(new char[]
             {
                 '|'
             });
             if (item.Hole1 > 0 && item.StrengthenLevel >= Convert.ToInt32(hole[0].Split(new char[]
             {
                 ','
             })[0]))
             {
                 if (ItemMgr.FindItemTemplate(item.Hole1).Property2 != 3)
                 {
                     this.m_player.EquipEffect.Add(item.Hole1);
                 }
             }
             if (item.Hole2 > 0 && item.StrengthenLevel >= Convert.ToInt32(hole[1].Split(new char[]
             {
                 ','
             })[0]))
             {
                 if (ItemMgr.FindItemTemplate(item.Hole2).Property2 != 3)
                 {
                     this.m_player.EquipEffect.Add(item.Hole2);
                 }
             }
             if (item.Hole3 > 0 && item.StrengthenLevel >= Convert.ToInt32(hole[2].Split(new char[]
             {
                 ','
             })[0]))
             {
                 if (ItemMgr.FindItemTemplate(item.Hole3).Property2 != 3)
                 {
                     this.m_player.EquipEffect.Add(item.Hole3);
                 }
             }
             if (item.Hole4 > 0 && item.StrengthenLevel >= Convert.ToInt32(hole[3].Split(new char[]
             {
                 ','
             })[0]))
             {
                 if (ItemMgr.FindItemTemplate(item.Hole4).Property2 != 3)
                 {
                     this.m_player.EquipEffect.Add(item.Hole4);
                 }
             }
             if (item.Hole5 > 0 && item.StrengthenLevel >= Convert.ToInt32(hole[4].Split(new char[]
             {
                 ','
             })[0]))
             {
                 if (ItemMgr.FindItemTemplate(item.Hole5).Property2 != 3)
                 {
                     this.m_player.EquipEffect.Add(item.Hole5);
                 }
             }
             if (item.Hole6 > 0 && item.StrengthenLevel >= Convert.ToInt32(hole[5].Split(new char[]
             {
                 ','
             })[0]))
             {
                 if (ItemMgr.FindItemTemplate(item.Hole6).Property2 != 3)
                 {
                     this.m_player.EquipEffect.Add(item.Hole6);
                 }
             }
         }
     }
 }
示例#60
0
 protected override FileSystemInfo GetXmlFile(ItemInfo info, IDirectoryService directoryService)
 {
     return(directoryService.GetFile(Path.Combine(info.Path, "playlist.xml")));
 }