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

◆ Apply() [2/2]

override void Terraria.GameContent.Dyes.ReflectiveArmorShaderData.Apply ( Entity entity,
DrawData? drawData )
inlinevirtual

Reimplemented from Terraria.Graphics.Shaders.ArmorShaderData.

Definition at line 15 of file ReflectiveArmorShaderData.cs.

16 {
17 //IL_0018: Unknown result type (might be due to invalid IL or missing references)
18 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
19 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
20 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
21 //IL_006a: Unknown result type (might be due to invalid IL or missing references)
22 //IL_007f: Unknown result type (might be due to invalid IL or missing references)
23 //IL_008c: Unknown result type (might be due to invalid IL or missing references)
24 //IL_0091: Unknown result type (might be due to invalid IL or missing references)
25 //IL_0096: Unknown result type (might be due to invalid IL or missing references)
26 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
27 //IL_009c: Unknown result type (might be due to invalid IL or missing references)
28 //IL_00a9: Unknown result type (might be due to invalid IL or missing references)
29 //IL_00ae: Unknown result type (might be due to invalid IL or missing references)
30 //IL_00b3: Unknown result type (might be due to invalid IL or missing references)
31 //IL_00b8: Unknown result type (might be due to invalid IL or missing references)
32 //IL_00ba: Unknown result type (might be due to invalid IL or missing references)
33 //IL_00c3: Unknown result type (might be due to invalid IL or missing references)
34 //IL_00c8: Unknown result type (might be due to invalid IL or missing references)
35 //IL_00cd: Unknown result type (might be due to invalid IL or missing references)
36 //IL_00d2: Unknown result type (might be due to invalid IL or missing references)
37 //IL_00dc: Unknown result type (might be due to invalid IL or missing references)
38 //IL_00e1: Unknown result type (might be due to invalid IL or missing references)
39 //IL_00e6: Unknown result type (might be due to invalid IL or missing references)
40 //IL_00eb: Unknown result type (might be due to invalid IL or missing references)
41 //IL_00ed: Unknown result type (might be due to invalid IL or missing references)
42 //IL_00f3: Unknown result type (might be due to invalid IL or missing references)
43 //IL_00fa: Unknown result type (might be due to invalid IL or missing references)
44 //IL_0103: Unknown result type (might be due to invalid IL or missing references)
45 //IL_010a: Unknown result type (might be due to invalid IL or missing references)
46 //IL_0112: Unknown result type (might be due to invalid IL or missing references)
47 //IL_011c: Unknown result type (might be due to invalid IL or missing references)
48 //IL_0123: Unknown result type (might be due to invalid IL or missing references)
49 //IL_012b: Unknown result type (might be due to invalid IL or missing references)
50 //IL_0135: Unknown result type (might be due to invalid IL or missing references)
51 //IL_013c: Unknown result type (might be due to invalid IL or missing references)
52 //IL_0144: Unknown result type (might be due to invalid IL or missing references)
53 //IL_0178: Unknown result type (might be due to invalid IL or missing references)
54 //IL_017c: Unknown result type (might be due to invalid IL or missing references)
55 //IL_0181: Unknown result type (might be due to invalid IL or missing references)
56 //IL_019c: Unknown result type (might be due to invalid IL or missing references)
57 //IL_01a8: Unknown result type (might be due to invalid IL or missing references)
58 //IL_01ae: Unknown result type (might be due to invalid IL or missing references)
59 //IL_01b0: Unknown result type (might be due to invalid IL or missing references)
60 //IL_01b5: Unknown result type (might be due to invalid IL or missing references)
61 //IL_01b9: Unknown result type (might be due to invalid IL or missing references)
62 //IL_01c0: Unknown result type (might be due to invalid IL or missing references)
63 //IL_01c7: Unknown result type (might be due to invalid IL or missing references)
64 //IL_01cf: Unknown result type (might be due to invalid IL or missing references)
65 //IL_01d6: Unknown result type (might be due to invalid IL or missing references)
66 //IL_0241: Unknown result type (might be due to invalid IL or missing references)
67 if (entity == null)
68 {
69 base.Shader.Parameters["uLightSource"].SetValue(Vector3.Zero);
70 }
71 else
72 {
73 float num = 0f;
74 if (drawData.HasValue)
75 {
76 num = drawData.Value.rotation;
77 }
78 Vector2 position = entity.position;
79 float num2 = entity.width;
80 float num3 = entity.height;
81 Vector2 val = position + new Vector2(num2, num3) * 0.1f;
82 num2 *= 0.8f;
83 num3 *= 0.8f;
84 Vector3 subLight = Lighting.GetSubLight(val + new Vector2(num2 * 0.5f, 0f));
85 Vector3 subLight2 = Lighting.GetSubLight(val + new Vector2(0f, num3 * 0.5f));
86 Vector3 subLight3 = Lighting.GetSubLight(val + new Vector2(num2, num3 * 0.5f));
87 Vector3 subLight4 = Lighting.GetSubLight(val + new Vector2(num2 * 0.5f, num3));
88 float num4 = subLight.X + subLight.Y + subLight.Z;
89 float num5 = subLight2.X + subLight2.Y + subLight2.Z;
90 float num6 = subLight3.X + subLight3.Y + subLight3.Z;
91 float num7 = subLight4.X + subLight4.Y + subLight4.Z;
92 Vector2 spinningpoint = default(Vector2);
93 ((Vector2)(ref spinningpoint))._002Ector(num6 - num5, num7 - num4);
94 float num8 = ((Vector2)(ref spinningpoint)).Length();
95 if (num8 > 1f)
96 {
97 num8 = 1f;
99 }
100 if (entity.direction == -1)
101 {
102 spinningpoint.X *= -1f;
103 }
104 spinningpoint = spinningpoint.RotatedBy(0f - num);
105 Vector3 value = default(Vector3);
106 ((Vector3)(ref value))._002Ector(spinningpoint, 1f - (spinningpoint.X * spinningpoint.X + spinningpoint.Y * spinningpoint.Y));
107 value.X *= 2f;
108 value.Y -= 0.15f;
109 value.Y *= 2f;
110 ((Vector3)(ref value)).Normalize();
111 value.Z *= 0.6f;
112 base.Shader.Parameters["uLightSource"].SetValue(value);
113 }
114 base.Apply(entity, drawData);
115 }

References Terraria.Entity.direction, Terraria.Lighting.GetSubLight(), Terraria.Entity.height, Terraria.Entity.position, and Terraria.Entity.width.

+ Here is the call graph for this function: