Made Cirrus use the Fabstaff ray
This commit is contained in:
1 parent
11aee1b13c
commit
0f01d33fc9
5 files changed
+5
-147
No files matched your search
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Items.Placeables.Furniture;
|
||||
using CalamityMod.Items.Potions.Alcohol;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.World;
|
||||
using System.Collections.Generic;
|
||||
@@ -375,13 +376,13 @@ namespace CalamityMod.NPCs.TownNPCs
|
||||
|
||||
public override void TownNPCAttackProj(ref int projType, ref int attackDelay)
|
||||
{
|
||||
projType = ModContent.ProjectileType<CirrusRay>();
|
||||
projType = ModContent.ProjectileType<FabRay>();
|
||||
attackDelay = 1;
|
||||
}
|
||||
|
||||
public override void TownNPCAttackProjSpeed(ref float multiplier, ref float gravityCorrection, ref float randomOffset)
|
||||
{
|
||||
multiplier = 2f;
|
||||
multiplier = 11.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
projectile.ai[0] += 1f;
|
||||
projectile.Opacity = Utils.InverseLerp(0f, 10f * projectile.MaxUpdates, projectile.timeLeft, true);
|
||||
|
||||
if (projectile.owner == Main.myPlayer && projectile.ai[0] % 12f == 0f)
|
||||
int shootRate = projectile.npcProj ? 40 : 12;
|
||||
if (projectile.owner == Main.myPlayer && projectile.ai[0] % shootRate == 0f)
|
||||
{
|
||||
NPC potentialTarget = projectile.Center.ClosestNPCAt(180f, false);
|
||||
if (potentialTarget != null)
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class CirrusBolt : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Bolt");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 4;
|
||||
projectile.height = 4;
|
||||
projectile.extraUpdates = 100;
|
||||
projectile.friendly = true;
|
||||
projectile.timeLeft = 45;
|
||||
projectile.magic = true;
|
||||
projectile.npcProj = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.timeLeft % 2f == 0f)
|
||||
{
|
||||
Vector2 vector33 = projectile.position;
|
||||
vector33 -= projectile.velocity * 0.25f;
|
||||
int num448 = Dust.NewDust(vector33, 1, 1, 234, 0f, 0f, 0, default, 1.25f);
|
||||
Main.dust[num448].position = vector33;
|
||||
Main.dust[num448].noGravity = true;
|
||||
Main.dust[num448].noLight = true;
|
||||
Main.dust[num448].scale = Main.rand.Next(70, 110) * 0.013f;
|
||||
Main.dust[num448].velocity *= 0.1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class CirrusOrb : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Orb");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = -1;
|
||||
projectile.timeLeft = 30;
|
||||
projectile.magic = true;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
projectile.npcProj = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 150f, 6f, 6f, 2, ModContent.ProjectileType<CirrusBolt>());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class CirrusRay : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ray");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 4;
|
||||
projectile.height = 4;
|
||||
projectile.friendly = true;
|
||||
projectile.magic = true;
|
||||
projectile.penetrate = 5;
|
||||
projectile.extraUpdates = 100;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 0;
|
||||
projectile.npcProj = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.2f, 0.01f, 0.1f);
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] % 6f == 0f && projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<CirrusOrb>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
}
|
||||
|
||||
if (projectile.ai[0] > 16f && projectile.ai[0] % 2f == 0f)
|
||||
{
|
||||
Vector2 source = projectile.position;
|
||||
int pink = Dust.NewDust(source, 1, 1, 234, 0f, 0f, 0, default, 1.25f);
|
||||
Main.dust[pink].noGravity = true;
|
||||
Main.dust[pink].noLight = true;
|
||||
Main.dust[pink].position = source;
|
||||
Main.dust[pink].scale = Main.rand.Next(70, 110) * 0.013f;
|
||||
Main.dust[pink].velocity *= 0.1f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
projectile.penetrate--;
|
||||
if (projectile.penetrate <= 0)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
{
|
||||
projectile.velocity.X = -oldVelocity.X;
|
||||
}
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
{
|
||||
projectile.velocity.Y = -oldVelocity.Y;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user