public override bool CanUseItem(Player player) { OrchidModPlayer modPlayer = player.GetModPlayer <OrchidModPlayer>(); if (player.altFunctionUse == 2) { return(false); } else { OrchidModGamblerHelper.clearGamblerCards(player, modPlayer); OrchidModGamblerHelper.onRespawnGambler(player, modPlayer); } return(base.CanUseItem(player)); }
public static int getNbGamblerCards(Player player, OrchidModPlayer modPlayer) { if (modPlayer.gamblerCardsItem.Count() != 20) { OrchidModGamblerHelper.clearGamblerCards(player, modPlayer); } int val = 0; for (int i = 0; i < 20; i++) { if (modPlayer.gamblerCardsItem[i].type != 0) { val++; } else { return(val); } } return(val); }