added godspawn helix staff
This commit is contained in:
1 parent
3607441c40
commit
601672ec80
12 files changed
+396
-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 AstralProbeBuff : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Astral Probe");
|
||||
Description.SetDefault("The astral probe will protect 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<AstralProbeSummon>()] > 0)
|
||||
{
|
||||
modPlayer.aProbe = true;
|
||||
}
|
||||
if (!modPlayer.aProbe)
|
||||
{
|
||||
player.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.buffTime[buffIndex] = 18000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -643,6 +643,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool pGuy = false;
|
||||
public bool sandnado = false;
|
||||
public bool plantera = false;
|
||||
public bool aProbe = false;
|
||||
public bool gDefense = false;
|
||||
public bool gOffense = false;
|
||||
public bool gHealer = false;
|
||||
@@ -1387,6 +1388,7 @@ namespace CalamityMod.CalPlayer
|
||||
sGod = false;
|
||||
sandnado = false;
|
||||
plantera = false;
|
||||
aProbe = false;
|
||||
vUrchin = false;
|
||||
cSpirit = false;
|
||||
rOrb = false;
|
||||
|
||||
@@ -5,6 +5,7 @@ using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.NPCs.AstrumDeus;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
@@ -47,6 +48,7 @@ namespace CalamityMod.Items.TreasureBags
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<TheMicrowave>(), 3);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<StarSputter>(), 3);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<Starfall>(), 3);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<GodspawnHelixStaff>(), 3);
|
||||
DropHelper.DropItemChance(player, ModContent.ItemType<Quasar>(), DropHelper.RareVariantDropRateInt);
|
||||
|
||||
// Equipment
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Summon
|
||||
{
|
||||
public class GodspawnHelixStaff : ModItem
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Godspawn Helix Staff");
|
||||
Tooltip.SetDefault("Summons astral probes to protect you");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.damage = 100;
|
||||
item.mana = 10;
|
||||
item.width = 50;
|
||||
item.height = 50;
|
||||
item.useTime = 36;
|
||||
item.useAnimation = 36;
|
||||
item.useStyle = 1;
|
||||
item.noMelee = true;
|
||||
item.knockBack = 1.25f;
|
||||
item.value = Item.buyPrice(0, 95, 0, 0);
|
||||
item.rare = 9;
|
||||
item.UseSound = SoundID.Item44;
|
||||
item.autoReuse = true;
|
||||
item.shoot = ModContent.ProjectileType<AstralProbeSummon>();
|
||||
item.summon = true;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Microsoft.Xna.Framework.Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
{
|
||||
position = Main.MouseWorld;
|
||||
speedX = 0;
|
||||
speedY = 0;
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -307,7 +307,7 @@ namespace CalamityMod
|
||||
(Func<bool>)(() => CalamityWorld.downedStarGod),
|
||||
ModContent.ItemType<Starcore>(),
|
||||
new List<int>() { ModContent.ItemType<AstrumDeusTrophy>(), ModContent.ItemType<AstrumDeusMask>(), ModContent.ItemType<KnowledgeAstrumDeus>(), ModContent.ItemType<KnowledgeAstralInfection>()},
|
||||
new List<int>() { ModContent.ItemType<AstrumDeusBag>(), ModContent.ItemType<Stardust>(), ModContent.ItemType<TheMicrowave>(), ModContent.ItemType<StarSputter>(), ModContent.ItemType<Starfall>(), ModContent.ItemType<Quasar>(), ModContent.ItemType<AstralBulwark>(), ModContent.ItemType<HideofAstrumDeus>(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion},
|
||||
new List<int>() { ModContent.ItemType<AstrumDeusBag>(), ModContent.ItemType<Stardust>(), ModContent.ItemType<TheMicrowave>(), ModContent.ItemType<StarSputter>(), ModContent.ItemType<Starfall>(), ModContent.ItemType<GodspawnHelixStaff>(), ModContent.ItemType<Quasar>(), ModContent.ItemType<AstralBulwark>(), ModContent.ItemType<HideofAstrumDeus>(), ItemID.FragmentSolar, ItemID.FragmentVortex, ItemID.FragmentNebula, ItemID.FragmentStardust, ItemID.GreaterHealingPotion},
|
||||
"Defeat 3 empowered astral titans or use a [i:" + ModContent.ItemType<Starcore>() + "] at Night",
|
||||
"[c/FFD700:The infected deity retreats to the heavens.]",
|
||||
"CalamityMod/NPCs/AstrumDeus/AstrumDeus_BossChecklist");
|
||||
@@ -768,6 +768,7 @@ namespace CalamityMod
|
||||
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<PlantationStaff>(), ModContent.BuffType<PlantationBuff>(), ModContent.ProjectileType<PlantSummon>());
|
||||
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<ResurrectionButterfly>(), ModContent.BuffType<ResurrectionButterflyBuff>(), new List<int>() {ModContent.ProjectileType<PinkButterfly>(), ModContent.ProjectileType<PurpleButterfly>()});
|
||||
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<SandSharknadoStaff>(), ModContent.BuffType<Sandnado>(), ModContent.ProjectileType<SandnadoMinion>());
|
||||
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<GodspawnHelixStaff>(), ModContent.BuffType<AstralProbeBuff>(), ModContent.ProjectileType<AstralProbeSummon>());
|
||||
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<ElementalAxe>(), ModContent.BuffType<ElementalAxeBuff>(), ModContent.ProjectileType<ElementalAxeMinion>());
|
||||
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<Cosmilamp>(), ModContent.BuffType<CosmilampBuff>(), ModContent.ProjectileType<CosmilampMinion>());
|
||||
SummonersAssociation.Call("AddMinionInfo", ModContent.ItemType<EtherealSubjugator>(), ModContent.BuffType<Phantom>(), ModContent.ProjectileType<PhantomGuy>());
|
||||
|
||||
@@ -10,6 +10,7 @@ using CalamityMod.Items.Weapons.Melee;
|
||||
using CalamityMod.Items.Weapons.Ranged;
|
||||
using CalamityMod.Items.Weapons.Magic;
|
||||
using CalamityMod.Items.Weapons.Rogue;
|
||||
using CalamityMod.Items.Weapons.Summon;
|
||||
using CalamityMod.Projectiles.Magic;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
@@ -230,6 +231,7 @@ namespace CalamityMod.NPCs.AstrumDeus
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<TheMicrowave>(), 4);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<StarSputter>(), 4);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<Starfall>(), 4);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<GodspawnHelixStaff>(), 4);
|
||||
DropHelper.DropItemChance(npc, ModContent.ItemType<Quasar>(), DropHelper.RareVariantDropRateInt);
|
||||
|
||||
// Equipment
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using CalamityMod.Dusts;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class AstralProbeRound : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Blast");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 6;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 4;
|
||||
projectile.height = 4;
|
||||
projectile.friendly = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.tileCollide = false;
|
||||
projectile.minionSlots = 0f;
|
||||
projectile.minion = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 300;
|
||||
projectile.extraUpdates = 2;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 0.3f, 0.5f, 0.1f);
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 1.57f;
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
int randomDust = Main.rand.Next(2);
|
||||
if (randomDust == 0)
|
||||
{
|
||||
randomDust = ModContent.DustType<AstralOrange>();
|
||||
}
|
||||
else
|
||||
{
|
||||
randomDust = ModContent.DustType<AstralBlue>();
|
||||
}
|
||||
int num137 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), 1, 1, randomDust, 0f, 0f, 0, default, 0.5f);
|
||||
Main.dust[num137].alpha = projectile.alpha;
|
||||
Main.dust[num137].velocity *= 0f;
|
||||
Main.dust[num137].noGravity = true;
|
||||
}
|
||||
float num472 = projectile.Center.X;
|
||||
float num473 = projectile.Center.Y;
|
||||
float num474 = 1200f;
|
||||
bool flag17 = false;
|
||||
for (int target = 0; target < 200; target++)
|
||||
{
|
||||
if (Main.npc[target].CanBeChasedBy(projectile, false) && Collision.CanHit(projectile.Center, 1, 1, Main.npc[target].Center, 1, 1))
|
||||
{
|
||||
float num476 = Main.npc[target].position.X + (float)(Main.npc[target].width / 2);
|
||||
float num477 = Main.npc[target].position.Y + (float)(Main.npc[target].height / 2);
|
||||
float num478 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num476) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num477);
|
||||
if (num478 < num474)
|
||||
{
|
||||
num474 = num478;
|
||||
num472 = num476;
|
||||
num473 = num477;
|
||||
flag17 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag17)
|
||||
{
|
||||
float num483 = 17f;
|
||||
Vector2 vector35 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num484 = num472 - vector35.X;
|
||||
float num485 = num473 - vector35.Y;
|
||||
float num486 = (float)Math.Sqrt((double)(num484 * num484 + num485 * num485));
|
||||
num486 = num483 / num486;
|
||||
num484 *= num486;
|
||||
num485 *= num486;
|
||||
projectile.velocity.X = (projectile.velocity.X * 20f + num484) / 21f;
|
||||
projectile.velocity.Y = (projectile.velocity.Y * 20f + num485) / 21f;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 120);
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 10);
|
||||
for (int k = 0; k < 5; k++)
|
||||
{
|
||||
int randomDust = Main.rand.Next(2);
|
||||
if (randomDust == 0)
|
||||
{
|
||||
randomDust = ModContent.DustType<AstralOrange>();
|
||||
}
|
||||
else
|
||||
{
|
||||
randomDust = ModContent.DustType<AstralBlue>();
|
||||
}
|
||||
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, randomDust, projectile.oldVelocity.X * 0.5f, projectile.oldVelocity.Y * 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
@@ -0,0 +1,190 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Projectiles.Ranged;
|
||||
using CalamityMod.Dusts;
|
||||
using CalamityMod.Buffs.Summon;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class AstralProbeSummon : ModProjectile
|
||||
{
|
||||
private double rotation = 0;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Astral Probe");
|
||||
ProjectileID.Sets.MinionSacrificable[projectile.type] = true;
|
||||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 22;
|
||||
projectile.height = 22;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.minionSlots = 1f;
|
||||
projectile.timeLeft = 18000;
|
||||
projectile.tileCollide = false;
|
||||
projectile.friendly = true;
|
||||
projectile.timeLeft *= 5;
|
||||
projectile.penetrate = -1;
|
||||
projectile.minion = true;
|
||||
}
|
||||
|
||||
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;
|
||||
int num226 = 36;
|
||||
for (int num227 = 0; num227 < num226; num227++)
|
||||
{
|
||||
Vector2 vector6 = Vector2.Normalize(projectile.velocity) * new Vector2((float)projectile.width / 2f, (float)projectile.height) * 0.75f;
|
||||
vector6 = vector6.RotatedBy((double)((float)(num227 - (num226 / 2 - 1)) * 6.28318548f / (float)num226), default) + projectile.Center;
|
||||
Vector2 vector7 = vector6 - projectile.Center;
|
||||
int num228 = Dust.NewDust(vector6 + vector7, 0, 0, (Main.rand.NextBool(2) ? ModContent.DustType<AstralOrange>() : ModContent.DustType<AstralBlue>()), vector7.X * 1.75f, vector7.Y * 1.75f, 100, default, 1.1f);
|
||||
Main.dust[num228].noGravity = true;
|
||||
Main.dust[num228].velocity = vector7;
|
||||
}
|
||||
projectile.localAI[0] += 1f;
|
||||
}
|
||||
if (player.minionDamage != projectile.Calamity().spawnedPlayerMinionDamageValue)
|
||||
{
|
||||
int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue /
|
||||
projectile.Calamity().spawnedPlayerMinionDamageValue *
|
||||
player.minionDamage);
|
||||
projectile.damage = damage2;
|
||||
}
|
||||
bool flag64 = projectile.type == ModContent.ProjectileType<AstralProbeSummon>();
|
||||
player.AddBuff(ModContent.BuffType<AstralProbeBuff>(), 3600);
|
||||
if (flag64)
|
||||
{
|
||||
if (player.dead)
|
||||
{
|
||||
modPlayer.aProbe = false;
|
||||
}
|
||||
if (modPlayer.aProbe)
|
||||
{
|
||||
projectile.timeLeft = 2;
|
||||
}
|
||||
}
|
||||
float num633 = 700f;
|
||||
float num634 = 1300f;
|
||||
float num635 = 2600f;
|
||||
float num636 = 600f;
|
||||
Vector2 vector46 = projectile.position;
|
||||
bool flag25 = false;
|
||||
if (player.HasMinionAttackTargetNPC)
|
||||
{
|
||||
NPC npc = Main.npc[player.MinionAttackTargetNPC];
|
||||
if (npc.CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num646 = Vector2.Distance(npc.Center, projectile.Center);
|
||||
if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25)
|
||||
{
|
||||
vector46 = npc.Center;
|
||||
flag25 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int num645 = 0; num645 < 200; num645++)
|
||||
{
|
||||
NPC nPC2 = Main.npc[num645];
|
||||
if (nPC2.CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num646 = Vector2.Distance(nPC2.Center, projectile.Center);
|
||||
if ((Vector2.Distance(projectile.Center, vector46) > num646 && num646 < num633) || !flag25)
|
||||
{
|
||||
num633 = num646;
|
||||
vector46 = nPC2.Center;
|
||||
flag25 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Vector2 vector = player.Center - projectile.Center;
|
||||
if (flag25)
|
||||
{
|
||||
projectile.rotation = (vector46 - projectile.Center).ToRotation() + 3.14159274f;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.rotation = vector.ToRotation() - 1.57f - (projectile.spriteDirection == 1 ? MathHelper.ToRadians(270) : MathHelper.ToRadians(90) * projectile.direction);
|
||||
}
|
||||
projectile.Center = player.Center + new Vector2(80, 0).RotatedBy(rotation);
|
||||
rotation += 0.03;
|
||||
if (rotation >= 360)
|
||||
{
|
||||
rotation = 0;
|
||||
}
|
||||
projectile.velocity.X = (vector.X > 0f) ? -0.000001f : 0f;
|
||||
|
||||
float num647 = num634;
|
||||
if (flag25)
|
||||
{
|
||||
num647 = num635;
|
||||
}
|
||||
if (Vector2.Distance(player.Center, projectile.Center) > num647)
|
||||
{
|
||||
projectile.ai[0] = 1f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
if (!flag25 && projectile.ai[0] != 0f)
|
||||
{
|
||||
bool flag26 = false;
|
||||
if (!flag26)
|
||||
{
|
||||
flag26 = projectile.ai[0] == 1f;
|
||||
}
|
||||
Vector2 center2 = projectile.Center;
|
||||
Vector2 vector48 = player.Center - center2 + new Vector2(0f, -120f);
|
||||
float num651 = vector48.Length();
|
||||
if (num651 < num636 && flag26)
|
||||
{
|
||||
projectile.ai[0] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
if (projectile.ai[1] > 0f)
|
||||
{
|
||||
projectile.ai[1] += (float)Main.rand.Next(1, 4);
|
||||
}
|
||||
if (projectile.ai[1] > 90f)
|
||||
{
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
float scaleFactor3 = 6f;
|
||||
int num658 = ModContent.ProjectileType<AstralProbeRound>();
|
||||
if (flag25 && projectile.ai[1] == 0f)
|
||||
{
|
||||
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 12);
|
||||
projectile.ai[1] += 1f;
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
{
|
||||
Vector2 value19 = vector46 - projectile.Center;
|
||||
value19.Normalize();
|
||||
value19 *= scaleFactor3;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projectile.damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override bool CanDamage()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 675 B |
Reference in new issue
Block a user