right click fix and tooltip

This commit is contained in:
Xyk committed 2024-09-16 21:07:11 -07:00
1 parent d22699ae1d
commit e28c0bdff4
4 files changed
+35 -32

No files matched your search

+15 -21
View File
@@ -61,25 +61,8 @@ namespace CalamityMod.Items.Weapons.Ranged
public override void HoldItem(Player player)
{
if (player.whoAmI != Main.myPlayer)
return;
// Right-click channeling
player.Calamity().rightClickListener = true;
if (player.Calamity().mouseRight && CanUseItem(player) && !Main.mapFullscreen && !Main.blockMouse)
{
// Only one out at a time
if (Main.projectile.Any(n => n.active && n.type == Item.shoot && n.owner == player.whoAmI))
return;
var source = player.GetSource_ItemUse(player.ActiveItem());
Projectile holdout = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, Item.shoot, player.ActiveItem().damage, 0f, player.whoAmI, 0, 0, 10 + (shotType ? 5 : 0));
holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
SoundStyle fire = new("CalamityMod/Sounds/Item/DudFire");
SoundEngine.PlaySound(fire with { Volume = 0.7f, Pitch = -0.5f + (shotType ? 0.5f : 0) }, player.Center);
shotType = !shotType;
}
if (Main.myPlayer == player.whoAmI)
player.Calamity().rightClickListener = true;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
@@ -88,8 +71,19 @@ namespace CalamityMod.Items.Weapons.Ranged
if (Main.projectile.Any(n => n.active && n.type == Item.shoot && n.owner == player.whoAmI))
return false;
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, shotType ? 0 : 5);
holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter);
if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse)
{
Projectile holdout2 = Projectile.NewProjectileDirect(source, player.Center, Vector2.Zero, Item.shoot, player.ActiveItem().damage, 0f, player.whoAmI, 0, 0, 10 + (shotType ? 5 : 0));
holdout2.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero);
SoundStyle fire = new("CalamityMod/Sounds/Item/DudFire");
SoundEngine.PlaySound(fire with { Volume = 0.7f, Pitch = -0.5f + (shotType ? 0.5f : 0) }, player.Center);
shotType = !shotType;
}
else
{
Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, shotType ? 0 : 5);
holdout.velocity = player.Calamity().mouseWorld - player.RotatedRelativePoint(player.MountedCenter);
}
return false;
}
public override void ModifyTooltips(List<TooltipLine> list)
@@ -837,12 +837,13 @@ OntologicalDespoiler: {
DisplayName: Ontological Despoiler
Tooltip:
'''
Charges and fires bursts of concentrated unreality, swap between unstable and null modes with right click
Unstable is trifurcated and pierces through enemies
Null is fired rapidly and has homing properties
The first charging stage increases the fire rate of the burst
The second charging stage replaces the burst with a disruption shot for unstable, or an annihilation beam for null
Modes charge slower when used in succession; switching resets it
Fires chargeable bursts of concentrated unreality
Swap between unstable mode and null mode with <right>
Unstable bursts are trifurcated and pierce enemies
Null bursts have high rate-of-fire and home in on enemies
At 50% charge, the bursts are fired rapidly
At 100% charge, unleash an unstable disruption shot or a null annihilation beam
Modes charge slower when used in succession, this is reset by switching
'Rob them of continuity and the laws of physics they hold so dear.'
'''
}
@@ -38,12 +38,16 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.penetrate = 1;
Projectile.timeLeft = 600;
Projectile.DamageType = DamageClass.Ranged;
Projectile.extraUpdates = 2;
Projectile.extraUpdates = 3;
Projectile.tileCollide = false;
}
public override void AI()
{
// Remove this when ranger doesnt get +1 extra update for free
if (Projectile.extraUpdates > 3)
Projectile.extraUpdates = 3;
Projectile.rotation = Projectile.velocity.ToRotation();
Projectile.frameCounter++;
@@ -174,8 +178,13 @@ namespace CalamityMod.Projectiles.Ranged
Particle orb3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Black, "CalamityMod/Particles/SmallBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0, 1.2f * power, 39, false);
GeneralParticleHandler.SpawnParticle(orb3);
SoundStyle fire = new("CalamityMod/Sounds/Item/EarthMeteor");
SoundEngine.PlaySound(fire with { Volume = 1f, Pitch = Main.rand.NextFloat(0, 0.1f) * -3 }, Projectile.Center);
for (int i = 0; i < 3; i++)
{
SoundStyle fire = new("CalamityMod/Sounds/Item/EarthMeteor");
SoundEngine.PlaySound(fire with { Volume = 0.6f, Pitch = -0.1f * (i + 1), MaxInstances = 3 }, Projectile.Center);
}
SoundStyle fire2 = new("CalamityMod/Sounds/Item/ShadowboltReflect");
SoundEngine.PlaySound(fire2 with { Volume = 0.9f, Pitch = -0.4f}, Projectile.Center);
Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<OntoligicalDespoilerBurst>(), (int)(Projectile.damage * 5.5f), Projectile.knockBack * 3, Projectile.owner, 0, 0, 0);
}
+1 -2
View File
@@ -141,8 +141,7 @@ namespace CalamityMod.Projectiles.Rogue
Projectile.damage *= 100;
}
for (int i = 0; i < 5; i++)
SoundEngine.PlaySound(Supernova.StealthExplosionSound with { Pitch = Projectile.ai[2], MaxInstances = 5 }, Projectile.Center);
SoundEngine.PlaySound(Supernova.StealthExplosionSound with { Pitch = Projectile.ai[2] }, Projectile.Center);
Projectile.numHits = 0;
damageFrame = true;
doDamage = true;