no more extra proj for aqua's scepter drawing
also pressed ctrl + k, ctrl e in the file
This commit is contained in:
1 parent
f00f8f9613
commit
df6db119fc
3 files changed
+64
-77
No files matched your search
@@ -8,7 +8,6 @@ AngelRay.DisplayName: Angelic Ray
|
||||
ApexShark.DisplayName: Ancient Mineral Shark
|
||||
ApparatusExplosion.DisplayName: Explosion
|
||||
AquasScepterCloud.DisplayName: Storm Cloud
|
||||
AquasScepterCloudFlash.DisplayName: Storm Cloud Flash
|
||||
AquasScepterRaindrop.DisplayName: Rain Droplet
|
||||
AquasScepterTeslaAura.DisplayName: Tesla Aura
|
||||
AquaticStarMinion.DisplayName: Aquatic Star
|
||||
|
||||
@@ -1,35 +1,38 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class AquasScepterCloud : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Summon";
|
||||
public class AquasScepterCloud : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Summon";
|
||||
public ref float LightningTimer => ref Projectile.ai[0];
|
||||
public ref float RainTimer => ref Projectile.ai[1];
|
||||
public int DrawFlashTimer = 0;
|
||||
|
||||
public override void SetStaticDefaults() {
|
||||
// Sets the amount of frames this minion has on its spritesheet
|
||||
Main.projFrames[Projectile.type] = 5;
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
// Sets the amount of frames this minion has on its spritesheet
|
||||
Main.projFrames[Projectile.type] = 5;
|
||||
}
|
||||
|
||||
public sealed override void SetDefaults() {
|
||||
Projectile.width = 252;
|
||||
Projectile.height = 78;
|
||||
public sealed override void SetDefaults()
|
||||
{
|
||||
Projectile.width = 252;
|
||||
Projectile.height = 78;
|
||||
Projectile.hide = true;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.timeLeft = Projectile.SentryLifeTime;
|
||||
Projectile.friendly = true;
|
||||
Projectile.sentry = true;
|
||||
Projectile.DamageType = DamageClass.Summon;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.light = 1f;
|
||||
}
|
||||
Projectile.timeLeft = Projectile.SentryLifeTime;
|
||||
Projectile.friendly = true;
|
||||
Projectile.sentry = true;
|
||||
Projectile.DamageType = DamageClass.Summon;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.light = 1f;
|
||||
}
|
||||
|
||||
public override void DrawBehind(int index, List<int> behindNPCsAndTiles, List<int> behindNPCs, List<int> behindProjectiles, List<int> overPlayers, List<int> overWiresUI)
|
||||
{
|
||||
@@ -40,17 +43,18 @@ namespace CalamityMod.Projectiles.Summon
|
||||
public override bool? CanDamage() => false;
|
||||
|
||||
public override Color? GetAlpha(Color drawColor)
|
||||
{
|
||||
return Color.White;
|
||||
}
|
||||
{
|
||||
return Color.White;
|
||||
}
|
||||
|
||||
public override void AI() {
|
||||
float distanceFromTarget = 700f;
|
||||
var targetCenter = Projectile.position;
|
||||
bool foundTarget = false;
|
||||
public override void AI()
|
||||
{
|
||||
float distanceFromTarget = 700f;
|
||||
var targetCenter = Projectile.position;
|
||||
bool foundTarget = false;
|
||||
|
||||
LightningTimer++;
|
||||
RainTimer++;
|
||||
LightningTimer++;
|
||||
RainTimer++;
|
||||
|
||||
Projectile.frameCounter++;
|
||||
if (Projectile.frameCounter >= 6)
|
||||
@@ -61,12 +65,12 @@ namespace CalamityMod.Projectiles.Summon
|
||||
if (Projectile.frame >= Main.projFrames[Projectile.type])
|
||||
Projectile.frame = 0;
|
||||
|
||||
if (RainTimer >= 3f) // Spawns a raindrop every 3 frames, displaced down and randomly along the length of the cloud
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), (Projectile.Center.X + Main.rand.Next(-110, 111)), (Projectile.Center.Y + 57f), 0f, 15f, ModContent.ProjectileType<AquasScepterRaindrop>(), Projectile.damage, 0, Projectile.owner);
|
||||
if (RainTimer >= 3f) // Spawns a raindrop every 3 frames, displaced down and randomly along the length of the cloud
|
||||
{
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), (Projectile.Center.X + Main.rand.Next(-110, 111)), (Projectile.Center.Y + 57f), 0f, 15f, ModContent.ProjectileType<AquasScepterRaindrop>(), Projectile.damage, 0, Projectile.owner);
|
||||
|
||||
RainTimer = 0f;
|
||||
}
|
||||
RainTimer = 0f;
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < Main.maxNPCs; i++)
|
||||
@@ -87,16 +91,30 @@ namespace CalamityMod.Projectiles.Summon
|
||||
}
|
||||
}
|
||||
}
|
||||
if (foundTarget) {
|
||||
if (distanceFromTarget < 300) {
|
||||
if (LightningTimer >= 60f) { //Every 60 AI cycles, plays the lightning sound and spawns 2 projectiles: the tesla aura for dealing damage in an aoe, and the cloud flash to simulate the brightness of the main cloud changing.
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/LightningAura"));
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<AquasScepterTeslaAura>(), (int)(Projectile.damage*7.2f), 16, Projectile.owner);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<AquasScepterCloudFlash>(), 0, 0, Projectile.owner);
|
||||
LightningTimer = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (foundTarget)
|
||||
{
|
||||
if (distanceFromTarget < 300)
|
||||
{
|
||||
if (LightningTimer >= 60f) //Every 60 AI cycles, plays the lightning sound and spawns 2 projectiles: the tesla aura for dealing damage in an aoe, and the cloud flash to simulate the brightness of the main cloud changing.
|
||||
{
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/LightningAura"));
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<AquasScepterTeslaAura>(), (int)(Projectile.damage * 7.2f), 16, Projectile.owner);
|
||||
LightningTimer = 0f;
|
||||
DrawFlashTimer = 27;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void PostDraw(Color lightColor)
|
||||
{
|
||||
if (DrawFlashTimer > 0)
|
||||
{
|
||||
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Summon/AquasScepterCloudFlash").Value;
|
||||
lightColor *= 1f - ((27 - DrawFlashTimer) / 27f);
|
||||
Vector2 drawPosition = Projectile.position - Main.screenPosition + (texture.Size() * 0.5f);
|
||||
Main.EntitySpriteDraw(texture, drawPosition, null, lightColor, 0f, texture.Size() * 0.5f, 1f, SpriteEffects.None);
|
||||
DrawFlashTimer--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class AquasScepterCloudFlash : ModProjectile, ILocalizedModType
|
||||
{
|
||||
public new string LocalizationCategory => "Projectiles.Summon";
|
||||
public override void SetStaticDefaults() {
|
||||
// Sets the amount of frames this minion has on its spritesheet
|
||||
Main.projFrames[Projectile.type] = 1;
|
||||
}
|
||||
|
||||
public sealed override void SetDefaults() {
|
||||
Projectile.width = 252;
|
||||
Projectile.height = 78;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.timeLeft = 27;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.alpha = 125;
|
||||
}
|
||||
|
||||
public override bool? CanDamage() => false;
|
||||
|
||||
public override void AI() {
|
||||
Projectile.alpha += 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user