1 - Removed Scarlet Devil by the dedicatee's request.
2 - Removed all mentions of Scarlet Devil's dedicatee from the codebase, at their request. 3 - Renamed the Brimrose mount internally at the dedicatee's request. 4 - Kept ScarletDevilShader around because it is used by over a dozen other things.
This commit is contained in:
1 parent
82695c962e
commit
29aae3591f
19 files changed
+7
-460
No files matched your search
@@ -14,7 +14,7 @@ namespace CalamityMod.Buffs.Mounts
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
player.mount.SetMount(ModContent.MountType<PhuppersChair>(), player);
|
||||
player.mount.SetMount(ModContent.MountType<BrimroseChair>(), player);
|
||||
player.buffTime[buffIndex] = 10;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,8 @@ namespace CalamityMod.Effects
|
||||
// Generic solid trail shader. Used by many things?
|
||||
internal static Effect FadingSolidTrailShader;
|
||||
|
||||
// Scarlet Devil main spear glowing trail. BEWARE: Is reused by many other items!
|
||||
// Typical projectile javelin glowing trail. BEWARE: Is used by many items!
|
||||
// 25MAY2025: Ozzatron: This has not been renamed to a more generic name to avoid breaking addons.
|
||||
internal static Effect ScarletDevilShader;
|
||||
|
||||
// Yharon border flame pillar trail.
|
||||
|
||||
@@ -315,8 +315,6 @@ namespace CalamityMod.Items
|
||||
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(131, 239, 255), new Color(36, 55, 230), 4f);
|
||||
if (item.type == ModContent.ItemType<DraconicDestruction>())
|
||||
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(255, 69, 0), new Color(139, 0, 0), 4f);
|
||||
if (item.type == ModContent.ItemType<ScarletDevil>())
|
||||
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(191, 45, 71), new Color(185, 187, 253), 4f);
|
||||
if (item.type == ModContent.ItemType<RedSun>())
|
||||
nameLine.OverrideColor = CalamityUtils.ColorSwap(new Color(204, 86, 80), new Color(237, 69, 141), 4f);
|
||||
if (item.type == ModContent.ItemType<CrystylCrusher>())
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Mounts
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.UseSound = SoundID.Item3;
|
||||
Item.noMelee = true;
|
||||
Item.mountType = ModContent.MountType<PhuppersChair>();
|
||||
Item.mountType = ModContent.MountType<BrimroseChair>();
|
||||
|
||||
Item.value = Item.sellPrice(gold: 5);
|
||||
Item.rare = ItemRarityID.Yellow;
|
||||
|
||||
@@ -6,7 +6,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Mounts
|
||||
{
|
||||
public class PhuppersChair : ModMount
|
||||
public class BrimroseChair : ModMount
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
File renamed without changes.
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
@@ -164,7 +164,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings
|
||||
"PaleoStar",
|
||||
"Pbtopacio",
|
||||
"Phantasmal Deathray",
|
||||
"Phupperbat",
|
||||
"Pinkie Poss",
|
||||
"Poly",
|
||||
"Popo",
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Rarities;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class ScarletDevil : RogueWeapon
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 108;
|
||||
Item.height = 108;
|
||||
Item.damage = 10000;
|
||||
Item.noMelee = true;
|
||||
Item.noUseGraphic = true;
|
||||
Item.useAnimation = Item.useTime = 60;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.knockBack = 8f;
|
||||
Item.UseSound = SoundID.Item60;
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<ScarletDevilProjectile>();
|
||||
Item.shootSpeed = 30f;
|
||||
Item.DamageType = RogueDamageClass.Instance;
|
||||
|
||||
Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice;
|
||||
Item.rare = ModContent.RarityType<HotPink>();
|
||||
Item.Calamity().devItem = true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (Main.projectile.IndexInRange(proj))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 20;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient<Wrathwing>().
|
||||
AddIngredient<RealityRupture>().
|
||||
AddIngredient<ShadowspecBar>(5).
|
||||
AddIngredient<BloodstoneCore>(15).
|
||||
AddIngredient(ItemID.SoulofNight, 15).
|
||||
AddTile<DraedonsForge>().
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.0 KiB |
@@ -954,17 +954,6 @@ SandDollar: {
|
||||
'''
|
||||
}
|
||||
|
||||
ScarletDevil: {
|
||||
DisplayName: Scarlet Devil
|
||||
Tooltip:
|
||||
'''
|
||||
Throws an ultra high velocity spear, which leaves a trail of homing bullets
|
||||
The spear creates a Scarlet Blast upon hitting an enemy
|
||||
Stealth strikes grant you lifesteal and summon a star of projectiles upon hitting an enemy
|
||||
'Divine Spear "Spear the Gungnir"'
|
||||
'''
|
||||
}
|
||||
|
||||
ScourgeoftheDesert: {
|
||||
DisplayName: Scourge of the Desert
|
||||
Tooltip:
|
||||
|
||||
@@ -227,9 +227,6 @@ SamsaraSlicerSmallDisk.DisplayName: Samsara Slicer
|
||||
SandDollarFrag.DisplayName: Sand Dollar Frag
|
||||
SandDollarProj.DisplayName: Sand Dollar
|
||||
SandDollarStealth.DisplayName: Sand Dollar Duststorm
|
||||
ScarletBlast.DisplayName: Scarlet Blast
|
||||
ScarletDevilBullet.DisplayName: Gungnir Bullet
|
||||
ScarletDevilProjectile.DisplayName: Spear the Gungnir
|
||||
ScourgeoftheDesertProj.DisplayName: Scourge of the Desert
|
||||
ScourgeoftheSeasProjectile.DisplayName: Moist Scourge
|
||||
ScourgeVenomCloud.DisplayName: Venom Cloud
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class ScarletBlast : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 500;
|
||||
Projectile.height = 500;
|
||||
Projectile.friendly = true;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.timeLeft = 30;
|
||||
Projectile.usesLocalNPCImmunity = true;
|
||||
Projectile.localNPCHitCooldown = 10;
|
||||
Projectile.DamageType = RogueDamageClass.Instance;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(Projectile.Center, 0.55f, 0.25f, 0f);
|
||||
if (Projectile.localAI[0] == 0f)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item20, Projectile.position);
|
||||
Projectile.localAI[0] += 1f;
|
||||
}
|
||||
bool xflag = false;
|
||||
bool yflag = false;
|
||||
if (Projectile.velocity.X < 0f && Projectile.position.X < Projectile.ai[0])
|
||||
{
|
||||
xflag = true;
|
||||
}
|
||||
if (Projectile.velocity.X > 0f && Projectile.position.X > Projectile.ai[0])
|
||||
{
|
||||
xflag = true;
|
||||
}
|
||||
if (Projectile.velocity.Y < 0f && Projectile.position.Y < Projectile.ai[1])
|
||||
{
|
||||
yflag = true;
|
||||
}
|
||||
if (Projectile.velocity.Y > 0f && Projectile.position.Y > Projectile.ai[1])
|
||||
{
|
||||
yflag = true;
|
||||
}
|
||||
if (xflag && yflag)
|
||||
{
|
||||
Projectile.Kill();
|
||||
}
|
||||
float projTimer = 25f;
|
||||
if (Projectile.ai[0] > 180f)
|
||||
{
|
||||
projTimer -= (Projectile.ai[0] - 180f) / 2f;
|
||||
}
|
||||
if (projTimer <= 0f)
|
||||
{
|
||||
projTimer = 0f;
|
||||
Projectile.Kill();
|
||||
}
|
||||
projTimer *= 0.7f;
|
||||
Projectile.ai[0] += 4f;
|
||||
int timerCompare = 0;
|
||||
while ((float)timerCompare < projTimer)
|
||||
{
|
||||
float random1 = (float)Main.rand.Next(-30, 35);
|
||||
float random2 = (float)Main.rand.Next(-30, 35);
|
||||
float random3 = (float)Main.rand.Next(13, 18);
|
||||
float randomAdjust = (float)Math.Sqrt((double)(random1 * random1 + random2 * random2));
|
||||
randomAdjust = random3 / randomAdjust;
|
||||
random1 *= randomAdjust;
|
||||
random2 *= randomAdjust;
|
||||
int redDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Firework_Red, 0f, 0f, 100, default, 1.25f);
|
||||
Dust dust = Main.dust[redDust];
|
||||
dust.noGravity = true;
|
||||
dust.position.X = Projectile.Center.X;
|
||||
dust.position.Y = Projectile.Center.Y;
|
||||
dust.position.X += (float)Main.rand.Next(-10, 11);
|
||||
dust.position.Y += (float)Main.rand.Next(-10, 11);
|
||||
dust.velocity.X = random1;
|
||||
dust.velocity.Y = random2;
|
||||
timerCompare++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,75 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class ScarletDevilBullet : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
public override void SetStaticDefaults() => ProjectileID.Sets.CultistIsResistantTo[Type] = true;
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 16;
|
||||
Projectile.height = 16;
|
||||
Projectile.friendly = true;
|
||||
Projectile.timeLeft = 140;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.ignoreWater = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Projectile.ai[0] += 1f;
|
||||
if (Projectile.ai[0] <= 60f)
|
||||
{
|
||||
Projectile.velocity.X *= 0.975f;
|
||||
Projectile.velocity.Y *= 0.975f;
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector2 center = Projectile.Center;
|
||||
float maxDistance = 1000f;
|
||||
bool homeIn = false;
|
||||
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
{
|
||||
if (Main.npc[i].CanBeChasedBy(Projectile, false))
|
||||
{
|
||||
float extraDistance = (float)(Main.npc[i].width / 2) + (float)(Main.npc[i].height / 2);
|
||||
|
||||
if (Vector2.Distance(Main.npc[i].Center, Projectile.Center) < (maxDistance + extraDistance))
|
||||
{
|
||||
center = Main.npc[i].Center;
|
||||
homeIn = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (homeIn)
|
||||
{
|
||||
Vector2 moveDirection = Projectile.SafeDirectionTo(center, Vector2.UnitY);
|
||||
Projectile.velocity = (Projectile.velocity * 10f + moveDirection * 30f) / (11f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.velocity.X = 0f;
|
||||
Projectile.velocity.Y = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(250, 250, 250);
|
||||
}
|
||||
|
||||
public override bool? CanDamage()
|
||||
{
|
||||
if (Projectile.Calamity().stealthStrike && Projectile.ai[0] < 60f)
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 251 B |
@@ -1,209 +0,0 @@
|
||||
using System;
|
||||
using CalamityMod.Balancing;
|
||||
using CalamityMod.Graphics.Primitives;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class ScarletDevilProjectile : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
public ref float ShootTimer => ref Projectile.ai[0];
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/ScarletDevil";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Type] = 45;
|
||||
ProjectileID.Sets.TrailingMode[Type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
ProjectileID.Sets.TrailCacheLength[Type] = 45;
|
||||
Projectile.width = 108;
|
||||
Projectile.height = 108;
|
||||
Projectile.friendly = true;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.penetrate = 1;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.timeLeft = 300;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.DamageType = RogueDamageClass.Instance;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(Projectile.Center, 0.55f, 0.25f, 0f);
|
||||
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4;
|
||||
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
for (int i = 0; i < (Projectile.Calamity().stealthStrike && Main.rand.NextBool() ? 2 : 1); i++)
|
||||
Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, 130, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 0, new Color(255, 255, 255), 0.85f);
|
||||
}
|
||||
|
||||
ShootTimer++;
|
||||
|
||||
if (!Projectile.Calamity().stealthStrike && Projectile.oldPos.Length != 6)
|
||||
Projectile.oldPos = new Vector2[6];
|
||||
|
||||
if ((ShootTimer %= 5f) == 0f && !Projectile.Calamity().stealthStrike)
|
||||
{
|
||||
if (Projectile.owner == Main.myPlayer)
|
||||
GenerateSideBullets(2, MathHelper.ToRadians(15f));
|
||||
}
|
||||
}
|
||||
|
||||
internal void GenerateSideBullets(int totalBullets, float rotationalOffset)
|
||||
{
|
||||
for (int i = 0; i < totalBullets; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(-Projectile.velocity.X / 3, -Projectile.velocity.Y / 3).RotatedBy(MathHelper.Lerp(-rotationalOffset, rotationalOffset, i / (totalBullets - 1)));
|
||||
for (int j = 0; j < 2; j++)
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, perturbedSpeed, ModContent.ProjectileType<ScarletDevilBullet>(), (int)(Projectile.damage * 0.03), 0f, Projectile.owner, 0f, 0f);
|
||||
perturbedSpeed *= 1.05f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void SpawnOnStealthStrikeBullets()
|
||||
{
|
||||
float starSpeed = 25f;
|
||||
|
||||
// Spawn a circle of fast bullets.
|
||||
for (int i = 0; i < 40; i++)
|
||||
{
|
||||
Vector2 shootVelocity = (MathHelper.TwoPi * i / 40f).ToRotationVector2() * starSpeed;
|
||||
int bullet = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + shootVelocity, shootVelocity, ModContent.ProjectileType<ScarletDevilBullet>(), (int)(Projectile.damage * 0.01), 0f, Projectile.owner);
|
||||
if (Main.projectile.IndexInRange(bullet))
|
||||
Main.projectile[bullet].Calamity().stealthStrike = true;
|
||||
}
|
||||
|
||||
// Spawn a pair of stars, one slow, one fast.
|
||||
int pointsOnStar = 6;
|
||||
for (int k = 0; k < 2; k++)
|
||||
{
|
||||
for (int i = 0; i < pointsOnStar; i++)
|
||||
{
|
||||
float angle = MathHelper.Pi * 1.5f - i * MathHelper.TwoPi / pointsOnStar;
|
||||
float nextAngle = MathHelper.Pi * 1.5f - (i + 3) % pointsOnStar * MathHelper.TwoPi / pointsOnStar;
|
||||
if (k == 1)
|
||||
nextAngle = MathHelper.Pi * 1.5f - (i + 2) * MathHelper.TwoPi / pointsOnStar;
|
||||
Vector2 start = angle.ToRotationVector2();
|
||||
Vector2 end = nextAngle.ToRotationVector2();
|
||||
int pointsOnStarSegment = 18;
|
||||
for (int j = 0; j < pointsOnStarSegment; j++)
|
||||
{
|
||||
Vector2 shootVelocity = Vector2.Lerp(start, end, j / (float)pointsOnStarSegment) * starSpeed;
|
||||
int bullet = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + shootVelocity, shootVelocity, ModContent.ProjectileType<ScarletDevilBullet>(), (int)(Projectile.damage * 0.01), 0f, Projectile.owner);
|
||||
if (Main.projectile.IndexInRange(bullet))
|
||||
Main.projectile[bullet].Calamity().stealthStrike = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(250, 250, 250);
|
||||
}
|
||||
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item122, Projectile.position);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
Projectile.ExpandHitboxBy(150);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<ScarletBlast>(), (int)(Projectile.damage * 0.0075), 0f, Projectile.owner);
|
||||
if (!Projectile.Calamity().stealthStrike)
|
||||
return;
|
||||
|
||||
// Spawn a bloom of bullets.
|
||||
SpawnOnStealthStrikeBullets();
|
||||
|
||||
// Give on-heal effects from stealth strikes.
|
||||
int heal = (int)Math.Round(hit.Damage * 0.01);
|
||||
if (heal > BalancingConstants.LifeStealCap)
|
||||
heal = BalancingConstants.LifeStealCap;
|
||||
|
||||
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player target, Player.HurtInfo info)
|
||||
{
|
||||
Projectile.ExpandHitboxBy(150);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<ScarletBlast>(), (int)(Projectile.damage * 0.0075), 0f, Projectile.owner);
|
||||
if (!Projectile.Calamity().stealthStrike)
|
||||
return;
|
||||
|
||||
// Spawn a bloom of bullets.
|
||||
SpawnOnStealthStrikeBullets();
|
||||
|
||||
// Give on-heal effects from stealth strikes.
|
||||
int heal = (int)Math.Round(info.Damage * 0.01);
|
||||
if (heal > BalancingConstants.LifeStealCap)
|
||||
heal = BalancingConstants.LifeStealCap;
|
||||
|
||||
if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange);
|
||||
}
|
||||
|
||||
internal float WidthFunction(float completionRatio)
|
||||
{
|
||||
float widthRatio = Utils.GetLerpValue(0f, 0.1f, completionRatio, true);
|
||||
float baseWidth = MathHelper.Lerp(0f, 110f, widthRatio) * MathHelper.Clamp(1f - (float)Math.Pow(completionRatio, 0.4D), 0.37f, 1f);
|
||||
return baseWidth;
|
||||
}
|
||||
|
||||
internal Color ColorFunction(float completionRatio)
|
||||
{
|
||||
float colorIncrement = (float)Math.Pow(completionRatio, 1f / 2f);
|
||||
if (colorIncrement is float.NaN)
|
||||
return Color.DarkRed;
|
||||
float colorFade = 1f - Utils.GetLerpValue(0.6f, 0.98f, completionRatio, true);
|
||||
Color baseColor = CalamityUtils.MulticolorLerp(colorIncrement, Color.White, Color.DarkRed, Color.Wheat, Color.IndianRed) * MathHelper.Lerp(0f, 1.4f, colorFade);
|
||||
return Color.Lerp(baseColor, Color.DarkRed, (float)Math.Pow(completionRatio, 3D));
|
||||
}
|
||||
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
if (!Projectile.Calamity().stealthStrike)
|
||||
{
|
||||
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], new Color(100, 100, 100));
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"].SetShaderTexture(ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Trails/ScarletDevilStreak"));
|
||||
PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(WidthFunction, ColorFunction, (_) => Projectile.Size * 0.5f + Projectile.velocity.SafeNormalize(Vector2.Zero) * 86f, false,
|
||||
shader: GameShaders.Misc["CalamityMod:OverpoweredTouhouSpearShader"]), 60);
|
||||
|
||||
Texture2D spearTexture = Terraria.GameContent.TextureAssets.Projectile[Type].Value;
|
||||
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
Color drawColor = Color.Lerp(lightColor, Color.White, 0.8f) * 0.2f;
|
||||
drawColor.A = 0;
|
||||
|
||||
Vector2 drawOffset = (i / 7f * MathHelper.TwoPi).ToRotationVector2() * 2f;
|
||||
Main.EntitySpriteDraw(spearTexture, Projectile.Center - Main.screenPosition + drawOffset, null, drawColor, Projectile.rotation, spearTexture.Size() * 0.5f, Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -155,7 +155,6 @@ namespace CalamityMod.Projectiles.Summon
|
||||
}
|
||||
|
||||
// Turning (wtf is this)
|
||||
// idk ask phup lmao
|
||||
if (Projectile.velocity.X < playerDestination.X)
|
||||
{
|
||||
Projectile.velocity.X += acceleration;
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
playerDist = returnSpeed / playerDist;
|
||||
playerDestination *= playerDist;
|
||||
// Turning (wtf is this) (idk ask phup lmao)
|
||||
// Turning (wtf is this)
|
||||
if (Projectile.velocity.X < playerDestination.X)
|
||||
{
|
||||
Projectile.velocity.X += acceleration;
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
|
||||
playerDist = returnSpeed / playerDist;
|
||||
playerDestination *= playerDist;
|
||||
// Turning (wtf is this) (idk ask phup lmao)
|
||||
// Turning (wtf is this)
|
||||
if (Projectile.velocity.X < playerDestination.X)
|
||||
{
|
||||
Projectile.velocity.X += acceleration;
|
||||
|
||||
Reference in new issue
Block a user