diff --git a/Common/NPCLootDrop/NPCLootDrop.cs b/Common/NPCLootDrop/NPCLootDrop.cs index 3acaf99..ba20156 100644 --- a/Common/NPCLootDrop/NPCLootDrop.cs +++ b/Common/NPCLootDrop/NPCLootDrop.cs @@ -12,7 +12,7 @@ public class NPCLootDrop : GlobalNPC { public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) { - // BlasphemousBlade + // Blasphemous Blade if (npc.type == NPCID.BloodEelHead) npcLoot.Add(ItemDropRule.Common(ModContent.ItemType(), 12)); if (npc.type == NPCID.BloodNautilus) @@ -20,6 +20,9 @@ public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) // Rune Arc if (npc.type == NPCID.Pixie) npcLoot.Add(ItemDropRule.Common(ModContent.ItemType(), 8)); + // Gian Crusher + if (npc.type == NPCID.Golem) + npcLoot.Add(ItemDropRule.Common(ModContent.ItemType(), 1)); } } } diff --git a/Content/Items/Weapons/Melee/BlasphemousBlade.cs b/Content/Items/Weapons/Melee/BlasphemousBlade.cs index b0b5645..b965f3f 100644 --- a/Content/Items/Weapons/Melee/BlasphemousBlade.cs +++ b/Content/Items/Weapons/Melee/BlasphemousBlade.cs @@ -19,24 +19,25 @@ public class BlasphemousBlade : ModItem bool BonusLimit = false; // Blade default properties (without holding bonus) - int BaseDamage = 75; + int BaseDamage = 55; float BaseKnockBack = 5f; float BaseShootSpeed = 14f; SoundStyle BladeMaxChargeSound = new SoundStyle("EldenRingItems/Sounds/TogethaAsFamilee"); SoundStyle BladeStartChargingSound = new SoundStyle("EldenRingItems/Sounds/DemonshadeEnrage"); - - public override void SetStaticDefaults() - { - // 20 - Number of ticks after which the frame will change (3.5 frames per 60FPS); 8 - Quantity of frames in a blade texture - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(17, 8)); - // Allows animation rendering not only in the inventory, but also in the world - ItemID.Sets.AnimatesAsSoul[Type] = true; - } + SoundStyle BladeShootSound = SoundID.Item60; + + //public override void SetStaticDefaults() + //{ + // // 20 - Number of ticks after which the frame will change (3.5 frames per 60FPS); 8 - Quantity of frames in a blade texture + // Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(17, 8)); + // // Allows animation rendering not only in the inventory, but also in the world + // ItemID.Sets.AnimatesAsSoul[Type] = true; + //} public override void SetDefaults() { - Item.width = 94; + Item.width = 92; Item.height = 92; Item.DamageType = DamageClass.Melee; Item.damage = BaseDamage; @@ -48,7 +49,7 @@ public override void SetDefaults() Item.useStyle = ItemUseStyleID.Swing; Item.UseSound = SoundID.Item1; Item.value = Item.sellPrice(0, 75, 0, 0); - Item.rare = ItemRarityID.LightPurple; + Item.rare = ItemRarityID.LightRed; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = BaseShootSpeed; @@ -82,11 +83,14 @@ public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, { MadeChargedAttacks++; SoundEngine.PlaySound(SoundID.Item73, position); - player.Heal(Main.rand.Next(15, 41)); + player.Heal(Main.rand.Next(15, 31)); } } else - SoundEngine.PlaySound(SoundID.Item60, position); + { + BladeShootSound.Volume = 0.5f; + SoundEngine.PlaySound(BladeShootSound, position); + } return true; } @@ -98,10 +102,10 @@ public override void HoldStyle(Player player, Rectangle heldItemFrame) { HoldingCount++; HoldingDamageBonus += 0.003f; - Item.damage = Convert.ToInt32(BaseDamage * HoldingDamageBonus); + Item.damage = Convert.ToInt32(BaseDamage * (HoldingDamageBonus/1.7)); if (HoldingCount == 25) // Take away player's health every 25 mouseRight-holding events processed { - player.Hurt(PlayerDeathReason.ByCustomReason(""), 18, player.direction, armorPenetration: 1000); + player.Hurt(PlayerDeathReason.ByCustomReason(""), Main.rand.Next(10, 21), player.direction, armorPenetration: 1000); HoldingCount = 0; } } diff --git a/Content/Items/Weapons/Melee/BlasphemousBlade.png b/Content/Items/Weapons/Melee/BlasphemousBlade.png index beac3d7..2fba1be 100644 Binary files a/Content/Items/Weapons/Melee/BlasphemousBlade.png and b/Content/Items/Weapons/Melee/BlasphemousBlade.png differ diff --git a/Content/Items/Weapons/Melee/GiantCrusher.cs b/Content/Items/Weapons/Melee/GiantCrusher.cs new file mode 100644 index 0000000..2bcb266 --- /dev/null +++ b/Content/Items/Weapons/Melee/GiantCrusher.cs @@ -0,0 +1,39 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.Audio; +using Terraria.DataStructures; +using Microsoft.Xna.Framework; +using System; +using EldenRingItems.Projectiles.Melee; + +namespace EldenRingItems.Content.Items.Weapons.Melee +{ + public class GiantCrusher : ModItem + { + public override void SetDefaults() + { + Item.width = 120; + Item.height = 120; + Item.noUseGraphic = true; + Item.DamageType = DamageClass.MeleeNoSpeed; + Item.damage = 110; + Item.knockBack = 9f; + Item.useTime = 30; + Item.useAnimation = 30; + Item.autoReuse = true; + Item.noMelee = true; + Item.useTurn = true; + Item.useStyle = ItemUseStyleID.Swing; + Item.noUseGraphic = true; + Item.UseSound = SoundID.Item1; + Item.value = Item.sellPrice(0, 20, 0, 0); + Item.rare = ItemRarityID.Lime; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 17f; + } + + } + + +} diff --git a/Content/Items/Weapons/Melee/GiantCrusher.png b/Content/Items/Weapons/Melee/GiantCrusher.png new file mode 100644 index 0000000..6e83ec7 Binary files /dev/null and b/Content/Items/Weapons/Melee/GiantCrusher.png differ diff --git a/Localization/en-US_Mods.EldenRingItems.hjson b/Localization/en-US_Mods.EldenRingItems.hjson index d4929f8..bcd9f19 100644 --- a/Localization/en-US_Mods.EldenRingItems.hjson +++ b/Localization/en-US_Mods.EldenRingItems.hjson @@ -12,24 +12,34 @@ Items: { } RuneArc: { - DisplayName: Rune Arc + DisplayName: Rune arc Tooltip: Gives you a blessing! } BlasphemousBlade: { - DisplayName: Blasphemous Blade + DisplayName: Blasphemous blade Tooltip: ''' When holding it in your hand, press [c/939393:right mouse button] to increase the damage [c/757575:(in exchange for health)]. When the sword has taken the right amount of your health it will become [c/0078bd:charged] and make a special sound Attacking from the [c/0078bd:charged state] releases super-fast blast waves that cast [c/c90000:Hellfire] - on the target and replenish between [c/980000:75] and [c/980000:200] of your health + on the target and replenish between [c/980000:75] and [c/980000:150] of your health Attack from [c/939393:Normal State] strikes with a blood wave that replenishes [c/980000:1] to [c/980000:5] of your health. [c/757575:Sacred Sword of Rickard, Blasphemous Lord]. [c/75757575:The remains of the countless heroes he devoured wriggle on the surface of this blade]. [c/75757575:They are now one family, bound by ties of blood] ''' } + + GiantCrusher: { + DisplayName: Giant crusher + Tooltip: + ''' + [c/757575:A hammer made from a boulder, used in the War against the Giants.] + [c/757575:One of the heftiest weapons in the entire Lands Between.] + [c/757575:After the giants were quelled, and man turned against man in violence, this weapon was all but forgotten.] + ''' + } } Buffs: { @@ -39,4 +49,7 @@ Buffs: { } } -Projectiles.BloodSlash.DisplayName: Blood Slash +Projectiles: { + BloodSlash.DisplayName: Blood Slash + GiantCrusherProj.DisplayName: Giant Crusher Proj +} diff --git a/Localization/ru-RU_Mods.EldenRingItems.hjson b/Localization/ru-RU_Mods.EldenRingItems.hjson index 8c70ecf..82f9c56 100644 --- a/Localization/ru-RU_Mods.EldenRingItems.hjson +++ b/Localization/ru-RU_Mods.EldenRingItems.hjson @@ -23,13 +23,23 @@ Items: { При взятии в руку, зажмите [c/939393:правую кнопку мыши] для увеличения урона [c/757575:(взамен на здоровье)] Когда меч возьмёт себе нужное количество вашего здоровья он станет [c/0078bd:заряжённым] и издаст специальный звук Атака из [c/0078bd:заряжённого состояния] выпускает сверхбыстрые взрывные волны, которые накладывают [c/c90000:Адский Огонь] - на цель и восполняют от [c/980000:75] до [c/980000:200] вашего здоровья + на цель и восполняют от [c/980000:75] до [c/980000:150] вашего здоровья Атака из [c/939393:обычного состояния] наносит удары кровавой волной, которая восполняет от [c/980000:1] до [c/980000:5] вашего здоровья. [c/757575:Священный меч Рикарда, богохульного владыки] [c/757575:Останки бесчисленных героев, которых он поглотил, извиваются на поверхности этого клинка] [c/757575:Теперь они — одна семья, связанная узами крови] ''' } + + GiantCrusher: { + DisplayName: Гроза великанов + Tooltip: + ''' + [c/757575:Молот из огромного валуна, применявшийся в Великанской войне.] + [c/757575:В Междуземье практически нет равных ему в мощи.] + [c/757575:Когда великанов сокрушили, а человек обратился против человека, это оружие почти кануло в безвестность.] + ''' + } } Buffs: { @@ -39,4 +49,7 @@ Buffs: { } } -Projectiles.BloodSlash.DisplayName: Blood Slash +Projectiles: { + BloodSlash.DisplayName: Blood Slash + // GiantCrusherProj.DisplayName: Giant Crusher Proj +} diff --git a/Projectiles/Melee/BloodSlash.cs b/Projectiles/Melee/BloodSlash.cs index 6e806f6..9ff3b95 100644 --- a/Projectiles/Melee/BloodSlash.cs +++ b/Projectiles/Melee/BloodSlash.cs @@ -4,8 +4,6 @@ using Terraria.ID; using Terraria.ModLoader; -using EldenRingItems.Content.Items.Weapons; - namespace EldenRingItems.Projectiles.Melee { public class BloodSlash : ModProjectile diff --git a/Projectiles/Melee/GiantCrusherProj.cs b/Projectiles/Melee/GiantCrusherProj.cs new file mode 100644 index 0000000..32895e4 --- /dev/null +++ b/Projectiles/Melee/GiantCrusherProj.cs @@ -0,0 +1,82 @@ +using System; +using System.IO; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace EldenRingItems.Projectiles.Melee +{ + public class GiantCrusherProj : ModProjectile + { + public override string Texture => "EldenRingItems/Content/Items/Weapons/Melee/GiantCrusher"; + public static readonly SoundStyle hitSound = new("EldenRingItems/Sounds/GiantCrusherProjHit") { Volume = 0.2f }; + public bool returnProj = false; + public bool projHadHit = false; + + public override void SetDefaults() + { + Projectile.width = 120; + Projectile.height = 120; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.extraUpdates = 1; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 120; + Projectile.tileCollide = false; + Projectile.penetrate = 3; + Projectile.alpha = 100; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + Vector2 direction = player.Center - Projectile.Center; + float distance = direction.Length(); + + if (distance > 850f && !returnProj) // maximum distance a projectile can travel + returnProj = true; + else if (distance < 80f && returnProj) + Projectile.Kill(); + else if (returnProj) + { + direction.Normalize(); + direction *= 17f; + Projectile.velocity = direction; + } + + Lighting.AddLight(Projectile.Center, 0.322f, 0.082f, 0.027f); + + Projectile.rotation += 0.25f * Projectile.direction; + Projectile.alpha -= 2; + + // Stone Dust + if (Main.rand.NextBool(5)) // only spawn 20% of the time + Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Stone, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f, 150); + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Player player = Main.player[Projectile.owner]; + float numberOfDusts = 36f; + float rotFactor = 360f / numberOfDusts; + for (int i = 0; i < numberOfDusts; i++) + { + float rot = MathHelper.ToRadians(i * rotFactor); + Vector2 offset = new Vector2(3.6f, 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 4.1f)); + Vector2 velOffset = new Vector2(3f, 0).RotatedBy(rot * Main.rand.NextFloat(1.1f, 4.1f)); + Dust dust = Dust.NewDustPerfect(Projectile.Center + offset, DustID.Stone, new Vector2(velOffset.X, velOffset.Y)); + dust.noGravity = true; + dust.velocity = velOffset; + dust.scale = Main.rand.NextFloat(1f, 2f); + } + if (!projHadHit) // fixes a bug with repeated playback of the hit sound + { + SoundEngine.PlaySound(hitSound, Projectile.Center); + projHadHit = true; + } + Projectile.ai[1] = target.whoAmI; + } + } +} diff --git a/Sounds/GiantCrusherProjHit.ogg b/Sounds/GiantCrusherProjHit.ogg new file mode 100644 index 0000000..778f34d Binary files /dev/null and b/Sounds/GiantCrusherProjHit.ogg differ diff --git a/build.txt b/build.txt index 136c982..d6ea519 100644 --- a/build.txt +++ b/build.txt @@ -1,3 +1,3 @@ displayName = Elden Ring Items author = rzc0d3r -version = 0.0.2 \ No newline at end of file +version = 0.0.3 \ No newline at end of file