Batholith Bangle + Band Balance
Added Batholith Bangle and did some polish and tweaks for the other two
This commit is contained in:
1 parent
1dbc568fdd
commit
1c95063911
12 files changed
+342
-49
No files matched your search
@@ -10,7 +10,6 @@ using CalamityMod.Dusts;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Armor.Reaver;
|
||||
using CalamityMod.Items.Fishing.AstralCatches;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Items.VanillaArmorChanges;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
@@ -26,12 +25,10 @@ using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Systems;
|
||||
using CalamityMod.Systems.Collections;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Mono.Cecil;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using static System.Net.Mime.MediaTypeNames;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
namespace CalamityMod.CalPlayer
|
||||
@@ -164,10 +161,20 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
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);
|
||||
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<ProtolithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
|
||||
band.DamageType = DamageClass.Ranged;
|
||||
if (cooldown < ProtolithBangle.cooldown)
|
||||
cooldown = ProtolithBangle.cooldown;
|
||||
}
|
||||
if (batholithBangle && item.DamageType == DamageClass.Magic)
|
||||
{
|
||||
var source = item.GetSource_FromThis();
|
||||
int damage = (int)Player.GetBestClassDamage().ApplyTo(BatholithBangle.damage);
|
||||
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BatholithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
|
||||
band.DamageType = DamageClass.Magic;
|
||||
if (cooldown < BatholithBangle.cooldown)
|
||||
cooldown = BatholithBangle.cooldown;
|
||||
}
|
||||
|
||||
if (cooldown > 0) // Check if a band effect went off, and apply the highest cooldown
|
||||
{
|
||||
@@ -342,12 +349,14 @@ namespace CalamityMod.CalPlayer
|
||||
if (generalBandCooldown == 0)
|
||||
{
|
||||
int cooldown = 0;
|
||||
if (bGlassBand)
|
||||
// NOTE: Apparently Pulse Pistol/Pulse Rifle projectiles will set spawned projectiles here to inherit the proj ID???
|
||||
// No clue why this happens or how to fix it, but it just breaks using multiple band types together on these two weapons
|
||||
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);
|
||||
Projectile band = 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;
|
||||
}
|
||||
@@ -355,10 +364,20 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
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);
|
||||
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<ProtolithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
|
||||
band.DamageType = DamageClass.Ranged;
|
||||
if (cooldown < ProtolithBangle.cooldown)
|
||||
cooldown = ProtolithBangle.cooldown;
|
||||
}
|
||||
if (batholithBangle && proj.DamageType == DamageClass.Magic)
|
||||
{
|
||||
var source = proj.GetSource_FromThis();
|
||||
int damage = (int)Player.GetBestClassDamage().ApplyTo(BatholithBangle.damage);
|
||||
Projectile band = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType<BatholithBangleProjectile>(), damage, -1, Player.whoAmI, target.whoAmI);
|
||||
band.DamageType = DamageClass.Magic;
|
||||
if (cooldown < BatholithBangle.cooldown)
|
||||
cooldown = BatholithBangle.cooldown;
|
||||
}
|
||||
|
||||
if (cooldown > 0) // Check if a band effect went off, and apply the highest cooldown
|
||||
{
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class BatholithBangle : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public static int cooldown = 600;
|
||||
public static int damage = 225;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 36;
|
||||
Item.height = 28;
|
||||
Item.value = CalamityGlobalItem.RarityGreenBuyPrice;
|
||||
Item.rare = ItemRarityID.Green;
|
||||
Item.accessory = true;
|
||||
}
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.batholithBangle = true;
|
||||
modPlayer.batholithBangleVisual = !hideVisual;
|
||||
}
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<BlackGlassBand>().
|
||||
AddRecipeGroup("Boss2Material", 15).
|
||||
AddIngredient(ItemID.Granite, 45).
|
||||
AddIngredient(ItemID.Amber, 3).
|
||||
AddIngredient(ItemID.FallenStar, 5).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 861 B |
@@ -8,8 +8,8 @@ namespace CalamityMod.Items.Accessories
|
||||
public class BlackGlassBand : ModItem, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public static int cooldown = 420;
|
||||
public static int damage = 40;
|
||||
public static int cooldown = 300;
|
||||
public static int damage = 32;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 30;
|
||||
@@ -27,9 +27,9 @@ namespace CalamityMod.Items.Accessories
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddRecipeGroup("AnyGoldBar", 5).
|
||||
AddIngredient(ItemID.Diamond, 2).
|
||||
AddIngredient(ItemID.Obsidian, 25).
|
||||
AddRecipeGroup("AnyGoldBar", 8).
|
||||
AddIngredient(ItemID.Diamond, 3).
|
||||
AddIngredient(ItemID.Obsidian, 35).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public new string LocalizationCategory => "Items.Accessories";
|
||||
public static int cooldown = 420;
|
||||
public static int damage = 65;
|
||||
public static int damage = 68;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 34;
|
||||
@@ -29,8 +29,10 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<BlackGlassBand>().
|
||||
AddRecipeGroup("Boss2Material", 5).
|
||||
AddIngredient(ItemID.Marble, 35).
|
||||
AddRecipeGroup("Boss2Material", 15).
|
||||
AddIngredient(ItemID.Marble, 45).
|
||||
AddIngredient(ItemID.Ruby, 3).
|
||||
AddIngredient(ItemID.Lens, 5).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
|
||||
@@ -284,12 +284,25 @@ Baroclaw: {
|
||||
'''
|
||||
}
|
||||
|
||||
BatholithBangle: {
|
||||
DisplayName: Batholith Bangle
|
||||
Tooltip:
|
||||
'''
|
||||
Magic enemy hits create a powerful granite flash that always critically strikes
|
||||
This effect has a 10 second cooldown, but is halved if the flash kills an enemy
|
||||
Visual and audio effects are reduced if visibility is disabled
|
||||
[c/0189D7:'The solid granite radiates energy throughout your body']
|
||||
'''
|
||||
}
|
||||
|
||||
BlackGlassBand: {
|
||||
DisplayName: Black Glass Band
|
||||
Tooltip:
|
||||
'''
|
||||
Enemy hits create an obsidian blast that always critically strikes
|
||||
This effect has a 7 second cooldown, but is halved if the blast kills an enemy
|
||||
Enemy hits create an obsidian flash that always critically strikes
|
||||
This effect has a 5 second cooldown, but is halved if the flash kills an enemy
|
||||
Visual and audio effects are reduced if visibility is disabled
|
||||
[c/655DC5:'A shining band with boundless potential']
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -1366,8 +1379,10 @@ 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
|
||||
Ranged enemy hits create a marble flash that always critically strikes and can hit multiple enemies
|
||||
This effect has a 7 second cooldown, but is halved if the flash kills the first enemy it hits
|
||||
Visual and audio effects are reduced if visibility is disabled
|
||||
[c/C5B965:'The cold marble against your wrist puts your mind at ease']
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -159,3 +159,4 @@ YellowLabSeeker.DisplayName: Seeking Mechanism
|
||||
VoidofExtinctionCrit.DisplayName: Void of Extinction Crit
|
||||
XykDeathAnim.DisplayName: Xyk Death Animation
|
||||
XykWings.DisplayName: Xyk Wings
|
||||
BatholithBangleProjectile.DisplayName: Batholith Bangle Projectile
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,203 @@
|
||||
using System;
|
||||
using CalamityMod.Cooldowns;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using ReLogic.Utilities;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class BatholithBangleProjectile : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Typeless";
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
public int time = 0;
|
||||
public int damageTime = 120;
|
||||
public int Soundtime1 = 84;
|
||||
public int Soundtime2 = 90;
|
||||
public int Soundtime3 = 96;
|
||||
public int Soundtime4 = 107;
|
||||
public SlotId SoundSlot;
|
||||
public Color clr1 = new Color(59, 28, 136); // Light Granite
|
||||
public Color clr2 = new Color(16, 14, 36); // Dark Granite
|
||||
public Color clr3 = new Color(23, 186, 218); // Granite energy
|
||||
public int spinDir = 1;
|
||||
public bool invalidTarget => (Projectile.ai[0] < 0f || Projectile.ai[0] > 199f || !Main.npc[(int)Projectile.ai[0]].active || Main.npc[(int)Projectile.ai[0]].life <= 0);
|
||||
public Player Owner => Main.player[Projectile.owner];
|
||||
public bool visual => Owner.Calamity().batholithBangleVisual;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 120;
|
||||
Projectile.height = 120;
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.extraUpdates = 0;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.alpha = 255;
|
||||
Projectile.timeLeft = damageTime + 2;
|
||||
Projectile.ArmorPenetration = 35;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = -1;
|
||||
Projectile.scale = 0.8f;
|
||||
}
|
||||
public override void AI()
|
||||
{
|
||||
if (time == 0 && visual)
|
||||
{
|
||||
spinDir = Main.rand.NextBool() ? 1 : -1;
|
||||
SoundStyle sound = new("CalamityMod/Sounds/Item/BatholithBangleSound");
|
||||
SoundSlot = SoundEngine.PlaySound(sound with { Volume = 1f, MaxInstances = -1 }, Projectile.Center);
|
||||
}
|
||||
if (!invalidTarget)
|
||||
Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center;
|
||||
else if (time < Soundtime2)
|
||||
{
|
||||
NPC target = Projectile.Center.ClosestNPCAt(400, true, true);
|
||||
Projectile.ai[0] = (target == null ? -1 : target.whoAmI);
|
||||
}
|
||||
|
||||
if (time > Soundtime1)
|
||||
{
|
||||
Projectile.rotation += 0.23f * spinDir * (float)Math.Pow(Utils.GetLerpValue(damageTime, Soundtime2, time, true), 1);
|
||||
}
|
||||
|
||||
float stabLerp = (float)Math.Pow(Utils.GetLerpValue(Soundtime4, damageTime, time, true), 8);
|
||||
Vector2 triPlace = (Vector2.UnitY * (230 - 150 * stabLerp)) * Projectile.scale;
|
||||
if (time == Soundtime2)
|
||||
MakePusle(Projectile.Center + triPlace.RotatedBy(Projectile.rotation));
|
||||
if (time == Soundtime3)
|
||||
MakePusle(Projectile.Center + triPlace.RotatedBy(Projectile.rotation + MathHelper.TwoPi / 3));
|
||||
if (time == Soundtime4)
|
||||
MakePusle(Projectile.Center + triPlace.RotatedBy(Projectile.rotation - MathHelper.TwoPi / 3));
|
||||
if (time == damageTime)
|
||||
{
|
||||
float visMult = (visual ? 1 : 0.6f);
|
||||
if (visual)
|
||||
{
|
||||
Owner.Calamity().GeneralScreenShakePower = 5f;
|
||||
|
||||
Particle spark = new CustomSpark(Projectile.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 12, 1.35f, clr3, Projectile.scale * new Vector2(2.5f, 1.3f), true, true, shrinkSpeed: 1.25f, extraRotation: MathHelper.PiOver2);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
Particle spark2 = new CustomSpark(Projectile.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 10, 1.05f, clr3, Projectile.scale * new Vector2(2f, 1.3f), true, true, shrinkSpeed: 0.7f);
|
||||
GeneralParticleHandler.SpawnParticle(spark2);
|
||||
|
||||
Particle pulse = new CustomPulse(Projectile.Center, Vector2.Zero, clr1, "CalamityMod/Particles/BloomRing", Projectile.scale * new Vector2(0.6f, 1.4f), 0, 0.3f, 1.35f, 15);
|
||||
GeneralParticleHandler.SpawnParticle(pulse);
|
||||
Particle pulse2 = new CustomPulse(Projectile.Center, Vector2.Zero, clr1, "CalamityMod/Particles/BloomRing", Projectile.scale * new Vector2(1.3f, 0.7f), 0, 0.25f, 1f, 15);
|
||||
GeneralParticleHandler.SpawnParticle(pulse2);
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
Vector2 vel = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(5, 10);
|
||||
Particle granite = new CustomSpark(Projectile.Center, vel, "CalamityMod/Particles/GlowTriangle", true, Main.rand.Next(30, 55 + 1), Projectile.scale * Main.rand.NextFloat(0.12f, 0.18f), (Main.rand.NextBool() ? clr1 : clr3) * visMult, Vector2.One, true, false, extraRotation: Main.rand.NextFloat(-4, 4), spin: Main.rand.NextFloat(-0.5f, 0.5f));
|
||||
GeneralParticleHandler.SpawnParticle(granite);
|
||||
}
|
||||
}
|
||||
|
||||
if (SoundEngine.TryGetActiveSound(SoundSlot, out var Sound) && Sound.IsPlaying)
|
||||
Sound.Position = Projectile.Center;
|
||||
time++;
|
||||
}
|
||||
public void MakePusle(Vector2 position)
|
||||
{
|
||||
if (!visual)
|
||||
return;
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
Vector2 outerVel = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(1, 5);
|
||||
Particle marble = new CustomSpark(position + outerVel * 5, outerVel, "CalamityMod/Particles/BloomCircle", false, Main.rand.Next(18, 25 + 1), Projectile.scale * Main.rand.NextFloat(0.3f, 0.4f), Main.rand.NextBool() ? clr1 : clr3, Vector2.One, true, true, extraRotation: Main.rand.NextFloat(-4, 4), spin: Main.rand.NextFloat(-0.3f, 0.3f), glowOpacity: 0.8f);
|
||||
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);
|
||||
modifiers.SourceDamage *= 1 + critDamage;
|
||||
|
||||
Vector2 launchVel = Utils.DirectionTo(Owner.Center, target.Center) - Vector2.UnitY;
|
||||
float launchPower = 9;
|
||||
target.MoveNPC(launchVel, launchPower, true);
|
||||
}
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
bool hasCD = Owner.Calamity().cooldowns.TryGetValue(GenericBandCooldown.ID, out CooldownInstance bandCD);
|
||||
|
||||
if ((damageDone <= 2 || (target.life <= 0 && target.realLife == -1)) && Owner.Calamity().generalBandCooldown > BatholithBangle.cooldown / 2)
|
||||
{
|
||||
Owner.Calamity().generalBandCooldown -= BatholithBangle.cooldown / 2;
|
||||
if (hasCD)
|
||||
bandCD.timeLeft -= BatholithBangle.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 && Projectile.numHits <= 0)
|
||||
return null;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
public override bool? CanHitNPC(NPC target)
|
||||
{
|
||||
if ((invalidTarget || Projectile.ai[0] == target.whoAmI) && Projectile.numHits <= 0)
|
||||
return null;
|
||||
return false;
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (!visual)
|
||||
return false;
|
||||
Asset<Texture2D> tri = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowTriangle");
|
||||
Asset<Texture2D> shine = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
|
||||
|
||||
float stabLerp = (float)Math.Pow(Utils.GetLerpValue(Soundtime4, damageTime, time, true), 8);
|
||||
Vector2 triPlace = Vector2.UnitY * (230 - 150 * stabLerp) * Projectile.scale;
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
float scale = Projectile.scale * (0.3f - 0.015f * i);
|
||||
float rotation = Projectile.rotation;
|
||||
float spawnScaleBonus = 0.3f;
|
||||
float squashPower = 0.4f;
|
||||
Color triColor = Color.Lerp(clr1, clr3, i * 0.14f);
|
||||
if (time >= Soundtime2)
|
||||
{
|
||||
float lerp = (float)Math.Pow(Utils.GetLerpValue(Soundtime2 + 13, Soundtime2, time, true), 2);
|
||||
Main.EntitySpriteDraw(tri.Value, Projectile.Center + triPlace.RotatedBy(rotation) - Main.screenPosition, null, triColor with { A = 0 }, rotation + MathHelper.Pi * lerp, tri.Size() * 0.5f, Projectile.scale * new Vector2(0.05f * i + 1 - squashPower * (1 - lerp), -0.05f * i + 1 + squashPower * (1 - lerp)) * (scale + spawnScaleBonus * lerp), SpriteEffects.None);
|
||||
}
|
||||
if (time >= Soundtime3)
|
||||
{
|
||||
rotation += MathHelper.TwoPi / 3;
|
||||
float lerp = (float)Math.Pow(Utils.GetLerpValue(Soundtime3 + 13, Soundtime3, time, true), 2);
|
||||
Main.EntitySpriteDraw(tri.Value, Projectile.Center + triPlace.RotatedBy(rotation) - Main.screenPosition, null, triColor with { A = 0 }, rotation + MathHelper.Pi * lerp, tri.Size() * 0.5f, Projectile.scale * new Vector2(0.05f * i + 1 - squashPower * (1 - lerp), -0.05f * i + 1 + squashPower * (1 - lerp)) * (scale + spawnScaleBonus * lerp), SpriteEffects.None);
|
||||
}
|
||||
if (time >= Soundtime4)
|
||||
{
|
||||
rotation += MathHelper.TwoPi / 3;
|
||||
float lerp = (float)Math.Pow(Utils.GetLerpValue(Soundtime4 + 13, Soundtime4, time, true), 2);
|
||||
Main.EntitySpriteDraw(tri.Value, Projectile.Center + triPlace.RotatedBy(rotation) - Main.screenPosition, null, triColor with { A = 0 }, rotation + MathHelper.Pi * lerp, tri.Size() * 0.5f, Projectile.scale * new Vector2(0.05f * i + 1 - squashPower * (1 - lerp), -0.05f * i + 1 + squashPower * (1 - lerp)) * (scale + spawnScaleBonus * lerp), SpriteEffects.None);
|
||||
}
|
||||
|
||||
}
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
float shineLerp = (float)Math.Pow(Utils.GetLerpValue(0, Soundtime4, time, true), 3);
|
||||
Color clrLerp = Color.Lerp(clr1, clr3, i * 0.3f);
|
||||
Color shineColor = Color.Lerp(clrLerp, Color.White, i * 0.2f) * shineLerp;
|
||||
float shineScale = Projectile.scale * 0.4f + 0.3f * shineLerp;
|
||||
Main.EntitySpriteDraw(shine.Value, Projectile.Center - Main.screenPosition, null, shineColor with { A = 0 }, MathHelper.PiOver2, shine.Size() * 0.5f, new Vector2(0.5f - i * 0.15f, 1 + i * 0.2f) * (1 - i * 0.2f) * shineScale, SpriteEffects.None);
|
||||
Main.EntitySpriteDraw(shine.Value, Projectile.Center - Main.screenPosition, null, shineColor with { A = 0 }, 0, shine.Size() * 0.5f, new Vector2(0.5f - i * 0.15f, 1 + i * 0.2f) * (1 - i * 0.1f) * shineScale, SpriteEffects.None);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,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 bool visual => Owner.Calamity().bGlassBandVisual;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 2;
|
||||
@@ -31,25 +32,29 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
if (time == 0)
|
||||
{
|
||||
float visMult = (visual ? 1 : 0.3f);
|
||||
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);
|
||||
if (visual)
|
||||
{
|
||||
SoundEngine.PlaySound(sound with { Volume = 1f, MaxInstances = -1 }, Projectile.Center);
|
||||
|
||||
float randRot = Main.rand.NextFloat(0, MathHelper.Pi);
|
||||
for (int i = -1; i <= 1; i += 2)
|
||||
{
|
||||
Vector2 position = Projectile.Center + (Vector2.UnitX * 20 * i).RotatedBy(randRot);
|
||||
Particle spark = new CustomSpark(position, Vector2.UnitY.RotatedBy(randRot) * 0.001f, "CalamityMod/Particles/GlowSpark", false, 15, 0.03f, Color.DarkSlateBlue, new Vector2(7f, 0.2f), true, shrinkSpeed: 0.55f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
for (int i = -1; i <= 1; i += 2)
|
||||
{
|
||||
Vector2 position = Projectile.Center + (Vector2.UnitY * 20 * i).RotatedBy(randRot);
|
||||
Particle spark = new CustomSpark(position, Vector2.UnitX.RotatedBy(randRot) * 0.001f, "CalamityMod/Particles/GlowSpark", false, 15, 0.03f, Color.DarkSlateBlue, new Vector2(7f, 0.2f), true, shrinkSpeed: 0.55f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 18; i++)
|
||||
{
|
||||
Particle spark = new CustomSpark(Projectile.Center, new Vector2(9, 9).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f), "CalamityMod/Particles/GlowOrbParticle", true, 35, Main.rand.NextFloat(0.6f, 0.8f), Main.rand.NextBool() ? Color.DarkSlateBlue : Color.MediumPurple, new Vector2(0.8f, 1.2f), false);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
float randRot = Main.rand.NextFloat(0, MathHelper.Pi);
|
||||
for (int i = -1; i <= 1; i += 2)
|
||||
{
|
||||
Vector2 position = Projectile.Center + (Vector2.UnitX * 20 * i).RotatedBy(randRot);
|
||||
Particle spark = new CustomSpark(position, Vector2.UnitY.RotatedBy(randRot) * 0.001f, "CalamityMod/Particles/GlowSpark", false, 15, 0.03f, Color.DarkSlateBlue, new Vector2(7f, 0.2f), true, shrinkSpeed: 0.55f);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
for (int i = -1; i <= 1; i += 2)
|
||||
{
|
||||
Vector2 position = Projectile.Center + (Vector2.UnitY * 20 * i).RotatedBy(randRot);
|
||||
Particle spark = new CustomSpark(position, Vector2.UnitX.RotatedBy(randRot) * 0.001f, "CalamityMod/Particles/GlowSpark", false, 15, 0.03f, Color.DarkSlateBlue, new Vector2(7f, 0.2f), true, shrinkSpeed: 0.55f);
|
||||
Particle spark = new CustomSpark(Projectile.Center, new Vector2(9, 9).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f), "CalamityMod/Particles/GlowOrbParticle", true, 35, Main.rand.NextFloat(0.6f, 0.8f), (Main.rand.NextBool() ? Color.DarkSlateBlue : Color.MediumPurple) * visMult, new Vector2(0.8f, 1.2f), false);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,10 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
public int Soundtime1 = 2;
|
||||
public int Soundtime2 = 8;
|
||||
public int Soundtime3 = 15;
|
||||
public int explosionSize = 180;
|
||||
public int explosionSize = 230;
|
||||
public SlotId SoundSlot;
|
||||
public Player Owner => Main.player[Projectile.owner];
|
||||
public bool visual => Owner.Calamity().protolithBangleVisual;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = explosionSize;
|
||||
@@ -36,10 +37,11 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
Projectile.ArmorPenetration = 25;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = -1;
|
||||
Projectile.scale = 0.8f;
|
||||
}
|
||||
public override void AI()
|
||||
{
|
||||
if (!(Projectile.ai[0] < 0f || Projectile.ai[0] > 199f) && time <= damageTime)
|
||||
if (!(Projectile.ai[0] < 0f || Projectile.ai[0] > 199f) && time <= damageTime && Main.npc[(int)Projectile.ai[0]].active && Main.npc[(int)Projectile.ai[0]].life > 0)
|
||||
Projectile.Center = Main.npc[(int)Projectile.ai[0]].Center;
|
||||
|
||||
Vector2 particlePlace = Vector2.UnitY * 40;
|
||||
@@ -57,24 +59,28 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
}
|
||||
if (time == damageTime)
|
||||
{
|
||||
Projectile.ai[0] = 0;
|
||||
float visMult = (visual ? 1 : 0.3f);
|
||||
Projectile.ai[0] = -1;
|
||||
|
||||
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);
|
||||
if (visual)
|
||||
{
|
||||
Particle spark = new CustomSpark(Projectile.Center, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 15, 1.2f, Color.Gold, Projectile.scale * 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", Projectile.scale * 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));
|
||||
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), Projectile.scale * Main.rand.NextFloat(0.08f, 0.14f) * 15, Color.Lerp(Color.White, Color.Khaki, Main.rand.NextFloat()) * visMult, new Vector2(1f, Main.rand.NextFloat(1, 2)), false, false, extraRotation: Main.rand.NextFloat(-4, 4));
|
||||
GeneralParticleHandler.SpawnParticle(marble);
|
||||
}
|
||||
}
|
||||
if (time == 0)
|
||||
if (time == 0 && visual)
|
||||
{
|
||||
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);
|
||||
SoundSlot = SoundEngine.PlaySound(sound with { Volume = 1f, MaxInstances = -1 }, Projectile.Center);
|
||||
}
|
||||
if (SoundEngine.TryGetActiveSound(SoundSlot, out var Sound) && Sound.IsPlaying)
|
||||
Sound.Position = Projectile.Center;
|
||||
@@ -82,13 +88,16 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
}
|
||||
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);
|
||||
if (!visual)
|
||||
return;
|
||||
|
||||
Particle pulse = new CustomPulse(position, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomRing", Projectile.scale * 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));
|
||||
Particle marble = new CustomSpark(position + outerVel * 5, -outerVel * 0.6f, "CalamityMod/Particles/Square", false, Main.rand.Next(10, 15 + 1), Projectile.scale * 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);
|
||||
}
|
||||
}
|
||||
@@ -97,7 +106,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
modifiers.SetCrit();
|
||||
float critDamage = Math.Min(Owner.GetTotalCritChance(AverageDamageClass.Instance) * 0.01f, 1f);
|
||||
|
||||
float minMult = 0.2f;
|
||||
float minMult = 0.1f;
|
||||
int hitsToMinMult = 5;
|
||||
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true);
|
||||
modifiers.SourceDamage *= damageMult + critDamage;
|
||||
@@ -117,7 +126,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
bandCD.timeLeft -= ProtolithBangle.cooldown / 2;
|
||||
}
|
||||
}
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f, targetHitbox);
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f * Projectile.scale, targetHitbox);
|
||||
public override bool? CanDamage()
|
||||
{
|
||||
if (time >= damageTime)
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user