This commit is contained in:
Altixal committed 2024-05-30 11:45:01 +07:00
commit 783bd5e2a8
16 files changed
+175 -108

No files matched your search

+5
View File
@@ -53,6 +53,7 @@ using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
using Terraria.Utilities.Terraria.Utilities;
namespace CalamityMod.CalPlayer
{
@@ -532,6 +533,8 @@ namespace CalamityMod.CalPlayer
public bool honeyDewHalveDebuffs = false;
public bool livingDewHalveDebuffs = false;
public int jewelBonusDefense = 0;
public float pulseCounter = 0; // Toxic Heart
public float pulseRate = 1; // Toxic Heart
public bool aAmpoule = false;
public bool rOoze = false;
public bool JustWasDebuffed = false;
@@ -793,6 +796,7 @@ namespace CalamityMod.CalPlayer
public bool astralStarRain = false;
public int astralStarRainCooldown = 0;
public int AbaddonCooldown = 0;
public int AlchFlaskCooldown = 0;
public bool plagueReaper = false;
public bool plaguebringerPatronSet = false;
public bool plaguebringerCarapace = false;
@@ -2313,6 +2317,7 @@ namespace CalamityMod.CalPlayer
gSabatonTempJumpSpeed = 0;
astralStarRainCooldown = 0;
AbaddonCooldown = 0;
AlchFlaskCooldown = 0;
silvaMageCooldown = 0;
bloodflareMageCooldown = 0;
tarraRangedCooldown = 0;
+17
View File
@@ -37,6 +37,7 @@ using CalamityMod.Projectiles.Typeless;
using CalamityMod.UI;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Mono.Cecil;
using Terraria;
using Terraria.Audio;
using Terraria.Chat;
@@ -1219,6 +1220,22 @@ namespace CalamityMod.CalPlayer
GeneralParticleHandler.SpawnParticle(spark);
}
}
if (alchFlask)
{
for (int i = 0; i < 9; i++)
{
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(15);
seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage);
Projectile bee = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f), ModContent.ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
bee.ArmorPenetration = 35;
bee.penetrate = 6;
bee.extraUpdates = 2;
bee.timeLeft = 600;
}
Player.AddBuff(BuffID.Honey, 900);
}
}
public override void OnHitByProjectile(Projectile proj, Player.HurtInfo hurtInfo)
+23 -3
View File
@@ -6,13 +6,16 @@ using CalamityMod.Cooldowns;
using CalamityMod.Items.Accessories;
using CalamityMod.NPCs;
using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Utilities.Terraria.Utilities;
namespace CalamityMod.CalPlayer
{
@@ -21,9 +24,6 @@ namespace CalamityMod.CalPlayer
#region Update Bad Life Regen
public override void UpdateBadLifeRegen()
{
if (Player.ownedProjectileCounts[ModContent.ProjectileType<BloodBoilerFire>()] > 0)
noLifeRegen = true;
// Universal +25% increase to DoT debuff damage in Death Mode
float deathNegativeRegenBonus = 0.25f;
float calamityDebuffMultiplier = 1f + (CalamityWorld.death ? deathNegativeRegenBonus : 0f);
@@ -878,6 +878,26 @@ namespace CalamityMod.CalPlayer
}
}
}
if (toxicHeart) // Since it needs to know your life regen, it must be placed here
{
int auraDamage = (int)Player.GetBestClassDamage().ApplyTo(200);
auraDamage = Player.ApplyArmorAccDamageBonusesTo(auraDamage);
var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType<ToxicHeart>()));
pulseRate = Utils.Remap(Player.lifeRegen, -30, 10, 20, 1, true);
if (pulseCounter >= 420)
{
Projectile.NewProjectileDirect(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<PlaguePulse>(), auraDamage, 0f, Player.whoAmI, 0, 0, 0);
pulseCounter = 0;
float soundVolume = Utils.Remap(Player.lifeRegen, -30, 10, 1f, 0.3f, true);
SoundStyle heartbeat = new("CalamityMod/Sounds/Item/Heartbeat");
SoundEngine.PlaySound(heartbeat with { Volume = soundVolume, PitchVariance = 0.2f }, Player.Center);
}
else
{
pulseCounter += MathHelper.Clamp(pulseRate, 1, 20);
}
}
}
#endregion
}
+2 -3
View File
@@ -1375,6 +1375,8 @@ namespace CalamityMod.CalPlayer
astralStarRainCooldown--;
if (AbaddonCooldown > 0)
AbaddonCooldown--;
if (AlchFlaskCooldown > 0)
AlchFlaskCooldown--;
if (tarraRangedCooldown > 0)
tarraRangedCooldown--;
if (bloodflareMageCooldown > 0)
@@ -2934,9 +2936,6 @@ namespace CalamityMod.CalPlayer
if (pFlames && !purity)
{
if (!alchFlask)
Player.blind = true;
Player.GetDamage<GenericDamageClass>() -= 0.1f;
}
+8 -5
View File
@@ -595,14 +595,17 @@ namespace CalamityMod.CalPlayer
if (!proj.CountsAsClass<MeleeDamageClass>() && !proj.CountsAsClass<SummonMeleeSpeedDamageClass>() && Player.meleeEnchant == 7)
Projectile.NewProjectile(source, position, proj.velocity, ProjectileID.ConfettiMelee, 0, 0f, proj.owner);
if (alchFlask && Player.ownedProjectileCounts[ProjectileType<PlagueSeeker>()] < 3 && hasClass)
if (alchFlask && AlchFlaskCooldown == 0 && proj.type != ModContent.ProjectileType<BasicPlagueBee>())
{
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(30);
int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(10);
seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage);
Vector2 seekerVelocity = new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1.2f);
Projectile projectile = CalamityUtils.SpawnOrb(proj, seekerDamage, ProjectileType<PlagueSeeker>(), 400f, 12f);
if (projectile.whoAmI.WithinBounds(Main.maxProjectiles))
Main.projectile[projectile.whoAmI].DamageType = DamageClass.Generic;
Projectile bee = Projectile.NewProjectileDirect(source, position, seekerVelocity, ModContent.ProjectileType<BasicPlagueBee>(), seekerDamage, 0f, Player.whoAmI, -20, 30, 2);
bee.ArmorPenetration = 20;
bee.penetrate = 2;
bee.extraUpdates = 1;
AlchFlaskCooldown = 7;
}
bool lifeAndShieldCondition = Player.statLife >= Player.statLifeMax2 && (!HasAnyEnergyShield || TotalEnergyShielding >= TotalMaxShieldDurability);
+3 -2
View File
@@ -29,8 +29,9 @@ namespace CalamityMod.Items.Accessories
{
CreateRecipe().
AddIngredient(ItemID.BottledWater).
AddIngredient(ItemID.BeeWax, 5).
AddIngredient<PlagueCellCanister>(10).
AddIngredient(ItemID.HoneyComb).
AddIngredient(ItemID.BeeWax, 8).
AddIngredient<PlagueCellCanister>(15).
AddTile(TileID.MythrilAnvil).
Register();
}
-38
View File
@@ -1,38 +0,0 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class PlagueHive : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
{
Item.width = 42;
Item.height = 48;
Item.value = CalamityGlobalItem.RarityRedBuyPrice;
Item.rare = ItemRarityID.Red;
Item.accessory = true;
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<AlchemicalFlask>().
AddIngredient(ItemID.HoneyComb).
AddTile(TileID.LunarCraftingStation).
Register();
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.uberBees = true;
modPlayer.alchFlask = true;
player.buffImmune[ModContent.BuffType<Plague>()] = true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 B

+2 -38
View File
@@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.Audio;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
@@ -12,6 +13,7 @@ namespace CalamityMod.Items.Accessories
public class ToxicHeart : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public float pulseCounter = 0;
public override void SetDefaults()
{
Item.width = 28;
@@ -25,44 +27,6 @@ namespace CalamityMod.Items.Accessories
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.toxicHeart = true;
player.buffImmune[ModContent.BuffType<Plague>()] = true;
int plagueCounter = 0;
Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0.05f, 1f, 0.1f);
int plagueDebuff = ModContent.BuffType<Plague>();
bool shouldInflictPlague = plagueCounter % 60 == 0;
int auraDamage = (int)player.GetBestClassDamage().ApplyTo(50);
auraDamage = player.ApplyArmorAccDamageBonusesTo(auraDamage);
int random = Main.rand.Next(10);
var source = player.GetSource_Accessory(Item);
if (player.whoAmI == Main.myPlayer)
{
if (random == 0)
{
foreach (NPC nPC in Main.ActiveNPCs)
{
if (nPC.IsAnEnemy() && !nPC.dontTakeDamage && !nPC.buffImmune[plagueDebuff] && Vector2.Distance(player.Center, nPC.Center) <= 300f)
{
if (nPC.FindBuffIndex(plagueDebuff) == -1)
{
nPC.AddBuff(plagueDebuff, 120, false);
}
if (shouldInflictPlague)
{
if (player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectileDirect(source, nPC.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), auraDamage, 0f, player.whoAmI, nPC.whoAmI);
}
}
}
}
}
}
plagueCounter++;
if (plagueCounter >= 180)
{
}
}
}
}
@@ -104,6 +104,7 @@ AlchemicalFlask: {
'''
All attacks inflict the Plague and reduces damage taken from the Plague
Projectiles spawn plague seekers on enemy hits
Releases plague bees when damaged and douses you in honey
'''
}
@@ -1260,16 +1261,6 @@ PlaguedFuelPack: {
'''
}
PlagueHive: {
DisplayName: Plague Hive
Tooltip:
'''
All attacks inflict the Plague and grants immunity to the Plague
Releases bees when damaged that inflict the Plague
Projectiles spawn plague seekers on enemy hits
'''
}
ProfanedSoulArtifact: {
DisplayName: Profaned Soul Artifact
Tooltip:
@@ -1882,8 +1873,9 @@ ToxicHeart: {
DisplayName: Toxic Heart
Tooltip:
'''
Summons a plague aura around you that damages nearby enemies
Makes you immune to the Plague debuff
Causes your heart to beat with powerful plague pulses, inflicting all nearby enemies with the Plague
The rate of these pulses scales with how low your life regen is
Pulses that kill targets create additional pulses and heal you
Multiplies all sickness-based debuff damage by 1.5
'''
}
@@ -94,6 +94,7 @@ PauldronExplosion.DisplayName: Pauldron Explosion
PendantProjectile1.DisplayName: Prism Shard
PendantProjectile2.DisplayName: Prism Shard
PendantProjectile3.DisplayName: Prism Shard
PlaguePulse.DisplayName: Plague Pulse
PoisonousSeawater.DisplayName: Seawater
PscTransformAnimation.DisplayName: Psc Transform Animation
PscTransformRocks.DisplayName: Psc Transform Rocks
+1
View File
@@ -94,6 +94,7 @@ namespace CalamityMod.NPCs
{
"Tavish DeGroot", // <@!442447226992721930> (magicoal)
"Fimmy", // <@!407348617079160832> (darkmega5)
"Dorira", // <@!215269032360804352> (crimsoncb)
};
private static readonly string[] DryadNames =
{
+1 -1
View File
@@ -186,7 +186,7 @@ namespace CalamityMod.Projectiles.Ranged
{
if (!Main.player[Projectile.owner].moonLeech)
{
int bonusHeal = Main.rand.NextBool(3) ? 6 : 4;
int bonusHeal = Main.rand.NextBool(3) ? 5 : 3;
int heal = improvedHeal ? bonusHeal : 2;
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
+9 -6
View File
@@ -33,8 +33,8 @@ namespace CalamityMod.Projectiles.Typeless
Projectile.penetrate = 2;
Projectile.timeLeft = 300;
Projectile.ignoreWater = true;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 5;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 12;
}
public override void AI()
@@ -81,9 +81,8 @@ namespace CalamityMod.Projectiles.Typeless
if (Main.rand.NextBool())
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, 303, -Projectile.velocity.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.2f, 0.6f), 0, default, Main.rand.NextFloat(0.35f, 0.55f));
Dust dust = Dust.NewDustPerfect(Projectile.Center, 89, -Projectile.velocity.RotatedByRandom(0.2f) * Main.rand.NextFloat(0.2f, 0.6f), 0, default, Main.rand.NextFloat(0.5f, 0.8f));
dust.noGravity = true;
dust.color = Color.Black;
dust.alpha = Main.rand.Next(90, 220 + 1);
}
}
@@ -125,7 +124,7 @@ namespace CalamityMod.Projectiles.Typeless
center.X = Projectile.Center.X + Projectile.velocity.X * 100f;
center.Y = Projectile.Center.Y + Projectile.velocity.Y * 100f;
}
float speed = 10f;
float speed = 8f;
float velocityTweak = 0.30f;
Vector2 projPos = Projectile.Center;
Vector2 velocity = center - projPos;
@@ -202,7 +201,11 @@ namespace CalamityMod.Projectiles.Typeless
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Plague>(), (int)(Projectile.ai[1]));
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<Plague>(), (int)(Projectile.ai[1]));
Projectile.ai[0] = 15;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType<Plague>(), (int)(Projectile.ai[1]));
+99
View File
@@ -0,0 +1,99 @@
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using CalamityMod.Particles;
using Terraria.ID;
using Terraria.ModLoader;
using Microsoft.Xna.Framework.Graphics;
using SteelSeries.GameSense;
using CalamityMod.Buffs.DamageOverTime;
using Mono.Cecil;
namespace CalamityMod.Projectiles.Typeless
{
public class PlaguePulse : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Typeless";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public ref float time => ref Projectile.ai[0];
public ref float radius => ref Projectile.ai[1];
public float maxRadius = 300;
public int startDamage;
public override void SetDefaults()
{
Projectile.width = 96;
Projectile.height = 96;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 60;
Projectile.extraUpdates = 1;
Projectile.ignoreWater = true;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = -1;
}
public override void AI()
{
if (time == 0)
startDamage = Projectile.damage;
Player player = Main.player[Projectile.owner];
if (Projectile.ai[2] == 0)
Projectile.Center = player.MountedCenter;
if (Projectile.ai[2] == 1)
{
maxRadius = 200;
}
if (Main.rand.NextBool(5))
{
DirectionalPulseRing pulse = new DirectionalPulseRing(Projectile.Center + Main.rand.NextVector2Circular(radius, radius), Vector2.Zero, (Main.rand.NextBool(3) ? Color.LimeGreen : Color.Green) * 0.6f, new Vector2(1, 1), 0, Main.rand.NextFloat(0.07f, 0.23f), 0f, 20);
GeneralParticleHandler.SpawnParticle(pulse);
}
if (Main.rand.NextBool(3))
{
for (int i = 0; i < 2; i++)
{
int DustID = 89;
Vector2 spawnPos = Projectile.Center + Main.rand.NextVector2Circular(radius, radius);
Dust dust2 = Dust.NewDustPerfect(spawnPos, DustID);
dust2.scale = Main.rand.NextFloat(0.5f, 0.9f);
dust2.velocity = (spawnPos - Projectile.Center).SafeNormalize(Vector2.UnitX) * Main.rand.NextFloat(5, 10);
dust2.noGravity = true;
}
}
radius = Utils.Remap(time, 0, 60, 30, maxRadius, true);
time++;
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (Projectile.numHits > 0)
Projectile.damage = (int)(Projectile.damage * 0.85f);
if (Projectile.damage < 1)
Projectile.damage = 1;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
Player player = Main.player[Projectile.owner];
target.AddBuff(ModContent.BuffType<Plague>(), 420);
if (target.life <= 0)
{
player.Heal(10);
Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType<PlaguePulse>(), (int)(startDamage * 0.8f), 0f, Projectile.owner, 0, 0, 1);
}
}
public override bool PreDraw(ref Color lightColor)
{
Player player = Main.player[Projectile.owner];
Texture2D rexture = ModContent.Request<Texture2D>("CalamityMod/Particles/HighResHollowCircleHardEdge").Value;
Main.EntitySpriteDraw(rexture, Projectile.Center - Main.screenPosition, null, (Color.Green * Utils.Remap(time, 30, 60, 0.35f, 0, true)) with { A = 0 }, Projectile.rotation, rexture.Size() * 0.5f, (Utils.Remap(time, 0, 60, 1, 6, true) / 21) * (maxRadius == 300 ? 1 : 0.7f), SpriteEffects.None, 0);
return false;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, radius, targetHitbox);
}
}
Binary file not shown.