flesh totem finish
This commit is contained in:
1 parent
d300dbfda0
commit
115ce9be2c
18 files changed
+165
-123
No files matched your search
@@ -1,17 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Summon
|
||||
{
|
||||
public class FleshTotemBuff : BaseSummonBuff
|
||||
{
|
||||
protected override int MinionProjectileType => ModContent.ProjectileType<FleshTotemMinion>();
|
||||
|
||||
protected override ref bool MinionBool => ref BuffModdedOwner.fleshTotem;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 528 B |
+30
-15
@@ -954,6 +954,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool shatteredCommunity = false;
|
||||
public bool fleshTotem = false;
|
||||
public bool fleshTotemMinion = false;
|
||||
public bool fleshTotemVisual = false;
|
||||
public int fleshTotemManaStorage = 0;
|
||||
public bool bloodPact = false;
|
||||
public bool bloodflareCore = false;
|
||||
@@ -1079,6 +1080,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool moonCrown = false;
|
||||
public int mageCrownTimer = 0;
|
||||
public int mageCrownCount = 0;
|
||||
public int crownShatterTimer = 0;
|
||||
public bool dragonScales = false;
|
||||
public bool gloveOfPrecision = false;
|
||||
public bool gloveOfRecklessness = false;
|
||||
@@ -2410,6 +2412,7 @@ namespace CalamityMod.CalPlayer
|
||||
stressPills = false;
|
||||
laudanum = false;
|
||||
fleshTotem = false;
|
||||
fleshTotemVisual = false;
|
||||
fleshTotemMinion = false;
|
||||
bloodPact = false;
|
||||
bloodflareCore = false;
|
||||
@@ -3079,6 +3082,7 @@ namespace CalamityMod.CalPlayer
|
||||
theBeeCooldown = 0;
|
||||
scuttlerCooldown = 0;
|
||||
mageCrownTimer = 0;
|
||||
crownShatterTimer = 0;
|
||||
wingProjectileCooldown = 0;
|
||||
hallowedRuneCooldown = 0;
|
||||
sulphurBubbleCooldown = 0;
|
||||
@@ -4768,6 +4772,31 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PreItemChecks
|
||||
public override bool PreItemCheck()
|
||||
{
|
||||
//For use when the player runs out of mana. Currently only used for Feather and Moonstone Crown
|
||||
if (Player.HeldItem.mana > 0 && Player.controlUseItem && Player.itemAnimation == 0)
|
||||
{
|
||||
int manaCost = Player.GetManaCost(Player.HeldItem);
|
||||
if (Player.statMana < manaCost)
|
||||
{
|
||||
if (moonCrown)
|
||||
{
|
||||
if (mageCrownCount > 0 && crownShatterTimer == 0)
|
||||
{
|
||||
mageCrownCount = -5;
|
||||
mageCrownTimer = 300;
|
||||
crownShatterTimer = 45;
|
||||
}
|
||||
if (mageCrownCount < 0) mageCrownCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region PostUpdateEquips
|
||||
public override void PostUpdateEquips()
|
||||
{
|
||||
@@ -6194,7 +6223,7 @@ namespace CalamityMod.CalPlayer
|
||||
life.noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (modPlayer.fleshTotem)
|
||||
{
|
||||
if (Main.myPlayer == Player.whoAmI)
|
||||
@@ -6207,20 +6236,6 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
//For when the player runs out of mana
|
||||
if (Player.statMana <= manaConsumed || Player.statMana <= 6)
|
||||
{
|
||||
if (moonCrown && mageCrownCount > 0)
|
||||
{
|
||||
SoundStyle fire = new("CalamityMod/Sounds/Item/CursedDaggerThrow");
|
||||
SoundEngine.PlaySound(fire with { Volume = 0.9f, Pitch = 0.9f, PitchVariance = 0.2f, MaxInstances = -1 }, Player.Center);
|
||||
mageCrownCount -= 5;
|
||||
if (mageCrownCount < 0)
|
||||
{
|
||||
mageCrownCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -2088,22 +2088,26 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (moonCrown)
|
||||
{
|
||||
int SpawnTimer = 120;
|
||||
int MaxSigils = 9; //Starts at 0, so cap is 10
|
||||
if (mageCrownTimer >= SpawnTimer)
|
||||
if (mageCrownTimer == 0)
|
||||
{
|
||||
if (mageCrownCount <= MaxSigils)
|
||||
{
|
||||
Main.NewText(mageCrownCount);
|
||||
SoundEngine.PlaySound(SoundID.Item20, Player.Center);
|
||||
mageCrownCount += 1;
|
||||
float start = 360f / mageCrownCount;
|
||||
Projectile.NewProjectile(Player.GetSource_FromThis(), new Vector2((int)(Player.Center.X + (Math.Sin(0 * start) * 300)), (int)(Player.Center.Y + (Math.Cos(0 * start) * 300))), Vector2.Zero, ModContent.ProjectileType<MoonSigil>(), 0, 0, Player.whoAmI, 0, mageCrownCount);
|
||||
}
|
||||
mageCrownTimer = 0;
|
||||
mageCrownTimer = 120;
|
||||
}
|
||||
else if (!Player.dead)
|
||||
{
|
||||
mageCrownTimer++;
|
||||
mageCrownTimer--;
|
||||
if (crownShatterTimer > 0)
|
||||
{
|
||||
crownShatterTimer--;
|
||||
}
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1187,10 +1187,14 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
if (magic)
|
||||
{
|
||||
if (moonCrown && mageCrownCount >= 10)
|
||||
if (moonCrown && mageCrownCount == 10)
|
||||
{
|
||||
target.AddBuff(BuffType<Nightwither>(), 360);
|
||||
}
|
||||
if(featherCrown && mageCrownCount == 5)
|
||||
{
|
||||
target.AddBuff(BuffID.Frostburn, 180);
|
||||
}
|
||||
}
|
||||
if (summon)
|
||||
{
|
||||
@@ -1200,6 +1204,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (profanedCrystal && (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs))
|
||||
{
|
||||
target.AddBuff(BuffType<HolyFlames>(), 600);
|
||||
}
|
||||
else if (pSoulArtifact)
|
||||
target.AddBuff(BuffType<HolyFlames>(), 300);
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ namespace CalamityMod.Items.Accessories
|
||||
player.manaCost -= (0.01f * modPlayer.mageCrownCount); //1% per feather, up to 5%
|
||||
if (modPlayer.mageCrownCount == 5)
|
||||
{
|
||||
player.manaCost -= 0.05f;
|
||||
player.GetCritChance<MagicDamageClass>() += 5;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
using CalamityMod.Buffs.Summon;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Cooldowns;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -36,10 +33,6 @@ namespace CalamityMod.Items.Accessories
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var source = player.GetSource_Accessory(Item);
|
||||
if (player.FindBuffIndex(ModContent.BuffType<FleshTotemBuff>()) == -1)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<FleshTotemBuff>(), 3600, true);
|
||||
}
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<FleshTotemMinion>()] < 1)
|
||||
{
|
||||
int damage = (int)player.GetTotalDamage<MagicDamageClass>().ApplyTo(lostSoulDamage);
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
player.manaRegenBonus += 10;
|
||||
}
|
||||
if (modPlayer.mageCrownCount == 9)
|
||||
if (modPlayer.mageCrownCount == 10) //I don't know why it's like this
|
||||
{
|
||||
player.GetCritChance<MagicDamageClass>() += 10;
|
||||
}
|
||||
|
||||
@@ -626,10 +626,11 @@ namespace CalamityMod.Items
|
||||
//Mana Potion interactions
|
||||
if (item.healMana > 0)
|
||||
{
|
||||
//If mana potion used, kill
|
||||
if (modPlayer.moonCrown || modPlayer.featherCrown)
|
||||
//If mana potion used, kill all active Crown projectiles
|
||||
if ((modPlayer.moonCrown || modPlayer.featherCrown) && modPlayer.mageCrownCount > 0)
|
||||
{
|
||||
//modPlayer.mageCrownCount = 0;
|
||||
modPlayer.mageCrownTimer = 300;
|
||||
modPlayer.mageCrownCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1541,7 +1542,7 @@ namespace CalamityMod.Items
|
||||
|
||||
return false;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region On Create
|
||||
private static int cachedForgeID = -1;
|
||||
|
||||
@@ -769,8 +769,10 @@ FeatherCrown: {
|
||||
DisplayName: Feather Crown
|
||||
Tooltip:
|
||||
'''
|
||||
15% increased rogue projectile velocity
|
||||
Stealth strikes cause feathers to fall from the sky on enemy hits
|
||||
Summons a Skyline Feather every 2 seconds, up to a maximum of 5
|
||||
Each Skyline Feather increases magic damage by 2% and decreases mana cost by 1%
|
||||
With 5 feathers, increases magic critical strike chance by 5% and all magic attacks inflict Frostburn
|
||||
Running out of mana sheds 3 feathers, drinking a mana potion sheds all feathers
|
||||
'''
|
||||
}
|
||||
|
||||
@@ -798,7 +800,7 @@ FleshTotem: {
|
||||
'''
|
||||
5% increased magic critical strike chance
|
||||
+30 max mana
|
||||
Summons an effigy above your head that stores mana as you use it
|
||||
Summons an effigy above your head that stores mana as you use it, up to 600 mana
|
||||
The effigy occasionally pulses, restoring 30 mana
|
||||
Pulses appear more frequently the more mana is stored
|
||||
Upon being struck, the effigy unleashes all stored up mana as vengeful souls that chase your enemies
|
||||
@@ -1150,9 +1152,9 @@ MoonstoneCrown: {
|
||||
+70 max mana
|
||||
Summons a Lunar Sigil every 2 seconds, up to a maximum of 10
|
||||
Each Lunar Sigil increases magic damage by 2% and reduces mana cost by 1%
|
||||
Having 5 sigils increases mana regeneration by +5 MP/s
|
||||
Having 10 sigils increases magic critical strike chance by 10% and all magic attacks inflict Nightwither
|
||||
Running out of mana removes 5 sigils
|
||||
With 5 sigils, increases mana regeneration by +5 MP/s
|
||||
With 10 sigils, increases magic critical strike chance by 10% and all magic attacks inflict Nightwither
|
||||
Running out of mana shatters 5 sigils, drinking a mana potion shatters all sigils
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -291,3 +291,4 @@ YharimsCrystalPrism.DisplayName: Yermes Christal
|
||||
FleshTotemMinion.DisplayName: Flesh Totem Minion
|
||||
FleshTotemSoul.DisplayName: Flesh Totem Soul
|
||||
SpectralFeather.DisplayName: Spectral Feather
|
||||
MoonSigil.DisplayName: Moon Sigil
|
||||
@@ -176,7 +176,6 @@ MetalShard.DisplayName: Metal Shard
|
||||
MeteorFistProj.DisplayName: Meteor Fist Gud For A Lot Of Shtuff
|
||||
MeteorFistMeteorite.DisplayName: Meteorite REALLY Gud For A Lot Of Shtuff
|
||||
MoltenAmputatorProj.DisplayName: Molten Amputator
|
||||
MoonSigil.DisplayName: Moon Sigil
|
||||
MycorootProj.DisplayName: Mycoroot
|
||||
MythrilKnifeProjectile.DisplayName: Mythril Knife
|
||||
NanoblackMain.DisplayName: Nanoblack Reaper
|
||||
|
||||
@@ -4054,20 +4054,6 @@ namespace CalamityMod.Projectiles
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (modPlayer.moonCrown)
|
||||
{
|
||||
if (Main.player[projectile.owner].miscCounter % 120 == 0 && projectile.FinalExtraUpdate())
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType<MoonSigil>()] < 5)
|
||||
{
|
||||
int damage = (int)player.GetTotalDamage<RogueDamageClass>().ApplyTo(42);
|
||||
|
||||
int proj = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType<MoonSigil>(), damage, 0f, projectile.owner);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].DamageType = DamageClass.Generic;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (modPlayer.dragonScales)
|
||||
{
|
||||
|
||||
@@ -11,6 +11,7 @@ using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -21,6 +22,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
|
||||
public int pulseTimer = 0;
|
||||
public Player Owner => Main.player[Projectile.owner];
|
||||
public bool visuals => Owner.Calamity().fleshTotemVisual; // Enables/disables visuals and sounds based on accessory visibility
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 30;
|
||||
@@ -40,11 +43,13 @@ namespace CalamityMod.Projectiles.Magic
|
||||
bool isActive = Projectile.type == ModContent.ProjectileType<FleshTotemMinion>();
|
||||
Player player = Main.player[Projectile.owner];
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
//If the player takes off the accessory, kill the projectile
|
||||
if (!modPlayer.fleshTotemMinion)
|
||||
{
|
||||
Projectile.active = false;
|
||||
return;
|
||||
}
|
||||
//Constantly ensure the projectile stays activem unless the player dies
|
||||
if (isActive)
|
||||
{
|
||||
if (player.dead)
|
||||
@@ -57,7 +62,9 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
}
|
||||
Lighting.AddLight(Projectile.Center, 0f, 0.25f, 1.5f);
|
||||
//The totem hovers above the player's head...
|
||||
Projectile.Center = player.Center + Vector2.UnitY * (player.gfxOffY - 85f);
|
||||
//Unless gravity is flipped, in which case it's below the player and flipped
|
||||
if (player.gravDir == -1f)
|
||||
{
|
||||
Projectile.position.Y += 170f;
|
||||
@@ -67,38 +74,43 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
Projectile.rotation = 0f;
|
||||
}
|
||||
//Pulses happen every 6 seconds, divided by how much mana the totem has stored
|
||||
int pulseMax = 360;
|
||||
pulseMax = 360 - (modPlayer.fleshTotemManaStorage / 2);
|
||||
|
||||
//Ensure the pulse timer can never go below 1 second
|
||||
if (pulseMax < 60)
|
||||
{
|
||||
pulseMax = 60;
|
||||
}
|
||||
//When the timer reaches max, pulse and restore 30 mana
|
||||
if (pulseTimer >= pulseMax)
|
||||
{
|
||||
//Main.NewText(pulseMax);
|
||||
SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound, Projectile.Center);
|
||||
for (int k = 0; k < 30; k++)
|
||||
if (visuals)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.IceTorch, new Vector2(9, 9).RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(0.5f, 0.8f), 0, Color.LightSkyBlue, Main.rand.NextFloat(1.2f, 1.4f));
|
||||
dust.noGravity = true;
|
||||
dust.alpha = Main.rand.Next(70, 90 + 1);
|
||||
}
|
||||
if (modPlayer.fleshTotemManaStorage == 600)
|
||||
{
|
||||
int Dusts = 8;
|
||||
float radians = MathHelper.TwoPi / Dusts;
|
||||
Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f));
|
||||
for (int i = 0; i < Dusts; i++)
|
||||
SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound, Projectile.Center);
|
||||
for (int k = 0; k < 30; k++)
|
||||
{
|
||||
Vector2 dustVelocity = spinningPoint.RotatedBy(radians * i) * 12.5f;
|
||||
GlowSparkParticle spark = new GlowSparkParticle(Projectile.Center, dustVelocity * 0.7f, false, 12, 0.009f, Color.Cyan, new Vector2(3.5f, 1.3f), true);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, 59, dustVelocity.RotatedBy(MathHelper.ToRadians(22.5f)), 0, default, 0.9f);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.IceTorch, new Vector2(9, 9).RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(0.5f, 0.8f), 0, Color.LightSkyBlue, Main.rand.NextFloat(1.2f, 1.4f));
|
||||
dust.noGravity = true;
|
||||
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, 59, dustVelocity.RotatedBy(MathHelper.ToRadians(22.5f)) * 0.4f, 0, default, 1.2f);
|
||||
dust2.noGravity = true;
|
||||
dust.alpha = Main.rand.Next(70, 90 + 1);
|
||||
}
|
||||
if (modPlayer.fleshTotemManaStorage == 600)
|
||||
{
|
||||
int Dusts = 8;
|
||||
float radians = MathHelper.TwoPi / Dusts;
|
||||
Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f));
|
||||
for (int i = 0; i < Dusts; i++)
|
||||
{
|
||||
Vector2 dustVelocity = spinningPoint.RotatedBy(radians * i) * 12.5f;
|
||||
GlowSparkParticle spark = new GlowSparkParticle(Projectile.Center, dustVelocity * 0.7f, false, 12, 0.009f, Color.Cyan, new Vector2(3.5f, 1.3f), true);
|
||||
GeneralParticleHandler.SpawnParticle(spark);
|
||||
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.BlueTorch, dustVelocity.RotatedBy(MathHelper.ToRadians(22.5f)), 0, default, 0.9f);
|
||||
dust.noGravity = true;
|
||||
Dust dust2 = Dust.NewDustPerfect(Projectile.Center, DustID.BlueTorch, dustVelocity.RotatedBy(MathHelper.ToRadians(22.5f)) * 0.4f, 0, default, 1.2f);
|
||||
dust2.noGravity = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
int manaGained = 30;
|
||||
@@ -112,6 +124,14 @@ namespace CalamityMod.Projectiles.Magic
|
||||
}
|
||||
pulseTimer++;
|
||||
}
|
||||
//Set the player's mana storage to 0 when equipping the accessory
|
||||
public override void OnSpawn(IEntitySource source)
|
||||
{
|
||||
Player player = Main.player[Projectile.owner];
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
modPlayer.fleshTotemManaStorage = 0;
|
||||
|
||||
}
|
||||
public override bool PreDraw(ref Color lightColor)
|
||||
{
|
||||
Player player = Main.player[Projectile.owner];
|
||||
@@ -122,25 +142,29 @@ namespace CalamityMod.Projectiles.Magic
|
||||
Vector2 drawPosition = player.Center - Main.screenPosition + Vector2.UnitY * -67f;
|
||||
Vector2 origin = texture.Size() * 0.5f;
|
||||
|
||||
float fade = Utils.GetLerpValue(0, modPlayer.fleshTotemManaStorage, FleshTotem.manaStorageMax, true);
|
||||
for (int i = 0; i < 10; i++)
|
||||
if (visuals)
|
||||
{
|
||||
Main.spriteBatch.Draw(texture, drawPosition + Vector2.UnitY * -1.5f, null, Color.Cyan with { A = 0 } * fade, Projectile.rotation, origin, Projectile.scale * (Main.rand.NextFloat(0.0016f, 0.002f) * modPlayer.fleshTotemManaStorage), SpriteEffects.None, 0f);
|
||||
float fade = Utils.GetLerpValue(0, modPlayer.fleshTotemManaStorage, FleshTotem.manaStorageMax, true);
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
Main.spriteBatch.Draw(texture, drawPosition + Vector2.UnitY * -1.5f, null, Color.Cyan with { A = 0 } * fade, Projectile.rotation, origin, Projectile.scale * (Main.rand.NextFloat(0.0016f, 0.002f) * modPlayer.fleshTotemManaStorage), SpriteEffects.None, 0f);
|
||||
}
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
int dustType = Main.rand.NextBool() ? 66 : 247;
|
||||
float rotMulti = Main.rand.NextFloat(0.3f, 1f);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Vector2.UnitY / 75f, dustType);
|
||||
dust.scale = Main.rand.NextFloat(1.2f, 1.8f) * (modPlayer.fleshTotemManaStorage * 0.0009f) - rotMulti * 0.1f;
|
||||
dust.noGravity = true;
|
||||
dust.velocity = new Vector2(0, -2).RotatedByRandom(rotMulti * 0.3f) * (Main.rand.NextFloat(1f, 3.2f) - rotMulti) * (modPlayer.fleshTotemManaStorage * 0.0009f);
|
||||
dust.alpha = 1;
|
||||
dust.color = Color.Cyan;
|
||||
}
|
||||
Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
|
||||
//When at max, draw glowing eyes on the totem
|
||||
if (modPlayer.fleshTotemManaStorage == 600)
|
||||
Main.EntitySpriteDraw(totemEyes, eyesDrawPosition + Vector2.UnitX * -2f, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
|
||||
}
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
int dustType = Main.rand.NextBool() ? 66 : 247;
|
||||
float rotMulti = Main.rand.NextFloat(0.3f, 1f);
|
||||
Dust dust = Dust.NewDustPerfect(Projectile.Center + Vector2.UnitY / 75f, dustType);
|
||||
dust.scale = Main.rand.NextFloat(1.2f, 1.8f) * (modPlayer.fleshTotemManaStorage * 0.0009f) - rotMulti * 0.1f;
|
||||
dust.noGravity = true;
|
||||
dust.velocity = new Vector2(0, -2).RotatedByRandom(rotMulti * 0.3f) * (Main.rand.NextFloat(1f, 3.2f) - rotMulti) * (modPlayer.fleshTotemManaStorage * 0.0009f);
|
||||
dust.alpha = 1;
|
||||
dust.color = Color.Cyan;
|
||||
}
|
||||
Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
|
||||
if (modPlayer.fleshTotemManaStorage == 600)
|
||||
Main.EntitySpriteDraw(totemEyes, eyesDrawPosition + Vector2.UnitX * -2f, null, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0);
|
||||
return false;
|
||||
}
|
||||
public override bool? CanDamage() => false;
|
||||
|
||||
@@ -2,12 +2,9 @@
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using static CalamityMod.Systems.LavaRenderingSystem;
|
||||
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Particles;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
namespace CalamityMod.Projectiles.Mage
|
||||
{
|
||||
public class MoonSigil : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Rogue";
|
||||
public new string LocalizationCategory => "Projectiles.Mage";
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 20;
|
||||
Projectile.height = 20;
|
||||
Projectile.scale = 0.9f;
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.ignoreWater = true;
|
||||
Projectile.timeLeft = 18000;
|
||||
Projectile.penetrate = -1;
|
||||
@@ -33,7 +36,6 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
if (!modPlayer.moonCrown)
|
||||
{
|
||||
Projectile.active = false;
|
||||
modPlayer.mageCrownCount = 0;
|
||||
return;
|
||||
}
|
||||
@@ -81,7 +83,6 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
if (!Projectile.FinalExtraUpdate())
|
||||
return;
|
||||
|
||||
// Give off some light
|
||||
float lightScalar = Main.rand.NextFloat(0.9f, 1.1f) * Main.essScale;
|
||||
Lighting.AddLight(Projectile.Center, 0.3f * lightScalar, 0.26f * lightScalar, 0.15f * lightScalar);
|
||||
|
||||
@@ -99,9 +100,27 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Projectile.spriteDirection = Projectile.direction;
|
||||
|
||||
}
|
||||
public override void OnSpawn(IEntitySource source)
|
||||
{
|
||||
Player player = Main.player[Projectile.owner];
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
if (modPlayer.mageCrownCount == 10)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.DD2_DarkMageHealImpact with { Volume = 1.3f }, player.Center);
|
||||
}
|
||||
|
||||
}
|
||||
public override void OnKill(int timeLeft)
|
||||
{
|
||||
float dustSp = 0.2f;
|
||||
Player player = Main.player[Projectile.owner];
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
//Ensures the breaking sound doesn't play when the player removes the accessory
|
||||
if (modPlayer.moonCrown)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.DeerclopsIceAttack with { Volume = 0.4f, Pitch = 0.3f, MaxInstances = 1 }, player.Center);
|
||||
SoundEngine.PlaySound(Exoblade.BeamHitSound with { MaxInstances = 1 }, player.Center);
|
||||
}
|
||||
float dustSp = 0.9f;
|
||||
int dustD = 0;
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
@@ -112,10 +131,25 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Main.dust[d].noGravity = true;
|
||||
Main.dust[d].position = Projectile.Center;
|
||||
Main.dust[d].velocity = dustspeed;
|
||||
dustSp += 0.2f;
|
||||
}
|
||||
dustD += 90;
|
||||
dustSp = 0.2f;
|
||||
}
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
Color colorAccent = Main.rand.NextBool() ? Color.PaleTurquoise : Color.SeaGreen;
|
||||
|
||||
Dust shatter = Dust.NewDustPerfect(Projectile.Center, DustID.PortalBoltTrail);
|
||||
shatter.velocity = Main.rand.NextVector2Circular(4.6f, 4.6f) + Projectile.velocity * 0.5f;
|
||||
shatter.color = Color.Lerp(Color.Turquoise, colorAccent, Main.rand.NextFloat(0.23f));
|
||||
shatter.scale *= 1.1f;
|
||||
shatter.fadeIn = 0.75f;
|
||||
shatter.noGravity = true;
|
||||
}
|
||||
int shardsplash = 0;
|
||||
while (shardsplash < 4)
|
||||
{
|
||||
GeneralParticleHandler.SpawnParticle(new PointParticle(Projectile.Center, new Vector2(Main.rand.NextFloat(10), 0).RotatedByRandom(MathHelper.TwoPi), false, 10, Projectile.ai[0] == 0.6f ? 0.8f : 0.6f, Projectile.ai[0] == 1 ? Color.Turquoise : Color.LightSeaGreen, true, false));
|
||||
shardsplash += 1;
|
||||
}
|
||||
}
|
||||
public override void DrawBehind(int index, List<int> behindNPCsAndTiles, List<int> behindNPCs, List<int> behindProjectiles, List<int> overPlayers, List<int> overWiresUI)
|
||||
@@ -133,7 +167,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
if (modPlayer.mageCrownCount >= 10)
|
||||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition, null, (Color.Teal * 0.5f) with { A = 0 }, Projectile.rotation, texture.Size() * 0.5f, Projectile.scale * 1.1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 563 B After Width: | Height: | Size: 563 B |
@@ -34,7 +34,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
if (!modPlayer.featherCrown)
|
||||
{
|
||||
Projectile.active = false;
|
||||
modPlayer.mageCrownTimer = 0;
|
||||
modPlayer.mageCrownCount = 0;
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user