当前位置: 首页>>代码示例>>C#>>正文


C# Player.ClearBuff方法代码示例

本文整理汇总了C#中Terraria.Player.ClearBuff方法的典型用法代码示例。如果您正苦于以下问题:C# Player.ClearBuff方法的具体用法?C# Player.ClearBuff怎么用?C# Player.ClearBuff使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Terraria.Player的用法示例。


在下文中一共展示了Player.ClearBuff方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Dismount

 public void Dismount(Player mountedPlayer)
 {
     if (!this._active)
     {
         return;
     }
     bool cart = this.Cart;
     this._active = false;
     mountedPlayer.ClearBuff(this._data.buff);
     this._mountSpecificData = null;
     if (cart)
     {
         mountedPlayer.ClearBuff(this._data.extraBuff);
         mountedPlayer.cartFlip = false;
         mountedPlayer.lastBoost = Vector2.Zero;
     }
     mountedPlayer.fullRotation = 0f;
     mountedPlayer.fullRotationOrigin = Vector2.Zero;
     if (Main.netMode != 2)
     {
         for (int i = 0; i < 100; i++)
         {
             if (this._type != 6 && this._type != 11 && this._type != 13)
             {
             }
         }
     }
     this.Reset();
     mountedPlayer.position.Y = mountedPlayer.position.Y + (float)mountedPlayer.height;
     mountedPlayer.height = 42;
     mountedPlayer.position.Y = mountedPlayer.position.Y - (float)mountedPlayer.height;
     if (mountedPlayer.whoAmI == Main.myPlayer)
     {
         NetMessage.SendData(13, -1, -1, "", mountedPlayer.whoAmI, 0f, 0f, 0f, 0, 0, 0);
     }
 }
开发者ID:sylar605,项目名称:TshockCN,代码行数:36,代码来源:Mount.cs

示例2: SetMount

 public void SetMount(int m, Player mountedPlayer, bool faceLeft = false)
 {
     if (this._type == m || m <= -1 || m >= 14)
     {
         return;
     }
     if (m == 5 && mountedPlayer.wet)
     {
         return;
     }
     if (!this._active)
     {
         this._active = true;
     }
     else
     {
         mountedPlayer.ClearBuff(this._data.buff);
         if (this.Cart)
         {
             mountedPlayer.ClearBuff(this._data.extraBuff);
             mountedPlayer.cartFlip = false;
             mountedPlayer.lastBoost = Vector2.Zero;
         }
         mountedPlayer.fullRotation = 0f;
         mountedPlayer.fullRotationOrigin = Vector2.Zero;
         this._mountSpecificData = null;
     }
     this._flyTime = 0;
     this._type = m;
     this._data = Mount.mounts[m];
     this._fatigueMax = (float)this._data.fatigueMax;
     if (!this.Cart || faceLeft || this.Directional)
     {
         mountedPlayer.AddBuff(this._data.buff, 3600, true);
         this._flipDraw = false;
     }
     else
     {
         mountedPlayer.AddBuff(this._data.extraBuff, 3600, true);
         this._flipDraw = true;
     }
     if (this._type == 9 && this._abilityCooldown < 20)
     {
         this._abilityCooldown = 20;
     }
     mountedPlayer.position.Y = mountedPlayer.position.Y + (float)mountedPlayer.height;
     for (int i = 0; i < (int)mountedPlayer.shadowPos.Length; i++)
     {
         mountedPlayer.shadowPos[i].Y = mountedPlayer.shadowPos[i].Y + (float)mountedPlayer.height;
     }
     mountedPlayer.height = 42 + this._data.heightBoost;
     mountedPlayer.position.Y = mountedPlayer.position.Y - (float)mountedPlayer.height;
     for (int j = 0; j < (int)mountedPlayer.shadowPos.Length; j++)
     {
         mountedPlayer.shadowPos[j].Y = mountedPlayer.shadowPos[j].Y - (float)mountedPlayer.height;
     }
     if (this._type == 7 || this._type == 8)
     {
         mountedPlayer.fullRotationOrigin = new Vector2((float)(mountedPlayer.width / 2), (float)(mountedPlayer.height / 2));
     }
     if (this._type == 8)
     {
         this._mountSpecificData = new Mount.DrillMountData();
     }
     if (Main.netMode != 2)
     {
     }
     if (mountedPlayer.whoAmI == Main.myPlayer)
     {
         NetMessage.SendData(13, -1, -1, "", mountedPlayer.whoAmI, 0f, 0f, 0f, 0, 0, 0);
     }
 }
开发者ID:sylar605,项目名称:TshockCN,代码行数:72,代码来源:Mount.cs

示例3: SetMount

		public void SetMount(int m, Player mountedPlayer, bool faceLeft = false)
		{
			if (this._type == m || m <= -1 || m >= 7)
			{
				return;
			}
			if (m == 5 && mountedPlayer.wet)
			{
				return;
			}
			if (this._active)
			{
				mountedPlayer.ClearBuff(this._data.buff);
				if (this._type == 6)
				{
					mountedPlayer.ClearBuff(this._data.extraBuff);
					mountedPlayer.cartFlip = false;
					mountedPlayer.fullRotation = 0f;
					mountedPlayer.fullRotationOrigin = Vector2.Zero;
					mountedPlayer.lastBoost = Vector2.Zero;
				}
			}
			else
			{
				this._active = true;
			}
			this._flyTime = 0;
			this._type = m;
			this._data = Mount.mounts[m];
			this._fatigueMax = (float)this._data.fatigueMax;
			if (this._type == 6 && !faceLeft)
			{
				mountedPlayer.AddBuff(this._data.extraBuff, 3600, true);
				this._flipDraw = true;
			}
			else
			{
				mountedPlayer.AddBuff(this._data.buff, 3600, true);
				this._flipDraw = false;
			}
			mountedPlayer.position.Y = mountedPlayer.position.Y + (float)mountedPlayer.height;
			mountedPlayer.height = 42 + this._data.heightBoost;
			mountedPlayer.position.Y = mountedPlayer.position.Y - (float)mountedPlayer.height;
			if (Main.netMode != 2)
			{
				for (int i = 0; i < 100; i++)
				{
					if (this._type == 6)
					{
						if (i % 10 == 0)
						{
							int type = Main.rand.Next(61, 64);
							int num = Gore.NewGore(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), Vector2.Zero, type, 1f);
							Main.gore[num].alpha = 100;
							Main.gore[num].velocity = Vector2.Transform(new Vector2(1f, 0f), Matrix.CreateRotationZ((float)(Main.rand.NextDouble() * 6.2831854820251465)));
						}
					}
					else
					{
						int num2 = Dust.NewDust(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), mountedPlayer.width + 40, mountedPlayer.height, this._data.spawnDust, 0f, 0f, 0, default(Color), 1f);
						Main.dust[num2].scale += (float)Main.rand.Next(-10, 21) * 0.01f;
						if (Main.rand.Next(2) == 0)
						{
							Main.dust[num2].scale *= 1.3f;
							Main.dust[num2].noGravity = true;
						}
						else
						{
							Main.dust[num2].velocity *= 0.5f;
						}
						Main.dust[num2].velocity += mountedPlayer.velocity * 0.8f;
					}
				}
			}
			if (mountedPlayer.whoAmi == Main.myPlayer)
			{
				NetMessage.SendData(13, -1, -1, "", mountedPlayer.whoAmi, 0f, 0f, 0f, 0);
			}
		}
开发者ID:EdgeKiller,项目名称:terrariaSource,代码行数:79,代码来源:Mount.cs

示例4: Dismount

		public void Dismount(Player mountedPlayer)
		{
			if (!this._active)
			{
				return;
			}
			this._active = false;
			mountedPlayer.ClearBuff(this._data.buff);
			if (this._type == 6)
			{
				mountedPlayer.ClearBuff(this._data.extraBuff);
				mountedPlayer.cartFlip = false;
				mountedPlayer.fullRotation = 0f;
				mountedPlayer.fullRotationOrigin = Vector2.Zero;
				mountedPlayer.lastBoost = Vector2.Zero;
			}
			if (Main.netMode != 2)
			{
				for (int i = 0; i < 100; i++)
				{
					if (this._type == 6)
					{
						if (i % 10 == 0)
						{
							int type = Main.rand.Next(61, 64);
							int num = Gore.NewGore(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), Vector2.Zero, type, 1f);
							Main.gore[num].alpha = 100;
							Main.gore[num].velocity = Vector2.Transform(new Vector2(1f, 0f), Matrix.CreateRotationZ((float)(Main.rand.NextDouble() * 6.2831854820251465)));
						}
					}
					else
					{
						int num2 = Dust.NewDust(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), mountedPlayer.width + 40, mountedPlayer.height, this._data.spawnDust, 0f, 0f, 0, default(Color), 1f);
						Main.dust[num2].scale += (float)Main.rand.Next(-10, 21) * 0.01f;
						if (Main.rand.Next(2) == 0)
						{
							Main.dust[num2].scale *= 1.3f;
							Main.dust[num2].noGravity = true;
						}
						else
						{
							Main.dust[num2].velocity *= 0.5f;
						}
						Main.dust[num2].velocity += mountedPlayer.velocity * 0.8f;
					}
				}
			}
			this.Reset();
			mountedPlayer.position.Y = mountedPlayer.position.Y + (float)mountedPlayer.height;
			mountedPlayer.height = 42;
			mountedPlayer.position.Y = mountedPlayer.position.Y - (float)mountedPlayer.height;
			if (mountedPlayer.whoAmi == Main.myPlayer)
			{
				NetMessage.SendData(13, -1, -1, "", mountedPlayer.whoAmi, 0f, 0f, 0f, 0);
			}
		}
开发者ID:EdgeKiller,项目名称:terrariaSource,代码行数:56,代码来源:Mount.cs

示例5: SetMount

 public void SetMount(int m, Player mountedPlayer, bool faceLeft = false)
 {
     if (this._type == m || m <= -1 || m >= 14)
     {
         return;
     }
     if (m == 5 && mountedPlayer.wet)
     {
         return;
     }
     if (this._active)
     {
         mountedPlayer.ClearBuff(this._data.buff);
         if (this.Cart)
         {
             mountedPlayer.ClearBuff(this._data.extraBuff);
             mountedPlayer.cartFlip = false;
             mountedPlayer.lastBoost = Vector2.Zero;
         }
         mountedPlayer.fullRotation = 0f;
         mountedPlayer.fullRotationOrigin = Vector2.Zero;
         this._mountSpecificData = null;
     }
     else
     {
         this._active = true;
     }
     this._flyTime = 0;
     this._type = m;
     this._data = Mount.mounts[m];
     this._fatigueMax = (float)this._data.fatigueMax;
     if (this.Cart && !faceLeft && !this.Directional)
     {
         mountedPlayer.AddBuff(this._data.extraBuff, 3600, true);
         this._flipDraw = true;
     }
     else
     {
         mountedPlayer.AddBuff(this._data.buff, 3600, true);
         this._flipDraw = false;
     }
     if (this._type == 9 && this._abilityCooldown < 20)
     {
         this._abilityCooldown = 20;
     }
     mountedPlayer.position.Y = mountedPlayer.position.Y + (float)mountedPlayer.height;
     for (int i = 0; i < mountedPlayer.shadowPos.Length; i++)
     {
         Vector2[] expr_14D_cp_0 = mountedPlayer.shadowPos;
         int expr_14D_cp_1 = i;
         expr_14D_cp_0[expr_14D_cp_1].Y = expr_14D_cp_0[expr_14D_cp_1].Y + (float)mountedPlayer.height;
     }
     mountedPlayer.height = 42 + this._data.heightBoost;
     mountedPlayer.position.Y = mountedPlayer.position.Y - (float)mountedPlayer.height;
     for (int j = 0; j < mountedPlayer.shadowPos.Length; j++)
     {
         Vector2[] expr_1AC_cp_0 = mountedPlayer.shadowPos;
         int expr_1AC_cp_1 = j;
         expr_1AC_cp_0[expr_1AC_cp_1].Y = expr_1AC_cp_0[expr_1AC_cp_1].Y - (float)mountedPlayer.height;
     }
     if (this._type == 7 || this._type == 8)
     {
         mountedPlayer.fullRotationOrigin = new Vector2((float)(mountedPlayer.width / 2), (float)(mountedPlayer.height / 2));
     }
     if (this._type == 8)
     {
         this._mountSpecificData = new Mount.DrillMountData();
     }
     if (Main.netMode != 2)
     {
         for (int k = 0; k < 100; k++)
         {
             if (this._type == 6 || this._type == 11 || this._type == 13)
             {
                 if (k % 10 == 0)
                 {
                     int type = Main.rand.Next(61, 64);
                     int num = Gore.NewGore(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), Vector2.Zero, type, 1f);
                     Main.gore[num].alpha = 100;
                     Main.gore[num].velocity = Vector2.Transform(new Vector2(1f, 0f), Matrix.CreateRotationZ((float)(Main.rand.NextDouble() * 6.2831854820251465)));
                 }
             }
             else
             {
                 int num2 = Dust.NewDust(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), mountedPlayer.width + 40, mountedPlayer.height, this._data.spawnDust, 0f, 0f, 0, default(Color), 1f);
                 Main.dust[num2].scale += (float)Main.rand.Next(-10, 21) * 0.01f;
                 if (this._data.spawnDustNoGravity)
                 {
                     Main.dust[num2].noGravity = true;
                 }
                 else if (Main.rand.Next(2) == 0)
                 {
                     Main.dust[num2].scale *= 1.3f;
                     Main.dust[num2].noGravity = true;
                 }
                 else
                 {
                     Main.dust[num2].velocity *= 0.5f;
                 }
                 Main.dust[num2].velocity += mountedPlayer.velocity * 0.8f;
//.........这里部分代码省略.........
开发者ID:MEFBAEA,项目名称:mefbaea,代码行数:101,代码来源:Mount.cs

示例6: SetMount

 public void SetMount(int m, Player mountedPlayer, bool faceLeft = false)
 {
     if (this._type == m || m <= -1 || m >= 14 || m == 5 && mountedPlayer.wet)
         return;
     if (this._active)
     {
         mountedPlayer.ClearBuff(this._data.buff);
         if (this.Cart)
         {
             mountedPlayer.ClearBuff(this._data.extraBuff);
             mountedPlayer.cartFlip = false;
             mountedPlayer.lastBoost = Vector2.Zero;
         }
         mountedPlayer.fullRotation = 0.0f;
         mountedPlayer.fullRotationOrigin = Vector2.Zero;
         this._mountSpecificData = (object)null;
     }
     else
         this._active = true;
     this._flyTime = 0;
     this._type = m;
     this._data = Mount.mounts[m];
     this._fatigueMax = (float)this._data.fatigueMax;
     if (this.Cart && !faceLeft && !this.Directional)
     {
         mountedPlayer.AddBuff(this._data.extraBuff, 3600, true);
         this._flipDraw = true;
     }
     else
     {
         mountedPlayer.AddBuff(this._data.buff, 3600, true);
         this._flipDraw = false;
     }
     if (this._type == 9 && this._abilityCooldown < 20)
         this._abilityCooldown = 20;
     mountedPlayer.position.Y += (float)mountedPlayer.height;
     for (int index = 0; index < mountedPlayer.shadowPos.Length; ++index)
         mountedPlayer.shadowPos[index].Y += (float)mountedPlayer.height;
     mountedPlayer.height = 42 + this._data.heightBoost;
     mountedPlayer.position.Y -= (float)mountedPlayer.height;
     for (int index = 0; index < mountedPlayer.shadowPos.Length; ++index)
         mountedPlayer.shadowPos[index].Y -= (float)mountedPlayer.height;
     if (this._type == 7 || this._type == 8)
         mountedPlayer.fullRotationOrigin = new Vector2((float)(mountedPlayer.width / 2), (float)(mountedPlayer.height / 2));
     if (this._type == 8)
         this._mountSpecificData = (object)new Mount.DrillMountData();
     if (Main.netMode != 2)
     {
         for (int index1 = 0; index1 < 100; ++index1)
         {
             if (this._type == 6 || this._type == 11 || this._type == 13)
             {
                 if (index1 % 10 == 0)
                 {
                     int Type = Main.rand.Next(61, 64);
                     int index2 = Gore.NewGore(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), Vector2.Zero, Type, 1f);
                     Main.gore[index2].alpha = 100;
                     Main.gore[index2].velocity = Vector2.Transform(new Vector2(1f, 0.0f), Matrix.CreateRotationZ((float)(Main.rand.NextDouble() * 6.28318548202515)));
                 }
             }
             else
             {
                 int index2 = Dust.NewDust(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), mountedPlayer.width + 40, mountedPlayer.height, this._data.spawnDust, 0.0f, 0.0f, 0, new Color(), 1f);
                 Main.dust[index2].scale += (float)Main.rand.Next(-10, 21) * 0.01f;
                 if (this._data.spawnDustNoGravity)
                     Main.dust[index2].noGravity = true;
                 else if (Main.rand.Next(2) == 0)
                 {
                     Main.dust[index2].scale *= 1.3f;
                     Main.dust[index2].noGravity = true;
                 }
                 else
                     Main.dust[index2].velocity *= 0.5f;
                 Main.dust[index2].velocity += mountedPlayer.velocity * 0.8f;
             }
         }
     }
     if (mountedPlayer.whoAmI != Main.myPlayer)
         return;
     NetMessage.SendData(13, -1, -1, "", mountedPlayer.whoAmI, 0.0f, 0.0f, 0.0f, 0, 0, 0);
 }
开发者ID:EmuDevs,项目名称:EDTerraria,代码行数:81,代码来源:Mount.cs

示例7: Dismount

 public void Dismount(Player mountedPlayer)
 {
     if (!this._active)
         return;
     bool cart = this.Cart;
     this._active = false;
     mountedPlayer.ClearBuff(this._data.buff);
     this._mountSpecificData = (object)null;
     if (cart)
     {
         mountedPlayer.ClearBuff(this._data.extraBuff);
         mountedPlayer.cartFlip = false;
         mountedPlayer.lastBoost = Vector2.Zero;
     }
     mountedPlayer.fullRotation = 0.0f;
     mountedPlayer.fullRotationOrigin = Vector2.Zero;
     if (Main.netMode != 2)
     {
         for (int index1 = 0; index1 < 100; ++index1)
         {
             if (this._type == 6 || this._type == 11 || this._type == 13)
             {
                 if (index1 % 10 == 0)
                 {
                     int Type = Main.rand.Next(61, 64);
                     int index2 = Gore.NewGore(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), Vector2.Zero, Type, 1f);
                     Main.gore[index2].alpha = 100;
                     Main.gore[index2].velocity = Vector2.Transform(new Vector2(1f, 0.0f), Matrix.CreateRotationZ((float)(Main.rand.NextDouble() * 6.28318548202515)));
                 }
             }
             else
             {
                 int index2 = Dust.NewDust(new Vector2(mountedPlayer.position.X - 20f, mountedPlayer.position.Y), mountedPlayer.width + 40, mountedPlayer.height, this._data.spawnDust, 0.0f, 0.0f, 0, new Color(), 1f);
                 Main.dust[index2].scale += (float)Main.rand.Next(-10, 21) * 0.01f;
                 if (this._data.spawnDustNoGravity)
                     Main.dust[index2].noGravity = true;
                 else if (Main.rand.Next(2) == 0)
                 {
                     Main.dust[index2].scale *= 1.3f;
                     Main.dust[index2].noGravity = true;
                 }
                 else
                     Main.dust[index2].velocity *= 0.5f;
                 Main.dust[index2].velocity += mountedPlayer.velocity * 0.8f;
             }
         }
     }
     this.Reset();
     mountedPlayer.position.Y += (float)mountedPlayer.height;
     mountedPlayer.height = 42;
     mountedPlayer.position.Y -= (float)mountedPlayer.height;
     if (mountedPlayer.whoAmI != Main.myPlayer)
         return;
     NetMessage.SendData(13, -1, -1, "", mountedPlayer.whoAmI, 0.0f, 0.0f, 0.0f, 0, 0, 0);
 }
开发者ID:EmuDevs,项目名称:EDTerraria,代码行数:55,代码来源:Mount.cs


注:本文中的Terraria.Player.ClearBuff方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。