Skip to content

Commit

Permalink
Update to v0.0.5
Browse files Browse the repository at this point in the history
1. Added 2 new weapons: Rivers Of Blood & Dark Moon Greatsword
  • Loading branch information
rzc0d3r authored Sep 15, 2024
1 parent f927b4f commit 267e069
Show file tree
Hide file tree
Showing 18 changed files with 692 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Common/NPCLootDrop/NPCLootDrop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
// Gian Crusher
if (npc.type == NPCID.Golem)
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<GiantCrusher>(), 1));
// Dark Moon Greatsword
if (npc.type == NPCID.CultistBoss)
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<DarkMoonGreatsword>(), 1));
// Rivers Of Blood
if (npc.type == NPCID.BloodEelHead)
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<RiversOfBlood>(), 12));
if (npc.type == NPCID.BloodNautilus)
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<RiversOfBlood>(), 4));
}
}
}
2 changes: 1 addition & 1 deletion Content/Items/Weapons/Melee/BlasphemousBlade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ namespace EldenRingItems.Content.Items.Weapons.Melee
public class BlasphemousBlade : ModItem
{
public override string Texture => "EldenRingItems/Content/Items/Weapons/Melee/BlasphemousBlade";
public override LocalizedText DisplayName => base.DisplayName.WithFormatArgs("");

const int MAX_CHARGED_ATTACKS = 5;
const int MIN_HEAL = 10;
const int MAX_HEAL = 25;

public override LocalizedText DisplayName => base.DisplayName.WithFormatArgs("");
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MIN_HEAL*MAX_CHARGED_ATTACKS, MAX_HEAL*MAX_CHARGED_ATTACKS, MAX_CHARGED_ATTACKS);

float HoldingCount = 0;
Expand Down
260 changes: 260 additions & 0 deletions Content/Items/Weapons/Melee/DarkMoonGreatsword.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,260 @@
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Localization;
using EldenRingItems.Content.Items.Materials.SomberSmithingStones;
using EldenRingItems.Projectiles.Melee;
using Terraria.DataStructures;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace EldenRingItems.Content.Items.Weapons.Melee
{
public class DarkMoonGreatsword : ModItem
{
public override string Texture => "EldenRingItems/Content/Items/Weapons/Melee/DarkMoonGreatsword";
public int BaseDamage { get; set; } = 100;

SoundStyle IsChargedSound = new SoundStyle("EldenRingItems/Sounds/cs_c2010.649");
SoundStyle ChargedUseSound = new SoundStyle("EldenRingItems/Sounds/cs_c2010.2318");

bool IsCharged = false;
const int MAX_CHARGED_ATTACKS = 8;
int MadeChargedAttacks = 0;
const int MANA_FOR_CHARGE = 60;

public override LocalizedText DisplayName => base.DisplayName.WithFormatArgs("");
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MANA_FOR_CHARGE, MAX_CHARGED_ATTACKS);

public override void SetDefaults()
{
Item.width = 92;
Item.height = 91;
Item.DamageType = DamageClass.Melee;
Item.damage = BaseDamage;
Item.knockBack = 5f;
Item.useTime = 20;
Item.useAnimation = 20;
Item.autoReuse = true;
Item.useTurn = true;
Item.useStyle = ItemUseStyleID.Swing;
Item.UseSound = SoundID.Item1;
Item.value = Item.sellPrice(0, 35, 0, 0);
Item.rare = ItemRarityID.Cyan;
Item.shoot = ModContent.ProjectileType<DarkMoonGreatswordProj>();
Item.shootSpeed = 12f;
}

public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (IsCharged)
{
if (MadeChargedAttacks == MAX_CHARGED_ATTACKS)
{
MadeChargedAttacks = 0;
IsCharged = false;
return false;
}
if (MadeChargedAttacks == MAX_CHARGED_ATTACKS-1)
Item.UseSound = SoundID.Item1;
MadeChargedAttacks++;
return true;
}
return false;
}

public override void HoldStyle(Player player, Rectangle heldItemFrame)
{
if (Main.mouseRight && !IsCharged)
{
if (player.CheckMana(MANA_FOR_CHARGE, true))
{
IsChargedSound.Volume = 0.6f;
SoundEngine.PlaySound(IsChargedSound);
Item.UseSound = ChargedUseSound;
IsCharged = true;
}
}
}

public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frameI, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
Texture2D texture;

if (!IsCharged)
{
texture = ModContent.Request<Texture2D>(Texture).Value;
spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0);
}
else
{
texture = ModContent.Request<Texture2D>("EldenRingItems/Content/Items/Weapons/Melee/DarkMoonGreatswordCharged").Value;
spriteBatch.Draw(texture, position, null, Color.White, 0f, origin, scale, SpriteEffects.None, 0);
}
return false;
}

//public override bool PreDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
//{
// Texture2D texture;

// if (!IsCharged)
// {
// texture = ModContent.Request<Texture2D>(Texture).Value;
// spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
// }
// else
// {
// texture = ModContent.Request<Texture2D>("EldenRingItems/Content/Items/Weapons/Melee/DarkMoonGreatswordCharged").Value;
// spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
// }
// return false;
//}

//public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
//{
// if (!IsCharged)
// return;
// Texture2D texture = ModContent.Request<Texture2D>("EldenRingItems/Content/Items/Weapons/Melee/DarkMoonGreatswordCharged").Value;
// spriteBatch.Draw(texture, Item.position - Main.screenPosition, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0);
//}
}

#region Upgrade
public abstract class UpgradedDarkMoonGreatsword : DarkMoonGreatsword
{
public int UpgradeLevel { get; set; }
public Recipe recipe { get; set; }
public override LocalizedText Tooltip => ModContent.GetModItem(ModContent.ItemType<DarkMoonGreatsword>()).Tooltip;
public override LocalizedText DisplayName => ModContent.GetModItem(ModContent.ItemType<DarkMoonGreatsword>()).DisplayName.WithFormatArgs($" +{UpgradeLevel}");

protected UpgradedDarkMoonGreatsword(int upgradeLevel)
{
UpgradeLevel = upgradeLevel;
}

public override void SetDefaults()
{
BaseDamage += UpgradeLevel * 10;
base.SetDefaults();
}

public override void AddRecipes()
{
recipe = CreateRecipe();
recipe.AddIngredient(SSSUtils.GetSSSByLevel(UpgradeLevel));
recipe.AddTile(SSSUtils.GetTileByLevel(UpgradeLevel));
}
}

public class DarkMoonGreatsword1 : UpgradedDarkMoonGreatsword
{
public DarkMoonGreatsword1() : base(1) { }
public override void AddRecipes()
{
base.AddRecipes();
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword>());
recipe.Register();
}
}

public class DarkMoonGreatsword2 : UpgradedDarkMoonGreatsword
{
public DarkMoonGreatsword2() : base(2) { }
public override void AddRecipes()
{
base.AddRecipes();
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword1>());
recipe.Register();
}
}

public class DarkMoonGreatsword3 : UpgradedDarkMoonGreatsword
{
public DarkMoonGreatsword3() : base(3) { }
public override void AddRecipes()
{
base.AddRecipes();
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword2>());
recipe.Register();
}
}
public class DarkMoonGreatsword4 : UpgradedDarkMoonGreatsword
{
public DarkMoonGreatsword4() : base(4) { }
public override void AddRecipes()
{
base.AddRecipes();
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword3>());
recipe.Register();
}
}

public class DarkMoonGreatsword5 : UpgradedDarkMoonGreatsword
{
public DarkMoonGreatsword5() : base(5) { }
public override void AddRecipes()
{
base.AddRecipes();
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword4>());
recipe.Register();
}
}

public class DarkMoonGreatsword6 : UpgradedDarkMoonGreatsword
{
public DarkMoonGreatsword6() : base(6) { }
public override void AddRecipes()
{
base.AddRecipes();
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword5>());
recipe.Register();
}
}

public class DarkMoonGreatsword7 : UpgradedDarkMoonGreatsword
{
public DarkMoonGreatsword7() : base(7) { }
public override void AddRecipes()
{
base.AddRecipes();
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword6>());
recipe.Register();
}
}

public class DarkMoonGreatsword8 : UpgradedDarkMoonGreatsword
{
public DarkMoonGreatsword8() : base(8) { }
public override void AddRecipes()
{
base.AddRecipes();
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword7>());
recipe.Register();
}
}

public class DarkMoonGreatsword9 : UpgradedDarkMoonGreatsword
{
public DarkMoonGreatsword9() : base(9) { }
public override void AddRecipes()
{
base.AddRecipes();
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword8>());
recipe.Register();
}
}

public class DarkMoonGreatsword10 : UpgradedDarkMoonGreatsword
{
public DarkMoonGreatsword10() : base(10) { }
public override void AddRecipes()
{
base.AddRecipes();
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword9>());
recipe.Register();
}
}
#endregion
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 267e069

Please sign in to comment.