public void Update() { if (Main.gamePaused) { return; } position += velocity; if (Main.gameMenu) { if (position.Y > Main.screenPosition.Y + (float)Main.screenHeight + 2000f) { active = false; } } else if (Collision.SolidCollision(position, 2, 2) || position.Y > Main.screenPosition.Y + (float)Main.screenHeight + 100f || Collision.WetCollision(position, 2, 2)) { active = false; if ((float)Main.rand.Next(100) < Main.gfxQuality * 100f) { int num = Dust.NewDust(position - velocity, 2, 2, Dust.dustWater()); Main.dust[num].position.X -= 2f; Main.dust[num].position.Y += 2f; Main.dust[num].alpha = 38; Main.dust[num].velocity *= 0.1f; Main.dust[num].velocity += -velocity * 0.025f; Main.dust[num].velocity.Y -= 2f; Main.dust[num].scale = 0.6f; Main.dust[num].noGravity = true; } } }
public static bool SpreadWater(int x, int y) { if ((double)Vector2.Distance(DelegateMethods.v2_1, new Vector2((float)x, (float)y)) > (double)DelegateMethods.f_1 || !WorldGen.PlaceLiquid(x, y, (byte)0, byte.MaxValue)) { return(false); } Vector2 Position = new Vector2((float)(x * 16), (float)(y * 16)); int Type = Dust.dustWater(); for (int index = 0; index < 3; ++index) { Dust dust1 = Dust.NewDustDirect(Position, 16, 16, Type, 0.0f, 0.0f, 100, Color.Transparent, 2.2f); dust1.noGravity = true; dust1.velocity.Y -= 1.2f; dust1.velocity *= 7f; Dust dust2 = Dust.NewDustDirect(Position, 16, 16, Type, 0.0f, 0.0f, 100, Color.Transparent, 1.3f); dust2.velocity.Y -= 1.2f; dust2.velocity *= 4f; } return(true); }
public void Update() { if (Main.gamePaused) { return; } this.position += this.velocity; if (Main.gameMenu) { if ((double)this.position.Y <= (double)Main.screenPosition.Y + (double)Main.screenHeight + 2000.0) { return; } this.active = false; } else { if (!Collision.SolidCollision(this.position, 2, 2) && (double)this.position.Y <= (double)Main.screenPosition.Y + (double)Main.screenHeight + 100.0 && !Collision.WetCollision(this.position, 2, 2)) { return; } this.active = false; if ((double)Main.rand.Next(100) >= (double)Main.gfxQuality * 100.0) { return; } int index = Dust.NewDust(this.position - this.velocity, 2, 2, Dust.dustWater(), 0.0f, 0.0f, 0, new Color(), 1f); Main.dust[index].position.X -= 2f; Main.dust[index].position.Y += 2f; Main.dust[index].alpha = 38; Main.dust[index].velocity *= 0.1f; Main.dust[index].velocity += -this.velocity * 0.025f; Main.dust[index].velocity.Y -= 2f; Main.dust[index].scale = 0.6f; Main.dust[index].noGravity = true; } }
public static bool SpreadWater(int x, int y) { if (Vector2.Distance(v2_1, new Vector2(x, y)) > f_1) { return(false); } if (WorldGen.PlaceLiquid(x, y, 0, byte.MaxValue)) { Vector2 position = new Vector2(x * 16, y * 16); int type = Dust.dustWater(); for (int i = 0; i < 3; i++) { Dust dust = Dust.NewDustDirect(position, 16, 16, type, 0f, 0f, 100, Color.Transparent, 2.2f); dust.noGravity = true; dust.velocity.Y -= 1.2f; dust.velocity *= 7f; Dust dust2 = Dust.NewDustDirect(position, 16, 16, type, 0f, 0f, 100, Color.Transparent, 1.3f); dust2.velocity.Y -= 1.2f; dust2.velocity *= 4f; } return(true); } return(false); }