Files
CalamityModPublic/Items/Weapons/Summon/Endogenesis.cs
T
Ozzatron eaa04280ba 1 - Properly separated all Cosmic Anvil and Draedon's Forge recipes.
2 - An extremely large number of recipe changes. Far too many to remember.
3 - Occult Stone and furniture are now made at the Ancient Manipulator.
4 - 1 Core of Calamity now requires 1 Ashes of Calamity.
5 - Renamed the Calamitous Altar to Altar of the Accursed.
6 - All Cosmilite tier items are made at the Cosmic Anvil.
7 - Standardized the costs of all late game (Cosmilite tier and beyond) items.
2021-09-12 20:07:50 -04:00

109 lines
4.4 KiB
C#

using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Summon
{
public class Endogenesis : ModItem
{
//Cooper be like cool
public static int AttackMode = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Endogenesis");
Tooltip.SetDefault("Summons an ascended ice construct to protect you \n" +
"Changes attack modes by resummoning or reusing the staff \n" +
"The first mode makes it shoot sweeping lasers aimed at the enemy \n" +
"The second mode sacrifices its limbs to shoot out homing projectiles \n" +
"The third mode allows it to agressively tackle its enemies \n" +
"The fourth mode makes the limbs function as endothermic flamethrowers \n" +
"Requires 10 minion slots to be summoned \n" +
"There can only be one \n" +
"[c/B0FBFF:Ice puns not included]"); //Icy no problems with that
}
public override void SetDefaults()
{
item.width = 80;
item.height = 80;
item.useStyle = ItemUseStyleID.SwingThrow;
item.noMelee = true;
item.UseSound = SoundID.Item78;
item.summon = true;
item.mana = 80;
item.damage = 1300;
item.knockBack = 4f;
item.autoReuse = true;
item.useTime = item.useAnimation = 10;
item.shoot = ModContent.ProjectileType<EndoCooperBody>();
item.shootSpeed = 10f;
item.value = CalamityGlobalItem.Rarity16BuyPrice;
item.Calamity().customRarity = CalamityRarity.HotPink;
item.Calamity().devItem = true;
}
public override bool CanUseItem(Player player) => player.maxMinions >= 10f;
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)
{
player.itemTime = item.useTime;
CalamityUtils.KillShootProjectileMany(player, new int[]
{
type,
ModContent.ProjectileType<EndoCooperLimbs>(),
ModContent.ProjectileType<EndoBeam>()
});
SummonEndoCooper(AttackMode, Main.MouseWorld, damage, knockBack, player, out _, out _);
AttackMode++;
if (AttackMode > 3)
AttackMode = 0;
}
return false;
}
public static void SummonEndoCooper(int attackMode, Vector2 spawnPosition, int damage, float knockBack, Player owner, out int bodyIndex, out int limbsIndex)
{
bodyIndex = limbsIndex = -1;
if (Main.myPlayer != owner.whoAmI)
return;
float dmgMult = 1f;
if (attackMode == 0) //lasers
dmgMult = 0.65f;
if (attackMode == 1) //icicles
dmgMult = 1f;
if (attackMode == 2) //melee
dmgMult = 0.95f;
if (attackMode == 3) //flamethrower
dmgMult = 0.9f;
bodyIndex = Projectile.NewProjectile(spawnPosition, Vector2.Zero, ModContent.ProjectileType<EndoCooperBody>(), (int)(damage * dmgMult), knockBack, owner.whoAmI, attackMode, 0f);
limbsIndex = Projectile.NewProjectile(spawnPosition, Vector2.Zero, ModContent.ProjectileType<EndoCooperLimbs>(), (int)(damage * dmgMult), knockBack, owner.whoAmI, attackMode, bodyIndex);
Main.projectile[bodyIndex].ai[1] = limbsIndex;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<CryogenicStaff>());
recipe.AddIngredient(ItemID.BlizzardStaff);
recipe.AddIngredient(ModContent.ItemType<EndothermicEnergy>(), 100);
recipe.AddIngredient(ModContent.ItemType<CoreofEleum>(), 15);
recipe.AddIngredient(ModContent.ItemType<ShadowspecBar>(), 5);
recipe.AddTile(ModContent.TileType<DraedonsForge>());
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}