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

◆ ItemCheck_ManageRightClickFeatures()

void Terraria.Player.ItemCheck_ManageRightClickFeatures ( )
inline

Definition at line 29229 of file Player.cs.

29230 {
29231 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
29232 //IL_00ab: Unknown result type (might be due to invalid IL or missing references)
29233 //IL_00af: Unknown result type (might be due to invalid IL or missing references)
29234 //IL_00b4: Unknown result type (might be due to invalid IL or missing references)
29235 bool flag = selectedItem != 58 && controlUseTile && Main.myPlayer == whoAmI && !tileInteractionHappened && releaseUseItem && !controlUseItem && !mouseInterface && !CaptureManager.Instance.Active && !Main.HoveringOverAnNPC && !Main.SmartInteractShowingGenuine;
29236 bool flag2 = flag;
29237 if (!ItemID.Sets.ItemsThatAllowRepeatedRightClick[inventory[selectedItem].type] && !Main.mouseRightRelease)
29238 {
29239 flag2 = false;
29240 }
29241 if (flag2 && altFunctionUse == 0)
29242 {
29243 for (int i = 0; i < _projectilesToInteractWith.Count; i++)
29244 {
29245 Projectile projectile = Main.projectile[_projectilesToInteractWith[i]];
29246 Rectangle hitbox = projectile.Hitbox;
29247 if (((Rectangle)(ref hitbox)).Contains(Main.MouseWorld.ToPoint()) || Main.SmartInteractProj == projectile.whoAmI)
29248 {
29249 flag = false;
29250 flag2 = false;
29251 break;
29252 }
29253 }
29254 }
29255 if (flag2 && altFunctionUse == 0 && itemTime == 0 && itemAnimation == 0)
29256 {
29257 int num = -1;
29258 int type = 7;
29259 switch (inventory[selectedItem].type)
29260 {
29261 case 5324:
29262 num = 5329;
29263 type = 22;
29264 break;
29265 case 5329:
29266 num = 5330;
29267 type = 22;
29268 break;
29269 case 5330:
29270 num = 5324;
29271 type = 22;
29272 break;
29273 case 4346:
29274 num = 5391;
29275 type = 22;
29276 break;
29277 case 5391:
29278 num = 4346;
29279 type = 22;
29280 break;
29281 case 5325:
29282 num = 4131;
29283 break;
29284 case 4131:
29285 num = 5325;
29286 break;
29287 case 5323:
29288 num = 5455;
29289 break;
29290 case 5455:
29291 num = 5323;
29292 break;
29293 case 4767:
29294 num = 5453;
29295 break;
29296 case 5453:
29297 num = 4767;
29298 break;
29299 case 5309:
29300 num = 5454;
29301 break;
29302 case 5454:
29303 num = 5309;
29304 break;
29305 case 5358:
29306 num = 5360;
29307 type = 22;
29308 break;
29309 case 5360:
29310 num = 5361;
29311 type = 22;
29312 break;
29313 case 5361:
29314 num = 5359;
29315 type = 22;
29316 break;
29317 case 5359:
29318 num = 5358;
29319 type = 22;
29320 break;
29321 case 5437:
29322 num = 5358;
29323 type = 22;
29324 break;
29325 }
29326 if (num != -1)
29327 {
29328 releaseUseTile = false;
29329 Main.mouseRightRelease = false;
29330 SoundEngine.PlaySound(type);
29332 Recipe.FindRecipes();
29333 }
29334 }
29335 if (flag2 && altFunctionUse == 0 && inventory[selectedItem].type == 3384)
29336 {
29337 altFunctionUse = 1;
29338 controlUseItem = true;
29339 }
29340 if (flag2 && altFunctionUse == 0 && inventory[selectedItem].type == 3858)
29341 {
29342 altFunctionUse = 1;
29343 controlUseItem = true;
29344 }
29345 if (flag2 && altFunctionUse == 0 && inventory[selectedItem].type == 4673)
29346 {
29347 altFunctionUse = 1;
29348 controlUseItem = true;
29349 }
29350 if (flag2 && altFunctionUse == 0 && inventory[selectedItem].type == 3852 && itemAnimation == 0)
29351 {
29352 altFunctionUse = 1;
29353 controlUseItem = true;
29354 }
29356 {
29357 altFunctionUse = 1;
29358 controlUseItem = true;
29359 }
29361 {
29362 altFunctionUse = 1;
29363 controlUseItem = true;
29364 }
29366 {
29367 altFunctionUse = 1;
29368 controlUseItem = true;
29369 }
29370 if (!controlUseItem && altFunctionUse == 1)
29371 {
29372 altFunctionUse = 0;
29373 }
29375 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
static bool[] ItemsThatAllowRepeatedRightClick
If true for a given item type (F:Terraria.Item.type), then that item has a right-click features that ...
Definition ItemID.cs:105
static bool[] MinionTargettingFeature
If true for a given projectile type (F:Terraria.Projectile.type), then any item that shoots that proj...
static bool[] TurretFeature
If true for a given projectile type (F:Terraria.Projectile.type), then any item that shoots that proj...
int shoot
The ID of the projectile that is fired by this item on use. Either a T:Terraria.ID....
Definition Item.cs:594
void ChangeItemType(int to)
Definition Item.cs:47874
int type
The Item ID of this item. The Item ID is a unique number assigned to each Item loaded into the game....
Definition Item.cs:345
static bool AltFunctionUse(Item item, Player player)
Calls ModItem.AltFunctionUse, then all GlobalItem.AltFunctionUse hooks, until one of them returns tru...
This serves as the central class from which item-related functions are carried out....
Definition ItemLoader.cs:26
void ItemCheck_ManageRightClickFeatures_ShieldRaise(bool theGeneralCheck)
Definition Player.cs:29377
List< int > _projectilesToInteractWith
Definition Player.cs:3255
bool mouseInterface
Definition Player.cs:1616
bool releaseUseTile
Definition Player.cs:1928
bool releaseUseItem
Definition Player.cs:1926
Item[] inventory
The player's normal inventory. Indexes 0-9 hold the hotbar items, 10-49 the rest of the main inventor...
Definition Player.cs:1767
bool controlUseTile
Definition Player.cs:1906
bool controlUseItem
Definition Player.cs:1904
bool tileInteractionHappened
Definition Player.cs:1958

References Terraria.Player._projectilesToInteractWith, Terraria.ModLoader.ItemLoader.AltFunctionUse(), Terraria.Player.altFunctionUse, Terraria.Item.ChangeItemType(), Terraria.Player.controlUseItem, Terraria.Player.controlUseTile, Terraria.Recipe.FindRecipes(), Terraria.Entity.Hitbox, Terraria.Player.inventory, Terraria.Player.itemAnimation, Terraria.Player.ItemCheck_ManageRightClickFeatures_ShieldRaise(), Terraria.ID.ItemID.Sets.ItemsThatAllowRepeatedRightClick, Terraria.Player.itemTime, Terraria.ID.ProjectileID.Sets.MinionTargettingFeature, Terraria.Player.mouseInterface, Terraria.Main.mouseRightRelease, Terraria.Main.MouseWorld, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.projectile, Terraria.Player.releaseUseItem, Terraria.Player.releaseUseTile, Terraria.Player.selectedItem, Terraria.Item.shoot, Terraria.Main.SmartInteractProj, Terraria.Main.SmartInteractShowingGenuine, Terraria.Player.tileInteractionHappened, Terraria.ID.ProjectileID.Sets.TurretFeature, Terraria.Item.type, and Terraria.Entity.whoAmI.

Referenced by Terraria.Player.Update().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: