added Alula Australis

also cleaned up some eclipse's fall code
This commit is contained in:
termigator1359 committed 2020-05-16 12:05:50 -04:00
1 parent 1ebb586bf5
commit cf678633d8
10 files changed
+205 -41

No files matched your search

+2
View File
@@ -6,6 +6,7 @@ using CalamityMod.Items.PermanentBoosters;
using CalamityMod.Items.Potions;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.NPCs.AstrumAureus;
@@ -50,6 +51,7 @@ namespace CalamityMod.Items.TreasureBags
// Weapons
DropHelper.DropItemChance(player, ModContent.ItemType<Nebulash>(), 3);
DropHelper.DropItemChance(player, ModContent.ItemType<AuroraBlazer>(), 3);
DropHelper.DropItemChance(player, ModContent.ItemType<AlulaAustralis>(), 3);
DropHelper.DropItemChance(player, ModContent.ItemType<BorealisBomber>(), 3);
DropHelper.DropItemChance(player, ModContent.ItemType<AuroradicalThrow>(), 3);
+44
View File
@@ -0,0 +1,44 @@
using CalamityMod.Projectiles.Magic;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Magic
{
public class AlulaAustralis : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Alula Australis");
Tooltip.SetDefault("Fires a beautiful aurora trailed by a star shower");
Item.staff[item.type] = true;
}
public override void SetDefaults()
{
item.damage = 60;
item.magic = true;
item.mana = 12;
item.width = 52;
item.height = 52;
item.useTime = 17;
item.useAnimation = 17;
item.useStyle = 5;
item.noMelee = true;
item.knockBack = 3f;
item.value = Item.buyPrice(0, 60, 0, 0);
item.rare = 7;
item.UseSound = SoundID.Item9;
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<AuroraAustralis>();
item.shootSpeed = 13f;
}
public override Vector2? HoldoutOrigin()
{
return new Vector2(15, 15);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 901 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<AuroradicalThrow>(), 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<AlulaAustralis>(), 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
@@ -9,6 +9,7 @@ using CalamityMod.Items.Potions;
using CalamityMod.Items.TreasureBags;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Items.Weapons.Ranged;
using CalamityMod.Items.Weapons.Magic;
using CalamityMod.Items.Weapons.Summon;
using CalamityMod.Items.Weapons.Rogue;
using CalamityMod.NPCs.TownNPCs;
@@ -360,6 +361,7 @@ namespace CalamityMod.NPCs.AstrumAureus
// Weapons
DropHelper.DropItemChance(npc, ModContent.ItemType<Nebulash>(), 4);
DropHelper.DropItemChance(npc, ModContent.ItemType<AuroraBlazer>(), 4);
DropHelper.DropItemChance(npc, ModContent.ItemType<AlulaAustralis>(), 4);
DropHelper.DropItemChance(npc, ModContent.ItemType<BorealisBomber>(), 4);
DropHelper.DropItemChance(npc, ModContent.ItemType<AuroradicalThrow>(), 4);
+124
View File
@@ -0,0 +1,124 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Magic
{
public class AuroraAustralis : ModProjectile
{
private static float CosFrequency = 0.05f;
private static float CosAmplitude = 0.008f;
private static float RotationIncrement = 0.26f;
public int[] dustTypes = new int[]
{
ModContent.DustType<AstralBlue>(),
ModContent.DustType<AstralOrange>()
};
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Aurora Australis");
}
public override void SetDefaults()
{
projectile.width = 10;
projectile.height = 10;
projectile.friendly = true;
projectile.penetrate = 1;
projectile.tileCollide = false;
projectile.timeLeft = 300;
projectile.magic = true;
projectile.alpha = 255;
CosFrequency = 0.15f;
CosAmplitude = 0.06f;
RotationIncrement = 0.26f;
}
public override void AI()
{
// On-spawn effects
if (projectile.ai[0] == 0)
{
// Store the X and Y of the spawn velocity so it can be used for trig calculations
projectile.localAI[0] = projectile.velocity.X;
projectile.localAI[1] = projectile.velocity.Y;
}
// Doesn't collide with tiles for the first 2 frames
projectile.tileCollide = projectile.ai[0] > 2f;
// Apply fancy cosine movement, then slight gravity, then cap velocity.
// Original velocity is reconstructed so that it can be used in the calculation
Vector2 originalVelocity = new Vector2(projectile.localAI[0], projectile.localAI[1]);
ApplyCosVelocity(originalVelocity);
float currentSpeed = projectile.velocity.Length();
float maxSpeed = 1.4f * originalVelocity.Length();
if (currentSpeed > maxSpeed)
projectile.velocity *= maxSpeed / currentSpeed;
// spawn dust
if (Main.rand.NextBool(5))
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.Next(dustTypes), projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
int rainbow = Dust.NewDust(projectile.Center, projectile.width, projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1f);
Dust dust = Main.dust[rainbow];
dust.velocity *= 0.1f;
dust.velocity += projectile.velocity * 0.2f;
dust.position.X = projectile.Center.X + 4f + Main.rand.Next(-2, 3);
dust.position.Y = projectile.Center.Y + Main.rand.Next(-2, 3);
dust.noGravity = true;
if (projectile.timeLeft % 10 == 0 && Main.myPlayer == projectile.owner) //spawn stars every 10 ticks
{
if (Main.player[projectile.owner].ownedProjectileCounts[ModContent.ProjectileType<AstralStarMagic>()] < 30)
{
float dmgKBMult = Main.rand.NextFloat(0.25f, 0.75f);
float xStart = projectile.Center.X + projectile.velocity.X;
float yStart = projectile.Center.Y - Main.rand.Next(500, 800);
Vector2 startPos = new Vector2(xStart, yStart);
Vector2 velocity = projectile.Center - startPos;
velocity.X += (float)Main.rand.Next(-100, 101);
float travelDist = velocity.Length();
float starSpeed = Main.rand.NextFloat(10f, 20f);
travelDist = starSpeed / travelDist;
velocity.X *= travelDist;
velocity.Y *= travelDist;
int star = Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType<AstralStarMagic>(), (int)(projectile.damage * dmgKBMult), projectile.knockBack * dmgKBMult, projectile.owner, 0f, 0f);
Main.projectile[star].timeLeft = 120;
}
}
projectile.ai[0]++;
}
private void ApplyCosVelocity(Vector2 baseVelocity)
{
float radians = -(-MathHelper.PiOver2 + CosFrequency * projectile.ai[0]);
projectile.velocity += CosAmplitude * baseVelocity.RotatedBy(radians);
}
public override void Kill(int timeLeft)
{
for (int i = 0; i <= 5; i++)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, Main.rand.Next(dustTypes), projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
}
}
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);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

+9 -13
View File
@@ -11,6 +11,12 @@ namespace CalamityMod.Projectiles.Rogue
{
public class AuroradicalSplitter : ModProjectile
{
public int[] dustTypes = new int[]
{
ModContent.DustType<AstralBlue>(),
ModContent.DustType<AstralOrange>()
};
public override string Texture => "CalamityMod/Projectiles/Rogue/AuroradicalStar";
public override void SetStaticDefaults()
@@ -62,12 +68,7 @@ namespace CalamityMod.Projectiles.Rogue
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);
int astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(dustTypes), 0f, 0f, 100, default, 0.8f);
Main.dust[astral].noGravity = true;
Main.dust[astral].velocity *= 0f;
}
@@ -106,18 +107,13 @@ namespace CalamityMod.Projectiles.Rogue
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);
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(dustTypes), 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);
int astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(dustTypes), 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);
+9 -13
View File
@@ -11,6 +11,12 @@ namespace CalamityMod.Projectiles.Rogue
{
public class AuroradicalStar : ModProjectile
{
public int[] dustTypes = new int[]
{
ModContent.DustType<AstralBlue>(),
ModContent.DustType<AstralOrange>()
};
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Auroradical Star");
@@ -58,12 +64,7 @@ namespace CalamityMod.Projectiles.Rogue
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);
int astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(dustTypes), 0f, 0f, 100, default, 0.8f);
Main.dust[astral].noGravity = true;
Main.dust[astral].velocity *= 0f;
}
@@ -160,18 +161,13 @@ namespace CalamityMod.Projectiles.Rogue
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);
Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(dustTypes), 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);
int astral = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, Main.rand.Next(dustTypes), 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);
+14 -14
View File
@@ -36,24 +36,24 @@ namespace CalamityMod.Projectiles.Rogue
{
if (projectile.timeLeft % 5 == 0) //congrats Pinkie... every 5 ticks
{
if (Main.rand.NextBool(2))
if (Main.rand.NextBool(2) && Main.myPlayer == projectile.owner)
{
float dmgKBMult = Main.rand.NextFloat(0.32f, 0.56f);
int spearAmt = Main.rand.Next(1, 4); //1 to 3 spears
for (int n = 0; n < spearAmt; n++)
{
float x = projectile.position.X + (float)Main.rand.Next(-400, 400);
float y = projectile.position.Y - (float)Main.rand.Next(500, 800);
Vector2 vector = new Vector2(x, y);
float num13 = projectile.position.X + (float)(projectile.width / 2) - vector.X;
float num14 = projectile.position.Y + (float)(projectile.height / 2) - vector.Y;
num13 += (float)Main.rand.Next(-100, 101);
int num15 = 29;
float num16 = (float)Math.Sqrt((double)(num13 * num13 + num14 * num14));
num16 = (float)num15 / num16;
num13 *= num16;
num14 *= num16;
Projectile.NewProjectile(x, y, num13, num14, ModContent.ProjectileType<EclipsesSmol>(), (int)(projectile.damage * Main.rand.NextFloat(0.32f, 0.56f)), projectile.knockBack * Main.rand.NextFloat(0.32f, 0.56f), projectile.owner, 0f, 0f);
} //very complicated and painful
float xStart = projectile.position.X + Main.rand.Next(-400, 400);
float yStart = projectile.position.Y - Main.rand.Next(500, 800);
Vector2 startPos = new Vector2(xStart, yStart);
Vector2 velocity = projectile.Center - startPos;
velocity.X += (float)Main.rand.Next(-100, 101);
float travelDist = velocity.Length();
float starSpeed = 29f;
travelDist = starSpeed / travelDist;
velocity.X *= travelDist;
velocity.Y *= travelDist;
Projectile.NewProjectile(startPos, velocity, ModContent.ProjectileType<EclipsesSmol>(), (int)(projectile.damage * dmgKBMult), projectile.knockBack * dmgKBMult, projectile.owner, 0f, 0f);
}
}
}
if (projectile.ai[0] == 0f)