本文整理匯總了C#中Terraria.Player.GetImmuneAlpha方法的典型用法代碼示例。如果您正苦於以下問題:C# Player.GetImmuneAlpha方法的具體用法?C# Player.GetImmuneAlpha怎麽用?C# Player.GetImmuneAlpha使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Terraria.Player
的用法示例。
在下文中一共展示了Player.GetImmuneAlpha方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DrawGhost
protected void DrawGhost(Player drawPlayer)
{
SpriteEffects none = SpriteEffects.None;
if (drawPlayer.direction == 1)
{
none = SpriteEffects.None;
}
else
{
none = SpriteEffects.FlipHorizontally;
}
Color immuneAlpha = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, ((int)(drawPlayer.position.Y + (drawPlayer.height * 0.5))) / 0x10, new Color((mouseTextColor / 2) + 100, (mouseTextColor / 2) + 100, (mouseTextColor / 2) + 100, (mouseTextColor / 2) + 100)));
Rectangle rectangle = new Rectangle(0, (ghostTexture.Height / 4) * drawPlayer.ghostFrame, ghostTexture.Width, ghostTexture.Height / 4);
Vector2 origin = new Vector2(rectangle.Width * 0.5f, rectangle.Height * 0.5f);
this.spriteBatch.Draw(ghostTexture, new Vector2((float)(((int)(drawPlayer.position.X - screenPosition.X)) + (rectangle.Width / 2)), (float)(((int)(drawPlayer.position.Y - screenPosition.Y)) + (rectangle.Height / 2))), new Rectangle?(rectangle), immuneAlpha, 0f, origin, (float)1f, none, 0f);
}
示例2: drawPlayer
protected void drawPlayer(Player drawPlayer)
{
SpriteEffects effects = SpriteEffects.None;
SpriteEffects effects2 = SpriteEffects.FlipHorizontally;
Color color = drawPlayer.GetImmuneAlpha(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), Color.White, 1));
Color color2 = drawPlayer.GetImmuneAlpha(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.eyeColor, 1));
Color color3 = drawPlayer.GetImmuneAlpha(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.hairColor, 1));
Color color4 = drawPlayer.GetImmuneAlpha(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.skinColor, 1));
Color color5 = drawPlayer.GetImmuneAlpha(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.skinColor, 1));
Color immuneAlpha = drawPlayer.GetImmuneAlpha(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.skinColor, 1));
Color color6 = drawPlayer.GetImmuneAlpha2(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.shirtColor, 1));
Color color7 = drawPlayer.GetImmuneAlpha2(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.underShirtColor, 1));
Color color8 = drawPlayer.GetImmuneAlpha2(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.pantsColor, 1));
Color color9 = drawPlayer.GetImmuneAlpha2(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.shoeColor, 1));
Color color10 = drawPlayer.GetImmuneAlpha2(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16, Color.White, 1));
Color color11 = drawPlayer.GetImmuneAlpha2(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16, Color.White, 1));
Color color12 = drawPlayer.GetImmuneAlpha2(GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16, Color.White, 1));
float num = 1f;
float num2 = 1f;
float num3 = 1f;
float num4 = 1f;
if (drawPlayer.poisoned)
{
if (Main.rand.Next(50) == 0)
{
int num5 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 46, 0f, 0f, 150, default(Color), 0.2f);
Main.dust[num5].noGravity = true;
Main.dust[num5].fadeIn = 1.9f;
}
num *= 0.65f;
num3 *= 0.75f;
}
if (drawPlayer.onFire)
{
if (Main.rand.Next(4) == 0)
{
int num6 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 6, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 3f);
Main.dust[num6].noGravity = true;
Dust expr_640 = Main.dust[num6];
expr_640.velocity *= 1.8f;
Dust expr_662_cp_0 = Main.dust[num6];
expr_662_cp_0.velocity.Y = expr_662_cp_0.velocity.Y - 0.5f;
}
num3 *= 0.6f;
num2 *= 0.7f;
}
if (drawPlayer.onFire2)
{
if (Main.rand.Next(4) == 0)
{
int num7 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 75, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, default(Color), 3f);
Main.dust[num7].noGravity = true;
Dust expr_72B = Main.dust[num7];
expr_72B.velocity *= 1.8f;
Dust expr_74D_cp_0 = Main.dust[num7];
expr_74D_cp_0.velocity.Y = expr_74D_cp_0.velocity.Y - 0.5f;
}
num3 *= 0.6f;
num2 *= 0.7f;
}
if (drawPlayer.noItems)
{
num2 *= 0.8f;
num *= 0.65f;
}
if (drawPlayer.blind)
{
num2 *= 0.65f;
num *= 0.7f;
}
if (drawPlayer.bleed)
{
num2 *= 0.9f;
num3 *= 0.9f;
if (!drawPlayer.dead && Main.rand.Next(30) == 0)
{
int num8 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 5, 0f, 0f, 0, default(Color), 1f);
Dust expr_820_cp_0 = Main.dust[num8];
expr_820_cp_0.velocity.Y = expr_820_cp_0.velocity.Y + 0.5f;
Dust expr_839 = Main.dust[num8];
expr_839.velocity *= 0.25f;
}
}
if (num != 1f || num2 != 1f || num3 != 1f || num4 != 1f)
{
if (drawPlayer.onFire || drawPlayer.onFire2)
{
color = drawPlayer.GetImmuneAlpha(Color.White);
color2 = drawPlayer.GetImmuneAlpha(drawPlayer.eyeColor);
color3 = drawPlayer.GetImmuneAlpha(drawPlayer.hairColor);
color4 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor);
color5 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor);
color6 = drawPlayer.GetImmuneAlpha(drawPlayer.shirtColor);
color7 = drawPlayer.GetImmuneAlpha(drawPlayer.underShirtColor);
color8 = drawPlayer.GetImmuneAlpha(drawPlayer.pantsColor);
color9 = drawPlayer.GetImmuneAlpha(drawPlayer.shoeColor);
color10 = drawPlayer.GetImmuneAlpha(Color.White);
color11 = drawPlayer.GetImmuneAlpha(Color.White);
color12 = drawPlayer.GetImmuneAlpha(Color.White);
//.........這裏部分代碼省略.........
示例3: DrawGhost
protected void DrawGhost(Player drawPlayer)
{
SpriteEffects effects;
if (drawPlayer.direction == 1)
{
effects = SpriteEffects.None;
}
else
{
effects = SpriteEffects.FlipHorizontally;
}
Color immuneAlpha = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16, new Color((int)(Main.mouseTextColor / 2 + 100), (int)(Main.mouseTextColor / 2 + 100), (int)(Main.mouseTextColor / 2 + 100), (int)(Main.mouseTextColor / 2 + 100))));
Rectangle value = new Rectangle(0, Main.ghostTexture.Height / 4 * drawPlayer.ghostFrame, Main.ghostTexture.Width, Main.ghostTexture.Height / 4);
Vector2 origin = new Vector2((float)value.Width * 0.5f, (float)value.Height * 0.5f);
this.spriteBatch.Draw(Main.ghostTexture, new Vector2((float)((int)(drawPlayer.position.X - Main.screenPosition.X + (float)(value.Width / 2))), (float)((int)(drawPlayer.position.Y - Main.screenPosition.Y + (float)(value.Height / 2)))), new Rectangle?(value), immuneAlpha, 0f, origin, 1f, effects, 0f);
}
示例4: DrawPlayer
protected void DrawPlayer(Player drawPlayer)
{
SpriteEffects none = SpriteEffects.None;
SpriteEffects flipHorizontally = SpriteEffects.FlipHorizontally;
Color immuneAlpha = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int)((drawPlayer.position.Y + (drawPlayer.height * 0.25)) / 16.0), Color.White));
Color newColor = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int)((drawPlayer.position.Y + (drawPlayer.height * 0.25)) / 16.0), drawPlayer.eyeColor));
Color color3 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int)((drawPlayer.position.Y + (drawPlayer.height * 0.25)) / 16.0), drawPlayer.hairColor));
Color color4 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int)((drawPlayer.position.Y + (drawPlayer.height * 0.25)) / 16.0), drawPlayer.skinColor));
Color color5 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int)((drawPlayer.position.Y + (drawPlayer.height * 0.5)) / 16.0), drawPlayer.skinColor));
Color color = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int)((drawPlayer.position.Y + (drawPlayer.height * 0.75)) / 16.0), drawPlayer.skinColor));
Color color7 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int)((drawPlayer.position.Y + (drawPlayer.height * 0.5)) / 16.0), drawPlayer.shirtColor));
Color color8 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int)((drawPlayer.position.Y + (drawPlayer.height * 0.5)) / 16.0), drawPlayer.underShirtColor));
Color color9 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int)((drawPlayer.position.Y + (drawPlayer.height * 0.75)) / 16.0), drawPlayer.pantsColor));
Color color10 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int)((drawPlayer.position.Y + (drawPlayer.height * 0.75)) / 16.0), drawPlayer.shoeColor));
Color color11 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, ((int)(drawPlayer.position.Y + (drawPlayer.height * 0.25))) / 0x10, Color.White));
Color color12 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, ((int)(drawPlayer.position.Y + (drawPlayer.height * 0.5))) / 0x10, Color.White));
Color color13 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor(((int)(drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, ((int)(drawPlayer.position.Y + (drawPlayer.height * 0.75))) / 0x10, Color.White));
if (drawPlayer.shadow > 0f)
{
color = new Color(0, 0, 0, 0);
color5 = new Color(0, 0, 0, 0);
color4 = new Color(0, 0, 0, 0);
color3 = new Color(0, 0, 0, 0);
newColor = new Color(0, 0, 0, 0);
immuneAlpha = new Color(0, 0, 0, 0);
}
float r = 1f;
float g = 1f;
float b = 1f;
float a = 1f;
if (drawPlayer.poisoned)
{
if (rand.Next(50) == 0)
{
int index = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 0x2e, 0f, 0f, 150, new Color(), 0.2f);
dust[index].noGravity = true;
dust[index].fadeIn = 1.9f;
}
r *= 0.65f;
b *= 0.75f;
}
if (drawPlayer.onFire)
{
if (rand.Next(4) == 0)
{
int num6 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 6, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, new Color(), 3f);
dust[num6].noGravity = true;
Dust dust1 = dust[num6];
dust1.velocity = (Vector2)(dust1.velocity * 1.8f);
dust[num6].velocity.Y -= 0.5f;
}
b *= 0.6f;
g *= 0.7f;
}
if (drawPlayer.onFire2)
{
if (rand.Next(4) == 0)
{
int num7 = Dust.NewDust(new Vector2(drawPlayer.position.X - 2f, drawPlayer.position.Y - 2f), drawPlayer.width + 4, drawPlayer.height + 4, 0x4b, drawPlayer.velocity.X * 0.4f, drawPlayer.velocity.Y * 0.4f, 100, new Color(), 3f);
dust[num7].noGravity = true;
Dust dust2 = dust[num7];
dust2.velocity = (Vector2)(dust2.velocity * 1.8f);
dust[num7].velocity.Y -= 0.5f;
}
b *= 0.6f;
g *= 0.7f;
}
if (drawPlayer.noItems)
{
g *= 0.8f;
r *= 0.65f;
}
if (drawPlayer.blind)
{
g *= 0.65f;
r *= 0.7f;
}
if (drawPlayer.bleed)
{
g *= 0.9f;
b *= 0.9f;
if (!drawPlayer.dead && (rand.Next(30) == 0))
{
int num8 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 5, 0f, 0f, 0, new Color(), 1f);
dust[num8].velocity.Y += 0.5f;
Dust dust3 = dust[num8];
dust3.velocity = (Vector2)(dust3.velocity * 0.25f);
}
}
if (((r != 1f) || (g != 1f)) || ((b != 1f) || (a != 1f)))
{
if (drawPlayer.onFire || drawPlayer.onFire2)
{
immuneAlpha = drawPlayer.GetImmuneAlpha(Color.White);
newColor = drawPlayer.GetImmuneAlpha(drawPlayer.eyeColor);
color3 = drawPlayer.GetImmuneAlpha(drawPlayer.hairColor);
color4 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor);
color5 = drawPlayer.GetImmuneAlpha(drawPlayer.skinColor);
color7 = drawPlayer.GetImmuneAlpha(drawPlayer.shirtColor);
color8 = drawPlayer.GetImmuneAlpha(drawPlayer.underShirtColor);
//.........這裏部分代碼省略.........
示例5: DrawPlayer
protected void DrawPlayer(Player drawPlayer)
{
int index = 0;
int index2 = 0;
int index3 = 0;
if (drawPlayer.dye[0] != null)
{
index = (int)drawPlayer.dye[0].dye;
}
if (drawPlayer.dye[1] != null)
{
index2 = (int)drawPlayer.dye[1].dye;
}
if (drawPlayer.dye[2] != null)
{
index3 = (int)drawPlayer.dye[2].dye;
}
if (drawPlayer.shadow == 0f)
{
drawPlayer.position.Y = drawPlayer.position.Y + drawPlayer.gfxOffY;
}
drawPlayer.itemLocation.Y = drawPlayer.itemLocation.Y + drawPlayer.gfxOffY;
SpriteEffects effects = SpriteEffects.None;
Color color = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), Color.White));
Color color2 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.eyeColor));
Color color3 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.hairColor));
Color color4 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.skinColor));
Color color5 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.skinColor));
Color immuneAlpha = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.skinColor));
Color color6 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.shirtColor));
Color color7 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.underShirtColor));
Color color8 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.pantsColor));
Color color9 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.shoeColor));
Color color10 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16, Color.White));
Color color11 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16, Color.White));
Color color12 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16, Color.White));
if (drawPlayer.head > 0 && drawPlayer.head < 112)
{
this.LoadArmorHead(drawPlayer.head);
}
if (drawPlayer.body > 0 && drawPlayer.body < 75)
{
this.LoadArmorBody(drawPlayer.body);
}
if (drawPlayer.legs > 0 && drawPlayer.legs < 64)
{
this.LoadArmorLegs(drawPlayer.legs);
}
this.LoadHair(drawPlayer.hair);
if ((drawPlayer.head == 78 || drawPlayer.head == 79 || drawPlayer.head == 80) && drawPlayer.body == 51 && drawPlayer.legs == 47)
{
float num = (float)Main.mouseTextColor / 200f - 0.3f;
if (drawPlayer.shadow != 0f)
{
num = 0f;
}
color10.G = (byte)((float)color10.G * num);
color11.G = (byte)((float)color11.G * num);
color12.G = (byte)((float)color12.G * num);
color10.B = (byte)((float)color10.B * num);
color10.R = (byte)((float)color10.R * num);
color11.B = (byte)((float)color11.B * num);
color11.R = (byte)((float)color11.R * num);
color12.B = (byte)((float)color12.B * num);
color12.R = (byte)((float)color12.R * num);
}
if (drawPlayer.shadow > 0f)
{
immuneAlpha = new Color(0, 0, 0, 0);
color5 = new Color(0, 0, 0, 0);
color4 = new Color(0, 0, 0, 0);
color3 = new Color(0, 0, 0, 0);
color2 = new Color(0, 0, 0, 0);
color = new Color(0, 0, 0, 0);
}
float num2 = 1f;
float num3 = 1f;
float num4 = 1f;
float num5 = 1f;
if (drawPlayer.honey && Main.rand.Next(30) == 0)
{
int num6 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 152, 0f, 0f, 150, default(Color), 1f);
Main.dust[num6].velocity.Y = 0.3f;
Dust expr_79B_cp_0 = Main.dust[num6];
expr_79B_cp_0.velocity.X = expr_79B_cp_0.velocity.X * 0.1f;
Main.dust[num6].scale += (float)Main.rand.Next(3, 4) * 0.1f;
Main.dust[num6].alpha = 100;
Main.dust[num6].noGravity = true;
Main.dust[num6].velocity += drawPlayer.velocity * 0.1f;
}
if (drawPlayer.poisoned)
{
if (Main.rand.Next(50) == 0)
{
int num7 = Dust.NewDust(drawPlayer.position, drawPlayer.width, drawPlayer.height, 46, 0f, 0f, 150, default(Color), 0.2f);
Main.dust[num7].noGravity = true;
Main.dust[num7].fadeIn = 1.9f;
}
num2 *= 0.65f;
num4 *= 0.75f;
//.........這裏部分代碼省略.........
示例6: DrawPlayer
//.........這裏部分代碼省略.........
num11 = num20;
}
if (num12 == 65)
{
num12 = num20;
}
if (num13 == 65)
{
num13 = num20;
}
if (num14 == 65)
{
num14 = num20;
}
if (num15 == 65)
{
num15 = num20;
}
if (num16 == 65)
{
num16 = num20;
}
if (num17 == 65)
{
num17 = num20;
}
if (num18 == 65)
{
num18 = num20;
}
drawPlayer.itemLocation.Y = drawPlayer.itemLocation.Y + drawPlayer.gfxOffY;
SpriteEffects spriteEffects = SpriteEffects.None;
SpriteEffects effect = SpriteEffects.FlipHorizontally;
Color color = drawPlayer.GetImmuneAlpha(drawPlayer.GetHairColor(true), shadow);
Color color2 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.25) / 16.0), Color.White), shadow);
Color color3 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.eyeColor), shadow);
Color color4 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.skinColor), shadow);
Color color5 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.skinColor), shadow);
Color color6 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.skinColor), shadow);
Color color7 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.shirtColor), shadow);
Color color8 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.underShirtColor), shadow);
Color color9 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.pantsColor), shadow);
Color color10 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)Position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.shoeColor), shadow);
Color color11 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)Position.Y + (double)drawPlayer.height * 0.25) / 16, Color.White), shadow);
Color color12 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)Position.Y + (double)drawPlayer.height * 0.5) / 16, Color.White), shadow);
Color color13 = drawPlayer.GetImmuneAlphaPure(Lighting.GetColor((int)((double)Position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)Position.Y + (double)drawPlayer.height * 0.75) / 16, Color.White), shadow);
if (drawPlayer.head > 0 && drawPlayer.head < 169)
{
this.LoadArmorHead(drawPlayer.head);
}
if (drawPlayer.body > 0 && drawPlayer.body < 175)
{
this.LoadArmorBody(drawPlayer.body);
}
if (drawPlayer.legs > 0 && drawPlayer.legs < 110)
{
this.LoadArmorLegs(drawPlayer.legs);
}
if (drawPlayer.handon > 0 && drawPlayer.handon < 18)
{
this.LoadAccHandsOn((int)drawPlayer.handon);
}
if (drawPlayer.handoff > 0 && drawPlayer.handoff < 11)
{
this.LoadAccHandsOff((int)drawPlayer.handoff);
}
示例7: DrawPlayer
protected void DrawPlayer(Player drawPlayer)
{
SpriteEffects none = SpriteEffects.None;
SpriteEffects flipHorizontally = SpriteEffects.FlipHorizontally;
Color immuneAlpha = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int) ((drawPlayer.position.Y + (drawPlayer.height * 0.25)) / 16.0), Color.White));
Color color = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int) ((drawPlayer.position.Y + (drawPlayer.height * 0.25)) / 16.0), drawPlayer.eyeColor));
Color color3 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int) ((drawPlayer.position.Y + (drawPlayer.height * 0.25)) / 16.0), drawPlayer.hairColor));
Color color4 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int) ((drawPlayer.position.Y + (drawPlayer.height * 0.25)) / 16.0), drawPlayer.skinColor));
Color color5 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int) ((drawPlayer.position.Y + (drawPlayer.height * 0.5)) / 16.0), drawPlayer.skinColor));
Color color6 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int) ((drawPlayer.position.Y + (drawPlayer.height * 0.5)) / 16.0), drawPlayer.shirtColor));
Color color7 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int) ((drawPlayer.position.Y + (drawPlayer.height * 0.5)) / 16.0), drawPlayer.underShirtColor));
Color color8 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int) ((drawPlayer.position.Y + (drawPlayer.height * 0.75)) / 16.0), drawPlayer.pantsColor));
Color color9 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int) ((drawPlayer.position.Y + (drawPlayer.height * 0.75)) / 16.0), drawPlayer.shoeColor));
Color color10 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, ((int) (drawPlayer.position.Y + (drawPlayer.height * 0.75))) / 0x10, Color.White));
Color color11 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, ((int) (drawPlayer.position.Y + (drawPlayer.height * 0.5))) / 0x10, Color.White));
Color color12 = drawPlayer.GetImmuneAlpha(Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, ((int) (drawPlayer.position.Y + (drawPlayer.height * 0.25))) / 0x10, Color.White));
if (drawPlayer.direction == 1)
{
none = SpriteEffects.None;
flipHorizontally = SpriteEffects.None;
}
else
{
none = SpriteEffects.FlipHorizontally;
flipHorizontally = SpriteEffects.FlipHorizontally;
}
Vector2 origin = new Vector2(drawPlayer.legFrame.Width * 0.5f, drawPlayer.legFrame.Height * 0.75f);
Vector2 vector2 = new Vector2(drawPlayer.legFrame.Width * 0.5f, drawPlayer.legFrame.Height * 0.5f);
Vector2 vector3 = new Vector2(drawPlayer.legFrame.Width * 0.5f, drawPlayer.legFrame.Height * 0.25f);
if ((drawPlayer.legs > 0) && (drawPlayer.legs < 10))
{
this.spriteBatch.Draw(armorLegTexture[drawPlayer.legs], (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.legFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.legFrame.Height) + 4f))) + drawPlayer.legPosition) + origin, new Rectangle?(drawPlayer.legFrame), color12, drawPlayer.legRotation, origin, (float) 1f, none, 0f);
}
else
{
this.spriteBatch.Draw(playerPantsTexture, (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.legFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.legFrame.Height) + 4f))) + drawPlayer.legPosition) + origin, new Rectangle?(drawPlayer.legFrame), color8, drawPlayer.legRotation, origin, (float) 1f, none, 0f);
this.spriteBatch.Draw(playerShoesTexture, (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.legFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.legFrame.Height) + 4f))) + drawPlayer.legPosition) + origin, new Rectangle?(drawPlayer.legFrame), color9, drawPlayer.legRotation, origin, (float) 1f, none, 0f);
}
if ((drawPlayer.body > 0) && (drawPlayer.body < 10))
{
this.spriteBatch.Draw(armorBodyTexture[drawPlayer.body], (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.bodyFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.bodyFrame.Height) + 4f))) + drawPlayer.bodyPosition) + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color11, drawPlayer.bodyRotation, vector2, (float) 1f, none, 0f);
}
else
{
this.spriteBatch.Draw(playerUnderShirtTexture, (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.bodyFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.bodyFrame.Height) + 4f))) + drawPlayer.bodyPosition) + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color7, drawPlayer.bodyRotation, vector2, (float) 1f, none, 0f);
this.spriteBatch.Draw(playerShirtTexture, (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.bodyFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.bodyFrame.Height) + 4f))) + drawPlayer.bodyPosition) + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color6, drawPlayer.bodyRotation, vector2, (float) 1f, none, 0f);
this.spriteBatch.Draw(playerHandsTexture, (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.bodyFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.bodyFrame.Height) + 4f))) + drawPlayer.bodyPosition) + new Vector2((float) (drawPlayer.bodyFrame.Width / 2), (float) (drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), color5, drawPlayer.bodyRotation, vector2, (float) 1f, none, 0f);
}
this.spriteBatch.Draw(playerHeadTexture, (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.bodyFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.bodyFrame.Height) + 4f))) + drawPlayer.headPosition) + vector3, new Rectangle?(drawPlayer.bodyFrame), color4, drawPlayer.headRotation, vector3, (float) 1f, none, 0f);
this.spriteBatch.Draw(playerEyeWhitesTexture, (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.bodyFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.bodyFrame.Height) + 4f))) + drawPlayer.headPosition) + vector3, new Rectangle?(drawPlayer.bodyFrame), immuneAlpha, drawPlayer.headRotation, vector3, (float) 1f, none, 0f);
this.spriteBatch.Draw(playerEyesTexture, (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.bodyFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.bodyFrame.Height) + 4f))) + drawPlayer.headPosition) + vector3, new Rectangle?(drawPlayer.bodyFrame), color, drawPlayer.headRotation, vector3, (float) 1f, none, 0f);
if (drawPlayer.head == 10)
{
this.spriteBatch.Draw(armorHeadTexture[drawPlayer.head], (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.bodyFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.bodyFrame.Height) + 4f))) + drawPlayer.headPosition) + vector3, new Rectangle?(drawPlayer.bodyFrame), color10, drawPlayer.headRotation, vector3, (float) 1f, none, 0f);
Rectangle bodyFrame = drawPlayer.bodyFrame;
bodyFrame.Y -= 0x150;
if (bodyFrame.Y < 0)
{
bodyFrame.Y = 0;
}
this.spriteBatch.Draw(playerHairTexture[drawPlayer.hair], (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.bodyFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.bodyFrame.Height) + 4f))) + drawPlayer.headPosition) + vector3, new Rectangle?(bodyFrame), color3, drawPlayer.headRotation, vector3, (float) 1f, none, 0f);
}
else if ((drawPlayer.head > 0) && (drawPlayer.head < 12))
{
this.spriteBatch.Draw(armorHeadTexture[drawPlayer.head], (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.bodyFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.bodyFrame.Height) + 4f))) + drawPlayer.headPosition) + vector3, new Rectangle?(drawPlayer.bodyFrame), color10, drawPlayer.headRotation, vector3, (float) 1f, none, 0f);
}
else
{
Rectangle rectangle2 = drawPlayer.bodyFrame;
rectangle2.Y -= 0x150;
if (rectangle2.Y < 0)
{
rectangle2.Y = 0;
}
this.spriteBatch.Draw(playerHairTexture[drawPlayer.hair], (new Vector2((float) ((((int) (drawPlayer.position.X - screenPosition.X)) - (drawPlayer.bodyFrame.Width / 2)) + (drawPlayer.width / 2)), (float) ((int) ((((drawPlayer.position.Y - screenPosition.Y) + drawPlayer.height) - drawPlayer.bodyFrame.Height) + 4f))) + drawPlayer.headPosition) + vector3, new Rectangle?(rectangle2), color3, drawPlayer.headRotation, vector3, (float) 1f, none, 0f);
}
Color newColor = Lighting.GetColor(((int) (drawPlayer.position.X + (drawPlayer.width * 0.5))) / 0x10, (int) ((drawPlayer.position.Y + (drawPlayer.height * 0.5)) / 16.0));
if (((drawPlayer.itemAnimation > 0) || (drawPlayer.inventory[drawPlayer.selectedItem].holdStyle > 0)) && (((drawPlayer.inventory[drawPlayer.selectedItem].type > 0) && !drawPlayer.dead) && !drawPlayer.inventory[drawPlayer.selectedItem].noUseGraphic))
{
if (drawPlayer.inventory[drawPlayer.selectedItem].useStyle == 5)
{
int num = 10;
Vector2 vector4 = new Vector2((float) (itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Width / 2), (float) (itemTexture[drawPlayer.inventory[drawPlayer.selectedItem].type].Height / 2));
if (drawPlayer.inventory[drawPlayer.selectedItem].type == 0x5f)
{
num = 10;
vector4.Y += 2f;
}
else if (drawPlayer.inventory[drawPlayer.selectedItem].type == 0x60)
{
num = -5;
}
else if (drawPlayer.inventory[drawPlayer.selectedItem].type == 0x62)
{
num = -5;
vector4.Y -= 2f;
}
else if (drawPlayer.inventory[drawPlayer.selectedItem].type == 0xc5)
{
num = -5;
//.........這裏部分代碼省略.........
示例8: DrawPlayer
//.........這裏部分代碼省略.........
num10 = num18;
}
if (num11 == 65)
{
num11 = num18;
}
if (num12 == 65)
{
num12 = num18;
}
if (num13 == 65)
{
num13 = num18;
}
if (num14 == 65)
{
num14 = num18;
}
if (num15 == 65)
{
num15 = num18;
}
if (num16 == 65)
{
num16 = num18;
}
if (drawPlayer.shadow == 0f)
{
drawPlayer.position.Y = drawPlayer.position.Y + drawPlayer.gfxOffY;
}
drawPlayer.itemLocation.Y = drawPlayer.itemLocation.Y + drawPlayer.gfxOffY;
SpriteEffects effects = SpriteEffects.None;
SpriteEffects effects2 = SpriteEffects.FlipHorizontally;
Color color = drawPlayer.GetImmuneAlpha(drawPlayer.GetHairColor(true));
Color color2 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), Color.White));
Color color3 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.eyeColor));
Color color4 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.skinColor));
Color color5 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.skinColor));
Color immuneAlpha = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.skinColor));
Color color6 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.shirtColor));
Color color7 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.underShirtColor));
Color color8 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.pantsColor));
Color color9 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.shoeColor));
Color color10 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16, Color.White));
Color color11 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16, Color.White));
Color color12 = drawPlayer.GetImmuneAlpha2(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16, Color.White));
if (drawPlayer.head > 0 && drawPlayer.head < 160)
{
this.LoadArmorHead(drawPlayer.head);
}
if (drawPlayer.body > 0 && drawPlayer.body < 168)
{
this.LoadArmorBody(drawPlayer.body);
}
if (drawPlayer.legs > 0 && drawPlayer.legs < 103)
{
this.LoadArmorLegs(drawPlayer.legs);
}
if (drawPlayer.handon > 0 && drawPlayer.handon < 18)
{
this.LoadAccHandsOn((int)drawPlayer.handon);
}
if (drawPlayer.handoff > 0 && drawPlayer.handoff < 11)
{
this.LoadAccHandsOff((int)drawPlayer.handoff);
}
示例9: DrawPlayer
protected void DrawPlayer(Player drawPlayer)
{
Color immuneAlpha1 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), Color.White));
Color immuneAlpha2 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.eyeColor));
Color immuneAlpha3 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.hairColor));
Color immuneAlpha4 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16.0), drawPlayer.skinColor));
Color immuneAlpha5 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.skinColor));
Color immuneAlpha6 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.shirtColor));
Color immuneAlpha7 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16.0), drawPlayer.underShirtColor));
Color immuneAlpha8 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.pantsColor));
Color immuneAlpha9 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)(((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16.0), drawPlayer.shoeColor));
Color immuneAlpha10 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.75) / 16, Color.White));
Color immuneAlpha11 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.5) / 16, Color.White));
Color immuneAlpha12 = drawPlayer.GetImmuneAlpha(Lighting.GetColor((int)((double)drawPlayer.position.X + (double)drawPlayer.width * 0.5) / 16, (int)((double)drawPlayer.position.Y + (double)drawPlayer.height * 0.25) / 16, Color.White));
SpriteEffects effects1;
SpriteEffects effects2;
if (drawPlayer.direction == 1)
{
effects1 = SpriteEffects.None;
effects2 = SpriteEffects.None;
}
else
{
effects1 = SpriteEffects.FlipHorizontally;
effects2 = SpriteEffects.FlipHorizontally;
}
Vector2 origin1 = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.75f);
Vector2 origin2 = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.5f);
Vector2 origin3 = new Vector2((float)drawPlayer.legFrame.Width * 0.5f, (float)drawPlayer.legFrame.Height * 0.25f);
if (drawPlayer.legs > 0 && drawPlayer.legs < 15)
{
this.spriteBatch.Draw(Main.armorLegTexture[drawPlayer.legs], new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.legFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.legFrame.Height + 4.0)) + drawPlayer.legPosition + origin1, new Rectangle?(drawPlayer.legFrame), immuneAlpha12, drawPlayer.legRotation, origin1, 1f, effects1, 0.0f);
}
else
{
this.spriteBatch.Draw(Main.playerPantsTexture, new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.legFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.legFrame.Height + 4.0)) + drawPlayer.legPosition + origin1, new Rectangle?(drawPlayer.legFrame), immuneAlpha8, drawPlayer.legRotation, origin1, 1f, effects1, 0.0f);
this.spriteBatch.Draw(Main.playerShoesTexture, new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.legFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.legFrame.Height + 4.0)) + drawPlayer.legPosition + origin1, new Rectangle?(drawPlayer.legFrame), immuneAlpha9, drawPlayer.legRotation, origin1, 1f, effects1, 0.0f);
}
if (drawPlayer.body > 0 && drawPlayer.body < 16)
{
this.spriteBatch.Draw(Main.armorBodyTexture[drawPlayer.body], new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), immuneAlpha11, drawPlayer.bodyRotation, origin2, 1f, effects1, 0.0f);
if (drawPlayer.body == 10 || drawPlayer.body == 11 || (drawPlayer.body == 12 || drawPlayer.body == 13) || drawPlayer.body == 14 || drawPlayer.body == 15)
this.spriteBatch.Draw(Main.playerHandsTexture, new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), immuneAlpha5, drawPlayer.bodyRotation, origin2, 1f, effects1, 0.0f);
}
else
{
this.spriteBatch.Draw(Main.playerUnderShirtTexture, new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), immuneAlpha7, drawPlayer.bodyRotation, origin2, 1f, effects1, 0.0f);
this.spriteBatch.Draw(Main.playerShirtTexture, new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), immuneAlpha6, drawPlayer.bodyRotation, origin2, 1f, effects1, 0.0f);
this.spriteBatch.Draw(Main.playerHandsTexture, new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.bodyPosition + new Vector2((float)(drawPlayer.bodyFrame.Width / 2), (float)(drawPlayer.bodyFrame.Height / 2)), new Rectangle?(drawPlayer.bodyFrame), immuneAlpha5, drawPlayer.bodyRotation, origin2, 1f, effects1, 0.0f);
}
this.spriteBatch.Draw(Main.playerHeadTexture, new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Rectangle?(drawPlayer.bodyFrame), immuneAlpha4, drawPlayer.headRotation, origin3, 1f, effects1, 0.0f);
this.spriteBatch.Draw(Main.playerEyeWhitesTexture, new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Rectangle?(drawPlayer.bodyFrame), immuneAlpha1, drawPlayer.headRotation, origin3, 1f, effects1, 0.0f);
this.spriteBatch.Draw(Main.playerEyesTexture, new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Rectangle?(drawPlayer.bodyFrame), immuneAlpha2, drawPlayer.headRotation, origin3, 1f, effects1, 0.0f);
Rectangle rectangle1;
if (drawPlayer.head == 10 || drawPlayer.head == 12)
{
this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Rectangle?(drawPlayer.bodyFrame), immuneAlpha10, drawPlayer.headRotation, origin3, 1f, effects1, 0.0f);
rectangle1 = drawPlayer.bodyFrame;
rectangle1.Y -= 336;
if (rectangle1.Y < 0)
rectangle1.Y = 0;
this.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Rectangle?(rectangle1), immuneAlpha3, drawPlayer.headRotation, origin3, 1f, effects1, 0.0f);
}
if (drawPlayer.head == 23)
{
rectangle1 = drawPlayer.bodyFrame;
rectangle1.Y -= 336;
if (rectangle1.Y < 0)
rectangle1.Y = 0;
this.spriteBatch.Draw(Main.playerHairTexture[drawPlayer.hair], new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Rectangle?(rectangle1), immuneAlpha3, drawPlayer.headRotation, origin3, 1f, effects1, 0.0f);
this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Rectangle?(drawPlayer.bodyFrame), immuneAlpha10, drawPlayer.headRotation, origin3, 1f, effects1, 0.0f);
}
else if (drawPlayer.head == 14)
{
Rectangle rectangle2 = drawPlayer.bodyFrame;
int num = 0;
if (rectangle2.Y == rectangle2.Height * 6)
rectangle2.Height -= 2;
else if (rectangle2.Y == rectangle2.Height * 7)
num = -2;
else if (rectangle2.Y == rectangle2.Height * 8)
num = -2;
else if (rectangle2.Y == rectangle2.Height * 9)
num = -2;
else if (rectangle2.Y == rectangle2.Height * 10)
num = -2;
else if (rectangle2.Y == rectangle2.Height * 13)
rectangle2.Height -= 2;
else if (rectangle2.Y == rectangle2.Height * 14)
num = -2;
else if (rectangle2.Y == rectangle2.Height * 15)
num = -2;
else if (rectangle2.Y == rectangle2.Height * 16)
num = -2;
rectangle2.Y += num;
this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0 + (double)num)) + drawPlayer.headPosition + origin3, new Rectangle?(rectangle2), immuneAlpha10, drawPlayer.headRotation, origin3, 1f, effects1, 0.0f);
}
else if (drawPlayer.head > 0 && drawPlayer.head < 27)
{
this.spriteBatch.Draw(Main.armorHeadTexture[drawPlayer.head], new Vector2((float)(int)((double)drawPlayer.position.X - (double)Main.screenPosition.X - (double)(drawPlayer.bodyFrame.Width / 2) + (double)(drawPlayer.width / 2)), (float)(int)((double)drawPlayer.position.Y - (double)Main.screenPosition.Y + (double)drawPlayer.height - (double)drawPlayer.bodyFrame.Height + 4.0)) + drawPlayer.headPosition + origin3, new Rectangle?(drawPlayer.bodyFrame), immuneAlpha10, drawPlayer.headRotation, origin3, 1f, effects1, 0.0f);
//.........這裏部分代碼省略.........