This commit is contained in:
Ozzatron committed 2019-10-18 20:41:48 -04:00
commit adaa74fbce
26 files changed
+153 -64

No files matched your search

+14 -4
View File
@@ -5,6 +5,16 @@ using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Projectiles.Magic;
using CalamityMod.Projectiles.Melee;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.Projectiles.Healing;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.DamageOverTime;
namespace CalamityMod.Projectiles
{
@@ -553,8 +563,8 @@ namespace CalamityMod.Projectiles
{
if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ProjectileID.Mushroom] < 30)
{
if (projectile.type == ModContent.ProjectileType<Nebulash>() || projectile.type == ModContent.ProjectileType<CosmicDischarge>() ||
projectile.type == ModContent.ProjectileType<Mourningstar>() || projectile.type == ProjectileID.SolarWhipSword)
if (projectile.type == ModContent.ProjectileType<Melee.Nebulash>() || projectile.type == ModContent.ProjectileType<Melee.CosmicDischarge>() ||
projectile.type == ModContent.ProjectileType<Melee.Mourningstar>() || projectile.type == ProjectileID.SolarWhipSword)
{
Vector2 vector24 = Main.OffsetsPlayerOnhand[Main.player[projectile.owner].bodyFrame.Y / 56] * 2f;
if (Main.player[projectile.owner].direction != 1)
@@ -629,7 +639,7 @@ namespace CalamityMod.Projectiles
//will always be friendly and rogue if it has this boost
if (Main.player[projectile.owner].Calamity().momentumCapacitor && projectile.Calamity().momentumCapacitatorBoost)
{
if (projectile.type != ModContent.ProjectileType<Malachite>() && projectile.type != ModContent.ProjectileType<DuneHopperProjectile>() &&
if (projectile.type != ModContent.ProjectileType<Rogue.Malachite>() && projectile.type != ModContent.ProjectileType<DuneHopperProjectile>() &&
projectile.velocity.Length() < 3f)
projectile.velocity *= 1.025f;
}
@@ -655,7 +665,7 @@ namespace CalamityMod.Projectiles
//Summon moon sigils infrequently
if (Main.rand.NextBool(300) && projectile.type != ModContent.ProjectileType<MoonSigil>())
{
Projectile.NewProjectile(projectile.position, Vector2.Zero, ModContent.ProjectileType<MoonSigil>(), (int)(projectile.damage * 0.05), 0, projectile.owner);
Projectile.NewProjectile(projectile.position, Vector2.Zero, ModContent.ProjectileType<MoonSigil>(), (int)(projectile.damage * 0.2), 0, projectile.owner);
}
}
}
+9 -1
View File
@@ -3,6 +3,7 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Buffs.StatBuffs;
namespace CalamityMod.Projectiles.Ranged
{
public class PolarStar : ModProjectile
@@ -204,9 +205,16 @@ namespace CalamityMod.Projectiles.Ranged
}
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
Collision.HitTiles(projectile.position + projectile.velocity, projectile.velocity, projectile.width, projectile.height);
Main.PlaySound(0, projectile.position);
return true;
}
public override void Kill(int timeLeft)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62);
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 62,0.5f);
if (projectile.ai[1] == 1f) //Boost two
{
int projectiles = Main.rand.Next(2, 5);
@@ -4,6 +4,7 @@ using System;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using CalamityMod.Items.Weapons.Rogue;
namespace CalamityMod.Projectiles.Rogue
{
@@ -84,6 +85,9 @@ namespace CalamityMod.Projectiles.Rogue
BlastBarrel.BaseDamage, 1f, projectile.owner);
Main.projectile[fireIndex].thrown = false;
Main.projectile[fireIndex].Calamity().rogue = true;
Main.projectile[fireIndex].penetrate = -1;
Main.projectile[fireIndex].usesLocalNPCImmunity = true;
Main.projectile[fireIndex].localNPCHitCooldown = -1;
}
}
projectile.ai[1]--;
+2 -1
View File
@@ -1,6 +1,7 @@
using Terraria;
using Terraria.ModLoader;
using CalamityMod.Dusts;
using CalamityMod.Projectiles.Melee;
namespace CalamityMod.Projectiles.Rogue
{
@@ -36,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue
{
if (projectile.Calamity().stealthStrike == true)
{
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, ModContent.ProjectileType<GacruxianHome>(), (int)((double)projectile.damage * 0.75), projectile.knockBack, projectile.owner, 0f, 0f);
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, projectile.velocity.X * 0f, projectile.velocity.Y * 0f, ModContent.ProjectileType<GacruxianHome>(), (int)((double)projectile.damage * 0.3), projectile.knockBack, projectile.owner, 0f, 0f);
}
else
{
+3 -2
View File
@@ -3,6 +3,7 @@ using System;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using CalamityMod.Items.Weapons.Rogue;
namespace CalamityMod.Projectiles.Rogue
{
@@ -52,9 +53,9 @@ namespace CalamityMod.Projectiles.Rogue
projectile.tileCollide = true;
//Decide the range of the boomerang depending on stealth
if (projectile.Calamity().stealthStrike)
ReboundTime = 25f;
ReboundTime = 27f;
else
ReboundTime = 50f;
ReboundTime = 55f;
// ai[0] stores whether the boomerang is returning. If 0, it isn't. If 1, it is.
if (projectile.ai[0] == 0f)
+3
View File
@@ -3,6 +3,7 @@ using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Items.Weapons.Rogue;
namespace CalamityMod.Projectiles.Rogue
{
@@ -24,6 +25,8 @@ namespace CalamityMod.Projectiles.Rogue
drawOffsetX = -10;
drawOriginOffsetY = 0;
drawOriginOffsetX = 0;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 40;
projectile.extraUpdates = 1;
projectile.Calamity().rogue = true;
}
+67 -3
View File
@@ -2,6 +2,7 @@
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using System;
namespace CalamityMod.Projectiles.Rogue
{
public class MoonSigil : ModProjectile
@@ -22,14 +23,77 @@ namespace CalamityMod.Projectiles.Rogue
projectile.ignoreWater = true;
projectile.timeLeft = 250;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 2;
projectile.localNPCHitCooldown = 10;
projectile.Calamity().rogue = true;
}
public override void AI()
{
if (projectile.timeLeft < 25)
{ projectile.alpha += 10; }
if (projectile.timeLeft < 52)
{
projectile.alpha += 5;
projectile.scale -= 0.013f;
}
if (projectile.alpha >= 255)
{
projectile.alpha = 255;
projectile.Kill();
return;
}
float num472 = projectile.Center.X;
float num473 = projectile.Center.Y;
float num474 = 600f;
bool flag17 = false;
for (int num475 = 0; num475 < 200; num475++)
{
if (Main.npc[num475].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num475].Center, 1, 1))
{
float num476 = Main.npc[num475].position.X + (float)(Main.npc[num475].width / 2);
float num477 = Main.npc[num475].position.Y + (float)(Main.npc[num475].height / 2);
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
if (num478 < num474)
{
num474 = num478;
num472 = num476;
num473 = num477;
flag17 = true;
}
}
}
if (flag17)
{
float num483 = 8f;
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num484 = num472 - vector35.X;
float num485 = num473 - vector35.Y;
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
num486 = num483 / num486;
num484 *= num486;
num485 *= num486;
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
}
}
public override void Kill(int timeLeft)
{
float dustSp = 0.2f;
int dustD = 0;
for (int i = 0; i < 4; i++)
{
for (int j = 0; j < 5; j++)
{
Vector2 dustspeed = new Vector2(dustSp, dustSp).RotatedBy(MathHelper.ToRadians(dustD));
int d = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 31, dustspeed.X, dustspeed.Y, 200, new Color(213, 242, 232, 200), 1f);
Main.dust[d].noGravity = true;
Main.dust[d].position = projectile.Center;
Main.dust[d].velocity = dustspeed;
dustSp += 0.2f;
}
dustD += 90;
dustSp = 0.2f;
}
}
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
+1
View File
@@ -4,6 +4,7 @@ using System;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using CalamityMod.Buffs.Summon;
namespace CalamityMod.Projectiles.Summon
{
public class BlackHawkSummon : ModProjectile
@@ -1,6 +1,8 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Rogue;
namespace CalamityMod.Projectiles.Typeless
{
public class MomentumCapacitorOrb : ModProjectile
@@ -24,6 +26,10 @@ namespace CalamityMod.Projectiles.Typeless
}
public override void AI()
{
Player player = Main.player[Main.myPlayer];
CalamityPlayer modPlayer = player.Calamity();
if (!modPlayer.momentumCapacitor)
projectile.Kill();
if (Main.rand.NextBool(4))
{
float numDust = MathHelper.TwoPi * Radius / 5f;