Add Visor Shard and RGBAlloy, rework Pete
This commit is contained in:
@@ -4,6 +4,7 @@ using Terraria.Audio;
|
|||||||
using Terraria.DataStructures;
|
using Terraria.DataStructures;
|
||||||
using Terraria.ID;
|
using Terraria.ID;
|
||||||
using Terraria.ModLoader;
|
using Terraria.ModLoader;
|
||||||
|
using ForgottenWawiTech.Content.Rarities;
|
||||||
|
|
||||||
namespace ForgottenWawiTech.Content.Items
|
namespace ForgottenWawiTech.Content.Items
|
||||||
{
|
{
|
||||||
@@ -11,8 +12,8 @@ namespace ForgottenWawiTech.Content.Items
|
|||||||
{
|
{
|
||||||
public override void SetDefaults()
|
public override void SetDefaults()
|
||||||
{
|
{
|
||||||
Item.damage = 10000;
|
Item.damage = 1;
|
||||||
Item.DamageType = DamageClass.Ranged;
|
Item.DamageType = DamageClass.Magic;
|
||||||
Item.width = 40;
|
Item.width = 40;
|
||||||
Item.height = 40;
|
Item.height = 40;
|
||||||
Item.useTime = 100;
|
Item.useTime = 100;
|
||||||
@@ -20,7 +21,7 @@ namespace ForgottenWawiTech.Content.Items
|
|||||||
Item.useStyle = ItemUseStyleID.Shoot;
|
Item.useStyle = ItemUseStyleID.Shoot;
|
||||||
Item.knockBack = 6;
|
Item.knockBack = 6;
|
||||||
Item.value = Item.buyPrice(gold: 20);
|
Item.value = Item.buyPrice(gold: 20);
|
||||||
Item.rare = ItemRarityID.Red;
|
Item.rare = ModContent.RarityType<FWTDeveloperItem>();
|
||||||
Item.UseSound = SoundID.Dig;
|
Item.UseSound = SoundID.Dig;
|
||||||
Item.autoReuse = true;
|
Item.autoReuse = true;
|
||||||
Item.noMelee = 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
|
// 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)
|
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.
|
// Kill the first player with a name containing "Neptune" or "Otter" (case insensitive) in multiplayer
|
||||||
if (player.name.Contains("Neptune") || player.name.Contains("Otter"))
|
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||||
{
|
{
|
||||||
player.KillMe(Terraria.DataStructures.PlayerDeathReason.ByCustomReason(player.name + " was punished accordingly."), 10000, 0);
|
for (int i = 0; i < Main.maxPlayers; i++)
|
||||||
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)
|
|
||||||
{
|
{
|
||||||
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
|
return false; // return false to prevent tModLoader from shooting the default projectile
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,14 +64,5 @@ namespace ForgottenWawiTech.Content.Items
|
|||||||
position += muzzleOffset;
|
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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
Reference in New Issue
Block a user