Mana Jelly -> Cleansing Jelly and rework

Using a healing potion will spawn an aura that cleanses all debuffs and defense damage once
This commit is contained in:
Xyk authored and Cameron Ewell committed 2023-08-06 22:34:28 -04:00
1 parent 180b52c044
commit a7223cc043
12 files changed
+182 -19

No files matched your search

+7
View File
@@ -497,6 +497,8 @@ namespace CalamityMod.CalPlayer
public bool abaddon = false;
public bool aeroStone = false;
public bool lifejelly = false;
public bool cleansingjelly = false;
public int CleansingEffect = 0;
public bool community = false;
public bool shatteredCommunity = false;
public bool fleshTotem = false;
@@ -1569,6 +1571,7 @@ namespace CalamityMod.CalPlayer
abaddon = false;
aeroStone = false;
lifejelly = false;
cleansingjelly = false;
community = false;
shatteredCommunity = false;
stressPills = false;
@@ -3209,6 +3212,10 @@ namespace CalamityMod.CalPlayer
if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && lifejelly)
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<PinkJellyAura>(), 0, 0, Player.whoAmI);
//Cleansing Jelly regen aura spawn when using a healing potion
if (timePotionSick == 1 && Player.whoAmI == Main.myPlayer && cleansingjelly)
Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType<BlueJellyAura>(), 0, 0, Player.whoAmI);
if (snowman)
{
+11 -1
View File
@@ -3553,7 +3553,7 @@ namespace CalamityMod.CalPlayer
#region Defense Effects
private void DefenseEffects()
{
//
//yeshere
// Defense Damage
//
// Current defense damage can be calculated at any time using the accessor property CurrentDefenseDamage.
@@ -3570,6 +3570,16 @@ namespace CalamityMod.CalPlayer
// (in addition to the player taking more defense damage, of course).
if (totalDefenseDamage > 0)
{
//Used to cleanse all defense damage by accessories
if (CleansingEffect == 1)
{
totalDefenseDamage = 0;
defenseDamageRecoveryFrames = 0;
totalDefenseDamageRecoveryFrames = DefenseDamageBaseRecoveryTime;
defenseDamageDelayFrames = 0;
CleansingEffect = 0;
}
// Defense damage is capped at your maximum defense, no matter what.
if (totalDefenseDamage > Player.statDefense)
totalDefenseDamage = Player.statDefense;
@@ -2,10 +2,11 @@
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using CalamityMod.CalPlayer;
namespace CalamityMod.Items.Accessories
{
public class ManaJelly : ModItem, ILocalizedModType
public class CleansingJelly : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Accessories";
public override void SetDefaults()
@@ -19,11 +20,8 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.statManaMax2 += 20;
if ((double)Math.Abs(player.velocity.X) < 0.05 && (double)Math.Abs(player.velocity.Y) < 0.05 && player.itemAnimation == 0)
{
player.manaRegenBonus += 4;
}
CalamityPlayer modPlayer = player.Calamity();
modPlayer.cleansingjelly = true;
}
}
}
File renamed without changes.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

+1 -1
View File
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Accessories
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<ManaJelly>().
AddIngredient<CleansingJelly>().
AddIngredient<LifeJelly>().
AddIngredient<VitalJelly>().
AddIngredient(ItemID.SoulofLight, 2).
@@ -1474,5 +1474,5 @@ WulfrumDroidBuff: {
PinkJellyRegen: {
DisplayName: Pink Jelly Regen
Description: You feel refreshed by the power of goo, life regen increased by 4
Description: The power of goo refreshes you, life regen increased by 4
}
@@ -1021,12 +1021,12 @@ LuxorsGift: {
'''
}
ManaJelly: {
DisplayName: Mana Jelly
CleansingJelly: {
DisplayName: Cleansing Jelly
Tooltip:
'''
+20 max mana
Standing still boosts mana regen
Using a healing potion will spawn an aura that cleanses
all debuffs and defense damage once
'''
}
+1 -1
View File
@@ -223,7 +223,7 @@ namespace CalamityMod.NPCs.Abyss
postClone.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType<DepthCells>(), 2, 5, 7, 10, 14));
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<LifeJelly>(), 7, 5));
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<ManaJelly>(), 7, 5));
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<CleansingJelly>(), 7, 5));
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<VitalJelly>(), 7, 5));
npcLoot.Add(ItemID.JellyfishNecklace, 10);
}
+2 -2
View File
@@ -255,9 +255,9 @@ namespace CalamityMod.NPCs
break;
// Blue Jellyfish
// Mana Jelly @ 14.29% Normal, 25% Expert+
// Cleansing Jelly @ 14.29% Normal, 25% Expert+
case NPCID.BlueJellyfish:
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<ManaJelly>(), 7, 4));
npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType<CleansingJelly>(), 7, 4));
break;
// Green Jellyfish
+138
View File
@@ -0,0 +1,138 @@
using System;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Typless
{
public class BlueJellyAura : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Typless";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public Player Owner => Main.player[Projectile.owner];
private static float Radius = 160f;
public int ShinkGrow = 0;
public int Framecounter = 0;
public int CleanseOnce = 1;
public int PulseOnce = 1;
public int PulseOnce2 = 1;
public int PulseOnce3 = 1;
public static readonly SoundStyle Spawnsound = new("CalamityMod/Sounds/Custom/OrbHeal1") { Volume = 0.5f };
public ref int CleansingEffect => ref Main.player[Projectile.owner].Calamity().CleansingEffect;
public override void SetDefaults()
{
//These shouldn't matter because its circular
Projectile.width = 336;
Projectile.height = 336;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Default;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 2710;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
}
public override void AI()
{
Framecounter++;
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
{
Player player = Main.player[playerIndex];
float targetDist = Vector2.Distance(player.Center, Projectile.Center);
//Remove the players debuffs and defense damage, but only once per aura
if (targetDist < 155f && CleanseOnce == 1)
{
CleansingEffect = 1;
for (int l = 0; l < Player.MaxBuffs; l++)
{
int hasBuff = player.buffType[l];
if (player.buffTime[l] > 2 && CalamityLists.debuffList.Contains(hasBuff))
{
player.buffTime[l] *= 0;
}
}
CleanseOnce = 0;
}
}
if (ShinkGrow == 0)
{
if (PulseOnce == 1)
{
SoundEngine.PlaySound(Spawnsound with { Pitch = -0.05f }, Projectile.Center);
Particle pulse = new StaticPulseRing(Projectile.Center, Vector2.Zero, Color.RoyalBlue, new Vector2(1f, 1f), 0f, 0f, 2f, 10);
GeneralParticleHandler.SpawnParticle(pulse);
PulseOnce = 0;
}
if (Framecounter == 10)
{
ShinkGrow = 1;
}
}
if (ShinkGrow == 1)
{
if (PulseOnce2 == 1)
{
Particle pulse2 = new StaticPulseRing(Projectile.Center, Vector2.Zero, Color.RoyalBlue, new Vector2(1f, 1f), 0f, 2f, 2f, 2700);
GeneralParticleHandler.SpawnParticle(pulse2);
PulseOnce2 = 0;
}
for (int i = 0; i < 1; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2CircularEdge(155f, 155f), 59);
dust.scale = Main.rand.NextFloat(2.2f, 3.3f);
dust.noGravity = true;
}
for (int i = 0; i < 1; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(150f, 150f), 59);
dust.scale = Main.rand.NextFloat(0.8f, 1.3f);
dust.noGravity = true;
}
if (Framecounter == 2710)
{
ShinkGrow = 2;
}
}
if (ShinkGrow == 2)
{
if (PulseOnce3 == 1)
{
Particle pulse3 = new StaticPulseRing(Projectile.Center, Vector2.Zero, Color.RoyalBlue, new Vector2(1f, 1f), 0f, 2f, 0f, 10);
GeneralParticleHandler.SpawnParticle(pulse3);
PulseOnce3 = 0;
}
}
}
public override bool? CanCutTiles()
{
return false;
}
public override bool? CanHitNPC(NPC target)
{
return false;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Radius, targetHitbox);
}
}
+3 -2
View File
@@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Typless
public int PulseOnce = 1;
public int PulseOnce2 = 1;
public int PulseOnce3 = 1;
public static readonly SoundStyle Spawnsound = new("CalamityMod/Sounds/Custom/OrbHeal1") { Volume = 0.5f };
public override void SetDefaults()
{
@@ -59,7 +60,7 @@ namespace CalamityMod.Projectiles.Typless
{
Particle pulse = new StaticPulseRing(Projectile.Center, Vector2.Zero, Color.HotPink, new Vector2(1f, 1f), 0f, 0f, 2f, 10);
GeneralParticleHandler.SpawnParticle(pulse);
SoundEngine.PlaySound(SoundID.NPCDeath28 with { Volume = 0.8f }, Projectile.Center);
SoundEngine.PlaySound(Spawnsound with { Pitch = -0.05f }, Projectile.Center);
PulseOnce = 0;
}
@@ -77,7 +78,7 @@ namespace CalamityMod.Projectiles.Typless
PulseOnce2 = 0;
}
for (int i = 0; i < 2; i++)
for (int i = 0; i < 1; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2CircularEdge(155f, 155f), 242);
dust.scale = Main.rand.NextFloat(2.2f, 3.3f);
+10 -1
View File
@@ -1 +1,10 @@
Mods.CalamityMod.Projectiles.Typless.PinkJellyAura.DisplayName: Pink Jelly Aura
Mods: {
CalamityMod: {
Projectiles: {
Typless: {
PinkJellyAura.DisplayName: Pink Jelly Aura
BlueJellyAura.DisplayName: Blue Jelly Aura
}
}
}
}