1159 {
1160 _ = Main.player[Main.myPlayer];
1161 int result = -1;
1162 switch (context)
1163 {
1164 case 0:
1165 result = 0;
1166 break;
1167 case 1:
1168 if (checkItem.type == 0 || checkItem.type == 71 || checkItem.type == 72 || checkItem.type == 73 || checkItem.type == 74)
1169 {
1170 result = 0;
1171 }
1172 break;
1173 case 2:
1174 if (checkItem.FitsAmmoSlot())
1175 {
1176 result = 0;
1177 }
1178 break;
1179 case 3:
1180 result = 0;
1181 break;
1182 case 4:
1183 case 32:
1184 {
1185 ChestUI.GetContainerUsageInfo(out var _, out var chestinv);
1186 if (!ChestUI.IsBlockedFromTransferIntoChest(checkItem, chestinv))
1187 {
1188 result = 0;
1189 }
1190 break;
1191 }
1192 case 5:
1193 if (checkItem.Prefix(-3) || checkItem.type == 0)
1194 {
1195 result = 0;
1196 }
1197 break;
1198 case 6:
1199 result = 0;
1200 break;
1201 case 7:
1202 if (checkItem.material || checkItem.type == 0)
1203 {
1204 result = 0;
1205 }
1206 break;
1207 case 8:
1208 if (checkItem.type == 0 || (checkItem.headSlot > -1 && slot == 0) || (checkItem.bodySlot > -1 && slot == 1) || (checkItem.legSlot > -1 && slot == 2))
1209 {
1210 result = 1;
1211 }
1212 break;
1213 case 23:
1214 if (checkItem.type == 0 || (checkItem.headSlot > 0 && slot == 0) || (checkItem.bodySlot > 0 && slot == 1) || (checkItem.legSlot > 0 && slot == 2))
1215 {
1216 result = 1;
1217 }
1218 break;
1219 case 26:
1220 if (checkItem.type == 0 || checkItem.headSlot > 0)
1221 {
1222 result = 1;
1223 }
1224 break;
1225 case 9:
1226 if (checkItem.type == 0 || (checkItem.headSlot > -1 && slot == 10) || (checkItem.bodySlot > -1 && slot == 11) || (checkItem.legSlot > -1 && slot == 12))
1227 {
1228 result = 1;
1229 }
1230 break;
1231 case 10:
1232 if (checkItem.type == 0 || (checkItem.accessory && !
AccCheck(Main.LocalPlayer.armor, checkItem, slot)))
1233 {
1234 result = 1;
1235 }
1236 break;
1237 case 24:
1238 if (checkItem.type == 0 || (checkItem.accessory && !
AccCheck(inv, checkItem, slot)))
1239 {
1240 result = 1;
1241 }
1242 break;
1243 case 11:
1244 if (checkItem.type == 0 || (checkItem.accessory && !
AccCheck(Main.LocalPlayer.armor, checkItem, slot)))
1245 {
1246 result = 1;
1247 }
1248 break;
1249 case 12:
1250 case 25:
1251 case 27:
1252 case 33:
1253 result = 2;
1254 break;
1255 case 15:
1256 if (checkItem.type == 0 && inv[slot].type > 0)
1257 {
1258 result = 3;
1259 }
1260 else if (checkItem.type == inv[slot].type && checkItem.type > 0 && checkItem.stack < checkItem.maxStack && inv[slot].stack > 0)
1261 {
1262 result = 3;
1263 }
1264 else if (inv[slot].
type == 0 && checkItem.type > 0 && (checkItem.type < 71 || checkItem.type > 74))
1265 {
1266 result = 4;
1267 }
1268 break;
1269 case 16:
1270 if (checkItem.type == 0 || Main.projHook[checkItem.shoot])
1271 {
1272 result = 1;
1273 }
1274 break;
1275 case 17:
1276 if (checkItem.type == 0 || (checkItem.mountType != -1 && !
MountID.
Sets.
Cart[checkItem.mountType]))
1277 {
1278 result = 1;
1279 }
1280 break;
1281 case 19:
1282 if (checkItem.type == 0 || (checkItem.buffType > 0 && Main.vanityPet[checkItem.buffType] && !Main.lightPet[checkItem.buffType]))
1283 {
1284 result = 1;
1285 }
1286 break;
1287 case 18:
1288 if (checkItem.type == 0 || (checkItem.mountType != -1 &&
MountID.
Sets.
Cart[checkItem.mountType]))
1289 {
1290 result = 1;
1291 }
1292 break;
1293 case 20:
1294 if (checkItem.type == 0 || (checkItem.buffType > 0 && Main.lightPet[checkItem.buffType]))
1295 {
1296 result = 1;
1297 }
1298 break;
1299 case 29:
1300 if (checkItem.type == 0 && inv[slot].type > 0)
1301 {
1302 result = 5;
1303 }
1304 break;
1305 }
1306 if (context == 30)
1307 {
1308 result = 0;
1309 }
1310 return result;
1311 }
static bool AccCheck(Item[] itemCollection, Item item, int slot)