Added a weak default dash

This commit is contained in:
Mishiro Usui authored and Ozzatron committed 2023-08-19 22:38:52 -04:00
1 parent 71fc2c3e56
commit 39cab532af
4 files changed
+47 -2

No files matched your search

+11 -2
View File
@@ -15,9 +15,18 @@ namespace CalamityMod.CalPlayer
{
public int VerticalGodslayerDashTimer;
public string DashID;
private string dashID; //private backing variable
public string DeferredDashID;
public string DashID
{
get
{
return (String.IsNullOrEmpty(dashID) && Player.dashType == 0 && CalamityConfig.Instance.DefaultDashEnabled) ? DefaultDash.ID : dashID; //gives default dash ONLY if no custom or vanilla dash.
}
set => dashID = value;
}
public string DeferredDashID;
public string LastUsedDashID;
+23
View File
@@ -0,0 +1,23 @@
using CalamityMod.Enums;
using Terraria;
using Terraria.DataStructures;
namespace CalamityMod.CalPlayer.Dashes
{
public class DefaultDash : PlayerDashEffect
{
public static new string ID => "Default Dash";
public override DashCollisionType CollisionType => DashCollisionType.NoCollision;
public override bool IsOmnidirectional => false;
public override float CalculateDashSpeed(Player player) => 1f;
public override void OnHitEffects(Player player, NPC npc, IEntitySource source, ref DashHitContext hitContext)
{
hitContext.Damage = 0;
hitContext.PlayerImmunityFrames = 0;
}
}
}
+4
View File
@@ -225,6 +225,10 @@ namespace CalamityMod
[DrawTicks]
[DefaultValue(MinBossHealthBoost)]
public float BossHealthBoost { get; set; }
[BackgroundColor(192, 54, 64, 192)]
[DefaultValue(true)]
public bool DefaultDashEnabled { get; set; }
#endregion
#region Default Player Stat Boosts
@@ -65,6 +65,15 @@ CalamityConfig: {
'''
}
DefaultDashEnabled: {
Label: "[i:EoCShield] Default Dash Enabled"
Tooltip:
'''
Enables a very weak dash.
This dash is disabled when you have any other dash available.
'''
}
BossZen: {
Label: "[i:CalamityMod/ZenPotion] Bosses Drastically Reduce Spawn Rates"
Tooltip: