This commit is contained in:
Xyk committed 2026-01-14 18:07:31 -08:00
1 parent 308d6f4082
commit 4acb607ac2
2 files changed
+11 -8

No files matched your search

+5 -4
View File
@@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Ranged
}
revSpeed = Utils.Remap(revFrames, 0, maxFrames - 120, 1, 20, true);
if (shootingTimer >= initialFireTime && revFrames < maxFrames && secondShot)
if (shootingTimer >= initialFireTime && revFrames < maxFrames && secondShot && Owner.whoAmI == Main.myPlayer)
{
Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _);
@@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Ranged
Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 19;
if (Main.myPlayer == Projectile.owner)
if (Owner.whoAmI == Main.myPlayer)
{
float spread = 0.045f * Utils.GetLerpValue(0, maxFrames, revFrames, true);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, (shootVelocity).RotatedByRandom(spread), bulletAMMO, Projectile.damage / 2, Projectile.knockBack, Projectile.owner);
@@ -76,10 +76,11 @@ namespace CalamityMod.Projectiles.Ranged
{
Owner.PickAmmo(Owner.HeldItem, out int bulletAMMO, out float SpeedNoUse, out int bulletDamage, out float kBackNoUse, out _);
Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * 19;
if (Main.myPlayer == Projectile.owner)
if (Owner.whoAmI == Main.myPlayer)
{
float spread = 0.045f * Utils.GetLerpValue(0, maxFrames, revFrames, true);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, (shootVelocity).RotatedByRandom(spread).RotatedByRandom(0.04f), bulletAMMO, Projectile.damage / 2, Projectile.knockBack, Projectile.owner);
Projectile.netUpdate = true;
}
shootingTimer = 0;
secondShot = true;
@@ -89,7 +90,7 @@ namespace CalamityMod.Projectiles.Ranged
revFrames++;
shineScale *= 0.77f;
if (revFrames >= maxFrames && !isTired || (Owner.Calamity().mouseRight && revFrames > 2 ))
if ((revFrames >= maxFrames && !isTired || (Owner.Calamity().mouseRight && revFrames > 2 )) && Owner.whoAmI == Main.myPlayer)
{
Owner.SetScreenshake(6.5f);
OffsetLengthFromArm -= 35f;
+6 -4
View File
@@ -60,11 +60,13 @@ namespace CalamityMod.Projectiles.Ranged
public override void SendExtraAIHoldout(BinaryWriter writer)
{
writer.Write(lastUseTime);
writer.Write(Projectile.spriteDirection);
}
public override void ReceiveExtraAIHoldout(BinaryReader reader)
{
lastUseTime = reader.ReadInt32();
Projectile.spriteDirection = reader.ReadInt32();
}
public override void HoldoutAI()
{
@@ -95,8 +97,8 @@ namespace CalamityMod.Projectiles.Ranged
return;
}
bool hasAmmo = Owner.PickAmmo(HeldItem, out _, out _, out _, out _, out _, true);
bool leftShootChecks = (Main.mouseLeft && !Main.mapFullscreen && !Owner.mouseInterface && shootingCooldown == 0) && hasAmmo;
bool rightShootChecks = Owner.Calamity().mouseRight && !Main.mapFullscreen && !Owner.mouseInterface && starburstCooldown == 0 && starburstTimer == 0;
bool leftShootChecks = Owner.whoAmI == Main.myPlayer && (Main.mouseLeft && !Main.mapFullscreen && !Owner.mouseInterface && shootingCooldown == 0) && hasAmmo;
bool rightShootChecks = Owner.whoAmI == Main.myPlayer && (Owner.Calamity().mouseRight && !Main.mapFullscreen && !Owner.mouseInterface && starburstCooldown == 0 && starburstTimer == 0);
if (Main.mouseLeft && !hasAmmo && OffsetLengthFromArm >= 24.5f)
{
@@ -108,7 +110,7 @@ namespace CalamityMod.Projectiles.Ranged
FireShotgun();
if (rightShootChecks)
{
Projectile.netUpdate = true;
Projectile.ForceNetUpdate();
SoundStyle test = new("CalamityMod/Sounds/Item/StarfleetStarburst");
SoundEngine.PlaySound(test with { Volume = 1f, Pitch = 0f }, Projectile.Center);
starburstTimer++;
@@ -161,7 +163,7 @@ namespace CalamityMod.Projectiles.Ranged
}
public void FireShotgun()
{
Projectile.netUpdate = true;
Projectile.ForceNetUpdate();
// 50% chance to not consume ammo
Owner.PickAmmo(HeldItem, out _, out _, out _, out _, out _, Main.rand.NextBool());