本文整理汇总了C#中Terraria.Projectile.Kill方法的典型用法代码示例。如果您正苦于以下问题:C# Projectile.Kill方法的具体用法?C# Projectile.Kill怎么用?C# Projectile.Kill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Terraria.Projectile
的用法示例。
在下文中一共展示了Projectile.Kill方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProjectileAiStyles
public static void ProjectileAiStyles(Projectile p, int aiStyle)
{
if (p.aiStyle == 125)
{
if (p.type != 656)
{
if (p.type == 653)
{
for (int num92 = 0; num92 < 5; num92++)
{
float num93 = p.velocity.X / 3f * (float)num92;
float num94 = p.velocity.Y / 3f * (float)num92;
int num95 = 4;
int num96 = Dust.NewDust(new Vector2(p.position.X + (float)num95, p.position.Y + (float)num95), p.width - num95 * 2, p.height - num95 * 2, 6, 0f, 0f, 100, default(Color), 1.2f);
Main.dust[num96].noGravity = true;
Main.dust[num96].velocity *= 0.1f;
Main.dust[num96].velocity += p.velocity * 0.1f;
Dust expr_47FA_cp_0 = Main.dust[num96];
expr_47FA_cp_0.position.X = expr_47FA_cp_0.position.X - num93;
Dust expr_4815_cp_0 = Main.dust[num96];
expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num94;
}
if (Main.rand.Next(5) == 0)
{
int num97 = 4;
int num98 = Dust.NewDust(new Vector2(p.position.X + (float)num97, p.position.Y + (float)num97), p.width - num97 * 2, p.height - num97 * 2, 6, 0f, 0f, 100, default(Color), 0.6f);
Main.dust[num98].velocity *= 0.25f;
Main.dust[num98].velocity += p.velocity * 0.5f;
}
}
if (p.ai[0] < 45f && p.ai[1] == 0)
{
p.ai[0] += 1f;
}
else if (p.ai[0] == 45f && p.ai[1] == 0)
{
p.Kill();
}
else if (p.ai[1] == 1f)
{
p.velocity *= 1.4f;
p.ai[1]++;
}
else if (p.ai[1] >= 1f && p.ai[1] < 40f)
{
p.ai[1]++;
}
if (p.ai[1] >= 10f)
{
p.Kill();
}
}
else
{
for (int num92 = 0; num92 < 5; num92++)
{
float num93 = p.velocity.X / 3f * (float)num92;
float num94 = p.velocity.Y / 3f * (float)num92;
int num95 = 4;
int num96 = Dust.NewDust(new Vector2(p.position.X + (float)num95, p.position.Y + (float)num95), p.width - num95 * 2, p.height - num95 * 2, 180, 0f, 0f, 100, default(Color), 1.2f);
Main.dust[num96].noGravity = true;
Main.dust[num96].velocity *= 0.1f;
Main.dust[num96].velocity += p.velocity * 0.1f;
Dust expr_47FA_cp_0 = Main.dust[num96];
expr_47FA_cp_0.position.X = expr_47FA_cp_0.position.X - num93;
Dust expr_4815_cp_0 = Main.dust[num96];
expr_4815_cp_0.position.Y = expr_4815_cp_0.position.Y - num94;
}
if (Main.rand.Next(5) == 0)
{
int num97 = 4;
int num98 = Dust.NewDust(new Vector2(p.position.X + (float)num97, p.position.Y + (float)num97), p.width - num97 * 2, p.height - num97 * 2, 180, 0f, 0f, 100, default(Color), 0.6f);
Main.dust[num98].velocity *= 0.25f;
Main.dust[num98].velocity += p.velocity * 0.5f;
}
p.ai[0]++;
if (p.ai[0] < 90)
{
float sp = 8f;
Vector2 pos = Main.player[Main.myPlayer].Center - p.Center;
float mag = (float)Math.Sqrt(pos.X * pos.X + pos.Y * pos.Y);
if (mag > sp)
{
pos *= mag / sp;
}
p.velocity = pos;
}
else
{
p.velocity *= 1.02f;
}
}
}
else if (p.aiStyle == 126)
{
if (p.type == 659)
{
p.ai[0]++;
if (p.ai[0] < 30f && p.ai[1] == 0f)
{
//.........这里部分代码省略.........