added young duke buff icon

This commit is contained in:
termigator1359 committed 2020-03-11 15:42:19 -04:00
1 parent 62547e6444
commit fa7745269a
5 files changed
+61 -12

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class MutatedTruffleBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Mini Old Duke");
Description.SetDefault("The young duke will protect you");
Main.buffNoTimeDisplay[Type] = true;
Main.buffNoSave[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (player.ownedProjectileCounts[ModContent.ProjectileType<YoungDuke>()] > 0)
{
modPlayer.youngDuke = true;
}
if (!modPlayer.youngDuke)
{
player.DelBuff(buffIndex);
buffIndex--;
}
else
{
player.buffTime[buffIndex] = 18000;
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

+2
View File
@@ -735,6 +735,7 @@ namespace CalamityMod.CalPlayer
public bool radiantResolution = false;
public bool plaguebringerMK2 = false;
public bool igneousExaltation = false;
public bool youngDuke = false;
// Biome
public bool ZoneCalamity = false;
@@ -1524,6 +1525,7 @@ namespace CalamityMod.CalPlayer
cSpirit = false;
rOrb = false;
dCrystal = false;
youngDuke = false;
sandWaifu = false;
sandBoobWaifu = false;
cloudWaifu = false;
+5
View File
@@ -1,3 +1,4 @@
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
@@ -30,6 +31,10 @@ namespace CalamityMod.Items.Accessories
modPlayer.miniOldDuke = true;
if (player.whoAmI == Main.myPlayer)
{
if (player.FindBuffIndex(ModContent.BuffType<MutatedTruffleBuff>()) == -1)
{
player.AddBuff(ModContent.BuffType<MutatedTruffleBuff>(), 3600, true);
}
const int damage = 1800;
if (player.ownedProjectileCounts[ModContent.ProjectileType<YoungDuke>()] < 1)
{
+18 -12
View File
@@ -39,6 +39,24 @@ namespace CalamityMod.Projectiles.Summon
{
Player player = Main.player[projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
if (!modPlayer.miniOldDuke)
{
projectile.active = false;
return;
}
bool correctMinion = projectile.type == ModContent.ProjectileType<YoungDuke>();
if (correctMinion)
{
if (player.dead)
{
modPlayer.youngDuke = false;
}
if (modPlayer.youngDuke)
{
projectile.timeLeft = 2;
}
}
// Adjust damage as needed
if (projectile.localAI[0] == 0f)
@@ -77,18 +95,6 @@ namespace CalamityMod.Projectiles.Summon
projectile.frame -= Main.projFrames[projectile.type] / 2;
}
bool correctMinion = projectile.type == ModContent.ProjectileType<YoungDuke>();
if (correctMinion)
{
if (player.dead)
{
modPlayer.miniOldDuke = false;
}
if (modPlayer.miniOldDuke)
{
projectile.timeLeft = 2;
}
}
NPC potentialTarget = projectile.Center.ClosestNPCAt(1600f);
if (potentialTarget != null)
{