Added Rotten Dogtooth
This commit is contained in:
1 parent
a232131445
commit
ca4e9ae32a
5 files changed
+56
-5
No files matched your search
@@ -292,6 +292,7 @@ namespace CalamityMod.CalPlayer
|
||||
public float rogueStealthMax = 0f;
|
||||
public float stealthGenStandstill = 1f;
|
||||
public float stealthGenMoving = 1f;
|
||||
public int flatStealthLossReduction = 0;
|
||||
public const float StealthAccelerationCap = 2f;
|
||||
public float stealthAcceleration = 1f;
|
||||
public bool stealthStrikeThisFrame = false;
|
||||
@@ -574,6 +575,7 @@ namespace CalamityMod.CalPlayer
|
||||
public int roverDriveTimer = 0;
|
||||
public int roverFrameCounter = 0;
|
||||
public int roverFrame = 0;
|
||||
public bool rottenDogTooth = false;
|
||||
#endregion
|
||||
|
||||
#region Armor Set
|
||||
@@ -1601,6 +1603,7 @@ namespace CalamityMod.CalPlayer
|
||||
noStupidNaturalARSpawns = false;
|
||||
burdenBreakerYeet = false;
|
||||
roverDrive = false;
|
||||
rottenDogTooth = false;
|
||||
|
||||
daedalusReflect = false;
|
||||
daedalusSplit = false;
|
||||
@@ -1973,6 +1976,8 @@ namespace CalamityMod.CalPlayer
|
||||
rageModeActive = false;
|
||||
adrenalineModeActive = false;
|
||||
|
||||
flatStealthLossReduction = 0;
|
||||
|
||||
lastProjectileHit = null;
|
||||
}
|
||||
#endregion
|
||||
@@ -6882,6 +6887,9 @@ namespace CalamityMod.CalPlayer
|
||||
#region Shoot
|
||||
public override bool Shoot(Item item, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
if (rottenDogTooth && item.Calamity().rogue && item.type != ModContent.ItemType<SylvanSlasher>())
|
||||
damage = (int)(damage * RottenDogtooth.StealthStrikeDamageMultiplier);
|
||||
|
||||
if (veneratedLocket)
|
||||
{
|
||||
if (item.Calamity().rogue && item.type != ModContent.ItemType<SylvanSlasher>())
|
||||
@@ -9081,20 +9089,21 @@ namespace CalamityMod.CalPlayer
|
||||
stealthStrikeThisFrame = true;
|
||||
stealthAcceleration = 1f; // Reset acceleration when you attack
|
||||
|
||||
float lossReductionRatio = flatStealthLossReduction / rogueStealthMax;
|
||||
if (stealthStrikeHalfCost)
|
||||
{
|
||||
rogueStealth -= 0.5f * rogueStealthMax;
|
||||
rogueStealth -= 0.5f * rogueStealthMax - lossReductionRatio;
|
||||
if (rogueStealth <= 0f)
|
||||
rogueStealth = 0f;
|
||||
}
|
||||
else if (stealthStrike75Cost)
|
||||
{
|
||||
rogueStealth -= 0.75f * rogueStealthMax;
|
||||
rogueStealth -= 0.75f * rogueStealthMax - lossReductionRatio;
|
||||
if (rogueStealth <= 0f)
|
||||
rogueStealth = 0f;
|
||||
}
|
||||
else
|
||||
rogueStealth = 0f;
|
||||
rogueStealth = lossReductionRatio;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
public class RottenDogtooth : ModItem
|
||||
{
|
||||
internal const int ArmorCrunchDebuffTime = 180;
|
||||
internal const float StealthStrikeDamageMultiplier = 0.1f;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Rotten Dogtooth");
|
||||
Tooltip.SetDefault($"Makes Stealth strikes inflict Armor Crunch, deal {(int)(StealthStrikeDamageMultiplier * 100)}% more damage and cost 1 less unit of stealth.");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 14;
|
||||
item.height = 22;
|
||||
item.value = CalamityGlobalItem.Rarity1BuyPrice;
|
||||
item.rare = ItemRarityID.Blue;
|
||||
item.accessory = true;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.Calamity().rottenDogTooth = true;
|
||||
player.Calamity().flatStealthLossReduction++;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 303 B |
@@ -1,3 +1,4 @@
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Placeables.Banners;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
@@ -64,6 +65,7 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
{
|
||||
int bandageDropRate = CalamityWorld.defiled ? DropHelper.DefiledDropRateInt : Main.expertMode ? 50 : 100;
|
||||
DropHelper.DropItemChance(npc, ItemID.AdhesiveBandage, bandageDropRate, 1, 1);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<RottenDogtooth>(), 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.Projectiles.Healing;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
@@ -21,6 +22,8 @@ using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using static Terraria.ModLoader.ModContent;
|
||||
|
||||
using NanotechProjectile = CalamityMod.Projectiles.Typeless.Nanotech;
|
||||
|
||||
namespace CalamityMod.Projectiles
|
||||
{
|
||||
public class CalamityGlobalProjectile : GlobalProjectile
|
||||
@@ -1155,9 +1158,9 @@ namespace CalamityMod.Projectiles
|
||||
{
|
||||
if (Main.player[projectile.owner].miscCounter % 30 == 0 && projectile.FinalExtraUpdate())
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType<Nanotech>()] < 25)
|
||||
if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType<NanotechProjectile>()] < 25)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType<Nanotech>(),
|
||||
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ProjectileType<NanotechProjectile>(),
|
||||
CalamityUtils.DamageSoftCap(projectile.damage * 0.15, 150), 0f, projectile.owner, 0f, 0f);
|
||||
}
|
||||
}
|
||||
@@ -1399,6 +1402,9 @@ namespace CalamityMod.Projectiles
|
||||
Player player = Main.player[projectile.owner];
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
|
||||
if (modPlayer.rottenDogTooth && projectile.Calamity().stealthStrike)
|
||||
target.AddBuff(BuffType<ArmorCrunch>(), RottenDogtooth.ArmorCrunchDebuffTime);
|
||||
|
||||
// Super dummies have nearly 10 million max HP (which is used in damage calculations).
|
||||
// This can very easily cause damage numbers that are unrealistic for the weapon.
|
||||
// As a result, they are omitted in this code.
|
||||
|
||||
Reference in new issue
Block a user