Merge branch '1.4' of https://github.com/CalamityTeam/CalamityMod into 1.4
This commit is contained in:
commit
16e9b39df8
412 files changed
+1921
-1275
No files matched your search
@@ -1,55 +1,28 @@
|
||||
using CalamityMod.World;
|
||||
using Terraria.ModLoader;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.Localization;
|
||||
|
||||
namespace CalamityMod.CustomRecipes
|
||||
{
|
||||
public class ArsenalTierGatedRecipe : ModRecipe
|
||||
public static class ArsenalTierGatedRecipe
|
||||
{
|
||||
public int Tier;
|
||||
public bool AllowedInOldWorlds;
|
||||
public ArsenalTierGatedRecipe(Mod mod, int tier, bool allowedInOldWorlds = false) : base(mod)
|
||||
public static NetworkText ConstructRecipeCondition(int tier, out Predicate<Recipe> condition)
|
||||
{
|
||||
Tier = tier;
|
||||
AllowedInOldWorlds = allowedInOldWorlds;
|
||||
condition = r => HasTierBeenLearned(tier);
|
||||
return NetworkText.FromKey($"Mods.Calamity.Tier{tier}ArsenalRecipeCondition");
|
||||
}
|
||||
|
||||
public static bool HasTierBeenLearned(int tier)
|
||||
{
|
||||
switch (tier)
|
||||
return tier switch
|
||||
{
|
||||
case 1:
|
||||
return RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes;
|
||||
case 2:
|
||||
return RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes;
|
||||
case 3:
|
||||
return RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes;
|
||||
case 4:
|
||||
return RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes;
|
||||
case 5:
|
||||
return RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool RecipeAvailable()
|
||||
{
|
||||
if (AllowedInOldWorlds && !CalamityWorld.IsWorldAfterDraedonUpdate)
|
||||
return true;
|
||||
|
||||
switch (Tier)
|
||||
{
|
||||
case 1:
|
||||
return RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes;
|
||||
case 2:
|
||||
return RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes;
|
||||
case 3:
|
||||
return RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes;
|
||||
case 4:
|
||||
return RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes;
|
||||
case 5:
|
||||
return RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes;
|
||||
}
|
||||
return false;
|
||||
1 => RecipeUnlockHandler.HasUnlockedT1ArsenalRecipes,
|
||||
2 => RecipeUnlockHandler.HasUnlockedT2ArsenalRecipes,
|
||||
3 => RecipeUnlockHandler.HasUnlockedT3ArsenalRecipes,
|
||||
4 => RecipeUnlockHandler.HasUnlockedT4ArsenalRecipes,
|
||||
5 => RecipeUnlockHandler.HasUnlockedT5ArsenalRecipes,
|
||||
_ => false,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.DataStructures
|
||||
@@ -29,7 +30,7 @@ namespace CalamityMod.DataStructures
|
||||
return;
|
||||
|
||||
Player owner = Main.player[ownerIndex];
|
||||
int copy = Projectile.NewProjectile(owner.Center, Vector2.Zero, Type, OriginalDamage, OriginalKnockback, ownerIndex, AIValues[0], AIValues[1]);
|
||||
int copy = Projectile.NewProjectile(new EntitySource_ByProjectileSourceId(1), owner.Center, Vector2.Zero, Type, OriginalDamage, OriginalKnockback, ownerIndex, AIValues[0], AIValues[1]);
|
||||
|
||||
if (Main.projectile.IndexInRange(copy))
|
||||
{
|
||||
@@ -62,7 +63,7 @@ namespace CalamityMod.DataStructures
|
||||
return;
|
||||
|
||||
Player owner = Main.player[ownerIndex];
|
||||
int body = Projectile.NewProjectile(owner.Center, Vector2.Zero, ModContent.ProjectileType<EndoHydraBody>(), OriginalDamage, OriginalKnockback, owner.whoAmI);
|
||||
int body = Projectile.NewProjectile(new EntitySource_ByProjectileSourceId(1), owner.Center, Vector2.Zero, ModContent.ProjectileType<EndoHydraBody>(), OriginalDamage, OriginalKnockback, owner.whoAmI);
|
||||
|
||||
// If there was not enough space for even the body to be created, don't both trying to create even more projectiles needlessly.
|
||||
if (!Main.projectile.IndexInRange(body))
|
||||
@@ -70,7 +71,7 @@ namespace CalamityMod.DataStructures
|
||||
|
||||
while (HeadCount > 0)
|
||||
{
|
||||
Projectile.NewProjectile(owner.Center, Main.rand.NextVector2Unit(), ModContent.ProjectileType<EndoHydraHead>(), OriginalDamage, OriginalKnockback, owner.whoAmI, body);
|
||||
Projectile.NewProjectile(new EntitySource_ByProjectileSourceId(1), owner.Center, Main.rand.NextVector2Unit(), ModContent.ProjectileType<EndoHydraHead>(), OriginalDamage, OriginalKnockback, owner.whoAmI, body);
|
||||
HeadCount--;
|
||||
}
|
||||
}
|
||||
@@ -92,7 +93,7 @@ namespace CalamityMod.DataStructures
|
||||
return;
|
||||
|
||||
Player owner = Main.player[ownerIndex];
|
||||
Endogenesis.SummonEndoCooper(AttackMode, Main.MouseWorld, OriginalDamage, OriginalKnockback, owner, out int bodyIndex, out int limbsIndex);
|
||||
Endogenesis.SummonEndoCooper(new EntitySource_ByProjectileSourceId(1), AttackMode, Main.MouseWorld, OriginalDamage, OriginalKnockback, owner, out int bodyIndex, out int limbsIndex);
|
||||
Main.projectile[bodyIndex].Calamity().RequiresManualResurrection = true;
|
||||
Main.projectile[limbsIndex].Calamity().RequiresManualResurrection = true;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ using Microsoft.Xna.Framework;
|
||||
using CalamityMod.TileEntities;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.Items.DraedonMisc
|
||||
{
|
||||
@@ -55,7 +56,14 @@ namespace CalamityMod.Items.DraedonMisc
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).AddIngredient(ModContent.ItemType<BarofLife>(), 3).AddIngredient(ItemID.Glass, 20).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).
|
||||
AddIngredient(ModContent.ItemType<BarofLife>(), 3).
|
||||
AddIngredient(ItemID.Glass, 20).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(3, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.Items.DraedonMisc
|
||||
{
|
||||
@@ -70,8 +71,15 @@ namespace CalamityMod.Items.DraedonMisc
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
// Old worlds can craft the cell immediately for the sake of being able to easily fight Draedon in endgame worlds.
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<AuricBar>(), 2).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 8).AddIngredient(ModContent.ItemType<DubiousPlating>(), 8).AddIngredient(ModContent.ItemType<EndothermicEnergy>(), 40).AddIngredient(ModContent.ItemType<CoreofEleum>(), 6).AddTile(ModContent.TileType<CosmicAnvil>()).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<AuricBar>(), 2).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 8).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 8).
|
||||
AddIngredient(ModContent.ItemType<EndothermicEnergy>(), 40).
|
||||
AddIngredient(ModContent.ItemType<CoreofEleum>(), 6).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(5, out Predicate<Recipe> condition), condition).
|
||||
AddTile(ModContent.TileType<CosmicAnvil>()).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Tiles.DraedonSummoner;
|
||||
@@ -27,7 +27,12 @@ namespace CalamityMod.Items.DraedonMisc
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<ChargingStationItem>()).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 20).AddIngredient(ModContent.ItemType<DubiousPlating>(), 35).AddTile(TileID.Anvils).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<ChargingStationItem>()).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 20).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 35).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using Microsoft.Xna.Framework;
|
||||
using CalamityMod.TileEntities;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.Items.DraedonMisc
|
||||
{
|
||||
@@ -57,7 +58,15 @@ namespace CalamityMod.Items.DraedonMisc
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 18).AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).AddIngredient(ItemID.Wire, 100).AddRecipeGroup("AnyCopperBar", 10).AddIngredient(ItemID.Glass, 15).AddTile(TileID.Anvils).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 18).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).
|
||||
AddIngredient(ItemID.Wire, 100).
|
||||
AddRecipeGroup("AnyCopperBar", 10).
|
||||
AddIngredient(ItemID.Glass, 15).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(1, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using Microsoft.Xna.Framework;
|
||||
using CalamityMod.TileEntities;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.Items.DraedonMisc
|
||||
{
|
||||
@@ -55,7 +56,14 @@ namespace CalamityMod.Items.DraedonMisc
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).AddRecipeGroup("AnyMythrilBar", 10).AddIngredient(ItemID.Wire, 50).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).
|
||||
AddRecipeGroup("AnyMythrilBar", 10).
|
||||
AddIngredient(ItemID.Wire, 50).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using Microsoft.Xna.Framework;
|
||||
using CalamityMod.TileEntities;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.Items.DraedonMisc
|
||||
{
|
||||
@@ -56,7 +57,14 @@ namespace CalamityMod.Items.DraedonMisc
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).AddIngredient(ModContent.ItemType<UeliaceBar>(), 5).AddIngredient(ItemID.LunarBar, 5).AddTile(TileID.LunarCraftingStation).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 10).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).
|
||||
AddIngredient(ModContent.ItemType<UeliaceBar>(), 5).
|
||||
AddIngredient(ItemID.LunarBar, 5).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -68,7 +69,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 8).AddIngredient(ModContent.ItemType<DubiousPlating>(), 12).AddRecipeGroup("AnyMythrilBar", 10).AddIngredient(ItemID.SoulofSight, 20).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 8).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 12).
|
||||
AddRecipeGroup("AnyMythrilBar", 10).
|
||||
AddIngredient(ItemID.SoulofSight, 20).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -64,7 +65,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).AddIngredient(ModContent.ItemType<DubiousPlating>(), 18).AddIngredient(ModContent.ItemType<BarofLife>(), 5).AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 18).
|
||||
AddIngredient(ModContent.ItemType<BarofLife>(), 5).
|
||||
AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(3, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -67,7 +68,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15).AddIngredient(ModContent.ItemType<DubiousPlating>(), 15).AddIngredient(ModContent.ItemType<BarofLife>(), 5).AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 15).
|
||||
AddIngredient(ModContent.ItemType<BarofLife>(), 5).
|
||||
AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(3, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,9 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -30,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.Rarity5BuyPrice;
|
||||
@@ -49,7 +51,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).AddIngredient(ModContent.ItemType<DubiousPlating>(), 8).AddRecipeGroup("AnyMythrilBar", 10).AddIngredient(ItemID.SoulofMight, 20).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 8).
|
||||
AddRecipeGroup("AnyMythrilBar", 10).
|
||||
AddIngredient(ItemID.SoulofMight, 20).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -57,7 +58,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 18).AddIngredient(ModContent.ItemType<DubiousPlating>(), 12).AddIngredient(ModContent.ItemType<BarofLife>(), 5).AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 18).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 12).
|
||||
AddIngredient(ModContent.ItemType<BarofLife>(), 5).
|
||||
AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(3, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -58,7 +59,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 8).AddIngredient(ModContent.ItemType<DubiousPlating>(), 12).AddRecipeGroup("AnyMythrilBar", 10).AddIngredient(ItemID.SoulofSight, 20).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 8).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 12).
|
||||
AddRecipeGroup("AnyMythrilBar", 10).
|
||||
AddIngredient(ItemID.SoulofSight, 20).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ModLoader;
|
||||
using System;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
{
|
||||
@@ -72,7 +73,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15).AddIngredient(ModContent.ItemType<DubiousPlating>(), 15).AddIngredient(ModContent.ItemType<UeliaceBar>(), 8).AddIngredient(ItemID.LunarBar, 4).AddTile(TileID.LunarCraftingStation).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 15).
|
||||
AddIngredient(ModContent.ItemType<UeliaceBar>(), 8).
|
||||
AddIngredient(ItemID.LunarBar, 4).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -61,7 +62,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).AddIngredient(ModContent.ItemType<DubiousPlating>(), 8).AddRecipeGroup("AnyMythrilBar", 10).AddIngredient(ItemID.SoulofFright, 20).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 8).
|
||||
AddRecipeGroup("AnyMythrilBar", 10).
|
||||
AddIngredient(ItemID.SoulofFright, 20).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -90,7 +91,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15).AddIngredient(ModContent.ItemType<DubiousPlating>(), 5).AddRecipeGroup("AnyMythrilBar", 10).AddIngredient(ItemID.SoulofFright, 20).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 5).
|
||||
AddRecipeGroup("AnyMythrilBar", 10).
|
||||
AddIngredient(ItemID.SoulofFright, 20).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
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;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -63,10 +65,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && Item.Calamity().Charge > 0;
|
||||
|
||||
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 blade = Projectile.NewProjectileDirect(position, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
Projectile blade = Projectile.NewProjectileDirect(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI);
|
||||
blade.rotation = blade.AngleTo(Main.MouseWorld);
|
||||
blade.netUpdate = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -74,7 +77,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15).AddIngredient(ModContent.ItemType<DubiousPlating>(), 25).AddIngredient(ModContent.ItemType<CosmiliteBar>(), 8).AddIngredient(ModContent.ItemType<AscendantSpiritEssence>(), 2).AddTile(ModContent.TileType<CosmicAnvil>()).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 15).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 25).
|
||||
AddIngredient(ModContent.ItemType<CosmiliteBar>(), 8).
|
||||
AddIngredient(ModContent.ItemType<AscendantSpiritEssence>(), 2).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(5, out Predicate<Recipe> condition), condition).
|
||||
AddTile(ModContent.TileType<CosmicAnvil>()).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -100,7 +101,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 18).AddIngredient(ModContent.ItemType<DubiousPlating>(), 12).AddIngredient(ModContent.ItemType<UeliaceBar>(), 8).AddIngredient(ItemID.LunarBar, 4).AddTile(TileID.LunarCraftingStation).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 18).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 12).
|
||||
AddIngredient(ModContent.ItemType<UeliaceBar>(), 8).
|
||||
AddIngredient(ItemID.LunarBar, 4).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -63,7 +64,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(999).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 5).AddIngredient(ModContent.ItemType<DubiousPlating>(), 5).AddIngredient(ModContent.ItemType<CosmiliteBar>()).AddIngredient(ModContent.ItemType<AscendantSpiritEssence>()).AddTile(ModContent.TileType<CosmicAnvil>()).Register();
|
||||
CreateRecipe(999).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 5).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 5).
|
||||
AddIngredient(ModContent.ItemType<CosmiliteBar>()).
|
||||
AddIngredient(ModContent.ItemType<AscendantSpiritEssence>()).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(5, out Predicate<Recipe> condition), condition).
|
||||
AddTile(ModContent.TileType<CosmicAnvil>()).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
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;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -50,10 +52,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)
|
||||
{
|
||||
Projectile north = Projectile.NewProjectileDirect(Main.MouseWorld + Vector2.UnitY * 30f, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
Projectile south = Projectile.NewProjectileDirect(Main.MouseWorld - Vector2.UnitY * 30f, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
Projectile north = Projectile.NewProjectileDirect(source, Main.MouseWorld + Vector2.UnitY * 30f, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
Projectile south = Projectile.NewProjectileDirect(source, Main.MouseWorld - Vector2.UnitY * 30f, Vector2.Zero, type, damage, knockBack, player.whoAmI);
|
||||
north.ai[1] = 1f;
|
||||
south.ai[1] = 0f;
|
||||
|
||||
@@ -74,8 +76,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
{
|
||||
if (Main.projectile[i].type == type && Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI)
|
||||
{
|
||||
((PoleWarperSummon)Main.projectile[i].modProjectile).Time = 0f;
|
||||
((PoleWarperSummon)Main.projectile[i].modProjectile).AngularOffset = MathHelper.TwoPi * magnetIndex / magnetCount;
|
||||
((PoleWarperSummon)Main.projectile[i].ModProjectile).Time = 0f;
|
||||
((PoleWarperSummon)Main.projectile[i].ModProjectile).AngularOffset = MathHelper.TwoPi * magnetIndex / magnetCount;
|
||||
magnetIndex++;
|
||||
}
|
||||
}
|
||||
@@ -87,7 +89,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 25).AddIngredient(ModContent.ItemType<DubiousPlating>(), 15).AddIngredient(ModContent.ItemType<CosmiliteBar>(), 8).AddIngredient(ModContent.ItemType<AscendantSpiritEssence>(), 2).AddTile(ModContent.TileType<CosmicAnvil>()).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 25).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 15).
|
||||
AddIngredient(ModContent.ItemType<CosmiliteBar>(), 8).
|
||||
AddIngredient(ModContent.ItemType<AscendantSpiritEssence>(), 2).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(5, out Predicate<Recipe> condition), condition).
|
||||
AddTile(ModContent.TileType<CosmicAnvil>()).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
@@ -46,15 +48,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
modItem.ChargePerUse = 0.32f;
|
||||
}
|
||||
|
||||
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);
|
||||
float offsetAngle = Main.rand.NextFloat(0.2f, 0.4f);
|
||||
velocity += player.velocity;
|
||||
float velocityAngle = velocity.ToRotation();
|
||||
Projectile projectile = Projectile.NewProjectileDirect(position, velocity, type, damage, knockBack, player.whoAmI, velocityAngle, Main.rand.NextFloat(30f, PulseDragonProjectile.MaximumPossibleOutwardness));
|
||||
Projectile projectile = Projectile.NewProjectileDirect(source, position, velocity, type, damage, knockBack, player.whoAmI, velocityAngle, Main.rand.NextFloat(30f, PulseDragonProjectile.MaximumPossibleOutwardness));
|
||||
projectile.localAI[0] = 1f;
|
||||
projectile = Projectile.NewProjectileDirect(position, velocity.RotatedBy(offsetAngle), type, damage, knockBack, player.whoAmI, velocityAngle + offsetAngle, Main.rand.NextFloat(30f, PulseDragonProjectile.MaximumPossibleOutwardness));
|
||||
projectile = Projectile.NewProjectileDirect(source, position, velocity.RotatedBy(offsetAngle), type, damage, knockBack, player.whoAmI, velocityAngle + offsetAngle, Main.rand.NextFloat(30f, PulseDragonProjectile.MaximumPossibleOutwardness));
|
||||
projectile.localAI[0] = -1f;
|
||||
return false;
|
||||
}
|
||||
@@ -63,7 +64,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).AddIngredient(ModContent.ItemType<DubiousPlating>(), 18).AddIngredient(ModContent.ItemType<UeliaceBar>(), 8).AddIngredient(ItemID.LunarBar, 4).AddTile(TileID.LunarCraftingStation).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 18).
|
||||
AddIngredient(ModContent.ItemType<UeliaceBar>(), 8).
|
||||
AddIngredient(ItemID.LunarBar, 4).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -59,7 +60,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 5).AddIngredient(ModContent.ItemType<DubiousPlating>(), 7).AddIngredient(ModContent.ItemType<AerialiteBar>(), 4).AddIngredient(ModContent.ItemType<SeaPrism>(), 7).AddTile(TileID.Anvils).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 5).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 7).
|
||||
AddIngredient(ModContent.ItemType<AerialiteBar>(), 4).
|
||||
AddIngredient(ModContent.ItemType<SeaPrism>(), 7).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(1, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -72,7 +73,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 20).AddIngredient(ModContent.ItemType<DubiousPlating>(), 20).AddIngredient(ModContent.ItemType<CosmiliteBar>(), 8).AddIngredient(ModContent.ItemType<AscendantSpiritEssence>(), 2).AddTile(ModContent.TileType<CosmicAnvil>()).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 20).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 20).
|
||||
AddIngredient(ModContent.ItemType<CosmiliteBar>(), 8).
|
||||
AddIngredient(ModContent.ItemType<AscendantSpiritEssence>(), 2).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(5, out Predicate<Recipe> condition), condition).
|
||||
AddTile(ModContent.TileType<CosmicAnvil>()).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -63,7 +64,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).AddIngredient(ModContent.ItemType<DubiousPlating>(), 18).AddIngredient(ModContent.ItemType<BarofLife>(), 5).AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 18).
|
||||
AddIngredient(ModContent.ItemType<BarofLife>(), 5).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(3, out Predicate<Recipe> condition), condition).
|
||||
AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -59,7 +60,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 18).AddIngredient(ModContent.ItemType<DubiousPlating>(), 12).AddIngredient(ModContent.ItemType<UeliaceBar>(), 8).AddIngredient(ItemID.LunarBar, 4).AddTile(TileID.LunarCraftingStation).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 18).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 12).
|
||||
AddIngredient(ModContent.ItemType<UeliaceBar>(), 8).
|
||||
AddIngredient(ItemID.LunarBar, 4).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -62,7 +63,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 8).AddIngredient(ModContent.ItemType<DubiousPlating>(), 4).AddIngredient(ModContent.ItemType<AerialiteBar>(), 4).AddIngredient(ModContent.ItemType<SeaPrism>(), 7).AddTile(TileID.Anvils).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 8).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 4).
|
||||
AddIngredient(ModContent.ItemType<AerialiteBar>(), 4).
|
||||
AddIngredient(ModContent.ItemType<SeaPrism>(), 7).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(1, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -65,7 +66,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 20).AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).AddIngredient(ModContent.ItemType<BarofLife>(), 5).AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5).AddTile(TileID.MythrilAnvil).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 20).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 10).
|
||||
AddIngredient(ModContent.ItemType<BarofLife>(), 5).
|
||||
AddIngredient(ModContent.ItemType<InfectedArmorPlating>(), 5).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(3, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.MythrilAnvil).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.CustomRecipes;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -31,7 +32,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.Rarity3BuyPrice;
|
||||
@@ -52,7 +53,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 7).AddIngredient(ModContent.ItemType<DubiousPlating>(), 5).AddIngredient(ModContent.ItemType<AerialiteBar>(), 4).AddIngredient(ModContent.ItemType<SeaPrism>(), 7).AddTile(TileID.Anvils).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 7).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 5).
|
||||
AddIngredient(ModContent.ItemType<AerialiteBar>(), 4).
|
||||
AddIngredient(ModContent.ItemType<SeaPrism>(), 7).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(1, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -73,7 +74,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 25).AddIngredient(ModContent.ItemType<DubiousPlating>(), 15).AddIngredient(ModContent.ItemType<CosmiliteBar>(), 8).AddIngredient(ModContent.ItemType<AscendantSpiritEssence>(), 2).AddTile(ModContent.TileType<CosmicAnvil>()).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 25).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 15).
|
||||
AddIngredient(ModContent.ItemType<CosmiliteBar>(), 8).
|
||||
AddIngredient(ModContent.ItemType<AscendantSpiritEssence>(), 2).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(5, out Predicate<Recipe> condition), condition).
|
||||
AddTile(ModContent.TileType<CosmicAnvil>()).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -65,7 +66,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 5).AddIngredient(ModContent.ItemType<DubiousPlating>(), 7).AddIngredient(ModContent.ItemType<AerialiteBar>(), 4).AddIngredient(ModContent.ItemType<SeaPrism>(), 7).AddTile(TileID.Anvils).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 5).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 7).
|
||||
AddIngredient(ModContent.ItemType<AerialiteBar>(), 4).
|
||||
AddIngredient(ModContent.ItemType<SeaPrism>(), 7).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(1, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.Anvils).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.DraedonsArsenal;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
@@ -63,7 +64,14 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).AddIngredient(ModContent.ItemType<DubiousPlating>(), 18).AddIngredient(ModContent.ItemType<UeliaceBar>(), 8).AddIngredient(ItemID.LunarBar, 4).AddTile(TileID.LunarCraftingStation).Register();
|
||||
CreateRecipe(1).
|
||||
AddIngredient(ModContent.ItemType<MysteriousCircuitry>(), 12).
|
||||
AddIngredient(ModContent.ItemType<DubiousPlating>(), 18).
|
||||
AddIngredient(ModContent.ItemType<UeliaceBar>(), 8).
|
||||
AddIngredient(ItemID.LunarBar, 4).
|
||||
AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(4, out Predicate<Recipe> condition), condition).
|
||||
AddTile(TileID.LunarCraftingStation).
|
||||
Register();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
@@ -42,19 +44,19 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-30, 0);
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<Shroomer>()).AddIngredient(ModContent.ItemType<CosmiliteBar>(), 10).AddTile(ModContent.TileType<CosmicAnvil>()).Register();
|
||||
}
|
||||
|
||||
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 (type == ProjectileID.Bullet)
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<AMRShot>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<AMRShot>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, (int)(damage * 1.3), knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity, type, (int)(damage * 1.3), knockback, player.whoAmI);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
@@ -53,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
CreateRecipe(1).AddIngredient(ItemID.Revolver).AddIngredient(ModContent.ItemType<ClaretCannon>()).AddIngredient(ModContent.ItemType<FantasyTalisman>(), 52).AddIngredient(ModContent.ItemType<AuricBar>(), 5).AddTile(ModContent.TileType<CosmicAnvil>()).Register();
|
||||
}
|
||||
|
||||
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 card = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
@@ -63,7 +64,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
ModContent.ProjectileType<CardClub>()
|
||||
});
|
||||
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, card, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, card, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
@@ -40,12 +41,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
Vector2 source = player.RotatedRelativePoint(player.MountedCenter);
|
||||
float num117 = MathHelper.Pi * 0.1f;
|
||||
int totalProjectiles = 6;
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
|
||||
velocity.Normalize();
|
||||
velocity *= 35f;
|
||||
bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0);
|
||||
@@ -74,7 +75,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
newType = ModContent.ProjectileType<TorrentialArrow>();
|
||||
break;
|
||||
}
|
||||
int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, newType, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, newType, damage, knockback, player.whoAmI);
|
||||
if (proj.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[proj].arrow = true;
|
||||
@@ -83,7 +84,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
else
|
||||
{
|
||||
int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
Main.projectile[proj].noDropItem = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -53,10 +55,10 @@ Fighting 'til the war's won");
|
||||
return new Vector2(-17, -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)
|
||||
{
|
||||
int NumBullets = Main.rand.Next(5, 8);
|
||||
Vector2 baseVelocity = new Vector2(speedX, speedY).SafeNormalize(Vector2.Zero) * BulletSpeed;
|
||||
Vector2 baseVelocity = velocity.SafeNormalize(Vector2.Zero) * BulletSpeed;
|
||||
|
||||
// Fire a shotgun spread of bullets.
|
||||
for (int i = 0; i < NumBullets; ++i)
|
||||
@@ -66,9 +68,9 @@ Fighting 'til the war's won");
|
||||
Vector2 randomVelocity = baseVelocity + new Vector2(dx, dy);
|
||||
|
||||
if (type == ProjectileID.Bullet)
|
||||
Projectile.NewProjectile(position, randomVelocity, ModContent.ProjectileType<IlluminatedBullet>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, randomVelocity, ModContent.ProjectileType<IlluminatedBullet>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position, randomVelocity, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, randomVelocity, type, damage, knockback, player.whoAmI);
|
||||
}
|
||||
|
||||
// Spawn a beam from the sky ala Deathhail Staff or Lunar Flare
|
||||
@@ -112,7 +114,7 @@ Fighting 'til the war's won");
|
||||
mouseDist = laserSpeed / mouseDist;
|
||||
mouseDX *= mouseDist;
|
||||
mouseDY *= mouseDist;
|
||||
Projectile.NewProjectile(rrp, new Vector2(mouseDX, mouseDY + Main.rand.NextFloat(-0.8f, 0.8f)), ModContent.ProjectileType<AngelicBeam>(), laserDamage, laserKB, player.whoAmI);
|
||||
Projectile.NewProjectile(source, rrp, new Vector2(mouseDX, mouseDY + Main.rand.NextFloat(-0.8f, 0.8f)), ModContent.ProjectileType<AngelicBeam>(), laserDamage, laserKB, player.whoAmI);
|
||||
|
||||
// Play the sound of the laser beam
|
||||
SoundEngine.PlaySound(SoundID.Item72, player.Center);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -68,18 +69,18 @@ Right click to fire a burst of bullets");
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
|
||||
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.altFunctionUse == 2)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.BulletHighVelocity, (int)(damage * 5.8f), knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ProjectileID.BulletHighVelocity, (int)(damage * 5.8f), knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
@@ -38,25 +39,25 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 6;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 6;
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
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 num6 = Main.rand.Next(2, 4);
|
||||
for (int index = 0; index < num6; ++index)
|
||||
{
|
||||
float SpeedX = speedX + Main.rand.Next(-40, 41) * 0.05f;
|
||||
float SpeedY = speedY + Main.rand.Next(-40, 41) * 0.05f;
|
||||
float SpeedX = velocity.X + Main.rand.Next(-40, 41) * 0.05f;
|
||||
float SpeedY = velocity.Y + Main.rand.Next(-40, 41) * 0.05f;
|
||||
|
||||
if (type == ProjectileID.Bullet)
|
||||
{
|
||||
int projectile = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<Aquashard>(), damage, knockBack, player.whoAmI);
|
||||
int projectile = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<Aquashard>(), damage, knockback, player.whoAmI);
|
||||
Main.projectile[projectile].timeLeft = 200;
|
||||
}
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -42,9 +43,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
|
||||
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)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item5, (int)player.Center.X, (int)player.Center.Y);
|
||||
|
||||
@@ -60,9 +61,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
int spread = (int)(30f * spreadScale);
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
float SpeedX = speedX + Main.rand.Next(-spread, spread + 1) * 0.05f;
|
||||
float SpeedY = speedY + Main.rand.Next(-spread, spread + 1) * 0.05f;
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * arrowScale), knockBack * arrowScale, player.whoAmI);
|
||||
float SpeedX = velocity.X + Main.rand.Next(-spread, spread + 1) * 0.05f;
|
||||
float SpeedY = velocity.Y + Main.rand.Next(-spread, spread + 1) * 0.05f;
|
||||
int proj = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * arrowScale), knockback * arrowScale, player.whoAmI);
|
||||
Main.projectile[proj].scale = arrowScale;
|
||||
Main.projectile[proj].extraUpdates += 1;
|
||||
Main.projectile[proj].noDropItem = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -40,12 +41,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return new Vector2(-10, -5);
|
||||
}
|
||||
|
||||
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 (type == ProjectileID.Bullet)
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<ArcherfishShot>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<ArcherfishShot>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -44,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<BloodstoneCore>(), 5).AddTile(TileID.LunarCraftingStation).Register();
|
||||
}
|
||||
|
||||
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 num72 = Item.shootSpeed;
|
||||
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
@@ -87,12 +88,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
float speedY5 = num79;
|
||||
if (type == ProjectileID.WoodenArrowFriendly)
|
||||
{
|
||||
int bloodfire = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType<BloodfireArrowProj>(), damage, knockBack, player.whoAmI, 0f, 80f);
|
||||
int bloodfire = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType<BloodfireArrowProj>(), damage, knockback, player.whoAmI, 0f, 80f);
|
||||
Main.projectile[bloodfire].tileCollide = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int num121 = Projectile.NewProjectile(vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockBack, player.whoAmI);
|
||||
int num121 = Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI);
|
||||
Main.projectile[num121].noDropItem = true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -37,16 +38,16 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 25;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 25;
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
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 (type == ProjectileID.Bullet)
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<AstralRound>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<AstralRound>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -36,7 +37,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 25;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 25;
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -39,9 +40,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
|
||||
float speed = velocity.Length();
|
||||
if (speed > 8f)
|
||||
velocity *= 8f / speed;
|
||||
@@ -51,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
type = Item.shoot;
|
||||
float aiVar = Main.rand.Next(4);
|
||||
|
||||
Projectile.NewProjectile(position, velocity, type, damage, knockBack, player.whoAmI, aiVar);
|
||||
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, aiVar);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
@@ -54,9 +56,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
add += damageMult;
|
||||
}
|
||||
|
||||
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), Item.shoot, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity, Item.shoot, damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -37,11 +38,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.rare = ItemRarityID.Lime;
|
||||
}
|
||||
|
||||
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 SpeedX = speedX + Main.rand.NextFloat(-15f, 15f) * 0.05f;
|
||||
float SpeedY = speedY + Main.rand.NextFloat(-15f, 15f) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, Main.rand.Next(4, 11), 0f);
|
||||
float SpeedX = velocity.X + Main.rand.NextFloat(-15f, 15f) * 0.05f;
|
||||
float SpeedY = velocity.Y + Main.rand.NextFloat(-15f, 15f) * 0.05f;
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, Main.rand.Next(4, 11), 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,12 +36,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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 (type == ProjectileID.WoodenArrowFriendly)
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<BoltArrow>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<BoltArrow>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,12 +37,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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 (type == ProjectileID.WoodenArrowFriendly)
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<BoltArrow>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<BoltArrow>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
@@ -41,13 +42,13 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return new Vector2(-10, 0);
|
||||
}
|
||||
|
||||
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 index = 0; index < 2; ++index)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -41,19 +43,19 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return new Vector2(-10, 0);
|
||||
}
|
||||
|
||||
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 < 4; i++)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-60, 61) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-60, 61) * 0.05f;
|
||||
int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-60, 61) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-60, 61) * 0.05f;
|
||||
int index = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI);
|
||||
Main.projectile[index].noDropItem = true;
|
||||
}
|
||||
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float num117 = 0.314159274f;
|
||||
int num118 = 2;
|
||||
Vector2 vector7 = new Vector2(speedX, speedY);
|
||||
Vector2 vector7 = velocity;
|
||||
vector7.Normalize();
|
||||
vector7 *= 10f;
|
||||
bool flag11 = Collision.CanHit(vector2, 0, 0, vector2 + vector7, 0, 0);
|
||||
@@ -65,7 +67,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
value9 -= vector7;
|
||||
}
|
||||
int projectile = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, ProjectileID.Leaf, damage / 2, 0f, player.whoAmI);
|
||||
int projectile = Projectile.NewProjectile(source, vector2.X + value9.X, vector2.Y + value9.Y, velocity.X, velocity.Y, ProjectileID.Leaf, damage / 2, 0f, player.whoAmI);
|
||||
if (projectile.WithinBounds(Main.maxProjectiles))
|
||||
Main.projectile[projectile].Calamity().forceRanged = true;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -38,9 +39,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
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<Nuke>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<Nuke>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -38,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
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 (Main.rand.NextFloat() > 0.75f)
|
||||
--player.statLife;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -59,15 +60,15 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
|
||||
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.altFunctionUse == 2)
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<SporeBomb>(), (int)(damage * 4D), knockBack * 60f, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<SporeBomb>(), (int)(damage * 4D), knockback * 60f, player.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<LeafArrow>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<LeafArrow>(), damage, knockback, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -36,19 +38,19 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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 numProj = 2;
|
||||
float rotation = MathHelper.ToRadians(2);
|
||||
for (int i = 0; i < numProj + 1; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
|
||||
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
|
||||
|
||||
if (type == ProjectileID.WoodenArrowFriendly)
|
||||
Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType<BrimstoneBolt>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType<BrimstoneBolt>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, perturbedSpeed, type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI);
|
||||
Main.projectile[proj].noDropItem = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -45,15 +46,15 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
// Disable vanilla ammo consumption
|
||||
public override bool ConsumeAmmo(Player player) => false;
|
||||
|
||||
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)
|
||||
{
|
||||
type = Item.shoot;
|
||||
int bulletAmt = Main.rand.Next(25,35);
|
||||
for (int i = 0; i < bulletAmt; i++)
|
||||
{
|
||||
float newSpeedX = speedX + Main.rand.NextFloat(-15f, 15f);
|
||||
float newSpeedY = speedY + Main.rand.NextFloat(-15f, 15f);
|
||||
Projectile.NewProjectile(position.X, position.Y, newSpeedX, newSpeedY, type, damage, knockBack, player.whoAmI);
|
||||
float newSpeedX = velocity.X + Main.rand.NextFloat(-15f, 15f);
|
||||
float newSpeedY = velocity.Y + Main.rand.NextFloat(-15f, 15f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, newSpeedX, newSpeedY, type, damage, knockback, player.whoAmI);
|
||||
}
|
||||
|
||||
// Consume 5 ammo per shot
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -40,9 +42,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
|
||||
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<ButcherGun>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<ButcherGun>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -47,11 +48,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return 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.altFunctionUse == 2)
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<ChargedBlast3>(), (int)((double)damage * 2), knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<ChargedBlast3>(), (int)((double)damage * 2), knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -59,11 +60,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
int num6 = Main.rand.Next(2, 5);
|
||||
for (int index = 0; index < num6; ++index)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
int projectile = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage / 2, knockBack, player.whoAmI, 0f, 0f);
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
int projectile = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage / 2, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<ChargedBlast>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<ChargedBlast>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -52,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType<ChickenCannonHeld>()] <= 0 || player.altFunctionUse == 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)
|
||||
{
|
||||
// Play a sound and detonate all in-flight rockets, but don't shoot anything.
|
||||
if (player.altFunctionUse == 2)
|
||||
@@ -62,10 +64,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return false;
|
||||
}
|
||||
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<ChickenCannonHeld>(), 0, 0f, player.whoAmI, 1);
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<ChickenCannonHeld>(), 0, 0f, player.whoAmI, 1);
|
||||
// Otherwise just play a grenade launcher sound and fire a rocket.
|
||||
//Main.PlaySound(SoundID.Item61, position);
|
||||
//Projectile.NewProjectile(position, new Vector2(speedX, speedY), item.shoot, damage, knockBack, player.whoAmI);
|
||||
//Projectile.NewProjectile(source, position, velocity, item.shoot, damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -37,12 +39,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
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 (type == ProjectileID.Bullet)
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<ClamorRifleProj>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<ClamorRifleProj>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -46,12 +47,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<BloodstoneCore>(), 4).AddTile(TileID.LunarCraftingStation).Register();
|
||||
}
|
||||
|
||||
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 (type == ProjectileID.Bullet)
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<ClaretCannonProj>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<ClaretCannonProj>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
@@ -43,14 +44,14 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/CleansingBlazeGlow"));
|
||||
}
|
||||
|
||||
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 num6 = Main.rand.Next(2, 4);
|
||||
for (int index = 0; index < num6; ++index)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-15, 16) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-15, 16) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-15, 16) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-15, 16) * 0.05f;
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -39,15 +40,15 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
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 SpeedX = speedX + Main.rand.Next(-15, 16) * 0.05f;
|
||||
float SpeedY = speedY + Main.rand.Next(-15, 16) * 0.05f;
|
||||
float SpeedX = velocity.X + Main.rand.Next(-15, 16) * 0.05f;
|
||||
float SpeedY = velocity.Y + Main.rand.Next(-15, 16) * 0.05f;
|
||||
|
||||
if (type == ProjectileID.Bullet)
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ProjectileID.BulletHighVelocity, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ProjectileID.BulletHighVelocity, damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -49,12 +51,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return 1f;
|
||||
}
|
||||
|
||||
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 shootVelocity = new Vector2(speedX, speedY);
|
||||
Vector2 shootVelocity = velocity;
|
||||
Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction);
|
||||
// Charge-up. Done via a holdout projectile.
|
||||
Projectile.NewProjectile(position, shootDirection, ModContent.ProjectileType<ClockworkBowHoldout>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, shootDirection, ModContent.ProjectileType<ClockworkBowHoldout>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -60,9 +62,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[ModContent.ProjectileType<CondemnationHoldout>()] <= 0;
|
||||
|
||||
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 shootVelocity = new Vector2(speedX, speedY);
|
||||
Vector2 shootVelocity = velocity;
|
||||
Vector2 shootDirection = shootVelocity.SafeNormalize(Vector2.UnitX * player.direction);
|
||||
|
||||
|
||||
@@ -71,12 +73,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
if (player.Calamity().mouseRight)
|
||||
{
|
||||
Vector2 tipPosition = position + shootDirection * 110f;
|
||||
Projectile.NewProjectile(tipPosition, shootVelocity, Item.shoot, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, tipPosition, shootVelocity, Item.shoot, damage, knockback, player.whoAmI);
|
||||
}
|
||||
|
||||
// Charge-up. Done via a holdout projectile.
|
||||
else
|
||||
Projectile.NewProjectile(position, shootDirection, ModContent.ProjectileType<CondemnationHoldout>(), 0, 0f, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, shootDirection, ModContent.ProjectileType<CondemnationHoldout>(), 0, 0f, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
@@ -47,9 +48,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
CreateRecipe(1).AddIngredient(ModContent.ItemType<Phangasm>()).AddIngredient(ModContent.ItemType<PlagueCellCluster>(), 20).AddIngredient(ModContent.ItemType<ShadowspecBar>(), 5).AddTile(ModContent.TileType<DraedonsForge>()).Register();
|
||||
}
|
||||
|
||||
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<ContagionBow>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<ContagionBow>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,19 +36,19 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 10;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 10;
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
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 (Main.rand.NextBool(5))
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<BigCoral>(), (int)((double)damage * 2.0), knockBack * 2f, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<BigCoral>(), (int)((double)damage * 2.0), knockback * 2f, player.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -37,14 +38,14 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
|
||||
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 (type == ProjectileID.WoodenArrowFriendly)
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<CorrodedShell>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<CorrodedShell>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -37,12 +39,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float piOver10 = MathHelper.Pi * 0.1f;
|
||||
int projAmt = 3;
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
|
||||
velocity.Normalize();
|
||||
velocity *= 30f;
|
||||
bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0);
|
||||
@@ -54,10 +56,10 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
offset -= velocity;
|
||||
|
||||
if (type == ProjectileID.WoodenArrowFriendly)
|
||||
Projectile.NewProjectile(source + offset, new Vector2(speedX, speedY), ModContent.ProjectileType<LunarBolt2>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source + offset, velocity, ModContent.ProjectileType<LunarBolt2>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
{
|
||||
int proj = Projectile.NewProjectile(source + offset, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source + offset, velocity, type, damage, knockback, player.whoAmI);
|
||||
Main.projectile[proj].noDropItem = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -34,9 +35,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.CursedBullet, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ProjectileID.CursedBullet, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -46,9 +47,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/DaemonsFlameGlow"));
|
||||
}
|
||||
|
||||
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<DaemonsFlameBow>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<DaemonsFlameBow>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,16 +37,16 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
int index = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI);
|
||||
Main.projectile[index].noDropItem = true;
|
||||
}
|
||||
int projectile = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ProjectileID.CrystalDart, damage / 2, knockBack, player.whoAmI);
|
||||
int projectile = Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ProjectileID.CrystalDart, damage / 2, knockback, player.whoAmI);
|
||||
Main.projectile[projectile].penetrate = 3;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -43,19 +44,19 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Ranged/DeathwindGlow"));
|
||||
}
|
||||
|
||||
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 index = 0; index < 4; ++index)
|
||||
{
|
||||
float SpeedX = speedX + Main.rand.Next(-20, 21) * 0.05f;
|
||||
float SpeedY = speedY + Main.rand.Next(-20, 21) * 0.05f;
|
||||
float SpeedX = velocity.X + Main.rand.Next(-20, 21) * 0.05f;
|
||||
float SpeedY = velocity.Y + Main.rand.Next(-20, 21) * 0.05f;
|
||||
if (type == ProjectileID.WoodenArrowFriendly)
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<DWArrow>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<DWArrow>(), damage, knockback, player.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
int num121 = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.8), knockBack, player.whoAmI);
|
||||
int num121 = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)(damage * 0.8), knockback, player.whoAmI);
|
||||
Main.projectile[num121].noDropItem = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -43,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
type = Item.shoot;
|
||||
return true;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -65,11 +67,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override float UseTimeMultiplier(Player player) => player.altFunctionUse == 2 ? FullAutoFireRateMult : 1f;
|
||||
|
||||
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)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item38, position);
|
||||
bool doDust = false;
|
||||
Vector2 vel = new Vector2(speedX, speedY);
|
||||
Vector2 vel = velocity;
|
||||
int[] bulletIDs = new int[PelletsPerShot];
|
||||
float spreadFactor = 1f;
|
||||
|
||||
@@ -114,7 +116,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
for (int i = 0; i < PelletsPerShot; ++i)
|
||||
{
|
||||
Vector2 rotatedVel = vel.RotatedBy(angleOffset);
|
||||
Projectile.NewProjectile(position, rotatedVel, bulletIDs[i], damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, rotatedVel, bulletIDs[i], damage, knockback, player.whoAmI);
|
||||
angleOffset += Spread * spreadFactor;
|
||||
|
||||
if (doDust)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
@@ -69,7 +71,7 @@ Right click to fire two devastating barrages of five empowered fireballs.
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
|
||||
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.altFunctionUse == 2) //tsunami
|
||||
{
|
||||
@@ -78,19 +80,19 @@ Right click to fire two devastating barrages of five empowered fireballs.
|
||||
int flameDamage = (int)(damage * RightClickDamageRatio);
|
||||
|
||||
const float num3 = 0.471238898f;
|
||||
Vector2 spinningpoint = new Vector2(speedX, speedY);
|
||||
Vector2 spinningpoint = velocity;
|
||||
spinningpoint.Normalize();
|
||||
spinningpoint *= 36f;
|
||||
for (int index1 = 0; index1 < numFlames; ++index1)
|
||||
{
|
||||
float num8 = index1 - (numFlames - 1) / 2;
|
||||
Vector2 vector2_5 = spinningpoint.RotatedBy(num3 * num8, new Vector2());
|
||||
Projectile.NewProjectile(position.X + vector2_5.X, position.Y + vector2_5.Y, speedX, speedY, flameID, flameDamage, knockBack, player.whoAmI, 1f, 0f);
|
||||
Projectile.NewProjectile(source, position.X + vector2_5.X, position.Y + vector2_5.Y, velocity.X, velocity.Y, flameID, flameDamage, knockback, player.whoAmI, 1f, 0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<DrataliornusBow>(), 0, 0f, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<DrataliornusBow>(), 0, 0f, player.whoAmI);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -40,12 +41,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
|
||||
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 source = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float piOverTen = MathHelper.Pi * 0.1f;
|
||||
int projCount = 2;
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
|
||||
velocity.Normalize();
|
||||
velocity *= 40f;
|
||||
bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0);
|
||||
@@ -57,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
offset -= velocity;
|
||||
}
|
||||
Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source.X + offset.X, source.Y + offset.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,18 +37,18 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
for (int index = 0; index < 2; ++index)
|
||||
{
|
||||
float SpeedX = speedX + Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedY = speedY + Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedX = velocity.X + Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedY = velocity.Y + Main.rand.Next(-30, 31) * 0.05f;
|
||||
|
||||
if (type == ProjectileID.WoodenArrowFriendly)
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<MistArrow>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<MistArrow>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI);
|
||||
Main.projectile[proj].noDropItem = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -38,14 +39,14 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
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 numFirestreams = Main.rand.Next(3, 5);
|
||||
for (int index = 0; index < numFirestreams; ++index)
|
||||
{
|
||||
float SpeedX = speedX + Main.rand.Next(-20, 21) * 0.05f;
|
||||
float SpeedY = speedY + Main.rand.Next(-20, 21) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
float SpeedX = velocity.X + Main.rand.Next(-20, 21) * 0.05f;
|
||||
float SpeedY = velocity.Y + Main.rand.Next(-20, 21) * 0.05f;
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -35,11 +36,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
int index = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<IcicleArrowProj>(), (int)(damage * 0.7f), knockBack, player.whoAmI);
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
int index = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<IcicleArrowProj>(), (int)(damage * 0.7f), knockback, player.whoAmI);
|
||||
Main.projectile[index].noDropItem = true;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -37,16 +38,16 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 25;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 25;
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-7, 0);
|
||||
|
||||
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 (type == ProjectileID.Bullet)
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<BloodClotFriendly>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<BloodClotFriendly>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -41,16 +43,16 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
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 (Main.rand.NextBool(8))
|
||||
{
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY) * 0.8f,
|
||||
ModContent.ProjectileType<EmesisGore>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity * 0.8f,
|
||||
ModContent.ProjectileType<EmesisGore>(), damage, knockback, player.whoAmI);
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustDirect(position, 10, 10, 27);
|
||||
dust.velocity = Vector2.Normalize(new Vector2(speedX, speedY)).RotatedByRandom(MathHelper.ToRadians(15f));
|
||||
dust.velocity = Vector2.Normalize(velocity).RotatedByRandom(MathHelper.ToRadians(15f));
|
||||
dust.noGravity = true;
|
||||
}
|
||||
if (player.Calamity().soundCooldown <= 0)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -49,16 +50,16 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return 1f;
|
||||
}
|
||||
|
||||
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.altFunctionUse == 2)
|
||||
{
|
||||
int num6 = Main.rand.Next(4, 6);
|
||||
for (int index = 0; index < num6; ++index)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-50, 51) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-50, 51) * 0.05f;
|
||||
int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 1.4), knockBack, player.whoAmI);
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f;
|
||||
int flare = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 1.4), knockback, player.whoAmI);
|
||||
if (flare.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[flare].penetrate = 1;
|
||||
@@ -73,9 +74,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
int num6 = Main.rand.Next(1, 3);
|
||||
for (int index = 0; index < num6; ++index)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-40, 41) * 0.05f;
|
||||
int flare = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI);
|
||||
if (flare.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[flare].Calamity().forceRanged = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
@@ -39,9 +40,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
|
||||
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<FlakKrakenGun>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<FlakKrakenGun>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
@@ -34,16 +36,16 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.shoot = ModContent.ProjectileType<ToxicannonShot>();
|
||||
Item.shootSpeed = 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)
|
||||
{
|
||||
float angle = new Vector2(speedX, speedY).ToRotation() + MathHelper.PiOver2;
|
||||
float angle = velocity.ToRotation() + MathHelper.PiOver2;
|
||||
if (angle <= -MathHelper.PiOver4 || angle >= MathHelper.PiOver4)
|
||||
return false;
|
||||
angle -= MathHelper.PiOver2;
|
||||
|
||||
Vector2 velocity = angle.ToRotationVector2() * (float)Math.Sqrt(speedX * speedX + speedY * speedY) * new Vector2(1f, 2f);
|
||||
|
||||
Projectile.NewProjectile(position, velocity, ModContent.ProjectileType<ToxicannonShot>(), damage, knockBack, player.whoAmI);
|
||||
|
||||
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<ToxicannonShot>(), damage, knockback, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -37,12 +39,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float num117 = 0.314159274f;
|
||||
int num118 = 5;
|
||||
Vector2 vector7 = new Vector2(speedX, speedY);
|
||||
Vector2 vector7 = velocity;
|
||||
vector7.Normalize();
|
||||
vector7 *= 50f;
|
||||
bool flag11 = Collision.CanHit(vector2, 0, 0, vector2 + vector7, 0, 0);
|
||||
@@ -56,12 +58,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
if (type == ProjectileID.WoodenArrowFriendly)
|
||||
{
|
||||
int num123 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, ModContent.ProjectileType<FlareBat>(), damage, knockBack, player.whoAmI);
|
||||
int num123 = Projectile.NewProjectile(source, vector2.X + value9.X, vector2.Y + value9.Y, velocity.X, velocity.Y, ModContent.ProjectileType<FlareBat>(), damage, knockback, player.whoAmI);
|
||||
Main.projectile[num123].noDropItem = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
int num123 = Projectile.NewProjectile(vector2.X + value9.X, vector2.Y + value9.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
int num123 = Projectile.NewProjectile(source, vector2.X + value9.X, vector2.Y + value9.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
Main.projectile[num123].noDropItem = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -45,9 +46,9 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
|
||||
|
||||
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<FlurrystormCannonShooting>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<FlurrystormCannonShooting>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -38,22 +39,22 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item36, position);
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
float newSpeedX = speedX + Main.rand.Next(-40, 41) * 0.06f;
|
||||
float newSpeedY = speedY + Main.rand.Next(-40, 41) * 0.06f;
|
||||
float newSpeedX = velocity.X + Main.rand.Next(-40, 41) * 0.06f;
|
||||
float newSpeedY = velocity.Y + Main.rand.Next(-40, 41) * 0.06f;
|
||||
|
||||
if (type == ProjectileID.Bullet)
|
||||
{
|
||||
int p = Projectile.NewProjectile(position.X, position.Y, newSpeedX, newSpeedY, ProjectileID.Blizzard, damage, knockBack, player.whoAmI);
|
||||
int p = Projectile.NewProjectile(source, position.X, position.Y, newSpeedX, newSpeedY, ProjectileID.Blizzard, damage, knockback, player.whoAmI);
|
||||
// Main.projectile[p].magic = false /* tModPorter - this is redundant, for more info see https://github.com/tModLoader/tModLoader/wiki/Update-Migration-Guide#damage-classes */ ;
|
||||
Main.projectile[p].DamageType = DamageClass.Ranged;
|
||||
}
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, newSpeedX, newSpeedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, newSpeedX, newSpeedY, type, damage, knockback, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -40,12 +41,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
|
||||
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 (type == ProjectileID.Bullet)
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<FungiOrb>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<FungiOrb>(), damage, knockback, player.whoAmI);
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, damage, knockback, player.whoAmI);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -36,12 +38,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
for (int i = -8; i <= 8; i += 8)
|
||||
{
|
||||
Vector2 perturbedSpeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(i));
|
||||
Projectile.NewProjectile(position, perturbedSpeed, ModContent.ProjectileType<FeatherLarge>(), damage / 4, 0f, player.whoAmI);
|
||||
Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i));
|
||||
Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType<FeatherLarge>(), damage / 4, 0f, player.whoAmI);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -38,15 +39,15 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-5, 0);
|
||||
|
||||
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);
|
||||
|
||||
|
||||
// Fire extra bullets to the left and right
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
Projectile.NewProjectile(position, velocity.RotatedBy(-Spread * (i + 1)), type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(position, velocity.RotatedBy(+Spread * (i + 1)), type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity.RotatedBy(-Spread * (i + 1)), type, damage, knockback, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position, velocity.RotatedBy(+Spread * (i + 1)), type, damage, knockback, player.whoAmI);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -36,12 +38,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float piOver10 = 0.1f * MathHelper.Pi;
|
||||
int projAmt = 2;
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
|
||||
velocity.Normalize();
|
||||
velocity *= 20f;
|
||||
bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0);
|
||||
@@ -53,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
offset -= velocity;
|
||||
}
|
||||
int index = Projectile.NewProjectile(source + offset, new Vector2(speedX, speedY) * 0.6f, ProjectileID.SlimeGun, damage / 4, 0f, player.whoAmI);
|
||||
int index = Projectile.NewProjectile(source + offset, velocity * 0.6f, ProjectileID.SlimeGun, damage / 4, 0f, player.whoAmI);
|
||||
if (index.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[index].Calamity().forceRanged = true;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -37,12 +39,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
float piOverTen = MathHelper.Pi * 0.1f;
|
||||
int arrowAmt = 3;
|
||||
Vector2 velocity = new Vector2(speedX, speedY);
|
||||
|
||||
velocity.Normalize();
|
||||
velocity *= 40f;
|
||||
bool canHit = Collision.CanHit(source, 0, 0, source + velocity, 0, 0);
|
||||
@@ -58,20 +60,20 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
type = ProjectileID.FireArrow;
|
||||
}
|
||||
int num121 = Projectile.NewProjectile(source + offset, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
int num121 = Projectile.NewProjectile(source + offset, velocity, type, damage, knockback, player.whoAmI);
|
||||
Main.projectile[num121].noDropItem = true;
|
||||
}
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
type = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
ProjectileID.CursedArrow,
|
||||
ProjectileID.HellfireArrow,
|
||||
ProjectileID.IchorArrow
|
||||
});
|
||||
int index = Projectile.NewProjectile(position, new Vector2(SpeedX, SpeedY), type, (int)(damage * 0.5f), knockBack, player.whoAmI);
|
||||
int index = Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), type, (int)(damage * 0.5f), knockback, player.whoAmI);
|
||||
Main.projectile[index].noDropItem = true;
|
||||
Main.projectile[index].usesLocalNPCImmunity = true;
|
||||
Main.projectile[index].localNPCHitCooldown = 10;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -41,14 +42,14 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
|
||||
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 num6 = Main.rand.Next(3, 5);
|
||||
for (int index = 0; index < num6; ++index)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-25, 26) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-25, 26) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-25, 26) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-25, 26) * 0.05f;
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -37,16 +38,16 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-15, 0);
|
||||
|
||||
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)
|
||||
{
|
||||
SoundEngine.PlaySound(SoundID.Item38, (int)player.Center.X, (int)player.Center.Y);
|
||||
|
||||
int bulletAmt = Main.rand.Next(25, 36);
|
||||
for (int index = 0; index < bulletAmt; ++index)
|
||||
{
|
||||
float SpeedX = speedX + Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = speedY + Main.rand.Next(-10, 11) * 0.05f;
|
||||
int shot = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
||||
float SpeedX = velocity.X + Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = velocity.Y + Main.rand.Next(-10, 11) * 0.05f;
|
||||
int shot = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI);
|
||||
Main.projectile[shot].timeLeft = 120;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
@@ -41,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 20;
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-15, 0);
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -39,11 +40,11 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 15;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 15;
|
||||
|
||||
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<HandheldTankShell>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<HandheldTankShell>(), damage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
@@ -55,14 +57,14 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
Item.Calamity().canFirePointBlankShots = 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)
|
||||
{
|
||||
Vector2 source = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
Vector2 vel = new Vector2(speedX, speedY);
|
||||
Vector2 vel = velocity;
|
||||
float piOver10 = MathHelper.Pi * 0.1f;
|
||||
|
||||
// This is not related to speed, but rather placing the arrows correctly along the large bow.
|
||||
Vector2 baseOffset = new Vector2(speedX, speedY);
|
||||
Vector2 baseOffset = velocity;
|
||||
baseOffset.Normalize();
|
||||
baseOffset *= 40f;
|
||||
|
||||
@@ -82,12 +84,12 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
// Teal exo arrows deal less damage.
|
||||
float dmgMult = thisArrowType == ProjectileType<TealExoArrow>() ? 0.66f : 1f;
|
||||
int finalDamage = (int)(damage * dmgMult);
|
||||
Projectile.NewProjectile(source + offset, vel, thisArrowType, finalDamage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source + offset, vel, thisArrowType, finalDamage, knockback, player.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
int normalArrowDamage = (int)(damage * NormalArrowDamageMult);
|
||||
int proj = Projectile.NewProjectile(source + offset, vel, type, normalArrowDamage, knockBack, player.whoAmI);
|
||||
int proj = Projectile.NewProjectile(source + offset, vel, type, normalArrowDamage, knockback, player.whoAmI);
|
||||
Main.projectile[proj].noDropItem = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -46,30 +47,30 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(-10, 0);
|
||||
|
||||
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 index = 0; index < 3; index++)
|
||||
{
|
||||
float SpeedX = speedX + Main.rand.Next(-15, 16) * 0.05f;
|
||||
float SpeedY = speedY + Main.rand.Next(-15, 16) * 0.05f;
|
||||
float SpeedX = velocity.X + Main.rand.Next(-15, 16) * 0.05f;
|
||||
float SpeedY = velocity.Y + Main.rand.Next(-15, 16) * 0.05f;
|
||||
|
||||
if (type == ProjectileID.Bullet)
|
||||
{
|
||||
int bullet = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ProjectileID.ExplosiveBullet, damage, knockBack, player.whoAmI);
|
||||
int bullet = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ProjectileID.ExplosiveBullet, damage, knockback, player.whoAmI);
|
||||
Main.projectile[bullet].usesLocalNPCImmunity = true;
|
||||
Main.projectile[bullet].localNPCHitCooldown = 10;
|
||||
}
|
||||
else
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void ModifyHitNPC(Player player, NPC target, ref int damage, ref float knockBack, ref bool crit)
|
||||
public override void ModifyHitNPC(Player player, NPC target, ref int damage, ref float knockback, ref bool crit)
|
||||
{
|
||||
player.Calamity().hellbornBoost = 600;
|
||||
damage *= 10;
|
||||
player.ApplyDamageToNPC(target, (int)(Item.damage * (player.allDamage + player.GetDamage(DamageClass.Ranged) - 1f)), 0f, 0, false);
|
||||
player.ApplyDamageToNPC(target, (int)(Item.damage * (player.GetDamage(DamageClass.Generic) + player.GetDamage(DamageClass.Ranged) - 1f)), 0f, 0, false);
|
||||
float num50 = 3.4f;
|
||||
float num51 = 1.6f;
|
||||
float num52 = 4f;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -40,13 +41,13 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
return new Vector2(-5, 0);
|
||||
}
|
||||
|
||||
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 index = 0; index < 2; ++index)
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-10, 11) * 0.05f;
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -38,21 +39,21 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
}
|
||||
|
||||
// Terraria seems to really dislike high crit values in SetDefaults
|
||||
public override void GetWeaponCrit(Player player, ref int crit) => crit += 14;
|
||||
public override void ModifyWeaponCrit(Player player, ref int crit) => crit += 14;
|
||||
|
||||
public override Vector2? HoldoutOffset() => new Vector2(0, -10);
|
||||
|
||||
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 SpeedX = speedX + (float)Main.rand.Next(-2, 3) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-2, 3) * 0.05f;
|
||||
float SpeedX = velocity.X + (float)Main.rand.Next(-2, 3) * 0.05f;
|
||||
float SpeedY = velocity.Y + (float)Main.rand.Next(-2, 3) * 0.05f;
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<ExplodingStake>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<ExplodingStake>(), damage, knockback, player.whoAmI);
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<FlamingStake>(), damage, knockBack, player.whoAmI);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, ModContent.ProjectileType<FlamingStake>(), damage, knockback, player.whoAmI);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Loaded 100 of 412 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user