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

◆ MakeFloorDust()

void Terraria.Player.MakeFloorDust ( bool Falling,
int type,
int paintColor )
inlineprivate

Definition at line 22127 of file Player.cs.

22128 {
22129 //IL_0071: Unknown result type (might be due to invalid IL or missing references)
22130 //IL_0098: Unknown result type (might be due to invalid IL or missing references)
22131 //IL_009d: Unknown result type (might be due to invalid IL or missing references)
22132 //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
22133 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
22134 //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
22135 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
22136 //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
22137 //IL_00e3: Unknown result type (might be due to invalid IL or missing references)
22138 //IL_00ea: Unknown result type (might be due to invalid IL or missing references)
22139 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
22140 //IL_01aa: Unknown result type (might be due to invalid IL or missing references)
22141 //IL_01b6: Unknown result type (might be due to invalid IL or missing references)
22142 //IL_0322: Unknown result type (might be due to invalid IL or missing references)
22143 //IL_0431: Unknown result type (might be due to invalid IL or missing references)
22144 //IL_044b: Unknown result type (might be due to invalid IL or missing references)
22145 //IL_06f2: Unknown result type (might be due to invalid IL or missing references)
22146 //IL_06fc: Unknown result type (might be due to invalid IL or missing references)
22147 //IL_0701: Unknown result type (might be due to invalid IL or missing references)
22148 //IL_061b: Unknown result type (might be due to invalid IL or missing references)
22149 //IL_0625: Unknown result type (might be due to invalid IL or missing references)
22150 //IL_062a: Unknown result type (might be due to invalid IL or missing references)
22151 if (type == 659 || type == 667)
22152 {
22153 bool flag = true;
22154 if (!Falling)
22155 {
22156 float num = Math.Abs(velocity.X) / 3f;
22157 if ((float)Main.rand.Next(100) > num * 50f)
22158 {
22159 flag = false;
22160 }
22161 }
22162 if (!flag)
22163 {
22164 return;
22165 }
22166 Vector2 positionInWorld = new Vector2(position.X, position.Y + (float)height - 2f) + new Vector2((float)width * Main.rand.NextFloat(), 6f * Main.rand.NextFloat());
22167 Vector2 movementVector = Main.rand.NextVector2Circular(0.8f, 0.8f);
22168 if (movementVector.Y > 0f)
22169 {
22170 movementVector.Y *= -1f;
22171 }
22173 {
22174 PositionInWorld = positionInWorld,
22175 MovementVector = movementVector
22176 }, whoAmI);
22177 }
22178 if (!TileLoader.HasWalkDust(type) && type != 147 && type != 25 && type != 53 && type != 189 && type != 0 && type != 123 && type != 57 && type != 112 && type != 116 && type != 196 && type != 193 && type != 195 && type != 197 && type != 199 && type != 229 && type != 234 && type != 371 && type != 460 && type != 666)
22179 {
22180 return;
22181 }
22182 int num2 = 1;
22183 if (Falling)
22184 {
22185 num2 = 20;
22186 if (type == 666)
22187 {
22188 SoundEngine.PlaySound(SoundID.Item177, (int)base.Center.X, (int)base.Bottom.Y);
22189 }
22190 }
22191 for (int i = 0; i < num2; i++)
22192 {
22193 bool flag2 = true;
22194 int num3 = 76;
22195 if (type == 666)
22196 {
22197 if (paintColor != 0)
22198 {
22199 break;
22200 }
22201 num3 = 322;
22202 }
22203 if (type == 53)
22204 {
22205 num3 = 32;
22206 }
22207 if (type == 189)
22208 {
22209 num3 = 16;
22210 }
22211 if (type == 0)
22212 {
22213 num3 = 0;
22214 }
22215 if (type == 123)
22216 {
22217 num3 = 53;
22218 }
22219 if (type == 57)
22220 {
22221 num3 = 36;
22222 }
22223 if (type == 112)
22224 {
22225 num3 = 14;
22226 }
22227 if (type == 234)
22228 {
22229 num3 = 122;
22230 }
22231 if (type == 116)
22232 {
22233 num3 = 51;
22234 }
22235 if (type == 196)
22236 {
22237 num3 = 108;
22238 }
22239 if (type == 193)
22240 {
22241 num3 = 4;
22242 }
22243 if (type == 195 || type == 199)
22244 {
22245 num3 = 5;
22246 }
22247 if (type == 197)
22248 {
22249 num3 = 4;
22250 }
22251 if (type == 229)
22252 {
22253 num3 = 153;
22254 }
22255 if (type == 371)
22256 {
22257 num3 = 243;
22258 }
22259 if (type == 460)
22260 {
22261 num3 = 108;
22262 }
22263 if (type == 25)
22264 {
22265 num3 = 37;
22266 }
22267 if (num3 == 32 && Main.rand.Next(2) == 0)
22268 {
22269 flag2 = false;
22270 }
22271 if (num3 == 14 && Main.rand.Next(2) == 0)
22272 {
22273 flag2 = false;
22274 }
22275 if (num3 == 51 && Main.rand.Next(2) == 0)
22276 {
22277 flag2 = false;
22278 }
22279 if (num3 == 36 && Main.rand.Next(2) == 0)
22280 {
22281 flag2 = false;
22282 }
22283 if (num3 == 0 && Main.rand.Next(3) != 0)
22284 {
22285 flag2 = false;
22286 }
22287 if (num3 == 53 && Main.rand.Next(3) != 0)
22288 {
22289 flag2 = false;
22290 }
22291 Color newColor = default(Color);
22292 if (type == 193)
22293 {
22294 ((Color)(ref newColor))._002Ector(30, 100, 255, 100);
22295 }
22296 if (type == 197)
22297 {
22298 ((Color)(ref newColor))._002Ector(97, 200, 255, 100);
22299 }
22300 if (type == 460)
22301 {
22302 ((Color)(ref newColor))._002Ector(100, 150, 130, 100);
22303 }
22305 if (!Falling)
22306 {
22307 float num4 = Math.Abs(velocity.X) / 3f;
22308 if ((float)Main.rand.Next(100) > num4 * 100f)
22309 {
22310 flag2 = false;
22311 }
22312 }
22313 if (!flag2)
22314 {
22315 continue;
22316 }
22317 float num5 = velocity.X;
22318 if (num5 > 6f)
22319 {
22320 num5 = 6f;
22321 }
22322 if (num5 < -6f)
22323 {
22324 num5 = -6f;
22325 }
22326 if (!(velocity.X != 0f || Falling))
22327 {
22328 continue;
22329 }
22330 int num6 = Dust.NewDust(new Vector2(position.X, position.Y + (float)height - 2f), width, 6, num3, 0f, 0f, 50, newColor);
22331 if (gravDir == -1f)
22332 {
22333 Main.dust[num6].position.Y -= height + 4;
22334 }
22335 if (num3 == 76)
22336 {
22337 Main.dust[num6].scale += (float)Main.rand.Next(3) * 0.1f;
22338 Main.dust[num6].noLight = true;
22339 }
22340 if (num3 == 16 || num3 == 108 || num3 == 153)
22341 {
22342 Main.dust[num6].scale += (float)Main.rand.Next(6) * 0.1f;
22343 }
22344 if (num3 == 37)
22345 {
22346 Main.dust[num6].scale += 0.25f;
22347 Main.dust[num6].alpha = 50;
22348 }
22349 if (num3 == 5)
22350 {
22351 Main.dust[num6].scale += (float)Main.rand.Next(2, 8) * 0.1f;
22352 }
22353 Main.dust[num6].noGravity = true;
22354 if (num3 == 322)
22355 {
22356 if (Main.rand.Next(4) == 0)
22357 {
22358 Main.dust[num6].noGravity = false;
22359 Main.dust[num6].scale *= 1.1f;
22360 }
22361 else
22362 {
22363 Main.dust[num6].scale *= 1.2f;
22364 }
22365 }
22366 if (num2 > 1)
22367 {
22368 Main.dust[num6].velocity.X *= 1.2f;
22369 Main.dust[num6].velocity.Y *= 0.8f;
22370 Main.dust[num6].velocity.Y -= 1f;
22371 Dust obj = Main.dust[num6];
22372 obj.velocity *= 0.8f;
22373 Main.dust[num6].scale += (float)Main.rand.Next(3) * 0.1f;
22374 Main.dust[num6].velocity.X = (Main.dust[num6].position.X - (position.X + (float)(width / 2))) * 0.2f;
22375 if (Main.dust[num6].velocity.Y > 0f)
22376 {
22377 Main.dust[num6].velocity.Y *= -1f;
22378 }
22379 Main.dust[num6].velocity.X += num5 * 0.3f;
22380 }
22381 else
22382 {
22383 Dust obj2 = Main.dust[num6];
22384 obj2.velocity *= 0.2f;
22385 }
22386 Main.dust[num6].position.X -= num5 * 1f;
22387 if (gravDir == -1f)
22388 {
22389 Main.dust[num6].velocity.Y *= -1f;
22390 }
22391 }
22392 }
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 ...
int whoAmI
The index of this Entity within its specific array. These arrays track the entities in the world....
Definition Entity.cs:16
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
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
static void RequestParticleSpawn(bool clientOnly, ParticleOrchestraType type, ParticleOrchestraSettings settings, int? overrideInvokingPlayerIndex=null)
static readonly SoundStyle Item177
Definition SoundID.cs:1031
static void WalkDust(int type, ref int dustType, ref bool makeDust, ref Color color)
static bool HasWalkDust(int type)
This serves as the central class from which tile-related functions are supported and carried out.
Definition TileLoader.cs:23

References Terraria.Main.dust, Terraria.Player.gravDir, Terraria.ModLoader.TileLoader.HasWalkDust(), Terraria.Entity.height, Terraria.ID.SoundID.Item177, Terraria.Dust.NewDust(), Terraria.Audio.SoundEngine.PlaySound(), Terraria.Entity.position, Terraria.Main.rand, Terraria.GameContent.Drawing.ParticleOrchestrator.RequestParticleSpawn(), Terraria.Entity.velocity, Terraria.ModLoader.TileLoader.WalkDust(), Terraria.Entity.whoAmI, and Terraria.Entity.width.

Referenced by Terraria.Player.FloorVisuals().

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