From bc2c06337bf706b02bde93d4e510a9cf992b13d7 Mon Sep 17 00:00:00 2001 From: Niko Date: Mon, 10 Nov 2025 00:24:45 +0000 Subject: [PATCH] Add Visor Shard and RGBAlloy, rework Pete --- Content/Items/BoulderCannon.cs | 44 +++++++++---------------- Content/Items/Materials/RGAlloy.png | Bin 0 -> 504 bytes Content/Items/Materials/RGBAlloy.cs | 17 ++++++++++ Content/Items/Materials/VisorShard.cs | 17 ++++++++++ Content/Items/Materials/VisorShard.png | Bin 0 -> 504 bytes 5 files changed, 49 insertions(+), 29 deletions(-) create mode 100644 Content/Items/Materials/RGAlloy.png create mode 100644 Content/Items/Materials/RGBAlloy.cs create mode 100644 Content/Items/Materials/VisorShard.cs create mode 100644 Content/Items/Materials/VisorShard.png diff --git a/Content/Items/BoulderCannon.cs b/Content/Items/BoulderCannon.cs index a34b547..04f4eb3 100644 --- a/Content/Items/BoulderCannon.cs +++ b/Content/Items/BoulderCannon.cs @@ -4,6 +4,7 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using ForgottenWawiTech.Content.Rarities; namespace ForgottenWawiTech.Content.Items { @@ -11,8 +12,8 @@ namespace ForgottenWawiTech.Content.Items { public override void SetDefaults() { - Item.damage = 10000; - Item.DamageType = DamageClass.Ranged; + Item.damage = 1; + Item.DamageType = DamageClass.Magic; Item.width = 40; Item.height = 40; Item.useTime = 100; @@ -20,7 +21,7 @@ namespace ForgottenWawiTech.Content.Items Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 6; Item.value = Item.buyPrice(gold: 20); - Item.rare = ItemRarityID.Red; + Item.rare = ModContent.RarityType(); Item.UseSound = SoundID.Dig; Item.autoReuse = true; Item.noMelee = true; @@ -32,29 +33,23 @@ namespace ForgottenWawiTech.Content.Items // On shoot, fire Projectile ID 502 (the rainbow projectile) instead of the default ammo projectile public override bool Shoot(Player player, Terraria.DataStructures.EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack) { - // If the player's name contains "Neptune" or "Otter", instakill the player. - if (player.name.Contains("Neptune") || player.name.Contains("Otter")) + // Kill the first player with a name containing "Neptune" or "Otter" (case insensitive) in multiplayer + if (Main.netMode == NetmodeID.MultiplayerClient) { - player.KillMe(Terraria.DataStructures.PlayerDeathReason.ByCustomReason(player.name + " was punished accordingly."), 10000, 0); - return false; - } - - // Block the weapon if there is a boss alive -/* for (int i = 0; i < Main.maxNPCs; i++) - { - NPC npc = Main.npc[i]; - if (npc.active && npc.boss) + for (int i = 0; i < Main.maxPlayers; i++) { - if (Main.myPlayer == player.whoAmI) + Player targetPlayer = Main.player[i]; + if (targetPlayer.active && (targetPlayer.name.ToLower().Contains("neptune") || targetPlayer.name.ToLower().Contains("otter"))) { - Main.NewText("The Boulder Cannon refuses to fire while a boss is alive!", 255, 0, 0); + targetPlayer.KillMe(Terraria.DataStructures.PlayerDeathReason.ByCustomReason($"{targetPlayer.name} was vaporized!"), 99999, 0); + NetMessage.SendData(MessageID.PlayerDeath, -1, -1, null, i); + break; // Only kill one player per shot } - return false; } - } */ - - Terraria.Projectile.NewProjectile(source, position, velocity, 1013, damage, knockBack, player.whoAmI); + } + // If no such player was found, suicide. + player.KillMe(Terraria.DataStructures.PlayerDeathReason.ByCustomReason($"{player.name} was consumed by power!"), 99999, 0); return false; // return false to prevent tModLoader from shooting the default projectile } @@ -69,14 +64,5 @@ namespace ForgottenWawiTech.Content.Items position += muzzleOffset; } } - - public override void AddRecipes() - { - Recipe recipe = CreateRecipe(); - recipe.AddIngredient(ItemID.BouncyBoulder, 100); - recipe.AddIngredient(ItemID.LunarBar, 20); - recipe.AddTile(TileID.LunarCraftingStation); - recipe.Register(); - } } } diff --git a/Content/Items/Materials/RGAlloy.png b/Content/Items/Materials/RGAlloy.png new file mode 100644 index 0000000000000000000000000000000000000000..9e0cf81e52f4133dbe85453dd9a37993af17b5be GIT binary patch literal 504 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVBbOU@sT!FNbf{DF-NtsjE_3B;! z|NjSy0D+K@p01v+t9x8zR#D@WS?dlQ`1+YJESG!@x4dC7*`C93=UXkhhvvt!hjSLlJ~RwmnP~Bh_e#*cGOJz5H)U2RZk=*d{>S{o z|7E^K_FWXNcxrjXh&wV*Hfp0Ti%!ljhM&t`NT+&77>M@wN(xASbQfH=B6&8`PK|k& o(pT;d?|57xzrgJ7^Ax@sCjQeEzP*#>W`d&2)78&qol`;+07t#pIRF3v literal 0 HcmV?d00001 diff --git a/Content/Items/Materials/RGBAlloy.cs b/Content/Items/Materials/RGBAlloy.cs new file mode 100644 index 0000000..03bb905 --- /dev/null +++ b/Content/Items/Materials/RGBAlloy.cs @@ -0,0 +1,17 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace ForgottenWawiTech.Content.Items.Materials +{ + public class RGBAlloy : ModItem + { + + public override void SetDefaults() + { + Item.width = 20; + Item.height = 20; + Item.maxStack = 9999; + Item.rare = ItemRarityID.White; + } + } +} \ No newline at end of file diff --git a/Content/Items/Materials/VisorShard.cs b/Content/Items/Materials/VisorShard.cs new file mode 100644 index 0000000..985845c --- /dev/null +++ b/Content/Items/Materials/VisorShard.cs @@ -0,0 +1,17 @@ +using Terraria.ID; +using Terraria.ModLoader; + +namespace ForgottenWawiTech.Content.Items.Materials +{ + public class VisorShard : ModItem + { + + public override void SetDefaults() + { + Item.width = 20; + Item.height = 20; + Item.maxStack = 9999; + Item.rare = ItemRarityID.White; + } + } +} \ No newline at end of file diff --git a/Content/Items/Materials/VisorShard.png b/Content/Items/Materials/VisorShard.png new file mode 100644 index 0000000000000000000000000000000000000000..9e0cf81e52f4133dbe85453dd9a37993af17b5be GIT binary patch literal 504 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVBbOU@sT!FNbf{DF-NtsjE_3B;! z|NjSy0D+K@p01v+t9x8zR#D@WS?dlQ`1+YJESG!@x4dC7*`C93=UXkhhvvt!hjSLlJ~RwmnP~Bh_e#*cGOJz5H)U2RZk=*d{>S{o z|7E^K_FWXNcxrjXh&wV*Hfp0Ti%!ljhM&t`NT+&77>M@wN(xASbQfH=B6&8`PK|k& o(pT;d?|57xzrgJ7^Ax@sCjQeEzP*#>W`d&2)78&qol`;+07t#pIRF3v literal 0 HcmV?d00001