Protolith Bangle

This commit is contained in:
Xyk committed 2025-05-13 21:18:57 -07:00
1 parent 062fc7110f
commit b08656f236
18 files changed
+267 -28

No files matched your search

+5 -3
View File
@@ -727,15 +727,13 @@ namespace CalamityMod.CalPlayer
public bool theBee = false;
public bool arcFlashRing = false;
public bool arcFlashRingVisual = false;
public int generalBandCooldown = 0;
public bool bGlassBand = false; // Obsidian band
public bool bGlassBandVisual = false;
public int bGlassbandCooldown = 0;
public bool batholithBangle = false; // Granite band
public bool batholithBangleVisual = false;
public int batholithBangleCooldown = 0;
public bool protolithBangle = false; // Marble band
public bool protolithBangleVisual = false;
public int protolithBangleCooldown = 0;
/// <summary> Used to prevent dodges from triggering The Bee's full health damage reduction cooldown. </summary>
public bool shouldTriggerBeeCooldown = false;
public int theBeeCooldown = 0;
@@ -2173,6 +2171,10 @@ namespace CalamityMod.CalPlayer
arcFlashRingVisual = false;
bGlassBand = false;
bGlassBandVisual = false;
batholithBangle = false; // Granite band
batholithBangleVisual = false;
protolithBangle = false; // Marble band
protolithBangleVisual = false;
aFossil = false;
aPowder = false;
fallingBlockProtection = false;
+2 -6
View File
@@ -2052,12 +2052,8 @@ namespace CalamityMod.CalPlayer
VoidCooldown--;
if (ursaSergeantCooldown > 0)
ursaSergeantCooldown--;
if (bGlassbandCooldown > 0)
bGlassbandCooldown--;
if (batholithBangleCooldown > 0)
batholithBangleCooldown--;
if (protolithBangleCooldown > 0)
protolithBangleCooldown--;
if (generalBandCooldown > 0)
generalBandCooldown--;
if (AlchFlaskCooldown > 0)
AlchFlaskCooldown--;
if (tarraRangedCooldown > 0)
+55 -12
View File
@@ -146,14 +146,36 @@ namespace CalamityMod.CalPlayer
// Ursa Sergeant slash cooldown is reset on kill
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - 180, 0, 300);
if (bGlassBand && bGlassbandCooldown == 0)
if (generalBandCooldown == 0)
{
var source = item.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(BlackGlassBand.damage);
Vector2 launchVel = Utils.DirectionTo(Player.Center, target.Center) * 6;
Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BlackGlassBandProjectile>(), damage, -1, Player.whoAmI, target.whoAmI, launchVel.X, launchVel.Y);
bGlassbandCooldown = BlackGlassBand.cooldown;
int cooldown = 0;
if (bGlassBand)
{
var source = item.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(BlackGlassBand.damage);
Vector2 launchVel = Utils.DirectionTo(Player.Center, target.Center) * 6;
Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BlackGlassBandProjectile>(), damage, -1, Player.whoAmI, target.whoAmI, launchVel.X, launchVel.Y);
if (cooldown < BlackGlassBand.cooldown)
cooldown = BlackGlassBand.cooldown;
}
if (protolithBangle && item.DamageType == DamageClass.Ranged)
{
var source = item.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(ProtolithBangle.damage);
Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<ProtolithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
if (cooldown < ProtolithBangle.cooldown)
cooldown = ProtolithBangle.cooldown;
}
if (cooldown > 0) // Check if a band effect went off, and apply the highest cooldown
{
generalBandCooldown = cooldown;
Player.AddCooldown(Cooldowns.GenericBandCooldown.ID, cooldown);
}
}
if (luxorsGift)
luxorHit = true;
@@ -316,14 +338,35 @@ namespace CalamityMod.CalPlayer
// Ursa Sergeant slash cooldown is reset on kill
if (ursaSergeant && target.life <= 0 && target.realLife == -1)
ursaSergeantCooldown = (int)MathHelper.Clamp(ursaSergeantCooldown - UrsaSergeant.CooldownReducedPerKill, 0, UrsaSergeant.MaxCooldown);
if (bGlassBand && bGlassbandCooldown == 0)
if (generalBandCooldown == 0)
{
var source = proj.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(BlackGlassBand.damage);
Vector2 launchVel = Utils.DirectionTo(Player.Center, target.Center) * 6;
Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BlackGlassBandProjectile>(), damage, -1, Player.whoAmI, target.whoAmI, launchVel.X, launchVel.Y);
bGlassbandCooldown = BlackGlassBand.cooldown;
int cooldown = 0;
if (bGlassBand)
{
var source = proj.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(BlackGlassBand.damage);
Vector2 launchVel = Utils.DirectionTo(Player.Center, target.Center) * 6;
Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BlackGlassBandProjectile>(), damage, -1, Player.whoAmI, target.whoAmI, launchVel.X, launchVel.Y);
if (cooldown < BlackGlassBand.cooldown)
cooldown = BlackGlassBand.cooldown;
}
if (protolithBangle && proj.DamageType == DamageClass.Ranged)
{
var source = proj.GetSource_FromThis();
int damage = (int)Player.GetBestClassDamage().ApplyTo(ProtolithBangle.damage);
Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<ProtolithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
if (cooldown < ProtolithBangle.cooldown)
cooldown = ProtolithBangle.cooldown;
}
if (cooldown > 0) // Check if a band effect went off, and apply the highest cooldown
{
generalBandCooldown = cooldown;
Player.AddCooldown(Cooldowns.GenericBandCooldown.ID, cooldown);
}
}
if (luxorsGift && proj.type != ModContent.ProjectileType<LuxorsGiftMelee>() && proj.type != ModContent.ProjectileType<LuxorsGiftRanged>() && proj.type != ModContent.ProjectileType<LuxorsGiftMagic>() && proj.type != ModContent.ProjectileType<LuxorsGiftSummon>() && proj.type != ModContent.ProjectileType<LuxorsGiftRogue>() && proj.type != ModContent.ProjectileType<LuxorsGiftClassless>())
luxorHit = true;
+19
View File
@@ -0,0 +1,19 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.Localization;
using static CalamityMod.CalamityUtils;
namespace CalamityMod.Cooldowns
{
public class GenericBandCooldown : CooldownHandler
{
public static new string ID => "BandCooldown";
public override bool ShouldDisplay => true;
public override LocalizedText DisplayName => CalamityUtils.GetText($"UI.Cooldowns.{ID}");
public override string Texture => "CalamityMod/Cooldowns/GenericBandCooldown";
public override Color OutlineColor => Color.White;
public override Color CooldownStartColor => Color.SlateGray;
public override Color CooldownEndColor => Color.Gray;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

+38
View File
@@ -0,0 +1,38 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Weapons.Ranged;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class ProtolithBangle : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public static int cooldown = 420;
public static int damage = 140;
public override void SetDefaults()
{
Item.width = 34;
Item.height = 34;
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
Item.rare = ItemRarityID.Green;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.protolithBangle = true;
modPlayer.protolithBangleVisual = !hideVisual;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<BlackGlassBand>().
AddRecipeGroup("Boss2Material", 5).
AddIngredient(ItemID.Marble, 35).
AddTile(TileID.Anvils).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

@@ -1362,6 +1362,15 @@ ProfanedSoulCrystal: {
'''
}
ProtolithBangle: {
DisplayName: Protolith Bangle
Tooltip:
'''
Ranged enemy hits create a marble blast that always critically strikes and can hit multiple enemies
This effect has a 7 second cooldown, but is halved if the blast kills the first enemy it hits
'''
}
QuiverofNihility: {
DisplayName: Quiver of Nihility
Tooltip:
@@ -105,6 +105,7 @@ PauldronExplosion.DisplayName: Pauldron Explosion
PearlAuraShard.DisplayName: Prism Shard
PlaguePulse.DisplayName: Plague Pulse
PoisonousSeawater.DisplayName: Seawater
ProtolithBangleProjectile.DisplayName: Marble Shatter
PscTransformAnimation.DisplayName: Psc Transform Animation
PscTransformRocks.DisplayName: Psc Transform Rocks
PuddleSplash.DisplayName: Puddle Splash
@@ -94,6 +94,7 @@ Cooldowns: {
FleshTotem: Contact Damage Halving Cooldown
FuryFuel: Crystal Powder
GaelsRage: Gael's Greatsword Rage Cooldown
GenericBandCooldown: Band Cooldown
GlobalDodge: Dodge Cooldown
GodSlayerDash: God Slayer Dash Cooldown
HellbornShots: Hellborn Shots
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

@@ -1,4 +1,5 @@
using CalamityMod.Items.Accessories;
using System;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Particles;
using CalamityMod.Tiles.Ores;
@@ -13,6 +14,7 @@ namespace CalamityMod.Projectiles.Typeless
{
public new string LocalizationCategory => "Projectiles.Typeless";
public int time = 0;
public Player Owner => Main.player[Projectile.owner];
public override void SetDefaults()
{
Projectile.width = 2;
@@ -30,10 +32,8 @@ namespace CalamityMod.Projectiles.Typeless
{
if (time == 0)
{
SoundStyle sound = AuricOre.MineSound;
SoundEngine.PlaySound(sound with { Volume = 0.9f, Pitch = Main.rand.NextFloat(0.15f, 0.25f), MaxInstances = -1 }, Projectile.Center);
SoundStyle sound2 = NullificationPistol.HitSound;
SoundEngine.PlaySound(sound2 with { Volume = 0.6f, Pitch = Main.rand.NextFloat(0.3f, 0.45f), MaxInstances = -1 }, Projectile.Center);
SoundStyle sound = new("CalamityMod/Sounds/Item/BlackGlassBandSound");
SoundEngine.PlaySound(sound with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = -1 }, Projectile.Center);
for (int i = 0; i < 18; i++)
{
@@ -59,12 +59,18 @@ namespace CalamityMod.Projectiles.Typeless
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.SetCrit();
float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f);
modifiers.SourceDamage *= (1 + critDamage);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
Player Owner = Main.player[Projectile.owner];
if ((damageDone <= 2 || (target.life <= 0 && target.realLife == -1)) && Owner.Calamity().bGlassbandCooldown > BlackGlassBand.cooldown / 2)
Owner.Calamity().bGlassbandCooldown = BlackGlassBand.cooldown / 2;
if ((damageDone <= 2 || (target.life <= 0 && target.realLife == -1)) && Owner.Calamity().generalBandCooldown > BlackGlassBand.cooldown / 2)
Owner.Calamity().generalBandCooldown -= BlackGlassBand.cooldown / 2;
}
public override bool? CanDamage()
{
return null;
}
}
}
@@ -0,0 +1,124 @@
using System;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Particles;
using CalamityMod.Tiles.Ores;
using Microsoft.Xna.Framework;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typeless
{
public class ProtolithBangleProjectile : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Typeless";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public int time = 0;
public int damageTime = 24;
public int Soundtime1 = 2;
public int Soundtime2 = 8;
public int Soundtime3 = 15;
public int explosionSize = 180;
public SlotId SoundSlot;
public Player Owner => Main.player[Projectile.owner];
public override void SetDefaults()
{
Projectile.width = explosionSize;
Projectile.height = explosionSize;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.extraUpdates = 0;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.alpha = 255;
Projectile.timeLeft = damageTime + 20;
Projectile.ArmorPenetration = 25;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
}
public override void AI()
{
if (!(Projectile.ai[0] < 0f || Projectile.ai[0] > 199f) && time <= damageTime)
Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center;
Vector2 particlePlace = Vector2.UnitY * 40;
if (time == Soundtime1)
{
MakePusle(Projectile.Center + particlePlace);
}
if (time == Soundtime2)
{
MakePusle(Projectile.Center + particlePlace.RotatedBy(MathHelper.TwoPi / 3));
}
if (time == Soundtime3)
{
MakePusle(Projectile.Center + particlePlace.RotatedBy(-MathHelper.TwoPi / 3));
}
if (time == damageTime)
{
Projectile.ai[0] = 0;
Particle spark = new CustomSpark(Projectile.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 15, 1.2f, Color.Gold, new Vector2(1f, 1.3f), true, true, shrinkSpeed: 0.9f);
GeneralParticleHandler.SpawnParticle(spark);
Particle pulse = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomRing", new Vector2(1.4f, 0.6f), 0, 0.3f, 1.35f, 15);
GeneralParticleHandler.SpawnParticle(pulse);
for (int i = 0; i < 28; i++)
{
Particle marble = new CustomSpark(Projectile.Center, (Vector2.One * Main.rand.NextFloat(8, 13)).RotatedByRandom(MathHelper.TwoPi), "CalamityMod/Particles/Square", true, Main.rand.Next(40, 70 + 1), Main.rand.NextFloat(0.08f, 0.14f) * 15, Color.Lerp(Color.White, Color.Khaki, Main.rand.NextFloat()), new Vector2(1f, Main.rand.NextFloat(1, 2)), false, false, extraRotation: Main.rand.NextFloat(-4, 4));
GeneralParticleHandler.SpawnParticle(marble);
}
}
if (time == 0)
{
SoundStyle sound = new("CalamityMod/Sounds/Item/ProtolithBangleSound");
SoundSlot = SoundEngine.PlaySound(sound with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = -1 }, Projectile.Center);
}
if (SoundEngine.TryGetActiveSound(SoundSlot, out var Sound) && Sound.IsPlaying)
Sound.Position = Projectile.Center;
time++;
}
public void MakePusle(Vector2 position)
{
Particle pulse = new CustomPulse(position, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomRing", Vector2.One, 0, 0.3f, 0.65f, 25);
GeneralParticleHandler.SpawnParticle(pulse);
for (int i = 0; i < 18; i++)
{
Vector2 outerVel = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(5, 7);
Particle marble = new CustomSpark(position + outerVel * 5, -outerVel * 0.6f, "CalamityMod/Particles/Square", false, Main.rand.Next(10, 15 + 1), Main.rand.NextFloat(0.08f, 0.14f) * 10, Color.Lerp(Color.White, Color.Khaki, Main.rand.NextFloat()), new Vector2(1f, Main.rand.NextFloat(1, 2)), false, false, extraRotation: Main.rand.NextFloat(-4, 4));
GeneralParticleHandler.SpawnParticle(marble);
}
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.SetCrit();
float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f);
float minMult = 0.2f;
int hitsToMinMult = 5;
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true);
modifiers.SourceDamage *= damageMult + critDamage;
Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center) - Vector2.UnitY;
float launchPower = 6;
target.MoveNPC(launchVel, launchPower, true);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if ((damageDone <= 2 || (target.life <= 0 && target.realLife == -1)) && Owner.Calamity().generalBandCooldown > ProtolithBangle.cooldown / 2)
Owner.Calamity().generalBandCooldown -= ProtolithBangle.cooldown / 2;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f, targetHitbox);
public override bool? CanDamage()
{
if (time >= damageTime)
return null;
else
return false;
}
}
}
Binary file not shown.
Binary file not shown.