internally renamed dance of light & nerfed flash
This commit is contained in:
1 parent
a1e70ed7fe
commit
c74963e9ca
7 files changed
+46
-19
No files matched your search
@@ -846,8 +846,8 @@ namespace CalamityMod.Items
|
||||
tt2.overrideColor = new Color(Main.DiscoR, 100, 255);
|
||||
if (item.type == ModContent.ItemType<BlushieStaff>())
|
||||
tt2.overrideColor = new Color(0, 0, 255);
|
||||
if (item.type == ModContent.ItemType<TheDanceofLight>())
|
||||
tt2.overrideColor = TheDanceofLight.GetSyncedLightColor();
|
||||
if (item.type == ModContent.ItemType<Judgement>())
|
||||
tt2.overrideColor = Judgement.GetSyncedLightColor();
|
||||
if (item.type == ModContent.ItemType<NanoblackReaperMelee>() || item.type == ModContent.ItemType<NanoblackReaperRogue>())
|
||||
tt2.overrideColor = new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f);
|
||||
if (item.type == ModContent.ItemType<ProfanedSoulCrystal>())
|
||||
|
||||
@@ -9,7 +9,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
public class TheDanceofLight : ModItem
|
||||
public class Judgement : ModItem
|
||||
{
|
||||
public const int HitsPerFlash = 300;
|
||||
public const int FlashBaseDamage = 80000;
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 876 B After Width: | Height: | Size: 876 B |
@@ -534,7 +534,7 @@ namespace CalamityMod
|
||||
BossDifficulty.TryGetValue("SupremeCalamitas", out float order);
|
||||
int type = NPCType<SupremeCalamitas>();
|
||||
int summon = ItemType<EyeofExtinction>();
|
||||
List<int> loot = new List<int>() { ItemType<CalamitousEssence>(), ItemType<Animus>(), ItemType<Azathoth>(), ItemType<Contagion>(), ItemType<CrystylCrusher>(), ItemType<DraconicDestruction>(), ItemType<Earth>(), ItemType<Fabstaff>(), ItemType<RoyalKnivesMelee>(), ItemType<RoyalKnives>(), ItemType<NanoblackReaperMelee>(), ItemType<NanoblackReaperRogue>(), ItemType<RedSun>(), ItemType<ScarletDevil>(), ItemType<SomaPrime>(), ItemType<BlushieStaff>(), ItemType<Svantechnical>(), ItemType<TheDanceofLight>(), ItemType<TriactisTruePaladinianMageHammerofMightMelee>(), ItemType<TriactisTruePaladinianMageHammerofMight>(), ItemType<Megafleet>(), ItemType<Endogenesis>(), ItemType<Vehemenc>(), ItemType<OmegaHealingPotion>() };
|
||||
List<int> loot = new List<int>() { ItemType<CalamitousEssence>(), ItemType<Animus>(), ItemType<Azathoth>(), ItemType<Contagion>(), ItemType<CrystylCrusher>(), ItemType<DraconicDestruction>(), ItemType<Earth>(), ItemType<Fabstaff>(), ItemType<RoyalKnivesMelee>(), ItemType<RoyalKnives>(), ItemType<NanoblackReaperMelee>(), ItemType<NanoblackReaperRogue>(), ItemType<RedSun>(), ItemType<ScarletDevil>(), ItemType<SomaPrime>(), ItemType<BlushieStaff>(), ItemType<Svantechnical>(), ItemType<Judgement>(), ItemType<TriactisTruePaladinianMageHammerofMightMelee>(), ItemType<TriactisTruePaladinianMageHammerofMight>(), ItemType<Megafleet>(), ItemType<Endogenesis>(), ItemType<Vehemenc>(), ItemType<OmegaHealingPotion>() };
|
||||
List<int> collection = new List<int>() { ItemType<KnowledgeCalamitas>(), ItemType<BrimstoneJewel>(), ItemType<Levi>() };
|
||||
string instructions = $"Use an [i:{summon}]";
|
||||
string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00));
|
||||
|
||||
@@ -2165,7 +2165,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
ModContent.ItemType<SomaPrime>(), ModContent.ItemType<SomaPrime>(),
|
||||
ModContent.ItemType<BlushieStaff>(), ModContent.ItemType<BlushieStaff>(), // Staff of Blushie
|
||||
ModContent.ItemType<Svantechnical>(), ModContent.ItemType<Svantechnical>(),
|
||||
ModContent.ItemType<TheDanceofLight>(), ModContent.ItemType<TheDanceofLight>(),
|
||||
ModContent.ItemType<Judgement>(), ModContent.ItemType<Judgement>(),
|
||||
ModContent.ItemType<TriactisTruePaladinianMageHammerofMightMelee>(), ModContent.ItemType<TriactisTruePaladinianMageHammerofMight>(),
|
||||
ModContent.ItemType<Megafleet>(), ModContent.ItemType<Megafleet>(), // Voidragon
|
||||
ModContent.ItemType<Endogenesis>(), ModContent.ItemType<Endogenesis>(),
|
||||
|
||||
@@ -30,10 +30,10 @@ namespace CalamityMod.Projectiles.Magic
|
||||
|
||||
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
|
||||
{
|
||||
float dist1 = Vector2.Distance(projectile.Center, targetHitbox.TopLeft());
|
||||
float dist2 = Vector2.Distance(projectile.Center, targetHitbox.TopRight());
|
||||
float dist3 = Vector2.Distance(projectile.Center, targetHitbox.BottomLeft());
|
||||
float dist4 = Vector2.Distance(projectile.Center, targetHitbox.BottomRight());
|
||||
float dist1 = projectile.Distance(targetHitbox.TopLeft());
|
||||
float dist2 = projectile.Distance(targetHitbox.TopRight());
|
||||
float dist3 = projectile.Distance(targetHitbox.BottomLeft());
|
||||
float dist4 = projectile.Distance(targetHitbox.BottomRight());
|
||||
|
||||
float minDist = dist1;
|
||||
if (dist2 < minDist)
|
||||
@@ -51,7 +51,10 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.timeLeft == Lifetime)
|
||||
{
|
||||
ConsumeNearbyBlades();
|
||||
DivideDamageAmongstTargets();
|
||||
}
|
||||
|
||||
projectile.ai[0]++;
|
||||
float progress = (float)Math.Sin(projectile.ai[0] / Lifetime * MathHelper.Pi);
|
||||
@@ -66,22 +69,46 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Filters.Scene["CalamityMod:LightBurst"].GetShader().UseProgress(progress);
|
||||
}
|
||||
}
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
Filters.Scene.Deactivate("CalamityMod:LightBurst");
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft) => Filters.Scene.Deactivate("CalamityMod:LightBurst");
|
||||
|
||||
private void ConsumeNearbyBlades()
|
||||
{
|
||||
int lightBlade = ModContent.ProjectileType<LightBlade>();
|
||||
int extraDamage = 0;
|
||||
for (int i = 0; i < Main.maxProjectiles; ++i)
|
||||
{
|
||||
Projectile otherProj = Main.projectile[i];
|
||||
if (otherProj is null || !otherProj.active || otherProj.owner != projectile.owner || otherProj.type != lightBlade)
|
||||
continue;
|
||||
|
||||
projectile.damage += otherProj.damage;
|
||||
// Can only consume blades within the flash radius (which should be most if not all of them anyway)
|
||||
if (projectile.Distance(otherProj.Center) > Radius)
|
||||
continue;
|
||||
extraDamage += otherProj.damage / 2;
|
||||
otherProj.Kill();
|
||||
}
|
||||
}
|
||||
projectile.damage += extraDamage;
|
||||
}
|
||||
|
||||
private void DivideDamageAmongstTargets()
|
||||
{
|
||||
int numTargets = 0;
|
||||
for(int i = 0; i < Main.maxNPCs; ++i)
|
||||
{
|
||||
NPC npc = Main.npc[i];
|
||||
if (npc is null || !npc.active || npc.friendly || npc.dontTakeDamage || npc.immortal)
|
||||
continue;
|
||||
if (projectile.Colliding(default, npc.Hitbox))
|
||||
++numTargets;
|
||||
}
|
||||
|
||||
// The number of targets is minimum one to prevent dividing by zero.
|
||||
if (numTargets <= 0)
|
||||
numTargets = 1;
|
||||
|
||||
// Divide damage by the square root of nearby targets. 25 targets = 1/5th damage, for example.
|
||||
projectile.damage = (int)(projectile.damage / Math.Sqrt(numTargets));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = 3;
|
||||
projectile.penetrate = 2;
|
||||
projectile.extraUpdates = 2;
|
||||
projectile.timeLeft = Lifetime;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
@@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
// Pick a random sword sprite and a random color to use.
|
||||
projectile.frame = Main.rand.Next(14);
|
||||
lightColor = TheDanceofLight.GetRandomLightColor();
|
||||
lightColor = Judgement.GetRandomLightColor();
|
||||
|
||||
// Spawn starting dust.
|
||||
Vector2 baseOffsetVec = new Vector2(1f, 4f);
|
||||
@@ -114,12 +114,12 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Player player = Main.player[projectile.owner];
|
||||
CalamityPlayer calPlayer = player.Calamity();
|
||||
calPlayer.danceOfLightCharge++;
|
||||
if (calPlayer.danceOfLightCharge >= TheDanceofLight.HitsPerFlash)
|
||||
if (calPlayer.danceOfLightCharge >= Judgement.HitsPerFlash)
|
||||
{
|
||||
calPlayer.danceOfLightCharge = 0;
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int flashDamage = (int)(TheDanceofLight.FlashBaseDamage * player.MagicDamage());
|
||||
int flashDamage = (int)(Judgement.FlashBaseDamage * player.MagicDamage());
|
||||
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<BlindingLight>(), flashDamage, 0f, projectile.owner);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user