Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
PlayerDrawHeadSet.cs
Go to the documentation of this file.
4using Terraria.ID;
5
7
8public struct PlayerDrawHeadSet
9{
11
13
15
17
18 public int cHead;
19
20 public int cFace;
21
22 public int cFaceHead;
23
24 public int cFaceFlower;
25
26 public int cUnicornHorn;
27
28 public int cAngelHalo;
29
30 public int cBeard;
31
32 public int skinVar;
33
34 public int hairShaderPacked;
35
36 public int skinDyePacked;
37
38 public float scale;
39
41
43
45
47
49
51
53
55
57
58 public bool fullHair;
59
60 public bool hatHair;
61
62 public bool hideHair;
63
64 public bool helmetIsTall;
65
67
68 public bool helmetIsNormal;
69
70 public bool drawUnicornHorn;
71
72 public bool drawAngelHalo;
73
75
77
79
81 {
82 get
83 {
85 result.Height--;
86 return result;
87 }
88 }
89
90 public void BoringSetup(Player drawPlayer2, List<DrawData> drawData, List<int> dust, List<int> gore, float X, float Y, float Alpha, float Scale)
91 {
93 Dust = dust;
94 Gore = gore;
97 cHead = 0;
98 cFace = 0;
99 cUnicornHorn = 0;
100 cAngelHalo = 0;
101 cBeard = 0;
102 drawUnicornHorn = false;
103 drawAngelHalo = false;
106 if (drawPlayer.head == 0 && drawPlayer.hairDye == 0)
107 {
109 }
112 {
113 Main.instance.LoadAccFace(drawPlayer.face);
114 }
124 Main.instance.LoadHair(drawPlayer.hair);
125 scale = Scale;
132 {
134 }
135 else
136 {
138 }
140 if (drawPlayer.direction < 0)
141 {
142 playerEffect = SpriteEffects.FlipHorizontally;
143 }
144 headVect = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.4f);
146 bodyFrameMemory.Y = 0;
148 Position.X += X;
149 Position.Y += Y;
150 Position.X -= 6f;
151 Position.Y -= 4f;
152 Position.Y -= drawPlayer.HeightMapOffset;
154 {
155 Main.instance.LoadArmorHead(drawPlayer.head);
157 if (num >= 0)
158 {
159 Main.instance.LoadArmorHead(num);
160 }
161 }
163 {
164 Main.instance.LoadAccFace(drawPlayer.face);
165 }
167 {
168 Main.instance.LoadAccFace(drawPlayer.faceHead);
169 }
171 {
172 Main.instance.LoadAccFace(drawPlayer.faceFlower);
173 }
175 {
176 Main.instance.LoadAccBeard(drawPlayer.beard);
177 }
180 hairOffset.Y *= drawPlayer.Directions.Y;
182 helmetOffset.Y *= drawPlayer.Directions.Y;
183 helmetIsTall = drawPlayer.head == 14 || drawPlayer.head == 56 || drawPlayer.head == 158;
184 helmetIsNormal = !helmetIsTall && !helmetIsOverFullHair && drawPlayer.head > 0 && drawPlayer.head < ArmorIDs.Head.Count && drawPlayer.head != 28;
185 }
186}
static int PackShader(int localShaderIndex, ShaderConfiguration shaderType)
Vector2 position
Definition Entity.cs:14
static readonly sbyte Count
Definition ArmorIDs.cs:2123
static readonly sbyte Count
Definition ArmorIDs.cs:2036
static readonly int Count
Definition ArmorIDs.cs:587
static Main instance
Definition Main.cs:283
static Vector2 screenPosition
Definition Main.cs:1715
static Microsoft.Xna.Framework.Color quickAlpha(Microsoft.Xna.Framework.Color oldColor, float Alpha)
Definition Main.cs:35174
int HeightMapOffset
Definition Player.cs:2815
Vector2 GetHairDrawOffset(int hairID, bool hatHair)
Definition Player.cs:3855
void GetHairSettings(out bool fullHair, out bool hatHair, out bool hideHair, out bool backHairDraw, out bool drawsBackHairWithoutHeadgear)
Definition Player.cs:16638
bool hasUnicornHorn
Definition Player.cs:1639
bool isDisplayDollOrInanimate
Definition Player.cs:1245
Color GetHairColor(bool useLighting=true)
Definition Player.cs:52299
Color skinColor
Definition Player.cs:2135
Vector2 Directions
Definition Player.cs:3326
sbyte faceFlower
Definition Player.cs:1361
bool hasAngelHalo
Definition Player.cs:1641
Vector2 GetHelmetDrawOffset()
Definition Player.cs:3869
Rectangle bodyFrame
Definition Player.cs:1373
Rectangle legFrame
Definition Player.cs:1375
void BoringSetup(Player drawPlayer2, List< DrawData > drawData, List< int > dust, List< int > gore, float X, float Y, float Alpha, float Scale)