コード例 #1
0
 public override void OnHitNPC(Item item, Player player, NPC target, int damage, float knockBack, bool crit)
 {
     if (item == player.HeldItem && Main.rand.NextFloat(0, 1) < Type1.GetValue())
     {
         SpawnLifeOrbs(player, target, damage);
     }
 }
コード例 #2
0
        public override string GetTolltipText(Item item)
        {
            int  value     = Type1.GetValueFormat();
            char plusMinus = Type1.GetValue() < 0 ? '-' : '+';

            return($"{ plusMinus }{ value } fishing power");
        }
コード例 #3
0
        public override bool ConsumeAmmo(Item item, Player player, ref float chanceToNotConsume)
        {
            float value = Type1.GetValue();

            chanceToNotConsume += value;
            return(true);
        }
コード例 #4
0
 public override void ProjOnHitPvp(Item item, Player player, Projectile projectile, Player target, int damage, bool crit)
 {
     if (item == player.HeldItem && Main.rand.NextFloat(0, 1) < Type1.GetValue())
     {
         SpawnLifeOrbs(player, target, damage);
     }
 }
コード例 #5
0
        public override string GetTolltipText(Item item)
        {
            float value       = Type1.GetValue();
            float valueFormat = Type1.GetValueFormat();

            return($"Up to { (value < 0 ? '-' : '+') }{ valueFormat }% attack speed above 50% life and up to { (value < 0 ? '+' : '-') }{ valueFormat }% below");
        }
コード例 #6
0
 void OnHit(Item item, Player player, Player target, int hitDamage)
 {
     if (item == player.HeldItem && Main.rand.NextFloat() < Type1.GetValue())
     {
         Bleed(target, hitDamage);
     }
 }
コード例 #7
0
 public override void ProjOnHitNPC(Item item, Player player, Projectile projectile, NPC target, int damage, float knockback, bool crit)
 {
     if (item == player.HeldItem && Main.rand.NextFloat(0, 1) < Type1.GetValue())
     {
         SpawnIcycles(player, target, damage);
     }
 }
コード例 #8
0
 public override void OnHitPvp(Item item, Player player, Player target, int damage, bool crit)
 {
     if (item == player.HeldItem && Main.rand.NextFloat(0, 1) < Type1.GetValue())
     {
         SpawnIcycles(player, target, damage);
     }
 }
コード例 #9
0
 public override void PlayerGetWeaponCrit(Item item, Item heldItem, Player player, ref float multiplier)
 {
     if (AffixItemItem.IsAccessoryEquipped(item, player))
     {
         multiplier += Type1.GetValue();
     }
 }
コード例 #10
0
 void Hit(Item item, Player player, Player target, int hitDamage)
 {
     if (item == player.HeldItem && Main.rand.NextFloat() < Type1.GetValue())
     {
         SpawnMeteor(player, target, hitDamage);
     }
 }
コード例 #11
0
 public override void PostHurt(Item item, Player player, bool pvp, bool quiet, double damage, int hitDirection, bool crit)
 {
     if (AffixItemItem.IsArmorEquipped(item, player) && PoMUtil.IsLowHP(player))
     {
         player.AddBuff(ModContent.BuffType <Adrenaline>(), (int)Math.Round(Type1.GetValue() * 60));
     }
 }
コード例 #12
0
 public override void PlayerModifyHitPvp(Item affixItem, Player player, Item item, Player target, ref float damageMultiplier, ref bool crit)
 {
     if (AffixItemItem.IsAccessoryEquipped(affixItem, player))
     {
         damageMultiplier += Type1.GetValue();
     }
 }
コード例 #13
0
 public override void ProjModifyHitPvp(Item item, Player player, Projectile projectile, Player target, ref float damageMultiplier, ref bool crit)
 {
     if (item == player.HeldItem && PoMUtil.IsLowHP(target))
     {
         damageMultiplier += Type1.GetValue();
     }
 }
コード例 #14
0
 void Hit(Item item, Player player, Player target, int hitDamage)
 {
     if (item == player.HeldItem && Main.rand.NextFloat() < Type1.GetValue())
     {
         SpawnChainLightning(player, target, hitDamage, false);
     }
 }
コード例 #15
0
 public override void ProjModifyHitNPC(Item item, Player player, Projectile projectile, NPC target, ref float damageMultiplier, ref float knockbackMultiplier, ref bool crit, ref int hitDirection)
 {
     if (crit && AffixItemItem.IsAccessoryEquipped(item, player))
     {
         damageMultiplier += Type1.GetValue();
     }
 }
コード例 #16
0
 public override void ProjModifyHitPvp(Item item, Player player, Projectile projectile, Player target, ref float damageMultiplier, ref bool crit)
 {
     if (crit && AffixItemItem.IsAccessoryEquipped(item, player))
     {
         damageMultiplier += Type1.GetValue();
     }
 }
コード例 #17
0
 public override void PlayerModifyHitNPC(Item affixItem, Player player, Item item, NPC target, ref float damageMultiplier, ref float knockbackMultiplier, ref bool crit)
 {
     if (crit && AffixItemItem.IsAccessoryEquipped(item, player))
     {
         damageMultiplier += Type1.GetValue();
     }
 }
コード例 #18
0
        void GainMoveSpeed(Player player)
        {
            int duration = (int)MathHelper.Clamp(Type2.GetValue() * 60, 1, 9999999);

            player.GetModPlayer <BuffPlayer>().AddWeaponMoveSpeedBuff(player, Type1.GetValue(), duration);
            lastProcTime = Main.GameUpdateCount;
        }
コード例 #19
0
 public override void NaturalLifeRegen(Item item, Player player, ref float regenMultiplier)
 {
     if (AffixItemItem.IsArmorEquipped(item, player))
     {
         regenMultiplier += Type1.GetValue();
     }
 }
コード例 #20
0
 public override void ProjModifyHitNPC(Item item, Player player, Projectile projectile, NPC target, ref float damageMultiplier, ref float knockbackMultiplier, ref bool crit, ref int hitDirection)
 {
     if (player.HeldItem == item)
     {
         float value = Type1.GetValue();
         damageMultiplier += value * PoMUtil.CountBuffs(target.buffType);
     }
 }
コード例 #21
0
 public override bool PreHurt(Item item, Player player, bool pvp, bool quiet, ref float damageMultiplier, ref int hitDirection, ref bool crit, ref bool customDamage, ref bool playSound, ref bool genGore, ref PlayerDeathReason damageSource)
 {
     if (AffixItemItem.IsAccessoryEquipped(item, player))
     {
         damageMultiplier += Type1.GetValue();
     }
     return(true);
 }
コード例 #22
0
 public override void ProjModifyHitPvp(Item item, Player player, Projectile projectile, Player target, ref float damageMultiplier, ref bool crit)
 {
     if (player.HeldItem == item)
     {
         float value = Type1.GetValue();
         damageMultiplier += value * PoMUtil.CountBuffs(target.buffType);
     }
 }
コード例 #23
0
        public override string GetTolltipText(Item item)
        {
            float value       = Type1.GetValue();
            float valueFormat = Type1.GetValueFormat();
            char  plusMinus   = value < 0 ? '-' : '+';

            return($"{ plusMinus }{ valueFormat }% life regen");
        }
コード例 #24
0
 void Hit(Item item, Player player, Player target)
 {
     if (item == player.HeldItem && Main.rand.NextFloat(1) < Type1.GetValue())
     {
         int durationTicks = (int)Math.Round(Type2.GetValue() * 60);
         target.AddBuff(BuffID.Confused, durationTicks, false);
     }
 }
コード例 #25
0
 void GainDodgeChance(Item item, Player player)
 {
     if (AffixItemItem.IsArmorEquipped(item, player) && (Main.GameUpdateCount - lastProcTime) >= (int)Math.Round(Type3.GetValue() * 60))
     {
         int durationTicks = (int)Math.Round((Type2.GetValue() * 60));
         player.GetModPlayer <BuffPlayer>().AddDodgeChanceBuff(player, Type1.GetValue(), durationTicks, false);
         lastProcTime = Main.GameUpdateCount;
     }
 }
コード例 #26
0
        public override void PostHurt(Item item, Player player, bool pvp, bool quiet, double damage, int hitDirection, bool crit)
        {
            if (AffixItemItem.IsArmorEquipped(item, player) && (Main.GameUpdateCount - lastProcTime) >= (int)Math.Round(Type3.GetValue() * 60))
            {
                player.GetModPlayer <BuffPlayer>().AddGreavesMoveSpeedBuff(player, Type1.GetValue(), (int)Math.Round(Type2.GetValue() * 60), false);

                lastProcTime = Main.GameUpdateCount;
            }
        }
コード例 #27
0
        public override string GetTolltipText(Item item)
        {
            float value       = Type1.GetValue();
            float valueFormat = Type1.GetValueFormat();

            char plusMinus = value < 0 ? '-' : '+';

            return($"{ plusMinus }{ valueFormat }% damage per enemy buff/debuff");
        }
コード例 #28
0
        public override void ProjModifyHitNPC(Item item, Player player, Projectile projectile, NPC target, ref float damageMultiplier, ref float knockbackMultiplier, ref bool crit, ref int hitDirection)
        {
            NPC realTarget = target.realLife >= 0 ? Main.npc[target.realLife] : target;

            if (item == player.HeldItem && (realTarget.life / (float)realTarget.lifeMax) <= PathOfModifiers.lowHPThreshold)
            {
                damageMultiplier += Type1.GetValue();
            }
        }
コード例 #29
0
 public override bool PlayerConsumeAmmo(Player player, Item item, Item ammo, ref float chanceToNotConsume)
 {
     if (AffixItemItem.IsArmorEquipped(item, player))
     {
         float value = Type1.GetValue();
         chanceToNotConsume += value;
     }
     return(true);
 }
コード例 #30
0
 void GainBuffs(Item item, Player player)
 {
     if (AffixItemItem.IsArmorEquipped(item, player))
     {
         int durationTicks = (int)Math.Round(Type1.GetValue() * 60);
         player.AddBuff(BuffID.Flipper, durationTicks);
         player.AddBuff(BuffID.Gills, durationTicks);
         player.AddBuff(BuffID.WaterWalking, durationTicks);
     }
 }