Files
CalamityModPublic/CalPlayer/Dashes/AsgardsValorDash.cs
T
mountaindrew10 096d43d05e 1 - Asgardian Aegis ram no longer inflicts Holy Flames.
2 - Amalgam now inflicts Acid Venom instead of Brimstone Flames and Plague and Astral Infection instead of God Slayer Inferno.
3 - Elemental Gauntlet now only inflicts Hellfire.
4 - Frosty Flare now inflicts Frostburn on all hits instead of just melee.
5 - Corrosive Spine now inflicts Acid Venom instead of Poisoned.
6 - Void of Extinction now inflicts Brimstone Flames on all hits instead of Hellfire on melee hits.
7 - Necklace of Vexation now inflicts Acid Venom instead of Cursed Inferno and Venom while wearing Reaver Armor.
8 - The Camper no longer inflicts On Fire!
9 - Increased Alicorn mount run speed to 90 mph, gave it infinite flight and increased vertical speed to 70 mph.
10 - Increased Gaze of Crysthamyr mount horizontal flight acceleration by 70%, decreased run speed to 50 mph and made holding W while flying up greatly boost vertical acceleration.
11 - Gaze of Crysthamyr now requires 10 Souls of Night to craft instead of 100.
12 - Dragon Scales infernadoes and fireballs now inflict Dragonfire.
13 - Abyssal Mirror projectiles now inflict Crush Depth.
14 - Statis Void Sash projectiles no longer inflict God Slayer Inferno.
15 - Venerated Locket projectiles now inflict God Slayer Inferno.
16 - Hallowed Rune projectiles no longer inflict Astral Infection.
17 - Nebulous Core projectiles now inflict God Slayer Inferno.
2022-12-04 02:03:22 -06:00

80 lines
3.4 KiB
C#

using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Enums;
using CalamityMod.Items.Accessories;
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.Graphics.Shaders;
using Terraria.ModLoader;
namespace CalamityMod.CalPlayer.Dashes
{
public class AsgardsValorDash : PlayerDashEffect
{
public static new string ID => "Asgard's Valor";
public override DashCollisionType CollisionType => DashCollisionType.ShieldSlam;
public override bool IsOmnidirectional => false;
public override float CalculateDashSpeed(Player player) => 16.9f;
public override void OnDashEffects(Player player)
{
// Spawn fire dust around the player's body.
for (int d = 0; d < 20; d++)
{
Dust holyFireDashDust = Dust.NewDustDirect(player.position, player.width, player.height, 246, 0f, 0f, 100, default, 3f);
holyFireDashDust.position += Main.rand.NextVector2Square(-5f, 5f);
holyFireDashDust.velocity *= 0.2f;
holyFireDashDust.scale *= Main.rand.NextFloat(1f, 1.2f);
holyFireDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player);
holyFireDashDust.noGravity = true;
holyFireDashDust.fadeIn = 0.5f;
}
}
public override void MidDashEffects(Player player, ref float dashSpeed, ref float dashSpeedDecelerationFactor, ref float runSpeedDecelerationFactor)
{
// Spawn fire dust around the player's body.
for (int d = 0; d < 4; d++)
{
Dust holyFireDashDust = Dust.NewDustDirect(player.position + Vector2.UnitY * 4f, player.width, player.height - 8, 246, 0f, 0f, 100, default, 2.75f);
holyFireDashDust.velocity *= 0.1f;
holyFireDashDust.scale *= Main.rand.NextFloat(1f, 1.2f);
holyFireDashDust.shader = GameShaders.Armor.GetSecondaryShader(player.ArmorSetDye(), player);
holyFireDashDust.noGravity = true;
if (Main.rand.NextBool(2))
holyFireDashDust.fadeIn = 0.5f;
}
}
public override void OnHitEffects(Player player, NPC npc, IEntitySource source, ref DashHitContext hitContext)
{
float kbFactor = 9f;
bool crit = Main.rand.Next(100) < player.GetCritChance<MeleeDamageClass>();
if (player.kbGlove)
kbFactor *= 2f;
if (player.kbBuff)
kbFactor *= 1.5f;
int hitDirection = player.direction;
if (player.velocity.X != 0f)
hitDirection = Math.Sign(player.velocity.X);
// Define hit context variables.
hitContext.CriticalHit = crit;
hitContext.HitDirection = hitDirection;
hitContext.KnockbackFactor = kbFactor;
hitContext.PlayerImmunityFrames = AsgardsValor.ShieldSlamIFrames;
hitContext.Damage = (int)player.GetTotalDamage<MeleeDamageClass>().ApplyTo(100f);
int holyExplosionDamage = (int)player.GetBestClassDamage().ApplyTo(60);
Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType<HolyExplosion>(), holyExplosionDamage, 15f, Main.myPlayer, 0f, 0f);
npc.AddBuff(ModContent.BuffType<HolyFlames>(), 180);
}
}
}