Merge branch 'master' into draedon-summoner

This commit is contained in:
Dominic committed 2021-07-31 12:41:25 -05:00
commit 5d8aef129c
269 files changed
+8177 -5890

No files matched your search

+3 -3
View File
@@ -114,15 +114,15 @@ namespace CalamityMod.Buffs
break;
case BuffID.BeetleMight1:
tip = "Melee damage and speed increase by 5%";
tip = "Melee damage increased by 10%";
break;
case BuffID.BeetleMight2:
tip = "Melee damage and speed increase by 10%";
tip = "Melee damage increased by 20%";
break;
case BuffID.BeetleMight3:
tip = "Melee damage and speed increase by 15%";
tip = "Melee damage increased by 30%";
break;
case BuffID.BeetleEndurance1:
+36
View File
@@ -0,0 +1,36 @@
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
class VoidConcentrationBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Concentrated Void");
Description.SetDefault("The infinite void yearns for more...");
Main.buffNoTimeDisplay[Type] = true;
Main.buffNoSave[Type] = true;
//Main.persistentBuff[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer mp = player.Calamity();
int count = player.ownedProjectileCounts[ModContent.ProjectileType<VoidConcentrationAura>()];
player.minionDamage += 0.05f; //5%
player.armorPenetration += 10;
if (!mp.voidAuraDamage && count == 0)
{
player.DelBuff(buffIndex);
buffIndex--;
}
else
{
player.buffTime[buffIndex] = 18000;
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

+23 -6
View File
@@ -42,6 +42,7 @@ using CalamityMod.NPCs.SulphurousSea;
using CalamityMod.NPCs.SunkenSea;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.NPCs.Yharon;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Boss;
using CalamityMod.Projectiles.DraedonsArsenal;
using CalamityMod.Projectiles.Enemy;
@@ -52,6 +53,7 @@ using CalamityMod.Projectiles.Ranged;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Skies;
using CalamityMod.Tiles;
using CalamityMod.UI;
using CalamityMod.World;
@@ -71,6 +73,8 @@ using Terraria.Localization;
using Terraria.ModLoader;
using Terraria.ModLoader.IO;
using ProvidenceBoss = CalamityMod.NPCs.Providence.Providence;
namespace CalamityMod.CalPlayer
{
public partial class CalamityPlayer : ModPlayer
@@ -589,6 +593,8 @@ namespace CalamityMod.CalPlayer
public int roverDriveTimer = 0;
public int roverFrameCounter = 0;
public int roverFrame = 0;
public int voidFrameCounter = 0;
public int voidFrame = 0;
public bool rottenDogTooth = false;
public bool angelicAlliance = false;
public int angelicActivate = -1;
@@ -922,6 +928,8 @@ namespace CalamityMod.CalPlayer
public bool plaguebringerMK2 = false;
public bool igneousExaltation = false;
public bool coldDivinity = false;
public bool voidAura = false;
public bool voidAuraDamage = false;
public bool youngDuke = false;
public bool virili = false;
public bool frostBlossom = false;
@@ -1050,6 +1058,10 @@ namespace CalamityMod.CalPlayer
public bool lecherousOrbEnchant = false;
#endregion Calamitas Enchant Effects
#region Draw Effects
public FireParticleSet ProvidenceBurnEffectDrawer = new FireParticleSet(-1, 1, Color.Yellow, Color.Red * 1.2f, 10f, 0.65f);
#endregion Draw Effects
#endregion
#region SavingAndLoading
@@ -1990,6 +2002,8 @@ namespace CalamityMod.CalPlayer
plaguebringerMK2 = false;
igneousExaltation = false;
coldDivinity = false;
voidAura = false;
voidAuraDamage = false;
radiantResolution = false;
virili = false;
frostBlossom = false;
@@ -3664,10 +3678,6 @@ namespace CalamityMod.CalPlayer
{
meleeSpeedMult += 0.05f;
}
if (graxDefense)
{
meleeSpeedMult += 0.1f;
}
if (yPower)
{
meleeSpeedMult += 0.05f;
@@ -3774,8 +3784,7 @@ namespace CalamityMod.CalPlayer
}
if (player.beetleOffense && player.beetleOrbs > 0)
{
player.meleeDamage -= 0.05f * player.beetleOrbs;
meleeSpeedMult -= 0.05f * player.beetleOrbs;
meleeSpeedMult -= 0.1f * player.beetleOrbs;
}
if (CalamityConfig.Instance.Proficiency)
{
@@ -3860,6 +3869,14 @@ namespace CalamityMod.CalPlayer
}
roverFrameCounter++;
int frames = 4;
if (voidFrameCounter >= 6)
{
voidFrameCounter = 0;
voidFrame = voidFrame == frames - 1 ? 0 : voidFrame + 1;
}
voidFrameCounter++;
for (int i = 0; i < player.dye.Length; i++)
{
if (player.dye[i].type == ModContent.ItemType<ProfanedMoonlightDye>())
+29 -1
View File
@@ -4,8 +4,8 @@ using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.NPCs;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@@ -17,6 +17,8 @@ using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
using ProvidenceBoss = CalamityMod.NPCs.Providence.Providence;
namespace CalamityMod.CalPlayer
{
public class CalamityPlayerDrawEffects : ModPlayer
@@ -71,8 +73,14 @@ namespace CalamityMod.CalPlayer
{
if (drawInfo.shadow != 0f)
return;
Player drawPlayer = drawInfo.drawPlayer;
CalamityPlayer modPlayer = drawPlayer.Calamity();
modPlayer.ProvidenceBurnEffectDrawer.DrawSet(drawPlayer.Bottom - Vector2.UnitY * 10f);
modPlayer.ProvidenceBurnEffectDrawer.SpawnAreaCompactness = 18f;
modPlayer.ProvidenceBurnEffectDrawer.RelativePower = 0.4f;
if (modPlayer.sirenIce)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/ExtraTextures/IceShield");
@@ -405,6 +413,25 @@ namespace CalamityMod.CalPlayer
}
});
public static readonly PlayerLayer ConcentratedVoidAura = new PlayerLayer("CalamityMod", "VoidAura", PlayerLayer.Skin, drawInfo =>
{
Player drawPlayer = drawInfo.drawPlayer;
CalamityPlayer modPlayer = drawPlayer.Calamity();
if (modPlayer.voidAura || modPlayer.voidAuraDamage)
{
Texture2D tex = ModContent.GetTexture("CalamityMod/ExtraTextures/VoidConcentrationAura");
Vector2 drawPos = drawPlayer.Center - Main.screenPosition + new Vector2(0f, drawPlayer.gfxOffY);
drawPos.Y -= 9;
SpriteEffects spriteEffects = drawPlayer.direction != -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; //intentionally inverse due to giving more space for the player model without faffing about with the specific positioning
Rectangle frame = tex.Frame(1, 4, 0, modPlayer.voidFrame);
Vector2 origin = new Vector2(tex.Width / 2f, tex.Height / 2f / 4f);
float scale = 1.75f;
DrawData data = new DrawData(tex, drawPos, frame, Color.White * 0.4f, 0f, origin, scale, spriteEffects, 0);
Main.playerDrawData.Add(data);
}
});
public static readonly PlayerLayer RoverDriveShield = new PlayerLayer("CalamityMod", "RoverDrive", PlayerLayer.Skin, drawInfo =>
{
Player drawPlayer = drawInfo.drawPlayer;
@@ -644,6 +671,7 @@ namespace CalamityMod.CalPlayer
list.Insert(drawTheStupidSign, ForbiddenCircletSign);
}
list.Add(ColdDivinityOverlay);
list.Add(ConcentratedVoidAura);
list.Add(RoverDriveShield);
list.Add(StratusSphereDrawing);
list.Add(ProfanedMoonlightDyeEffects);
+33 -43
View File
@@ -19,6 +19,7 @@ using CalamityMod.Items.Potions;
using CalamityMod.Items.Potions.Alcohol;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.NPCs;
using CalamityMod.NPCs.AcidRain;
using CalamityMod.NPCs.Astral;
@@ -47,6 +48,8 @@ using Terraria.Graphics.Shaders;
using Terraria.ID;
using Terraria.ModLoader;
using ProvidenceBoss = CalamityMod.NPCs.Providence.Providence;
namespace CalamityMod.CalPlayer
{
public class CalamityPlayerMiscEffects
@@ -144,48 +147,6 @@ namespace CalamityMod.CalPlayer
#region Revengeance Effects
private static void RevengeanceModeMiscEffects(Player player, CalamityPlayer modPlayer, Mod mod)
{
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
{
if (Main.myPlayer == Main.npc[CalamityGlobalNPC.holyBoss].target)
{
float x = Vector2.Distance(Main.player[Main.npc[CalamityGlobalNPC.holyBoss].target].Center, Main.npc[CalamityGlobalNPC.holyBoss].Center);
float aiState = Main.npc[CalamityGlobalNPC.holyBoss].ai[0];
float aiTimer = Main.npc[CalamityGlobalNPC.holyBoss].ai[3];
float baseDistance = 2800f;
float shorterFlameCocoonDistance = (CalamityWorld.death || CalamityWorld.malice || !Main.dayTime) ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f;
float shorterSpearCocoonDistance = (CalamityWorld.death || CalamityWorld.malice || !Main.dayTime) ? 1000f : CalamityWorld.revenge ? 650f : Main.expertMode ? 300f : 0f;
float shorterDistance = aiState == 2f ? shorterFlameCocoonDistance : shorterSpearCocoonDistance;
bool guardianAlive = false;
if (CalamityGlobalNPC.holyBossAttacker != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBossAttacker].active)
guardianAlive = true;
}
if (CalamityGlobalNPC.holyBossDefender != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBossDefender].active)
guardianAlive = true;
}
if (CalamityGlobalNPC.holyBossHealer != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBossHealer].active)
guardianAlive = true;
}
float maxDistance = guardianAlive ? baseDistance : (aiState == 2f || aiState == 5f) ? baseDistance - MathHelper.Lerp(0f, shorterDistance, MathHelper.Clamp(aiTimer / 120f, 0f, 1f)) : baseDistance;
float drawDarknessDistance = maxDistance - 400f;
float intensityScalar = MathHelper.Lerp(0f, 0.9f, MathHelper.Clamp((x - drawDarknessDistance) / 400f, 0f, 1f));
if (!Main.player[Main.npc[CalamityGlobalNPC.holyBoss].target].Calamity().ZoneAbyss && !Main.player[Main.npc[CalamityGlobalNPC.holyBoss].target].headcovered)
ScreenObstruction.screenObstruction = MathHelper.Lerp(ScreenObstruction.screenObstruction, 1f, intensityScalar);
}
}
}
if (CalamityWorld.revenge || CalamityWorld.malice)
{
// This effect is way too annoying during the fight so I disabled it - Fab
@@ -659,6 +620,35 @@ namespace CalamityMod.CalPlayer
}
}
// Update the Providence Burn effect drawer if applicable.
float providenceBurnIntensity = 0f;
if (Main.npc.IndexInRange(CalamityGlobalNPC.holyBoss) && Main.npc[CalamityGlobalNPC.holyBoss].active)
providenceBurnIntensity = (Main.npc[CalamityGlobalNPC.holyBoss].modNPC as ProvidenceBoss).CalculateBurnIntensity();
modPlayer.ProvidenceBurnEffectDrawer.ParticleSpawnRate = int.MaxValue;
// If the burn intensity is great enough, cause the player to ignite into flames.
if (providenceBurnIntensity > 0.45f)
modPlayer.ProvidenceBurnEffectDrawer.ParticleSpawnRate = 1;
// Otherwise, if the intensity is too weak, but still presernt, cause the player to release holy cinders.
else if (providenceBurnIntensity > 0f)
{
int cinderCount = (int)MathHelper.Lerp(1f, 4f, Utils.InverseLerp(0f, 0.45f, providenceBurnIntensity, true));
for (int i = 0; i < cinderCount; i++)
{
if (!Main.rand.NextBool(3))
continue;
Dust holyCinder = Dust.NewDustDirect(player.position, player.width, player.head, (int)CalamityDusts.ProfanedFire);
holyCinder.velocity = Main.rand.NextVector2Circular(3.5f, 3.5f);
holyCinder.velocity.Y -= Main.rand.NextFloat(1f, 3f);
holyCinder.scale = Main.rand.NextFloat(1.15f, 1.45f);
holyCinder.noGravity = true;
}
}
modPlayer.ProvidenceBurnEffectDrawer.Update();
// Immunity to most debuffs
if (modPlayer.invincible)
{
@@ -3395,7 +3385,7 @@ namespace CalamityMod.CalPlayer
player.AddBuff(ModContent.BuffType<YharonKindleBuff>(), 3600, true);
if (player.ownedProjectileCounts[ModContent.ProjectileType<SonOfYharon>()] < 2)
Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType<SonOfYharon>(), (int)(232f * player.MinionDamage()), 2f, Main.myPlayer, 0f, 0f);
Projectile.NewProjectile(player.Center, Vector2.Zero, ModContent.ProjectileType<SonOfYharon>(), (int)(AngryChickenStaff.Damage * player.MinionDamage()), 2f, Main.myPlayer, 0f, 0f);
}
}
+10 -2
View File
@@ -409,6 +409,7 @@ namespace CalamityMod
ProjectileID.LaserMachinegun,
ProjectileID.ChargedBlasterCannon,
ProjectileID.MedusaHead,
ProjectileType<PhangasmBow>(),
ProjectileType<ContagionBow>(),
ProjectileType<DaemonsFlameBow>(),
@@ -418,6 +419,7 @@ namespace CalamityMod
ProjectileType<StarfleetMK2Gun>(),
ProjectileType<NorfleetCannon>(),
ProjectileType<FlurrystormCannonShooting>(),
ProjectileType<PurgeProj>(),
ProjectileType<T1000Proj>(),
ProjectileType<YharimsCrystalPrism>(),
@@ -428,14 +430,20 @@ namespace CalamityMod
ProjectileType<ApotheosisWorm>(),
ProjectileType<FlakKrakenProj>(),
ProjectileType<SylvanSlashAttack>(),
ProjectileType<InfernadoFriendly>(),
ProjectileType<DragonRageStaff>(),
ProjectileType<MurasamaSlash>(),
ProjectileType<PhaseslayerProjectile>(),
ProjectileType<TaintedBladeSlasher>(),
ProjectileType<PhotonRipperProjectile>(),
ProjectileType<SpineOfThanatosProjectile>(),
ProjectileType<SylvanSlashAttack>(),
ProjectileType<FinalDawnProjectile>(),
ProjectileType<FinalDawnThrow>(),
ProjectileType<FinalDawnHorizontalSlash>(),
ProjectileType<FinalDawnFireSlash>(),
//Some hostile boss projectiles
ProjectileType<BrimstoneMonster>(),
ProjectileType<InfernadoRevenge>(),
@@ -2541,7 +2549,7 @@ namespace CalamityMod
NPCType<ThanatosBody1>(),
NPCType<ThanatosBody2>(),
NPCType<ThanatosTail>(),
NPCType<SCalWormHeart>()
NPCType<BrimstoneHeart>()
};
bossMinionList = new List<int>()
-43
View File
@@ -1409,49 +1409,6 @@ namespace CalamityMod
{
// Apply the calculated darkness value for the local player.
CalamityPlayer modPlayer = Main.LocalPlayer.Calamity();
if (CalamityGlobalNPC.holyBoss != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBoss].active)
{
if (Main.myPlayer == Main.npc[CalamityGlobalNPC.holyBoss].target)
{
float x = Vector2.Distance(Main.player[Main.npc[CalamityGlobalNPC.holyBoss].target].Center, Main.npc[CalamityGlobalNPC.holyBoss].Center);
float aiState = Main.npc[CalamityGlobalNPC.holyBoss].ai[0];
float aiTimer = Main.npc[CalamityGlobalNPC.holyBoss].ai[3];
float baseDistance = 2800f;
float shorterFlameCocoonDistance = (CalamityWorld.death || CalamityWorld.malice || !Main.dayTime) ? 600f : CalamityWorld.revenge ? 400f : Main.expertMode ? 200f : 0f;
float shorterSpearCocoonDistance = (CalamityWorld.death || CalamityWorld.malice || !Main.dayTime) ? 1000f : CalamityWorld.revenge ? 650f : Main.expertMode ? 300f : 0f;
float shorterDistance = aiState == 2f ? shorterFlameCocoonDistance : shorterSpearCocoonDistance;
bool guardianAlive = false;
if (CalamityGlobalNPC.holyBossAttacker != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBossAttacker].active)
guardianAlive = true;
}
if (CalamityGlobalNPC.holyBossDefender != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBossDefender].active)
guardianAlive = true;
}
if (CalamityGlobalNPC.holyBossHealer != -1)
{
if (Main.npc[CalamityGlobalNPC.holyBossHealer].active)
guardianAlive = true;
}
float maxDistance = guardianAlive ? baseDistance : (aiState == 2f || aiState == 5f) ? baseDistance - MathHelper.Lerp(0f, shorterDistance, MathHelper.Clamp(aiTimer / 120f, 0f, 1f)) : baseDistance;
float drawDarknessDistance = maxDistance - 400f;
float intensityScalar = MathHelper.Lerp(0f, 0.9f, MathHelper.Clamp((x - drawDarknessDistance) / 400f, 0f, 1f));
scale -= intensityScalar;
// Return to prevent running other darkness code
return;
}
}
}
float darkRatio = MathHelper.Clamp(modPlayer.caveDarkness, 0f, 1f);
if (modPlayer.ZoneAbyss)
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float4 color = tex2D(uImage0, coords);
float interval = cos(uTime * 7 + coords.x * 4) / 2 + 0.5;
float4 returnColor = float4(lerp(uColor, uSecondaryColor, interval), 1); // Fade between two colors depending on the time and x position on the texture in a 0-1 cosine linear interpolation. The color can vary.
return returnColor * color; // And multiply by the original color to give it a blend effect.
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+31
View File
@@ -0,0 +1,31 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float4 color = tex2D(uImage0, coords);
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float interval = (cos((uTime - 0.5) * 17 + frameY * 8) / 2 + 0.5);
float4 returnColor = float4(lerp(uColor, uSecondaryColor, interval), 1); // One again, use a cosine lerp based on position and time, but this time, with the Y position.
return returnColor * color;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+55
View File
@@ -0,0 +1,55 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float2 RotatedBy(float2 xy, float theta)
{
return float2(xy.x * cos(theta) + xy.y * sin(theta), xy.x * sin(theta) - xy.y * cos(theta));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float4 color = tex2D(uImage0, coords);
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float interval = (cos(uTime * 2.2 + frameY * coords.x * 1.55) * 0.5 + 0.5) * 0.6 + 0.2; // A complex function that works based on the X and Y coords with a 0.2-0.8 range.
float brightness = 1.35;
float3 returnColor = uColor;
// Rotate the colors around and adjust the brightness.
for (int i = 0; i < 4; i++)
{
float2 positionAt = float2(interval, 1 - interval);
positionAt = (RotatedBy(float2(cos(uTime * 1.7 + i / 4 * 6.283), cos(uTime * 1.9 + i / 4 * 6.283)), uTime + i / 4 * 6.283) * 0.5 + 0.5) - positionAt;
float dist = distance(coords, positionAt);
if (dist < 0.35)
{
float inverseDistanceRatio = 1 - dist / 0.35;
returnColor = lerp(uColor, uSecondaryColor, inverseDistanceRatio);
brightness = lerp(1.35, 1.7, inverseDistanceRatio);
}
}
if (frameY > 0.5)
{
returnColor = lerp(returnColor, uSecondaryColor, (frameY - 0.5) * 3);
}
return float4(returnColor, 1) * color * brightness;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+44
View File
@@ -0,0 +1,44 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float4 pixelBelow = tex2D(uImage0, coords);
float4 noiseColor = tex2D(uImage1, float2(coords.x, frac(frameY - uTime * 0.67)) * 0.5) * 1.5;
float verticalFlowMovement = (sin(coords.x * 14.71 + frameY * 13.5 - uTime * 5.6) * 0.5 + 0.5) * noiseColor.r;
if (pixelBelow.a == 0 && frameY < 0.96)
coords.y = saturate(coords.y + verticalFlowMovement / uSourceRect.w / 17);
float4 color = tex2D(uImage0, coords);
// Prepare the dark outlines.
float outlineFade = pow(1 - (color.r + color.g + color.b) / 3, 2);
color = lerp(color, float4(uColor, 1), outlineFade) * color.a;
// Prepare the bright in-lines.
color = lerp(color, float4(uSecondaryColor, 1), saturate(1 - outlineFade) * 0.8) * color.a;
// Handle red fades based on noise.
color = lerp(color, float4(1, 0, 0, 1), pow(noiseColor.r, 3) * 0.3 + verticalFlowMovement * 0.3 + 0.16) * color.a;
return color * (1 + (1 - outlineFade) * 0.25);
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+43
View File
@@ -0,0 +1,43 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float4 noiseColor = tex2D(uImage1, float2(coords.x, frameY));
float4 color = tex2D(uImage0, coords);
float3 blendColor = lerp(uColor, uSecondaryColor, sqrt(frameY));
float blendFactor = (cos(uTime * 9 + coords.x * 18) * 0.5 + 0.5) * 0.5;
// Allow the fade to pulse upward based on how far up the pixel is.
blendFactor += (cos(uTime * -13 - frameY * 7.1)) * 0.5;
float brightness = blendFactor * 0.35 + noiseColor.r * 0.35;
// Cause the effects to taper off at the bottom of the sprite.
if (frameY < 0.2)
{
brightness *= frameY / 0.2;
blendFactor *= frameY / 0.2;
}
float4 colorBlendMultiplier = lerp(float4(blendColor, 1), float4(1, 1, 1, 1), saturate(pow(blendFactor * 1.5, 2)));
return (lerp(color, float4(blendColor, 1), blendFactor * 0.5 + 0.2) * color.a) * colorBlendMultiplier * (1 + brightness);
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+37
View File
@@ -0,0 +1,37 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float randomness(float2 uv)
{
float noise = (frac(sin(dot(uv, float2(12.9898, 78.233) * 2.0)) * 43758.5453));
return noise;
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
coords.x += randomness(uTime + frameY).x * 0.09 * (1 - frameY); // Add an X offset based on a noise function, giving a moon lord void-esque shader effect.
float4 color = tex2D(uImage0, coords);
float4 returnColor = color * 0.1;
returnColor.a = color.a;
return returnColor;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+49
View File
@@ -0,0 +1,49 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float2 swirlOffset = float2(sin(uTime * 0.96 + 1.754) * 0.31, sin(uTime * 0.96) * 0.16) * uSaturation;
float4 color = tex2D(uImage0, coords);
float4 noiseColor = tex2D(uImage1, frac(float2(coords.x, frameY + uTime * 0.36) + swirlOffset - uWorldPosition * 0.0006) * 0.26);
float4 flameColor = tex2D(uImage1, frac(float2(coords.x, frameY + uTime * 0.44)) * 0.1);
float brightnessFactor = noiseColor.r * 2;
float normalizedDistanceFromCenter = distance(float2(coords.x, frameY), float2(0.5, 0.5)) * 2;
// Cause "ring" fades based on distance.
float fadeToNormal = 1 - saturate((normalizedDistanceFromCenter - 0.67) / 0.3);
// Cause noise-based stars to appear all across the sprite.
float3 starColor = lerp(uColor * 1.1, uSecondaryColor, sin(brightnessFactor * 6.283) * 0.5 + 0.5);
// Prepare a dull, bluish-greyish background across the sprite for contrast.
color = lerp(color, float4(43 / 255.0, 58 / 255.0, 92 / 255.0, 1) * color.a, fadeToNormal * 0.45);
// Fade to the secondary color based on the flame color map. This helps the overall result more vibrant.
color = lerp(color, float4(uSecondaryColor, 1) * color.a, flameColor.r * 0.5);
// And create stars based on a noise texture that rise upward.
color = lerp(color, float4(starColor, 1) * color.a, fadeToNormal * pow(brightnessFactor, 6) * 0.15);
return color * (1 + brightnessFactor);
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+42
View File
@@ -0,0 +1,42 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float4 noiseColor = tex2D(uImage1, float2(frac(coords.x + uTime * 0.1), frameY));
float4 color = tex2D(uImage0, coords);
// Cause sharp brightness increases based on a perlin noise map.
// This causes icy, crystaline structures to appear.
float brightness = pow((noiseColor.r + noiseColor.g + noiseColor.b) / 3, 3) * 3;
float normalizedDistanceFromCenter = distance(float2(coords.x, frameY), float2(0.5, 0.5)) * 2;
// Cause "ring" fades based on distance.
float fadeToSecondaryColor = pow(sin(uTime * -1.56 + normalizedDistanceFromCenter * 3.141), 6);
// This fades out at the ends of the sprite.
if (normalizedDistanceFromCenter > 0.7)
fadeToSecondaryColor *= saturate(1 - (normalizedDistanceFromCenter - 0.7) / 0.2);
float4 endFadeColor = lerp(float4(uColor, 1), float4(uSecondaryColor, 1), 0.5);
return (lerp(color, endFadeColor, 0.3 + fadeToSecondaryColor * 0.6) * color.a) * (1 + brightness);
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+44
View File
@@ -0,0 +1,44 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
static float Variance = 0.4f;
static float MinBrightness = 1.5f;
static float MaxBrightness = 2.5f;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float4 color = tex2D(uImage0, coords);
float4 noiseColor = tex2D(uImage1, coords);
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float interval = cos(uTime * 7 + frameY * 6) * 0.5 + 0.5;
float brightness = pow((interval + sin(uTime + coords.x * uTime * frameY * cos(uTime)) * 0.5 + 0.5) * 0.5, 2); // Force the brightness to rise to 1 more quickly
brightness = brightness * (MaxBrightness - MinBrightness) + MinBrightness; // And bring it to a specified range
float4 colorMap = float4(lerp(uColor, uSecondaryColor, interval) + noiseColor.rgb * 0.4, 1);
colorMap.rgb *= brightness;
colorMap.rgb = colorMap.rgb - colorMap.rgb % Variance; // Slice the return color map to make pixels appear less varied and more extreme
return colorMap * color;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+41
View File
@@ -0,0 +1,41 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
static float3 colors[4] =
{
float3(195, 50, 37) / 255.0,
float3(252, 155, 0) / 255.0,
float3(255, 235, 195) / 255.0,
float3(252, 155, 0) / 255.0
};
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float4 color = tex2D(uImage0, coords);
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float interval = (cos(coords.x * 6.283 + uTime * 3.141) * 2 + sin(uTime * 7 + frameY * 6)) * 0.125 + 0.5;
interval *= 2; // Exaggerate the interval.
float4 returnColor = float4(lerp(colors[floor(interval) % 4], colors[floor(interval + 1) % 4], interval % 1), 1); // But clamp it to a 0-1 range.
return returnColor * color * 1.95;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+44
View File
@@ -0,0 +1,44 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float4 color = tex2D(uImage0, coords);
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w;
float time = (sin(uTime + coords.x * cos(uTime + 3.141 * coords.x) + 1.5707 * frameY) * 0.5 + 0.5) * 6;
float timeFloored = floor(time);
float3 colors[6] =
{
float3(241, 149, 49), // Solar
float3(88, 201, 169), // Vortex
float3(102, 200, 249), // Stardust
float3(226, 76, 239) * 0.7, // Nebula
float3(102, 200, 249), // Stardust
float3(88, 201, 169) // Vortex
};
// Use a multi-lerp to fade between colors and then base them on a trig-based time step.
color.rgb *= lerp(colors[timeFloored] / 255.0, colors[(timeFloored + 1) % 6] / 255.0, time / 6) * 1.6;
return color;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+33
View File
@@ -0,0 +1,33 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
// Saturate basically clamps to a 0-1 range. Basically, the further away from the center the closer the color becomes to the secondary color.
float3 idealColor = lerp(uColor, uSecondaryColor, saturate(distance(float2(coords.x, frameY), (0.5, 0.5))));
float4 color = tex2D(uImage0, coords);
float luminosity = (color.r + color.g + color.b) / 3;
color.rgb = luminosity * idealColor * 1.3; // Average out the colors.
return color;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+36
View File
@@ -0,0 +1,36 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float3 idealColor = uColor;
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float depth = sin(uTime * 3 + coords.x * 2) * 0.05;
if (frameY < 0.425 + depth)
{
idealColor = lerp(uColor, uSecondaryColor, 1 - frameY / (0.425 + depth));
}
float4 color = tex2D(uImage0, coords);
float luminosity = (color.r + color.g + color.b) / 3;
color.rgb = luminosity * idealColor * 1.6; // Average out the colors.
return color;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+42
View File
@@ -0,0 +1,42 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float4 noiseColor = tex2D(uImage1, float2(coords.x, frac(frameY + uTime * 0.7)));
float4 color = tex2D(uImage0, coords);
float normalizedDistanceFromCenter = distance(float2(coords.x, frameY), float2(0.5, 0.5)) * 2;
// Cause "ring" pulses based on distance.
float fadeToSecondaryColor = pow(sin(uTime * -2.56 + normalizedDistanceFromCenter * 2), 4);
// This fades out at the ends of the sprite.
if (normalizedDistanceFromCenter > 0.7)
fadeToSecondaryColor *= saturate(1 - (normalizedDistanceFromCenter - 0.7) / 0.37 + sin(coords.x * coords.y * 12) * 0.1);
float4 endFadeColor = float4(lerp(uColor, uSecondaryColor, fadeToSecondaryColor * 0.74 + noiseColor.g * 0.13), 1);
float4 blendedColor = (color + endFadeColor) * 0.5 - 0.05;
blendedColor *= 1.4;
blendedColor.a = 1;
return blendedColor * color.a * (1 + lerp(0.07, 0.3, fadeToSecondaryColor) + noiseColor.g * 0.1);
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+44
View File
@@ -0,0 +1,44 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float4 color = tex2D(uImage0, coords);
// Read the fade map as a streak.
float4 fadeMapColor = tex2D(uImage1, float2(frac(coords.x * 0.18 + cos(uTime * 0.9) * 0.021), frac(frameY * 0.32 + uTime * 0.2)));
fadeMapColor.r *= pow(coords.x, 0.2);
float opacity = lerp(1.05, 1.95, fadeMapColor.r);
opacity *= fadeMapColor.r + 1;
opacity *= lerp(0.4, 1.1, fadeMapColor.r);
float3 transformColor = lerp(uColor, uSecondaryColor, fadeMapColor.r);
float orangeFade = 1 - saturate((frameY - 0.08) / 0.74);
opacity += (1 - orangeFade) * 0.6;
transformColor = lerp(transformColor, float3(206 / 255, 116 / 255, 59 / 255), orangeFade);
color.rgb = lerp(color.rgb, transformColor, fadeMapColor.r);
opacity *= color.a;
return color * opacity;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
Binary file not shown.
+28
View File
@@ -0,0 +1,28 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float4 returnColor = tex2D(uImage0, coords);
returnColor.rgb *= uColor * ((cos(uTime) * 0.5 + 0.5) * 0.3 + 1.3);
return returnColor;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+34
View File
@@ -0,0 +1,34 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float4 color = tex2D(uImage0, coords);
float luminosity = (color.r + color.g + color.b) / 3;
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float yMultiplier = sqrt(frameY) * (sin(frameY * 2 + uTime * 1.4) + 1) * 0.5;
color.rgb *= ((coords.x * uColor * (1 - yMultiplier) * 1.4) + ((1 - coords.x) * uSecondaryColor * yMultiplier * 1.7)) * luminosity * 2.1;
color.rgb *= clamp(1.6 * saturate(distance((0.5, 0.5), coords)), 0.8, 1.6); // Intensify the colors based on how far they are from the center of the sprite.
return color;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+47
View File
@@ -0,0 +1,47 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
float2 RotatedBy(float theta, float x, float y)
{
return float2(x * cos(theta) + y * sin(theta), x * sin(theta) - y * cos(theta));
}
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float sineTime = sin(uTime); // Saved so that I don't have the compute this multiple times. Shaders have a limited number of mathematical instructions you can use - 64.
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float2 modifiedCoords = coords;
float4 color = tex2D(uImage0, coords);
modifiedCoords = RotatedBy(uTime + 0.4 * sineTime, modifiedCoords.y, modifiedCoords.x);
float4 noiseColor = tex2D(uImage1, modifiedCoords);
float xMultiplier = cos(coords.x * 2.3 + uTime) + 1;
float yMultiplier = sin(frameY * 2 + uTime * 1.4) + 1;
float interpolationValue = saturate(xMultiplier * yMultiplier) * 0.7 + 0.3; // Range of 0-1. Depends on the current coordinates and the time.
color.rgb *= 0.2 + pow(noiseColor.rgb, 3); // Squash the color to the upper and lower bounds and add a bit of lightness to it.
color.rgb *= lerp(uColor, uSecondaryColor, interpolationValue); // Blend with the secondary color.
color.rgb *= 1.7 + (sineTime * 0.5 + 1.5) * interpolationValue; // Range of 1.7 to 3.7, can cause certain spots to become very bright.
return color;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
+45
View File
@@ -0,0 +1,45 @@
sampler uImage0 : register(s0);
sampler uImage1 : register(s1);
float3 uColor;
float3 uSecondaryColor;
float uOpacity;
float uSaturation;
float uRotation;
float uTime;
float4 uSourceRect;
float2 uWorldPosition;
float uDirection;
float3 uLightSource;
float2 uImageSize0;
float2 uImageSize1;
static float xAdditiveMax = 0.035;
float4 PixelShaderFunction(float4 sampleColor : TEXCOORD, float2 coords : TEXCOORD0) : COLOR0
{
float4 color = tex2D(uImage0, coords);
float sineTime = sin(uTime); // Saved so that I don't have the compute this multiple times. Shaders have a limited number of mathematical instructions you can use - 64.
float frameY = (coords.y * uImageSize0.y - uSourceRect.y) / uSourceRect.w; // Gets a 0-1 representation of the y position on a given frame, with 0 being the top, and 1 being the bottom.
float2 modifiedCoords = coords;
modifiedCoords.x += cos(uTime + frameY) * 0.5 + 0.5; // Cause the effect to sway around a bit with time.
float4 noiseColor = tex2D(uImage1, frac(modifiedCoords));
float xMultiplier = cos(coords.x * 2.3 + uTime * 1.15) + 0.5;
float yMultiplier = (sin(frameY * 2 + uTime * 1.4) + 1) * 0.5;
color.rgb *= lerp(uColor, uSecondaryColor, saturate(xMultiplier * yMultiplier * 1.6));
if (noiseColor.r > 0.55 + sineTime * 0.025)
{
color.rgb *= 1.6; // Sometimes give light "patches" depending on the swaying noise image.
}
color.rgb *= 1.6 + (sineTime * 0.5 + 1.5) * ((frameY + coords.x) - 1) * 2; // Brighten the shader over time.
return color;
}
technique Technique1
{
pass DyePass
{
PixelShader = compile ps_2_0 PixelShaderFunction();
}
}
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.
Binary file not shown.
+145 -1
View File
@@ -1,5 +1,6 @@
using CalamityMod.NPCs.AcidRain;
using CalamityMod.NPCs.OldDuke;
using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using System;
@@ -176,6 +177,100 @@ namespace CalamityMod.Events
BroadcastEventText("Mods.CalamityMod.AcidRainStart"); // A toxic downpour falls over the wasteland seas!
}
/// <summary>
/// Handles updating the entire invasion, including more misc operations, such as summoning OD's tornado.
/// </summary>
public static void Update()
{
CalamityWorld.timeSinceAcidRainKill++;
CalamityWorld.timeSinceAcidStarted++;
// If enough time has passed, and no enemy has been killed, end the invasion early.
// The player almost certainly does not want to deal with it.
if (CalamityWorld.timeSinceAcidRainKill >= AcidRainEvent.InvasionNoKillPersistTime)
{
CalamityWorld.acidRainPoints = 0;
CalamityWorld.triedToSummonOldDuke = false;
AcidRainEvent.UpdateInvasion(false);
}
if (!CalamityWorld.startAcidicDownpour)
{
int sulphSeaWidth = SulphurousSea.BiomeWidth;
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
{
// A variable named "player" already exists above, which retrieves the player who is closest to the map center.
Player player2 = Main.player[playerIndex];
if (player2.active)
{
// An artificial biome can be made, and therefore, the event could be started by an artificial biome.
// While fighting the event in an artificial biome is not bad, having it be started by a patch of Sulphurous Sand
// would definitely be strange.
// Because of this, this code is executed based on if the player is in the sea (based on tile count) AND position relative to the naturally generated sea.
bool inNaturalSeaPosition = (player2.Center.X <= (sulphSeaWidth + 60f) * 16f && CalamityWorld.abyssSide) || (player2.Center.X >= (Main.maxTilesX - (sulphSeaWidth + 60f)) * 16f && !CalamityWorld.abyssSide);
if (inNaturalSeaPosition && player2.Calamity().ZoneSulphur)
{
// Makes rain pour at its maximum intensity (but only after an idiot meanders into the Sulphurous Sea)
// You'll never catch me, Fabs, Not when I shift into MAXIMUM OVERDRIVE!!
CalamityWorld.startAcidicDownpour = true;
CalamityNetcode.SyncWorld();
break;
}
}
}
}
// Stop the rain if the Old Duke is present for visibility during the fight.
if (Main.raining && NPC.AnyNPCs(ModContent.NPCType<OldDuke>()))
{
Main.raining = false;
CalamityNetcode.SyncWorld();
}
// If the rain stops for whatever reason, end the invasion.
// This is primarily done for compatibility, so that if another mod wants to manipulate the weather,
// they can without having to deal with endless rain.
if (!Main.raining && !NPC.AnyNPCs(ModContent.NPCType<OldDuke>()) && CalamityWorld.timeSinceAcidStarted > 20)
{
CalamityWorld.acidRainPoints = 0;
CalamityWorld.triedToSummonOldDuke = false;
UpdateInvasion(false);
}
else if (CalamityWorld.timeSinceAcidStarted < 20)
{
Main.raining = true;
Main.cloudBGActive = 1f;
Main.numCloudsTemp = Main.cloudLimit;
Main.numClouds = Main.numCloudsTemp;
Main.windSpeedTemp = 0.72f;
Main.windSpeedSet = Main.windSpeedTemp;
Main.weatherCounter = 60 * 60 * 10; // 10 minutes of rain. Remember, once the rain goes away, so does the invasion.
Main.rainTime = Main.weatherCounter;
Main.maxRaining = 0.89f;
}
// Summon Old Duke tornado post-Polter as needed
if (CalamityWorld.downedPolterghast && CalamityWorld.acidRainPoints == 1)
{
if (!NPC.AnyNPCs(ModContent.NPCType<OldDuke>()) &&
CalamityUtils.CountProjectiles(ModContent.ProjectileType<OverlyDramaticDukeSummoner>()) <= 0)
{
if (CalamityWorld.triedToSummonOldDuke)
{
CalamityWorld.acidRainPoints = 0;
CalamityWorld.triedToSummonOldDuke = false;
UpdateInvasion(false);
}
else
{
int playerClosestToAbyss = Player.FindClosest(new Vector2(CalamityWorld.abyssSide ? 0 : Main.maxTilesX * 16, (int)Main.worldSurface), 0, 0);
Player closestToAbyss = Main.player[playerClosestToAbyss];
if (Main.netMode != NetmodeID.MultiplayerClient && Math.Abs(closestToAbyss.Center.X - (CalamityWorld.abyssSide ? 0 : Main.maxTilesX * 16)) <= 12000f)
Projectile.NewProjectile(closestToAbyss.Center + Vector2.UnitY * 160f, Vector2.Zero, ModContent.ProjectileType<OverlyDramaticDukeSummoner>(), 120, 8f, Main.myPlayer);
}
}
}
}
/// <summary>
/// Updates the invasion, checking to see if it has ended.
/// </summary>
@@ -236,7 +331,56 @@ namespace CalamityMod.Events
}
}
internal static void OnEnemyKill(NPC npc)
public static void TryToStartEventNaturally()
{
// Attempt to start the acid rain at the 4:29AM.
// This does not happen if a player has the Broken Water Filter in use.
bool increasedEventChance = !CalamityWorld.downedEoCAcidRain || (!CalamityWorld.downedAquaticScourgeAcidRain && CalamityWorld.downedAquaticScourge) || (!CalamityWorld.downedBoomerDuke && CalamityWorld.downedPolterghast);
if (Main.time == 32399 && !Main.dayTime && Main.rand.NextBool(increasedEventChance ? 3 : 300))
{
bool shouldNotStartEvent = false;
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
{
if (!Main.player[playerIndex].active)
continue;
if (Main.player[playerIndex].Calamity().noStupidNaturalARSpawns)
{
shouldNotStartEvent = true;
break;
}
}
if (!shouldNotStartEvent)
{
TryStartEvent();
CalamityNetcode.SyncWorld();
}
}
// Attempt to force an Acid Rain immediately after the EoC is dead when someone wanders to the sea.
if (NPC.downedBoss1 && !CalamityWorld.downedEoCAcidRain && !CalamityWorld.forcedRainAlready)
{
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
{
if (Main.player[playerIndex].active && Main.player[playerIndex].Calamity().ZoneSulphur)
{
CalamityWorld.forcedRainAlready = true;
TryStartEvent();
CalamityNetcode.SyncWorld();
}
}
}
if (CalamityWorld.forceRainTimer == 1)
{
TryStartEvent();
CalamityNetcode.SyncWorld();
}
if (CalamityWorld.forceRainTimer > 0)
CalamityWorld.forceRainTimer--;
}
public static void OnEnemyKill(NPC npc)
{
Dictionary<int, AcidRainSpawnData> possibleEnemies = PossibleEnemiesPreHM;
+18 -4
View File
@@ -295,10 +295,25 @@ namespace CalamityMod.Events
{
if (!BossRushActive)
return;
// Prevent Moon Lord from spawning naturally
if (NPC.MoonLordCountdown > 0)
{
NPC.MoonLordCountdown = 0;
// Handle projectile clearing.
if (CalamityWorld.bossRushHostileProjKillCounter > 0)
{
CalamityWorld.bossRushHostileProjKillCounter--;
if (CalamityWorld.bossRushHostileProjKillCounter == 1)
CalamityUtils.KillAllHostileProjectiles();
if (Main.netMode == NetmodeID.Server)
{
var netMessage = CalamityMod.Instance.GetPacket();
netMessage.Write((byte)CalamityModMessageType.BRHostileProjKillSync);
netMessage.Write(CalamityWorld.bossRushHostileProjKillCounter);
netMessage.Send();
}
}
}
@@ -345,19 +360,18 @@ namespace CalamityMod.Events
// Change time as necessary.
if (Bosses[BossRushStage].ToChangeTimeTo != TimeChangeContext.None)
CalamityWorld.ChangeTime(Bosses[BossRushStage].ToChangeTimeTo == TimeChangeContext.Day);
CalamityUtils.ChangeTime(Bosses[BossRushStage].ToChangeTimeTo == TimeChangeContext.Day);
// Play the typical boss roar sound.
if (!Bosses[BossRushStage].UsesSpecialSound)
{
Main.PlaySound(SoundID.Roar, Main.player[ClosestPlayerToWorldCenter].position, 0);
}
// And spawn the boss.
Bosses[BossRushStage].SpawnContext.Invoke(CurrentlyFoughtBoss);
}
}
}
#endregion
#region On Boss Kill
Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Loaded 100 of 269 files, more files were not shown because too many files have changed in this diff. Show more