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

◆ OnHit_Inner()

void Terraria.Player.OnHit_Inner ( float x,
float y,
Entity victim )
inlineprivate

Definition at line 7231 of file Player.cs.

7232 {
7233 //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
7234 //IL_00a7: Unknown result type (might be due to invalid IL or missing references)
7235 //IL_024f: Unknown result type (might be due to invalid IL or missing references)
7236 //IL_02ab: Unknown result type (might be due to invalid IL or missing references)
7237 //IL_02b6: Unknown result type (might be due to invalid IL or missing references)
7238 //IL_03f6: Unknown result type (might be due to invalid IL or missing references)
7239 //IL_0401: Unknown result type (might be due to invalid IL or missing references)
7240 //IL_0454: Unknown result type (might be due to invalid IL or missing references)
7241 //IL_0460: Unknown result type (might be due to invalid IL or missing references)
7242 //IL_0466: Unknown result type (might be due to invalid IL or missing references)
7243 //IL_017e: Unknown result type (might be due to invalid IL or missing references)
7244 //IL_0184: Unknown result type (might be due to invalid IL or missing references)
7245 //IL_0189: Unknown result type (might be due to invalid IL or missing references)
7246 //IL_018e: Unknown result type (might be due to invalid IL or missing references)
7247 //IL_04b6: Unknown result type (might be due to invalid IL or missing references)
7248 //IL_04ce: Unknown result type (might be due to invalid IL or missing references)
7249 //IL_01a4: Unknown result type (might be due to invalid IL or missing references)
7250 //IL_01aa: Unknown result type (might be due to invalid IL or missing references)
7251 //IL_01af: Unknown result type (might be due to invalid IL or missing references)
7252 //IL_01b7: Unknown result type (might be due to invalid IL or missing references)
7253 //IL_01c2: Unknown result type (might be due to invalid IL or missing references)
7254 //IL_01cc: Unknown result type (might be due to invalid IL or missing references)
7255 //IL_01d2: Unknown result type (might be due to invalid IL or missing references)
7256 //IL_048b: Unknown result type (might be due to invalid IL or missing references)
7257 //IL_0493: Unknown result type (might be due to invalid IL or missing references)
7258 //IL_0498: Unknown result type (might be due to invalid IL or missing references)
7259 bool flag = victim is NPC && (((NPC)victim).type == 488 || ((NPC)victim).SpawnedFromStatue);
7260 if (titaniumStormCooldown > 0)
7261 {
7262 flag = true;
7263 }
7264 if (victim is NPC)
7265 {
7266 Main.BigBossProgressBar.TryTracking(victim.whoAmI);
7267 }
7268 if (onHitTitaniumStorm && !flag)
7269 {
7271 AddBuff(306, 600);
7272 if (ownedProjectileCounts[908] < 7)
7273 {
7274 ownedProjectileCounts[908]++;
7275 Projectile.NewProjectile(GetProjectileSource_OnHit(victim, 4), base.Center, Vector2.Zero, 908, 50, 15f, whoAmI);
7276 }
7277 }
7278 if (onHitDodge && shadowDodgeTimer == 0)
7279 {
7280 AddBuff(59, 1800);
7281 }
7282 if (onHitRegen)
7283 {
7284 AddBuff(58, 300);
7285 }
7286 if (stardustMinion && victim is NPC)
7287 {
7288 for (int i = 0; i < 1000; i++)
7289 {
7290 Projectile projectile = Main.projectile[i];
7291 if (projectile.active && projectile.owner == whoAmI && projectile.type == 613 && !(projectile.localAI[1] > 0f) && Main.rand.Next(2) == 0)
7292 {
7293 Vector2 vector = new Vector2(x, y) - projectile.Center;
7294 if (((Vector2)(ref vector)).Length() > 0f)
7295 {
7296 ((Vector2)(ref vector)).Normalize();
7297 }
7298 vector *= 20f;
7299 Projectile.NewProjectile(Entity.InheritSource(projectile), projectile.Center.X, projectile.Center.Y, vector.X, vector.Y, 614, projectile.damage / 3, 0f, projectile.owner, 0f, victim.whoAmI);
7300 projectile.localAI[1] = 30 + Main.rand.Next(4) * 10;
7301 }
7302 }
7303 }
7304 if (onHitPetal && petalTimer == 0)
7305 {
7306 petalTimer = 20;
7307 _ = position;
7308 _ = width / 2;
7309 int num20 = direction;
7310 float num12 = Main.screenPosition.X;
7311 if (num20 < 0)
7312 {
7313 num12 += (float)Main.screenWidth;
7314 }
7315 float y2 = Main.screenPosition.Y;
7316 y2 += (float)Main.rand.Next(Main.screenHeight);
7317 Vector2 vector2 = default(Vector2);
7318 ((Vector2)(ref vector2))._002Ector(num12, y2);
7319 float num13 = x - vector2.X;
7320 float num14 = y - vector2.Y;
7321 num13 += (float)Main.rand.Next(-50, 51) * 0.1f;
7322 num14 += (float)Main.rand.Next(-50, 51) * 0.1f;
7323 float num15 = (float)Math.Sqrt(num13 * num13 + num14 * num14);
7324 num15 = 24f / num15;
7325 num13 *= num15;
7326 num14 *= num15;
7327 Projectile.NewProjectile(GetProjectileSource_OnHit(victim, 5), num12, y2, num13, num14, 221, 36, 0f, whoAmI);
7328 }
7329 if (!crystalLeaf || petalTimer != 0)
7330 {
7331 return;
7332 }
7333 Vector2 vector3 = default(Vector2);
7334 for (int j = 0; j < 1000; j++)
7335 {
7336 if (Main.projectile[j].owner != whoAmI || Main.projectile[j].type != 226)
7337 {
7338 continue;
7339 }
7340 petalTimer = 50;
7341 float num16 = 12f;
7342 ((Vector2)(ref vector3))._002Ector(Main.projectile[j].position.X + (float)width * 0.5f, Main.projectile[j].position.Y + (float)height * 0.5f);
7343 float num17 = x - vector3.X;
7344 float num18 = y - vector3.Y;
7345 float num19 = (float)Math.Sqrt(num17 * num17 + num18 * num18);
7346 int num10 = 180;
7347 float num11 = num16 * (float)num10;
7348 if (!(num19 >= num11))
7349 {
7350 num19 = num16 / num19;
7351 num17 *= num19;
7352 num18 *= num19;
7353 Utils.ChaseResults chaseResults = Utils.GetChaseResults(Main.projectile[j].Center, num16 * (float)num10, victim.Center, victim.velocity);
7354 if (chaseResults.InterceptionHappens && chaseResults.InterceptionTime <= 180f)
7355 {
7356 Vector2 val = chaseResults.ChaserVelocity / (float)num10;
7357 num17 = val.X;
7358 num18 = val.Y;
7359 }
7360 Projectile.NewProjectile(GetProjectileSource_SetBonus(6), Main.projectile[j].Center.X - 4f, Main.projectile[j].Center.Y, num17, num18, 227, crystalLeafDamage, crystalLeafKB, whoAmI);
7361 break;
7362 }
7363 }
7364 }
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
int height
The height of this Entity's hitbox, in pixels.
Definition Entity.cs:51
IEntitySource GetProjectileSource_OnHit(Entity victim, int projectileSourceId)
Definition Player.cs:7856
bool onHitTitaniumStorm
Definition Player.cs:1398
static int crystalLeafKB
Definition Player.cs:1047
IEntitySource GetProjectileSource_SetBonus(int projectileSourceId)
Definition Player.cs:7896
bool stardustMinion
Definition Player.cs:1470
int shadowDodgeTimer
Definition Player.cs:1406
int titaniumStormCooldown
Definition Player.cs:1400
static int crystalLeafDamage
Definition Player.cs:1045
void AddBuff(int type, int timeToAdd, bool quiet=true, bool foodHack=false)
Gives the player the provided buff. This accounts for if the player is immune to the buff....
Definition Player.cs:5700
int[] ownedProjectileCounts
Provides efficient access to the number of projectiles of the specified type owned by this player cur...
Definition Player.cs:3105

References Terraria.Entity.active, Terraria.Player.AddBuff(), Terraria.Main.BigBossProgressBar, Terraria.Entity.Center, Terraria.Player.crystalLeaf, Terraria.Player.crystalLeafDamage, Terraria.Player.crystalLeafKB, Terraria.Entity.direction, Terraria.Utils.GetChaseResults(), Terraria.Player.GetProjectileSource_OnHit(), Terraria.Player.GetProjectileSource_SetBonus(), Terraria.Entity.height, Terraria.Entity.InheritSource(), Terraria.Projectile.localAI, Terraria.Projectile.NewProjectile(), Terraria.Enums.NPC, Terraria.Player.onHitDodge, Terraria.Player.onHitPetal, Terraria.Player.onHitRegen, Terraria.Player.onHitTitaniumStorm, Terraria.Player.ownedProjectileCounts, Terraria.Projectile.owner, Terraria.Player.petalTimer, Terraria.Entity.position, Terraria.Main.projectile, Terraria.Main.rand, Terraria.Main.screenHeight, Terraria.Main.screenPosition, Terraria.Main.screenWidth, Terraria.Player.shadowDodgeTimer, Terraria.Player.stardustMinion, Terraria.Player.titaniumStormCooldown, Terraria.Projectile.type, Terraria.Entity.whoAmI, and Terraria.Entity.width.

Referenced by Terraria.Player.OnHit().

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