Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ItemCheck_ManageRightClickFeatures()

void Terraria.Player.ItemCheck_ManageRightClickFeatures ( )
inline

Definition at line 29284 of file Player.cs.

29285 {
29286 bool flag = selectedItem != 58 && controlUseTile && Main.myPlayer == whoAmI && !tileInteractionHappened && releaseUseItem && !controlUseItem && !mouseInterface && !CaptureManager.Instance.Active && !Main.HoveringOverAnNPC && !Main.SmartInteractShowingGenuine;
29287 bool flag2 = flag;
29288 if (!ItemID.Sets.ItemsThatAllowRepeatedRightClick[inventory[selectedItem].type] && !Main.mouseRightRelease)
29289 {
29290 flag2 = false;
29291 }
29292 if (flag2 && altFunctionUse == 0)
29293 {
29294 for (int i = 0; i < _projectilesToInteractWith.Count; i++)
29295 {
29296 Projectile projectile = Main.projectile[_projectilesToInteractWith[i]];
29297 if (projectile.Hitbox.Contains(Main.MouseWorld.ToPoint()) || Main.SmartInteractProj == projectile.whoAmI)
29298 {
29299 flag = false;
29300 flag2 = false;
29301 break;
29302 }
29303 }
29304 }
29305 if (flag2 && altFunctionUse == 0 && itemTime == 0 && itemAnimation == 0)
29306 {
29307 int num = -1;
29308 int type = 7;
29309 switch (inventory[selectedItem].type)
29310 {
29311 case 5324:
29312 num = 5329;
29313 type = 22;
29314 break;
29315 case 5329:
29316 num = 5330;
29317 type = 22;
29318 break;
29319 case 5330:
29320 num = 5324;
29321 type = 22;
29322 break;
29323 case 4346:
29324 num = 5391;
29325 type = 22;
29326 break;
29327 case 5391:
29328 num = 4346;
29329 type = 22;
29330 break;
29331 case 5325:
29332 num = 4131;
29333 break;
29334 case 4131:
29335 num = 5325;
29336 break;
29337 case 5323:
29338 num = 5455;
29339 break;
29340 case 5455:
29341 num = 5323;
29342 break;
29343 case 4767:
29344 num = 5453;
29345 break;
29346 case 5453:
29347 num = 4767;
29348 break;
29349 case 5309:
29350 num = 5454;
29351 break;
29352 case 5454:
29353 num = 5309;
29354 break;
29355 case 5358:
29356 num = 5360;
29357 type = 22;
29358 break;
29359 case 5360:
29360 num = 5361;
29361 type = 22;
29362 break;
29363 case 5361:
29364 num = 5359;
29365 type = 22;
29366 break;
29367 case 5359:
29368 num = 5358;
29369 type = 22;
29370 break;
29371 case 5437:
29372 num = 5358;
29373 type = 22;
29374 break;
29375 }
29376 if (num != -1)
29377 {
29378 releaseUseTile = false;
29379 Main.mouseRightRelease = false;
29382 Recipe.FindRecipes();
29383 }
29384 }
29385 if (flag2 && altFunctionUse == 0 && inventory[selectedItem].type == 3384)
29386 {
29387 altFunctionUse = 1;
29388 controlUseItem = true;
29389 }
29390 if (flag2 && altFunctionUse == 0 && inventory[selectedItem].type == 3858)
29391 {
29392 altFunctionUse = 1;
29393 controlUseItem = true;
29394 }
29395 if (flag2 && altFunctionUse == 0 && inventory[selectedItem].type == 4673)
29396 {
29397 altFunctionUse = 1;
29398 controlUseItem = true;
29399 }
29400 if (flag2 && altFunctionUse == 0 && inventory[selectedItem].type == 3852 && itemAnimation == 0)
29401 {
29402 altFunctionUse = 1;
29403 controlUseItem = true;
29404 }
29406 {
29407 altFunctionUse = 1;
29408 controlUseItem = true;
29409 }
29411 {
29412 altFunctionUse = 1;
29413 controlUseItem = true;
29414 }
29415 if (!controlUseItem && altFunctionUse == 1)
29416 {
29417 altFunctionUse = 0;
29418 }
29420 }
static void PlaySound(int type, Vector2 position, int style=1)
static bool[] ItemsThatAllowRepeatedRightClick
Definition ItemID.cs:53
static bool[] MinionTargettingFeature
int shoot
Definition Item.cs:235
void ChangeItemType(int to)
Definition Item.cs:46627
void ItemCheck_ManageRightClickFeatures_ShieldRaise(bool theGeneralCheck)
Definition Player.cs:29422
List< int > _projectilesToInteractWith
Definition Player.cs:2695
bool mouseInterface
Definition Player.cs:1137
bool releaseUseTile
Definition Player.cs:1415
bool releaseUseItem
Definition Player.cs:1413
Item[] inventory
Definition Player.cs:1257
bool controlUseTile
Definition Player.cs:1393
bool controlUseItem
Definition Player.cs:1391
bool tileInteractionHappened
Definition Player.cs:1445

References Terraria.Item.ChangeItemType(), Microsoft.Xna.Framework.Rectangle.Contains(), Terraria.Recipe.FindRecipes(), Terraria.Entity.Hitbox, Terraria.ID.ItemID.Sets.ItemsThatAllowRepeatedRightClick, Terraria.ID.ProjectileID.Sets.MinionTargettingFeature, Terraria.Main.mouseRightRelease, Terraria.Main.MouseWorld, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.projectile, Terraria.Item.shoot, Terraria.Main.SmartInteractProj, Terraria.Main.SmartInteractShowingGenuine, Terraria.ID.ProjectileID.Sets.TurretFeature, System.type, Terraria.Item.type, and Terraria.Entity.whoAmI.