Gave Flesh Ball AI some powerful drugs

This commit is contained in:
Dominic committed 2020-12-19 01:31:03 -06:00
1 parent 031e05f105
commit 124b747517
2 files changed
+12 -13

No files matched your search

+2 -2
View File
@@ -1,8 +1,6 @@
using Terraria.ModLoader;
using Terraria.ID;
using Terraria;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using TerrariaAudio = Terraria.Audio;
using CalamityMod.Items.Materials;
@@ -27,6 +25,8 @@ namespace CalamityMod.Items.Weapons.Summon
item.knockBack = 1f;
item.value = CalamityGlobalItem.Rarity3BuyPrice;
item.rare = ItemRarityID.Orange;
// SoundID has no Zombie24 sound instance, so we must create one ourselves.
item.UseSound = new TerrariaAudio.LegacySoundStyle(SoundID.Zombie, 24, TerrariaAudio.SoundType.Sound);
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<FleshBallMinion>();
+10 -11
View File
@@ -114,26 +114,25 @@ namespace CalamityMod.Projectiles.Summon
{
projectile.tileCollide = true;
bool closeToTarget = projectile.WithinRange(target.Center, 300f);
if (SittingOnGround && HopTimer % 20f == 19f)
{
if (!closeToTarget)
{
projectile.velocity = projectile.DirectionTo(Owner.Center) * 6f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -4f);
projectile.velocity = projectile.DirectionTo(target.Center) * 6f + new Vector2(Math.Sign(projectile.velocity.X) * 2f, -4f);
// Don't collide with tiles for 1 frame, to prevent slopes from being a nuisance.
projectile.tileCollide = false;
projectile.netUpdate = true;
}
// Don't collide with tiles for 1 frame, to prevent slopes from being a nuisance.
projectile.tileCollide = false;
projectile.netUpdate = true;
// Release a bunch of blood.
else if (Main.myPlayer == projectile.owner)
if (Main.myPlayer == projectile.owner)
{
for (int i = 0; i < Main.rand.Next(1, 3 + 1); i++)
for (int i = 0; i < Main.rand.Next(1, 4 + 1); i++)
{
Vector2 shootVelocity = -Vector2.UnitY.RotatedByRandom(0.3f);
Vector2 shootVelocity = -Vector2.UnitY.RotatedByRandom(0.3f) * Main.rand.NextFloat(6f, 11f);
int blood = Projectile.NewProjectile(projectile.Top, shootVelocity, ModContent.ProjectileType<Blood2>(), projectile.damage, projectile.knockBack, projectile.owner);
if (Main.projectile.IndexInRange(blood))
{
Main.projectile[blood].Calamity().forceMinion = true;
Main.projectile[blood].penetrate = 1;
}
}
}
}