public void UpdateTeleportVisuals()
{
if ((double)this.teleportTime <= 0.0)
return;
if (this.teleportStyle == 0)
{
if ((double)Main.rand.Next(100) <= 100.0 * (double)this.teleportTime * 2.0)
{
int index = Dust.NewDust(new Vector2((float)this.getRect().X, (float)this.getRect().Y), this.getRect().Width, this.getRect().Height, 159, 0.0f, 0.0f, 0, new Color(), 1f);
Main.dust[index].scale = this.teleportTime * 1.5f;
Main.dust[index].noGravity = true;
Main.dust[index].velocity *= 1.1f;
}
}
else if (this.teleportStyle == 1)
{
if ((double)Main.rand.Next(100) <= 100.0 * (double)this.teleportTime)
{
int index = Dust.NewDust(new Vector2((float)this.getRect().X, (float)this.getRect().Y), this.getRect().Width, this.getRect().Height, 164, 0.0f, 0.0f, 0, new Color(), 1f);
Main.dust[index].scale = this.teleportTime * 1.5f;
Main.dust[index].noGravity = true;
Main.dust[index].velocity *= 1.1f;
}
}
else if (this.teleportStyle == 2)
this.teleportTime = 0.005f;
else if (this.teleportStyle == 3)
this.teleportTime = 0.005f;
else if (this.teleportStyle == 4)
{
this.teleportTime -= 0.02f;
if ((double)Main.rand.Next(100) <= 100.0 * (double)this.teleportTime)
{
Dust dust = Main.dust[Dust.NewDust(this.position, this.width, this.height, 263, 0.0f, 0.0f, 0, new Color(), 1f)];
dust.color = PortalHelper.GetPortalColor(this.lastPortalColorIndex);
dust.noLight = true;
dust.noGravity = true;
dust.scale = 1.2f;
dust.fadeIn = 0.4f;
}
}
this.teleportTime -= 0.005f;
}