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

◆ BombsHurtPlayers()

void Terraria.Projectile.BombsHurtPlayers ( Rectangle projRectangle,
int j )
inlineprivate

Definition at line 13811 of file Projectile.cs.

13812 {
13813 //IL_00cc: Unknown result type (might be due to invalid IL or missing references)
13814 if (aiStyle != 16 || ProjectileID.Sets.RocketsSkipDamageForPlayers[type] || (timeLeft > 1 && type != 108 && type != 164 && type != 1002) || !Main.player[j].active || Main.player[j].dead || Main.player[j].immune || (ownerHitCheck && !CanHitWithMeleeWeapon(Main.player[j])))
13815 {
13816 return;
13817 }
13818 Rectangle value = default(Rectangle);
13819 ((Rectangle)(ref value))._002Ector((int)Main.player[j].position.X, (int)Main.player[j].position.Y, Main.player[j].width, Main.player[j].height);
13820 if (!((Rectangle)(ref projRectangle)).Intersects(value))
13821 {
13822 return;
13823 }
13824 if (Main.player[j].position.X + (float)(Main.player[j].width / 2) < position.X + (float)(width / 2))
13825 {
13826 direction = -1;
13827 }
13828 else
13829 {
13830 direction = 1;
13831 }
13832 int num = Main.DamageVar(damage, 0f - Main.player[j].luck);
13833 int playerIndex = owner;
13834 bool pvp = true;
13835 if (type == 108 || type == 1002)
13836 {
13837 playerIndex = -1;
13838 pvp = false;
13839 }
13841 {
13842 playerIndex = (int)ai[0];
13843 }
13844 bool dodgeable = IsDamageDodgable();
13846 if (Main.player[j].Hurt(damageSource, num, direction, pvp, quiet: false, Crit: false, -1, dodgeable, ArmorPenetration) > 0.0 && !Main.player[j].dead)
13847 {
13848 StatusPlayer(j);
13849 }
13850 if (trap)
13851 {
13852 Main.player[j].trapDebuffSource = true;
13853 if (Main.player[j].dead)
13854 {
13855 AchievementsHelper.HandleSpecialEvent(Main.player[j], 4);
13856 }
13857 }
13858 }
static PlayerDeathReason ByProjectile(int playerIndex, int projectileIndex)
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
int width
The width of this Entity's hitbox, in pixels.
Definition Entity.cs:46
static void HandleSpecialEvent(Player player, int eventID)
static bool[] RocketsSkipDamageForPlayers
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile,...
static bool[] IsAGravestone
If true for a given projectile type (F:Terraria.Projectile.type), then that projectile handles player...
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
int aiStyle
Selects which vanilla code to use for the AI method. Vanilla projectile AI styles are enumerated in t...
int damage
This will always be set in Projectile.NewProjectile based on the weapons damage and player stat modif...
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
int ArmorPenetration
The number of defense points that this projectile can ignore on its own. Cannot be set to negative va...
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
bool ownerHitCheck
If true, then this projectile will only deal damage if its owner has line of sight to the hit....
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
void StatusPlayer(int i)
bool trap
If true, this projectile was spawned by a trap tile.
bool CanHitWithMeleeWeapon(Entity ent)

References Terraria.Projectile.ai, Terraria.Projectile.aiStyle, Terraria.Projectile.ArmorPenetration, Terraria.DataStructures.PlayerDeathReason.ByProjectile(), Terraria.Projectile.CanHitWithMeleeWeapon(), Terraria.Projectile.damage, Terraria.Main.DamageVar(), Terraria.Entity.direction, Terraria.GameContent.Achievements.AchievementsHelper.HandleSpecialEvent(), Terraria.ID.ProjectileID.Sets.IsAGravestone, Terraria.Projectile.IsDamageDodgable(), Terraria.Projectile.owner, Terraria.Projectile.ownerHitCheck, Terraria.Main.player, Terraria.Entity.position, Terraria.ID.ProjectileID.Sets.RocketsSkipDamageForPlayers, Terraria.Projectile.StatusPlayer(), Terraria.Projectile.timeLeft, Terraria.Projectile.trap, Terraria.Projectile.type, Terraria.Entity.whoAmI, and Terraria.Entity.width.

Referenced by Terraria.Projectile.Damage().

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