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

◆ GetAlpha()

Color Terraria.Projectile.GetAlpha ( Color newColor)
inline

Definition at line 67173 of file Projectile.cs.

67174 {
67175 if (type == 920 || type == 921)
67176 {
67177 return Color.Lerp(newColor, Color.White, 0.4f) * Opacity;
67178 }
67179 if (type == 47 && Main.player[owner].wet)
67180 {
67181 return Color.White;
67182 }
67183 if (type == 937)
67184 {
67185 newColor.A = (byte)((float)(int)newColor.A * 0.75f);
67186 }
67187 if (type == 880 || type == 929)
67188 {
67189 newColor.A /= 2;
67190 }
67191 if (type == 963)
67192 {
67193 float num = 0.85f;
67194 newColor *= num;
67195 newColor.A = (byte)((float)(int)newColor.A * num);
67196 if (ai[0] >= 2f)
67197 {
67198 newColor.G = (byte)((float)(int)newColor.G * 0.7f);
67199 newColor.B = (byte)((float)(int)newColor.B * 0.7f);
67200 }
67201 }
67202 if (type == 1021)
67203 {
67204 return Color.White;
67205 }
67206 if (type == 1006)
67207 {
67208 return Color.White;
67209 }
67210 if (type == 981)
67211 {
67212 return Color.White;
67213 }
67214 if (type == 75)
67215 {
67216 return Color.Lerp(newColor, Color.White, 0.66f) * Opacity;
67217 }
67218 int r;
67219 int g;
67220 int b;
67221 if (type == 969)
67222 {
67223 int num2 = 210;
67224 r = (g = (b = num2));
67225 if (newColor.R < num2)
67226 {
67227 r = newColor.R;
67228 }
67229 if (newColor.G < num2)
67230 {
67231 g = newColor.G;
67232 }
67233 if (newColor.B < num2)
67234 {
67235 b = newColor.B;
67236 }
67237 return new Color(r, g, b, 185) * Opacity;
67238 }
67239 if (type == 967)
67240 {
67241 return Color.White * Opacity;
67242 }
67243 if (type == 855)
67244 {
67245 newColor = Color.Lerp(newColor, new Color(255, 200, 60), 0.5f);
67246 }
67247 if (type == 933 || type == 1001)
67248 {
67249 newColor = Color.White * Opacity;
67250 }
67251 if (type == 270)
67252 {
67253 return new Color(255, 255, 255, (int)Utils.WrappedLerp(0f, 255f, (float)(timeLeft % 40) / 40f));
67254 }
67255 if (type == 837)
67256 {
67257 if (alpha > 0)
67258 {
67259 return Color.Transparent;
67260 }
67261 return new Color(255, 255, 255, 200);
67262 }
67263 if (type == 180 || type == 345)
67264 {
67265 return Color.Lerp(newColor, Color.White, 0.75f);
67266 }
67267 if (type == 586)
67268 {
67269 if (ai[2] == 1f)
67270 {
67271 Color value = new Color(newColor.R / 2, 0, newColor.G);
67272 float amount = (float)Math.Sin(ai[0] % 120f * ((float)Math.PI * 2f) / 120f) * 0.5f + 0.5f;
67274 return Color.Lerp(newColor, Color.Lerp(Color.White, value, amount), 0.75f);
67275 }
67276 return Color.Lerp(newColor, Color.White, 0.75f);
67277 }
67278 if (type == 764 || type == 856 || type == 857 || type == 864)
67279 {
67280 return Color.White;
67281 }
67282 if (type == 873 || type == 872 || type == 931 || type == 913 || type == 34)
67283 {
67284 return Color.White * Opacity;
67285 }
67286 if (type == 756 || type == 961)
67287 {
67288 return Color.Lerp(newColor, Color.Black, 0.25f);
67289 }
67290 if (type == 895)
67291 {
67292 return Color.White * Opacity;
67293 }
67294 if (type == 893 || type == 907)
67295 {
67296 return new Color(255, 255, 255, 150);
67297 }
67298 if (type == 833 || type == 834 || type == 835 || type == 912)
67299 {
67300 return Color.Lerp(newColor, Color.White, 0.25f);
67301 }
67302 if (type == 351 || type == 350)
67303 {
67304 Point point = base.Center.ToTileCoordinates();
67305 if (WorldGen.InWorld(point.X, point.Y) && !WorldGen.SolidTile(point.X, point.Y))
67306 {
67307 return Color.Lerp(newColor, Color.White, 0.15f);
67308 }
67309 return Color.Lerp(newColor, Color.White, 0.05f);
67310 }
67311 if (type == 346 || type == 347 || type == 325 || type == 755)
67312 {
67313 return Color.Lerp(newColor, Color.White, 0.75f);
67314 }
67315 if (type == 650)
67316 {
67317 r = (int)((double)(int)newColor.R * 1.5);
67318 g = (int)((double)(int)newColor.G * 1.5);
67319 b = (int)((double)(int)newColor.B * 1.5);
67320 if (r > 255)
67321 {
67322 r = 255;
67323 }
67324 if (g > 255)
67325 {
67326 g = 255;
67327 }
67328 if (b > 255)
67329 {
67330 b = 255;
67331 }
67332 }
67333 else
67334 {
67335 if (type == 948)
67336 {
67337 return Color.White;
67338 }
67339 if (type == 604 || type == 631)
67340 {
67341 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 0);
67342 }
67343 if (type == 342)
67344 {
67345 return Color.Lerp(newColor, Color.White, 0.75f) * Opacity;
67346 }
67347 if (type == 636)
67348 {
67349 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 64 - alpha / 4);
67350 }
67351 if (type == 673 || type == 706)
67352 {
67353 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 180 - alpha / 2 - alpha / 4);
67354 }
67355 if (type == 603 || type == 633)
67356 {
67357 return new Color(255, 255, 255, 200);
67358 }
67359 if (type == 623 || (type >= 625 && type <= 628) || type == 710)
67360 {
67361 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 255 - alpha);
67362 }
67363 if (type == 645 || type == 643)
67364 {
67365 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 127 - alpha / 2);
67366 }
67367 if (type == 611)
67368 {
67369 return new Color(255, 255, 255, 200);
67370 }
67371 if (type == 640 || type == 644 || type == 658)
67372 {
67373 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 0);
67374 }
67375 if (type == 612 || type == 953)
67376 {
67377 return new Color(255, 255, 255, 127);
67378 }
67379 if (type == 978)
67380 {
67381 return new Color(255, 255, 255, 127) * Opacity;
67382 }
67383 if (aiStyle == 105)
67384 {
67385 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 255 - alpha);
67386 }
67387 if (type == 554)
67388 {
67389 return new Color(200, 200, 200, 200);
67390 }
67391 if (type == 601)
67392 {
67393 return PortalHelper.GetPortalColor(owner, (int)ai[0]);
67394 }
67395 if (type == 602)
67396 {
67398 portalColor.A = 227;
67399 return portalColor;
67400 }
67401 if (type == 585)
67402 {
67403 byte a = newColor.A;
67405 newColor.A = a;
67406 return newColor;
67407 }
67408 if (type == 714)
67409 {
67410 byte a2 = newColor.A;
67412 newColor.A = a2;
67413 newColor *= (float)(int)a2 / 255f;
67414 return newColor;
67415 }
67416 if (type == 573 || type == 578 || type == 579 || type == 617 || type == 641 || type == 707 || type == 813)
67417 {
67418 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 255 - alpha);
67419 }
67420 if (type == 490)
67421 {
67422 return Color.White;
67423 }
67424 if (type == 575 || type == 596 || type == 659)
67425 {
67426 if (timeLeft < 30)
67427 {
67428 float num3 = (float)timeLeft / 30f;
67429 alpha = (int)(255f - 255f * num3);
67430 }
67431 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 128 - alpha / 2);
67432 }
67433 if (type == 546)
67434 {
67435 return new Color(255, 200, 255, 200);
67436 }
67437 if (type == 553)
67438 {
67439 return new Color(255, 255, 200, 200);
67440 }
67441 if (type == 540)
67442 {
67443 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 0);
67444 }
67445 if (type == 498)
67446 {
67447 return new Color(255, 100, 20, 200);
67448 }
67449 if (type == 538)
67450 {
67451 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 255 - alpha);
67452 }
67453 if (type == 518)
67454 {
67455 float num4 = 1f - (float)alpha / 255f;
67456 return new Color((int)(200f * num4), (int)(200f * num4), (int)(200f * num4), (int)(100f * num4));
67457 }
67458 if (type == 518 || type == 595 || type == 735)
67459 {
67460 Color color = Color.Lerp(newColor, Color.White, 0.85f);
67461 color.A = 128;
67462 return color * (1f - (float)alpha / 255f);
67463 }
67464 if (type == 536 || type == 607)
67465 {
67466 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 63 - alpha / 4);
67467 }
67468 if (type == 591)
67469 {
67470 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 63 - alpha / 4);
67471 }
67472 if (type == 493 || type == 494)
67473 {
67474 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 255 - alpha);
67475 }
67476 if (type == 492)
67477 {
67478 return new Color(255, 255, 255, 255);
67479 }
67480 if (type == 491)
67481 {
67482 return new Color(255, 255, 255, 255);
67483 }
67484 if (type == 485 || type == 502)
67485 {
67486 return new Color(255, 255, 255, 200);
67487 }
67488 if (type == 488)
67489 {
67490 return new Color(255, 255, 255, 255);
67491 }
67492 if (type == 477 || type == 478 || type == 479)
67493 {
67494 if (alpha == 0)
67495 {
67496 return new Color(255, 255, 255, 200);
67497 }
67498 return new Color(0, 0, 0, 0);
67499 }
67500 if (type == 473)
67501 {
67502 return new Color(255, 255, 255, 255);
67503 }
67504 if (type == 50 || type == 53 || type == 515 || type == 870)
67505 {
67506 return new Color(255, 255, 255, 0);
67507 }
67508 if (type == 723 || type == 724 || type == 725 || type == 726 || type == 728 || type == 9)
67509 {
67510 return new Color(255, 255, 255, 0) * Opacity;
67511 }
67512 if (type == 92)
67513 {
67514 return new Color(255, 255, 255, 0);
67515 }
67516 if (type == 91)
67517 {
67518 return new Color(200, 200, 200, 0);
67519 }
67520 if (type == 34 || type == 15 || type == 93 || type == 94 || type == 95 || type == 96 || type == 253 || type == 258 || (type == 102 && alpha < 255))
67521 {
67522 return new Color(200, 200, 200, 25);
67523 }
67524 if (type == 465)
67525 {
67526 return new Color(255, 255, 255, 0) * (1f - (float)alpha / 255f);
67527 }
67528 if (type == 503)
67529 {
67530 Color value2 = Color.Lerp(newColor, Color.White, 0.5f) * (1f - (float)alpha / 255f);
67532 float amount2 = 0.25f + (float)Math.Cos(localAI[0]) * 0.25f;
67533 return Color.Lerp(value2, value3, amount2);
67534 }
67535 if (type == 467)
67536 {
67537 return new Color(255, 255, 255, 255) * (1f - (float)alpha / 255f);
67538 }
67539 if (type == 694 || type == 695 || type == 696)
67540 {
67541 return new Color(255, 255, 255, 127) * (1f - (float)alpha / 255f);
67542 }
67543 if (type == 634 || type == 635)
67544 {
67545 return new Color(255, 255, 255, 127) * Opacity;
67546 }
67547 if (type == 671)
67548 {
67549 return new Color(255, 255, 255, 255) * Opacity;
67550 }
67551 if (type == 664 || type == 666 || type == 668)
67552 {
67554 return new Color(newColor.R, newColor.G, newColor.B, 200) * Opacity;
67555 }
67556 if (type == 451)
67557 {
67558 return new Color(255, 255, 255, 200) * ((255f - (float)alpha) / 255f);
67559 }
67560 if (type == 684)
67561 {
67562 return new Color(255, 255, 255, 200) * ((255f - (float)alpha) / 255f);
67563 }
67564 if (type == 454 || type == 452)
67565 {
67566 return new Color(255, 255, 255, 255) * (1f - (float)alpha / 255f);
67567 }
67568 if (type == 464)
67569 {
67570 return new Color(255, 255, 255, 255) * ((255f - (float)alpha) / 255f);
67571 }
67572 if (type == 450)
67573 {
67574 return new Color(200, 200, 200, 255 - alpha);
67575 }
67576 if (type == 459 || type == 709)
67577 {
67578 return new Color(255, 255, 255, 200);
67579 }
67580 if (type == 447)
67581 {
67582 return new Color(255, 255, 255, 200);
67583 }
67584 if (type == 446)
67585 {
67586 return Color.Lerp(newColor, Color.White, 0.8f) * (1f - (float)alpha / 255f);
67587 }
67588 if (type == 691 || type == 692 || type == 693)
67589 {
67590 return Color.Lerp(newColor, Color.White, 0.4f) * (1f - (float)alpha / 255f);
67591 }
67592 if (type >= 646 && type <= 649)
67593 {
67594 return Color.Lerp(newColor, Color.White, 0.8f) * (1f - (float)alpha / 255f);
67595 }
67596 if (type == 445)
67597 {
67598 return new Color(255, 255, 255, 128) * (1f - (float)alpha / 255f);
67599 }
67600 if (type == 440 || type == 449 || type == 606)
67601 {
67602 r = 255 - alpha;
67603 g = 255 - alpha;
67604 b = 255 - alpha;
67605 }
67606 else
67607 {
67608 if (type == 444)
67609 {
67610 return newColor * (1f - (float)alpha / 255f);
67611 }
67612 if (type == 443 || type == 675 || type == 686 || type == 711)
67613 {
67614 return new Color(255, 255, 255, 128) * (1f - (float)alpha / 255f);
67615 }
67616 if (type == 676)
67617 {
67618 return newColor * Opacity;
67619 }
67620 if (type == 438)
67621 {
67622 return new Color(255, 255, 255, 128) * (1f - (float)alpha / 255f);
67623 }
67624 if (type == 592)
67625 {
67626 return new Color(255, 255, 255, 128) * (1f - (float)alpha / 255f);
67627 }
67628 if (type == 437 || type == 700)
67629 {
67630 return new Color(255, 255, 255, 0) * (1f - (float)alpha / 255f);
67631 }
67632 if (type == 964 || type == 965)
67633 {
67634 return new Color(255, 255, 255, 255) * Opacity;
67635 }
67636 if (type == 462)
67637 {
67638 return new Color(255, 255, 255, 128) * (1f - (float)alpha / 255f);
67639 }
67640 if (type == 352)
67641 {
67643 color2.A = (byte)((float)(int)color2.A * ((float)alpha / 255f));
67644 return new Color(color2.R, color2.G, color2.B, color2.A);
67645 }
67646 if (type == 435 || type == 732 || type == 731)
67647 {
67649 return new Color(newColor.R, newColor.G, newColor.B, 25);
67650 }
67651 if (type == 682)
67652 {
67654 return new Color(newColor.R, newColor.G, newColor.B, 127);
67655 }
67656 if (type == 436)
67657 {
67659 return new Color(newColor.R, newColor.G, newColor.B, 25);
67660 }
67661 if (type == 409)
67662 {
67663 return new Color(250, 250, 250, 200);
67664 }
67665 if (type == 348 || type == 349)
67666 {
67667 return new Color(200, 200, 200, alpha);
67668 }
67669 if (type == 337)
67670 {
67671 return new Color(250, 250, 250, 150);
67672 }
67673 if (type >= 424 && type <= 426)
67674 {
67675 byte b2 = 150;
67676 if (newColor.R < b2)
67677 {
67678 newColor.R = b2;
67679 }
67680 if (newColor.G < b2)
67681 {
67682 newColor.G = b2;
67683 }
67684 if (newColor.B < b2)
67685 {
67686 newColor.B = b2;
67687 }
67688 return new Color(newColor.R, newColor.G, newColor.B, 255);
67689 }
67690 if (type == 431 || type == 432)
67691 {
67692 return new Color(250, 250, 250, 255 - alpha);
67693 }
67694 if (type == 343 || type == 344)
67695 {
67696 float num5 = 1f - (float)alpha / 255f;
67697 return new Color((int)(250f * num5), (int)(250f * num5), (int)(250f * num5), (int)(100f * num5));
67698 }
67699 if (type == 332)
67700 {
67701 return new Color(255, 255, 255, 255);
67702 }
67703 if (type == 329)
67704 {
67705 return new Color(200, 200, 200, 50);
67706 }
67707 if (type >= 326 && type <= 328)
67708 {
67709 return Color.Transparent;
67710 }
67711 if (type >= 400 && type <= 402)
67712 {
67713 return Color.Transparent;
67714 }
67715 if (type == 324 && frame >= 6 && frame <= 9)
67716 {
67717 return new Color(255, 255, 255, 255);
67718 }
67719 if (type == 16)
67720 {
67721 return new Color(255, 255, 255, 0);
67722 }
67723 if (type == 321)
67724 {
67725 return new Color(200, 200, 200, 0);
67726 }
67727 if (type == 76 || type == 77 || type == 78)
67728 {
67729 return new Color(255, 255, 255, 0);
67730 }
67731 if (type == 308)
67732 {
67733 return new Color(200, 200, 255, 125);
67734 }
67735 if (type == 263)
67736 {
67737 if (timeLeft < 255)
67738 {
67739 return new Color(255, 255, 255, (byte)timeLeft);
67740 }
67741 return new Color(255, 255, 255, 255);
67742 }
67743 if (type == 274)
67744 {
67745 if (timeLeft < 85)
67746 {
67747 byte b3 = (byte)(timeLeft * 3);
67748 byte a3 = (byte)(100f * ((float)(int)b3 / 255f));
67749 return new Color(b3, b3, b3, a3);
67750 }
67751 return new Color(255, 255, 255, 100);
67752 }
67753 if (type == 5)
67754 {
67755 return new Color(255, 255, 255, 0);
67756 }
67757 if (type == 300)
67758 {
67759 return new Color(250, 250, 250, 50);
67760 }
67761 if (type == 301)
67762 {
67763 if (ai[0] == 1f)
67764 {
67765 return newColor;
67766 }
67767 return new Color(250, 250, 250, 50);
67768 }
67769 if (type == 712)
67770 {
67771 return Color.Lerp(newColor, Color.White, 0.4f) * Opacity;
67772 }
67773 if (type == 304)
67774 {
67775 return new Color(255 - alpha, 255 - alpha, 255 - alpha, (byte)((float)(255 - alpha) / 3f));
67776 }
67777 if (type == 116 || type == 132 || type == 156 || type == 157 || type == 157 || type == 173)
67778 {
67779 if (localAI[1] >= 15f)
67780 {
67781 return new Color(255, 255, 255, alpha);
67782 }
67783 if (localAI[1] < 5f)
67784 {
67785 return Color.Transparent;
67786 }
67787 int num6 = (int)((localAI[1] - 5f) / 10f * 255f);
67788 return new Color(num6, num6, num6, num6);
67789 }
67790 if (type == 254)
67791 {
67792 if (timeLeft < 30)
67793 {
67794 float num7 = (float)timeLeft / 30f;
67795 alpha = (int)(255f - 255f * num7);
67796 }
67797 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 0);
67798 }
67799 if (type == 265 || type == 355)
67800 {
67801 if (alpha > 0)
67802 {
67803 return Color.Transparent;
67804 }
67805 return new Color(255, 255, 255, 0);
67806 }
67807 if (type == 257)
67808 {
67809 if (alpha > 200)
67810 {
67811 return Color.Transparent;
67812 }
67813 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 0);
67814 }
67815 if (type == 259)
67816 {
67817 if (alpha > 200)
67818 {
67819 return Color.Transparent;
67820 }
67821 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 0);
67822 }
67823 if (type >= 150 && type <= 152)
67824 {
67825 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 255 - alpha);
67826 }
67827 if (type == 250)
67828 {
67829 return Color.Transparent;
67830 }
67831 if (type == 251)
67832 {
67833 r = 255 - alpha;
67834 g = 255 - alpha;
67835 b = 255 - alpha;
67836 return new Color(r, g, b, 0);
67837 }
67838 if (type == 131)
67839 {
67840 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 0);
67841 }
67842 if (type == 211)
67843 {
67844 return new Color(255, 255, 255, 0);
67845 }
67846 if (type == 229)
67847 {
67848 return new Color(255, 255, 255, 50);
67849 }
67850 if (type == 221 || type == 729 || type == 977)
67851 {
67852 return new Color(255, 255, 255, 200);
67853 }
67854 if (type == 20)
67855 {
67856 if (alpha <= 150)
67857 {
67858 return new Color(255, 255, 255, 0);
67859 }
67860 return new Color(0, 0, 0, 0);
67861 }
67862 if (type == 207)
67863 {
67864 r = 255 - alpha;
67865 g = 255 - alpha;
67866 b = 255 - alpha;
67867 }
67868 else
67869 {
67870 if (type == 242)
67871 {
67872 if (alpha < 140)
67873 {
67874 return new Color(255, 255, 255, 100);
67875 }
67876 return Color.Transparent;
67877 }
67878 if (type == 638)
67879 {
67880 return new Color(255, 255, 255, 100) * Opacity;
67881 }
67882 if (type == 660)
67883 {
67884 return new Color(150, 255, 255, 0) * Opacity;
67885 }
67886 if (type == 209)
67887 {
67888 r = newColor.R - alpha;
67889 g = newColor.G - alpha;
67890 b = newColor.B - alpha / 2;
67891 }
67892 else
67893 {
67894 if (type == 130)
67895 {
67896 return new Color(255, 255, 255, 175);
67897 }
67898 if (type == 182)
67899 {
67900 return new Color(255, 255, 255, 200);
67901 }
67902 if (type == 226)
67903 {
67904 r = 255;
67905 g = 255;
67906 b = 255;
67907 float num8 = (float)(int)Main.mouseTextColor / 200f - 0.3f;
67908 r = (int)((float)r * num8);
67909 g = (int)((float)g * num8);
67910 b = (int)((float)b * num8);
67911 r += 50;
67912 if (r > 255)
67913 {
67914 r = 255;
67915 }
67916 g += 50;
67917 if (g > 255)
67918 {
67919 g = 255;
67920 }
67921 b += 50;
67922 if (b > 255)
67923 {
67924 b = 255;
67925 }
67926 return new Color(r, g, b, 200);
67927 }
67928 if (type == 227)
67929 {
67930 r = (g = (b = 255));
67931 float num9 = (float)(int)Main.mouseTextColor / 100f - 1.6f;
67932 r = (int)((float)r * num9);
67933 g = (int)((float)g * num9);
67934 b = (int)((float)b * num9);
67935 int a4 = (int)(100f * num9);
67936 r += 50;
67937 if (r > 255)
67938 {
67939 r = 255;
67940 }
67941 g += 50;
67942 if (g > 255)
67943 {
67944 g = 255;
67945 }
67946 b += 50;
67947 if (b > 255)
67948 {
67949 b = 255;
67950 }
67951 return new Color(r, g, b, a4);
67952 }
67953 if (type == 114 || type == 115)
67954 {
67955 if (localAI[1] >= 15f)
67956 {
67957 return new Color(255, 255, 255, alpha);
67958 }
67959 if (localAI[1] < 5f)
67960 {
67961 return Color.Transparent;
67962 }
67963 int num10 = (int)((localAI[1] - 5f) / 10f * 255f);
67964 return new Color(num10, num10, num10, num10);
67965 }
67966 if (type == 83 || type == 88 || type == 89 || type == 90 || type == 100 || type == 104 || type == 279 || (type >= 283 && type <= 287) || type == 876)
67967 {
67968 if (alpha < 200)
67969 {
67970 return new Color(255 - alpha, 255 - alpha, 255 - alpha, 0);
67971 }
67972 return Color.Transparent;
67973 }
67974 if (type == 34 || type == 35 || type == 15 || type == 19 || type == 44 || type == 45)
67975 {
67976 return Color.White;
67977 }
67978 if (type == 79)
67979 {
67980 r = Main.DiscoR;
67981 g = Main.DiscoG;
67982 b = Main.DiscoB;
67983 return default(Color);
67984 }
67985 if (type == 9 || type == 15 || type == 34 || type == 50 || type == 53 || type == 76 || type == 77 || type == 78 || type == 92 || type == 91)
67986 {
67987 r = newColor.R - alpha / 3;
67988 g = newColor.G - alpha / 3;
67989 b = newColor.B - alpha / 3;
67990 }
67991 else
67992 {
67993 if (type == 18)
67994 {
67995 return new Color(255, 255, 255, 50);
67996 }
67997 if (type == 16 || type == 44 || type == 45)
67998 {
67999 r = newColor.R;
68000 g = newColor.G;
68001 b = newColor.B;
68002 }
68003 else if (type == 12 || type == 72 || type == 86 || type == 87 || type == 955)
68004 {
68005 return new Color(255, 255, 255, newColor.A - alpha);
68006 }
68007 }
68008 }
68009 }
68010 }
68011 }
68012 float num11 = (float)(255 - alpha) / 255f;
68013 r = (int)((float)(int)newColor.R * num11);
68014 g = (int)((float)(int)newColor.G * num11);
68015 b = (int)((float)(int)newColor.B * num11);
68016 int num12 = newColor.A - alpha;
68017 if (num12 < 0)
68018 {
68019 num12 = 0;
68020 }
68021 if (num12 > 255)
68022 {
68023 num12 = 255;
68024 }
68025 return new Color(r, g, b, num12);
68026 }
static double Cos(double d)
static double Sin(double a)
const double PI
Definition Math.cs:16
static Color GetPortalColor(int colorIndex)
static Color Transparent
Definition Color.cs:76
static Color Lerp(Color value1, Color value2, float amount)
Definition Color.cs:491

References Microsoft.Xna.Framework.Color.Black, System.Math.Cos(), Terraria.Main.DiscoB, Terraria.Main.DiscoG, Terraria.Main.DiscoR, Terraria.GameContent.PortalHelper.GetPortalColor(), Terraria.WorldGen.InWorld(), Microsoft.Xna.Framework.Color.Lerp(), System.Math.PI, Terraria.Main.player, Microsoft.Xna.Framework.Color.Purple, System.Math.Sin(), Terraria.WorldGen.SolidTile(), Microsoft.Xna.Framework.Color.Transparent, System.type, System.value, Microsoft.Xna.Framework.Color.White, Terraria.Utils.WrappedLerp(), Microsoft.Xna.Framework.Point.X, and Microsoft.Xna.Framework.Point.Y.