Brimmy summon
This commit is contained in:
1 parent
5826f80a27
commit
015abc5fbf
15 files changed
+578
-1
No files matched your search
@@ -0,0 +1,36 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Buffs.Summon
|
||||
{
|
||||
public class DormantBrimseekerBuff : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Dormant Brimseeker");
|
||||
Description.SetDefault("Does it want something from you?");
|
||||
Main.buffNoTimeDisplay[Type] = true;
|
||||
Main.buffNoSave[Type] = true;
|
||||
}
|
||||
|
||||
public override void Update(Player player, ref int buffIndex)
|
||||
{
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
if (player.ownedProjectileCounts[ModContent.ProjectileType<DormantBrimseekerBab>()] > 0)
|
||||
{
|
||||
modPlayer.brimseeker = true;
|
||||
}
|
||||
if (!modPlayer.brimseeker)
|
||||
{
|
||||
player.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.buffTime[buffIndex] = 18000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 584 B |
@@ -6,6 +6,7 @@ using CalamityMod.Items.Mounts;
|
||||
using CalamityMod.Items.Pets;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.NPCs.BrimstoneElemental;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
@@ -51,6 +52,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
// Weapons
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<Brimlance>(), 3);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<SeethingDischarge>(), 3);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<DormantBrimseeker>(), 3);
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItem(player, ModContent.ItemType<Abaddon>());
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Summon
|
||||
{
|
||||
public class DormantBrimseeker : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Dormant Brimseeker");
|
||||
Tooltip.SetDefault("Summons a brimseeker to keep you company\n" +
|
||||
"'You could’ve sworn that they turned even scarier when you looked at their reflections in a mirror'");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 97;
|
||||
item.mana = 12;
|
||||
item.width = item.height = 32;
|
||||
item.useTime = item.useAnimation = 25;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.noMelee = true;
|
||||
item.noUseGraphic = true;
|
||||
item.knockBack = 3f;
|
||||
item.UseSound = SoundID.Item20;
|
||||
item.autoReuse = true;
|
||||
item.shoot = ModContent.ProjectileType<DormantBrimseekerSummoner>();
|
||||
item.shootSpeed = 10f;
|
||||
item.summon = true;
|
||||
|
||||
item.value = Item.buyPrice(0, 36, 0, 0);
|
||||
item.rare = 5;
|
||||
}
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
float totalSlots = 0f;
|
||||
for (int i = 0; i < Main.projectile.Length; i++)
|
||||
{
|
||||
if (Main.projectile[i].minion && Main.projectile[i].active && Main.projectile[i].owner == player.whoAmI)
|
||||
{
|
||||
totalSlots += Main.projectile[i].minionSlots;
|
||||
}
|
||||
}
|
||||
if (totalSlots < player.maxMinions)
|
||||
{
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), type, damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
else if (player.ownedProjectileCounts[ModContent.ProjectileType<DormantBrimseekerAura>()] <= 0f)
|
||||
{
|
||||
Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<DormantBrimseekerAura>(), damage, knockBack, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 650 B |
@@ -273,7 +273,7 @@ namespace CalamityMod
|
||||
BossDifficulty.TryGetValue("BrimstoneElemental", out float order);
|
||||
int type = NPCType<BrimstoneElemental>();
|
||||
int summon = ItemType<CharredIdol>();
|
||||
List<int> loot = new List<int>() { ItemType<BrimstoneWaifuBag>(), ItemID.SoulofFright, ItemType<EssenceofChaos>(), ItemType<Bloodstone>(), ItemType<Brimlance>(), ItemType<SeethingDischarge>(), ItemType<Abaddon>(), ItemType<RoseStone>(), ItemType<Gehenna>(), ItemType<Brimrose>(), ItemID.GreaterHealingPotion };
|
||||
List<int> loot = new List<int>() { ItemType<BrimstoneWaifuBag>(), ItemID.SoulofFright, ItemType<EssenceofChaos>(), ItemType<Bloodstone>(), ItemType<Brimlance>(), ItemType<DormantBrimseeker>(), ItemType<SeethingDischarge>(), ItemType<Abaddon>(), ItemType<RoseStone>(), ItemType<Gehenna>(), ItemType<Brimrose>(), ItemID.GreaterHealingPotion };
|
||||
List<int> collection = new List<int>() { ItemType<BrimstoneElementalTrophy>(), ItemType<BrimstoneWaifuMask>(), ItemType<KnowledgeBrimstoneCrag>(), ItemType<KnowledgeBrimstoneElemental>(), ItemType<CharredRelic>() };
|
||||
string instructions = $"Use a [i:{summon}] in the Brimstone Crag";
|
||||
string despawn = CalamityUtils.ColorMessage("Brimstone Elemental withdraws to the ruins of her shrine.", new Color(0xDC, 0x14, 0x3C));
|
||||
@@ -741,6 +741,7 @@ namespace CalamityMod
|
||||
sAssociation.Call("AddMinionInfo", ItemType<ForgottenApexWand>(), BuffType<ApexSharkBuff>(), ProjectileType<ApexShark>());
|
||||
sAssociation.Call("AddMinionInfo", ItemType<DeepseaStaff>(), BuffType<AquaticStar>(), ProjectileType<AquaticStarMinion>());
|
||||
sAssociation.Call("AddMinionInfo", ItemType<SunGodStaff>(), BuffType<SolarSpiritGod>(), ProjectileType<SolarGod>());
|
||||
sAssociation.Call("AddMinionInfo", ItemType<DormantBrimseeker>(), BuffType<DormantBrimseekerBuff>(), ProjectileType<DormantBrimseekerBab>());
|
||||
sAssociation.Call("AddMinionInfo", ItemType<IgneousExaltation>(), BuffType<IgneousExaltationBuff>(), ProjectileType<IgneousBlade>());
|
||||
sAssociation.Call("AddMinionInfo", ItemType<BlightedEyeStaff>(), BuffType<CalamitasEyes>(), new List<int>() { ProjectileType<Calamitamini>(), ProjectileType<Cataclymini>(), ProjectileType<Catastromini>()}, new List<float>() {1f-0.6666666f, 0.3333333f, 0.3333333f});
|
||||
//Entropy's Vigil is a bruh moment
|
||||
|
||||
@@ -9,6 +9,7 @@ using CalamityMod.Items.Placeables.Furniture.Trophies;
|
||||
using CalamityMod.Items.TreasureBags;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.Projectiles.Boss;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -192,6 +193,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
|
||||
// Weapons
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<Brimlance>(), 4);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<SeethingDischarge>(), 4);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<DormantBrimseeker>(), 4);
|
||||
|
||||
// Equipment
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<RoseStone>(), 10);
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class BrimseekerAuraBall : ModProjectile
|
||||
{
|
||||
public static float MovementSpeed = 4f;
|
||||
public static float RotationalSpeed = 0.08f;
|
||||
public bool initialized = false;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Seeker");
|
||||
ProjectileID.Sets.MinionShot[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 8;
|
||||
projectile.height = 8;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.minion = true;
|
||||
projectile.minionSlots = 0f;
|
||||
projectile.tileCollide = false;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
if (!initialized)
|
||||
{
|
||||
projectile.rotation = Main.rand.NextFloat(0f, MathHelper.TwoPi);
|
||||
projectile.localAI[1] = Main.rand.NextFloat(-RotationalSpeed, RotationalSpeed);
|
||||
initialized = true;
|
||||
}
|
||||
projectile.tileCollide = false;
|
||||
|
||||
Projectile parent = Main.projectile[(int)projectile.ai[0]];
|
||||
|
||||
if (parent.active)
|
||||
{
|
||||
Vector2 positionDelta = new Vector2(0, projectile.localAI[0]);
|
||||
positionDelta = positionDelta.RotatedBy(projectile.rotation);
|
||||
|
||||
projectile.Center = parent.Center + positionDelta;
|
||||
projectile.rotation += projectile.localAI[1];
|
||||
|
||||
if (projectile.timeLeft % 200 / MovementSpeed < 100 / MovementSpeed)
|
||||
{
|
||||
projectile.localAI[0] += MovementSpeed;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.localAI[0] -= MovementSpeed;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
|
||||
int dust = Dust.NewDust(projectile.position, projectile.width, projectile.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[dust].noGravity = true;
|
||||
Main.dust[dust].velocity.Y = -0.15f;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 240);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 240);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 191 B |
@@ -0,0 +1,115 @@
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class DormantBrimseekerAura : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Dormant Brimseeker Aura Projecter");
|
||||
ProjectileID.Sets.MinionShot[projectile.type] = true;
|
||||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.friendly = true;
|
||||
projectile.width = 30;
|
||||
projectile.height = 30;
|
||||
projectile.minion = true;
|
||||
projectile.minionSlots = 0f;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.rotation = projectile.rotation.AngleLerp(-MathHelper.PiOver4, 0.045f);
|
||||
projectile.velocity *= 0.975f;
|
||||
if (Math.Abs(projectile.rotation + MathHelper.PiOver4) < 0.04f)
|
||||
{
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
Main.PlaySound(SoundID.DD2_EtherianPortalOpen, projectile.Center);
|
||||
for (int i = 0; i < 30; i++)
|
||||
{
|
||||
float angle = 1.4f * (i / 30f) - 0.7f;
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.Brimstone);
|
||||
dust.velocity = new Vector2(0f, -14f).RotatedBy(angle);
|
||||
dust.noGravity = true;
|
||||
}
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
float angle = 2.4f * (i / 50f) - 1.2f;
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.Brimstone);
|
||||
dust.velocity = new Vector2(0f, 8f).RotatedBy(angle);
|
||||
}
|
||||
projectile.timeLeft = 820;
|
||||
projectile.localAI[0] = 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (projectile.localAI[1] < 400f)
|
||||
{
|
||||
projectile.localAI[1] += 6f;
|
||||
}
|
||||
projectile.ai[1] += MathHelper.ToRadians(1.2f);
|
||||
for (int i = 0; i < 85; i++)
|
||||
{
|
||||
float angle = MathHelper.TwoPi / 85f * i + projectile.ai[1];
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center + angle.ToRotationVector2() * projectile.localAI[1], (int)CalamityDusts.Brimstone);
|
||||
dust.noGravity = true;
|
||||
dust.velocity = Vector2.Zero;
|
||||
if (Main.rand.NextBool(360))
|
||||
dust.scale = 1.5f;
|
||||
}
|
||||
for (int i = 0; i < Main.projectile.Length; i++)
|
||||
{
|
||||
if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType<DormantBrimseekerBab>() &&
|
||||
Main.projectile[i].owner == projectile.owner && Main.projectile[i].localAI[1] == 0f)
|
||||
{
|
||||
if (Main.projectile[i].Distance(projectile.Center) < projectile.localAI[1])
|
||||
{
|
||||
for (int j = 0; j < 30; j++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(Main.projectile[i].Center, (int)CalamityDusts.Brimstone);
|
||||
dust.velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 7f;
|
||||
}
|
||||
Main.projectile[i].localAI[1] = 1f;
|
||||
Main.PlaySound(SoundID.Item45, Main.projectile[i].Center);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Main.rand.NextBool(50))
|
||||
{
|
||||
int idx = Projectile.NewProjectile(projectile.Center, Vector2.Zero, ModContent.ProjectileType<BrimseekerAuraBall>(), 120,
|
||||
3f, projectile.owner, projectile.whoAmI);
|
||||
Main.projectile[idx].timeLeft = projectile.timeLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
for (int i = 0; i < Main.projectile.Length; i++)
|
||||
{
|
||||
if (Main.projectile[i].active && Main.projectile[i].type == ModContent.ProjectileType<DormantBrimseekerBab>() &&
|
||||
Main.projectile[i].owner == projectile.owner && Main.projectile[i].localAI[1] == 1f)
|
||||
{
|
||||
for (int j = 0; j < 30; j++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.Brimstone);
|
||||
dust.velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 7f;
|
||||
}
|
||||
Main.PlaySound(SoundID.Item29, Main.projectile[i].Center);
|
||||
Main.projectile[i].localAI[1] = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 650 B |
@@ -0,0 +1,227 @@
|
||||
using CalamityMod.Buffs.Summon;
|
||||
using CalamityMod.CalPlayer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class DormantBrimseekerBab : ModProjectile
|
||||
{
|
||||
public const float DistanceToCheck = 1600f;
|
||||
public const float TurnTime = 25f;
|
||||
public bool SeekingTarget = false;
|
||||
public float MaxChargeTime
|
||||
{
|
||||
get
|
||||
{
|
||||
return (projectile.localAI[1] == 1f) ? 21 : 38;
|
||||
}
|
||||
}
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Dormant Brimseeker");
|
||||
|
||||
Main.projFrames[projectile.type] = 8;
|
||||
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 7;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 2;
|
||||
|
||||
ProjectileID.Sets.MinionSacrificable[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 46;
|
||||
projectile.height = 36;
|
||||
projectile.netImportant = true;
|
||||
projectile.friendly = true;
|
||||
projectile.minion = true;
|
||||
projectile.minionSlots = 1f;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 18000;
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = false;
|
||||
projectile.timeLeft *= 5;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 6;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Player player = Main.player[projectile.owner];
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
projectile.Calamity().spawnedPlayerMinionDamageValue = player.MinionDamage();
|
||||
projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage;
|
||||
projectile.localAI[0] = 1f;
|
||||
}
|
||||
if (player.MinionDamage() != projectile.Calamity().spawnedPlayerMinionDamageValue)
|
||||
{
|
||||
int trueDamage = (int)(projectile.Calamity().spawnedPlayerMinionProjectileDamageValue /
|
||||
projectile.Calamity().spawnedPlayerMinionDamageValue *
|
||||
player.MinionDamage());
|
||||
projectile.damage = trueDamage;
|
||||
}
|
||||
bool isProperProjectile = projectile.type == ModContent.ProjectileType<DormantBrimseekerBab>();
|
||||
player.AddBuff(ModContent.BuffType<DormantBrimseekerBuff>(), 3600);
|
||||
if (isProperProjectile)
|
||||
{
|
||||
if (player.dead)
|
||||
{
|
||||
modPlayer.brimseeker = false;
|
||||
}
|
||||
if (modPlayer.brimseeker)
|
||||
{
|
||||
projectile.timeLeft = 2;
|
||||
}
|
||||
}
|
||||
|
||||
NPC potentialTarget = projectile.Center.MinionHoming(DistanceToCheck, player);
|
||||
if (potentialTarget == null)
|
||||
{
|
||||
projectile.rotation = projectile.rotation.AngleTowards(0f, 0.1f);
|
||||
projectile.direction = projectile.spriteDirection = (projectile.velocity.X < 0).ToDirectionInt();
|
||||
projectile.ai[1] += MathHelper.ToRadians(3f);
|
||||
if (projectile.ai[1] >= MathHelper.Pi * 4f)
|
||||
{
|
||||
projectile.ai[1] = 0f;
|
||||
}
|
||||
Vector2 destination = player.Center + projectile.ai[1].ToRotationVector2() * new Vector2(1f, (float)Math.Cos(projectile.ai[1])) * 200f;
|
||||
|
||||
projectile.velocity = (projectile.velocity * 18f + projectile.DirectionTo(destination) * 14f) / 20f;
|
||||
|
||||
projectile.frameCounter++;
|
||||
if (projectile.frameCounter >= 6)
|
||||
{
|
||||
projectile.frameCounter = 0;
|
||||
projectile.frame++;
|
||||
}
|
||||
if (projectile.frame >= 4 + (projectile.localAI[1] == 1f).ToInt() * 4)
|
||||
{
|
||||
projectile.frame = (projectile.localAI[1] == 1f).ToInt() * 4;
|
||||
}
|
||||
|
||||
float acceleration = 0.1f;
|
||||
for (int index = 0; index < Main.projectile.Length; index++)
|
||||
{
|
||||
Projectile proj = Main.projectile[index];
|
||||
if (index != projectile.whoAmI &&
|
||||
proj.active && proj.owner == projectile.owner &&
|
||||
proj.type == projectile.type && Math.Abs(projectile.position.X - proj.position.X) + Math.Abs(projectile.position.Y - proj.position.Y) < projectile.width)
|
||||
{
|
||||
if (projectile.position.X < proj.position.X)
|
||||
{
|
||||
projectile.velocity.X -= acceleration;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.X += acceleration;
|
||||
}
|
||||
if (projectile.position.Y < proj.position.Y)
|
||||
{
|
||||
projectile.velocity.Y -= acceleration;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.velocity.Y += acceleration;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (projectile.Distance(potentialTarget.Center) < 1100f && projectile.ai[0] == 0f)
|
||||
{
|
||||
Main.PlaySound(SoundID.DD2_DrakinShot, projectile.Center);
|
||||
projectile.ai[0]++;
|
||||
float acceleration = (projectile.localAI[1] == 1f) ? 1.6f : 0.8f;
|
||||
float minSpeed = (projectile.localAI[1] == 1f) ? 13f : 8f;
|
||||
float maxSpeed = (projectile.localAI[1] == 1f) ? 21f : 18f;
|
||||
projectile.velocity = projectile.DirectionTo(potentialTarget.Center) * MathHelper.Clamp(projectile.velocity.Length() + acceleration, minSpeed, maxSpeed);
|
||||
projectile.rotation = projectile.AngleTo(potentialTarget.Center) + (projectile.spriteDirection == 1).ToInt() * MathHelper.Pi;
|
||||
}
|
||||
else if (projectile.ai[0] > 0)
|
||||
{
|
||||
projectile.ai[0]++;
|
||||
SeekingTarget = false;
|
||||
}
|
||||
else if (projectile.Distance(potentialTarget.Center) >= 1100f)
|
||||
{
|
||||
projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(potentialTarget.Center) + (projectile.spriteDirection == 1).ToInt() * MathHelper.Pi, 0.1f);
|
||||
projectile.velocity = projectile.DirectionTo(potentialTarget.Center) * MathHelper.Clamp(projectile.velocity.Length() + 2f, 6f, 15f);
|
||||
SeekingTarget = true;
|
||||
projectile.ai[0] = 0f;
|
||||
}
|
||||
|
||||
if (projectile.ai[0] >= MaxChargeTime)
|
||||
{
|
||||
projectile.rotation = projectile.rotation.AngleTowards(projectile.AngleTo(potentialTarget.Center) + (projectile.spriteDirection == 1).ToInt() * MathHelper.Pi, 0.1f);
|
||||
}
|
||||
|
||||
projectile.frameCounter++;
|
||||
if (projectile.frameCounter >= 6)
|
||||
{
|
||||
projectile.frameCounter = 0;
|
||||
projectile.frame++;
|
||||
}
|
||||
if (projectile.frame >= 8)
|
||||
{
|
||||
projectile.frame = 4;
|
||||
}
|
||||
|
||||
if (projectile.ai[0] >= MaxChargeTime + TurnTime)
|
||||
projectile.ai[0] = 0f;
|
||||
}
|
||||
Lighting.AddLight(projectile.Center, Color.Red.ToVector3());
|
||||
}
|
||||
public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
if ((projectile.ai[0] > 0f && projectile.ai[0] <= MaxChargeTime && projectile.velocity.Length() >= 8f) || SeekingTarget)
|
||||
{
|
||||
Texture2D projectileTexture = ModContent.GetTexture(Texture);
|
||||
Texture2D flameTexture = Main.extraTexture[55];
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
if (projectile.spriteDirection == -1)
|
||||
spriteEffects = SpriteEffects.FlipHorizontally;
|
||||
|
||||
float completionRatio = projectile.ai[0] / 30f;
|
||||
if (projectile.ai[0] > 30f)
|
||||
completionRatio = 1f - (30f - projectile.ai[0]) / 30f;
|
||||
|
||||
Vector2 modifiedProjectileTexture = new Vector2(projectileTexture.Width / 2,projectileTexture.Height / Main.projFrames[projectile.type] / 2);
|
||||
for (int oldPositionDrawIndex = 6; oldPositionDrawIndex >= 0; oldPositionDrawIndex--)
|
||||
{
|
||||
Color drawColor = Color.Lerp(Color.LightGoldenrodYellow, new Color(142, 24, 67), completionRatio);
|
||||
drawColor = Color.Lerp(drawColor, new Color(142, 24, 67), oldPositionDrawIndex / 9.7f);
|
||||
drawColor.A = (byte)(64f * completionRatio);
|
||||
drawColor.R = (byte)(drawColor.R * (10 - oldPositionDrawIndex) / 20);
|
||||
drawColor.G = (byte)(drawColor.G * (10 - oldPositionDrawIndex) / 20);
|
||||
drawColor.B = (byte)(drawColor.B * (10 - oldPositionDrawIndex) / 20);
|
||||
drawColor.A = (byte)(drawColor.A * (10 - oldPositionDrawIndex) / 20);
|
||||
drawColor *= completionRatio;
|
||||
int yFrame = ((int)projectile.ai[0] / 2 - oldPositionDrawIndex) % 4;
|
||||
if (yFrame < 0)
|
||||
{
|
||||
yFrame += 4;
|
||||
}
|
||||
Rectangle flameFrameRectangle = flameTexture.Frame(1, 4, 0, yFrame);
|
||||
Vector2 flameOrigin = new Vector2(flameTexture.Width / 2, flameTexture.Height / 8 + 14);
|
||||
spriteBatch.Draw(flameTexture,
|
||||
new Vector2(projectile.oldPos[oldPositionDrawIndex].X - Main.screenPosition.X + projectile.width / 2 - projectileTexture.Width * projectile.scale / 2f + modifiedProjectileTexture.X * projectile.scale, projectile.oldPos[oldPositionDrawIndex].Y - Main.screenPosition.Y + projectile.height - projectileTexture.Height * projectile.scale / Main.projFrames[projectile.type] + 4f + modifiedProjectileTexture.Y * projectile.scale + projectile.gfxOffY),
|
||||
new Rectangle?(flameFrameRectangle),
|
||||
drawColor,
|
||||
projectile.oldRot[oldPositionDrawIndex] + projectile.oldSpriteDirection[oldPositionDrawIndex] * MathHelper.PiOver2,
|
||||
flameOrigin,
|
||||
MathHelper.Lerp(0.1f, 1.2f, (10f - oldPositionDrawIndex) / 10f),
|
||||
spriteEffects,
|
||||
0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
@@ -0,0 +1,54 @@
|
||||
using CalamityMod.Dusts;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class DormantBrimseekerSummoner : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Dormant Brimseeker");
|
||||
ProjectileID.Sets.MinionShot[projectile.type] = true;
|
||||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.friendly = true;
|
||||
projectile.width = 30;
|
||||
projectile.height = 30;
|
||||
projectile.minion = true;
|
||||
projectile.minionSlots = 0f;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.rotation = projectile.rotation.AngleLerp(-MathHelper.PiOver4, 0.045f);
|
||||
projectile.velocity *= 0.975f;
|
||||
if (projectile.ai[0]++ == 110f)
|
||||
{
|
||||
Main.PlaySound(SoundID.Item100, projectile.Center);
|
||||
}
|
||||
if (projectile.ai[0]++ >= 90f)
|
||||
{
|
||||
for (int i = 0; i < (180 - (int)projectile.ai[0]) / 2; i++)
|
||||
{
|
||||
Dust dust = Dust.NewDustPerfect(projectile.Center, (int)CalamityDusts.Brimstone);
|
||||
dust.velocity = Vector2.One.RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(1f, 4f);
|
||||
dust.noGravity = true;
|
||||
}
|
||||
projectile.alpha = (int)(255 * (projectile.ai[0] - 90f) / 90f);
|
||||
}
|
||||
if (projectile.ai[0] >= 180f)
|
||||
{
|
||||
Projectile.NewProjectile(projectile.Center, Vector2.UnitY * 7f, ModContent.ProjectileType<DormantBrimseekerBab>(), projectile.damage, projectile.knockBack,
|
||||
projectile.owner);
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 650 B |
Reference in new issue
Block a user