| | |
| | |
|
| | | public bool SatisfyReplace(int hole, GatherSoulItem item)
|
| | | {
|
| | | if (item.itemType == GATHERSOUL_ESSENCE_TYPE)
|
| | | {
|
| | | return false;
|
| | | }
|
| | | GatherSoulItem holeItem;
|
| | | if (TryGetItem(hole, out holeItem))
|
| | | {
|
| | | var sameHole = IsSamePropertyCompareHoles(hole, item);
|
| | | var multiProperty = false;
|
| | | if (item.ExistSameProperty(holeItem.id))
|
| | | {
|
| | | multiProperty = gatherSoulPropertys[item.id].Count
|
| | | > gatherSoulPropertys[holeItem.id].Count;
|
| | | }
|
| | | if (item.itemType == holeItem.itemType
|
| | | && IsSamePropertyCompareHoles(hole, item) == -1)
|
| | | && (sameHole == -1 || multiProperty))
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | break;
|
| | | }
|
| | | }
|
| | | if (tryEquipHole != -1)
|
| | | TryExecuteReplaceSoul(tryEquipHole, item);
|
| | | }
|
| | |
|
| | | public void TryExecuteReplaceSoul(int hole, GatherSoulItem item)
|
| | | {
|
| | | if (hole != -1)
|
| | | {
|
| | | GatherSoulItem holeItem;
|
| | | if (TryGetItem(tryEquipHole, out holeItem))
|
| | | if (TryGetItem(hole, out holeItem))
|
| | | {
|
| | | var sameHole = -1;
|
| | | if (gatherSoulPropertys[item.id].Count > gatherSoulPropertys[holeItem.id].Count)
|
| | | {
|
| | | sameHole = IsSamePropertyCompareHoles(tryEquipHole, item);
|
| | | sameHole = IsSamePropertyCompareHoles(hole, item);
|
| | | }
|
| | | if (sameHole != -1)
|
| | | {
|
| | | SendEquipPack((int)PackType.rptInterimPack, sameHole, (int)PackType.rptGatherSoul, 0);
|
| | | }
|
| | | SendEquipPack((int)PackType.rptGatherSoul, item.index, (int)PackType.rptInterimPack, tryEquipHole);
|
| | | SendEquipPack((int)PackType.rptGatherSoul, item.index, (int)PackType.rptInterimPack, hole);
|
| | | }
|
| | | }
|
| | | else if (item.itemType == GATHERSOUL_CORE_TYPE)
|
| | |
| | | {
|
| | | SendEquipPack((int)PackType.rptInterimPack, sameHole, (int)PackType.rptGatherSoul, 0);
|
| | | }
|
| | | SendEquipPack((int)PackType.rptGatherSoul, item.index, (int)PackType.rptInterimPack, tryEquipHole);
|
| | | SendEquipPack((int)PackType.rptGatherSoul, item.index, (int)PackType.rptInterimPack, hole);
|
| | | }
|
| | | }
|
| | | }
|