Add Nullified debuff, add Transcendent weapons and tool
This commit is contained in:
@@ -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