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

◆ AI_170_FairyGlowstick()

void Terraria.Projectile.AI_170_FairyGlowstick ( )
inlineprivate

Definition at line 48172 of file Projectile.cs.

48173 {
48174 //IL_0001: Unknown result type (might be due to invalid IL or missing references)
48175 //IL_0006: Unknown result type (might be due to invalid IL or missing references)
48176 //IL_000b: Unknown result type (might be due to invalid IL or missing references)
48177 //IL_000c: Unknown result type (might be due to invalid IL or missing references)
48178 //IL_000d: Unknown result type (might be due to invalid IL or missing references)
48179 //IL_0012: Unknown result type (might be due to invalid IL or missing references)
48180 //IL_0016: Unknown result type (might be due to invalid IL or missing references)
48181 //IL_001b: Unknown result type (might be due to invalid IL or missing references)
48182 //IL_003b: Unknown result type (might be due to invalid IL or missing references)
48183 //IL_01aa: Unknown result type (might be due to invalid IL or missing references)
48184 //IL_01b4: Unknown result type (might be due to invalid IL or missing references)
48185 //IL_01b9: Unknown result type (might be due to invalid IL or missing references)
48186 //IL_01d1: Unknown result type (might be due to invalid IL or missing references)
48187 //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
48188 //IL_00de: Unknown result type (might be due to invalid IL or missing references)
48189 //IL_0175: Unknown result type (might be due to invalid IL or missing references)
48190 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)
48191 //IL_0161: Unknown result type (might be due to invalid IL or missing references)
48192 //IL_0189: Unknown result type (might be due to invalid IL or missing references)
48193 //IL_018d: Unknown result type (might be due to invalid IL or missing references)
48194 //IL_0192: Unknown result type (might be due to invalid IL or missing references)
48195 //IL_01a2: Unknown result type (might be due to invalid IL or missing references)
48196 //IL_01a3: Unknown result type (might be due to invalid IL or missing references)
48197 //IL_0105: Unknown result type (might be due to invalid IL or missing references)
48198 //IL_010c: Unknown result type (might be due to invalid IL or missing references)
48199 //IL_0111: Unknown result type (might be due to invalid IL or missing references)
48200 //IL_0116: Unknown result type (might be due to invalid IL or missing references)
48201 //IL_0118: Unknown result type (might be due to invalid IL or missing references)
48202 //IL_011a: Unknown result type (might be due to invalid IL or missing references)
48203 //IL_011f: Unknown result type (might be due to invalid IL or missing references)
48204 //IL_0138: Unknown result type (might be due to invalid IL or missing references)
48205 //IL_013d: Unknown result type (might be due to invalid IL or missing references)
48206 //IL_013f: Unknown result type (might be due to invalid IL or missing references)
48207 //IL_0143: Unknown result type (might be due to invalid IL or missing references)
48208 //IL_0148: Unknown result type (might be due to invalid IL or missing references)
48209 //IL_014a: Unknown result type (might be due to invalid IL or missing references)
48210 //IL_014b: Unknown result type (might be due to invalid IL or missing references)
48211 //IL_014d: Unknown result type (might be due to invalid IL or missing references)
48212 //IL_0152: Unknown result type (might be due to invalid IL or missing references)
48213 Point p = base.Center.ToTileCoordinates();
48214 Vector2 vector = p.ToVector2();
48215 int num = 10;
48216 Vector2 zero = Vector2.Zero;
48217 int num2 = 0;
48218 float num3 = 3f;
48219 if (ai[1] == 1f)
48220 {
48222 rotation = 0f;
48223 velocity.X = 0f;
48224 ai[1] = 2f;
48225 }
48226 frameCounter++;
48227 if (frameCounter > 4)
48228 {
48229 frameCounter = 0;
48230 frame++;
48231 if (frame >= Main.projFrames[type])
48232 {
48233 frame = 0;
48234 }
48235 }
48236 if (((Vector2)(ref velocity)).Length() > 1f && timeLeft % 10 == 0)
48237 {
48238 for (int i = p.X - num; i < p.X + num + 1; i++)
48239 {
48240 for (int j = p.Y - num; j < p.Y + num + 1; j++)
48241 {
48242 if (WorldGen.SolidTile(i, j))
48243 {
48244 Vector2 v = vector - new Vector2((float)i, (float)j);
48245 Vector2 vector2 = v.SafeNormalize(Vector2.Zero) * Math.Max((float)num - ((Vector2)(ref v)).Length(), 0f);
48246 vector2 *= num3;
48247 zero += vector2;
48248 num2++;
48249 }
48250 }
48251 }
48252 if (num2 > 0)
48253 {
48254 zero /= (float)num2;
48255 }
48256 if (((Vector2)(ref zero)).Length() > 1f)
48257 {
48258 velocity = zero;
48259 }
48260 }
48261 velocity *= 0.95f;
48262 if (((Vector2)(ref velocity)).Length() < 1f)
48263 {
48264 velocity = Vector2.Zero;
48265 netUpdate = true;
48266 }
48267 }
static SlotId PlaySound(in SoundStyle? style, Vector2? position=null, SoundUpdateCallback? updateCallback=null)
Attempts to play a sound style with the provided sound style (if it's not null), and returns a valid ...
Vector2 velocity
The velocity of this Entity in world coordinates per tick.
Definition Entity.cs:33
Vector2 position
The position of this Entity in world coordinates.
Definition Entity.cs:28
static readonly SoundStyle Item28
Definition SoundID.cs:733
float[] ai
An array with 3 slots used for any sort of data storage, which is occasionally synced to the server....
bool netUpdate
Set manually to true in M:Terraria.ModLoader.ModProjectile.AI once to make it sync its current F:Terr...
int frame
The frame number in the spritesheet that this projectile will be drawn with. Assign in M:Terraria....
int type
The Projectile ID of this projectile. The Projectile ID is a unique number assigned to each Projectil...
int timeLeft
Time in ticks before this projectile will naturally despawn. Each update timeLeft is decreased by 1...
float rotation
Rotation of the projectile. Radians not Degrees. Use T:Microsoft.Xna.Framework.MathHelper if you want...
int frameCounter
Used as a timer to decide when to change F:Terraria.Projectile.frame. Defaults to 0.

References Terraria.ID.SoundID.Item28, Terraria.Audio.SoundEngine.PlaySound(), Terraria.Main.projFrames, and Terraria.WorldGen.SolidTile().

+ Here is the call graph for this function: