added a telegraph for geysers and slightly buffed wyvern's call

This commit is contained in:
termigator1359 committed 2020-04-24 18:48:08 -04:00
1 parent b202a8ba4e
commit 7f0b29f48c
15 files changed
+448 -80

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ Fires wyverns and colored feathers from the sky that stick to enemies and tiles
public override void SetDefaults()
{
item.damage = 30;
item.damage = 35;
item.magic = true;
item.mana = 10;
item.width = 52;
+5 -4
View File
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -156,7 +157,7 @@ namespace CalamityMod.NPCs.Calamitas
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f);
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f);
}
}
else
@@ -169,7 +170,7 @@ namespace CalamityMod.NPCs.Calamitas
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
for (int num621 = 0; num621 < 40; num621++)
{
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
@@ -179,10 +180,10 @@ namespace CalamityMod.NPCs.Calamitas
}
for (int num623 = 0; num623 < 70; num623++)
{
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f);
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f);
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
}
}
+8 -26
View File
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using CalamityMod.Items.Placeables.Furniture.Trophies;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Projectiles.Boss;
@@ -155,35 +156,16 @@ namespace CalamityMod.NPCs.Calamitas
public override void NPCLoot()
{
if (Main.rand.NextBool(10))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<CataclysmTrophy>());
}
if (Main.expertMode)
{
if (Main.rand.NextBool(10))
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<BrimstoneFlamesprayer>());
}
else if (Main.rand.NextBool(12))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<BrimstoneFlamesprayer>());
}
if (Main.expertMode)
{
if (Main.rand.NextBool(10))
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<BrimstoneFlameblaster>());
}
else if (Main.rand.NextBool(12))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<BrimstoneFlameblaster>());
}
DropHelper.DropItemChance(npc, ModContent.ItemType<CataclysmTrophy>(), 10);
DropHelper.DropItemChance(npc, ModContent.ItemType<BrimstoneFlamesprayer>(), Main.expertMode ? 10 : 12);
DropHelper.DropItemChance(npc, ModContent.ItemType<BrimstoneFlameblaster>(), Main.expertMode ? 10 : 12);
}
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f);
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f);
}
if (npc.life <= 0)
{
@@ -200,7 +182,7 @@ namespace CalamityMod.NPCs.Calamitas
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
for (int num621 = 0; num621 < 40; num621++)
{
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
@@ -210,10 +192,10 @@ namespace CalamityMod.NPCs.Calamitas
}
for (int num623 = 0; num623 < 70; num623++)
{
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f);
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f);
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
}
}
+7 -17
View File
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using CalamityMod.Items.Placeables.Furniture.Trophies;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.Projectiles.Boss;
@@ -155,26 +156,15 @@ namespace CalamityMod.NPCs.Calamitas
public override void NPCLoot()
{
if (Main.rand.NextBool(10))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<CatastropheTrophy>());
}
if (Main.expertMode)
{
if (Main.rand.NextBool(10))
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<CrushsawCrasher>());
}
else if (Main.rand.NextBool(15))
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<CrushsawCrasher>());
}
DropHelper.DropItemChance(npc, ModContent.ItemType<CatastropheTrophy>(), 10);
DropHelper.DropItemChance(npc, ModContent.ItemType<CrushsawCrasher>(), Main.expertMode ? 10 : 12);
}
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f);
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f);
}
if (npc.life <= 0)
{
@@ -191,7 +181,7 @@ namespace CalamityMod.NPCs.Calamitas
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
for (int num621 = 0; num621 < 40; num621++)
{
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
@@ -201,10 +191,10 @@ namespace CalamityMod.NPCs.Calamitas
}
for (int num623 = 0; num623 < 70; num623++)
{
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f);
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f);
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
}
}
+5 -4
View File
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Armor.Vanity;
using CalamityMod.Items.LoreItems;
@@ -236,7 +237,7 @@ namespace CalamityMod.NPCs.Calamitas
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f);
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f);
}
if (npc.life <= 0)
{
@@ -254,7 +255,7 @@ namespace CalamityMod.NPCs.Calamitas
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
for (int num621 = 0; num621 < 40; num621++)
{
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
@@ -264,10 +265,10 @@ namespace CalamityMod.NPCs.Calamitas
}
for (int num623 = 0; num623 < 70; num623++)
{
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f);
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f);
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.Calamitas
npc.canGhostHeal = false;
npc.HitSound = SoundID.NPCHit4;
npc.DeathSound = SoundID.NPCDeath14;
npc.buffImmune[24] = true;
npc.buffImmune[BuffID.OnFire] = true;
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
+5 -4
View File
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Dusts;
using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -128,7 +129,7 @@ namespace CalamityMod.NPCs.Calamitas
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f);
Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, hitDirection, -1f, 0, default, 1f);
}
if (npc.life <= 0)
{
@@ -144,7 +145,7 @@ namespace CalamityMod.NPCs.Calamitas
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
for (int num621 = 0; num621 < 20; num621++)
{
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f);
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
@@ -154,10 +155,10 @@ namespace CalamityMod.NPCs.Calamitas
}
for (int num623 = 0; num623 < 40; num623++)
{
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 3f);
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 235, 0f, 0f, 100, default, 2f);
num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
}
}
+16 -18
View File
@@ -1,4 +1,5 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
@@ -27,42 +28,39 @@ namespace CalamityMod.Projectiles.Boss
Lighting.AddLight(projectile.Center, 0.3f, 0f, 0f);
if (projectile.ai[0] > 7f)
{
float num296 = 1f;
float scalar = 1f;
if (projectile.ai[0] == 8f)
{
num296 = 0.25f;
scalar = 0.25f;
}
else if (projectile.ai[0] == 9f)
{
num296 = 0.5f;
scalar = 0.5f;
}
else if (projectile.ai[0] == 10f)
{
num296 = 0.75f;
scalar = 0.75f;
}
projectile.ai[0] += 1f;
int num297 = 235;
int dustType = (int)CalamityDusts.Brimstone;
if (Main.rand.NextBool(2))
{
int num299 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num297, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 100, default, 1f);
int fire = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f, 100, default, 1f);
Dust dust = Main.dust[fire];
if (Main.rand.NextBool(3))
{
Main.dust[num299].noGravity = true;
Main.dust[num299].scale *= 3f;
Dust expr_DBEF_cp_0 = Main.dust[num299];
expr_DBEF_cp_0.velocity.X *= 1.5f;
Dust expr_DC0F_cp_0 = Main.dust[num299];
expr_DC0F_cp_0.velocity.Y *= 1.5f;
dust.noGravity = true;
dust.scale *= 3f;
dust.velocity.X *= 1.5f;
dust.velocity.Y *= 1.5f;
}
else
{
Main.dust[num299].scale *= 1.5f;
dust.scale *= 1.5f;
}
Dust expr_DC74_cp_0 = Main.dust[num299];
expr_DC74_cp_0.velocity.X *= 1.2f;
Dust expr_DC94_cp_0 = Main.dust[num299];
expr_DC94_cp_0.velocity.Y *= 1.2f;
Main.dust[num299].scale *= num296;
dust.velocity.X *= 1.2f;
dust.velocity.Y *= 1.2f;
dust.scale *= scalar;
}
}
else
+174
View File
@@ -0,0 +1,174 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Environment
{
public class BrimstoneGeyser : ModProjectile
{
private int dustType = (int)CalamityDusts.Brimstone;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Smoke");
}
public override void SetDefaults()
{
projectile.width = 30;
projectile.height = 30;
projectile.alpha = 255;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.timeLeft = 120;
projectile.hostile = true;
projectile.penetrate = -1;
projectile.trap = true;
}
public override void AI()
{
int num1 = Math.Sign(projectile.velocity.Y);
int num2 = num1 == -1 ? 0 : 1;
if (projectile.ai[0] == 0f)
{
if (!Collision.SolidCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float) (projectile.height - 48) : 0f), projectile.width, 48) && !Collision.WetCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float) (projectile.height - 20) : 0f), projectile.width, 20))
{
projectile.velocity = new Vector2(0f, (float) Math.Sign(projectile.velocity.Y) * (1f / 1000f));
projectile.ai[0] = 1f;
projectile.ai[1] = 0f;
projectile.timeLeft = 60;
}
projectile.ai[1] += 1f;
if (projectile.ai[1] >= 60f)
projectile.Kill();
for (int index1 = 0; index1 < 3; ++index1)
{
int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, new Color(), 1f);
Main.dust[index2].scale = 0.1f + Main.rand.Next(5) * 0.1f;
Main.dust[index2].fadeIn = 1.5f + Main.rand.Next(5) * 0.1f;
Main.dust[index2].noGravity = true;
Main.dust[index2].position = projectile.Center + new Vector2(0f, (float) (-projectile.height / 2)).RotatedBy((double)projectile.rotation, new Vector2()) * 1.1f;
}
}
if (projectile.ai[0] != 1f)
return;
projectile.velocity = new Vector2(0f, (float) Math.Sign(projectile.velocity.Y) * (1f / 1000f));
if (num1 != 0)
{
int num3 = 16;
int num4 = 320;
while (num3 < num4 && !Collision.SolidCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float)(projectile.height - num3 - 16) : 0f), projectile.width, num3 + 16))
num3 += 16;
if (num1 == -1)
{
projectile.position.Y += (float)projectile.height;
projectile.height = num3;
projectile.position.Y -= (float)num3;
}
else
projectile.height = num3;
}
projectile.ai[1] += 1f;
if (projectile.ai[1] >= 60f)
projectile.Kill();
if (projectile.localAI[0] == 0f)
{
projectile.localAI[0] = 1f;
for (int index1 = 0; index1 < 60; ++index1)
{
int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f);
Dust dust = Main.dust[index2];
dust.alpha = 200;
dust.velocity *= new Vector2(0.3f, 2f);
dust.velocity.Y += (float)(2 * num1);
dust.scale += Main.rand.NextFloat();
dust.position = new Vector2(projectile.Center.X, projectile.Center.Y + (float) projectile.height * 0.5f * (float) -num1);
dust.customData = (object) num2;
if (num1 == -1 && Main.rand.Next(4) != 0)
{
dust.velocity.Y -= 0.2f;
}
}
Main.PlaySound(SoundID.Item34, projectile.position);
}
if (num1 == 1)
{
for (int index1 = 0; index1 < 9; ++index1)
{
int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f);
Dust dust = Main.dust[index2];
dust.alpha = 200;
dust.velocity *= new Vector2(0.3f, 2f);
dust.velocity.Y += (float)(2 * num1);
dust.scale += Main.rand.NextFloat();
dust.position = new Vector2(projectile.Center.X, projectile.Center.Y + (float) projectile.height * 0.5f * (float) -num1);
dust.customData = (object)num2;
if (num1 == -1 && Main.rand.Next(4) != 0)
{
Main.dust[index2].velocity.Y -= 0.2f;
}
}
}
int Height = (int)(projectile.ai[1] / 60f * (float)projectile.height) * 3;
if (Height > projectile.height)
Height = projectile.height;
Vector2 Position = projectile.position + (num1 == -1 ? new Vector2(0f, (float) (projectile.height - Height)) : Vector2.Zero);
Vector2 vector2 = projectile.position + (num1 == -1 ? new Vector2(0f, (float) projectile.height) : Vector2.Zero);
for (int index1 = 0; index1 < 6; ++index1)
{
if (Main.rand.Next(3) < 2)
{
int index2 = Dust.NewDust(Position, projectile.width, Height, dustType, 0f, 0f, 90, new Color(), 2.5f);
Dust dust = Main.dust[index2];
dust.noGravity = true;
dust.fadeIn = 1f;
if (dust.velocity.Y > 0f)
{
dust.velocity.Y *= -1f;
}
if (Main.rand.Next(6) < 3)
{
dust.position.Y = MathHelper.Lerp(dust.position.Y, vector2.Y, 0.5f);
dust.velocity *= 5f;
dust.velocity.Y -= 3f;
dust.position.X = projectile.Center.X;
dust.noGravity = false;
dust.noLight = true;
dust.fadeIn = 0.4f;
dust.scale *= 0.3f;
}
else
Main.dust[index2].velocity = projectile.DirectionFrom(Main.dust[index2].position) * Main.dust[index2].velocity.Length() * 0.25f;
Main.dust[index2].velocity.Y *= (float)-num1;
Main.dust[index2].customData = (object)num2;
}
}
for (int index1 = 0; index1 < 6; ++index1)
{
if (Main.rand.NextFloat() >= 0.5f)
{
int index2 = Dust.NewDust(Position, projectile.width, Height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f);
Dust dust = Main.dust[index2];
dust.alpha = 200;
dust.velocity *= new Vector2(0.6f, 1.5f);
dust.scale += Main.rand.NextFloat();
if (num1 == -1 && Main.rand.Next(4) != 0)
{
dust.velocity.Y -= 0.2f;
}
dust.customData = (object)num2;
}
}
}
public override bool CanDamage() => false;
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 180);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

@@ -0,0 +1,53 @@
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Environment
{
public class GeyserTelegraph : ModProjectile
{
private bool initialized = false;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Geyser");
}
public override void SetDefaults()
{
projectile.width = 6;
projectile.height = 12;
projectile.hostile = true;
projectile.penetrate = -1;
projectile.timeLeft = 100;
projectile.trap = true;
}
public override void AI()
{
if (!initialized)
{
int projectileType = ModContent.ProjectileType<SmokeTelegraph>();
float randomVelocity = Main.rand.NextFloat() + 0.5f;
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, -8f * randomVelocity, projectileType, 0, 0f, projectile.owner, 0f, 0f);
Main.projectile[proj].netUpdate = true;
initialized = true;
}
}
public override void Kill(int timeLeft)
{
int projectileType = ProjectileID.GeyserTrap;
if (projectile.ai[0] == 1f)
{
projectileType = ModContent.ProjectileType<BrimstoneGeyser>();
}
float randomVelocity = Main.rand.NextFloat() + 0.5f;
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, -8f * randomVelocity, projectileType, 20, 2f, projectile.owner, 0f, 0f);
Main.projectile[proj].friendly = false;
Main.projectile[proj].netUpdate = true;
}
public override bool OnTileCollide(Vector2 oldVelocity) => false;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

+167
View File
@@ -0,0 +1,167 @@
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Environment
{
public class SmokeTelegraph : ModProjectile
{
private int dustType = 31;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Smoke");
}
public override void SetDefaults()
{
projectile.width = 30;
projectile.height = 30;
projectile.alpha = 255;
projectile.tileCollide = false;
projectile.ignoreWater = true;
projectile.timeLeft = 120;
projectile.hostile = true;
projectile.penetrate = -1;
projectile.trap = true;
}
public override void AI()
{
int num1 = Math.Sign(projectile.velocity.Y);
int num2 = num1 == -1 ? 0 : 1;
if (projectile.ai[0] == 0f)
{
if (!Collision.SolidCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float) (projectile.height - 48) : 0f), projectile.width, 48) && !Collision.WetCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float) (projectile.height - 20) : 0f), projectile.width, 20))
{
projectile.velocity = new Vector2(0f, (float) Math.Sign(projectile.velocity.Y) * (1f / 1000f));
projectile.ai[0] = 1f;
projectile.ai[1] = 0f;
projectile.timeLeft = 60;
}
projectile.ai[1] += 1f;
if (projectile.ai[1] >= 60f)
projectile.Kill();
for (int index1 = 0; index1 < 3; ++index1)
{
int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 100, new Color(), 1f);
Main.dust[index2].scale = 0.1f + Main.rand.Next(5) * 0.1f;
Main.dust[index2].fadeIn = 1.5f + Main.rand.Next(5) * 0.1f;
Main.dust[index2].noGravity = true;
Main.dust[index2].position = projectile.Center + new Vector2(0f, (float) (-projectile.height / 2)).RotatedBy((double)projectile.rotation, new Vector2()) * 1.1f;
}
}
if (projectile.ai[0] != 1f)
return;
projectile.velocity = new Vector2(0f, (float) Math.Sign(projectile.velocity.Y) * (1f / 1000f));
if (num1 != 0)
{
int num3 = 16;
int num4 = 320;
while (num3 < num4 && !Collision.SolidCollision(projectile.position + new Vector2(0f, num1 == -1 ? (float)(projectile.height - num3 - 16) : 0f), projectile.width, num3 + 16))
num3 += 16;
if (num1 == -1)
{
projectile.position.Y += (float)projectile.height;
projectile.height = num3;
projectile.position.Y -= (float)num3;
}
else
projectile.height = num3;
}
projectile.ai[1] += 1f;
if (projectile.ai[1] >= 60f)
projectile.Kill();
if (projectile.localAI[0] == 0f)
{
projectile.localAI[0] = 1f;
for (int index1 = 0; index1 < 60; ++index1)
{
int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f);
Dust dust = Main.dust[index2];
dust.alpha = 200;
dust.velocity *= new Vector2(0.3f, 2f);
dust.velocity.Y += (float)(2 * num1);
dust.scale += Main.rand.NextFloat();
dust.position = new Vector2(projectile.Center.X, projectile.Center.Y + (float) projectile.height * 0.5f * (float) -num1);
dust.customData = (object) num2;
if (num1 == -1 && Main.rand.Next(4) != 0)
{
dust.velocity.Y -= 0.2f;
}
}
Main.PlaySound(SoundID.Item34, projectile.position);
}
if (num1 == 1)
{
for (int index1 = 0; index1 < 9; ++index1)
{
int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f);
Dust dust = Main.dust[index2];
dust.alpha = 200;
dust.velocity *= new Vector2(0.3f, 2f);
dust.velocity.Y += (float)(2 * num1);
dust.scale += Main.rand.NextFloat();
dust.position = new Vector2(projectile.Center.X, projectile.Center.Y + (float) projectile.height * 0.5f * (float) -num1);
dust.customData = (object)num2;
if (num1 == -1 && Main.rand.Next(4) != 0)
{
Main.dust[index2].velocity.Y -= 0.2f;
}
}
}
int Height = (int)(projectile.ai[1] / 60f * (float)projectile.height) * 3;
if (Height > projectile.height)
Height = projectile.height;
Vector2 Position = projectile.position + (num1 == -1 ? new Vector2(0f, (float) (projectile.height - Height)) : Vector2.Zero);
Vector2 vector2 = projectile.position + (num1 == -1 ? new Vector2(0f, (float) projectile.height) : Vector2.Zero);
for (int index1 = 0; index1 < 6; ++index1)
{
if (Main.rand.Next(3) < 2)
{
int index2 = Dust.NewDust(Position, projectile.width, Height, dustType, 0f, 0f, 90, new Color(), 2.5f);
Dust dust = Main.dust[index2];
dust.noGravity = true;
dust.fadeIn = 1f;
if (dust.velocity.Y > 0f)
{
dust.velocity.Y *= -1f;
}
if (Main.rand.Next(6) < 3)
{
dust.position.Y = MathHelper.Lerp(dust.position.Y, vector2.Y, 0.5f);
dust.velocity *= 5f;
dust.velocity.Y -= 3f;
dust.position.X = projectile.Center.X;
dust.noGravity = false;
dust.noLight = true;
dust.fadeIn = 0.4f;
dust.scale *= 0.3f;
}
else
Main.dust[index2].velocity = projectile.DirectionFrom(Main.dust[index2].position) * Main.dust[index2].velocity.Length() * 0.25f;
Main.dust[index2].velocity.Y *= (float)-num1;
Main.dust[index2].customData = (object)num2;
}
}
for (int index1 = 0; index1 < 6; ++index1)
{
if (Main.rand.NextFloat() >= 0.5f)
{
int index2 = Dust.NewDust(Position, projectile.width, Height, dustType, 0f, -2.5f * (float) -num1, 0, new Color(), 1f);
Dust dust = Main.dust[index2];
dust.alpha = 200;
dust.velocity *= new Vector2(0.6f, 1.5f);
dust.scale += Main.rand.NextFloat();
if (num1 == -1 && Main.rand.Next(4) != 0)
{
dust.velocity.Y -= 0.2f;
}
dust.customData = (object)num2;
}
}
}
public override bool CanDamage() => false;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

+6 -5
View File
@@ -1,6 +1,6 @@
using CalamityMod.CalPlayer;
using CalamityMod.Items.Potions;
using CalamityMod.Projectiles.Boss;
using CalamityMod.Projectiles.Environment;
using CalamityMod.Tiles.Abyss;
using CalamityMod.Tiles.Astral;
using CalamityMod.Tiles.AstralDesert;
@@ -485,10 +485,11 @@ namespace CalamityMod.Tiles
}
if (shootFlames && Main.netMode != NetmodeID.MultiplayerClient)
{
int projectileType = (type != ModContent.TileType<BrimstoneSlag>() && type != ModContent.TileType<CharredOre>()) ? ProjectileID.GeyserTrap : ModContent.ProjectileType<BrimstoneFire>();
float randomVelocity = Main.rand.NextFloat() + 0.5f;
int proj = Projectile.NewProjectile((float)(i * 16), (float)(j * 16), 0f, -8f * randomVelocity, projectileType, 20, 2f, Main.myPlayer, 0f, 0f);
Main.projectile[proj].friendly = false;
float ai0 = 0f;
if (type == ModContent.TileType<BrimstoneSlag>() || type == ModContent.TileType<CharredOre>())
ai0 = 1f;
int projectileType = ModContent.ProjectileType<GeyserTelegraph>();
int proj = Projectile.NewProjectile((float)(i * 16), (float)(j * 16), 0f, 0f, projectileType, 0, 0f, Main.myPlayer, ai0, 0f);
Main.projectile[proj].netUpdate = true;
}
}