Merge branch 'master' of https://github.com/UncleDanny/CalamityMod
No files matched your search
@@ -69,7 +69,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod
|
||||
{
|
||||
public class CalamityLists
|
||||
public class CalamityLists
|
||||
{
|
||||
public static IList<string> donatorList;
|
||||
public static List<int> trueMeleeProjectileList; // DO NOT, EVER, DELETE THIS LIST, OR I WILL COME FOR YOU :D
|
||||
@@ -754,7 +754,6 @@ namespace CalamityMod
|
||||
ModContent.ItemType<FirestormCannon>(),
|
||||
ModContent.ItemType<FlameburstShortsword>(),
|
||||
ModContent.ItemType<FlameScythe>(),
|
||||
ModContent.ItemType<FlameScytheMelee>(),
|
||||
ModContent.ItemType<FlareBolt>(),
|
||||
ModContent.ItemType<FlarewingBow>(),
|
||||
ModContent.ItemType<ForbiddenSun>(),
|
||||
@@ -833,7 +832,6 @@ namespace CalamityMod
|
||||
ModContent.ItemType<GlacialCrusher>(),
|
||||
ModContent.ItemType<TemporalFloeSword>(),
|
||||
ModContent.ItemType<ColdheartIcicle>(),
|
||||
ModContent.ItemType<KelvinCatalystMelee>(),
|
||||
ModContent.ItemType<CosmicDischarge>(),
|
||||
ModContent.ItemType<EffluviumBow>(),
|
||||
ModContent.ItemType<EternalBlizzard>(),
|
||||
@@ -928,7 +926,6 @@ namespace CalamityMod
|
||||
ModContent.ItemType<LifefruitScythe>(),
|
||||
ModContent.ItemType<ManaRose>(),
|
||||
ModContent.ItemType<MangroveChakram>(),
|
||||
ModContent.ItemType<MangroveChakramMelee>(),
|
||||
ModContent.ItemType<MantisClaws>(),
|
||||
ModContent.ItemType<Mariana>(),
|
||||
ModContent.ItemType<Mistlestorm>(),
|
||||
@@ -983,7 +980,6 @@ namespace CalamityMod
|
||||
ModContent.ItemType<SeasSearing>(),
|
||||
ModContent.ItemType<YateveoBloom>(),
|
||||
ModContent.ItemType<TerraDisk>(),
|
||||
ModContent.ItemType<TerraDiskMelee>(),
|
||||
ModContent.ItemType<BelladonnaSpiritStaff>(),
|
||||
ModContent.ItemType<TenebreusTides>(),
|
||||
ModContent.ItemType<Greentide>(),
|
||||
@@ -1475,9 +1471,7 @@ namespace CalamityMod
|
||||
ModContent.ItemType<EpidemicShredder>(),
|
||||
ModContent.ItemType<Equanimity>(),
|
||||
ModContent.ItemType<Eradicator>(),
|
||||
ModContent.ItemType<TruePaladinsHammer>(),
|
||||
ModContent.ItemType<FlameScythe>(),
|
||||
ModContent.ItemType<GalaxySmasherRogue>(),
|
||||
ModContent.ItemType<Glaive>(),
|
||||
ModContent.ItemType<GhoulishGouger>(),
|
||||
ModContent.ItemType<Icebreaker>(),
|
||||
@@ -1486,12 +1480,9 @@ namespace CalamityMod
|
||||
ModContent.ItemType<MangroveChakram>(),
|
||||
ModContent.ItemType<MoltenAmputator>(),
|
||||
ModContent.ItemType<NanoblackReaperRogue>(),
|
||||
ModContent.ItemType<Pwnagehammer>(),
|
||||
ModContent.ItemType<SandDollar>(),
|
||||
ModContent.ItemType<SeashellBoomerang>(),
|
||||
ModContent.ItemType<Shroomerang>(),
|
||||
ModContent.ItemType<StellarContemptRogue>(),
|
||||
ModContent.ItemType<TriactisTruePaladinianMageHammerofMight>(),
|
||||
ModContent.ItemType<Valediction>(),
|
||||
ModContent.ItemType<FrostcrushValari>(),
|
||||
ModContent.ItemType<DefectiveSphere>(),
|
||||
@@ -1518,12 +1509,12 @@ namespace CalamityMod
|
||||
ModContent.ProjectileType<KylieBoomerang>(),
|
||||
ModContent.ProjectileType<MangroveChakramProjectile>(),
|
||||
ModContent.ProjectileType<MoltenAmputatorProj>(),
|
||||
ModContent.ProjectileType<OPHammer>(),
|
||||
ModContent.ProjectileType<FallenPaladinsHammerProj>(),
|
||||
ModContent.ProjectileType<SandDollarProj>(),
|
||||
ModContent.ProjectileType<SandDollarStealth>(),
|
||||
ModContent.ProjectileType<SeashellBoomerangProjectile>(),
|
||||
ModContent.ProjectileType<ShroomerangProj>(),
|
||||
ModContent.ProjectileType<TriactisOPHammer>(),
|
||||
ModContent.ProjectileType<TriactisHammerProj>(),
|
||||
ModContent.ProjectileType<ValedictionBoomerang>(),
|
||||
ModContent.ProjectileType<GalaxySmasherHammer>(),
|
||||
ModContent.ProjectileType<KelvinCatalystBoomerang>(),
|
||||
@@ -1552,7 +1543,6 @@ namespace CalamityMod
|
||||
ModContent.ItemType<ProfanedTrident>(),
|
||||
ModContent.ItemType<LuminousStriker>(),
|
||||
ModContent.ItemType<ScarletDevil>(),
|
||||
ModContent.ItemType<ScourgeoftheCosmosThrown>(),
|
||||
ModContent.ItemType<ScourgeoftheDesert>(),
|
||||
ModContent.ItemType<ScourgeoftheSeas>(),
|
||||
ModContent.ItemType<SpearofDestiny>(),
|
||||
@@ -1619,8 +1609,6 @@ namespace CalamityMod
|
||||
ModContent.ItemType<LunarKunai>(),
|
||||
ModContent.ItemType<GildedDagger>(),
|
||||
ModContent.ItemType<GleamingDagger>(),
|
||||
ModContent.ItemType<EmpyreanKnives>(),
|
||||
ModContent.ItemType<RoyalKnives>(),
|
||||
ModContent.ItemType<InfernalKris>(),
|
||||
ModContent.ItemType<UtensilPoker>(),
|
||||
ModContent.ItemType<ShinobiBlade>(),
|
||||
|
||||
@@ -1129,7 +1129,7 @@ namespace CalamityMod.Items
|
||||
tt2.overrideColor = new Color(0, 0, 255);
|
||||
if (item.type == ModContent.ItemType<Judgement>())
|
||||
tt2.overrideColor = Judgement.GetSyncedLightColor();
|
||||
if (item.type == ModContent.ItemType<NanoblackReaperMelee>() || item.type == ModContent.ItemType<NanoblackReaperRogue>())
|
||||
if (item.type == ModContent.ItemType<NanoblackReaperRogue>())
|
||||
tt2.overrideColor = new Color(0.34f, 0.34f + 0.66f * Main.DiscoG / 255f, 0.34f + 0.5f * Main.DiscoG / 255f);
|
||||
if (item.type == ModContent.ItemType<ProfanedSoulCrystal>())
|
||||
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 166, 0), new Color(25, 250, 25), 4f); //alternates between emerald green and amber (BanditHueh)
|
||||
@@ -1153,9 +1153,9 @@ namespace CalamityMod.Items
|
||||
tt2.overrideColor = new Color(254, 253, 235);
|
||||
if (item.type == ModContent.ItemType<Contagion>())
|
||||
tt2.overrideColor = new Color(207, 17, 117);
|
||||
if (item.type == ModContent.ItemType<TriactisTruePaladinianMageHammerofMightMelee>() || item.type == ModContent.ItemType<TriactisTruePaladinianMageHammerofMight>())
|
||||
if (item.type == ModContent.ItemType<TriactisTruePaladinianMageHammerofMightMelee>())
|
||||
tt2.overrideColor = new Color(227, 226, 180);
|
||||
if (item.type == ModContent.ItemType<RoyalKnivesMelee>() || item.type == ModContent.ItemType<RoyalKnives>())
|
||||
if (item.type == ModContent.ItemType<RoyalKnivesMelee>())
|
||||
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(154, 255, 151), new Color(228, 151, 255), 4f);
|
||||
if (item.type == ModContent.ItemType<DemonshadeHelm>() || item.type == ModContent.ItemType<DemonshadeBreastplate>() || item.type == ModContent.ItemType<DemonshadeGreaves>())
|
||||
tt2.overrideColor = CalamityUtils.ColorSwap(new Color(255, 132, 22), new Color(221, 85, 7), 4f);
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
DropHelper.WeightStack<Deathwind>(w),
|
||||
DropHelper.WeightStack<DeathhailStaff>(w),
|
||||
DropHelper.WeightStack<StaffoftheMechworm>(w),
|
||||
Main.rand.NextBool() ? DropHelper.WeightStack<EradicatorMelee>(w) : DropHelper.WeightStack<Eradicator>(w)
|
||||
DropHelper.WeightStack<Eradicator>(w)
|
||||
);
|
||||
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<Skullmasher>(), DropHelper.RareVariantDropRateInt);
|
||||
|
||||
@@ -56,8 +56,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
DropHelper.WeightStack<SpikecragStaff>(w),
|
||||
DropHelper.WeightStack<CraniumSmasher>(w)
|
||||
);
|
||||
|
||||
DropHelper.DropItemFromSetChance(player, 0.05f, ModContent.ItemType<CorpusAvertorMelee>(), ModContent.ItemType<CorpusAvertor>());
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<CorpusAvertor>(), 0.05f);
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<BloodPact>(), 0.5f);
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class AccretionDiskMelee : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Elemental Disk");
|
||||
Tooltip.SetDefault("Throws a disk that has a chance to generate several disks if enemies are near it");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 38;
|
||||
item.damage = 118;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.autoReuse = true;
|
||||
item.useAnimation = 15;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 15;
|
||||
item.knockBack = 9f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.melee = true;
|
||||
item.height = 38;
|
||||
item.value = Item.buyPrice(1, 20, 0, 0);
|
||||
item.rare = 10;
|
||||
item.shoot = ModContent.ProjectileType<AccretionDiskProj>();
|
||||
item.shootSpeed = 13f;
|
||||
item.Calamity().customRarity = CalamityRarity.Turquoise;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<MangroveChakramMelee>());
|
||||
recipe.AddIngredient(ModContent.ItemType<FlameScytheMelee>());
|
||||
recipe.AddIngredient(ModContent.ItemType<TerraDiskMelee>());
|
||||
recipe.AddIngredient(ModContent.ItemType<GalacticaSingularity>(), 5);
|
||||
recipe.AddIngredient(ModContent.ItemType<BarofLife>(), 5);
|
||||
recipe.AddIngredient(ItemID.LunarBar, 5);
|
||||
recipe.AddTile(TileID.LunarCraftingStation);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,53 +0,0 @@
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class CorpusAvertorMelee : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Corpus Avertor");
|
||||
Tooltip.SetDefault("Seems like it has worn down over time\n" +
|
||||
"Attacks grant lifesteal based on damage dealt\n" +
|
||||
"The lower your HP the more damage this weapon does and heals the player on enemy hits");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 18;
|
||||
item.height = 32;
|
||||
item.damage = 98;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 15;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 15;
|
||||
item.knockBack = 3f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.autoReuse = true;
|
||||
item.value = Item.buyPrice(gold: 80);
|
||||
item.rare = 8;
|
||||
item.Calamity().customRarity = CalamityRarity.Dedicated;
|
||||
item.shoot = ModContent.ProjectileType<CorpusAvertorProj>();
|
||||
item.shootSpeed = 5f;
|
||||
item.melee = true;
|
||||
}
|
||||
|
||||
// Gains 10% of missing health as base damage.
|
||||
public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat)
|
||||
{
|
||||
int lifeAmount = player.statLifeMax2 - player.statLife;
|
||||
flat += lifeAmount * 0.1f * player.MeleeDamage();
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 480 B |
@@ -1,6 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
@@ -32,8 +31,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.UseSound = SoundID.Item39;
|
||||
item.autoReuse = true;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(2, 50, 0, 0);
|
||||
item.rare = 10;
|
||||
item.value = Item.buyPrice(platinum: 2, gold: 50);
|
||||
item.rare = ItemRarityID.Red;
|
||||
item.shoot = ModContent.ProjectileType<EmpyreanKnife>();
|
||||
item.shootSpeed = 15f;
|
||||
item.Calamity().customRarity = CalamityRarity.Violet;
|
||||
@@ -103,9 +102,9 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.VampireKnives);
|
||||
recipe.AddIngredient(ModContent.ItemType<MonstrousKnives>());
|
||||
recipe.AddIngredient(ModContent.ItemType<CosmiliteBar>(), 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<DarksunFragment>(), 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<LunarKunai>(), 999);
|
||||
recipe.AddTile(ModContent.TileType<DraedonsForge>());
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class EradicatorMelee : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Eradicator");
|
||||
Tooltip.SetDefault("Throws a disk that fires lasers at nearby enemies");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 38;
|
||||
item.damage = 300;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.autoReuse = true;
|
||||
item.useAnimation = 19;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 19;
|
||||
item.knockBack = 7f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.melee = true;
|
||||
item.height = 54;
|
||||
item.value = Item.buyPrice(1, 40, 0, 0);
|
||||
item.rare = 10;
|
||||
item.shoot = ModContent.ProjectileType<EradicatorProjectile>();
|
||||
item.shootSpeed = 12f;
|
||||
item.Calamity().customRarity = CalamityRarity.PureGreen;
|
||||
}
|
||||
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
||||
{
|
||||
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Melee/EradicatorMeleeGlow"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
@@ -1,46 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class FlameScytheMelee : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Subduction Slicer");
|
||||
Tooltip.SetDefault("Throws a scythe that explodes on enemy hits");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 50;
|
||||
item.damage = 90;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.autoReuse = true;
|
||||
item.useAnimation = 20;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 20;
|
||||
item.knockBack = 8.5f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.melee = true;
|
||||
item.height = 48;
|
||||
item.value = Item.buyPrice(0, 80, 0, 0);
|
||||
item.rare = 8;
|
||||
item.shoot = ModContent.ProjectileType<FlameScytheProjectile>();
|
||||
item.shootSpeed = 16f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<CruptixBar>(), 9);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,5 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -8,7 +8,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class GalaxySmasherMelee : ModItem
|
||||
public class GalaxySmasherMelee : ModItem
|
||||
{
|
||||
public static int BaseDamage = 480;
|
||||
public static float Speed = 18f;
|
||||
@@ -35,9 +35,9 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.UseSound = SoundID.Item1;
|
||||
|
||||
item.rare = 10;
|
||||
item.rare = ItemRarityID.Red;
|
||||
item.Calamity().customRarity = CalamityRarity.DarkBlue;
|
||||
item.value = Item.buyPrice(1, 80, 0, 0);
|
||||
item.value = Item.buyPrice(platinum: 1, gold: 80);
|
||||
|
||||
item.shoot = ModContent.ProjectileType<GalaxySmasherHammer>();
|
||||
item.shootSpeed = Speed;
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.Accessories.Wings;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class KelvinCatalystMelee : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Kelvin Catalyst");
|
||||
Tooltip.SetDefault("Throws an icy blade that splits into multiple ice stars on enemy hits");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 20;
|
||||
item.damage = 70;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.autoReuse = true;
|
||||
item.useAnimation = 30;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 30;
|
||||
item.knockBack = 4f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(0, 48, 0, 0);
|
||||
item.rare = 6;
|
||||
item.shoot = ModContent.ProjectileType<KelvinCatalystBoomerang>();
|
||||
item.shootSpeed = 8f;
|
||||
item.melee = true;
|
||||
item.Calamity().customRarity = CalamityRarity.Dedicated;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<IceStar>(), 200);
|
||||
recipe.AddIngredient(ItemID.FrozenKey);
|
||||
recipe.AddIngredient(ModContent.ItemType<CryoBar>(), 20);
|
||||
recipe.AddIngredient(ModContent.ItemType<EssenceofEleum>(), 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<Avalanche>(), 2);
|
||||
recipe.AddIngredient(ModContent.ItemType<BittercoldStaff>(), 2);
|
||||
recipe.AddIngredient(ModContent.ItemType<EffluviumBow>(), 2);
|
||||
recipe.AddIngredient(ModContent.ItemType<GlacialCrusher>(), 2);
|
||||
recipe.AddIngredient(ModContent.ItemType<Icebreaker>(), 2);
|
||||
recipe.AddIngredient(ModContent.ItemType<SnowstormStaff>(), 2);
|
||||
recipe.AddIngredient(ModContent.ItemType<SoulofCryogen>(), 2);
|
||||
recipe.AddIngredient(ModContent.ItemType<FrostFlare>(), 2);
|
||||
recipe.AddIngredient(ItemID.FrostCore, 2);
|
||||
recipe.AddIngredient(ModContent.ItemType<CryoStone>());
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.3 KiB |
@@ -1,45 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class MangroveChakramMelee : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Mangrove Chakram");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 38;
|
||||
item.damage = 84;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.autoReuse = true;
|
||||
item.useAnimation = 14;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 14;
|
||||
item.knockBack = 7.5f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.melee = true;
|
||||
item.height = 38;
|
||||
item.value = Item.buyPrice(0, 60, 0, 0);
|
||||
item.rare = 7;
|
||||
item.shoot = ModContent.ProjectileType<MangroveChakramProjectile>();
|
||||
item.shootSpeed = 16f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<DraedonBar>(), 7);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,70 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class NanoblackReaperMelee : ModItem
|
||||
{
|
||||
public static int BaseDamage = 800;
|
||||
public static float Knockback = 9f;
|
||||
public static float Speed = 16f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Nanoblack Reaper");
|
||||
Tooltip.SetDefault("Unleashes a storm of nanoblack energy blades\nBlades target bosses whenever possible\n'She smothered them in Her hatred'");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 78;
|
||||
item.height = 64;
|
||||
item.melee = true;
|
||||
item.damage = BaseDamage;
|
||||
item.knockBack = Knockback;
|
||||
item.useTime = 6;
|
||||
item.useAnimation = 6;
|
||||
item.autoReuse = true;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.UseSound = SoundID.Item18;
|
||||
|
||||
item.rare = 10;
|
||||
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
|
||||
item.value = Item.buyPrice(5, 0, 0, 0);
|
||||
|
||||
item.shoot = ModContent.ProjectileType<NanoblackMain>();
|
||||
item.shootSpeed = Speed;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe r = new ModRecipe(mod);
|
||||
r.SetResult(this);
|
||||
r.AddTile(ModContent.TileType<DraedonsForge>());
|
||||
r.AddIngredient(ModContent.ItemType<GhoulishGouger>());
|
||||
r.AddIngredient(ModContent.ItemType<SoulHarvester>());
|
||||
r.AddIngredient(ModContent.ItemType<EssenceFlayer>());
|
||||
r.AddIngredient(ModContent.ItemType<ShadowspecBar>(), 5);
|
||||
r.AddIngredient(ModContent.ItemType<EndothermicEnergy>(), 40);
|
||||
r.AddIngredient(ModContent.ItemType<DarkPlasma>(), 10);
|
||||
r.AddIngredient(ItemID.Nanites, 400);
|
||||
r.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -12,15 +12,15 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
DisplayName.SetDefault("Pwnagehammer");
|
||||
Tooltip.SetDefault("Throws a heavy, gravity-affected hammer that creates a loud blast of hallowed energy when it hits something\n" +
|
||||
"There is a 20 percent chance for the hammer to home in on a target\n" +
|
||||
"Homing hammers summon an additional spectral hammer on hit and are guaranteed to land a critical hit");
|
||||
"There is a 20 percent chance for the hammer to home in on a target\n" +
|
||||
"Homing hammers summon an additional spectral hammer on hit and are guaranteed to land a critical hit");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 68;
|
||||
item.damage = 210;
|
||||
item.crit = 10;
|
||||
item.crit = 10;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.autoReuse = true;
|
||||
@@ -30,20 +30,20 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.melee = true;
|
||||
item.height = 68;
|
||||
item.value = Item.buyPrice(0, 48, 0, 0);
|
||||
item.rare = 6;
|
||||
item.value = Item.buyPrice(gold: 48);
|
||||
item.rare = ItemRarityID.LightPurple;
|
||||
item.shoot = ModContent.ProjectileType<PwnagehammerProj>();
|
||||
item.shootSpeed = 24.4f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
Vector2 speed = new Vector2(speedX, speedY);
|
||||
Vector2 yeetOffset = Vector2.Normalize(speed) * 40f;
|
||||
if (Collision.CanHit(position, 0, 0, position + yeetOffset, 0, 0))
|
||||
{
|
||||
position += yeetOffset;
|
||||
}
|
||||
Vector2 speed = new Vector2(speedX, speedY);
|
||||
Vector2 yeetOffset = Vector2.Normalize(speed) * 40f;
|
||||
if (Collision.CanHit(position, 0, 0, position + yeetOffset, 0, 0))
|
||||
{
|
||||
position += yeetOffset;
|
||||
}
|
||||
Projectile.NewProjectile(position, speed, type, damage, knockBack, player.whoAmI, Main.rand.NextBool(5) ? 1f : -1f);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
@@ -31,8 +31,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.UseSound = SoundID.Item39;
|
||||
item.autoReuse = true;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(5, 0, 0, 0);
|
||||
item.rare = 10;
|
||||
item.value = Item.buyPrice(platinum: 5);
|
||||
item.rare = ItemRarityID.Red;
|
||||
item.shoot = ModContent.ProjectileType<IllustriousKnife>();
|
||||
item.shootSpeed = 9f;
|
||||
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
|
||||
@@ -93,8 +93,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
num149 *= num80;
|
||||
float x4 = vector2.X;
|
||||
float y4 = vector2.Y;
|
||||
int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[knife].Calamity().forceMelee = true;
|
||||
Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -30,8 +29,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.UseSound = SoundID.Item109;
|
||||
item.autoReuse = true;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(2, 50, 0, 0);
|
||||
item.rare = 10;
|
||||
item.value = Item.buyPrice(platinum: 2, gold: 50);
|
||||
item.rare = ItemRarityID.Red;
|
||||
item.shoot = ModContent.ProjectileType<ScourgeoftheCosmosProj>();
|
||||
item.shootSpeed = 15f;
|
||||
item.Calamity().customRarity = CalamityRarity.Violet;
|
||||
@@ -41,9 +40,9 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.ScourgeoftheCorruptor);
|
||||
recipe.AddIngredient(ModContent.ItemType<Bonebreaker>());
|
||||
recipe.AddIngredient(ModContent.ItemType<CosmiliteBar>(), 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<DarksunFragment>(), 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<XerocPitchfork>(), 200);
|
||||
recipe.AddTile(ModContent.TileType<DraedonsForge>());
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class SeashellBoomerangMelee : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Seashell Boomerang");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 18;
|
||||
item.damage = 15;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 15;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 15;
|
||||
item.knockBack = 5.5f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.melee = true;
|
||||
item.height = 34;
|
||||
item.value = Item.buyPrice(0, 2, 0, 0);
|
||||
item.rare = 2;
|
||||
item.shoot = ModContent.ProjectileType<SeashellBoomerangProjectile>();
|
||||
item.shootSpeed = 11.5f;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<VictideBar>(), 2);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 492 B |
@@ -1,12 +1,11 @@
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class StellarContemptMelee : ModItem
|
||||
public class StellarContemptMelee : ModItem
|
||||
{
|
||||
public static int BaseDamage = 250;
|
||||
public static float Speed = 18f;
|
||||
@@ -33,21 +32,14 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.UseSound = SoundID.Item1;
|
||||
|
||||
item.rare = 10;
|
||||
item.rare = ItemRarityID.Red;
|
||||
item.Calamity().customRarity = CalamityRarity.Turquoise;
|
||||
item.value = Item.buyPrice(1, 20, 0, 0);
|
||||
item.value = Item.buyPrice(platinum: 1, gold: 20);
|
||||
|
||||
item.shoot = ModContent.ProjectileType<StellarContemptHammer>();
|
||||
item.shootSpeed = Speed;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe r = new ModRecipe(mod);
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class TerraDiskMelee : ModItem
|
||||
{
|
||||
public static int BaseDamage = 100;
|
||||
public static float Speed = 12f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Terra Disk");
|
||||
Tooltip.SetDefault(@"Throws a disk that has a chance to generate several disks if enemies are near it
|
||||
A max of three disks can be active at a time");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 46;
|
||||
item.height = 46;
|
||||
item.damage = BaseDamage;
|
||||
item.knockBack = 4f;
|
||||
item.useAnimation = 16;
|
||||
item.useTime = 16;
|
||||
item.autoReuse = true;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.UseSound = SoundID.Item1;
|
||||
|
||||
item.value = Item.buyPrice(0, 80, 0, 0);
|
||||
item.rare = 8;
|
||||
|
||||
item.melee = true;
|
||||
item.shoot = ModContent.ProjectileType<TerraDiskProjectile>();
|
||||
item.shootSpeed = Speed;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.ownedProjectileCounts[item.shoot] >= 3)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
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)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddIngredient(ModContent.ItemType<SeashellBoomerangMelee>());
|
||||
recipe.AddIngredient(ModContent.ItemType<Equanimity>());
|
||||
recipe.AddIngredient(ItemID.ThornChakram);
|
||||
recipe.AddIngredient(ModContent.ItemType<LivingShard>(), 8);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -1,5 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -7,7 +7,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class TriactisTruePaladinianMageHammerofMightMelee : ModItem
|
||||
public class TriactisTruePaladinianMageHammerofMightMelee : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -29,11 +29,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.melee = true;
|
||||
item.height = 160;
|
||||
item.value = Item.buyPrice(5, 0, 0, 0);
|
||||
item.rare = 10;
|
||||
item.shoot = ModContent.ProjectileType<TriactisOPHammer>();
|
||||
item.shootSpeed = 25f;
|
||||
item.value = Item.buyPrice(platinum: 5);
|
||||
item.rare = ItemRarityID.Red;
|
||||
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
|
||||
item.shoot = ModContent.ProjectileType<TriactisHammerProj>();
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Melee
|
||||
{
|
||||
public class TruePaladinsHammerMelee : ModItem
|
||||
public class TruePaladinsHammerMelee : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -28,9 +28,9 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.melee = true;
|
||||
item.height = 28;
|
||||
item.value = Item.buyPrice(0, 80, 0, 0);
|
||||
item.rare = 8;
|
||||
item.shoot = ModContent.ProjectileType<OPHammer>();
|
||||
item.value = Item.buyPrice(gold: 80);
|
||||
item.rare = ItemRarityID.Yellow;
|
||||
item.shoot = ModContent.ProjectileType<FallenPaladinsHammerProj>();
|
||||
item.shootSpeed = 14f;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -28,8 +28,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
item.knockBack = 9f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.height = 38;
|
||||
item.value = Item.buyPrice(1, 20, 0, 0);
|
||||
item.rare = 10;
|
||||
item.value = Item.buyPrice(platinum: 1, gold: 20);
|
||||
item.rare = ItemRarityID.Red;
|
||||
item.shoot = ModContent.ProjectileType<AccretionDiskProj>();
|
||||
item.shootSpeed = 13f;
|
||||
item.Calamity().rogue = true;
|
||||
@@ -39,8 +39,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -29,8 +29,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
item.knockBack = 3f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.autoReuse = true;
|
||||
item.value = Item.buyPrice(0, 80, 0, 0);
|
||||
item.rare = 8;
|
||||
item.value = Item.buyPrice(gold: 80);
|
||||
item.rare = ItemRarityID.Yellow;
|
||||
item.Calamity().customRarity = CalamityRarity.Dedicated;
|
||||
item.shoot = ModContent.ProjectileType<CorpusAvertorProj>();
|
||||
item.shootSpeed = 5f;
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class EmpyreanKnivesThrown : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Empyrean Knives");
|
||||
Tooltip.SetDefault("Throws a flurry of bouncing knives that can heal the user");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 18;
|
||||
item.damage = 520;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 15;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 15;
|
||||
item.knockBack = 3f;
|
||||
item.UseSound = SoundID.Item39;
|
||||
item.autoReuse = true;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(2, 50, 0, 0);
|
||||
item.rare = 10;
|
||||
item.shoot = ModContent.ProjectileType<EmpyreanKnife>();
|
||||
item.shootSpeed = 15f;
|
||||
item.Calamity().rogue = true;
|
||||
item.Calamity().customRarity = CalamityRarity.Violet;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
float num72 = item.shootSpeed;
|
||||
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default);
|
||||
Vector2 vector3 = Main.MouseWorld - vector2;
|
||||
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
|
||||
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
|
||||
if (player.gravDir == -1f)
|
||||
{
|
||||
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
|
||||
}
|
||||
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
|
||||
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
|
||||
{
|
||||
num78 = (float)player.direction;
|
||||
num79 = 0f;
|
||||
num80 = num72;
|
||||
}
|
||||
else
|
||||
{
|
||||
num80 = num72 / num80;
|
||||
}
|
||||
num78 *= num80;
|
||||
num79 *= num80;
|
||||
int num146 = 4;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
num146++;
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
num146++;
|
||||
}
|
||||
if (Main.rand.NextBool(8))
|
||||
{
|
||||
num146++;
|
||||
}
|
||||
if (Main.rand.NextBool(16))
|
||||
{
|
||||
num146++;
|
||||
}
|
||||
for (int num147 = 0; num147 < num146; num147++)
|
||||
{
|
||||
float num148 = num78;
|
||||
float num149 = num79;
|
||||
float num150 = 0.05f * (float)num147;
|
||||
num148 += (float)Main.rand.Next(-25, 26) * num150;
|
||||
num149 += (float)Main.rand.Next(-25, 26) * num150;
|
||||
num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149));
|
||||
num80 = num72 / num80;
|
||||
num148 *= num80;
|
||||
num149 *= num80;
|
||||
float x4 = vector2.X;
|
||||
float y4 = vector2.Y;
|
||||
int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.VampireKnives);
|
||||
recipe.AddIngredient(ModContent.ItemType<CosmiliteBar>(), 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<DarksunFragment>(), 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<LunarKunai>(), 999);
|
||||
recipe.AddTile(ModContent.TileType<DraedonsForge>());
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -1,4 +1,4 @@
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
@@ -39,14 +39,13 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
||||
{
|
||||
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EradicatorGlow"));
|
||||
item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EradicatorGlow"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -7,7 +7,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class FlameScythe : RogueWeapon
|
||||
public class FlameScythe : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -18,18 +18,18 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 50;
|
||||
item.height = 48;
|
||||
item.height = 48;
|
||||
item.damage = 90;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.autoReuse = true;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 20;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 20;
|
||||
item.useAnimation = 20;
|
||||
item.knockBack = 8.5f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.value = Item.buyPrice(gold: 80);
|
||||
item.rare = 8;
|
||||
item.rare = ItemRarityID.Yellow;
|
||||
item.shoot = ModContent.ProjectileType<FlameScytheProjectile>();
|
||||
item.shootSpeed = 16f;
|
||||
item.Calamity().rogue = true;
|
||||
@@ -38,8 +38,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class GalaxySmasherRogue : RogueWeapon
|
||||
{
|
||||
public static int BaseDamage = 390;
|
||||
public static float Speed = 18f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Galaxy Smasher");
|
||||
Tooltip.SetDefault("Explodes and summons death lasers on enemy hits");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 86;
|
||||
item.height = 72;
|
||||
item.damage = BaseDamage;
|
||||
item.knockBack = 9f;
|
||||
item.useAnimation = 13;
|
||||
item.useTime = 13;
|
||||
item.autoReuse = true;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.UseSound = SoundID.Item1;
|
||||
|
||||
item.rare = 10;
|
||||
item.Calamity().customRarity = CalamityRarity.DarkBlue;
|
||||
item.value = Item.buyPrice(1, 80, 0, 0);
|
||||
|
||||
item.Calamity().rogue = true;
|
||||
item.shoot = ModContent.ProjectileType<GalaxySmasherHammer>();
|
||||
item.shootSpeed = Speed;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe r = new ModRecipe(mod);
|
||||
r.SetResult(this);
|
||||
r.AddIngredient(ModContent.ItemType<StellarContemptRogue>());
|
||||
r.AddIngredient(ModContent.ItemType<CosmiliteBar>(), 5);
|
||||
r.AddIngredient(ModContent.ItemType<AscendantSpiritEssence>());
|
||||
r.AddTile(ModContent.TileType<DraedonsForge>());
|
||||
r.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.3 KiB |
@@ -4,7 +4,7 @@ using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -33,8 +33,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
item.knockBack = 4f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(0, 48, 0, 0);
|
||||
item.rare = 6;
|
||||
item.value = Item.buyPrice(gold: 48);
|
||||
item.rare = ItemRarityID.LightPurple;
|
||||
item.shoot = ModContent.ProjectileType<KelvinCatalystBoomerang>();
|
||||
item.shootSpeed = 8f;
|
||||
item.Calamity().rogue = true;
|
||||
@@ -43,8 +43,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -7,7 +7,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class MangroveChakram : RogueWeapon
|
||||
public class MangroveChakram : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -27,8 +27,8 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
item.knockBack = 7.5f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.height = 38;
|
||||
item.value = Item.buyPrice(0, 60, 0, 0);
|
||||
item.rare = 7;
|
||||
item.value = Item.buyPrice(gold: 60);
|
||||
item.rare = ItemRarityID.Lime;
|
||||
item.shoot = ModContent.ProjectileType<MangroveChakramProjectile>();
|
||||
item.shootSpeed = 16f;
|
||||
item.Calamity().rogue = true;
|
||||
@@ -37,7 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
@@ -36,9 +36,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.UseSound = SoundID.Item18;
|
||||
|
||||
item.rare = 10;
|
||||
item.rare = ItemRarityID.Red;
|
||||
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
|
||||
item.value = Item.buyPrice(5, 0, 0, 0);
|
||||
item.value = Item.buyPrice(platinum: 5);
|
||||
|
||||
item.Calamity().rogue = true;
|
||||
item.shoot = ModContent.ProjectileType<NanoblackMain>();
|
||||
@@ -48,8 +48,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class Pwnagehammer : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Pwnagehammer");
|
||||
Tooltip.SetDefault("Throws a heavy, gravity-affected hammer that creates a loud blast of hallowed energy when it hits something\n" +
|
||||
"There is a 20 percent chance for the hammer to home in on a target\n" +
|
||||
"Homing hammers summon an additional spectral hammer on hit and are guaranteed to land a critical hit");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 68;
|
||||
item.damage = 210;
|
||||
item.crit = 10;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.autoReuse = true;
|
||||
item.useAnimation = item.useTime = 48;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.knockBack = 10f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.Calamity().rogue = true;
|
||||
item.height = 68;
|
||||
item.value = Item.buyPrice(0, 48, 0, 0);
|
||||
item.rare = 6;
|
||||
item.shoot = ModContent.ProjectileType<PwnagehammerProj>();
|
||||
item.shootSpeed = 24.4f;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
Vector2 speed = new Vector2(speedX, speedY);
|
||||
Vector2 yeetOffset = Vector2.Normalize(speed) * 40f;
|
||||
if (Collision.CanHit(position, 0, 0, position + yeetOffset, 0, 0))
|
||||
{
|
||||
position += yeetOffset;
|
||||
}
|
||||
int proj = Projectile.NewProjectile(position, speed, type, damage, knockBack, player.whoAmI, Main.rand.NextBool(5) ? 1f : -1f);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.Pwnhammer);
|
||||
recipe.AddIngredient(ItemID.HallowedBar, 7);
|
||||
recipe.AddIngredient(ItemID.SoulofMight, 3);
|
||||
recipe.AddIngredient(ItemID.SoulofSight, 3);
|
||||
recipe.AddIngredient(ItemID.SoulofFright, 3);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 584 B |
@@ -1,113 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class RoyalKnives : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Illustrious Knives");
|
||||
Tooltip.SetDefault("Throws a flurry of homing knives that can heal the user");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 18;
|
||||
item.damage = 2000;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 12;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 12;
|
||||
item.knockBack = 3f;
|
||||
item.UseSound = SoundID.Item39;
|
||||
item.autoReuse = true;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(5, 0, 0, 0);
|
||||
item.rare = 10;
|
||||
item.shoot = ModContent.ProjectileType<IllustriousKnife>();
|
||||
item.shootSpeed = 9f;
|
||||
item.Calamity().rogue = true;
|
||||
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
float num72 = item.shootSpeed;
|
||||
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default);
|
||||
Vector2 vector3 = Main.MouseWorld - vector2;
|
||||
float num78 = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
|
||||
float num79 = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
|
||||
if (player.gravDir == -1f)
|
||||
{
|
||||
num79 = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
|
||||
}
|
||||
float num80 = (float)Math.Sqrt((double)(num78 * num78 + num79 * num79));
|
||||
if ((float.IsNaN(num78) && float.IsNaN(num79)) || (num78 == 0f && num79 == 0f))
|
||||
{
|
||||
num78 = (float)player.direction;
|
||||
num79 = 0f;
|
||||
num80 = num72;
|
||||
}
|
||||
else
|
||||
{
|
||||
num80 = num72 / num80;
|
||||
}
|
||||
num78 *= num80;
|
||||
num79 *= num80;
|
||||
int num146 = 4;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
num146++;
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
num146++;
|
||||
}
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
num146++;
|
||||
}
|
||||
if (Main.rand.NextBool(8))
|
||||
{
|
||||
num146++;
|
||||
}
|
||||
for (int num147 = 0; num147 < num146; num147++)
|
||||
{
|
||||
float num148 = num78;
|
||||
float num149 = num79;
|
||||
float num150 = 0.05f * (float)num147;
|
||||
num148 += (float)Main.rand.Next(-35, 36) * num150;
|
||||
num149 += (float)Main.rand.Next(-35, 36) * num150;
|
||||
num80 = (float)Math.Sqrt((double)(num148 * num148 + num149 * num149));
|
||||
num80 = num72 / num80;
|
||||
num148 *= num80;
|
||||
num149 *= num80;
|
||||
float x4 = vector2.X;
|
||||
float y4 = vector2.Y;
|
||||
int knife = Projectile.NewProjectile(x4, y4, num148, num149, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[knife].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<ShadowspecBar>(), 5);
|
||||
recipe.AddIngredient(ModContent.ItemType<CoreofCalamity>(), 3);
|
||||
recipe.AddIngredient(ModContent.ItemType<EmpyreanKnivesThrown>());
|
||||
recipe.AddTile(ModContent.TileType<DraedonsForge>());
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 503 B |
@@ -1,59 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class ScourgeoftheCosmosThrown : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Scourge of the Cosmos");
|
||||
Tooltip.SetDefault("Throws a bouncing cosmic scourge that emits tiny homing cosmic scourges on death and tile hits");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 18;
|
||||
item.damage = 1100;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 20;
|
||||
item.useStyle = ItemUseStyleID.HoldingOut;
|
||||
item.useTime = 20;
|
||||
item.knockBack = 5f;
|
||||
item.UseSound = SoundID.Item109;
|
||||
item.autoReuse = true;
|
||||
item.height = 20;
|
||||
item.value = Item.buyPrice(2, 50, 0, 0);
|
||||
item.rare = 10;
|
||||
item.shoot = ModContent.ProjectileType<ScourgeoftheCosmosProj>();
|
||||
item.shootSpeed = 15f;
|
||||
item.Calamity().rogue = true;
|
||||
item.Calamity().customRarity = CalamityRarity.Violet;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int javelin = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
Main.projectile[javelin].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.ScourgeoftheCorruptor);
|
||||
recipe.AddIngredient(ModContent.ItemType<CosmiliteBar>(), 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<DarksunFragment>(), 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<XerocPitchfork>(), 200);
|
||||
recipe.AddTile(ModContent.TileType<DraedonsForge>());
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.3 KiB |
@@ -1,5 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -36,7 +36,6 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class StellarContemptRogue : RogueWeapon
|
||||
{
|
||||
public static int BaseDamage = 250;
|
||||
public static float Speed = 18f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Stellar Contempt");
|
||||
Tooltip.SetDefault("Lunar flares rain down on enemy hits");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 66;
|
||||
item.height = 64;
|
||||
item.damage = BaseDamage;
|
||||
item.knockBack = 9f;
|
||||
item.useTime = 13;
|
||||
item.useAnimation = 13;
|
||||
item.autoReuse = true;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.UseSound = SoundID.Item1;
|
||||
|
||||
item.rare = 10;
|
||||
item.Calamity().customRarity = CalamityRarity.Turquoise;
|
||||
item.value = Item.buyPrice(1, 20, 0, 0);
|
||||
|
||||
item.Calamity().rogue = true;
|
||||
item.shoot = ModContent.ProjectileType<StellarContemptHammer>();
|
||||
item.shootSpeed = Speed;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe r = new ModRecipe(mod);
|
||||
r.SetResult(this);
|
||||
r.AddIngredient(ModContent.ItemType<TruePaladinsHammer>());
|
||||
r.AddIngredient(ItemID.LunarBar, 5);
|
||||
r.AddIngredient(ItemID.FragmentSolar, 10);
|
||||
r.AddIngredient(ItemID.FragmentNebula, 10);
|
||||
r.AddTile(TileID.LunarCraftingStation);
|
||||
r.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,5 +1,5 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -34,8 +34,8 @@ A max of three disks can be active at a time");
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.UseSound = SoundID.Item1;
|
||||
|
||||
item.value = Item.buyPrice(0, 80, 0, 0);
|
||||
item.rare = 8;
|
||||
item.value = Item.buyPrice(gold: 80);
|
||||
item.rare = ItemRarityID.Yellow;
|
||||
|
||||
item.Calamity().rogue = true;
|
||||
item.shoot = ModContent.ProjectileType<TerraDiskProjectile>();
|
||||
@@ -44,21 +44,21 @@ A max of three disks can be active at a time");
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
if (player.ownedProjectileCounts[item.shoot] >= 3)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (player.ownedProjectileCounts[item.shoot] >= 3)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
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)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Tiles.Furniture.CraftingStations;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class TriactisTruePaladinianMageHammerofMight : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Triactis' True Paladinian Mage-Hammer of Might");
|
||||
Tooltip.SetDefault("Explodes on enemy hits");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 160;
|
||||
item.damage = 10000;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.autoReuse = true;
|
||||
item.useAnimation = 10;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 10;
|
||||
item.knockBack = 50f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.height = 160;
|
||||
item.value = Item.buyPrice(5, 0, 0, 0);
|
||||
item.rare = 10;
|
||||
item.shoot = ModContent.ProjectileType<TriactisOPHammer>();
|
||||
item.shootSpeed = 25f;
|
||||
item.Calamity().rogue = true;
|
||||
item.Calamity().customRarity = CalamityRarity.ItemSpecific;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<GalaxySmasherRogue>());
|
||||
recipe.AddIngredient(ItemID.SoulofMight, 30);
|
||||
recipe.AddIngredient(ModContent.ItemType<ShadowspecBar>(), 5);
|
||||
recipe.AddTile(ModContent.TileType<DraedonsForge>());
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 3.5 KiB |
@@ -1,59 +0,0 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class TruePaladinsHammer : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Fallen Paladin's Hammer");
|
||||
Tooltip.SetDefault("Explodes on enemy hits");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 14;
|
||||
item.damage = 87;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.autoReuse = true;
|
||||
item.useAnimation = 13;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.useTime = 13;
|
||||
item.knockBack = 20f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.height = 28;
|
||||
item.value = Item.buyPrice(0, 80, 0, 0);
|
||||
item.rare = 8;
|
||||
item.shoot = ModContent.ProjectileType<OPHammer>();
|
||||
item.shootSpeed = 14f;
|
||||
item.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI);
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.PaladinsHammer);
|
||||
recipe.AddIngredient(ModContent.ItemType<Pwnagehammer>());
|
||||
recipe.AddIngredient(ModContent.ItemType<CalamityDust>(), 5);
|
||||
recipe.AddIngredient(ModContent.ItemType<CoreofChaos>(), 5);
|
||||
recipe.AddIngredient(ModContent.ItemType<CruptixBar>(), 5);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.0 KiB |
@@ -386,7 +386,7 @@ namespace CalamityMod
|
||||
BossDifficulty.TryGetValue("Ravager", out float order);
|
||||
List<int> segments = new List<int>() { NPCType<RavagerBody>(), NPCType<RavagerClawLeft>(), NPCType<RavagerClawRight>(), NPCType<RavagerHead>(), NPCType<RavagerLegLeft>(), NPCType<RavagerLegRight>() };
|
||||
int summon = ItemType<AncientMedallion>();
|
||||
List<int> loot = new List<int>() { ItemType<RavagerBag>(), ItemType<FleshyGeodeT1>(), ItemType<FleshyGeodeT2>(), ItemType<UltimusCleaver>(), ItemType<RealmRavager>(), ItemType<Hematemesis>(), ItemType<SpikecragStaff>(), ItemType<CraniumSmasher>(), ItemType<BloodPact>(), ItemType<FleshTotem>(), ItemType<BloodflareCore>(), ItemType<InfernalBlood>(), ItemID.GreaterHealingPotion };
|
||||
List<int> loot = new List<int>() { ItemType<RavagerBag>(), ItemType<FleshyGeodeT1>(), ItemType<FleshyGeodeT2>(), ItemType<UltimusCleaver>(), ItemType<RealmRavager>(), ItemType<Hematemesis>(), ItemType<SpikecragStaff>(), ItemType<CraniumSmasher>(), ItemType<CorpusAvertor>(), ItemType<BloodPact>(), ItemType<FleshTotem>(), ItemType<BloodflareCore>(), ItemType<InfernalBlood>(), ItemID.GreaterHealingPotion };
|
||||
List<int> collection = new List<int>() { ItemType<RavagerTrophy>(), ItemType<RavagerMask>(), ItemType<KnowledgeRavager>() };
|
||||
string instructions = $"Use an [i:{summon}]";
|
||||
string despawn = CalamityUtils.ColorMessage("The automaton of misshapen victims went looking for the true perpetrator.", new Color(0xB2, 0x22, 0x22));
|
||||
@@ -514,7 +514,7 @@ namespace CalamityMod
|
||||
BossDifficulty.TryGetValue("DevourerOfGods", out float order);
|
||||
int type = NPCType<DevourerofGodsHeadS>();
|
||||
int summon = ItemType<CosmicWorm>();
|
||||
List<int> loot = new List<int>() { ItemType<DevourerofGodsBag>(), ItemType<CosmiliteBar>(), ItemType<CosmiliteBrick>(), ItemType<Excelsus>(), ItemType<EradicatorMelee>(), ItemType<TheObliterator>(), ItemType<Deathwind>(), ItemType<DeathhailStaff>(), ItemType<StaffoftheMechworm>(), ItemType<Eradicator>(), ItemType<Skullmasher>(), ItemType<Norfleet>(), ItemType<CosmicDischarge>(), ItemType<NebulousCore>(), ItemType<Fabsol>(), ItemType<SupremeHealingPotion>() };
|
||||
List<int> loot = new List<int>() { ItemType<DevourerofGodsBag>(), ItemType<CosmiliteBar>(), ItemType<CosmiliteBrick>(), ItemType<Excelsus>(), ItemType<TheObliterator>(), ItemType<Deathwind>(), ItemType<DeathhailStaff>(), ItemType<StaffoftheMechworm>(), ItemType<Eradicator>(), ItemType<Skullmasher>(), ItemType<Norfleet>(), ItemType<CosmicDischarge>(), ItemType<NebulousCore>(), ItemType<Fabsol>(), ItemType<SupremeHealingPotion>() };
|
||||
List<int> collection = new List<int>() { ItemType<DevourerofGodsTrophy>(), ItemType<DevourerofGodsMask>(), ItemType<KnowledgeDevourerofGods>() };
|
||||
string instructions = $"Use a [i:{summon}]";
|
||||
string despawn = CalamityUtils.ColorMessage("The Devourer of Gods has slain everyone and feasted on their essence.", new Color(0x00, 0xFF, 0xFF));
|
||||
@@ -542,7 +542,7 @@ namespace CalamityMod
|
||||
BossDifficulty.TryGetValue("SupremeCalamitas", out float order);
|
||||
int type = NPCType<SupremeCalamitas>();
|
||||
int summon = ItemType<EyeofExtinction>();
|
||||
List<int> loot = new List<int>() { ItemType<CalamitousEssence>(), ItemType<Animus>(), ItemType<Azathoth>(), ItemType<Contagion>(), ItemType<CrystylCrusher>(), ItemType<Judgement>(), ItemType<DraconicDestruction>(), ItemType<Earth>(), ItemType<Endogenesis>(), ItemType<Fabstaff>(), ItemType<RoyalKnivesMelee>(), ItemType<RoyalKnives>(), ItemType<NanoblackReaperMelee>(), ItemType<NanoblackReaperRogue>(), ItemType<RedSun>(), ItemType<ScarletDevil>(), ItemType<SomaPrime>(), ItemType<BlushieStaff>(), ItemType<Svantechnical>(), ItemType<BensUmbrella>(), ItemType<TriactisTruePaladinianMageHammerofMightMelee>(), ItemType<TriactisTruePaladinianMageHammerofMight>(), ItemType<Megafleet>(), ItemType<PrototypeAndromechaRing>(), ItemType<Vehemenc>(), ItemType<OmegaHealingPotion>() };
|
||||
List<int> loot = new List<int>() { ItemType<CalamitousEssence>(), ItemType<Animus>(), ItemType<Azathoth>(), ItemType<Contagion>(), ItemType<CrystylCrusher>(), ItemType<Judgement>(), ItemType<DraconicDestruction>(), ItemType<Earth>(), ItemType<Endogenesis>(), ItemType<Fabstaff>(), ItemType<RoyalKnivesMelee>(), ItemType<NanoblackReaperRogue>(), ItemType<RedSun>(), ItemType<ScarletDevil>(), ItemType<SomaPrime>(), ItemType<BlushieStaff>(), ItemType<Svantechnical>(), ItemType<BensUmbrella>(), ItemType<TriactisTruePaladinianMageHammerofMightMelee>(), ItemType<Megafleet>(), ItemType<PrototypeAndromechaRing>(), ItemType<Vehemenc>(), ItemType<OmegaHealingPotion>() };
|
||||
List<int> collection = new List<int>() { ItemType<SupremeCalamitasTrophy>(), ItemType<KnowledgeCalamitas>(), ItemType<BrimstoneJewel>(), ItemType<Levi>() };
|
||||
string instructions = $"Use an [i:{summon}]";
|
||||
string despawn = CalamityUtils.ColorMessage("Please don't waste my time.", new Color(0xFF, 0xA5, 0x00));
|
||||
|
||||
@@ -1152,7 +1152,7 @@ namespace CalamityMod.NPCs.DevourerofGods
|
||||
DropHelper.WeightStack<Deathwind>(w),
|
||||
DropHelper.WeightStack<DeathhailStaff>(w),
|
||||
DropHelper.WeightStack<StaffoftheMechworm>(w),
|
||||
Main.rand.NextBool() ? DropHelper.WeightStack<EradicatorMelee>(w) : DropHelper.WeightStack<Eradicator>(w)
|
||||
DropHelper.WeightStack<Eradicator>(w)
|
||||
);
|
||||
|
||||
// Vanity
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.Items.Accessories;
|
||||
using CalamityMod.Items.LoreItems;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Pets;
|
||||
using CalamityMod.Items.Placeables.Furniture.Trophies;
|
||||
using CalamityMod.Items.Potions;
|
||||
using CalamityMod.Items.Tools;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
@@ -21,10 +22,7 @@ using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.Localization;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Items.Placeables.Furniture.Trophies;
|
||||
using CalamityMod.Events;
|
||||
|
||||
namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
{
|
||||
@@ -2055,29 +2053,28 @@ namespace CalamityMod.NPCs.SupremeCalamitas
|
||||
DropHelper.DropItem(npc, ModContent.ItemType<CalamitousEssence>(), true, essenceMin, essenceMax);
|
||||
|
||||
// Weapons
|
||||
|
||||
// All non-hybrid weapons are listed twice so that the drop rates are actually equal between each unique weapon
|
||||
// Rejoice! Hybrid weapons are no more, so this list is no longer cluttered.
|
||||
DropHelper.DropItemFromSetCondition(npc, true, Main.expertMode,
|
||||
ModContent.ItemType<Animus>(), ModContent.ItemType<Animus>(),
|
||||
ModContent.ItemType<Azathoth>(), ModContent.ItemType<Azathoth>(),
|
||||
ModContent.ItemType<Contagion>(), ModContent.ItemType<Contagion>(),
|
||||
ModContent.ItemType<CrystylCrusher>(), ModContent.ItemType<CrystylCrusher>(),
|
||||
ModContent.ItemType<DraconicDestruction>(), ModContent.ItemType<DraconicDestruction>(),
|
||||
ModContent.ItemType<Earth>(), ModContent.ItemType<Earth>(),
|
||||
ModContent.ItemType<Fabstaff>(), ModContent.ItemType<Fabstaff>(),
|
||||
ModContent.ItemType<RoyalKnivesMelee>(), ModContent.ItemType<RoyalKnives>(), // Illustrious Knives
|
||||
ModContent.ItemType<NanoblackReaperMelee>(), ModContent.ItemType<NanoblackReaperRogue>(),
|
||||
ModContent.ItemType<RedSun>(), ModContent.ItemType<RedSun>(),
|
||||
ModContent.ItemType<ScarletDevil>(), ModContent.ItemType<ScarletDevil>(),
|
||||
ModContent.ItemType<SomaPrime>(), ModContent.ItemType<SomaPrime>(),
|
||||
ModContent.ItemType<BlushieStaff>(), ModContent.ItemType<BlushieStaff>(), // Staff of Blushie
|
||||
ModContent.ItemType<Svantechnical>(), ModContent.ItemType<Svantechnical>(),
|
||||
ModContent.ItemType<Judgement>(), ModContent.ItemType<Judgement>(),
|
||||
ModContent.ItemType<TriactisTruePaladinianMageHammerofMightMelee>(), ModContent.ItemType<TriactisTruePaladinianMageHammerofMight>(),
|
||||
ModContent.ItemType<Megafleet>(), ModContent.ItemType<Megafleet>(), // Voidragon
|
||||
ModContent.ItemType<Endogenesis>(), ModContent.ItemType<Endogenesis>(),
|
||||
ModContent.ItemType<BensUmbrella>(), ModContent.ItemType<BensUmbrella>(), //Temporal Umbrella
|
||||
ModContent.ItemType<PrototypeAndromechaRing>(), ModContent.ItemType<PrototypeAndromechaRing>()
|
||||
ModContent.ItemType<Animus>(),
|
||||
ModContent.ItemType<Azathoth>(),
|
||||
ModContent.ItemType<Contagion>(),
|
||||
ModContent.ItemType<CrystylCrusher>(),
|
||||
ModContent.ItemType<DraconicDestruction>(),
|
||||
ModContent.ItemType<Earth>(),
|
||||
ModContent.ItemType<Endogenesis>(),
|
||||
ModContent.ItemType<Fabstaff>(),
|
||||
ModContent.ItemType<PrototypeAndromechaRing>(), // Flamsteed Ring
|
||||
ModContent.ItemType<RoyalKnivesMelee>(), // Illustrious Knives
|
||||
ModContent.ItemType<NanoblackReaperRogue>(),
|
||||
ModContent.ItemType<RedSun>(),
|
||||
ModContent.ItemType<ScarletDevil>(),
|
||||
ModContent.ItemType<SomaPrime>(),
|
||||
ModContent.ItemType<BlushieStaff>(), // Staff of Blushie
|
||||
ModContent.ItemType<Svantechnical>(),
|
||||
ModContent.ItemType<BensUmbrella>(), // Temporal Umbrella
|
||||
ModContent.ItemType<Judgement>(), // The Dance of Light
|
||||
ModContent.ItemType<TriactisTruePaladinianMageHammerofMightMelee>(),
|
||||
ModContent.ItemType<Megafleet>() // Voidragon
|
||||
);
|
||||
DropHelper.DropItemCondition(npc, ModContent.ItemType<Vehemenc>(), Main.expertMode, CalamityWorld.revenge);
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ using CalamityMod.Dusts;
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.NPCs.NormalNPCs;
|
||||
using CalamityMod.Projectiles.Healing;
|
||||
using CalamityMod.Projectiles.Hybrid;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Projectiles.Melee.Yoyos;
|
||||
@@ -24,7 +23,7 @@ using static Terraria.ModLoader.ModContent;
|
||||
|
||||
namespace CalamityMod.Projectiles
|
||||
{
|
||||
public class CalamityGlobalProjectile : GlobalProjectile
|
||||
public class CalamityGlobalProjectile : GlobalProjectile
|
||||
{
|
||||
public override bool InstancePerEntity
|
||||
{
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class AccretionDisk2 : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/AccretionDisk";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Accretion Disk");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 56;
|
||||
projectile.height = 56;
|
||||
projectile.alpha = 120;
|
||||
projectile.friendly = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.aiStyle = 3;
|
||||
projectile.timeLeft = 60;
|
||||
aiType = ProjectileID.WoodenBoomerang;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
int num250 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.5f);
|
||||
Main.dust[num250].noGravity = true;
|
||||
Main.dust[num250].velocity *= 0f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<GlacialState>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<GlacialState>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class CorpusAvertorClone : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/CorpusAvertor";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Corpus Avertor");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 24;
|
||||
projectile.height = 24;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 180;
|
||||
projectile.melee = true;
|
||||
projectile.tileCollide = false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.ai[1] == 1f)
|
||||
{
|
||||
projectile.melee = false;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.04f;
|
||||
|
||||
projectile.velocity.X *= 1.005f;
|
||||
projectile.velocity.Y *= 1.005f;
|
||||
|
||||
switch ((int)projectile.ai[0])
|
||||
{
|
||||
case 20:
|
||||
projectile.scale = 0.7f;
|
||||
break;
|
||||
case 40:
|
||||
projectile.scale = 0.8f;
|
||||
break;
|
||||
case 60:
|
||||
projectile.scale = 0.9f;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
projectile.width = projectile.height = (int)(24f * projectile.scale);
|
||||
|
||||
CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 300f, 16f, 20f);
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
if (projectile.timeLeft < 85)
|
||||
{
|
||||
return new Color((int)(150f * ((float)projectile.timeLeft / 85f)), 0, 0, projectile.timeLeft / 5 * 3);
|
||||
}
|
||||
return new Color(150, 0, 0, 50);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
return;
|
||||
|
||||
float heal = (float)damage * 0.05f;
|
||||
if ((int)heal == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
float heal = (float)damage * 0.05f;
|
||||
if ((int)heal == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class CorpusAvertorProj : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/CorpusAvertor";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Corpus Avertor");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 6;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 24;
|
||||
projectile.height = 24;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.melee = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.ai[1] == 1f)
|
||||
{
|
||||
projectile.melee = false;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f;
|
||||
|
||||
if (projectile.ai[0] < 120f)
|
||||
projectile.ai[0] += 1f;
|
||||
|
||||
if (projectile.ai[0] < 61f)
|
||||
{
|
||||
if (projectile.ai[0] % 20f == 0f)
|
||||
{
|
||||
Vector2 velocity = new Vector2(projectile.velocity.X, projectile.velocity.Y);
|
||||
float mult = projectile.ai[0] / 80f; // Ranges from 0.25 to 0.5 to 0.75
|
||||
velocity *= mult;
|
||||
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, velocity.X, velocity.Y, ModContent.ProjectileType<CorpusAvertorClone>(),
|
||||
(int)(projectile.damage * mult), projectile.knockBack * mult, projectile.owner, projectile.ai[0], projectile.melee ? 0f : 1f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X *= 1.01f;
|
||||
projectile.velocity.Y *= 1.01f;
|
||||
|
||||
int scale = (int)((projectile.ai[0] - 60f) * 4.25f);
|
||||
int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, new Color(scale, 0, 0, 50), 2f);
|
||||
Main.dust[dust].velocity *= 0f;
|
||||
Main.dust[dust].noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
if (projectile.ai[0] >= 61f)
|
||||
{
|
||||
int scale = (int)((projectile.ai[0] - 60f) * 4.25f);
|
||||
return new Color(scale, 0, 0, 50);
|
||||
}
|
||||
return new Color(0, 0, 0, 50);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
return;
|
||||
|
||||
float heal = (float)damage * 0.05f;
|
||||
if ((int)heal == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
float heal = (float)damage * 0.05f;
|
||||
if ((int)heal == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class EmpyreanKnife : ModProjectile
|
||||
{
|
||||
private int bounce = 3;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Knife");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 12;
|
||||
projectile.height = 12;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.melee = true;
|
||||
projectile.extraUpdates = 1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.ai[1] == 1f)
|
||||
{
|
||||
projectile.melee = false;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] >= 75f)
|
||||
{
|
||||
projectile.alpha += 10;
|
||||
projectile.damage = (int)(projectile.damage * 0.95);
|
||||
projectile.knockBack = projectile.knockBack * 0.95f;
|
||||
if (projectile.alpha >= 255)
|
||||
{
|
||||
projectile.active = false;
|
||||
}
|
||||
}
|
||||
if (projectile.ai[0] < 75f)
|
||||
{
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + MathHelper.PiOver2;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.rotation += 0.5f;
|
||||
}
|
||||
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 250f, 15f, 20f);
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 58, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
bounce--;
|
||||
if (bounce <= 0)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
{
|
||||
projectile.velocity.X = -oldVelocity.X;
|
||||
}
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
{
|
||||
projectile.velocity.Y = -oldVelocity.Y;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int num303 = 0; num303 < 3; num303++)
|
||||
{
|
||||
int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 0.8f);
|
||||
Main.dust[num304].noGravity = true;
|
||||
Main.dust[num304].velocity *= 1.2f;
|
||||
Main.dust[num304].velocity -= projectile.oldVelocity * 0.3f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
float healAmt = (float)damage * 0.005f;
|
||||
if ((int)healAmt == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
float healAmt = (float)damage * 0.005f;
|
||||
if ((int)healAmt == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,66 +0,0 @@
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class EradicatorProjectile : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/Eradicator";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Eradicator");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 58;
|
||||
projectile.height = 58;
|
||||
projectile.friendly = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.aiStyle = 3;
|
||||
projectile.timeLeft = 180;
|
||||
aiType = ProjectileID.WoodenBoomerang;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 3;
|
||||
projectile.melee = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.35f, 0f, 0.25f);
|
||||
CalamityGlobalProjectile.MagnetSphereHitscan(projectile, 300f, 6f, 8f, 6, ModContent.ProjectileType<NebulaShot>(), 1D, true);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Vector2 origin = new Vector2(31f, 29f);
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Items/Weapons/Rogue/EradicatorGlow"), projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation, origin, 1f, SpriteEffects.None, 0f);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.OnFire, 600);
|
||||
target.AddBuff(BuffID.Frostburn, 600);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.OnFire, 600);
|
||||
target.AddBuff(BuffID.Frostburn, 600);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class FlameScytheProjectile : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/FlameScythe";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Scythe");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 30;
|
||||
projectile.height = 30;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.aiStyle = 3;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.alpha = 55;
|
||||
aiType = ProjectileID.WoodenBoomerang;
|
||||
projectile.melee = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.25f, 0.15f, 0f);
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.NextBool(3) ? 16 : 127, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
||||
}
|
||||
Vector2 goreVec = new Vector2(projectile.position.X + (float)(projectile.width / 2) + projectile.velocity.X, projectile.position.Y + (float)(projectile.height / 2) + projectile.velocity.Y);
|
||||
if (Main.rand.NextBool(8))
|
||||
{
|
||||
int smoke = Gore.NewGore(goreVec, default, Main.rand.Next(375, 378), 0.75f);
|
||||
Main.gore[smoke].behindTiles = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Texture2D tex = Main.projectileTexture[projectile.type];
|
||||
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.immune[projectile.owner] = 6;
|
||||
target.AddBuff(BuffID.OnFire, 300);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
if (projectile.melee)
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
else
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.OnFire, 300);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
if (projectile.melee)
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
else
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,259 +0,0 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class GalaxySmasherHammer : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/GalaxySmasherMelee";
|
||||
|
||||
private static float RotationIncrement = 0.22f;
|
||||
private static int Lifetime = 240;
|
||||
private static float ReboundTime = 26f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Galaxy Smasher");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 62;
|
||||
projectile.height = 62;
|
||||
projectile.friendly = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 3;
|
||||
projectile.timeLeft = Lifetime;
|
||||
|
||||
// Slightly ignores iframes so it can easily hit twice.
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 8;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
drawOffsetX = -12;
|
||||
drawOriginOffsetY = -5;
|
||||
drawOriginOffsetX = 0;
|
||||
|
||||
// Produces violet dust constantly while in flight. This lights the hammer.
|
||||
int numDust = 2;
|
||||
for (int i = 0; i < numDust; ++i)
|
||||
{
|
||||
int dustType = Main.rand.NextBool(6) ? 112 : 173;
|
||||
float scale = 0.8f + Main.rand.NextFloat(0.6f);
|
||||
int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType);
|
||||
Main.dust[idx].noGravity = true;
|
||||
Main.dust[idx].velocity = Vector2.Zero;
|
||||
Main.dust[idx].scale = scale;
|
||||
}
|
||||
|
||||
// The hammer makes sound while flying.
|
||||
if (projectile.soundDelay == 0)
|
||||
{
|
||||
projectile.soundDelay = 8;
|
||||
Main.PlaySound(SoundID.Item7, (int)projectile.position.X, (int)projectile.position.Y);
|
||||
}
|
||||
|
||||
// ai[0] stores whether the hammer is returning. If 0, it isn't. If 1, it is.
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] >= ReboundTime)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.tileCollide = false;
|
||||
float returnSpeed = GalaxySmasherMelee.Speed;
|
||||
float acceleration = 3.2f;
|
||||
Player owner = Main.player[projectile.owner];
|
||||
|
||||
// Delete the hammer if it's excessively far away.
|
||||
Vector2 playerCenter = owner.Center;
|
||||
float xDist = playerCenter.X - projectile.Center.X;
|
||||
float yDist = playerCenter.Y - projectile.Center.Y;
|
||||
float dist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist));
|
||||
if (dist > 3000f)
|
||||
projectile.Kill();
|
||||
|
||||
dist = returnSpeed / dist;
|
||||
xDist *= dist;
|
||||
yDist *= dist;
|
||||
|
||||
// Home back in on the player.
|
||||
if (projectile.velocity.X < xDist)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + acceleration;
|
||||
if (projectile.velocity.X < 0f && xDist > 0f)
|
||||
projectile.velocity.X += acceleration;
|
||||
}
|
||||
else if (projectile.velocity.X > xDist)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - acceleration;
|
||||
if (projectile.velocity.X > 0f && xDist < 0f)
|
||||
projectile.velocity.X -= acceleration;
|
||||
}
|
||||
if (projectile.velocity.Y < yDist)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + acceleration;
|
||||
if (projectile.velocity.Y < 0f && yDist > 0f)
|
||||
projectile.velocity.Y += acceleration;
|
||||
}
|
||||
else if (projectile.velocity.Y > yDist)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - acceleration;
|
||||
if (projectile.velocity.Y > 0f && yDist < 0f)
|
||||
projectile.velocity.Y -= acceleration;
|
||||
}
|
||||
|
||||
// Delete the projectile if it touches its owner.
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
if (projectile.Hitbox.Intersects(owner.Hitbox))
|
||||
projectile.Kill();
|
||||
}
|
||||
|
||||
// Rotate the hammer as it flies.
|
||||
projectile.rotation += RotationIncrement;
|
||||
return;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
// Some dust gets produced on impact.
|
||||
int dustSets = Main.rand.Next(5, 8);
|
||||
int dustRadius = 6;
|
||||
Vector2 corner = new Vector2(target.Center.X - (float)dustRadius, target.Center.Y - (float)dustRadius);
|
||||
for (int i = 0; i < dustSets; ++i)
|
||||
{
|
||||
// Bigger, flying orb dust
|
||||
float scaleOrb = 1.2f + Main.rand.NextFloat(1f);
|
||||
int orb = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 112);
|
||||
Main.dust[orb].noGravity = true;
|
||||
Main.dust[orb].velocity *= 4f;
|
||||
Main.dust[orb].scale = scaleOrb;
|
||||
|
||||
// Add six sparkles per flying orb
|
||||
for (int j = 0; j < 6; ++j)
|
||||
{
|
||||
float scaleSparkle = 0.8f + Main.rand.NextFloat(1.1f);
|
||||
int sparkle = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 173);
|
||||
Main.dust[sparkle].noGravity = true;
|
||||
float dustSpeed = Main.rand.NextFloat(10f, 18f);
|
||||
Main.dust[sparkle].velocity = Main.rand.NextVector2Unit() * dustSpeed;
|
||||
Main.dust[sparkle].scale = scaleSparkle;
|
||||
}
|
||||
}
|
||||
|
||||
// Makes an explosion sound.
|
||||
Main.PlaySound(SoundID.Item14, projectile.position);
|
||||
|
||||
// Applies God Slayer Inferno on contact.
|
||||
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 480);
|
||||
|
||||
// Three death lasers (aka "Nebula Shots") swarm the target.
|
||||
int laserID = ModContent.ProjectileType<NebulaShot>();
|
||||
int laserDamage = (int)(0.2f * projectile.damage);
|
||||
float laserKB = 2.5f;
|
||||
int numLasers = 3;
|
||||
for (int i = 0; i < numLasers; ++i)
|
||||
{
|
||||
float startDist = Main.rand.NextFloat(260f, 270f);
|
||||
Vector2 startDir = Main.rand.NextVector2Unit();
|
||||
Vector2 startPoint = target.Center + (startDir * startDist);
|
||||
|
||||
float laserSpeed = Main.rand.NextFloat(15f, 18f);
|
||||
Vector2 velocity = startDir * (-laserSpeed);
|
||||
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner);
|
||||
if (projectile.melee)
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
else
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
Main.projectile[proj].tileCollide = false;
|
||||
Main.projectile[proj].timeLeft = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
// Some dust gets produced on impact.
|
||||
int dustSets = Main.rand.Next(5, 8);
|
||||
int dustRadius = 6;
|
||||
Vector2 corner = new Vector2(target.Center.X - (float)dustRadius, target.Center.Y - (float)dustRadius);
|
||||
for (int i = 0; i < dustSets; ++i)
|
||||
{
|
||||
// Bigger, flying orb dust
|
||||
float scaleOrb = 1.2f + Main.rand.NextFloat(1f);
|
||||
int orb = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 112);
|
||||
Main.dust[orb].noGravity = true;
|
||||
Main.dust[orb].velocity *= 4f;
|
||||
Main.dust[orb].scale = scaleOrb;
|
||||
|
||||
// Add six sparkles per flying orb
|
||||
for (int j = 0; j < 6; ++j)
|
||||
{
|
||||
float scaleSparkle = 0.8f + Main.rand.NextFloat(1.1f);
|
||||
int sparkle = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 173);
|
||||
Main.dust[sparkle].noGravity = true;
|
||||
float dustSpeed = Main.rand.NextFloat(10f, 18f);
|
||||
Main.dust[sparkle].velocity = Main.rand.NextVector2Unit() * dustSpeed;
|
||||
Main.dust[sparkle].scale = scaleSparkle;
|
||||
}
|
||||
}
|
||||
|
||||
// Makes an explosion sound.
|
||||
Main.PlaySound(SoundID.Item14, projectile.position);
|
||||
|
||||
// Applies God Slayer Inferno on contact.
|
||||
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 480);
|
||||
|
||||
// Three death lasers (aka "Nebula Shots") swarm the target.
|
||||
int laserID = ModContent.ProjectileType<NebulaShot>();
|
||||
int laserDamage = (int)(0.2f * projectile.damage);
|
||||
float laserKB = 2.5f;
|
||||
int numLasers = 3;
|
||||
for (int i = 0; i < numLasers; ++i)
|
||||
{
|
||||
float startDist = Main.rand.NextFloat(260f, 270f);
|
||||
Vector2 startDir = Main.rand.NextVector2Unit();
|
||||
Vector2 startPoint = target.Center + (startDir * startDist);
|
||||
|
||||
float laserSpeed = Main.rand.NextFloat(15f, 18f);
|
||||
Vector2 velocity = startDir * (-laserSpeed);
|
||||
|
||||
// NebulaShot projectile adjusts its own damage type based on ai[0]
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
float damageType = projectile.melee ? 1f : 2f;
|
||||
int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner, damageType, 0f);
|
||||
Main.projectile[proj].tileCollide = false;
|
||||
Main.projectile[proj].timeLeft = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Projectiles.Healing;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class IllustriousKnife : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Knife");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 18;
|
||||
projectile.height = 18;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] >= 240f)
|
||||
{
|
||||
projectile.alpha += 4;
|
||||
projectile.damage = (int)((double)projectile.damage * 0.95);
|
||||
projectile.knockBack = (float)(int)((double)projectile.knockBack * 0.95);
|
||||
}
|
||||
if (projectile.ai[0] < 240f)
|
||||
{
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.rotation += 0.5f;
|
||||
}
|
||||
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 800f, 35f, 20f);
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 20, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int num303 = 0; num303 < 3; num303++)
|
||||
{
|
||||
int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default, 0.8f);
|
||||
Main.dust[num304].noGravity = true;
|
||||
Main.dust[num304].velocity *= 1.2f;
|
||||
Main.dust[num304].velocity -= projectile.oldVelocity * 0.3f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), 600);
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
float healAmt = (float)damage * 0.015f;
|
||||
if ((int)healAmt == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType<RoyalHeal>(), 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), 600);
|
||||
float healAmt = (float)damage * 0.015f;
|
||||
if ((int)healAmt == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
{
|
||||
return;
|
||||
}
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType<RoyalHeal>(), 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,200 +0,0 @@
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.IO;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class KelvinCatalystBoomerang : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/KelvinCatalyst";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Kelvin Catalyst");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 12;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 30;
|
||||
projectile.height = 30;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.melee = true;
|
||||
projectile.coldDamage = true;
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(projectile.localAI[0]);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
projectile.localAI[0] = reader.ReadSingle();
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, Main.DiscoR * 0.3f / 255f, Main.DiscoR * 0.4f / 255f, Main.DiscoR * 0.5f / 255f);
|
||||
|
||||
if (projectile.ai[1] == 1f)
|
||||
{
|
||||
projectile.melee = false;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
if (projectile.soundDelay == 0)
|
||||
{
|
||||
projectile.soundDelay = 8;
|
||||
Main.PlaySound(SoundID.Item7, projectile.position);
|
||||
}
|
||||
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] >= 75f)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.localAI[0] = 0f;
|
||||
projectile.width = projectile.height = 60;
|
||||
projectile.tileCollide = false;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
float num42 = 20f;
|
||||
float num43 = 2f;
|
||||
Vector2 vector2 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num44 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector2.X;
|
||||
float num45 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector2.Y;
|
||||
float num46 = (float)Math.Sqrt((double)(num44 * num44 + num45 * num45));
|
||||
|
||||
if (num46 > 3000f)
|
||||
projectile.Kill();
|
||||
|
||||
num46 = num42 / num46;
|
||||
num44 *= num46;
|
||||
num45 *= num46;
|
||||
|
||||
if (projectile.velocity.X < num44)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + num43;
|
||||
if (projectile.velocity.X < 0f && num44 > 0f)
|
||||
projectile.velocity.X = projectile.velocity.X + num43;
|
||||
}
|
||||
else if (projectile.velocity.X > num44)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - num43;
|
||||
if (projectile.velocity.X > 0f && num44 < 0f)
|
||||
projectile.velocity.X = projectile.velocity.X - num43;
|
||||
}
|
||||
if (projectile.velocity.Y < num45)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + num43;
|
||||
if (projectile.velocity.Y < 0f && num45 > 0f)
|
||||
projectile.velocity.Y = projectile.velocity.Y + num43;
|
||||
}
|
||||
else if (projectile.velocity.Y > num45)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - num43;
|
||||
if (projectile.velocity.Y > 0f && num45 < 0f)
|
||||
projectile.velocity.Y = projectile.velocity.Y - num43;
|
||||
}
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
{
|
||||
Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height);
|
||||
Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height);
|
||||
if (rectangle.Intersects(value2))
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
|
||||
int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 67, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 0f;
|
||||
|
||||
projectile.rotation += 0.25f;
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.localAI[0] = 0f;
|
||||
projectile.width = projectile.height = 60;
|
||||
projectile.tileCollide = false;
|
||||
projectile.netUpdate = true;
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
{
|
||||
projectile.velocity.X = -oldVelocity.X;
|
||||
}
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
{
|
||||
projectile.velocity.Y = -oldVelocity.Y;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.Frostburn, 240);
|
||||
if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType<KelvinCatalystStar>()] < 25)
|
||||
{
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int i;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 4f), (float)(Math.Cos(offsetAngle) * 4f),
|
||||
ModContent.ProjectileType<KelvinCatalystStar>(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f);
|
||||
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 4f), (float)(-Math.Cos(offsetAngle) * 4f),
|
||||
ModContent.ProjectileType<KelvinCatalystStar>(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f);
|
||||
}
|
||||
}
|
||||
Main.PlaySound(SoundID.Item30, projectile.position);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.Frostburn, 240);
|
||||
if (projectile.owner == Main.myPlayer && Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType<KelvinCatalystStar>()] < 25)
|
||||
{
|
||||
float spread = 45f * 0.0174f;
|
||||
double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 8f;
|
||||
double offsetAngle;
|
||||
int i;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 4f), (float)(Math.Cos(offsetAngle) * 4f),
|
||||
ModContent.ProjectileType<KelvinCatalystStar>(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f);
|
||||
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 4f), (float)(-Math.Cos(offsetAngle) * 4f),
|
||||
ModContent.ProjectileType<KelvinCatalystStar>(), projectile.damage / 6, projectile.knockBack * 0.5f, projectile.owner, 0f, 0f);
|
||||
}
|
||||
}
|
||||
Main.PlaySound(SoundID.Item30, projectile.position);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class MangroveChakramProjectile : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/MangroveChakram";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Chakram");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 30;
|
||||
projectile.height = 30;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.aiStyle = 3;
|
||||
projectile.timeLeft = 600;
|
||||
aiType = ProjectileID.WoodenBoomerang;
|
||||
projectile.melee = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0f, 0.25f, 0f);
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 44, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Texture2D tex = Main.projectileTexture[projectile.type];
|
||||
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.immune[projectile.owner] = 6;
|
||||
target.AddBuff(BuffID.CursedInferno, 120);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(BuffID.CursedInferno, 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,168 +0,0 @@
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class NanoblackMain : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/NanoblackReaperRogue";
|
||||
|
||||
private const float RotationIncrement = 0.22f;
|
||||
private const int Lifetime = 240;
|
||||
private const float ReboundTime = 50f;
|
||||
private const int MinBladeTimer = 13;
|
||||
private const int MaxBladeTimer = 18;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Nanoblack Reaper");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 7;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 2;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 56;
|
||||
projectile.height = 56;
|
||||
projectile.friendly = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 2;
|
||||
projectile.timeLeft = Lifetime;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 2;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
drawOffsetX = -11;
|
||||
drawOriginOffsetY = -4;
|
||||
drawOriginOffsetX = 0;
|
||||
|
||||
// Initialize the frame counter and random blade delay on the very first frame.
|
||||
if (projectile.timeLeft == Lifetime)
|
||||
projectile.ai[1] = GetBladeDelay();
|
||||
|
||||
// Produces electricity and green firework sparks constantly while in flight.
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
int dustType = Main.rand.NextBool(5) ? 226 : 220;
|
||||
float scale = 0.8f + Main.rand.NextFloat(0.3f);
|
||||
float velocityMult = Main.rand.NextFloat(0.3f, 0.6f);
|
||||
int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType);
|
||||
Main.dust[idx].noGravity = true;
|
||||
Main.dust[idx].velocity = velocityMult * projectile.velocity;
|
||||
Main.dust[idx].scale = scale;
|
||||
}
|
||||
|
||||
// ai[0] is a frame counter. ai[1] is a countdown to spawning the next nanoblack energy blade.
|
||||
projectile.ai[0] += 1f;
|
||||
projectile.ai[1] -= 1f;
|
||||
|
||||
// On the frame the scythe begins returning, send a net update.
|
||||
if (projectile.ai[0] == ReboundTime)
|
||||
projectile.netUpdate = true;
|
||||
|
||||
// The scythe runs its returning AI if the frame counter is greater than ReboundTime.
|
||||
if (projectile.ai[0] >= ReboundTime)
|
||||
{
|
||||
float returnSpeed = NanoblackReaperMelee.Speed;
|
||||
float acceleration = 2.4f;
|
||||
Player owner = Main.player[projectile.owner];
|
||||
|
||||
// Delete the scythe if it's excessively far away.
|
||||
Vector2 playerCenter = owner.Center;
|
||||
float xDist = playerCenter.X - projectile.Center.X;
|
||||
float yDist = playerCenter.Y - projectile.Center.Y;
|
||||
float dist = (float)Math.Sqrt(xDist * xDist + yDist * yDist);
|
||||
if (dist > 3000f)
|
||||
projectile.Kill();
|
||||
|
||||
dist = returnSpeed / dist;
|
||||
xDist *= dist;
|
||||
yDist *= dist;
|
||||
|
||||
// Home back in on the player.
|
||||
if (projectile.velocity.X < xDist)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + acceleration;
|
||||
if (projectile.velocity.X < 0f && xDist > 0f)
|
||||
projectile.velocity.X += acceleration;
|
||||
}
|
||||
else if (projectile.velocity.X > xDist)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - acceleration;
|
||||
if (projectile.velocity.X > 0f && xDist < 0f)
|
||||
projectile.velocity.X -= acceleration;
|
||||
}
|
||||
if (projectile.velocity.Y < yDist)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + acceleration;
|
||||
if (projectile.velocity.Y < 0f && yDist > 0f)
|
||||
projectile.velocity.Y += acceleration;
|
||||
}
|
||||
else if (projectile.velocity.Y > yDist)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - acceleration;
|
||||
if (projectile.velocity.Y > 0f && yDist < 0f)
|
||||
projectile.velocity.Y -= acceleration;
|
||||
}
|
||||
|
||||
// Delete the projectile if it touches its owner.
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
if (projectile.Hitbox.Intersects(owner.Hitbox))
|
||||
projectile.Kill();
|
||||
}
|
||||
|
||||
// Create nanoblack energy blades at a somewhat-random rate while in flight.
|
||||
if (projectile.ai[1] <= 0f)
|
||||
{
|
||||
SpawnEnergyBlade();
|
||||
projectile.ai[1] = GetBladeDelay();
|
||||
}
|
||||
|
||||
// Rotate the scythe as it flies.
|
||||
float spin = (projectile.direction <= 0) ? -1f : 1f;
|
||||
projectile.rotation += spin * RotationIncrement;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
private int GetBladeDelay()
|
||||
{
|
||||
return Main.rand.Next(MinBladeTimer, MaxBladeTimer + 1);
|
||||
}
|
||||
|
||||
private void SpawnEnergyBlade()
|
||||
{
|
||||
int bladeID = ModContent.ProjectileType<NanoblackSplit>();
|
||||
int bladeDamage = projectile.damage / 5;
|
||||
float bladeKB = 3f;
|
||||
float spin = (projectile.direction <= 0) ? -1f : 1f;
|
||||
float d = 16f;
|
||||
float velocityMult = 0.9f;
|
||||
Vector2 directOffset = new Vector2(Main.rand.NextFloat(-d, d), Main.rand.NextFloat(-d, d));
|
||||
Vector2 velocityOffset = Main.rand.NextFloat(-velocityMult, velocityMult) * projectile.velocity;
|
||||
Vector2 pos = projectile.Center + directOffset + velocityOffset;
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(pos, Vector2.Zero, bladeID, bladeDamage, bladeKB, projectile.owner, 0f, spin);
|
||||
CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity();
|
||||
if (projectile.melee)
|
||||
cgp.forceMelee = true;
|
||||
else
|
||||
cgp.forceRogue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,212 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class NanoblackSplit : ModProjectile
|
||||
{
|
||||
private static int SpriteWidth = 52;
|
||||
private static int Lifetime = 90;
|
||||
private static float MaxRotationSpeed = 0.25f;
|
||||
private static float MaxSpeed = 22f;
|
||||
|
||||
private static float HomingStartRange = 600f;
|
||||
private static float HomingBreakRange = 1000f;
|
||||
private static float HomingBonusRangeCap = 200f;
|
||||
private static float BaseHomingFactor = 1.6f;
|
||||
private static float MaxHomingFactor = 6.6f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Nanoblack Blade");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 3;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 32;
|
||||
projectile.height = 32;
|
||||
projectile.friendly = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = 4;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.timeLeft = Lifetime;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 8;
|
||||
}
|
||||
|
||||
// ai[0] = Index of current NPC target. If 0 or negative, the projectile has no target
|
||||
// ai[1] = Current spin speed. Negative speeds are also allowed.
|
||||
public override void AI()
|
||||
{
|
||||
drawOffsetX = -10;
|
||||
drawOriginOffsetY = 0;
|
||||
drawOriginOffsetX = 0;
|
||||
|
||||
// On the very first frame, clear any invalid starting target variable and create some dust.
|
||||
// Also grab the damage type based on ai[0].
|
||||
if (projectile.timeLeft == Lifetime)
|
||||
SpawnDust();
|
||||
|
||||
// Spin in the specified starting direction and slow down spin over time
|
||||
// Loses 1.66% of current speed every frame
|
||||
// Also update current orientation to reflect current spin direction
|
||||
float currentSpin = projectile.ai[1];
|
||||
projectile.direction = (currentSpin <= 0f) ? 1 : -1;
|
||||
projectile.spriteDirection = projectile.direction;
|
||||
projectile.rotation += currentSpin * MaxRotationSpeed;
|
||||
float spinReduction = 0.0166f * currentSpin;
|
||||
projectile.ai[1] -= spinReduction;
|
||||
|
||||
// If about to disappear, shrink by 8% every frame
|
||||
if (projectile.timeLeft < 15)
|
||||
projectile.scale *= 0.92f;
|
||||
|
||||
// Search for and home in on nearby targets
|
||||
HomingAI();
|
||||
}
|
||||
|
||||
private void HomingAI()
|
||||
{
|
||||
// If we don't currently have a target, go try and get one!
|
||||
int targetID = (int)projectile.ai[0] - 1;
|
||||
if (targetID < 0)
|
||||
targetID = AcquireTarget();
|
||||
|
||||
// Save the target, whether we have one or not.
|
||||
projectile.ai[0] = targetID + 1f;
|
||||
|
||||
// If we don't have a target, then just slow down a bit.
|
||||
if (targetID < 0)
|
||||
{
|
||||
projectile.velocity *= 0.94f;
|
||||
return;
|
||||
}
|
||||
|
||||
// Homing behavior depends on how far the blade is from its target.
|
||||
NPC target = Main.npc[targetID];
|
||||
float xDist = projectile.Center.X - target.Center.X;
|
||||
float yDist = projectile.Center.Y - target.Center.Y;
|
||||
float dist = (float)Math.Sqrt(xDist * xDist + yDist * yDist);
|
||||
|
||||
// If the target is too far away, stop homing in on it.
|
||||
if (dist > HomingBreakRange)
|
||||
{
|
||||
projectile.ai[0] = 0f;
|
||||
return;
|
||||
}
|
||||
|
||||
// Adds a multiple of the towards-target vector to its velocity every frame.
|
||||
float homingFactor = CalcHomingFactor(dist);
|
||||
Vector2 posDiff = target.Center - projectile.Center;
|
||||
posDiff = posDiff.SafeNormalize(Vector2.Zero);
|
||||
posDiff *= homingFactor;
|
||||
Vector2 newVelocity = projectile.velocity += posDiff;
|
||||
|
||||
// Caps speed to make sure it doesn't go too fast.
|
||||
if (newVelocity.Length() >= MaxSpeed)
|
||||
{
|
||||
newVelocity = newVelocity.SafeNormalize(Vector2.Zero);
|
||||
newVelocity *= MaxSpeed;
|
||||
}
|
||||
|
||||
projectile.velocity = newVelocity;
|
||||
}
|
||||
|
||||
// Returns the ID of the NPC to be targeted by this energy blade.
|
||||
// It chooses the closest target which can be chased, ignoring invulnerable NPCs.
|
||||
// Nanoblack Blades prefer to target bosses whenever possible.
|
||||
private int AcquireTarget()
|
||||
{
|
||||
bool bossFound = false;
|
||||
int target = -1;
|
||||
float minDist = HomingStartRange;
|
||||
for (int i = 0; i < 200; ++i)
|
||||
{
|
||||
NPC npc = Main.npc[i];
|
||||
if (!npc.active || npc.type == NPCID.TargetDummy)
|
||||
continue;
|
||||
|
||||
// If we've found a valid boss target, ignore ALL targets which aren't bosses.
|
||||
if (bossFound && !npc.boss)
|
||||
continue;
|
||||
|
||||
if (npc.CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float xDist = projectile.Center.X - npc.Center.X;
|
||||
float yDist = projectile.Center.Y - npc.Center.Y;
|
||||
float distToNPC = (float)Math.Sqrt(xDist * xDist + yDist * yDist);
|
||||
if (distToNPC < minDist)
|
||||
{
|
||||
// If this target within range is a boss, set the boss found flag.
|
||||
if (npc.boss)
|
||||
bossFound = true;
|
||||
minDist = distToNPC;
|
||||
target = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
// Energy blades home even more aggressively if they are very close to their target.
|
||||
private float CalcHomingFactor(float dist)
|
||||
{
|
||||
float baseFactor = BaseHomingFactor;
|
||||
float bonus = (MaxHomingFactor - BaseHomingFactor) * (1f - dist / HomingBonusRangeCap);
|
||||
if (bonus < 0f)
|
||||
bonus = 0f;
|
||||
return baseFactor + bonus;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Draws the energy blade's glowmask.
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
float fWidthOverTwo = SpriteWidth / 2f;
|
||||
float fHeightOverTwo = projectile.height / 2f;
|
||||
|
||||
// Make sure the glowmask matches the blade's own orientation
|
||||
SpriteEffects eff = SpriteEffects.None;
|
||||
if (projectile.spriteDirection == -1)
|
||||
eff = SpriteEffects.FlipHorizontally;
|
||||
Vector2 origin = new Vector2(fWidthOverTwo, fHeightOverTwo);
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Hybrid/NanoblackSplitGlow"),
|
||||
projectile.Center - Main.screenPosition, null, Color.White, projectile.rotation,
|
||||
origin, projectile.scale, eff, 0f);
|
||||
}
|
||||
|
||||
// Spawns a tiny bit of dust when the energy blade vanishes.
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
SpawnDust();
|
||||
}
|
||||
|
||||
// Spawns a small bit of Luminite themed dust.
|
||||
private void SpawnDust()
|
||||
{
|
||||
int dustCount = Main.rand.Next(3, 6);
|
||||
Vector2 corner = projectile.position;
|
||||
for (int i = 0; i < dustCount; ++i)
|
||||
{
|
||||
int dustType = 229;
|
||||
float scale = 0.6f + Main.rand.NextFloat(0.4f);
|
||||
int idx = Dust.NewDust(corner, projectile.width, projectile.height, dustType);
|
||||
Main.dust[idx].noGravity = true;
|
||||
Main.dust[idx].velocity *= 3f;
|
||||
Main.dust[idx].scale = scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class OPHammer : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/TruePaladinsHammerMelee";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Hammer");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 62;
|
||||
projectile.height = 62;
|
||||
projectile.friendly = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 2;
|
||||
projectile.melee = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.35f, 0.35f, 0f);
|
||||
if (projectile.soundDelay == 0)
|
||||
{
|
||||
projectile.soundDelay = 8;
|
||||
Main.PlaySound(SoundID.Item7, projectile.position);
|
||||
}
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] >= 30f)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.tileCollide = false;
|
||||
float num42 = 16f;
|
||||
float num43 = 3.2f;
|
||||
Vector2 vector2 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num44 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector2.X;
|
||||
float num45 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector2.Y;
|
||||
float num46 = (float)Math.Sqrt((double)(num44 * num44 + num45 * num45));
|
||||
if (num46 > 3000f)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
num46 = num42 / num46;
|
||||
num44 *= num46;
|
||||
num45 *= num46;
|
||||
if (projectile.velocity.X < num44)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + num43;
|
||||
if (projectile.velocity.X < 0f && num44 > 0f)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + num43;
|
||||
}
|
||||
}
|
||||
else if (projectile.velocity.X > num44)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - num43;
|
||||
if (projectile.velocity.X > 0f && num44 < 0f)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - num43;
|
||||
}
|
||||
}
|
||||
if (projectile.velocity.Y < num45)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + num43;
|
||||
if (projectile.velocity.Y < 0f && num45 > 0f)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + num43;
|
||||
}
|
||||
}
|
||||
else if (projectile.velocity.Y > num45)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - num43;
|
||||
if (projectile.velocity.Y > 0f && num45 < 0f)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - num43;
|
||||
}
|
||||
}
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
{
|
||||
Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height);
|
||||
Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height);
|
||||
if (rectangle.Intersects(value2))
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
projectile.rotation += 0.5f;
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(250, 250, 250, 50);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
if (projectile.melee)
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
else
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
if (projectile.melee)
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
else
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class ScourgeoftheCosmosMini : ModProjectile
|
||||
{
|
||||
private int bounce = 3;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Cosmic Scourge Mini");
|
||||
Main.projFrames[projectile.type] = 2;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 16;
|
||||
projectile.height = 16;
|
||||
projectile.friendly = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.melee = true;
|
||||
projectile.extraUpdates = 3;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.ai[1] == 1f)
|
||||
{
|
||||
projectile.melee = false;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
if (projectile.alpha > 0)
|
||||
{
|
||||
projectile.alpha -= 50;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.extraUpdates = 0;
|
||||
}
|
||||
if (projectile.alpha < 0)
|
||||
{
|
||||
projectile.alpha = 0;
|
||||
}
|
||||
projectile.frameCounter++;
|
||||
if (projectile.frameCounter >= 6)
|
||||
{
|
||||
projectile.frame++;
|
||||
projectile.frameCounter = 0;
|
||||
}
|
||||
if (projectile.frame > 1)
|
||||
{
|
||||
projectile.frame = 0;
|
||||
}
|
||||
for (int num369 = 0; num369 < 1; num369++)
|
||||
{
|
||||
int dustType = Main.rand.NextBool(3) ? 56 : 242;
|
||||
float num370 = projectile.velocity.X / 3f * (float)num369;
|
||||
float num371 = projectile.velocity.Y / 3f * (float)num369;
|
||||
int num372 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f);
|
||||
Dust dust = Main.dust[num372];
|
||||
dust.position.X = projectile.Center.X - num370;
|
||||
dust.position.Y = projectile.Center.Y - num371;
|
||||
dust.velocity *= 0f;
|
||||
dust.scale = 0.5f;
|
||||
}
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) - 1.57f;
|
||||
float num373 = projectile.position.X;
|
||||
float num374 = projectile.position.Y;
|
||||
float num375 = 100000f;
|
||||
bool flag10 = false;
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] > 30f)
|
||||
{
|
||||
projectile.ai[0] = 30f;
|
||||
for (int num376 = 0; num376 < Main.maxNPCs; num376++)
|
||||
{
|
||||
if (Main.npc[num376].CanBeChasedBy(projectile, false) && (!Main.npc[num376].wet || projectile.type == 307))
|
||||
{
|
||||
float num377 = Main.npc[num376].position.X + (float)(Main.npc[num376].width / 2);
|
||||
float num378 = Main.npc[num376].position.Y + (float)(Main.npc[num376].height / 2);
|
||||
float num379 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num377) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num378);
|
||||
if (num379 < 800f && num379 < num375 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num376].position, Main.npc[num376].width, Main.npc[num376].height))
|
||||
{
|
||||
num375 = num379;
|
||||
num373 = num377;
|
||||
num374 = num378;
|
||||
flag10 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag10)
|
||||
{
|
||||
num373 = projectile.position.X + (float)(projectile.width / 2) + projectile.velocity.X * 100f;
|
||||
num374 = projectile.position.Y + (float)(projectile.height / 2) + projectile.velocity.Y * 100f;
|
||||
}
|
||||
float num380 = 10f;
|
||||
float num381 = 0.16f;
|
||||
Vector2 vector30 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num382 = num373 - vector30.X;
|
||||
float num383 = num374 - vector30.Y;
|
||||
float num384 = (float)Math.Sqrt((double)(num382 * num382 + num383 * num383));
|
||||
num384 = num380 / num384;
|
||||
num382 *= num384;
|
||||
num383 *= num384;
|
||||
if (projectile.velocity.X < num382)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + num381;
|
||||
if (projectile.velocity.X < 0f && num382 > 0f)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + num381 * 2f;
|
||||
}
|
||||
}
|
||||
else if (projectile.velocity.X > num382)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - num381;
|
||||
if (projectile.velocity.X > 0f && num382 < 0f)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - num381 * 2f;
|
||||
}
|
||||
}
|
||||
if (projectile.velocity.Y < num383)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + num381;
|
||||
if (projectile.velocity.Y < 0f && num383 > 0f)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + num381 * 2f;
|
||||
}
|
||||
}
|
||||
else if (projectile.velocity.Y > num383)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - num381;
|
||||
if (projectile.velocity.Y > 0f && num383 < 0f)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - num381 * 2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
bounce--;
|
||||
if (bounce <= 0)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
{
|
||||
projectile.velocity.X = -oldVelocity.X;
|
||||
}
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
{
|
||||
projectile.velocity.Y = -oldVelocity.Y;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Texture2D texture2D13 = Main.projectileTexture[projectile.type];
|
||||
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
|
||||
int y6 = num214 * projectile.frame;
|
||||
Vector2 origin = new Vector2(9f, 10f);
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Hybrid/ScourgeoftheCosmosMiniGlow"), projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,178 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class ScourgeoftheCosmosProj : ModProjectile
|
||||
{
|
||||
private int bounce = 3;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Cosmic Scourge");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.alpha = 255;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.extraUpdates = 1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.ai[1] == 1f)
|
||||
{
|
||||
projectile.melee = false;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
if (projectile.alpha <= 200)
|
||||
{
|
||||
int num3;
|
||||
for (int num20 = 0; num20 < 2; num20 = num3 + 1)
|
||||
{
|
||||
int dustType = Main.rand.NextBool(3) ? 56 : 242;
|
||||
float num21 = projectile.velocity.X / 4f * (float)num20;
|
||||
float num22 = projectile.velocity.Y / 4f * (float)num20;
|
||||
int num23 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f);
|
||||
Main.dust[num23].position.X = projectile.Center.X - num21;
|
||||
Main.dust[num23].position.Y = projectile.Center.Y - num22;
|
||||
Dust dust = Main.dust[num23];
|
||||
dust.velocity *= 0f;
|
||||
Main.dust[num23].scale = 0.7f;
|
||||
num3 = num20;
|
||||
}
|
||||
}
|
||||
projectile.alpha -= 50;
|
||||
if (projectile.alpha < 0)
|
||||
{
|
||||
projectile.alpha = 0;
|
||||
}
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f;
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] >= 180f)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + 0.4f;
|
||||
projectile.velocity.X = projectile.velocity.X * 0.97f;
|
||||
}
|
||||
if (projectile.velocity.Y > 16f)
|
||||
{
|
||||
projectile.velocity.Y = 16f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
bounce--;
|
||||
if (bounce <= 0)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.PlaySound(SoundID.NPCHit4, projectile.position);
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
{
|
||||
projectile.velocity.X = -oldVelocity.X;
|
||||
}
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
{
|
||||
projectile.velocity.Y = -oldVelocity.Y;
|
||||
}
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int num626 = 1;
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
num626++;
|
||||
}
|
||||
int num3;
|
||||
for (int num627 = 0; num627 < num626; num627 = num3 + 1)
|
||||
{
|
||||
float num628 = (float)Main.rand.Next(-35, 36) * 0.02f;
|
||||
float num629 = (float)Main.rand.Next(-35, 36) * 0.02f;
|
||||
num628 *= 10f;
|
||||
num629 *= 10f;
|
||||
if (!projectile.melee)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType<ScourgeoftheCosmosMini>(), (int)((double)projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer, 0f, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType<ScourgeoftheCosmosMini>(), (int)((double)projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
num3 = num627;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
Main.PlaySound(SoundID.NPCHit4, projectile.position);
|
||||
int num3;
|
||||
for (int num622 = 0; num622 < 10; num622 = num3 + 1)
|
||||
{
|
||||
int dustType = Main.rand.NextBool(3) ? 56 : 242;
|
||||
int num623 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f);
|
||||
Dust dust = Main.dust[num623];
|
||||
dust.scale *= 1.1f;
|
||||
Main.dust[num623].noGravity = true;
|
||||
num3 = num622;
|
||||
}
|
||||
for (int num624 = 0; num624 < 15; num624 = num3 + 1)
|
||||
{
|
||||
int dustType = Main.rand.NextBool(3) ? 56 : 242;
|
||||
int num625 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f);
|
||||
Dust dust = Main.dust[num625];
|
||||
dust.velocity *= 2.5f;
|
||||
dust = Main.dust[num625];
|
||||
dust.scale *= 0.8f;
|
||||
Main.dust[num625].noGravity = true;
|
||||
num3 = num624;
|
||||
}
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int num626 = 3;
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
num626++;
|
||||
}
|
||||
for (int num627 = 0; num627 < num626; num627 = num3 + 1)
|
||||
{
|
||||
float num628 = (float)Main.rand.Next(-35, 36) * 0.02f;
|
||||
float num629 = (float)Main.rand.Next(-35, 36) * 0.02f;
|
||||
num628 *= 10f;
|
||||
num629 *= 10f;
|
||||
if (!projectile.melee)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType<ScourgeoftheCosmosMini>(), (int)((double)projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer, 0f, 1f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType<ScourgeoftheCosmosMini>(), (int)((double)projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
num3 = num627;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,261 +0,0 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class StellarContemptHammer : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/StellarContemptMelee";
|
||||
|
||||
private static float RotationIncrement = 0.22f;
|
||||
private static int Lifetime = 240;
|
||||
private static float ReboundTime = 26f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Stellar Contempt");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 44;
|
||||
projectile.height = 44;
|
||||
projectile.friendly = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 3;
|
||||
projectile.timeLeft = Lifetime;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
drawOffsetX = -11;
|
||||
drawOriginOffsetY = -10;
|
||||
drawOriginOffsetX = 0;
|
||||
|
||||
Lighting.AddLight(projectile.Center, 0.7f, 0.3f, 0.6f);
|
||||
|
||||
// The hammer makes sound while flying.
|
||||
if (projectile.soundDelay == 0)
|
||||
{
|
||||
projectile.soundDelay = 8;
|
||||
Main.PlaySound(SoundID.Item7, (int)projectile.position.X, (int)projectile.position.Y);
|
||||
}
|
||||
|
||||
// ai[0] stores whether the hammer is returning. If 0, it isn't. If 1, it is.
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] >= ReboundTime)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.tileCollide = false;
|
||||
float returnSpeed = StellarContemptMelee.Speed;
|
||||
float acceleration = 3.2f;
|
||||
Player owner = Main.player[projectile.owner];
|
||||
|
||||
// Delete the hammer if it's excessively far away.
|
||||
Vector2 playerCenter = owner.Center;
|
||||
float xDist = playerCenter.X - projectile.Center.X;
|
||||
float yDist = playerCenter.Y - projectile.Center.Y;
|
||||
float dist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist));
|
||||
if (dist > 3000f)
|
||||
projectile.Kill();
|
||||
|
||||
dist = returnSpeed / dist;
|
||||
xDist *= dist;
|
||||
yDist *= dist;
|
||||
|
||||
// Home back in on the player.
|
||||
if (projectile.velocity.X < xDist)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + acceleration;
|
||||
if (projectile.velocity.X < 0f && xDist > 0f)
|
||||
projectile.velocity.X += acceleration;
|
||||
}
|
||||
else if (projectile.velocity.X > xDist)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - acceleration;
|
||||
if (projectile.velocity.X > 0f && xDist < 0f)
|
||||
projectile.velocity.X -= acceleration;
|
||||
}
|
||||
if (projectile.velocity.Y < yDist)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + acceleration;
|
||||
if (projectile.velocity.Y < 0f && yDist > 0f)
|
||||
projectile.velocity.Y += acceleration;
|
||||
}
|
||||
else if (projectile.velocity.Y > yDist)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - acceleration;
|
||||
if (projectile.velocity.Y > 0f && yDist < 0f)
|
||||
projectile.velocity.Y -= acceleration;
|
||||
}
|
||||
|
||||
// Delete the projectile if it touches its owner.
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
if (projectile.Hitbox.Intersects(owner.Hitbox))
|
||||
projectile.Kill();
|
||||
}
|
||||
|
||||
// Rotate the hammer as it flies.
|
||||
projectile.rotation += RotationIncrement;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
// Some dust gets produced on impact.
|
||||
int dustCount = Main.rand.Next(20, 24);
|
||||
int dustRadius = 6;
|
||||
Vector2 corner = new Vector2(target.Center.X - (float)dustRadius, target.Center.Y - (float)dustRadius);
|
||||
for (int i = 0; i < dustCount; ++i)
|
||||
{
|
||||
int dustType = 229;
|
||||
float scale = 0.8f + Main.rand.NextFloat(1.1f);
|
||||
int idx = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, dustType);
|
||||
Main.dust[idx].noGravity = true;
|
||||
Main.dust[idx].velocity *= 3f;
|
||||
Main.dust[idx].scale = scale;
|
||||
}
|
||||
|
||||
// Applies Nightwither on contact at night.
|
||||
if (!Main.dayTime)
|
||||
target.AddBuff(ModContent.BuffType<Nightwither>(), 480);
|
||||
|
||||
// Do not drop lunar flares on dummies.
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
return;
|
||||
|
||||
// Play the Lunar Flare sound centered on the user, not the target (consistent with Lunar Flare and Stellar Striker)
|
||||
Player user = Main.player[projectile.owner];
|
||||
Main.PlaySound(SoundID.Item88, projectile.position);
|
||||
projectile.netUpdate = true;
|
||||
|
||||
int numFlares = 2;
|
||||
int flareDamage = (int)(0.3f * projectile.damage);
|
||||
float flareKB = 4f;
|
||||
for (int i = 0; i < numFlares; ++i)
|
||||
{
|
||||
float flareSpeed = Main.rand.NextFloat(8f, 11f);
|
||||
|
||||
// Flares never come from straight up, there is always at least an 80 pixel horizontal offset
|
||||
float xDist = Main.rand.NextFloat(80f, 320f) * (Main.rand.NextBool() ? -1f : 1f);
|
||||
float yDist = Main.rand.NextFloat(1200f, 1440f);
|
||||
Vector2 startPoint = target.Center + new Vector2(xDist, -yDist);
|
||||
|
||||
// The flare is somewhat inaccurate based on the size of the target.
|
||||
float xVariance = target.width / 4f;
|
||||
if (xVariance < 8f)
|
||||
xVariance = 8f;
|
||||
float yVariance = target.height / 4f;
|
||||
if (yVariance < 8f)
|
||||
yVariance = 8f;
|
||||
float xOffset = Main.rand.NextFloat(-xVariance, xVariance);
|
||||
float yOffset = Main.rand.NextFloat(-yVariance, yVariance);
|
||||
Vector2 offsetTarget = target.Center + new Vector2(xOffset, yOffset);
|
||||
|
||||
// Finalize the velocity vector and make sure it's going at the right speed.
|
||||
Vector2 velocity = offsetTarget - startPoint;
|
||||
velocity.Normalize();
|
||||
velocity *= flareSpeed;
|
||||
|
||||
float AI1 = (float)Main.rand.Next(3);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(startPoint, velocity, ProjectileID.LunarFlare, flareDamage, flareKB, Main.myPlayer, 0f, AI1);
|
||||
CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity();
|
||||
if (projectile.melee)
|
||||
cgp.forceMelee = true;
|
||||
else
|
||||
cgp.forceRogue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
// Some dust gets produced on impact.
|
||||
int dustCount = Main.rand.Next(20, 24);
|
||||
int dustRadius = 6;
|
||||
Vector2 corner = new Vector2(target.Center.X - (float)dustRadius, target.Center.Y - (float)dustRadius);
|
||||
for (int i = 0; i < dustCount; ++i)
|
||||
{
|
||||
int dustType = 229;
|
||||
float scale = 0.8f + Main.rand.NextFloat(1.1f);
|
||||
int idx = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, dustType);
|
||||
Main.dust[idx].noGravity = true;
|
||||
Main.dust[idx].velocity *= 3f;
|
||||
Main.dust[idx].scale = scale;
|
||||
}
|
||||
|
||||
// Applies Nightwither on contact at night.
|
||||
if (!Main.dayTime)
|
||||
target.AddBuff(ModContent.BuffType<Nightwither>(), 480);
|
||||
|
||||
// Play the Lunar Flare sound centered on the user, not the target (consistent with Lunar Flare and Stellar Striker)
|
||||
Player user = Main.player[projectile.owner];
|
||||
Main.PlaySound(SoundID.Item88, projectile.position);
|
||||
projectile.netUpdate = true;
|
||||
|
||||
int numFlares = 2;
|
||||
int flareDamage = (int)(0.3f * projectile.damage);
|
||||
float flareKB = 4f;
|
||||
for (int i = 0; i < numFlares; ++i)
|
||||
{
|
||||
float flareSpeed = Main.rand.NextFloat(8f, 11f);
|
||||
|
||||
// Flares never come from straight up, there is always at least an 80 pixel horizontal offset
|
||||
float xDist = Main.rand.NextFloat(80f, 320f) * (Main.rand.NextBool() ? -1f : 1f);
|
||||
float yDist = Main.rand.NextFloat(1200f, 1440f);
|
||||
Vector2 startPoint = target.Center + new Vector2(xDist, -yDist);
|
||||
|
||||
// The flare is somewhat inaccurate based on the size of the target.
|
||||
float xVariance = target.width / 4f;
|
||||
if (xVariance < 8f)
|
||||
xVariance = 8f;
|
||||
float yVariance = target.height / 4f;
|
||||
if (yVariance < 8f)
|
||||
yVariance = 8f;
|
||||
float xOffset = Main.rand.NextFloat(-xVariance, xVariance);
|
||||
float yOffset = Main.rand.NextFloat(-yVariance, yVariance);
|
||||
Vector2 offsetTarget = target.Center + new Vector2(xOffset, yOffset);
|
||||
|
||||
// Finalize the velocity vector and make sure it's going at the right speed.
|
||||
Vector2 velocity = offsetTarget - startPoint;
|
||||
velocity.Normalize();
|
||||
velocity *= flareSpeed;
|
||||
|
||||
float AI1 = (float)Main.rand.Next(3);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(startPoint, velocity, ProjectileID.LunarFlare, flareDamage, flareKB, Main.myPlayer, 0f, AI1);
|
||||
CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity();
|
||||
if (projectile.melee)
|
||||
cgp.forceMelee = true;
|
||||
else
|
||||
cgp.forceRogue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,116 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class TerraDiskProjectile : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/TerraDisk";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Terra Disk");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 46;
|
||||
projectile.height = 46;
|
||||
projectile.friendly = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
projectile.penetrate = -1;
|
||||
projectile.aiStyle = 3;
|
||||
projectile.timeLeft = 180;
|
||||
aiType = ProjectileID.WoodenBoomerang;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0f, (255 - projectile.alpha) * 0.75f / 255f, 0f);
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y);
|
||||
}
|
||||
int[] array = new int[20];
|
||||
int num428 = 0;
|
||||
float num429 = 300f;
|
||||
bool flag14 = false;
|
||||
for (int num430 = 0; num430 < 200; num430++)
|
||||
{
|
||||
if (Main.npc[num430].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num431 = Main.npc[num430].position.X + (float)(Main.npc[num430].width / 2);
|
||||
float num432 = Main.npc[num430].position.Y + (float)(Main.npc[num430].height / 2);
|
||||
float num433 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num431) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num432);
|
||||
if (num433 < num429 && Collision.CanHit(projectile.Center, 1, 1, Main.npc[num430].Center, 1, 1))
|
||||
{
|
||||
if (num428 < 20)
|
||||
{
|
||||
array[num428] = num430;
|
||||
num428++;
|
||||
}
|
||||
flag14 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag14)
|
||||
{
|
||||
int num434 = Main.rand.Next(num428);
|
||||
num434 = array[num434];
|
||||
float num435 = Main.npc[num434].position.X + (float)(Main.npc[num434].width / 2);
|
||||
float num436 = Main.npc[num434].position.Y + (float)(Main.npc[num434].height / 2);
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] > 8f)
|
||||
{
|
||||
projectile.localAI[0] = 0f;
|
||||
float num437 = 6f;
|
||||
Vector2 value10 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
value10 += projectile.velocity * 4f;
|
||||
float num438 = num435 - value10.X;
|
||||
float num439 = num436 - value10.Y;
|
||||
float num440 = (float)Math.Sqrt((double)(num438 * num438 + num439 * num439));
|
||||
num440 = num437 / num440;
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
float spread = 60f * 0.0174f;
|
||||
double startAngle = Math.Atan2(projectile.velocity.X, projectile.velocity.Y) - spread / 2;
|
||||
double deltaAngle = spread / 6f;
|
||||
double offsetAngle;
|
||||
int i;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<TerraDiskProjectile2>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
if (projectile.melee)
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
else
|
||||
Main.projectile[proj].Calamity().forceRogue = true;
|
||||
int proj2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType<TerraDiskProjectile2>(), projectile.damage / 2, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
if (projectile.melee)
|
||||
Main.projectile[proj2].Calamity().forceMelee = true;
|
||||
else
|
||||
Main.projectile[proj2].Calamity().forceRogue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class TerraDiskProjectile2 : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Terra Disk");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 40;
|
||||
projectile.height = 40;
|
||||
projectile.alpha = 75;
|
||||
projectile.friendly = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.aiStyle = 3;
|
||||
projectile.timeLeft = 60;
|
||||
aiType = ProjectileID.WoodenBoomerang;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0f, (255 - projectile.alpha) * 0.75f / 255f, 0f);
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 107, projectile.velocity.X, projectile.velocity.Y);
|
||||
}
|
||||
}
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
public class TriactisOPHammer : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Hammer");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 160;
|
||||
projectile.height = 160;
|
||||
projectile.friendly = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 3;
|
||||
projectile.melee = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0f, 0.5f, 0.75f);
|
||||
if (projectile.soundDelay == 0)
|
||||
{
|
||||
projectile.soundDelay = 8;
|
||||
Main.PlaySound(SoundID.Item7, projectile.position);
|
||||
}
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] >= 30f)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.tileCollide = false;
|
||||
float num42 = 20f;
|
||||
float num43 = 5f;
|
||||
Vector2 vector2 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num44 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector2.X;
|
||||
float num45 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector2.Y;
|
||||
float num46 = (float)Math.Sqrt((double)(num44 * num44 + num45 * num45));
|
||||
if (num46 > 3000f)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
num46 = num42 / num46;
|
||||
num44 *= num46;
|
||||
num45 *= num46;
|
||||
if (projectile.velocity.X < num44)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + num43;
|
||||
if (projectile.velocity.X < 0f && num44 > 0f)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + num43;
|
||||
}
|
||||
}
|
||||
else if (projectile.velocity.X > num44)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - num43;
|
||||
if (projectile.velocity.X > 0f && num44 < 0f)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - num43;
|
||||
}
|
||||
}
|
||||
if (projectile.velocity.Y < num45)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + num43;
|
||||
if (projectile.velocity.Y < 0f && num45 > 0f)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + num43;
|
||||
}
|
||||
}
|
||||
else if (projectile.velocity.Y > num45)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - num43;
|
||||
if (projectile.velocity.Y > 0f && num45 < 0f)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - num43;
|
||||
}
|
||||
}
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
{
|
||||
Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height);
|
||||
Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height);
|
||||
if (rectangle.Intersects(value2))
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
projectile.rotation += 0.5f;
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(250, 250, 250, 50);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<MageHammerBoom>(), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
}
|
||||
Main.PlaySound(SoundID.Item14, projectile.position);
|
||||
for (int num621 = 0; num621 < 40; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 70; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<MageHammerBoom>(), (int)((double)projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
}
|
||||
Main.PlaySound(SoundID.Item14, projectile.position);
|
||||
for (int num621 = 0; num621 < 40; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 70; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class EmpyreanKnife : ModProjectile
|
||||
{
|
||||
private int bounce = 3;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Empyrean Knife");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 12;
|
||||
projectile.height = 12;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.extraUpdates = 1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] >= 75f)
|
||||
{
|
||||
projectile.alpha += 10;
|
||||
projectile.damage = (int)(projectile.damage * 0.95);
|
||||
projectile.knockBack = projectile.knockBack * 0.95f;
|
||||
if (projectile.alpha >= 255)
|
||||
projectile.active = false;
|
||||
}
|
||||
if (projectile.ai[0] < 75f)
|
||||
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + MathHelper.PiOver2;
|
||||
else
|
||||
{
|
||||
projectile.rotation += 0.5f;
|
||||
}
|
||||
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 250f, 15f, 20f);
|
||||
if (Main.rand.NextBool(6))
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 58, projectile.velocity.X * 0.1f, projectile.velocity.Y * 0.1f);
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
bounce--;
|
||||
if (bounce <= 0)
|
||||
projectile.Kill();
|
||||
else
|
||||
{
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
projectile.velocity.X = -oldVelocity.X;
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
projectile.velocity.Y = -oldVelocity.Y;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int num303 = 0; num303 < 3; num303++)
|
||||
{
|
||||
int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 58, 0f, 0f, 100, default, 0.8f);
|
||||
Main.dust[num304].noGravity = true;
|
||||
Main.dust[num304].velocity *= 1.2f;
|
||||
Main.dust[num304].velocity -= projectile.oldVelocity * 0.3f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
return;
|
||||
float healAmt = damage * 0.005f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
float healAmt = damage * 0.005f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 372 B After Width: | Height: | Size: 372 B |
@@ -0,0 +1,132 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class FallenPaladinsHammerProj : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/TruePaladinsHammerMelee";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Fallen Paladin's Hammer");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 62;
|
||||
projectile.height = 62;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 2;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.35f, 0.35f, 0f);
|
||||
if (projectile.soundDelay == 0)
|
||||
{
|
||||
projectile.soundDelay = 8;
|
||||
Main.PlaySound(SoundID.Item7, projectile.position);
|
||||
}
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] >= 30f)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.tileCollide = false;
|
||||
float num42 = 16f;
|
||||
float num43 = 3.2f;
|
||||
Vector2 vector2 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
|
||||
float num44 = Main.player[projectile.owner].position.X + Main.player[projectile.owner].width / 2 - vector2.X;
|
||||
float num45 = Main.player[projectile.owner].position.Y + Main.player[projectile.owner].height / 2 - vector2.Y;
|
||||
float num46 = (float)Math.Sqrt(num44 * num44 + num45 * num45);
|
||||
if (num46 > 3000f)
|
||||
projectile.Kill();
|
||||
num46 = num42 / num46;
|
||||
num44 *= num46;
|
||||
num45 *= num46;
|
||||
if (projectile.velocity.X < num44)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + num43;
|
||||
if (projectile.velocity.X < 0f && num44 > 0f)
|
||||
projectile.velocity.X = projectile.velocity.X + num43;
|
||||
}
|
||||
else if (projectile.velocity.X > num44)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - num43;
|
||||
if (projectile.velocity.X > 0f && num44 < 0f)
|
||||
projectile.velocity.X = projectile.velocity.X - num43;
|
||||
}
|
||||
if (projectile.velocity.Y < num45)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + num43;
|
||||
if (projectile.velocity.Y < 0f && num45 > 0f)
|
||||
projectile.velocity.Y = projectile.velocity.Y + num43;
|
||||
}
|
||||
else if (projectile.velocity.Y > num45)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - num43;
|
||||
if (projectile.velocity.Y > 0f && num45 < 0f)
|
||||
projectile.velocity.Y = projectile.velocity.Y - num43;
|
||||
}
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
{
|
||||
Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height);
|
||||
Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height);
|
||||
if (rectangle.Intersects(value2))
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
projectile.rotation += 0.5f;
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(250, 250, 250, 50);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 300);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<FuckYou>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f);
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class GalaxySmasherHammer : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/GalaxySmasherMelee";
|
||||
|
||||
private static float RotationIncrement = 0.22f;
|
||||
private static int Lifetime = 240;
|
||||
private static float ReboundTime = 26f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Galaxy Smasher");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 62;
|
||||
projectile.height = 62;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 3;
|
||||
projectile.timeLeft = Lifetime;
|
||||
|
||||
// Slightly ignores iframes so it can easily hit twice.
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 8;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
drawOffsetX = -12;
|
||||
drawOriginOffsetY = -5;
|
||||
drawOriginOffsetX = 0;
|
||||
|
||||
// Produces violet dust constantly while in flight. This lights the hammer.
|
||||
int numDust = 2;
|
||||
for (int i = 0; i < numDust; ++i)
|
||||
{
|
||||
int dustType = Main.rand.NextBool(6) ? 112 : 173;
|
||||
float scale = 0.8f + Main.rand.NextFloat(0.6f);
|
||||
int idx = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType);
|
||||
Main.dust[idx].noGravity = true;
|
||||
Main.dust[idx].velocity = Vector2.Zero;
|
||||
Main.dust[idx].scale = scale;
|
||||
}
|
||||
|
||||
// The hammer makes sound while flying.
|
||||
if (projectile.soundDelay == 0)
|
||||
{
|
||||
projectile.soundDelay = 8;
|
||||
Main.PlaySound(SoundID.Item7, (int)projectile.position.X, (int)projectile.position.Y);
|
||||
}
|
||||
|
||||
// ai[0] stores whether the hammer is returning. If 0, it isn't. If 1, it is.
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] >= ReboundTime)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.tileCollide = false;
|
||||
float returnSpeed = GalaxySmasherMelee.Speed;
|
||||
float acceleration = 3.2f;
|
||||
Player owner = Main.player[projectile.owner];
|
||||
|
||||
// Delete the hammer if it's excessively far away.
|
||||
Vector2 playerCenter = owner.Center;
|
||||
float xDist = playerCenter.X - projectile.Center.X;
|
||||
float yDist = playerCenter.Y - projectile.Center.Y;
|
||||
float dist = (float)Math.Sqrt(xDist * xDist + yDist * yDist);
|
||||
if (dist > 3000f)
|
||||
projectile.Kill();
|
||||
|
||||
dist = returnSpeed / dist;
|
||||
xDist *= dist;
|
||||
yDist *= dist;
|
||||
|
||||
// Home back in on the player.
|
||||
if (projectile.velocity.X < xDist)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + acceleration;
|
||||
if (projectile.velocity.X < 0f && xDist > 0f)
|
||||
projectile.velocity.X += acceleration;
|
||||
}
|
||||
else if (projectile.velocity.X > xDist)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - acceleration;
|
||||
if (projectile.velocity.X > 0f && xDist < 0f)
|
||||
projectile.velocity.X -= acceleration;
|
||||
}
|
||||
if (projectile.velocity.Y < yDist)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + acceleration;
|
||||
if (projectile.velocity.Y < 0f && yDist > 0f)
|
||||
projectile.velocity.Y += acceleration;
|
||||
}
|
||||
else if (projectile.velocity.Y > yDist)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - acceleration;
|
||||
if (projectile.velocity.Y > 0f && yDist < 0f)
|
||||
projectile.velocity.Y -= acceleration;
|
||||
}
|
||||
|
||||
// Delete the projectile if it touches its owner.
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
if (projectile.Hitbox.Intersects(owner.Hitbox))
|
||||
projectile.Kill();
|
||||
}
|
||||
|
||||
// Rotate the hammer as it flies.
|
||||
projectile.rotation += RotationIncrement;
|
||||
return;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
// Some dust gets produced on impact.
|
||||
int dustSets = Main.rand.Next(5, 8);
|
||||
int dustRadius = 6;
|
||||
Vector2 corner = new Vector2(target.Center.X - dustRadius, target.Center.Y - dustRadius);
|
||||
for (int i = 0; i < dustSets; ++i)
|
||||
{
|
||||
// Bigger, flying orb dust
|
||||
float scaleOrb = 1.2f + Main.rand.NextFloat(1f);
|
||||
int orb = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 112);
|
||||
Main.dust[orb].noGravity = true;
|
||||
Main.dust[orb].velocity *= 4f;
|
||||
Main.dust[orb].scale = scaleOrb;
|
||||
|
||||
// Add six sparkles per flying orb
|
||||
for (int j = 0; j < 6; ++j)
|
||||
{
|
||||
float scaleSparkle = 0.8f + Main.rand.NextFloat(1.1f);
|
||||
int sparkle = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 173);
|
||||
Main.dust[sparkle].noGravity = true;
|
||||
float dustSpeed = Main.rand.NextFloat(10f, 18f);
|
||||
Main.dust[sparkle].velocity = Main.rand.NextVector2Unit() * dustSpeed;
|
||||
Main.dust[sparkle].scale = scaleSparkle;
|
||||
}
|
||||
}
|
||||
|
||||
// Makes an explosion sound.
|
||||
Main.PlaySound(SoundID.Item14, projectile.position);
|
||||
|
||||
// Applies God Slayer Inferno on contact.
|
||||
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 480);
|
||||
|
||||
// Three death lasers (aka "Nebula Shots") swarm the target.
|
||||
int laserID = ModContent.ProjectileType<NebulaShot>();
|
||||
int laserDamage = (int)(0.2f * projectile.damage);
|
||||
float laserKB = 2.5f;
|
||||
int numLasers = 3;
|
||||
for (int i = 0; i < numLasers; ++i)
|
||||
{
|
||||
float startDist = Main.rand.NextFloat(260f, 270f);
|
||||
Vector2 startDir = Main.rand.NextVector2Unit();
|
||||
Vector2 startPoint = target.Center + startDir * startDist;
|
||||
|
||||
float laserSpeed = Main.rand.NextFloat(15f, 18f);
|
||||
Vector2 velocity = startDir * -laserSpeed;
|
||||
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner);
|
||||
Main.projectile[proj].Calamity().forceMelee = true;
|
||||
Main.projectile[proj].tileCollide = false;
|
||||
Main.projectile[proj].timeLeft = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
// Some dust gets produced on impact.
|
||||
int dustSets = Main.rand.Next(5, 8);
|
||||
int dustRadius = 6;
|
||||
Vector2 corner = new Vector2(target.Center.X - dustRadius, target.Center.Y - dustRadius);
|
||||
for (int i = 0; i < dustSets; ++i)
|
||||
{
|
||||
// Bigger, flying orb dust
|
||||
float scaleOrb = 1.2f + Main.rand.NextFloat(1f);
|
||||
int orb = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 112);
|
||||
Main.dust[orb].noGravity = true;
|
||||
Main.dust[orb].velocity *= 4f;
|
||||
Main.dust[orb].scale = scaleOrb;
|
||||
|
||||
// Add six sparkles per flying orb
|
||||
for (int j = 0; j < 6; ++j)
|
||||
{
|
||||
float scaleSparkle = 0.8f + Main.rand.NextFloat(1.1f);
|
||||
int sparkle = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, 173);
|
||||
Main.dust[sparkle].noGravity = true;
|
||||
float dustSpeed = Main.rand.NextFloat(10f, 18f);
|
||||
Main.dust[sparkle].velocity = Main.rand.NextVector2Unit() * dustSpeed;
|
||||
Main.dust[sparkle].scale = scaleSparkle;
|
||||
}
|
||||
}
|
||||
|
||||
// Makes an explosion sound.
|
||||
Main.PlaySound(SoundID.Item14, projectile.position);
|
||||
|
||||
// Applies God Slayer Inferno on contact.
|
||||
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 480);
|
||||
|
||||
// Three death lasers (aka "Nebula Shots") swarm the target.
|
||||
int laserID = ModContent.ProjectileType<NebulaShot>();
|
||||
int laserDamage = (int)(0.2f * projectile.damage);
|
||||
float laserKB = 2.5f;
|
||||
int numLasers = 3;
|
||||
for (int i = 0; i < numLasers; ++i)
|
||||
{
|
||||
float startDist = Main.rand.NextFloat(260f, 270f);
|
||||
Vector2 startDir = Main.rand.NextVector2Unit();
|
||||
Vector2 startPoint = target.Center + startDir * startDist;
|
||||
|
||||
float laserSpeed = Main.rand.NextFloat(15f, 18f);
|
||||
Vector2 velocity = startDir * -laserSpeed;
|
||||
|
||||
// NebulaShot projectile adjusts its own damage type based on ai[0]. So set it to 1f
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
float damageType = 1f;
|
||||
int proj = Projectile.NewProjectile(startPoint, velocity, laserID, laserDamage, laserKB, projectile.owner, damageType, 0f);
|
||||
Main.projectile[proj].tileCollide = false;
|
||||
Main.projectile[proj].timeLeft = 30;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Projectiles.Healing;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class IllustriousKnife : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Illustrious Knife");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 18;
|
||||
projectile.height = 18;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 300;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] >= 240f)
|
||||
{
|
||||
projectile.alpha += 4;
|
||||
projectile.damage = (int)(projectile.damage * 0.95);
|
||||
projectile.knockBack = (int)(projectile.knockBack * 0.95);
|
||||
}
|
||||
if (projectile.ai[0] < 240f)
|
||||
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 1.57f;
|
||||
else
|
||||
{
|
||||
projectile.rotation += 0.5f;
|
||||
}
|
||||
CalamityGlobalProjectile.HomeInOnNPC(projectile, false, 800f, 35f, 20f);
|
||||
if (Main.rand.NextBool(6))
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 20, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int num303 = 0; num303 < 3; num303++)
|
||||
{
|
||||
int num304 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 20, 0f, 0f, 100, default, 0.8f);
|
||||
Main.dust[num304].noGravity = true;
|
||||
Main.dust[num304].velocity *= 1.2f;
|
||||
Main.dust[num304].velocity -= projectile.oldVelocity * 0.3f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), 600);
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
return;
|
||||
float healAmt = damage * 0.015f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType<RoyalHeal>(), 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), 600);
|
||||
float healAmt = damage * 0.015f;
|
||||
if ((int)healAmt == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], healAmt, ModContent.ProjectileType<RoyalHeal>(), 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 253 B After Width: | Height: | Size: 253 B |
@@ -6,13 +6,13 @@ using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class PwnagehammerProjStealthStrike : ModProjectile
|
||||
public class PwnagehammerEcho : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Spectral Hammer");
|
||||
DisplayName.SetDefault("Pwnagehammer Echo");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 7;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
@@ -23,6 +23,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
projectile.height = 40;
|
||||
projectile.aiStyle = 0;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.tileCollide = false;
|
||||
projectile.ignoreWater = true;
|
||||
@@ -62,9 +63,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
|
||||
NPC target = Main.npc[(int)projectile.ai[1]];
|
||||
if (!target.CanBeChasedBy(projectile, false) || !target.active)
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
else
|
||||
{
|
||||
float velConst = 3f;
|
||||
@@ -77,7 +76,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
Vector2 offset = new Vector2(7, 0).RotatedByRandom(MathHelper.ToRadians(360f));
|
||||
Vector2 velOffset = new Vector2(3, 0).RotatedBy(offset.ToRotation());
|
||||
Dust dust = Dust.NewDustPerfect(new Vector2(projectile.position.X, projectile.position.Y) + offset, DustID.GoldFlame, new Vector2((projectile.velocity.X * 0.2f) + velOffset.X, (projectile.velocity.Y * 0.2f) + velOffset.Y), 100, new Color(255, 245, 198), 2f);
|
||||
Dust dust = Dust.NewDustPerfect(new Vector2(projectile.position.X, projectile.position.Y) + offset, DustID.GoldFlame, new Vector2(projectile.velocity.X * 0.2f + velOffset.X, projectile.velocity.Y * 0.2f + velOffset.Y), 100, new Color(255, 245, 198), 2f);
|
||||
dust.noGravity = true;
|
||||
}
|
||||
|
||||
@@ -85,7 +84,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
Vector2 offset = new Vector2(7, 0).RotatedByRandom(MathHelper.ToRadians(360f));
|
||||
Vector2 velOffset = new Vector2(3, 0).RotatedBy(offset.ToRotation());
|
||||
Dust dust = Dust.NewDustPerfect(new Vector2(projectile.position.X, projectile.position.Y) + offset, DustID.GoldFlame, new Vector2((projectile.velocity.X * 0.2f) + velOffset.X, (projectile.velocity.Y * 0.2f) + velOffset.Y), 100, new Color(255, 245, 198), 2f);
|
||||
Dust dust = Dust.NewDustPerfect(new Vector2(projectile.position.X, projectile.position.Y) + offset, DustID.GoldFlame, new Vector2(projectile.velocity.X * 0.2f + velOffset.X, projectile.velocity.Y * 0.2f + velOffset.Y), 100, new Color(255, 245, 198), 2f);
|
||||
dust.noGravity = true;
|
||||
}
|
||||
}
|
||||
@@ -93,9 +92,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
public override bool? CanHitNPC(NPC target)
|
||||
{
|
||||
if (projectile.ai[0] <= 42f)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -147,9 +144,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (projectile.spriteDirection == -1)
|
||||
{
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
}
|
||||
Texture2D texture = Main.projectileTexture[projectile.type];
|
||||
Rectangle sourceRectangle = new Rectangle(0, 0, texture.Width, texture.Height);
|
||||
Vector2 origin = sourceRectangle.Size() / 2f;
|
||||
@@ -158,8 +153,8 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
float rot = MathHelper.ToRadians(22.5f) * Math.Sign(projectile.velocity.X);
|
||||
Vector2 drawPos = projectile.oldPos[i] - Main.screenPosition + origin + new Vector2(0f, projectile.gfxOffY);
|
||||
Color color = projectile.GetAlpha(lightColor) * ((float)(projectile.oldPos.Length - i) / (float)projectile.oldPos.Length);
|
||||
spriteBatch.Draw(texture, drawPos, new Rectangle?(), color, projectile.rotation - (i * rot), origin, projectile.scale, spriteEffects, 0f);
|
||||
Color color = projectile.GetAlpha(lightColor) * ((projectile.oldPos.Length - i) / (float)projectile.oldPos.Length);
|
||||
spriteBatch.Draw(texture, drawPos, new Rectangle?(), color, projectile.rotation - i * rot, origin, projectile.scale, spriteEffects, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 748 B After Width: | Height: | Size: 748 B |
@@ -7,11 +7,11 @@ using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class PwnagehammerProj : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/PwnagehammerMelee";
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/PwnagehammerMelee";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.direction = projectile.spriteDirection = (projectile.velocity.X > 0f) ? 1 : -1;
|
||||
projectile.direction = projectile.spriteDirection = projectile.velocity.X > 0f ? 1 : -1;
|
||||
projectile.rotation += MathHelper.ToRadians(22.5f) * projectile.direction;
|
||||
|
||||
if (projectile.ai[0] == 1f)
|
||||
@@ -60,9 +60,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
float distanceTo = vec.Length();
|
||||
distanceTo -= (float)Math.Sqrt(npc.width * npc.width + npc.height * npc.height) * 0.75f;
|
||||
if (distanceTo < distance && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height))
|
||||
{
|
||||
projectile.ai[1] = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -91,7 +89,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f));
|
||||
Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation());
|
||||
Dust dust = Dust.NewDustPerfect(new Vector2(projectile.Center.X, projectile.Center.Y) + offset, DustID.GoldFlame, new Vector2((projectile.velocity.X * 0.2f) + velOffset.X, (projectile.velocity.Y * 0.2f) + velOffset.Y), 100, new Color(255, 245, 198), 2f);
|
||||
Dust dust = Dust.NewDustPerfect(new Vector2(projectile.Center.X, projectile.Center.Y) + offset, DustID.GoldFlame, new Vector2(projectile.velocity.X * 0.2f + velOffset.X, projectile.velocity.Y * 0.2f + velOffset.Y), 100, new Color(255, 245, 198), 2f);
|
||||
dust.noGravity = true;
|
||||
}
|
||||
|
||||
@@ -99,7 +97,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
Vector2 offset = new Vector2(12, 0).RotatedByRandom(MathHelper.ToRadians(360f));
|
||||
Vector2 velOffset = new Vector2(4, 0).RotatedBy(offset.ToRotation());
|
||||
Dust dust = Dust.NewDustPerfect(new Vector2(projectile.Center.X, projectile.Center.Y) + offset, DustID.GoldFlame, new Vector2((projectile.velocity.X * 0.2f) + velOffset.X, (projectile.velocity.Y * 0.2f) + velOffset.Y), 100, new Color(255, 245, 198), 2f);
|
||||
Dust dust = Dust.NewDustPerfect(new Vector2(projectile.Center.X, projectile.Center.Y) + offset, DustID.GoldFlame, new Vector2(projectile.velocity.X * 0.2f + velOffset.X, projectile.velocity.Y * 0.2f + velOffset.Y), 100, new Color(255, 245, 198), 2f);
|
||||
dust.noGravity = true;
|
||||
}
|
||||
}
|
||||
@@ -120,14 +118,14 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
dust.noGravity = true;
|
||||
dust.velocity = velOffset;
|
||||
dust.scale = 2.5f;
|
||||
if ((i % 2) == 0)
|
||||
if (i % 2 == 0)
|
||||
{
|
||||
dust = Dust.NewDustPerfect(projectile.position + offset, 269, new Vector2(velOffset.X, velOffset.Y));
|
||||
dust.noGravity = true;
|
||||
dust.velocity = velOffset * 2f;
|
||||
dust.scale = 2.5f;
|
||||
}
|
||||
if ((i % 4) == 0)
|
||||
if (i % 4 == 0)
|
||||
{
|
||||
dust = Dust.NewDustPerfect(projectile.position + offset, 269, new Vector2(velOffset.X, velOffset.Y));
|
||||
dust.noGravity = true;
|
||||
@@ -147,20 +145,16 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
if (distanceTo < distance && npc.CanBeChasedBy(projectile, false) && k != projectile.localAI[0])
|
||||
{
|
||||
float alldamage = projectile.damage * 1.25f;
|
||||
double damage = npc.StrikeNPC((int)alldamage, projectile.knockBack, (projectile.velocity.X > 0f) ? 1 : -1);
|
||||
double damage = npc.StrikeNPC((int)alldamage, projectile.knockBack, projectile.velocity.X > 0f ? 1 : -1);
|
||||
player.addDPS((int)damage);
|
||||
}
|
||||
}
|
||||
SoundEffectInstance sound1 = Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Item, "Sounds/Item/PwnagehammerHoming"), projectile.Center);
|
||||
if (sound1 != null)
|
||||
{
|
||||
sound1.Volume = 0.3f;
|
||||
}
|
||||
SoundEffectInstance sound2 = Main.PlaySound(SoundID.Item14, projectile.Center);
|
||||
if (sound2 != null)
|
||||
{
|
||||
sound2.Volume = 0.22f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -188,7 +182,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
if (distanceTo < distance && npc.CanBeChasedBy(projectile, false) && k != projectile.localAI[0])
|
||||
{
|
||||
float alldamage = projectile.damage * 0.75f;
|
||||
double damage = npc.StrikeNPC((int)alldamage, projectile.knockBack, (projectile.velocity.X > 0f) ? 1 : -1);
|
||||
double damage = npc.StrikeNPC((int)alldamage, projectile.knockBack, projectile.velocity.X > 0f ? 1 : -1);
|
||||
player.addDPS((int)damage);
|
||||
}
|
||||
}
|
||||
@@ -200,9 +194,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
}
|
||||
SoundEffectInstance sound2 = Main.PlaySound(SoundID.Item14, projectile.Center);
|
||||
if (sound2 != null)
|
||||
{
|
||||
sound2.Volume = 0.11f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,10 +203,8 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
if (projectile.ai[0] == 1f && Main.myPlayer == projectile.owner)
|
||||
{
|
||||
crit = true;
|
||||
int hammer = Projectile.NewProjectile(projectile.Center, new Vector2(0, -15f), ModContent.ProjectileType<PwnagehammerProjStealthStrike>(), projectile.damage * 2, projectile.knockBack, projectile.owner, 0f, projectile.ai[1]);
|
||||
int hammer = Projectile.NewProjectile(projectile.Center, new Vector2(0, -15f), ModContent.ProjectileType<PwnagehammerEcho>(), projectile.damage * 2, projectile.knockBack, projectile.owner, 0f, projectile.ai[1]);
|
||||
Main.projectile[hammer].localAI[0] = Math.Sign(projectile.velocity.X);
|
||||
Main.projectile[hammer].melee = projectile.melee;
|
||||
Main.projectile[hammer].Calamity().rogue = projectile.Calamity().rogue;
|
||||
Main.projectile[hammer].netUpdate = true;
|
||||
}
|
||||
}
|
||||
@@ -223,10 +213,8 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
if (projectile.ai[0] == 1f && Main.myPlayer == projectile.owner)
|
||||
{
|
||||
int hammer = Projectile.NewProjectile(projectile.Center, new Vector2(0, -15f), ModContent.ProjectileType<PwnagehammerProjStealthStrike>(), projectile.damage * 2, projectile.knockBack, projectile.owner, 0f, projectile.ai[1]);
|
||||
int hammer = Projectile.NewProjectile(projectile.Center, new Vector2(0, -15f), ModContent.ProjectileType<PwnagehammerEcho>(), projectile.damage * 2, projectile.knockBack, projectile.owner, 0f, projectile.ai[1]);
|
||||
Main.projectile[hammer].localAI[0] = Math.Sign(projectile.velocity.X);
|
||||
Main.projectile[hammer].melee = projectile.melee;
|
||||
Main.projectile[hammer].Calamity().rogue = projectile.Calamity().rogue;
|
||||
Main.projectile[hammer].netUpdate = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class ScourgeoftheCosmosMini : ModProjectile
|
||||
{
|
||||
private int bounce = 3;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Miniature Cosmic Scourge");
|
||||
Main.projFrames[projectile.type] = 2;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 16;
|
||||
projectile.height = 16;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.extraUpdates = 3;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.alpha > 0)
|
||||
projectile.alpha -= 50;
|
||||
else
|
||||
{
|
||||
projectile.extraUpdates = 0;
|
||||
}
|
||||
if (projectile.alpha < 0)
|
||||
projectile.alpha = 0;
|
||||
projectile.frameCounter++;
|
||||
if (projectile.frameCounter >= 6)
|
||||
{
|
||||
projectile.frame++;
|
||||
projectile.frameCounter = 0;
|
||||
}
|
||||
if (projectile.frame > 1)
|
||||
projectile.frame = 0;
|
||||
for (int num369 = 0; num369 < 1; num369++)
|
||||
{
|
||||
int dustType = Main.rand.NextBool(3) ? 56 : 242;
|
||||
float num370 = projectile.velocity.X / 3f * num369;
|
||||
float num371 = projectile.velocity.Y / 3f * num369;
|
||||
int num372 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f);
|
||||
Dust dust = Main.dust[num372];
|
||||
dust.position.X = projectile.Center.X - num370;
|
||||
dust.position.Y = projectile.Center.Y - num371;
|
||||
dust.velocity *= 0f;
|
||||
dust.scale = 0.5f;
|
||||
}
|
||||
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) - 1.57f;
|
||||
float num373 = projectile.position.X;
|
||||
float num374 = projectile.position.Y;
|
||||
float num375 = 100000f;
|
||||
bool flag10 = false;
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] > 30f)
|
||||
{
|
||||
projectile.ai[0] = 30f;
|
||||
for (int num376 = 0; num376 < Main.maxNPCs; num376++)
|
||||
{
|
||||
if (Main.npc[num376].CanBeChasedBy(projectile, false) && (!Main.npc[num376].wet || projectile.type == 307))
|
||||
{
|
||||
float num377 = Main.npc[num376].position.X + Main.npc[num376].width / 2;
|
||||
float num378 = Main.npc[num376].position.Y + Main.npc[num376].height / 2;
|
||||
float num379 = Math.Abs(projectile.position.X + projectile.width / 2 - num377) + Math.Abs(projectile.position.Y + projectile.height / 2 - num378);
|
||||
if (num379 < 800f && num379 < num375 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num376].position, Main.npc[num376].width, Main.npc[num376].height))
|
||||
{
|
||||
num375 = num379;
|
||||
num373 = num377;
|
||||
num374 = num378;
|
||||
flag10 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flag10)
|
||||
{
|
||||
num373 = projectile.position.X + projectile.width / 2 + projectile.velocity.X * 100f;
|
||||
num374 = projectile.position.Y + projectile.height / 2 + projectile.velocity.Y * 100f;
|
||||
}
|
||||
float num380 = 10f;
|
||||
float num381 = 0.16f;
|
||||
Vector2 vector30 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
|
||||
float num382 = num373 - vector30.X;
|
||||
float num383 = num374 - vector30.Y;
|
||||
float num384 = (float)Math.Sqrt(num382 * num382 + num383 * num383);
|
||||
num384 = num380 / num384;
|
||||
num382 *= num384;
|
||||
num383 *= num384;
|
||||
if (projectile.velocity.X < num382)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + num381;
|
||||
if (projectile.velocity.X < 0f && num382 > 0f)
|
||||
projectile.velocity.X = projectile.velocity.X + num381 * 2f;
|
||||
}
|
||||
else if (projectile.velocity.X > num382)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - num381;
|
||||
if (projectile.velocity.X > 0f && num382 < 0f)
|
||||
projectile.velocity.X = projectile.velocity.X - num381 * 2f;
|
||||
}
|
||||
if (projectile.velocity.Y < num383)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + num381;
|
||||
if (projectile.velocity.Y < 0f && num383 > 0f)
|
||||
projectile.velocity.Y = projectile.velocity.Y + num381 * 2f;
|
||||
}
|
||||
else if (projectile.velocity.Y > num383)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - num381;
|
||||
if (projectile.velocity.Y > 0f && num383 < 0f)
|
||||
projectile.velocity.Y = projectile.velocity.Y - num381 * 2f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
bounce--;
|
||||
if (bounce <= 0)
|
||||
projectile.Kill();
|
||||
else
|
||||
{
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
projectile.velocity.X = -oldVelocity.X;
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
projectile.velocity.Y = -oldVelocity.Y;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Texture2D texture2D13 = Main.projectileTexture[projectile.type];
|
||||
int num214 = Main.projectileTexture[projectile.type].Height / Main.projFrames[projectile.type];
|
||||
int y6 = num214 * projectile.frame;
|
||||
Vector2 origin = new Vector2(9f, 10f);
|
||||
spriteBatch.Draw(ModContent.GetTexture("CalamityMod/Projectiles/Melee/ScourgeoftheCosmosMiniGlow"), projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), Color.White, projectile.rotation, origin, projectile.scale, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 546 B After Width: | Height: | Size: 546 B |
|
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 236 B |
@@ -0,0 +1,145 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class ScourgeoftheCosmosProj : ModProjectile
|
||||
{
|
||||
private int bounce = 3;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Cosmic Scourge");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.alpha = 255;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.extraUpdates = 1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.alpha <= 200)
|
||||
{
|
||||
int num3;
|
||||
for (int num20 = 0; num20 < 2; num20 = num3 + 1)
|
||||
{
|
||||
int dustType = Main.rand.NextBool(3) ? 56 : 242;
|
||||
float num21 = projectile.velocity.X / 4f * num20;
|
||||
float num22 = projectile.velocity.Y / 4f * num20;
|
||||
int num23 = Dust.NewDust(projectile.position, projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f);
|
||||
Main.dust[num23].position.X = projectile.Center.X - num21;
|
||||
Main.dust[num23].position.Y = projectile.Center.Y - num22;
|
||||
Dust dust = Main.dust[num23];
|
||||
dust.velocity *= 0f;
|
||||
Main.dust[num23].scale = 0.7f;
|
||||
num3 = num20;
|
||||
}
|
||||
}
|
||||
projectile.alpha -= 50;
|
||||
if (projectile.alpha < 0)
|
||||
projectile.alpha = 0;
|
||||
projectile.rotation = (float)Math.Atan2(projectile.velocity.Y, projectile.velocity.X) + 0.785f;
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] >= 180f)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + 0.4f;
|
||||
projectile.velocity.X = projectile.velocity.X * 0.97f;
|
||||
}
|
||||
if (projectile.velocity.Y > 16f)
|
||||
projectile.velocity.Y = 16f;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
bounce--;
|
||||
if (bounce <= 0)
|
||||
projectile.Kill();
|
||||
else
|
||||
{
|
||||
Main.PlaySound(SoundID.NPCHit4, projectile.position);
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
projectile.velocity.X = -oldVelocity.X;
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
projectile.velocity.Y = -oldVelocity.Y;
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int num626 = 1;
|
||||
if (Main.rand.NextBool(10))
|
||||
num626++;
|
||||
int num3;
|
||||
for (int num627 = 0; num627 < num626; num627 = num3 + 1)
|
||||
{
|
||||
float num628 = Main.rand.Next(-35, 36) * 0.02f;
|
||||
float num629 = Main.rand.Next(-35, 36) * 0.02f;
|
||||
num628 *= 10f;
|
||||
num629 *= 10f;
|
||||
Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType<ScourgeoftheCosmosMini>(), (int)(projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer);
|
||||
num3 = num627;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
Main.PlaySound(SoundID.NPCHit4, projectile.position);
|
||||
int num3;
|
||||
for (int num622 = 0; num622 < 10; num622 = num3 + 1)
|
||||
{
|
||||
int dustType = Main.rand.NextBool(3) ? 56 : 242;
|
||||
int num623 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f);
|
||||
Dust dust = Main.dust[num623];
|
||||
dust.scale *= 1.1f;
|
||||
Main.dust[num623].noGravity = true;
|
||||
num3 = num622;
|
||||
}
|
||||
for (int num624 = 0; num624 < 15; num624 = num3 + 1)
|
||||
{
|
||||
int dustType = Main.rand.NextBool(3) ? 56 : 242;
|
||||
int num625 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1f);
|
||||
Dust dust = Main.dust[num625];
|
||||
dust.velocity *= 2.5f;
|
||||
dust = Main.dust[num625];
|
||||
dust.scale *= 0.8f;
|
||||
Main.dust[num625].noGravity = true;
|
||||
num3 = num624;
|
||||
}
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int num626 = 3;
|
||||
if (Main.rand.NextBool(10))
|
||||
num626++;
|
||||
for (int num627 = 0; num627 < num626; num627 = num3 + 1)
|
||||
{
|
||||
float num628 = Main.rand.Next(-35, 36) * 0.02f;
|
||||
float num629 = Main.rand.Next(-35, 36) * 0.02f;
|
||||
num628 *= 10f;
|
||||
num629 *= 10f;
|
||||
Projectile.NewProjectile(projectile.position.X, projectile.position.Y, num628, num629, ModContent.ProjectileType<ScourgeoftheCosmosMini>(), (int)(projectile.damage * 0.7), projectile.knockBack * 0.35f, Main.myPlayer);
|
||||
num3 = num627;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 716 B After Width: | Height: | Size: 716 B |
@@ -0,0 +1,255 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class StellarContemptHammer : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/StellarContemptMelee";
|
||||
|
||||
private static float RotationIncrement = 0.22f;
|
||||
private static int Lifetime = 240;
|
||||
private static float ReboundTime = 26f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Stellar Contempt");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 8;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 44;
|
||||
projectile.height = 44;
|
||||
projectile.friendly = true;
|
||||
projectile.melee = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 3;
|
||||
projectile.timeLeft = Lifetime;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
drawOffsetX = -11;
|
||||
drawOriginOffsetY = -10;
|
||||
drawOriginOffsetX = 0;
|
||||
|
||||
Lighting.AddLight(projectile.Center, 0.7f, 0.3f, 0.6f);
|
||||
|
||||
// The hammer makes sound while flying.
|
||||
if (projectile.soundDelay == 0)
|
||||
{
|
||||
projectile.soundDelay = 8;
|
||||
Main.PlaySound(SoundID.Item7, (int)projectile.position.X, (int)projectile.position.Y);
|
||||
}
|
||||
|
||||
// ai[0] stores whether the hammer is returning. If 0, it isn't. If 1, it is.
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] >= ReboundTime)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.tileCollide = false;
|
||||
float returnSpeed = StellarContemptMelee.Speed;
|
||||
float acceleration = 3.2f;
|
||||
Player owner = Main.player[projectile.owner];
|
||||
|
||||
// Delete the hammer if it's excessively far away.
|
||||
Vector2 playerCenter = owner.Center;
|
||||
float xDist = playerCenter.X - projectile.Center.X;
|
||||
float yDist = playerCenter.Y - projectile.Center.Y;
|
||||
float dist = (float)Math.Sqrt(xDist * xDist + yDist * yDist);
|
||||
if (dist > 3000f)
|
||||
projectile.Kill();
|
||||
|
||||
dist = returnSpeed / dist;
|
||||
xDist *= dist;
|
||||
yDist *= dist;
|
||||
|
||||
// Home back in on the player.
|
||||
if (projectile.velocity.X < xDist)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + acceleration;
|
||||
if (projectile.velocity.X < 0f && xDist > 0f)
|
||||
projectile.velocity.X += acceleration;
|
||||
}
|
||||
else if (projectile.velocity.X > xDist)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - acceleration;
|
||||
if (projectile.velocity.X > 0f && xDist < 0f)
|
||||
projectile.velocity.X -= acceleration;
|
||||
}
|
||||
if (projectile.velocity.Y < yDist)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + acceleration;
|
||||
if (projectile.velocity.Y < 0f && yDist > 0f)
|
||||
projectile.velocity.Y += acceleration;
|
||||
}
|
||||
else if (projectile.velocity.Y > yDist)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - acceleration;
|
||||
if (projectile.velocity.Y > 0f && yDist < 0f)
|
||||
projectile.velocity.Y -= acceleration;
|
||||
}
|
||||
|
||||
// Delete the projectile if it touches its owner.
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
if (projectile.Hitbox.Intersects(owner.Hitbox))
|
||||
projectile.Kill();
|
||||
}
|
||||
|
||||
// Rotate the hammer as it flies.
|
||||
projectile.rotation += RotationIncrement;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
// Some dust gets produced on impact.
|
||||
int dustCount = Main.rand.Next(20, 24);
|
||||
int dustRadius = 6;
|
||||
Vector2 corner = new Vector2(target.Center.X - dustRadius, target.Center.Y - dustRadius);
|
||||
for (int i = 0; i < dustCount; ++i)
|
||||
{
|
||||
int dustType = 229;
|
||||
float scale = 0.8f + Main.rand.NextFloat(1.1f);
|
||||
int idx = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, dustType);
|
||||
Main.dust[idx].noGravity = true;
|
||||
Main.dust[idx].velocity *= 3f;
|
||||
Main.dust[idx].scale = scale;
|
||||
}
|
||||
|
||||
// Applies Nightwither on contact at night.
|
||||
if (!Main.dayTime)
|
||||
target.AddBuff(ModContent.BuffType<Nightwither>(), 480);
|
||||
|
||||
// Do not drop lunar flares on dummies.
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
return;
|
||||
|
||||
// Play the Lunar Flare sound centered on the user, not the target (consistent with Lunar Flare and Stellar Striker)
|
||||
Player user = Main.player[projectile.owner];
|
||||
Main.PlaySound(SoundID.Item88, projectile.position);
|
||||
projectile.netUpdate = true;
|
||||
|
||||
int numFlares = 2;
|
||||
int flareDamage = (int)(0.3f * projectile.damage);
|
||||
float flareKB = 4f;
|
||||
for (int i = 0; i < numFlares; ++i)
|
||||
{
|
||||
float flareSpeed = Main.rand.NextFloat(8f, 11f);
|
||||
|
||||
// Flares never come from straight up, there is always at least an 80 pixel horizontal offset
|
||||
float xDist = Main.rand.NextFloat(80f, 320f) * (Main.rand.NextBool() ? -1f : 1f);
|
||||
float yDist = Main.rand.NextFloat(1200f, 1440f);
|
||||
Vector2 startPoint = target.Center + new Vector2(xDist, -yDist);
|
||||
|
||||
// The flare is somewhat inaccurate based on the size of the target.
|
||||
float xVariance = target.width / 4f;
|
||||
if (xVariance < 8f)
|
||||
xVariance = 8f;
|
||||
float yVariance = target.height / 4f;
|
||||
if (yVariance < 8f)
|
||||
yVariance = 8f;
|
||||
float xOffset = Main.rand.NextFloat(-xVariance, xVariance);
|
||||
float yOffset = Main.rand.NextFloat(-yVariance, yVariance);
|
||||
Vector2 offsetTarget = target.Center + new Vector2(xOffset, yOffset);
|
||||
|
||||
// Finalize the velocity vector and make sure it's going at the right speed.
|
||||
Vector2 velocity = offsetTarget - startPoint;
|
||||
velocity.Normalize();
|
||||
velocity *= flareSpeed;
|
||||
|
||||
float AI1 = Main.rand.Next(3);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(startPoint, velocity, ProjectileID.LunarFlare, flareDamage, flareKB, Main.myPlayer, 0f, AI1);
|
||||
CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity();
|
||||
cgp.forceMelee = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
// Some dust gets produced on impact.
|
||||
int dustCount = Main.rand.Next(20, 24);
|
||||
int dustRadius = 6;
|
||||
Vector2 corner = new Vector2(target.Center.X - dustRadius, target.Center.Y - dustRadius);
|
||||
for (int i = 0; i < dustCount; ++i)
|
||||
{
|
||||
int dustType = 229;
|
||||
float scale = 0.8f + Main.rand.NextFloat(1.1f);
|
||||
int idx = Dust.NewDust(corner, 2 * dustRadius, 2 * dustRadius, dustType);
|
||||
Main.dust[idx].noGravity = true;
|
||||
Main.dust[idx].velocity *= 3f;
|
||||
Main.dust[idx].scale = scale;
|
||||
}
|
||||
|
||||
// Applies Nightwither on contact at night.
|
||||
if (!Main.dayTime)
|
||||
target.AddBuff(ModContent.BuffType<Nightwither>(), 480);
|
||||
|
||||
Main.PlaySound(SoundID.Item88, projectile.position);
|
||||
projectile.netUpdate = true;
|
||||
|
||||
int numFlares = 2;
|
||||
int flareDamage = (int)(0.3f * projectile.damage);
|
||||
float flareKB = 4f;
|
||||
for (int i = 0; i < numFlares; ++i)
|
||||
{
|
||||
float flareSpeed = Main.rand.NextFloat(8f, 11f);
|
||||
|
||||
// Flares never come from straight up, there is always at least an 80 pixel horizontal offset
|
||||
float xDist = Main.rand.NextFloat(80f, 320f) * (Main.rand.NextBool() ? -1f : 1f);
|
||||
float yDist = Main.rand.NextFloat(1200f, 1440f);
|
||||
Vector2 startPoint = target.Center + new Vector2(xDist, -yDist);
|
||||
|
||||
// The flare is somewhat inaccurate based on the size of the target.
|
||||
float xVariance = target.width / 4f;
|
||||
if (xVariance < 8f)
|
||||
xVariance = 8f;
|
||||
float yVariance = target.height / 4f;
|
||||
if (yVariance < 8f)
|
||||
yVariance = 8f;
|
||||
float xOffset = Main.rand.NextFloat(-xVariance, xVariance);
|
||||
float yOffset = Main.rand.NextFloat(-yVariance, yVariance);
|
||||
Vector2 offsetTarget = target.Center + new Vector2(xOffset, yOffset);
|
||||
|
||||
// Finalize the velocity vector and make sure it's going at the right speed.
|
||||
Vector2 velocity = offsetTarget - startPoint;
|
||||
velocity.Normalize();
|
||||
velocity *= flareSpeed;
|
||||
|
||||
float AI1 = Main.rand.Next(3);
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int proj = Projectile.NewProjectile(startPoint, velocity, ProjectileID.LunarFlare, flareDamage, flareKB, Main.myPlayer, 0f, AI1);
|
||||
CalamityGlobalProjectile cgp = Main.projectile[proj].Calamity();
|
||||
cgp.forceMelee = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee
|
||||
{
|
||||
public class TriactisHammerProj : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMightMelee";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Triactis' True Paladinian Mage-Hammer of Might");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 160;
|
||||
projectile.height = 160;
|
||||
projectile.friendly = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 3;
|
||||
projectile.melee = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0f, 0.5f, 0.75f);
|
||||
if (projectile.soundDelay == 0)
|
||||
{
|
||||
projectile.soundDelay = 8;
|
||||
Main.PlaySound(SoundID.Item7, projectile.position);
|
||||
}
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] >= 30f)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.tileCollide = false;
|
||||
float num42 = 20f;
|
||||
float num43 = 5f;
|
||||
Vector2 vector2 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
|
||||
float num44 = Main.player[projectile.owner].position.X + Main.player[projectile.owner].width / 2 - vector2.X;
|
||||
float num45 = Main.player[projectile.owner].position.Y + Main.player[projectile.owner].height / 2 - vector2.Y;
|
||||
float num46 = (float)Math.Sqrt(num44 * num44 + num45 * num45);
|
||||
if (num46 > 3000f)
|
||||
projectile.Kill();
|
||||
num46 = num42 / num46;
|
||||
num44 *= num46;
|
||||
num45 *= num46;
|
||||
if (projectile.velocity.X < num44)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X + num43;
|
||||
if (projectile.velocity.X < 0f && num44 > 0f)
|
||||
projectile.velocity.X = projectile.velocity.X + num43;
|
||||
}
|
||||
else if (projectile.velocity.X > num44)
|
||||
{
|
||||
projectile.velocity.X = projectile.velocity.X - num43;
|
||||
if (projectile.velocity.X > 0f && num44 < 0f)
|
||||
projectile.velocity.X = projectile.velocity.X - num43;
|
||||
}
|
||||
if (projectile.velocity.Y < num45)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y + num43;
|
||||
if (projectile.velocity.Y < 0f && num45 > 0f)
|
||||
projectile.velocity.Y = projectile.velocity.Y + num43;
|
||||
}
|
||||
else if (projectile.velocity.Y > num45)
|
||||
{
|
||||
projectile.velocity.Y = projectile.velocity.Y - num43;
|
||||
if (projectile.velocity.Y > 0f && num45 < 0f)
|
||||
projectile.velocity.Y = projectile.velocity.Y - num43;
|
||||
}
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
{
|
||||
Rectangle rectangle = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height);
|
||||
Rectangle value2 = new Rectangle((int)Main.player[projectile.owner].position.X, (int)Main.player[projectile.owner].position.Y, Main.player[projectile.owner].width, Main.player[projectile.owner].height);
|
||||
if (rectangle.Intersects(value2))
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
projectile.rotation += 0.5f;
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(250, 250, 250, 50);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<MageHammerBoom>(), (int)(projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
Main.PlaySound(SoundID.Item14, projectile.position);
|
||||
for (int num621 = 0; num621 < 40; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 70; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<MageHammerBoom>(), (int)(projectile.damage * 0.25), projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
Main.PlaySound(SoundID.Item14, projectile.position);
|
||||
for (int num621 = 0; num621 < 40; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num622].scale = 0.5f;
|
||||
Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
for (int num623 = 0; num623 < 70; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 3f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
Main.dust[num624].velocity *= 5f;
|
||||
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.NextBool(2) ? 89 : 229, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].velocity *= 2f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
public override void AI()
|
||||
{
|
||||
Player player = Main.player[projectile.owner];
|
||||
float num = 0f;
|
||||
Vector2 vector = player.RotatedRelativePoint(player.MountedCenter, true);
|
||||
if (projectile.type == ModContent.ProjectileType<ContagionBow>())
|
||||
{
|
||||
@@ -128,7 +127,9 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
}
|
||||
}
|
||||
projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - projectile.Size / 2f;
|
||||
projectile.rotation = projectile.velocity.ToRotation() + num;
|
||||
projectile.rotation = projectile.velocity.ToRotation();
|
||||
if (projectile.spriteDirection == -1)
|
||||
projectile.rotation += MathHelper.Pi;
|
||||
projectile.spriteDirection = projectile.direction;
|
||||
projectile.timeLeft = 2;
|
||||
player.ChangeDir(projectile.direction);
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class AccretionDisk2 : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/AccretionDisk";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Accretion Disk");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 1;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 56;
|
||||
projectile.height = 56;
|
||||
projectile.alpha = 120;
|
||||
projectile.friendly = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.penetrate = -1;
|
||||
projectile.aiStyle = 3;
|
||||
projectile.timeLeft = 60;
|
||||
aiType = ProjectileID.WoodenBoomerang;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
int num250 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, projectile.direction * 2, 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 0.5f);
|
||||
Main.dust[num250].noGravity = true;
|
||||
Main.dust[num250].velocity *= 0f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<GlacialState>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<GlacialState>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<Plague>(), 120);
|
||||
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,11 @@ using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Hybrid
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class AccretionDiskProj : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/AccretionDisk";
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/AccretionDisk";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -32,14 +32,14 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
projectile.aiStyle = 3;
|
||||
projectile.timeLeft = 400;
|
||||
aiType = ProjectileID.WoodenBoomerang;
|
||||
projectile.melee = true;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
int rainbow = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, (float)(projectile.direction * 2), 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f);
|
||||
int rainbow = Dust.NewDust(projectile.position, projectile.width, projectile.height, 66, projectile.direction * 2, 0f, 150, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.3f);
|
||||
Main.dust[rainbow].noGravity = true;
|
||||
Main.dust[rainbow].velocity *= 0f;
|
||||
}
|
||||
@@ -54,13 +54,13 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
NPC npc = Main.npc[i];
|
||||
if (npc.CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float extraDistance = (npc.width / 2) + (npc.height / 2);
|
||||
float extraDistance = npc.width / 2 + npc.height / 2;
|
||||
|
||||
bool canHit = true;
|
||||
if (extraDistance < maxDistance)
|
||||
canHit = Collision.CanHit(projectile.Center, 1, 1, npc.Center, 1, 1);
|
||||
|
||||
if (Vector2.Distance(npc.Center, projectile.Center) < (maxDistance + extraDistance) && canHit)
|
||||
if (Vector2.Distance(npc.Center, projectile.Center) < maxDistance + extraDistance && canHit)
|
||||
{
|
||||
homeIn = true;
|
||||
break;
|
||||
@@ -69,9 +69,7 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
}
|
||||
|
||||
if (!projectile.friendly)
|
||||
{
|
||||
homeIn = false;
|
||||
}
|
||||
|
||||
if (homeIn)
|
||||
{
|
||||
@@ -88,11 +86,9 @@ namespace CalamityMod.Projectiles.Hybrid
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i;
|
||||
int disk = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), splitProj, projectile.damage, projectile.knockBack, projectile.owner);
|
||||
Main.projectile[disk].Calamity().forceMelee = projectile.melee;
|
||||
Main.projectile[disk].Calamity().forceRogue = projectile.Calamity().rogue;
|
||||
Main.projectile[disk].Calamity().forceRogue = true;
|
||||
int disk2 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), splitProj, projectile.damage, projectile.knockBack, projectile.owner);
|
||||
Main.projectile[disk2].Calamity().forceMelee = projectile.melee;
|
||||
Main.projectile[disk2].Calamity().forceRogue = projectile.Calamity().rogue;
|
||||
Main.projectile[disk2].Calamity().forceRogue = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class CorpusAvertorClone : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/CorpusAvertor";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Corpus Avertor");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 24;
|
||||
projectile.height = 24;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 180;
|
||||
projectile.tileCollide = false;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.04f;
|
||||
|
||||
projectile.velocity.X *= 1.005f;
|
||||
projectile.velocity.Y *= 1.005f;
|
||||
|
||||
switch ((int)projectile.ai[0])
|
||||
{
|
||||
case 20:
|
||||
projectile.scale = 0.7f;
|
||||
break;
|
||||
case 40:
|
||||
projectile.scale = 0.8f;
|
||||
break;
|
||||
case 60:
|
||||
projectile.scale = 0.9f;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
projectile.width = projectile.height = (int)(24f * projectile.scale);
|
||||
|
||||
CalamityGlobalProjectile.HomeInOnNPC(projectile, true, 300f, 16f, 20f);
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
if (projectile.timeLeft < 85)
|
||||
return new Color((int)(150f * (projectile.timeLeft / 85f)), 0, 0, projectile.timeLeft / 5 * 3);
|
||||
return new Color(150, 0, 0, 50);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
return;
|
||||
|
||||
float heal = damage * 0.05f;
|
||||
if ((int)heal == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
float heal = damage * 0.05f;
|
||||
if ((int)heal == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class CorpusAvertorProj : ModProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Rogue/CorpusAvertor";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Corpus Avertor");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 6;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 24;
|
||||
projectile.height = 24;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.02f;
|
||||
|
||||
if (projectile.ai[0] < 120f)
|
||||
projectile.ai[0] += 1f;
|
||||
|
||||
if (projectile.ai[0] < 61f)
|
||||
{
|
||||
if (projectile.ai[0] % 20f == 0f)
|
||||
{
|
||||
Vector2 velocity = new Vector2(projectile.velocity.X, projectile.velocity.Y);
|
||||
float mult = projectile.ai[0] / 80f; // Ranges from 0.25 to 0.5 to 0.75
|
||||
velocity *= mult;
|
||||
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, velocity.X, velocity.Y, ModContent.ProjectileType<CorpusAvertorClone>(),
|
||||
(int)(projectile.damage * mult), projectile.knockBack * mult, projectile.owner, projectile.ai[0]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X *= 1.01f;
|
||||
projectile.velocity.Y *= 1.01f;
|
||||
|
||||
int scale = (int)((projectile.ai[0] - 60f) * 4.25f);
|
||||
int dust = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 5, 0f, 0f, 100, new Color(scale, 0, 0, 50), 2f);
|
||||
Main.dust[dust].velocity *= 0f;
|
||||
Main.dust[dust].noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
if (projectile.ai[0] >= 61f)
|
||||
{
|
||||
int scale = (int)((projectile.ai[0] - 60f) * 4.25f);
|
||||
return new Color(scale, 0, 0, 50);
|
||||
}
|
||||
return new Color(0, 0, 0, 50);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
if (target.type == NPCID.TargetDummy)
|
||||
return;
|
||||
|
||||
float heal = damage * 0.05f;
|
||||
if ((int)heal == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
float heal = damage * 0.05f;
|
||||
if ((int)heal == 0)
|
||||
return;
|
||||
if (Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
CalamityGlobalProjectile.SpawnLifeStealProjectile(projectile, Main.player[projectile.owner], heal, ProjectileID.VampireHeal, 1200f, 1.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||