Add Nullified debuff, add Transcendent weapons and tool
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using ForgottenWawiTech.Content.Items.Materials;
|
||||
using ForgottenWawiTech.Content.Players;
|
||||
using ForgottenWawiTech.Content.Rarities;
|
||||
using ForgottenWawiTech.Content.Tiles.CraftingStations;
|
||||
|
||||
namespace ForgottenWawiTech.Content.Items.Accessories
|
||||
{
|
||||
public class AscendantSwarmModule : ModItem
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 30;
|
||||
Item.height = 34;
|
||||
Item.accessory = true;
|
||||
Item.value = Item.sellPrice(platinum: 240);
|
||||
Item.rare = ModContent.RarityType<TranscendentItem>();
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.maxMinions += 6;
|
||||
player.maxTurrets += 3;
|
||||
player.GetDamage(DamageClass.Summon) += 0.35f;
|
||||
player.GetAttackSpeed(DamageClass.Summon) += 0.20f;
|
||||
player.whipRangeMultiplier += 0.30f;
|
||||
player.GetKnockback(DamageClass.Summon) += 2f;
|
||||
player.buffImmune[BuffID.OnFire] = true;
|
||||
player.buffImmune[BuffID.CursedInferno] = true;
|
||||
player.buffImmune[BuffID.Venom] = true;
|
||||
|
||||
player.GetModPlayer<TranscendentPlayer>().HandleSwarmAccessory(Item);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe()
|
||||
.AddIngredient(ModContent.ItemType<ControlledSingularity>(), 6)
|
||||
.AddIngredient(ModContent.ItemType<SingularityAlloy>(), 8)
|
||||
.AddIngredient(ModContent.ItemType<EnergyCore>(), 10)
|
||||
.AddIngredient(ModContent.ItemType<MalfunctioningNanites>(), 16)
|
||||
.AddIngredient(ModContent.ItemType<UnstableMatter>(), 6)
|
||||
.AddTile(ModContent.TileType<SingularitySealingUnit>())
|
||||
.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
@@ -0,0 +1,54 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using ForgottenWawiTech.Content.Items.Materials;
|
||||
using ForgottenWawiTech.Content.Rarities;
|
||||
using ForgottenWawiTech.Content.Tiles.CraftingStations;
|
||||
|
||||
namespace ForgottenWawiTech.Content.Items.Accessories
|
||||
{
|
||||
public class TranscendentMatrix : ModItem
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 28;
|
||||
Item.height = 32;
|
||||
Item.value = Item.sellPrice(platinum: 250);
|
||||
Item.rare = ModContent.RarityType<TranscendentItem>();
|
||||
Item.accessory = true;
|
||||
Item.defense = 12;
|
||||
}
|
||||
|
||||
public override void UpdateAccessory(Player player, bool hideVisual)
|
||||
{
|
||||
player.GetDamage(DamageClass.Generic) += 0.25f;
|
||||
player.GetCritChance(DamageClass.Generic) += 15;
|
||||
player.endurance += 0.12f;
|
||||
player.statLifeMax2 += 160;
|
||||
player.statManaMax2 += 160;
|
||||
player.lifeRegen += 6;
|
||||
player.manaCost -= 0.12f;
|
||||
player.manaRegenBonus += 120;
|
||||
player.moveSpeed += 0.25f;
|
||||
player.GetAttackSpeed(DamageClass.Melee) += 0.15f;
|
||||
player.GetAttackSpeed(DamageClass.Summon) += 0.15f;
|
||||
player.lavaImmune = true;
|
||||
player.fireWalk = true;
|
||||
player.noKnockback = true;
|
||||
player.wingTimeMax = System.Math.Max(player.wingTimeMax, 1200);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe()
|
||||
.AddIngredient(ModContent.ItemType<ControlledSingularity>(), 6)
|
||||
.AddIngredient(ModContent.ItemType<SingularityAlloy>(), 8)
|
||||
.AddIngredient(ModContent.ItemType<EnergyCore>(), 12)
|
||||
.AddIngredient(ModContent.ItemType<MalfunctioningNanites>(), 16)
|
||||
.AddIngredient(ModContent.ItemType<UnstableMatter>(), 6)
|
||||
.AddIngredient(ItemID.CelestialShell)
|
||||
.AddTile(ModContent.TileType<SingularitySealingUnit>())
|
||||
.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
@@ -36,7 +36,7 @@ namespace ForgottenWawiTech.Content.Items.Materials
|
||||
{
|
||||
CreateRecipe()
|
||||
.AddIngredient(ModContent.ItemType<RGBass>(), 1)
|
||||
.AddIngredient(ModContent.ItemType<VisorShard>(), 5)
|
||||
.AddIngredient(ModContent.ItemType<MalfunctioningNanites>(), 5)
|
||||
.AddTile(TileID.Anvils)
|
||||
.Register();
|
||||
}
|
||||
|
||||
@@ -1,13 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using ForgottenWawiTech.Content.Items.Materials;
|
||||
using ForgottenWawiTech.Content.Rarities;
|
||||
using Terraria.ModLoader.IO;
|
||||
using Terraria.Localization;
|
||||
|
||||
namespace ForgottenWawiTech.Content.Items.Tools.SingularitySet
|
||||
{
|
||||
public class SingularityMultitool : ModItem
|
||||
{
|
||||
private bool hammerMode;
|
||||
private const int PickaxePower = 500;
|
||||
private const int HammerPower = 500;
|
||||
private const int AxePower = 500;
|
||||
|
||||
protected override bool CloneNewInstances => true;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 500;
|
||||
@@ -23,8 +35,52 @@ namespace ForgottenWawiTech.Content.Items.Tools.SingularitySet
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.autoReuse = true;
|
||||
Item.useTurn = true;
|
||||
Item.axe = 500;
|
||||
Item.pick = 500;
|
||||
Item.axe = AxePower;
|
||||
Item.pick = PickaxePower;
|
||||
Item.hammer = 0;
|
||||
ApplyMode();
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
ToggleMode(player);
|
||||
return false;
|
||||
}
|
||||
|
||||
ApplyMode();
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
string modeText = hammerMode ? "Hammer" : "Pickaxe";
|
||||
tooltips.Add(new TooltipLine(Mod, "SingularityMultitoolMode", $"Current Mode: {modeText}"));
|
||||
}
|
||||
|
||||
public override void SaveData(TagCompound tag)
|
||||
{
|
||||
tag["HammerMode"] = hammerMode;
|
||||
}
|
||||
|
||||
public override void LoadData(TagCompound tag)
|
||||
{
|
||||
hammerMode = tag.GetBool("HammerMode");
|
||||
ApplyMode();
|
||||
}
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(hammerMode);
|
||||
}
|
||||
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
hammerMode = reader.ReadBoolean();
|
||||
ApplyMode();
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
@@ -35,5 +91,36 @@ namespace ForgottenWawiTech.Content.Items.Tools.SingularitySet
|
||||
.AddTile<Content.Tiles.CraftingStations.SingularitySealingUnit>()
|
||||
.Register();
|
||||
}
|
||||
|
||||
private void ToggleMode(Player player)
|
||||
{
|
||||
hammerMode = !hammerMode;
|
||||
ApplyMode();
|
||||
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
string itemName = Lang.GetItemNameValue(Item.type);
|
||||
string modeText = hammerMode ? "Hammer" : "Pickaxe";
|
||||
Main.NewText($"{itemName} switched to {modeText} mode.", 190, 120, 255);
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(SoundID.MenuTick, player.Center);
|
||||
}
|
||||
|
||||
private void ApplyMode()
|
||||
{
|
||||
if (hammerMode)
|
||||
{
|
||||
Item.pick = 0;
|
||||
Item.hammer = HammerPower;
|
||||
}
|
||||
else
|
||||
{
|
||||
Item.pick = PickaxePower;
|
||||
Item.hammer = 0;
|
||||
}
|
||||
|
||||
Item.axe = AxePower;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,150 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using ForgottenWawiTech.Content.Items.Materials;
|
||||
using ForgottenWawiTech.Content.Rarities;
|
||||
using ForgottenWawiTech.Content.Tiles.CraftingStations;
|
||||
using Terraria.ModLoader.IO;
|
||||
using Terraria.Localization;
|
||||
|
||||
namespace ForgottenWawiTech.Content.Items.Tools.Transcendent
|
||||
{
|
||||
public class TranscendentOmnitool : ModItem
|
||||
{
|
||||
private bool hammerMode;
|
||||
private const int PickaxePower = 420;
|
||||
private const int HammerPower = 350;
|
||||
private const int AxePower = 80;
|
||||
|
||||
protected override bool CloneNewInstances => true;
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 42;
|
||||
Item.height = 42;
|
||||
Item.damage = 220;
|
||||
Item.DamageType = DamageClass.Melee;
|
||||
Item.knockBack = 6f;
|
||||
Item.useTime = 5;
|
||||
Item.useAnimation = 10;
|
||||
Item.pick = PickaxePower;
|
||||
Item.axe = AxePower;
|
||||
Item.hammer = 0;
|
||||
Item.tileBoost += 6;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.UseSound = SoundID.Item15;
|
||||
Item.value = Item.sellPrice(platinum: 260);
|
||||
Item.rare = ModContent.RarityType<TranscendentItem>();
|
||||
ApplyMode();
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player) => true;
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
ToggleMode(player);
|
||||
return false;
|
||||
}
|
||||
|
||||
ApplyMode();
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
ApplyMode();
|
||||
player.blockRange += 3;
|
||||
player.pickSpeed -= 0.25f;
|
||||
if (player.pickSpeed < 0.35f)
|
||||
{
|
||||
player.pickSpeed = 0.35f;
|
||||
}
|
||||
|
||||
player.AddBuff(BuffID.Dangersense, 2);
|
||||
player.AddBuff(BuffID.Shine, 2);
|
||||
}
|
||||
|
||||
public override void ModifyHitNPC(Player player, NPC target, ref NPC.HitModifiers modifiers)
|
||||
{
|
||||
modifiers.SourceDamage *= 1.25f;
|
||||
}
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
string modeText = hammerMode ? "Hammer" : "Pickaxe";
|
||||
tooltips.Add(new TooltipLine(Mod, "TranscendentOmnitoolMode", $"Current Mode: {modeText}"));
|
||||
}
|
||||
|
||||
public override void SaveData(TagCompound tag)
|
||||
{
|
||||
tag["HammerMode"] = hammerMode;
|
||||
}
|
||||
|
||||
public override void LoadData(TagCompound tag)
|
||||
{
|
||||
hammerMode = tag.GetBool("HammerMode");
|
||||
ApplyMode();
|
||||
}
|
||||
|
||||
public override void NetSend(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(hammerMode);
|
||||
}
|
||||
|
||||
public override void NetReceive(BinaryReader reader)
|
||||
{
|
||||
hammerMode = reader.ReadBoolean();
|
||||
ApplyMode();
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe()
|
||||
.AddIngredient(ModContent.ItemType<ControlledSingularity>(), 6)
|
||||
.AddIngredient(ModContent.ItemType<SingularityAlloy>(), 10)
|
||||
.AddIngredient(ModContent.ItemType<EnergyCore>(), 14)
|
||||
.AddIngredient(ModContent.ItemType<MalfunctioningNanites>(), 18)
|
||||
.AddIngredient(ModContent.ItemType<UnstableMatter>(), 6)
|
||||
.AddTile(ModContent.TileType<SingularitySealingUnit>())
|
||||
.Register();
|
||||
}
|
||||
|
||||
private void ToggleMode(Player player)
|
||||
{
|
||||
hammerMode = !hammerMode;
|
||||
ApplyMode();
|
||||
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
string itemName = Lang.GetItemNameValue(Item.type);
|
||||
string modeText = hammerMode ? "Hammer" : "Pickaxe";
|
||||
Main.NewText($"{itemName} switched to {modeText} mode.", 120, 255, 225);
|
||||
}
|
||||
|
||||
SoundEngine.PlaySound(SoundID.MenuTick, player.Center);
|
||||
}
|
||||
|
||||
private void ApplyMode()
|
||||
{
|
||||
if (hammerMode)
|
||||
{
|
||||
Item.pick = 0;
|
||||
Item.hammer = HammerPower;
|
||||
}
|
||||
else
|
||||
{
|
||||
Item.pick = PickaxePower;
|
||||
Item.hammer = 0;
|
||||
}
|
||||
|
||||
Item.axe = AxePower;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
@@ -1,6 +1,5 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -12,110 +11,67 @@ namespace ForgottenWawiTech.Content.Items.Weapons.Magic
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.damage = 15000;
|
||||
Item.mana = 30;
|
||||
Item.damage = 520;
|
||||
Item.mana = 22;
|
||||
Item.crit = 100;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.width = 40;
|
||||
Item.height = 40;
|
||||
Item.useTime = 20;
|
||||
Item.useAnimation = 20;
|
||||
Item.useTime = 14;
|
||||
Item.useAnimation = 14;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.knockBack = 6;
|
||||
Item.value = Item.buyPrice(platinum: 20);
|
||||
Item.knockBack = 4.5f;
|
||||
Item.value = Item.sellPrice(gold: 32);
|
||||
Item.rare = ModContent.RarityType<SingularityItem>();
|
||||
Item.autoReuse = true;
|
||||
Item.noMelee = true;
|
||||
Item.shoot = ProjectileID.PurificationPowder;
|
||||
Item.shootSpeed = 50f;
|
||||
Item.shoot = ProjectileID.NebulaBlaze1;
|
||||
Item.shootSpeed = 20f;
|
||||
Item.useAmmo = AmmoID.None;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, Terraria.DataStructures.EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockBack)
|
||||
{
|
||||
// Shoot every projectile from vanilla Terraria magic weapons at once.
|
||||
int[] projectiles = new int[] {
|
||||
// Pre-Hardmode Magic Weapons
|
||||
ProjectileID.WandOfSparkingSpark,
|
||||
ProjectileID.AmethystBolt,
|
||||
ProjectileID.TopazBolt,
|
||||
ProjectileID.SapphireBolt,
|
||||
ProjectileID.EmeraldBolt,
|
||||
ProjectileID.RubyBolt,
|
||||
ProjectileID.DiamondBolt,
|
||||
ProjectileID.AmberBolt,
|
||||
ProjectileID.VilethornBase,
|
||||
ProjectileID.VilethornTip,
|
||||
ProjectileID.Bee,
|
||||
ProjectileID.WaterStream,
|
||||
ProjectileID.BookOfSkullsSkull,
|
||||
ProjectileID.DemonScythe,
|
||||
ProjectileID.ThunderSpear,
|
||||
ProjectileID.FlowerPetal,
|
||||
ProjectileID.Flamelash,
|
||||
ProjectileID.MagicMissile,
|
||||
// Hardmode Magic Weapons
|
||||
ProjectileID.SkyFracture,
|
||||
ProjectileID.CrystalShard,
|
||||
ProjectileID.CrystalStorm,
|
||||
ProjectileID.CursedFlameFriendly,
|
||||
ProjectileID.GoldenShowerFriendly,
|
||||
//ProjectileID.CrystalSerpent,
|
||||
ProjectileID.Meteor1,
|
||||
ProjectileID.Meteor2,
|
||||
ProjectileID.Meteor3,
|
||||
ProjectileID.RainbowRodBullet,
|
||||
//ProjectileID.MagicalHarp,
|
||||
ProjectileID.IceBlock,
|
||||
ProjectileID.RainCloudRaining,
|
||||
ProjectileID.PoisonFang,
|
||||
ProjectileID.VenomFang,
|
||||
ProjectileID.NettleBurstLeft,
|
||||
ProjectileID.NettleBurstRight,
|
||||
//ProjectileID.LeafBlowerLeaf,
|
||||
ProjectileID.ShadowBeamFriendly,
|
||||
ProjectileID.SpectreWrath,
|
||||
ProjectileID.InfernoFriendlyBolt,
|
||||
ProjectileID.MagnetSphereBall,
|
||||
ProjectileID.MagnetSphereBolt,
|
||||
ProjectileID.RainbowFront,
|
||||
ProjectileID.RainbowBack,
|
||||
ProjectileID.NorthPoleSnowflake,
|
||||
ProjectileID.Blizzard,
|
||||
ProjectileID.HeatRay,
|
||||
ProjectileID.LaserMachinegunLaser,
|
||||
ProjectileID.ChargedBlasterOrb,
|
||||
ProjectileID.Bubble,
|
||||
ProjectileID.NightBeam,
|
||||
ProjectileID.LightBeam,
|
||||
ProjectileID.LunarFlare,
|
||||
ProjectileID.NebulaArcanum,
|
||||
Vector2 direction = velocity.LengthSquared() > 0.0001f ? Vector2.Normalize(velocity) : new Vector2(player.direction, 0f);
|
||||
int[] primaryBolts =
|
||||
{
|
||||
ProjectileID.NebulaBlaze1,
|
||||
ProjectileID.NebulaBlaze2,
|
||||
ProjectileID.LastPrismLaser,
|
||||
ProjectileID.ShadowFlame,
|
||||
ProjectileID.ToxicFlask,
|
||||
ProjectileID.BookStaffShot,
|
||||
// Special/Event Magic Weapons
|
||||
ProjectileID.FlaironBubble,
|
||||
ProjectileID.UnholyTridentFriendly,
|
||||
ProjectileID.RainFriendly,
|
||||
ProjectileID.IceSickle,
|
||||
ProjectileID.FrostBoltStaff,
|
||||
ProjectileID.CrystalLeafShot,
|
||||
ProjectileID.Spark,
|
||||
ProjectileID.BeeArrow,
|
||||
ProjectileID.Wasp,
|
||||
ProjectileID.DD2PhoenixBowShot,
|
||||
ProjectileID.MonkStaffT1,
|
||||
ProjectileID.MonkStaffT2,
|
||||
ProjectileID.MonkStaffT3,
|
||||
ProjectileID.SkyFracture,
|
||||
ProjectileID.ShadowBeamFriendly,
|
||||
ProjectileID.CrystalShard,
|
||||
ProjectileID.CrystalLeafShot
|
||||
};
|
||||
foreach (int projectileType in projectiles)
|
||||
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Terraria.Projectile.NewProjectile(source, position, velocity, projectileType, damage, knockBack, player.whoAmI);
|
||||
int projType = primaryBolts[Main.rand.Next(primaryBolts.Length)];
|
||||
Vector2 perturbedVelocity = direction.RotatedByRandom(MathHelper.ToRadians(8f)) * Item.shootSpeed * Main.rand.NextFloat(0.98f, 1.18f);
|
||||
int proj = Projectile.NewProjectile(source, position, perturbedVelocity, projType, (int)(damage * 0.95f), knockBack, player.whoAmI);
|
||||
if (proj >= 0)
|
||||
{
|
||||
Main.projectile[proj].DamageType = DamageClass.Magic;
|
||||
}
|
||||
}
|
||||
return false; // return false to prevent tModLoader from shooting the default projectile
|
||||
|
||||
int lingeringType = ProjectileID.MagnetSphereBall;
|
||||
Vector2 orbitalVel = direction.RotatedBy(MathHelper.ToRadians(Main.rand.NextBool() ? 22f : -22f)) * (Item.shootSpeed * 0.68f);
|
||||
int sphere = Projectile.NewProjectile(source, position, orbitalVel, lingeringType, (int)(damage * 0.85f), 0f, player.whoAmI);
|
||||
if (sphere >= 0)
|
||||
{
|
||||
Main.projectile[sphere].DamageType = DamageClass.Magic;
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
int burst = Projectile.NewProjectile(source, position, direction * (Item.shootSpeed * 0.85f), ProjectileID.NebulaArcanum, (int)(damage * 0.7f), knockBack * 0.6f, player.whoAmI);
|
||||
if (burst >= 0)
|
||||
{
|
||||
Main.projectile[burst].DamageType = DamageClass.Magic;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset() {
|
||||
@@ -123,7 +79,8 @@ namespace ForgottenWawiTech.Content.Items.Weapons.Magic
|
||||
}
|
||||
|
||||
public override void ModifyShootStats(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) {
|
||||
Vector2 muzzleOffset = Vector2.Normalize(velocity) * 25f;
|
||||
Vector2 direction = velocity.LengthSquared() > 0.0001f ? Vector2.Normalize(velocity) : new Vector2(player.direction, 0f);
|
||||
Vector2 muzzleOffset = direction * 25f;
|
||||
|
||||
if (Collision.CanHit(position, 0, 0, position + muzzleOffset, 0, 0)) {
|
||||
position += muzzleOffset;
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using ForgottenWawiTech.Content.Items.Materials;
|
||||
using ForgottenWawiTech.Content.Projectiles.Transcendent;
|
||||
using ForgottenWawiTech.Content.Rarities;
|
||||
using ForgottenWawiTech.Content.Tiles.CraftingStations;
|
||||
|
||||
namespace ForgottenWawiTech.Content.Items.Weapons.Magic
|
||||
{
|
||||
public class TranscendentSingularityStaff : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
Item.staff[Type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 64;
|
||||
Item.height = 64;
|
||||
Item.damage = 5000;
|
||||
Item.DamageType = DamageClass.Magic;
|
||||
Item.knockBack = 5f;
|
||||
Item.crit = 50;
|
||||
Item.mana = 50;
|
||||
Item.useTime = 18;
|
||||
Item.useAnimation = 18;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.UseSound = SoundID.Item73;
|
||||
Item.autoReuse = true;
|
||||
Item.noMelee = true;
|
||||
Item.shootSpeed = 20f;
|
||||
Item.shoot = ModContent.ProjectileType<TranscendentNova>();
|
||||
Item.value = Item.sellPrice(platinum: 310);
|
||||
Item.rare = ModContent.RarityType<TranscendentItem>();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 spawnPosition = player.Center + new Vector2(0f, -16f);
|
||||
Vector2 spawnVelocity = velocity * 0.6f + player.velocity * 0.4f;
|
||||
spawnVelocity = spawnVelocity.RotatedByRandom(MathHelper.ToRadians(8f));
|
||||
|
||||
Projectile.NewProjectile(source, spawnPosition, spawnVelocity, type, damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe()
|
||||
.AddIngredient(ModContent.ItemType<ControlledSingularity>(), 8)
|
||||
.AddIngredient(ModContent.ItemType<SingularityAlloy>(), 10)
|
||||
.AddIngredient(ModContent.ItemType<EnergyCore>(), 12)
|
||||
.AddIngredient(ModContent.ItemType<MalfunctioningNanites>(), 20)
|
||||
.AddIngredient(ModContent.ItemType<UnstableMatter>(), 8)
|
||||
.AddTile(ModContent.TileType<SingularitySealingUnit>())
|
||||
.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
@@ -0,0 +1,73 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using ForgottenWawiTech.Content.Items.Materials;
|
||||
using ForgottenWawiTech.Content.Projectiles.Transcendent;
|
||||
using ForgottenWawiTech.Content.Rarities;
|
||||
using ForgottenWawiTech.Content.Tiles.CraftingStations;
|
||||
|
||||
namespace ForgottenWawiTech.Content.Items.Weapons.Melee
|
||||
{
|
||||
public class TranscendentBlade : ModItem
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 68;
|
||||
Item.height = 68;
|
||||
Item.damage = 5000;
|
||||
Item.DamageType = DamageClass.Melee;
|
||||
Item.knockBack = 8f;
|
||||
Item.crit = 24;
|
||||
Item.useTime = 14;
|
||||
Item.useAnimation = 14;
|
||||
Item.useStyle = ItemUseStyleID.Swing;
|
||||
Item.autoReuse = true;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.value = Item.sellPrice(platinum: 300);
|
||||
Item.rare = ModContent.RarityType<TranscendentItem>();
|
||||
Item.shoot = ModContent.ProjectileType<TranscendentBladeShard>();
|
||||
Item.shootSpeed = 19f;
|
||||
}
|
||||
|
||||
public override void MeleeEffects(Player player, Rectangle hitbox)
|
||||
{
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Vector2 spawnPosition = new Vector2(hitbox.X, hitbox.Y);
|
||||
Dust dust = Dust.NewDustDirect(spawnPosition, hitbox.Width, hitbox.Height, DustID.RainbowTorch, player.velocity.X * 0.2f, player.velocity.Y * 0.2f, 150, default, 1.3f);
|
||||
dust.noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, Terraria.DataStructures.EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 baseVelocity = Vector2.Normalize(velocity) * Item.shootSpeed;
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Vector2 perturbedVelocity = baseVelocity.RotatedByRandom(MathHelper.ToRadians(22f)) * Main.rand.NextFloat(0.8f, 1.1f);
|
||||
Projectile.NewProjectile(source, player.Center, perturbedVelocity, type, (int)(damage * 0.8f), knockback * 0.6f, player.whoAmI);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
target.AddBuff(BuffID.Daybreak, 420);
|
||||
target.AddBuff(BuffID.BetsysCurse, 300);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe()
|
||||
.AddIngredient(ModContent.ItemType<ControlledSingularity>(), 8)
|
||||
.AddIngredient(ModContent.ItemType<SingularityAlloy>(), 12)
|
||||
.AddIngredient(ModContent.ItemType<EnergyCore>(), 14)
|
||||
.AddIngredient(ModContent.ItemType<MalfunctioningNanites>(), 20)
|
||||
.AddIngredient(ModContent.ItemType<UnstableMatter>(), 8)
|
||||
.AddTile(ModContent.TileType<SingularitySealingUnit>())
|
||||
.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
@@ -0,0 +1,63 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using ForgottenWawiTech.Content.Items.Materials;
|
||||
using ForgottenWawiTech.Content.Projectiles.Transcendent;
|
||||
using ForgottenWawiTech.Content.Rarities;
|
||||
using ForgottenWawiTech.Content.Tiles.CraftingStations;
|
||||
|
||||
namespace ForgottenWawiTech.Content.Items.Weapons.Ranged
|
||||
{
|
||||
public class TranscendentRailcannon : ModItem
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.width = 74;
|
||||
Item.height = 32;
|
||||
Item.damage = 5000;
|
||||
Item.DamageType = DamageClass.Ranged;
|
||||
Item.knockBack = 6f;
|
||||
Item.crit = 28;
|
||||
Item.useTime = 7;
|
||||
Item.useAnimation = 7;
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.UseSound = SoundID.Item38;
|
||||
Item.autoReuse = true;
|
||||
Item.noMelee = true;
|
||||
Item.value = Item.sellPrice(platinum: 320);
|
||||
Item.rare = ModContent.RarityType<TranscendentItem>();
|
||||
Item.shoot = ModContent.ProjectileType<TranscendentRailBolt>();
|
||||
Item.shootSpeed = 26f;
|
||||
Item.useAmmo = AmmoID.None;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 direction = velocity.LengthSquared() > 0.0001f ? Vector2.Normalize(velocity) : new Vector2(player.direction, 0f);
|
||||
Vector2 muzzleOffset = direction * 32f;
|
||||
Vector2 spawnPosition = position + muzzleOffset;
|
||||
|
||||
Projectile.NewProjectile(source, spawnPosition, direction * Item.shootSpeed, type, damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override Vector2? HoldoutOffset()
|
||||
{
|
||||
return new Vector2(-10f, 0f);
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe()
|
||||
.AddIngredient(ModContent.ItemType<ControlledSingularity>(), 8)
|
||||
.AddIngredient(ModContent.ItemType<SingularityAlloy>(), 10)
|
||||
.AddIngredient(ModContent.ItemType<EnergyCore>(), 16)
|
||||
.AddIngredient(ModContent.ItemType<MalfunctioningNanites>(), 24)
|
||||
.AddIngredient(ModContent.ItemType<UnstableMatter>(), 8)
|
||||
.AddTile(ModContent.TileType<SingularitySealingUnit>())
|
||||
.Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 504 B |
Reference in New Issue
Block a user