Alpha Draconis + general touchups

This commit is contained in:
Doze-Zoze committed 2025-08-11 12:56:01 -05:00
1 parent 7cb67f8eff
commit c0ccfd7976
31 files changed
+464 -310

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 492 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 557 B

+83
View File
@@ -0,0 +1,83 @@
using System;
using System.Linq;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
[LegacyName("ClamorNoctus")]
public class AlphaDraconis : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetStaticDefaults()
{
Item.staff[Type] = true;
}
public override void SetDefaults()
{
Item.width = 52;
Item.height = 74;
Item.damage = 270;
Item.DamageType = DamageClass.Magic;
Item.mana = 6;
Item.useTime = 12;
Item.useAnimation = 12;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 5.2f;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.rare = ModContent.RarityType<PureGreen>();
Item.UseSound = SoundID.Item105;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<AlphaDraconisStar>();
Item.shootSpeed = 8f;
}
public override bool AltFunctionUse(Player player)
{
return player.Calamity().StratusStarburst >= 5 || player.ownedProjectileCounts[ModContent.ProjectileType<DracoConstellation>()] > 0;
}
public override void HoldItem(Player player)
{
player.Calamity().HasStratusItemCooldown = (int)MathHelper.Max(player.Calamity().HasStratusItemCooldown, 600);
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.altFunctionUse == 2)
{
if (player.ownedProjectileCounts[ModContent.ProjectileType<DracoConstellation>()] > 0)
{
var p = Main.projectile.First(x => x.type == ModContent.ProjectileType<DracoConstellation>() && x.active && x.owner == player.whoAmI);
p.timeLeft = (int)MathHelper.Min(p.timeLeft, 60);
} else
Projectile.NewProjectile(source, player.Center + new Vector2(-125,-100), -Vector2.Zero, ModContent.ProjectileType<DracoConstellation>(), damage, knockback, player.whoAmI);
return false;
}
var mousePos = player.Calamity().mouseWorld + new Vector2(player.direction * -64);
var dir = player.DirectionTo(mousePos);
for (var i = 0; i < 3; i++)
Projectile.NewProjectile(source, new Vector2(mousePos.X,player.Center.Y) + new Vector2(Main.rand.Next(500, 1300) * -player.direction, Main.rand.Next(-800,-600)), Vector2.UnitX * player.direction * velocity.Length(), type, damage, knockback, player.whoAmI, mousePos.X, mousePos.Y);
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<WyvernsCall>().
AddIngredient<Lumenyl>(6).
AddIngredient<RuinousSoul>(5).
AddIngredient<ExodiumCluster>(10).
AddTile(TileID.MythrilAnvil).
Register();
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

-116
View File
@@ -1,116 +0,0 @@
using System;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class ClamorNoctus : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetStaticDefaults()
{
Item.staff[Type] = true;
}
public override void SetDefaults()
{
Item.width = 52;
Item.height = 74;
Item.damage = 270;
Item.DamageType = DamageClass.Magic;
Item.mana = 12;
Item.useTime = 21;
Item.useAnimation = 21;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 5.2f;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.rare = ModContent.RarityType<PureGreen>();
Item.UseSound = SoundID.Item105;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<ClamorNoctusStar>();
Item.shootSpeed = 25f;
}
public override void HoldItem(Player player)
{
player.Calamity().HasStratusItemCooldown = (int)MathHelper.Max(player.Calamity().HasStratusItemCooldown, 600);
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float projSpeed = Item.shootSpeed;
Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true);
float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (player.gravDir == -1f)
{
mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - realPlayerPos.Y;
}
float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f))
{
mouseXDist = (float)player.direction;
mouseYDist = 0f;
mouseDistance = projSpeed;
}
else
{
mouseDistance = projSpeed / mouseDistance;
}
int projAmt = 3;
for (int i = 0; i < projAmt; i++)
{
float damageMult = 1f;
float kbMult = 1f;
if (Main.rand.NextBool(10))
{
type = ModContent.ProjectileType<ClamorNoctusWyvern>();
}
if (type == ModContent.ProjectileType<ClamorNoctusWyvern>())
{
damageMult = 25f;
kbMult = 1.5f;
}
realPlayerPos = new Vector2(player.Center.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.Center.X), player.MountedCenter.Y - 600f);
realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201);
realPlayerPos.Y -= (float)(100 * i);
mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X;
mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y;
if (mouseYDist < 0f)
{
mouseYDist *= -1f;
}
if (mouseYDist < 20f)
{
mouseYDist = 20f;
}
mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist));
mouseDistance = projSpeed / mouseDistance;
mouseXDist *= mouseDistance;
mouseYDist *= mouseDistance;
float speedX4 = mouseXDist + (float)Main.rand.Next(-30, 31) * 0.02f;
float speedY5 = mouseYDist + (float)Main.rand.Next(-30, 31) * 0.02f;
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, (int)(damage * damageMult), (int)(knockback * kbMult), player.whoAmI, 0f, (float)Main.rand.Next(15));
}
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<WyvernsCall>().
AddIngredient<Lumenyl>(6).
AddIngredient<RuinousSoul>(5).
AddIngredient<ExodiumCluster>(10).
AddTile(TileID.MythrilAnvil).
Register();
}
}
}
+1 -1
View File
@@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<NightsGaze>().
AddIngredient<Vega>().
AddIngredient<CosmiliteBar>(8).
AddIngredient<DarksunFragment>(8).
AddIngredient<SolarVeil>(12).
@@ -11,7 +11,8 @@ using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Rogue
{
public class NightsGaze : RogueWeapon, IHoldShiftTooltipItem
[LegacyName("NightsGaze")]
public class Vega : RogueWeapon, IHoldShiftTooltipItem
{
public static int StarburstCost = 20;
public override void SetDefaults()
@@ -28,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Rogue
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.maxStack = 1;
Item.shoot = ModContent.ProjectileType<NightsGazeProjectile>();
Item.shoot = ModContent.ProjectileType<VegaProjectile>();
Item.shootSpeed = 30f;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.rare = ModContent.RarityType<PureGreen>();
@@ -59,14 +60,20 @@ namespace CalamityMod.Items.Weapons.Rogue
player.Calamity().StratusStarburst -= StarburstCost;
int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI,0,1);
if (p.WithinBounds(Main.maxProjectiles))
{
Main.projectile[p].Calamity().stealthStrike = true;
Main.projectile[p].extraUpdates += 1;
}
return false;
}
if (player.Calamity().StealthStrikeAvailable())
{
int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
if (p.WithinBounds(Main.maxProjectiles))
{
Main.projectile[p].Calamity().stealthStrike = true;
Main.projectile[p].extraUpdates += 1;
}
return false;
}
return true;
@@ -74,7 +81,7 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Rogue/NightsGazeGlow").Value);
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Rogue/VegaGlow").Value);
}
public override void AddRecipes()
File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 753 B

After

Width:  |  Height:  |  Size: 753 B

@@ -181,7 +181,7 @@ ChronomancersScythe: {
'''
}
ClamorNoctus: {
AlphaDraconis: {
DisplayName: Alpha Draconis
Tooltip:
'''
@@ -807,7 +807,7 @@ NastyCholla: {
'''
}
NightsGaze: {
Vega: {
DisplayName: Vega
Tooltip:
'''
@@ -40,8 +40,8 @@ CauldronProjSmall.DisplayName: Smaullerdron
ChronoIcicleLarge.DisplayName: Chrono Icicle
ChronoIcicleSmall.DisplayName: Chrono Icicle
ChronomancersScytheHoldout.DisplayName: Chronomancer's Scythe
ClamorNoctusStar.DisplayName: Clamor Star
ClamorNoctusWyvern.DisplayName: Clamor Wyvern
AlphaDraconisStar.DisplayName: Shooting Star
DracoConstellation.DisplayName: Draco
ClimaxBeam.DisplayName: Voltaic Bolt
ClimaxProj.DisplayName: Voltaic Orb
CoralSpike.DisplayName: Coral Spike
@@ -183,9 +183,9 @@ NanoblackStealthSplit.DisplayName: Nanoblack Afterimage
NastyChollaBol.DisplayName: Nasty Cholla
NastyChollaNeedle.DisplayName: Cactus Needle
NiceCock.DisplayName: Kitchen Fire
NightsGazeProjectile.DisplayName: Night's Gaze
NightsGazeSpark.DisplayName: Night's Gaze Spark
NightsGazeStar.DisplayName: Night's Gaze Star
VegaProjectile.DisplayName: Night's Gaze
VegaSpark.DisplayName: Night's Gaze Spark
VegaStar.DisplayName: Night's Gaze Star
OrichalcumSpikedGemstoneProjectile.DisplayName: Orichalcum Gemstone
PalladiumJavelinProjectile.DisplayName: Palladium Javelin
PanSpark.DisplayName: Pan Spark
@@ -324,3 +324,4 @@ WrathwingFireball.DisplayName: Wrathwing Fireball
WrathwingSpear.DisplayName: Wrathwing
WulfrumKnifeProj.DisplayName: Wulfrum Knife
LyraConstellation.DisplayName: Lyra Constellation
ScorpiusConstellation.DisplayName: Scorpius Constellation
+107
View File
@@ -0,0 +1,107 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class AlphaDraconisStar : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Magic";
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Type] = 16;
ProjectileID.Sets.TrailingMode[Type] = 1;
}
public override void SetDefaults()
{
Projectile.width = 22;
Projectile.height = 24;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.DamageType = DamageClass.Magic;
Projectile.extraUpdates = 4;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10 * Projectile.MaxUpdates;
Projectile.scale = 0.5f;
Projectile.tileCollide = false;
Projectile.timeLeft = Projectile.MaxUpdates * 300;
}
public override void AI()
{
Vector2 goalPos = new Vector2(Projectile.ai[0], Projectile.ai[1]);
float velLength = Projectile.velocity.Length();
if (Projectile.ai[2] == 0)
{
Projectile.velocity += Projectile.DirectionTo(goalPos) * 0.15f;
Projectile.velocity.Normalize();
if (Projectile.velocity.HasNaNs())
Projectile.velocity = Vector2.UnitY;
Projectile.velocity *= velLength;
if (Projectile.Center.Y > goalPos.Y + 100)
Projectile.ai[2] = 1;
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
}
else
{
Projectile.velocity *= 0.98f;
if (Projectile.velocity.Length() < 1 && Projectile.ai[2] == 1)
Projectile.Kill();
if (Projectile.ai[2] == 2)
{
Projectile.rotation += 0.1f;
Projectile.scale = MathHelper.Min(Projectile.scale + 0.02f, 1);
Player closestPlayer = null;
float closestDis = 200;
foreach (var player in Main.ActivePlayers)
{
var dis = Projectile.Distance(player.Center);
if (dis < closestDis)
{
closestDis = dis;
closestPlayer = player;
}
}
if (closestPlayer != null)
{
Projectile.velocity += Projectile.DirectionTo(closestPlayer.Center);
if (Projectile.Distance(closestPlayer.Center) < 32)
{
closestPlayer.Calamity().StratusStarburst++;
Projectile.Kill();
}
}
}
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Projectile.ai[2] == 0)
{
if (Main.rand.NextFloat() <= 0.4f) //40% chance to become pick-up-able stars
Projectile.ai[2] = 2;
else
Projectile.ai[2] = 1;
Projectile.velocity *= Main.rand.NextFloat(0.9f, 1.1f);
}
}
public override void OnKill(int timeLeft)
{
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile,1,Color.White,shrink: true);
return false;
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 457 B

After

Width:  |  Height:  |  Size: 457 B

-99
View File
@@ -1,99 +0,0 @@
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class ClamorNoctusStar : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Magic";
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Type] = 8;
ProjectileID.Sets.TrailingMode[Type] = 1;
}
public override void SetDefaults()
{
Projectile.width = 10;
Projectile.height = 10;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.alpha = 255;
Projectile.DamageType = DamageClass.Magic;
Projectile.aiStyle = ProjAIStyleID.Nail;
AIType = ProjectileID.NailFriendly;
Projectile.extraUpdates = 1;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
}
public override void AI()
{
if (Projectile.soundDelay == 0)
{
Projectile.soundDelay = 20 + Main.rand.Next(40);
if (Main.rand.NextBool(5))
{
SoundEngine.PlaySound(SoundID.Item9, Projectile.Center);
}
}
if (Main.rand.NextBool(3))
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.PurificationPowder, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f);
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Voidfrost>(), 120);
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item14, Projectile.Center);
Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y + (float)(Projectile.height / 2);
Projectile.width = 50;
Projectile.height = 50;
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
for (int i = 0; i < 15; i++)
{
int brightDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PurificationPowder, 0f, 0f, 100, default, 1.2f);
Main.dust[brightDust].velocity *= 3f;
if (Main.rand.NextBool())
{
Main.dust[brightDust].scale = 0.5f;
Main.dust[brightDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int j = 0; j < 30; j++)
{
int brightDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PurificationPowder, 0f, 0f, 100, default, 1.7f);
Main.dust[brightDust2].noGravity = true;
Main.dust[brightDust2].velocity *= 5f;
brightDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PurificationPowder, 0f, 0f, 100, default, 1f);
Main.dust[brightDust2].velocity *= 2f;
}
if (!Main.dedServ)
{
for (int k = 0; k < 3; k++)
{
Gore.NewGore(Projectile.GetSource_Death(), Projectile.position, new Vector2(Projectile.velocity.X * 0.05f, Projectile.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f);
}
}
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 2);
return false;
}
}
}
-67
View File
@@ -1,67 +0,0 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class ClamorNoctusWyvern : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Magic";
public override void SetDefaults()
{
Projectile.width = 10;
Projectile.height = 10;
Projectile.friendly = true;
Projectile.penetrate = 1;
Projectile.alpha = 255;
Projectile.DamageType = DamageClass.Magic;
Projectile.aiStyle = ProjAIStyleID.Nail;
Projectile.extraUpdates = 1;
}
public override void AI()
{
if (Main.rand.NextBool(5))
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Shadewood, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f);
}
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
if (Projectile.owner == Main.myPlayer)
{
Projectile.timeLeft = 0;
}
return false;
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.NPCHit7, Projectile.Center);
for (int i = 0; i <= 10; i++)
{
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.Shadewood, Projectile.oldVelocity.X * 0.5f, Projectile.oldVelocity.Y * 0.5f);
}
if (!Main.dedServ)
{
int head = Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, Projectile.velocity * 0.8f, Mod.Find<ModGore>("ClamorNoctusHead").Type);
Main.gore[head].timeLeft /= 10;
int body = Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, Projectile.velocity * 0.8f, Mod.Find<ModGore>("ClamorNoctusBody").Type);
Main.gore[body].timeLeft /= 10;
int tail = Gore.NewGore(Projectile.GetSource_Death(), Projectile.Center, Projectile.velocity * 0.8f, Mod.Find<ModGore>("ClamorNoctusTail").Type);
Main.gore[tail].timeLeft /= 10;
}
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value;
Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
return false;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

+238
View File
@@ -0,0 +1,238 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
using Terraria;
using Terraria.Audio;
using Terraria.GameContent;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class DracoConstellation : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Magic";
public override string Texture => "CalamityMod/Particles/Sparkle";
public float TailLength => 600;
public List<DracoSegment> Segments = new();
/// <summary>
/// Do not reference this field directly. Use GetGlowTex() instead.
/// </summary>
private static Asset<Texture2D> GlowTex = null;
private static Texture2D GetGlowTex()
{
if (GlowTex == null)
{
GlowTex = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle");
}
return GlowTex.Value;
}
public class DracoSegment
{
public Vector2 Center = Vector2.Zero;
public float rotation = 0;
public Vector2 velocity = Vector2.Zero;
public Vector2 size = Vector2.One;
public float followDistance = 50;
public float PoseRotation = 0;
public DracoSegment(Projectile Head, float followingDistance = 50)
{
Center = Head.Center;
rotation = Head.rotation;
velocity = Head.velocity;
followDistance = followingDistance;
}
public DracoSegment(DracoConstellation Head, float followingDistance, float rotation)
{
var prior = Head.Segments.LastOrDefault(new DracoSegment(Head.Projectile));
Center = prior.Center + rotation.ToRotationVector2() * (followingDistance * 600f);
this.rotation = prior.rotation;
velocity = prior.velocity;
followDistance = followingDistance;
PoseRotation = rotation;
}
}
public override void SetDefaults()
{
Projectile.width = 64;
Projectile.height = 64;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.DamageType = DamageClass.Magic;
Projectile.extraUpdates = 1;
Projectile.tileCollide = false;
Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates;
Projectile.usesLocalNPCImmunity = true;
Projectile.timeLeft = 300;
}
public override void AI()
{
if (Main.player[Projectile.owner].Calamity().StratusStarburst < 1 && Projectile.timeLeft > 60)
{
Projectile.timeLeft = 60;
return;
}
if (Projectile.FinalExtraUpdate() && Main.player[Projectile.owner].miscCounter % 15 == 0 &&
Projectile.timeLeft > 60)
{
Main.player[Projectile.owner].Calamity().StratusStarburst--;
Main.player[Projectile.owner].Calamity().HasStratusItemCooldown = (int)MathHelper.Max(Main.player[Projectile.owner].Calamity().HasStratusItemCooldown, 240);
}
if (Segments.Count <= 0)
{
//These segment lengths were gotten by getting the length between each star from Draco's Wikipedia diagam in pixels, then converting to a percentage of the total length.
//This ignores the "head" of draco in those calculations. The values here are multiplied by TailLength to get the full length of Draco in game.
Segments = new List<DracoSegment>();
Segments.Add(new(this, 0.1985f, MathHelper.TwoPi * 0.74f));
Segments.Add(new(this, 0.0835f, MathHelper.TwoPi * 0.01f));
Segments.Add(new(this, 0.1209f, MathHelper.TwoPi * 0.2f));
Segments.Add(new(this, 0.0938f, MathHelper.TwoPi * 0.15f));
Segments.Add(new(this, 0.0571f, MathHelper.TwoPi * 0.15f));
Segments.Add(new(this, 0.0711f, MathHelper.TwoPi * 0.99f));
Segments.Add(new(this, 0.1560f, MathHelper.TwoPi * 0.9f));
Segments.Add(new(this, 0.1458f, MathHelper.TwoPi * 0.85f));
Segments.Add(new(this, 0.0733f, MathHelper.TwoPi * 0.9f));
};
if (Projectile.timeLeft <= 240 && Projectile.timeLeft > 60)
{
Projectile.timeLeft++;
NPC target = null;
if (Main.player[Projectile.owner].HasMinionAttackTargetNPC)
{
target = Main.npc[Main.player[Projectile.owner].MinionAttackTargetNPC];
}
float targetDistance = 800;
if (target == null || Projectile.localNPCImmunity[target.whoAmI] > 0 || target.dontTakeDamage)
target = null;
if (target == null)
foreach (var item in Main.ActiveNPCs)
{
if (item.dontTakeDamage || Projectile.localNPCImmunity[item.whoAmI] > 0 || item.Distance(Main.player[Projectile.owner].Center) > 1200)
continue;
var dis = Projectile.Distance(item.Center);
if (dis < targetDistance)
{
targetDistance = dis;
target = item;
}
}
if (target != null)
{
float velLength = Projectile.velocity.Length();
Projectile.velocity += Projectile.DirectionTo(target.Center) * 0.5f;
}
else if (Projectile.Distance(Main.player[Projectile.owner].Center) > 300)
{
float velLength = Projectile.velocity.Length();
Projectile.velocity += Projectile.DirectionTo(Main.player[Projectile.owner].Center) * 0.5f;
}
if (Projectile.velocity.Length() > 5)
Projectile.velocity *= 0.98f;
Projectile.rotation = Projectile.velocity.ToRotation();
}
else if (Projectile.timeLeft > 60) {
Projectile.rotation = MathHelper.PiOver2;
Projectile.scale = MathHelper.Lerp(1, 0, (Projectile.timeLeft - 240) / 60f);
} else
{
Projectile.scale = MathHelper.Lerp(0, 1, (Projectile.timeLeft) / 60f);
Projectile.velocity *= 0.95f;
}
Projectile.position += Projectile.velocity;
if (Projectile.timeLeft <= 241)
for (int i = 0; i < Segments.Count; i++)
{
float segmentDistance = Segments[i].followDistance * TailLength;
var thisSeg = Segments[i];
var aheadSeg = new DracoSegment(Projectile);
if (i != 0)
{
aheadSeg = Segments[i - 1];
}
float intensity = 0.05f;
Vector2 nexSegDir = aheadSeg.Center - thisSeg.Center;
if (aheadSeg.rotation != thisSeg.rotation)
{
nexSegDir = nexSegDir.RotatedBy(MathHelper.WrapAngle(aheadSeg.rotation - thisSeg.rotation) * intensity);
nexSegDir = nexSegDir.MoveTowards((aheadSeg.rotation - thisSeg.rotation).ToRotationVector2(), 1f);
}
thisSeg.rotation = nexSegDir.ToRotation();
thisSeg.Center = aheadSeg.Center - nexSegDir.SafeNormalize(Vector2.Zero) * segmentDistance;
}
Projectile.position -= Projectile.velocity;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
{
for (var i = 0; i < Segments.Count; i++)
{
var prevSeg = new DracoSegment(Projectile);
if (i != 0)
{
prevSeg = Segments[i - 1];
}
float cpoint = 0;
if (Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), prevSeg.Center, Segments[i].Center, 4, ref cpoint))
{
return true;
}
}
return base.Colliding(projHitbox, targetHitbox);
}
public override bool PreDraw(ref Color lightColor)
{
var tex = TextureAssets.Projectile[Type].Value;
var connectioncolor = Color.SkyBlue * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.125f + 0.75f);
Main.spriteBatch.SafeBegin(SpriteSortMode.Immediate, BatchSetting.Additive, null, Main.GameViewMatrix.TransformationMatrix, () =>
{
for (var i = 0; i < Segments.Count; i++)
{
if (i == 0)
{
CalamityUtils.DrawLineBetter(Main.spriteBatch, Projectile.Center, Segments[i].Center, connectioncolor, 2 * Projectile.scale);
}
if (Segments.IndexInRange(i + 1))
{
var nextSegment = Segments[i + 1];
CalamityUtils.DrawLineBetter(Main.spriteBatch, Segments[i].Center, nextSegment.Center, connectioncolor, 2 * Projectile.scale);
}
Main.spriteBatch.Draw(GetGlowTex(), Segments[i].Center - Main.screenPosition, null, Color.SkyBlue, 0, GetGlowTex().Size() * 0.5f, 0.2f * Projectile.scale, SpriteEffects.None, 0);
Main.spriteBatch.Draw(tex, Segments[i].Center - Main.screenPosition, null, Color.White, 0*Segments[i].followDistance * 5f * Main.GlobalTimeWrappedHourly, tex.Size() * 0.5f, 0.75f * Projectile.scale, SpriteEffects.None, 0);
}
void DrawHeadStar(Vector2 offsetPercentage)
{
Main.spriteBatch.Draw(GetGlowTex(), Projectile.Center + offsetPercentage.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength - Main.screenPosition, null, Color.SkyBlue, 0, GetGlowTex().Size() * 0.5f, 0.2f * Projectile.scale, SpriteEffects.None, 0);
Main.spriteBatch.Draw(tex, Projectile.Center + offsetPercentage.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength - Main.screenPosition, null, Color.White,0*Math.Abs(offsetPercentage.X) * 5f * Main.GlobalTimeWrappedHourly, tex.Size() * 0.5f, 0.75f * Projectile.scale, SpriteEffects.None, 0);
}
void connectOffsets(Vector2 offset1, Vector2 offset2)
{
CalamityUtils.DrawLineBetter(Main.spriteBatch, Projectile.Center + offset1.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength, Projectile.Center + offset2.RotatedBy(Projectile.rotation - MathHelper.PiOver2) * TailLength, connectioncolor, 2 * Projectile.scale);
}
connectOffsets(new(), new(-0.0425f, 0.0637f));
connectOffsets(new(), new(0.0307f, 0.0418f));
connectOffsets(new(-0.0425f, 0.0637f), new(0.0168f, 0.0791f));
connectOffsets(new(0.0307f, 0.0418f), new(0.0168f, 0.0791f));
DrawHeadStar(new());
DrawHeadStar(new(-0.0425f, 0.0637f));
DrawHeadStar(new(0.0307f, 0.0418f));
DrawHeadStar(new(0.0168f, 0.0791f));
});
return false;
}
}
}
+1 -2
View File
@@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.velocity *= 0.965f;
if (Projectile.timeLeft < 225 * Projectile.MaxUpdates)
CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 12f, 20f,true)
CalamityUtils.HomeInOnNPC(Projectile, true, 600f, 12f, 20f, true);
}
public override void OnKill(int timeLeft)
@@ -82,7 +82,6 @@ namespace CalamityMod.Projectiles.Melee
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
}
}
}
+1 -1
View File
@@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Melee
point2 += new Vector2(5, 49.25f);
point1.X *= Projectile.spriteDirection;
point2.X *= Projectile.spriteDirection;
var color = Color.SkyBlue * 0.5f * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.25f + 0.5f);
var color = Color.SkyBlue * 0.75f * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.25f + 0.5f);
CalamityUtils.DrawLineBetter(Main.spriteBatch, SiriusPos + point1.RotatedBy(Projectile.rotation) * Projectile.scale, SiriusPos + point2.RotatedBy(Projectile.rotation) * Projectile.scale, color * Projectile.Opacity, 3);
}
//Order is back of tail to front. Last four are the head
@@ -177,7 +177,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
for (int i = 0; i < 3; i++)
{
float moveDuration = Main.rand.Next(5, 15);
var proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Owner.velocity.RotatedByRandom(0.4f) * -Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType<NightsGazeStar>(), Projectile.originalDamage, Projectile.knockBack, Projectile.owner, 0f, moveDuration);
var proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Owner.velocity.RotatedByRandom(0.4f) * -Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType<VegaStar>(), Projectile.originalDamage, Projectile.knockBack, Projectile.owner, 0f, moveDuration);
if (Main.projectile.IndexInRange(proj))
{
Main.projectile[proj].DamageType = DamageClass.Melee;
@@ -235,11 +235,12 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
float intensity = MathHelper.Min(32, point1.Distance(point2) * 0.1f);
float size = intensity/32f;
intensity *= intensitymult;
var color = Color.SkyBlue * 0.75f * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.25f + 0.5f);
for (var i = 1; i < offsets.Count; i++)
{
var p1 = Vector2.Lerp(point1, point2, i / (float)(offsets.Count-1)) + new Vector2(0, intensity).RotatedBy(point1.DirectionTo(point2).ToRotation()) * MathF.Sin(Projectile.ai[2] * 0.01f * offsets[i].Item2 + offsets[i].Item1);
var p2 = Vector2.Lerp(point1, point2, (i - 1) / (float)(offsets.Count - 1)) + new Vector2(0, intensity).RotatedBy(point1.DirectionTo(point2).ToRotation()) * MathF.Sin(Projectile.ai[2] * 0.01f * offsets[i-1].Item2 + offsets[i-1].Item1);
CalamityUtils.DrawLineBetter(Main.spriteBatch, p1, p2, Color.SkyBlue * 0.5f, 2 * size);
CalamityUtils.DrawLineBetter(Main.spriteBatch, p1, p2, color, 2 * size);
}
return base.PreDraw(ref lightColor);
}
+1 -1
View File
@@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Rogue
point2 += new Vector2(35.666f, -53.166f);
point1.X *= Projectile.spriteDirection;
point2.X *= Projectile.spriteDirection;
var color = Color.SkyBlue * 0.5f * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.25f + 0.5f);
var color = Color.SkyBlue * 0.75f * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.25f + 0.5f);
CalamityUtils.DrawLineBetter(Main.spriteBatch, SiriusPos + point1.RotatedBy(Projectile.rotation) * Projectile.scale - (Owner.oldVelocity * Math.Clamp(point1.Length() * 0.001f, 0, 1)), SiriusPos + point2.RotatedBy(Projectile.rotation) * Projectile.scale - (Owner.oldVelocity * Math.Clamp(point2.Length() * 0.001f, 0, 1)), color, 3);
}
ConnectStars( new Vector2(0f, 0f), new Vector2(75, -60)); //Center - Vega
@@ -10,10 +10,10 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class NightsGazeProjectile : ModProjectile, ILocalizedModType
public class VegaProjectile : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
public override string Texture => "CalamityMod/Items/Weapons/Rogue/NightsGaze";
public override string Texture => "CalamityMod/Items/Weapons/Rogue/Vega";
public override void SetStaticDefaults()
{
@@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue
{
foreach (var item in Main.ActiveProjectiles)
{
if (item.type == ModContent.ProjectileType<NightsGazeStar>() && item.owner == Projectile.owner)
if (item.type == ModContent.ProjectileType<VegaStar>() && item.owner == Projectile.owner)
{
item.ai[2] = target.whoAmI + 1;
item.timeLeft = Math.Max(300,item.timeLeft);
@@ -76,8 +76,8 @@ namespace CalamityMod.Projectiles.Rogue
float spread = 20f;
int projectileDamage = SplitProjDamage;
float kb = 5f;
int sparkID = ModContent.ProjectileType<NightsGazeSpark>();
int starID = ModContent.ProjectileType<NightsGazeStar>();
int sparkID = ModContent.ProjectileType<VegaSpark>();
int starID = ModContent.ProjectileType<VegaStar>();
if (Projectile.Calamity().stealthStrike)
for (int i = 0; i < 1; i++)
{
@@ -122,7 +122,7 @@ namespace CalamityMod.Projectiles.Rogue
public override void PostDraw(Color lightColor)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Rogue/NightsGazeGlow").Value;
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Rogue/VegaGlow").Value;
Vector2 origin = new Vector2(texture.Width / 2f, texture.Height / 2f);
Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, origin, 1f, SpriteEffects.None, 0);
}
@@ -7,7 +7,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class NightsGazeSpark : ModProjectile, ILocalizedModType
public class VegaSpark : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
public static int lifetime = 150;
File renamed without changes.

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

@@ -11,7 +11,7 @@ using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class NightsGazeStar : ModProjectile, ILocalizedModType
public class VegaStar : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Rogue";
public static int lifetime = 300;
File renamed without changes.

Before

Width:  |  Height:  |  Size: 452 B

After

Width:  |  Height:  |  Size: 452 B

+2 -2
View File
@@ -95,9 +95,9 @@ namespace CalamityMod.Projectiles.Summon
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Voidfrost>(), 180);
if (Projectile.ai[0] == 1) //Only spawns the on-hit for the quazar
if (Projectile.ai[0] == 1) //Only does all the on-hit for the quazar
{
target.AddBuff(ModContent.BuffType<Voidfrost>(), 600);
float x4 = Main.rgbToHsl(new Color(103, 203, Main.DiscoB)).X;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<SiriusExplosion>(), Projectile.damage, Projectile.knockBack, Projectile.owner, x4, Projectile.whoAmI);
}
+1 -1
View File
@@ -210,7 +210,7 @@ namespace CalamityMod.Projectiles.Summon
return;
point1.X *= Projectile.spriteDirection;
point2.X *= Projectile.spriteDirection;
var color = Color.SkyBlue * 0.5f * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.25f + 0.5f);
var color = Color.SkyBlue * 0.75f * ((MathF.Sin(Main.GlobalTimeWrappedHourly) + 1) * 0.25f + 0.5f);
CalamityUtils.DrawLineBetter(Main.spriteBatch, SiriusPos+point1 * Projectile.scale - (Owner.oldVelocity * Math.Clamp(point1.Length() * 0.001f, 0, 1)), SiriusPos+point2* Projectile.scale - (Owner.oldVelocity * Math.Clamp(point2.Length() * 0.001f, 0, 1)), color, 1.5f);
}
ConnectStars(4,new Vector2(0f, 0f), new Vector2(119f, 32f)); //Sirius - Front Foot