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

◆ DrawWhip_RainbowWhip()

static Vector2 Terraria.Main.DrawWhip_RainbowWhip ( Projectile proj,
List< Vector2 > controlPoints )
inlinestatic

Definition at line 46915 of file Main.cs.

46916 {
46917 //IL_0019: Unknown result type (might be due to invalid IL or missing references)
46918 //IL_001e: Unknown result type (might be due to invalid IL or missing references)
46919 //IL_001f: Unknown result type (might be due to invalid IL or missing references)
46920 //IL_0032: Unknown result type (might be due to invalid IL or missing references)
46921 //IL_0033: Unknown result type (might be due to invalid IL or missing references)
46922 //IL_003d: Unknown result type (might be due to invalid IL or missing references)
46923 //IL_0042: Unknown result type (might be due to invalid IL or missing references)
46924 //IL_0045: Unknown result type (might be due to invalid IL or missing references)
46925 //IL_004a: Unknown result type (might be due to invalid IL or missing references)
46926 //IL_006a: Unknown result type (might be due to invalid IL or missing references)
46927 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
46928 //IL_025e: Unknown result type (might be due to invalid IL or missing references)
46929 //IL_00b2: Unknown result type (might be due to invalid IL or missing references)
46930 //IL_00b7: Unknown result type (might be due to invalid IL or missing references)
46931 //IL_00be: Unknown result type (might be due to invalid IL or missing references)
46932 //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
46933 //IL_00c5: Unknown result type (might be due to invalid IL or missing references)
46934 //IL_00ca: Unknown result type (might be due to invalid IL or missing references)
46935 //IL_023e: Unknown result type (might be due to invalid IL or missing references)
46936 //IL_0240: Unknown result type (might be due to invalid IL or missing references)
46937 //IL_0242: Unknown result type (might be due to invalid IL or missing references)
46938 //IL_0247: Unknown result type (might be due to invalid IL or missing references)
46939 //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
46940 //IL_00ff: Unknown result type (might be due to invalid IL or missing references)
46941 //IL_0101: Unknown result type (might be due to invalid IL or missing references)
46942 //IL_0103: Unknown result type (might be due to invalid IL or missing references)
46943 //IL_0159: Unknown result type (might be due to invalid IL or missing references)
46944 //IL_0168: Unknown result type (might be due to invalid IL or missing references)
46945 //IL_016a: Unknown result type (might be due to invalid IL or missing references)
46946 //IL_016f: Unknown result type (might be due to invalid IL or missing references)
46947 //IL_0174: Unknown result type (might be due to invalid IL or missing references)
46948 //IL_017c: Unknown result type (might be due to invalid IL or missing references)
46949 //IL_017e: Unknown result type (might be due to invalid IL or missing references)
46950 //IL_0183: Unknown result type (might be due to invalid IL or missing references)
46951 //IL_0188: Unknown result type (might be due to invalid IL or missing references)
46952 //IL_018e: Unknown result type (might be due to invalid IL or missing references)
46953 //IL_0190: Unknown result type (might be due to invalid IL or missing references)
46954 //IL_0197: Unknown result type (might be due to invalid IL or missing references)
46955 //IL_019e: Unknown result type (might be due to invalid IL or missing references)
46956 //IL_01bb: Unknown result type (might be due to invalid IL or missing references)
46957 //IL_01bd: Unknown result type (might be due to invalid IL or missing references)
46958 //IL_01c2: Unknown result type (might be due to invalid IL or missing references)
46959 //IL_01c7: Unknown result type (might be due to invalid IL or missing references)
46960 //IL_01cd: Unknown result type (might be due to invalid IL or missing references)
46961 //IL_01d4: Unknown result type (might be due to invalid IL or missing references)
46962 //IL_01db: Unknown result type (might be due to invalid IL or missing references)
46963 //IL_01f6: Unknown result type (might be due to invalid IL or missing references)
46964 //IL_01f8: Unknown result type (might be due to invalid IL or missing references)
46965 //IL_0209: Unknown result type (might be due to invalid IL or missing references)
46966 //IL_020b: Unknown result type (might be due to invalid IL or missing references)
46967 //IL_0210: Unknown result type (might be due to invalid IL or missing references)
46968 //IL_0215: Unknown result type (might be due to invalid IL or missing references)
46969 //IL_021b: Unknown result type (might be due to invalid IL or missing references)
46970 //IL_0222: Unknown result type (might be due to invalid IL or missing references)
46971 //IL_0229: Unknown result type (might be due to invalid IL or missing references)
46972 Texture2D value = TextureAssets.Projectile[proj.type].Value;
46973 Rectangle rectangle = value.Frame(1, 5);
46974 int height = rectangle.Height;
46975 rectangle.Height -= 2;
46976 Vector2 vector = rectangle.Size() / 2f;
46977 Vector2 vector2 = controlPoints[0];
46978 float miscCounterNormalized = player[proj.owner].miscCounterNormalized;
46979 for (int i = 0; i < controlPoints.Count - 1; i++)
46980 {
46981 bool flag = true;
46982 Vector2 origin = vector;
46983 switch (i)
46984 {
46985 case 0:
46986 origin.Y -= 4f;
46987 break;
46988 case 39:
46989 rectangle.Y = height * 4;
46990 break;
46991 default:
46992 flag = i % 2 == 0;
46993 rectangle.Y = height * (1 + i % 3);
46994 break;
46995 }
46996 Vector2 vector3 = controlPoints[i];
46997 Vector2 vector4 = controlPoints[i + 1] - vector3;
46998 if (flag)
46999 {
47000 Color color = hslToRgb((miscCounterNormalized * 5f + (float)i * 0.05f) % 1f, 1f, 0.5f);
47001 Color color2 = color;
47002 float lerpValue = Utils.GetLerpValue(controlPoints.Count - 10, controlPoints.Count - 2, i, clamped: true);
47003 float num = MathHelper.Lerp(1f, 1f, lerpValue);
47004 ((Color)(ref color2)).A = (byte)(((Color)(ref color2)).A / 2);
47005 ((Color)(ref color2)).A = (byte)((float)(int)((Color)(ref color2)).A * lerpValue);
47006 float rotation = vector4.ToRotation() - (float)Math.PI / 2f;
47007 Color color3 = Lighting.GetColor(vector3.ToTileCoordinates());
47008 spriteBatch.Draw(value, vector2 - screenPosition, (Rectangle?)rectangle, Color.Lerp(color3, color2, 0.5f), rotation, origin, num, (SpriteEffects)0, 0f);
47009 ((Color)(ref color2)).A = 0;
47010 spriteBatch.Draw(value, vector2 - screenPosition, (Rectangle?)rectangle, color2 * 0.1f, rotation, origin, num * 1.2f, (SpriteEffects)0, 0f);
47011 if (i == 39)
47012 {
47013 color2 = color;
47014 ((Color)(ref color2)).A = 127;
47015 spriteBatch.Draw(value, vector2 - screenPosition, (Rectangle?)rectangle, color2 * 0.3f, rotation, origin, num * 1.4f, (SpriteEffects)0, 0f);
47016 }
47017 }
47018 vector2 += vector4;
47019 }
47020 return vector2;
47021 }
static Asset< Texture2D >[] Projectile
static Color hslToRgb(Vector3 hslVector)
Definition Main.cs:61847
static SpriteBatch spriteBatch
Definition Main.cs:1043
static Vector2 screenPosition
The position of the top left corner of the screen in world coordinates. Modify in M:Terraria....
Definition Main.cs:1864
static Player[] player
Definition Main.cs:1960

References Terraria.Graphics.Light.Color, Terraria.Lighting.GetColor(), Terraria.Utils.GetLerpValue(), Terraria.Main.hslToRgb(), Terraria.Main.player, Terraria.GameContent.TextureAssets.Projectile, Terraria.Main.screenPosition, and Terraria.Main.spriteBatch.

Referenced by Terraria.Main.DrawWhip().

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