Files
CalamityModPublic/Projectiles/VanillaProjectileOverrides/CounterweightEffects.cs
T
Doze-Zoze 7bca87e6c6 Misc Balance Changes
- Mana Polarizer & Hydro lifesteal no longer requires holding a mage weapon
- Obliterator counterweights now cause an extra dimensional drive. Dmg nerf to compensate 475 -> 400
- Omega Blue set 69 -> 50 defense
- Glaive dmg 22 -> 19; ut 15 -> 22 shred DoT 60 -> 100, 0.6 -> 0.4 ssdm
- Blazing Star 10% -> 20% falloff, tile ricochets now cause falloff too
- Flamarang 2 -> 1 extra update, 37 -> 40 damage
- Undid the *dev only* amalgam debuff mult increase (stays +200%, same as public)
- Bloom Stone is now a flat +30 MPH buff
- Fixed Vodka doing literally nothing lol
- Nebulous Core spawns more consistently at a rate of 8 stars per second. Boosted its homing speed.
2026-05-19 11:20:38 -05:00

64 lines
2.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.ILEditing;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Projectiles.Melee.Yoyos;
using MonoMod;
using MonoMod.Cil;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.VanillaProjectileOverrides
{
public class CounterweightEffects : GlobalProjectile
{
public override bool InstancePerEntity => true;
bool runInitialization = false;
public override bool AppliesToEntity(Projectile entity, bool lateInstantiation)
{
//All counterweights fall within this range.
if (entity.type >= ProjectileID.BlackCounterweight && entity.type <= ProjectileID.YellowCounterweight)
return true;
return false;
}
public override bool PreAI(Projectile projectile)
{
var player = Main.player[projectile.owner];
int id = player.HeldItem.type;
if (!runInitialization)
{
if (id == ModContent.ItemType<Pandemic>())
projectile.MaxUpdates++;
runInitialization = true;
}
return true;
}
public override void OnHitNPC(Projectile projectile, NPC target, NPC.HitInfo hit, int damageDone)
{
var player = Main.player[projectile.owner];
int id = player.HeldItem.type;
if ( id == ModContent.ItemType<Pandemic>())
target.AddBuff(ModContent.BuffType<Plague>(), 300);
if (id == ModContent.ItemType<TheObliterator>())
{
foreach (var item in Main.ActiveProjectiles)
{
if (item.owner == player.whoAmI && item.ModProjectile is ObliteratorYoyo o)
{
o.DashQueue++;
item.netUpdate = true;
}
}
}
}
}
}