configure a code style that is not completely cursed

This commit is contained in:
2026-01-07 19:08:34 +01:00
parent a945f17711
commit fff8b5e7f1
18 changed files with 188 additions and 298 deletions
+11 -18
View File
@@ -5,24 +5,19 @@ using Vector2 = Microsoft.Xna.Framework.Vector2;
namespace YHTMod.Changes;
public class SummonerOnHitEffects : GlobalProjectile
{
public override void OnHitNPC(Projectile projectile, NPC target, NPC.HitInfo hit, int damageDone)
{
var player = Main.player[projectile.owner];
var modPlayer = player.GetModPlayer<YhtPlayer>();
if (projectile.minion && Main.myPlayer == projectile.owner)
{
if (modPlayer.SummonerAmbition)
{
public class SummonerOnHitEffects : GlobalProjectile {
public override void OnHitNPC(Projectile projectile, NPC target, NPC.HitInfo hit, int damageDone) {
Player player = Main.player[projectile.owner];
YhtPlayer modPlayer = player.GetModPlayer<YhtPlayer>();
if (projectile.minion && Main.myPlayer == projectile.owner) {
if (modPlayer.SummonerAmbition) {
if (
modPlayer.SummonerAmbitions.Contains("deerclops")
&& modPlayer.SummonerAmbitionDeerclopsCooldown == 0
&& Main.rand.NextBool(10)
)
{
) {
modPlayer.SummonerAmbitionDeerclopsCooldown = 5 * 60;
var direction = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f));
Vector2 direction = new Vector2(Main.rand.NextFloat(-1f, 1f), Main.rand.NextFloat(-1f, 1f));
direction.Normalize();
direction *= Main.rand.NextFloat(4f, 8f);
Projectile.NewProjectile(
@@ -39,18 +34,16 @@ public class SummonerOnHitEffects : GlobalProjectile
if (
modPlayer.SummonerAmbitions.Contains("queen_bee")
&& Main.rand.NextBool(4)
)
{
) {
target.AddBuff(BuffID.Poisoned, 5 * 60);
}
}
}
if (projectile.WhipSettings.Segments > 0)
{
if (projectile.WhipSettings.Segments > 0) {
projectile.damage = (int)(projectile.damage * 1.1);
}
base.OnHitNPC(projectile, target, hit, damageDone);
}
}
}