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

◆ ItemCheck_ManageRightClickFeatures_ShieldRaise()

void Terraria.Player.ItemCheck_ManageRightClickFeatures_ShieldRaise ( bool theGeneralCheck)
inline

Definition at line 29422 of file Player.cs.

29423 {
29424 bool mouseRight = PlayerInput.Triggers.JustPressed.MouseRight;
29425 if (whoAmI != Main.myPlayer)
29426 {
29427 mouseRight = shieldRaised;
29429 }
29430 bool shouldGuard = false;
29431 bool flag = inventory[selectedItem].type == 3823 || inventory[selectedItem].type == 4760;
29432 if (theGeneralCheck && flag && hasRaisableShield && !mount.Active && (itemAnimation == 0 || mouseRight))
29433 {
29434 shouldGuard = true;
29435 }
29436 if (shield_parry_cooldown > 0)
29437 {
29439 if (shield_parry_cooldown == 0)
29440 {
29441 SoundEngine.PlaySound(25, base.Center);
29442 for (int i = 0; i < 10; i++)
29443 {
29444 int num = Dust.NewDust(base.Center + new Vector2(direction * 6 + ((direction == -1) ? (-10) : 0), -14f), 10, 16, 45, 0f, 0f, 255, new Color(255, 100, 0, 127), (float)Main.rand.Next(10, 16) * 0.1f);
29445 Main.dust[num].noLight = true;
29446 Main.dust[num].noGravity = true;
29447 Main.dust[num].velocity *= 0.5f;
29448 }
29449 }
29450 }
29451 if (shieldParryTimeLeft > 0 && ++shieldParryTimeLeft > 20)
29452 {
29454 }
29456 }
static void PlaySound(int type, Vector2 position, int style=1)
static TriggersPack Triggers
bool Active
Definition Mount.cs:345
bool hasRaisableShield
Definition Player.cs:2671
int shield_parry_cooldown
Definition Player.cs:2677
int shieldParryTimeLeft
Definition Player.cs:2675
void TryTogglingShield(bool shouldGuard)
Definition Player.cs:29458
Item[] inventory
Definition Player.cs:1257
bool shieldRaised
Definition Player.cs:2673

References Terraria.Main.dust, Terraria.Main.myPlayer, Terraria.Dust.NewDust(), Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.rand, Terraria.GameInput.PlayerInput.Triggers, and Terraria.Item.type.