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


C# Player.HealEffect方法代码示例

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


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

示例1: ModifyHitNPC

        public override void ModifyHitNPC(Player player, NPC target, ref int damage, ref float knockBack, ref bool crit)
        {
            Vector2 loc = player.itemLocation;
            loc.Y -= 20;

            Random rand = new Random();
            int r = rand.Next(0, 6);

            if (r == 0)
            {
                for (int i = 0; i < 9; i++)
                {
                    Dust.NewDust(loc, 50, 30, mod.DustType("Garnsworddust"), 0.0F, 0.0F, 0, default(Color), 4.5F);
                }

                damage += (int) (damage * 0.4);

                int healamount = (int)(damage * 0.33);
                player.HealEffect(healamount, true);

                if (player.statLife + healamount <= (player.statLifeMax + player.statLifeMax2))
                {
                    player.statLife += healamount;
                }
                else
                {
                    player.statLife = (player.statLifeMax + player.statLifeMax2);
                }
            }
        }
开发者ID:Garnetty97,项目名称:Garnmod,代码行数:30,代码来源:Garnsword.cs

示例2: UseItem

        /// <summary>
        /// 
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public override bool? UseItem(Player p)
        {
            int heal = Math.Max(Main.rand.Next(90, 130), p.statLifeMax2 - p.statLife);

            p.statLife += heal;

            p.HealEffect(heal);

            return true;
        }
开发者ID:RainbowDashGaming,项目名称:Terraria-Avalon-MODIFIED,代码行数:15,代码来源:Medicine+Bottle.cs

示例3: Activate

 /// <summary>
 /// Activates the tome skill.
 /// </summary>
 /// <param name="p">The <see cref="Player" /> that activated the skill.</param>
 /// <remarks>No NetMessages have to be sent, this method is called on all clients and the server.</remarks>
 public override void Activate(Player p)
 {
     if (p.direction == 1)
     {
         if (p.statMana > 20)
         {
             p.statLife += 20;
             p.statMana -= 20;
             p.HealEffect(20);
         }
     }
     else if (p.statLife > 20)
     {
         p.statMana += 20;
         p.statLife -= 5 ;
         p.ManaEffect(20);
     }
 }
开发者ID:RainbowDashGaming,项目名称:Terraria-Avalon-MODIFIED,代码行数:23,代码来源:Tale+of+the+Dolt.cs

示例4: OnHitNPC

 public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
 {
     player.HealEffect(3);
     player.statLife += 3;
 }
开发者ID:ColinAV516,项目名称:EnergyMod,代码行数:5,代码来源:LeechingSword.cs

示例5: Activate

        /// <summary>
        /// Activates the tome skill.
        /// </summary>
        /// <param name="p">The <see cref="Player" /> that activated the skill.</param>
        /// <remarks>No NetMessages have to be sent, this method is called on all clients and the server.</remarks>
        public override void Activate(Player p)
        {
            if (p.statMana < 30f* p.manaCost)
                return;
            p.statMana = (int)(p.statMana - 30f * p.manaCost);

            if (Main.rand.Next(5) == 0 && (p.wet || p.lavaWet))
            {
                if (p.wet)
                    p.breath += 50;
                if (p.lavaWet)
                    p.AddBuff(1, 180);
            }
            else if (Main.rand.Next(2) == 0)
            {
                p.statMana += 130;
                p.ManaEffect(130);
            }
            else
            {
                p.statLife += 100;
                p.HealEffect(100);
            }
        }
开发者ID:RainbowDashGaming,项目名称:Terraria-Avalon-MODIFIED,代码行数:29,代码来源:Love+Up+and+Down.cs


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