Merge: Big E's Brain of Cthulhu Rev+ Rework
This commit is contained in:
1 parent
7a96e80f22
commit
ff0af84400
30 files changed
+5322
-855
No files matched your search
@@ -251,8 +251,12 @@ namespace CalamityMod.Effects
|
||||
#endregion
|
||||
|
||||
#region Big E's Shaders
|
||||
internal static Asset<Effect> RadialBlur;
|
||||
|
||||
internal static Asset<Effect> SeaPrismColorBlendingShader;
|
||||
internal static Asset<Effect> Dissolve;
|
||||
|
||||
internal static Asset<Effect> BrainOfCthulhuForcefield;
|
||||
#endregion
|
||||
|
||||
internal static Asset<Effect> SunkenSeaMenuLogoWater;
|
||||
@@ -498,11 +502,17 @@ namespace CalamityMod.Effects
|
||||
#endregion
|
||||
|
||||
#region Loading Big E's Shaders
|
||||
RadialBlur = LoadShader("ScreenShaders/RadialBlur");
|
||||
RegisterScreenShader(RadialBlur, "RadialBlurPass", "RadialBlurShader");
|
||||
|
||||
SeaPrismColorBlendingShader = LoadShader("SeaPrismColorBlending");
|
||||
RegisterMiscShader(SeaPrismColorBlendingShader, "SeaPrismBlendingPass", "SeaPrismColorBlending");
|
||||
|
||||
Dissolve = LoadShader("Dissolve");
|
||||
RegisterMiscShader(Dissolve, "DissolvePass", "Dissolve");
|
||||
|
||||
BrainOfCthulhuForcefield = LoadShader("ScreenShaders/BrainOfCthulhuForcefield");
|
||||
RegisterScreenShader(BrainOfCthulhuForcefield, "BoCShieldPass", "BrainOfCthulhuForcefield");
|
||||
#endregion
|
||||
|
||||
SunkenSeaMenuLogoWater = LoadShader("UI/SunkenSeaMenuLogoWater");
|
||||
|
||||
@@ -17,7 +17,7 @@ float4 uShaderSpecificData;
|
||||
float4 AdjustPixelPosition(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
|
||||
{
|
||||
// Drift to offset the noisemap. X multiplier is a prime number to ensure the "loop time" of this is very high, it takes 100 uTime to return to the original state
|
||||
float2 drift = float2(0.23 * uTime * uSaturation, uTime * uSaturation);
|
||||
float2 drift = float2(uTime * uRotation, uTime * uSaturation);
|
||||
|
||||
//This is the uv distance from the center of the texture
|
||||
float2 uvOffsetFromCenter = (coords - 0.5);
|
||||
@@ -38,8 +38,16 @@ float4 AdjustPixelPosition(float4 sampleColor : COLOR0, float2 coords : TEXCOORD
|
||||
// I would like to be able to draw directly additive, but I have been unable to make that work and this has worked well.
|
||||
float4 distortedColor = tex2D(uImage0, modifiedCoords);
|
||||
distortedColor.a = distortedColor.x;
|
||||
distortedColor *= uDirection;
|
||||
|
||||
float4 drawColor = sampleColor;
|
||||
float4 borderColor = sampleColor;
|
||||
borderColor.rgb = uSecondaryColor;
|
||||
|
||||
if(dist > 0.4)
|
||||
drawColor = lerp(sampleColor, borderColor, (dist - 0.4) / 0.1);
|
||||
|
||||
return distortedColor * sampleColor * mask;
|
||||
return distortedColor * drawColor * mask;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,149 @@
|
||||
sampler uImage0 : register(s0);
|
||||
sampler uImage1 : register(s1);
|
||||
sampler uImage2 : register(s2);
|
||||
sampler uImage3 : register(s3);
|
||||
texture voronoi;
|
||||
sampler2D voronoiSampler = sampler_state
|
||||
{
|
||||
texture = <voronoi>;
|
||||
magfilter = LINEAR;
|
||||
minfilter = LINEAR;
|
||||
mipfilter = LINEAR;
|
||||
AddressU = wrap;
|
||||
AddressV = wrap;
|
||||
};
|
||||
|
||||
texture depthNoise;
|
||||
sampler2D noiseSampler = sampler_state
|
||||
{
|
||||
texture = <depthNoise>;
|
||||
magfilter = LINEAR;
|
||||
minfilter = LINEAR;
|
||||
mipfilter = LINEAR;
|
||||
AddressU = wrap;
|
||||
AddressV = wrap;
|
||||
};
|
||||
|
||||
float3 uColor;
|
||||
float3 uSecondaryColor;
|
||||
float2 uScreenResolution;
|
||||
float2 uScreenPosition;
|
||||
float2 uTargetPosition;
|
||||
float2 uDirection;
|
||||
float uOpacity;
|
||||
float uTime;
|
||||
float uIntensity;
|
||||
float uProgress;
|
||||
float2 uImageSize1;
|
||||
float2 uImageSize2;
|
||||
float2 uImageSize3;
|
||||
float2 uImageOffset;
|
||||
float uSaturation;
|
||||
float4 uSourceRect;
|
||||
float2 uZoom;
|
||||
|
||||
float4 PixelShaderFunction(float2 coords : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float resolutionRatio = uScreenResolution.x / uScreenResolution.y;
|
||||
|
||||
float screenScale = 1080.0 / min(uScreenResolution.x, uScreenResolution.y);
|
||||
|
||||
float pixelSize = 0.002 * uZoom;
|
||||
float2 aspectCorrectedCoords = coords;
|
||||
aspectCorrectedCoords.x *= resolutionRatio;
|
||||
float2 pixelatedCoords = floor(aspectCorrectedCoords / pixelSize) * pixelSize + pixelSize * 0.5;
|
||||
pixelatedCoords.x /= resolutionRatio;
|
||||
|
||||
float radius = uProgress * screenScale * resolutionRatio;
|
||||
|
||||
float4 baseColor = (1, 1, 1, 1);
|
||||
baseColor.rgb = uColor;
|
||||
|
||||
float4 edgeColor = (1, 1, 1, 1);
|
||||
edgeColor.rgb = uSecondaryColor;
|
||||
|
||||
float2 center = (uDirection - (0.5, 0.5)) * 2;
|
||||
center.x *= resolutionRatio;
|
||||
|
||||
float2 correctedCoords = (pixelatedCoords - (0.5, 0.5)) * 2;
|
||||
correctedCoords.x *= resolutionRatio;
|
||||
float2 correctedTrueCoords = (coords - (0.5, 0.5)) * 2;
|
||||
correctedTrueCoords.x *= resolutionRatio;
|
||||
|
||||
float2 centerOffset = center - correctedCoords;
|
||||
float angle = atan2(centerOffset.y, centerOffset.x);
|
||||
float dist = length(centerOffset);
|
||||
float2 polarUV = float2(angle, dist);
|
||||
|
||||
float2 voronoiUV = float2(angle / (2 * 3.14159), dist - (uTime / 4));
|
||||
float voronoiValue = tex2D(voronoiSampler, voronoiUV).r;
|
||||
|
||||
float sin1 = sin((uTime * 9) + (angle * 8)) / 132 + 0.5;
|
||||
float sin2 = sin((-uTime * 3) + (angle * 16)) / 124 + 0.5;
|
||||
float sin3 = sin((uTime * 6) + (angle * 6)) / 116 + 0.5;
|
||||
|
||||
float voronoiStrength = 0.025;
|
||||
|
||||
radius += sin1 + sin2 + sin3;
|
||||
radius += voronoiValue * voronoiStrength;
|
||||
radius -= 1.5;
|
||||
|
||||
if (dist < radius)
|
||||
{
|
||||
float normalizedDist = dist / radius;
|
||||
float distortionStrength = 0.15 * uOpacity;
|
||||
float distortionFalloff = pow(normalizedDist, 3);
|
||||
float sphericalOffset = (1.0 - normalizedDist) * distortionStrength * distortionFalloff;
|
||||
float2 distortionDirection = normalize(center - correctedCoords);
|
||||
float2 distortedCoords = coords + (distortionDirection * sphericalOffset * normalizedDist);
|
||||
|
||||
float distDiff = (radius - dist) / radius;
|
||||
if (distDiff > 0.5)
|
||||
distDiff = 1;
|
||||
else
|
||||
distDiff *= 2;
|
||||
float l = lerp(0, pow(1 - distDiff, 5), uOpacity);
|
||||
|
||||
float baseWave = dist / uZoom * 50 - uTime * 7;
|
||||
float angleWave = sin(angle * 12 - uTime * 4) * 0.3;
|
||||
float wave = pow(max(0, sin(baseWave + angleWave)), 3) * 0.8;
|
||||
|
||||
float waveFade = pow(normalizedDist, 3);
|
||||
float waveIntensity = wave * waveFade * 0.7;
|
||||
|
||||
float perspectiveScale = 1.0 + (normalizedDist * 3.0);
|
||||
float2 noiseUV = float2(
|
||||
polarUV.x / (2 * 3.14159),
|
||||
polarUV.y * (perspectiveScale / uZoom.x) / 5 - (uTime * 0.2)
|
||||
);
|
||||
float noiseValue = tex2D(noiseSampler, noiseUV).r;
|
||||
|
||||
float noiseFade = pow(normalizedDist, 2) * 0.333; //controls overall intensity
|
||||
float depthNoise = noiseValue * noiseFade;
|
||||
|
||||
float4 baseTexture = tex2D(uImage0, distortedCoords);
|
||||
float4 shieldColor = lerp(baseTexture, edgeColor, l);
|
||||
float4 depthColor = float4(depthNoise, depthNoise, depthNoise, 0);
|
||||
depthColor.rgb = lerp(edgeColor, (1, 1, 1, 1), 0.33);
|
||||
depthColor *= depthNoise;
|
||||
|
||||
return shieldColor
|
||||
+ (baseColor * waveIntensity * uOpacity)
|
||||
+ depthColor * uOpacity;
|
||||
}
|
||||
else if (dist < radius + 0.01)
|
||||
{
|
||||
float4 brightEdgeColor = lerp(edgeColor, (1, 1, 1, 1), 0.4);
|
||||
return brightEdgeColor;
|
||||
}
|
||||
|
||||
return tex2D(uImage0, coords);
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass BoCShieldPass
|
||||
{
|
||||
PixelShader = compile ps_3_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,50 @@
|
||||
sampler uImage0 : register(s0);
|
||||
sampler uImage1 : register(s1);
|
||||
sampler uImage2 : register(s2);
|
||||
sampler uImage3 : register(s3);
|
||||
float3 uColor;
|
||||
float3 uSecondaryColor;
|
||||
float2 uScreenResolution;
|
||||
float2 uScreenPosition;
|
||||
float2 uTargetPosition;
|
||||
float2 uDirection;
|
||||
float uOpacity;
|
||||
float uTime;
|
||||
float uIntensity;
|
||||
float uProgress;
|
||||
float2 uImageSize1;
|
||||
float2 uImageSize2;
|
||||
float2 uImageSize3;
|
||||
float2 uImageOffset;
|
||||
float uSaturation;
|
||||
float4 uSourceRect;
|
||||
float2 uZoom;
|
||||
|
||||
float4 PixelShaderFunction(float2 coords : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float2 pixelCoords = coords;
|
||||
|
||||
float2 dir = uDirection - pixelCoords;
|
||||
float2 blur = dir * uIntensity * 0.005;
|
||||
float4 baseColor = 0;
|
||||
float2 sampleUV = coords;
|
||||
|
||||
for (int i = 0; i < uSaturation; i++)
|
||||
{
|
||||
baseColor += tex2D(uImage0, sampleUV);
|
||||
sampleUV += blur;
|
||||
|
||||
if (i > 20)
|
||||
break;
|
||||
}
|
||||
|
||||
return baseColor / uSaturation;
|
||||
}
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass RadialBlurPass
|
||||
{
|
||||
PixelShader = compile ps_3_0 PixelShaderFunction();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -714,6 +714,7 @@ namespace CalamityMod.Items
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return base.UseItem(item, player);
|
||||
}
|
||||
|
||||
|
||||
@@ -565,3 +565,5 @@ WildBumblebirb.DisplayName: Wild Bumblebirb
|
||||
DraconicSwarmer.DisplayName: Draconic Swarmer
|
||||
Dragonfolly.DisplayName: Dragonfolly
|
||||
Shoreskipper.DisplayName: Shoreskipper
|
||||
BrainIllusion.DisplayName: Brain Illusion
|
||||
FalseBrain.DisplayName: False Brain
|
||||
@@ -24,6 +24,7 @@ BigFlare2.DisplayName: Big Flare
|
||||
BirbAura.DisplayName: Draconic Aura
|
||||
BirbAuraFlare.DisplayName: Draconic Aura Flare
|
||||
BloodGeyser.DisplayName: Blood Geyser
|
||||
BloodScythe.DisplayName: Blood Scythe
|
||||
BrimstoneBall.DisplayName: Brimstone Fireball
|
||||
BrimstoneBarrage.DisplayName: Brimstone Dart
|
||||
BrimstoneFire.DisplayName: Brimstone Fire
|
||||
@@ -44,6 +45,8 @@ CalamitousExplosion.DisplayName: Calamitous Explosion
|
||||
CalamitousFireball.DisplayName: Calamitous Fireball
|
||||
CataclysmicFlame.DisplayName: Cataclysmic Flame
|
||||
CatastrophicCinder.DisplayName: Catastrophic Cinder
|
||||
CirclingBloodScythe.DisplayName: Circling Blood Scythe
|
||||
CrimsonEye.DisplayName: Crimson Eye
|
||||
CrimulanSpike.DisplayName: Crimulan Spike
|
||||
CursedFire.DisplayName: Eye Fire
|
||||
DarkEnergyBall.DisplayName: Dark Energy
|
||||
@@ -73,6 +76,7 @@ FlareBomb.DisplayName: Flare Bomb
|
||||
FlareDust.DisplayName: Flare Dust
|
||||
FlareDust2.DisplayName: Flare Bomb
|
||||
Flarenado.DisplayName: Flarenado
|
||||
FriendlyLaserWallBeam.DisplayName: God's Bane Doombeam
|
||||
FrostMist.DisplayName: Frost Mist
|
||||
GolemInfernoBolt.DisplayName: Golem Fire Bolt
|
||||
GolemInfernoBlast.DisplayName: Golem Fire Blast
|
||||
@@ -97,6 +101,7 @@ IceBomb.DisplayName: Ice Bomb
|
||||
IceRain.DisplayName: Ice Rain
|
||||
IchorBlob.DisplayName: Ichor Blob
|
||||
IchorShot.DisplayName: Ichor Shot
|
||||
IchorShower.DisplayName: Ichor Shower
|
||||
Infernado.DisplayName: Infernado
|
||||
Infernado2.DisplayName: Infernado
|
||||
InfernadoRevenge.DisplayName: Infernado
|
||||
@@ -148,6 +153,7 @@ SCalBrimstoneFireblast.DisplayName: Brimstone Fireblast
|
||||
SCalBrimstoneGigablast.DisplayName: Brimstone Gigablast
|
||||
SCalRitualDrama.DisplayName: Calamitous Ritual Drama
|
||||
HomingLaserDart.DisplayName: Homing Dart
|
||||
HyperdeathRiftScepterBeam.DisplayName: Hyperdeath Rift Ripper
|
||||
ShadeNimbusHostile.DisplayName: Shade Nimbus
|
||||
ShaderainHostile.DisplayName: Shade Rain
|
||||
ShadowflameFireball.DisplayName: Shadowflame Fireball
|
||||
@@ -161,6 +167,8 @@ StormWeaverFrostWaveTelegraph.DisplayName: Frost Wave Telegraph
|
||||
SupremeCataclysmFist.DisplayName: Fist of Fury
|
||||
SupremeCatastropheSlash.DisplayName: Resonance Slash
|
||||
SwirlingFire.DisplayName: Fire
|
||||
TelekineticEnemyGrab.DisplayName: Telekinetic Enemy Grab
|
||||
TelekineticBlast.DisplayName: Telekinetic Blast
|
||||
ThanatosBeamStart.DisplayName: T Hanos Beam
|
||||
ThanatosBeamTelegraph.DisplayName: Gamma Disintegration Beam Telegraph
|
||||
ThanatosLaser.DisplayName: Exo Pulse Laser
|
||||
|
||||
@@ -63,6 +63,7 @@ using CalamityMod.Tiles.FurnitureAuric;
|
||||
using CalamityMod.Tiles.Ores;
|
||||
using CalamityMod.UI;
|
||||
using CalamityMod.UI.DebuffSystem;
|
||||
using CalamityMod.UI.VanillaBossBars;
|
||||
using CalamityMod.Walls.DraedonStructures;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -1234,6 +1235,10 @@ namespace CalamityMod.NPCs
|
||||
npc.SetDebuffImmunities();
|
||||
|
||||
VulnerabilitiesAndResistances(npc);
|
||||
|
||||
//Gives Brain of Cthulhu a unique boss bar in Rev+ where Creepers contribute to a Shield rather than additional Health
|
||||
if (npc.type == NPCID.BrainofCthulhu && CalamityWorld.revenge)
|
||||
npc.BossBar = GetInstance<RevBrainOfCthulhuBossBar>();
|
||||
}
|
||||
|
||||
public override bool? CanFallThroughPlatforms(NPC npc)
|
||||
@@ -1279,10 +1284,10 @@ namespace CalamityMod.NPCs
|
||||
npc.lifeMax *= 4;
|
||||
break;
|
||||
case NPCID.BrainofCthulhu:
|
||||
npc.lifeMax *= 2;
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.75);
|
||||
break;
|
||||
case NPCID.Creeper:
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.4);
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.1);
|
||||
break;
|
||||
case NPCID.QueenBee:
|
||||
npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.8);
|
||||
|
||||
@@ -946,6 +946,14 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
AIOverride?.PostAI(Mod);
|
||||
}
|
||||
|
||||
public override bool? CanBeHitByProjectile(NPC npc, Projectile projectile)
|
||||
{
|
||||
if (!Enabled)
|
||||
return base.CanBeHitByProjectile(npc, projectile);
|
||||
|
||||
return AIOverride?.CanBeHitByProjectile(Mod, projectile);
|
||||
}
|
||||
|
||||
public override void HitEffect(NPC npc, NPC.HitInfo hit)
|
||||
{
|
||||
if (!Enabled)
|
||||
@@ -954,6 +962,46 @@ public sealed partial class CalamityVanillaAIOverrideNPC : GlobalNPC
|
||||
AIOverride?.HitEffect(Mod, hit);
|
||||
}
|
||||
|
||||
public override void ModifyHitByItem(NPC npc, Player player, Item item, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
AIOverride?.ModifyHitByItem(Mod, player, item, ref modifiers);
|
||||
}
|
||||
|
||||
public override void ModifyHitByProjectile(NPC npc, Projectile projectile, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
AIOverride?.ModifyHitByProjectile(Mod, projectile, ref modifiers);
|
||||
}
|
||||
|
||||
public override void OnHitByItem(NPC npc, Player player, Item item, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
AIOverride?.OnHitByItem(Mod, player, item, hit, damageDone);
|
||||
}
|
||||
|
||||
public override void OnHitByProjectile(NPC npc, Projectile projectile, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
if (!Enabled)
|
||||
return;
|
||||
|
||||
AIOverride?.OnHitByProjectile(Mod, projectile, hit, damageDone);
|
||||
}
|
||||
|
||||
public override bool PreKill(NPC npc)
|
||||
{
|
||||
if (!Enabled || AIOverride == null)
|
||||
return base.PreKill(npc);
|
||||
|
||||
return AIOverride.PreKill(Mod);
|
||||
}
|
||||
|
||||
public override void FindFrame(NPC npc, int frameHeight)
|
||||
{
|
||||
if (!Enabled)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large.
Load diff
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 258 B |
Binary file not shown.
|
After Width: | Height: | Size: 196 KiB |
@@ -4,6 +4,7 @@ using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader.IO;
|
||||
using Terraria.WorldBuilding;
|
||||
|
||||
namespace CalamityMod.NPCs.VanillaNPCAIOverrides
|
||||
{
|
||||
@@ -43,8 +44,20 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides
|
||||
|
||||
}
|
||||
|
||||
public virtual bool? CanBeHitByProjectile(Mod mod, Projectile projectile) => null;
|
||||
|
||||
public virtual void ModifyHitByItem(Mod mod, Player player, Item item, ref NPC.HitModifiers modifiers) { }
|
||||
|
||||
public virtual void ModifyHitByProjectile(Mod mod, Projectile projectile, ref NPC.HitModifiers modifiers) { }
|
||||
|
||||
public virtual void OnHitByItem(Mod mod, Player player, Item item, NPC.HitInfo hit, int damageDone) { }
|
||||
|
||||
public virtual void OnHitByProjectile(Mod mod, Projectile projectile, NPC.HitInfo hit, int damageDone) { }
|
||||
|
||||
public virtual void HitEffect(Mod mod, NPC.HitInfo hit) { }
|
||||
|
||||
public virtual bool PreKill(Mod mod) => true;
|
||||
|
||||
public virtual void FindFrame(Mod mod, int frameHeight) { }
|
||||
|
||||
public virtual bool PreDraw(Mod mod, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) => true;
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 150 KiB |
@@ -300,6 +300,11 @@ namespace CalamityMod.Projectiles
|
||||
|
||||
public int HomingTarget = -1;
|
||||
|
||||
/// <summary>
|
||||
/// Flag used during Rev+ Brain of Cthulhu to denote projectiles that were spawned prior to its Illusion Trick attack starting.
|
||||
/// </summary>
|
||||
public bool IgnoreBoCIllusions = false;
|
||||
|
||||
#region On Spawn
|
||||
public override void OnSpawn(Projectile projectile, IEntitySource source)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
using System;
|
||||
using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Scenes.MusicScenes
|
||||
{
|
||||
public class RevBoCIntroMusicScene : ModSceneEffect
|
||||
{
|
||||
public override bool IsSceneEffectActive(Player player)
|
||||
{
|
||||
if(!CalamityWorld.revenge)
|
||||
return false;
|
||||
|
||||
if (NPC.crimsonBoss == -1)
|
||||
return false;
|
||||
|
||||
NPC brain = Main.npc[NPC.crimsonBoss];
|
||||
|
||||
if (brain.ai[0] >= 0) //BoC isn't doing its spawn animation
|
||||
return false;
|
||||
|
||||
BrainOfCthulhuAI revBrain = brain.AIOverride<BrainOfCthulhuAI>();
|
||||
|
||||
// BoC has sent out all its Creepers
|
||||
// The second part leaves one frame at the end of the animation where the boss music starts playing, so that it can be instantly maxed out
|
||||
return revBrain.SpawnTime != 0 && (revBrain.Time - Math.Abs(revBrain.SpawnTime) < 420);
|
||||
}
|
||||
|
||||
public override int Music => MusicLoader.GetMusicSlot(Mod, "Sounds/Music/Silence");
|
||||
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium;
|
||||
}
|
||||
|
||||
public class RevBoCPreIntroMusicScene : ModSceneEffect
|
||||
{
|
||||
public override bool IsSceneEffectActive(Player player)
|
||||
{
|
||||
if (!CalamityWorld.revenge)
|
||||
return false;
|
||||
|
||||
if (NPC.crimsonBoss == -1)
|
||||
return false;
|
||||
|
||||
NPC brain = Main.npc[NPC.crimsonBoss];
|
||||
|
||||
if (brain.ai[0] >= 0) //BoC isn't doing its spawn animation
|
||||
return false;
|
||||
|
||||
BrainOfCthulhuAI revBrain = brain.AIOverride<BrainOfCthulhuAI>();
|
||||
|
||||
// BoC has sent out all its Creepers
|
||||
// The second part leaves one frame at the end of the animation where the boss music starts playing, so that it can be instantly maxed out
|
||||
return revBrain.SpawnTime != 0 && (revBrain.Time - Math.Abs(revBrain.SpawnTime) < 420);
|
||||
}
|
||||
|
||||
public override int Music => RevBoCSystem.PreviousMusic >= 0 ? RevBoCSystem.PreviousMusic : MusicID.Crimson; //Keeps the music that was playing prior to BoC being spawned
|
||||
|
||||
public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ReLogic.Content;
|
||||
using Terraria;
|
||||
using Terraria.GameContent;
|
||||
using Terraria.GameContent.UI.BigProgressBar;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.UI.VanillaBossBars
|
||||
{
|
||||
internal class RevBrainOfCthulhuBossBar : ModBossBar
|
||||
{
|
||||
public override Asset<Texture2D> GetIconTexture(ref Rectangle? iconFrame) => TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[NPCID.BrainofCthulhu]];
|
||||
|
||||
public override bool? ModifyInfo(ref BigProgressBarInfo info, ref float life, ref float lifeMax, ref float shield, ref float shieldMax)
|
||||
{
|
||||
NPC target = Main.npc[info.npcIndexToAimAt];
|
||||
if (!target.active)
|
||||
return false;
|
||||
|
||||
// Get the boss health, obviously
|
||||
life = target.life;
|
||||
lifeMax = target.lifeMax;
|
||||
|
||||
// Reset the shield
|
||||
shield = 0f;
|
||||
shieldMax = 0f;
|
||||
|
||||
if (NPC.AnyNPCs(NPCID.Creeper))
|
||||
{
|
||||
foreach (NPC creeper in Main.ActiveNPCs)
|
||||
{
|
||||
if (creeper.type != NPCID.Creeper)
|
||||
continue;
|
||||
shieldMax = creeper.lifeMax * BrainOfCthulhuAI.GetBrainOfCthuluCreepersCountRevDeath();
|
||||
shield += creeper.life;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items;
|
||||
using CalamityMod.Items.BaseItems;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.NPCs.VanillaNPCAIOverrides;
|
||||
using CalamityMod.Projectiles;
|
||||
using Terraria;
|
||||
|
||||
@@ -11,6 +12,19 @@ namespace CalamityMod
|
||||
{
|
||||
public static CalamityPlayer Calamity(this Player player) => player.GetModPlayer<CalamityPlayer>();
|
||||
public static CalamityGlobalNPC Calamity(this NPC npc) => npc.GetGlobalNPC<CalamityGlobalNPC>();
|
||||
public static CalamityVanillaAIOverrideNPC AIOverrideNPC(this NPC npc) => npc.GetGlobalNPC<CalamityVanillaAIOverrideNPC>();
|
||||
public static T? AIOverride<T>(this NPC npc) {
|
||||
VanillaAIOverride aiOverride = npc.GetGlobalNPC<CalamityVanillaAIOverrideNPC>().AIOverride;
|
||||
if (aiOverride == null)
|
||||
throw new System.Exception("NPC does not have an AI Override");
|
||||
|
||||
if(aiOverride is T ai)
|
||||
return ai;
|
||||
|
||||
throw new System.Exception($"NPC's AI Override is not of Type {typeof(T).Name}");
|
||||
}
|
||||
public static CalamityTileCollisionHarmNPC FlungNPC(this NPC npc) => npc.GetGlobalNPC<CalamityTileCollisionHarmNPC>();
|
||||
public static CalamityPolarityNPC PolarityNPC(this NPC npc) => npc.GetGlobalNPC<CalamityPolarityNPC>();
|
||||
public static CalamityGlobalItem Calamity(this Item item) => item.GetGlobalItem<CalamityGlobalItem>();
|
||||
public static CalamityGlobalProjectile Calamity(this Projectile proj) => proj.GetGlobalProjectile<CalamityGlobalProjectile>();
|
||||
public static TransformationPlayer Transformation(this Player player) => player.GetModPlayer<TransformationPlayer>();
|
||||
|
||||
@@ -293,6 +293,16 @@ namespace CalamityMod
|
||||
|
||||
public static List<Point> GetIntersectingPointsInLine(Vector2 start, Vector2 end) => GetIntersectingPointsInLine(start.ToTileCoordinates(), end.ToTileCoordinates());
|
||||
|
||||
/// <summary>
|
||||
/// Rotates a vector towards targetAngle by at most maxChange and normalizes the vector.
|
||||
/// </summary>
|
||||
public static Vector2 RotateDirectionTowards(this Vector2 vec, float targetAngle, float maxChange) => vec.ToRotation().AngleTowards(targetAngle, maxChange).ToRotationVector2();
|
||||
|
||||
/// <summary>
|
||||
/// Rotates a vector towards targetAngle by at most maxChange.
|
||||
/// </summary>
|
||||
public static Vector2 RotateTowards(this Vector2 vec, float targetAngle, float maxChange) => vec.RotateDirectionTowards(targetAngle, maxChange) * vec.Length();
|
||||
|
||||
#region Easings
|
||||
/// <summary>
|
||||
/// Gets a value from 0 to 1 and returns an eased value.
|
||||
|
||||
Reference in new issue
Block a user