Siren's song emits blue instead of green light now Cosmilamps emit purple instead of red light now
123 lines
5.1 KiB
C#
123 lines
5.1 KiB
C#
using CalamityMod.Buffs.Summon;
|
|
using CalamityMod.Projectiles.Summon;
|
|
using CalamityMod.World;
|
|
using Microsoft.Xna.Framework;
|
|
using System.Collections.Generic;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Weapons.Summon
|
|
{
|
|
public class ColdDivinity : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Cold Divinity");
|
|
Tooltip.SetDefault("Legendary Drop\n" +
|
|
"Summons the power of the ancient ice castle\n" +
|
|
"For each minion slot used, you will gain an additional orbiting shield spike\n" +
|
|
"These spikes accelerate rapidly towards a nearby enemy to inflict heavy damage\n" +
|
|
"They take some time to regenerate after launching themselves at the target, however\n" +
|
|
"On right click, summons a duplicate ring around the targeted enemy, which slowly converges before exploding\n" +
|
|
"Minion damage bonuses apply to this weapon twice for more damage\n" +
|
|
"Revengeance Drop");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.damage = 60;
|
|
item.mana = 20;
|
|
item.width = 52;
|
|
item.height = 50;
|
|
item.useTime = item.useAnimation = 25;
|
|
item.useStyle = ItemUseStyleID.HoldingUp;
|
|
item.noMelee = true;
|
|
item.knockBack = 4.5f;
|
|
item.value = Item.buyPrice(0, 36, 0, 0);
|
|
item.rare = 5;
|
|
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
|
|
item.UseSound = SoundID.Item30;
|
|
item.autoReuse = true;
|
|
item.shoot = ModContent.ProjectileType<ColdDivinityPointyThing>();
|
|
item.shootSpeed = 10f;
|
|
item.summon = true;
|
|
}
|
|
|
|
public override void ModifyTooltips(List<TooltipLine> list)
|
|
{
|
|
if (CalamityWorld.death)
|
|
{
|
|
foreach (TooltipLine line2 in list)
|
|
{
|
|
if (line2.mod == "Terraria" && line2.Name == "Tooltip7")
|
|
{
|
|
line2.text = "Provides heat and cold protection in Death Mode when in use\n" +
|
|
"Revengeance Drop";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat)
|
|
{
|
|
mult += player.MinionDamage() - 1f;
|
|
}
|
|
|
|
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
|
{
|
|
//damage = (int)(damage * player.MinionDamage());
|
|
float totalMinionSlots = 0f;
|
|
for (int i = 0; i < Main.projectile.Length; i++)
|
|
{
|
|
if (Main.projectile[i].active && Main.projectile[i].minion && Main.projectile[i].owner == player.whoAmI)
|
|
{
|
|
totalMinionSlots += Main.projectile[i].minionSlots;
|
|
}
|
|
}
|
|
if (player.altFunctionUse != 2 && totalMinionSlots < player.maxMinions)
|
|
{
|
|
player.AddBuff(ModContent.BuffType<ColdDivinityBuff>(), 120, true);
|
|
position = Main.MouseWorld;
|
|
Projectile.NewProjectile(position, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
|
int pointyThingCount = 0;
|
|
for (int i = 0; i < Main.projectile.Length; i++)
|
|
{
|
|
if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI)
|
|
{
|
|
if (!(Main.projectile[i].modProjectile as ColdDivinityPointyThing).circlingPlayer)
|
|
continue;
|
|
pointyThingCount++;
|
|
}
|
|
}
|
|
float angleVariance = MathHelper.TwoPi / pointyThingCount;
|
|
float angle = 0f;
|
|
for (int i = 0; i < Main.projectile.Length; i++)
|
|
{
|
|
if (Main.projectile[i].active && Main.projectile[i].type == type && Main.projectile[i].owner == player.whoAmI && Main.projectile[i].ai[1] == 0f)
|
|
{
|
|
if (!(Main.projectile[i].modProjectile as ColdDivinityPointyThing).circlingPlayer)
|
|
continue;
|
|
Main.projectile[i].ai[0] = angle;
|
|
Main.projectile[i].netUpdate = true;
|
|
angle += angleVariance;
|
|
for (int j = 0; j < 22; j++)
|
|
{
|
|
Dust dust = Dust.NewDustDirect(Main.projectile[i].position, Main.projectile[i].width, Main.projectile[i].height, DustID.Ice);
|
|
dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool(2).ToDirectionInt();
|
|
dust.noGravity = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public override bool AltFunctionUse(Player player)
|
|
{
|
|
return base.AltFunctionUse(player);
|
|
}
|
|
}
|
|
|
|
}
|