changes to some minions
This commit is contained in:
1 parent
37349b8f92
commit
e2ec97acb6
16 files changed
+373
-76
No files matched your search
@@ -49,12 +49,6 @@ namespace CalamityMod.Projectiles.Magic
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int fire = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<HellfireExplosionFriendly>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
// protection against projectile cap
|
||||
if (projectile.minion && fire < Main.maxProjectiles)
|
||||
{
|
||||
Main.projectile[fire].Calamity().forceMinion = true;
|
||||
ProjectileID.Sets.MinionShot[Main.projectile[fire].type] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,21 +40,20 @@ namespace CalamityMod.Projectiles.Magic
|
||||
float num93 = projectile.velocity.X / 3f * (float)num92;
|
||||
float num94 = projectile.velocity.Y / 3f * (float)num92;
|
||||
int num95 = 4;
|
||||
int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 174, 0f, 0f, 100, default, 1.2f);
|
||||
Main.dust[num96].noGravity = true;
|
||||
Main.dust[num96].velocity *= 0.1f;
|
||||
Main.dust[num96].velocity += projectile.velocity * 0.1f;
|
||||
Dust expr_47FA_cp_0 = Main.dust[num96];
|
||||
expr_47FA_cp_0.position.X -= num93;
|
||||
Dust expr_4815_cp_0 = Main.dust[num96];
|
||||
expr_4815_cp_0.position.Y -= num94;
|
||||
int fireDust = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 174, 0f, 0f, 100, default, 1.2f);
|
||||
Dust dust = Main.dust[fireDust];
|
||||
dust.noGravity = true;
|
||||
dust.velocity *= 0.1f;
|
||||
dust.velocity += projectile.velocity * 0.1f;
|
||||
dust.position.X -= num93;
|
||||
dust.position.Y -= num94;
|
||||
}
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
int num97 = 4;
|
||||
int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 174, 0f, 0f, 100, default, 0.6f);
|
||||
Main.dust[num98].velocity *= 0.25f;
|
||||
Main.dust[num98].velocity += projectile.velocity * 0.5f;
|
||||
int fireDustSmol = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 174, 0f, 0f, 100, default, 0.6f);
|
||||
Main.dust[fireDustSmol].velocity *= 0.25f;
|
||||
Main.dust[fireDustSmol].velocity += projectile.velocity * 0.5f;
|
||||
}
|
||||
projectile.rotation += 0.3f * (float)projectile.direction;
|
||||
}
|
||||
|
||||
@@ -40,42 +40,40 @@ namespace CalamityMod.Projectiles.Magic
|
||||
float num93 = projectile.velocity.X / 3f * (float)num92;
|
||||
float num94 = projectile.velocity.Y / 3f * (float)num92;
|
||||
int num95 = 4;
|
||||
int num96 = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 174, 0f, 0f, 100, default, 1.2f);
|
||||
Main.dust[num96].noGravity = true;
|
||||
Main.dust[num96].velocity *= 0.1f;
|
||||
Main.dust[num96].velocity += projectile.velocity * 0.1f;
|
||||
Dust expr_47FA_cp_0 = Main.dust[num96];
|
||||
expr_47FA_cp_0.position.X -= num93;
|
||||
Dust expr_4815_cp_0 = Main.dust[num96];
|
||||
expr_4815_cp_0.position.Y -= num94;
|
||||
int fireDust = Dust.NewDust(new Vector2(projectile.position.X + (float)num95, projectile.position.Y + (float)num95), projectile.width - num95 * 2, projectile.height - num95 * 2, 174, 0f, 0f, 100, default, 1.2f);
|
||||
Dust dust = Main.dust[fireDust];
|
||||
dust.noGravity = true;
|
||||
dust.velocity *= 0.1f;
|
||||
dust.velocity += projectile.velocity * 0.1f;
|
||||
dust.position.X -= num93;
|
||||
dust.position.Y -= num94;
|
||||
}
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
int num97 = 4;
|
||||
int num98 = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 174, 0f, 0f, 100, default, 0.6f);
|
||||
Main.dust[num98].velocity *= 0.25f;
|
||||
Main.dust[num98].velocity += projectile.velocity * 0.5f;
|
||||
int fireDustSmol = Dust.NewDust(new Vector2(projectile.position.X + (float)num97, projectile.position.Y + (float)num97), projectile.width - num97 * 2, projectile.height - num97 * 2, 174, 0f, 0f, 100, default, 0.6f);
|
||||
Main.dust[fireDustSmol].velocity *= 0.25f;
|
||||
Main.dust[fireDustSmol].velocity += projectile.velocity * 0.5f;
|
||||
}
|
||||
for (int num105 = 0; num105 < 2; num105++)
|
||||
{
|
||||
float num99 = projectile.velocity.X / 3f * (float)num105;
|
||||
float num100 = projectile.velocity.Y / 3f * (float)num105;
|
||||
int num101 = 4;
|
||||
int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 92, 0f, 0f, 100, default, 1.2f);
|
||||
Main.dust[num102].noGravity = true;
|
||||
Main.dust[num102].velocity *= 0.1f;
|
||||
Main.dust[num102].velocity += projectile.velocity * 0.1f;
|
||||
Dust expr_47FA_cp_0 = Main.dust[num102];
|
||||
expr_47FA_cp_0.position.X -= num99;
|
||||
Dust expr_4815_cp_0 = Main.dust[num102];
|
||||
expr_4815_cp_0.position.Y -= num100;
|
||||
int frostDust = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 92, 0f, 0f, 100, default, 1.2f);
|
||||
Dust dust = Main.dust[frostDust];
|
||||
dust.noGravity = true;
|
||||
dust.velocity *= 0.1f;
|
||||
dust.velocity += projectile.velocity * 0.1f;
|
||||
dust.position.X -= num99;
|
||||
dust.position.Y -= num100;
|
||||
}
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
int num103 = 4;
|
||||
int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 92, 0f, 0f, 100, default, 0.6f);
|
||||
Main.dust[num104].velocity *= 0.25f;
|
||||
Main.dust[num104].velocity += projectile.velocity * 0.5f;
|
||||
int frostDustSmol = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 92, 0f, 0f, 100, default, 0.6f);
|
||||
Main.dust[frostDustSmol].velocity *= 0.25f;
|
||||
Main.dust[frostDustSmol].velocity += projectile.velocity * 0.5f;
|
||||
}
|
||||
projectile.rotation += 0.3f * (float)projectile.direction;
|
||||
}
|
||||
|
||||
@@ -41,21 +41,20 @@ namespace CalamityMod.Projectiles.Magic
|
||||
float num99 = projectile.velocity.X / 3f * (float)num105;
|
||||
float num100 = projectile.velocity.Y / 3f * (float)num105;
|
||||
int num101 = 4;
|
||||
int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 92, 0f, 0f, 100, default, 1.2f);
|
||||
Main.dust[num102].noGravity = true;
|
||||
Main.dust[num102].velocity *= 0.1f;
|
||||
Main.dust[num102].velocity += projectile.velocity * 0.1f;
|
||||
Dust expr_47FA_cp_0 = Main.dust[num102];
|
||||
expr_47FA_cp_0.position.X -= num99;
|
||||
Dust expr_4815_cp_0 = Main.dust[num102];
|
||||
expr_4815_cp_0.position.Y -= num100;
|
||||
int frostDust = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 92, 0f, 0f, 100, default, 1.2f);
|
||||
Dust dust = Main.dust[frostDust];
|
||||
dust.noGravity = true;
|
||||
dust.velocity *= 0.1f;
|
||||
dust.velocity += projectile.velocity * 0.1f;
|
||||
dust.position.X -= num99;
|
||||
dust.position.Y -= num100;
|
||||
}
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
int num103 = 4;
|
||||
int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 92, 0f, 0f, 100, default, 0.6f);
|
||||
Main.dust[num104].velocity *= 0.25f;
|
||||
Main.dust[num104].velocity += projectile.velocity * 0.5f;
|
||||
int frostDustSmol = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 92, 0f, 0f, 100, default, 0.6f);
|
||||
Main.dust[frostDustSmol].velocity *= 0.25f;
|
||||
Main.dust[frostDustSmol].velocity += projectile.velocity * 0.5f;
|
||||
}
|
||||
projectile.rotation += 0.3f * (float)projectile.direction;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.aiStyle = 1;
|
||||
projectile.coldDamage = true;
|
||||
projectile.friendly = true;
|
||||
projectile.minion = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.Calamity().rogue = true;
|
||||
projectile.coldDamage = true;
|
||||
|
||||
@@ -49,8 +49,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
vel.X += Main.rand.Next(-50, 51);
|
||||
vel.Normalize();
|
||||
vel *= 30f;
|
||||
int p = Projectile.NewProjectile(pos, vel + projectile.velocity / 4f, ModContent.ProjectileType<FrostShardFriendly>(), projectile.damage, projectile.knockBack, projectile.owner);
|
||||
Main.projectile[p].minion = false;
|
||||
Projectile.NewProjectile(pos, vel + projectile.velocity / 4f, ModContent.ProjectileType<FrostShardFriendly>(), projectile.damage, projectile.knockBack, projectile.owner);
|
||||
}
|
||||
|
||||
int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 172);
|
||||
@@ -73,8 +72,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
vel.X += Main.rand.Next(-50, 51);
|
||||
vel.Normalize();
|
||||
vel *= 30f;
|
||||
int p = Projectile.NewProjectile(pos, vel + Main.npc[id].velocity, ModContent.ProjectileType<FrostShardFriendly>(), projectile.damage, projectile.knockBack, projectile.owner);
|
||||
Main.projectile[p].minion = false;
|
||||
Projectile.NewProjectile(pos, vel + Main.npc[id].velocity, ModContent.ProjectileType<FrostShardFriendly>(), projectile.damage, projectile.knockBack, projectile.owner);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
@@ -224,7 +223,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
float scaleFactor3 = 14f;
|
||||
int num658 = ModContent.ProjectileType<BrimstoneHellfireballFriendly>();
|
||||
int num658 = ModContent.ProjectileType<BrimstoneFireballMinion>();
|
||||
if (flag25 && projectile.ai[1] == 0f)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
@@ -233,14 +232,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Vector2 value19 = vector46 - projectile.Center;
|
||||
value19.Normalize();
|
||||
value19 *= scaleFactor3;
|
||||
int fire = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projectile.damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
// protection against projectile cap
|
||||
if (fire < Main.maxProjectiles)
|
||||
{
|
||||
Main.projectile[fire].timeLeft = 200;
|
||||
Main.projectile[fire].Calamity().forceMinion = true;
|
||||
ProjectileID.Sets.MinionShot[Main.projectile[fire].type] = true;
|
||||
}
|
||||
int fire = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projectile.damage, 0f, projectile.owner, 0f, 0f);
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class BrimstoneExplosionMinion : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Explosion");
|
||||
ProjectileID.Sets.MinionShot[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 130;
|
||||
projectile.height = 130;
|
||||
projectile.friendly = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.timeLeft = 180;
|
||||
projectile.minion = true;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.9f, 0f, 0f);
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
|
||||
projectile.localAI[0] += 1f;
|
||||
}
|
||||
float num461 = 25f;
|
||||
if (projectile.ai[0] > 180f)
|
||||
{
|
||||
num461 -= (projectile.ai[0] - 180f) / 2f;
|
||||
}
|
||||
if (num461 <= 0f)
|
||||
{
|
||||
num461 = 0f;
|
||||
projectile.Kill();
|
||||
}
|
||||
num461 *= 0.7f;
|
||||
projectile.ai[0] += 4f;
|
||||
int num462 = 0;
|
||||
while ((float)num462 < num461)
|
||||
{
|
||||
float num463 = (float)Main.rand.Next(-10, 11);
|
||||
float num464 = (float)Main.rand.Next(-10, 11);
|
||||
float num465 = (float)Main.rand.Next(3, 9);
|
||||
float num466 = (float)Math.Sqrt((double)(num463 * num463 + num464 * num464));
|
||||
num466 = num465 / num466;
|
||||
num463 *= num466;
|
||||
num464 *= num466;
|
||||
int num467 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1.5f);
|
||||
Dust dust = Main.dust[num467];
|
||||
dust.noGravity = true;
|
||||
dust.position.X = projectile.Center.X;
|
||||
dust.position.Y = projectile.Center.Y;
|
||||
dust.position.X += (float)Main.rand.Next(-10, 11);
|
||||
dust.position.Y += (float)Main.rand.Next(-10, 11);
|
||||
dust.velocity.X = num463;
|
||||
dust.velocity.Y = num464;
|
||||
num462++;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 600);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 354 B |
@@ -0,0 +1,61 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class BrimstoneFireballMinion : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Brimfire");
|
||||
ProjectileID.Sets.MinionShot[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 12;
|
||||
projectile.height = 12;
|
||||
projectile.friendly = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 200;
|
||||
projectile.penetrate = 2;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.minion = true;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.6f, 0f, 0f);
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
|
||||
projectile.localAI[0] += 1f;
|
||||
}
|
||||
for (int num457 = 0; num457 < 3; num457++)
|
||||
{
|
||||
int num458 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 1.5f);
|
||||
Main.dust[num458].noGravity = true;
|
||||
Main.dust[num458].velocity *= 0.5f;
|
||||
Main.dust[num458].velocity += projectile.velocity * 0.1f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int fire = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<BrimstoneExplosionMinion>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 600);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 139 B |
@@ -1,5 +1,3 @@
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -76,8 +74,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Vector2 speed = new Vector2(Main.rand.Next(-1000, 1001), Main.rand.Next(-1000, 1001));
|
||||
speed.Normalize();
|
||||
speed *= 15f;
|
||||
int shard = Projectile.NewProjectile(projectile.Center + speed, speed, ModContent.ProjectileType<FrostShardFriendly>(), projectile.damage / 2, projectile.knockBack / 2, projectile.owner);
|
||||
ProjectileID.Sets.SentryShot[Main.projectile[shard].type] = true;
|
||||
int shard = Projectile.NewProjectile(projectile.Center + speed, speed, ModContent.ProjectileType<IceSentryShard>(), projectile.damage / 2, projectile.knockBack / 2, projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,13 +116,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
speed *= 8f;
|
||||
if (projectile.ai[1] >= 300f)
|
||||
speed = speed.RotatedBy(MathHelper.ToRadians(Main.rand.Next(-5, 6))) * 1.5f + npc.velocity / 2f;
|
||||
int p = Projectile.NewProjectile(projectile.Center, speed + npc.velocity / 2f, ModContent.ProjectileType<FrostBoltProjectile>(), projectile.damage, projectile.knockBack, projectile.owner);
|
||||
if (p != 1000)
|
||||
{
|
||||
Main.projectile[p].magic = false;
|
||||
Main.projectile[p].minion = true;
|
||||
ProjectileID.Sets.SentryShot[Main.projectile[p].type] = true;
|
||||
}
|
||||
Projectile.NewProjectile(projectile.Center, speed + npc.velocity / 2f, ModContent.ProjectileType<IceSentryFrostBolt>(), projectile.damage, projectile.knockBack, projectile.owner);
|
||||
}
|
||||
|
||||
//if (!rememberTarget) Main.NewText("couldn't hit target");
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class IceSentryFrostBolt : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Ball");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 2;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
ProjectileID.Sets.SentryShot[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 16;
|
||||
projectile.height = 16;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = 2;
|
||||
projectile.timeLeft = 480;
|
||||
projectile.minion = true;
|
||||
projectile.coldDamage = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.alpha > 0)
|
||||
{
|
||||
projectile.alpha -= 25;
|
||||
if (projectile.alpha < 0)
|
||||
projectile.alpha = 0;
|
||||
}
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.01f / 255f, (255 - projectile.alpha) * 0.3f / 255f, (255 - projectile.alpha) * 0.45f / 255f);
|
||||
for (int num105 = 0; num105 < 2; num105++)
|
||||
{
|
||||
float num99 = projectile.velocity.X / 3f * (float)num105;
|
||||
float num100 = projectile.velocity.Y / 3f * (float)num105;
|
||||
int num101 = 4;
|
||||
int num102 = Dust.NewDust(new Vector2(projectile.position.X + (float)num101, projectile.position.Y + (float)num101), projectile.width - num101 * 2, projectile.height - num101 * 2, 92, 0f, 0f, 100, default, 1.2f);
|
||||
Dust dust = Main.dust[num102];
|
||||
dust.noGravity = true;
|
||||
dust.velocity *= 0.1f;
|
||||
dust.velocity += projectile.velocity * 0.1f;
|
||||
dust.position.X -= num99;
|
||||
dust.position.Y -= num100;
|
||||
}
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
int num103 = 4;
|
||||
int num104 = Dust.NewDust(new Vector2(projectile.position.X + (float)num103, projectile.position.Y + (float)num103), projectile.width - num103 * 2, projectile.height - num103 * 2, 92, 0f, 0f, 100, default, 0.6f);
|
||||
Main.dust[num104].velocity *= 0.25f;
|
||||
Main.dust[num104].velocity += projectile.velocity * 0.5f;
|
||||
}
|
||||
projectile.rotation += 0.3f * (float)projectile.direction;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 27);
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 92, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.Frostburn, 60);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 271 B |
@@ -0,0 +1,81 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class IceSentryShard : ModProjectile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 12;
|
||||
projectile.height = 12;
|
||||
projectile.aiStyle = 1;
|
||||
projectile.coldDamage = true;
|
||||
projectile.friendly = true;
|
||||
projectile.minion = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.coldDamage = true;
|
||||
}
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Frost Shard");
|
||||
Main.projFrames[projectile.type] = 5;
|
||||
ProjectileID.Sets.SentryShot[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.frameCounter++;
|
||||
if (projectile.frameCounter > 4)
|
||||
{
|
||||
projectile.frameCounter = 0;
|
||||
projectile.frame++;
|
||||
}
|
||||
|
||||
if (projectile.frame >= 5)
|
||||
projectile.frame = 0;
|
||||
|
||||
projectile.velocity.Y += 0.2f;
|
||||
if (projectile.localAI[0] == 0f || projectile.localAI[0] == 2f)
|
||||
{
|
||||
projectile.scale += 0.01f;
|
||||
projectile.alpha -= 50;
|
||||
if (projectile.alpha <= 0)
|
||||
{
|
||||
projectile.localAI[0] = 1f;
|
||||
projectile.alpha = 0;
|
||||
}
|
||||
}
|
||||
else if (projectile.localAI[0] == 1.0)
|
||||
{
|
||||
projectile.scale -= 0.01f;
|
||||
projectile.alpha += 50;
|
||||
if (projectile.alpha >= byte.MaxValue)
|
||||
{
|
||||
projectile.localAI[0] = 2f;
|
||||
projectile.alpha = byte.MaxValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(200, 200, 200, projectile.alpha);
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
Main.PlaySound(SoundID.Item27, projectile.position);
|
||||
for (int index1 = 0; index1 < 3; ++index1)
|
||||
{
|
||||
int index2 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 76);
|
||||
Main.dust[index2].noGravity = true;
|
||||
Main.dust[index2].noLight = true;
|
||||
Main.dust[index2].scale = 0.7f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 304 B |
Reference in new issue
Block a user