added plantation staff

This commit is contained in:
termigator1359 committed 2019-12-30 08:58:07 -05:00
1 parent 031f3aab72
commit cf9b40e8da
14 files changed
+801

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Summon
{
public class PlantationBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Plantation");
Description.SetDefault("The miniature plantera will protect you");
Main.buffNoTimeDisplay[Type] = true;
Main.buffNoSave[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
CalamityPlayer modPlayer = player.Calamity();
if (player.ownedProjectileCounts[ModContent.ProjectileType<PlantSummon>()] > 0)
{
modPlayer.plantera = true;
}
if (!modPlayer.plantera)
{
player.DelBuff(buffIndex);
buffIndex--;
}
else
{
player.buffTime[buffIndex] = 18000;
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 621 B

+2
View File
@@ -642,6 +642,7 @@ namespace CalamityMod.CalPlayer
public bool cLamp = false;
public bool pGuy = false;
public bool sandnado = false;
public bool plantera = false;
public bool gDefense = false;
public bool gOffense = false;
public bool gHealer = false;
@@ -1385,6 +1386,7 @@ namespace CalamityMod.CalPlayer
sCrystal = false;
sGod = false;
sandnado = false;
plantera = false;
vUrchin = false;
cSpirit = false;
rOrb = false;
+120
View File
@@ -0,0 +1,120 @@
using CalamityMod.Projectiles.Summon;
using CalamityMod.Items.Materials;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Summon
{
public class PlantationStaff : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Plantation Staff");
Tooltip.SetDefault("Summons a miniature plantera to protect you\n" +
"Fires seeds and spiky balls from afar to poison targets\n" +
"Enrages when you get under 50% health and begins ramming enemies\n" +
"Occupies 2 minion slots and there can only be one");
}
public override void SetDefaults()
{
item.damage = 60;
item.mana = 10;
item.width = 66;
item.height = 70;
item.useTime = 36;
item.useAnimation = 36;
item.useStyle = 1;
item.noMelee = true;
item.knockBack = 1f;
item.value = Item.buyPrice(0, 80, 0, 0);
item.rare = 8;
item.UseSound = SoundID.Item76;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<PlantSummon>();
item.shootSpeed = 10f;
item.summon = true;
}
public override bool CanUseItem(Player player)
{
for (int i = 0; i < Main.maxProjectiles; i++)
{
Projectile p = Main.projectile[i];
if (p.active && p.type == ModContent.ProjectileType<PlantSummon>() && p.owner == player.whoAmI)
{
return false;
}
}
return true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<LivingShard>(), 10);
recipe.AddIngredient(ModContent.ItemType<BlightedEyeStaff>());
recipe.AddIngredient(ModContent.ItemType<DeepseaStaff>());
recipe.AddIngredient(ItemID.OpticStaff);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
public override bool AltFunctionUse(Player player)
{
return true;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (player.altFunctionUse != 2)
{
int i = Main.myPlayer;
float num72 = item.shootSpeed;
float num74 = knockBack;
num74 = player.GetWeaponKnockback(item, num74);
player.itemTime = item.useTime;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (player.gravDir == -1f)
{
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
}
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
{
num78 = (float)player.direction;
num79 = 0f;
num80 = num72;
}
else
{
num80 = num72 / num80;
}
num78 *= num80;
num79 *= num80;
vector2.X = (float)Main.mouseX + Main.screenPosition.X;
vector2.Y = (float)Main.mouseY + Main.screenPosition.Y;
Vector2 spinningpoint = new Vector2(num78, num79);
spinningpoint = spinningpoint.RotatedBy(1.5707963705062866, default);
Projectile.NewProjectile(vector2.X + spinningpoint.X, vector2.Y + spinningpoint.Y, spinningpoint.X, spinningpoint.Y, type, damage, num74, i, 0f, 0f);
}
return false;
}
public override bool UseItem(Player player)
{
if (player.altFunctionUse == 2)
{
player.MinionNPCTargetAim();
}
return base.UseItem(player);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+1
View File
@@ -765,6 +765,7 @@ namespace CalamityMod
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<DeepseaStaff>(), ModContent.BuffType<AquaticStar>(), ModContent.ProjectileType<AquaticStarMinion>());
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<SunGodStaff>(), ModContent.BuffType<SolarSpiritGod>(), ModContent.ProjectileType<SolarGod>());
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<BlightedEyeStaff>(), ModContent.BuffType<CalamitasEyes>(), new List<int>() {ModContent.ProjectileType<Calamitamini>(), ModContent.ProjectileType<Cataclymini>(), ModContent.ProjectileType<Catastromini>()}, new List<float>() {(1f-0.6666666f), 0.3333333f, 0.3333333f}); //Entropy's Vigil is a bruh moment
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<PlantationStaff>(), ModContent.BuffType<PlantationBuff>(), ModContent.ProjectileType<PlantSummon>());
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<ResurrectionButterfly>(), ModContent.BuffType<ResurrectionButterflyBuff>(), new List<int>() {ModContent.ProjectileType<PinkButterfly>(), ModContent.ProjectileType<PurpleButterfly>()});
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<SandSharknadoStaff>(), ModContent.BuffType<Sandnado>(), ModContent.ProjectileType<SandnadoMinion>());
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<ElementalAxe>(), ModContent.BuffType<ElementalAxeBuff>(), ModContent.ProjectileType<ElementalAxeMinion>());
+59
View File
@@ -0,0 +1,59 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class PlantSeed : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Seed");
Main.projFrames[projectile.type] = 2;
}
public override void SetDefaults()
{
projectile.width = 14;
projectile.height = 14;
projectile.light = 0.5f;
projectile.alpha = 255;
projectile.extraUpdates = 2;
projectile.tileCollide = false;
projectile.friendly = true;
projectile.minion = true;
projectile.minionSlots = 0f;
projectile.ignoreWater = true;
projectile.aiStyle = 1;
aiType = 242;
projectile.penetrate = 1;
projectile.timeLeft = 600;
}
public override void AI()
{
projectile.frameCounter++;
if (projectile.frameCounter > 8)
{
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame >= 2)
{
projectile.frame = 0;
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
return false;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.Poisoned, 60);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

+59
View File
@@ -0,0 +1,59 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class PlantSeedGreen : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Seed");
Main.projFrames[projectile.type] = 2;
}
public override void SetDefaults()
{
projectile.width = 14;
projectile.height = 14;
projectile.light = 0.5f;
projectile.alpha = 255;
projectile.extraUpdates = 3;
projectile.tileCollide = false;
projectile.friendly = true;
projectile.minion = true;
projectile.minionSlots = 0f;
projectile.ignoreWater = true;
projectile.aiStyle = 1;
aiType = 242;
projectile.penetrate = 1;
projectile.timeLeft = 600;
}
public override void AI()
{
projectile.frameCounter++;
if (projectile.frameCounter > 8)
{
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame >= 2)
{
projectile.frame = 0;
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
return false;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.Poisoned, 180);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 389 B

+466
View File
@@ -0,0 +1,466 @@
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class PlantSummon : ModProjectile
{
private bool enraged = false;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Plantera");
Main.projFrames[projectile.type] = 8;
ProjectileID.Sets.MinionSacrificable[projectile.type] = true;
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
}
public override void SetDefaults()
{
projectile.width = 38;
projectile.height = 38;
projectile.netImportant = true;
projectile.friendly = true;
projectile.ignoreWater = true;
projectile.minionSlots = 2f;
projectile.timeLeft = 18000;
projectile.penetrate = -1;
projectile.tileCollide = false;
projectile.timeLeft *= 5;
projectile.minion = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 15;
projectile.extraUpdates = 0;
}
public override void AI()
{
Player player = Main.player[projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
if (player.statLife <= (int)((double)player.statLifeMax2 * 0.5))
{
if (Main.myPlayer == projectile.owner)
{
enraged = true;
}
}
else
{
enraged = false;
projectile.extraUpdates = 0;
}
projectile.frameCounter++;
if (projectile.frameCounter > 8)
{
projectile.frame++;
projectile.frameCounter = 0;
}
if (!enraged)
{
if (projectile.frame >= 4)
{
projectile.frame = 0;
}
}
else
{
if (projectile.frame >= 8)
{
projectile.frame = 4;
}
}
if (projectile.localAI[0] == 0f)
{
projectile.Calamity().spawnedPlayerMinionDamageValue = player.minionDamage;
projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage;
int num226 = 36;
for (int num227 = 0; num227 < num226; num227++)
{
Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f;
vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center;
Vector2 vector7 = vector6 - projectile.Center;
int num228 = Dust.NewDust(vector6 + vector7, 0, 0, 44, vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f);
Main.dust[num228].noGravity = true;
Main.dust[num228].velocity = vector7;
}
projectile.localAI[0] += 1f;
}
if (player.minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue)
{
int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue /
projectile.Calamity().spawnedPlayerMinionDamageValue *
player.minionDamage);
projectile.damage = damage2;
}
bool flag64 = projectile.type == ModContent.ProjectileType<PlantSummon>();
player.AddBuff(ModContent.BuffType<PlantationBuff>(), 3600);
if (flag64)
{
if (player.dead)
{
modPlayer.plantera = false;
}
if (modPlayer.plantera)
{
projectile.timeLeft = 2;
}
}
float num633 = 700f;
float num634 = 1300f;
float num635 = 2600f;
float num636 = 600f;
float num637 = 0.05f;
//idle movement
for (int num638 = 0; num638 < 1000; num638++)
{
bool flag23 = Main.projectile[num638].type == ModContent.ProjectileType<PlantSummon>();
if (num638 != projectile.whoAmI && Main.projectile[num638].active && Main.projectile[num638].owner == projectile.owner && flag23 && Math.Abs(projectile.position.X - Main.projectile[num638].position.X) + Math.Abs(projectile.position.Y - Main.projectile[num638].position.Y) < (float)projectile.width)
{
if (projectile.position.X < Main.projectile[num638].position.X)
{
projectile.velocity.X = projectile.velocity.X - num637;
}
else
{
projectile.velocity.X = projectile.velocity.X + num637;
}
if (projectile.position.Y < Main.projectile[num638].position.Y)
{
projectile.velocity.Y = projectile.velocity.Y - num637;
}
else
{
projectile.velocity.Y = projectile.velocity.Y + num637;
}
}
}
bool flag24 = false;
if (enraged)
{
if (projectile.ai[0] == 2f)
{
projectile.ai[1] += 1f;
projectile.extraUpdates = 1;
if (projectile.ai[1] > 30f)
{
projectile.ai[1] = 1f;
projectile.ai[0] = 0f;
projectile.extraUpdates = 0;
projectile.numUpdates = 0;
projectile.netUpdate = true;
}
else
{
flag24 = true;
}
}
if (flag24)
{
return;
}
Vector2 vector46 = projectile.position;
bool flag25 = false;
if (player.HasMinionAttackTargetNPC)
{
NPC npc = Main.npc[player.MinionAttackTargetNPC];
if (npc.CanBeChasedBy(projectile, false))
{
float num646 = Vector2.Distance(npc.Center, projectile.Center);
if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25)
{
num633 = num646;
vector46 = npc.Center;
flag25 = true;
}
}
}
else
{
for (int num645 = 0; num645 < 200; num645++)
{
NPC nPC2 = Main.npc[num645];
if (nPC2.CanBeChasedBy(projectile, false))
{
float num646 = Vector2.Distance(nPC2.Center, projectile.Center);
if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25)
{
num633 = num646;
vector46 = nPC2.Center;
flag25 = true;
}
}
}
}
if (flag25)
{
projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f;
}
else
{
projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f;
}
float num647 = num634;
if (flag25)
{
num647 = num635;
}
if (Vector2.Distance(player.Center, projectile.Center) > num647)
{
projectile.ai[0] = 1f;
projectile.netUpdate = true;
}
if (flag25 && projectile.ai[0] == 0f)
{
Vector2 vector47 = vector46 - projectile.Center;
float num648 = vector47.Length();
vector47.Normalize();
if (num648 > 200f)
{
float scaleFactor2 = 8f;
vector47 *= scaleFactor2;
projectile.velocity = (projectile.velocity * 40f + vector47) / 41f;
}
else
{
float num649 = 4f;
vector47 *= -num649;
projectile.velocity = (projectile.velocity * 40f + vector47) / 41f;
}
}
else
{
bool flag26 = false;
if (!flag26)
{
flag26 = projectile.ai[0] == 1f;
}
float num650 = 6f;
if (flag26)
{
num650 = 15f;
}
Vector2 center2 = projectile.Center;
Vector2 vector48 = player.Center - center2 + new Vector2(0f, -60f);
float num651 = vector48.Length();
if (num651 > 200f && num650 < 8f)
{
num650 = 8f;
}
if (num651 < num636 && flag26 && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height))
{
projectile.ai[0] = 0f;
projectile.netUpdate = true;
}
if (num651 > 2000f)
{
projectile.position.X = player.Center.X - (float)(projectile.width / 2);
projectile.position.Y = player.Center.Y - (float)(projectile.height / 2);
projectile.netUpdate = true;
}
if (num651 > 70f)
{
vector48.Normalize();
vector48 *= num650;
projectile.velocity = (projectile.velocity * 40f + vector48) / 41f;
}
else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f)
{
projectile.velocity.X = -0.15f;
projectile.velocity.Y = -0.05f;
}
}
if (projectile.ai[1] > 0f)
{
projectile.ai[1] += (float)Main.rand.Next(1, 4);
}
if (projectile.ai[1] > 40f)
{
projectile.ai[1] = 0f;
projectile.netUpdate = true;
}
if (projectile.ai[0] == 0f)
{
if (projectile.ai[1] == 0f && flag25 && num633 < 500f)
{
projectile.ai[1] += 1f;
if (Main.myPlayer == projectile.owner)
{
projectile.ai[0] = 2f;
Vector2 value20 = vector46 - projectile.Center;
value20.Normalize();
if (Main.rand.NextBool(3))
{
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value20.X, value20.Y, ModContent.ProjectileType<PlantThornBall>(), (int)(projectile.damage * 1.2f), 0f, Main.myPlayer, 0f, 0f);
}
projectile.velocity = value20 * 8f;
projectile.netUpdate = true;
}
}
}
}
else //if not enraged
{
Vector2 vector46 = projectile.position;
bool flag25 = false;
if (player.HasMinionAttackTargetNPC)
{
NPC npc = Main.npc[player.MinionAttackTargetNPC];
if (npc.CanBeChasedBy(projectile, false))
{
float num646 = Vector2.Distance(npc.Center, projectile.Center);
if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25)
{
vector46 = npc.Center;
flag25 = true;
}
}
}
else
{
for (int num645 = 0; num645 < 200; num645++)
{
NPC nPC2 = Main.npc[num645];
if (nPC2.CanBeChasedBy(projectile, false))
{
float num646 = Vector2.Distance(nPC2.Center, projectile.Center);
if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25)
{
num633 = num646;
vector46 = nPC2.Center;
flag25 = true;
}
}
}
}
float num647 = num634;
if (flag25)
{
num647 = num635;
}
if (Vector2.Distance(player.Center, projectile.Center) > num647)
{
projectile.ai[0] = 1f;
projectile.netUpdate = true;
}
if (flag25 && projectile.ai[0] == 0f)
{
Vector2 vector47 = vector46 - projectile.Center;
float num648 = vector47.Length();
vector47.Normalize();
if (num648 > 200f)
{
float scaleFactor2 = 18f; //12
vector47 *= scaleFactor2;
projectile.velocity = (projectile.velocity * 40f + vector47) / 41f;
}
else
{
float num649 = 9f;
vector47 *= -num649;
projectile.velocity = (projectile.velocity * 40f + vector47) / 41f;
}
}
else
{
bool flag26 = false;
if (!flag26)
{
flag26 = projectile.ai[0] == 1f;
}
float num650 = 12f;
if (flag26)
{
num650 = 30f;
}
Vector2 center2 = projectile.Center;
Vector2 vector48 = player.Center - center2 + new Vector2(0f, -120f);
float num651 = vector48.Length();
if (num651 > 200f && num650 < 16f)
{
num650 = 16f;
}
if (num651 < num636 && flag26)
{
projectile.ai[0] = 0f;
projectile.netUpdate = true;
}
if (num651 > 2000f)
{
projectile.position.X = player.Center.X - (float)(projectile.width / 2);
projectile.position.Y = player.Center.Y - (float)(projectile.height / 2);
projectile.netUpdate = true;
}
if (num651 > 70f)
{
vector48.Normalize();
vector48 *= num650;
projectile.velocity = (projectile.velocity * 40f + vector48) / 41f;
}
else if (projectile.velocity.X == 0f && projectile.velocity.Y == 0f)
{
projectile.velocity.X = -0.15f;
projectile.velocity.Y = -0.05f;
}
}
if (flag25)
{
projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f;
}
else
{
projectile.rotation = projectile.velocity.ToRotation() + 3.14159274f;
}
if (projectile.ai[1] > 0f)
{
projectile.ai[1] += (float)Main.rand.Next(1, 4);
}
if (projectile.ai[1] > 90f)
{
projectile.ai[1] = 0f;
projectile.netUpdate = true;
}
if (projectile.ai[0] == 0f)
{
float scaleFactor3 = 6f;
int num658 = (Main.rand.NextBool(2) ? ModContent.ProjectileType<PlantSeedGreen>() : ModContent.ProjectileType<PlantSeed>());
int projDmg = (int)(projectile.damage * 0.7f);
if (Main.rand.NextBool(4))
{
num658 = ModContent.ProjectileType<PlantThornBall>();
projDmg = (int)(projectile.damage * 1.2f)
}
if (flag25 && projectile.ai[1] == 0f)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 20);
projectile.ai[1] += 1f;
if (Main.myPlayer == projectile.owner)
{
Vector2 value19 = vector46 - projectile.Center;
value19.Normalize();
value19 *= scaleFactor3;
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projDmg, 0f, Main.myPlayer, 0f, 0f);
projectile.netUpdate = true;
}
}
}
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.Poisoned, 300);
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

+58
View File
@@ -0,0 +1,58 @@
using CalamityMod.Projectiles.Typeless;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Summon
{
public class PlantThornBall : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Thorn Ball");
}
public override void SetDefaults()
{
projectile.width = 30;
projectile.height = 30;
projectile.scale = 0.75f;
projectile.friendly = true;
projectile.penetrate = 3;
projectile.timeLeft = 300;
projectile.minion = true;
projectile.aiStyle = 14;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
projectile.extraUpdates = 1;
}
public override void AI()
{
if (Main.rand.NextBool(12))
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
}
public override bool OnTileCollide(Vector2 oldVelocity)
{
if (projectile.velocity.X != oldVelocity.X)
{
projectile.velocity.X = -oldVelocity.X * 1.001f;
}
if (projectile.velocity.Y != oldVelocity.Y)
{
projectile.velocity.Y = -oldVelocity.Y * 1.001f;
}
return false;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.Poisoned, 180);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B