This commit is contained in:
mountaindrew10 committed 2024-06-17 15:54:54 -05:00
commit db23b4c2bc
7 files changed
+100 -17

No files matched your search

+34 -9
View File
@@ -2,6 +2,7 @@
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -29,20 +30,44 @@ namespace CalamityMod.Buffs.DamageOverTime
npc.DelBuff(buffIndex);
buffIndex--;
}
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
Player player = drawInfo.drawPlayer;
var modPlayer = player.Calamity();
if (Main.rand.NextBool())
{
Vector2 randVel = new Vector2(6, 6).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f);
Dust dust = Dust.NewDustPerfect(modPlayer.RandomDebuffVisualSpot, 5, randVel * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.6f, 0.9f));
dust.noGravity = false;
Particle spark = new AltSparkParticle(modPlayer.RandomDebuffVisualSpot, randVel + new Vector2(0, -4), true, 12, Main.rand.NextFloat(0.25f, 0.6f), Color.DarkRed * 0.5f);
GeneralParticleHandler.SpawnParticle(spark);
}
if (Main.rand.NextBool(8))
{
Particle spark = new GlowOrbParticle(modPlayer.RandomDebuffVisualSpot, new Vector2(0, 4) * Main.rand.NextFloat(0.5f, 0.7f), true, 16, Main.rand.NextFloat(0.55f, 0.8f), Color.DarkRed * 0.8f, false, false, false);
GeneralParticleHandler.SpawnParticle(spark);
}
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
{
Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2));
Vector2 randVel = new Vector2(6, 6).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1f);
if (Main.rand.NextBool(3))
{
for (int b = 0; b < 2; b++)
{
Vector2 bloodVel = Main.rand.NextVector2CircularEdge(1f, 1f);
bloodVel.SafeNormalize(Vector2.Zero);
bloodVel *= Main.rand.NextFloat(4f, 7f);
Particle bloody = new BloodParticle(npc.Center, bloodVel, 40, 0.75f, new Color(192, 0, 0));
GeneralParticleHandler.SpawnParticle(bloody);
}
Particle spark = new AltSparkParticle(npcSize, randVel + new Vector2(0, -4), true, 12, Main.rand.NextFloat(0.25f, 0.6f), Color.DarkRed * 0.5f);
GeneralParticleHandler.SpawnParticle(spark);
}
else
{
Dust dust = Dust.NewDustPerfect(npcSize, 5, randVel * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.2f, 0.6f));
dust.noGravity = false;
}
if (Main.rand.NextBool(8))
{
Particle spark = new GlowOrbParticle(npcSize, new Vector2(0, 4) * Main.rand.NextFloat(0.5f, 0.7f), true, 16, Main.rand.NextFloat(0.55f, 0.8f), Color.DarkRed * 0.8f, false, false, false);
GeneralParticleHandler.SpawnParticle(spark);
}
}
}
+20 -6
View File
@@ -32,8 +32,9 @@ namespace CalamityMod.Buffs.DamageOverTime
internal static void DrawEffects(PlayerDrawSet drawInfo)
{
Player Player = drawInfo.drawPlayer;
var modPlayer = Player.Calamity();
if (Main.rand.NextBool(7))
if (Main.rand.NextBool(14))
{
int dust = Dust.NewDust(drawInfo.Position - new Vector2(2f), Player.width + 4, Player.height + 4, DustID.FungiHit, Player.velocity.X * 0.4f, Player.velocity.Y * 0.4f, 100, default, 1f);
Main.dust[dust].noGravity = false;
@@ -41,16 +42,29 @@ namespace CalamityMod.Buffs.DamageOverTime
Main.dust[dust].velocity.Y += 0.8f;
drawInfo.DustCache.Add(dust);
}
if (Main.rand.NextBool(9))
{
Gore bubble = Gore.NewGorePerfect(Player.GetSource_FromAI(), modPlayer.RandomDebuffVisualSpot, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), 411);
bubble.timeLeft = 4 + Main.rand.Next(7);
bubble.scale = Main.rand.NextFloat(0.6f, 1f);
bubble.type = Main.rand.NextBool(3) ? 412 : 411;
}
}
internal static void DrawEffects(NPC npc, ref Color drawColor)
{
if (Main.rand.Next(7) < 3)
Vector2 npcSize = npc.Center + new Vector2(Main.rand.NextFloat(-npc.width / 2, npc.width / 2), Main.rand.NextFloat(-npc.height / 2, npc.height / 2));
if (Main.rand.NextBool(9))
{
int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, DustID.FungiHit, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1f);
Main.dust[dust].noGravity = false;
Main.dust[dust].velocity *= 1.2f;
Main.dust[dust].velocity.Y += 0.5f;
Dust dust = Dust.NewDustPerfect(npcSize, 76, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), 0, default, Main.rand.NextFloat(0.2f, 0.6f));
dust.color = (Main.rand.NextBool(3) ? Color.LightBlue : Color.LightSkyBlue);
}
if (Main.rand.NextBool(8))
{
Gore bubble = Gore.NewGorePerfect(npc.GetSource_FromAI(), npcSize, new Vector2(2f, 2f).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 0.7f), 411);
bubble.timeLeft = 4 + Main.rand.Next(7);
bubble.scale = Main.rand.NextFloat(0.6f, 1f);
bubble.type = Main.rand.NextBool(3) ? 412 : 411;
}
}
}
+1
View File
@@ -85,6 +85,7 @@ namespace CalamityMod.ILEditing
On_Player.UpdateItemDye += FindCalamityItemDyeShader;
On_AWorldListItem.GetDifficulty += GetDifficultyOverride;
On_Item.GetShimmered += ShimmerEffectEdits;
Terraria.On_Player.Teleport += TPOverride;
// Mana Burn (Chaos Stone) and Chalice of the Blood God
IL_Player.ApplyLifeAndOrMana += ManaSicknessAndChaliceBufferHeal;
+41
View File
@@ -22,6 +22,7 @@ using CalamityMod.Projectiles;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Systems;
using CalamityMod.Tiles.Abyss;
using CalamityMod.Walls;
using CalamityMod.Waterfalls;
using CalamityMod.Waters;
using Microsoft.Xna.Framework;
@@ -1495,5 +1496,45 @@ namespace CalamityMod.ILEditing
}
}
#endregion
#region Block Abyss from Teleportation Potions
public static void TPOverride(Terraria.On_Player.orig_Teleport orig, Player self, Vector2 newPos, int Style = 0, int extraInfo = 0)
{
// Grab the tile from where the potion wants to teleport
Tile t = CalamityUtils.ParanoidTileRetrieval(newPos.ToTileCoordinates().X, newPos.ToTileCoordinates().Y);
// Check if it's a Teleportation Potion
if (Style == 2)
{
// Check if it's an Abyss wall
if (t.WallType == ModContent.WallType<SulphurousShaleWall>() || t.WallType == ModContent.WallType<AbyssGravelWall>() || t.WallType == ModContent.WallType<PyreMantleWall>() || t.WallType == ModContent.WallType<VoidstoneWallUnsafe>() || t.WallType == ModContent.WallType<HardenedSulphurousSandstoneWall>() || t.WallType == ModContent.WallType<SulphurousSandstoneWall>())
{
// If an Abyss wall is detected, try to find another teleportation location
bool canSpawn = false;
int teleportStartX = 100;
int teleportRangeX = Main.maxTilesX - 200;
int teleportStartY = 100;
int underworldLayer = Main.UnderworldLayer;
Vector2 newerPos = self.CheckForGoodTeleportationSpot(ref canSpawn, teleportStartX, teleportRangeX, teleportStartY, underworldLayer, new Player.RandomTeleportationAttemptSettings
{
avoidLava = true,
avoidHurtTiles = true,
maximumFallDistanceFromOrignalPoint = 100,
attemptsBeforeGivingUp = 1000
});
// Attempt teleporting again with the new location
orig(self, newerPos, Style, extraInfo);
}
else
{
orig(self, newPos, Style, extraInfo);
}
}
else
{
orig(self, newPos, Style, extraInfo);
}
}
#endregion
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

+3 -1
View File
@@ -65,7 +65,9 @@ namespace CalamityMod.Items.Weapons.Ranged
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
player.velocity += -velocity * 0.3f;
Vector2 recoilVelocity = velocity;
recoilVelocity.Normalize();
player.velocity += -recoilVelocity * 7f;
if (type == ProjectileID.Bullet)
type = ModContent.ProjectileType<NitroShot>();
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f);
@@ -30,7 +30,7 @@ ElysianWings: {
Acceleration multiplier: 2.7
Great vertical speed
Flight time: 240
Temporary immunity to lava and 10% increased movement speed
Immunity to lava and 10% increased movement speed
Blessed by the Profaned Flame
'''
}