Resolved a merge conflict.

This commit is contained in:
mountaindrew10 committed 2023-07-28 18:19:53 -05:00
commit 0d94abd263
27 files changed
+445 -134

No files matched your search

+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
{
public class AuricSetTrailLayer : PlayerDrawLayer
{
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.Head);
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.LastVanillaLayer);
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.CalPlayer.DrawLayers
{
public class CobaltSetTrailLayer : PlayerDrawLayer
{
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.Head);
public override Position GetDefaultPosition() => new AfterParent(PlayerDrawLayers.LastVanillaLayer);
public override bool GetDefaultVisibility(PlayerDrawSet drawInfo)
{
+26
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using System.Collections.Generic;
using CalamityMod.Sounds;
namespace CalamityMod.Items.Weapons.Magic
@@ -92,6 +93,31 @@ namespace CalamityMod.Items.Weapons.Magic
}
}
public override void ModifyWeaponDamage(Player player, ref StatModifier damage)
{
// scaling legendary!!!!
if (Main.zenithWorld)
{
bool plantera = NPC.downedPlantBoss;
bool golem = NPC.downedGolemBoss;
bool cultist = NPC.downedAncientCultist;
bool moonLord = NPC.downedMoonlord;
bool providence = DownedBossSystem.downedProvidence;
bool devourerOfGods = DownedBossSystem.downedDoG;
bool yharon = DownedBossSystem.downedYharon;
float damageMult = 1f +
(plantera ? 0.1f : 0f) + //1.1
(golem ? 0.15f : 0f) + //1.25
(cultist ? 3.5f : 0f) + //4.75
(moonLord ? 4.5f : 0f) + //9.25
(providence ? 7.5f : 0f) + //16.75
(devourerOfGods ? 2.5f : 0f) + //19.25
(yharon ? 30f : 0f); //49.25
damage *= damageMult;
}
}
public override void ModifyTooltips(List<TooltipLine> list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal"));
public override void AddRecipes()
{
CreateRecipe().
+101 -41
View File
@@ -4,79 +4,131 @@ using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using CalamityMod.Tiles.Furniture.CraftingStations;
using System.Collections.Generic;
using CalamityMod.Rarities;
namespace CalamityMod.Items.Weapons.Melee
{
public class Hellkite : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/WulfrumScrewdriverScrewHit") { Volume = 0.6f };
public static float PitchSound = 1;
public override void SetDefaults()
{
Item.width = 84;
Item.height = 84;
Item.scale = 1f;
Item.damage = 180;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = 30;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTime = 30;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.knockBack = 8f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.height = 84;
Item.value = CalamityGlobalItem.Rarity7BuyPrice;
Item.rare = ItemRarityID.Lime;
}
public override void MeleeEffects(Player player, Rectangle hitbox)
{
if (Main.rand.NextBool(4))
if (!Main.zenithWorld)
if (Main.rand.NextBool(4))
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 174);
}
public override bool CanUseItem(Player player)
{
if (Main.zenithWorld)
{
Item.width = 210;
Item.height = 210;
Item.scale = 2.5f;
Item.damage = 1369;
Item.DamageType = DamageClass.Melee;
Item.useTime = Item.useAnimation = 12;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.knockBack = 19f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
}
else
{
Item.width = 84;
Item.height = 84;
Item.scale = 1f;
Item.damage = 180;
Item.DamageType = DamageClass.Melee;
Item.useTime = Item.useAnimation = 30;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.knockBack = 8f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.Rarity7BuyPrice;
Item.rare = ItemRarityID.Lime;
}
return base.CanUseItem(player);
}
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.OnFire3, 300);
int onHitDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage);
player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false);
float num50 = 1.7f;
float num51 = 0.8f;
float num52 = 2f;
Vector2 value3 = (target.rotation - 1.57079637f).ToRotationVector2();
Vector2 value4 = value3 * target.velocity.Length();
SoundEngine.PlaySound(SoundID.Item14, target.Center);
int num3;
for (int num53 = 0; num53 < 40; num53 = num3 + 1)
if (Main.zenithWorld)
{
int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 200, default, num50);
Dust dust = Main.dust[num54];
dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f;
dust.noGravity = true;
dust.velocity.Y -= 6f;
dust.velocity *= 3f;
dust.velocity += value4 * Main.rand.NextFloat();
num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 100, default, num51);
dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f;
dust.velocity.Y -= 6f;
dust.velocity *= 2f;
dust.noGravity = true;
dust.fadeIn = 1f;
dust.color = Color.Crimson * 0.5f;
dust.velocity += value4 * Main.rand.NextFloat();
num3 = num53;
SoundEngine.PlaySound(UseSound with { Pitch = PitchSound * Main.rand.NextFloat(0.01f, 0.03f) });
}
for (int num55 = 0; num55 < 20; num55 = num3 + 1)
else
{
int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 0, default, num52);
Dust dust = Main.dust[num56];
dust.position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f;
dust.noGravity = true;
dust.velocity.Y -= 6f;
dust.velocity *= 0.5f;
dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat());
num3 = num55;
target.AddBuff(BuffID.OnFire3, 300);
int onHitDamage = player.CalcIntDamage<MeleeDamageClass>(Item.damage);
player.ApplyDamageToNPC(target, onHitDamage, 0f, 0, false);
float num50 = 1.7f;
float num51 = 0.8f;
float num52 = 2f;
Vector2 value3 = (target.rotation - 1.57079637f).ToRotationVector2();
Vector2 value4 = value3 * target.velocity.Length();
SoundEngine.PlaySound(SoundID.Item14, target.Center);
int num3;
for (int num53 = 0; num53 < 40; num53 = num3 + 1)
{
int num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 200, default, num50);
Dust dust = Main.dust[num54];
dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f;
dust.noGravity = true;
dust.velocity.Y -= 6f;
dust.velocity *= 3f;
dust.velocity += value4 * Main.rand.NextFloat();
num54 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 100, default, num51);
dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f;
dust.velocity.Y -= 6f;
dust.velocity *= 2f;
dust.noGravity = true;
dust.fadeIn = 1f;
dust.color = Color.Crimson * 0.5f;
dust.velocity += value4 * Main.rand.NextFloat();
num3 = num53;
}
for (int num55 = 0; num55 < 20; num55 = num3 + 1)
{
int num56 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 174, 0f, 0f, 0, default, num52);
Dust dust = Main.dust[num56];
dust.position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f;
dust.noGravity = true;
dust.velocity.Y -= 6f;
dust.velocity *= 0.5f;
dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat());
num3 = num55;
}
}
}
public override void ModifyTooltips(List<TooltipLine> list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal"));
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
{
target.AddBuff(BuffID.OnFire3, 300);
@@ -85,7 +137,15 @@ namespace CalamityMod.Items.Weapons.Melee
public override void AddRecipes()
{
CreateRecipe().
CreateRecipe().
AddCondition(new Condition("Get Fixed Boi", () => Main.zenithWorld)).
AddIngredient(ItemID.TitaniumSword).
AddIngredient<NightmareFuel>(12).
AddTile<CosmicAnvil>().
Register();
CreateRecipe().
AddCondition(new Condition(" ", () => !Main.zenithWorld)).
AddIngredient(ItemID.FieryGreatsword).
AddIngredient<PerennialBar>(8).
AddTile(TileID.MythrilAnvil).
+10
View File
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using System.Collections.Generic;
namespace CalamityMod.Items.Weapons.Summon
{
@@ -30,6 +31,8 @@ namespace CalamityMod.Items.Weapons.Summon
Item.shoot = ModContent.ProjectileType<Spikecrag>();
}
public override void ModifyTooltips(List<TooltipLine> list) => list.FindAndReplace("[GFB]", this.GetLocalizedValue(Main.zenithWorld ? "TooltipGFB" : "TooltipNormal"));
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
//CalamityUtils.OnlyOneSentry(player, type);
@@ -39,5 +42,12 @@ namespace CalamityMod.Items.Weapons.Summon
player.UpdateMaxTurrets();
return false;
}
public override void ModifyWeaponDamage(Player player, ref StatModifier damage)
{
bool superBuff = DownedBossSystem.downedProvidence && Main.zenithWorld;
float buffAMT = superBuff ? 3 : 1;
damage *= buffAMT;
}
}
}
@@ -682,11 +682,13 @@ ShiftingSands: {
SHPC: {
DisplayName: SHPC
Tooltip:
Tooltip: "[GFB]"
TooltipNormal:
'''
Fires plasma orbs that linger and emit massive explosions
Press <right> to fire powerful energy beams
'''
TooltipGFB: It scales again :)
}
SkyGlaze: {
@@ -661,11 +661,13 @@ HellionFlowerSpear: {
Hellkite: {
DisplayName: Hellkite
Tooltip:
Tooltip: "[GFB]"
TooltipNormal:
'''
Summons flame geyser explosions on enemy hits
Contains the power of an ancient drake
'''
TooltipGFB: "'My Beloved <3'"
}
HolyCollider: {
@@ -603,7 +603,13 @@ SlimePuppetStaff: {
SpikecragStaff: {
DisplayName: Spikecrag Staff
Tooltip: Summons a spikecrag to protect you
Tooltip: "[GFB]"
TooltipNormal: Summons a spikecrag to protect you
TooltipGFB:
'''
Summons a spikecrag to protect you"
Defeating the Profaned Goddess unlocks its true power
'''
}
SquirrelSquireStaff: {
@@ -358,4 +358,6 @@ PwnagehammerSmallExplosion.DisplayName: Pwnage Blast
PwnagehammerExplosionSmall.DisplayName: Pwnage Blast
PwnagehammerExplosionBig.DisplayName: Pwnage Blast
GalaxySmasherMini.DisplayName: Galaxy Smasher
GalaxySmasherEcho.DisplayName: Galaxy Smasher Echo
GalaxySmasherEcho.DisplayName: Galaxy Smasher Echo
StellarContemptBlast.DisplayName: Stellar Blast
GalaxySmasherBlast.DisplayName: Galactic Blast
+143 -8
View File
@@ -22,6 +22,9 @@ namespace CalamityMod.NPCs.Other
public int aiSwitchCounter = 420;
public int deathrayCounter = 0;
public int invincibleCounter = 0;
public int squintTimer = 0;
public int cutsceneAnimation = -1;
public int frameToUse = 0;
public bool ajitPaiDidNothingWrong = false; // christ this is old
public bool canDespawn = false;
@@ -29,6 +32,8 @@ namespace CalamityMod.NPCs.Other
public bool hasBeenPlantera = false;
public bool hasBeenGolem = false;
public bool Dying = false;
public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/Lordeath");
public override void SetStaticDefaults()
@@ -38,6 +43,7 @@ namespace CalamityMod.NPCs.Other
NPCID.Sets.DebuffImmunitySets.Add(Type, debuffData);
NPCID.Sets.ShouldBeCountedAsBoss[Type] = true;
this.HideFromBestiary();
Main.npcFrameCount[NPC.type] = 7;
}
public override void SetDefaults()
@@ -69,9 +75,13 @@ namespace CalamityMod.NPCs.Other
writer.Write(urAMemeNow);
writer.Write(hasBeenPlantera);
writer.Write(hasBeenGolem);
writer.Write(Dying);
writer.Write(invincibleCounter);
writer.Write(aiSwitchCounter);
writer.Write(deathrayCounter);
writer.Write(squintTimer);
writer.Write(cutsceneAnimation);
writer.Write(frameToUse);
}
public override void ReceiveExtraAI(BinaryReader reader)
@@ -86,9 +96,13 @@ namespace CalamityMod.NPCs.Other
urAMemeNow = reader.ReadBoolean();
hasBeenPlantera = reader.ReadBoolean();
hasBeenGolem = reader.ReadBoolean();
Dying = reader.ReadBoolean();
invincibleCounter = reader.ReadInt32();
aiSwitchCounter = reader.ReadInt32();
deathrayCounter = reader.ReadInt32();
squintTimer = reader.ReadInt32();
cutsceneAnimation = reader.ReadInt32();
frameToUse = reader.ReadInt32();
}
public override void OnSpawn(IEntitySource source)
@@ -115,6 +129,34 @@ namespace CalamityMod.NPCs.Other
{
NPC.alpha = 0;
}
// Do the death animation once killed.
if (Dying)
{
NPC.velocity *= 0.9f;
NPC.rotation = MathHelper.Lerp(NPC.rotation, 0, 1f);
if (frameToUse >= 18)
{
NPC.active = false;
NPC.HitEffect();
NPC.NPCLoot();
SoundEngine.PlaySound(DeathSound with { Volume = 2 }, Main.LocalPlayer.Center);
NPC.netUpdate = true;
}
return;
}
// Trigger the death animation
else if (NPC.life <= 1 && invincibleCounter >= 6000)
{
NPC.life = 1;
if (!Dying)
{
frameToUse = 0;
Dying = true;
}
NPC.dontTakeDamage = true;
NPC.netUpdate = true;
return;
}
if (Main.rand.NextBool(50))
{
// old was zombie 1 - zombie 62
@@ -329,26 +371,108 @@ namespace CalamityMod.NPCs.Other
}
}
public override void FindFrame(int frameHeight)
{
if (Dying)
{
NPC.frameCounter++;
if (NPC.frameCounter > 4 && frameToUse < 18)
{
frameToUse++;
NPC.frameCounter = 0;
}
}
else
{
if (squintTimer > 0)
{
squintTimer--;
}
if (cutsceneAnimation > 0)
{
NPC.frameCounter++;
if (NPC.frameCounter > 6)
{
frameToUse++;
}
if (frameToUse > 13 || frameToUse < 6)
{
frameToUse = 6;
}
cutsceneAnimation--;
}
else
{
frameToUse = 0;
}
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
SpriteEffects spriteEffects = SpriteEffects.None;
if (NPC.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
Vector2 origin = new Vector2((float)(texture.Width / 2), (float)(texture.Height / 2));
Rectangle frameUsed = texture.Frame(2, 7, 0, 1); // the idle frame by default
Rectangle squintFrame = texture.Frame(2, 7, 0, 0);
int columnAmount = Dying ? 3 : 2;
Vector2 origin = new Vector2((float)(texture.Width / (2 * columnAmount)), (float)(texture.Height / 14));
Vector2 npcOffset = NPC.Center - screenPos;
npcOffset -= new Vector2((float)texture.Width, (float)texture.Height) * NPC.scale / 2f;
npcOffset -= new Vector2((float)texture.Width / columnAmount, (float)texture.Height / 7) * NPC.scale / 2f;
npcOffset += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY);
spriteBatch.Draw(texture, npcOffset, NPC.frame, drawColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
if (Dying)
{
// death animation
texture = ModContent.Request<Texture2D>("CalamityMod/NPCs/Other/THELORDEDEATH").Value;
int xFrame = 0;
int yFrame = frameToUse;
if (frameToUse > 13)
{
xFrame = 2;
yFrame = frameToUse - 12;
}
else if (frameToUse > 6)
{
xFrame = 1;
yFrame = frameToUse - 6;
}
frameUsed = texture.Frame(3, 7, xFrame, yFrame);
}
else
{
// use his glitching animation for 4 seconds upon reaching desperation
if (cutsceneAnimation > 0)
{
int xFrame = 0;
int yFrame = 6;
if (frameToUse > 6)
{
xFrame = 1;
yFrame = frameToUse - 6;
}
frameUsed = texture.Frame(2, 7, xFrame, yFrame);
}
// squiny if he should be squinting
else if (squintTimer > 0)
{
frameUsed = squintFrame;
}
}
spriteBatch.Draw(texture, npcOffset, frameUsed, drawColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f);
return false;
}
public override void ModifyIncomingHit(ref NPC.HitModifiers modifiers)
{
modifiers.SetMaxDamage(NPC.life - 1);
// When struck below 1% HP, activates desperation and becomes essentially immune to damage.
// The hit which causes this has its damage capped at 1, then THE LORDE heals for 1 so that it doesn't take any net damage.
if ((double)NPC.life <= (double)NPC.lifeMax * 0.01f && invincibleCounter == 0 && !ajitPaiDidNothingWrong)
{
cutsceneAnimation = 240;
ajitPaiDidNothingWrong = true;
modifiers.SetMaxDamage(1);
NPC.life += 1;
@@ -373,6 +497,7 @@ namespace CalamityMod.NPCs.Other
// The hit which triggers antibutcher has its damage capped at 1, then THE LORDE heals for 1 so that it doesn't take any net damage.
modifiers.SetMaxDamage(1);
NPC.life += 1;
squintTimer = 120;
}
}
@@ -392,6 +517,7 @@ namespace CalamityMod.NPCs.Other
// The hit which triggers antibutcher has its damage capped at 1, then THE LORDE heals for 1 so that it doesn't take any net damage.
modifiers.SetMaxDamage(1);
NPC.life += 1;
squintTimer = 120;
}
}
@@ -415,6 +541,20 @@ namespace CalamityMod.NPCs.Other
return canDespawn;
}
public override bool CheckDead()
{
NPC.life = 1;
if (!Dying && invincibleCounter >= 6000)
{
frameToUse = 0;
Dying = true;
}
NPC.active = true;
NPC.dontTakeDamage = true;
NPC.netUpdate = true;
return false;
}
public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float bossLifeScale, float anotherthing)
{
NPC.lifeMax = (int)(NPC.lifeMax * 0.5f * bossLifeScale);
@@ -427,10 +567,5 @@ namespace CalamityMod.NPCs.Other
npcLoot.AddIf(() => !(CalamityWorld.LegendaryMode && CalamityWorld.revenge), ModContent.ItemType<SuspiciousLookingNOU>(), 27); // otherwise 1 in 27
npcLoot.Add(ModContent.ItemType<DeliciousMeat>(), 1, 22, (int)(pisquaredover6 * 100));
}
public override void OnKill()
{
SoundEngine.PlaySound(DeathSound with { Volume = 2 }, Main.LocalPlayer.Center);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

+1 -1
View File
@@ -2358,7 +2358,7 @@ namespace CalamityMod.Projectiles
}
}
if (player.meleeEnchant > 0 && !projectile.noEnchantments)
if (player.meleeEnchant > 0 && !projectile.noEnchantments && !projectile.noEnchantmentVisuals)
{
switch (player.meleeEnchant)
{
@@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.tileCollide = false;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.noEnchantmentVisuals = true;
}
public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f;
@@ -38,6 +38,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.tileCollide = false;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.noEnchantmentVisuals = true;
}
public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f;
@@ -37,6 +37,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.tileCollide = false;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.noEnchantmentVisuals = true;
}
public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f;
+3 -2
View File
@@ -14,7 +14,8 @@ namespace CalamityMod.Projectiles.Melee
{
public new string LocalizationCategory => "Projectiles.Melee";
public override void SetStaticDefaults() => Main.projFrames[Type] = 8;
private static float ExplosionRadius = 236f;
public override void SetDefaults()
{
Projectile.width = 472;
@@ -38,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.Kill();
}
public override bool? CanDamage() => false;
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox);
}
}
+1 -14
View File
@@ -107,22 +107,9 @@ namespace CalamityMod.Projectiles.Melee
else
SoundEngine.PlaySound(SlamHamSound, Projectile.Center);
Main.player[Projectile.owner].Calamity().GeneralScreenShakePower = 5;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<FallenBlast>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
float distance = 248f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType<FallenBlast>(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f);
for (int k = 0; k < Main.maxNPCs; k++)
{
NPC npc = Main.npc[k];
Vector2 vec = npc.Center - Projectile.Center;
float distanceTo = (float)Math.Sqrt(vec.X * vec.X + vec.Y * vec.Y);
if (distanceTo < distance && npc.CanBeChasedBy(Projectile, false) && k != Projectile.localAI[0])
{
float alldamage = Projectile.damage * 0.5f;
double damage = npc.StrikeNPC(npc.CalculateHitInfo((int)alldamage, Projectile.velocity.X > 0f ? 1 : -1, true, Projectile.knockBack));
player.addDPS((int)damage);
}
}
return false;
}
+35
View File
@@ -0,0 +1,35 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class GalaxySmasherBlast : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public Player Owner => Main.player[Projectile.owner];
private static float ExplosionRadius = 568f;
public override void SetDefaults()
{
//These shouldn't matter because its circular
Projectile.width = 568;
Projectile.height = 568;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.MeleeNoSpeed;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 2;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox);
}
}
+1 -13
View File
@@ -133,20 +133,8 @@ namespace CalamityMod.Projectiles.Melee
Particle pulse2 = new DirectionalPulseRing(Projectile.Center, Vector2.Zero, Color.Aqua, new Vector2(2f, 2f), Main.rand.NextFloat(12f, 25f), 0.1f, 1.5f, 11);
GeneralParticleHandler.SpawnParticle(pulse2);
float distance = 568f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType<GalaxySmasherBlast>(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f);
for (int k = 0; k < Main.maxNPCs; k++)
{
NPC npc = Main.npc[k];
Vector2 vec = npc.Center - Projectile.Center;
float distanceTo = (float)Math.Sqrt(vec.X * vec.X + vec.Y * vec.Y);
if (distanceTo < distance && npc.CanBeChasedBy(Projectile, false) && k != Projectile.localAI[0])
{
float alldamage = Projectile.damage * 0.5f;
double damage = npc.StrikeNPC(npc.CalculateHitInfo((int)alldamage, Projectile.velocity.X > 0f ? 1 : -1, true, Projectile.knockBack));
player.addDPS((int)damage);
}
}
return false;
}
+6 -2
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Melee
{
public new string LocalizationCategory => "Projectiles.Melee";
public static readonly SoundStyle BigSound = new("CalamityMod/Sounds/Item/PwnagehammerBigImpact");
public static readonly SoundStyle SlamHamSound = new("CalamityMod/Sounds/Item/TF2PanHit") { Volume = 1.1f };
public static readonly SoundStyle Kunk = new("CalamityMod/Sounds/Item/TF2PanHit") { Volume = 1.1f };
public int Explodamage = 0;
public override void SetStaticDefaults()
{
@@ -115,7 +115,11 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[dust].scale = 3f;
}
SoundEngine.PlaySound(BigSound, Projectile.Center);
if (Main.zenithWorld)
SoundEngine.PlaySound(Kunk, Projectile.Center);
else
SoundEngine.PlaySound(BigSound, Projectile.Center);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType<PwnagehammerExplosionBig>(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f);
+35
View File
@@ -0,0 +1,35 @@
using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Melee
{
public class StellarContemptBlast : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public Player Owner => Main.player[Projectile.owner];
private static float ExplosionRadius = 336f;
public override void SetDefaults()
{
//These shouldn't matter because its circular
Projectile.width = 336;
Projectile.height = 336;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.MeleeNoSpeed;
Projectile.ignoreWater = true;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 2;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplosionRadius, targetHitbox);
}
}
+34 -46
View File
@@ -128,54 +128,42 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[dust].velocity = velOffset;
Main.dust[dust].scale = 3.8f;
}
for (int i = 0; i < 88; ++i)
{
// Pick a random type of dust
int dustID;
switch (Main.rand.Next(6))
{
case 0:
dustID = 229;
break;
case 1:
case 2:
dustID = 156;
break;
default:
dustID = 156;
break;
}
// Choose a random speed and angle for the dust
float dustSpeed = Main.rand.NextFloat(6.0f, 29.0f);
float angleRandom = 0.09f;
Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation());
dustVel = dustVel.RotatedBy(-angleRandom);
dustVel = dustVel.RotatedByRandom(2.0f * angleRandom);
// Pick a size for the dust particle
float scale = Main.rand.NextFloat(2.2f, 4.8f);
// Actually spawn the dust
int idx = Dust.NewDust(Projectile.Center, 1, 1, dustID, dustVel.X, dustVel.Y, 0, default, scale);
Main.dust[idx].noGravity = true;
Main.dust[idx].position = Projectile.Center;
}
float distance = 336f;
for (int k = 0; k < Main.maxNPCs; k++)
{
NPC npc = Main.npc[k];
Vector2 vec = npc.Center - Projectile.Center;
float distanceTo = (float)Math.Sqrt(vec.X * vec.X + vec.Y * vec.Y);
if (distanceTo < distance && npc.CanBeChasedBy(Projectile, false) && k != Projectile.localAI[0])
for (int i = 0; i < 88; ++i)
{
float alldamage = Projectile.damage * 0.5f;
double damage = npc.StrikeNPC(npc.CalculateHitInfo((int)alldamage, Projectile.velocity.X > 0f ? 1 : -1, true, Projectile.knockBack));
player.addDPS((int)damage);
}
// Pick a random type of dust
int dustID;
switch (Main.rand.Next(6))
{
case 0:
dustID = 229;
break;
case 1:
case 2:
dustID = 156;
break;
default:
dustID = 156;
break;
}
// Choose a random speed and angle for the dust
float dustSpeed = Main.rand.NextFloat(6.0f, 29.0f);
float angleRandom = 0.09f;
Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation());
dustVel = dustVel.RotatedBy(-angleRandom);
dustVel = dustVel.RotatedByRandom(2.0f * angleRandom);
// Pick a size for the dust particle
float scale = Main.rand.NextFloat(2.2f, 4.8f);
// Actually spawn the dust
int idx = Dust.NewDust(Projectile.Center, 1, 1, dustID, dustVel.X, dustVel.Y, 0, default, scale);
Main.dust[idx].noGravity = true;
Main.dust[idx].position = Projectile.Center;
}
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType<StellarContemptBlast>(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f);
return false;
}
@@ -34,6 +34,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.tileCollide = false;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.noEnchantmentVisuals = true;
}
public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f;
+14 -1
View File
@@ -1,6 +1,8 @@
using CalamityMod.CalPlayer;
using CalamityMod.NPCs.Other;
using Terraria;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
@@ -52,7 +54,18 @@ namespace CalamityMod.Projectiles.Pets
{
SoundEngine.PlaySound(THELORDE.DeathSound with { PitchVariance = 2, MaxInstances = 5 }, Projectile.Center);
}
//Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.01f * (float)Projectile.direction;
}
public override bool PreDraw(ref Color drawColor)
{
SpriteEffects spriteEffects = SpriteEffects.None;
if (Projectile.spriteDirection == 1)
spriteEffects = SpriteEffects.FlipHorizontally;
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
Rectangle frameUsed = texture.Frame(2, 7, 0, 1);
Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), frameUsed, drawColor, Projectile.rotation, new Vector2(texture.Width / 4f, texture.Height / 14f), Projectile.scale, spriteEffects, 0);
return false;
}
}
}
+4
View File
@@ -78,6 +78,10 @@ namespace CalamityMod.Projectiles.Summon
if ((Projectile.ai[1] % 10f) == 0f)
{
int amount = Main.rand.Next(2, 4);
if (DownedBossSystem.downedProvidence && Main.zenithWorld) // spikecrag gfb buff
{
amount += 6;
}
for (int i = 0; i < amount; i++)
{
float velocityX = Main.rand.NextFloat(-10f, 10f);
+9
View File
@@ -2,6 +2,7 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Buffs.DamageOverTime;
namespace CalamityMod.Projectiles.Summon
{
@@ -31,5 +32,13 @@ namespace CalamityMod.Projectiles.Summon
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Projectile.velocity.Y += 0.1f;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Main.zenithWorld)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 180);
}
}
}
}