added auroradical throw

This commit is contained in:
termigator1359 committed 2020-05-15 21:52:16 -04:00
1 parent 4768aedda4
commit 1ebb586bf5
8 files changed
+379 -1

No files matched your search

+2
View File
@@ -7,6 +7,7 @@ using CalamityMod.Items.Potions;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.NPCs.AstrumAureus;
using CalamityMod.World;
using Terraria;
@@ -50,6 +51,7 @@ namespace CalamityMod.Items.TreasureBags
DropHelper.DropItemChance(player, ModContent.ItemType<Nebulash>(), 3);
DropHelper.DropItemChance(player, ModContent.ItemType<AuroraBlazer>(), 3);
DropHelper.DropItemChance(player, ModContent.ItemType<BorealisBomber>(), 3);
DropHelper.DropItemChance(player, ModContent.ItemType<AuroradicalThrow>(), 3);
// Equipment
DropHelper.DropItemCondition(player, ModContent.ItemType<SquishyBeanMount>(), CalamityWorld.revenge && NPC.downedMoonlord);
+54
View File
@@ -0,0 +1,54 @@
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Rogue
{
public class AuroradicalThrow : RogueWeapon
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Auroradical Throw");
Tooltip.SetDefault("Launches a star that splits after a short period of time\n" +
"Split stars home in on nearby enemies after a few seconds\n" +
"Stealth strikes summon a meteor upon enemy impact");
}
public override void SafeSetDefaults()
{
item.width = 34;
item.height = 58;
item.damage = 32;
item.noMelee = true;
item.noUseGraphic = true;
item.useAnimation = 30;
item.useStyle = 1;
item.useTime = 30;
item.knockBack = 6f;
item.UseSound = SoundID.Item117;
item.autoReuse = true;
item.value = Item.buyPrice(0, 60, 0, 0);
item.rare = 7;
item.shoot = ModContent.ProjectileType<AuroradicalSplitter>();
item.shootSpeed = 10f;
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 star = Projectile.NewProjectile(player.Center, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
Main.projectile[star].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable();
return false;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
Texture2D glowmask = Main.itemTexture[item.type];
Vector2 origin = new Vector2(glowmask.Width / 2f, glowmask.Height / 2f - 2f);
spriteBatch.Draw(glowmask, item.Center - Main.screenPosition, null, Color.White, rotation, origin, 1f, SpriteEffects.None, 0f);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 839 B

+1 -1
View File
@@ -357,7 +357,7 @@ namespace CalamityMod
BossDifficulty.TryGetValue("AstrumAureus", out float order);
int type = NPCType<AstrumAureus>();
int summon = ItemType<AstralChunk>();
List<int> loot = new List<int>() { ItemType<AstrageldonBag>(), ItemType<Stardust>(), ItemID.FallenStar, ItemType<Nebulash>(), ItemType<AuroraBlazer>(),ItemType<BorealisBomber>(), ItemType<GravistarSabaton>(), ItemType<AstralJelly>(), ItemID.HallowedKey, ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemType<StarlightFuelCell>(), ItemID.GreaterHealingPotion };
List<int> loot = new List<int>() { ItemType<AstrageldonBag>(), ItemType<Stardust>(), ItemID.FallenStar, ItemType<Nebulash>(), ItemType<AuroraBlazer>(), ItemType<BorealisBomber>(), ItemType<AuroradicalThrow>(), ItemType<GravistarSabaton>(), ItemType<AstralJelly>(), ItemID.HallowedKey, ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemType<StarlightFuelCell>(), ItemID.GreaterHealingPotion };
List<int> collection = new List<int>() { ItemType<AstrageldonTrophy>(), ItemType<AureusMask>(), ItemType<KnowledgeAstrumAureus>() };
string instructions = $"Use an [i:{summon}] at Night in the Astral Biome";
string despawn = CalamityUtils.ColorMessage("Astrum Aureus’ program has been executed. Initiate recall.", new Color(0xFF, 0xD7, 0x00));
+2
View File
@@ -10,6 +10,7 @@ using CalamityMod.Items.TreasureBags;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.NPCs.TownNPCs;
using CalamityMod.World;
using Microsoft.Xna.Framework;
@@ -360,6 +361,7 @@ namespace CalamityMod.NPCs.AstrumAureus
DropHelper.DropItemChance(npc, ModContent.ItemType<Nebulash>(), 4);
DropHelper.DropItemChance(npc, ModContent.ItemType<AuroraBlazer>(), 4);
DropHelper.DropItemChance(npc, ModContent.ItemType<BorealisBomber>(), 4);
DropHelper.DropItemChance(npc, ModContent.ItemType<AuroradicalThrow>(), 4);
// Vanity
DropHelper.DropItemChance(npc, ModContent.ItemType<AureusMask>(), 7);
+133
View File
@@ -0,0 +1,133 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
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.Rogue
{
public class AuroradicalSplitter : ModProjectile
{
public override string Texture => "CalamityMod/Projectiles/Rogue/AuroradicalStar";
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Auroradical Star");
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
public override void SetDefaults()
{
projectile.width = 50;
projectile.height = 50;
projectile.friendly = true;
projectile.ignoreWater = true;
projectile.tileCollide = false;
projectile.alpha = 100;
projectile.penetrate = -1;
projectile.timeLeft = 50;
projectile.Calamity().rogue = true;
projectile.localNPCHitCooldown = 10;
projectile.usesLocalNPCImmunity = true;
}
public override void AI()
{
//Rotation
projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction;
//Lighting
Lighting.AddLight(projectile.Center, 0.3f, 0.5f, 0.1f);
//sound effects
if (projectile.soundDelay == 0)
{
projectile.soundDelay = 20 + Main.rand.Next(40);
if (Main.rand.NextBool(5))
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9);
}
}
//Change the scale size a little bit to make it pulse in and out
float scaleAmt = (float)Main.mouseTextColor / 200f - 0.35f;
scaleAmt *= 0.2f;
projectile.scale = scaleAmt + 0.95f;
//Spawn dust
projectile.ai[0] += 1f;
if (projectile.ai[0] > 15f)
{
int dustType = Utils.SelectRandom(Main.rand, new int[]
{
ModContent.DustType<AstralBlue>(),
ModContent.DustType<AstralOrange>()
});
int astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 0.8f);
Main.dust[astral].noGravity = true;
Main.dust[astral].velocity *= 0f;
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, projectile.alpha);
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 180);
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 180);
}
public override void Kill(int timeLeft)
{
if (Main.myPlayer != projectile.owner)
return;
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9, 1f, 0f);
for (float i = 0; i < 5; i++)
{
float angle = MathHelper.TwoPi / 5f * i;
int star = Projectile.NewProjectile(projectile.Center, angle.ToRotationVector2() * 5f, ModContent.ProjectileType<AuroradicalStar>(), projectile.damage, projectile.knockBack, projectile.owner, 0f, 0f);
Main.projectile[star].Calamity().stealthStrike = projectile.Calamity().stealthStrike;
}
projectile.position = projectile.Center;
projectile.width = projectile.height = 96;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
int dustType = Utils.SelectRandom(Main.rand, new int[]
{
ModContent.DustType<AstralBlue>(),
ModContent.DustType<AstralOrange>()
});
for (int d = 0; d < 2; d++)
{
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1f);
}
for (int d = 0; d < 20; d++)
{
int astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1.5f);
Main.dust[astral].noGravity = true;
Main.dust[astral].velocity *= 3f;
astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 50, default, 1f);
Main.dust[astral].velocity *= 2f;
Main.dust[astral].noGravity = true;
}
for (int g = 0; g < 3; g++)
{
Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f);
}
}
}
}
+187
View File
@@ -0,0 +1,187 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
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.Rogue
{
public class AuroradicalStar : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Auroradical Star");
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
public override void SetDefaults()
{
projectile.width = 50;
projectile.height = 50;
projectile.friendly = true;
projectile.ignoreWater = true;
projectile.tileCollide = false;
projectile.alpha = 100;
projectile.penetrate = 1;
projectile.timeLeft = 485;
projectile.Calamity().rogue = true;
}
public override void AI()
{
//Rotation
projectile.rotation += (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y)) * 0.01f * (float)projectile.direction;
//Lighting
Lighting.AddLight(projectile.Center, 0.3f, 0.5f, 0.1f);
//sound effects
if (projectile.soundDelay == 0)
{
projectile.soundDelay = 20 + Main.rand.Next(40);
if (Main.rand.NextBool(5))
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9);
}
}
//Change the scale size a little bit to make it pulse in and out
float scaleAmt = (float)Main.mouseTextColor / 200f - 0.35f;
scaleAmt *= 0.2f;
projectile.scale = scaleAmt + 0.95f;
//Spawn dust
projectile.ai[0] += 1f;
if (projectile.ai[0] > 15f)
{
int dustType = Utils.SelectRandom(Main.rand, new int[]
{
ModContent.DustType<AstralBlue>(),
ModContent.DustType<AstralOrange>()
});
int astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 100, default, 0.8f);
Main.dust[astral].noGravity = true;
Main.dust[astral].velocity *= 0f;
}
//Home in
float maxDistance = 1600f;
int targetIndex = -1;
int i;
for (i = 0; i < Main.maxNPCs; i++)
{
if (Main.npc[i].CanBeChasedBy(projectile, false))
{
float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2);
if (Vector2.Distance(Main.npc[i].Center, projectile.Center) < (maxDistance + extraDistance))
{
targetIndex = i;
break;
}
}
}
if (targetIndex != -1)
{
Vector2 targetVec = Main.npc[i].Center - projectile.Center;
if (targetVec.Length() < 60f)
{
projectile.Kill();
return;
}
if (projectile.ai[0] >= 120f)
{
projectile.ai[1] += 1f;
if (projectile.ai[1] < 120f)
{
float speedMult = 25f;
targetVec.Normalize();
targetVec *= speedMult;
projectile.velocity = (projectile.velocity * 15f + targetVec) / 16f;
projectile.velocity.Normalize();
projectile.velocity *= speedMult;
}
else if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 18f)
{
projectile.velocity.X *= 1.01f;
projectile.velocity.Y *= 1.01f;
}
}
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, projectile.alpha);
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 180);
if (projectile.Calamity().stealthStrike && Main.myPlayer == projectile.owner)
{
Vector2 pos = new Vector2(target.Center.X + target.width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50));
Vector2 velocity = (target.Center - pos) / 40f;
int dmg = projectile.damage / 2;
int comet = Projectile.NewProjectile(pos, velocity, ModContent.ProjectileType<CometQuasherMeteor>(), dmg, projectile.knockBack, projectile.owner, 0f, 0f);
Main.projectile[comet].Calamity().forceRogue = true;
Main.projectile[comet].Calamity().lineColor = Main.rand.Next(3);;
}
}
public override void OnHitPvp(Player target, int damage, bool crit)
{
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 180);
if (projectile.Calamity().stealthStrike && Main.myPlayer == projectile.owner)
{
Vector2 pos = new Vector2(target.Center.X + target.width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50));
Vector2 velocity = (target.Center - pos) / 40f;
int dmg = projectile.damage / 2;
int comet = Projectile.NewProjectile(pos, velocity, ModContent.ProjectileType<CometQuasherMeteor>(), dmg, projectile.knockBack, projectile.owner, 0f, 0f);
Main.projectile[comet].Calamity().forceRogue = true;
Main.projectile[comet].Calamity().lineColor = Main.rand.Next(3);;
}
}
public override void Kill(int timeLeft)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 9, 1f, 0f);
projectile.position = projectile.Center;
projectile.width = projectile.height = 96;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
projectile.localNPCHitCooldown = 10;
projectile.usesLocalNPCImmunity = true;
projectile.Damage();
int dustType = Utils.SelectRandom(Main.rand, new int[]
{
ModContent.DustType<AstralBlue>(),
ModContent.DustType<AstralOrange>()
});
for (int d = 0; d < 2; d++)
{
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 50, default, 1f);
}
for (int d = 0; d < 20; d++)
{
int astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, dustType, 0f, 0f, 0, default, 1.5f);
Main.dust[astral].noGravity = true;
Main.dust[astral].velocity *= 3f;
astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 173, 0f, 0f, 50, default, 1f);
Main.dust[astral].velocity *= 2f;
Main.dust[astral].noGravity = true;
}
for (int g = 0; g < 3; g++)
{
Gore.NewGore(projectile.position, new Vector2(projectile.velocity.X * 0.05f, projectile.velocity.Y * 0.05f), Main.rand.Next(16, 18), 1f);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B