Murasama Rework

Moved to post DoG
Third swing deals extra damage
Is now not scaled up and as a result is much harder to use and also stronger
Has GFB functionality
This commit is contained in:
Xyk committed 2023-11-27 12:41:01 -08:00
1 parent 8f299a86be
commit 0118dcc4c9
12 files changed
+192 -37

No files matched your search

+2 -5
View File
@@ -265,8 +265,8 @@ namespace CalamityMod.Balancing
// 25% resist to Aetherflux Cannon.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<PhasedGodRay>()))));
// 25% resist to Murasama.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<MurasamaSlash>()))));
// 15% resist to Murasama.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileResistBalancingRule(0.85f, ProjectileType<MurasamaSlash>()))));
// 20% resist to the Spin Throw part of the Ark of the Cosmos' combo.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AresIDs, Do(new ProjectileSpecificRequirementBalancingRule(0.8f, AotCThrowCombo))));
@@ -398,9 +398,6 @@ namespace CalamityMod.Balancing
// 50% resist to Subsuming Vortex.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.5f, ProjectileType<ExoVortex>(), ProjectileType<ExoVortex2>(), ProjectileType<EnormousConsumingVortex>())));
// 30% resist to Murasama.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.7f, ProjectileType<MurasamaSlash>())));
// 30% resist to Zenith.
NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType<SoulSeekerSupreme>(), new ProjectileResistBalancingRule(0.7f, ProjectileID.FinalFractal)));
+2
View File
@@ -225,6 +225,7 @@ namespace CalamityMod.CalPlayer
public int auralisAurora = 0;
public int necroReviveCounter = -1;
public int hideOfDeusTimer = 0;
public int murasamaHitCooldown = 0;
public int giantShellPostHit = 0;
public int tortShellPostHit = 0;
public int spiritOriginBullseyeShootCountdown = 0;
@@ -2270,6 +2271,7 @@ namespace CalamityMod.CalPlayer
auralisAurora = 0;
necroReviveCounter = -1;
hideOfDeusTimer = 0;
murasamaHitCooldown = 0;
RustyMedallionCooldown = 0;
SulphWaterPoisoningLevel = 0f;
holyInfernoFadeIntensity = 0f;
+2
View File
@@ -1434,6 +1434,8 @@ namespace CalamityMod.CalPlayer
titanCooldown--;
if (hideOfDeusTimer > 0)
hideOfDeusTimer--;
if (murasamaHitCooldown > 0)
murasamaHitCooldown--;
if (hellbornBoost > 0)
hellbornBoost--;
if (persecutedEnchantSummonTimer < 1800)
+8 -3
View File
@@ -3,6 +3,7 @@ using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -14,8 +15,12 @@ namespace CalamityMod.Items.Weapons.Melee
public new string LocalizationCategory => "Items.Weapons.Melee";
public int frameCounter = 0;
public int frame = 0;
public bool IDUnlocked(Player player) => DownedBossSystem.downedYharon || player.name == "Jetstream Sam" || player.name == "Samuel Rodrigues";
public bool IDUnlocked(Player player) => DownedBossSystem.downedDoG;
public static readonly SoundStyle OrganicHit = new("CalamityMod/Sounds/Item/MurasamaHitOrganic") { Volume = 0.6f };
public static readonly SoundStyle InorganicHit = new("CalamityMod/Sounds/Item/MurasamaHitInorganic") { Volume = 0.65f };
public static readonly SoundStyle Swing = new("CalamityMod/Sounds/Item/MurasamaSwing") { Volume = 0.3f };
public static readonly SoundStyle BigSwing = new("CalamityMod/Sounds/Item/MurasamaBigSwing") { Volume = 0.35f };
public override void SetStaticDefaults()
{
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 13));
@@ -26,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee
{
Item.height = 128;
Item.width = 56;
Item.damage = 3001;
Item.damage = 2222;
Item.DamageType = TrueMeleeNoSpeedDamageClass.Instance;
Item.noMelee = true;
Item.noUseGraphic = true;
@@ -44,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Melee
}
// Terraria seems to really dislike high crit values in SetDefaults
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 30;
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 61;
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
@@ -752,7 +752,8 @@ Murasama: {
Tooltip:
'''
A high-frequency blade that can cleanly slice through even the mightiest foe
Prove your worth by slaying Yharon, Dragon of Rebirth to unsheath this sword
Every third swing deals immense damage
Prove your worth by slaying The Devourer of Gods to unsheath this sword
[c/F41A31:'There will be blood!']
'''
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

+60
View File
@@ -0,0 +1,60 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Particles
{
public class SparkleParticle : Particle
{
public override string Texture => "CalamityMod/Particles/Sparkle2";
public bool UseAltVisual = true;
public override bool UseAdditiveBlend => UseAltVisual;
public override bool UseCustomDraw => true;
public override bool SetLifetime => true;
public override bool Important => imporant;
public bool imporant;
private float Spin;
private float opacity;
private Color Bloom;
private Color LightColor => Bloom * opacity;
private float BloomScale;
public SparkleParticle(Vector2 position, Vector2 velocity, Color color, Color bloom, float scale, int lifeTime, float rotationSpeed = 0f, float bloomScale = 1f, bool AddativeBlend = true, bool needed = false)
{
Position = position;
Velocity = velocity;
Color = color;
Bloom = bloom;
Scale = scale;
Lifetime = lifeTime;
Rotation = Main.rand.NextFloat(MathHelper.TwoPi);
Spin = rotationSpeed;
BloomScale = bloomScale;
UseAltVisual = AddativeBlend;
imporant = needed;
}
public override void Update()
{
opacity = (float)Math.Sin(LifetimeCompletion * MathHelper.Pi);
Lighting.AddLight(Position, LightColor.R / 255f, LightColor.G / 255f, LightColor.B / 255f);
Velocity *= 0.95f;
Rotation += Spin * ((Velocity.X > 0) ? 1f : -1f);
}
public override void CustomDraw(SpriteBatch spriteBatch)
{
Texture2D starTexture = ModContent.Request<Texture2D>(Texture).Value;
Texture2D bloomTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
//Ajust the bloom's texture to be the same size as the star's
float properBloomSize = (float)starTexture.Height / (float)bloomTexture.Height;
spriteBatch.Draw(bloomTexture, Position - Main.screenPosition, null, Bloom * opacity * 0.5f, 0, bloomTexture.Size()/2f, Scale * BloomScale * properBloomSize, SpriteEffects.None, 0);
spriteBatch.Draw(starTexture, Position - Main.screenPosition, null, Color * opacity * 0.5f, Rotation + MathHelper.PiOver4, starTexture.Size() / 2f, Scale * 0.75f, SpriteEffects.None, 0);
spriteBatch.Draw(starTexture, Position - Main.screenPosition, null, Color * opacity, Rotation, starTexture.Size() / 2f, Scale, SpriteEffects.None, 0);
}
}
}
+116 -28
View File
@@ -1,5 +1,7 @@
using CalamityMod.Dusts;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Particles;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
@@ -14,8 +16,11 @@ namespace CalamityMod.Projectiles.Melee
public class MurasamaSlash : ModProjectile, ILocalizedModType
{
public override LocalizedText DisplayName => CalamityUtils.GetItemName<Murasama>();
private Player Owner => Main.player[Projectile.owner];
public ref int hitCooldown => ref Main.player[Projectile.owner].Calamity().murasamaHitCooldown;
public int frameX = 0;
public int frameY = 0;
public int time = 0;
public int CurrentFrame
{
@@ -27,23 +32,22 @@ namespace CalamityMod.Projectiles.Melee
}
}
// A "slash" is only present during 2 specific frames (ones with a slash effect) right before they transition to the next frame.
// Note: This bool is unused. Murasama formerly only dealt damage when on these frames, but it created a few issues with player usability.
public bool Slashing => CurrentFrame % 7 == 0 && Projectile.frameCounter % 3 == 2;
public bool Slashing = false;
public override void SetDefaults()
{
Projectile.width = 236;
Projectile.height = 180;
Projectile.scale = 2f;
Projectile.height = 236;
Projectile.scale = 1f;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance;
Projectile.ownerHitCheck = true;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 21;
Projectile.idStaticNPCHitCooldown = 6;
Projectile.frameCounter = 0;
Projectile.alpha = 255;
}
public override bool PreDraw(ref Color lightColor)
@@ -60,7 +64,47 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
if (time == 0)
{
if (Main.zenithWorld)
Projectile.scale = 2;
CurrentFrame = Main.zenithWorld ? 6 : 10;
Projectile.alpha = 0;
time++;
}
Player player = Main.player[Projectile.owner];
if (CurrentFrame == 0)
{
SoundEngine.PlaySound(Murasama.Swing with { Pitch = -0.1f }, Projectile.Center);
if (hitCooldown == 0)
Slashing = true;
Projectile.numHits = 0;
}
else if (CurrentFrame == 6)
{
SoundEngine.PlaySound(Murasama.BigSwing with { Pitch = 0f }, Projectile.Center);
if (hitCooldown == 0)
Slashing = true;
Projectile.numHits = 0;
}
else if (CurrentFrame == 10)
{
SoundEngine.PlaySound(Murasama.Swing with { Pitch = -0.05f }, Projectile.Center);
if (hitCooldown == 0)
Slashing = true;
Projectile.numHits = 0;
}
else
Slashing = false;
if (CurrentFrame == 5 && Projectile.frameCounter % 3 == 0)
{
Projectile.damage = (int)(Projectile.damage * 2);
}
if (CurrentFrame == 7 && Projectile.frameCounter % 3 == 0)
{
Projectile.damage = (int)(Projectile.damage * 0.5f);
}
//Frames and crap
Projectile.frameCounter++;
@@ -71,21 +115,8 @@ namespace CalamityMod.Projectiles.Melee
CurrentFrame = 0;
}
// Play a "droning" noise every so often.
if (Slashing)
{
SoundEngine.PlaySound(SoundID.Item15, Projectile.Center);
}
// Create idle light and dust.
Vector2 origin = Projectile.Center + Projectile.velocity * 3f;
Lighting.AddLight(origin, 3f, 0.2f, 0.2f);
if (Main.rand.NextBool(3))
{
int redDust = Dust.NewDust(origin - Projectile.Size / 2f, Projectile.width, Projectile.height, (int)CalamityDusts.Brimstone, Projectile.velocity.X, Projectile.velocity.Y, 100, default, 2f);
Main.dust[redDust].noGravity = true;
Main.dust[redDust].position -= Projectile.velocity;
}
Lighting.AddLight(origin, Color.Red.ToVector3() * (Slashing == true ? 3.5f : 2f));
Vector2 playerRotatedPoint = player.RotatedRelativePoint(player.MountedCenter, true);
if (Main.myPlayer == Projectile.owner)
@@ -93,17 +124,24 @@ namespace CalamityMod.Projectiles.Melee
if (player.channel && !player.noItems && !player.CCed)
HandleChannelMovement(player, playerRotatedPoint);
else
{
hitCooldown = Main.zenithWorld ? 0 : 8;
Projectile.Kill();
}
}
// Rotation and directioning.
float velocityAngle = Projectile.velocity.ToRotation();
Projectile.rotation = velocityAngle + (Projectile.spriteDirection == -1).ToInt() * MathHelper.Pi;
Projectile.direction = (Math.Cos(velocityAngle) > 0).ToDirectionInt();
if (Slashing)
{
float velocityAngle = Projectile.velocity.ToRotation();
Projectile.rotation = velocityAngle + (Projectile.spriteDirection == -1).ToInt() * MathHelper.Pi;
}
float velocityAngle2 = Projectile.velocity.ToRotation();
Projectile.direction = (Math.Cos(velocityAngle2) > 0).ToDirectionInt();
// Positioning close to the end of the player's arm.
float offset = 80f * Projectile.scale;
Projectile.position = playerRotatedPoint - Projectile.Size * 0.5f + velocityAngle.ToRotationVector2() * offset;
Projectile.position = playerRotatedPoint - Projectile.Size * 0.5f + velocityAngle2.ToRotationVector2() * offset;
// Sprite and player directioning.
Projectile.spriteDirection = Projectile.direction;
@@ -129,15 +167,65 @@ namespace CalamityMod.Projectiles.Melee
Vector2 newVelocity = (Main.MouseWorld - playerRotatedPoint).SafeNormalize(Vector2.UnitX * player.direction) * speed;
// Sync if a velocity component changes.
if (Projectile.velocity.X != newVelocity.X || Projectile.velocity.Y != newVelocity.Y)
if (Slashing)
{
Projectile.netUpdate = true;
if (Projectile.velocity.X != newVelocity.X || Projectile.velocity.Y != newVelocity.Y)
{
Projectile.netUpdate = true;
}
Projectile.velocity = newVelocity;
}
Projectile.velocity = newVelocity;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (target.Organic())
SoundEngine.PlaySound(Murasama.OrganicHit with { Pitch = (CurrentFrame == 0 ? -0.1f : CurrentFrame == 6 ? 0.1f : CurrentFrame == 10 ? -0.15f : 0) }, Projectile.Center);
else
SoundEngine.PlaySound(Murasama.InorganicHit with { Pitch = (CurrentFrame == 0 ? -0.1f : CurrentFrame == 6 ? 0.1f : CurrentFrame == 10 ? -0.15f : 0) }, Projectile.Center);
for (int i = 0; i < 3; i++)
{
Color impactColor = CurrentFrame == 6 ? Main.rand.NextBool(3) ? Color.LightCoral : Color.White : Main.rand.NextBool(4) ? Color.LightCoral : Color.Crimson;
float impactParticleScale = Main.rand.NextFloat(1f, 1.75f);
if (CurrentFrame == 6)
{
SparkleParticle impactParticle2 = new SparkleParticle(target.Center + Main.rand.NextVector2Circular(target.width * 0.75f, target.height * 0.75f), Vector2.Zero, Color.White, Color.Red, impactParticleScale * 1.2f, 8, 0, 4.5f);
GeneralParticleHandler.SpawnParticle(impactParticle2);
}
SparkleParticle impactParticle = new SparkleParticle(target.Center + Main.rand.NextVector2Circular(target.width * 0.75f, target.height * 0.75f), Vector2.Zero, impactColor, Color.Red, impactParticleScale, 8, 0, 2.5f);
GeneralParticleHandler.SpawnParticle(impactParticle);
}
float sparkCount = MathHelper.Clamp(CurrentFrame == 6 ? 18 - Projectile.numHits * 3 : 5 - Projectile.numHits * 2, 0, 18);
for (int i = 0; i < sparkCount; i++)
{
Vector2 sparkVelocity2 = Projectile.velocity.RotatedBy(CurrentFrame == 0 ? -0.45f * Owner.direction : CurrentFrame == 6 ? 0 : CurrentFrame == 10 ? 0.45f * Owner.direction : 0).RotatedByRandom(0.35f) * Main.rand.NextFloat(0.5f, 1.8f);
int sparkLifetime2 = Main.rand.Next(23, 35);
float sparkScale2 = Main.rand.NextFloat(0.95f, 1.8f);
Color sparkColor2 = CurrentFrame == 6 ? Main.rand.NextBool(3) ? Color.Red : Color.IndianRed : Main.rand.NextBool() ? Color.Red : Color.Firebrick;
if (Main.rand.NextBool())
{
AltSparkParticle spark = new AltSparkParticle(target.Center + Main.rand.NextVector2Circular(target.width * 0.5f, target.height * 0.5f) + Projectile.velocity * 1.2f, sparkVelocity2 * (CurrentFrame == 6 ? 1f : 0.65f), false, (int)(sparkLifetime2 * (CurrentFrame == 6 ? 1.2f : 1f)), sparkScale2 * (CurrentFrame == 6 ? 1.4f : 1f), sparkColor2);
GeneralParticleHandler.SpawnParticle(spark);
}
else
{
LineParticle spark = new LineParticle(target.Center + Main.rand.NextVector2Circular(target.width * 0.5f, target.height * 0.5f) + Projectile.velocity * 1.2f, sparkVelocity2 * (CurrentFrame == 7 ? 1f : 0.65f), false, (int)(sparkLifetime2 * (CurrentFrame == 7 ? 1.2f : 1f)), sparkScale2 * (CurrentFrame == 7 ? 1.4f : 1f), Main.rand.NextBool() ? Color.Red : Color.Firebrick);
GeneralParticleHandler.SpawnParticle(spark);
}
}
float dustCount = MathHelper.Clamp(CurrentFrame == 6 ? 25 - Projectile.numHits * 3 : 12 - Projectile.numHits * 2, 0, 25);
for (int i = 0; i <= dustCount; i++)
{
int dustID = Main.rand.NextBool(3) ? 182 : Main.rand.NextBool() ? CurrentFrame == 6 ? 309 : 296 : 90;
Dust dust2 = Dust.NewDustPerfect(target.Center + Main.rand.NextVector2Circular(target.width * 0.5f, target.height * 0.5f), dustID, Projectile.velocity.RotatedBy(CurrentFrame == 0 ? -0.45f * Owner.direction : CurrentFrame == 6 ? 0 : CurrentFrame == 10 ? 0.45f * Owner.direction : 0).RotatedByRandom(0.55f) * Main.rand.NextFloat(0.3f, 1.1f));
dust2.scale = Main.rand.NextFloat(0.9f, 2.4f);
dust2.noGravity = true;
}
}
public override Color? GetAlpha(Color lightColor) => new Color(200, 0, 0, 0);
//public override bool? CanDamage() => Slashing;
public override bool? CanDamage() => Slashing == false ? false : null;
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.