From 02103014240ab985dac7412dcc400d910ab66142 Mon Sep 17 00:00:00 2001 From: Xhack <72313282+energykid@users.noreply.github.com> Date: Tue, 21 May 2024 14:01:35 -0400 Subject: [PATCH] Un-exploded the PR request --- .../BaseCustomUseStyleProjectile.cs | 53 ++----------------- 1 file changed, 4 insertions(+), 49 deletions(-) diff --git a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs index e662a81fae..0b9ec47dfe 100644 --- a/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseCustomUseStyleProjectile.cs @@ -22,10 +22,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles { Projectile.friendly = true; Projectile.tileCollide = false; -<<<<<<< Updated upstream -======= Projectile.penetrate = -1; ->>>>>>> Stashed changes } public override void OnSpawn(IEntitySource source) @@ -39,11 +36,6 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// public Vector2 Offset = Vector2.Zero; -<<<<<<< Updated upstream -======= - public float RestrikeDelay = 0; - ->>>>>>> Stashed changes /// /// The Player that is using the projectile. /// @@ -100,41 +92,20 @@ namespace CalamityMod.Projectiles.BaseProjectiles /// The origin of the sprite when drawn on your character. /// /// -<<<<<<< Updated upstream - public virtual Vector2 SpriteOrigin() - { - return Projectile.Size / 2; - } -======= public virtual Vector2 SpriteOrigin => Projectile.Size / 2; ->>>>>>> Stashed changes /// /// Helper method for getting the rotation of the sprite plus RotationOffset, without having to make your own local variable every time. /// /// -<<<<<<< Updated upstream - public float FinalRotation() - { - return Projectile.rotation + RotationOffset; - } -======= public float FinalRotation => Projectile.rotation + RotationOffset; ->>>>>>> Stashed changes /// /// Rotation offset for the hitbox that doesn't affect the sprite. /// Useful for if you have, for instance, a sword sprite at a 45 degree angle, and need that to reflect on the hitbox. /// /// -<<<<<<< Updated upstream - public virtual float HitboxRotationOffset() - { - return 0f; - } -======= public virtual float HitboxRotationOffset => 0f; ->>>>>>> Stashed changes /// /// Whether or not the projectile can hit enemies at the current frame. @@ -182,14 +153,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void AI() { -<<<<<<< Updated upstream - Projectile.penetrate = 100; -======= Owner.Calamity().mouseWorldListener = true; - RestrikeDelay--; ->>>>>>> Stashed changes - if (Owner.ItemAnimationActive) { Animation++; @@ -238,18 +203,14 @@ namespace CalamityMod.Projectiles.BaseProjectiles } } -<<<<<<< Updated upstream -======= public override bool? CanHitNPC(NPC target) { - bool bb = (target.immune[0] <= 0) && !target.friendly && !target.dontTakeDamage && RestrikeDelay <= 0; - - if (bb) RestrikeDelay = 1; + bool bb = (target.immune[0] <= 0) && !target.friendly && !target.dontTakeDamage; return bb; } ->>>>>>> Stashed changes + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { modifiers.HitDirectionOverride = Owner.direction; @@ -263,11 +224,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void ModifyDamageHitbox(ref Rectangle hitbox) { -<<<<<<< Updated upstream - Vector2 cen = Projectile.Center + new Vector2(HitboxOutset, 0).RotatedBy(FinalRotation() + HitboxRotationOffset()); -======= Vector2 cen = Projectile.Center + new Vector2(HitboxOutset, 0).RotatedBy(FinalRotation + HitboxRotationOffset); ->>>>>>> Stashed changes + hitbox = new Rectangle((int)cen.X - (int)(HitboxSize.X / 2), (int)cen.Y - (int)(HitboxSize.Y / 2), (int)HitboxSize.X, (int)HitboxSize.Y); @@ -283,11 +241,8 @@ namespace CalamityMod.Projectiles.BaseProjectiles float r = FlipAsSword ? MathHelper.ToRadians(90) : 0f; -<<<<<<< Updated upstream - Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin().X, SpriteOrigin().Y) : SpriteOrigin(), Projectile.scale, FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None); -======= Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition + new Vector2(0, Owner.gfxOffY), tex.Frame(1, FrameCount, 0, Frame), lightColor, Projectile.rotation + RotationOffset + r, FlipAsSword ? new Vector2(tex.Width() - SpriteOrigin.X, SpriteOrigin.Y) : SpriteOrigin, Projectile.scale, FlipAsSword ? SpriteEffects.FlipHorizontally : SpriteEffects.None); ->>>>>>> Stashed changes + } return false; }