private void ShopTerminalBehavior_GenerateNewPickupServer(On.RoR2.ShopTerminalBehavior.orig_GenerateNewPickupServer orig, ShopTerminalBehavior self) { bool tierAvailable = ItemTierAvailable(self.itemTier); if (tierAvailable) { orig(self); } }
void GenerateNewPickupServer(On.RoR2.ShopTerminalBehavior.orig_GenerateNewPickupServer orig, ShopTerminalBehavior shopTerminalBehavior) { List <PickupIndex> shopList = new List <PickupIndex>(); if (shopTerminalBehavior.itemTier == ItemTier.Tier1) { shopList = Run.instance.availableTier1DropList; } else if (shopTerminalBehavior.itemTier == ItemTier.Tier2) { shopList = Run.instance.availableTier2DropList; } else if (shopTerminalBehavior.itemTier == ItemTier.Tier3) { shopList = Run.instance.availableTier3DropList; } else if (shopTerminalBehavior.itemTier == ItemTier.Boss) { shopList = Run.instance.availableBossDropList; } else if (shopTerminalBehavior.itemTier == ItemTier.Lunar) { shopList = Run.instance.availableLunarDropList; } if (shopList.Count > 0) { orig(shopTerminalBehavior); } else { shopTerminalBehavior.SetNoPickup(); RoR2.PurchaseInteraction purchaseInteraction = shopTerminalBehavior.GetComponent <RoR2.PurchaseInteraction>(); if (purchaseInteraction != null) { purchaseInteraction.SetAvailable(false); } } }