Merge branch '1.4.4' of https://github.com/CalamityTeam/CalamityMod into tile-hell

This commit is contained in:
Altixal committed 2023-09-20 02:44:02 +07:00
commit 59b5b6cd82
128 files changed
+2369 -1675

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 765 B

-34
View File
@@ -1,34 +0,0 @@
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class Calamari : ModBuff
{
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.buffNoSave[Type] = true;
//Main.persistentBuff[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (player.ownedProjectileCounts[ModContent.ProjectileType<CalamariMinion>()] > 0)
{
modPlayer.calamari = true;
}
if (!modPlayer.calamari)
{
player.DelBuff(buffIndex);
buffIndex--;
}
else
{
player.buffTime[buffIndex] = 18000;
}
}
}
}
@@ -1,11 +1,11 @@
using CalamityMod.CalPlayer;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class BloodClot : ModBuff
public class CalamarisLamentBuff : ModBuff
{
public override void SetStaticDefaults()
{
@@ -17,11 +17,11 @@ namespace CalamityMod.Buffs.Summon
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (player.ownedProjectileCounts[ModContent.ProjectileType<BloodClotMinion>()] > 0)
if (player.ownedProjectileCounts[ModContent.ProjectileType<CalamarisLamentMinion>()] > 0)
{
modPlayer.bClot = true;
modPlayer.CalamarisLament = true;
}
if (!modPlayer.bClot)
if (!modPlayer.CalamarisLament)
{
player.DelBuff(buffIndex);
buffIndex--;
File renamed without changes.

Before

Width:  |  Height:  |  Size: 616 B

After

Width:  |  Height:  |  Size: 616 B

+47 -2
View File
@@ -78,6 +78,7 @@ namespace CalamityMod.CalPlayer
public bool killSpikyBalls = false;
public float KameiTrailXScale = 0.1f;
public int KameiBladeUseDelay = 0;
public int SpeedBlasterDashDelayCooldown = 0;
public Vector2[] OldPositions = new Vector2[4];
public double contactDamageReduction = 0D;
public double projectileDamageReduction = 0D;
@@ -174,6 +175,9 @@ namespace CalamityMod.CalPlayer
#region Timer and Counter
public int gaelSwipes = 0;
public float ColorValue = 0; //used for Speed Blaster's colors
public bool sBlasterDashActivated = false;
public int SpeedBlasterDashVisual = 1;
public int Holyhammer = 0;
public int PHAThammer = 0;
public int StellarHammer = 0;
@@ -474,6 +478,7 @@ namespace CalamityMod.CalPlayer
public bool hideOfDeus = false;
public bool dAmulet = false;
public bool gShell = false;
public bool lAmbergris = false;
public bool tortShell = false;
public bool absorber = false;
public bool alwaysHoneyRegen = false;
@@ -550,6 +555,7 @@ namespace CalamityMod.CalPlayer
public bool crawCarapace = false;
public bool baroclaw = false;
public bool HasReducedDashFirstFrame = false;
public bool HasIncreasedDashFirstFrame = false;
public bool voidOfCalamity = false;
public bool voidOfExtinction = false;
public bool eArtifact = false;
@@ -693,6 +699,7 @@ namespace CalamityMod.CalPlayer
public bool godSlayerRanged = false;
public bool godSlayerThrowing = false;
public bool godSlayerDashHotKeyPressed = false;
public bool SpeedBlasterDashStarted = false;
public bool ataxiaBolt = false;
public bool ataxiaFire = false;
public bool ataxiaVolley = false;
@@ -931,7 +938,7 @@ namespace CalamityMod.CalPlayer
public bool herring = false;
public bool blackhawk = false;
public bool cosmicViper = false;
public bool calamari = false;
public bool CalamarisLament = false;
public bool cEyes = false;
public bool cSlime = false;
public bool cSlime2 = false;
@@ -1585,6 +1592,7 @@ namespace CalamityMod.CalPlayer
hideOfDeus = false;
dAmulet = false;
gShell = false;
lAmbergris = false;
tortShell = false;
absorber = false;
alwaysHoneyRegen = false;
@@ -1637,6 +1645,7 @@ namespace CalamityMod.CalPlayer
crawCarapace = false;
baroclaw = false;
gShell = false;
lAmbergris = false;
tortShell = false;
voidOfCalamity = false;
voidOfExtinction = false;
@@ -1936,7 +1945,7 @@ namespace CalamityMod.CalPlayer
herring = false;
blackhawk = false;
cosmicViper = false;
calamari = false;
CalamarisLament = false;
cEyes = false;
cSlime = false;
cSlime2 = false;
@@ -2396,6 +2405,7 @@ namespace CalamityMod.CalPlayer
godSlayerRanged = false;
godSlayerThrowing = false;
godSlayerDashHotKeyPressed = false;
SpeedBlasterDashStarted = false;
auricBoost = false;
silvaSet = false;
silvaMage = false;
@@ -2933,6 +2943,21 @@ namespace CalamityMod.CalPlayer
}
}
//Right click dash on Speed Blaster
if (sBlasterDashActivated == true)
{
if ((Player.controlUp || Player.controlDown || Player.controlLeft || Player.controlRight) && !Player.pulley && Player.grappling[0] == -1 && !Player.tongued && !Player.mount.Active && SpeedBlasterDashDelayCooldown == 300 && Player.dashDelay == 0)
{
SpeedBlasterDashStarted = true;
}
}
if (Player.Calamity().SpeedBlasterDashStarted || (Player.dashDelay != 0 && Player.Calamity().LastUsedDashID == SpeedBlasterDash.ID))
{
Player.Calamity().DeferredDashID = SpeedBlasterDash.ID;
Player.dash = 0;
}
// Trigger for pressing the Rage hotkey.
if (CalamityKeybinds.RageHotKey.JustPressed)
{
@@ -3594,6 +3619,7 @@ namespace CalamityMod.CalPlayer
(lunicCorpsLegs ? 0.1f : 0f) +
(shadowSpeed ? 0.5f : 0f) +
(stressPills ? 0.05f : 0f) +
(aeroStone && Player.equippedWings != null && Player.wingTime == 0f ? 0.5f : 0f) +
((abyssalDivingSuit && Player.IsUnderwater()) ? 0.05f : 0f) +
(aquaticHeartWaterBuff ? 0.15f : 0f) +
((frostFlare && Player.statLife < (int)(Player.statLifeMax2 * 0.25)) ? 0.15f : 0f) +
@@ -4166,6 +4192,18 @@ namespace CalamityMod.CalPlayer
Player.eocDash = 0;
}
// Disable vanilla dashes during god slayer dash
if (SpeedBlasterDashStarted)
{
// Set the player to have no registered vanilla dashes.
Player.dashType = 0;
// Prevent the possibility of Shield of Cthulhu invulnerability exploits.
Player.eocHit = -1;
if (Player.eocDash != 0)
Player.eocDash = 0;
}
if ((silvaCountdown > 0 && hasSilvaEffect && silvaSet) || (DashID == GodslayerArmorDash.ID && Player.dashDelay < 0))
{
if (Player.lifeRegen < 0)
@@ -4719,6 +4757,7 @@ namespace CalamityMod.CalPlayer
#endregion
#region Misc Stuff
private static int musicModDisplayDelay = -1;
// Triggers effects that must occur when the player enters the world. This sends a bunch of packets in multiplayer.
// It also starts the speedrun timer if applicable.
@@ -4737,6 +4776,12 @@ namespace CalamityMod.CalPlayer
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus1");
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.WikiStatus2");
}
// Set a random delay between 12 and 20 seconds. When this delay hits zero, the music mod reminder message displays
if (CalamityMod.Instance.musicMod is null && CalamityConfig.Instance.MusicModReminderMessage)
{
musicModDisplayDelay = Main.rand.Next(CalamityUtils.SecondsToFrames(12), CalamityUtils.SecondsToFrames(20) + 1);
}
}
/// <summary>
+19
View File
@@ -14,6 +14,7 @@ namespace CalamityMod.CalPlayer
public partial class CalamityPlayer : ModPlayer
{
public int VerticalGodslayerDashTimer;
public int VerticalSpeedBlasterDashTimer;
private string dashID; //private backing variable
@@ -100,6 +101,13 @@ namespace CalamityMod.CalPlayer
}
}
if (Player.dashDelay > 0) //Speed Blaster
{
VerticalSpeedBlasterDashTimer = 0;
LastUsedDashID = string.Empty;
return;
}
if (Player.dashDelay > 0)
{
VerticalGodslayerDashTimer = 0;
@@ -135,6 +143,17 @@ namespace CalamityMod.CalPlayer
}
}
if (UsedDash.IsOmnidirectional && VerticalSpeedBlasterDashTimer < 25)
{
VerticalSpeedBlasterDashTimer++;
if (VerticalSpeedBlasterDashTimer >= 25)
{
Player.dashDelay = dashDelayToApply;
// Stop the player from going flying
Player.velocity *= 0.2f;
}
}
if (HasCustomDash)
{
Player.vortexStealthActive = false;
-3
View File
@@ -2015,9 +2015,6 @@ namespace CalamityMod.CalPlayer
SoundEngine.PlaySound(SoundID.Item96, Player.Center);
}
if ((flameLickedShell) && !Player.panic)
Player.AddBuff(ModContent.BuffType<ShellBoost>(), 180);
if (gShell) //5 seconds of no dash reduction and reduced defense
giantShellPostHit = 300;
+111 -8
View File
@@ -43,6 +43,8 @@ using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.Other;
using CalamityMod.NPCs.PlagueEnemies;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Healing;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Rogue;
@@ -139,6 +141,9 @@ namespace CalamityMod.CalPlayer
// Potions (Quick Buff && Potion Sickness)
HandlePotions();
// Display the Music Mod Reminder text in chat.
HandleTextChatMessages();
// Check if schematics are present on the mouse, for the sake of registering their recipes.
CheckIfMouseItemIsSchematic();
@@ -223,6 +228,86 @@ namespace CalamityMod.CalPlayer
HasReducedDashFirstFrame = false;
}
if (lAmbergris)
{
if (Player.dashDelay == -1)// TODO: prevent working with special dashes, this was inconsitent with my old solution so I didn't keep it. not huge deal)
{
Player.endurance += 0.05f;
if (!HasIncreasedDashFirstFrame)
{
Player.velocity.X *= 1.15f;
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<LeviAmberDash>(), 75, 20f, Player.whoAmI);
HasIncreasedDashFirstFrame = true;
}
float numberOfDusts = 10f;
float rotFactor = 180f / numberOfDusts;
for (int i = 0; i < numberOfDusts; i++)
{
float rot = MathHelper.ToRadians(i * rotFactor);
Vector2 offset = new Vector2(Player.velocity.X * Player.direction * 0.7f + 6f, 0).RotatedBy(rot * Main.rand.NextFloat(4f, 5f));
Vector2 velOffset = Vector2.Zero;
Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool(2) ? 160 : 307, new Vector2(velOffset.X, velOffset.Y));
dust.noGravity = true;
dust.velocity = velOffset;
dust.alpha = 100;
dust.scale = (Player.velocity.X * Player.direction * 0.08f);
}
if (Player.miscCounter % 4 == 0)
{
float sparkscale = (Player.velocity.X * Player.direction * 0.07f);
Vector2 SparkVelocity1 = Player.velocity.RotatedBy(Player.direction * 2, default) * 0.1f - Player.velocity / 2f;
SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.DodgerBlue);
GeneralParticleHandler.SpawnParticle(spark);
Vector2 SparkVelocity2 = Player.velocity.RotatedBy(Player.direction * -2, default) * 0.1f - Player.velocity / 2f;
SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkTurquoise : Color.DodgerBlue);
GeneralParticleHandler.SpawnParticle(spark2);
}
if (Player.miscCounter % 4 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<LeviAmberDash>(), 90, 0f, Player.whoAmI);
}
else
HasIncreasedDashFirstFrame = false;
}
if (flameLickedShell)
{
if (Player.dashDelay == -1)// TODO: prevent working with special dashes, this was inconsitent with my old solution so I didn't keep it. not huge deal)
{
if (!HasReducedDashFirstFrame)
{
SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with { Volume = 0.4f , PitchVariance = 0.4f }, Player.Center);
Player.velocity.X *= 0.75f; //25% reduced dash velocity
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<FlameLickedShellBurst>(), 67, 16f, Player.whoAmI);
HasReducedDashFirstFrame = true;
}
float numberOfDusts = 10f;
float rotFactor = 180f / numberOfDusts;
for (int i = 0; i < numberOfDusts; i++)
{
float rot = MathHelper.ToRadians(i * rotFactor);
Vector2 offset = new Vector2(Player.velocity.X * Player.direction * 0.7f + 8f, 0).RotatedBy(rot * Main.rand.NextFloat(4f, 5f));
Vector2 velOffset = Vector2.Zero;
Dust dust = Dust.NewDustPerfect(Player.Center + offset + Player.velocity, Main.rand.NextBool(2) ? 35 : 127, new Vector2(velOffset.X, velOffset.Y));
dust.noGravity = true;
dust.velocity = velOffset;
dust.alpha = 100;
dust.scale = (Player.velocity.X * Player.direction * 0.08f);
}
float sparkscale = (Player.velocity.X * Player.direction * 0.08f);
Vector2 SparkVelocity1 = Player.velocity.RotatedBy(Player.direction * -3, default) * 0.1f - Player.velocity / 2f;
SparkParticle spark = new SparkParticle(Player.Center + Player.velocity.RotatedBy(2f * Player.direction) * 1.5f, SparkVelocity1, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkOrange : Color.OrangeRed);
GeneralParticleHandler.SpawnParticle(spark);
Vector2 SparkVelocity2 = Player.velocity.RotatedBy(Player.direction * 3, default) * 0.1f - Player.velocity / 2f;
SparkParticle spark2 = new SparkParticle(Player.Center + Player.velocity.RotatedBy(-2f * Player.direction) * 1.5f, SparkVelocity2, false, Main.rand.Next(11, 13), sparkscale, Main.rand.NextBool(2) ? Color.DarkOrange : Color.OrangeRed);
GeneralParticleHandler.SpawnParticle(spark2);
if (Player.miscCounter % 5 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<FlameLickedShellBurst>(), 220, 16f, Player.whoAmI);
}
else
HasReducedDashFirstFrame = false;
}
if (tortShell)
{
//reduce player dash velocity as long as you didn't just get hit
@@ -1175,6 +1260,8 @@ namespace CalamityMod.CalPlayer
phantomicBulwarkCooldown--;
if (KameiBladeUseDelay > 0)
KameiBladeUseDelay--;
if (SpeedBlasterDashDelayCooldown > 0)
SpeedBlasterDashDelayCooldown--;
if (galileoCooldown > 0)
galileoCooldown--;
if (dragonRageCooldown > 0)
@@ -1557,8 +1644,8 @@ namespace CalamityMod.CalPlayer
// Absorber bonus
if (absorber)
{
Player.moveSpeed += 0.1f;
Player.jumpSpeedBoost += 0.5f;
Player.moveSpeed += 0.12f;
Player.jumpSpeedBoost += 0.6f;
Player.thorns += 3.5f;
}
@@ -2370,6 +2457,11 @@ namespace CalamityMod.CalPlayer
if (baroclaw)
Player.GetDamage<GenericDamageClass>() += 0.1f;
if (aeroStone)
{
Player.moveSpeed += (Player.equippedWings != null && Player.wingTime == 0f ? 0.25f : 0f);
}
if (gShell)
{
if (giantShellPostHit == 1)
@@ -2413,7 +2505,6 @@ namespace CalamityMod.CalPlayer
if (eGauntlet)
{
Player.kbGlove = true;
Player.magmaStone = true;
Player.GetDamage<MeleeDamageClass>() += 0.15f;
Player.GetCritChance<MeleeDamageClass>() += 5;
}
@@ -2572,7 +2663,6 @@ namespace CalamityMod.CalPlayer
(ZoneAstral ? 0.05 : 0D) +
(harpyRing ? 0.2 : 0D) +
(reaverSpeed ? 0.1 : 0D) +
(aeroStone ? 0.1 : 0D) +
(angelTreads ? 0.1 : 0D) +
(blueCandle ? 0.1 : 0D) +
(soaring ? 0.1 : 0D) +
@@ -2580,9 +2670,6 @@ namespace CalamityMod.CalPlayer
(plagueReaper ? 0.05 : 0D) +
(Player.empressBrooch ? 0.25 : 0D);
if (harpyRing)
Player.moveSpeed += 0.1f;
if (blueCandle)
Player.moveSpeed += 0.1f;
@@ -2778,7 +2865,7 @@ namespace CalamityMod.CalPlayer
if (vexation)
{
if (Player.statLife < (int)(Player.statLifeMax2 * 0.5))
if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5))
Player.GetDamage<GenericDamageClass>() += 0.2f;
}
@@ -3956,6 +4043,22 @@ namespace CalamityMod.CalPlayer
}
#endregion
#region Text Chat Messages
private void HandleTextChatMessages()
{
if (Player.whoAmI != Main.myPlayer || Main.netMode == NetmodeID.Server)
return;
if (musicModDisplayDelay >= 0)
{
if (musicModDisplayDelay == 0)
CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Misc.MusicModReminder");
--musicModDisplayDelay;
}
}
#endregion
#region Mouse Item Checks
public void CheckIfMouseItemIsSchematic()
{
+9 -9
View File
@@ -817,7 +817,7 @@ namespace CalamityMod.CalPlayer
}
}
if (modProj.stealthStrike && rogueCrownCooldown <= 0 && modProj.stealthStrikeHitCount < 5)
if (modProj.stealthStrike && rogueCrownCooldown <= 0 && modProj.stealthStrikeHitCount < 3)
{
bool spawnedFeathers = false;
if (nanotech)
@@ -826,7 +826,7 @@ namespace CalamityMod.CalPlayer
{
Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50));
Vector2 velocity = (position - source) / 40f;
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(125);
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(120);
Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType<NanoFlare>(), damage, 3f, proj.owner);
}
}
@@ -851,7 +851,7 @@ namespace CalamityMod.CalPlayer
float speedX = (position.X - source.X) / 30f;
float speedY = (position.Y - source.Y) * 8;
Vector2 velocity = new Vector2(speedX, speedY);
int featherDamage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(15);
int featherDamage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(25);
int feather = Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType<StickyFeather>(), featherDamage, 3f, proj.owner);
if (feather.WithinBounds(Main.maxProjectiles))
{
@@ -864,7 +864,7 @@ namespace CalamityMod.CalPlayer
rogueCrownCooldown = spawnedFeathers ? 15 : 60;
}
if (forbiddenCirclet && modProj.stealthStrike && forbiddenCooldown <= 0 && modProj.stealthStrikeHitCount < 5)
if (forbiddenCirclet && modProj.stealthStrike && forbiddenCooldown <= 0 && modProj.stealthStrikeHitCount < 3)
{
for (int index2 = 0; index2 < 6; index2++)
{
@@ -880,7 +880,7 @@ namespace CalamityMod.CalPlayer
}
}
if (titanHeartSet && modProj.stealthStrike && titanCooldown <= 0 && modProj.stealthStrikeHitCount < 5)
if (titanHeartSet && modProj.stealthStrike && titanCooldown <= 0 && modProj.stealthStrikeHitCount < 3)
{
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(50);
Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<SabatonBoom>(), damage, proj.knockBack, proj.owner, 1f, 0f);
@@ -896,7 +896,7 @@ namespace CalamityMod.CalPlayer
titanCooldown = 15;
}
if (corrosiveSpine && modProj.stealthStrikeHitCount < 5)
if (corrosiveSpine && modProj.stealthStrikeHitCount < 3)
{
for (int i = 0; i < 3; i++)
{
@@ -928,7 +928,7 @@ namespace CalamityMod.CalPlayer
}
}
if (shadow && shadowPotCooldown <= 0 && modProj.stealthStrikeHitCount < 5)
if (shadow && shadowPotCooldown <= 0 && modProj.stealthStrikeHitCount < 3)
{
int randrot = Main.rand.Next(-30, 391);
Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(randrot));
@@ -951,13 +951,13 @@ namespace CalamityMod.CalPlayer
if (npcCheck)
{
// Umbraphile cannot trigger off of itself. It is guaranteed on stealth strikes and 25% chance otherwise.
if (umbraphileSet && ((modProj.stealthStrike && modProj.stealthStrikeHitCount < 5) || Main.rand.NextBool(4)))
if (umbraphileSet && ((modProj.stealthStrike && modProj.stealthStrikeHitCount < 3) || Main.rand.NextBool(4)))
{
// Umbraphile Rogue Blasts: 25%, softcap starts at 200 base damage
int umbraBlastDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.25, 50);
Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType<UmbraphileBoom>(), umbraBlastDamage, 0f, Player.whoAmI);
}
if (electricianGlove && modProj.stealthStrike && modProj.stealthStrikeHitCount < 5)
if (electricianGlove && modProj.stealthStrike && modProj.stealthStrikeHitCount < 3)
{
for (int s = 0; s < 3; s++)
{
+48
View File
@@ -0,0 +1,48 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.Enums;
using CalamityMod.Items.Armor.GodSlayer;
using CalamityMod.Items.Weapons.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.Graphics.Shaders;
using Terraria.ID;
using CalamityMod.Projectiles.Ranged;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.Dashes
{
public class SpeedBlasterDash : PlayerDashEffect
{
public static new string ID => "Speed Blaster";
public override DashCollisionType CollisionType => DashCollisionType.NoCollision;
public override bool IsOmnidirectional => true;
public bool dustOnce = true;
public override float CalculateDashSpeed(Player player) => 30f;
public override void OnDashEffects(Player player)
{
SoundEngine.PlaySound(SpeedBlaster.Dash, player.Center);
}
public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor)
{
// Fall way, way, faster than usual.
player.maxFallSpeed = 50f;
// Dash at a much, much faster speed than the default value.
dashSpeed = 20f;
runSpeedDecelerationFactor = 0.8f;
// Cooldown for dash.
player.Calamity().SpeedBlasterDashStarted = false;
player.Calamity().sBlasterDashActivated = false;
}
}
}
+16 -25
View File
@@ -1,24 +1,11 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Reflection;
using System.ComponentModel;
using System.Runtime.Serialization;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.DifficultyItems;
using CalamityMod.Items.DraedonMisc;
using CalamityMod.Items.Dyes.HairDye;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Weapons.DraedonsArsenal;
using CalamityMod.UI;
using Terraria;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ModLoader.Config;
using CalamityMod.Items.PermanentBoosters;
using CalamityMod.UI.Rippers;
using CalamityMod.UI.DraedonsArsenal;
using CalamityMod.UI.Rippers;
using CalamityMod.UI.SulphurousWaterMeter;
using CalamityMod.Items.Tools.ClimateChange;
using Terraria;
using Terraria.ModLoader.Config;
namespace CalamityMod
{
@@ -64,19 +51,23 @@ namespace CalamityMod
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool StealthInvisibility { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool ShopNewAlert { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool WikiStatusMessage { get; set; }
#endregion
#region UI Changes
[Header("UI")]
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool MusicModReminderMessage { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool WikiStatusMessage { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool ShopNewAlert { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool BossHealthBarExtraInfo { get; set; }
+1
View File
@@ -1996,6 +1996,7 @@ namespace CalamityMod
ProjectileType<PlantationStaffSporeCloud>(),
ProjectileType<PrismaticBeam>(),
ProjectileType<RancorLaserbeam>(),
ProjectileType<ReaperProjectile>(),
ProjectileType<SacrificeProjectile>(),
ProjectileType<SnapClamProj>(),
ProjectileType<SnapClamStealth>(),
+4 -4
View File
@@ -21,16 +21,16 @@ namespace CalamityMod.Items.Accessories
{
Item.width = 40;
Item.height = 50;
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
Item.rare = ItemRarityID.Green;
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
Item.rare = ItemRarityID.Orange;
Item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.Calamity().aeroStone = true;
player.moveSpeed += 0.1f;
player.jumpSpeedBoost += 0.5f;
player.wingTimeMax += 45;
}
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
+1 -7
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.defense = 36;
Item.defense = 18;
Item.width = 36;
Item.height = 42;
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
@@ -24,13 +24,7 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.flameLickedShell = true;
player.buffImmune[ModContent.BuffType<ArmorCrunch>()] = true;
player.lavaImmune = true;
float moveSpeedDecrease = modPlayer.shellBoost ? 0.15f : 0.35f;
player.moveSpeed -= moveSpeedDecrease;
player.thorns += 0.25f;
if (modPlayer.shellBoost)
player.statDefense -= 18;
}
}
}
+2 -2
View File
@@ -22,8 +22,8 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.GrandGelatin = true;
player.moveSpeed += 0.1f;
player.jumpSpeedBoost += 0.5f;
player.moveSpeed += 0.12f;
player.jumpSpeedBoost += 0.6f;
}
public override void AddRecipes()
+1
View File
@@ -22,6 +22,7 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.harpyRing = true;
player.moveSpeed += 0.1f;
}
public override void AddRecipes()
+4 -58
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Typeless;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -11,7 +12,6 @@ namespace CalamityMod.Items.Accessories
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.defense = 20;
Item.width = 20;
Item.height = 22;
Item.value = CalamityGlobalItem.Rarity7BuyPrice;
@@ -21,62 +21,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
var source = player.GetSource_Accessory(Item);
player.ignoreWater = true;
if (!player.lavaWet && !player.honeyWet)
{
if (!Collision.DrownCollision(player.position, player.width, player.height, player.gravDir))
{
player.endurance += 0.05f;
player.GetDamage<GenericDamageClass>() += 0.05f;
}
else
{
player.GetDamage<GenericDamageClass>() += 0.1f;
player.statDefense += 10;
player.moveSpeed += 0.3f;
}
}
if ((double)player.velocity.X > 0 || (double)player.velocity.Y > 0 || (double)player.velocity.X < -0.1 || (double)player.velocity.Y < -0.1)
{
if (player.whoAmI == Main.myPlayer)
{
int seawaterDamage = (int)player.GetBestClassDamage().ApplyTo(50);
Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, 0f, ModContent.ProjectileType<PoisonousSeawater>(), seawaterDamage, 5f, player.whoAmI, 0f, 0f);
}
}
int seaCounter = 0;
Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0f, 0.5f, 1.25f);
int num = BuffID.Venom;
float num2 = 200f;
bool flag = seaCounter % 60 == 0;
int auraDamage = (int)player.GetBestClassDamage().ApplyTo(15);
int random = Main.rand.Next(5);
if (player.whoAmI == Main.myPlayer)
{
if (random == 0 && player.immune && Collision.DrownCollision(player.position, player.width, player.height, player.gravDir))
{
for (int l = 0; l < Main.maxNPCs; l++)
{
NPC nPC = Main.npc[l];
if (nPC.active && !nPC.friendly && nPC.damage > 0 && !nPC.dontTakeDamage && !nPC.buffImmune[num] && Vector2.Distance(player.Center, nPC.Center) <= num2)
{
if (nPC.FindBuffIndex(num) == -1)
{
nPC.AddBuff(num, 300, false);
}
if (flag)
{
if (player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectileDirect(source, nPC.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), auraDamage, 0f, player.whoAmI, l);
}
}
}
}
}
}
seaCounter++;
CalamityPlayer modPlayer = player.Calamity();
modPlayer.lAmbergris = true;
}
}
}
+2 -2
View File
@@ -33,9 +33,9 @@ namespace CalamityMod.Items.Accessories
public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(9); // was 6
public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(6);
// While active, The Sponge gives 30 defense and 30% DR
// While active, The Sponge gives 30 defense and 10% DR
public static int ShieldActiveDefense = 30;
public static float ShieldActiveDamageReduction = 0.3f;
public static float ShieldActiveDamageReduction = 0.1f;
public override void SetStaticDefaults()
+2 -2
View File
@@ -18,8 +18,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.moveSpeed += 0.1f;
player.jumpSpeedBoost += 0.5f;
player.moveSpeed += 0.12f;
player.jumpSpeedBoost += 0.6f;
}
}
}
+23 -23
View File
@@ -135,7 +135,7 @@ namespace CalamityMod.Items
{ ItemID.Keybrand, Do(UseTurn, ScaleRatio(1.5f)) }, // Uses ratios due to remix seed
{ ItemID.KOCannon, Do(DamageRatio(2.65f)) }, // Uses ratios due to remix seed
{ ItemID.LaserRifle, Do(DamageExact(46), UseExact(10), ManaExact(4)) },
{ ItemID.LastPrism, Do(DamageRatio(0.75f)) },
{ ItemID.LastPrism, Do(DamageExact(57), ManaExact(10)) },
{ ItemID.LeadShortsword, Do(AutoReuse, TrueMelee, DamageExact(11)) },
{ ItemID.LightDisc, Do(DamageExact(128), ShootSpeedExact(18)) },
{ ItemID.LunarFlareBook, Do(DamageRatio(1.2f)) },
@@ -189,6 +189,7 @@ namespace CalamityMod.Items
{ ItemID.RedRyder, Do(PointBlank, DamageExact(24)) },
{ ItemID.RocketIII, Do(DamageRatio(0.75f)) },
{ ItemID.RocketIV, Do(DamageRatio(0.75f)) },
{ ItemID.Sandgun, Do(PointBlank, DamageExact(22), UseExact(20)) },
{ ItemID.SapphireStaff, Do(DamageExact(25)) },
{ ItemID.Seedler, Do(UseMeleeSpeed, DamageRatio(1.5f)) },
{ ItemID.ShadowbeamStaff, Do(DamageExact(100)) },
@@ -284,31 +285,31 @@ namespace CalamityMod.Items
#region CATEGORY 3: Tool Balancing
{ ItemID.AcornAxe, Do(AxePower(125)) }, // Axe of Regrowth
{ ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0)) },
{ ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1)) },
{ ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0), DamageExact(75)) },
{ ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1), DamageExact(32)) },
{ ItemID.AdamantitePickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) },
{ ItemID.AdamantiteWaraxe, Do(AxePower(160), UseTimeExact(10), TileBoostExact(+1)) },
{ ItemID.BloodLustCluster, Do(AxePower(100), UseTimeExact(13), TileBoostExact(+0)) },
{ ItemID.BonePickaxe, Do(PickPower(55), UseTimeExact(6)) },
{ ItemID.BorealWoodHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) },
{ ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, AxePower(150), UseTimeExact(3), TileBoostExact(+0)) },
{ ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, AxePower(150), UseTimeExact(3), TileBoostExact(+0), DamageExact(194)) },
{ ItemID.CactusPickaxe, Do(PickPower(34), UseTimeExact(9)) },
{ ItemID.CnadyCanePickaxe, Do(PickPower(55), UseTimeExact(9), TileBoostExact(+1)) }, // Candy Cane Pickaxe
{ ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), TileBoostExact(+0)) },
{ ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, PickPower(200), UseTimeExact(4), TileBoostExact(+2)) },
{ ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), TileBoostExact(+0), DamageExact(112)) },
{ ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, PickPower(200), UseTimeExact(4), TileBoostExact(+2), DamageExact(43)) },
{ ItemID.ChlorophyteGreataxe, Do(AxePower(165), UseTimeExact(7), TileBoostExact(+2)) },
{ ItemID.ChlorophyteJackhammer, Do(TrueMeleeNoSpeed, HammerPower(90), UseTimeExact(5), TileBoostExact(+0)) },
{ ItemID.ChlorophytePickaxe, Do(PickPower(200), UseTimeExact(7), TileBoostExact(+2)) },
{ ItemID.ChlorophyteWarhammer, Do(HammerPower(90), UseTimeExact(8), TileBoostExact(+2)) },
{ ItemID.CobaltChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1)) },
{ ItemID.CobaltDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5)) },
{ ItemID.CobaltChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1), DamageExact(51)) },
{ ItemID.CobaltDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5), DamageExact(21)) },
{ ItemID.CobaltPickaxe, Do(PickPower(130), UseTimeExact(9)) },
{ ItemID.CobaltWaraxe, Do(AxePower(125), UseTimeExact(12), TileBoostExact(+0)) },
{ ItemID.CopperAxe, Do(AxePower(50), UseTimeExact(16), TileBoostExact(+0)) },
{ ItemID.CopperHammer, Do(HammerPower(35), UseTimeExact(12), TileBoostExact(+0)) },
{ ItemID.CopperPickaxe, Do(PickPower(35), UseTimeExact(10), TileBoostExact(+0)) },
{ ItemID.DeathbringerPickaxe, Do(PickPower(70), UseTimeExact(10)) },
{ ItemID.Drax, Do(TrueMeleeNoSpeed, PickPower(200), AxePower(110), UseTimeExact(4), TileBoostExact(+1)) },
{ ItemID.Drax, Do(TrueMeleeNoSpeed, PickPower(200), AxePower(110), UseTimeExact(4), TileBoostExact(+1), DamageExact(80)) },
{ ItemID.EbonwoodHammer, Do(HammerPower(25), UseTimeExact(9), TileBoostExact(+0)) },
{ ItemID.FleshGrinder, Do(HammerPower(70), UseTimeExact(13), TileBoostExact(+0)) },
{ ItemID.GoldAxe, Do(AxePower(80), UseTimeExact(14), TileBoostExact(+0)) },
@@ -318,7 +319,7 @@ namespace CalamityMod.Items
{ ItemID.IronAxe, Do(AxePower(60), UseTimeExact(15), TileBoostExact(+0)) },
{ ItemID.IronHammer, Do(HammerPower(45), UseTimeExact(11), TileBoostExact(+0)) },
{ ItemID.IronPickaxe, Do(PickPower(40), UseTimeExact(8)) },
{ ItemID.LaserDrill, Do(PickPower(220), AxePower(120), UseTimeExact(4)) },
{ ItemID.LaserDrill, Do(PickPower(220), AxePower(120), UseTimeExact(4), DamageExact(54)) },
{ ItemID.LeadAxe, Do(AxePower(60), UseTimeExact(15), TileBoostExact(+0)) },
{ ItemID.LeadHammer, Do(HammerPower(45), UseTimeExact(11), TileBoostExact(+0)) },
{ ItemID.LeadPickaxe, Do(PickPower(40), UseTimeExact(8)) },
@@ -330,20 +331,20 @@ namespace CalamityMod.Items
{ ItemID.MeteorHamaxe, Do(HammerPower(70), AxePower(100), UseTimeExact(16), TileBoostExact(+0)) },
{ ItemID.MoltenHamaxe, Do(HammerPower(75), AxePower(125), UseTimeExact(14), TileBoostExact(+0)) },
{ ItemID.MoltenPickaxe, Do(PickPower(100), UseTimeExact(10)) },
{ ItemID.MythrilChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1)) },
{ ItemID.MythrilDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4)) },
{ ItemID.MythrilChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1), DamageExact(63)) },
{ ItemID.MythrilDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4), DamageExact(26)) },
{ ItemID.MythrilPickaxe, Do(PickPower(160), UseTimeExact(8)) },
{ ItemID.MythrilWaraxe, Do(AxePower(140), UseTimeExact(11), TileBoostExact(+0)) },
{ ItemID.NebulaDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) },
{ ItemID.NebulaDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) },
{ ItemID.NebulaPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) },
{ ItemID.NettleBurst, Do(ManaExact(10), DamageExact(43)) },
{ ItemID.NightmarePickaxe, Do(PickPower(66), UseTimeExact(9)) },
{ ItemID.OrichalcumChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1)) },
{ ItemID.OrichalcumDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4)) },
{ ItemID.OrichalcumChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1), DamageExact(63)) },
{ ItemID.OrichalcumDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4), DamageExact(26)) },
{ ItemID.OrichalcumPickaxe, Do(PickPower(160), UseTimeExact(8)) },
{ ItemID.OrichalcumWaraxe, Do(AxePower(140), UseTimeExact(11), TileBoostExact(+0)) },
{ ItemID.PalladiumChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1)) },
{ ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5)) },
{ ItemID.PalladiumChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1), DamageExact(51)) },
{ ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5), DamageExact(21)) },
{ ItemID.PalladiumPickaxe, Do(PickPower(130), UseTimeExact(9)) },
{ ItemID.PalladiumWaraxe, Do(AxePower(125), UseTimeExact(12), TileBoostExact(+0)) },
{ ItemID.PalmWoodHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) },
@@ -363,25 +364,25 @@ namespace CalamityMod.Items
{ ItemID.SilverAxe, Do(AxePower(70), UseTimeExact(14), TileBoostExact(+0)) },
{ ItemID.SilverHammer, Do(HammerPower(55), UseTimeExact(10), TileBoostExact(+0)) },
{ ItemID.SilverPickaxe, Do(PickPower(50), UseTimeExact(11)) },
{ ItemID.SolarFlareDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) },
{ ItemID.SolarFlareDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) },
{ ItemID.SolarFlarePickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) },
{ ItemID.SpectreHamaxe, Do(HammerPower(90), AxePower(170), TileBoostExact(+4)) },
{ ItemID.SpectrePickaxe, Do(PickPower(200), TileBoostExact(+4)) },
{ ItemID.StardustDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) },
{ ItemID.StardustDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) },
{ ItemID.StardustPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) },
{ ItemID.TheAxe, Do(HammerPower(100), AxePower(175), UseTimeExact(7), TileBoostExact(+1)) },
{ ItemID.TheBreaker, Do(HammerPower(70), UseTimeExact(13), TileBoostExact(+0)) },
{ ItemID.TinAxe, Do(AxePower(50), UseTimeExact(16), TileBoostExact(+0)) },
{ ItemID.TinHammer, Do(HammerPower(35), UseTimeExact(12), TileBoostExact(+0)) },
{ ItemID.TinPickaxe, Do(PickPower(35), UseTimeExact(10), TileBoostExact(+0)) },
{ ItemID.TitaniumChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0)) },
{ ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1)) },
{ ItemID.TitaniumChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0), DamageExact(75)) },
{ ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1), DamageExact(32)) },
{ ItemID.TitaniumPickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) },
{ ItemID.TitaniumWaraxe, Do(AxePower(160), UseTimeExact(10), TileBoostExact(+1)) },
{ ItemID.TungstenAxe, Do(AxePower(70), UseTimeExact(14), TileBoostExact(+0)) },
{ ItemID.TungstenHammer, Do(HammerPower(55), UseTimeExact(10), TileBoostExact(+0)) },
{ ItemID.TungstenPickaxe, Do(PickPower(50), UseTimeExact(11)) },
{ ItemID.VortexDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4)) },
{ ItemID.VortexDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) },
{ ItemID.VortexPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) },
{ ItemID.WarAxeoftheNight, Do(AxePower(100), UseTimeExact(13), TileBoostExact(+0)) },
{ ItemID.WoodenHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) },
@@ -431,7 +432,6 @@ namespace CalamityMod.Items
{ ItemID.QuadBarrelShotgun, pointBlank },
{ ItemID.Revolver, Do(PointBlank, AutoReuse) },
{ ItemID.RichMahoganyBow, pointBlank },
{ ItemID.Sandgun, pointBlank },
{ ItemID.SDMG, pointBlank },
{ ItemID.ShadewoodBow, pointBlank },
{ ItemID.SilverBow, pointBlank },
-24
View File
@@ -1,24 +0,0 @@
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
namespace CalamityMod.Items.Materials
{
public class BeetleJuice : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Materials";
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 5;
}
public override void SetDefaults()
{
Item.width = 20;
Item.height = 20;
Item.maxStack = 9999;
Item.value = Item.sellPrice(silver: 1);
Item.rare = ItemRarityID.Blue;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 440 B

+2 -1
View File
@@ -19,5 +19,6 @@ namespace CalamityMod.Items.Materials
Item.maxStack = 9999;
Item.value = Item.sellPrice(silver: 16);
Item.rare = ItemRarityID.LightRed;
} }
}
}
}
+1 -1
View File
@@ -74,7 +74,7 @@ namespace CalamityMod.Items.TreasureBags
ModContent.ItemType<VeinBurster>(),
ModContent.ItemType<Eviscerator>(),
ModContent.ItemType<BloodBath>(),
ModContent.ItemType<BloodClotStaff>(),
ModContent.ItemType<FleshOfInfidelity>(),
new WeightedItemStack(ModContent.ItemType<ToothBall>(), 1f, 50, 75),
}));
+2 -2
View File
@@ -13,9 +13,9 @@ namespace CalamityMod.Items.Weapons.Magic
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetDefaults()
{
Item.damage = 147;
Item.damage = 131;
Item.DamageType = DamageClass.Magic;
Item.mana = 11;
Item.mana = 14;
Item.width = 28;
Item.height = 30;
Item.useTime = 2;
-50
View File
@@ -1,50 +0,0 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class CarnageRay : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetStaticDefaults()
{
Item.staff[Item.type] = true;
}
public override void SetDefaults()
{
Item.damage = 24;
Item.DamageType = DamageClass.Magic;
Item.mana = 10;
Item.width = 44;
Item.height = 46;
Item.useTime = 20;
Item.useAnimation = 20;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 3.25f;
Item.value = CalamityGlobalItem.Rarity4BuyPrice;
Item.rare = ItemRarityID.LightRed;
Item.UseSound = SoundID.Item72;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<BloodRay>();
Item.shootSpeed = 6f;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.CrimsonRod).
AddIngredient(ItemID.MagicMissile).
AddIngredient(ItemID.WandofSparking).
AddIngredient(ItemID.AmberStaff).
AddIngredient<PurifiedGel>(10).
AddTile(TileID.DemonAltar).
Register();
}
}
}
+2 -2
View File
@@ -13,9 +13,9 @@ namespace CalamityMod.Items.Weapons.Magic
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetDefaults()
{
Item.damage = 64;
Item.damage = 60;
Item.DamageType = DamageClass.Magic;
Item.mana = 17;
Item.mana = 20;
Item.width = 56;
Item.height = 26;
Item.useTime = 15;
+2 -2
View File
@@ -15,9 +15,9 @@ namespace CalamityMod.Items.Weapons.Magic
public override void SetDefaults()
{
Item.damage = 73;
Item.damage = 60;
Item.DamageType = DamageClass.Magic;
Item.mana = 6;
Item.mana = 8;
Item.width = 62;
Item.height = 34;
Item.useTime = Item.useAnimation = UseTime;
+2 -2
View File
@@ -13,9 +13,9 @@ namespace CalamityMod.Items.Weapons.Magic
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetDefaults()
{
Item.damage = 114;
Item.damage = 140;
Item.DamageType = DamageClass.Magic;
Item.mana = 13;
Item.mana = 22;
Item.width = 38;
Item.height = 40;
Item.useTime = 25;
-6
View File
@@ -52,12 +52,6 @@ namespace CalamityMod.Items.Weapons.Magic
AddIngredient<LivingShard>(12).
AddTile(TileID.MythrilAnvil).
Register();
CreateRecipe().
AddIngredient<CarnageRay>().
AddIngredient<ValkyrieRay>().
AddIngredient<LivingShard>(12).
AddTile(TileID.MythrilAnvil).
Register();
}
}
}
+4 -4
View File
@@ -11,13 +11,13 @@ namespace CalamityMod.Items.Weapons.Magic
public new string LocalizationCategory => "Items.Weapons.Magic";
public override void SetDefaults()
{
Item.damage = 40;
Item.damage = 36;
Item.DamageType = DamageClass.Magic;
Item.mana = 7;
Item.mana = 14;
Item.width = 60;
Item.height = 52;
Item.useTime = 8;
Item.useAnimation = 8;
Item.useTime = 12;
Item.useAnimation = 12;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.value = CalamityGlobalItem.Rarity10BuyPrice;
+1 -1
View File
@@ -56,7 +56,7 @@ namespace CalamityMod.Items.Weapons.Melee
Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType<BrimstoneBoom>(), Item.damage, Item.knockBack, Main.myPlayer);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300);
if (player.statLife < (player.statLifeMax2 * 0.5f) && Main.rand.NextBool(5))
if (player.statLife <= (player.statLifeMax2 * 0.5f) && Main.rand.NextBool(5))
{
if (!CalamityPlayer.areThereAnyDamnBosses && CalamityGlobalNPC.ShouldAffectNPC(target))
{
+8 -8
View File
@@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee
#region stats
public static int BaseDamage = 800;
public static int PhoenixAttunement_BaseDamage = 800;
public static int PhoenixAttunement_BaseDamage = 1050;
public static int PhoenixAttunement_LocalIFrames = 30; //Remember its got one extra update
public static float PhoenixAttunement_BoltDamageReduction = 0.5f;
public static float PhoenixAttunement_BoltThrowDamageMultiplier = 1f;
@@ -39,8 +39,8 @@ namespace CalamityMod.Items.Weapons.Melee
public static float PhoenixAttunement_FullChargeDamageBoost = 2.1f;
public static float PhoenixAttunement_ThrowDamageBoost = 3.2f;
public static int PolarisAttunement_BaseDamage = 1200;
public static int PolarisAttunement_FullChargeDamage = 1900;
public static int PolarisAttunement_BaseDamage = 1800;
public static int PolarisAttunement_FullChargeDamage = 3600;
public static int PolarisAttunement_ShredIFrames = 10;
public static int PolarisAttunement_LocalIFrames = 30; //Be warned its got one extra update so all the iframes should be divided in 2
public static int PolarisAttunement_LocalIFramesCharged = 16;
@@ -48,17 +48,17 @@ namespace CalamityMod.Items.Weapons.Melee
public static int PolarisAttunement_SlashBoltsDamage = 1300;
public static int PolarisAttunement_SlashIFrames = 20;
public static float PolarisAttunement_ShotDamageBoost = 0.8f; //The shots fired if the dash connects
public static float PolarisAttunement_ShredChargeupGain = 1.1f; //How much charge is gainted per second.
public static float PolarisAttunement_ShredChargeupGain = 1f; //How much charge is gainted per second.
public static int AndromedaAttunement_BaseDamage = 2200;
public static int AndromedaAttunement_BaseDamage = 2800;
public static int AndromedaAttunement_DashHitIFrames = 20;
public static float AndromedaAttunement_FullChargeBoost = 3.5f; //The EXTRA damage boost. So putting 1 here will make it deal double damage. Putting 0.5 here will make it deal 1.5x the damage.
public static float AndromedaAttunement_FullChargeBoost = 6f; //The EXTRA damage boost. So putting 1 here will make it deal double damage. Putting 0.5 here will make it deal 1.5x the damage.
public static float AndromedaAttunement_MonolithDamageBoost = 1.2f;
public static float AndromedaAttunement_BoltsDamageReduction = 0.2f; //The shots fired as it charges
public static int AriesAttunement_BaseDamage = 950;
public static int AriesAttunement_BaseDamage = 1325;
public static int AriesAttunement_LocalIFrames = 10;
public static int AriesAttunement_Reach = 600;
public static int AriesAttunement_Reach = 650;
public static float AriesAttunement_ChainDamageReduction = 0.2f;
public static float AriesAttunement_OnHitBoltDamageReduction = 0.5f;
+75
View File
@@ -0,0 +1,75 @@
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Ranged
{
[LegacyName("MagnaStriker")]
public class ArcNovaDiffuser : ModItem, ILocalizedModType
{
public static readonly SoundStyle ChargeLV1 = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV1") { Volume = 0.6f };
public static readonly SoundStyle ChargeLV2 = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLV2") { Volume = 0.6f };
public static readonly SoundStyle ChargeStart = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeStart") { Volume = 0.6f };
public static readonly SoundStyle ChargeLoop = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeLoop") { Volume = 0.6f };
internal static readonly int ChargeLoopSoundFrames = 151;
public static readonly SoundStyle SmallShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserSmallShot") { PitchVariance = 0.3f, Volume = 0.5f };
public static readonly SoundStyle BigShot = new("CalamityMod/Sounds/Item/ArcNovaDiffuserBigShot") { PitchVariance = 0.3f, Volume = 0.8f };
public static int AftershotCooldownFrames = 9;
public static int Charge1Frames = 156;
public static int Charge2Frames = 308;
public new string LocalizationCategory => "Items.Weapons.Ranged";
public override void SetDefaults()
{
Item.damage = 138;
Item.DamageType = DamageClass.Ranged;
Item.width = 72;
Item.height = 38;
Item.useTime = Item.useAnimation = AftershotCooldownFrames;
Item.noMelee = true;
Item.channel = true;
Item.useStyle = ItemUseStyleID.Shoot;
Item.knockBack = 4f;
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
Item.rare = ItemRarityID.Yellow;
Item.UseSound = null;
Item.autoReuse = false;
Item.shoot = ModContent.ProjectileType<NovaShot>();
Item.shootSpeed = 12f;
Item.Calamity().canFirePointBlankShots = true;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-5, 0);
}
public override void HoldItem(Player player)
{
Item.noUseGraphic = true;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType<ArcNovaDiffuserHoldout>()] <= 0;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Vector2 shootVelocity = velocity;
Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction);
Projectile.NewProjectile(source, position, shootDirection, ModContent.ProjectileType<ArcNovaDiffuserHoldout>(), damage, knockback, player.whoAmI);
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<OpalStriker>().
AddIngredient<MagnaCannon>().
AddIngredient<LifeAlloy>(3).
AddIngredient(ItemID.MartianConduitPlating, 15).
AddTile(TileID.MythrilAnvil).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

+11 -8
View File
@@ -10,24 +10,27 @@ namespace CalamityMod.Items.Weapons.Ranged
{
public class MagnaCannon : ModItem, ILocalizedModType
{
public static readonly SoundStyle ChargeFull = new("CalamityMod/Sounds/Item/MagnaCannonChargeFull") { Volume = 0.2f };
public static readonly SoundStyle ChargeLoop = new("CalamityMod/Sounds/Item/MagnaCannonChargeLoop") { Volume = 0.2f };
public static readonly SoundStyle ChargeStart = new("CalamityMod/Sounds/Item/MagnaCannonChargeStart") { Volume = 0.2f };
public static readonly SoundStyle Fire = new("CalamityMod/Sounds/Item/MagnaCannonShot") { PitchVariance = 0.3f, Volume = 0.3f };
public static readonly SoundStyle ChargeFull = new("CalamityMod/Sounds/Item/MagnaCannonChargeFull") { Volume = 0.5f };
public static readonly SoundStyle ChargeLoop = new("CalamityMod/Sounds/Item/MagnaCannonChargeLoop") { Volume = 0.5f };
internal static readonly int ChargeLoopSoundFrames = 153;
public static readonly SoundStyle ChargeStart = new("CalamityMod/Sounds/Item/MagnaCannonChargeStart") { Volume = 0.5f };
public static readonly SoundStyle Fire = new("CalamityMod/Sounds/Item/MagnaCannonShot") { PitchVariance = 0.3f, Volume = 0.4f };
public static int AftershotCooldownFrames = 30;
public static int FullChargeFrames = 138; //126 frames is durration of charge sound
public static int MaxLoadedShots = 20;
public new string LocalizationCategory => "Items.Weapons.Ranged";
public override void SetDefaults()
{
Item.damage = 29;
Item.damage = 30;
Item.DamageType = DamageClass.Ranged;
Item.width = 56;
Item.height = 34;
Item.useTime = Item.useAnimation = 30;
Item.useTime = Item.useAnimation = AftershotCooldownFrames;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.channel = true;
Item.knockBack = 1.2f;
Item.knockBack = 2.5f;
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
Item.rare = ItemRarityID.Green;
Item.UseSound = null;
-63
View File
@@ -1,63 +0,0 @@
using Terraria.DataStructures;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Projectiles.Ranged;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Ranged
{
public class MagnaStriker : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
public override void SetDefaults()
{
Item.damage = 50;
Item.DamageType = DamageClass.Ranged;
Item.width = 72;
Item.height = 38;
Item.useTime = 5;
Item.useAnimation = 20;
Item.reuseDelay = 6;
Item.useLimitPerAnimation = 4;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 2.25f;
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
Item.rare = ItemRarityID.Yellow;
Item.UseSound = null;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<OpalStrike>();
Item.shootSpeed = 15f;
Item.useAmmo = AmmoID.Bullet;
Item.Calamity().canFirePointBlankShots = true;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-5, 0);
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (Main.rand.NextBool())
{
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<MagnaStrike>(), damage, knockback, player.whoAmI);
return false;
}
return true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<OpalStriker>().
AddIngredient<MagnaCannon>().
AddRecipeGroup("AnyAdamantiteBar", 6).
AddIngredient(ItemID.Ectoplasm, 5).
AddTile(TileID.MythrilAnvil).
Register();
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

+12 -8
View File
@@ -12,21 +12,25 @@ namespace CalamityMod.Items.Weapons.Ranged
{
public new string LocalizationCategory => "Items.Weapons.Ranged";
public static readonly SoundStyle Charge = new("CalamityMod/Sounds/Item/OpalCharge") { Volume = 0.2f};
public static readonly SoundStyle ChargeLoop = new("CalamityMod/Sounds/Item/OpalChargeLoop") { Volume = 0.2f};
public static readonly SoundStyle Fire = new("CalamityMod/Sounds/Item/OpalFire") { PitchVariance = 0.3f, Volume = 0.3f };
public static readonly SoundStyle ChargedFire = new("CalamityMod/Sounds/Item/OpalChargedFire") { PitchVariance = 0.3f, Volume = 0.3f };
public static readonly SoundStyle Charge = new("CalamityMod/Sounds/Item/OpalCharge") { Volume = 0.5f};
public static readonly SoundStyle ChargeLoop = new("CalamityMod/Sounds/Item/OpalChargeLoop") { Volume = 0.5f};
internal static readonly int ChargeLoopSoundFrames = 120;
public static readonly SoundStyle Fire = new("CalamityMod/Sounds/Item/OpalFire") { PitchVariance = 0.4f, Volume = 0.3f };
public static readonly SoundStyle ChargedFire = new("CalamityMod/Sounds/Item/OpalChargedFire") { PitchVariance = 0.3f, Volume = 0.6f };
public static int AftershotCooldownFrames = 17;
public static int FullChargeFrames = 88;
public override void SetDefaults()
{
Item.damage = 34;
Item.damage = 30;
Item.DamageType = DamageClass.Ranged;
Item.width = 46;
Item.height = 30;
Item.useTime = Item.useAnimation = 18;
Item.useTime = Item.useAnimation = AftershotCooldownFrames;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 2f;
Item.knockBack = 4f;
Item.value = CalamityGlobalItem.Rarity2BuyPrice;
Item.rare = ItemRarityID.Green;
Item.UseSound = null;
@@ -56,7 +60,7 @@ namespace CalamityMod.Items.Weapons.Ranged
CreateRecipe().
AddIngredient(ItemID.Marble, 25).
AddIngredient(ItemID.MeteoriteBar, 10).
AddIngredient(ItemID.Diamond, 2).
AddIngredient(ItemID.Diamond, 3).
AddIngredient(ItemID.Amber, 3).
AddTile(TileID.Anvils).
Register();
+2 -2
View File
@@ -65,8 +65,8 @@ namespace CalamityMod.Items.Weapons.Ranged
// Fire drones to the left and right.
for (int i = 0; i < 3; i++)
{
Projectile.NewProjectile(source, barrelPosition, velocity.RotatedBy(-Spread * (i + 1)), ModContent.ProjectileType<PlagueTaintedDrone>(), player.Calamity().alchFlask ? (int)(damage * 0.65f) : damage, knockback, player.whoAmI);
Projectile.NewProjectile(source, barrelPosition, velocity.RotatedBy(Spread * (i + 1)), ModContent.ProjectileType<PlagueTaintedDrone>(), player.Calamity().alchFlask ? (int)(damage * 0.65f) : damage, knockback, player.whoAmI);
Projectile.NewProjectile(source, barrelPosition, velocity.RotatedBy(-Spread * (i + 1)), ModContent.ProjectileType<PlagueTaintedDrone>(), damage, knockback, player.whoAmI, 0f, player.Calamity().alchFlask || player.Calamity().spiritOrigin ? 1f : 0f);
Projectile.NewProjectile(source, barrelPosition, velocity.RotatedBy(Spread * (i + 1)), ModContent.ProjectileType<PlagueTaintedDrone>(), damage, knockback, player.whoAmI, 0f, player.Calamity().alchFlask || player.Calamity().spiritOrigin ? 1f : 0f);
}
}
else
+68 -31
View File
@@ -1,67 +1,104 @@
using Terraria.DataStructures;
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Projectiles.Ranged;
using Terraria.Audio;
using CalamityMod.Projectiles.Magic;
using CalamityMod.CalPlayer.Dashes;
using CalamityMod.Particles;
namespace CalamityMod.Items.Weapons.Ranged
{
[LegacyName("PaintballBlaster")]
public class SpeedBlaster : ModItem, ILocalizedModType
{
public static readonly SoundStyle Shot = new("CalamityMod/Sounds/Item/Splatshot") { PitchVariance = 0.3f, Volume = 3.5f };
public static readonly SoundStyle Dash = new("CalamityMod/Sounds/Item/SplatshotDash") { PitchVariance = 0.3f, Volume = 5f };
public static readonly SoundStyle ShotBig = new("CalamityMod/Sounds/Item/SplatshotBig") { PitchVariance = 0.3f, Volume = 2f };
public static readonly SoundStyle Empty = new("CalamityMod/Sounds/Item/DudFire") { PitchVariance = 0.3f, Volume = 0.7f };
public new string LocalizationCategory => "Items.Weapons.Ranged";
public int ColorValue = 0;
public int UseTime = 10;
public float ShotBigMode = 0;
public override void SetDefaults()
{
Item.damage = 34;
Item.damage = 55;
Item.DamageType = DamageClass.Ranged;
Item.width = 54;
Item.height = 26;
Item.useTime = 4;
Item.useAnimation = 24;
Item.reuseDelay = 9;
Item.useLimitPerAnimation = 6;
Item.useTime = Item.useAnimation = UseTime;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 2.25f;
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
Item.rare = ItemRarityID.Pink;
Item.UseSound = null;
Item.UseSound = Shot;
Item.autoReuse = true;
Item.shootSpeed = 20f;
Item.shoot = ProjectileID.PainterPaintball;
Item.shoot = ModContent.ProjectileType<SpeedBlasterShot>();
Item.Calamity().canFirePointBlankShots = true;
}
public override bool AltFunctionUse(Player player) => true;
public override bool CanUseItem(Player player)
{
if (player.Calamity().SpeedBlasterDashDelayCooldown > 0 && player.altFunctionUse == 2)
{
SoundEngine.PlaySound(Empty, player.Center);
return false;
}
Item.UseSound = player.altFunctionUse == 2 && player.Calamity().SpeedBlasterDashDelayCooldown == 0 ? ShotBig : Shot;
return base.CanUseItem(player);
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-1, -6);
}
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback)
{
if (player.Calamity().SpeedBlasterDashDelayCooldown == 0)
{
Item.useTime = Item.useAnimation = 9;
ShotBigMode = 0;
}
if (player.altFunctionUse == 2 && player.Calamity().SpeedBlasterDashDelayCooldown == 0)
{
ShotBigMode = 3;
if (ColorValue >= 4)
ColorValue = 0;
else
ColorValue++;
Item.useTime = Item.useAnimation = 8;
player.Calamity().SpeedBlasterDashDelayCooldown = 300;
player.Calamity().sBlasterDashActivated = true;
}
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float num72 = Item.shootSpeed;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (player.gravDir == -1f)
// Reposition to the gun's tip + add some inaccuracy
Vector2 newPos = position + new Vector2(38f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation());
Vector2 newVel = velocity.RotatedByRandom(MathHelper.ToRadians(ShotBigMode == 3 ? 0f : ShotBigMode == 2 ? 3f : 17f));
Projectile.NewProjectile(source, newPos, newVel, ModContent.ProjectileType<SpeedBlasterShot>(), damage * (ShotBigMode == 3 ? 5 : 1), knockback, player.whoAmI, ColorValue, ShotBigMode);
if (player.Calamity().SpeedBlasterDashDelayCooldown > 0)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
ShotBigMode = 2;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
player.Calamity().ColorValue = ColorValue;
if (player.Calamity().SpeedBlasterDashDelayCooldown == 300 && player.velocity != Vector2.Zero)
{
num78 = (float)player.direction;
num79 = 0f;
Color ColorUsed = (ColorValue == 0 ? Color.Aqua : ColorValue == 1 ? Color.Blue : ColorValue == 2 ? Color.Fuchsia : ColorValue == 3 ? Color.Lime : ColorValue == 4 ? Color.Yellow : Color.White);
for (int i = 0; i <= 8; i++)
{
CritSpark spark = new CritSpark(player.Center, player.velocity.RotatedByRandom(MathHelper.ToRadians(13f)) * Main.rand.NextFloat(-2.1f, -4.5f), Color.White, ColorUsed, 2f, 45, 2f, 2.5f);
GeneralParticleHandler.SpawnParticle(spark);
}
}
else
{
num80 = num72 / num80;
}
float num208 = num78;
float num209 = num79;
num208 += (float)Main.rand.Next(-1, 2) * 0.5f;
num209 += (float)Main.rand.Next(-1, 2) * 0.5f;
if (Collision.CanHitLine(player.Center, 0, 0, vector2 + new Vector2(num208, num209) * 2f, 0, 0))
{
vector2 += new Vector2(num208, num209);
}
Projectile.NewProjectile(source, position.X, position.Y - player.gravDir * 4f, num208, num209, ProjectileID.PainterPaintball, damage, knockback, player.whoAmI, 0f, (float)Main.rand.Next(12) / 6f);
return false;
}
@@ -69,7 +106,7 @@ namespace CalamityMod.Items.Weapons.Ranged
{
CreateRecipe().
AddIngredient(ItemID.PainterPaintballGun).
AddIngredient(ItemID.SoulofSight, 5).
AddIngredient(ItemID.MythrilBar, 5).
AddTile(TileID.MythrilAnvil).
Register();
}
+6 -8
View File
@@ -14,26 +14,24 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void SetDefaults()
{
Item.width = 106;
Item.damage = 143;
Item.damage = 180;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.useAnimation = 22;
Item.useTime = 22;
Item.useAnimation = 20;
Item.useTime = 20;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 4f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.height = 104;
Item.shoot = ModContent.ProjectileType<ReaperProjectile>();
Item.shootSpeed = 20f;
Item.shootSpeed = 16f;
Item.DamageType = RogueDamageClass.Instance;
Item.value = CalamityGlobalItem.Rarity13BuyPrice;
Item.rare = ModContent.RarityType<PureGreen>();
}
public override float StealthDamageMultiplier => 0.66f;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
@@ -41,8 +39,8 @@ namespace CalamityMod.Items.Weapons.Rogue
int spread = 15;
for (int i = 0; i < 3; i++)
{
Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3,4), velocity.Y + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread));
int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, damage, knockback, player.whoAmI);
Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-2,3), velocity.Y + Main.rand.Next(-2,3)).RotatedBy(MathHelper.ToRadians(spread));
int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, damage /2, knockback, player.whoAmI);
if (proj.WithinBounds(Main.maxProjectiles))
{
Main.projectile[proj].Calamity().stealthStrike = true;
-57
View File
@@ -1,57 +0,0 @@
using Terraria.DataStructures;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Summon
{
public class BloodClotStaff : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Summon";
public override void SetDefaults()
{
Item.damage = 9;
Item.mana = 10;
Item.width = 58;
Item.height = 64;
Item.useTime = Item.useAnimation = 30;
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.knockBack = 2.25f;
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
Item.rare = ItemRarityID.Orange;
Item.UseSound = SoundID.Item44;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<BloodClotMinion>();
Item.shootSpeed = 10f;
Item.DamageType = DamageClass.Summon;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.altFunctionUse != 2)
{
position = Main.MouseWorld;
velocity.X = 0;
velocity.Y = 0;
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = Item.damage;
}
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.CrimtaneBar, 4).
AddIngredient<BloodSample>(12).
AddIngredient(ItemID.Vertebrae, 4).
AddTile(TileID.DemonAltar).
Register();
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

+43 -22
View File
@@ -1,8 +1,10 @@
using Terraria.DataStructures;
using System.Collections.Generic;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -10,38 +12,57 @@ namespace CalamityMod.Items.Weapons.Summon
{
public class CalamarisLament : ModItem, ILocalizedModType
{
public static readonly SoundStyle GFB = new("CalamityMod/Sounds/Item/Inkling", 5);
public new string LocalizationCategory => "Items.Weapons.Summon";
#region Minion Stats
public static float EnemyDistanceDetection = 8000f; // It's this high so it can target DoG reliably.
public static float ShootingExtraTargettingSpeed = 10f;
public static float ShootingMinionDistance = 320f;
public static int ShootingFireRate = 30; // In frames.
public static float ShootingProjectileSpeed = 20f;
public static float LatchingDistanceRequired = 400f;
public static float LatchingExtraTargettingSpeed = 30f;
public static float LatchingDamageMultiplier = 1.25f;
public static int LatchingIFrames = 30; // If the value is changed, respawn all minions.
#endregion
public override void SetStaticDefaults()
{
Item.staff[Type] = true;
}
public override void SetDefaults()
{
Item.damage = 110;
Item.mana = 10;
Item.width = 62;
Item.height = 62;
Item.useTime = Item.useAnimation = 10;
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.knockBack = 2.5f;
Item.value = CalamityGlobalItem.Rarity13BuyPrice;
Item.UseSound = SoundID.Item83;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<CalamariMinion>();
Item.shootSpeed = 10f;
Item.shoot = ModContent.ProjectileType<CalamarisLamentMinion>();
Item.DamageType = DamageClass.Summon;
Item.useTime = Item.useAnimation = 10;
Item.mana = 10;
Item.width = 88;
Item.height = 108;
Item.noMelee = true;
Item.autoReuse = true;
Item.UseSound = SoundID.Item85;
Item.useStyle = ItemUseStyleID.Shoot;
Item.rare = ModContent.RarityType<PureGreen>();
Item.value = CalamityGlobalItem.Rarity13BuyPrice;
// This does nothing, it's just here so it's able to act like a staff.
Item.shootSpeed = 1f;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.altFunctionUse != 2)
{
position = Main.MouseWorld;
velocity.X = 0;
velocity.Y = 0;
int p = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = Item.damage;
}
Projectile.NewProjectile(source, Main.MouseWorld, velocity, type, damage, knockback, player.whoAmI);
return false;
}
public override void ModifyTooltips(List<TooltipLine> list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal"));
}
}
+20 -25
View File
@@ -1,53 +1,48 @@
using Terraria.ModLoader;
using Terraria.ID;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Microsoft.Xna.Framework;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Summon
{
public class FleshOfInfidelity : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Summon";
public override void SetDefaults()
{
Item.damage = 27;
Item.mana = 10;
Item.width = Item.height = 48;
Item.useTime = Item.useAnimation = 30;
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.damage = 15;
Item.DamageType = DamageClass.Summon;
Item.shoot = ModContent.ProjectileType<FleshBallMinion>();
Item.knockBack = 1f;
Item.useTime = Item.useAnimation = 10;
Item.mana = 10;
Item.width = 42;
Item.height = 42;
Item.noMelee = true;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
Item.rare = ItemRarityID.Orange;
Item.useStyle = ItemUseStyleID.Swing;
Item.UseSound = SoundID.Zombie24;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<FleshBallMinion>();
Item.shootSpeed = 10f;
Item.DamageType = DamageClass.Summon;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.altFunctionUse != 2)
{
int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = Item.damage;
}
Projectile.NewProjectile(source, Main.MouseWorld, Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI);
return false;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<ScabRipper>().
AddIngredient<StaffOfNecrosteocytes>().
AddIngredient<BelladonnaSpiritStaff>().
AddIngredient(ItemID.ImpStaff).
AddIngredient<PurifiedGel>(10).
AddIngredient(ItemID.CrimtaneBar, 4).
AddIngredient<BloodSample>(12).
AddIngredient(ItemID.Vertebrae, 4).
AddTile(TileID.DemonAltar).
Register();
}
+11 -17
View File
@@ -12,37 +12,31 @@ namespace CalamityMod.Items.Weapons.Summon
public class Perdition : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Summon";
public override void SetDefaults()
{
Item.damage = 100;
Item.damage = 375;
Item.DamageType = DamageClass.Summon;
Item.shoot = ModContent.ProjectileType<PerditionBeacon>();
Item.knockBack = 4f;
Item.useTime = Item.useAnimation = 10; // 9 because of useStyle 1.
Item.mana = 10;
Item.width = Item.height = 56;
Item.useTime = Item.useAnimation = 10; // 9 because of useStyle 1
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.knockBack = 4f;
Item.UseSound = SoundID.DD2_EtherianPortalOpen;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<PerditionBeacon>();
Item.shootSpeed = 10f;
Item.DamageType = DamageClass.Summon;
Item.sentry = true;
Item.value = CalamityGlobalItem.RarityVioletBuyPrice;
Item.rare = ModContent.RarityType<Violet>();
Item.useStyle = ItemUseStyleID.Swing;
Item.UseSound = SoundID.DD2_EtherianPortalOpen;
}
public override bool AltFunctionUse(Player player) => true;
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.altFunctionUse != 2)
{
CalamityUtils.OnlyOneSentry(player, type);
int p = Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = Item.damage;
player.UpdateMaxTurrets();
if (player.ownedProjectileCounts[type] < 1)
Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
}
else
{
+6 -1
View File
@@ -12,6 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon
public class WulfrumController : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Summon";
public override void SetDefaults()
{
Item.damage = 16;
@@ -67,6 +68,7 @@ namespace CalamityMod.Items.Weapons.Summon
public override void ResetEffects()
{
}
public override void UpdateDead()
{
buffingDrones = 0;
@@ -76,7 +78,10 @@ namespace CalamityMod.Items.Weapons.Summon
{
if (buffingDrones > 0)
{
Player.lifeRegen += (int)(buffingDrones * 3);
// 1 life regen per drone.
Player.lifeRegen += (int)(buffingDrones);
// 3 defense per drone.
Player.statDefense += buffingDrones * 3;
buffingDrones = 0;
@@ -988,12 +988,12 @@ WitherDebuff: {
AbandonedSlimeBuff: {
DisplayName: Astral Jelly
Description: The mini astrageldon slime will protect you
Description: Back from the heavens just to protect you!
}
AncientMineralSharkBuff: {
DisplayName: Ancient Mineral Shark
Description: Ancient yet so dangerous
Description: So ancient yet just as powerful
}
AquaticStar: {
@@ -1051,7 +1051,7 @@ BrittleStar: {
Description: The brittle star will protect you
}
Calamari: {
CalamarisLamentBuff: {
DisplayName: Calamari
Description: The squid will protect you
}
@@ -1273,7 +1273,7 @@ MidnightSunBuff: {
MiniatureEyeofCthulhu: {
DisplayName: Miniature Eye of Cthulhu
Description: It's watching you
Description: It's giving you the death stare
}
MiniOldDukeBuff: {
@@ -235,6 +235,15 @@ CalamityConfig: {
'''
}
MusicModReminderMessage: {
Label: "[i:MusicBoxMartians] Music Mod Reminder Message"
Tooltip:
'''
Enable or disable the status message which reminds users to install the Calamity Music Mod.
This message plays on world entry.
'''
}
NerfExpertDebuffs: {
Label: "[i:AnkhCharm] Remove Increased Debuff Duration"
Tooltip:
@@ -65,8 +65,9 @@ AeroStone: {
DisplayName: Aero Stone
Tooltip:
'''
Increases flight time, movement speed and jump speed by 10%
One of the ancient relics
Provides an additional 45 flight time
Movement speed and acceleration are greatly increased when you are out of flight time
'One of the ancient relics'
'''
}
@@ -313,7 +314,7 @@ BloomStone: {
Both of these effects are maximized from noon to sunset
Flowers grow if you are standing on grass
Random dye plants will grow while standing on grassless dirt
One of the ancient relics
'One of the ancient relics'
'''
}
@@ -347,7 +348,7 @@ ChaosStone: {
Mana Sickness from drinking mana potions is replaced by Mana Burn
Mana Burn deals damage over time relative to the intensity of the debuff
This debuff does not reduce your magic damage
One of the ancient relics
'One of the ancient relics'
'''
}
@@ -441,9 +442,9 @@ CryoStone: {
DisplayName: Cryo Stone
Tooltip:
'''
One of the ancient relics
Multiplies all cold-based debuff damage by 1.5
Creates a rotating ice shield around you that damages and slows down enemies on contact
'One of the ancient relics'
'''
}
@@ -715,10 +716,9 @@ FlameLickedShell: {
DisplayName: Flame-Licked Shell
Tooltip:
'''
35% decreased movement speed
Enemies take damage when they hit you
You move faster and lose 18 defense for 3 seconds if you take damage
Grants immunity to lava and Armor Crunch
25% decreased dash velocity
Your dashes are empowered by fire, shredding enemies near you with violent explosions
Grants immunity to lava
'''
}
@@ -843,7 +843,7 @@ GrandGelatin: {
DisplayName: Grand Gelatin
Tooltip:
'''
10% increased movement speed and jump speed
12% increased movement speed and jump speed
Using a healing potion will spawn a cleansing aura
Walking into the aura removes all debuffs and defense damage one time
The aura grants +2.5 HP/s life regen for all players inside for 8 seconds
@@ -988,10 +988,9 @@ LeviathanAmbergris: {
DisplayName: Leviathan Ambergris
Tooltip:
'''
You leave behind poisonous seawater as you move
30% increased movement speed, 10% increase to all damage and plus 10 defense while submerged in liquid
If you are damaged while submerged in liquid you will gain a damaging aura for a short time
Being outside of liquid increases all damage by 5% and increases damage reduction by 5%
15% increased dash velocity
You gain 5% damage reduction while dashing
Your dashes are empowered by water, knocking back and damaging nearby enemies with viscous currents
'''
}
@@ -1393,7 +1392,7 @@ RoseStone: {
Tooltip:
'''
Summons a Brimstone Elemental to fight for you
One of the ancient relics
'One of the ancient relics'
'''
}
@@ -1730,7 +1729,7 @@ TheAbsorber: {
DisplayName: The Absorber
Tooltip:
'''
10% increased movement and jump speed
12% increased movement and jump speed
Enemies take immense damage when they touch you and are afflicted with a damaging sickeness debuff that reduces damage reduction significantly
Using a healing potion will spawn a cleansing aura
Walking into the aura removes all debuffs and defense damage one time
@@ -1821,7 +1820,7 @@ TheSponge: {
Tooltip:
'''
Projects a quantum foam barrier that absorbs up to 180 damage
The barrier grants 30 defense and reduces damage taken by 30% while active
The barrier grants 30 defense and reduces damage taken by 10% while active
The barrier starts recharging 9 seconds after being hit
Recharging from zero to full charge takes 6 seconds
Being hit again while recharging restarts the charge timer
@@ -1921,7 +1920,7 @@ VeneratedLocket: {
VitalJelly: {
DisplayName: Vital Jelly
Tooltip: 10% increased movement and jump speed
Tooltip: 12% increased movement and jump speed
}
VoidofCalamity: {
@@ -25,7 +25,7 @@ AuricQuantumCoolingCell: {
Can be placed in the Codebreaker, completing it
Greatly decreases decryption time
The completion of the Codebreaker allows you to make contact with its original creator
[c/8B00000:Attempting to do so may have dire consequences]
[c/8B00000:Its creator is ready, and he hopes you are too.]
'''
}
@@ -647,9 +647,14 @@ LunarianBow: {
'''
}
MagnaStriker: {
DisplayName: Magna Striker
Tooltip: Fires a string of opal and magna strikes
ArcNovaDiffuser: {
DisplayName: Arc Nova Diffuser
Tooltip:
'''
Charges and fires a rapid burst of nova bolts
The first charging stage increases the fire rate of the burst
The second charging stage replaces the rapid burst with a devastating nova blast
'''
}
MagnomalyCannon: {
@@ -1067,7 +1072,13 @@ SpectralstormCannon: {
SpeedBlaster: {
DisplayName: Speed Blaster
Tooltip: Shoots a string of paint blasts
Tooltip:
'''
Fires gravity affected paint shots
Right click while holding down the movement keys to dash omnidirectionally and fire a powerful straight shot
After right clicking your fire rate and shot velocity are increased for a while
Right clicks only work while your shots aren't velocity boosted
'''
}
Spyker: {
@@ -1238,7 +1238,7 @@ TheOldReaper: {
Tooltip:
'''
Throws a homing reaper scythe that shreds enemies
Stealth strikes throw four at once
Stealth strikes throw three at once
'Slice 'n dice'
'''
}
@@ -44,16 +44,16 @@ AtlasMunitionsBeacon: {
DisplayName: Atlas Munitions Beacon
Tooltip:
'''
[c/F2B629:Drops down a crate from the sky that houses a mounted, stationary cannon]
[c/F2B629:The cannon will fire at any enemies within its range]
[c/F27049:If an enemy is in close proximity, it will enter Overdrive mode]
[c/F27049:When in Overdrive mode the cannon uses three barrels that each collectively fire]
[c/F27049:The cannon also heats up the more it fires in overdrive mode]
[c/69F0DC:Press right click while holding this item to pick up the cannon and use it for yourself]
[c/69F0DC:When held, the cannon will always be in Overdrive mode]
[c/69F0DC:If the held cannon overheats due to Overdrive mode, you are forced to drop it]
[c/9AA4AE:Pressing right click allows you to drop it manually]
[c/9AA4AE:If the held cannon is dropped near the mount, it will re-attach automatically]
[c/F2B629:Brings forth an exo-powered, stationary cannon]
[c/F2B629:The cannon will fire at enemies within its range]
[c/F27049:If an enemy is in close proximity, it will enter Overdrive]
[c/F27049:When in Overdrive the cannon uses its full power to bring down any foe]
[c/F27049:While in Overdrive, the cannon will build up heat, eventually overheating]
[c/69F0DC:Press right click while holding this item to pick up the cannon and use it yourself]
[c/69F0DC:When held, the cannon will always be in Overdrive]
[c/69F0DC:If the cannon overheats while you hold it, you will be forced to drop it]
[c/9AA4AE:Pressing <right> allows you to drop it manually]
[c/9AA4AE:If dropped near the base, it will re-attach automatically]
'It's surprisingly easy to pick up'
'''
}
@@ -95,12 +95,14 @@ CadaverousCarrion: {
CalamarisLament: {
DisplayName: Calamari's Lament
Tooltip:
Tooltip: "[GFB]"
TooltipNormal:
'''
Summons a squid that viciously inks enemies
'In the Abyss, all kinds of resources are scarce.
Every species is solitary. There simply is not enough to share.'
'''
TooltipGFB: "'Woomy!'"
}
CausticCroakerStaff: {
@@ -19,8 +19,9 @@ RecipeGroup: {
}
// Status
WikiStatus1: "[i:Book][c/EE4939:Note: The Fandom wiki is no longer supported by Calamity.] [i:Book]"
WikiStatus2: "[i:Book][c/EE4939:Check out the Official Calamity Mod Wiki at ][c/3989FF:calamitymod.wiki.gg][c/EE4939:!] [i:Book]"
WikiStatus1: "[i:Book] [c/EE4939:Note: The Fandom wiki is no longer supported by Calamity.] [i:Book]"
WikiStatus2: "[i:Book] [c/EE4939:Check out the Official Calamity Mod Wiki at ][c/3989FF:calamitymod.wiki.gg][c/EE4939:!] [i:Book]"
MusicModReminder: "[i:MusicBoxMartians] [c/71DFF5:Remember to also install the Calamity Music Mod to experience our soundtrack!] [i:MusicBoxMartians]"
// Recipe Conditions
Tier1ArsenalRecipeCondition: View an unencrypted schematic from the lab near the Sunken Sea
Tier2ArsenalRecipeCondition: Decrypt a schematic from the lab in the large planetoid in the sky
@@ -256,4 +256,8 @@ VeriumBulletProj.DisplayName: Verium Bullet
Voidragon.DisplayName: Voidragon Blast
VoidragonTentacle.DisplayName: Voidragon Tentacle
WaterSpout.DisplayName: Spout
WulfrumScrapBullet.DisplayName: High Speed Scrap
WulfrumScrapBullet.DisplayName: High Speed Scrap
ArcNovaDiffuserHoldout.DisplayName: Arc Nova Diffuser Holdout
NovaShot.DisplayName: Nova Bolt
NovaChargeShot.DisplayName: Charged Nova Blast
SpeedBlasterShot.DisplayName: Splatter Shot
@@ -47,8 +47,8 @@ BrimstoneFireballMinion.DisplayName: Brimstone Fireball
BrimstoneFireSummon.DisplayName: Brimstone Fire
BrimstoneLaserSummon.DisplayName: Brimstone Laser
BrittleStarMinion.DisplayName: Brittle Star
CalamariInk.DisplayName: Calamari Ink
CalamariMinion.DisplayName: Calamari
CalamarisLamentProjectile.DisplayName: Calamari Ink
CalamarisLamentMinion.DisplayName: Calamari
Calamitamini.DisplayName: Calamitamini
Cataclymini.DisplayName: Cataclymini
CataclysmSummon.DisplayName: Cataclysm
@@ -128,4 +128,7 @@ YanmeisKnifeSlash.DisplayName: Yanmei's Knife
YellowLabSeeker.DisplayName: Seeking Mechanism
TarragonAura.DisplayName: Tarragon Aura
BlazingStarHeal.DisplayName: Blazing Star Heal
BlazingStarThatDoesNotHeal.DisplayName: Blazing Star That Does Not Heal
BlazingStarThatDoesNotHeal.DisplayName: Blazing Star That Does Not Heal
LeviAmberDash.DisplayName: Riptide Slam
FlameLickedShellBurst.DisplayName: Flame Slam
FlameLickedShellExplosion.DisplayName: Fire Blast
+1 -2
View File
@@ -1086,7 +1086,6 @@ namespace CalamityMod
RegisterSummon(ItemType<VileFeeder>(), BuffType<VileFeederBuff>(), ProjectileType<VileFeederSummon>());
RegisterSummon(ItemType<ScabRipper>(), BuffType<BabyBloodCrawlerBuff>(), ProjectileType<BabyBloodCrawler>());
RegisterSummon(ItemType<CinderBlossomStaff>(), BuffType<CinderBlossomBuff>(), ProjectileType<CinderBlossom>());
RegisterSummon(ItemType<BloodClotStaff>(), BuffType<BloodClot>(), ProjectileType<BloodClotMinion>());
RegisterSummon(ItemType<DankStaff>(), BuffType<DankCreeperBuff>(), ProjectileType<DankCreeperMinion>());
RegisterSummon(ItemType<StarSwallowerContainmentUnit>(), BuffType<StarSwallowerBuff>(), ProjectileType<StarSwallowerSummon>());
RegisterSummon(ItemType<HerringStaff>(), BuffType<Herring>(), ProjectileType<HerringMinion>());
@@ -1125,7 +1124,7 @@ namespace CalamityMod
RegisterSummon(ItemType<Cosmilamp>(), BuffType<CosmilampBuff>(), ProjectileType<CosmilampMinion>());
RegisterSummon(ItemType<VoidConcentrationStaff>(), BuffType<VoidConcentrationBuff>(), ProjectileType<VoidConcentrationAura>());
RegisterSummon(ItemType<EtherealSubjugator>(), BuffType<Phantom>(), ProjectileType<PhantomGuy>());
RegisterSummon(ItemType<CalamarisLament>(), BuffType<Calamari>(), ProjectileType<CalamariMinion>());
RegisterSummon(ItemType<CalamarisLament>(), BuffType<CalamarisLamentBuff>(), ProjectileType<CalamarisLamentMinion>());
RegisterSummon(ItemType<GammaHeart>(), BuffType<GammaHydraBuff>(), ProjectileType<GammaHead>());
RegisterSummon(ItemType<WarloksMoonFist>(), BuffType<MoonFistBuff>(), ProjectileType<MoonFist>());
RegisterSummon(ItemType<StaffoftheMechworm>(), BuffType<Mechworm>(), ProjectileType<MechwormBody>());
+30
View File
@@ -3699,6 +3699,7 @@ namespace CalamityMod.NPCs
Main.npc[headOneID].Calamity().newAI[0] = 1f;
Main.npc[headOneID].velocity = Vector2.Normalize(player.Center - Main.npc[headOneID].Center) * 16f;
Main.npc[headOneID].timeLeft *= 20;
Main.npc[headOneID].netSpam = 0;
Main.npc[headOneID].netUpdate = true;
// On server, immediately send the correct extra AI of this head to clients.
@@ -3721,6 +3722,7 @@ namespace CalamityMod.NPCs
Main.npc[headTwoID].Calamity().newAI[3] = Main.getGoodWorld ? 300f : 600f;
Main.npc[headTwoID].velocity = Vector2.Normalize(player.Center - Main.npc[headTwoID].Center) * 16f;
Main.npc[headTwoID].timeLeft *= 20;
Main.npc[headTwoID].netSpam = 0;
Main.npc[headTwoID].netUpdate = true;
// On server, immediately send the correct extra AI of this head to clients.
@@ -3823,7 +3825,12 @@ namespace CalamityMod.NPCs
npc.HitEffect(0, 10.0);
npc.checkDead();
npc.active = false;
npc.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (npc.netSpam >= 10)
npc.netSpam = 9;
}
}
@@ -3972,7 +3979,12 @@ namespace CalamityMod.NPCs
if (Main.npc[num957].type == headType || Main.npc[num957].type == bodyType || Main.npc[num957].type == tailType)
{
Main.npc[num957].active = false;
Main.npc[num957].netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (Main.npc[num957].netSpam >= 10)
Main.npc[num957].netSpam = 9;
}
}
}
@@ -4166,21 +4178,39 @@ namespace CalamityMod.NPCs
if (flag2)
{
if (npc.localAI[0] != 1f)
{
npc.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (npc.netSpam >= 10)
npc.netSpam = 9;
}
npc.localAI[0] = 1f;
}
else
{
if (npc.localAI[0] != 0f)
{
npc.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (npc.netSpam >= 10)
npc.netSpam = 9;
}
npc.localAI[0] = 0f;
}
if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit)
{
npc.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (npc.netSpam >= 10)
npc.netSpam = 9;
}
npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + MathHelper.PiOver2;
}
+34 -2
View File
@@ -4567,7 +4567,7 @@ namespace CalamityMod.NPCs
// Hitbox criteria were changed to allow long one dimensional projectiles so that Condemnation would work.
bool hitBullseye = false;
bool acceptableVelocity = projectile.velocity != Vector2.Zero;
bool acceptableHitbox = (projectile.width < 36) || (projectile.height < 36);
bool acceptableHitbox = (projectile.width <= 36) || (projectile.height <= 36);
if (bullseye != null && acceptableVelocity && acceptableHitbox)
{
// Bullseyes are visually different on bosses and thus have larger hitboxes.
@@ -6191,7 +6191,7 @@ namespace CalamityMod.NPCs
segmentDrawColor = Color.Black;
}
}
// Draw segments
spriteBatch.Draw(npcTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY),
npc.frame, segmentDrawColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f);
@@ -6203,6 +6203,12 @@ namespace CalamityMod.NPCs
if (npc.realLife >= 0)
destroyerLifeRatio = Main.npc[npc.realLife].life / (float)Main.npc[npc.realLife].lifeMax;
float shootProjectile = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 180 : 300;
float timer = npc.ai[0] * 30f;
float shootProjectileGateValue = timer + shootProjectile;
float glowDuration = 120f;
float startGlowingGateValue = shootProjectileGateValue - glowDuration;
if ((newAI[3] >= 900f && destroyerLifeRatio < 0.5f) || (newAI[1] < 600f && newAI[1] > 60f))
{
Color drawColor2 = new Color(50, 50, 255, 0) * (1f - npc.alpha / 255f);
@@ -6211,12 +6217,38 @@ namespace CalamityMod.NPCs
spriteBatch.Draw(TextureAssets.Dest[npc.type - NPCID.TheDestroyer].Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame,
drawColor2, npc.rotation, halfSize, npc.scale, spriteEffects, 0f);
}
// Glow telegraph for lasers
/*if (newAI[0] > startGlowingGateValue)
{
Texture2D bloomTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Color bloom = drawColor2;
bloom = Main.hslToRgb((Main.rgbToHsl(bloom).X + 0.02f) % 1, Main.rgbToHsl(bloom).Y, Main.rgbToHsl(bloom).Z);
float scalingFactor = (newAI[0] - startGlowingGateValue) / glowDuration;
float opacity = (float)Math.Sin(MathHelper.PiOver2 + scalingFactor * MathHelper.PiOver2);
float properBloomSize = (float)npc.height / (float)bloomTexture.Height;
float scale = scalingFactor;
spriteBatch.Draw(bloomTexture, npc.Center - Main.screenPosition, null, bloom * opacity * 0.5f, 0, bloomTexture.Size() / 2f, scale * 1f * properBloomSize, SpriteEffects.None, 0);
}*/
}
else
{
Color drawColor2 = new Color(255, 255, 255, 0) * (1f - npc.alpha / 255f);
spriteBatch.Draw(TextureAssets.Dest[npc.type - NPCID.TheDestroyer].Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame,
drawColor2, npc.rotation, halfSize, npc.scale, spriteEffects, 0f);
// Glow telegraph for lasers
/*if (newAI[0] > startGlowingGateValue)
{
Texture2D bloomTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
Color bloom = drawColor2;
bloom = Main.hslToRgb((Main.rgbToHsl(bloom).X + 0.02f) % 1, Main.rgbToHsl(bloom).Y, Main.rgbToHsl(bloom).Z);
float scalingFactor = (newAI[0] - startGlowingGateValue) / glowDuration;
float opacity = (float)Math.Sin(MathHelper.PiOver2 + scalingFactor * MathHelper.PiOver2);
float properBloomSize = (float)npc.height / (float)bloomTexture.Height;
float scale = scalingFactor;
spriteBatch.Draw(bloomTexture, npc.Center - Main.screenPosition, null, bloom * opacity * 0.5f, 0, bloomTexture.Size() / 2f, scale * 1f * properBloomSize, SpriteEffects.None, 0);
}*/
}
}
}
+3 -16
View File
@@ -352,15 +352,6 @@ namespace CalamityMod.NPCs
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<TrapperBulb>(), 2, 1));
break;
// Derpling, Cochineal Beetle, Cyan Beetle, Lac Beetle
// Beetle Juice @ 33.33% Normal, 50% Expert+
case NPCID.Derpling:
case NPCID.CochinealBeetle:
case NPCID.CyanBeetle:
case NPCID.LacBeetle:
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<BeetleJuice>(), 3, 2));
break;
// Moth
// Butterfly Dust @ 100% INSTEAD OF 50%
case NPCID.Moth:
@@ -1629,13 +1620,9 @@ namespace CalamityMod.NPCs
#region Enemy Lists
// All Moss Hornets
// Stinger @ 50% Normal, 100% Expert+
// Needler @ 4% Normal, 6.67% Expert+
if (CalamityLists.mossHornetList.Contains(npc.type))
{
npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Stinger, 2, 1));
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<Needler>(), 25, 15));
}
// All Skeletons
// Ancient Bone Dust @ 20% Normal, 33.33% Expert+
@@ -1713,9 +1700,9 @@ namespace CalamityMod.NPCs
// Block anything except the Rock from dropping
DropHelper.BlockEverything(ModContent.ItemType<Rock>());
}
return true;
}
#endregion
return true;
}
#endregion
#region On Kill Main Hook
public override void OnKill(NPC npc)
+23 -19
View File
@@ -24,7 +24,6 @@ using Terraria.GameContent;
using Terraria.ID;
using Terraria.Localization;
using Terraria.ModLoader;
using CalamityMod.Items.Placeables.Walls;
using static Terraria.ModLoader.ModContent;
namespace CalamityMod.NPCs
@@ -128,6 +127,7 @@ namespace CalamityMod.NPCs
"Outlaw", // <@!918311619480657922> (TheChosenOutlaw#8746)
"Alfred Rend", // <@!606301806481375255> (Deadsqurp300#0907)
"Leeman", // <@!281999243168841728> (Tweee#5831)
"Mihai", // <@!373941893467209730> (cmihaii.)
};
private static readonly string[] MechanicNames =
{
@@ -324,18 +324,22 @@ namespace CalamityMod.NPCs
// Annoyingly, because npc.GivenName is a property, it can't be passed as a ref parameter.
private string ChooseName(ref bool alreadySet, string currentName, int numVanillaNames, string[] patreonNames, string[] globalNames)
{
if (alreadySet || patreonNames is null || patreonNames.Length == 0)
if (alreadySet)
{
alreadySet = true;
return currentName;
}
alreadySet = true;
int index = Main.rand.Next(numVanillaNames + patreonNames.Length + globalNames.Length);
// PatreonNames can be null, so can global names, it short circuits in the next step if so
int combinedLength = (patreonNames?.Length ?? 0) + (globalNames?.Length ?? 0);
int index = Main.rand.Next(numVanillaNames + combinedLength);
// If the roll isn't low enough, then a "vanilla name" was picked, meaning we change nothing.
if (index >= patreonNames.Length + globalNames.Length)
if (index >= combinedLength)
return currentName;
// Change the name to be a randomly selected Patreon name if the roll is low enough.
if (index >= globalNames.Length)
return patreonNames[index - globalNames.Length];
@@ -378,22 +382,22 @@ namespace CalamityMod.NPCs
switch (npc.townNpcVariationIndex)
{
case 0:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogLabradorVanillaNames, TownDogLabradorNames, TownDogNames);
npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogLabradorVanillaNames, TownDogLabradorNames, TownDogNames);
break;
case 1:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogPitBullVanillaNames, TownDogPitBullNames, TownDogNames);
npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogPitBullVanillaNames, TownDogPitBullNames, TownDogNames);
break;
case 2:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogBeagleVanillaNames, TownDogBeagleNames, TownDogNames);
npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogBeagleVanillaNames, TownDogBeagleNames, TownDogNames);
break;
case 3:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogCorgiVanillaNames, TownDogCorgiNames, TownDogNames);
npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogCorgiVanillaNames, TownDogCorgiNames, TownDogNames);
break;
case 4:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogDalmatianVanillaNames, TownDogDalmatianNames, TownDogNames);
npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogDalmatianVanillaNames, TownDogDalmatianNames, TownDogNames);
break;
case 5:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownDogHuskyVanillaNames, TownDogHuskyNames, TownDogNames);
npc.GivenName = ChooseName(ref CalamityWorld.dogName, npc.GivenName, TownDogHuskyVanillaNames, TownDogHuskyNames, TownDogNames);
break;
default:
break;
@@ -403,22 +407,22 @@ namespace CalamityMod.NPCs
switch (npc.townNpcVariationIndex)
{
case 0:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyWhiteVanillaNames, TownBunnyWhiteNames, TownBunnyNames);
npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyWhiteVanillaNames, TownBunnyWhiteNames, TownBunnyNames);
break;
case 1:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyAngoraVanillaNames, TownBunnyAngoraNames, TownBunnyNames);
npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyAngoraVanillaNames, TownBunnyAngoraNames, TownBunnyNames);
break;
case 2:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyDutchVanillaNames, TownBunnyDutchNames, TownBunnyNames);
npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyDutchVanillaNames, TownBunnyDutchNames, TownBunnyNames);
break;
case 3:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyFlemishVanillaNames, TownBunnyFlemishNames, TownBunnyNames);
npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyFlemishVanillaNames, TownBunnyFlemishNames, TownBunnyNames);
break;
case 4:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnyLopVanillaNames, TownBunnyLopNames, TownBunnyNames);
npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnyLopVanillaNames, TownBunnyLopNames, TownBunnyNames);
break;
case 5:
npc.GivenName = ChooseName(ref CalamityWorld.catName, npc.GivenName, TownBunnySilverVanillaNames, TownBunnySilverNames, TownBunnyNames);
npc.GivenName = ChooseName(ref CalamityWorld.bunnyName, npc.GivenName, TownBunnySilverVanillaNames, TownBunnySilverNames, TownBunnyNames);
break;
default:
break;
@@ -530,7 +534,7 @@ namespace CalamityMod.NPCs
break;
// This function doesn't work with Town Pets currently
/*case NPCID.TownCat:
case NPCID.TownCat:
AddNewNames(nameList, TownCatNames);
switch (npc.townNpcVariationIndex)
{
@@ -607,7 +611,7 @@ namespace CalamityMod.NPCs
default:
break;
}
break;*/
break;
default:
break;
+19
View File
@@ -158,7 +158,12 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.height = (int)(70 * NPC.scale);
NPC.frame = new Rectangle(0, 0, 114, 88);
NPC.position -= NPC.Size * 0.5f;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
}
@@ -304,6 +309,10 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.Opacity = 0f;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
}
}
@@ -431,8 +440,13 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.life = 1;
NPC.dontTakeDamage = true;
NPC.active = true;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
if (NPC.realLife >= 0)
{
NPC Head = Main.npc[NPC.realLife];
@@ -441,7 +455,12 @@ namespace CalamityMod.NPCs.DevourerofGods
Head.ModNPC<DevourerofGodsHead>().Dying = true;
Head.dontTakeDamage = true;
Head.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (Head.netSpam >= 10)
Head.netSpam = 9;
}
return false;
}
+102
View File
@@ -461,6 +461,10 @@ namespace CalamityMod.NPCs.DevourerofGods
Main.npc[a].active = false;
Main.npc[a].netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (Main.npc[a].netSpam >= 10)
Main.npc[a].netSpam = 9;
}
}
}
@@ -538,7 +542,12 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.height = (int)(186 * NPC.scale);
NPC.position -= NPC.Size * 0.5f;
NPC.frame = new Rectangle(0, 0, 134, 196);
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
// Dialogue the moment the second phase starts
@@ -577,7 +586,12 @@ namespace CalamityMod.NPCs.DevourerofGods
if (Main.netMode != NetmodeID.MultiplayerClient && newOpacity > 0f && NPC.Opacity > newOpacity)
{
NPC.Opacity = newOpacity;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
if (NPC.Opacity < 0.2f)
@@ -594,7 +608,12 @@ namespace CalamityMod.NPCs.DevourerofGods
PortalIndex = Projectile.NewProjectile(NPC.GetSource_FromAI(), portalSpawnPosition, Vector2.Zero, ModContent.ProjectileType<DoGP1EndPortal>(), 0, 0f);
hasCreatedPhase1Portal = true;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
AttemptingToEnterPortal = true;
@@ -628,7 +647,13 @@ namespace CalamityMod.NPCs.DevourerofGods
{
Dying = true;
NPC.dontTakeDamage = true;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
return;
}
@@ -1225,7 +1250,12 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.ai[3] = 1f;
calamityGlobalNPC.newAI[2] = 0f;
NPC.TargetClosest();
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
}
@@ -1467,28 +1497,51 @@ namespace CalamityMod.NPCs.DevourerofGods
if (flies)
{
if (NPC.localAI[0] != 1f)
{
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
NPC.localAI[0] = 1f;
}
else
{
if (NPC.localAI[0] != 0f)
{
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
NPC.localAI[0] = 0f;
}
if (((NPC.velocity.X > 0f && NPC.oldVelocity.X < 0f) || (NPC.velocity.X < 0f && NPC.oldVelocity.X > 0f) || (NPC.velocity.Y > 0f && NPC.oldVelocity.Y < 0f) || (NPC.velocity.Y < 0f && NPC.oldVelocity.Y > 0f)) && !NPC.justHit)
{
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
if (calamityGlobalNPC.newAI[2] > phaseLimit)
{
calamityGlobalNPC.velocityPriorToPhaseSwap = NPC.velocity.Length();
NPC.ai[3] = 0f;
calamityGlobalNPC.newAI[2] = 0f;
NPC.TargetClosest();
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
}
}
@@ -1973,7 +2026,12 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.ai[3] = 1f;
calamityGlobalNPC.newAI[2] = 0f;
NPC.TargetClosest();
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
}
@@ -2203,21 +2261,39 @@ namespace CalamityMod.NPCs.DevourerofGods
if (flies)
{
if (NPC.localAI[0] != 1f)
{
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
NPC.localAI[0] = 1f;
}
else
{
if (NPC.localAI[0] != 0f)
{
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
NPC.localAI[0] = 0f;
}
if (((NPC.velocity.X > 0f && NPC.oldVelocity.X < 0f) || (NPC.velocity.X < 0f && NPC.oldVelocity.X > 0f) || (NPC.velocity.Y > 0f && NPC.oldVelocity.Y < 0f) || (NPC.velocity.Y < 0f && NPC.oldVelocity.Y > 0f)) && !NPC.justHit)
{
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
if (calamityGlobalNPC.newAI[2] > phaseLimit)
{
calamityGlobalNPC.velocityPriorToPhaseSwap = NPC.velocity.Length();
@@ -2309,8 +2385,13 @@ namespace CalamityMod.NPCs.DevourerofGods
// Prediction is Death Mode only for now because it's weird without the line telegraph that Shayy spoke about
Vector2 predictionVector = death ? player.velocity * 40f : Vector2.Zero;
NPC.velocity = Vector2.Normalize(player.Center + predictionVector - NPC.Center) * chargeVelocity;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
for (int i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType<DevourerofGodsBody>() || Main.npc[i].type == ModContent.NPCType<DevourerofGodsTail>()))
@@ -2321,6 +2402,10 @@ namespace CalamityMod.NPCs.DevourerofGods
((DevourerofGodsTail)Main.npc[i].ModNPC).setInvulTime(720);
Main.npc[i].netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (Main.npc[i].netSpam >= 10)
Main.npc[i].netSpam = 9;
}
}
@@ -2367,7 +2452,13 @@ namespace CalamityMod.NPCs.DevourerofGods
Main.npc[i].life = 0;
Main.npc[i].HitEffect();
Main.npc[i].active = false;
Main.npc[i].netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (Main.npc[i].netSpam >= 10)
Main.npc[i].netSpam = 9;
destroyedSegments++;
break;
}
@@ -2422,7 +2513,12 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.HitEffect();
NPC.NPCLoot();
NPC.active = false;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
DeathAnimationTimer++;
}
@@ -2682,7 +2778,13 @@ namespace CalamityMod.NPCs.DevourerofGods
Dying = true;
NPC.dontTakeDamage = true;
NPC.active = true;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
return false;
}
+19
View File
@@ -157,7 +157,12 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.height = (int)(140 * NPC.scale);
NPC.frame = new Rectangle(0, 0, 86, 148);
NPC.position -= NPC.Size * 0.5f;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
}
@@ -250,6 +255,10 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.Opacity = 0f;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
}
}
@@ -429,8 +438,13 @@ namespace CalamityMod.NPCs.DevourerofGods
NPC.life = 1;
NPC.dontTakeDamage = true;
NPC.active = true;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
if (NPC.realLife >= 0)
{
NPC Head = Main.npc[NPC.realLife];
@@ -439,7 +453,12 @@ namespace CalamityMod.NPCs.DevourerofGods
Head.ModNPC<DevourerofGodsHead>().Dying = true;
Head.dontTakeDamage = true;
Head.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (Head.netSpam >= 10)
Head.netSpam = 9;
}
return false;
}
+1 -1
View File
@@ -549,7 +549,7 @@ namespace CalamityMod.NPCs.Perforator
ModContent.ItemType<Aorta>(),
ModContent.ItemType<Eviscerator>(),
ModContent.ItemType<BloodBath>(),
ModContent.ItemType<BloodClotStaff>(),
ModContent.ItemType<FleshOfInfidelity>(),
new WeightedItemStack(ModContent.ItemType<ToothBall>(), 1f, 30, 50),
}));
+46
View File
@@ -306,6 +306,10 @@ namespace CalamityMod.NPCs.Providence
calamityGlobalNPC.newAI[2] = 0f;
calamityGlobalNPC.newAI[3] = 0f;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
// Increase all projectile damage at night, but reduce to 0 for Zenith
@@ -538,6 +542,11 @@ namespace CalamityMod.NPCs.Providence
Dying = true;
NPC.dontTakeDamage = true;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
return;
}
@@ -622,6 +631,11 @@ namespace CalamityMod.NPCs.Providence
{
NPC.life += healAmt;
NPC.HealEffect(healAmt, true);
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
NPC.netUpdate = true;
}
}
@@ -938,7 +952,13 @@ namespace CalamityMod.NPCs.Providence
NPC.ai[3] = 0f;
calamityGlobalNPC.newAI[1] = 0f;
calamityGlobalNPC.newAI[2] = 0f;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
NPC.netUpdate = true;
break;
case (int)Phase.HolyBlast:
@@ -1173,7 +1193,12 @@ namespace CalamityMod.NPCs.Providence
// Radial offset
NPC.ai[2] += 10f;
}
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
else
{
@@ -1676,6 +1701,10 @@ namespace CalamityMod.NPCs.Providence
}
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
}
}
@@ -1756,15 +1785,26 @@ namespace CalamityMod.NPCs.Providence
// Do periodic syncs.
if (Main.netMode == NetmodeID.Server && DeathAnimationTimer % 45f == 44f)
{
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
// Die and create drops after the star is gone.
if (DeathAnimationTimer >= 345f)
{
NPC.active = false;
NPC.HitEffect();
NPC.NPCLoot();
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
}
}
@@ -1844,7 +1884,13 @@ namespace CalamityMod.NPCs.Providence
Dying = true;
NPC.active = true;
NPC.dontTakeDamage = true;
NPC.netUpdate = true;
// Prevent netUpdate from being blocked by the spam counter.
if (NPC.netSpam >= 10)
NPC.netSpam = 9;
return false;
}
@@ -268,7 +268,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
}
bool scrap = false;
if (probeLaunched && Main.rand.NextBool())
if (probeLaunched)
{
scrap = true;
projectileType = ProjectileID.SaucerScrap;
@@ -281,10 +281,10 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
float num158 = bossRush ? 10f : phase2 ? (60f - (death ? 30f * (1f - lifeRatio) : 0f)) : 75f;
if (Main.getGoodWorld)
num158 *= 0.8f;
num158 = (float)Math.Ceiling(num158);
if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[1] >= num158)
if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[1] % num158 == 0f && calamityGlobalNPC.newAI[1] > 45f)
{
calamityGlobalNPC.newAI[1] = 0f;
Vector2 vector18 = npc.Center;
float num159 = Main.player[npc.target].position.X + (Main.player[npc.target].width / 2) - vector18.X;
float num160 = Main.player[npc.target].position.Y + (Main.player[npc.target].height / 2) - vector18.Y;
@@ -292,8 +292,8 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses
if (Collision.CanHit(vector18, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
{
float num162 = phase2 ? (5f + (death ? 3f * (1f - lifeRatio) : 0f)) : 4f;
float num163 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector18.X + Main.rand.Next(-20, 21);
float num164 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector18.Y + Main.rand.Next(-20, 21);
float num163 = Main.player[npc.target].position.X + Main.player[npc.target].width * 0.5f - vector18.X;
float num164 = Main.player[npc.target].position.Y + Main.player[npc.target].height * 0.5f - vector18.Y;
float num165 = (float)Math.Sqrt(num163 * num163 + num164 * num164);
num165 = num162 / num165;
num163 *= num165;
@@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles
/// Multiplied by <see cref="Projectile.MaxUpdates"/> so changing <see cref="Projectile.extraUpdates"/> won't affect this.<br/>
/// Defaults to 10.
/// </summary>
public int IFrames { get; set; } = 10;
public int IFrames { get => Projectile.localNPCHitCooldown / Projectile.MaxUpdates; set => Projectile.localNPCHitCooldown = value * Projectile.MaxUpdates; }
/// <summary>
/// If <see langword="true"/>, makes the minion only be able to detect and attack enemies through tiles only when there are any bosses alive.<br/>
@@ -101,7 +101,6 @@ namespace CalamityMod.Projectiles.BaseProjectiles
{
Projectile.DamageType = DamageClass.Summon;
Projectile.minionSlots = MinionSlots;
Projectile.localNPCHitCooldown = IFrames * Projectile.MaxUpdates;
Projectile.penetrate = -1;
Projectile.friendly = true;
+46 -22
View File
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -21,6 +20,8 @@ namespace CalamityMod.Projectiles
IProjectileTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed);
IProjectileTweak[] pointBlank = Do(PointBlank);
IProjectileTweak[] standardBulletTweaks = Do(PointBlank, ExtraUpdatesDelta(+2));
IProjectileTweak[] standardChainsawTweaks = Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(5));
IProjectileTweak[] standardDrillTweaks = Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+25), LocalIFrames(5));
IProjectileTweak[] counterweightTweaks = Do(MaxUpdatesExact(2), IDStaticIFrames(10));
// Shorthand for changing all the stats of a yoyo at once. This handles extra update related math for you.
@@ -112,6 +113,8 @@ namespace CalamityMod.Projectiles
#endregion
#region CATEGORY 2: Weapon/Enemy Balancing
{ ProjectileID.AdamantiteChainsaw, standardChainsawTweaks },
{ ProjectileID.AdamantiteDrill, standardDrillTweaks },
{ ProjectileID.Anchor, Do(ExtraUpdatesExact(1)) },
{ ProjectileID.Bee, Do(PiercingExact(2)) },
{ ProjectileID.BlackCounterweight, counterweightTweaks },
@@ -119,7 +122,11 @@ namespace CalamityMod.Projectiles
{ ProjectileID.BlueMoon, Do(ExtraUpdatesExact(1)) },
{ ProjectileID.Bullet, standardBulletTweaks },
{ ProjectileID.BulletHighVelocity, Do(PointBlank, LocalIFrames(-1)) },
{ ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ScaleExact(1.5f)) },
{ ProjectileID.ButchersChainsaw, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(5), ScaleExact(1.5f)) },
{ ProjectileID.ChlorophyteChainsaw, standardChainsawTweaks },
{ ProjectileID.ChlorophyteDrill, standardDrillTweaks },
{ ProjectileID.CobaltChainsaw, standardChainsawTweaks },
{ ProjectileID.CobaltDrill, standardDrillTweaks },
{ ProjectileID.CrystalBullet, standardBulletTweaks },
{ ProjectileID.CrystalVileShardHead, Do(LocalIFrames(10)) },
{ ProjectileID.CrystalVileShardShaft, Do(LocalIFrames(10)) },
@@ -139,9 +146,11 @@ namespace CalamityMod.Projectiles
{ ProjectileID.GiantBee, Do(PiercingExact(2)) },
{ ProjectileID.GoldenBullet, standardBulletTweaks },
{ ProjectileID.GreenCounterweight, counterweightTweaks },
{ ProjectileID.Hamdrax, standardDrillTweaks }, // Drax (never internally renamed since 1.1)
{ ProjectileID.IceBoomerang, Do(ExtraUpdatesExact(1)) },
{ ProjectileID.IchorBullet, standardBulletTweaks },
{ ProjectileID.InfluxWaver, Do(ExtraUpdatesExact(1)) },
{ ProjectileID.LaserDrill, Do(ArmorPenetrationDelta(+25), LocalIFrames(5)) },
{ ProjectileID.LightDisc, Do(MaxUpdatesExact(3)) },
{ ProjectileID.LostSoulHostile, Do(TileCollide) }, // Ragged Caster
{ ProjectileID.MeteorShot, standardBulletTweaks },
@@ -150,35 +159,42 @@ namespace CalamityMod.Projectiles
{ ProjectileID.MonkStaffT2, Do(TrueMelee, IDStaticIFrames(18)) }, // Ghastly Glaive
{ ProjectileID.MonkStaffT3, Do(ScaleRatio(2f)) }, // Sky Dragon's Fury
{ ProjectileID.MoonlordBullet, standardBulletTweaks }, // Luminite Bullet
{ ProjectileID.MythrilChainsaw, standardChainsawTweaks },
{ ProjectileID.MythrilDrill, standardDrillTweaks },
{ ProjectileID.NanoBullet, standardBulletTweaks },
{ ProjectileID.NebulaDrill, standardDrillTweaks },
{ ProjectileID.NebulaLaser, Do(ExtraUpdatesDelta(+1)) },
{ ProjectileID.OrichalcumChainsaw, standardChainsawTweaks },
{ ProjectileID.OrichalcumDrill, standardDrillTweaks },
{ ProjectileID.PalladiumChainsaw, standardChainsawTweaks },
{ ProjectileID.PalladiumDrill, standardDrillTweaks },
{ ProjectileID.PartyBullet, standardBulletTweaks },
{ ProjectileID.PoisonFang, Do(LocalIFrames(10)) },
{ ProjectileID.PurpleCounterweight, counterweightTweaks },
{ ProjectileID.QueenSlimeGelAttack, Do(NoPiercing) },
{ ProjectileID.QueenSlimeMinionPinkBall, Do(NoPiercing) },
{ ProjectileID.RedCounterweight, counterweightTweaks },
{ ProjectileID.SawtoothShark, Do(TrueMeleeNoSpeed, ArmorPenetrationDelta(+15), LocalIFrames(6)) },
{ ProjectileID.ShadowBeamHostile, Do(TimeLeftExact(60)) },
{ ProjectileID.Shroomerang, Do(ExtraUpdatesExact(1)) },
{ ProjectileID.SolarFlareDrill, standardDrillTweaks },
{ ProjectileID.StardustDrill, standardDrillTweaks },
{ ProjectileID.StarWrath, Do(NoPiercing) },
{ ProjectileID.Sunfury, Do(ExtraUpdatesExact(1)) },
{ ProjectileID.SwordBeam, Do(ExtraUpdatesExact(1)) }, // Beam Sword projectile
{ ProjectileID.TitaniumChainsaw, standardChainsawTweaks },
{ ProjectileID.TitaniumDrill, standardDrillTweaks },
{ ProjectileID.Trimarang, Do(ExtraUpdatesExact(1)) },
{ ProjectileID.VenomBullet, standardBulletTweaks },
{ ProjectileID.VenomFang, Do(LocalIFrames(10)) },
{ ProjectileID.VortexDrill, standardDrillTweaks },
{ ProjectileID.YellowCounterweight, counterweightTweaks },
#endregion
#region CATEGORY 3: True Melee support
{ ProjectileID.AdamantiteChainsaw, trueMeleeNoSpeed },
{ ProjectileID.AdamantiteDrill, trueMeleeNoSpeed },
{ ProjectileID.AdamantiteGlaive, trueMelee },
{ ProjectileID.Arkhalis, trueMeleeNoSpeed },
{ ProjectileID.ChlorophyteChainsaw, trueMeleeNoSpeed },
{ ProjectileID.ChlorophyteDrill, trueMeleeNoSpeed },
{ ProjectileID.ChlorophyteJackhammer, trueMeleeNoSpeed },
{ ProjectileID.CobaltChainsaw, trueMeleeNoSpeed },
{ ProjectileID.CobaltDrill, trueMeleeNoSpeed },
{ ProjectileID.CobaltNaginata, trueMelee },
{ ProjectileID.CopperShortswordStab, trueMelee },
{ ProjectileID.DarkLance, trueMelee },
@@ -186,45 +202,31 @@ namespace CalamityMod.Projectiles
{ ProjectileID.GoldShortswordStab, trueMelee },
{ ProjectileID.Gungnir, trueMelee },
{ ProjectileID.HallowJoustingLance, trueMelee },
{ ProjectileID.Hamdrax, trueMeleeNoSpeed }, // Drax (never internally renamed since 1.1)
{ ProjectileID.IronShortswordStab, trueMelee },
{ ProjectileID.JoustingLance, trueMelee },
{ ProjectileID.LeadShortswordStab, trueMelee },
{ ProjectileID.MushroomSpear, trueMelee },
{ ProjectileID.MythrilChainsaw, trueMeleeNoSpeed },
{ ProjectileID.MythrilDrill, trueMeleeNoSpeed },
{ ProjectileID.MythrilHalberd, trueMelee },
{ ProjectileID.NebulaChainsaw, trueMeleeNoSpeed },
{ ProjectileID.NebulaDrill, trueMeleeNoSpeed },
{ ProjectileID.ObsidianSwordfish, trueMelee },
{ ProjectileID.OrichalcumChainsaw, trueMeleeNoSpeed },
{ ProjectileID.OrichalcumDrill, trueMeleeNoSpeed },
{ ProjectileID.OrichalcumHalberd, trueMelee },
{ ProjectileID.PalladiumChainsaw, trueMeleeNoSpeed },
{ ProjectileID.PalladiumDrill, trueMeleeNoSpeed },
{ ProjectileID.PalladiumPike, trueMelee },
{ ProjectileID.PiercingStarlight, trueMelee },
{ ProjectileID.PlatinumShortswordStab, trueMelee },
{ ProjectileID.RulerStab, trueMelee },
{ ProjectileID.SawtoothShark, trueMeleeNoSpeed },
{ ProjectileID.ShadowJoustingLance, trueMelee },
{ ProjectileID.SilverShortswordStab, trueMelee },
{ ProjectileID.SolarFlareChainsaw, trueMeleeNoSpeed },
{ ProjectileID.SolarFlareDrill, trueMeleeNoSpeed },
{ ProjectileID.Spear, trueMelee },
{ ProjectileID.StardustChainsaw, trueMeleeNoSpeed },
{ ProjectileID.StardustDrill, trueMeleeNoSpeed },
{ ProjectileID.Swordfish, trueMelee },
{ ProjectileID.Terragrim, trueMeleeNoSpeed },
{ ProjectileID.TheRottedFork, trueMelee },
{ ProjectileID.TinShortswordStab, trueMelee },
{ ProjectileID.TitaniumChainsaw, trueMeleeNoSpeed },
{ ProjectileID.TitaniumDrill, trueMeleeNoSpeed },
{ ProjectileID.TitaniumTrident, trueMelee },
{ ProjectileID.Trident, trueMelee },
{ ProjectileID.TungstenShortswordStab, trueMelee },
{ ProjectileID.VortexChainsaw, trueMeleeNoSpeed },
{ ProjectileID.VortexDrill, trueMeleeNoSpeed },
#endregion
#region CATEGORY 4: Point Blank support
@@ -347,6 +349,28 @@ namespace CalamityMod.Projectiles
void ApplyTweak(Projectile proj);
}
#region Built-In Armor Penetration
internal class ArmorPenetrationDeltaRule : IProjectileTweak
{
internal readonly int delta = 0;
public ArmorPenetrationDeltaRule(int d) => delta = d;
public bool AppliesTo(Projectile proj) => true;
public void ApplyTweak(Projectile proj) => proj.ArmorPenetration += delta;
}
internal static IProjectileTweak ArmorPenetrationDelta(int d) => new ArmorPenetrationDeltaRule(d);
internal class ArmorPenetrationExactRule : IProjectileTweak
{
internal readonly int armorPen = 0;
public ArmorPenetrationExactRule(int a) => armorPen = a;
public bool AppliesTo(Projectile proj) => true;
public void ApplyTweak(Projectile proj) => proj.ArmorPenetration = armorPen;
}
internal static IProjectileTweak ArmorPenetrationExact(int a) => new ArmorPenetrationExactRule(a);
#endregion
#region Defense Damage
internal class DefenseDamageRule : IProjectileTweak
{
+1 -1
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Magic
Projectile.alpha = 255;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Magic;
Projectile.penetrate = -1;
Projectile.penetrate = 3;
Projectile.timeLeft = 600;
Projectile.tileCollide = false;
Projectile.extraUpdates = 2;
+1 -1
View File
@@ -86,7 +86,7 @@ namespace CalamityMod.Projectiles.Magic
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.ShadowFlame, 360);
target.AddBuff(BuffID.ShadowFlame, 180);
}
}
}
@@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee
public ref float OverCharge => ref Projectile.localAI[1];
private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed;
const float MaxCharge = 500;
const float MaxCharge = 360;
public Vector2 lastDisplacement;
public float dashDuration;
+1 -1
View File
@@ -27,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee
public Player Owner => Main.player[Projectile.owner];
private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed;
public const float maxShred = 750; //How much shred you get
public const float maxShred = 650; //How much shred you get
public Projectile Wheel;
public bool Dashing;
@@ -0,0 +1,288 @@
using System;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class ArcNovaDiffuserHoldout : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Ranged";
private Player Owner => Main.player[Projectile.owner];
public SlotId NovaChargeStartSlot;
public SlotId NovaChargeLoopSlot;
public float CurrentChargingFrames = 0f;
private ref float ShotsLoaded => ref Projectile.ai[1]; //arrowsloaded
private bool OwnerCanShoot => Owner.channel && !Owner.noItems && !Owner.CCed;
private float storedVelocity = 12f;
public const float velocityMultiplier = 1.2f;
public int Time = 0;
public int SoundSpamFix = 0;
public bool FirstLoop = true;
public bool ChargeLV1 = false;
public bool ChargeLV2 = false;
public float Aftershot = ArcNovaDiffuser.AftershotCooldownFrames;
public int SoundVariable = 5;
public bool NovaRing = false;
public bool ThrowItBack = false;
public float Recoil = 0;
public bool PostFireEnergy = true;
public override string Texture => "CalamityMod/Items/Weapons/Ranged/ArcNovaDiffuser";
public override void SetDefaults()
{
Projectile.width = 72;
Projectile.height = 38;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Ranged;
Projectile.ignoreWater = true;
}
public override void AI()
{
Player player = Main.player[Projectile.owner];
if (player.dead) // destroy the holdout if the player dies
{
Projectile.Kill();
return;
}
Vector2 armPosition = Owner.RotatedRelativePoint(Owner.MountedCenter, true);
Vector2 tipPosition = armPosition + Projectile.velocity * Projectile.width * 0.95f;
// Fire if the owner stops channeling or otherwise cannot use the weapon.
if (!OwnerCanShoot)
{
if (Aftershot == ArcNovaDiffuser.AftershotCooldownFrames)
{
if (SoundEngine.TryGetActiveSound(NovaChargeStartSlot, out var NovaCharge2))
NovaCharge2.Stop();
if (SoundEngine.TryGetActiveSound(NovaChargeLoopSlot, out var NovaChargeLoop2))
NovaChargeLoop2.Stop();
if (ChargeLV2) // Big Shot Mode
{
SoundEngine.PlaySound(ArcNovaDiffuser.BigShot, Projectile.position);
CurrentChargingFrames = 0;
ShotsLoaded = 0;
Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * storedVelocity;
int charge2Damage = Projectile.damage * 20;
float charge2KB = Projectile.knockBack * 3f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, shootVelocity, ModContent.ProjectileType<NovaChargeShot>(), charge2Damage, charge2KB, Projectile.owner);
Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 5;
for (int i = 0; i <= 20; i++)
{
Dust dust = Dust.NewDustPerfect(tipPosition, 107, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.2f, 1.2f), 0, default, Main.rand.NextFloat(1.5f, 2.3f));
dust.noGravity = true;
}
ThrowItBack = true;
Recoil = 10;
Aftershot -= 0.5f;
}
else //Rapid Fire Mode
{
if (SoundSpamFix >= (ChargeLV1 ? 7 : 8)) //Shoot faster if fully charged
SoundSpamFix = 0;
if (SoundSpamFix == (ChargeLV1 ? 6 : 7))//Recoil should be 1 frame lower than above frames
ThrowItBack = false;
if (ShotsLoaded <= 0f)
{
--Aftershot;
}
Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * storedVelocity;
if (SoundSpamFix == 0)
{
for (int i = 0; i <= 3; i++)
{
Dust dust = Dust.NewDustPerfect(tipPosition, 107, shootVelocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.9f, 1.2f), 0, default, Main.rand.NextFloat(1.3f, 1.7f));
dust.noGravity = true;
}
ThrowItBack = true;
Recoil = 16;
Vector2 fireVec = shootVelocity.RotatedByRandom(MathHelper.ToRadians(2f));
Projectile.NewProjectile(Projectile.GetSource_FromThis(), tipPosition, fireVec, ModContent.ProjectileType<NovaShot>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
SoundEngine.PlaySound(ArcNovaDiffuser.SmallShot, Projectile.position);
--ShotsLoaded;
}
Recoil += 1;
SoundSpamFix++;
CurrentChargingFrames = 0;
}
}
else
{
if (ChargeLV2)
{
if (Recoil >= 30)
{
ThrowItBack = false;
}
Recoil += 2;
Aftershot -= 0.5f;
}
else
--Aftershot;
}
if (ShotsLoaded == 0 && PostFireEnergy)
{
for (int i = 0; i < 6; i++)
{
SparkParticle spark2 = new SparkParticle((tipPosition - Projectile.velocity * 3) + Main.rand.NextVector2Circular(10, 10), -Projectile.velocity * Main.rand.NextFloat(9.1f, 17.8f), false, Main.rand.Next(9, 12), Main.rand.NextFloat(0.2f, 0.3f), Main.rand.NextBool(4) ? Color.Chartreuse : Color.Lime);
GeneralParticleHandler.SpawnParticle(spark2);
}
PostFireEnergy = false;
}
if (Aftershot <= 0)
Projectile.Kill();
}
else
{
if (CurrentChargingFrames == 0)
{
CurrentChargingFrames++;
}
if (CurrentChargingFrames % 13 == 0 && !ChargeLV1) //every 13 frames get another shot
ShotsLoaded++;
if (CurrentChargingFrames >= 10)
{
for (int i = 0; i < (ChargeLV2 ? 4 : ChargeLV1 ? 3 : 2); i++)
{
SparkParticle spark2 = new SparkParticle((tipPosition -Projectile.velocity * 4) + Main.rand.NextVector2Circular(12, 12), -Projectile.velocity * Main.rand.NextFloat(16.1f, 30.8f), false, Main.rand.Next(2, 7), Main.rand.NextFloat(CurrentChargingFrames / 350, CurrentChargingFrames / 270), Main.rand.NextBool(4) ? Color.Chartreuse : Color.Lime);
GeneralParticleHandler.SpawnParticle(spark2);
}
Particle orb = new GenericBloom(tipPosition, Projectile.velocity, Color.Lime, CurrentChargingFrames / 270, 2);
GeneralParticleHandler.SpawnParticle(orb);
Particle orb2 = new GenericBloom(tipPosition, Projectile.velocity, Color.White, CurrentChargingFrames / 400, 2);
GeneralParticleHandler.SpawnParticle(orb2);
}
if (CurrentChargingFrames == 10)
{
NovaChargeStartSlot = SoundEngine.PlaySound(ArcNovaDiffuser.ChargeStart, Projectile.position);
}
// Start Charging.
if (CurrentChargingFrames < ArcNovaDiffuser.Charge2Frames + 2) //308 is when you reach LV2 charge
{
if (ChargeLV1)
CurrentChargingFrames += 2;
else
CurrentChargingFrames++;
}
if (CurrentChargingFrames >= ArcNovaDiffuser.Charge1Frames) //146 frames is durration of charge sound
{
Time++;
if (CurrentChargingFrames == ArcNovaDiffuser.Charge1Frames)
{
SoundEngine.PlaySound(ArcNovaDiffuser.ChargeLV1, Projectile.position);
ShotsLoaded = 15;
ChargeLV1 = true;
}
if (FirstLoop)
{
NovaChargeLoopSlot = SoundEngine.PlaySound(ArcNovaDiffuser.ChargeLoop, Projectile.position);
FirstLoop = false;
}
if (Time % ArcNovaDiffuser.ChargeLoopSoundFrames == 0) //Loop sound is 151 frames long
{
NovaChargeLoopSlot = SoundEngine.PlaySound(ArcNovaDiffuser.ChargeLoop, Projectile.position);
}
}
if (CurrentChargingFrames >= ArcNovaDiffuser.Charge2Frames) //Stuff for reaching charge LV2
{
if (CurrentChargingFrames == ArcNovaDiffuser.Charge2Frames)
{
SoundEngine.PlaySound(ArcNovaDiffuser.ChargeLV2, Projectile.position);
ChargeLV2 = true;
}
}
if (CurrentChargingFrames == ArcNovaDiffuser.Charge1Frames)
{
for (int i = 0; i < 36; i++)
{
Dust chargefull = Dust.NewDustPerfect(tipPosition, 107);
chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 8f + Owner.velocity;
chargefull.scale = Main.rand.NextFloat(1f, 1.3f);
chargefull.noGravity = true;
}
}
if (CurrentChargingFrames == ArcNovaDiffuser.Charge2Frames)
{
for (int i = 0; i < 45; i++)
{
Dust chargefull = Dust.NewDustPerfect(tipPosition, 107);
chargefull.velocity = (MathHelper.TwoPi * i / 36f).ToRotationVector2() * 12f + Owner.velocity;
chargefull.scale = Main.rand.NextFloat(1.2f, 1.4f);
chargefull.noGravity = true;
}
}
}
if (SoundEngine.TryGetActiveSound(NovaChargeLoopSlot, out var NovaChargeLoop) && NovaChargeLoop.IsPlaying)
NovaChargeLoop.Position = Projectile.Center;
if (SoundEngine.TryGetActiveSound(NovaChargeStartSlot, out var NovaCharge) && NovaCharge.IsPlaying)
NovaCharge.Position = Projectile.Center;
UpdateProjectileHeldVariables(armPosition);
ManipulatePlayerVariables();
}
private void UpdateProjectileHeldVariables(Vector2 armPosition)
{
if (Main.myPlayer == Projectile.owner)
{
float interpolant = Utils.GetLerpValue(5f, 25f, Projectile.Distance(Main.MouseWorld), true);
Vector2 oldVelocity = Projectile.velocity;
Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(Main.MouseWorld), interpolant);
}
Player player = Main.player[Projectile.owner];
Projectile.Center = (player.RotatedRelativePoint(player.MountedCenter, true) + Projectile.velocity * (ThrowItBack ? Recoil : 30)) + new Vector2 (0, 7);
Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f);
Projectile.spriteDirection = Projectile.direction;
Projectile.timeLeft = 2;
player.ChangeDir(Projectile.direction);
player.heldProj = Projectile.whoAmI;
player.itemTime = 2;
player.itemAnimation = 2;
player.itemRotation = (float)Math.Atan2(Projectile.velocity.Y * Projectile.direction, Projectile.velocity.X * Projectile.direction);
Projectile.position += Main.rand.NextVector2Circular(CurrentChargingFrames / 70f, CurrentChargingFrames / 70f); //rumble features
}
private void ManipulatePlayerVariables()
{
Owner.ChangeDir(Projectile.direction);
Owner.heldProj = Projectile.whoAmI;
Owner.itemTime = 2;
Owner.itemAnimation = 2;
Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation();
}
public override void Kill(int timeLeft)
{
if (SoundEngine.TryGetActiveSound(NovaChargeStartSlot, out var NovaCharge))
NovaCharge.Stop();
if (SoundEngine.TryGetActiveSound(NovaChargeLoopSlot, out var NovaChargeLoop))
NovaChargeLoop.Stop();
CurrentChargingFrames = 0;
}
public override bool? CanDamage() => false;
}
}
+33 -24
View File
@@ -1,15 +1,11 @@
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Sounds;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Utilities;
using CalamityMod.Items.Accessories;
using System;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Particles;
using System;
using System.Runtime.Intrinsics;
using Microsoft.Xna.Framework;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
@@ -22,7 +18,7 @@ namespace CalamityMod.Projectiles.Ranged
public SlotId MagnaChargeFirstLoopSlot;
private float CurrentChargingFrames = 0f;
public int Fullchargesoundframes = 41;
public int Fullchargesoundframes = 42;
private ref float ShotsLoaded => ref Projectile.ai[1]; //arrowsloaded
@@ -34,7 +30,7 @@ namespace CalamityMod.Projectiles.Ranged
public int SoundSpamFix = 0;
public bool FirstLoop = true;
public bool FullCharge = false;
public int Aftershot = 30;
public int Aftershot = MagnaCannon.AftershotCooldownFrames;
public override string Texture => "CalamityMod/Items/Weapons/Ranged/MagnaCannon";
@@ -51,6 +47,13 @@ namespace CalamityMod.Projectiles.Ranged
public override void AI()
{
Player player = Main.player[Projectile.owner];
if (player.dead) // destroy the holdout if the player dies
{
Projectile.Kill();
return;
}
if (CurrentChargingFrames >= 88)
Extradamage = true;
else
@@ -62,9 +65,16 @@ namespace CalamityMod.Projectiles.Ranged
// Fire if the owner stops channeling or otherwise cannot use the weapon.
if (!OwnerCanShoot)
{
if (Aftershot == 30)
if (Aftershot == MagnaCannon.AftershotCooldownFrames)
{
if (SoundSpamFix >= (FullCharge ? 4 : 6)) //Shoot faster if fully charged
if (SoundEngine.TryGetActiveSound(MagnaChargeSlot, out var MagnaCharge2))
MagnaCharge2.Stop();
if (SoundEngine.TryGetActiveSound(MagnaChargeLoopSlot, out var MagnaChargeLoop2))
MagnaChargeLoop2.Stop();
if (SoundEngine.TryGetActiveSound(MagnaChargeLoopSlot, out var MagnaChargeFirstLoop2))
MagnaChargeFirstLoop2.Stop();
if (SoundSpamFix >= (FullCharge ? 4 : 5)) //Shoot faster if fully charged
SoundSpamFix = 0;
if (ShotsLoaded <= 0f)
@@ -99,13 +109,12 @@ namespace CalamityMod.Projectiles.Ranged
if (CurrentChargingFrames == 0)
CurrentChargingFrames++;
if (CurrentChargingFrames % 10 == 0)
if (CurrentChargingFrames % 9 == 0) //every 9 frames get another shot
ShotsLoaded++;
Player player = Main.player[Projectile.owner];
if (CurrentChargingFrames >= 10)
{
if (CurrentChargingFrames < 136)
if (CurrentChargingFrames < MagnaCannon.FullChargeFrames)
{
Particle streak = new ManaDrainStreak(player, Main.rand.NextFloat(0.06f + (CurrentChargingFrames / 180), 0.08f + (CurrentChargingFrames / 180)), Main.rand.NextVector2CircularEdge(2f, 2f) * Main.rand.NextFloat(0.3f * CurrentChargingFrames, 0.3f * CurrentChargingFrames), 0f, Color.White, Color.Aqua, 7, tipPosition);
GeneralParticleHandler.SpawnParticle(streak);
@@ -120,16 +129,16 @@ namespace CalamityMod.Projectiles.Ranged
MagnaChargeSlot = SoundEngine.PlaySound(MagnaCannon.ChargeStart, Projectile.position);
}
// Start Charging.
if (CurrentChargingFrames < 138)
if (CurrentChargingFrames < MagnaCannon.FullChargeFrames + 2)
{
++CurrentChargingFrames;
}
if (CurrentChargingFrames >= 136f) //126 frames is durration of charge sound
if (CurrentChargingFrames >= MagnaCannon.FullChargeFrames) //128 frames is durration of charge sound
{
Fullchargesoundframes--;
Time++;
if (CurrentChargingFrames == 136f)
if (CurrentChargingFrames == MagnaCannon.FullChargeFrames)
{
SoundEngine.PlaySound(MagnaCannon.ChargeFull, Projectile.position);
ShotsLoaded = 20;
@@ -142,14 +151,14 @@ namespace CalamityMod.Projectiles.Ranged
MagnaChargeFirstLoopSlot = MagnaChargeLoopSlot = SoundEngine.PlaySound(MagnaCannon.ChargeLoop, Projectile.position);
FirstLoop = false;
}
if (Time % 154 == 0)
if (Time % MagnaCannon.ChargeLoopSoundFrames == 0)
{
MagnaChargeLoopSlot = SoundEngine.PlaySound(MagnaCannon.ChargeLoop, Projectile.position);
}
}
}
if (CurrentChargingFrames == 136f)
if (CurrentChargingFrames == MagnaCannon.FullChargeFrames)
{
for (int i = 0; i < 36; i++)
{
@@ -188,7 +197,7 @@ namespace CalamityMod.Projectiles.Ranged
player.itemTime = 2;
player.itemAnimation = 2;
player.itemRotation = (float)Math.Atan2(Projectile.velocity.Y * Projectile.direction, Projectile.velocity.X * Projectile.direction);
Projectile.position += Main.rand.NextVector2Circular(CurrentChargingFrames / 30f, CurrentChargingFrames / 30f); //rumble features
Projectile.position += Main.rand.NextVector2Circular(CurrentChargingFrames / 43f, CurrentChargingFrames / 43f); //rumble features
}
+1 -1
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.DamageType = DamageClass.Ranged;
Projectile.penetrate = -1;
Projectile.penetrate = 5;
Projectile.extraUpdates = 3;
Projectile.timeLeft = 95;
Projectile.usesIDStaticNPCImmunity = true;
+1 -1
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.DamageType = DamageClass.Ranged;
Projectile.penetrate = -1;
Projectile.penetrate = 5;
Projectile.extraUpdates = 3;
Projectile.timeLeft = 95;
Projectile.usesIDStaticNPCImmunity = true;
+101
View File
@@ -0,0 +1,101 @@
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class NovaChargeShot : ModProjectile, ILocalizedModType
{
public static readonly SoundStyle ChargeImpact = new("CalamityMod/Sounds/Item/ArcNovaDiffuserChargeImpact") { Volume = 0.3f };
public int Time = 0;
public new string LocalizationCategory => "Projectiles.Ranged";
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
}
public override void SetDefaults()
{
Projectile.width = Projectile.height = 36;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.alpha = 20;
Projectile.penetrate = 1;
Projectile.timeLeft = 1200;
Projectile.DamageType = DamageClass.Ranged;
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
Projectile.extraUpdates = 24;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
}
public override void AI()
{
Time++;
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(-3, 3), 107);
dust.noGravity = true;
dust.scale = 1.2f;
if (Main.rand.NextBool(2))
{
Vector2 trailPos = Projectile.Center + Main.rand.NextVector2Circular(10, 10);
float trailScale = Main.rand.NextFloat(0.8f, 1.2f);
Color trailColor = Main.rand.NextBool(3) ? Color.Chartreuse : Color.Lime;
Particle Trail = new SparkParticle(trailPos, Projectile.velocity * 0.2f, false, 60, trailScale, trailColor);
GeneralParticleHandler.SpawnParticle(Trail);
}
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
return false;
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(50, 255, 50, Projectile.alpha);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.CursedInferno, 900);
}
public override void Kill(int timeLeft)
{
for (int i = 0; i <= 19; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, 107, new Vector2(0, -18).RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.1f, 1.9f));
dust.noGravity = false;
dust.scale = Main.rand.NextFloat(0.8f, 1.5f);
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, 107, new Vector2(0, -7).RotatedByRandom(MathHelper.ToRadians(35f)) * Main.rand.NextFloat(0.1f, 1.9f));
dust2.noGravity = false;
dust2.scale = Main.rand.NextFloat(0.8f, 1.5f);
}
SoundEngine.PlaySound(ChargeImpact, Projectile.position);
Particle pulse = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Lime, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.6f, 20);
GeneralParticleHandler.SpawnParticle(pulse);
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Chartreuse, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 0.5f, 16);
GeneralParticleHandler.SpawnParticle(pulse2);
for (int i = 0; i < 25; ++i)
{
int bloodLifetime = Main.rand.Next(22, 36);
float bloodScale = Main.rand.NextFloat(0.6f, 0.8f);
Color bloodColor = Color.Lerp(Color.Lime, Color.Chartreuse, Main.rand.NextFloat());
bloodColor = Color.Lerp(bloodColor, new Color(51, 22, 94), Main.rand.NextFloat(0.65f));
if (Main.rand.NextBool(20))
bloodScale *= 2f;
float randomSpeedMultiplier = Main.rand.NextFloat(1.25f, 2.25f);
Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 5 * randomSpeedMultiplier;
bloodVelocity.Y -= 5f;
BloodParticle blood = new BloodParticle(Projectile.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor);
GeneralParticleHandler.SpawnParticle(blood);
}
}
public override bool? CanDamage() => base.CanDamage();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

+86
View File
@@ -0,0 +1,86 @@
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
public class NovaShot : ModProjectile, ILocalizedModType
{
public bool FirstFrameNoDraw = true;
public new string LocalizationCategory => "Projectiles.Ranged";
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
}
public override void SetDefaults()
{
Projectile.width = Projectile.height = 20;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.alpha = 20;
Projectile.penetrate = -1;
Projectile.timeLeft = 300;
Projectile.DamageType = DamageClass.Ranged;
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
Projectile.extraUpdates = 3;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
}
public override void AI()
{
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
//Dust dust = Dust.NewDustPerfect(Projectile.Center, 107); // + Main.rand.NextVector2Circular(-3, 3)
//dust.noGravity = true;
//dust.scale = 0.5f;
if (Main.rand.NextBool(4))
{
Vector2 SparkVelocity1 = Projectile.velocity.RotatedBy(-3, default) * 0.1f - Projectile.velocity / 2f;
Vector2 SparkPosition1 = Projectile.velocity.RotatedBy(-0.8, default);
SparkParticle spark = new SparkParticle(Projectile.Center + SparkPosition1, SparkVelocity1, false, Main.rand.Next(4, 5), Main.rand.NextFloat(0.4f, 0.6f), Color.Lime);
GeneralParticleHandler.SpawnParticle(spark);
}
if (Main.rand.NextBool(4))
{
Vector2 SparkVelocity2 = Projectile.velocity.RotatedBy(3, default) * 0.1f - Projectile.velocity / 2f;
Vector2 SparkPosition2 = Projectile.velocity.RotatedBy(0.8, default);
SparkParticle spark2 = new SparkParticle(Projectile.Center + SparkPosition2, SparkVelocity2, false, Main.rand.Next(4, 5), Main.rand.NextFloat(0.4f, 0.6f), Main.rand.NextBool(4) ? Color.Chartreuse : Color.Lime);
GeneralParticleHandler.SpawnParticle(spark2);
}
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
return false;
}
public override Color? GetAlpha(Color lightColor)
{
return new Color(50, 255, 50, Projectile.alpha);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.CursedInferno, 90);
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
Projectile.damage = (int)(Projectile.damage * 0.88f);
if (Projectile.damage < 1)
Projectile.damage = 1;
}
public override void Kill(int timeLeft)
{
for (int i = 0; i <= 4; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.position, 107, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(15f)) * Main.rand.NextFloat(0.1f, 0.8f), 0, default, Main.rand.NextFloat(1.2f, 1.6f));
dust.noGravity = false;
}
}
public override bool? CanDamage() => base.CanDamage();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

+29 -22
View File
@@ -1,15 +1,11 @@
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Sounds;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using ReLogic.Utilities;
using CalamityMod.Items.Accessories;
using System;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Particles;
using System;
using System.Runtime.Intrinsics;
using Microsoft.Xna.Framework;
using ReLogic.Utilities;
using Terraria;
using Terraria.Audio;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Ranged
{
@@ -28,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged
public const float velocityMultiplier = 1.2f;
public bool Extradamage = false;
public int Time = 0;
public int Aftershot = 30;
public int Aftershot = OpalStriker.AftershotCooldownFrames;
public override string Texture => "CalamityMod/Items/Weapons/Ranged/OpalStriker";
@@ -45,7 +41,14 @@ namespace CalamityMod.Projectiles.Ranged
public override void AI()
{
if (CurrentChargingFrames >= 88)
Player player = Main.player[Projectile.owner];
if (player.dead) // destroy the holdout if the player dies
{
Projectile.Kill();
return;
}
if (CurrentChargingFrames >= OpalStriker.FullChargeFrames)
Extradamage = true;
else
Extradamage = false;
@@ -56,8 +59,13 @@ namespace CalamityMod.Projectiles.Ranged
// Fire if the owner stops channeling or otherwise cannot use the weapon.
if (!OwnerCanShoot)
{
if (Aftershot == 30)
if (Aftershot == OpalStriker.AftershotCooldownFrames)
{
if (SoundEngine.TryGetActiveSound(OpalChargeSlot, out var OpalCharge2))
OpalCharge2.Stop();
if (SoundEngine.TryGetActiveSound(OpalChargeLoopSlot, out var OpalChargeLoop2))
OpalChargeLoop2.Stop();
int newdamage = Projectile.damage * (Extradamage ? 6 : 1);
OpalChargeShotSlot = SoundEngine.PlaySound(Extradamage ? OpalStriker.ChargedFire : OpalStriker.Fire, Projectile.position);
CurrentChargingFrames = 0;
@@ -84,10 +92,9 @@ namespace CalamityMod.Projectiles.Ranged
}
else
{
Player player = Main.player[Projectile.owner];
if (CurrentChargingFrames >= 10)
{
if (CurrentChargingFrames < 88)
if (CurrentChargingFrames < OpalStriker.FullChargeFrames)
{
Particle streak = new ManaDrainStreak(player, Main.rand.NextFloat(0.06f + (CurrentChargingFrames / 180), 0.08f + (CurrentChargingFrames / 180)), Main.rand.NextVector2CircularEdge(2f, 2f) * Main.rand.NextFloat(0.3f * CurrentChargingFrames, 0.3f * CurrentChargingFrames), 0f, Color.Gold, Color.Orange, 7, tipPosition);
GeneralParticleHandler.SpawnParticle(streak);
@@ -102,21 +109,21 @@ namespace CalamityMod.Projectiles.Ranged
OpalChargeSlot = SoundEngine.PlaySound(OpalStriker.Charge, Projectile.position);
}
// Start Charging.
if (CurrentChargingFrames < 90)
if (CurrentChargingFrames < OpalStriker.FullChargeFrames + 2)
++CurrentChargingFrames;
if (CurrentChargingFrames >= 88f) //78 frames is durration of charge sound
if (CurrentChargingFrames >= OpalStriker.FullChargeFrames) //78 frames is durration of charge sound
{
Time++;
if (CurrentChargingFrames == 88f)
if (CurrentChargingFrames == OpalStriker.FullChargeFrames)
OpalChargeLoopSlot = SoundEngine.PlaySound(OpalStriker.ChargeLoop, Projectile.position);
if (Time % 120 == 0)
if (Time % OpalStriker.ChargeLoopSoundFrames == 0)
{
OpalChargeLoopSlot = SoundEngine.PlaySound(OpalStriker.ChargeLoop, Projectile.position);
}
}
if (CurrentChargingFrames == 88f)
if (CurrentChargingFrames == OpalStriker.FullChargeFrames)
{
for (int i = 0; i < 36; i++)
{
@@ -146,7 +153,7 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.SafeDirectionTo(Main.MouseWorld), interpolant);
}
Player player = Main.player[Projectile.owner];
Projectile.Center = player.RotatedRelativePoint(player.MountedCenter, true) + Projectile.velocity * 15;
Projectile.Center = (player.RotatedRelativePoint(player.MountedCenter, true) + Projectile.velocity * 15) + new Vector2(0, 3);
Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f);
Projectile.spriteDirection = Projectile.direction;
Projectile.timeLeft = 2;
+1 -1
View File
@@ -120,7 +120,7 @@ namespace CalamityMod.Projectiles.Ranged
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (target.Calamity().pFlames > 0)
if (target.Calamity().pFlames > 0 && Projectile.ai[1] != 1)
modifiers.SetCrit();
}
+167
View File
@@ -0,0 +1,167 @@
using CalamityMod.Particles;
using CalamityMod.Items.Weapons.Ranged;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
using System;
namespace CalamityMod.Projectiles.Ranged
{
public class SpeedBlasterShot : ModProjectile, ILocalizedModType
{
public bool FirstFrameSettings = true;
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Projectiles/Ranged/SpeedBlasterShot";
public ref float ColorValue => ref Main.player[Projectile.owner].Calamity().ColorValue;
public static readonly SoundStyle ShotImpact = new("CalamityMod/Sounds/Item/SplatshotImpact") { PitchVariance = 0.3f, Volume = 2.5f };
public static readonly SoundStyle ShotImpactBig = new("CalamityMod/Sounds/Item/SplatshotBigImpact") { PitchVariance = 0.3f, Volume = 4f };
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 12;
ProjectileID.Sets.TrailingMode[Projectile.type] = 1;
}
public static int DashShot = 3; //used with projectile.ai[1] to fire the big shot
public static int PostDashShot = 2; //used with projectile.ai[1] to fire the higher velocity post dash shots
public bool FirstHit = true;
public override void SetDefaults()
{
Projectile.width = Projectile.height = 10;
Projectile.friendly = true;
Projectile.alpha = 0;
Projectile.penetrate = 1;
Projectile.extraUpdates = 1;
Projectile.timeLeft = 300;
Projectile.DamageType = DamageClass.Ranged;
Projectile.Calamity().pointBlankShotDuration = CalamityGlobalProjectile.DefaultPointBlankDuration;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 50;
}
public override void AI()
{
ColorValue = Projectile.ai[0];
if (Projectile.ai[1] == DashShot)
{
if (FirstFrameSettings)
{
Projectile.penetrate = 4;
Projectile.extraUpdates = 28;
Projectile.timeLeft = 1500;
Projectile.Size *= 2f;
FirstFrameSettings = false;
}
}
else if (Projectile.ai[1] == PostDashShot)
Projectile.extraUpdates = 2;
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Projectile.velocity *= (Projectile.ai[1] == DashShot ? 1f : Projectile.ai[1] == PostDashShot ? 0.985f : 0.97f);
Projectile.velocity.Y += (Projectile.ai[1] == DashShot ? 0f : Projectile.ai[1] == PostDashShot ? 0.19f : 0.28f);
Color ColorUsed = (Projectile.ai[0] == 0 ? Color.Aqua : Projectile.ai[0] == 1 ? Color.Blue : Projectile.ai[0] == 2 ? Color.Fuchsia : Projectile.ai[0] == 3 ? Color.Lime : Projectile.ai[0] == 4 ? Color.Yellow : Color.White);
if (Main.rand.NextBool(20) && Projectile.ai[1] != DashShot)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, 192);
dust.noLight = true;
dust.noGravity = false;
dust.scale = 1.2f;
dust.velocity = new Vector2(Main.rand.Next(-1, 1), 3);
dust.color = ColorUsed;
dust.alpha = 75;
}
if (Projectile.ai[1] == DashShot)
{
Dust dust2 = Dust.NewDustPerfect(Projectile.Center + new Vector2(Main.rand.Next(-5, 5), Main.rand.Next(-5, 5)), 279);
dust2.noLightEmittence = true;
dust2.noGravity = true;
dust2.scale = Main.rand.NextFloat(2.5f, 3.8f);
dust2.velocity = Vector2.Zero;
dust2.color = ColorUsed;
dust2.alpha = 15;
for (int i = 0; i <= 2; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, 192);
dust.noLight = true;
dust.noGravity = false;
dust.scale = Main.rand.NextFloat(1.3f, 1.5f);
dust.velocity = new Vector2(Main.rand.Next(-1, 1), Main.rand.Next(0, 8)).RotatedByRandom(MathHelper.ToRadians(10f)) * Main.rand.NextFloat(0.05f, 0.3f);
dust.color = ColorUsed;
dust.alpha = Main.rand.Next(145, 240);
}
}
if (Projectile.timeLeft == 300 && Projectile.ai[1] == DashShot)
{
for (int i = 0; i <= 10; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, 192, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(30f)) * Main.rand.NextFloat(0.4f, 1.2f));
dust.noGravity = true;
dust.color = ColorUsed;
dust.alpha = Main.rand.Next(40, 90);
dust.scale = Main.rand.NextFloat(1.2f, 2.3f);
dust.noLight = true;
}
}
if (Projectile.timeLeft == 300 && Projectile.ai[1] != DashShot)
{
for (int i = 0; i <= 7; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, 192, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(Projectile.ai[1] == PostDashShot ? 13f : 23f)) * Main.rand.NextFloat(0.4f, 1.2f));
dust.noGravity = true;
dust.color = ColorUsed;
dust.alpha = Main.rand.Next(40, 90);
dust.scale = Main.rand.NextFloat(0.7f, 1.6f);
dust.noLight = true;
}
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
Color ColorUsed = (Projectile.ai[0] == 0 ? Color.Aqua : Projectile.ai[0] == 1 ? Color.Blue : Projectile.ai[0] == 2 ? Color.Fuchsia : Projectile.ai[0] == 3 ? Color.Lime : Projectile.ai[0] == 4 ? Color.Yellow : Color.White);
if (Projectile.ai[1] == DashShot)
{
if (FirstHit)
{
FirstHit = false;
SoundEngine.PlaySound(ShotImpactBig, Projectile.position);
}
for (int i = 0; i < 2; i++)
{
CritSpark spark = new CritSpark(Projectile.Center, Vector2.Zero, Color.White, ColorUsed, 5.5f, 7, 10f, 4.5f);
GeneralParticleHandler.SpawnParticle(spark);
}
}
}
public override void Kill(int timeLeft)
{
if (Projectile.ai[1] != DashShot)
SoundEngine.PlaySound(ShotImpact, Projectile.position);
for (int i = 0; i <= 8; i++)
{
Color ColorUsed = (Projectile.ai[0] == 0 ? Color.Aqua : Projectile.ai[0] == 1 ? Color.Blue : Projectile.ai[0] == 2 ? Color.Fuchsia : Projectile.ai[0] == 3 ? Color.Lime : Projectile.ai[0] == 4 ? Color.Yellow : Color.White);
Dust dust = Dust.NewDustPerfect(Projectile.position, 192, Projectile.velocity.RotatedByRandom(MathHelper.ToRadians(20f)) * Main.rand.NextFloat(0.05f, 0.3f), 0, default, Main.rand.NextFloat(0.6f, 1.2f));
dust.noLight = true;
dust.noGravity = false;
dust.color = ColorUsed;
dust.alpha = 75;
}
}
public override Color? GetAlpha(Color drawColor)
{
Color ColorUsed = (Projectile.ai[0] == 0 ? Color.Aqua : Projectile.ai[0] == 1 ? Color.Blue : Projectile.ai[0] == 2 ? Color.Fuchsia : Projectile.ai[0] == 3 ? Color.Lime : Projectile.ai[0] == 4 ? Color.Yellow : Color.White);
Color lightColor = ColorUsed * drawColor.A;
return lightColor * Projectile.Opacity;
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 2);
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

+1 -1
View File
@@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Rogue
{
Vector2 SparkVelocity1 = Projectile.velocity.RotatedBy(-3, default) * 0.1f - Projectile.velocity / 2f;
Vector2 SparkPosition1 = Projectile.velocity.RotatedBy(-0.8, default);
SparkParticle spark = new SparkParticle(Projectile.Center + SparkPosition1, SparkVelocity1, false, Main.rand.Next(12, 15), Main.rand.NextFloat(0.6f, 0.8f), Color.Plum);
SparkParticle spark = new SparkParticle(Projectile.Center + SparkPosition1, SparkVelocity1, false, Main.rand.Next(6, 8), Main.rand.NextFloat(0.6f, 0.8f), Color.Plum);
GeneralParticleHandler.SpawnParticle(spark);
}
+50 -46
View File
@@ -5,6 +5,11 @@ using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Particles;
using Terraria.Graphics.Shaders;
using Microsoft.Xna.Framework.Graphics;
using CalamityMod.Dusts;
using Microsoft.CodeAnalysis;
namespace CalamityMod.Projectiles.Rogue
{
@@ -15,27 +20,27 @@ namespace CalamityMod.Projectiles.Rogue
public override void SetStaticDefaults()
{
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 8;
ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
}
public override void SetDefaults()
{
Projectile.width = 60;
Projectile.height = 60;
Projectile.width = 100;
Projectile.height = 100;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.penetrate = -1;
Projectile.extraUpdates = 2;
Projectile.timeLeft = Projectile.MaxUpdates * 90;
Projectile.timeLeft = Projectile.MaxUpdates * 120;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 18; // can't hit too fast, but can hit many many times
Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 9; // can't hit too fast, but can hit many many times
Projectile.DamageType = RogueDamageClass.Instance;
}
public override void AI()
{
Projectile.rotation += 0.4f;
if (Projectile.soundDelay == 0)
{
Projectile.soundDelay = 8;
@@ -55,20 +60,20 @@ namespace CalamityMod.Projectiles.Rogue
// Initial homing before landing a hit.
else
CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 12f, 14f);
CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 14f, 14f);
}
// Homing after landing a hit. This homing repeatedly turns on and off.
else
{
float homingRange = 700f;
float homingRange = 1100f; //tbh 700 works for fat targets but then we'll get so many bug reports cuz it doesnt work on dummies
bool noHomingThisFrame = false;
if (Projectile.ai[0] == 1f)
{
Projectile.ai[1] += 1f;
if (Projectile.ai[1] > 40f)
if (Projectile.ai[1] > 30f)
{
Projectile.ai[1] = 1f;
Projectile.ai[1] = 0f;
Projectile.ai[0] = 0f;
Projectile.netUpdate = true;
}
@@ -81,87 +86,86 @@ namespace CalamityMod.Projectiles.Rogue
Vector2 homingTarget = Projectile.Center;
bool foundTarget = false;
Vector2 targetVelocity = new Vector2(0f);
for (int i = 0; i < Main.maxNPCs; i++)
{
NPC nPC2 = Main.npc[i];
if (nPC2.CanBeChasedBy(Projectile, false))
NPC potentialTarget = Main.npc[i];
if (potentialTarget.CanBeChasedBy(Projectile, false) && Projectile.WithinRange(Main.npc[i].Center, homingRange))
{
float npcDist = Vector2.Distance(nPC2.Center, Projectile.Center);
if (!foundTarget)
{
homingRange = npcDist;
homingTarget = nPC2.Center;
homingRange = Vector2.Distance(Projectile.Center, potentialTarget.Center);
homingTarget = potentialTarget.Center;
targetVelocity = potentialTarget.velocity;
foundTarget = true;
break;
}
}
}
if (foundTarget && Projectile.ai[0] == 0f)
{
Vector2 delta = homingTarget - Projectile.Center;
float distance = delta.Length();
delta /= distance;
if (distance > 200f)
{
float homingScalar = 11f;
delta *= homingScalar;
Projectile.velocity = (Projectile.velocity * 40f + delta) / 41f;
}
bool perfectAim = Main.rand.NextBool(3);
if (perfectAim)
Projectile.velocity = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, homingTarget, targetVelocity, Main.rand.NextFloat(18f, 20f));
else
{
float homingScalar = 3.6f;
delta *= -homingScalar; // yes this is intentionally backwards
Projectile.velocity = (Projectile.velocity * 40f + delta) / 41f;
float angularTurnSpeed = 0.35f;
float angleToTargetCoords = Projectile.AngleTo(homingTarget);
Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(angleToTargetCoords, angularTurnSpeed).ToRotationVector2() * Main.rand.NextFloat(18f, 20f);
}
}
if (Projectile.ai[1] > 0f)
{
Projectile.ai[1] += (float)Main.rand.Next(1, 4);
}
if (Projectile.ai[1] > 40f)
Projectile.ai[1] += (float)Main.rand.Next(1, 5);
if (Projectile.ai[1] > 30f)
{
Projectile.ai[1] = 0f;
Projectile.netUpdate = true;
}
if (Projectile.ai[0] == 0f)
{
if (Projectile.ai[1] == 0f && foundTarget && homingRange < 500f)
{
Projectile.ai[1] += 1f;
if (Main.myPlayer == Projectile.owner)
{
Projectile.ai[0] = 1f;
Vector2 value20 = homingTarget - Projectile.Center;
value20.Normalize();
Projectile.velocity = value20 * 8f;
Projectile.netUpdate = true;
}
}
}
}
Projectile.rotation += 0.3f;
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
if (Projectile.ai[0] == 1)
{
//Glowing
Main.spriteBatch.EnterShaderRegion();
GameShaders.Misc["CalamityMod:BasicTint"].UseColor(Main.hslToRgb(1.64f, 0.8f, 0.5f)); //Using RGB directly fails, gotta use HSL
float opacityFactor = Projectile.ai[1] - 5;
if (opacityFactor < 0f)
opacityFactor = 0f;
GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(opacityFactor / 40f);
GameShaders.Misc["CalamityMod:BasicTint"].Apply();
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
Main.spriteBatch.ExitShaderRegion();
}
else
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
return false;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<CrushDepth>(), 180);
//target.AddBuff(ModContent.BuffType<Irradiated>(), 180);
target.AddBuff(ModContent.BuffType<SulphuricPoisoning>(), 180);
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
target.AddBuff(ModContent.BuffType<CrushDepth>(), 180);
//target.AddBuff(ModContent.BuffType<Irradiated>(), 180);
target.AddBuff(ModContent.BuffType<SulphuricPoisoning>(), 180);
}
@@ -176,7 +180,7 @@ namespace CalamityMod.Projectiles.Rogue
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
for (int num621 = 0; num621 < 5; num621++)
{
int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
@@ -186,10 +190,10 @@ namespace CalamityMod.Projectiles.Rogue
}
for (int num623 = 0; num623 < 8; num623++)
{
int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 3f);
int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 33, 0f, 0f, 100, default, 2f);
num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, (int)CalamityDusts.SulfurousSeaAcid, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
}
}
-232
View File
@@ -1,232 +0,0 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class BloodClotMinion : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override void SetStaticDefaults()
{
ProjectileID.Sets.MinionSacrificable[Projectile.type] = true;
ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true;
Main.projFrames[Projectile.type] = 4;
}
public override void SetDefaults()
{
Projectile.width = 36;
Projectile.height = 36;
Projectile.netImportant = true;
Projectile.friendly = true;
Projectile.minionSlots = 1;
Projectile.timeLeft = 18000;
Projectile.penetrate = -1;
Projectile.timeLeft *= 5;
Projectile.minion = true;
Projectile.tileCollide = false;
Projectile.MaxUpdates = 3;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = Projectile.MaxUpdates * 30;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
Player player = Main.player[Projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
if (Projectile.localAI[0] == 0f)
{
int num226 = 36;
for (int num227 = 0; num227 < num226; num227++)
{
Vector2 vector6 = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f;
vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + Projectile.Center;
Vector2 vector7 = vector6 - Projectile.Center;
int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 5, vector7.X * 1.5f, vector7.Y * 1.5f, 100, default, 1.4f);
Main.dust[num228].noGravity = true;
Main.dust[num228].noLight = true;
Main.dust[num228].velocity = vector7;
}
Projectile.localAI[0] += 1f;
}
int num1262 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 5, 0f, 0f, 0, default, 1f);
Main.dust[num1262].velocity *= 0.1f;
Main.dust[num1262].scale = 0.7f;
Main.dust[num1262].noGravity = true;
Projectile.frameCounter++;
if (Projectile.frameCounter > 5)
{
Projectile.frame++;
Projectile.frameCounter = 0;
}
if (Projectile.frame > 3)
{
Projectile.frame = 0;
}
bool flag64 = Projectile.type == ModContent.ProjectileType<BloodClotMinion>();
player.AddBuff(ModContent.BuffType<BloodClot>(), 3600);
if (flag64)
{
if (player.dead)
{
modPlayer.bClot = false;
}
if (modPlayer.bClot)
{
Projectile.timeLeft = 2;
}
}
Projectile.MinionAntiClump();
float num535 = Projectile.position.X;
float num536 = Projectile.position.Y;
float num537 = 1300f;
bool flag19 = false;
int num538 = 1100;
if (Projectile.ai[1] != 0f)
{
num538 = 1800;
}
if (Math.Abs(Projectile.Center.X - player.Center.X) + Math.Abs(Projectile.Center.Y - player.Center.Y) > (float)num538)
{
Projectile.ai[0] = 1f;
}
if (Projectile.ai[0] == 0f)
{
if (player.HasMinionAttackTargetNPC)
{
NPC npc = Main.npc[player.MinionAttackTargetNPC];
if (npc.CanBeChasedBy(Projectile, false))
{
float num539 = npc.position.X + (float)(npc.width / 2);
float num540 = npc.position.Y + (float)(npc.height / 2);
float num541 = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - num539) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - num540);
if (num541 < num537 && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height))
{
num535 = num539;
num536 = num540;
flag19 = true;
}
}
}
if (!flag19)
{
for (int num542 = 0; num542 < Main.maxNPCs; num542++)
{
if (Main.npc[num542].CanBeChasedBy(Projectile, false))
{
float num543 = Main.npc[num542].position.X + (float)(Main.npc[num542].width / 2);
float num544 = Main.npc[num542].position.Y + (float)(Main.npc[num542].height / 2);
float num545 = Math.Abs(Projectile.position.X + (float)(Projectile.width / 2) - num543) + Math.Abs(Projectile.position.Y + (float)(Projectile.height / 2) - num544);
if (num545 < num537 && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[num542].position, Main.npc[num542].width, Main.npc[num542].height))
{
num537 = num545;
num535 = num543;
num536 = num544;
flag19 = true;
}
}
}
}
}
if (!flag19)
{
float num546 = 8f;
if (Projectile.ai[0] == 1f)
{
num546 = 12f;
}
Vector2 vector42 = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f);
float num547 = player.Center.X - vector42.X;
float num548 = player.Center.Y - vector42.Y - 60f;
float num549 = (float)Math.Sqrt((double)(num547 * num547 + num548 * num548));
if (num549 < 100f && Projectile.ai[0] == 1f && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height))
{
Projectile.ai[0] = 0f;
}
if (num549 > 2000f)
{
Projectile.position.X = player.Center.X - (float)(Projectile.width / 2);
Projectile.position.Y = player.Center.Y - (float)(Projectile.width / 2);
}
if (num549 > 70f)
{
num549 = num546 / num549;
num547 *= num549;
num548 *= num549;
Projectile.velocity.X = (Projectile.velocity.X * 20f + num547) / 21f;
Projectile.velocity.Y = (Projectile.velocity.Y * 20f + num548) / 21f;
}
else
{
if (Projectile.velocity.X == 0f && Projectile.velocity.Y == 0f)
{
Projectile.velocity.X = -0.15f;
Projectile.velocity.Y = -0.05f;
}
Projectile.velocity *= 1.01f;
}
Projectile.rotation = Projectile.velocity.X * 0.05f;
if ((double)Math.Abs(Projectile.velocity.X) > 0.2)
{
Projectile.spriteDirection = -Projectile.direction;
return;
}
}
else
{
if (Projectile.ai[1] == -1f)
{
Projectile.ai[1] = 11f;
}
if (Projectile.ai[1] > 0f)
{
Projectile.ai[1] -= 1f;
}
if (Projectile.ai[1] == 0f)
{
float num550 = 8f; //12
Vector2 vector43 = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f);
float num551 = num535 - vector43.X;
float num552 = num536 - vector43.Y;
float num553 = (float)Math.Sqrt((double)(num551 * num551 + num552 * num552));
if (num553 < 100f)
{
num550 = 10f; //14
}
num553 = num550 / num553;
num551 *= num553;
num552 *= num553;
Projectile.velocity.X = (Projectile.velocity.X * 40f + num551) / 41f;
Projectile.velocity.Y = (Projectile.velocity.Y * 40f + num552) / 41f;
}
else
{
if (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) < 10f)
{
Projectile.velocity *= 1.05f;
}
}
Projectile.rotation = Projectile.velocity.X * 0.05f;
if ((double)Math.Abs(Projectile.velocity.X) > 0.2)
{
Projectile.spriteDirection = -Projectile.direction;
return;
}
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<BurningBlood>(), 120);
Projectile.ai[1] = -1f;
Projectile.netUpdate = true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

-153
View File
@@ -1,153 +0,0 @@
using CalamityMod.Buffs.DamageOverTime;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Summon
{
public class CalamariInk : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override void SetStaticDefaults()
{
Main.projFrames[Projectile.type] = 5;
ProjectileID.Sets.MinionShot[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.width = 14;
Projectile.height = 14;
Projectile.friendly = true;
Projectile.penetrate = 5;
Projectile.timeLeft = 180;
Projectile.minion = true;
Projectile.minionSlots = 0f;
Projectile.extraUpdates = 2;
Projectile.DamageType = DamageClass.Summon;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
}
public override void AI()
{
Projectile.frameCounter++;
if (Projectile.frameCounter > 8)
{
Projectile.frame++;
Projectile.frameCounter = 0;
}
if (Projectile.frame > 4)
{
Projectile.frame = 0;
}
Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) - MathHelper.PiOver2;
Player player = Main.player[Projectile.owner];
int targetIdx = -1;
float maxHomingRange = 400f;
bool hasHomingTarget = false;
if (player.HasMinionAttackTargetNPC)
{
NPC npc = Main.npc[player.MinionAttackTargetNPC];
if (npc.CanBeChasedBy(Projectile, false))
{
float dist = (Projectile.Center - npc.Center).Length();
if (dist < maxHomingRange)
{
targetIdx = player.MinionAttackTargetNPC;
maxHomingRange = dist;
hasHomingTarget = true;
}
}
}
else if (Main.npc[(int)Projectile.ai[0]].active && Projectile.ai[0] != -1f)
{
NPC npc = Main.npc[(int)Projectile.ai[0]];
if (npc.CanBeChasedBy(Projectile, false))
{
float dist = (Projectile.Center - npc.Center).Length();
if (dist < maxHomingRange)
{
targetIdx = (int)Projectile.ai[0];
maxHomingRange = dist;
hasHomingTarget = true;
}
}
}
if (!hasHomingTarget)
{
for (int i = 0; i < Main.npc.Length; ++i)
{
NPC npc = Main.npc[i];
if (npc is null || !npc.active)
continue;
if (npc.CanBeChasedBy(Projectile, false))
{
float dist = (Projectile.Center - npc.Center).Length();
if (dist < maxHomingRange)
{
targetIdx = i;
maxHomingRange = dist;
hasHomingTarget = true;
}
}
}
}
// Home in on said closest NPC.
if (hasHomingTarget)
{
NPC target = Main.npc[targetIdx];
Vector2 homingVector = (target.Center - Projectile.Center).SafeNormalize(Vector2.Zero) * 10f;
float homingRatio = 20f;
Projectile.velocity = (Projectile.velocity * homingRatio + homingVector) / (homingRatio + 1f);
}
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture2D13 = ModContent.Request<Texture2D>(Texture).Value;
int num214 = texture2D13.Height / Main.projFrames[Projectile.type];
int y6 = num214 * Projectile.frame;
Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<CrushDepth>(), 180);
}
public override void Kill(int timeLeft)
{
Projectile.position = Projectile.Center;
Projectile.width = Projectile.height = 48;
Projectile.position.X = Projectile.position.X - (Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2);
SoundEngine.PlaySound(SoundID.NPCDeath28, Projectile.Center);
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 54, 0f, 0f, 100, default, 1f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 15; num623++)
{
int num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 109, 0f, 0f, 100, default, 1.5f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 109, 0f, 0f, 100, default, 1f);
Main.dust[num624].velocity *= 2f;
}
}
}
}
-359
View File
@@ -1,359 +0,0 @@
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Summon
{
public class CalamariMinion : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public override void SetStaticDefaults()
{
Main.projFrames[Projectile.type] = 5;
ProjectileID.Sets.MinionSacrificable[Projectile.type] = true;
ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.width = 40;
Projectile.height = 40;
Projectile.netImportant = true;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.minionSlots = 1f;
Projectile.timeLeft = 18000;
Projectile.penetrate = -1;
Projectile.timeLeft *= 5;
Projectile.minion = true;
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
{
if (Projectile.owner < 0 || Projectile.owner >= Main.maxPlayers)
{
Projectile.Kill();
return;
}
Player player = Main.player[Projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
// Spawn dust on frame 1
if (Projectile.localAI[1] == 0f)
{
int dustAmt = 36;
for (int i = 0; i < dustAmt; i++)
{
Vector2 spawnPos = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f;
spawnPos = spawnPos.RotatedBy((double)((float)(i - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Projectile.Center;
Vector2 velocity = spawnPos - Projectile.Center;
int idx = Dust.NewDust(spawnPos + velocity, 0, 0, 109, velocity.X * 1.5f, velocity.Y * 1.5f, 100, default, 1.4f);
Main.dust[idx].noGravity = true;
Main.dust[idx].noLight = true;
Main.dust[idx].velocity = velocity;
}
Projectile.localAI[1] += 1f;
}
// Update frames
Projectile.frameCounter++;
if (Projectile.frameCounter > 8)
{
Projectile.frame++;
Projectile.frameCounter = 0;
}
if (Projectile.frame > 4)
{
Projectile.frame = 0;
}
// Update buffs and player bools
bool isMinion = Projectile.type == ModContent.ProjectileType<CalamariMinion>();
player.AddBuff(ModContent.BuffType<Calamari>(), 3600);
if (isMinion)
{
if (player.dead)
{
modPlayer.calamari = false;
}
if (modPlayer.calamari)
{
Projectile.timeLeft = 2;
}
}
// Randomly make noise
if (Main.rand.NextBool(600))
{
SoundEngine.PlaySound(SoundID.Zombie35, Projectile.position);
}
if (Projectile.ai[0] == 2f)
{
Projectile.ai[1] -= 1f;
if (Projectile.ai[1] > 3f)
{
SoundEngine.PlaySound(SoundID.Zombie34, Projectile.position);
int num = Dust.NewDust(Projectile.Center, 0, 0, 109, Projectile.velocity.X, Projectile.velocity.Y, 100, default, 1.4f);
Main.dust[num].scale = 0.5f + (float)Main.rand.NextDouble() * 0.3f;
Main.dust[num].velocity /= 2.5f;
Main.dust[num].noGravity = true;
Main.dust[num].noLight = true;
}
if (Projectile.ai[1] != 0f)
{
return;
}
Projectile.ai[1] = 15f;
Projectile.ai[0] = 0f;
Projectile.velocity /= 5f;
Projectile.velocity.Y = 0f;
Projectile.extraUpdates = 0;
Projectile.numUpdates = 0;
Projectile.netUpdate = true;
Projectile.extraUpdates = 0;
Projectile.numUpdates = 0;
}
if (Projectile.extraUpdates > 1)
{
Projectile.extraUpdates = 0;
}
if (Projectile.numUpdates > 1)
{
Projectile.numUpdates = 0;
}
if (Projectile.localAI[0] > 0f)
{
Projectile.localAI[0] -= 1f;
}
// Prevent clumping
Projectile.MinionAntiClump();
// Find a target
Vector2 shootPosition = Projectile.position;
float range = 3500f;
bool foundTarget = false;
Vector2 center = player.Center;
Vector2 half = new Vector2(0.5f);
half.Y = 0f;
int targetIndex = -1;
if (player.HasMinionAttackTargetNPC)
{
NPC npc = Main.npc[player.MinionAttackTargetNPC];
if (npc.CanBeChasedBy(Projectile, false))
{
Vector2 npcPos = npc.position + npc.Size * half;
float npcDist = Vector2.Distance(npcPos, center);
if (!foundTarget && npcDist < range && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height))
{
shootPosition = npcPos;
foundTarget = true;
targetIndex = npc.whoAmI;
}
}
}
if (!foundTarget)
{
for (int k = 0; k < Main.maxNPCs; k++)
{
NPC npc = Main.npc[k];
if (npc.CanBeChasedBy(Projectile, false))
{
Vector2 npcPos = npc.position + npc.Size * half;
float npcDist = Vector2.Distance(npcPos, center);
if (!foundTarget && npcDist < range && Collision.CanHitLine(Projectile.position, Projectile.width, Projectile.height, npc.position, npc.width, npc.height))
{
range = npcDist;
shootPosition = npcPos;
foundTarget = true;
targetIndex = k;
}
}
}
}
// Return to the player when far away
int returnDist = 3500;
if (foundTarget)
{
returnDist = 4000;
}
if (Vector2.Distance(player.Center, Projectile.Center) > returnDist)
{
Projectile.ai[0] = 1f;
Projectile.netUpdate = true;
}
// Position towards the target
if (foundTarget && Projectile.ai[0] == 0f)
{
Vector2 shootDir = shootPosition - Projectile.Center;
shootDir.Normalize();
shootDir = shootPosition - Vector2.UnitY * 80f;
int tileY = (int)shootDir.Y / 16;
if (tileY < 0)
{
tileY = 0;
}
Tile tile = Main.tile[(int)shootDir.X / 16, tileY];
if (tile != null && tile.HasTile && Main.tileSolid[tile.TileType] && !Main.tileSolidTop[tile.TileType])
{
shootDir += Vector2.UnitY * 16f;
tile = Main.tile[(int)shootDir.X / 16, (int)shootDir.Y / 16];
if (tile != null && tile.HasTile && Main.tileSolid[tile.TileType] && !Main.tileSolidTop[tile.TileType])
{
shootDir += Vector2.UnitY * 16f;
}
}
shootDir -= Projectile.Center;
float distance = shootDir.Length();
shootDir.Normalize();
if (distance > 300f && distance <= 1600f && Projectile.localAI[0] == 0f)
{
Projectile.ai[0] = 2f;
Projectile.ai[1] = (int)(distance / 10f);
Projectile.extraUpdates = (int)(Projectile.ai[1] * 2f) + 1;
Projectile.velocity = shootDir * 20f;
Projectile.localAI[0] = 60f;
return;
}
if (distance > 200f)
{
float scaleFactor2 = 20f;
shootDir *= scaleFactor2;
Projectile.velocity.X = (Projectile.velocity.X * 30f + shootDir.X) / 31f;
Projectile.velocity.Y = (Projectile.velocity.Y * 30f + shootDir.Y) / 31f;
}
if (distance > 70f && distance < 130f)
{
float scaleFactor3 = 18f;
if (distance < 100f)
{
scaleFactor3 = -7.5f;
}
shootDir *= scaleFactor3;
Projectile.velocity = (Projectile.velocity * 15f + shootDir) / 16f;
if (Math.Abs(shootDir.X) > Math.Abs(shootDir.Y))
{
Projectile.velocity.X = (Projectile.velocity.X * 6f + shootDir.X) / 7f;
}
}
else
{
Projectile.velocity *= 0.99f;
}
}
// Idle Behavior
else
{
if (!Collision.CanHitLine(Projectile.Center, 1, 1, Main.player[Projectile.owner].Center, 1, 1))
{
Projectile.ai[0] = 1f;
}
float returnSpd = 12f; //6
if (Projectile.ai[0] == 1f)
{
returnSpd = 18f; //15
}
Vector2 returnPos = player.Center - Projectile.Center + new Vector2(0f, -60f);
float returnPosDist = returnPos.Length();
if (returnPosDist > 200f && returnSpd < 13.5f)
{
returnSpd = 13.5f; //9
}
if (returnPosDist < 800f && Projectile.ai[0] == 1f)
{
Projectile.ai[0] = 0f;
Projectile.netUpdate = true;
}
if (returnPosDist > 4000f)
{
Projectile.position.X = player.Center.X - (Projectile.width / 2);
Projectile.position.Y = player.Center.Y - (Projectile.width / 2);
}
if (returnPosDist > 70f)
{
returnPos.Normalize();
returnPos *= returnSpd;
Projectile.velocity = (Projectile.velocity * 20f + returnPos) / 21f;
}
else
{
if (Projectile.velocity.X == 0f && Projectile.velocity.Y == 0f)
{
Projectile.velocity.X = -0.15f;
Projectile.velocity.Y = -0.05f;
}
Projectile.velocity *= 1.01f;
}
}
// Update rotation
Projectile.rotation = Projectile.velocity.X * 0.025f;
// Update shoot cooldown
if (Projectile.ai[1] > 0f)
{
Projectile.ai[1] += 1f;
if (Main.rand.Next(2) != 0)
{
Projectile.ai[1] += 1f;
}
}
if (Projectile.ai[1] > 20f)
{
Projectile.ai[1] = 0f;
Projectile.netUpdate = true;
}
// Shoot projectiles
if (Projectile.ai[0] == 0f)
{
float inkShootSpeed = 15f;
int projID = ModContent.ProjectileType<CalamariInk>();
if (foundTarget)
{
if (Math.Abs((shootPosition - Projectile.Center).ToRotation() - MathHelper.PiOver2) > MathHelper.PiOver4)
{
Projectile.velocity += (shootPosition - Projectile.Center - Vector2.UnitY * 100f).SafeNormalize(Vector2.Zero) * 2f;
return;
}
if ((shootPosition - Projectile.Center).Length() <= 600f && Projectile.ai[1] == 0f)
{
Projectile.ai[1] += 1f;
if (Main.myPlayer == Projectile.owner)
{
SoundEngine.PlaySound(SoundID.Item111, Projectile.position);
Vector2 inkShootVelocity = Projectile.SafeDirectionTo(shootPosition, Vector2.UnitY) * inkShootSpeed;
int p = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + Vector2.UnitY * 20f, inkShootVelocity, projID, Projectile.damage, 0f, Main.myPlayer, targetIndex, 0f);
if (Main.projectile.IndexInRange(p))
Main.projectile[p].originalDamage = Projectile.originalDamage;
Projectile.netUpdate = true;
}
}
}
}
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture2D13 = ModContent.Request<Texture2D>(Texture).Value;
int num214 = texture2D13.Height / Main.projFrames[Projectile.type];
int y6 = num214 * Projectile.frame;
Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override bool? CanDamage() => false;
}
}
+229
View File
@@ -0,0 +1,229 @@
using CalamityMod.Buffs.Summon;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Projectiles.BaseProjectiles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class CalamarisLamentMinion : BaseMinionProjectile
{
public override int AssociatedProjectileTypeID => ModContent.ProjectileType<CalamarisLamentMinion>();
public override int AssociatedBuffTypeID => ModContent.BuffType<CalamarisLamentBuff>();
public override ref bool AssociatedMinionBool => ref ModdedOwner.CalamarisLament;
// Increased to be able to target DoG reliably.
public override float EnemyDistanceDetection => CalamarisLament.EnemyDistanceDetection;
// It's an Abyss-origin summon, it deserves having visibility in Abyss areas.
public override bool PreventTargettingUntilTargetHit => false;
public ref float ShootingTimer => ref Projectile.ai[0];
public enum AIState { Idle, Shooting, Latching }
public AIState State { get => (AIState)Projectile.ai[1]; set => Projectile.ai[1] = (int)value; }
public override void SetStaticDefaults()
{
base.SetStaticDefaults();
Main.projFrames[Type] = 5;
}
public override void SetDefaults()
{
base.SetDefaults();
// Half the size of one frame so it looks better while latching to a target.
Projectile.width = Projectile.height = 31;
}
public override void MinionAI()
{
// Ambient idle sounds.
if (Main.zenithWorld)
{
if (Main.rand.NextBool(750))
{
SoundEngine.PlaySound(CalamarisLament.GFB, Projectile.Center);
}
}
else
{
if (Main.rand.NextBool(600))
{
SoundStyle glubNoise = Main.rand.NextBool() ? SoundID.Zombie35 : SoundID.Zombie34;
SoundStyle trollBirdChirpingSound = SoundID.Zombie16;
// 1/200th chance to do a bird chirping sound.
SoundEngine.PlaySound(Main.rand.NextBool(200) ? trollBirdChirpingSound : glubNoise, Projectile.Center);
}
}
switch (State)
{
case AIState.Idle:
IdleState();
break;
case AIState.Shooting:
ShootingState();
break;
case AIState.Latching:
LatchingState();
break;
}
}
#region AI Methods
private void IdleState()
{
// The minion will hover around the owner.
if (!Projectile.WithinRange(Owner.Center, 320f))
{
Projectile.velocity = (Projectile.velocity + Projectile.SafeDirectionTo(Owner.Center)) * 0.9f;
SyncVariables();
}
// The minion will teleport on the owner if they get far enough.
if (!Projectile.WithinRange(Owner.Center, 1200f))
{
Projectile.Center = Owner.Center;
SyncVariables();
}
Projectile.rotation = Projectile.rotation.AngleTowards(MathHelper.ToRadians(Projectile.velocity.X * 2f), .1f);
Projectile.MinionAntiClump(0.5f);
if (Target is not null)
SwitchState(AIState.Shooting);
}
private void ShootingState()
{
if (Target is not null)
{
Vector2 toTargetDirection = Projectile.SafeDirectionTo(Target.Center);
// The minion will hover around the owner more strongly.
if (!Projectile.WithinRange(Owner.Center, 320f))
{
float inertia = 8f;
Projectile.velocity = (Projectile.velocity * inertia + Projectile.SafeDirectionTo(Owner.Center) * 25f) / (inertia + 1f);
SyncVariables();
}
// A random chance to increase the fire rate timer a bit so they're not always synced and looks nicer.
// In balance terms, this barely means anything, it's probably like a 5% DMG increase or less.
ShootingTimer += Main.rand.NextBool(30) ? 2 : 1;
if (ShootingTimer >= CalamarisLament.ShootingFireRate && Main.myPlayer == Projectile.owner)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, (toTargetDirection * (CalamarisLament.ShootingProjectileSpeed + 10f)).RotatedByRandom(MathHelper.PiOver4), ModContent.ProjectileType<CalamarisLamentProjectile>(), Projectile.damage, 1f, Projectile.owner, Target.whoAmI);
// Flavor recoil effect.
Projectile.velocity -= toTargetDirection * 3f;
// Flavor dust effect.
for (int i = 0; i < 15; i++)
{
Dust shootDust = Dust.NewDustPerfect(Projectile.Center + (Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * Projectile.height / 2, 109, toTargetDirection.RotatedByRandom(MathHelper.PiOver4) * Main.rand.NextFloat(3f, 7f), Scale: Main.rand.NextFloat(0.5f, 1.5f), Alpha: 127);
shootDust.noGravity = true;
}
SoundEngine.PlaySound(SoundID.Item111, Projectile.Center);
ShootingTimer = 0f;
SyncVariables();
}
Projectile.rotation = Projectile.rotation.AngleTowards(toTargetDirection.ToRotation() - MathHelper.PiOver2, .1f);
Projectile.MinionAntiClump(0.5f);
if (Owner.WithinRange(Target.Center, CalamarisLament.LatchingDistanceRequired))
SwitchState(AIState.Latching);
}
else
SwitchState(AIState.Idle);
}
private void LatchingState()
{
if (Target is not null)
{
Vector2 toTargetDirection = Projectile.SafeDirectionTo(Target.Center);
// If the minion is not on the target's hithox, which means they're not "latched", go to the target.
if (!Projectile.getRect().Intersects(Target.getRect()))
{
float inertia = 10f;
Projectile.velocity = (Projectile.velocity * inertia + toTargetDirection * (Target.velocity.Length() + CalamarisLament.LatchingExtraTargettingSpeed)) / (inertia + 1f);
Projectile.rotation = Projectile.rotation.AngleTowards(toTargetDirection.ToRotation() - MathHelper.PiOver2, .3f);
Projectile.MinionAntiClump(0.5f);
SyncVariables();
}
// Deaccelerate fast but not instantly stop so it doesn't bug.
else
{
Projectile.velocity *= 0.2f;
SyncVariables();
}
if (!Owner.WithinRange(Target.Center, CalamarisLament.LatchingDistanceRequired))
SwitchState(AIState.Shooting);
}
else
SwitchState(AIState.Idle);
}
private void SwitchState(AIState state)
{
State = state;
SyncVariables();
}
private void SyncVariables()
{
Projectile.netUpdate = true;
Projectile.netSpam = 0;
}
#endregion
public override void OnSpawn(IEntitySource source)
{
IFrames = 30;
int dustAmount = 40;
for (int dustIndex = 0; dustIndex < dustAmount; dustIndex++)
{
float angle = MathHelper.TwoPi / dustAmount * dustIndex;
Vector2 velocity = angle.ToRotationVector2() * 8f;
Dust spawnDust = Dust.NewDustPerfect(Projectile.Center, 109, velocity);
spawnDust.noGravity = true;
spawnDust.noLight = true;
}
}
// The minion will only have contact damage if it's on latching mode.
public override bool? CanDamage() => (State == AIState.Latching) ? null : false;
// The minion will do 1.5x damage if it's latched on.
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.SourceDamage *= CalamarisLament.LatchingDamageMultiplier;
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame);
Vector2 origin = frame.Size() * 0.5f;
Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None);
return false;
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

@@ -0,0 +1,100 @@
using CalamityMod.Items.Weapons.Summon;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class CalamarisLamentProjectile : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Summon";
public ref float TargetShotID => ref Projectile.ai[0];
public NPC TargetShot => Main.npc[(int)TargetShotID];
public override void SetStaticDefaults()
{
Main.projFrames[Type] = 5;
ProjectileID.Sets.MinionShot[Type] = true;
ProjectileID.Sets.TrailingMode[Type] = 2;
ProjectileID.Sets.TrailCacheLength[Type] = 4;
ProjectileID.Sets.DrawScreenCheckFluff[Type] = (int)CalamarisLament.EnemyDistanceDetection;
}
public override void SetDefaults()
{
Projectile.DamageType = DamageClass.Summon;
Projectile.localNPCHitCooldown = -1;
Projectile.timeLeft = 240;
Projectile.width = Projectile.height = 28;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.ignoreWater = true;
Projectile.usesLocalNPCImmunity = true;
}
public override void AI()
{
if (TargetShot is not null && TargetShot.active)
{
float inertia = 20f;
Projectile.velocity = (Projectile.velocity * inertia + Projectile.SafeDirectionTo(TargetShot.Center) * CalamarisLament.ShootingProjectileSpeed) / (inertia + 1f);
Projectile.extraUpdates = 1;
Projectile.netUpdate = true;
Projectile.netSpam = 0;
}
else
Projectile.extraUpdates = 0;
Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2;
Projectile.alpha = (int)Utils.Remap(Projectile.timeLeft, 30f, 0f, 0f, 255f);
Dust trailDust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, 109, Scale: Main.rand.NextFloat(0.5f, 0.8f), Alpha: 127);
trailDust.noGravity = true;
trailDust.noLight = true;
trailDust.alpha = (int)Utils.Remap(Projectile.timeLeft, 30f, 0f, 127f, 0f);
Projectile.frameCounter++;
if (Projectile.frameCounter >= 4)
{
Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Type];
Projectile.frameCounter = 0;
}
}
// Made for DoG so the projectile can go through segments without spamming numbers
// and hit DoG's head and/or tail reliably and without penetration.
public override bool? CanDamage() => Projectile.getRect().Intersects(TargetShot.getRect()) ? null : false;
public override void Kill(int timeLeft)
{
for (int i = 0; i < 15; i++)
{
Dust deathDust = Dust.NewDustPerfect(Projectile.Center, 109, Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedByRandom(MathHelper.PiOver4) * Main.rand.NextFloat(3f, 7f), Scale: Main.rand.NextFloat(0.5f, 1.5f), Alpha: 127);
deathDust.noGravity = true;
deathDust.noLight = true;
}
SoundEngine.PlaySound(SoundID.NPCDeath28, Projectile.Center);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame);
Vector2 origin = frame.Size() * 0.5f;
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor);
Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None);
return false;
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 607 B

After

Width:  |  Height:  |  Size: 607 B

+21 -46
View File
@@ -1,52 +1,43 @@
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using System;
using CalamityMod.Buffs.Summon;
using CalamityMod.Projectiles.BaseProjectiles;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class FleshBallMinion : ModProjectile, ILocalizedModType
public class FleshBallMinion : BaseMinionProjectile
{
public new string LocalizationCategory => "Projectiles.Summon";
public Player Owner => Main.player[Projectile.owner];
public NPC Target => Owner.Center.MinionHoming(950f, Owner, CalamityPlayer.areThereAnyDamnBosses);
public bool SittingOnGround => Math.Abs(Projectile.velocity.X) < 1.55f && Projectile.velocity.Y == 0f;
public override int AssociatedProjectileTypeID => ModContent.ProjectileType<FleshBallMinion>();
public override int AssociatedBuffTypeID => ModContent.BuffType<FleshBallBuff>();
public override ref bool AssociatedMinionBool => ref ModdedOwner.fleshBall;
public override bool PreHardmodeMinionTileVision => true;
public ref float HopTimer => ref Projectile.ai[0];
public ref float HopAmount => ref Projectile.ai[1];
public bool SittingOnGround => Math.Abs(Projectile.velocity.X) < 1.55f && Projectile.velocity.Y == 0f;
public const float Gravity = 0.25f;
public const float MaxFallSpeed = 12f;
public override void SetStaticDefaults()
{
Main.projFrames[Projectile.type] = 6;
ProjectileID.Sets.MinionSacrificable[Projectile.type] = true;
ProjectileID.Sets.MinionTargettingFeature[Projectile.type] = true;
base.SetStaticDefaults();
Main.projFrames[Type] = 6;
}
public override void SetDefaults()
{
base.SetDefaults();
Projectile.width = 46;
Projectile.height = 38;
Projectile.netImportant = true;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.minionSlots = 1f;
Projectile.timeLeft = 90000;
Projectile.penetrate = -1;
Projectile.extraUpdates = 1;
Projectile.tileCollide = false;
Projectile.minion = true;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 60;
Projectile.DamageType = DamageClass.Summon;
}
public override void AI()
public override void MinionAI()
{
ProvidePlayerMinionBuffs();
DetermineFrames();
GenerateVisuals();
HopTimer++;
@@ -58,27 +49,7 @@ namespace CalamityMod.Projectiles.Summon
EnforceGravity();
}
internal void ProvidePlayerMinionBuffs()
{
Owner.AddBuff(ModContent.BuffType<FleshBallBuff>(), 3600);
// Verify player/minion state integrity. The minion cannot stay alive if the
// owner is dead or if the caller of the AI is invalid.
if (Projectile.type != ModContent.ProjectileType<FleshBallMinion>())
return;
if (Owner.dead)
Owner.Calamity().fleshBall = false;
if (Owner.Calamity().fleshBall)
Projectile.timeLeft = 2;
}
internal void DetermineFrames()
{
Projectile.frameCounter++;
if (Projectile.frameCounter % 5 == 6)
Projectile.frame = (Projectile.frame + 1) % Main.projFrames[Projectile.type];
}
#region AI Methods
internal void EnforceGravity()
{
@@ -152,6 +123,10 @@ namespace CalamityMod.Projectiles.Summon
}
}
#endregion
public override void OnSpawn(IEntitySource source) => IFrames = 30;
// Prevent immediate death on tile collision, and slow down on tile collision.
public override bool OnTileCollide(Vector2 oldVelocity)
{
Loaded 100 of 128 files, more files were not shown because too many files have changed in this diff. Show more