Merge branch 'master' of https://github.com/UncleDanny/CalamityMod
No files matched your search
@@ -0,0 +1,25 @@
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.DamageOverTime
|
||||
{
|
||||
public class Vaporfied : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Vaporfied");
|
||||
Description.SetDefault("Vape");
|
||||
Main.debuff[Type] = true;
|
||||
Main.pvpBuff[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
longerExpertDebuff = false;
|
||||
}
|
||||
|
||||
public override void Update(NPC npc, ref int buffIndex)
|
||||
{
|
||||
npc.Calamity().vaporfied = npc.buffTime[buffIndex];
|
||||
npc.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 657 B |
@@ -1779,7 +1779,8 @@ namespace CalamityMod
|
||||
ModContent.ItemType<StellarContemptRogue>(),
|
||||
ModContent.ItemType<TriactisTruePaladinianMageHammerofMight>(),
|
||||
ModContent.ItemType<Valediction>(),
|
||||
ModContent.ItemType<FrostcrushValari>()
|
||||
ModContent.ItemType<FrostcrushValari>(),
|
||||
ModContent.ItemType<DefectiveSphere>()
|
||||
};
|
||||
|
||||
boomerangProjList = new List<int>()
|
||||
@@ -1812,7 +1813,11 @@ namespace CalamityMod
|
||||
ModContent.ProjectileType<StellarContemptHammer>(),
|
||||
ModContent.ProjectileType<IcebreakerHammer>(),
|
||||
ModContent.ProjectileType<PwnagehammerProj>(),
|
||||
ModContent.ProjectileType<ValariBoomerang>()
|
||||
ModContent.ProjectileType<ValariBoomerang>(),
|
||||
ModContent.ProjectileType<SphereSpiked>(),
|
||||
ModContent.ProjectileType<SphereBladed>(),
|
||||
ModContent.ProjectileType<SphereYellow>(),
|
||||
ModContent.ProjectileType<ButcherKnife>()
|
||||
};
|
||||
|
||||
javelinList = new List<int>()
|
||||
@@ -1959,6 +1964,7 @@ namespace CalamityMod
|
||||
|
||||
spikyBallList = new List<int>()
|
||||
{
|
||||
ModContent.ItemType<BouncySpikyBall>(),
|
||||
ModContent.ItemType<GodsParanoia>(),
|
||||
ModContent.ItemType<NastyCholla>(),
|
||||
ModContent.ItemType<HellsSun>(),
|
||||
@@ -1969,6 +1975,7 @@ namespace CalamityMod
|
||||
|
||||
spikyBallProjList = new List<int>()
|
||||
{
|
||||
ModContent.ProjectileType<BouncyBol>(),
|
||||
ModContent.ProjectileType<GodsParanoiaProj>(),
|
||||
ModContent.ProjectileType<HellsSunProj>(),
|
||||
ModContent.ProjectileType<NastyChollaBol>(),
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<SirensSong>(), 3);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<Atlantis>(), 3);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<BrackishFlask>(), 3);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<LeviathanTeeth>(), 3);
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItem(player, ModContent.ItemType<LeviathanAmbergris>());
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
{
|
||||
public class HeliumFlash : ModItem
|
||||
{
|
||||
public static int BaseDamage = 1900;
|
||||
public static int BaseDamage = 1280;
|
||||
public static float Speed = 15f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
|
||||
@@ -45,7 +45,6 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
"[Swings leave behind exploding blood trails [Below 50% health]]\n" +
|
||||
"[Right click to swipe the sword, reflecting projectiles at a 50% chance]\n" +
|
||||
"[Activating Rage Mode releases an enormous barrage of skulls]\n" +
|
||||
"Upgrades after killing the Wall of Flesh, Moon Lord, and Yharon\n" +
|
||||
"'Give me that thing, your dark soul'");
|
||||
}
|
||||
//NOTE: GetWeaponDamage is in the CalamityPlayer file
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
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 = 70;
|
||||
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 = 1;
|
||||
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<LivingShard>(), 8);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.AddRecipe();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 18;
|
||||
item.damage = 9;
|
||||
item.ranged = true;
|
||||
item.width = 56;
|
||||
item.height = 28;
|
||||
@@ -70,7 +70,7 @@ namespace CalamityMod.Items.Weapons.Ranged
|
||||
{
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-50, 51) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-50, 51) * 0.05f;
|
||||
int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 0.75), knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
int flare = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, (int)((double)damage * 1.6), knockBack, player.whoAmI, 0.0f, 0.0f);
|
||||
Main.projectile[flare].penetrate = 1;
|
||||
Main.projectile[flare].timeLeft = 600;
|
||||
Main.projectile[flare].Calamity().forceRanged = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 593 B After Width: | Height: | Size: 628 B |
@@ -0,0 +1,62 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class BouncySpikyBall : RogueWeapon
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Bouncy Spiky Ball");
|
||||
Tooltip.SetDefault(@"Throws a very bouncy ball that richochets off walls and enemies
|
||||
Receives a small boost in damage and velocity after bouncing off an enemy
|
||||
Stealth strikes provide a bigger boost after richocheting");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 14;
|
||||
item.damage = 10;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 18;
|
||||
item.useStyle = 1;
|
||||
item.useTime = 18;
|
||||
item.knockBack = 1f;
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.autoReuse = true;
|
||||
item.consumable = true;
|
||||
item.maxStack = 999;
|
||||
item.height = 14;
|
||||
item.value = Item.buyPrice(0, 0, 1, 0);
|
||||
item.rare = 1;
|
||||
item.shoot = ModContent.ProjectileType<BouncyBol>();
|
||||
item.shootSpeed = 8f;
|
||||
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)
|
||||
{
|
||||
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ItemID.SpikyBall, 3);
|
||||
recipe.AddIngredient(ItemID.PinkGel);
|
||||
recipe.AddTile(TileID.WorkBenches);
|
||||
recipe.SetResult(this, 3);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 301 B |
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
item.autoReuse = true;
|
||||
item.height = 48;
|
||||
item.maxStack = 1;
|
||||
item.rare = 8;
|
||||
item.rare = 7;
|
||||
item.value = Item.buyPrice(0, 60, 0, 0);
|
||||
item.shoot = ModContent.ProjectileType<DeepWounderProjectile>();
|
||||
item.shootSpeed = 14f;
|
||||
|
||||
@@ -0,0 +1,100 @@
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class DefectiveSphere : RogueWeapon
|
||||
{
|
||||
public static int BaseDamage = 80;
|
||||
public static float Speed = 15f;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Defective Sphere");
|
||||
Tooltip.SetDefault(@"Fires a variety deadly spheres with different effects
|
||||
Stacks up to 5
|
||||
Stealth strikes launch all 4 sphere types at once");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 42;
|
||||
item.height = 44;
|
||||
item.damage = BaseDamage;
|
||||
item.knockBack = 5f;
|
||||
item.useAnimation = 13;
|
||||
item.useTime = 13;
|
||||
item.autoReuse = true;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.maxStack = 5;
|
||||
|
||||
item.useStyle = 1;
|
||||
item.UseSound = SoundID.Item15; //phaseblade sound effect
|
||||
|
||||
item.value = Item.buyPrice(0, 16, 0, 0);
|
||||
item.rare = 8;
|
||||
|
||||
item.Calamity().rogue = true;
|
||||
item.shoot = ModContent.ProjectileType<SphereSpiked>();
|
||||
item.shootSpeed = Speed;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
int UseMax = item.stack;
|
||||
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if ((player.ownedProjectileCounts[item.shoot] + player.ownedProjectileCounts[ModContent.ProjectileType<SphereBladed>()] + player.ownedProjectileCounts[ModContent.ProjectileType<SphereYellow>()] + player.ownedProjectileCounts[ModContent.ProjectileType<SphereBlue>()]) >= UseMax)
|
||||
{
|
||||
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 sphereType = type;
|
||||
if (Main.rand.NextBool(4))
|
||||
sphereType = ModContent.ProjectileType<SphereBladed>();
|
||||
else if (Main.rand.NextBool(3))
|
||||
sphereType = ModContent.ProjectileType<SphereYellow>();
|
||||
else if (Main.rand.NextBool(2))
|
||||
sphereType = ModContent.ProjectileType<SphereBlue>();
|
||||
float SpeedX = speedX + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedY = speedY + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedX2 = speedX + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedY2 = speedY + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedX3 = speedX + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedY3 = speedY + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedX4 = speedX + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
float SpeedY4 = speedY + (float)Main.rand.Next(-30, 31) * 0.05f;
|
||||
|
||||
if (player.Calamity().StealthStrikeAvailable())
|
||||
{
|
||||
int stealth = Projectile.NewProjectile(position.X, position.Y, SpeedX, SpeedY, type, damage / 2, knockBack, player.whoAmI, 0f, 0f);
|
||||
int stealth2 = Projectile.NewProjectile(position.X, position.Y, SpeedX2, SpeedY2, ModContent.ProjectileType<SphereBladed>(), damage / 2, knockBack, player.whoAmI, 0f, 0f);
|
||||
int stealth3 = Projectile.NewProjectile(position.X, position.Y, SpeedX3, SpeedY3, ModContent.ProjectileType<SphereYellow>(), damage / 2, knockBack, player.whoAmI, 0f, 0f);
|
||||
int stealth4 = Projectile.NewProjectile(position.X, position.Y, SpeedX4, SpeedY4, ModContent.ProjectileType<SphereBlue>(), damage / 2, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[stealth].Calamity().stealthStrike = true;
|
||||
Main.projectile[stealth2].Calamity().stealthStrike = true;
|
||||
Main.projectile[stealth3].Calamity().stealthStrike = true;
|
||||
Main.projectile[stealth4].Calamity().stealthStrike = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), sphereType, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 723 B |
@@ -21,7 +21,7 @@ Stealth strikes throws three short ranged boomerangs along with a spread of icic
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.damage = 75;
|
||||
item.damage = 70;
|
||||
item.knockBack = 12;
|
||||
item.thrown = true;
|
||||
item.crit = 16;
|
||||
@@ -67,7 +67,7 @@ Stealth strikes throws three short ranged boomerangs along with a spread of icic
|
||||
return true;
|
||||
}
|
||||
|
||||
/*public override void AddRecipes()
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<Kylie>());
|
||||
@@ -77,6 +77,6 @@ Stealth strikes throws three short ranged boomerangs along with a spread of icic
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,9 +63,9 @@ Right click to delete all existing spiky balls");
|
||||
}
|
||||
else
|
||||
{
|
||||
int UseMax = item.stack - 1;
|
||||
int UseMax = item.stack;
|
||||
|
||||
if (player.ownedProjectileCounts[item.shoot] > UseMax)
|
||||
if (player.ownedProjectileCounts[item.shoot] >= UseMax)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -64,9 +64,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
else
|
||||
{
|
||||
int UseMax = item.stack - 1;
|
||||
int UseMax = item.stack;
|
||||
|
||||
if (player.ownedProjectileCounts[item.shoot] > UseMax)
|
||||
if (player.ownedProjectileCounts[item.shoot] >= UseMax)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -13,13 +13,14 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
DisplayName.SetDefault("Jaws of Oblivion");
|
||||
Tooltip.SetDefault("Throws a tight spread of six venomous reaper fangs that stick in enemies\n" +
|
||||
"Stealth strikes cause the teeth to emit a crushing shockwave on impact");
|
||||
"Stealth strikes cause the teeth to emit a crushing shockwave on impact\n" +
|
||||
"You're gonna need a bigger boat");
|
||||
}
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 42;
|
||||
item.damage = 350;
|
||||
item.damage = 438;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 15;
|
||||
@@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
item.value = Item.buyPrice(1, 40, 0, 0);
|
||||
item.rare = 10;
|
||||
item.shoot = ModContent.ProjectileType<JawsProjectile>();
|
||||
item.shootSpeed = 20f;
|
||||
item.shootSpeed = 25f;
|
||||
item.Calamity().postMoonLordRarity = 13;
|
||||
item.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX, speedY).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType<KylieBoomerang>(), item.damage, item.knockBack, player.whoAmI, 0f, 1f);
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType<KylieBoomerang>(), damage, knockBack, player.whoAmI, 0f, 1f);
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
spread -= 10;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.width = 36;
|
||||
item.damage = 70;
|
||||
item.damage = 94;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.useAnimation = 10;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
item.UseSound = SoundID.Item1;
|
||||
item.useTime = 20;
|
||||
item.useAnimation = 20;
|
||||
item.value = Item.buyPrice(0, 0, 1, 0);
|
||||
item.value = Item.buyPrice(0, 0, 4, 0);
|
||||
item.rare = 7;
|
||||
item.shootSpeed = 8f;
|
||||
item.shoot = ModContent.ProjectileType<MonkeyDart>();
|
||||
|
||||
@@ -47,7 +47,7 @@ Stealth strikes throw five at once");
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, item.damage, item.knockBack, player.whoAmI, 0f, 0f);
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
spread -= Main.rand.Next(1,4);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ Stealth strikes don't slow down and souls always deal full damage");
|
||||
|
||||
public override void SafeSetDefaults()
|
||||
{
|
||||
item.damage = 150;
|
||||
item.damage = 75;
|
||||
item.knockBack = 5f;
|
||||
|
||||
item.width = 62;
|
||||
|
||||
@@ -60,9 +60,9 @@ namespace CalamityMod.Items.Weapons.Rogue
|
||||
}
|
||||
else
|
||||
{
|
||||
int UseMax = item.stack - 1;
|
||||
int UseMax = item.stack;
|
||||
|
||||
if (player.ownedProjectileCounts[item.shoot] > UseMax)
|
||||
if (player.ownedProjectileCounts[item.shoot] >= UseMax)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -45,9 +45,10 @@ Stealth strikes throw seven at once and last a lot longer");
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
Vector2 perturbedspeed = new Vector2(speedX + Main.rand.Next(-3,4), speedY + Main.rand.Next(-3,4)).RotatedBy(MathHelper.ToRadians(spread));
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, item.damage, item.knockBack, player.whoAmI, 0f, 0f);
|
||||
int proj = Projectile.NewProjectile(position.X, position.Y, perturbedspeed.X, perturbedspeed.Y, type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
Main.projectile[proj].Calamity().stealthStrike = true;
|
||||
Main.projectile[proj].timeLeft *= 4;
|
||||
Main.projectile[proj].localNPCHitCooldown += 15;
|
||||
spread -= Main.rand.Next(1,4);
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Rogue
|
||||
{
|
||||
public class TerraDisk : RogueWeapon
|
||||
{
|
||||
public static int BaseDamage = 70;
|
||||
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 SafeSetDefaults()
|
||||
{
|
||||
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 = 1;
|
||||
item.UseSound = SoundID.Item1;
|
||||
|
||||
item.value = Item.buyPrice(0, 80, 0, 0);
|
||||
item.rare = 8;
|
||||
|
||||
item.Calamity().rogue = 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().forceRogue = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/*public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddIngredient(ModContent.ItemType<SeashellBoomerang>());
|
||||
recipe.AddIngredient(ModContent.ItemType<LivingShard>(), 8);
|
||||
recipe.AddTile(TileID.MythrilAnvil);
|
||||
recipe.AddRecipe();
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,70 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Typeless
|
||||
{
|
||||
public class Aestheticus : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Aestheticus");
|
||||
Tooltip.SetDefault("Fires crystals that explode and slow enemies down\n" +
|
||||
"This weapon scales with all your damage stats at once");
|
||||
Item.staff[item.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 58;
|
||||
item.damage = 10;
|
||||
item.rare = 3;
|
||||
item.useAnimation = 25;
|
||||
item.useTime = 25;
|
||||
item.useStyle = 5;
|
||||
item.knockBack = 3f;
|
||||
item.UseSound = SoundID.Item109;
|
||||
item.autoReuse = true;
|
||||
item.noMelee = true;
|
||||
item.height = 58;
|
||||
item.value = Item.buyPrice(0, 4, 0, 0);
|
||||
item.shoot = ModContent.ProjectileType<CursorProj>();
|
||||
item.shootSpeed = 5f;
|
||||
}
|
||||
|
||||
// Lunic Eye scales off of all damage types simultaneously (meaning it scales 5x from universal damage boosts).
|
||||
public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat)
|
||||
{
|
||||
float formula = 5f * (player.allDamage - 1f);
|
||||
formula += player.meleeDamage - 1f;
|
||||
formula += player.rangedDamage - 1f;
|
||||
formula += player.magicDamage - 1f;
|
||||
formula += player.minionDamage - 1f;
|
||||
formula += player.Calamity().throwingDamage - 1f;
|
||||
add += formula;
|
||||
}
|
||||
|
||||
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(ItemID.HellstoneBar, 10);
|
||||
recipe.AddIngredient(ItemID.MeteoriteBar, 10);
|
||||
recipe.AddIngredient(ModContent.ItemType<AerialiteBar>(), 5);
|
||||
recipe.AddIngredient(ItemID.Glass, 20);
|
||||
recipe.AddIngredient(ItemID.Gel, 15);
|
||||
recipe.AddIngredient(ItemID.FallenStar, 5);
|
||||
recipe.AddTile(TileID.Anvils);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 2.7 KiB |
@@ -89,7 +89,8 @@ namespace CalamityMod.NPCs
|
||||
// Draedons Remote
|
||||
public static bool DraedonMayhem = false;
|
||||
|
||||
// Debuffs
|
||||
// Debuffs
|
||||
public int vaporfied = 0;
|
||||
public int timeSlow = 0;
|
||||
public int gState = 0;
|
||||
public int tSad = 0;
|
||||
@@ -529,6 +530,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}*/
|
||||
|
||||
ApplyDPSDebuff(vaporfied, 30, 6, ref npc.lifeRegen, ref damage);
|
||||
ApplyDPSDebuff(irradiated, 20, 4, ref npc.lifeRegen, ref damage);
|
||||
ApplyDPSDebuff(bFlames, 40, 8, ref npc.lifeRegen, ref damage);
|
||||
ApplyDPSDebuff(hFlames, 50, 10, ref npc.lifeRegen, ref damage);
|
||||
@@ -2127,6 +2129,8 @@ namespace CalamityMod.NPCs
|
||||
dFlames--;
|
||||
if (marked > 0)
|
||||
marked--;
|
||||
if (vaporfied > 0)
|
||||
vaporfied--;
|
||||
if (irradiated > 0)
|
||||
irradiated--;
|
||||
if (bFlames > 0)
|
||||
@@ -2164,8 +2168,13 @@ namespace CalamityMod.NPCs
|
||||
if (npc.boss || CalamityMod.movementImpairImmuneList.Contains(npc.type))
|
||||
return;
|
||||
|
||||
if (pearlAura > 0 && !CalamityPlayer.areThereAnyDamnBosses)
|
||||
npc.velocity *= 0.9f;
|
||||
if (!CalamityPlayer.areThereAnyDamnBosses)
|
||||
{
|
||||
if (pearlAura > 0)
|
||||
npc.velocity *= 0.9f;
|
||||
if (vaporfied > 0)
|
||||
npc.velocity *= 0.9f;
|
||||
}
|
||||
|
||||
if (!CalamityWorld.bossRushActive)
|
||||
{
|
||||
@@ -2905,7 +2914,34 @@ namespace CalamityMod.NPCs
|
||||
|
||||
public override void DrawEffects(NPC npc, ref Color drawColor)
|
||||
{
|
||||
if (bBlood > 0)
|
||||
if (vaporfied > 0)
|
||||
{
|
||||
int dustType = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
246,
|
||||
242,
|
||||
229,
|
||||
226,
|
||||
247,
|
||||
187,
|
||||
234
|
||||
});
|
||||
|
||||
if (Main.rand.Next(5) < 4)
|
||||
{
|
||||
int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, dustType, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 3f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity *= 1.8f;
|
||||
Main.dust[dust].velocity.Y -= 0.5f;
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
Main.dust[dust].noGravity = false;
|
||||
Main.dust[dust].scale *= 0.5f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bBlood > 0)
|
||||
{
|
||||
if (Main.rand.Next(5) < 4)
|
||||
{
|
||||
@@ -2921,6 +2957,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
Lighting.AddLight(npc.position, 0.08f, 0f, 0f);
|
||||
}
|
||||
|
||||
if (bFlames > 0 || enraged > 0)
|
||||
{
|
||||
if (Main.rand.Next(5) < 4)
|
||||
@@ -2937,6 +2974,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
Lighting.AddLight(npc.position, 0.05f, 0.01f, 0.01f);
|
||||
}
|
||||
|
||||
if (aFlames > 0)
|
||||
{
|
||||
if (Main.rand.Next(5) < 4)
|
||||
@@ -2953,6 +2991,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
Lighting.AddLight(npc.position, 0.025f, 0f, 0f);
|
||||
}
|
||||
|
||||
if (pShred > 0)
|
||||
{
|
||||
if (Main.rand.Next(5) < 4)
|
||||
@@ -2968,6 +3007,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hFlames > 0)
|
||||
{
|
||||
if (Main.rand.Next(5) < 4)
|
||||
@@ -2984,6 +3024,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
Lighting.AddLight(npc.position, 0.25f, 0.25f, 0.1f);
|
||||
}
|
||||
|
||||
if (pFlames > 0)
|
||||
{
|
||||
if (Main.rand.Next(5) < 4)
|
||||
@@ -3000,6 +3041,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
Lighting.AddLight(npc.position, 0.07f, 0.15f, 0.01f);
|
||||
}
|
||||
|
||||
if (gsInferno > 0)
|
||||
{
|
||||
if (Main.rand.Next(5) < 4)
|
||||
@@ -3016,6 +3058,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
Lighting.AddLight(npc.position, 0.1f, 0f, 0.135f);
|
||||
}
|
||||
|
||||
if (astralInfection > 0)
|
||||
{
|
||||
if (Main.rand.Next(5) < 3)
|
||||
@@ -3033,6 +3076,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nightwither > 0)
|
||||
{
|
||||
Rectangle hitbox = npc.Hitbox;
|
||||
@@ -3044,6 +3088,7 @@ namespace CalamityMod.NPCs
|
||||
27,
|
||||
234
|
||||
});
|
||||
|
||||
int num4 = Dust.NewDust(hitbox.TopLeft(), npc.width, npc.height, num3, 0f, -2.5f, 0, default, 1f);
|
||||
Main.dust[num4].noGravity = true;
|
||||
Main.dust[num4].alpha = 200;
|
||||
@@ -3054,6 +3099,7 @@ namespace CalamityMod.NPCs
|
||||
dust.scale += Main.rand.NextFloat();
|
||||
}
|
||||
}
|
||||
|
||||
if (tSad > 0 || cDepth > 0)
|
||||
{
|
||||
if (Main.rand.Next(6) < 3)
|
||||
@@ -3069,6 +3115,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dFlames > 0)
|
||||
{
|
||||
if (Main.rand.Next(5) < 4)
|
||||
@@ -3085,6 +3132,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
Lighting.AddLight(npc.position, 0.1f, 0f, 0.135f);
|
||||
}
|
||||
|
||||
if (sulphurPoison > 0)
|
||||
{
|
||||
if (Main.rand.Next(5) < 4)
|
||||
@@ -3121,7 +3169,7 @@ namespace CalamityMod.NPCs
|
||||
drawColor = Color.Cyan;
|
||||
}
|
||||
|
||||
if (marked > 0 || sulphurPoison > 0)
|
||||
if (marked > 0 || sulphurPoison > 0 || vaporfied > 0)
|
||||
{
|
||||
drawColor = Color.Fuchsia;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 787 B After Width: | Height: | Size: 1.1 KiB |
@@ -629,6 +629,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<SirensSong>(), 4);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<Atlantis>(), 4);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<BrackishFlask>(), 4);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<LeviathanTeeth>(), 4);
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<LureofEnthrallment>(), 4);
|
||||
|
||||
@@ -251,24 +251,23 @@ namespace CalamityMod.NPCs.TownNPCs
|
||||
{
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<BouncingBetty>());
|
||||
nextSlot++;
|
||||
/*shop.item[nextSlot].SetDefaults(ModContent.ItemType<Items.LatcherMines>());
|
||||
/*shop.item[nextSlot].SetDefaults(ModContent.ItemType<LatcherMines>());
|
||||
nextSlot++;*/
|
||||
}
|
||||
if (NPC.downedPlantBoss)
|
||||
{
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<MonkeyDarts>());
|
||||
shop.item[nextSlot].shopCustomPrice = Item.buyPrice(0, 0, 4, 0);
|
||||
nextSlot++;
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<GloveOfPrecision>());
|
||||
nextSlot++;
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<GloveOfRecklessness>());
|
||||
nextSlot++;
|
||||
/*shop.item[nextSlot].SetDefaults(ModContent.ItemType<Items.DeepWounder>());
|
||||
nextSlot++;*/
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<DeepWounder>());
|
||||
nextSlot++;
|
||||
}
|
||||
/*if (NPC.downedGolemBoss)
|
||||
{
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<Items.EtherealExtorter>());
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<EtherealExtorter>());
|
||||
shop.item[nextSlot].shopCustomPrice = Item.buyPrice(1, 0, 0, 0);
|
||||
nextSlot++;
|
||||
}*/
|
||||
@@ -280,7 +279,7 @@ namespace CalamityMod.NPCs.TownNPCs
|
||||
}
|
||||
/*if (CalamityWorld.downedProvidence)
|
||||
{
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<Items.SylvanSlasher>());
|
||||
shop.item[nextSlot].SetDefaults(ModContent.ItemType<SylvanSlasher>());
|
||||
shop.item[nextSlot].shopCustomPrice = Item.buyPrice(5, 0, 0, 0);
|
||||
nextSlot++;
|
||||
}*/
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using CalamityMod.Buffs.StatDebuffs;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -105,7 +104,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
|
||||
// Spawn a Helium Flash on impact
|
||||
int type = ModContent.ProjectileType<HeliumFlashBlast>();
|
||||
int damage = HeliumFlash.BaseDamage;
|
||||
int damage = projectile.damage;
|
||||
float kb = 9.5f;
|
||||
Projectile.NewProjectile(projectile.Center, Vector2.Zero, type, damage, kb, projectile.owner, 0f, 0f);
|
||||
}
|
||||
|
||||
@@ -77,14 +77,14 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
Vector2 shrapnelVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(30f));
|
||||
Projectile.NewProjectile(projectile.Center, projectile.velocity + shrapnelVelocity,
|
||||
ModContent.ProjectileType<BarrelShrapnel>(), BlastBarrel.BaseDamage, 3f, projectile.owner);
|
||||
ModContent.ProjectileType<BarrelShrapnel>(), projectile.damage, 3f, projectile.owner);
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector2 fireVelocity = (Vector2.UnitY * (-16f + Main.rand.NextFloat(-3, 12f))).RotatedByRandom((double)MathHelper.ToRadians(40f));
|
||||
int fireIndex = Projectile.NewProjectile(projectile.Center, projectile.velocity + fireVelocity,
|
||||
Main.rand.Next(ProjectileID.MolotovFire, ProjectileID.MolotovFire3 + 1),
|
||||
BlastBarrel.BaseDamage, 1f, projectile.owner);
|
||||
projectile.damage, 1f, projectile.owner);
|
||||
Main.projectile[fireIndex].Calamity().forceRogue = true;
|
||||
Main.projectile[fireIndex].penetrate = -1;
|
||||
Main.projectile[fireIndex].usesLocalNPCImmunity = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 593 B After Width: | Height: | Size: 628 B |
@@ -0,0 +1,115 @@
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class BouncyBol : ModProjectile
|
||||
{
|
||||
private bool hasHitEnemy = false;
|
||||
private int targetNPC = -1;
|
||||
private List<int> previousNPCs = new List<int>() { -1 };
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Bouncy Ball");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 8;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.Calamity().rogue = true;
|
||||
projectile.aiStyle = 14;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (hasHitEnemy == true && projectile.timeLeft < 575)
|
||||
{
|
||||
projectile.velocity.X *= 1.005f; //you broke up, time to yeet yourself out
|
||||
projectile.velocity.Y *= 1.005f;
|
||||
if (projectile.velocity.X > 16f)
|
||||
{
|
||||
projectile.velocity.X = 16f;
|
||||
}
|
||||
if (projectile.velocity.Y > 16f)
|
||||
{
|
||||
projectile.velocity.Y = 16f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
float minDist = 999f;
|
||||
int index = 0;
|
||||
for (int i = 0; i < Main.npc.Length; i++)
|
||||
{
|
||||
bool hasHitNPC = false;
|
||||
for (int j = 0; j < previousNPCs.Count; j++)
|
||||
{
|
||||
if (previousNPCs[j] == i)
|
||||
{
|
||||
hasHitNPC = true;
|
||||
}
|
||||
}
|
||||
|
||||
NPC npc = Main.npc[i];
|
||||
if (npc == target)
|
||||
{
|
||||
previousNPCs.Add(i);
|
||||
}
|
||||
if (!npc.friendly && !npc.townNPC && npc.active && !npc.dontTakeDamage && npc.chaseable && npc != target && !hasHitNPC)
|
||||
{
|
||||
float dist = (projectile.Center - npc.Center).Length();
|
||||
if (dist < minDist)
|
||||
{
|
||||
minDist = dist;
|
||||
index = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 velocityNew;
|
||||
if (minDist < 999f)
|
||||
{
|
||||
if (projectile.Calamity().stealthStrike && hasHitEnemy == false)
|
||||
{
|
||||
projectile.damage = (int)(projectile.damage * 1.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.damage = (int)(projectile.damage * 1.1f);
|
||||
}
|
||||
hasHitEnemy = true;
|
||||
targetNPC = index;
|
||||
velocityNew = Main.npc[index].Center - projectile.Center;
|
||||
velocityNew.Normalize();
|
||||
velocityNew *= 15f;
|
||||
projectile.velocity = velocityNew;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
if (projectile.velocity.X != oldVelocity.X)
|
||||
{
|
||||
projectile.velocity.X = -oldVelocity.X * 1.001f;
|
||||
}
|
||||
if (projectile.velocity.Y != oldVelocity.Y)
|
||||
{
|
||||
projectile.velocity.Y = -oldVelocity.Y * 1.001f;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 301 B |
@@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
framesNeeded /= 6f - projectile.penetrate + 1f; //1 is to prevent division by zero. The more hits, the more afterimages
|
||||
if (projectile.timeLeft % (int)framesNeeded == 0f)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center, projectile.velocity, ModContent.ProjectileType<CelestialReaperAfterimage>(), CelestialReaper.BaseDamage, 2f, projectile.owner);
|
||||
Projectile.NewProjectile(projectile.Center, projectile.velocity, ModContent.ProjectileType<CelestialReaperAfterimage>(), projectile.damage, 2f, projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
for (float i = 0f; i < 7f; i += 1f)
|
||||
{
|
||||
float angle = MathHelper.TwoPi * i / 7f;
|
||||
Projectile.NewProjectile(projectile.Center, angle.ToRotationVector2() * 12f, ModContent.ProjectileType<CelestialReaperAfterimage>(), CelestialReaper.BaseDamage, 2f, projectile.owner);
|
||||
Projectile.NewProjectile(projectile.Center, angle.ToRotationVector2() * 12f, ModContent.ProjectileType<CelestialReaperAfterimage>(), projectile.damage, 2f, projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Point result;
|
||||
if (WorldUtils.Find(projectile.Top.ToTileCoordinates(), Searches.Chain((GenSearch)new Searches.Down(80), (GenCondition)new Conditions.IsSolid()), out result))
|
||||
{
|
||||
Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, ModContent.ProjectileType<BlueFlamePillar>(), ConsecratedWater.BaseDamage, 2f, projectile.owner);
|
||||
Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, ModContent.ProjectileType<BlueFlamePillar>(), projectile.damage, 2f, projectile.owner);
|
||||
}
|
||||
}
|
||||
//stealth strike
|
||||
@@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
Point result;
|
||||
if (WorldUtils.Find((projectile.Top + i * Main.rand.NextFloat(56f, 108f) * Vector2.UnitX).ToTileCoordinates(), Searches.Chain((GenSearch)new Searches.Down(80), (GenCondition)new Conditions.IsSolid()), out result))
|
||||
{
|
||||
Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, ModContent.ProjectileType<BlueFlamePillar>(), ConsecratedWater.BaseDamage, 2f, projectile.owner);
|
||||
Projectile.NewProjectile(result.ToVector2() * 16f, Vector2.Zero, ModContent.ProjectileType<BlueFlamePillar>(), projectile.damage, 2f, projectile.owner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,5 +115,12 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.Kill();
|
||||
return false;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -115,5 +115,12 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.Kill();
|
||||
return false;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
@@ -51,7 +50,7 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
}
|
||||
}
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f;
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 175, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, default(Color), 0.85f);
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 175, projectile.velocity.X * 0.25f, projectile.velocity.Y * 0.25f, 0, default, 0.85f);
|
||||
projCount--;
|
||||
if (projCount <= 0)
|
||||
{
|
||||
@@ -59,18 +58,19 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
if (projectile.Calamity().stealthStrike)
|
||||
{
|
||||
int stealthSoul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<Phantom>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
int stealthSoulDamage = (int)(projectile.damage * 0.75f);
|
||||
float stealthSoulKB = projectile.knockBack;
|
||||
int stealthSoul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<Phantom>(), stealthSoulDamage, stealthSoulKB, projectile.owner, 0f, 0f);
|
||||
Main.projectile[stealthSoul].Calamity().forceRogue = true;
|
||||
Main.projectile[stealthSoul].usesLocalNPCImmunity = true;
|
||||
Main.projectile[stealthSoul].localNPCHitCooldown = -2;
|
||||
}
|
||||
else
|
||||
{
|
||||
double damageMult = 1.0;
|
||||
damageMult = (double)(projectile.timeLeft) / 300.0;
|
||||
double newDamage = projectile.damage * damageMult;
|
||||
|
||||
int soul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<Phantom>(), (int)newDamage, projectile.knockBack, projectile.owner, 0f, 0f);
|
||||
float damageMult = projectile.timeLeft * 0.75f / 300f;
|
||||
int soulDamage = (int)(projectile.damage * damageMult);
|
||||
float soulKB = projectile.knockBack;
|
||||
int soul = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<Phantom>(), soulDamage, soulKB, projectile.owner, 0f, 0f);
|
||||
Main.projectile[soul].Calamity().forceRogue = true;
|
||||
Main.projectile[soul].usesLocalNPCImmunity = true;
|
||||
Main.projectile[soul].localNPCHitCooldown = -2;
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
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 SphereBladed : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Bladed Sphere");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 20;
|
||||
projectile.height = 20;
|
||||
projectile.friendly = true;
|
||||
projectile.tileCollide = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.extraUpdates = 1;
|
||||
projectile.Calamity().rogue = true;
|
||||
projectile.usesIDStaticNPCImmunity = true;
|
||||
projectile.idStaticNPCHitCooldown = 10;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.tileCollide = false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 1f, 0f, 0f);
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 100);
|
||||
}
|
||||
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] >= 25f)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
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 void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 34);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 781 B |
@@ -0,0 +1,126 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using System;
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class SphereBlue : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Blue Thruster Sphere");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 10;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 20;
|
||||
projectile.height = 20;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.tileCollide = false;
|
||||
projectile.Calamity().rogue = true;
|
||||
projectile.extraUpdates = 1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0f, 0f, 1f);
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 100);
|
||||
}
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] >= 5f)
|
||||
{
|
||||
projectile.tileCollide = true;
|
||||
}
|
||||
projectile.rotation += projectile.velocity.X * 0.02f;
|
||||
projectile.velocity.Y = projectile.velocity.Y + 0.085f;
|
||||
projectile.velocity.X = projectile.velocity.X * 0.99f;
|
||||
float pcx = projectile.Center.X;
|
||||
float pcy = projectile.Center.Y;
|
||||
float var1 = 800f;
|
||||
bool flag = false;
|
||||
for (int npcvar = 0; npcvar < 200; npcvar++)
|
||||
{
|
||||
if (Main.npc[npcvar].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[npcvar].Center, 1, 1))
|
||||
{
|
||||
float var2 = Main.npc[npcvar].position.X + (Main.npc[npcvar].width / 2);
|
||||
float var3 = Main.npc[npcvar].position.Y + (Main.npc[npcvar].height / 2);
|
||||
float var4 = Math.Abs(projectile.position.X + (projectile.width / 2) - var2) + Math.Abs(projectile.position.Y + (projectile.height / 2) - var3);
|
||||
if (var4 < var1)
|
||||
{
|
||||
var1 = var4;
|
||||
pcx = var2;
|
||||
pcy = var3;
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag)
|
||||
{
|
||||
float homingstrenght = 16f;
|
||||
Vector2 vector1 = new Vector2(projectile.position.X + projectile.width * 0.5f, projectile.position.Y + projectile.height * 0.5f);
|
||||
float var6 = pcx - vector1.X;
|
||||
float var7 = pcy - vector1.Y;
|
||||
float var8 = (float)Math.Sqrt(var6 * var6 + var7 * var7);
|
||||
var8 = homingstrenght / var8;
|
||||
var6 *= var8;
|
||||
var7 *= var8;
|
||||
projectile.velocity.X = (projectile.velocity.X * 20f + var6) / 21f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 20f + var7) / 21f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = projectile.height = 192;
|
||||
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
|
||||
projectile.maxPenetrate = -1;
|
||||
projectile.penetrate = -1;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
projectile.Damage();
|
||||
Main.PlaySound(4, (int)projectile.Center.X, (int)projectile.Center.Y, 37);
|
||||
for (int num625 = 0; num625 < 3; num625++)
|
||||
{
|
||||
float scaleFactor10 = 0.33f;
|
||||
if (num625 == 1)
|
||||
{
|
||||
scaleFactor10 = 0.66f;
|
||||
}
|
||||
if (num625 == 2)
|
||||
{
|
||||
scaleFactor10 = 1f;
|
||||
}
|
||||
int defectiveBruh = Gore.NewGore(new Vector2(projectile.position.X + (float)(projectile.width / 2) - 24f, projectile.position.Y + (float)(projectile.height / 2) - 24f), default, Main.rand.Next(660, 662), 1f);
|
||||
Main.gore[defectiveBruh].velocity *= scaleFactor10;
|
||||
Main.gore[defectiveBruh].velocity += projectile.velocity;
|
||||
}
|
||||
for (int num194 = 0; num194 < 25; num194++)
|
||||
{
|
||||
int dustType = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
226,
|
||||
229
|
||||
});
|
||||
int num195 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num195].noGravity = true;
|
||||
Main.dust[num195].velocity *= 0f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 767 B |
@@ -0,0 +1,56 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class SphereSpiked : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Spiked Sphere");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 5;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 20;
|
||||
projectile.height = 20;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.aiStyle = 3;
|
||||
projectile.timeLeft = 300;
|
||||
aiType = 52;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 1f, 0f, 0f);
|
||||
if (projectile.timeLeft == 300)
|
||||
projectile.damage *= (int)1.2f;
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 100);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 34);
|
||||
if (Main.rand.NextBool(10)) //idk if this even works
|
||||
{
|
||||
if (!crit)
|
||||
crit = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 723 B |
@@ -0,0 +1,62 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
namespace CalamityMod.Projectiles.Rogue
|
||||
{
|
||||
public class SphereYellow : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Yellow Thruster Sphere");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 5;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 20;
|
||||
projectile.height = 20;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = -1;
|
||||
projectile.aiStyle = 3;
|
||||
projectile.timeLeft = 300;
|
||||
aiType = 52;
|
||||
projectile.Calamity().rogue = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 1f, 1f, 0f);
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 229, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f, 100);
|
||||
}
|
||||
}
|
||||
|
||||
public override bool OnTileCollide(Vector2 oldVelocity)
|
||||
{
|
||||
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)
|
||||
{
|
||||
Main.PlaySound(3, (int)projectile.Center.X, (int)projectile.Center.Y, 34);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 746 B |
@@ -27,8 +27,8 @@ namespace CalamityMod.Projectiles.Rogue
|
||||
projectile.penetrate = -1;
|
||||
projectile.timeLeft = 360;
|
||||
projectile.tileCollide = false;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 15;
|
||||
projectile.usesIDStaticNPCImmunity = true;
|
||||
projectile.idStaticNPCHitCooldown = 15;
|
||||
projectile.coldDamage = true;
|
||||
|
||||
projectile.Calamity().rogue = true;
|
||||
|
||||
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 2.7 KiB |
@@ -0,0 +1,221 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class CursorProj : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Aestheticus Crystal");
|
||||
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.extraUpdates = 1;
|
||||
projectile.alpha = 255;
|
||||
projectile.timeLeft = 300;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.alpha > 0)
|
||||
projectile.alpha -= 15;
|
||||
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
|
||||
if (projectile.timeLeft > 285)
|
||||
return;
|
||||
|
||||
float num29 = 5f;
|
||||
float num30 = 300f;
|
||||
float scaleFactor = 6f;
|
||||
Vector2 value7 = new Vector2(10f, 20f);
|
||||
float num31 = 1f;
|
||||
int num32 = 3 * projectile.MaxUpdates;
|
||||
int num33 = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
246,
|
||||
242,
|
||||
229,
|
||||
226,
|
||||
247
|
||||
});
|
||||
int num34 = 255;
|
||||
if (projectile.ai[1] == 0f)
|
||||
{
|
||||
projectile.ai[1] = 1f;
|
||||
projectile.localAI[0] = (float)-(float)Main.rand.Next(48);
|
||||
}
|
||||
else if (projectile.ai[1] == 1f && projectile.owner == Main.myPlayer)
|
||||
{
|
||||
int num35 = -1;
|
||||
float num36 = num30;
|
||||
for (int num37 = 0; num37 < 200; num37++)
|
||||
{
|
||||
if (Main.npc[num37].active && Main.npc[num37].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
Vector2 center3 = Main.npc[num37].Center;
|
||||
float num38 = Vector2.Distance(center3, projectile.Center);
|
||||
if (num38 < num36 && num35 == -1 && Collision.CanHitLine(projectile.Center, 1, 1, center3, 1, 1))
|
||||
{
|
||||
num36 = num38;
|
||||
num35 = num37;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num36 < 4f)
|
||||
{
|
||||
projectile.Kill();
|
||||
return;
|
||||
}
|
||||
if (num35 != -1)
|
||||
{
|
||||
projectile.ai[1] = num29 + 1f;
|
||||
projectile.ai[0] = (float)num35;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
else if (projectile.ai[1] > num29)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
int num39 = (int)projectile.ai[0];
|
||||
if (!Main.npc[num39].active || !Main.npc[num39].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
projectile.ai[1] = 1f;
|
||||
projectile.ai[0] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.ToRotation();
|
||||
Vector2 vector6 = Main.npc[num39].Center - projectile.Center;
|
||||
if (vector6.Length() < 10f)
|
||||
{
|
||||
projectile.Kill();
|
||||
return;
|
||||
}
|
||||
if (vector6 != Vector2.Zero)
|
||||
{
|
||||
vector6.Normalize();
|
||||
vector6 *= scaleFactor;
|
||||
}
|
||||
float num40 = 30f;
|
||||
projectile.velocity = (projectile.velocity * (num40 - 1f) + vector6) / num40;
|
||||
}
|
||||
}
|
||||
if (projectile.ai[1] >= 1f && projectile.ai[1] < num29)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] == num29)
|
||||
{
|
||||
projectile.ai[1] = 1f;
|
||||
}
|
||||
}
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] == 48f)
|
||||
{
|
||||
projectile.localAI[0] = 0f;
|
||||
}
|
||||
if (Main.rand.NextBool(12))
|
||||
{
|
||||
Vector2 value9 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default);
|
||||
int num44 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num34, 0f, 0f, 160, default, 1f);
|
||||
Main.dust[num44].velocity *= 0.1f;
|
||||
Main.dust[num44].position = projectile.Center + value9 * (float)projectile.width / 2f + projectile.velocity * 2f;
|
||||
Main.dust[num44].fadeIn = 0.9f;
|
||||
}
|
||||
if (Main.rand.NextBool(18))
|
||||
{
|
||||
Vector2 value10 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)projectile.velocity.ToRotation(), default);
|
||||
int num46 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, 0f, 0f, 155, default, 0.8f);
|
||||
Main.dust[num46].velocity *= 0.3f;
|
||||
Main.dust[num46].position = projectile.Center + value10 * (float)projectile.width / 2f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num46].fadeIn = 1.4f;
|
||||
}
|
||||
}
|
||||
if (Main.rand.NextBool(8))
|
||||
{
|
||||
Vector2 value11 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)projectile.velocity.ToRotation(), default);
|
||||
int num48 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num33, 0f, 0f, 0, default, 1f);
|
||||
Main.dust[num48].velocity *= 0.3f;
|
||||
Main.dust[num48].noGravity = true;
|
||||
Main.dust[num48].position = projectile.Center + value11 * (float)projectile.width / 2f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num48].fadeIn = 1.4f;
|
||||
}
|
||||
}
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default);
|
||||
int num50 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num34, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num50].velocity *= 0.3f;
|
||||
Main.dust[num50].position = projectile.Center + value13 * (float)projectile.width / 2f;
|
||||
Main.dust[num50].fadeIn = 1.2f;
|
||||
Main.dust[num50].scale = 1.5f;
|
||||
Main.dust[num50].noGravity = true;
|
||||
}
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.2f / 255f, (255 - projectile.alpha) * 0.2f / 255f, (255 - projectile.alpha) * 0.2f / 255f);
|
||||
int num154 = 14;
|
||||
int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 234, 0f, 0f, 100, default, 0.8f);
|
||||
Main.dust[num155].velocity *= 0.1f;
|
||||
Main.dust[num155].velocity += projectile.velocity * 0.5f;
|
||||
Main.dust[num155].noGravity = true;
|
||||
if (Main.rand.NextBool(12))
|
||||
{
|
||||
int num156 = 16;
|
||||
int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 159, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num157].velocity *= 0.25f;
|
||||
Main.dust[num157].velocity += projectile.velocity * 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Vaporfied>(), 300);
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
Vector2 velocity = projectile.velocity;
|
||||
velocity.Normalize();
|
||||
velocity *= 4f;
|
||||
|
||||
int spread = 45;
|
||||
int numProj = 4;
|
||||
float rotation = MathHelper.ToRadians(spread);
|
||||
float baseSpeed = (float)Math.Sqrt(velocity.X * velocity.X + velocity.Y * velocity.Y);
|
||||
double startAngle = Math.Atan2(velocity.X, velocity.Y) - rotation / 2;
|
||||
double deltaAngle = rotation / (float)numProj;
|
||||
double offsetAngle;
|
||||
|
||||
for (int i = 0; i < numProj; i++)
|
||||
{
|
||||
offsetAngle = startAngle + deltaAngle * i;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, baseSpeed * (float)Math.Sin(offsetAngle), baseSpeed * (float)Math.Cos(offsetAngle),
|
||||
ModContent.ProjectileType<CursorProjSplit>(), projectile.damage / 3, projectile.knockBack * 0.33f, projectile.owner, 0f, 0f);
|
||||
}
|
||||
|
||||
Main.PlaySound(SoundID.Item110, projectile.Center);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 452 B |
@@ -0,0 +1,263 @@
|
||||
using System;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class CursorProjSplit : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Aestheticus Crystal");
|
||||
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.extraUpdates = 1;
|
||||
projectile.alpha = 255;
|
||||
projectile.timeLeft = 300;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (projectile.alpha > 0)
|
||||
projectile.alpha -= 3;
|
||||
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
|
||||
float num29 = 5f;
|
||||
float num30 = 300f;
|
||||
float scaleFactor = 6f;
|
||||
Vector2 value7 = new Vector2(10f, 20f);
|
||||
float num31 = 1f;
|
||||
int num32 = 3 * projectile.MaxUpdates;
|
||||
int num33 = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
246,
|
||||
242,
|
||||
229,
|
||||
226,
|
||||
247
|
||||
});
|
||||
int num34 = 255;
|
||||
if (projectile.ai[1] == 0f)
|
||||
{
|
||||
projectile.ai[1] = 1f;
|
||||
projectile.localAI[0] = (float)-(float)Main.rand.Next(48);
|
||||
}
|
||||
else if (projectile.ai[1] == 1f && projectile.owner == Main.myPlayer)
|
||||
{
|
||||
if (projectile.alpha < 128)
|
||||
{
|
||||
int num35 = -1;
|
||||
float num36 = num30;
|
||||
for (int num37 = 0; num37 < 200; num37++)
|
||||
{
|
||||
if (Main.npc[num37].active && Main.npc[num37].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
Vector2 center3 = Main.npc[num37].Center;
|
||||
float num38 = Vector2.Distance(center3, projectile.Center);
|
||||
if (num38 < num36 && num35 == -1 && Collision.CanHitLine(projectile.Center, 1, 1, center3, 1, 1))
|
||||
{
|
||||
num36 = num38;
|
||||
num35 = num37;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (num36 < 4f)
|
||||
{
|
||||
projectile.Kill();
|
||||
return;
|
||||
}
|
||||
if (num35 != -1)
|
||||
{
|
||||
projectile.ai[1] = num29 + 1f;
|
||||
projectile.ai[0] = (float)num35;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (projectile.ai[1] > num29)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
int num39 = (int)projectile.ai[0];
|
||||
if (!Main.npc[num39].active || !Main.npc[num39].CanBeChasedBy(projectile, false))
|
||||
{
|
||||
projectile.ai[1] = 1f;
|
||||
projectile.ai[0] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.ToRotation();
|
||||
Vector2 vector6 = Main.npc[num39].Center - projectile.Center;
|
||||
if (vector6.Length() < 10f)
|
||||
{
|
||||
projectile.Kill();
|
||||
return;
|
||||
}
|
||||
if (vector6 != Vector2.Zero)
|
||||
{
|
||||
vector6.Normalize();
|
||||
vector6 *= scaleFactor;
|
||||
}
|
||||
float num40 = 30f;
|
||||
projectile.velocity = (projectile.velocity * (num40 - 1f) + vector6) / num40;
|
||||
}
|
||||
}
|
||||
if (projectile.ai[1] >= 1f && projectile.ai[1] < num29)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
if (projectile.ai[1] == num29)
|
||||
{
|
||||
projectile.ai[1] = 1f;
|
||||
}
|
||||
}
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] == 48f)
|
||||
{
|
||||
projectile.localAI[0] = 0f;
|
||||
}
|
||||
if (Main.rand.NextBool(12))
|
||||
{
|
||||
Vector2 value9 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default);
|
||||
int num44 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num34, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num44].velocity *= 0.1f;
|
||||
Main.dust[num44].position = projectile.Center + value9 * (float)projectile.width / 2f + projectile.velocity * 2f;
|
||||
Main.dust[num44].fadeIn = 0.9f;
|
||||
}
|
||||
if (Main.rand.NextBool(18))
|
||||
{
|
||||
Vector2 value10 = -Vector2.UnitX.RotatedByRandom(0.39269909262657166).RotatedBy((double)projectile.velocity.ToRotation(), default);
|
||||
int num46 = Dust.NewDust(projectile.position, projectile.width, projectile.height, 107, 0f, 0f, 155, default, 0.8f);
|
||||
Main.dust[num46].velocity *= 0.3f;
|
||||
Main.dust[num46].position = projectile.Center + value10 * (float)projectile.width / 2f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num46].fadeIn = 1.4f;
|
||||
}
|
||||
}
|
||||
if (Main.rand.NextBool(8))
|
||||
{
|
||||
Vector2 value11 = -Vector2.UnitX.RotatedByRandom(0.78539818525314331).RotatedBy((double)projectile.velocity.ToRotation(), default);
|
||||
int num48 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num33, 0f, 0f, 0, default, 1f);
|
||||
Main.dust[num48].velocity *= 0.3f;
|
||||
Main.dust[num48].noGravity = true;
|
||||
Main.dust[num48].position = projectile.Center + value11 * (float)projectile.width / 2f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[num48].fadeIn = 1.4f;
|
||||
}
|
||||
}
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Vector2 value13 = -Vector2.UnitX.RotatedByRandom(0.19634954631328583).RotatedBy((double)projectile.velocity.ToRotation(), default);
|
||||
int num50 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num34, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num50].velocity *= 0.3f;
|
||||
Main.dust[num50].position = projectile.Center + value13 * (float)projectile.width / 2f;
|
||||
Main.dust[num50].fadeIn = 1.2f;
|
||||
Main.dust[num50].scale = 1.5f;
|
||||
Main.dust[num50].noGravity = true;
|
||||
}
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.2f / 255f, (255 - projectile.alpha) * 0.2f / 255f, (255 - projectile.alpha) * 0.2f / 255f);
|
||||
int num154 = 14;
|
||||
int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 234, 0f, 0f, 100, default, 0.8f);
|
||||
Main.dust[num155].velocity *= 0.1f;
|
||||
Main.dust[num155].velocity += projectile.velocity * 0.5f;
|
||||
Main.dust[num155].noGravity = true;
|
||||
if (Main.rand.NextBool(12))
|
||||
{
|
||||
int num156 = 16;
|
||||
int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 159, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num157].velocity *= 0.25f;
|
||||
Main.dust[num157].velocity += projectile.velocity * 0.5f;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 2);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Vaporfied>(), 120);
|
||||
}
|
||||
|
||||
public override bool? CanHitNPC(NPC target)
|
||||
{
|
||||
return projectile.alpha < 128;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
int num47 = Utils.SelectRandom(Main.rand, new int[]
|
||||
{
|
||||
246,
|
||||
242,
|
||||
229,
|
||||
226,
|
||||
247
|
||||
});
|
||||
|
||||
int num48 = 187;
|
||||
int num49 = 234;
|
||||
int height = 50;
|
||||
float num50 = 1.2f;
|
||||
float num51 = 0.6f;
|
||||
float num52 = 1.5f;
|
||||
|
||||
Vector2 value3 = (projectile.rotation - 1.57079637f).ToRotationVector2();
|
||||
Vector2 value4 = value3 * projectile.velocity.Length() * (float)projectile.MaxUpdates;
|
||||
|
||||
Main.PlaySound(SoundID.Item14, projectile.Center);
|
||||
|
||||
int num3;
|
||||
for (int num53 = 0; num53 < 20; num53 = num3 + 1)
|
||||
{
|
||||
int num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num47, 0f, 0f, 200, default, num50);
|
||||
Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f;
|
||||
Main.dust[num54].noGravity = true;
|
||||
Dust dust = Main.dust[num54];
|
||||
dust.velocity.Y -= 6f;
|
||||
dust.velocity *= 3f;
|
||||
dust = Main.dust[num54];
|
||||
dust.velocity += value4 * Main.rand.NextFloat();
|
||||
num54 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num48, 0f, 0f, 100, default, num51);
|
||||
Main.dust[num54].position = projectile.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)projectile.width / 2f;
|
||||
dust = Main.dust[num54];
|
||||
dust.velocity.Y -= 6f;
|
||||
dust.velocity *= 2f;
|
||||
Main.dust[num54].noGravity = true;
|
||||
Main.dust[num54].fadeIn = 1f;
|
||||
Main.dust[num54].color = Color.Cyan * 0.5f;
|
||||
dust = Main.dust[num54];
|
||||
dust.velocity += value4 * Main.rand.NextFloat();
|
||||
num3 = num53;
|
||||
}
|
||||
|
||||
for (int num55 = 0; num55 < 10; num55 = num3 + 1)
|
||||
{
|
||||
int num56 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, num49, 0f, 0f, 0, default, num52);
|
||||
Main.dust[num56].position = projectile.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)projectile.velocity.ToRotation(), default) * (float)projectile.width / 3f;
|
||||
Dust dust = Main.dust[num56];
|
||||
dust.noGravity = true;
|
||||
dust.velocity.Y -= 6f;
|
||||
dust.velocity *= 0.5f;
|
||||
dust = Main.dust[num56];
|
||||
dust.velocity += value4 * (0.6f + 0.6f * Main.rand.NextFloat());
|
||||
num3 = num55;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 452 B |
@@ -171,7 +171,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
|
||||
// Three death lasers (aka "Nebula Shots") swarm the target.
|
||||
int laserID = ModContent.ProjectileType<NebulaShot>();
|
||||
int laserDamage = (int)(0.2f * GalaxySmasherMelee.BaseDamage);
|
||||
int laserDamage = (int)(0.2f * projectile.damage);
|
||||
float laserKB = 2.5f;
|
||||
int numLasers = 3;
|
||||
for (int i = 0; i < numLasers; ++i)
|
||||
|
||||
@@ -30,7 +30,9 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.alpha -= 5;
|
||||
if (projectile.alpha > 0)
|
||||
projectile.alpha -= 5;
|
||||
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
if (projectile.owner == Main.myPlayer && projectile.timeLeft <= 3)
|
||||
{
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
private void SpawnEnergyBlade()
|
||||
{
|
||||
int bladeID = ModContent.ProjectileType<NanoblackSplit>();
|
||||
int bladeDamage = NanoblackReaperMelee.BaseDamage / 5;
|
||||
int bladeDamage = projectile.damage / 5;
|
||||
float bladeKB = 3f;
|
||||
float spin = (projectile.direction <= 0) ? -1f : 1f;
|
||||
float d = 16f;
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace CalamityMod.Projectiles.Typeless
|
||||
projectile.netUpdate = true;
|
||||
|
||||
int numFlares = 2;
|
||||
int flareDamage = (int)(0.3f * StellarContemptMelee.BaseDamage);
|
||||
int flareDamage = (int)(0.3f * projectile.damage);
|
||||
float flareKB = 4f;
|
||||
for (int i = 0; i < numFlares; ++i)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
public class TerraDiskProjectile : 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 = 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 = 52;
|
||||
}
|
||||
|
||||
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, 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.0 KiB |
@@ -0,0 +1,45 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Typeless
|
||||
{
|
||||
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 = 52;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 487 B |