Skip to content

Commit

Permalink
Merge branch 'master' into new_infusions
Browse files Browse the repository at this point in the history
  • Loading branch information
ScalarVector1 committed Jun 2, 2024
2 parents e8957da + eebcfb0 commit df2a907
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 18 deletions.
3 changes: 2 additions & 1 deletion Content/Dusts/BigFire.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public override bool Update(Dust dust)

dust.alpha += 16;

if (dust.alpha > 255)
if (dust.alpha >= 255)
dust.active = false;

return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Content/GUI/ArmorChargeUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public override int InsertionIndex(List<GameInterfaceLayer> layers)

public override void Draw(SpriteBatch spriteBatch)
{
if (message != "" && ModContent.GetInstance<GUIConfig>().ObviousArmorCharge)
if (!string.IsNullOrEmpty(message) && ModContent.GetInstance<GUIConfig>().ObviousArmorCharge)
Utils.DrawBorderString(spriteBatch, message, Main.LocalPlayer.Center - Main.screenPosition + new Vector2(0, -48), Color.White, 0.8f, 0.5f, 0.5f);

message = "";
Expand Down
25 changes: 9 additions & 16 deletions Content/Items/Forest/Accessories.AcornSprout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,21 @@ public override void SafeSetDefaults()

public override void Load()
{
StarlightPlayer.OnHitNPCWithProjEvent += SpawnAcorn;
StarlightPlayer.OnHitNPCEvent += SpawnAcorn2;
StarlightPlayer.OnHitNPCEvent += SpawnAcornItem;
StarlightPlayer.OnHitNPCWithProjEvent += SpawnAcornProjectile;
}

private void SpawnAcorn2(Player player, Item Item, NPC target, NPC.HitInfo hit, int damageDone)
private void SpawnAcornItem(Player player, Item Item, NPC target, NPC.HitInfo hit, int damageDone)
{
if (!Equipped(player))
return;
AcornCheck(player, target, damageDone);
}

if (target.life - damageDone <= 0)
{
if (player.MinionAttackTargetNPC == target.whoAmI)
{
foreach (NPC NPC in Main.npc.Where(n => n.active && n.chaseable && Vector2.DistanceSquared(n.Center, target.Center) < Math.Pow(240, 2)))
{
Projectile.NewProjectile(player.GetSource_Accessory(Item), player.Center, Vector2.Zero, ModContent.ProjectileType<Acorn>(), 5, 1, player.whoAmI, NPC.whoAmI);
}
}
}
private void SpawnAcornProjectile(Player player, Projectile proj, NPC target, NPC.HitInfo info, int damageDone)
{
AcornCheck(player, target, damageDone);
}

private void SpawnAcorn(Player player, Projectile proj, NPC target, NPC.HitInfo info, int damageDone)
private void AcornCheck(Player player, NPC target, int damageDone)
{
if (!Equipped(player))
return;
Expand Down
6 changes: 6 additions & 0 deletions Content/Items/Hell/Accessories.FuryInABottle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ private void GainCharge(Player player, Item Item, NPC target, NPC.HitInfo hit, i
{
var instance = GetEquippedInstance(player) as FuryInABottle;
instance.charge += damageDone;

if (Main.netMode == NetmodeID.MultiplayerClient)
player.GetModPlayer<StarlightPlayer>().SetHitPacketStatus(shouldRunProjMethods: false);
}
}

Expand All @@ -44,6 +47,9 @@ private void GainChargeProj(Player player, Projectile proj, NPC target, NPC.HitI
{
var instance = GetEquippedInstance(player) as FuryInABottle;
instance.charge += damageDone;

if (Main.netMode == NetmodeID.MultiplayerClient)
player.GetModPlayer<StarlightPlayer>().SetHitPacketStatus(shouldRunProjMethods: false);
}
}

Expand Down
3 changes: 3 additions & 0 deletions Content/Items/Infernal/InfernalHarvest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using StarlightRiver.Helpers;
using System;
using System.Collections.Generic;
using Terraria;
using Terraria.DataStructures;
using Terraria.Graphics.Effects;
using Terraria.ID;
Expand Down Expand Up @@ -162,6 +163,8 @@ public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
Helper.PlayPitched("Impacts/GoreLight", 0.25f, 0.5f, target.Center);

Dust.NewDustPerfect(target.Center, ModContent.DustType<Dusts.GlowLineFast>(), Vector2.UnitX.RotatedBy(Projectile.rotation - 1.57f) * 15 * direction, 0, new Color(255, 80, 0), 2.5f);

Owner.GetModPlayer<StarlightPlayer>().SetHitPacketStatus(shouldRunProjMethods: true);
}

public override bool PreDraw(ref Color lightColor)
Expand Down

0 comments on commit df2a907

Please sign in to comment.