1 - Draedon's Arsenal weapon fixes.
This commit is contained in:
1 parent
170e0f33c5
commit
758402fa2d
19 files changed
+84
-69
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -36,10 +37,10 @@ namespace CalamityMod.Items.Tools
|
||||
Item.autoReuse = true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int powderDamage = (int)(0.85f * damage);
|
||||
int idx = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, powderDamage, knockBack, player.whoAmI, 0f, 0f);
|
||||
int idx = Projectile.NewProjectile(source, position, velocity, type, powderDamage, knockback, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[idx].DamageType = DamageClass.Melee;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -54,12 +55,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void SafeModifyTooltips(List<TooltipLine> tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2);
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
damage = (int)(damage * 0.9f);
|
||||
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -54,10 +55,10 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3);
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
float swingOffset = Main.rand.NextFloat(0.5f, 1f) * Item.shootSpeed * 1.6f * player.direction;
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, swingOffset);
|
||||
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, swingOffset);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -37,7 +38,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
Item.mana = 6;
|
||||
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/GatlingLaserFireStart");
|
||||
Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/GatlingLaserFireStart");
|
||||
Item.noMelee = true;
|
||||
|
||||
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
|
||||
@@ -56,9 +57,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3);
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<GatlingLaserProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<GatlingLaserProj>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
Item.autoReuse = true;
|
||||
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/GaussWeaponFire");
|
||||
Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/GaussWeaponFire");
|
||||
Item.noMelee = true;
|
||||
|
||||
Item.value = CalamityGlobalItem.Rarity8BuyPrice;
|
||||
@@ -46,9 +47,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerUse = 0.1125f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<GaussRifleBlast>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<GaussRifleBlast>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
@@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
Item.autoReuse = true;
|
||||
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/LaserRifleFire");
|
||||
Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserRifleFire");
|
||||
Item.noMelee = true;
|
||||
|
||||
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
|
||||
@@ -46,9 +47,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerUse = 0.125f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
if (velocity.Length() > 5f)
|
||||
{
|
||||
velocity.Normalize();
|
||||
@@ -58,7 +58,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
{
|
||||
float SpeedX = velocity.X + Main.rand.Next(-1, 2) * 0.05f;
|
||||
float SpeedY = velocity.Y + Main.rand.Next(-1, 2) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<LaserRifleShot>(), damage, knockBack, player.whoAmI, i, 0f);
|
||||
Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), ModContent.ProjectileType<LaserRifleShot>(), damage, knockback, player.whoAmI, i, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
Item.autoReuse = true;
|
||||
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaBolt");
|
||||
Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBolt");
|
||||
Item.noMelee = true;
|
||||
|
||||
Item.value = CalamityGlobalItem.Rarity5BuyPrice;
|
||||
@@ -47,11 +48,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerUse = 0.075f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
for (int i = 0; i < Main.rand.Next(3, 5 + 1); i++)
|
||||
{
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY).RotatedByRandom(0.4f) * Main.rand.NextFloat(0.8f, 1.3f), type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.8f, 1.3f), type, damage, knockback, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -48,9 +49,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerAltUse = 0f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(player.Center, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, player.Center, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
int totalOwnedScanners = player.ownedProjectileCounts[type];
|
||||
int currentScannerIndex = 0;
|
||||
foreach (Projectile projectile in Main.projectile)
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
Item.mana = 24;
|
||||
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PlasmaCasterFire");
|
||||
Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaCasterFire");
|
||||
Item.noMelee = true;
|
||||
|
||||
Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice;
|
||||
@@ -66,9 +67,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
mult /= 3f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
if (velocity.Length() > 5f)
|
||||
{
|
||||
velocity.Normalize();
|
||||
@@ -87,7 +87,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
kbMult = 3f / 7f;
|
||||
}
|
||||
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<PlasmaCasterShot>(), (int)(damage * damageMult), knockBack * kbMult, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), ModContent.ProjectileType<PlasmaCasterShot>(), (int)(damage * damageMult), knockback * kbMult, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
@@ -6,6 +6,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -47,12 +48,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.rogue = true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
damage = (int)(damage * 1.05);
|
||||
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
Item.autoReuse = true;
|
||||
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PulseRifleFire");
|
||||
Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PulseRifleFire");
|
||||
Item.noMelee = true;
|
||||
|
||||
Item.value = CalamityGlobalItem.Rarity3BuyPrice;
|
||||
@@ -46,9 +47,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerUse = 0.05f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<PulsePistolShot>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<PulsePistolShot>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -35,7 +36,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
Item.autoReuse = true;
|
||||
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PulseRifleFire");
|
||||
Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PulseRifleFire");
|
||||
Item.noMelee = true;
|
||||
|
||||
Item.value = CalamityGlobalItem.Rarity14BuyPrice;
|
||||
@@ -50,9 +51,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerUse = 0.24f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
if (velocity.Length() > 5f)
|
||||
{
|
||||
velocity.Normalize();
|
||||
@@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-1, 2) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-1, 2) * 0.05f;
|
||||
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<PulseRifleShot>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), ModContent.ProjectileType<PulseRifleShot>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -50,10 +51,10 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerAltUse = 0f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
CalamityUtils.OnlyOneSentry(player, type);
|
||||
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
player.UpdateMaxTurrets();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -48,9 +49,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerAltUse = 0f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -47,12 +48,12 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerAltUse = 0f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Point mouseTileCoords = Main.MouseWorld.ToTileCoordinates();
|
||||
if (!CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).active())
|
||||
if (!CalamityUtils.ParanoidTileRetrieval(mouseTileCoords.X, mouseTileCoords.Y).HasTile)
|
||||
{
|
||||
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, Main.MouseWorld, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -52,9 +53,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] < MaxDeployedProjectiles;
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -36,7 +37,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
Item.mana = 30;
|
||||
|
||||
Item.useStyle = ItemUseStyleID.Shoot;
|
||||
Item.UseSound = Mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/TeslaCannonFire");
|
||||
Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/TeslaCannonFire");
|
||||
Item.noMelee = true;
|
||||
|
||||
Item.value = CalamityGlobalItem.Rarity14BuyPrice;
|
||||
@@ -51,9 +52,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerUse = 0.9f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
if (velocity.Length() > 5f)
|
||||
{
|
||||
velocity.Normalize();
|
||||
@@ -63,7 +63,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-1, 2) * 0.02f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-1, 2) * 0.02f;
|
||||
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<TeslaCannonShot>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), ModContent.ProjectileType<TeslaCannonShot>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
@@ -6,6 +6,7 @@ using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -52,9 +53,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerUse = 0.08f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -50,9 +51,9 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerUse = 0.5f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user