Skip to content

Commit

Permalink
Update to v0.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
rzc0d3r authored Sep 24, 2024
1 parent 76b3739 commit a6112d0
Show file tree
Hide file tree
Showing 29 changed files with 211 additions and 177 deletions.
1 change: 1 addition & 0 deletions Common/GlobalsNPCs/DamageOverTimeGlobalNPC.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Terraria;
using Terraria.ModLoader;

using EldenRingItems.Content.Buffs.StatDebuff;

namespace ExampleMod.Common.GlobalNPCs
Expand Down
10 changes: 5 additions & 5 deletions Common/NPCLootDrop/NPCLootDrop.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Terraria.GameContent.ItemDropRules;
using Terraria.ModLoader;
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.GameContent.ItemDropRules;

using EldenRingItems.Content.Items.Weapons.Melee;
using EldenRingItems.Content.Items.Consumables;
using EldenRingItems.Content.Items.Weapons.Melee;

namespace EldenRingItems.Common.NPCLootDrop
{
Expand All @@ -25,7 +25,7 @@ public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot)
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<GiantCrusher>(), 1));
// Dark Moon Greatsword
if (npc.type == NPCID.CultistBoss)
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<DarkMoonGreatsword>(), 1));
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<DarkMoonGreatsword0>(), 1));
// Rivers Of Blood
if (npc.type == NPCID.BloodEelHead)
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<RiversOfBlood>(), 12));
Expand Down
11 changes: 7 additions & 4 deletions Common/Players/ERIPlayer.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

using Microsoft.Xna.Framework;

using EldenRingItems.Content.Buffs.StatDebuff;

namespace EldenRingItems.Common.Players
Expand Down Expand Up @@ -30,11 +32,12 @@ public override void MeleeEffects(Item item, Rectangle hitbox)
{
if (WeaponImbueBlackFlame)
{
if (item.DamageType.CountsAsClass<MeleeDamageClass>() && !item.noMelee && !item.noUseGraphic)
if (item.DamageType.CountsAsClass<MeleeDamageClass>() && !item.noMelee && !item.noUseGraphic) {
if (Main.rand.NextBool(2))
{
Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.Wraith, Scale: Main.rand.NextFloat(0.5f, 0.8f));
}
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion Content/Buffs/StatBuff/BlessingBuff.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

using EldenRingItems.Common.Players;
using Terraria.ID;

namespace EldenRingItems.Content.Buffs.StatBuff
{
Expand Down
3 changes: 2 additions & 1 deletion Content/Buffs/StatBuff/WeaponImbueBlackFlame.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

using EldenRingItems.Common.Players;
using Terraria.ID;

namespace EldenRingItems.Content.Buffs.StatBuff
{
Expand Down
5 changes: 2 additions & 3 deletions Content/Buffs/StatDebuff/BlackFlameDebuff.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

using Microsoft.Xna.Framework;
using Terraria.ID;
using Microsoft.Xna.Framework.Graphics;
using Terraria.DataStructures;

namespace EldenRingItems.Content.Buffs.StatDebuff
{
Expand Down
6 changes: 3 additions & 3 deletions Content/Items/Accessories/RadahnsGreatRune.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Terraria.ID;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria;
using Terraria.Localization;
using EldenRingItems.Common.Players;

using EldenRingItems.Content.Buffs.StatBuff;

namespace EldenRingItems.Content.Items.Accessories
Expand Down
7 changes: 4 additions & 3 deletions Content/Items/Consumables/BlackFlameSpell.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using Terraria.ID;
using Terraria.ModLoader;
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.Audio;
using Terraria.ModLoader;

using EldenRingItems.Content.Buffs.StatBuff;

namespace EldenRingItems.Content.Items.Consumables
Expand Down
6 changes: 3 additions & 3 deletions Content/Items/Consumables/RuneArc.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Terraria.ID;
using Terraria.ModLoader;
using Terraria;
using Terraria;
using Terraria.ID;
using Terraria.Audio;
using Terraria.ModLoader;

using EldenRingItems.Common.Players;
using EldenRingItems.Content.Buffs.StatBuff;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Terraria.ID;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria;

namespace EldenRingItems.Content.Items.Materials.SomberSmithingStones
{
Expand Down Expand Up @@ -280,4 +280,4 @@ public static int GetTileByLevel(int level)
}
}
#endregion
}
}
9 changes: 5 additions & 4 deletions Content/Items/Weapons/Melee/BlasphemousBlade.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using EldenRingItems.Projectiles.Melee;
using Terraria.Audio;
using Terraria.ModLoader;
using Terraria.Localization;
using Terraria.DataStructures;

using Microsoft.Xna.Framework;
using System;
using Terraria.Localization;

using EldenRingItems.Projectiles.Melee;
using EldenRingItems.Content.Items.Materials.SomberSmithingStones;

namespace EldenRingItems.Content.Items.Weapons.Melee
Expand Down
74 changes: 51 additions & 23 deletions Content/Items/Weapons/Melee/DarkMoonGreatsword.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.Audio;
using Terraria.ModLoader;
using Terraria.Localization;
using Terraria.DataStructures;

using Microsoft.Xna.Framework;
using EldenRingItems.Content.Items.Materials.SomberSmithingStones;
using Microsoft.Xna.Framework.Graphics;

using EldenRingItems.Projectiles.Melee.DarkMoonGreatsword;
using EldenRingItems.Common.Players;
using EldenRingItems.Projectiles.Melee;
using EldenRingItems.Content.Items.Materials.SomberSmithingStones;

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

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


public bool Charging { get; set; } = false;
public bool IsCharged { get; set; } = false;
const int MAX_CHARGED_ATTACKS = 10;
int MadeChargedAttacks = 0;
const int MANA_FOR_CHARGE = 100;
Expand Down Expand Up @@ -47,13 +50,12 @@ public override void SetDefaults()

public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.GetModPlayer<ERIPlayer>().DarkMoonGreatswordIsCharged && player.altFunctionUse != 2)
if (IsCharged && player.altFunctionUse != 2)
{
if (MadeChargedAttacks == MAX_CHARGED_ATTACKS - 1)
{
Item.UseSound = SoundID.Item1;
MadeChargedAttacks = 0;
player.GetModPlayer<ERIPlayer>().DarkMoonGreatswordIsCharged = false;
Reset();
IsCharged = false;
}
else
MadeChargedAttacks++;
Expand All @@ -64,26 +66,52 @@ public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source,

public override bool AltFunctionUse(Player player) => true;

void Reset(string addtext="")
{
//Main.NewText(addtext+ "Resetting an interrupted charge DarkMoonGreatsword");
Charging = false;
Item.UseSound = SoundID.Item1;
MadeChargedAttacks = 0;
}

public override void UpdateInventory(Player player)
{
if (player.HeldItem.type != Type && !IsCharged && Charging)
Reset();
}

public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
base.PostDrawInWorld(spriteBatch, lightColor, alphaColor, rotation, scale, whoAmI);
if (!IsCharged && Charging && Main.LocalPlayer.HeldItem.type != Type)
Reset();
}

public override void PostDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
{
base.PostDrawInInventory(spriteBatch, position, frame, drawColor, itemColor, origin, scale);
if (!IsCharged && Charging && Main.LocalPlayer.HeldItem.type != Type)
Reset();
}

public override bool CanUseItem(Player player)
{
if (player.altFunctionUse == 2)
if (player.altFunctionUse == 2 && !IsCharged)
{
if (!player.GetModPlayer<ERIPlayer>().DarkMoonGreatswordIsCharged && !player.GetModPlayer<ERIPlayer>().DarkMoonGreatswordCharging)
if (!Charging)
{
if (player.CheckMana(MANA_FOR_CHARGE, true))
{
player.GetModPlayer<ERIPlayer>().DarkMoonGreatswordCharging = true;
Projectile.NewProjectile(player.GetSource_ItemUse(player.HeldItem), player.MountedCenter.X, player.MountedCenter.Y, 0, -30, ModContent.ProjectileType<DarkMoonGreatswordCharging>(), 0, 0, player.whoAmI, 0f);
Charging = true;
if (Main.myPlayer == player.whoAmI)
Projectile.NewProjectile(player.GetSource_ItemUse(player.HeldItem), player.MountedCenter.X, player.MountedCenter.Y, 0, -30, ModContent.ProjectileType<DarkMoonGreatswordCharging>(), 0, 0, player.whoAmI, 0f);
Item.UseSound = ChargedUseSound;
MadeChargedAttacks = 0;
}
}
}
else
{
if (!player.GetModPlayer<ERIPlayer>().DarkMoonGreatswordCharging && player.altFunctionUse != 2)
return true;
}
else if (!Charging && player.altFunctionUse != 2)
return true;
return false;
}

Expand All @@ -95,12 +123,12 @@ public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int da
}

#region Upgrade
public abstract class UpgradedDarkMoonGreatsword : DarkMoonGreatsword
public abstract class UpgradedDarkMoonGreatsword : DarkMoonGreatsword0
{
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}");
public override LocalizedText Tooltip => ModContent.GetModItem(ModContent.ItemType<DarkMoonGreatsword0>()).Tooltip;
public override LocalizedText DisplayName => ModContent.GetModItem(ModContent.ItemType<DarkMoonGreatsword0>()).DisplayName.WithFormatArgs($" +{UpgradeLevel}");

protected UpgradedDarkMoonGreatsword(int upgradeLevel)
{
Expand All @@ -127,7 +155,7 @@ public DarkMoonGreatsword1() : base(1) { }
public override void AddRecipes()
{
base.AddRecipes();
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword>());
recipe.AddIngredient(ModContent.ItemType<DarkMoonGreatsword0>());
recipe.Register();
}
}
Expand Down
3 changes: 2 additions & 1 deletion Content/Items/Weapons/Melee/GiantCrusher.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using EldenRingItems.Projectiles.Melee;
using Terraria.Localization;

using EldenRingItems.Projectiles.Melee;
using EldenRingItems.Content.Items.Materials.SomberSmithingStones;

namespace EldenRingItems.Content.Items.Weapons.Melee
Expand Down
11 changes: 7 additions & 4 deletions Content/Items/Weapons/Melee/GreatKatana.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
using Terraria;
using Terraria.Audio;
using System;

using Terraria;
using Terraria.ID;
using Terraria.Audio;
using Terraria.ModLoader;
using Terraria.Localization;
using EldenRingItems.Content.Items.Materials.SomberSmithingStones;

using Microsoft.Xna.Framework;
using System;

using EldenRingItems.Content.Items.Materials.SomberSmithingStones;

namespace EldenRingItems.Content.Items.Weapons.Melee
{
Expand Down
6 changes: 4 additions & 2 deletions Content/Items/Weapons/Melee/Moonveil.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.Audio;
using Terraria.ModLoader;
using Terraria.Localization;
using EldenRingItems.Content.Items.Materials.SomberSmithingStones;
using Terraria.DataStructures;

using Microsoft.Xna.Framework;

using EldenRingItems.Projectiles.Melee;
using EldenRingItems.Content.Items.Materials.SomberSmithingStones;

namespace EldenRingItems.Content.Items.Weapons.Melee
{
Expand Down
6 changes: 4 additions & 2 deletions Content/Items/Weapons/Melee/RiversOfBlood.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using Terraria;
using Terraria.Audio;
using Terraria.ID;
using Terraria.Audio;
using Terraria.ModLoader;
using Terraria.Localization;
using EldenRingItems.Content.Items.Materials.SomberSmithingStones;
using Terraria.DataStructures;

using Microsoft.Xna.Framework;

using EldenRingItems.Projectiles.Melee;
using EldenRingItems.Content.Items.Materials.SomberSmithingStones;

namespace EldenRingItems.Content.Items.Weapons.Melee
{
Expand Down
4 changes: 3 additions & 1 deletion Content/Items/Weapons/Melee/SwordOfNightAndFlame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Localization;
using EldenRingItems.Content.Items.Materials.SomberSmithingStones;

using Microsoft.Xna.Framework;

using EldenRingItems.Content.Items.Materials.SomberSmithingStones;

namespace EldenRingItems.Content.Items.Weapons.Melee
{
public class SwordOfNightAndFlame : ModItem
Expand Down
8 changes: 1 addition & 7 deletions EldenRingItems.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria.ModLoader;

namespace EldenRingItems
{
// Please read https://github.com/tModLoader/tModLoader/wiki/Basic-tModLoader-Modding-Guide#mod-skeleton-contents for more information about the various files in a mod.
public class EldenRingItems : Mod
{

}
}
}
Loading

0 comments on commit a6112d0

Please sign in to comment.