added Sirius
This commit is contained in:
1 parent
37ca65af84
commit
92101b786c
12 files changed
+598
-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 SiriusBuff : ModBuff
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Sirius");
|
||||
Description.SetDefault("A bit too bright, but it helps me");
|
||||
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<SiriusMinion>()] > 0)
|
||||
{
|
||||
modPlayer.sirius = true;
|
||||
}
|
||||
if (!modPlayer.sirius)
|
||||
{
|
||||
player.DelBuff(buffIndex);
|
||||
buffIndex--;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.buffTime[buffIndex] = 18000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 559 B |
@@ -631,6 +631,7 @@ namespace CalamityMod.CalPlayer
|
||||
public bool eAxe = false;
|
||||
public bool endoCooper = false;
|
||||
public bool SPG = false;
|
||||
public bool sirius = false;
|
||||
public bool aChicken = false;
|
||||
public bool cLamp = false;
|
||||
public bool pGuy = false;
|
||||
@@ -1365,6 +1366,7 @@ namespace CalamityMod.CalPlayer
|
||||
eAxe = false;
|
||||
endoCooper = false;
|
||||
SPG = false;
|
||||
sirius = false;
|
||||
aChicken = false;
|
||||
cLamp = false;
|
||||
pGuy = false;
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace CalamityMod.Items.Weapons.Summon
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<SunGodStaff>());
|
||||
recipe.AddIngredient(ModContent.ItemType<Sirius>());
|
||||
recipe.AddIngredient(ModContent.ItemType<AncientIceChunk>());
|
||||
recipe.AddIngredient(ModContent.ItemType<ElementalAxe>());
|
||||
recipe.AddIngredient(ModContent.ItemType<EnergyStaff>());
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Items.Weapons.Summon
|
||||
{
|
||||
public class Sirius : ModItem
|
||||
{
|
||||
int siriusSlots;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Sirius");
|
||||
Tooltip.SetDefault("Summons the brightest star in the night sky to shine upon your foes\n" +
|
||||
"Consumes all of the remaining minion slots on use\n" +
|
||||
"Increased power based on the number of minion slots used");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
item.width = 62;
|
||||
item.height = 62;
|
||||
item.useStyle = ItemUseStyleID.SwingThrow;
|
||||
item.noMelee = true;
|
||||
item.UseSound = SoundID.Item44;
|
||||
|
||||
item.summon = true;
|
||||
item.mana = 60;
|
||||
item.damage = 500;
|
||||
item.knockBack = 3f;
|
||||
item.autoReuse = true;
|
||||
item.useTime = 36;
|
||||
item.useAnimation = 36;
|
||||
item.shoot = ModContent.ProjectileType<SiriusMinion>();
|
||||
item.shootSpeed = 10f;
|
||||
|
||||
item.value = Item.buyPrice(1, 40, 0, 0);
|
||||
item.rare = 10;
|
||||
item.Calamity().postMoonLordRarity = 13;
|
||||
}
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
return siriusSlots >= 1;
|
||||
}
|
||||
|
||||
public override void HoldItem(Player player)
|
||||
{
|
||||
double minionCount = 0;
|
||||
for (int j = 0; j < Main.projectile.Length; j++)
|
||||
{
|
||||
if (Main.projectile[j].active && Main.projectile[j].owner == player.whoAmI && Main.projectile[j].minion)
|
||||
{
|
||||
minionCount += Main.projectile[j].minionSlots;
|
||||
}
|
||||
}
|
||||
siriusSlots = (int)((double)player.maxMinions - minionCount);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
for (int x = 0; x < Main.projectile.Length; x++)
|
||||
{
|
||||
Projectile projectile = Main.projectile[x];
|
||||
if (projectile.active && projectile.owner == player.whoAmI && projectile.type == ModContent.ProjectileType<SiriusMinion>())
|
||||
{
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
position = Main.MouseWorld;
|
||||
speedX = 0;
|
||||
speedY = 0;
|
||||
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, siriusSlots);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
ModRecipe recipe = new ModRecipe(mod);
|
||||
recipe.AddIngredient(ModContent.ItemType<SunGodStaff>());
|
||||
recipe.AddIngredient(ModContent.ItemType<ExodiumClusterOre>(), 12);
|
||||
recipe.AddIngredient(ModContent.ItemType<RuinousSoul>(), 2);
|
||||
recipe.AddTile(TileID.LunarCraftingStation);
|
||||
recipe.SetResult(this);
|
||||
recipe.AddRecipe();
|
||||
}
|
||||
|
||||
public override bool AltFunctionUse(Player player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool UseItem(Player player)
|
||||
{
|
||||
if (player.altFunctionUse == 2)
|
||||
{
|
||||
player.MinionNPCTargetAim();
|
||||
}
|
||||
return base.UseItem(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,54 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class SiriusBeam : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Beam");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 4;
|
||||
projectile.height = 4;
|
||||
projectile.friendly = true;
|
||||
projectile.minion = true;
|
||||
projectile.minionSlots = 0f;
|
||||
projectile.extraUpdates = 100;
|
||||
projectile.timeLeft = 1000;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.localAI[0] += 1f;
|
||||
if (projectile.localAI[0] > 9f)
|
||||
{
|
||||
for (int num447 = 0; num447 < 4; num447++)
|
||||
{
|
||||
Vector2 vector33 = projectile.position;
|
||||
vector33 -= projectile.velocity * ((float)num447 * 0.25f);
|
||||
projectile.alpha = 255;
|
||||
int num448 = Dust.NewDust(vector33, 1, 1, 20, 0f, 0f, 0, default, 1f);
|
||||
Main.dust[num448].position = vector33;
|
||||
Main.dust[num448].scale = (float)Main.rand.Next(70, 110) * 0.013f;
|
||||
Main.dust[num448].velocity *= 0.2f;
|
||||
Main.dust[num448].noGravity = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Nightwither>(), 300);
|
||||
float x4 = Main.rgbToHsl(new Color(103, 203, Main.DiscoB)).X;
|
||||
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, 0f, 0f, ModContent.ProjectileType<SiriusExplosion>(), projectile.damage, projectile.knockBack, projectile.owner, x4, (float)projectile.whoAmI);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 135 B |
@@ -0,0 +1,237 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class SiriusExplosion : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Explosion");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 14;
|
||||
projectile.height = 14;
|
||||
projectile.alpha = 255;
|
||||
projectile.penetrate = 1;
|
||||
projectile.tileCollide = false;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = 900;
|
||||
projectile.minion = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Color newColor2 = Main.hslToRgb(0.5f, 1f, projectile.ai[0]);
|
||||
int num978 = (int)projectile.ai[1];
|
||||
if (num978 < 0 || num978 >= 1000 || (!Main.projectile[num978].active && Main.projectile[num978].type != ModContent.ProjectileType<SilvaCrystal>()))
|
||||
{
|
||||
projectile.ai[1] = -1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
DelegateMethods.v3_1 = newColor2.ToVector3() * 0.5f;
|
||||
Utils.PlotTileLine(projectile.Center, Main.projectile[num978].Center, 8f, new Utils.PerLinePoint(DelegateMethods.CastLight));
|
||||
}
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
projectile.localAI[0] = Main.rand.NextFloat() * 0.8f + 0.8f;
|
||||
projectile.direction = (Main.rand.Next(2) > 0) ? 1 : -1;
|
||||
}
|
||||
projectile.rotation = projectile.localAI[1] / 40f * 6.28318548f * (float)projectile.direction;
|
||||
if (projectile.alpha > 0)
|
||||
{
|
||||
projectile.alpha -= 8;
|
||||
}
|
||||
if (projectile.alpha < 0)
|
||||
{
|
||||
projectile.alpha = 0;
|
||||
}
|
||||
if (projectile.alpha == 0)
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, newColor2.ToVector3() * 0.5f);
|
||||
}
|
||||
int num3;
|
||||
for (int num979 = 0; num979 < 2; num979 = num3 + 1)
|
||||
{
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
Vector2 value55 = Vector2.UnitY.RotatedBy((double)((float)num979 * 3.14159274f), default).RotatedBy((double)projectile.rotation, default);
|
||||
Dust dust24 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)];
|
||||
dust24.noGravity = true;
|
||||
dust24.noLight = true;
|
||||
dust24.scale = projectile.Opacity * projectile.localAI[0];
|
||||
dust24.position = projectile.Center;
|
||||
dust24.velocity = value55 * 2.5f;
|
||||
}
|
||||
num3 = num979;
|
||||
}
|
||||
for (int num980 = 0; num980 < 2; num980 = num3 + 1)
|
||||
{
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
Vector2 value56 = Vector2.UnitY.RotatedBy((double)((float)num980 * 3.14159274f), default);
|
||||
Dust dust25 = Main.dust[Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 225, newColor2, 1.5f)];
|
||||
dust25.noGravity = true;
|
||||
dust25.noLight = true;
|
||||
dust25.scale = projectile.Opacity * projectile.localAI[0];
|
||||
dust25.position = projectile.Center;
|
||||
dust25.velocity = value56 * 2.5f;
|
||||
}
|
||||
num3 = num980;
|
||||
}
|
||||
if (Main.rand.NextBool(10))
|
||||
{
|
||||
float scaleFactor13 = 1f + Main.rand.NextFloat() * 2f;
|
||||
float fadeIn = 1f + Main.rand.NextFloat();
|
||||
float num981 = 1f + Main.rand.NextFloat();
|
||||
Vector2 vector136 = Utils.RandomVector2(Main.rand, -1f, 1f);
|
||||
if (vector136 != Vector2.Zero)
|
||||
{
|
||||
vector136.Normalize();
|
||||
}
|
||||
vector136 *= 20f + Main.rand.NextFloat() * 100f;
|
||||
Vector2 vector137 = projectile.Center + vector136;
|
||||
Point point3 = vector137.ToTileCoordinates();
|
||||
bool flag52 = true;
|
||||
if (!WorldGen.InWorld(point3.X, point3.Y, 0))
|
||||
{
|
||||
flag52 = false;
|
||||
}
|
||||
if (flag52 && WorldGen.SolidTile(point3.X, point3.Y))
|
||||
{
|
||||
flag52 = false;
|
||||
}
|
||||
if (flag52)
|
||||
{
|
||||
Dust dust26 = Main.dust[Dust.NewDust(vector137, 0, 0, 267, 0f, 0f, 127, newColor2, 1f)];
|
||||
dust26.noGravity = true;
|
||||
dust26.position = vector137;
|
||||
dust26.velocity = -Vector2.UnitY * scaleFactor13 * (Main.rand.NextFloat() * 0.9f + 1.6f);
|
||||
dust26.fadeIn = fadeIn;
|
||||
dust26.scale = num981;
|
||||
dust26.noLight = true;
|
||||
Dust dust27 = Dust.CloneDust(dust26);
|
||||
Dust dust = dust27;
|
||||
dust.scale *= 0.65f;
|
||||
dust = dust27;
|
||||
dust.fadeIn *= 0.65f;
|
||||
dust27.color = new Color(255, 255, 255, 255);
|
||||
}
|
||||
}
|
||||
projectile.scale = projectile.Opacity / 2f * projectile.localAI[0];
|
||||
projectile.velocity = Vector2.Zero;
|
||||
projectile.localAI[1] += 1f;
|
||||
if (projectile.localAI[1] >= 60f)
|
||||
{
|
||||
projectile.Kill();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Color color25 = Lighting.GetColor((int)((double)projectile.position.X + (double)projectile.width * 0.5) / 16, (int)(((double)projectile.position.Y + (double)projectile.height * 0.5) / 16.0));
|
||||
Vector2 vector59 = projectile.position + new Vector2((float)projectile.width, (float)projectile.height) / 2f + Vector2.UnitY * projectile.gfxOffY - Main.screenPosition;
|
||||
Texture2D texture2D34 = Main.projectileTexture[projectile.type];
|
||||
Rectangle rectangle17 = texture2D34.Frame(1, Main.projFrames[projectile.type], 0, projectile.frame);
|
||||
Color alpha5 = projectile.GetAlpha(color25);
|
||||
Vector2 origin11 = rectangle17.Size() / 2f;
|
||||
Color color60 = Main.hslToRgb(0.5f, 1f, projectile.ai[0]).MultiplyRGBA(new Color(255, 255, 255, 0));
|
||||
Main.spriteBatch.Draw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, projectile.rotation, origin11, projectile.scale * 2f, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(texture2D34, vector59, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60, 0f, origin11, projectile.scale * 2f, SpriteEffects.None, 0f);
|
||||
if (projectile.ai[1] != -1f && projectile.Opacity > 0.3f)
|
||||
{
|
||||
Vector2 vector61 = Main.projectile[(int)projectile.ai[1]].Center - projectile.Center;
|
||||
Vector2 vector62 = new Vector2(1f, vector61.Length() / (float)texture2D34.Height);
|
||||
float rotation27 = vector61.ToRotation() + 1.57079637f;
|
||||
float num279 = MathHelper.Distance(30f, projectile.localAI[1]) / 20f;
|
||||
num279 = MathHelper.Clamp(num279, 0f, 1f);
|
||||
if (num279 > 0f)
|
||||
{
|
||||
Main.spriteBatch.Draw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), color60 * num279, rotation27, origin11, vector62, SpriteEffects.None, 0f);
|
||||
Main.spriteBatch.Draw(texture2D34, vector59 + vector61 / 2f, new Microsoft.Xna.Framework.Rectangle?(rectangle17), alpha5 * num279, rotation27, origin11, vector62 / 2f, SpriteEffects.None, 0f);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Kill(int timeLeft)
|
||||
{
|
||||
Vector2 spinningpoint = new Vector2(0f, -3f).RotatedByRandom(3.1415927410125732);
|
||||
float num69 = (float)Main.rand.Next(7, 13);
|
||||
Vector2 value5 = new Vector2(2.1f, 2f);
|
||||
Color newColor = Main.hslToRgb(0.5f, 1f, projectile.ai[0]);
|
||||
newColor.A = 255;
|
||||
float num72;
|
||||
for (float num70 = 0f; num70 < num69; num70 = num72 + 1f)
|
||||
{
|
||||
int num71 = Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 0, newColor, 1f);
|
||||
Main.dust[num71].position = projectile.Center;
|
||||
Main.dust[num71].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num70 / num69), default) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f);
|
||||
Main.dust[num71].noGravity = true;
|
||||
Main.dust[num71].scale = 2f;
|
||||
Main.dust[num71].fadeIn = Main.rand.NextFloat() * 2f;
|
||||
Dust dust11 = Dust.CloneDust(num71);
|
||||
Dust dust = dust11;
|
||||
dust.scale /= 2f;
|
||||
dust = dust11;
|
||||
dust.fadeIn /= 2f;
|
||||
dust11.color = new Color(255, 255, 255, 255);
|
||||
num72 = num70;
|
||||
}
|
||||
for (float num73 = 0f; num73 < num69; num73 = num72 + 1f)
|
||||
{
|
||||
int num74 = Dust.NewDust(projectile.Center, 0, 0, 267, 0f, 0f, 0, newColor, 1f);
|
||||
Main.dust[num74].position = projectile.Center;
|
||||
Main.dust[num74].velocity = spinningpoint.RotatedBy((double)(6.28318548f * num73 / num69), default) * value5 * (0.8f + Main.rand.NextFloat() * 0.4f);
|
||||
Dust dust = Main.dust[num74];
|
||||
dust.velocity *= Main.rand.NextFloat() * 0.8f;
|
||||
Main.dust[num74].noGravity = true;
|
||||
Main.dust[num74].scale = Main.rand.NextFloat() * 1f;
|
||||
Main.dust[num74].fadeIn = Main.rand.NextFloat() * 2f;
|
||||
Dust dust12 = Dust.CloneDust(num74);
|
||||
dust = dust12;
|
||||
dust.scale /= 2f;
|
||||
dust = dust12;
|
||||
dust.fadeIn /= 2f;
|
||||
dust12.color = new Color(255, 255, 255, 255);
|
||||
num72 = num73;
|
||||
}
|
||||
if (Main.myPlayer == projectile.owner)
|
||||
{
|
||||
projectile.friendly = true;
|
||||
int width = projectile.width;
|
||||
int height2 = projectile.height;
|
||||
int num75 = projectile.penetrate;
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = projectile.height = 60;
|
||||
projectile.Center = projectile.position;
|
||||
projectile.penetrate = -1;
|
||||
projectile.maxPenetrate = -1;
|
||||
projectile.usesLocalNPCImmunity = true;
|
||||
projectile.localNPCHitCooldown = 10;
|
||||
projectile.Damage();
|
||||
projectile.penetrate = num75;
|
||||
projectile.position = projectile.Center;
|
||||
projectile.width = width;
|
||||
projectile.height = height2;
|
||||
projectile.Center = projectile.position;
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(255 - projectile.alpha, 255 - projectile.alpha, 255 - projectile.alpha, 0);
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Nightwither>(), 120);
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.0 KiB |
@@ -0,0 +1,163 @@
|
||||
using CalamityMod.Buffs.Summon;
|
||||
using CalamityMod.CalPlayer;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
public class SiriusMinion : ModProjectile
|
||||
{
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Sirius");
|
||||
ProjectileID.Sets.MinionSacrificable[projectile.type] = true;
|
||||
ProjectileID.Sets.MinionTargettingFeature[projectile.type] = true;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 38;
|
||||
projectile.height = 50;
|
||||
projectile.netImportant = true;
|
||||
projectile.friendly = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.minionSlots = 1f;
|
||||
projectile.timeLeft = 18000;
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = false;
|
||||
projectile.timeLeft *= 5;
|
||||
projectile.minion = true;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, 1f, 0.5f, 5f);
|
||||
bool flag64 = projectile.type == ModContent.ProjectileType<SiriusMinion>();
|
||||
Player player = Main.player[projectile.owner];
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
player.AddBuff(ModContent.BuffType<SiriusBuff>(), 3600);
|
||||
if (flag64)
|
||||
{
|
||||
if (player.dead)
|
||||
{
|
||||
modPlayer.sirius = false;
|
||||
}
|
||||
if (modPlayer.sirius)
|
||||
{
|
||||
projectile.timeLeft = 2;
|
||||
}
|
||||
}
|
||||
projectile.minionSlots = projectile.ai[0];
|
||||
projectile.position.X = player.Center.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f;
|
||||
if (player.gravDir == -1f)
|
||||
{
|
||||
projectile.position.Y = projectile.position.Y + 150f;
|
||||
projectile.rotation = 3.14f;
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.rotation = 0f;
|
||||
}
|
||||
projectile.position.X = (float)(int)projectile.position.X;
|
||||
projectile.position.Y = (float)(int)projectile.position.Y;
|
||||
float num395 = (float)Main.mouseTextColor / 200f - 0.35f;
|
||||
num395 *= 0.2f;
|
||||
projectile.scale = num395 + 0.95f;
|
||||
if (projectile.localAI[0] == 0f)
|
||||
{
|
||||
projectile.Calamity().spawnedPlayerMinionDamageValue = (player.allDamage + player.minionDamage - 1f);
|
||||
projectile.Calamity().spawnedPlayerMinionProjectileDamageValue = projectile.damage;
|
||||
int num501 = 50;
|
||||
for (int num502 = 0; num502 < num501; num502++)
|
||||
{
|
||||
int num503 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y + 16f), projectile.width, projectile.height - 16, 20, 0f, 0f, 0, default, 1f);
|
||||
Main.dust[num503].velocity *= 2f;
|
||||
Main.dust[num503].scale *= 1.15f;
|
||||
}
|
||||
projectile.localAI[0] += 1f;
|
||||
}
|
||||
if ((player.allDamage + player.minionDamage - 1f) != projectile.Calamity().spawnedPlayerMinionDamageValue)
|
||||
{
|
||||
int damage2 = (int)((float)projectile.Calamity().spawnedPlayerMinionProjectileDamageValue /
|
||||
projectile.Calamity().spawnedPlayerMinionDamageValue *
|
||||
(player.allDamage + player.minionDamage - 1f));
|
||||
projectile.damage = damage2;
|
||||
}
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
if (projectile.ai[1] != 0f)
|
||||
{
|
||||
projectile.ai[1] -= 1f;
|
||||
return;
|
||||
}
|
||||
float num396 = projectile.position.X;
|
||||
float num397 = projectile.position.Y;
|
||||
float num398 = 700f;
|
||||
bool flag11 = false;
|
||||
if (player.HasMinionAttackTargetNPC)
|
||||
{
|
||||
NPC npc = Main.npc[player.MinionAttackTargetNPC];
|
||||
if (npc.CanBeChasedBy(projectile, false))
|
||||
{
|
||||
float num539 = npc.position.X + (float)(npc.width / 2);
|
||||
float num540 = npc.position.Y + (float)(npc.height / 2);
|
||||
float num541 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num539) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num540);
|
||||
if (num541 < num398 && Collision.CanHit(projectile.position, projectile.width, projectile.height, npc.position, npc.width, npc.height))
|
||||
{
|
||||
num396 = num539;
|
||||
num397 = num540;
|
||||
flag11 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int num399 = 0; num399 < Main.npc.Length; num399++)
|
||||
{
|
||||
if (Main.npc[num399].CanBeChasedBy(projectile, true))
|
||||
{
|
||||
float num400 = Main.npc[num399].position.X + (float)(Main.npc[num399].width / 2);
|
||||
float num401 = Main.npc[num399].position.Y + (float)(Main.npc[num399].height / 2);
|
||||
float num402 = Math.Abs(projectile.position.X + (float)(projectile.width / 2) - num400) + Math.Abs(projectile.position.Y + (float)(projectile.height / 2) - num401);
|
||||
if (num402 < num398 && Collision.CanHit(projectile.position, projectile.width, projectile.height, Main.npc[num399].position, Main.npc[num399].width, Main.npc[num399].height))
|
||||
{
|
||||
num398 = num402;
|
||||
num396 = num400;
|
||||
num397 = num401;
|
||||
flag11 = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag11)
|
||||
{
|
||||
float num403 = 35f;
|
||||
Vector2 vector29 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
|
||||
float num404 = num396 - vector29.X;
|
||||
float num405 = num397 - vector29.Y;
|
||||
float num406 = (float)Math.Sqrt((double)(num404 * num404 + num405 * num405));
|
||||
num406 = num403 / num406;
|
||||
num404 *= num406;
|
||||
num405 *= num406;
|
||||
float damageMult = ((float)Math.Log(projectile.ai[0], MathHelper.E)) + 1f;
|
||||
int beam = Projectile.NewProjectile(projectile.Center.X - 4f, projectile.Center.Y, num404, num405, ModContent.ProjectileType<SiriusBeam>(), (int)(projectile.damage * damageMult), projectile.knockBack, projectile.owner);
|
||||
Main.projectile[beam].penetrate = (int)projectile.ai[0];
|
||||
projectile.ai[1] = 30f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(200, 200, 200, 200);
|
||||
}
|
||||
|
||||
public override bool CanDamage()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 677 B |
Reference in new issue
Block a user