mirror of
https://github.com/YouHaveTrouble/YHTMod.git
synced 2026-05-12 05:56:56 +00:00
configure a code style that is not completely cursed
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user