/// <summary> /// チェンジのアイテムチェック /// </summary> /// <param name="end">ドラッグの最後の場所</param> private void ExchangeItemCheck(InventoryClassification end) { if (startInventory == end)//同じ { foreach (var datas in cInventoryManager.instance.inventoryList) { if (datas.inventoryType == startInventory) { ExchangeItemData(datas); } } } else { cInventory startData = null, endData = null; foreach (var datas in cInventoryManager.instance.inventoryList) { if (datas.inventoryType == startInventory) { startData = datas; } if (datas.inventoryType == end) { endData = datas; } } ExchangeItemData(startData, endData); } }
private void ExchangeItemData(cInventory startData, cInventory endData = null) { var temp = startData.itemList[currentItemID]; if (endData == null) { startData.itemList[currentItemID] = startData.itemList[checkItemID]; startData.itemList[checkItemID] = temp; } else { startData.itemList[currentItemID] = endData.itemList[checkItemID]; endData.itemList[checkItemID] = temp; } }
public cPlayerInfo(cPlayerInfo pPi, cInventory pInventory) { clothCoupon = new cProperty("clothCoupon", pPi.clothCoupon.value); myWeaponsId = new bool[pPi.myWeaponsId.Length]; for (byte i = 0; i < pPi.myWeaponsId.Length; i++) { myWeaponsId[i] = pPi.myWeaponsId[i]; } curWeaponId = pPi.curWeaponId; myClothesId = new bool[pPi.myClothesId.Length]; for (byte i = 0; i < pPi.myClothesId.Length; i++) { myClothesId[i] = pPi.myClothesId[i]; } curClothId = pPi.curClothId; prevStorePrice = new cJewerly[5]; avStorePrice = new cJewerly[5]; curStorePrice = new cJewerly[5]; for (byte i = 0; i < 5; i++) { prevStorePrice[i] = new cJewerly(pPi.prevStorePrice[i]._name, pPi.prevStorePrice[i].value); avStorePrice[i] = new cJewerly(pPi.avStorePrice[i]._name, pPi.avStorePrice[i].value); curStorePrice[i] = new cJewerly(pPi.curStorePrice[i]._name, pPi.curStorePrice[i].value); } weapon = new cAxe(pPi.weapon); skillLevel = new byte[4]; for (byte i = 0; i < skillLevel.Length; i++) { skillLevel[i] = pPi.skillLevel[i]; } flaged = new bool[15]; for (byte i = 0; i < flaged.Length; i++) { flaged[i] = pPi.flaged[i]; } bossDone = new bool[5]; for (byte i = 0; i < bossDone.Length; i++) { bossDone[i] = pPi.bossDone[i]; } quickSlotItemNum = new short[4]; for (byte i = 0; i < quickSlotItemNum.Length; i++) { quickSlotItemNum[i] = pPi.quickSlotItemNum[i]; } inventory = pInventory; inventory.Init(); this.nickName = pPi.nickName; inventory.GetMoney().value = pPi.money.value; inventory.GetRock().value = pPi.rock.value; inventory.GetDia().value = pPi.dia.value; for (byte i = 0; i < pPi.jewerly.Length; i++) { inventory.GetJewerly()[i].value = pPi.jewerly[i].value; } for (byte i = 0; i < pPi.soul.Length; i++) { inventory.GetSoul()[i].value = pPi.soul[i].value; } if (pPi.item_equip != null) { for (byte i = 0; i < pPi.item_equip.Length; i++) { inventory.GetItemEquip().Add(pPi.item_equip[i]); } } if (pPi.item_use != null) { for (byte i = 0; i < pPi.item_use.Length; i++) { inventory.GetItemUse().Add(pPi.item_use[i]); } } if (pPi.item_etc != null) { for (byte i = 0; i < pPi.item_etc.Length; i++) { inventory.GetItemEtc().Add(pPi.item_etc[i]); } } }
public cPlayerInfo(string pNickName, cAxe pAxe, byte[] pSkillLevel, bool[] pFlaged, bool[] pBossDone, short[] pQuickSlotItemNum, cInventory pInventory, cGold pMoney, cRock pRock, cDia pDia, cJewerly[] pJewerly, cSoul[] pSoul, cJewerly[] pPrevStorePrice, cJewerly[] pAvStorePrice, cJewerly[] pCurStorePrice, cProperty pClothCoupon, bool[] pMyWeaponsId, byte pCurWeaponId, bool[] pMyClothesId, byte pCurClothId, cItem_equip[] pItem_equip = null, cItem_use[] pItem_use = null, cItem_etc[] pItem_etc = null) { clothCoupon = new cProperty("clothCoupon", pClothCoupon.value); myWeaponsId = new bool[pMyWeaponsId.Length]; for (byte i = 0; i < pMyWeaponsId.Length; i++) { myWeaponsId[i] = pMyWeaponsId[i]; } curWeaponId = pCurWeaponId; myClothesId = new bool[pMyClothesId.Length]; for (byte i = 0; i < pMyClothesId.Length; i++) { myClothesId[i] = pMyClothesId[i]; } curClothId = pCurClothId; prevStorePrice = new cJewerly[5]; avStorePrice = new cJewerly[5]; curStorePrice = new cJewerly[5]; for (byte i = 0; i < 5; i++) { prevStorePrice[i] = new cJewerly(pPrevStorePrice[i]._name, pPrevStorePrice[i].value); avStorePrice[i] = new cJewerly(pAvStorePrice[i]._name, pAvStorePrice[i].value); curStorePrice[i] = new cJewerly(pCurStorePrice[i]._name, pCurStorePrice[i].value); } weapon = new cAxe(pAxe); skillLevel = new byte[4]; for (byte i = 0; i < skillLevel.Length; i++) { skillLevel[i] = pSkillLevel[i]; } flaged = new bool[15]; for (byte i = 0; i < flaged.Length; i++) { flaged[i] = pFlaged[i]; } bossDone = new bool[5]; for (byte i = 0; i < bossDone.Length; i++) { bossDone[i] = pBossDone[i]; } quickSlotItemNum = new short[4]; for (byte i = 0; i < quickSlotItemNum.Length; i++) { quickSlotItemNum[i] = pQuickSlotItemNum[i]; } inventory = pInventory; inventory.Init(); nickName = pNickName; inventory.GetMoney().value = pMoney.value; inventory.GetRock().value = pRock.value; inventory.GetDia().value = pDia.value; for (byte i = 0; i < pJewerly.Length; i++) { inventory.GetJewerly()[i].value = pJewerly[i].value; } for (byte i = 0; i < pSoul.Length; i++) { inventory.GetSoul()[i].value = pSoul[i].value; } if (pItem_equip != null) { for (byte i = 0; i < pItem_equip.Length; i++) { inventory.GetItemEquip().Add(pItem_equip[i]); } } if (pItem_use != null) { for (byte i = 0; i < pItem_use.Length; i++) { inventory.GetItemUse().Add(pItem_use[i]); } } if (pItem_etc != null) { for (byte i = 0; i < pItem_use.Length; i++) { inventory.GetItemEtc().Add(pItem_etc[i]); } } }
public override void Init(string pNickName, cProperty pDamage, float pMoveSpeed, cProperty pMaxHp, cProperty pCurHp) { base.Init(pNickName, pDamage, pMoveSpeed, pMaxHp, pCurHp); if (cUtil._sm._scene != SCENE.SKIN) { this.gameObject.tag = "Untagged"; } _animator = this.GetComponent <Animator>(); originObj = this.transform.parent.gameObject; if (cUtil._user != null) { inven = cUtil._user.GetInventory(); } rt = originObj.GetComponent <BoxCollider2D>(); changingGravity = defaultGravity; SetIsGrounded(false); isClimbing = false; isSpeedUp = false; speedUpTime = 0.0f; speedUpAmount = 0.0f; jumpHeight = 200.0f; attackBoxPos[0] = new Vector3(18, 280, -1.1f); attackBoxPos[1] = new Vector3(180, 58, -1.1f); attackBoxPos[2] = new Vector3(60, -128, -1.1f); attackBoxPos[3] = new Vector3(100, 142, -1.1f); attackBox.transform.position = attackBoxPos[0]; weapon.damage = damage; status = CHARACTERSTATUS.NONE; isMoveAttack = false; isFalling = false; if (this.tag.Equals("player_skin")) { //스킬 레벨 //대쉬 byte dashFactor = 50; float dashCooltimeFactor = 0.5f; dashMoveSpeed = maxMoveSpeed + 300 + dashFactor * 0; maxDashCoolDown = 4.0f - dashCooltimeFactor * 0; dashCoolDown = maxDashCoolDown; //시야 byte lightFactor = 100; GameObject.Find("SkinScene").transform.Find("HeadLight").GetComponent <cHeadLight>(). SetLightRange(lightFactor * 0); //차지 계수 //cBtn_attack에서 초기화 //연속공격 doubleAttackPercentage = (byte)(0 + 10 * 0); } else { //스킬 레벨 //대쉬 byte dashFactor = 50; float dashCooltimeFactor = 0.5f; dashMoveSpeed = maxMoveSpeed + 300 + dashFactor * cUtil._user._playerInfo.skillLevel[0]; maxDashCoolDown = 4.0f - dashCooltimeFactor * cUtil._user._playerInfo.skillLevel[0]; dashCoolDown = maxDashCoolDown; //시야 byte lightFactor = 100; GameObject.Find("DungeonNormalScene").transform.Find("HeadLight").GetComponent <cHeadLight>(). SetLightRange(lightFactor * cUtil._user._playerInfo.skillLevel[1]); //차지 계수 //cBtn_attack에서 초기화 //연속공격 doubleAttackPercentage = (byte)(0 + 10 * cUtil._user._playerInfo.skillLevel[3]); //내구도 maxDp = new cProperty("MaxDp", cUtil._user._playerInfo.weapon.indurance.value); curDp = new cProperty("MaxDp", cUtil._user._playerInfo.weapon.indurance.value); SetDp(); } img_weapon.sprite = cUtil._user.WeaponEquipImages[cUtil._user._playerInfo.curWeaponId]; }