This commit is contained in:
mountaindrew10 committed 2024-08-03 04:40:09 -05:00
commit b7ea3bc681
75 files changed
+1161 -1263

No files matched your search

-3
View File
@@ -338,9 +338,6 @@ namespace CalamityMod.Balancing
// 50% resist to Eidolic Wail.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType<EidolicWailSoundwave>()))));
// 35% resist to Venusian Trident's explosions.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.65f, ProjectileType<VenusianBolt>(), ProjectileType<VenusianExplosion>()))));
// 25% resist to Corinth Prime's Grenades.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.DevourerOfGodsIDs, Do(new ProjectileResistBalancingRule(0.75f, ProjectileType<CorinthPrimeAirburst>()))));
-25
View File
@@ -1,25 +0,0 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
{
public class RancorBurn : ModBuff
{
public override void SetStaticDefaults()
{
Main.debuff[Type] = true;
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
BuffID.Sets.NurseCannotRemoveDebuff[Type] = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().RancorBurnTime < npc.buffTime[buffIndex])
npc.Calamity().RancorBurnTime = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 B

+1 -1
View File
@@ -80,7 +80,7 @@ namespace CalamityMod.Items.Accessories
// Additional debuff immunities (Everything from Elysian Aegis + thematic counterparts)
player.buffImmune[BuffID.CursedInferno] = true;
player.buffImmune[BuffID.ShadowFlame] = true;
player.buffImmune[BuffID.Daybreak] = true;
player.buffImmune[ModContent.BuffType<Daybroken>()] = true;
player.buffImmune[ModContent.BuffType<Nightwither>()] = true;
player.buffImmune[ModContent.BuffType<HolyFlames>()] = true;
player.buffImmune[ModContent.BuffType<Voidfrost>()] = true;
+1 -1
View File
@@ -51,7 +51,7 @@ namespace CalamityMod.Items.Accessories
player.buffImmune[BuffID.CursedInferno] = true;
player.buffImmune[BuffID.ShadowFlame] = true;
player.buffImmune[ModContent.BuffType<BrimstoneFlames>()] = true;
player.buffImmune[BuffID.Daybreak] = true;
player.buffImmune[ModContent.BuffType<Daybroken>()] = true;
player.buffImmune[ModContent.BuffType<HolyFlames>()] = true;
}
}
+1 -1
View File
@@ -34,8 +34,8 @@ namespace CalamityMod.Items.Accessories
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<SulphuricScale>(20).
AddRecipeGroup("AnySilverBar", 10).
AddIngredient<SulphuricScale>(3).
AddTile(TileID.Anvils).
Register();
}
@@ -58,7 +58,7 @@ namespace CalamityMod.Items.Armor.Fearmonger
BuffID.Frostburn,
BuffID.CursedInferno,
BuffID.ShadowFlame, //doesn't do anything
BuffID.Daybreak, //doesn't do anything
ModContent.BuffType<Daybroken>(),
BuffID.Burning,
ModContent.BuffType<Shadowflame>(),
ModContent.BuffType<BrimstoneFlames>(),
+1 -1
View File
@@ -95,8 +95,8 @@ namespace CalamityMod.Items
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<SulphuricScale>(20).
AddRecipeGroup("IronBar", 10).
AddIngredient<SulphuricScale>().
AddTile(TileID.Anvils).
Register();
}
+1 -1
View File
@@ -27,8 +27,8 @@ namespace CalamityMod.Items.Placeables.Furniture
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<SulphuricScale>(20).
AddIngredient<Acidwood>(10).
AddIngredient<SulphuricScale>(2).
AddTile(TileID.Anvils).
Register();
}
+27 -8
View File
@@ -3,6 +3,8 @@ using CalamityMod.Projectiles.Magic;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
@@ -20,23 +22,40 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 62;
Item.height = 60;
Item.damage = 260;
Item.damage = 115;
Item.DamageType = DamageClass.Magic;
Item.mana = 20;
Item.useTime = 20;
Item.useAnimation = 20;
Item.mana = 60;
Item.useTime = 3;
Item.useAnimation = 45;
Item.reuseDelay = 75;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 7.5f;
Item.knockBack = 20f;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.UseSound = SoundID.Item43;
Item.UseSound = new SoundStyle("CalamityMod/Sounds/Item/PhantasmalFuryShoot") with { Volume = 0.6f, PitchVariance = 0.15f };
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<PhantasmalFuryProj>();
Item.shootSpeed = 12f;
Item.shootSpeed = 6f;
Item.rare = ModContent.RarityType<PureGreen>();
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectileDirect(source, position + velocity * 13, velocity.RotatedByRandom(0.3f) * Main.rand.NextFloat(0.8f, 1.1f), ModContent.ProjectileType<PhantasmalFuryProj>(), damage, 0, player.whoAmI, 0f, 0f);
for (int i = 0; i < 2; i++)
{
Projectile.NewProjectileDirect(source, position + velocity * 13, velocity.RotatedByRandom(0.4f), ModContent.ProjectileType<Phantom>(), damage / 2, 0, player.whoAmI, 0f, 0f);
}
for (int i = 0; i < 2; i++)
{
Dust chargefull = Dust.NewDustPerfect(position + velocity * 13, 267);
chargefull.velocity = velocity.RotatedByRandom(0.25f) * Main.rand.NextFloat(1f, 4);
chargefull.scale = Main.rand.NextFloat(0.5f, 0.9f);
chargefull.noGravity = true;
chargefull.color = Color.Lerp(Color.White, Color.Aqua, 0.3f);
}
return false;
}
public override void AddRecipes()
{
CreateRecipe().
+6 -6
View File
@@ -20,19 +20,19 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 58;
Item.height = 56;
Item.damage = 280;
Item.damage = 190;
Item.DamageType = DamageClass.Magic;
Item.mana = 20;
Item.useTime = 14;
Item.useAnimation = 14;
Item.mana = 10;
Item.useTime = 12;
Item.useAnimation = 12;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 8f;
Item.knockBack = 5f;
Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice;
Item.UseSound = SoundID.Item72;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<Shadowbolt>();
Item.shootSpeed = 6f;
Item.shootSpeed = 5f;
Item.rare = ModContent.RarityType<PureGreen>();
}
+5 -5
View File
@@ -21,11 +21,11 @@ namespace CalamityMod.Items.Weapons.Magic
{
Item.width = 70;
Item.height = 68;
Item.damage = 256;
Item.damage = 2156;
Item.DamageType = DamageClass.Magic;
Item.mana = 20;
Item.useTime = 25;
Item.useAnimation = 25;
Item.mana = 40;
Item.useTime = 65;
Item.useAnimation = 65;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 9f;
@@ -33,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Magic
Item.UseSound = SoundID.Item45;
Item.autoReuse = true;
Item.shoot = ModContent.ProjectileType<VenusianBolt>();
Item.shootSpeed = 19f;
Item.shootSpeed = 13f;
Item.rare = ModContent.RarityType<PureGreen>();
}
+1 -1
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue
public override void SetDefaults()
{
Item.width = 36;
Item.height = 34;
Item.height = 36;
Item.damage = 37;
Item.noMelee = true;
Item.noUseGraphic = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 935 B

+1 -1
View File
@@ -48,8 +48,8 @@ namespace CalamityMod.Items.Weapons.Summon
public override void AddRecipes()
{
CreateRecipe().
AddIngredient<SulphuricScale>(20).
AddRecipeGroup("AnySilverBar", 10).
AddIngredient<SulphuricScale>(3).
AddTile(TileID.Anvils).
Register();
}
@@ -622,11 +622,6 @@ Zerg: {
Description: Spawn rates are greatly boosted
}
RancorBurn: {
DisplayName: Rancor Burn
Description: Burning
}
AbyssalDivingSuitBuff: {
DisplayName: Abyssal Diving Suit
Description: You are made of metal
@@ -391,9 +391,8 @@ GruesomeEminence: {
DisplayName: Gruesome Eminence
Tooltip:
'''
Summons a gaseous conglomeration of spirits near the cursor
At first, the spirits will fly wildly. This can hurt enemies and players
However, over time they will begin to accumulate to create a single, controllable monstrosity
Summons a gaseous conglomeration of spirits near the cursor that fly around wildly
Over time, the spirits accumulate to create a single, controllable monstrosity
[c/C61B40:'The spirits of the amalgam could never pass on to their desired afterlife,]
[c/C61B40:Tainted and melded by rage as they were.']
'''
@@ -596,7 +595,7 @@ ParasiticSceptor: {
PhantasmalFury: {
DisplayName: Phantasmal Fury
Tooltip: Casts a phantasmal bolt that explodes into more bolts
Tooltip: Casts a vortex of homing souls around you that repels enemies and will fly towards your cursor after a few seconds
}
PhoenixFlameBarrage: {
@@ -682,7 +681,7 @@ Rancor: {
Tooltip:
'''
Casts a magic circle that charges energy and eventually releases a powerful laser burst of controlled maleficent magic
The laser causes arms and searing lava to appear on surfaces it touches which harm both you and enemies
The laser causes arms and searing lava to appear on surfaces it touches
[c/C61B40:'Forgiveness can only heal so much,]
[c/C61B40:If the recipient has not yet forgiven themselves.']
'''
@@ -751,7 +750,7 @@ ShaderainStaff: {
ShadowboltStaff: {
DisplayName: Shadowbolt Staff
Tooltip: The more tiles and enemies the beam bounces off of or travels through the more damage the beam does
Tooltip: Fires a shadow beam that creates a platform to redirect itself back at enemies for increased damage
}
ShiftingSands: {
@@ -519,9 +519,10 @@ Metastasis: {
Tooltip:
'''
Summons a Sepulcher to fight for you
While the Sepulcher is active brimstone hearts will begin to appear and orbit you
It will attempt to attack you more and more frequently depending on how many hearts are present
It takes up 4 minion slots and it can only be summoned once
While the Sepulcher is active, brimstone hearts will begin to appear and orbit you
When too many hearts are present, it will interrupt attacking to attack the hearts instead
This happens more frequently depending on how many hearts are present
Requires 4 minion slots to use and can only be summoned once
[c/C61B40:A contemplated possible future of the cosmic serpent,]
[c/C61B40:A gruesome warning for those blinded by the hunger for power.]
'''
@@ -616,6 +616,7 @@ DraedonFacility: Other minor research projects
Abyss: Disposing of Silva's remains
SulphurSea2: Irradiating one of the oceans
Roxcalibur: I wanna rock
AuricLandMines: Setting god killing traps
// Hold Shift tooltip default
HoldShiftTooltipExtensionIndicator: Hold "Left Shift" for more
HoldShiftTooltipReplacementIndicator: Hold "Left Shift" for details
+23 -9
View File
@@ -5,12 +5,12 @@ using System.Reflection;
using CalamityMod.Balancing;
using CalamityMod.Buffs;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.Placeables;
using CalamityMod.Buffs.StatBuffs;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.Summon.Whips;
using CalamityMod.CalPlayer;
using CalamityMod.Events;
using CalamityMod.Graphics.Metaballs;
using CalamityMod.Graphics.Renderers.CalamityRenderers;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Tools;
@@ -299,7 +299,7 @@ namespace CalamityMod.NPCs
public int vulnerabilityHex = 0;
public int banishingFire = 0;
public int wither = 0;
public int RancorBurnTime = 0;
public int ashesOnDeath = 0;
// whoAmI Variables
public static int[] bobbitWormBottom = new int[5];
@@ -523,7 +523,7 @@ namespace CalamityMod.NPCs
myClone.vulnerabilityHex = vulnerabilityHex;
myClone.banishingFire = banishingFire;
myClone.wither = wither;
myClone.RancorBurnTime = RancorBurnTime;
myClone.ashesOnDeath = ashesOnDeath;
// This gets set up as needed.
myClone.VulnerabilityHexFireDrawer = null;
@@ -5291,8 +5291,8 @@ namespace CalamityMod.NPCs
banishingFire--;
if (wither > 0)
wither--;
if (RancorBurnTime > 0)
RancorBurnTime--;
if (ashesOnDeath > 0)
ashesOnDeath--;
if (cobaltNerfTimer > 0)
cobaltNerfTimer--;
@@ -5376,7 +5376,7 @@ namespace CalamityMod.NPCs
{
SoundEngine.PlaySound(SoundID.Item49, Main.LocalPlayer.Center);
Vector2 shardVel = Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 7.5f;
int damage = 20;
int damage = Main.LocalPlayer.ApplyArmorAccDamageBonusesTo(20);
Projectile.NewProjectile(npc.GetSource_FromThis(), Main.LocalPlayer.Center, shardVel, ProjectileType<PearlAuraShard>(), damage, 5f, Main.myPlayer);
}
}
@@ -5392,6 +5392,7 @@ namespace CalamityMod.NPCs
if (player.miscCounter % frequency == 0)
{
int sDamage = strongerShock ? 50 : 10;
sDamage = player.ApplyArmorAccDamageBonusesTo(sDamage);
Vector2 velocity = Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 5f;
Projectile spark = Projectile.NewProjectileDirect(npc.GetSource_FromThis(), npc.Center, velocity, ProjectileType<GenericElectricSpark>(), sDamage, 0f, player.whoAmI, 0f, 1f);
spark.timeLeft = 120;
@@ -5954,7 +5955,7 @@ namespace CalamityMod.NPCs
modifiers.ScalingBonusDamage += (empowered ? 0.4f : 0.2f) * TagDamageMult;
if (Main.netMode != NetmodeID.Server)
{
var color = ProvUtils.GetProjectileColor((int)(Main.dayTime ? Providence.Providence.BossMode.Day : Providence.Providence.BossMode.Night), 0);
var color = ProvUtils.GetDayNightColor(!Main.dayTime, 0);
float power = Math.Min(npc.height / 100f, 3f);
var position = new Vector2(Main.rand.NextFloat(npc.Left.X, npc.Right.X), Main.rand.NextFloat(npc.Top.Y, npc.Bottom.Y));
var particle = new FlameParticle(position, 50, 0.25f, power, color * (Main.dayTime ? 1f : 1.25f), color * (Main.dayTime ? 1.25f : 1f));
@@ -6019,7 +6020,7 @@ namespace CalamityMod.NPCs
#region Hit Effect
public override void HitEffect(NPC npc, NPC.HitInfo hit)
{
if (npc.life <= 0 && npc.Organic() && RancorBurnTime > 0)
if (npc.life <= 0 && npc.Organic() && ashesOnDeath > 0)
DeathAshParticle.CreateAshesFromNPC(npc);
// Cultist shield flicker
@@ -6593,6 +6594,20 @@ namespace CalamityMod.NPCs
if (absorberAffliction > 0)
AbsorberAffliction.DrawEffects(npc, ref drawColor);
// Rancor's burn effect
if (ashesOnDeath > 0)
{
if (Main.rand.NextBool(4))
{
Projectile.NewProjectile(npc.GetSource_FromThis(), npc.Center, Main.rand.NextVector2Circular(2.75f, 6.5f), ProjectileType<RancorFog>(), 0, 0f, Main.myPlayer, 0f, 0.475f);
}
if (Main.rand.NextBool(6))
{
Vector2 randomPosition = new(npc.position.X + Main.rand.NextFloat(-10f, npc.width + 10f), npc.position.Y + Main.rand.NextFloat(-10f, npc.height + 10f));
RancorLavaMetaball.SpawnParticle(randomPosition, Main.rand.NextFloat(30f, 37f));
}
}
if (astralInfection > 0)
AstralInfectionDebuff.DrawEffects(npc, ref drawColor);
@@ -6857,7 +6872,6 @@ namespace CalamityMod.NPCs
("CalamityMod/Buffs/DamageOverTime/MiracleBlight", NPC => NPC.Calamity().miracleBlight > 0),
("CalamityMod/Buffs/DamageOverTime/Nightwither", NPC => NPC.Calamity().nightwither > 0),
("CalamityMod/Buffs/DamageOverTime/Plague", NPC => NPC.Calamity().pFlames > 0),
("CalamityMod/Buffs/DamageOverTime/RancorBurn", NPC => NPC.Calamity().RancorBurnTime > 0),
("CalamityMod/Buffs/DamageOverTime/RiptideDebuff", NPC => NPC.Calamity().rTide > 0),
("CalamityMod/Buffs/DamageOverTime/SagePoison", NPC => NPC.Calamity().sagePoisonTime > 0),
("CalamityMod/Buffs/DamageOverTime/ShellfishClaps", NPC => NPC.Calamity().shellfishVore > 0),
-2
View File
@@ -45,8 +45,6 @@ namespace CalamityMod.NPCs.Other
NPC.Calamity().VulnerableToWater = true;
}
public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) => NPC.lifeMax = 50000;
public override void AI()
{
NPC.Opacity = Utils.GetLerpValue(0f, 25f, Time, true);
@@ -1073,12 +1073,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
}
}
Providence.Providence.BossMode mode = Providence.Providence.BossMode.Day;
if (!Main.dayTime) mode = Providence.Providence.BossMode.Night;
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
}
// Draw laser effects
@@ -796,9 +796,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
Providence.Providence.BossMode mode = Providence.Providence.BossMode.Day;
if (!Main.dayTime) mode = Providence.Providence.BossMode.Night;
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
}
// Draw laser effects
@@ -514,9 +514,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians
Providence.Providence.BossMode mode = Providence.Providence.BossMode.Day;
if (!Main.dayTime) mode = Providence.Providence.BossMode.Night;
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
spriteBatch.Draw(texture2D16, drawLocation, NPC.frame, overrideColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
}
+2 -5
View File
@@ -156,12 +156,9 @@ namespace CalamityMod.NPCs.Providence
}
}
Providence.BossMode mode = Providence.BossMode.Day;
if (!Main.dayTime) mode = Providence.BossMode.Night;
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
spriteBatch.Draw(texture2D15, vector43, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
spriteBatch.Draw(texture2D15, vector43, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
return false;
}
+2 -5
View File
@@ -163,12 +163,9 @@ namespace CalamityMod.NPCs.Providence
}
}
Providence.BossMode mode = Providence.BossMode.Day;
if (!Main.dayTime) mode = Providence.BossMode.Night;
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
spriteBatch.Draw(texture2D16, drawLocation, NPC.frame, violetLerp, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
+2 -5
View File
@@ -158,12 +158,9 @@ namespace CalamityMod.NPCs.Providence
}
}
Providence.BossMode mode = Providence.BossMode.Day;
if (!Main.dayTime) mode = Providence.BossMode.Night;
NPC.DrawBackglow(ProvUtils.GetDayNightColor(0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
NPC.DrawBackglow(ProvUtils.GetProjectileColor((int)mode, 0, true), 4f, spriteEffects, NPC.frame, Main.screenPosition, texture2D15);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetProjectileColor((int)mode, 0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, ProvUtils.GetDayNightColor(0), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f);
return false;
}
+170 -200
View File
@@ -78,16 +78,9 @@ namespace CalamityMod.NPCs.Providence
{
Night = -1,
Day = 0,
Red = 1,
Orange = 2,
Yellow = 3,
Green = 4,
Blue = 5,
Violet = 6
Rainbow = 1,
}
public int colorShiftTimer = -1;
Color HighFireColor = new Color(255, 191, 73);
Color LowFireColor = new Color(116, 45, 23);
@@ -298,7 +291,6 @@ namespace CalamityMod.NPCs.Providence
writer.Write(text);
writer.Write(useDefenseFrames);
writer.Write(biomeType);
writer.Write(colorShiftTimer);
writer.Write(phaseChange);
writer.Write(frameUsed);
writer.Write(healTimer);
@@ -324,7 +316,6 @@ namespace CalamityMod.NPCs.Providence
text = reader.ReadBoolean();
useDefenseFrames = reader.ReadBoolean();
biomeType = reader.ReadInt32();
colorShiftTimer = reader.ReadInt32();
phaseChange = reader.ReadInt32();
frameUsed = reader.ReadInt32();
healTimer = reader.ReadInt32();
@@ -354,9 +345,6 @@ namespace CalamityMod.NPCs.Providence
public override void AI()
{
// Local helper variable to get the current boss mode without having to use the magic number version
int currentMode = (int)NPC.localAI[1];
// Set the border drawing to true if it isn't set to true
// Can happen when another mod sets to false for a difficulty and that difficulty is then toggled off.
shouldDrawInfernoBorder = true;
@@ -384,25 +372,9 @@ namespace CalamityMod.NPCs.Providence
bool bossRush = BossRushEvent.BossRushActive;
bool getFuckedAI = Main.zenithWorld;
int timeToShift = 30; //Switches color every half-second
if (getFuckedAI)
{
colorShiftTimer++;
if (colorShiftTimer == -1) //Initiate
{
NPC.localAI[1] = (float)BossMode.Red;
colorShiftTimer = 0;
}
else if (colorShiftTimer >= timeToShift)
{
NPC.localAI[1]++;
if (NPC.localAI[1] > (float)BossMode.Violet)
NPC.localAI[1] = (float)BossMode.Red;
colorShiftTimer = 0;
}
}
else if ((!Main.dayTime && !Main.remixWorld) || bossRush) // Normal Night time activity
NPC.localAI[1] = (float)BossMode.Rainbow;
else if (!ProvUtils.DayAI()) // Normal Night time activity
NPC.localAI[1] = (float)BossMode.Night;
else
NPC.localAI[1] = (float)BossMode.Day;
@@ -453,7 +425,9 @@ namespace CalamityMod.NPCs.Providence
// Increase all projectile damage at night, but reduce to 0 for Zenith
int projectileDamageMult = 1;
if (nightAI)
if (getFuckedAI)
projectileDamageMult = 0;
else if (nightAI)
projectileDamageMult = 2;
NPC.Calamity().CurrentlyEnraged = !bossRush && nightAI;
@@ -469,7 +443,7 @@ namespace CalamityMod.NPCs.Providence
int holyStarDamage = NPC.GetProjectileDamage(ModContent.ProjectileType<HolyBurnOrb>()) * projectileDamageMult;
// Change dust type at night
int dustType = ProvUtils.GetDustID(NPC.localAI[1]);
int dustType = ProvUtils.GetDustID();
// Phase times
float phaseTime = nightAI ? (240f - 60f * (1f - lifeRatio)) : 300f;
@@ -511,9 +485,9 @@ namespace CalamityMod.NPCs.Providence
float burnIntensity = CalculateBurnIntensity(attackDelayAfterCocoon);
// Color determination
Color hiColor = ProvUtils.GetProjectileColor(currentMode, 0);
Color medColor = ProvUtils.GetProjectileColor(currentMode, 255);
Color loColor = ProvUtils.GetProjectileColor(currentMode, 255, true);
Color hiColor = ProvUtils.GetProjectileColor(0);
Color medColor = ProvUtils.GetProjectileColor(255);
Color loColor = ProvUtils.GetProjectileColor(255, true);
if (!player.dead && player.active && !player.creativeGodMode && !Dying)
{
@@ -857,10 +831,7 @@ namespace CalamityMod.NPCs.Providence
{
// Slowly drift down when spawning
if (spawnAnimation)
{
colorShiftTimer++; // Also double the shift speed in the mean time :)
NPC.velocity = Vector2.Zero;
}
else
{
// Slows down while firing Holy Rays. It would've not slowed down for the Zenith seed but apparently it was too fast (shockers).
@@ -1133,8 +1104,8 @@ namespace CalamityMod.NPCs.Providence
}
CalamityUtils.AddScreenshakeAt(NPC.Center, 10, 2000);
Color hColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 255, false);
Color lColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0, true);
Color hColor = ProvUtils.GetProjectileColor(255, false);
Color lColor = ProvUtils.GetProjectileColor(0, true);
for (int i = 0; i < 30; i++)
{
@@ -1852,8 +1823,8 @@ namespace CalamityMod.NPCs.Providence
{
CalamityUtils.AddScreenshakeAt(NPC.Center, 5, 2000);
Color hiColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 255, false);
Color loColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0, true);
Color hiColor = ProvUtils.GetProjectileColor( 255, false);
Color loColor = ProvUtils.GetProjectileColor(0, true);
for (int i = 0; i < 30; i++)
{
@@ -1958,7 +1929,7 @@ namespace CalamityMod.NPCs.Providence
float shorterDistanceFade = Utils.GetLerpValue(0f, 120f, aiTimer, true);
// Distance does not get shorter if in GFB / Guardians are alive
if (!guardianAlive && NPC.localAI[1] < (float)BossMode.Red)
if (!guardianAlive && NPC.localAI[1] < (float)BossMode.Rainbow)
{
maxDistance = baseDistance;
if (AIState == (int)Phase.FlameCocoon || AIState == (int)Phase.SpearCocoon)
@@ -2025,8 +1996,8 @@ namespace CalamityMod.NPCs.Providence
{
CalamityUtils.AddScreenshakeAt(NPC.Center, 10, 2000);
Color hiColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 255, false);
Color loColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0, true);
Color hiColor = ProvUtils.GetProjectileColor(255, false);
Color loColor = ProvUtils.GetProjectileColor(0, true);
for (int i = 0; i < 30; i++)
{
@@ -2187,7 +2158,7 @@ namespace CalamityMod.NPCs.Providence
{
int frameY = (int)(NPC.Calamity().newAI[3] / 4) % 4;
float sc1 = MathHelper.Lerp(1, 0, sc);
Main.EntitySpriteDraw(orbTex.Value, NPC.Center - Main.screenPosition + new Vector2(Main.rand.NextFloat(MathHelper.Lerp(0f, 10f, sc)), 0).RotatedByRandom(MathHelper.TwoPi), orbTex.Frame(), ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0, false).MultiplyRGBA(new Color(sc * 45f, sc * 11f, sc * 22f, 0f)), 0f, orbTex.Frame().Center(), (sc * 4.4f) + (float)(Math.Cos((float)NPC.Calamity().newAI[3] / 10) * sc), SpriteEffects.None);
Main.EntitySpriteDraw(orbTex.Value, NPC.Center - Main.screenPosition + new Vector2(Main.rand.NextFloat(MathHelper.Lerp(0f, 10f, sc)), 0).RotatedByRandom(MathHelper.TwoPi), orbTex.Frame(), ProvUtils.GetProjectileColor(0, false).MultiplyRGBA(new Color(sc * 45f, sc * 11f, sc * 22f, 0f)), 0f, orbTex.Frame().Center(), (sc * 4.4f) + (float)(Math.Cos((float)NPC.Calamity().newAI[3] / 10) * sc), SpriteEffects.None);
}
}
@@ -2269,41 +2240,43 @@ namespace CalamityMod.NPCs.Providence
// Draw the glowmask textures + their afterimages
// These are the colors at their strongest point. It'll shift towards white by the brightness value used earlier.
Color WingColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0); // Default to day
Color WingColor = ProvUtils.GetProjectileColor(0); // Default to day
Color CrystalColor = Color.Violet;
switch (NPC.localAI[1])
if (NPC.localAI[1] == (float)BossMode.Rainbow)
{
case (float)BossMode.Red:
WingColor = Color.Red;
CrystalColor = Color.BlueViolet;
break;
case (float)BossMode.Orange:
WingColor = Color.Orange;
CrystalColor = Color.HotPink;
break;
case (float)BossMode.Yellow: // Same as day
break;
case (float)BossMode.Green:
WingColor = Color.Green;
CrystalColor = Color.Gold;
break;
case (float)BossMode.Blue: // Same as night
case (float)BossMode.Night:
WingColor = Color.Cyan;
CrystalColor = Color.BlueViolet;
break;
case (float)BossMode.Violet:
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
{
WingColor = Color.Magenta;
CrystalColor = Color.GreenYellow;
break;
default:
break;
}
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
{
WingColor = Color.Cyan;
CrystalColor = Color.BlueViolet;
}
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
{
WingColor = Color.Green;
CrystalColor = Color.Gold;
}
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
CrystalColor = Color.Violet;
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
{
WingColor = Color.Orange;
CrystalColor = Color.HotPink;
}
else // Red
{
WingColor = Color.Red;
CrystalColor = Color.BlueViolet;
}
}
else if (NPC.localAI[1] == (float)BossMode.Night)
{
WingColor = Color.Cyan;
CrystalColor = Color.BlueViolet;
}
Color BaseWingColor = Color.Lerp(WingColor, BaseColor, Brightness) * NPC.Opacity;
@@ -2314,13 +2287,13 @@ namespace CalamityMod.NPCs.Providence
BaseCrystalColor = colorOverride.Value;
}
Color GlowWingColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], NPC.GetAlpha(drawColor), true);
Color GlowWingColor = ProvUtils.GetProjectileColor(NPC.GetAlpha(drawColor), true);
if (CalamityConfig.Instance.Afterimages)
{
for (int j = 1; j < maxAfterimages; j++)
{
Color AfterimageWingColor = ProvUtils.GetProjectileColor((int)NPC.localAI[1], 0, true);
Color AfterimageWingColor = ProvUtils.GetProjectileColor(0, true);
AfterimageWingColor = Color.Lerp(AfterimageWingColor, BaseColor, Brightness);
AfterimageWingColor = NPC.GetAlpha(AfterimageWingColor);
AfterimageWingColor *= (maxAfterimages - j) / 15f;
@@ -2487,7 +2460,7 @@ namespace CalamityMod.NPCs.Providence
public override Color? GetAlpha(Color drawColor)
{
return ProvUtils.GetProjectileColor((int)NPC.localAI[1], drawColor) * NPC.Opacity;
return ProvUtils.GetProjectileColor(drawColor) * NPC.Opacity;
}
public override void PostDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
@@ -2514,7 +2487,7 @@ namespace CalamityMod.NPCs.Providence
int pr = (int)(progress * 30f);
Color col = ProvUtils.GetProjectileColor((int)NPC.localAI[1], Color.DarkGray, true);
Color col = ProvUtils.GetProjectileColor(Color.DarkGray, true);
col.A = 255;
Main.EntitySpriteDraw(tex, NPC.Center + vec + new Vector2(0, 310) - Main.screenPosition + new Vector2(Main.rand.Next(-pr, pr) * 2, outset), new Rectangle(0, i * 2, tex.Width, 2), Color.Lerp(col, Color.White, progress * 2f).MultiplyRGBA(new Color(255, 255, 255, MathHelper.Lerp(progress, 1f, 0.2f) * 2f)), 0f, tex.Size() / 2f, 1f, SpriteEffects.None);
@@ -2700,7 +2673,7 @@ namespace CalamityMod.NPCs.Providence
SoundEngine.PlaySound(HurtSound, NPC.Center);
}
int dustType = ProvUtils.GetDustID(NPC.localAI[1]);
int dustType = ProvUtils.GetDustID();
for (int k = 0; k < 15; k++)
{
int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, dustType, hit.HitDirection, -1f, 0, default, 1f);
@@ -2853,11 +2826,26 @@ namespace CalamityMod.NPCs.Providence
// These will be used for almost every single one of her projectiles, so it's useful to have.
public static class ProvUtils
{
public static Color GetProjectileColor(int Mode, Color givenLightColor, bool Outline = false)
public static bool DayAI() => (Main.IsItDay() || Main.remixWorld) && !Main.zenithWorld && !BossRushEvent.BossRushActive;
// Simplified to day/night only. For PSC and Profaned Guardians
public static Color GetDayNightColor(int Alpha, bool Outline = false) => GetDayNightColor(!Main.IsItDay() && !Main.remixWorld, Alpha, Outline);
public static Color GetDayNightColor(bool Night, int Alpha, bool Outline = false)
{
Color FinalColor = new Color(255, Outline ? 0 : 155, Outline ? 0 : 25, Alpha); // Default to day
if (Night)
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, Alpha);
return FinalColor;
}
public static Color GetProjectileColor(Color givenLightColor, bool Outline = false)
{
int alpha = 0;
if (!Outline && Mode == (int)Providence.BossMode.Yellow)
// Custom set alpha for GFB Yellow Mode
if (!Outline && Main.zenithWorld && Main.GlobalTimeWrappedHourly % 6f >= 2f && Main.GlobalTimeWrappedHourly % 6f < 3f)
{
float colorBrightness = (givenLightColor.R + givenLightColor.G + givenLightColor.B / 3) / 255f;
alpha = (int)MathHelper.Lerp(0f, 155f, colorBrightness);
@@ -2868,35 +2856,24 @@ namespace CalamityMod.NPCs.Providence
}
Color FinalColor = new Color(255, Outline ? 0 : 255, Outline ? 0 : 255, alpha); // Default to day
switch (Mode)
if (Main.zenithWorld)
{
case (int)Providence.BossMode.Red:
FinalColor = new Color(250, 100, Outline ? 200 : 100, alpha);
break;
case (int)Providence.BossMode.Orange:
FinalColor = new Color(250, 150, Outline ? 150 : 100, alpha);
break;
case (int)Providence.BossMode.Yellow: // Same as day
break;
case (int)Providence.BossMode.Green:
FinalColor = new Color(Outline ? 200 : 100, 250, 100, alpha);
break;
case (int)Providence.BossMode.Blue: // Same as night
case (int)Providence.BossMode.Night:
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, alpha);
break;
case (int)Providence.BossMode.Violet:
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
FinalColor = new Color(Outline ? 100 : 150, Outline ? 150 : 100, 250, alpha);
break;
default:
break;
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, alpha);
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
FinalColor = new Color(Outline ? 200 : 100, 250, 100, alpha);
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
FinalColor = new Color(255, Outline ? 0 : 255, Outline ? 0 : 255, alpha);
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
FinalColor = new Color(250, 150, Outline ? 150 : 100, alpha);
else // Red
FinalColor = new Color(250, 100, Outline ? 200 : 100, alpha);
}
else if (!DayAI())
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, alpha);
if (Outline)
FinalColor *= 0.1f;
@@ -2904,38 +2881,27 @@ namespace CalamityMod.NPCs.Providence
return FinalColor;
}
public static Color GetProjectileColor(int Mode, int Alpha, bool Outline = false)
public static Color GetProjectileColor(int Alpha, bool Outline = false)
{
Color FinalColor = new Color(255, Outline ? 0 : 155, Outline ? 0 : 25, Alpha); // Default to day
switch (Mode)
if (Main.zenithWorld)
{
case (int)Providence.BossMode.Red:
FinalColor = new Color(250, 100, Outline ? 200 : 100, Alpha);
break;
case (int)Providence.BossMode.Orange:
FinalColor = new Color(250, 150, Outline ? 150 : 100, Alpha);
break;
case (int)Providence.BossMode.Yellow: // Same as day
break;
case (int)Providence.BossMode.Green:
FinalColor = new Color(Outline ? 200 : 100, 250, 100, Alpha);
break;
case (int)Providence.BossMode.Blue: // Same as night
case (int)Providence.BossMode.Night:
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, Alpha);
break;
case (int)Providence.BossMode.Violet:
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
FinalColor = new Color(Outline ? 100 : 150, Outline ? 150 : 100, 250, Alpha);
break;
default:
break;
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, Alpha);
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
FinalColor = new Color(Outline ? 200 : 100, 250, 100, Alpha);
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
FinalColor = new Color(255, Outline ? 0 : 155, Outline ? 0 : 25, Alpha);
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
FinalColor = new Color(250, 150, Outline ? 150 : 100, Alpha);
else // Red
FinalColor = new Color(250, 100, Outline ? 200 : 100, Alpha);
}
else if (!DayAI())
FinalColor = new Color(100, Outline ? 250 : 200, Outline ? 200 : 250, Alpha);
if (Outline)
FinalColor *= 0.1f;
@@ -2943,88 +2909,92 @@ namespace CalamityMod.NPCs.Providence
return FinalColor;
}
public static int GetDustID(float Mode)
// Assign the night bool to turn it into a binary day/night state without accounting for GFB
public static int GetDustID(bool? Night = null)
{
int DustType = (int)CalamityDusts.ProfanedFire; // Default to day
switch (Mode)
if (Night.HasValue)
{
case (float)Providence.BossMode.Red:
DustType = DustID.RedTorch;
break;
case (float)Providence.BossMode.Orange:
DustType = DustID.OrangeTorch;
break;
case (float)Providence.BossMode.Yellow: // Same as day
break;
case (float)Providence.BossMode.Green:
DustType = DustID.GreenTorch;
break;
case (float)Providence.BossMode.Blue: // Same as night
case (float)Providence.BossMode.Night:
if (Night.Value)
DustType = (int)CalamityDusts.Nightwither;
break;
case (float)Providence.BossMode.Violet:
DustType = DustID.PurpleTorch;
break;
default:
break;
}
else if (Main.zenithWorld)
{
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
DustType = DustID.PurpleTorch;
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
DustType = (int)CalamityDusts.Nightwither;
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
DustType = DustID.GreenTorch;
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
DustType = (int)CalamityDusts.ProfanedFire;
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
DustType = DustID.OrangeTorch;
else // Red
DustType = DustID.RedTorch;
}
else if (!DayAI())
DustType = (int)CalamityDusts.Nightwither;
return DustType;
}
// Shortcut function for applying Burden Breaker-like negative healing to GFB Providence
public static void ApplyGFBDamage(Projectile proj, int BaseDuration, int NegativeHealValue)
{
int index = Player.FindClosest(proj.position, proj.width, proj.height);
Player player = Main.player[index];
if (player is null)
return;
if (proj.Colliding(proj.Hitbox, player.Hitbox))
ApplyDebuffs(player, BaseDuration, NegativeHealValue);
}
// Include debuffs inflicted by Providence's projectiles for all her forms
// In the GFB seed, also includes negative healing
public static void ApplyHitEffects(Player Target, int Mode, int BaseDuration, int NegativeHealValue)
public static void ApplyDebuffs(Player Target, int BaseDuration, int NegativeHealValue = 0)
{
int BuffType = ModContent.BuffType<HolyFlames>(); // Default to day
float Multiplier = 1f; // Used to counterbalance Cursed Inferno and Shadowflame
int BuffType = ModContent.BuffType<HolyFlames>(); // Default to non-GFB
// Day and Night Providence inflicts 16-80 damage of debuffs depending on attacks
// GFB Providence inflicts 24-120 damage (+50%) for half the colors, 26-130 (+62.5%) for another half
switch (Mode)
// All debuffs are adjusted to be 50% more powerful in GFB
float Multiplier = 1f;
if (Main.zenithWorld)
{
case (int)Providence.BossMode.Red:
BuffType = ModContent.BuffType<BrimstoneFlames>();
break;
case (int)Providence.BossMode.Orange:
BuffType = ModContent.BuffType<Dragonfire>();
Multiplier = 0.5f;
break;
case (int)Providence.BossMode.Yellow: // Same as day
break;
case (int)Providence.BossMode.Green:
BuffType = BuffID.CursedInferno;
Multiplier = 0.75f;
break;
case (int)Providence.BossMode.Blue: // Night Providence no longer inflicts a different debuff, but Blue GFB Providence does
BuffType = ModContent.BuffType<Nightwither>();
break;
case (int)Providence.BossMode.Night: //Same as Day, will inflict Holy Flames
break;
case (int)Providence.BossMode.Violet:
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
{
BuffType = ModContent.BuffType<Shadowflame>();
Multiplier = 0.60f;
break;
default:
break;
Multiplier = 2f;
}
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
{
BuffType = ModContent.BuffType<Nightwither>();
Multiplier = 1.5f;
}
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
{
BuffType = BuffID.CursedInferno;
Multiplier = 2.5f;
}
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
{
BuffType = ModContent.BuffType<HolyFlames>();
Multiplier = 1.5f;
}
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
BuffType = ModContent.BuffType<Dragonfire>();
else // Red
{
BuffType = ModContent.BuffType<BrimstoneFlames>();
Multiplier = 2f;
}
}
Target.AddBuff(BuffType, (int)(BaseDuration * Multiplier));
// A. Specifically inflicts Vaporfied in quirky RGB Mode because it's a colorful debuff
// B. Apply the negative healing
if (Mode >= (int)Providence.BossMode.Red)
if (Main.zenithWorld)
{
// Obligatory offensive guardian boosting negative heals
if (CalamityGlobalNPC.holyBossAttacker != -1)
+17
View File
@@ -87,6 +87,7 @@ namespace CalamityMod.NPCs.SunkenSea
if (Main.rand.NextBool(50))
{
Variant = (int)ShoalColor.Gold;
NPC.catchItem = ItemID.GoldCoin;
}
RandomOpacityOffset = Main.rand.NextFloat(MathHelper.TwoPi);
@@ -342,6 +343,22 @@ namespace CalamityMod.NPCs.SunkenSea
}
}
public override void OnCaughtBy(Player player, Item item, bool failed)
{
// Gold shoals drop Gold Coins instead of ash when caught
// The shoal drops 1 coin by default while the extra coins are spawned here in a spread
if (!failed)
{
if (Variant == (int)ShoalColor.Gold)
{
for (int i = 0; i < Main.rand.Next(0, 5); i++)
{
Item.NewItem(NPC.GetSource_CatchEntity(NPC), NPC.getRect(), ItemID.GoldCoin);
}
}
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
SpriteEffects spriteEffects = SpriteEffects.None;
+9 -3
View File
@@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.SunkenSea
{
public class SandProwler : ModNPC
{
public const int maxLength = 9;
public const int maxLength = 14;
public float speed = 3f;
public float turnSpeed = 0.0625f;
bool TailSpawned = false;
@@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.SunkenSea
public override void SetStaticDefaults()
{
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(0)
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
{
CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/SeaSerpent_Bestiary",
PortraitPositionXOverride = 40,
@@ -549,12 +549,18 @@ namespace CalamityMod.NPCs.SunkenSea
return 0f;
}
public override bool CheckActive()
{
return IsHead;
}
public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType<Serpentine>(), 4);
public override void ModifyNPCLoot(NPCLoot npcLoot) => DefineSandProwlerLoot(npcLoot);
public static void DefineSandProwlerLoot(NPCLoot npcLoot)
{
npcLoot.Add(ModContent.ItemType<Serpentine>(), 4);
}
public override void HitEffect(NPC.HitInfo hit)
{
+14 -15
View File
@@ -16,6 +16,7 @@ using Terraria.ID;
using Terraria.ModLoader;
using Terraria.ModLoader.Utilities;
using Terraria.GameContent.Bestiary;
using CalamityMod.NPCs.Crags;
namespace CalamityMod.NPCs.SunkenSea
{
@@ -54,16 +55,7 @@ namespace CalamityMod.NPCs.SunkenSea
public override void SetStaticDefaults()
{
NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers()
{
CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/SeaSerpent_Bestiary",
PortraitPositionXOverride = 40,
PortraitPositionYOverride = 20
};
value.Position.Y += 20;
value.Position.X += 40;
NPCID.Sets.NPCBestiaryDrawOffset[Type] = value;
this.HideFromBestiary();
NPCID.Sets.TrailingMode[NPC.type] = 0;
NPCID.Sets.TrailCacheLength[NPC.type] = 60;
NPCID.Sets.UsesNewTargetting[NPC.type] = true;
@@ -274,7 +266,7 @@ namespace CalamityMod.NPCs.SunkenSea
if (SnapTimer > 0f)
{
int snapTime = PeekingOut ? 45 : 32;
float idealSpeed = PeekingOut ? 1.75f : 8f;
float idealSpeed = PeekingOut ? 1.75f : 10f;
float newSpeed = MathHelper.Lerp(NPC.velocity.Length(), idealSpeed, 0.08f);
NPC.velocity = CurrentSnapDirection.ToRotationVector2() * newSpeed;
@@ -461,10 +453,7 @@ namespace CalamityMod.NPCs.SunkenSea
return 0f;
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ModContent.ItemType<Serpentine>(), 4);
}
public override void ModifyNPCLoot(NPCLoot npcLoot) => SandProwler.DefineSandProwlerLoot(npcLoot);
public override void HitEffect(NPC.HitInfo hit)
{
@@ -481,5 +470,15 @@ namespace CalamityMod.NPCs.SunkenSea
Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find<ModGore>("SeaSerpentGore1").Type, NPC.scale);
}
}
public override void OnKill()
{
// Increase the kill count of Sand Prowlers for the Bestiary
if (NPC.GetWereThereAnyInteractions())
{
NPC nPC = new NPC();
nPC.SetDefaults(ModContent.NPCType<SandProwler>());
Main.BestiaryTracker.Kills.RegisterKill(nPC);
}
}
}
}
+2 -4
View File
@@ -71,14 +71,12 @@ namespace CalamityMod.Projectiles.Boss
float a = (float)Math.Sin(amount2 / 20) + 1;
int mode = (int)Providence.BossMode.Yellow;
Color color = Color.Lerp(ProvUtils.GetProjectileColor(mode, 0, true), ProvUtils.GetProjectileColor(mode, 0, false), a);
Color color = Color.Lerp(ProvUtils.GetProjectileColor(0, true), ProvUtils.GetProjectileColor(0, false), a);
bool underworld = Projectile.ai[0] == 2f;
if (!Main.zenithWorld)
{
if (Main.IsItDay())
if (Main.IsItDay() || Main.remixWorld)
{
color.R = 255;
if (underworld)
+15 -40
View File
@@ -64,6 +64,8 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
ProvUtils.ApplyGFBDamage(Projectile, 320, 20);
Lighting.AddLight(Projectile.Center, 0.9f, 0.7f, 0f);
if (Projectile.timeLeft > TimeLeft - AccelerationTime)
@@ -72,26 +74,6 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.Hitbox.Intersects(new Rectangle((int)Projectile.ai[0], (int)Projectile.ai[1], Player.defaultWidth, Player.defaultHeight)))
Projectile.tileCollide = true;
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
else if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
Projectile.frameCounter++;
if (Projectile.frameCounter > 6)
{
@@ -105,15 +87,15 @@ namespace CalamityMod.Projectiles.Boss
{
for (int i = 0; i < 13; i++)
{
GeneralParticleHandler.SpawnParticle(new PointParticle(Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(Main.rand.NextFloat(-30f, 30f))) * Main.rand.NextFloat(2.4f, 4.2f), false, 15, Main.rand.NextFloat(3f, 6f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false)));
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(Main.rand.NextFloat(-50f, 50f))) * Main.rand.NextFloat(2.4f, 4.2f), false, 15, Main.rand.NextFloat(2f, 5f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false)));
GeneralParticleHandler.SpawnParticle(new PointParticle(Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(Main.rand.NextFloat(-30f, 30f))) * Main.rand.NextFloat(2.4f, 4.2f), false, 15, Main.rand.NextFloat(3f, 6f), ProvUtils.GetProjectileColor(255, false)));
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center, Projectile.velocity.RotatedBy(MathHelper.ToRadians(Main.rand.NextFloat(-50f, 50f))) * Main.rand.NextFloat(2.4f, 4.2f), false, 15, Main.rand.NextFloat(2f, 5f), ProvUtils.GetProjectileColor(255, false)));
}
started = true;
}
if (Projectile.localAI[0] == 0f)
{
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
int dustType = ProvUtils.GetDustID();
for (int i = 0; i < 10; i++)
{
int holyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f);
@@ -131,7 +113,7 @@ namespace CalamityMod.Projectiles.Boss
if (Math.Abs(Projectile.velocity.X) > 0.2)
Projectile.spriteDirection = -Projectile.direction;
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(50), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.6f, false, 20, Main.rand.NextFloat(1f, 2f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255)));
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(50), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.6f, false, 20, Main.rand.NextFloat(1f, 2f), ProvUtils.GetProjectileColor(255)));
GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center + new Vector2(40, 0).RotatedBy(Vector2.Zero.AngleTo(-Projectile.velocity)) + new Vector2(Main.rand.NextFloat(20), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.6f, Color.LightSlateGray, Color.DarkSlateGray, Main.rand.NextFloat(1f, 3f), 150f));
if (Projectile.velocity.X < 0f)
@@ -142,16 +124,16 @@ namespace CalamityMod.Projectiles.Boss
public override Color? GetAlpha(Color lightColor)
{
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
return ProvUtils.GetProjectileColor(lightColor);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBlastNight").Value;
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBlastNight").Value;
int framing = texture.Height / Main.projFrames[Projectile.type];
int y6 = framing * Projectile.frame;
Vector2 sc = Vector2.One;
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor, true), 4f, sc, texture);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, sc, texture);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), sc, SpriteEffects.None, 0);
return false;
@@ -159,8 +141,8 @@ namespace CalamityMod.Projectiles.Boss
public override void OnKill(int timeLeft)
{
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
Color hiColor = ProvUtils.GetProjectileColor(255, false);
Color loColor = ProvUtils.GetProjectileColor(0, true);
for (int i = 0; i < 30; i++)
{
@@ -177,7 +159,7 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.owner == Main.myPlayer)
{
int totalProjectiles = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 8 : 6;
int totalProjectiles = !ProvUtils.DayAI() ? 8 : 6;
if (CalamityWorld.LegendaryMode && CalamityWorld.revenge)
totalProjectiles *= 2;
@@ -196,7 +178,7 @@ namespace CalamityMod.Projectiles.Boss
SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, Projectile.Center);
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
int dustType = ProvUtils.GetDustID();
for (int j = 0; j < 4; j++)
{
int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 50, default, 2f);
@@ -213,20 +195,13 @@ namespace CalamityMod.Projectiles.Boss
}
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
//In GFB, "real damage" is replaced with negative healing
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
modifiers.SourceDamage *= 0f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
// If the player is dodging, don't apply debuffs
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
if (info.Damage <= 0 || target.creativeGodMode)
return;
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 320, 20);
ProvUtils.ApplyDebuffs(target, 320);
}
}
}
+10 -43
View File
@@ -37,37 +37,11 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
ProvUtils.ApplyGFBDamage(Projectile, 160, 20);
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
/*
* Day mode by default but syncs with the boss
* Uses maxPenetrate because it's kinda pointless for a boss projectile
* and it's convenient to copypaste without having to do adjustments
* If someone really feels like making a proper int for this purpose they can do it themselves - Iris
*/
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
else if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
SquishAnimation += 0.06f;
SquishAnimation = MathHelper.Clamp(SquishAnimation, 0f, 1f);
Projectile.ai[0] += 1f;
@@ -80,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss
{
Vector2 center = Projectile.Center + new Vector2(0, -15);
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(center, new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-4f, 2f)), false, 30, Main.rand.NextFloat(1f, 2.5f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255)));
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(center, new Vector2(Main.rand.NextFloat(-10f, 10f), Main.rand.NextFloat(-4f, 2f)), false, 30, Main.rand.NextFloat(1f, 2.5f), ProvUtils.GetProjectileColor(255)));
}
float velocityY = -2f;
@@ -111,25 +85,25 @@ namespace CalamityMod.Projectiles.Boss
public override Color? GetAlpha(Color lightColor)
{
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
return ProvUtils.GetProjectileColor(lightColor);
}
public override bool PreDraw(ref Color lightColor)
{
float squish = CalamityUtils.SineBumpEasing(SquishAnimation, 1) * 0.25f;
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBombNight").Value;
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBombNight").Value;
int framing = texture.Height / Main.projFrames[Projectile.type];
int y6 = framing * Projectile.frame;
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor, true), 4f, new Vector2(Projectile.scale + squish, Projectile.scale - squish), texture, offset: new Vector2(0, (-22 * (1 - squish))));
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, new Vector2(Projectile.scale + squish, Projectile.scale - squish), texture, offset: new Vector2(0, (-22 * (1 - squish))));
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, (framing / 2f) + 22), new Vector2(Projectile.scale + squish, Projectile.scale - squish), SpriteEffects.None, 0);
return false;
}
public override void OnKill(int timeLeft)
{
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
Color hiColor = ProvUtils.GetProjectileColor(255, false);
Color loColor = ProvUtils.GetProjectileColor(0, true);
for (int i = 0; i < 25; i++)
{
@@ -149,20 +123,13 @@ namespace CalamityMod.Projectiles.Boss
SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center);
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
//In GFB, "real damage" is replaced with negative healing
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
modifiers.SourceDamage *= 0f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
// If the player is dodging, don't apply debuffs
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
if (info.Damage <= 0 || target.creativeGodMode)
return;
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 160, 20);
ProvUtils.ApplyDebuffs(target, 160);
}
}
}
+10 -39
View File
@@ -35,40 +35,18 @@ namespace CalamityMod.Projectiles.Boss
Projectile.Calamity().DealsDefenseDamage = true;
}
public override void OnSpawn(IEntitySource source)
{
}
public override void AI()
{
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
ProvUtils.ApplyGFBDamage(Projectile, 120, 50);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
else if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
if (Projectile.ai[0] == 0f && BossRushEvent.BossRushActive)
Projectile.velocity *= 1.25f;
if (!started)
{
Color cl = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255);
Color cl = ProvUtils.GetProjectileColor(255);
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, cl, "CalamityMod/Particles/BlastCone", new Vector2(Main.rand.NextFloat(4f, 7f), 1.5f), Vector2.Zero.AngleTo(Projectile.velocity), 1f, 0f, 30));
started = true;
}
@@ -98,7 +76,7 @@ namespace CalamityMod.Projectiles.Boss
Projectile.localAI[1] += (Projectile.velocity.Length() / 20);
Color col = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255);
Color col = ProvUtils.GetProjectileColor(255);
float vel = MathHelper.Clamp(Projectile.velocity.Length() / 5, 0, 1.5f);
@@ -113,8 +91,8 @@ namespace CalamityMod.Projectiles.Boss
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
Vector2 drawPos = Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY);
Color baseColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, true) * 4;
Color baseColor2 = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255);
Color baseColor = ProvUtils.GetProjectileColor(255, true) * 4;
Color baseColor2 = ProvUtils.GetProjectileColor(255);
baseColor.A = 0;
baseColor *= lerpMult;
baseColor2 *= lerpMult;
@@ -147,7 +125,7 @@ namespace CalamityMod.Projectiles.Boss
{
SoundEngine.PlaySound(SoundID.Item14, Projectile.Center);
Projectile.ExpandHitboxBy(50);
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
int dustType = ProvUtils.GetDustID();
for (int d = 0; d < 5; d++)
{
int holy = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f);
@@ -170,22 +148,15 @@ namespace CalamityMod.Projectiles.Boss
}
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
//In GFB, "real damage" is replaced with negative healing
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
modifiers.SourceDamage *= 0f;
Projectile.Kill();
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => Projectile.Kill();
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
// If the player is dodging, don't apply debuffs
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
if (info.Damage <= 0 || target.creativeGodMode)
return;
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 120, 50);
ProvUtils.ApplyDebuffs(target, 120);
}
}
}
+10 -36
View File
@@ -35,36 +35,17 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
ProvUtils.ApplyGFBDamage(Projectile, 80, 20);
Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f);
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
else if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
if (Projectile.ai[1] == 0f)
{
Projectile.ai[1] = 1f;
SoundEngine.PlaySound(SoundID.Item20, Projectile.Center);
}
Projectile.alpha -= (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 10 : 5;
Projectile.alpha -= !ProvUtils.DayAI() ? 10 : 5;
if (Projectile.alpha <= 0)
Projectile.Kill();
@@ -80,24 +61,24 @@ namespace CalamityMod.Projectiles.Boss
public override Color? GetAlpha(Color lightColor)
{
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
return ProvUtils.GetProjectileColor(lightColor);
}
public override bool PreDraw(ref Color lightColor)
{
Projectile.scale = 1.5f;
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFireNight").Value;
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFireNight").Value;
int framing = texture.Height / Main.projFrames[Projectile.type];
int y6 = framing * Projectile.frame;
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor, true), 4f, new Vector2(Projectile.scale));
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, new Vector2(Projectile.scale));
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override void OnKill(int timeLeft)
{
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
Color hiColor = ProvUtils.GetProjectileColor(255, false);
Color loColor = ProvUtils.GetProjectileColor(0, true);
for (int i = 0; i < 25; i++)
{
@@ -148,20 +129,13 @@ namespace CalamityMod.Projectiles.Boss
SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center);
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
//In GFB, "real damage" is replaced with negative healing
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
modifiers.SourceDamage *= 0f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
// If the player is dodging, don't apply debuffs
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
if (info.Damage <= 0 || target.creativeGodMode)
return;
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 80, 20);
ProvUtils.ApplyDebuffs(target, 80);
}
}
}
+10 -36
View File
@@ -35,29 +35,10 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
ProvUtils.ApplyGFBDamage(Projectile, 80, 10);
Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f);
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
else if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
Projectile.frameCounter++;
if (Projectile.frameCounter > 6)
{
@@ -82,7 +63,7 @@ namespace CalamityMod.Projectiles.Boss
Vector2 playerDirection = Main.player[playerTracker].Center - Projectile.Center;
playerDirection.Normalize();
playerDirection *= projVelocityMult;
float inertia = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 20f : 25f;
float inertia = !ProvUtils.DayAI() ? 20f : 25f;
Projectile.velocity = (Projectile.velocity * (inertia - 1f) + playerDirection) / inertia;
Projectile.velocity.Normalize();
Projectile.velocity *= projVelocityMult;
@@ -90,7 +71,7 @@ namespace CalamityMod.Projectiles.Boss
float vel = Math.Clamp(((Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) / 2), 0f, 1f);
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.2f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255)));
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.2f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255)));
if (Main.rand.NextBool())
{
@@ -102,15 +83,15 @@ namespace CalamityMod.Projectiles.Boss
public override Color? GetAlpha(Color lightColor)
{
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
return ProvUtils.GetProjectileColor(lightColor);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFire2Night").Value;
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFire2Night").Value;
int framing = texture.Height / Main.projFrames[Projectile.type];
int y6 = framing * Projectile.frame;
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor, true), 4f, texture);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, texture);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
@@ -124,7 +105,7 @@ namespace CalamityMod.Projectiles.Boss
Projectile.height = 40;
Projectile.position.X = Projectile.position.X - (Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (Projectile.height / 2);
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
int dustType = ProvUtils.GetDustID();
for (int i = 0; i < 5; i++)
{
int holyDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, 2f);
@@ -144,20 +125,13 @@ namespace CalamityMod.Projectiles.Boss
}
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
//In GFB, "real damage" is replaced with negative healing
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
modifiers.SourceDamage *= 0f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
// If the player is dodging, don't apply debuffs
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
if (info.Damage <= 0 || target.creativeGodMode)
return;
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 80, 10);
ProvUtils.ApplyDebuffs(target, 80);
}
}
}
+12 -38
View File
@@ -36,29 +36,10 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
ProvUtils.ApplyGFBDamage(Projectile, 120, 20);
Lighting.AddLight(Projectile.Center, 0.35f, 0.275f, 0f);
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
else if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
Player player = Main.player[Projectile.owner];
Projectile.frameCounter++;
@@ -75,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.velocity.Y > velocityYCap)
Projectile.velocity.Y = velocityYCap;
float velocityX = Projectile.maxPenetrate != (int)Providence.BossMode.Day ? 0.025f : 0.02f;
float velocityX = !ProvUtils.DayAI() ? 0.025f : 0.02f;
if (Projectile.position.X + Projectile.width < player.position.X)
{
if (Projectile.velocity.X < 0f)
@@ -89,13 +70,13 @@ namespace CalamityMod.Projectiles.Boss
Projectile.velocity.X -= velocityX;
}
float velocityXCap = Projectile.maxPenetrate != (int)Providence.BossMode.Day ? 10f : 8f;
float velocityXCap = !ProvUtils.DayAI() ? 10f : 8f;
if (Projectile.velocity.X > velocityXCap || Projectile.velocity.X < -velocityXCap)
Projectile.velocity.X *= 0.97f;
float vel = Math.Clamp(((Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) / 2), 0f, 1f);
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.5f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255)));
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.5f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255)));
if (Main.rand.NextBool())
{
@@ -107,23 +88,23 @@ namespace CalamityMod.Projectiles.Boss
public override Color? GetAlpha(Color lightColor)
{
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
return ProvUtils.GetProjectileColor(lightColor);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = Projectile.maxPenetrate == (int)Providence.BossMode.Day ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFlareNight").Value;
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFlareNight").Value;
int framing = texture.Height / Main.projFrames[Projectile.type];
int y6 = framing * Projectile.frame;
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor, true), 4f, texture);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, texture);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override void OnKill(int timeLeft)
{
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
Color hiColor = ProvUtils.GetProjectileColor(255, false);
Color loColor = ProvUtils.GetProjectileColor(0, true);
for (int i = 0; i < 25; i++)
{
@@ -142,20 +123,13 @@ namespace CalamityMod.Projectiles.Boss
SoundEngine.PlaySound(SoundID.Item100.WithPitchOffset(0.4f), Projectile.Center);
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
//In GFB, "real damage" is replaced with negative healing
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
modifiers.SourceDamage *= 0f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
// If the player is dodging, don't apply debuffs
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
if (info.Damage <= 0 || target.creativeGodMode)
return;
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 120, 20);
ProvUtils.ApplyDebuffs(target, 120);
}
}
}
+51 -119
View File
@@ -55,26 +55,9 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
Lighting.AddLight(Projectile.Center, 0.45f * Projectile.Opacity, 0.35f * Projectile.Opacity, 0f);
ProvUtils.ApplyGFBDamage(Projectile, 120, 20);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
else if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
Lighting.AddLight(Projectile.Center, 0.45f * Projectile.Opacity, 0.35f * Projectile.Opacity, 0f);
if (Projectile.localAI[0] == 0f)
{
@@ -86,14 +69,14 @@ namespace CalamityMod.Projectiles.Boss
bool commanderSpear = Projectile.ai[0] == -1f;
bool enragedCommanderSpear = Projectile.ai[0] == -2f;
float timeGateValue = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 420f : ((commanderSpear || enragedCommanderSpear) ? 360f : 540f);
float timeGateValue = !ProvUtils.DayAI() ? 420f : ((commanderSpear || enragedCommanderSpear) ? 360f : 540f);
if (Projectile.ai[0] <= 0f)
{
Projectile.ai[1] += 1f;
float slowGateValue = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 60f : ((commanderSpear || enragedCommanderSpear) ? 30f : 90f);
float slowGateValue = !ProvUtils.DayAI() ? 60f : ((commanderSpear || enragedCommanderSpear) ? 30f : 90f);
float fastGateValue = 30f;
float minVelocity = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 4f : (enragedCommanderSpear ? 6f : commanderSpear ? 4.5f : 3f);
float minVelocity = !ProvUtils.DayAI() ? 4f : (enragedCommanderSpear ? 6f : commanderSpear ? 4.5f : 3f);
float maxVelocity = minVelocity * 4f;
float extremeVelocity = maxVelocity * 2f;
float deceleration = 0.95f;
@@ -122,8 +105,8 @@ namespace CalamityMod.Projectiles.Boss
}
else
{
float frequency = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 0.2f : 0.1f;
float amplitude = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 4f : 2f;
float frequency = !ProvUtils.DayAI() ? 0.2f : 0.1f;
float amplitude = !ProvUtils.DayAI() ? 4f : 2f;
Projectile.ai[1] += frequency;
@@ -145,49 +128,27 @@ namespace CalamityMod.Projectiles.Boss
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
bool aimedSpear = Projectile.ai[0] > 0f;
int red = 255;
int green = 255;
int blue = 0;
switch (Projectile.maxPenetrate)
{
case (int)Providence.BossMode.Red:
red = 255;
green = aimedSpear ? 0 : 125;
blue = aimedSpear ? 0 : 255;
break;
case (int)Providence.BossMode.Orange:
red = 255;
green = 125;
blue = aimedSpear ? 0 : 175;
break;
case (int)Providence.BossMode.Yellow: //Same as day
case (int)Providence.BossMode.Day:
red = 255;
green = aimedSpear ? 255 : 125;
blue = aimedSpear ? 25 : 125;
break;
case (int)Providence.BossMode.Green:
red = 0;
green = 255;
blue = aimedSpear ? 0 : 175;
break;
case (int)Providence.BossMode.Blue: //Same as night
case (int)Providence.BossMode.Night:
red = aimedSpear ? 100 : 175;
green = aimedSpear ? 255 : 175;
blue = 255;
break;
case (int)Providence.BossMode.Violet:
red = aimedSpear ? 125 : 255;
green = aimedSpear ? 0 : 255;
blue = 125;
break;
default:
break;
}
Color baseColor = new Color(red, green, blue, 0);
Color baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125); // Default to day
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(20), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity, false, 15, Main.rand.NextFloat(0.5f, 1.5f) * MathHelper.Clamp(Projectile.velocity.Length() / 15, 0f, 2f), aimedSpear ? baseColor : ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false)));
if (Main.zenithWorld)
{
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
baseColor = new Color(aimedSpear ? 125 : 255, aimedSpear ? 0 : 255, 125);
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
baseColor = new Color(aimedSpear ? 100 : 175, aimedSpear ? 255 : 175, 255);
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
baseColor = new Color(0, 255, aimedSpear ? 0 : 175);
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125);
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
baseColor = new Color(255, 125, aimedSpear ? 0 : 175);
else // Red
baseColor = new Color(255, aimedSpear ? 0 : 125, aimedSpear ? 0 : 255);
}
else if (!ProvUtils.DayAI())
baseColor = new Color(aimedSpear ? 100 : 175, aimedSpear ? 255 : 175, 255);
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(20), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity, false, 15, Main.rand.NextFloat(0.5f, 1.5f) * MathHelper.Clamp(Projectile.velocity.Length() / 15, 0f, 2f), aimedSpear ? baseColor : ProvUtils.GetProjectileColor(255, false)));
}
public override bool PreDraw(ref Color lightColor)
@@ -195,53 +156,31 @@ namespace CalamityMod.Projectiles.Boss
Texture2D drawTexture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
bool aimedSpear = Projectile.ai[0] > 0f;
int red = 255;
int green = 255;
int blue = 0;
switch (Projectile.maxPenetrate)
{
case (int)Providence.BossMode.Red:
red = 255;
green = aimedSpear ? 0 : 125;
blue = aimedSpear ? 0 : 255;
break;
case (int)Providence.BossMode.Orange:
red = 255;
green = 125;
blue = aimedSpear ? 0 : 175;
break;
case (int)Providence.BossMode.Yellow: //Same as day
case (int)Providence.BossMode.Day:
red = 255;
green = aimedSpear ? 255 : 125;
blue = aimedSpear ? 0 : 125;
break;
case (int)Providence.BossMode.Green:
red = 0;
green = 255;
blue = aimedSpear ? 0 : 175;
break;
case (int)Providence.BossMode.Blue: //Same as night
case (int)Providence.BossMode.Night:
red = aimedSpear ? 100 : 175;
green = aimedSpear ? 255 : 175;
blue = 255;
break;
case (int)Providence.BossMode.Violet:
red = aimedSpear ? 125 : 255;
green = aimedSpear ? 0 : 255;
blue = 125;
break;
default:
break;
}
Color baseColor = new Color(red, green, blue, 0);
Color baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125); // Default to day
Color baseColor2 = new Color(15, 35, 50, 0);
if (Main.zenithWorld)
{
if (Main.GlobalTimeWrappedHourly % 6f >= 5f) // Violet
baseColor = new Color(aimedSpear ? 125 : 255, aimedSpear ? 0 : 255, 125);
else if (Main.GlobalTimeWrappedHourly % 6f >= 4f) // Blue
baseColor = new Color(aimedSpear ? 100 : 175, aimedSpear ? 255 : 175, 255);
else if (Main.GlobalTimeWrappedHourly % 6f >= 3f) // Green
baseColor = new Color(0, 255, aimedSpear ? 0 : 175);
else if (Main.GlobalTimeWrappedHourly % 6f >= 2f) // Yellow
baseColor = new Color(255, aimedSpear ? 255 : 125, aimedSpear ? 25 : 125);
else if (Main.GlobalTimeWrappedHourly % 6f >= 1f) // Orange
baseColor = new Color(255, 125, aimedSpear ? 0 : 175);
else // Red
baseColor = new Color(255, aimedSpear ? 0 : 125, aimedSpear ? 0 : 255);
}
else if (!ProvUtils.DayAI())
baseColor = new Color(aimedSpear ? 100 : 175, aimedSpear ? 255 : 175, 255);
if (!aimedSpear)
{
baseColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
baseColor2 = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
baseColor = ProvUtils.GetProjectileColor(0);
baseColor2 = ProvUtils.GetProjectileColor(0, true);
}
Vector2 projDirection = Main.screenPosition - new Vector2(0f, Projectile.gfxOffY);
@@ -274,25 +213,18 @@ namespace CalamityMod.Projectiles.Boss
return false;
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
//In GFB, "real damage" is replaced with negative healing
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
modifiers.SourceDamage *= 0f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
// If the player is dodging, don't apply debuffs
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
if (info.Damage <= 0 || target.creativeGodMode)
return;
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 120, 20);
ProvUtils.ApplyDebuffs(target, 120);
}
public override Color? GetAlpha(Color lightColor)
{
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, false);
return ProvUtils.GetProjectileColor(0, false);
}
}
}
+12 -37
View File
@@ -53,6 +53,8 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
ProvUtils.ApplyGFBDamage(Projectile, 160, 20);
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
if (Projectile.timeLeft > TimeLeft - AccelerationTime)
@@ -61,26 +63,6 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.Hitbox.Intersects(new Rectangle((int)Projectile.ai[0], (int)Projectile.ai[1], Player.defaultWidth, Player.defaultHeight)))
Projectile.tileCollide = true;
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
else if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
Projectile.frameCounter++;
if (Projectile.frameCounter > 6)
{
@@ -90,7 +72,7 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.frame > 3)
Projectile.frame = 0;
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
int dustType = ProvUtils.GetDustID();
if (Projectile.localAI[1] == 0f)
{
for (int d = 0; d < 10; d++)
@@ -130,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss
float vel = Math.Clamp(((Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) / 2), 0f, 1f);
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.5f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255)));
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(15), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.5f, false, 10, Main.rand.NextFloat(0.8f, 1.2f), ProvUtils.GetProjectileColor(255)));
if (Main.rand.NextBool())
{
@@ -140,23 +122,23 @@ namespace CalamityMod.Projectiles.Boss
public override Color? GetAlpha(Color lightColor)
{
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
return ProvUtils.GetProjectileColor(0);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MoltenBlastNight").Value;
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MoltenBlastNight").Value;
int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type];
int y6 = framing * Projectile.frame;
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha, true), 4f, texture);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.alpha, true), 4f, texture);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
public override void OnKill(int timeLeft)
{
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
Color hiColor = ProvUtils.GetProjectileColor(255, false);
Color loColor = ProvUtils.GetProjectileColor(0, true);
for (int i = 0; i < 25; i++)
{
@@ -171,7 +153,7 @@ namespace CalamityMod.Projectiles.Boss
}
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.02f, 0.045f, 5));
int blobAmt = (Projectile.maxPenetrate != (int)Providence.BossMode.Day) ? 9 : 6;
int blobAmt = !ProvUtils.DayAI() ? 9 : 6;
if (Projectile.owner == Main.myPlayer)
{
Vector2 additionalBlobVelocity = new Vector2(Projectile.velocity.X * 0.1f, Projectile.velocity.Y);
@@ -189,20 +171,13 @@ namespace CalamityMod.Projectiles.Boss
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 18f, targetHitbox);
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
//In GFB, "real damage" is replaced with negative healing
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
modifiers.SourceDamage *= 0f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
// If the player is dodging, don't apply debuffs
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
if (info.Damage <= 0 || target.creativeGodMode)
return;
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 160, 20);
ProvUtils.ApplyDebuffs(target, 160);
}
}
}
+9 -35
View File
@@ -37,30 +37,11 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
ProvUtils.ApplyGFBDamage(Projectile, 80, 10);
Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f);
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
else if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
Landing += 0.1f;
Landing = MathHelper.Clamp(Landing, 0f, 1f);
colliding = Projectile.velocity.Y == 0f;
@@ -115,12 +96,12 @@ namespace CalamityMod.Projectiles.Boss
public override Color? GetAlpha(Color lightColor)
{
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
return ProvUtils.GetProjectileColor(0);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MoltenBlobNight").Value;
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/MoltenBlobNight").Value;
int framing = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value.Height / Main.projFrames[Projectile.type];
int y6 = framing * (1 + Projectile.frame);
float squish = CalamityUtils.SineBumpEasing(Landing, 1) * 0.5f;
@@ -132,15 +113,15 @@ namespace CalamityMod.Projectiles.Boss
Projectile.rotation = Vector2.Zero.AngleTo(Projectile.velocity) + MathHelper.PiOver2;
}
Vector2 vec = new Vector2(0, framing * squish);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha, true), 4f, new Vector2(1 + squish, 1 - squish), texture, offset: vec);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.alpha, true), 4f, new Vector2(1 + squish, 1 - squish), texture, offset: vec);
Main.spriteBatch.Draw(texture, Projectile.Center + vec - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), new Vector2(1 + squish, 1 - squish), SpriteEffects.None, 0);
return false;
}
public override void OnKill(int timeLeft)
{
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
Color hiColor = ProvUtils.GetProjectileColor(255, false);
Color loColor = ProvUtils.GetProjectileColor(0, true);
for (int i = 0; i < 25; i++)
{
@@ -156,20 +137,13 @@ namespace CalamityMod.Projectiles.Boss
GeneralParticleHandler.SpawnParticle(new CustomPulse(Projectile.Center, Vector2.Zero, hiColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.002f, 0.015f, 5));
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
//In GFB, "real damage" is replaced with negative healing
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
modifiers.SourceDamage *= 0f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
// If the player is dodging, don't apply debuffs
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
if (info.Damage <= 0 || target.creativeGodMode)
return;
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 80, 10);
ProvUtils.ApplyDebuffs(target, 80);
}
}
}
+5 -17
View File
@@ -37,18 +37,6 @@ namespace CalamityMod.Projectiles.Boss
{
Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f);
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
if (Projectile.timeLeft < 510)
Projectile.tileCollide = true;
@@ -73,13 +61,13 @@ namespace CalamityMod.Projectiles.Boss
public override Color? GetAlpha(Color lightColor)
{
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha);
return ProvUtils.GetDayNightColor(Projectile.alpha);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = (Projectile.maxPenetrate == (int)Providence.BossMode.Day) ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/ProfanedSpearNight").Value;
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(Projectile.maxPenetrate, Projectile.alpha, true), 4f, texture);
Texture2D texture = ProvUtils.DayAI() ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/ProfanedSpearNight").Value;
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(Projectile.alpha, true), 4f, texture);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, 0, texture.Width, texture.Height)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, texture.Height / 2f), Projectile.scale, SpriteEffects.None, 0);
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
return false;
@@ -87,8 +75,8 @@ namespace CalamityMod.Projectiles.Boss
public override void OnKill(int timeLeft)
{
Color hiColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255, false);
Color loColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0, true);
Color hiColor = ProvUtils.GetDayNightColor(255, false);
Color loColor = ProvUtils.GetDayNightColor(0, true);
for (int i = 0; i < 25; i++)
{
+2 -4
View File
@@ -91,8 +91,6 @@ namespace CalamityMod.Projectiles.Boss
Player proviTarget = Main.player[Main.npc[CalamityGlobalNPC.holyBoss].target];
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
Projectile.position.X = proviTarget.Center.X - (Projectile.width / 2);
Projectile.position.Y = proviTarget.Center.Y - (Projectile.height / 2) + proviTarget.gfxOffY - 360f;
if (proviTarget.gravDir == -1f)
@@ -113,7 +111,7 @@ namespace CalamityMod.Projectiles.Boss
if (Projectile.alpha == 0 && Main.rand.NextBool(15))
{
Color BaseColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
Color BaseColor = ProvUtils.GetProjectileColor(0);
float Brightness = 0.8f;
Color DustColor = Color.Lerp(BaseColor, Color.White, Brightness);
Dust crystalDust = Main.dust[Dust.NewDust(Projectile.Top, 0, 0, DustID.RainbowMk2, 0f, 0f, 100, DustColor, 1f)];
@@ -132,7 +130,7 @@ namespace CalamityMod.Projectiles.Boss
// At day, fires every 300 frames but lasts 1500-3600 frames.
// At night, fires every 30 framges but lasts 210 frames.
// In GFB, fires at night rate for the first 210 frames, then at day rate for the next 1500.
bool dayAI = Projectile.maxPenetrate == (int)Providence.BossMode.Day || (Projectile.maxPenetrate >= (int)Providence.BossMode.Red && Projectile.timeLeft < 1500);
bool dayAI = ProvUtils.DayAI() || (Main.zenithWorld && Projectile.timeLeft < 1500);
if (Projectile.localAI[0] >= (dayAI ? 300f : 30f))
{
+3 -26
View File
@@ -51,23 +51,16 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
ProvUtils.ApplyGFBDamage(Projectile, 0, 10);
bool healerGuardianAlive = true;
if (CalamityGlobalNPC.doughnutBossHealer < 0 || !Main.npc[CalamityGlobalNPC.doughnutBossHealer].active)
healerGuardianAlive = false;
Lighting.AddLight(Projectile.Center, 0.3f * Projectile.Opacity, 0.3f * Projectile.Opacity, 0.3f * Projectile.Opacity);
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
// Night AI or Guardian Healer
if (Projectile.maxPenetrate != (int)Providence.BossMode.Day || healerGuardianAlive)
if (!ProvUtils.DayAI() || healerGuardianAlive)
Projectile.extraUpdates = 1;
if (Projectile.timeLeft < 300)
@@ -232,21 +225,5 @@ namespace CalamityMod.Projectiles.Boss
}
public override Color? GetAlpha(Color lightColor) => new Color(255 * Projectile.Opacity, 255 * Projectile.Opacity, 255 * Projectile.Opacity, 255 * Projectile.Opacity);
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
// In GFB, "real damage" is replaced with negative healing
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
modifiers.SourceDamage *= 0f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
// If the player is dodging, don't apply debuffs
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
return;
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 0, 10);
}
}
}
+12 -35
View File
@@ -58,26 +58,7 @@ namespace CalamityMod.Projectiles.Boss
{
ExtraWidth = Projectile.ai[2];
// Day mode by default but syncs with the boss
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
else if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
bool scissorLasers = CalamityWorld.revenge || (Projectile.maxPenetrate != (int)Providence.BossMode.Day);
bool scissorLasers = CalamityWorld.revenge || !ProvUtils.DayAI();
Vector2? vector78 = null;
if (Projectile.velocity.HasNaNs() || Projectile.velocity == Vector2.Zero)
@@ -103,6 +84,9 @@ namespace CalamityMod.Projectiles.Boss
return;
}
if (projScale == 1f)
ProvUtils.ApplyGFBDamage(Projectile, 400, 20);
Projectile.scale = (float)Math.Sin(Projectile.localAI[0] * MathHelper.Pi / (scissorLasers ? 100f : 180f)) * 10f * projScale;
if (Projectile.scale > projScale)
Projectile.scale = projScale;
@@ -131,7 +115,7 @@ namespace CalamityMod.Projectiles.Boss
if (!Collision.CanHitLine(Main.npc[(int)Projectile.ai[1]].Center, 1, 1, Main.player[Main.npc[(int)Projectile.ai[1]].target].Center, 1, 1))
rayLength = 2400f;
int dustType = ProvUtils.GetDustID(Projectile.maxPenetrate);
int dustType = ProvUtils.GetDustID();
Projectile.localAI[1] = MathHelper.Lerp(Projectile.localAI[1], rayLength, 0.5f); // Length of laser, linear interpolation
Vector2 dustRotation = Projectile.Center + Projectile.velocity * (Projectile.localAI[1] - 14f);
for (int j = 0; j < 2; j++)
@@ -158,13 +142,13 @@ namespace CalamityMod.Projectiles.Boss
for (float i = 0; i < Projectile.localAI[1]; i += Main.rand.NextFloat(15, 30))
{
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(30 * ExtraWidth), 0).RotatedBy(Main.rand.NextFloat(MathHelper.TwoPi)) + (Projectile.velocity * i), Projectile.velocity * 5, false, 5, Main.rand.NextFloat(0.5f, 1.5f), ProvUtils.GetProjectileColor((int)Projectile.maxPenetrate, 255), false));
GeneralParticleHandler.SpawnParticle(new SparkParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(30 * ExtraWidth), 0).RotatedBy(Main.rand.NextFloat(MathHelper.TwoPi)) + (Projectile.velocity * i), Projectile.velocity * 5, false, 5, Main.rand.NextFloat(0.5f, 1.5f), ProvUtils.GetProjectileColor(255), false));
}
}
public override Color? GetAlpha(Color lightColor)
{
return ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
return ProvUtils.GetProjectileColor(lightColor);
}
public override bool PreDraw(ref Color lightColor)
@@ -174,7 +158,7 @@ namespace CalamityMod.Projectiles.Boss
Vector2 scale = new Vector2(Projectile.scale * ExtraWidth, Projectile.scale);
bool dayTime = Projectile.maxPenetrate == (int)Providence.BossMode.Day;
bool dayTime = ProvUtils.DayAI();
Texture2D texture2D19 = dayTime ? ModContent.Request<Texture2D>(Texture, AssetRequestMode.ImmediateLoad).Value :
ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/ProvidenceHolyRayNight", AssetRequestMode.ImmediateLoad).Value;
Texture2D texture2D20 = dayTime ? ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayMid", AssetRequestMode.ImmediateLoad).Value :
@@ -183,7 +167,7 @@ namespace CalamityMod.Projectiles.Boss
ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEndNight", AssetRequestMode.ImmediateLoad).Value;
float rayDrawLength = Projectile.localAI[1]; //length of laser
Color baseColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, lightColor);
Color baseColor = ProvUtils.GetProjectileColor(lightColor);
Vector2 vector = Projectile.Center - Main.screenPosition;
Rectangle? sourceRectangle2 = null;
Main.spriteBatch.Draw(texture2D19, vector, sourceRectangle2, baseColor, Projectile.rotation, texture2D19.Size() / 2f, scale, SpriteEffects.None, 0);
@@ -196,7 +180,7 @@ namespace CalamityMod.Projectiles.Boss
Projectile.localAI[2]++;
Color glowColor = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 0);
Color glowColor = ProvUtils.GetProjectileColor(0);
Main.EntitySpriteDraw(GlowBallTexture, Projectile.Center - Main.screenPosition, GlowBallTexture.Frame(), glowColor, 0f, GlowBallTexture.Frame().Center(), Projectile.scale / 1.5f * ExtraWidth, SpriteEffects.None);
Main.EntitySpriteDraw(GlowRingTexture, Projectile.Center - Main.screenPosition, GlowRingTexture.Frame(), glowColor, 0f, GlowRingTexture.Frame().Center(), Projectile.scale / MathHelper.Lerp(1.5f, 1f, (float)Math.Sin(Projectile.localAI[2] / 20f) * 0.5f) * ExtraWidth, SpriteEffects.None);
@@ -250,20 +234,13 @@ namespace CalamityMod.Projectiles.Boss
return false;
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
// In GFB, "real damage" is replaced with negative healing
if (Projectile.maxPenetrate >= (int)Providence.BossMode.Red)
modifiers.SourceDamage *= 0f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
// If the player is dodging, don't apply debuffs
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
if (info.Damage <= 0 || target.creativeGodMode)
return;
ProvUtils.ApplyHitEffects(target, Projectile.maxPenetrate, 400, 20);
ProvUtils.ApplyDebuffs(target, 400);
}
public override bool CanHitPlayer(Player target) => Projectile.scale >= 0.5f;
+1 -20
View File
@@ -30,26 +30,7 @@ namespace CalamityMod.Projectiles.Boss
public override void AI()
{
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
if (CalamityGlobalNPC.holyBoss != -1)
{
Projectile.maxPenetrate = (int)Main.npc[CalamityGlobalNPC.holyBoss].localAI[1];
}
if (CalamityGlobalNPC.doughnutBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].active)
{
if (Main.npc[CalamityGlobalNPC.doughnutBoss].Calamity().CurrentlyEnraged)
Projectile.maxPenetrate = (int)Providence.BossMode.Night;
else
Projectile.maxPenetrate = (int)Providence.BossMode.Day;
}
}
Color c = ProvUtils.GetProjectileColor(Projectile.maxPenetrate, 255);
Color c = ProvUtils.GetProjectileColor(255);
GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center, Projectile.velocity / 2f, false, 10, 0.5f * Projectile.ai[2], c));
GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center, Vector2.Zero, Color.LightSlateGray, Color.DarkSlateGray, 0.5f * Projectile.ai[2], 150, Main.rand.NextFloat(-0.01f, 0.01f)));
+56 -92
View File
@@ -58,82 +58,46 @@ namespace CalamityMod.Projectiles.Magic
float laserNormalize;
Vector2 projDirection = Vector2.Zero;
float laserTimer;
float y;
float yOffset;
float laserRotationSpeed;
float scaleFactor6;
Color color = new Color(1, 1, 1, 127);
Color color = GetBeamColor((int)projectile2.ai[0], (int)Projectile.ai[0]);
Projectile.Opacity = 1f;
if (projectile2.ai[0] < 720f)
if (projectile2.ai[0] < 360f)
{
laserTimer = projectile2.ai[0] / 1440f;
y = 6f + projectile2.ai[0] / 720f * 7f;
if (projectile2.ai[0] > 360f)
{
int colorValue = (int)((0.01f + ((projectile2.ai[0] - 360f) / 360f * 2.55f)) * 100f);
color = new Color(colorValue, colorValue, colorValue, 127);
}
if (projectile2.ai[0] < 480f)
laserTimer = projectile2.ai[0] / 720f;
yOffset = 6f + projectile2.ai[0] / 360f * 7f;
if (projectile2.ai[0] < 240f)
laserRotationSpeed = 1.75f;
else
laserRotationSpeed = 3f + 5f * ((projectile2.ai[0] - 480f) / 240f);
scaleFactor6 = -2f - projectile2.ai[0] / 720f * 5f;
laserRotationSpeed = 3f + 5f * ((projectile2.ai[0] - 240f) / 120f);
scaleFactor6 = -2f - projectile2.ai[0] / 360f * 5f;
}
else
{
float colorLimit = projectile2.ai[0] - 720f;
if (colorLimit > 255f)
colorLimit = 255f;
switch ((int)Projectile.ai[0]) //R O Y G B I V
{
case 0:
color = new Color(255, 255 - (int)colorLimit, 255 - (int)colorLimit, 127);
break;
case 1:
color = new Color(255, 255 - (int)(colorLimit * 0.3529412f), 255 - (int)colorLimit, 127);
break;
case 2:
color = new Color(255, 255, 255 - (int)colorLimit, 127);
break;
case 3:
color = new Color(255 - (int)colorLimit, 255 - (int)(colorLimit * 0.5f), 255 - (int)colorLimit, 127);
break;
case 4:
color = new Color(255 - (int)colorLimit, 255 - (int)colorLimit, 255, 127);
break;
case 5:
color = new Color(255 - (int)(colorLimit * 0.7058824f), 255 - (int)colorLimit, 255 - (int)(colorLimit * 0.4901961), 127);
break;
case 6:
color = new Color(255 - (int)(colorLimit * 0.0666667f), 255 - (int)(colorLimit * 0.4901961), 255 - (int)(colorLimit * 0.0666667f), 127);
break;
}
laserTimer = 0.5f;
laserRotationSpeed = 10.875f;
y = 13f;
yOffset = 13f;
scaleFactor6 = -7f;
}
float laserDirection = (projectile2.ai[0] + laserPosition * laserRotationSpeed) / (laserRotationSpeed * 6f) * MathHelper.TwoPi;
laserNormalize = Vector2.UnitY.RotatedBy(laserDirection).Y * (MathHelper.Pi / 6) * laserTimer * 0.33f;
projDirection = (Vector2.UnitY.RotatedBy(laserDirection) * new Vector2(4f, y)).RotatedBy(projectile2.velocity.ToRotation());
projDirection = (Vector2.UnitY.RotatedBy(laserDirection) * new Vector2(4f, yOffset)).RotatedBy(projectile2.velocity.ToRotation());
Projectile.position = projectile2.Center + aimDirection * 16f - Projectile.Size / 2f + new Vector2(0f, -Main.projectile[(int)Projectile.ai[1]].gfxOffY);
Projectile.position += projectile2.velocity.ToRotation().ToRotationVector2() * scaleFactor6;
Projectile.position += projDirection;
Projectile.velocity = Vector2.Normalize(projectile2.velocity).RotatedBy(laserNormalize);
Projectile.scale = 1.5f * (1.5f - laserTimer);
// Takes 360 frames to reach normal damage
float amount = projectile2.ai[0] / 1200f;
// Takes 180 frames to reach normal damage
float amount = projectile2.ai[0] / 600f;
if (amount > 1f)
amount = 1f;
Projectile.damage = (int)(projectile2.damage * MathHelper.Lerp(0.25f, 2.2f, amount));
if (projectile2.ai[0] >= 720f)
if (projectile2.ai[0] >= 360f)
chargeUpCenter = new Vector2?(projectile2.Center);
if (!Collision.CanHitLine(Main.player[Projectile.owner].Center, 0, 0, projectile2.Center, 0, 0))
@@ -212,55 +176,15 @@ namespace CalamityMod.Projectiles.Magic
Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
float drawArea = Projectile.localAI[1];
Projectile projectile2 = Main.projectile[(int)Projectile.ai[1]];
Color color = new Color(1, 1, 1, 127);
if (projectile2.ai[0] < 720f)
{
if (projectile2.ai[0] > 360f)
{
int colorValue = (int)((0.01f + ((projectile2.ai[0] - 360f) / 360f * 2.55f)) * 100f);
color = new Color(colorValue, colorValue, colorValue, 127);
}
}
else
{
float colorLimit = projectile2.ai[0] - 720f;
if (colorLimit > 255f)
{
colorLimit = 255f;
}
switch ((int)Projectile.ai[0]) //R O Y G B I V
{
case 0:
color = new Color(255, 255 - (int)colorLimit, 255 - (int)colorLimit, 127);
break;
case 1:
color = new Color(255, 255 - (int)(colorLimit * 0.3529412f), 255 - (int)colorLimit, 127);
break;
case 2:
color = new Color(255, 255, 255 - (int)colorLimit, 127);
break;
case 3:
color = new Color(255 - (int)colorLimit, 255 - (int)(colorLimit * 0.5f), 255 - (int)colorLimit, 127);
break;
case 4:
color = new Color(255 - (int)colorLimit, 255 - (int)colorLimit, 255, 127);
break;
case 5:
color = new Color(255 - (int)(colorLimit * 0.7058824f), 255 - (int)colorLimit, 255 - (int)(colorLimit * 0.4901961), 127);
break;
case 6:
color = new Color(255 - (int)(colorLimit * 0.0666667f), 255 - (int)(colorLimit * 0.4901961), 255 - (int)(colorLimit * 0.0666667f), 127);
break;
}
}
Color color = GetBeamColor((int)projectile2.ai[0], (int)Projectile.ai[0]);
Color value25 = color;
Vector2 drawStart = Projectile.Center.Floor();
drawStart += Projectile.velocity * Projectile.scale * 10.5f;
drawArea -= Projectile.scale * 14.5f * Projectile.scale;
Vector2 drawScale = new Vector2(Projectile.scale);
DelegateMethods.f_1 = 1f;
DelegateMethods.c_1 = value25 * 0.75f * Projectile.Opacity;
DelegateMethods.c_1 = color * 0.75f * Projectile.Opacity;
Vector2 projPos = Projectile.oldPos[0];
projPos = new Vector2(Projectile.width, Projectile.height) / 2f + Vector2.UnitY * Projectile.gfxOffY - Main.screenPosition;
Utils.DrawLaser(Main.spriteBatch, tex, drawStart - Main.screenPosition, drawStart + Projectile.velocity * drawArea - Main.screenPosition, drawScale, new Utils.LaserLineFraming(DelegateMethods.RainbowLaserDraw));
@@ -269,6 +193,46 @@ namespace CalamityMod.Projectiles.Magic
return false;
}
public Color GetBeamColor(int timer, int type)
{
Color color = Color.Black;
if (timer < 360f)
{
float brightness = MathHelper.Clamp(timer / 180f, 0f, 1f);
color = Color.Lerp(Color.Black, Color.White, brightness);
}
else
{
float hue = 0f;
switch (type)
{
case 1: // 30 (Orange)
hue = 1f / 12f;
break;
case 2: // 60 (Yellow)
hue = 1f / 6f;
break;
case 3: // 120 (Green)
hue = 1f / 3f;
break;
case 4: // 210 (Blue)
hue = 7f / 12f;
break;
case 5: // 270 (Purple)
hue = 3f / 4f;
break;
case 0: // 0 (Red)
default:
hue = 0f;
break;
}
float lightness = 1f - (MathHelper.Clamp((timer - 360f) / 240f, 0f, 1f) * 0.4f);
color = Main.hslToRgb(hue, 1f, lightness);
}
color.A = 127;
return color;
}
public override void CutTiles()
{
DelegateMethods.tilecut_0 = TileCuttingContext.AttackProjectile;
+88 -34
View File
@@ -1,5 +1,7 @@
using System;
using System.Threading.Channels;
using Microsoft.Xna.Framework;
using Steamworks;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
@@ -9,11 +11,14 @@ namespace CalamityMod.Projectiles.Magic
public class PhantasmalFuryProj : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Magic";
public int time = 0;
public float dustRotation = 0;
public bool launched = false;
public override void SetStaticDefaults()
{
Main.projFrames[Projectile.type] = 4;
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6;
ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
}
public override void SetDefaults()
@@ -22,13 +27,19 @@ namespace CalamityMod.Projectiles.Magic
Projectile.height = 16;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.penetrate = 1;
Projectile.timeLeft = 120;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.extraUpdates = 5;
Projectile.timeLeft = 900;
Projectile.DamageType = DamageClass.Magic;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 16 * Projectile.MaxUpdates;
Projectile.ArmorPenetration = 15;
}
public override void AI()
{
Player Owner = Main.player[Projectile.owner];
Projectile.frameCounter++;
if (Projectile.frameCounter > 4)
{
@@ -38,51 +49,94 @@ namespace CalamityMod.Projectiles.Magic
if (Projectile.frame >= Main.projFrames[Projectile.type])
Projectile.frame = 0;
if (Projectile.timeLeft % 10 == 0)
{
if (Projectile.owner == Main.myPlayer)
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<Phantom>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
}
if (Projectile.timeLeft < 100)
{
CalamityUtils.HomeInOnNPC(Projectile, true, 300f, 10f, 20f);
}
dustRotation += 0.12f;
Lighting.AddLight(Projectile.Center, Color.White.ToVector3() * 0.5f);
Lighting.AddLight(Projectile.Center, 0.25f, 0.25f, 0.25f);
for (int i = 0; i < 3; i++)
{
int spectre = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.SpectreStaff, 0f, 0f, 100, default, 2f);
Main.dust[spectre].noGravity = true;
Main.dust[spectre].velocity *= 0.5f;
Main.dust[spectre].velocity += Projectile.velocity * 0.1f;
}
// 175, 100 ALPHA
Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt();
Projectile.rotation = Projectile.velocity.ToRotation() + (Projectile.spriteDirection == 1 ? 0f : MathHelper.Pi);
if (time >= 500)
{
if (time == 500)
{
Projectile.penetrate = 1;
launched = true;
}
NPC target = Projectile.Center.ClosestNPCAt(700);
if (target != null && target.CanBeChasedBy(Projectile))
{
Vector2 moveTotarget = (target.Center - Projectile.Center).SafeNormalize(Vector2.UnitX);
if (Projectile.velocity.Length() < 6)
Projectile.velocity += moveTotarget * 0.45f;
else
Projectile.velocity *= 0.9f;
}
if (time < 550 && target == null)
{
if (Projectile.velocity.Length() < 6)
Projectile.velocity += (Owner.Calamity().mouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX) * 0.35f;
else
Projectile.velocity *= 0.9f;
}
}
else if (time > 15)
{
Vector2 circle = Owner.Center + new Vector2(0, -30).RotatedBy(time * 0.05f);
Vector2 moveToEnemy = (circle - Projectile.Center).SafeNormalize(Vector2.UnitX);
if (Projectile.velocity.Length() < 8)
Projectile.velocity += moveToEnemy * Main.rand.NextFloat(0.2f, 0.4f);
else
Projectile.velocity *= 0.85f;
}
if (time > 5)
{
Vector2 dustPos = Projectile.Center + (MathHelper.Pi + dustRotation + MathHelper.PiOver2).ToRotationVector2() * 10f * Projectile.scale;
Dust dust = Dust.NewDustPerfect(dustPos, 175, (MathHelper.Pi + dustRotation * Math.Sign(Projectile.velocity.Length())).ToRotationVector2() * 2);
dust.noGravity = false;
dust.scale = Main.rand.NextFloat(0.75f, 1.2f);
dust.alpha = Main.rand.Next(100, 170 + 1);
dust.velocity = dust.velocity.RotatedByRandom(0f);
}
time++;
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.SourceDamage *= (launched ? 1f : 0.05f);
Player Owner = Main.player[Projectile.owner];
if (target.CanBeMoved(true))
{
// Custom knockback
Vector2 launchVel = (Owner.Center - target.Center).SafeNormalize(Vector2.UnitY) * -10 * (launched ? 0.5f : 2);
target.velocity = launchVel * (target.knockBackResist == 0 ? 0.5f : 1f);
}
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item43, Projectile.Center);
for (int j = 0; j <= 10; j++)
//SoundEngine.PlaySound(SoundID.Item43, Projectile.Center);
for (int i = 0; i <= 3; i++)
{
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.SpectreStaff, 0f, 0f, 100, default, 1f);
}
if (Projectile.owner == Main.myPlayer)
{
for (int i = 0; i < 8; i++)
{
Vector2 velocity = (MathHelper.TwoPi * i / 8f).ToRotationVector2() * 3f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType<Phantom>(), Projectile.damage, Projectile.knockBack, Projectile.owner);
}
Dust dust = Dust.NewDustPerfect(Projectile.Center, 175, (Projectile.velocity * 6).RotatedByRandom(0.4f) * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(1.2f, 1.8f));
dust.noGravity = true;
Dust chargefull = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(4) ? 278 : 267);
chargefull.velocity = Projectile.velocity.RotatedByRandom(0.25f) * Main.rand.NextFloat(1f, 4);
chargefull.scale = Main.rand.NextFloat(0.5f, 0.9f);
chargefull.noGravity = true;
chargefull.color = Color.Lerp(Color.White, Color.Aqua, 0.3f);
}
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White, 1);
return false;
}
}
+101 -10
View File
@@ -1,4 +1,5 @@
using Microsoft.Xna.Framework;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -8,31 +9,121 @@ namespace CalamityMod.Projectiles.Magic
public class Phantom : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Magic";
public float sizeVariance = 2;
public int time = 0;
public int spinDir = 100;
public int waveOften = 40;
public float scaleVariance = 1;
public bool launched = false;
public override void SetDefaults()
{
Projectile.width = 8;
Projectile.height = 8;
Projectile.friendly = true;
Projectile.extraUpdates = 1;
Projectile.penetrate = 2;
Projectile.extraUpdates = 5;
Projectile.penetrate = -1;
Projectile.ignoreWater = true;
Projectile.timeLeft = 120;
Projectile.tileCollide = false;
Projectile.timeLeft = 900;
Projectile.DamageType = DamageClass.Magic;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 16 * Projectile.MaxUpdates;
Projectile.ArmorPenetration = 30;
}
public override void AI()
{
Projectile.rotation += 0.01f;
Player Owner = Main.player[Projectile.owner];
float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
Lighting.AddLight(Projectile.Center, 0.2f, 0.2f, 0.2f);
Projectile.rotation += Main.rand.NextFloat(0.02f, 0.09f);
for (int i = 0; i < 2; i++)
if (spinDir == 100)
{
int spectre = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.SpectreStaff, 0f, 0f, 100, default, 1f);
Main.dust[spectre].noGravity = true;
spinDir = Main.rand.NextBool() ? 1 : -1;
waveOften = Main.rand.Next(10, 40 + 1);
Projectile.scale = Main.rand.NextFloat(0.95f, 1.1f);
}
CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 300f, 12f, 20f);
Lighting.AddLight(Projectile.Center, Color.White.ToVector3() * 0.3f);
if (time % 2 == 0 && time > 3 && targetDist < 1400)
{
Particle spark = new GlowSparkParticle(Projectile.Center + Projectile.velocity * Main.rand.NextFloat(-1, 1), -Projectile.velocity * 0.3f, false, 4, 0.025f, Color.Lerp(Color.White, Color.Aqua, 0.3f) * 0.6f, new Vector2(1, 0.3f), true, false, 2);
GeneralParticleHandler.SpawnParticle(spark);
}
if (time >= 500)
{
if (time == 500)
{
Projectile.penetrate = 1;
Projectile.velocity = (Owner.Calamity().mouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX) * 6;
launched = true;
}
float badDist = Vector2.Distance(Owner.Calamity().mouseWorld, Projectile.Center);
if (badDist < 30)
{
time = 600;
}
NPC target = Projectile.Center.ClosestNPCAt(550);
if (target != null)
{
Vector2 moveToEnemy = (target.Center - Projectile.Center).SafeNormalize(Vector2.UnitX);
if (Projectile.velocity.Length() < 6)
Projectile.velocity += moveToEnemy * 0.3f;
else
Projectile.velocity *= 0.85f;
}
if (time < 550 && target == null)
{
if (Projectile.velocity.Length() < 6)
Projectile.velocity += (Owner.Calamity().mouseWorld - Projectile.Center).SafeNormalize(Vector2.UnitX) * 0.35f;
else
Projectile.velocity *= 0.9f;
}
if (time % waveOften == 0)
spinDir *= -1;
Projectile.velocity = Projectile.velocity.RotatedBy(Main.rand.NextFloat(0.01f, 0.02f) * spinDir);
}
else if (time > 15)
{
Vector2 circle = Owner.Center + new Vector2(0, -30).RotatedBy(time * 0.05f);
Vector2 moveToEnemy = (circle - Projectile.Center).SafeNormalize(Vector2.UnitX);
if (Projectile.velocity.Length() < 8)
Projectile.velocity += moveToEnemy * Main.rand.NextFloat(0.2f, 0.4f);
else
Projectile.velocity *= 0.85f;
}
time++;
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
modifiers.SourceDamage *= (launched ? 1f : 0.05f);
Player Owner = Main.player[Projectile.owner];
if (target.CanBeMoved(true))
{
// Custom knockback
Vector2 launchVel = (Owner.Center - target.Center).SafeNormalize(Vector2.UnitY) * -10 * (launched ? 0.5f : 2);
target.velocity = launchVel * (target.knockBackResist == 0 ? 0.5f : 1f);
}
}
public override void OnKill(int timeLeft)
{
for (int i = 0; i <= 2; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center, 175, (Projectile.velocity * 3).RotatedByRandom(0.6f) * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.8f, 1.3f));
dust.noGravity = true;
}
}
}
}
+5 -16
View File
@@ -1,9 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.IO;
using Terraria;
using Terraria.Audio;
using Terraria.ID;
@@ -28,7 +29,6 @@ namespace CalamityMod.Projectiles.Magic
{
Projectile.width = Projectile.height = 4;
Projectile.friendly = true;
Projectile.hostile = true;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Magic;
@@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Magic
// Decide a frame to use and adjust the hitbox based on it.
if (Projectile.localAI[0] == 0f)
{
// Play a wraith death sound by default, play a generic flame sound when spawned by gfb Orthoceras
// Play a wraith death sound by default, play a generic flame sound when spawned by GFB Orthoceras
SoundStyle sound = Time == 0 ? SoundID.NPCDeath52 : SoundID.Item20;
SoundEngine.PlaySound(sound, Projectile.Center);
@@ -135,17 +135,6 @@ namespace CalamityMod.Projectiles.Magic
behindNPCsAndTiles.Add(index);
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
if (Projectile.friendly)
{
modifiers.SourceDamage *= 0f;
if (Main.masterMode) modifiers.SourceDamage.Flat += 450f;
else if (Main.expertMode) modifiers.SourceDamage.Flat += 375f;
else modifiers.SourceDamage.Flat += 300f;
}
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
+1 -1
View File
@@ -29,7 +29,7 @@ namespace CalamityMod.Projectiles.Magic
// Decide scale and initial rotation on the first frame this projectile exists.
if (Projectile.localAI[0] == 0f)
{
Projectile.scale = Main.rand.NextFloat(1f, 1.7f);
Projectile.scale = Main.rand.NextFloat(1f, 1.7f) * Projectile.ai[1];
Projectile.rotation = Main.rand.NextFloat(MathHelper.TwoPi);
Projectile.localAI[0] = 1f;
}
-7
View File
@@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Magic
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Magic;
Projectile.friendly = true;
Projectile.hostile = true;
Projectile.timeLeft = 300;
Projectile.ignoreWater = true;
}
@@ -49,12 +48,6 @@ namespace CalamityMod.Projectiles.Magic
Time++;
}
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
modifiers.SourceDamage *= 0f;
modifiers.SourceDamage.Flat += Main.rand.Next(80, 90);
}
public override Color? GetAlpha(Color lightColor) => Color.White * Projectile.Opacity;
}
}
+2 -5
View File
@@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Magic
public void CreateTileHitEffects()
{
Vector2 endOfLaser = Projectile.Center + Projectile.velocity * (LaserLength - Main.rand.NextFloat(12f, 72f));
Projectile.NewProjectile(Projectile.GetSource_FromThis(), endOfLaser, Main.rand.NextVector2Circular(4f, 8f), ModContent.ProjectileType<RancorFog>(), 0, 0f, Projectile.owner);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), endOfLaser, Main.rand.NextVector2Circular(4f, 8f), ModContent.ProjectileType<RancorFog>(), 0, 0f, Projectile.owner, 0f, 1f);
if (Main.rand.NextBool())
{
@@ -182,10 +182,7 @@ namespace CalamityMod.Projectiles.Magic
overWiresUI.Add(index);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(ModContent.BuffType<RancorBurn>(), 150);
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.Calamity().ashesOnDeath = 10;
public override bool ShouldUpdatePosition() => false;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

+214 -42
View File
@@ -1,7 +1,13 @@
using Microsoft.Xna.Framework;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using rail;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using System;
using ReLogic.Content;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Magic
{
@@ -9,65 +15,231 @@ namespace CalamityMod.Projectiles.Magic
{
public new string LocalizationCategory => "Projectiles.Magic";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public int time = 0;
public float platFade = 0;
public float platRot = 0;
public bool spawnPlat = false;
public bool hasSetPlatSpawn = false;
public bool hasReboundOffPlat = false;
public bool reflecting = false;
public int reflectionTimer = 50;
public Vector2 platPosCenter;
public Vector2 platPosWall;
public NPC chosenTarget;
public Vector2 targetCenter;
public override void SetStaticDefaults()
{
ProjectileID.Sets.DrawScreenCheckFluff[Projectile.type] = 10000;
}
public override void SetDefaults()
{
Projectile.width = 4;
Projectile.height = 4;
Projectile.width = 30;
Projectile.height = 30;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Magic;
Projectile.ignoreWater = true;
Projectile.penetrate = 6;
Projectile.extraUpdates = 100;
Projectile.timeLeft = 300;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.extraUpdates = 10;
Projectile.timeLeft = 2400;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.localNPCHitCooldown = -1;
}
public override bool OnTileCollide(Vector2 oldVelocity)
public override void AI()
{
Projectile.damage = (int)(Projectile.damage * 1.15);
Projectile.penetrate--;
if (Projectile.penetrate <= 0)
Player Owner = Main.player[Projectile.owner];
float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
if (!spawnPlat && !hasReboundOffPlat && targetCenter != Vector2.Zero)
platFade = MathHelper.Lerp(platFade, 1, 0.008f);
if (hasReboundOffPlat)
{
Projectile.Kill();
platFade -= 0.0007f;
}
BeamMainVisuals(Owner, targetDist);
if (reflecting)
{
if (reflectionTimer > 15)
platPosCenter += (targetCenter - platPosCenter).SafeNormalize(Vector2.UnitX) * -2.7f * Utils.GetLerpValue(15, 40, reflectionTimer, true);
else
platPosCenter += (targetCenter - platPosCenter).SafeNormalize(Vector2.UnitX) * 9f * Utils.GetLerpValue(10, 0, reflectionTimer, true);
Projectile.extraUpdates = 0;
Projectile.velocity = Vector2.Zero;
Projectile.Center = platPosWall;
reflectionTimer--;
if (reflectionTimer <= 0)
{
SoundStyle bounce = new("CalamityMod/Sounds/Item/ShadowboltReflect");
SoundEngine.PlaySound(bounce with { Volume = 0.6f, Pitch = 0f }, platPosWall);
for (int i = 0; i < Main.maxNPCs; i++)
Projectile.localNPCImmunity[i] = 0;
Projectile.velocity = (targetCenter - platPosCenter).SafeNormalize(Vector2.UnitX) * 5;
reflecting = false;
hasReboundOffPlat = true;
time = 10;
Projectile.extraUpdates = 100;
}
}
if (spawnPlat && hasSetPlatSpawn)
{
chosenTarget = Projectile.Center.ClosestNPCAt(2000);
if (chosenTarget == null)
targetCenter = Owner.Calamity().mouseWorld;
else
targetCenter = chosenTarget.Center;
platPosCenter = Projectile.Center + Projectile.velocity * Main.rand.Next(70, 120 + 1);
platRot = (Projectile.Center - platPosCenter).SafeNormalize(Vector2.UnitX).ToRotation();
platPosWall = platPosCenter + new Vector2(0, 8).RotatedBy(platRot);
spawnPlat = false;
}
if (!spawnPlat && reflecting && targetCenter != Vector2.Zero)
{
if (chosenTarget == null)
targetCenter = Owner.Calamity().mouseWorld;
else
targetCenter = chosenTarget.Center;
platRot = platRot.AngleLerp((targetCenter - platPosCenter).SafeNormalize(Vector2.UnitX).ToRotation(), 0.1f);
platPosWall = platPosCenter + new Vector2(0, -30).RotatedBy(platRot + MathHelper.ToRadians(90f));
}
if (!spawnPlat && !hasReboundOffPlat && targetCenter != Vector2.Zero)
{
float beamDist = Vector2.Distance(platPosWall, Projectile.Center);
if (beamDist <= 25 && !reflecting)
{
Particle blastRing = new CustomPulse(platPosWall, Vector2.Zero, Color.Purple, "CalamityMod/Particles/SmallBloomRing", Vector2.One, Main.rand.NextFloat(-10, 10), 0.1f, 1.55f, 20, true);
GeneralParticleHandler.SpawnParticle(blastRing);
SoundStyle wall = new("CalamityMod/Sounds/Item/ShadowboltWallHit");
SoundEngine.PlaySound(wall with { Volume = 0.5f, Pitch = 0f }, platPosWall);
reflecting = true;
Projectile.extraUpdates = 0;
}
}
if (!hasReboundOffPlat && Projectile.numHits == 0 && !hasSetPlatSpawn && (Collision.SolidCollision(Projectile.Center, 20, 20) || time > 90))
{
hasSetPlatSpawn = true;
spawnPlat = true;
}
time++;
}
private void BeamMainVisuals(Player Owner, float targetDist)
{
if (reflecting)
{
for (int i = 0; i < 2; i++)
{
Dust chargefull = Dust.NewDustPerfect(Projectile.Center, 267);
chargefull.velocity = new Vector2(3, 3).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 0.8f);
chargefull.scale = Main.rand.NextFloat(0.35f, 0.8f);
chargefull.noGravity = true;
chargefull.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Indigo : Color.Purple, 0.7f);
}
}
else
{
if (Projectile.velocity.X != oldVelocity.X)
if (time == 14)
{
Projectile.velocity.X = -oldVelocity.X;
for (int i = 0; i < 2; i++)
{
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Indigo, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.3f, 0.75f, 12, true);
GeneralParticleHandler.SpawnParticle(blastRing);
Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.2f, 0.55f, 12, true);
GeneralParticleHandler.SpawnParticle(blastRing2);
}
for (int i = 0; i < 6; i++)
{
Dust chargefull = Dust.NewDustPerfect(Projectile.Center, 278);
chargefull.velocity = Projectile.velocity.RotatedByRandom(0.25f) * Main.rand.NextFloat(0.6f, 2f);
chargefull.scale = Main.rand.NextFloat(0.65f, 0.9f);
chargefull.noGravity = true;
chargefull.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Indigo : Color.Purple, 0.7f);
}
}
if (Projectile.velocity.Y != oldVelocity.Y)
if (targetDist < 1400)
{
Projectile.velocity.Y = -oldVelocity.Y;
if (time > 30 && Main.rand.NextBool(15))
{
Particle spark = new LineParticle(Projectile.Center, Projectile.velocity * Main.rand.NextFloat(-1, 1), false, 50, 1.9f, Color.Lerp(Color.Indigo, Color.Purple, Main.rand.NextFloat(0, 1)));
GeneralParticleHandler.SpawnParticle(spark);
}
if (time > 22 && time % 3 == 0)
{
Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, -Projectile.velocity * 0.1f, false, 18, 0.05f * (hasReboundOffPlat ? 1.1f : 0.5f), Color.Lerp(Color.Indigo, Color.Orchid, 0.25f), new Vector2(0.7f, 1f), true, false, 0.3f);
GeneralParticleHandler.SpawnParticle(spark);
}
if (time > 30 && Main.rand.NextBool(12))
{
Dust chargefull = Dust.NewDustPerfect(Projectile.Center, 267);
chargefull.velocity = Projectile.velocity * Main.rand.NextFloat(-2, 2);
chargefull.scale = Main.rand.NextFloat(0.95f, 1.4f);
chargefull.noGravity = true;
chargefull.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Indigo : Color.Purple, 0.7f);
}
}
}
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
float minMult = 0.25f;
int hitsToMinMult = 7;
float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true);
modifiers.SourceDamage *= (hasReboundOffPlat ? 2.5f : 1) * damageMult;
if (!hasReboundOffPlat && Projectile.numHits == 0 && !hasSetPlatSpawn)
{
spawnPlat = true;
hasSetPlatSpawn = true;
}
//if (!hasReboundOffPlat)
//Projectile.extraUpdates = 10;
}
public override bool? CanDamage() => reflecting ? false : null;
public override bool PreDraw(ref Color lightColor)
{
if (targetCenter != Vector2.Zero && platFade > 0)
{
Texture2D pTexture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Magic/ShadowPlatform").Value;
for (int i = 0; i < 5; i++)
{
Color auraColor = Color.Lerp(Color.Indigo, Color.Purple, Utils.GetLerpValue(0, 5, i)) with { A = 0 } * 0.55f * platFade;
Vector2 rotationalDrawOffset = (MathHelper.TwoPi * i / 7f + Main.GlobalTimeWrappedHourly * 30f).ToRotationVector2();
rotationalDrawOffset *= MathHelper.Lerp(3f, 5.25f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 6f) * 0.5f + 0.5f);
Main.EntitySpriteDraw(pTexture, platPosCenter - Main.screenPosition + rotationalDrawOffset, null, auraColor, platRot + MathHelper.ToRadians(90f), pTexture.Size() * 0.5f, new Vector2(1, 0.7f), SpriteEffects.None);
}
for (int i = 0; i < 4; i++)
Main.EntitySpriteDraw(pTexture, platPosCenter - Main.screenPosition, null, Color.Purple with { A = 0 } * platFade, platRot + MathHelper.ToRadians(90f), pTexture.Size() * 0.5f, new Vector2(1, 0.7f), SpriteEffects.None);
Main.EntitySpriteDraw(pTexture, platPosCenter - Main.screenPosition, null, Color.White with { A = 0 } * platFade * 0.6f, platRot + MathHelper.ToRadians(90f), pTexture.Size() * 0.5f, new Vector2(1, 0.7f) * 0.93f, SpriteEffects.None);
}
if (!reflecting && time >= 22 && !hasReboundOffPlat)
{
Asset<Texture2D> tex = ModContent.Request<Texture2D>("CalamityMod/Particles/GlowSpark");
for (int i = 0; i < 5; i++)
{
Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 15, null, Color.White with { A = 0 } * 0.7f, Projectile.velocity.ToRotation() + MathHelper.ToRadians(90f), tex.Size() * 0.5f, new Vector2(0.4f, 1f) * (i * 0.3f) * 0.05f * (hasReboundOffPlat ? 1.1f : 0.5f), SpriteEffects.None);
}
}
if (reflecting)
{
Texture2D rechargeTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/BloomCircle").Value;
float randSize = Main.rand.NextFloat(0.8f, 1.2f);
Main.EntitySpriteDraw(rechargeTexture, platPosWall - Main.screenPosition, null, Color.Purple with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.65f * Utils.GetLerpValue(-25, 20, reflectionTimer, true) * randSize, SpriteEffects.None, 0);
Main.EntitySpriteDraw(rechargeTexture, platPosWall - Main.screenPosition, null, Color.White with { A = 0 }, Projectile.rotation, rechargeTexture.Size() * 0.5f, 0.45f * Utils.GetLerpValue(-25, 20, reflectionTimer, true) * randSize, SpriteEffects.None, 0);
}
return false;
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (Projectile.numHits > 0)
Projectile.damage = (int)(Projectile.damage * 1.15);
}
public override void AI()
{
Projectile.localAI[0] += 1f;
if (Projectile.localAI[0] > 9f)
{
for (int i = 0; i < 4; i++)
{
Vector2 projPos = Projectile.position;
projPos -= Projectile.velocity * ((float)i * 0.25f);
Projectile.alpha = 255;
int shadowDust = Dust.NewDust(projPos, 1, 1, DustID.ShadowbeamStaff, 0f, 0f, 0, default, 1f);
Main.dust[shadowDust].position = projPos;
Main.dust[shadowDust].scale = (float)Main.rand.Next(70, 110) * 0.013f;
Main.dust[shadowDust].velocity *= 0.2f;
}
}
}
}
}
-4
View File
@@ -61,12 +61,8 @@ namespace CalamityMod.Projectiles.Magic
float flySpeed = 8f;
float flyInertia = 54f;
Projectile.hostile = true;
Projectile.friendly = false;
if (ProjectileOwner != null && (ProjectileOwner.ModProjectile<SpiritCongregation>().CurrentPower > 0.97f || Projectile.timeLeft < 95))
{
Projectile.hostile = false;
radius += 36f;
target = ProjectileOwner;
-21
View File
@@ -140,11 +140,6 @@ namespace CalamityMod.Projectiles.Magic
HoverOffset = Vector2.Zero;
}
// Previously, Gruesome Eminence stopped being able to hurt you when fully charged.
// This has been changed so that its threat is everpresent.
Projectile.hostile = Time > 75f;
// Projectile.hostile = !tame && Time > 75f;
// Explode into a burst of spirit dust and gas clouds when a bigger face appears.
if (!WasStrongBefore && CurrentPower > LargeMouthPowerLowerBound)
{
@@ -304,22 +299,6 @@ namespace CalamityMod.Projectiles.Magic
DrawHead(backTexture, 1.04f);
}
// Damage scales up over time as it grows.
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
float damageFactor = 0.25f + 0.75f * CurrentPower;
int fullPowerDamage;
if (Main.masterMode)
fullPowerDamage = 540;
else if (Main.expertMode)
fullPowerDamage = 450;
else
fullPowerDamage = 360;
modifiers.SourceDamage *= 0f;
modifiers.SourceDamage.Flat += (int)(damageFactor * fullPowerDamage);
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
{
for (int i = 0; i < Projectile.oldPos.Length; i++)
+70 -19
View File
@@ -1,4 +1,5 @@
using System;
using CalamityMod.Particles;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
@@ -15,38 +16,62 @@ namespace CalamityMod.Projectiles.Magic
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
}
public int time = 0;
public bool explode = true;
public override void SetDefaults()
{
Projectile.width = 20;
Projectile.height = 20;
Projectile.friendly = true;
Projectile.penetrate = 1;
Projectile.extraUpdates = 1;
Projectile.ignoreWater = true;
Projectile.extraUpdates = 7;
Projectile.timeLeft = 600;
Projectile.DamageType = DamageClass.Magic;
}
public override void AI()
{
Player Owner = Main.player[Projectile.owner];
float targetDist = Vector2.Distance(Owner.Center, Projectile.Center);
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(45);
Lighting.AddLight(Projectile.Center, 0.25f, 0.2f, 0f);
if (Projectile.wet && !Projectile.lavaWet)
{
Projectile.Kill();
}
if (Projectile.timeLeft == 1)
explode = false;
if (Projectile.localAI[0] == 0f)
{
SoundEngine.PlaySound(SoundID.Item73, Projectile.Center);
Projectile.localAI[0] += 1f;
}
for (int i = 0; i < 3; i++)
if (time == 5)
{
int venusDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Pixie, 0f, 0f, 100, default, 1.2f);
Main.dust[venusDust].noGravity = true;
Main.dust[venusDust].velocity *= 0.5f;
Main.dust[venusDust].velocity += Projectile.velocity * 0.1f;
for (int i = 0; i < 12; i++)
{
Dust chargefull = Dust.NewDustPerfect(Projectile.Center, 278);
chargefull.velocity = Projectile.velocity.RotatedByRandom(0.25f) * Main.rand.NextFloat(0.1f, 1);
chargefull.scale = Main.rand.NextFloat(0.45f, 0.8f);
chargefull.noGravity = true;
chargefull.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Orange : Color.Coral, 0.7f);
}
}
if (targetDist < 1400)
{
if (time > 8 && time % 3 == 0)
{
SparkParticle spark = new SparkParticle(Projectile.Center + Main.rand.NextVector2Circular(15, 15) - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.8f), false, 35, 0.8f, Color.Lerp(Color.OrangeRed, Color.Coral, Main.rand.NextFloat(0, 1)));
GeneralParticleHandler.SpawnParticle(spark);
}
if (time > 6 && time % 2 == 0)
{
for (int i = 0; i < 2; i++)
{
Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, -Projectile.velocity, false, 8, 0.08f * (i == 0 ? 0.5f : 1), Color.Lerp(Color.Orange, Color.Coral, 0.25f) * 0.5f, new Vector2(0.3f, 1f), false, false, 0.8f);
GeneralParticleHandler.SpawnParticle(spark);
}
}
}
time++;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
@@ -56,16 +81,33 @@ namespace CalamityMod.Projectiles.Magic
public override void OnKill(int timeLeft)
{
if (Projectile.owner == Main.myPlayer)
Player Owner = Main.player[Projectile.owner];
if (Projectile.owner == Main.myPlayer && explode)
{
int explosionDamage = Projectile.damage;
Owner.Calamity().GeneralScreenShakePower = 3.5f;
SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode with { Volume = 1f, Pitch = -0.5f }, Projectile.Center);
SoundEngine.PlaySound(SoundID.Item74 with { Volume = 0.7f, Pitch = 1f }, Projectile.Center);
for (int i = 0; i < 6; i++)
{
Particle explosion = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Lerp(Color.Red, Color.Coral, Utils.GetLerpValue(-2, 6, i, true)), i == 5 ? "CalamityMod/Particles/FlameExplosion" : "CalamityMod/Particles/SoftRoundExplosion", Vector2.One, Main.rand.NextFloat(-5, 5), 0f, 0.1f + 0.03f * i, (int)(30 - i * 1.3f));
GeneralParticleHandler.SpawnParticle(explosion);
}
for (int i = 0; i < 2; i++)
{
Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.OrangeRed, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 1f, 3f, 25, true);
GeneralParticleHandler.SpawnParticle(blastRing);
Particle blastRing2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.5f, 1.5f, 25, true);
GeneralParticleHandler.SpawnParticle(blastRing2);
}
int explosionDamage = Projectile.damage / 4;
float explosionKB = 6f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<VenusianExplosion>(), explosionDamage, explosionKB, Projectile.owner);
int cinderDamage = (int)(Projectile.damage * 0.20);
int cinderDamage = (int)(Projectile.damage * 0.02);
float cinderKB = 0f;
Vector2 cinderPos = Projectile.oldPosition + 0.5f * Projectile.Size;
int numCinders = Main.rand.Next(7, 10);
Vector2 cinderPos = Projectile.Center;
int numCinders = 10;
for (int i = 0; i < numCinders; i++)
{
Vector2 cinderVel = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101));
@@ -75,15 +117,24 @@ namespace CalamityMod.Projectiles.Magic
}
cinderVel.Normalize();
cinderVel *= Main.rand.Next(70, 101) * 0.1f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), cinderPos, cinderVel, ModContent.ProjectileType<VenusianFlame>(), cinderDamage, cinderKB, Projectile.owner);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), cinderPos, cinderVel + new Vector2(0, -3), ModContent.ProjectileType<VenusianFlame>(), cinderDamage, cinderKB, Projectile.owner);
}
for (int i = 0; i < 20; i++)
{
Dust chargefull = Dust.NewDustPerfect(Projectile.Center, 278);
chargefull.velocity = new Vector2(9, 9).RotatedByRandom(100) * Main.rand.NextFloat(0.2f, 2f);
chargefull.scale = Main.rand.NextFloat(0.65f, 1.25f);
chargefull.noGravity = true;
chargefull.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Orange : Color.Coral, 0.7f);
}
}
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
return false;
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], Color.White, 1);
return true;
}
}
}
+12 -43
View File
@@ -14,65 +14,34 @@ namespace CalamityMod.Projectiles.Magic
public override void SetDefaults()
{
Projectile.width = 250;
Projectile.height = 250;
Projectile.width = 400;
Projectile.height = 400;
Projectile.friendly = true;
Projectile.ignoreWater = false;
Projectile.tileCollide = false;
Projectile.penetrate = -1;
Projectile.timeLeft = 120;
Projectile.timeLeft = 2;
Projectile.DamageType = DamageClass.Magic;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 17;
Projectile.localNPCHitCooldown = -1;
}
public override void AI()
{
Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.75f / 255f, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.01f / 255f);
if (Projectile.localAI[0] == 0f)
{
SoundEngine.PlaySound(SoundID.Item74, Projectile.Center);
Projectile.localAI[0] += 1f;
}
float projTimer = 25f;
if (Projectile.ai[0] > 180f)
{
projTimer -= (Projectile.ai[0] - 180f) / 2f;
}
if (projTimer <= 0f)
{
projTimer = 0f;
Projectile.Kill();
}
projTimer *= 0.7f;
Projectile.ai[0] += 4f;
int timerCounter = 0;
while ((float)timerCounter < projTimer)
{
float rando1 = (float)Main.rand.Next(-30, 31);
float rando2 = (float)Main.rand.Next(-30, 31);
float rando3 = (float)Main.rand.Next(9, 27);
float randoAdjuster = (float)Math.Sqrt((double)(rando1 * rando1 + rando2 * rando2));
randoAdjuster = rando3 / randoAdjuster;
rando1 *= randoAdjuster;
rando2 *= randoAdjuster;
int venusDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Pixie, 0f, 0f, 100, default, 2.5f);
Dust dust = Main.dust[venusDust];
dust.noGravity = true;
dust.position.X = Projectile.Center.X;
dust.position.Y = Projectile.Center.Y;
dust.position.X += (float)Main.rand.Next(-10, 11);
dust.position.Y += (float)Main.rand.Next(-10, 11);
dust.velocity.X = rando1;
dust.velocity.Y = rando2;
timerCounter++;
}
return;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Daybreak, 300);
}
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers)
{
if (Projectile.numHits > 0)
Projectile.damage = (int)(Projectile.damage * 0.88f);
if (Projectile.damage < 1)
Projectile.damage = 1;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.width * 0.5f * Projectile.scale, targetHitbox);
}
}
+9 -6
View File
@@ -23,10 +23,11 @@ namespace CalamityMod.Projectiles.Magic
Projectile.height = 14;
Projectile.friendly = true;
Projectile.DamageType = DamageClass.Magic;
Projectile.penetrate = 3;
Projectile.penetrate = -1;
Projectile.extraUpdates = 1;
Projectile.timeLeft = 120;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 10;
Projectile.localNPCHitCooldown = -1;
}
public override void AI()
@@ -105,7 +106,7 @@ namespace CalamityMod.Projectiles.Magic
}
//Dust
if (Main.rand.NextBool(4))
if (Main.rand.NextBool(6))
{
int venusDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Pixie, 0f, 0f, 100, default, 1f);
Dust dust = Main.dust[venusDust];
@@ -114,16 +115,18 @@ namespace CalamityMod.Projectiles.Magic
dust.scale += (float)Main.rand.Next(50) * 0.01f;
dust.noGravity = true;
dust.velocity.Y -= 2f;
dust.velocity += Projectile.velocity * 0.5f;
}
if (Main.rand.NextBool(10))
if (Main.rand.NextBool(14))
{
int venusDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Pixie, 0f, 0f, 100, default, 1f);
int venusDust2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 278, 0f, 0f, 0, default, Main.rand.NextFloat(0.3f, 0.5f));
Dust dust2 = Main.dust[venusDust2];
dust2.position.X -= 2f;
dust2.position.Y += 2f;
dust2.scale += 0.3f + (float)Main.rand.Next(50) * 0.01f;
dust2.noGravity = true;
dust2.velocity *= 0.1f;
dust2.velocity += Projectile.velocity * 0.5f;
dust2.color = Color.Lerp(Color.White, Main.rand.NextBool(4) ? Color.Orange : Color.Coral, 0.7f);
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 231 B

After

Width:  |  Height:  |  Size: 240 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 671 B

After

Width:  |  Height:  |  Size: 603 B

@@ -1,4 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.NPCs.Other;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
@@ -42,6 +43,13 @@ namespace CalamityMod.Projectiles.Summon
Lighting.AddLight(Projectile.Center, 0.75f, 0f, 0f);
}
public override bool? CanHitNPC(NPC target)
{
if (target.type == ModContent.NPCType<ExhumedHeart>())
return false;
return null;
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 240);
public override bool PreDraw(ref Color lightColor)
+1 -2
View File
@@ -323,9 +323,8 @@ namespace CalamityMod.Projectiles.Summon
if (shouldDrawDust)
{
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
var shouldAdjust = !Main.dayTime && buffedAi;
int dustId = ProvUtils.GetDustID(pscState);
int dustId = ProvUtils.GetDustID(!Main.dayTime);
for (int i = 0; i < 6; i++)
{
Dust dust = Dust.NewDustPerfect(Projectile.Center + (Projectile.Size / 2f).RotatedBy(Projectile.rotation), dustId);
+2 -2
View File
@@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Summon
Vector2 dustPos = new Vector2(Owner.Center.X + Main.rand.NextFloat(-10, 10), Owner.Center.Y + Main.rand.NextFloat(-10, 10));
Vector2 velocity = (Owner.Center - dustPos).SafeNormalize(Vector2.Zero);
velocity *= (Main.dayTime || !SpawnedFromPSC) ? 3f : 6.9f;
var dust = Dust.NewDustPerfect(Owner.Center, ProvUtils.GetDustID((float)((Main.dayTime || !SpawnedFromPSC) ? Providence.BossMode.Day : Providence.BossMode.Night)), velocity, 0, default(Color), 2f);
var dust = Dust.NewDustPerfect(Owner.Center, ProvUtils.GetDustID(!Main.dayTime && SpawnedFromPSC), velocity, 0, default(Color), 2f);
if (!Main.dayTime && SpawnedFromPSC)
dust.noGravity = true;
}
@@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Summon
if (!Main.rand.NextBool(3))
continue;
Dust dust = Dust.NewDustDirect(Owner.position, Owner.width, Owner.height, ProvUtils.GetDustID((float)((Main.dayTime || !SpawnedFromPSC) ? Providence.BossMode.Day : Providence.BossMode.Night)));
Dust dust = Dust.NewDustDirect(Owner.position, Owner.width, Owner.height, ProvUtils.GetDustID(!Main.dayTime && SpawnedFromPSC));
dust.velocity = Main.rand.NextVector2Circular(3.5f, 3.5f);
dust.velocity.Y -= Main.rand.NextFloat(1f, 3f);
dust.scale = Main.rand.NextFloat(1.15f, 1.45f);
+1 -3
View File
@@ -314,9 +314,7 @@ namespace CalamityMod.Projectiles.Summon
Vector2 spawnPosition = player.Center + Main.rand.NextVector2Unit() * outwardness * Main.rand.NextFloat(0.75f, 1.1f);
Vector2 dustVelocity = (player.Center - spawnPosition) * 0.085f + owner.velocity;
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
Dust dust = Dust.NewDustPerfect(spawnPosition, ProvUtils.GetDustID(pscState));
Dust dust = Dust.NewDustPerfect(spawnPosition, ProvUtils.GetDustID(!Main.dayTime));
dust.velocity = dustVelocity;
dust.scale = dustScale * Main.rand.NextFloat(0.75f, 1.15f);
dust.color = Color.Lerp(Color.LightCoral, Color.White, Projectile.ai[2] / 120 * Main.rand.NextFloat(0.65f, 1f));
+2 -4
View File
@@ -107,8 +107,7 @@ namespace CalamityMod.Projectiles.Summon
// Fire laser through walls at max length
num807 = 2400f;
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int dustType = ProvUtils.GetDustID(pscState);
int dustType = ProvUtils.GetDustID(!Main.dayTime);
float amount = 0.5f;
Projectile.localAI[1] = MathHelper.Lerp(Projectile.localAI[1], num807, amount); // Length of laser, linear interpolation
Vector2 vector79 = Projectile.Center + Projectile.velocity * (Projectile.localAI[1] - 14f);
@@ -149,8 +148,7 @@ namespace CalamityMod.Projectiles.Summon
ModContent.Request<Texture2D>("CalamityMod/ExtraTextures/Lasers/ProvidenceHolyRayEndNight", AssetRequestMode.ImmediateLoad).Value;
float num223 = Projectile.localAI[1]; //length of laser
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
Color color44 = ProvUtils.GetProjectileColor(pscState, 0) * 0.9f;
Color color44 = ProvUtils.GetDayNightColor(!Main.dayTime, 0) * 0.9f;
Vector2 vector = Projectile.Center - Main.screenPosition;
Rectangle? sourceRectangle2 = null;
Main.spriteBatch.Draw(texture2D19, vector, sourceRectangle2, color44, Projectile.rotation, texture2D19.Size() / 2f, Projectile.scale, SpriteEffects.None, 0);
+1 -5
View File
@@ -87,8 +87,7 @@ namespace CalamityMod.Projectiles.Summon
{
SoundEngine.PlaySound(SoundID.Item14, Projectile.Center);
Projectile.ExpandHitboxBy(50);
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int dustType = ProvUtils.GetDustID(pscState);
int dustType = ProvUtils.GetDustID(!Main.dayTime);
for (int d = 0; d < 5; d++)
{
int holy = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f);
@@ -118,9 +117,6 @@ namespace CalamityMod.Projectiles.Summon
public override void OnHitPlayer(Player target, Player.HurtInfo info)
{
if ((info.Damage <= 0 && Projectile.maxPenetrate < (int)Providence.BossMode.Red) || target.creativeGodMode)
return;
Projectile.Kill();
}
}
@@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Summon
public override void AI()
{
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int dustID = ProvUtils.GetDustID(pscState);
int dustID = ProvUtils.GetDustID(!Main.dayTime);
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, 1f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
@@ -137,8 +137,7 @@ namespace CalamityMod.Projectiles.Summon
public override Color? GetAlpha(Color lightColor)
{
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
}
public override bool PreDraw(ref Color lightColor)
@@ -146,8 +145,7 @@ namespace CalamityMod.Projectiles.Summon
Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBlastNight").Value;
int num214 = texture.Height / Main.projFrames[Projectile.type];
int y6 = num214 * Projectile.frame;
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
@@ -180,8 +178,7 @@ namespace CalamityMod.Projectiles.Summon
Split(false, false);
}
SoundEngine.PlaySound(SoundID.Item20, Projectile.position);
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int dustID = ProvUtils.GetDustID(pscState);
int dustID = ProvUtils.GetDustID(!Main.dayTime);
for (int num193 = 0; num193 < 6; num193++)
{
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustID, 0f, 0f, 50, default, 1.5f);
@@ -251,7 +248,7 @@ namespace CalamityMod.Projectiles.Summon
}
if (Projectile.timeLeft > 550)
Projectile.velocity *= 0.95f;
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID((float)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night)), 0f, 0f, 100, default, Main.dayTime ? 1f : 0.75f);
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID(!Main.dayTime), 0f, 0f, 100, default, Main.dayTime ? 1f : 0.75f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
@@ -329,17 +326,15 @@ namespace CalamityMod.Projectiles.Summon
public override Color? GetAlpha(Color lightColor)
{
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
}
public override bool PreDraw(ref Color lightColor)
{
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFire2Night").Value;
int num214 = texture.Height / Main.projFrames[Projectile.type];
int y6 = num214 * Projectile.frame;
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
@@ -380,8 +375,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.width = Projectile.height = 200;
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int dust = ProvUtils.GetDustID(pscState);
int dust = ProvUtils.GetDustID(!Main.dayTime);
for (int num621 = 0; num621 < 4; num621++)
{
int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f);
@@ -507,9 +501,8 @@ namespace CalamityMod.Projectiles.Summon
public override bool PreDraw(ref Color lightColor)
{
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value);
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetProjectileColor(pscState, Projectile.alpha), 1);
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value);
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha), 1);
return false;
}
@@ -524,8 +517,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.width = Projectile.height = 200;
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int dust = ProvUtils.GetDustID(pscState);
int dust = ProvUtils.GetDustID(!Main.dayTime);
for (int num621 = 0; num621 < 4; num621++)
{
int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f);
@@ -736,8 +728,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2;
Projectile.velocity *= boomerSwarm ? 1.03f : 1.02f;
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int dust = ProvUtils.GetDustID(pscState);
int dust = ProvUtils.GetDustID(!Main.dayTime);
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, 1f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
@@ -747,8 +738,7 @@ namespace CalamityMod.Projectiles.Summon
public override Color? GetAlpha(Color lightColor)
{
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
}
public override bool PreDraw(ref Color lightColor)
@@ -756,8 +746,7 @@ namespace CalamityMod.Projectiles.Summon
Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Summon/ProfanedCrystalRangedHugesNight").Value;
int num214 = texture.Height / Main.projFrames[Projectile.type];
int y6 = num214 * Projectile.frame;
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
@@ -792,8 +781,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.width = Projectile.height = 200;
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int dust = ProvUtils.GetDustID(pscState);
int dust = ProvUtils.GetDustID(!Main.dayTime);
for (int num621 = 0; num621 < 4; num621++)
{
int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f);
@@ -922,8 +910,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.height = 50;
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int dust = ProvUtils.GetDustID(pscState);
int dust = ProvUtils.GetDustID(!Main.dayTime);
for (int num621 = 0; num621 < 10; num621++)
{
int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, 0f, 0f, 100, default, Main.dayTime ? 2f : 0.5f);
@@ -956,16 +943,14 @@ namespace CalamityMod.Projectiles.Summon
public override Color? GetAlpha(Color lightColor)
{
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value;
int num214 = texture.Height / Main.projFrames[Projectile.type];
int y6 = num214 * Projectile.frame;
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
@@ -1507,9 +1492,7 @@ namespace CalamityMod.Projectiles.Summon
Vector2 spawnPosition = Projectile.Center + Main.rand.NextVector2Unit() * outwardness * Main.rand.NextFloat(0.75f, 1.1f);
Vector2 dustVelocity = (Projectile.Center - spawnPosition) * 0.085f + owner.velocity;
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
Dust dust = Dust.NewDustPerfect(spawnPosition, ProvUtils.GetDustID(pscState));
Dust dust = Dust.NewDustPerfect(spawnPosition, ProvUtils.GetDustID(!Main.dayTime));
dust.velocity = dustVelocity;
dust.scale = dustScale * Main.rand.NextFloat(0.75f, 1.15f);
dust.noGravity = true;
@@ -1567,7 +1550,7 @@ namespace CalamityMod.Projectiles.Summon
Vector2 dustPos = new Vector2(Owner.Center.X + Main.rand.NextFloat(-10, 10), Owner.Center.Y + Main.rand.NextFloat(-10, 10));
Vector2 velocity = (Owner.Center - dustPos).SafeNormalize(Vector2.Zero);
velocity *= Main.dayTime ? 3f : 6.9f;
var dust = Dust.NewDustPerfect(Owner.Center, ProvUtils.GetDustID((float)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night)), velocity, 0, default(Color), 2f);
var dust = Dust.NewDustPerfect(Owner.Center, ProvUtils.GetDustID(!Main.dayTime), velocity, 0, default(Color), 2f);
if (!Main.dayTime)
dust.noGravity = true;
}
@@ -1795,8 +1778,7 @@ namespace CalamityMod.Projectiles.Summon
//Ensure that psa's spears are not coloured by night
var psc = Projectile.ai[0] > 0f;
int pscState = (int)((!Main.dayTime && psc) ? Providence.BossMode.Night : Providence.BossMode.Day);
int num469 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ProvUtils.GetDustID(pscState), 0f, 0f, 100, default, !Main.dayTime && psc ? 0.5f : 1f);
int num469 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, ProvUtils.GetDustID(!Main.dayTime && psc), 0f, 0f, 100, default, !Main.dayTime && psc ? 0.5f : 1f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
handleAI(psc && Projectile.ai[1] > 0f);
@@ -1813,9 +1795,8 @@ namespace CalamityMod.Projectiles.Summon
public override bool PreDraw(ref Color lightColor)
{
var psc = Projectile.ai[0] > 0f;
int pscState = (int)((!Main.dayTime && psc) ? Providence.BossMode.Night : Providence.BossMode.Day);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value);
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetProjectileColor(pscState, Projectile.alpha), 1);
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime && psc, Projectile.alpha, true), 4f, Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value);
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], ProvUtils.GetDayNightColor(!Main.dayTime && psc, Projectile.alpha), 1);
return false;
}
@@ -1830,9 +1811,8 @@ namespace CalamityMod.Projectiles.Summon
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
var psc = Projectile.ai[0] > 0f;
var shouldAdjust = !Main.dayTime && psc;
int pscState = (int)(shouldAdjust ? Providence.BossMode.Night : Providence.BossMode.Day);
int dustID = ProvUtils.GetDustID(pscState);
bool shouldAdjust = !Main.dayTime && psc;
int dustID = ProvUtils.GetDustID(shouldAdjust);
for (int num621 = 0; num621 < 4; num621++)
{
int num622 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustID, 0f, 0f, 100, default, !Main.dayTime && psc ? 0.5f : 2f);
@@ -1927,16 +1907,14 @@ namespace CalamityMod.Projectiles.Summon
Projectile.damage = (int)Owner.GetTotalDamage<SummonDamageClass>().ApplyTo(Projectile.originalDamage);
Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage);
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID(pscState), 0f, 0f, 100, default, 1f);
int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID(!Main.dayTime), 0f, 0f, 100, default, 1f);
Main.dust[num469].noGravity = true;
Main.dust[num469].velocity *= 0f;
}
public override Color? GetAlpha(Color lightColor)
{
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
}
public override bool PreDraw(ref Color lightColor)
@@ -1944,8 +1922,7 @@ namespace CalamityMod.Projectiles.Summon
Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyBlastNight").Value;
int num214 = texture.Height / Main.projFrames[Projectile.type];
int y6 = num214 * Projectile.frame;
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
@@ -1980,8 +1957,7 @@ namespace CalamityMod.Projectiles.Summon
Split();
}
SoundEngine.PlaySound(HolyBlast.ImpactSound, Projectile.Center);
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int dustID = ProvUtils.GetDustID(pscState);
int dustID = ProvUtils.GetDustID(!Main.dayTime);
for (int num193 = 0; num193 < 6; num193++)
{
Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustID, 0f, 0f, 50, default, Main.dayTime ? 1.5f : 0.5f);
@@ -2077,17 +2053,15 @@ namespace CalamityMod.Projectiles.Summon
public override Color? GetAlpha(Color lightColor)
{
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
return ProvUtils.GetProjectileColor(pscState, Projectile.alpha);
return ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha);
}
public override bool PreDraw(ref Color lightColor)
{
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
Texture2D texture = Main.dayTime ? Terraria.GameContent.TextureAssets.Projectile[Projectile.type].Value : ModContent.Request<Texture2D>("CalamityMod/Projectiles/Boss/HolyFire2Night").Value;
int num214 = texture.Height / Main.projFrames[Projectile.type];
int y6 = num214 * Projectile.frame;
Projectile.DrawBackglow(ProvUtils.GetProjectileColor(pscState, Projectile.alpha, true), 4f, texture);
Projectile.DrawBackglow(ProvUtils.GetDayNightColor(!Main.dayTime, Projectile.alpha, true), 4f, texture);
Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, num214)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, num214 / 2f), Projectile.scale, SpriteEffects.None, 0);
return false;
}
@@ -2102,8 +2076,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2);
Projectile.position.Y = Projectile.position.Y - (float)(Projectile.height / 2);
int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night);
int dust = ProvUtils.GetDustID(pscState);
int dust = ProvUtils.GetDustID(!Main.dayTime);
for (int num621 = 0; num621 < 4; num621++)
{
+48 -37
View File
@@ -75,12 +75,12 @@ namespace CalamityMod.Projectiles.Summon
HoverNearOwner,
AttackEnemy_Charge,
AttackEnemy_ReleaseDartBurst,
AttackOwner
AttackHearts
}
public int IdleTimer;
public int AttackTimer;
public int PlayerAttackCountdown;
public int HeartAttackCountdown;
public SepulcherSegment[] Segments = new SepulcherSegment[24];
public List<SepulcherArm> Arms = new List<SepulcherArm>();
public Player Owner => Main.player[Projectile.owner];
@@ -138,7 +138,7 @@ namespace CalamityMod.Projectiles.Summon
Initialize();
writer.Write(IdleTimer);
writer.Write(PlayerAttackCountdown);
writer.Write(HeartAttackCountdown);
writer.Write(Arms.Count);
for (int i = 0; i < Arms.Count; i++)
{
@@ -158,7 +158,7 @@ namespace CalamityMod.Projectiles.Summon
Initialize();
IdleTimer = reader.ReadInt32();
PlayerAttackCountdown = reader.ReadInt32();
HeartAttackCountdown = reader.ReadInt32();
int armCount = reader.ReadInt32();
Arms.Clear();
for (int i = 0; i < armCount; i++)
@@ -183,7 +183,7 @@ namespace CalamityMod.Projectiles.Summon
NPC potentialTarget = AttemptToFindTarget(1450f);
// Enter the attack state if a valid enemy is found and go back to hovering otherwise.
// This will be overriden if attacking the owner.
// This will be overriden if attacking its hearts.
if (CurrentAIState != AIState.AttackEnemy_ReleaseDartBurst && CurrentAIState != AIState.AttackEnemy_Charge)
{
if (potentialTarget != null)
@@ -195,23 +195,19 @@ namespace CalamityMod.Projectiles.Summon
AttackTimer = 0;
}
// Reset the AI to player attack mode if the countdown is going on.
if (PlayerAttackCountdown > 0)
// Reset the AI to heart attack mode if the countdown is going on.
if (HeartAttackCountdown > 0)
{
if (CurrentAIState != AIState.AttackOwner)
CurrentAIState = AIState.AttackOwner;
if (CurrentAIState != AIState.AttackHearts)
CurrentAIState = AIState.AttackHearts;
PlayerAttackCountdown--;
HeartAttackCountdown--;
// If it's finished, go back to idle owner hover movement.
if (PlayerAttackCountdown <= 0)
if (HeartAttackCountdown <= 0)
CurrentAIState = AIState.HoverNearOwner;
}
// Determine whether the projectile can attack its owner based on the attakc countdown.
Projectile.hostile = PlayerAttackCountdown > 0;
switch (CurrentAIState)
{
case AIState.HoverNearOwner:
@@ -225,8 +221,8 @@ namespace CalamityMod.Projectiles.Summon
AttackEnemyByCharging(potentialTarget);
AttackTimer++;
break;
case AIState.AttackOwner:
AttackOwner();
case AIState.AttackHearts:
AttackHearts();
break;
}
@@ -248,7 +244,7 @@ namespace CalamityMod.Projectiles.Summon
chanceToBecomeAngry = Utils.GetLerpValue(2f, 6f, heartsAttachedToOwner, true);
if (Main.rand.NextFloat() < chanceToBecomeAngry)
{
PlayerAttackCountdown = 300;
HeartAttackCountdown = 300;
Projectile.netUpdate = true;
}
else if (Main.netMode != NetmodeID.MultiplayerClient)
@@ -349,7 +345,7 @@ namespace CalamityMod.Projectiles.Summon
float rotationalVelocityFactor = Utils.GetLerpValue(0f, 6f, Projectile.velocity.Length(), true);
if (CurrentAIState == AIState.AttackEnemy_Charge)
rotationalVelocityFactor *= 0.85f;
if (CurrentAIState == AIState.AttackOwner)
if (CurrentAIState == AIState.AttackHearts)
rotationalVelocityFactor *= 1.2f;
if (Arms[i].ReelingBack)
@@ -455,14 +451,39 @@ namespace CalamityMod.Projectiles.Summon
}
}
public void AttackOwner()
public void AttackHearts()
{
// Attempt to angle towards the owner.
float newSpeed = MathHelper.Lerp(Projectile.velocity.Length(), 21f, 0.025f);
if (!Projectile.WithinRange(Owner.Center, 370f))
// Find the closest heart to the minion.
float npcDistCompare = 960f;
int index = -1;
foreach (NPC n in Main.ActiveNPCs)
{
Vector2 idealVelocity = Projectile.SafeDirectionTo(Owner.Center) * newSpeed;
if (!n.CanBeChasedBy(Projectile, false) || n.type != ModContent.NPCType<ExhumedHeart>())
continue;
float currentNPCDist = Vector2.Distance(n.Center, Projectile.Center);
if (currentNPCDist < npcDistCompare)
{
npcDistCompare = currentNPCDist;
index = n.whoAmI;
}
}
// If there are no Hearts left, immediately go back to being passive.
if (index == -1)
{
HeartAttackCountdown = 0;
CurrentAIState = AIState.HoverNearOwner;
return;
}
// Otherwise, move towards the targeted heart.
NPC targetHeart = Main.npc[index];
if (!Projectile.WithinRange(targetHeart.Center, 185f))
{
Vector2 idealVelocity = Projectile.SafeDirectionTo(targetHeart.Center) * newSpeed;
Projectile.velocity = Projectile.velocity.MoveTowards(idealVelocity, 2f);
float idealAimDirection = idealVelocity.ToRotation();
@@ -470,15 +491,15 @@ namespace CalamityMod.Projectiles.Summon
}
else if (Projectile.velocity.Length() < 36f)
{
Projectile.velocity *= 1.03f;
Projectile.velocity *= 1.066f;
if (JawSnapTimer <= 0f)
{
// Open the mouth of the jaw if close but not super close to the owner.
if (Projectile.WithinRange(Owner.Center, 300f))
if (Projectile.WithinRange(targetHeart.Center, 150f))
JawRotation = JawRotation.AngleLerp(0.87f, 0.12f);
// If really close, snap.
if (Projectile.WithinRange(Owner.Center, 180f))
if (Projectile.WithinRange(targetHeart.Center, 90f))
{
SoundEngine.PlaySound(SoundID.DD2_SkeletonHurt, Projectile.Center);
JawSnapTimer = 45f;
@@ -526,7 +547,7 @@ namespace CalamityMod.Projectiles.Summon
public override bool PreDraw(ref Color lightColor)
{
float angerFactor = Utils.GetLerpValue(300f, 280f, PlayerAttackCountdown, true) * Utils.GetLerpValue(0f, 30f, PlayerAttackCountdown, true);
float angerFactor = Utils.GetLerpValue(300f, 280f, HeartAttackCountdown, true) * Utils.GetLerpValue(0f, 30f, HeartAttackCountdown, true);
float afterimageOutwardness = MathHelper.Lerp(6f, 8f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 2.3f) * 0.5f + 0.5f) * angerFactor;
Color backAfterimageColor = Color.Red * angerFactor;
backAfterimageColor.A = 0;
@@ -671,21 +692,11 @@ namespace CalamityMod.Projectiles.Summon
#endregion
#region Damage Stuff
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers)
{
modifiers.SourceDamage *= 0f;
if (Main.masterMode) modifiers.SourceDamage.Flat += 450f;
else if (Main.expertMode) modifiers.SourceDamage.Flat += 375f;
else modifiers.SourceDamage.Flat += 300f;
}
public override bool? CanHitNPC(NPC target)
{
if (target.type == ModContent.NPCType<ExhumedHeart>())
return false;
return HeartAttackCountdown > 0;
return null;
}
#endregion
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
+10
View File
@@ -306,6 +306,16 @@ namespace CalamityMod.Systems
progress.Message = Language.GetOrRegister("Mods.CalamityMod.UI.Roxcalibur").Value;
MiscWorldgenRoutines.PlaceRoxShrine();
}));
// No Traps/GFB Auric Land Mines
if (Main.noTrapsWorld)
{
tasks.Insert(++currentFinalIndex, new PassLegacy("Auric Land Mines", (progress, config) =>
{
progress.Message = Language.GetOrRegister("Mods.CalamityMod.UI.AuricLandMines").Value;
MiscWorldgenRoutines.GenerateAuricLandMines();
}));
}
}
}
+33
View File
@@ -10,6 +10,7 @@ using CalamityMod.Tiles.Abyss;
using CalamityMod.Tiles.Astral;
using CalamityMod.Tiles.Crags;
using CalamityMod.Tiles.FurnitureAncient;
using CalamityMod.Tiles.FurnitureAuric;
using CalamityMod.Tiles.Ores;
using CalamityMod.Walls;
using Microsoft.Xna.Framework;
@@ -489,5 +490,37 @@ namespace CalamityMod.World
}
}
#endregion
#region Auric Land Mines
public static void GenerateAuricLandMines()
{
int landMineID = ModContent.TileType<AuricLandMineTile>();
int landMineChance = Main.zenithWorld ? 150 : 300;
float maxDepth = Main.maxTilesY * (Main.zenithWorld ? 0.75f : 0.5f); // depth increased in gfb due to the evil columns that extend further downward
for (int x = 0; x < Main.maxTilesX; x++)
{
for (int y = 0; y < maxDepth; y++)
{
Tile t = CalamityUtils.ParanoidTileRetrieval(x, y);
Tile above = CalamityUtils.ParanoidTileRetrieval(x, y - 1);
if (t != null)
{
if (above != null)
{
// Yharim killed the gods with auric land mines obviously
if ((t.TileType == TileID.Ebonstone || t.TileType == TileID.Crimstone) && !above.HasTile)
{
if (WorldGen.genRand.NextBool(landMineChance))
{
WorldGen.SlopeTile(x, y);
WorldGen.PlaceTile(x, y - 1, landMineID);
}
}
}
}
}
}
}
#endregion
}
}