fully functional
This commit is contained in:
1 parent
b1e02b14f3
commit
ce44643a41
8 files changed
+94
-14
No files matched your search
@@ -3263,7 +3263,7 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime/4f))/60f;
|
||||
}
|
||||
if (gSabatonHotkeyHoldTime == 45)
|
||||
if (gSabatonHotkeyHoldTime == 45 && !gSabatonFalling)
|
||||
{
|
||||
SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GravistarCharge") { Volume = 0.3f });
|
||||
}
|
||||
@@ -6990,8 +6990,13 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
public void SpawnGravistarParticle()
|
||||
{
|
||||
Vector2 position1 = Player.position + new Vector2(Player.width / 14, Player.height);
|
||||
Vector2 position2 = Player.position + new Vector2(Player.width * 13 / 14, Player.height);
|
||||
float height = Player.height;
|
||||
if (Player.gravDir == -1)
|
||||
{
|
||||
height = 0;
|
||||
}
|
||||
Vector2 position1 = Player.position + new Vector2(Player.width / 14, height);
|
||||
Vector2 position2 = Player.position + new Vector2(Player.width * 13 / 14, height);
|
||||
SquareParticle square1 = new SquareParticle(position1, Player.velocity * (0.15f + Main.rand.NextFloat(0.1f)), false, 15, 1.7f + Main.rand.NextFloat(0.6f), Color.Cyan * 1.5f);
|
||||
SquareParticle square2 = new SquareParticle(position2, Player.velocity * (0.15f + Main.rand.NextFloat(0.1f)), false, 15, 1.7f + Main.rand.NextFloat(0.6f), Color.Cyan * 1.5f);
|
||||
GeneralParticleHandler.SpawnParticle(square1);
|
||||
|
||||
@@ -981,9 +981,13 @@ namespace CalamityMod.CalPlayer
|
||||
bool notOnRope = !Player.pulley && Player.ropeCount == 0;
|
||||
bool notGrappling = Player.grappling[0] == -1;
|
||||
bool airborne = Player.velocity.Y != 0;
|
||||
if (holdingDown && Player.ControlsEnabled() && notInLiquid && notOnRope && notGrappling && airborne)
|
||||
if (holdingDown && Player.ControlsEnabled() && notInLiquid && notOnRope && notGrappling && airborne && !Player.Calamity().gSabatonFalling)
|
||||
{
|
||||
Player.velocity.Y += Player.gravity * Player.gravDir * (BalancingConstants.HoldingDownGravityMultiplier - 1f);
|
||||
if (Player.Calamity().gSabaton)
|
||||
{
|
||||
Player.maxFallSpeed *= 1.5f;
|
||||
}
|
||||
if (Player.velocity.Y * Player.gravDir > Player.maxFallSpeed)
|
||||
Player.velocity.Y = Player.maxFallSpeed * Player.gravDir;
|
||||
}
|
||||
|
||||
@@ -173,6 +173,9 @@ namespace CalamityMod.Effects
|
||||
internal static Effect MiracleBlight;
|
||||
#endregion
|
||||
|
||||
#region Aqua's Shaders
|
||||
internal static Effect CircularGradientWithEdge;
|
||||
#endregion
|
||||
// Shorthand to register a loaded shader in Terraria's graphics engine
|
||||
// All shaders registered this way are accessible under GameShaders.Misc
|
||||
// They will use the prefix described above
|
||||
@@ -365,6 +368,11 @@ namespace CalamityMod.Effects
|
||||
MiracleBlight = LoadShader("MiracleBlight");
|
||||
RegisterMiscShader(MiracleBlight, "BlightPass", "MiracleBlight");
|
||||
#endregion
|
||||
|
||||
#region Loading Aqua's Shaders
|
||||
CircularGradientWithEdge = LoadShader("CircularGradientWithEdge");
|
||||
RegisterMiscShader(CircularGradientWithEdge, "CircularGradientWithEdgePass", "CircularGradientWithEdge");
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
sampler uImage0 : register(s0);
|
||||
sampler uImage1 : register(s1);
|
||||
float3 uColor; //Color of the telegraph zone
|
||||
float3 uSecondaryColor; //Color of the outline
|
||||
float uOpacity;
|
||||
float uSaturation; //Saturation is being used as scale here.
|
||||
float uRotation;
|
||||
float uTime;
|
||||
float4 uSourceRect;
|
||||
float2 uWorldPosition;
|
||||
float uDirection;
|
||||
float3 uLightSource;
|
||||
float2 uImageSize0;
|
||||
float2 uImageSize1;
|
||||
float4 uShaderSpecificData;
|
||||
|
||||
float4 Recolor(float4 sampleColor : COLOR0, float2 coords : TEXCOORD0) : COLOR0
|
||||
{
|
||||
float3 color = uColor;
|
||||
//this is the center of the sprite, coords work from 0 - 1
|
||||
float2 center = float2(0.5, 0.5);
|
||||
//get the length of the doubled distance, so that 0 = at the center of the sprite and 1 = at the very edge of the circle
|
||||
float distanceFromCenter = length(coords - center) * 2;
|
||||
|
||||
//Crop the sprite into a circle
|
||||
if (distanceFromCenter > 1)
|
||||
return float4(0, 0, 0, 0);
|
||||
|
||||
//Make the brightness increase towards the edge
|
||||
float opacity = 0.1 + (0.2 + 0.35) * distanceFromCenter;
|
||||
|
||||
//Brighten the very edge
|
||||
if (distanceFromCenter > (1 - 0.005 - (0.005 * (120/22 + 0.5)/uSaturation)))
|
||||
{
|
||||
color = uSecondaryColor;
|
||||
|
||||
opacity = lerp(uOpacity, 1, min(1.25, min(uOpacity + 0.1, 1)));
|
||||
}
|
||||
|
||||
else
|
||||
opacity = opacity * uOpacity;
|
||||
|
||||
color = color * opacity;
|
||||
|
||||
return float4(color, opacity);
|
||||
}
|
||||
|
||||
|
||||
technique Technique1
|
||||
{
|
||||
pass CircularGradientWithEdgePass
|
||||
{
|
||||
PixelShader = compile ps_2_0 Recolor();
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1,6 +1,7 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CalamityMod.Items.Accessories
|
||||
{
|
||||
@@ -16,6 +17,8 @@ namespace CalamityMod.Items.Accessories
|
||||
Item.rare = ItemRarityID.Lime;
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> list) => list.IntegrateHotkey(CalamityKeybinds.GravistarSabatonHotkey);
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.noFallDmg = true;
|
||||
|
||||
@@ -861,9 +861,14 @@ GravistarSabaton: {
|
||||
DisplayName: Gravistar Sabaton
|
||||
Tooltip:
|
||||
'''
|
||||
Tap the DOWN key to increase your fall speed for 5 seconds
|
||||
This has an 8 second cooldown
|
||||
Striking the ground with increased fall speed will cause an astral explosion
|
||||
20% increased jump speed
|
||||
Grants immunity to fall damage
|
||||
Hold DOWN to increase your maximum fall speed
|
||||
Hold [KEY] for 1 second while midair to charge up a superspeed slam
|
||||
While slamming, you ram through enemies and don't take contact damage
|
||||
Once you reach the ground, you create an explosion at your feet
|
||||
The explosion scales in both damage and size the longer you slam for
|
||||
Temporary 40% increased jump speed after slamming into the ground
|
||||
'''
|
||||
}
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
damageScaleFromFall = Projectile.ai[0] / 40;
|
||||
Projectile.damage = (int)(300f * damageScaleFromFall + 300f);
|
||||
SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GravistarSlam") { Volume = 0.75f }, Projectile.Center);
|
||||
int particleCount = (int)(20 * scaleFromFall);
|
||||
int particleCount = (int)(10 * scaleFromFall);
|
||||
for (int i = 0; i < particleCount; i++)
|
||||
{
|
||||
SquareParticle square = new SquareParticle(Projectile.Center + Main.rand.NextVector2Circular(scaleFromFall * 78f, scaleFromFall * 78f), Main.rand.NextVector2Circular(5f, 5f), false, 60, 1.7f + Main.rand.NextFloat(0.6f), Color.Cyan * 1.5f);
|
||||
SquareParticle square = new SquareParticle(Projectile.Center + Main.rand.NextVector2Circular(scaleFromFall * 74f, scaleFromFall * 74f), Main.rand.NextVector2Circular(2.5f, 2.5f), false, 120, 3.5f + Main.rand.NextFloat(0.6f), Color.Lerp(Color.Cyan, Color.LightCyan, 0.75f));
|
||||
GeneralParticleHandler.SpawnParticle(square);
|
||||
}
|
||||
Projectile.localAI[0]++;
|
||||
@@ -62,12 +62,12 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
Main.spriteBatch.EnterShaderRegion();
|
||||
Texture2D telegraphBase = ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj").Value;
|
||||
|
||||
GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseOpacity(0.75f * Projectile.timeLeft/(float)timeLeft);
|
||||
GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseColor(Color.Lerp(Color.Cyan, Color.LightCyan, 0.35f));
|
||||
GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseSecondaryColor(Color.White);
|
||||
GameShaders.Misc["CalamityMod:CircularAoETelegraph"].UseSaturation(1);
|
||||
GameShaders.Misc["CalamityMod:CircularGradientWithEdge"].UseOpacity(0.75f * Projectile.timeLeft/(float)timeLeft);
|
||||
GameShaders.Misc["CalamityMod:CircularGradientWithEdge"].UseColor(Color.Lerp(Color.Cyan, Color.LightCyan, 0.5f));
|
||||
GameShaders.Misc["CalamityMod:CircularGradientWithEdge"].UseSecondaryColor(Color.White);
|
||||
GameShaders.Misc["CalamityMod:CircularGradientWithEdge"].UseSaturation(scaleFromFall);
|
||||
|
||||
GameShaders.Misc["CalamityMod:CircularAoETelegraph"].Apply();
|
||||
GameShaders.Misc["CalamityMod:CircularGradientWithEdge"].Apply();
|
||||
|
||||
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
|
||||
Main.EntitySpriteDraw(telegraphBase, drawPosition, null, lightColor, 0, telegraphBase.Size() / 2f, scaleFromFall*156f, 0, 0);
|
||||
|
||||
Reference in new issue
Block a user