private bool ShouldPurchaseItem(ShopPurchase shopPurchase) { var info = Data.ShopItemMap[shopPurchase.ShopItem]; var itemData = info.ItemData; var itemCount = itemData.ItemCount(); // check inventory count if (itemCount >= shopPurchase.MaxCount) { return(false); } if (ConditionParser.FreeItemSlots() == 0 && itemCount == 0) { return(false); } // check cost switch (info.ShopType) { case ShopType.BlueCrafter: if (Memory.Scrips.BlueCrafter < info.Cost) { return(false); } break; case ShopType.RedCrafter: if (Memory.Scrips.RedCrafter < info.Cost) { return(false); } break; case ShopType.BlueGatherer: if (Memory.Scrips.BlueGatherer < info.Cost) { return(false); } break; case ShopType.RedGatherer: if (Memory.Scrips.RedGatherer < info.Cost) { return(false); } break; } return(true); }
private bool ShouldPurchaseItem(ShopPurchase shopPurchase) { if (shopPurchase.IgnoreItem) { return(false); } var info = Data.ShopItemMap[shopPurchase.ShopItem]; var itemData = info.ItemData; var itemCount = itemData.ItemCount(); // check inventory count if (itemCount >= shopPurchase.MaxCount) { return(false); } if (ConditionParser.FreeItemSlots() == 0 && itemCount == 0) { return(false); } // check cost switch (info.ShopJob) { case ShopJob.Crafter: { switch (info.ShopType) { case ShopType.Yellow50: if (Memory.Scrips.YellowCrafter < info.Cost) { return(false); } break; case ShopType.Yellow58: if (Memory.Scrips.YellowCrafter < info.Cost) { return(false); } break; case ShopType.Yellow61: if (Memory.Scrips.YellowCrafter < info.Cost) { return(false); } break; case ShopType.Yellow70: if (Memory.Scrips.YellowCrafter < info.Cost) { return(false); } break; case ShopType.White80: if (Memory.Scrips.WhiteCrafter < info.Cost) { return(false); } break; } } break; case ShopJob.Gatherer: { switch (info.ShopType) { case ShopType.Yellow50: if (Memory.Scrips.YellowGatherer < info.Cost) { return(false); } break; case ShopType.Yellow58: if (Memory.Scrips.YellowGatherer < info.Cost) { return(false); } break; case ShopType.Yellow61: if (Memory.Scrips.YellowGatherer < info.Cost) { return(false); } break; case ShopType.Yellow70: if (Memory.Scrips.YellowGatherer < info.Cost) { return(false); } break; case ShopType.White80: if (Memory.Scrips.WhiteGatherer < info.Cost) { return(false); } break; } } break; } return(true); }