private void OnHit(Player player, NPC target, int damage, float knockback, bool crit) { if (Equipped(player) && crit && Main.rand.Next(0, 100) < 25) { DisinfectantWipes.CleanDebuff(player, 1); } }
private void OnHit(Player player, bool crit) { if (Equipped(player) && crit) { if (Main.rand.NextFloat() < 0.1f) { DisinfectantWipes.ReduceDebuffDurations(player); } if (Main.rand.NextFloat() < 0.25f) { SanitizerSpray.TransferRandomDebuffToNearbyEnemies(player); } } }
public static bool SanitizeEnemies(Player player, int bufftype, int time, float range) { bool triggered = false; for (int i = 0; i < Main.maxNPCs; i += 1) { NPC npc = Main.npc[i]; if ((npc.Center - player.Center).Length() < range) { if (npc.active && npc.buffImmune[bufftype] && !npc.dontTakeDamage) { continue; } npc.AddBuff(bufftype, time); DisinfectantWipes.MakeDusts(new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height), 2, Color.Red, ModContent.DustType <BioLumen>(), 1.5f); triggered = true; } } return(triggered); }