Skip to content

Commit

Permalink
Merge pull request #23 from Nick-NCSU/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
Nick-NCSU authored Nov 7, 2021
2 parents 31391d1 + 67d1797 commit ba8739d
Show file tree
Hide file tree
Showing 10 changed files with 761 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Buffs/ChlorophyteBuff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

namespace DubNation.Buffs
{
public class ChlorophyteBuff : ModBuff
public class ShroomiteBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Chlorophyte Minion");
Description.SetDefault("The chlorophyte minion will fight for you");
DisplayName.SetDefault("Shroomite Minion");
Description.SetDefault("The shroomite minion will fight for you");
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
}

public override void Update(Player player, ref int buffIndex)
{
if (player.ownedProjectileCounts[ModContent.ProjectileType<Projectiles.ChlorophyteMinion>()] > 0)
if (player.ownedProjectileCounts[ModContent.ProjectileType<Projectiles.ShroomiteMinion>()] > 0)
{
player.buffTime[buffIndex] = 18000;
}
Expand Down
32 changes: 32 additions & 0 deletions Buffs/ShroomiteBuff.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace DubNation.Buffs
{
public class ChlorophyteBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Chlorophyte Minion");
Description.SetDefault("The chlorophyte minion will fight for you");
Main.buffNoSave[Type] = true;
Main.buffNoTimeDisplay[Type] = true;
}

public override void Update(Player player, ref int buffIndex)
{
if (player.ownedProjectileCounts[ModContent.ProjectileType<Projectiles.ChlorophyteMinion>()] > 0)
{
player.buffTime[buffIndex] = 18000;
}
else
{
player.DelBuff(buffIndex);
buffIndex--;
}
}
}
}
Binary file added Buffs/ShroomiteBuff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Items/ChlorophyteStaff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public override void SetStaticDefaults()

public override void SetDefaults()
{
item.damage = 10;
item.damage = 30;
item.width = 40;
item.height = 40;
item.useTime = 36;
Expand Down
54 changes: 54 additions & 0 deletions Items/ShroomiteStaff.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace DubNation.Items
{
class ShroomiteStaff : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Shroomite Staff");
Tooltip.SetDefault("Summons a shroomite minion to fight for you.");
ItemID.Sets.GamepadWholeScreenUseRange[item.type] = true;
ItemID.Sets.LockOnIgnoresCollision[item.type] = true;
}

public override void SetDefaults()
{
item.damage = 30;
item.width = 40;
item.height = 40;
item.useTime = 36;
item.useAnimation = 36;
item.useStyle = ItemUseStyleID.SwingThrow;
item.value = 10;
item.rare = ItemRarityID.Blue;
item.UseSound = SoundID.Item1;
item.mana = 10;
item.noMelee = true;
item.summon = true;
item.buffType = ModContent.BuffType<Buffs.ShroomiteBuff>();
item.shoot = ModContent.ProjectileType<Projectiles.ShroomiteMinion>();
}

public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
player.AddBuff(item.buffType, 2);
position = Main.MouseWorld;
return true;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.ChlorophyteBar, 9);
recipe.AddIngredient(ItemID.TurtleShell, 1);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Loading

0 comments on commit ba8739d

Please sign in to comment.