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

◆ GetLastPrismHue()

float Terraria.Projectile.GetLastPrismHue ( float laserIndex,
ref float laserLuminance,
ref float laserAlphaMultiplier )
inline

Definition at line 18291 of file Projectile.cs.

18292 {
18293 if (Main.player[owner].active)
18294 {
18295 double timeForVisualEffects = Main.timeForVisualEffects;
18296 switch (Main.player[owner].name)
18297 {
18298 case "Cenx":
18299 {
18300 float amount2 = Utils.PingPongFrom01To010(laserIndex / 6f);
18303 return Main.rgbToHsl(Color.Lerp(new Color(0.3f, 1f, 0.2f), Color.HotPink, amount2)).X;
18304 }
18305 case "Crowno":
18306 laserLuminance = MathHelper.Lerp(0.25f, 0.4f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 105.0 * 6.2831854820251465)));
18307 laserAlphaMultiplier = 0.5f;
18308 return MathHelper.Lerp(127f / 180f, 47f / 60f, Utils.Turn01ToCyclic010(laserIndex / 6f));
18309 case "Tsuki":
18310 case "Yoraiz0r":
18311 return 0.92f;
18312 case "Lazure":
18313 return MathHelper.Lerp(8f / 15f, 83f / 90f, Utils.Turn01ToCyclic010(laserIndex / 6f));
18314 case "Jaxrud":
18315 return MathHelper.Lerp(13f / 72f, 0.43611112f, Utils.Turn01ToCyclic010(laserIndex / 6f));
18316 case "Ghostar":
18317 laserLuminance = MathHelper.Lerp(0.4f, 0.7f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 120.0 * 6.2831854820251465)));
18318 laserAlphaMultiplier = 0.3f;
18319 return 0.66f;
18320 case "Devalaous":
18321 return 0.66f + (float)Math.Cos(timeForVisualEffects / 180.0 * 6.2831854820251465) * 0.1f;
18322 case "Leinfors":
18323 return 0.73f + (float)Math.Cos(timeForVisualEffects / 3.0 * 6.2831854820251465) * 0.03f;
18324 case "Aeroblop":
18325 return 0.25f + (float)Math.Cos(timeForVisualEffects / 180.0 * 6.2831854820251465) * 0.1f;
18326 case "Doylee":
18327 return 0.84f + (float)Math.Cos(timeForVisualEffects / 90.0 * 6.2831854820251465) * 0.16f;
18328 case "Darkhalis":
18329 case "Arkhalis":
18330 return 0.75f + (float)Math.Cos(timeForVisualEffects / 180.0 * 6.2831854820251465) * 0.07f;
18331 case "Nike Leon":
18332 return 0.07f + (float)Math.Cos(timeForVisualEffects / 180.0 * 6.2831854820251465) * 0.04f;
18333 case "Suweeka":
18334 return 0.5f + (float)Math.Cos(timeForVisualEffects / 180.0 * 6.2831854820251465) * 0.18f;
18335 case "W1K":
18336 return 0.75f + (float)Math.Cos(timeForVisualEffects / 120.0 * 6.2831854820251465) * 0.05f;
18337 case "Grox The Great":
18338 return 0.41f + (float)Math.Cos(timeForVisualEffects / 120.0 * 6.2831854820251465) * 0.1f;
18339 case "Acamaeda":
18340 return 0.18f + (float)Math.Cos(timeForVisualEffects / 90.0 * 6.2831854820251465) * 0.1f;
18341 case "Alchemystics":
18342 return 0.73f + (float)Math.Cos(timeForVisualEffects / 180.0 * 6.2831854820251465) * 0.18f;
18343 case "Antithesis":
18344 laserLuminance = 0.25f;
18345 laserAlphaMultiplier = 0.4f;
18346 return 0.7f + (float)Math.Cos(timeForVisualEffects / 180.0 * 6.2831854820251465) * 0.05f;
18347 case "Aurora3500":
18348 laserLuminance = MathHelper.Lerp(0f, 0.5f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 105.0 * 6.2831854820251465)));
18349 laserAlphaMultiplier = 0.25f;
18350 return 0.35f;
18351 case "Bame":
18352 {
18353 float amount = Utils.PingPongFrom01To010(laserIndex / 6f);
18356 return Main.rgbToHsl(Color.Lerp(Color.Yellow, new Color(0.2f, 0f, 0.7f), amount)).X;
18357 }
18358 case "Criddle":
18359 return 0.91f + (float)Math.Cos(timeForVisualEffects / 180.0 * 6.2831854820251465) * 0.19f;
18360 case "Darthkitten":
18361 laserLuminance = MathHelper.Lerp(0.4f, 0.9f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 120.0 * 6.2831854820251465)));
18362 laserAlphaMultiplier = 0.3f;
18363 return 1f;
18364 case "darthmorf":
18365 laserLuminance = MathHelper.Lerp(0f, 0.2f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 105.0 * 6.2831854820251465)));
18366 laserAlphaMultiplier = 0.4f;
18367 return 0f;
18368 case "Discipile":
18369 laserLuminance = MathHelper.Lerp(0f, 0.4f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 105.0 * 6.2831854820251465)));
18370 laserAlphaMultiplier = 0.35f;
18371 return 0.55f;
18372 case "Jenosis":
18373 return 0.66f + (float)Math.Cos(timeForVisualEffects / 180.0 * 6.2831854820251465) * 0.08f;
18374 case "Kazzymodus":
18375 laserLuminance = MathHelper.Lerp(0.6f, 0.8f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 90.0 * 6.2831854820251465)));
18376 laserAlphaMultiplier = 0.3f;
18377 return 0.33f;
18378 case "Khaios":
18379 laserLuminance = MathHelper.Lerp(0f, 0.1f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 105.0 * 6.2831854820251465)));
18380 laserAlphaMultiplier = 0.25f;
18381 return 0.35f;
18382 case "Loki":
18383 laserLuminance = MathHelper.Lerp(0f, 0.3f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 5.0 * 6.2831854820251465)));
18384 laserAlphaMultiplier = 0.4f;
18385 return 0f;
18386 case "ManaUser":
18387 return 0.49f + (float)Math.Cos(timeForVisualEffects / 140.0 * 6.2831854820251465) * 0.08f;
18388 case "Mid":
18389 laserLuminance = 0.25f;
18390 laserAlphaMultiplier = 0.4f;
18391 return 0.86f + (float)Math.Cos(timeForVisualEffects / 270.0 * 6.2831854820251465) * 0.13f;
18392 case "Nimbus":
18393 laserLuminance = MathHelper.Lerp(0f, 0.3f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 20.0 * 6.2831854820251465)));
18394 laserAlphaMultiplier = 0.2f;
18395 return 0.75f;
18396 case "ppowersteef":
18397 laserLuminance = MathHelper.Lerp(0.1f, 0.5f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 105.0 * 6.2831854820251465)));
18398 laserAlphaMultiplier = 0.25f;
18399 return 0.6f;
18400 case "RBrandon":
18401 laserLuminance = MathHelper.Lerp(0f, 0.5f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 105.0 * 6.2831854820251465)));
18402 laserAlphaMultiplier = 0.4f;
18403 return 1f;
18404 case "Redigit":
18405 return 0.7f;
18406 case "Serenity":
18407 laserLuminance = MathHelper.Lerp(0.9f, 0.65f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 120.0 * 6.2831854820251465)));
18408 laserAlphaMultiplier = 0.3f;
18409 return 0.85f;
18410 case "Sigma":
18411 return 0.06f + (float)Math.Cos(timeForVisualEffects / 180.0 * 6.2831854820251465) * 0.06f;
18412 case "teiull":
18413 return 0.5f + (float)Math.Cos(timeForVisualEffects / 45.0 * 6.2831854820251465) * 0.3f;
18414 case "Unit One":
18415 return 0.38f + (float)Math.Cos(timeForVisualEffects / 90.0 * 6.2831854820251465) * 0.24f;
18416 case "Vulpes Inculta":
18417 return 0.7f + (float)Math.Cos(timeForVisualEffects / 180.0 * 6.2831854820251465) * 0.05f;
18418 case "Waze3174":
18419 return 0.38f + (float)Math.Cos(timeForVisualEffects / 90.0 * 6.2831854820251465) * 0.24f;
18420 case "Xman101":
18421 laserLuminance = MathHelper.Lerp(0.9f, 0.55f, Utils.GetLerpValue(-1f, 1f, (float)Math.Cos(timeForVisualEffects / 120.0 * 6.2831854820251465)));
18422 laserAlphaMultiplier = 0.2f;
18423 return 0.33f;
18424 case "Zoomo":
18425 return 0.77f;
18426 case "Random":
18427 return Main.rand.NextFloat();
18428 }
18429 }
18430 return (float)(int)laserIndex / 6f;
18431 }
static float Lerp(float value1, float value2, float amount)
Definition MathHelper.cs:53
static float SmoothStep(float value1, float value2, float amount)
Definition MathHelper.cs:63
static double Cos(double d)
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491

References System.Math.Cos(), Terraria.Utils.GetLerpValue(), Microsoft.Xna.Framework.Color.HotPink, Microsoft.Xna.Framework.Color.Lerp(), Microsoft.Xna.Framework.MathHelper.Lerp(), Terraria.Projectile.owner, Terraria.Utils.PingPongFrom01To010(), Terraria.Main.player, Terraria.Main.rand, Terraria.Main.rgbToHsl(), Microsoft.Xna.Framework.MathHelper.SmoothStep(), Terraria.Main.timeForVisualEffects, Terraria.Utils.Turn01ToCyclic010(), and Microsoft.Xna.Framework.Color.Yellow.