Skip to content

Commit

Permalink
Updated remaining staves
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-NCSU committed Feb 28, 2022
1 parent 30b49b3 commit 3efa615
Show file tree
Hide file tree
Showing 47 changed files with 1,259 additions and 297 deletions.
Binary file added Items/AscendantGlow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 30 additions & 2 deletions Items/AscendantStaff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,33 @@
using System;
using Terraria;
using Terraria.ID;
using Terraria.DataStructures;
using Terraria.ModLoader;
using Microsoft.Xna.Framework.Graphics;

namespace MoreStaves.Items
{
// Adds the ascendant staff to the game
class AscendantStaff : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Ascendant Staff");
Tooltip.SetDefault("Summons Cluster Bombs to fight for you.\nMore powerful attacks against targeted enemies.");

// Sets the item to use 30 frames with with 5 ticks per frame
Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 30));

// Allows targeting across screen
ItemID.Sets.GamepadWholeScreenUseRange[item.type] = true;
ItemID.Sets.LockOnIgnoresCollision[item.type] = true;
}

public override void SetDefaults()
{
item.damage = 200;
item.width = 40;
item.height = 40;
item.width = 20;
item.height = 20;
item.useTime = 36;
item.useAnimation = 36;
item.useStyle = ItemUseStyleID.SwingThrow;
Expand All @@ -31,26 +39,37 @@ public override void SetDefaults()
item.noMelee = true;
item.summon = true;
item.knockBack = 3f;
// Spawns the Ascendant Buff
item.buffType = ModContent.BuffType<Buffs.AscendantBuff>();
// Shoots a Ascendant Minion
item.shoot = ModContent.ProjectileType<Projectiles.AscendantMinion>();
// Prevents the default item graphic from being used
item.noUseGraphic = 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)
{
// Does not add buff if player already has the buff
if(player.HasBuff(item.buffType))
{
return false;
}
// When shoot is called it should also spawn the staff
Projectile.NewProjectile(position, Vector2.Zero, ModContent.ProjectileType<Projectiles.AscendantStaffProjectile>(), 0, 0, item.owner);
// Adds the buff
player.AddBuff(item.buffType, 2);
// spawns minion at mouse position
position = Main.MouseWorld;
return true;
}

public override void AddRecipes()
{
// Checks if calamity is loaded
Mod calamity = ModLoader.GetMod("CalamityMod");
if (calamity != null)
{
// Recipe Ascendant Spirit Essence (2), Cosmilite Bar (6), Explosive Trap Staff (1), Bomb (396) @ Cosmic Anvil
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(calamity.ItemType("AscendantSpiritEssence"), 2);
recipe.AddIngredient(calamity.ItemType("CosmiliteBar"), 6);
Expand All @@ -61,5 +80,14 @@ public override void AddRecipes()
recipe.AddRecipe();
}
}

public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
// Draws the glowing gem and effect as a glow mask
Texture2D glow = mod.GetTexture("Items/AscendantGlow");
Rectangle sourceRectangle = Main.itemAnimations[item.type].GetFrame(glow);
Vector2 offset = sourceRectangle.Size() * 0.5f;
spriteBatch.Draw(glow, item.Center - Main.screenPosition - new Vector2(0, 18f), sourceRectangle, Color.White, rotation, offset, scale, SpriteEffects.None, 0f);
}
}
}
Binary file modified Items/AscendantStaff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 28 additions & 2 deletions Items/HallowedStaff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,33 @@
using System;
using Terraria;
using Terraria.ID;
using Terraria.DataStructures;
using Terraria.ModLoader;
using Microsoft.Xna.Framework.Graphics;

namespace MoreStaves.Items
{
// Adds the hallowed staff to the game
class HallowedStaff : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Hallowed Staff");
Tooltip.SetDefault("Summons a hallowed minion to fight for you.");

// Sets the item to use 30 frames with with 5 ticks per frame
Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 30));

// Allows targeting across screen
ItemID.Sets.GamepadWholeScreenUseRange[item.type] = true;
ItemID.Sets.LockOnIgnoresCollision[item.type] = true;
}

public override void SetDefaults()
{
item.damage = 12;
item.width = 40;
item.height = 40;
item.width = 20;
item.height = 20;
item.useTime = 24;
item.useAnimation = 24;
item.useStyle = ItemUseStyleID.SwingThrow;
Expand All @@ -31,24 +39,42 @@ public override void SetDefaults()
item.noMelee = true;
item.summon = true;
item.knockBack = 3f;
// Spawns the Hallowed Buff
item.buffType = ModContent.BuffType<Buffs.HallowedBuff>();
// Shoots a Hallowed Minion
item.shoot = ModContent.ProjectileType<Projectiles.HallowedMinion>();
// Prevents the default item graphic from being used
item.noUseGraphic = 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)
{
// When shoot is called it should also spawn the staff
Projectile.NewProjectile(position, Vector2.Zero, ModContent.ProjectileType<Projectiles.HallowedStaffProjectile>(), 0, 0, item.owner);
// Adds the buff
player.AddBuff(item.buffType, 2);
// spawns minion at mouse position
position = Main.MouseWorld;
return true;
}

public override void AddRecipes()
{
// Recipe Hallowed Bar (8) @ Mythril Anvil
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.HallowedBar, 8);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}

public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
// Draws the glowing gem and effect as a glow mask
Texture2D glow = mod.GetTexture("Items/HallowedGlow");
Rectangle sourceRectangle = Main.itemAnimations[item.type].GetFrame(glow);
Vector2 offset = sourceRectangle.Size() * 0.5f;
spriteBatch.Draw(glow, item.Center - Main.screenPosition - new Vector2(0, 18f), sourceRectangle, Color.White, rotation, offset, scale, SpriteEffects.None, 0f);
}
}
}
30 changes: 28 additions & 2 deletions Items/LuminiteStaff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,33 @@
using System;
using Terraria;
using Terraria.ID;
using Terraria.DataStructures;
using Terraria.ModLoader;
using Microsoft.Xna.Framework.Graphics;

namespace MoreStaves.Items
{
// Adds the luminite staff to the game
class LuminiteStaff : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Luminite Staff");
Tooltip.SetDefault("Summons a True Eye of Cthulhu to fight for you.");

// Sets the item to use 30 frames with with 5 ticks per frame
Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 30));

// Allows targeting across screen
ItemID.Sets.GamepadWholeScreenUseRange[item.type] = true;
ItemID.Sets.LockOnIgnoresCollision[item.type] = true;
}

public override void SetDefaults()
{
item.damage = 82;
item.width = 40;
item.height = 40;
item.width = 20;
item.height = 20;
item.useTime = 36;
item.useAnimation = 36;
item.useStyle = ItemUseStyleID.SwingThrow;
Expand All @@ -31,19 +39,28 @@ public override void SetDefaults()
item.noMelee = true;
item.summon = true;
item.knockBack = 3f;
// Spawns the Luminite Buff
item.buffType = ModContent.BuffType<Buffs.LuminiteBuff>();
// Shoots a Luminite Minion
item.shoot = ModContent.ProjectileType<Projectiles.LuminiteMinion>();
// Prevents the default item graphic from being used
item.noUseGraphic = 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)
{
// When shoot is called it should also spawn the staff
Projectile.NewProjectile(position, Vector2.Zero, ModContent.ProjectileType<Projectiles.LuminiteStaffProjectile>(), 0, 0, item.owner);
// Adds the buff
player.AddBuff(item.buffType, 2);
// spawns minion at mouse position
position = Main.MouseWorld;
return true;
}

public override void AddRecipes()
{
// Recipe Luminite Bar (10), Stardust Fragment (6), Solar Fragment (6), Nebula Fragment (6), Vortex Fragment (6) @ Ancient Manipulator
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.LunarBar, 10);
recipe.AddIngredient(ItemID.FragmentStardust, 6);
Expand All @@ -54,5 +71,14 @@ public override void AddRecipes()
recipe.SetResult(this);
recipe.AddRecipe();
}

public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
// Draws the glowing gem and effect as a glow mask
Texture2D glow = mod.GetTexture("Items/LuminiteGlow");
Rectangle sourceRectangle = Main.itemAnimations[item.type].GetFrame(glow);
Vector2 offset = sourceRectangle.Size() * 0.5f;
spriteBatch.Draw(glow, item.Center - Main.screenPosition - new Vector2(0, 18f), sourceRectangle, Color.White, rotation, offset, scale, SpriteEffects.None, 0f);
}
}
}
30 changes: 28 additions & 2 deletions Items/MeteoriteStaff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,33 @@
using System;
using Terraria;
using Terraria.ID;
using Terraria.DataStructures;
using Terraria.ModLoader;
using Microsoft.Xna.Framework.Graphics;

namespace MoreStaves.Items
{
// Adds the meteorite staff to the game
class MeteoriteStaff : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Meteorite Staff");
Tooltip.SetDefault("Summons a meteorite minion to fight for you.\nThe minion will follow your cursor and inflict On Fire! on enemies they touch.");

// Sets the item to use 30 frames with with 5 ticks per frame
Main.RegisterItemAnimation(item.type, new DrawAnimationVertical(5, 30));

// Allows targeting across screen
ItemID.Sets.GamepadWholeScreenUseRange[item.type] = true;
ItemID.Sets.LockOnIgnoresCollision[item.type] = true;
}

public override void SetDefaults()
{
item.damage = 16;
item.width = 40;
item.height = 40;
item.width = 20;
item.height = 20;
item.useTime = 36;
item.useAnimation = 36;
item.useStyle = ItemUseStyleID.SwingThrow;
Expand All @@ -31,24 +39,42 @@ public override void SetDefaults()
item.noMelee = true;
item.summon = true;
item.knockBack = 1f;
// Spawns the Meteorite Buff
item.buffType = ModContent.BuffType<Buffs.MeteoriteBuff>();
// Shoots a Meteorite Minion
item.shoot = ModContent.ProjectileType<Projectiles.MeteoriteMinion>();
// Prevents the default item graphic from being used
item.noUseGraphic = 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)
{
// When shoot is called it should also spawn the staff
Projectile.NewProjectile(position, Vector2.Zero, ModContent.ProjectileType<Projectiles.MeteoriteStaffProjectile>(), 0, 0, item.owner);
// Adds the buff
player.AddBuff(item.buffType, 2);
// spawns minion at mouse position
position = Main.MouseWorld;
return true;
}

public override void AddRecipes()
{
// Recipe Meteorite Bar (18) @ Anvil
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.MeteoriteBar, 18);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}

public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
// Draws the glowing gem and effect as a glow mask
Texture2D glow = mod.GetTexture("Items/MeteoriteGlow");
Rectangle sourceRectangle = Main.itemAnimations[item.type].GetFrame(glow);
Vector2 offset = sourceRectangle.Size() * 0.5f;
spriteBatch.Draw(glow, item.Center - Main.screenPosition - new Vector2(0, 18f), sourceRectangle, Color.White, rotation, offset, scale, SpriteEffects.None, 0f);
}
}
}
Loading

0 comments on commit 3efa615

Please sign in to comment.