more progress

This commit is contained in:
AquaSG committed 2023-08-07 16:18:23 -04:00
1 parent 0621bda42f
commit b1e02b14f3
7 files changed
+153 -22

No files matched your search

+61 -15
View File
@@ -474,7 +474,7 @@ namespace CalamityMod.CalPlayer
public int gSabatonHotkeyHoldTime = 0;
public int gSabatonFall = 0;
public bool gSabatonFalling = false;
public int gSabatonCooldown = 0;
public int gSabatonTempJumpSpeed = 0;
public bool sGlyph = false;
public bool sRegen = false;
public bool tracersDust = false;
@@ -2132,7 +2132,7 @@ namespace CalamityMod.CalPlayer
gSabatonHotkeyHoldTime = 0;
gSabatonFall = 0;
gSabatonFalling = false;
gSabatonCooldown = 0;
gSabatonTempJumpSpeed = 0;
astralStarRainCooldown = 0;
silvaMageCooldown = 0;
bloodflareMageCooldown = 0;
@@ -2505,22 +2505,18 @@ namespace CalamityMod.CalPlayer
if (Player.dead)
return;
if (CalamityKeybinds.GravistarSabatonHotkey.Current && gSabaton && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != Player.oldVelocity.Y) && !Player.pulley)
if (CalamityKeybinds.GravistarSabatonHotkey.Current && gSabaton && Main.myPlayer == Player.whoAmI && (Player.velocity.Y != Player.oldVelocity.Y) && !Player.pulley && !Player.mount.Active && Player.grappling[0] == -1 && !Player.tongued)
{
gSabatonHotkeyHoldTime++;
Player.mount.Dismount(Player);
Player.RemoveAllGrapplingHooks();
Player.controlMount = false;
Player.controlHook = false;
if (gSabatonHotkeyHoldTime < 60 && gSabatonHotkeyHoldTime % 3f == 0)
{
SpawnGravistarParticle();
}
}
else if (Main.myPlayer == Player.whoAmI)
{
gSabatonHotkeyHoldTime = 0;
}
if (Main.myPlayer == Player.whoAmI && gSabatonFalling)
{
Player.controlMount = false;
}
if (CalamityKeybinds.NormalityRelocatorHotKey.JustPressed && normalityRelocator && Main.myPlayer == Player.whoAmI)
{
@@ -3261,30 +3257,34 @@ namespace CalamityMod.CalPlayer
{
Player.AddBuff(ModContent.BuffType<ProfanedCrystalBuff>(), 60, true);
}
if (gSabaton)
if (gSabaton && Player.whoAmI == Main.myPlayer)
{
if (gSabatonHotkeyHoldTime < 60 && gSabatonHotkeyHoldTime != 0 && !gSabatonFalling)
{
Player.velocity.Y *= (60 - (gSabatonHotkeyHoldTime/4f))/60f;
}
if (gSabatonHotkeyHoldTime == 45)
{
SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GravistarCharge") { Volume = 0.3f });
}
if (gSabatonHotkeyHoldTime == 60)
{
gSabatonFalling = true;
}
if (Player.pulley)
if (Player.pulley || Player.mount.Active || Player.grappling[0] != -1 || Player.tongued)
{
gSabatonFall = 0;
gSabatonFalling = false;
}
if (gSabatonFalling)
{
SpawnGravistarParticle();
if (gSabatonFall < 120)
gSabatonFall++;
Player.maxFallSpeed = 40f;
Player.gravity = 1.3f;
Player.mount.Dismount(Player);
Player.controlHook = false;
Player.controlJump = false;
if (Player.oldVelocity.Y == Player.velocity.Y)
@@ -3293,6 +3293,7 @@ namespace CalamityMod.CalPlayer
Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType<SabatonSlam>(), 300, 4f, Player.whoAmI, gSabatonFall);
gSabatonFall = 0;
gSabatonFalling = false;
gSabatonTempJumpSpeed = 40;
}
}
@@ -3473,6 +3474,15 @@ namespace CalamityMod.CalPlayer
ForceVariousEffects();
BaseIdleHoldoutProjectile.CheckForEveryHoldout(Player);
if (gSabatonTempJumpSpeed > 0)
{
gSabatonTempJumpSpeed--;
if (gSabaton && Player.whoAmI == Main.myPlayer)
{
Player.jumpSpeedBoost += 2f;
}
}
}
#endregion
@@ -5499,6 +5509,32 @@ namespace CalamityMod.CalPlayer
info.Damage += (bossRushDamageFloor - info.Damage);
}
if (gSabatonFalling)
{
for (int i = 0; i < Main.maxNPCs; i++)
{
NPC n = Main.npc[i];
// Ignore critters with the Guide to Critter Companionship
if (Player.dontHurtCritters && NPCID.Sets.CountsAsCritter[n.type])
continue;
if (n.active && !n.dontTakeDamage && !n.friendly && n.Calamity().dashImmunityTime[Player.whoAmI] <= 0)
{
Rectangle npcHitbox = n.getRect();
if ((Player.getRect()).Intersects(npcHitbox) && (n.noTileCollide || Collision.CanHit(Player.position, Player.width, Player.height, n.position, n.width, n.height)))
{
Projectile.NewProjectile(Player.GetSource_FromThis(), n.Center, Vector2.Zero, ModContent.ProjectileType<DirectStrike>(), 150, 0, Main.myPlayer);
n.Calamity().dashImmunityTime[Player.whoAmI] = 4;
Player.GiveIFrames(5, false);
return true;
}
}
}
}
// God Slayer Damage Resistance makes you ignore hits that came in as less than 80.
// Alternatively, if the incoming damage is somehow less than 1 (TML doesn't allow this, but...), the hit is completely ignored.
if ((godSlayerDamage && info.Damage <= 80) || info.Damage < 1)
@@ -6951,6 +6987,16 @@ namespace CalamityMod.CalPlayer
range *= reaverExplore ? 0.9f : 1f;
return range;
}
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);
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);
GeneralParticleHandler.SpawnParticle(square2);
}
#endregion
#region Mana Consumption Effects
+1
View File
@@ -19,6 +19,7 @@ namespace CalamityMod.Items.Accessories
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.noFallDmg = true;
player.jumpSpeedBoost += 1f;
player.Calamity().gSabaton = true;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

+51
View File
@@ -0,0 +1,51 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ModLoader;
using System.Collections.Generic;
namespace CalamityMod.Particles
{
public class SquareParticle : Particle
{
public Color InitialColor;
public bool AffectedByGravity;
public override bool SetLifetime => true;
public override bool UseCustomDraw => true;
public override bool UseAdditiveBlend => true;
public override string Texture => "CalamityMod/Particles/Square";
public SquareParticle(Vector2 relativePosition, Vector2 velocity, bool affectedByGravity, int lifetime, float scale, Color color)
{
Position = relativePosition;
Velocity = velocity;
AffectedByGravity = affectedByGravity;
Scale = scale;
Lifetime = lifetime;
Color = InitialColor = color;
}
public override void Update()
{
Scale *= 0.95f;
Color = Color.Lerp(InitialColor, Color.Transparent, (float)Math.Pow(LifetimeCompletion, 3D));
Velocity *= 0.95f;
if (Velocity.Length() < 12f && AffectedByGravity)
{
Velocity.X *= 0.94f;
Velocity.Y += 0.25f;
}
Rotation = Velocity.ToRotation() + MathHelper.PiOver2;
}
public override void CustomDraw(SpriteBatch spriteBatch)
{
Vector2 scale = new Vector2(0.8f, 1.2f) * Scale;
Texture2D texture = ModContent.Request<Texture2D>(Texture).Value;
spriteBatch.Draw(texture, Position - Main.screenPosition, null, Color, Rotation, texture.Size() * 0.5f, scale, 0, 0f);
}
}
}
+40 -7
View File
@@ -6,6 +6,9 @@ using Terraria.ModLoader;
using Terraria.Audio;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria.Graphics.Shaders;
using System;
using CalamityMod.Particles;
namespace CalamityMod.Projectiles.Typeless
{
@@ -15,6 +18,8 @@ namespace CalamityMod.Projectiles.Typeless
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public float scaleFromFall;
public float damageScaleFromFall;
public int timeLeft = 60;
public bool ableToHit = true;
public override void SetDefaults()
{
@@ -30,19 +35,47 @@ namespace CalamityMod.Projectiles.Typeless
public override void AI()
{
// Image is 156x156
scaleFromFall = (Projectile.ai[0] / 22) + 0.5f;
damageScaleFromFall = Projectile.ai[0] / 40;
Projectile.damage = (int)(300f * damageScaleFromFall + 300f);
if (Projectile.timeLeft <= 40)
{
ableToHit = false;
}
if (Projectile.localAI[0] == 0)
{
scaleFromFall = (Projectile.ai[0] / 22) + 0.5f;
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);
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);
GeneralParticleHandler.SpawnParticle(square);
}
Projectile.localAI[0]++;
}
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D lightTexture = ModContent.Request<Texture2D>("CalamityMod/Particles/HollowCircleHardEdge").Value;
Main.spriteBatch.EnterShaderRegion();
Texture2D telegraphBase = ModContent.Request<Texture2D>("CalamityMod/Projectiles/InvisibleProj").Value;
Main.EntitySpriteDraw(lightTexture, Projectile.Center - Main.screenPosition, null, Color.White, 0f, lightTexture.Size() * 0.5f, scaleFromFall, SpriteEffects.None, 0);
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:CircularAoETelegraph"].Apply();
Vector2 drawPosition = Projectile.Center - Main.screenPosition;
Main.EntitySpriteDraw(telegraphBase, drawPosition, null, lightColor, 0, telegraphBase.Size() / 2f, scaleFromFall*156f, 0, 0);
Main.spriteBatch.ExitShaderRegion();
return false;
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, (scaleFromFall * 64f), targetHitbox);
public override bool? CanDamage() => ableToHit ? (bool?)null : false;
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, (scaleFromFall * 78f), targetHitbox);
}
}
Binary file not shown.
Binary file not shown.