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

◆ GetWeaponDamage()

int Terraria.Player.GetWeaponDamage ( Item sItem,
bool forTooltip = false )
inline

Definition at line 53945 of file Player.cs.

53946 {
53948 if (AmmoID.Sets.IsArrow[sItem.useAmmo])
53949 {
53950 modifier = modifier.CombineWith(arrowDamage);
53951 }
53952 if (AmmoID.Sets.IsBullet[sItem.useAmmo])
53953 {
53954 modifier = modifier.CombineWith(bulletDamage);
53955 }
53957 {
53958 modifier = modifier.CombineWith(specialistDamage);
53959 }
53961 float baseDamage = sItem.damage;
53962 if (forTooltip)
53963 {
53965 }
53966 return Math.Max(0, (int)(modifier.ApplyTo(baseDamage) + 5E-06f));
53967 }
static bool[] IsArrow
If true for a given item type (F:Terraria.Item.type), then items of that type are counted as arrows f...
Definition AmmoID.cs:118
static bool[] IsSpecialist
If true for a given item type (F:Terraria.Item.type), then items of that type are counted as speciali...
Definition AmmoID.cs:130
static bool[] IsBullet
If true for a given item type (F:Terraria.Item.type), then items of that type are counted as bullets ...
Definition AmmoID.cs:124
AmmoID entries represent ammo types. Ammo items that share the same AmmoID value assigned to F:Terrar...
Definition AmmoID.cs:11
static float[] ToolTipDamageMultiplier
If != 1f for a given item type (F:Terraria.Item.type), then that item will have the damage in its too...
Definition ItemID.cs:394
static bool[] IsRangedSpecialistWeapon
If true, the item counts as a specialist weapon. Used for Shroomite Helmet damage buffs (and other e...
Definition ItemID.cs:1619
static void ModifyWeaponDamage(Player player, Item item, ref StatModifier damage)
StatModifier GetTotalDamage(DamageClass damageClass)
Calculates a total damage modifier for the player for the provided T:Terraria.ModLoader....
Definition Player.cs:58396
StatModifier arrowDamage
Definition Player.cs:2605
StatModifier bulletDamage
Definition Player.cs:2607
StatModifier specialistDamage
Definition Player.cs:2609

References Terraria.Player.arrowDamage, Terraria.Player.bulletDamage, Terraria.Player.GetTotalDamage(), Terraria.ID.AmmoID.Sets.IsArrow, Terraria.ID.AmmoID.Sets.IsBullet, Terraria.ID.ItemID.Sets.IsRangedSpecialistWeapon, Terraria.ID.AmmoID.Sets.IsSpecialist, Terraria.ModLoader.CombinedHooks.ModifyWeaponDamage(), Terraria.Player.specialistDamage, and Terraria.ID.ItemID.Sets.ToolTipDamageMultiplier.

Referenced by Terraria.Projectile.AI_075(), Terraria.Player.ItemCheck_Inner(), and Terraria.Player.PickAmmo().

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