Files
CalamityModPublic/Items/Weapons/Ranged/TrueConferenceCall.cs
T
Andrew Marheine 486604f9b3 1 - Removed Rare Variant rarity, replaced with Challenge Drop tooltip.
2 - Replaced Pharaoh Set in Pyramids with a Ruby Hook via IL Editing.
3 - Gave several split projectiles homing a set time after the primary projectile splits, these projectiles deal no damage for a short time and then begin homing once that time has passed.
4 - Reduced Rocket III and Rocket IV damage by 25%, buffed low damage launchers a bit to compensate.
5 - Reverted the nerf made to Snowman Cannon.
6 - Adjusted Scorpio to be a burst-fire weapon.
7 - Increased homing speed for many weapons but reduced homing range.
8 - Reworked Conference Call to target up to 12 enemies on your screen and fire bullets from the sky towards them.
9 - Crown Jewel and Teardrop Cleaver are now Challenge Drops.
10 - Magic Mirror, Ice Mirror, Recall Potions and Cell Phone have a tooltip to state that they can't be used during boss fights.
11 - Reduced Bohldohr damage and made them spawn more often.
12 - Adjusted Gem Crawler spawn rates.
13 - Earth Elemental drop pool changes and made them non-hostile and non-damageable unless approached.
14 - Providence no longer fires additional stars directly at the player given her guardians are alive and she's not at low HP.
15 - Pillar event spawns are now tiered, weaker enemies spawn while the shield is at high HP and more difficult enemies spawn as the HP lowers.
16 - Demon Altars drop 6 Souls of Night upon being broken.
17 - Added recipes for Pharaoh Set pieces.
2021-04-05 18:47:55 -05:00

111 lines
3.9 KiB
C#

using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Ranged
{
public class TrueConferenceCall : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Conference Call");
Tooltip.SetDefault("@everyone");
}
public override void SetDefaults()
{
item.damage = 40;
item.ranged = true;
item.width = 66;
item.height = 26;
item.useTime = 26;
item.useAnimation = 26;
item.useStyle = ItemUseStyleID.HoldingOut;
item.noMelee = true;
item.knockBack = 4.5f;
item.value = Item.buyPrice(0, 95, 0, 0);
item.rare = ItemRarityID.Cyan;
item.UseSound = SoundID.Item38;
item.autoReuse = true;
item.shootSpeed = 12f;
item.shoot = ProjectileID.PurificationPowder;
item.useAmmo = AmmoID.Bullet;
item.Calamity().challengeDrop = true;
}
public override Vector2? HoldoutOffset()
{
return new Vector2(-10, 0);
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
int maxTargets = 12;
int[] targets = new int[maxTargets];
int targetArrayIndex = 0;
Rectangle rectangle = new Rectangle((int)player.Center.X - 960, (int)player.Center.Y - 540, 1920, 1080);
for (int i = 0; i < Main.maxNPCs; i++)
{
NPC npc = Main.npc[i];
if (npc.active && npc.chaseable && npc.lifeMax > 5 && !npc.dontTakeDamage && !npc.friendly && !npc.immortal)
{
if (npc.Hitbox.Intersects(rectangle))
{
if (targetArrayIndex < maxTargets)
{
targets[targetArrayIndex] = i;
targetArrayIndex++;
}
else
break;
}
}
}
Vector2 velocity = new Vector2(speedX, speedY);
int bulletAmt = 5;
for (int index = 0; index < bulletAmt; ++index)
{
velocity.X += Main.rand.Next(-15, 16) * 0.05f;
velocity.Y += Main.rand.Next(-15, 16) * 0.05f;
int proj = Projectile.NewProjectile(position, velocity, type, damage, knockBack, player.whoAmI);
Main.projectile[proj].extraUpdates += 2;
}
float num72 = item.shootSpeed;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
float num78 = Main.mouseX + Main.screenPosition.X - vector2.X;
float num79 = Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (player.gravDir == -1f)
num79 = Main.screenPosition.Y + Main.screenHeight - Main.mouseY - vector2.Y;
float num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79);
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
{
num78 = player.direction;
num79 = 0f;
num80 = num72;
}
else
num80 = num72 / num80;
for (int j = 0; j < targetArrayIndex; j++)
{
vector2 = new Vector2(player.position.X + player.width * 0.5f + (Main.rand.Next(201) * -(float)player.direction) + (Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y - 600f);
vector2.X = (vector2.X + player.Center.X) / 2f + Main.rand.Next(-200, 201);
vector2.Y -= 100 * j;
Vector2 velocity2 = Vector2.Normalize(Main.npc[targets[j]].Center - vector2) * item.shootSpeed;
int proj = Projectile.NewProjectile(vector2, velocity2, type, damage, knockBack, player.whoAmI);
Main.projectile[proj].extraUpdates += 2;
Main.projectile[proj].tileCollide = false;
Main.projectile[proj].timeLeft /= 2;
}
return false;
}
}
}