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

◆ AI_138_ExplosiveTrap()

void Terraria.Projectile.AI_138_ExplosiveTrap ( )
inlineprivate

Definition at line 76157 of file Projectile.cs.

76158 {
76159 //IL_0053: Unknown result type (might be due to invalid IL or missing references)
76160 //IL_0105: Unknown result type (might be due to invalid IL or missing references)
76161 //IL_0112: Unknown result type (might be due to invalid IL or missing references)
76162 //IL_0117: Unknown result type (might be due to invalid IL or missing references)
76163 //IL_0120: Unknown result type (might be due to invalid IL or missing references)
76164 //IL_0125: Unknown result type (might be due to invalid IL or missing references)
76165 //IL_012a: Unknown result type (might be due to invalid IL or missing references)
76166 //IL_014a: Unknown result type (might be due to invalid IL or missing references)
76167 //IL_0194: Unknown result type (might be due to invalid IL or missing references)
76168 //IL_01a1: Unknown result type (might be due to invalid IL or missing references)
76169 //IL_01a6: Unknown result type (might be due to invalid IL or missing references)
76170 //IL_01ab: Unknown result type (might be due to invalid IL or missing references)
76171 spriteDirection = (direction = 1);
76172 int num = 694;
76173 int num2 = 48;
76175 switch (type)
76176 {
76177 case 692:
76178 num = 695;
76179 break;
76180 case 693:
76181 num = 696;
76182 break;
76183 }
76184 Lighting.AddLight(base.Center, 0.6f, 0.5f, 0.3f);
76185 if (++frameCounter >= 12)
76186 {
76187 frameCounter = 0;
76188 if (++frame >= Main.projFrames[type])
76189 {
76190 frame = 0;
76191 }
76192 }
76193 if (localAI[0] > 0f)
76194 {
76195 localAI[0] -= 1f;
76196 }
76197 if (localAI[0] <= 0f && owner == Main.myPlayer)
76198 {
76199 localAI[0] = 3f;
76200 bool flag = false;
76201 Rectangle rectangle = Utils.CenteredRectangle(base.Center + new Vector2(0f, (float)(-num2)), new Vector2((float)(num2 * 3)));
76202 for (int i = 0; i < 200; i++)
76203 {
76204 NPC nPC = Main.npc[i];
76205 if (nPC.CanBeChasedBy(this) && ((Rectangle)(ref rectangle)).Intersects(nPC.Hitbox))
76206 {
76207 flag = true;
76208 break;
76209 }
76210 }
76211 if (flag)
76212 {
76215 NewProjectile(GetProjectileSource_FromThis(), base.Center + new Vector2(0f, (float)(-num2)), Vector2.Zero, num, damage, knockBack, owner);
76216 }
76217 }
76218 tileCollide = true;
76219 velocity.Y += 0.2f;
76220 }
static SlotId PlayTrackedSound(in SoundStyle style, Vector2? position=null)
static readonly SoundStyle DD2_ExplosiveTrapExplode
Definition SoundID.cs:61
int owner
The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they...
int damage
This will always be set in Projectile.NewProjectile based on the weapons damage and player stat modif...
IEntitySource GetProjectileSource_FromThis()
float[] localAI
Acts like F:Terraria.Projectile.ai, but does not sync to the server. Many vanilla T:Terraria....
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
float knockBack
This will always be set in Projectile.NewProjectile based on the weapons knockback and player stat mo...
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
bool tileCollide
If true, the projectile will collide with tiles, usually bouncing or killing the tile depending on M:...
static int GetExplosiveTrapCooldown(Player player)
int frameCounter
Used as a timer to decide when to change F:Terraria.Projectile.frame. Defaults to 0.
static int NewProjectile(IEntitySource spawnSource, Vector2 position, Vector2 velocity, int Type, int Damage, float KnockBack, int Owner=-1, float ai0=0f, float ai1=0f, float ai2=0f)
This particular overload uses a Vector2 instead of X and Y to determine the actual spawn position and...

References Terraria.Lighting.AddLight(), Terraria.Utils.CenteredRectangle(), Terraria.ID.SoundID.DD2_ExplosiveTrapExplode, Terraria.Main.myPlayer, Terraria.Main.npc, Terraria.Main.player, Terraria.Audio.SoundEngine.PlayTrackedSound(), and Terraria.Main.projFrames.

+ Here is the call graph for this function: