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


C# Player.AddBuff方法代码示例

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


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

示例1: UseItem

        public override bool UseItem(Player player)
        {
            if (player.altFunctionUse == 2)
            {
                if (player.HasBuff(mod.BuffType("UnPowered")) >= 0)
                {

                }
                else
                {
                    player.AddBuff(mod.BuffType("PowerUnleash"), 1800);
                    player.AddBuff(mod.BuffType("UnPowered"), 7200);
                }
            }

            return true;
        }
开发者ID:ColinAV516,项目名称:Spirit-Mod,代码行数:17,代码来源:DarkfireKatana.cs

示例2: UpdateEquip

        public override void UpdateEquip(Player player)
        {
            if (player.name == "Miniek" || player.name == "miniek" || player.name == "Eldrazi" || player.name == "eldrazi")
            {
                player.meleeDamage *= 1.3F; // Increase melee damage by 30%
                player.magicDamage *= 1.3F; // Increase magic damage by 30%
                player.rangedDamage *= 1.3F; // Increase ranged damage by 30%

                player.maxMinions += 8; // Increase the max amount of minions by 8.
                player.minionKB *= 1.75F; // Increase the knockback of the minions by 75%
                player.minionDamage *= 1.4F; // Increase the damage of minions by 40%

                player.moveSpeed *= 1.3F; // Increase move speed by 30%
                player.pickSpeed *= 1.5F; // Increase dig speed by 50%
                player.tileSpeed *= 1.5F; // Increase tile placement speed by 50%

                player.lifeRegen *= 10; // Insane health regen.
                player.manaRegen *= 10; // Insane mana regen.

                player.AddBuff(74, 2); // Did cursed flames buff for now. Will be a custom buff later on.
            }
            else
            {
                player.AddBuff(BuffID.OnFire, 2);
            }
        }
开发者ID:Eldrazi,项目名称:Mharadium,代码行数:26,代码来源:SatansSpell.cs

示例3: OnHitPlayer

        public override void OnHitPlayer(Player target, int damage, bool crit)
        {
            npc.life = 0;
            npc.checkDead();

            target.AddBuff(BuffID.Frostburn, 180); // Applies Frostburn debuff for 3 seconds.
        }
开发者ID:Eldrazi,项目名称:Gyrolite,代码行数:7,代码来源:NitrousGas.cs

示例4: UseStyle

		public override void UseStyle(Player player)
		{
			if (player.whoAmI == Main.myPlayer && player.itemTime == 0)
			{
				player.AddBuff(item.buffType, 3600, true);
			}
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:7,代码来源:ExampleLightPet.cs

示例5: OnHitPvp

		public override void OnHitPvp(Player target, int damage, bool crit)
		{
			if (Main.rand.Next(10) == 0)
			{
				target.AddBuff(BuffID.OnFire, 180, false);
			}
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:7,代码来源:MoltenDrill.cs

示例6: ModifyHitPlayer

 public override void ModifyHitPlayer(Player target, ref int damage, ref bool crit)
 {
     if (Main.rand.Next(3) == 0 || (Main.expertMode && Main.rand.Next(3) == 0))
     {
         target.AddBuff(mod.BuffType("Nullified"), Main.rand.Next(240, 300));
     }
 }
开发者ID:bluemagic123,项目名称:tModLoader,代码行数:7,代码来源:NullLaser.cs

示例7: OnHitPlayer

		public override void OnHitPlayer(Player target, int damage, bool crit)
		{
			if ((Main.expertMode || Main.rand.Next(2) == 0) && projectile.ai[0] >= 0f)
			{
				target.AddBuff((int)projectile.ai[0], (int)projectile.ai[1], true);
			}
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:7,代码来源:ElementBall.cs

示例8: OnHitPlayer

 public override void OnHitPlayer(Player target, int damage, bool crit)
 {
     if (Main.rand.Next(0, 3) == 0) // 33% chance to inflict the Ichor debuff for 3 seconds.
     {
         target.AddBuff(BuffID.Ichor, 180);
     }
 }
开发者ID:Eldrazi,项目名称:Gyrolite,代码行数:7,代码来源:AetheriaSlime.cs

示例9: OnHitPlayer

 public override void OnHitPlayer(Player target, int damage, bool crit)
 {
     if (!target.frozen && Main.rand.Next(0, 2) == 0) // 50% chance to freeze the player for 1.5 seconds.
     {
         target.AddBuff(BuffID.Frozen, 90);
     }
 }
开发者ID:Eldrazi,项目名称:Gyrolite,代码行数:7,代码来源:NitrousOrb.cs

示例10: OnHitPlayer

 public override void OnHitPlayer(Player player, int damage, bool crit)
 {
     if(Main.expertMode || Main.rand.Next(2) == 0)
     {
     player.AddBuff(BuffID.OnFire, 600, true);
     }
 }
开发者ID:digitalseraphim,项目名称:tModLoader,代码行数:7,代码来源:AbominationRun.cs

示例11: DamagePVP

        /// <summary>
        /// When a <see cref="Player" /> in PvP is damaged by the <see cref="Projectile" />.
        /// </summary>
        /// <param name="p">The <see cref="Player" /> that got damaged.</param>
        /// <param name="dir">In which direction the <see cref="Player"/> got hit.</param>
        /// <param name="dmg">The damage dealt to the <see cref="Player" />.</param>
        /// <param name="crit">Wether it was a critical hit or not.</param>
        /// <param name="cMult">The damage multiplier of a critical hit.</param>
        public override void DamagePVP(Player p, int dir, ref int dmg, ref bool crit, ref float cMult)
        {
            base.DamagePVP(p, dir, ref dmg, ref crit, ref cMult);

            if (Main.rand.Next(3) == 0)
                p.AddBuff(20, 300);
        }
开发者ID:RainbowDashGaming,项目名称:Terraria-Avalon-MODIFIED,代码行数:15,代码来源:Sporalash+Ball.cs

示例12: UpdateAccessory

        public override void UpdateAccessory(Player player)
        {
            player.lifeRegen *= 10; // Extreme mana regen.

            player.lifeMagnet = true; // Attracts heart from a longer distance.
            player.pStone = true; // Adds Philosopher's Stone effect.
            player.AddBuff(BuffID.Lifeforce, 2); // Adds the LifeForce buff.
        }
开发者ID:Eldrazi,项目名称:Mharadium,代码行数:8,代码来源:MharadiumHealthBand.cs

示例13: PlayerUpdate

 public static void PlayerUpdate(Player p)
 {
     MultiBlocks.Do();
     Waypoint.UpdateWaypoints();
     if (Main.rand.Next(2000) == 0)
     {
         foreach (object ob in Ulterraria.Debugs)
         {
             if (ob != null)
             {
                 Main.NewText(ob.ToString());
             }
         }
     }
     if (Main.keyState.IsKeyDown(XNA.Input.Keys.F) && Main.hasFocus && p.primesFury && p.HasBuff(192) == -1)
     {
         p.AddBuff(192, 1800);
     }
     int pFeatherAmount = 0;
     int fFeatherAmount = 0;
     int asteroidAmount = 0;
     for (int i = 0; i < Main.projectile.Length; i++)
     {
         if (Main.projectile[i].type == 686)
         {
             pFeatherAmount++;
         }
         if (Main.projectile[i].type == 687)
         {
             fFeatherAmount++;
         }
         if (Main.projectile[i].type == 844)
         {
             asteroidAmount++;
         }
     }
     if (p.phoenixFeather && Main.rand.Next(800) == 69 && pFeatherAmount < 4)
     {
         Projectile.NewProjectile(p.Center.X, p.Center.Y, 0, 0, 686, 67, 0f, Main.myPlayer);
     }
     if (p.kuiperBelt && Main.rand.Next(1100) == 69 && asteroidAmount < 6)
     {
         Projectile.NewProjectile(p.Center.X, p.Center.Y, 0, 0, 844, 81, 0f, Main.myPlayer);
     }
     if (p.froenixFeather && Main.rand.Next(800) == 69 && fFeatherAmount < 4)
     {
         Projectile.NewProjectile(p.Center.X, p.Center.Y, 0, 0, 687, 67, 0f, Main.myPlayer);
     }
     if (p.vanillaDamage > 0)
     {
         p.vanillaDamage -= 0.0005f;
         if (p.vanillaDamage < 0)
         {
             p.vanillaDamage = 0f;
         }
     }
 }
开发者ID:thegamingboffin,项目名称:Ulterraria_Reborn_GitHub,代码行数:57,代码来源:UlterrariaPlayers.cs

示例14: OnHitPlayer

		public override void OnHitPlayer(Player target, int damage, bool crit)
		{
			if (Main.rand.Next(2) == 0 && projectile.ai[0] >= 0f)
			{
				int debuff = GetDebuff();
				if (debuff >= 0)
				{
					target.AddBuff(debuff, GetDebuffTime(), true);
				}
			}
		}
开发者ID:DrakoGlyph,项目名称:tModLoader,代码行数:11,代码来源:ElementLaser.cs

示例15: UpdateAccessory

        public override void UpdateAccessory(Player player)
        {
            // Increase all damage by 30%
            player.meleeDamage += 0.3F;
            player.magicDamage += 0.3F;
            player.minionDamage += 0.3F;
            player.thrownDamage += 0.3F;
            player.rangedDamage += 0.3F;

            player.AddBuff(BuffID.WeaponImbueFire, 2);
        }
开发者ID:Eldrazi,项目名称:Mharadium,代码行数:11,代码来源:MharadiumEmblem.cs


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