Added Hell's Sun (unobtainable)

This commit is contained in:
termigator1359 committed 2019-10-31 18:26:42 -04:00
1 parent cdec7c17f2
commit e063b4697a
9 files changed
+293

No files matched your search

+1
View File
@@ -1710,6 +1710,7 @@ namespace CalamityMod
spikyBallList = new List<int>() //There's more to come
{
ModContent.ItemType<HellsSun>()
ModContent.ItemType<SkyStabber>()
};
+106
View File
@@ -0,0 +1,106 @@
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using CalamityMod.Items.Materials;
using CalamityMod.Projectiles.Rogue;
using CalamityMod.CalPlayer;
namespace CalamityMod.Items.Weapons.Rogue
{
public class HellsSun : RogueWeapon
{
private static int damage = 250;
private static int knockBack = 5;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Hell's Sun");
Tooltip.SetDefault("Shoots a gravity-defying spiky ball. Stacks up to 10.\n" +
"Once stationary, periodically emits small suns that explode on hit\n" +
"Stealth strikes emit suns at a faster rate and last for a longer amount of time\n" +
"Right click to delete all existing spiky balls");
}
public override void SafeSetDefaults()
{
item.damage = damage;
item.Calamity().rogue = true;
item.noMelee = true;
item.noUseGraphic = true;
item.width = 1;
item.height = 1;
item.useTime = 15;
item.useAnimation = 15;
item.useStyle = 1;
item.knockBack = knockBack;
item.value = Item.buyPrice(0, 12, 0, 0);
item.rare = 10;
item.Calamity().postMoonLordRarity = 12;;
item.UseSound = SoundID.Item1;
item.maxStack = 10;
item.shootSpeed = 5f;
item.shoot = ModContent.ProjectileType<HellsSunProj>();
}
public override bool CanUseItem(Player player)
{
if (player.altFunctionUse == 2)
{
return true;
}
else
{
int UseMax = item.stack - 1;
if (player.ownedProjectileCounts[item.shoot] > UseMax)
{
return false;
}
else
{
return 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)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.killSpikyBalls = false;
if (player.altFunctionUse == 2)
{
modPlayer.killSpikyBalls = true;
return false;
}
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
{
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<HellsSunProj>(), damage, knockBack, player.whoAmI, 0f, 0f);
Main.projectile[stealth].Calamity().stealthStrike = true;
Main.projectile[stealth].penetrate = -1;
Main.projectile[stealth].timeLeft = 2400;
return false;
}
return true;
}
public override bool AltFunctionUse(Player player)
{
return true;
}
/*public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.SpikyBall, 100);
recipe.AddIngredient(ModContent.ItemType<UnholyEssence>(), 10);
r.AddTile(TileID.LunarCraftingStation);
recipe.SetResult(this);
recipe.AddRecipe();
}*/
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B

+91
View File
@@ -0,0 +1,91 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
using CalamityMod.Buffs.DamageOverTime;
namespace CalamityMod.Projectiles.Rogue
{
public class ExplosiveSun : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Explosive Sun");
}
public override void SetDefaults()
{
projectile.width = 22;
projectile.height = 22;
projectile.aiStyle = 115;
projectile.friendly = true;
projectile.penetrate = 1;
projectile.light = 0.5f;
projectile.alpha = 50;
projectile.scale = 1.2f;
projectile.timeLeft = 600;
projectile.tileCollide = false;
projectile.Calamity().rogue = true;
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
//Changes the texture of the projectile
if (projectile.ai[0] == 1f)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/ExplosiveSun2");
Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, 30, 30)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), projectile.scale, SpriteEffects.None, 0f);
return false;
}
if (projectile.ai[0] == 2f)
{
Texture2D texture = ModContent.GetTexture("CalamityMod/Projectiles/Rogue/ExplosiveSun3");
Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition, new Rectangle?(new Rectangle(0, 0, 34, 34)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2(texture.Width / 2f, 20 / 2f), projectile.scale, SpriteEffects.None, 0f);
return false;
}
return true;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 120);
}
public override void Kill(int timeLeft)
{
projectile.position = projectile.Center;
projectile.width = projectile.height = 192;
projectile.position.X = projectile.position.X - (float)(projectile.width / 2);
projectile.position.Y = projectile.position.Y - (float)(projectile.height / 2);
projectile.maxPenetrate = -1;
projectile.penetrate = -1;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 10;
projectile.damage /= 2;
projectile.Damage();
if (Main.rand.NextBool(3))
{
Main.PlaySound(2, (int)projectile.Center.X, (int)projectile.Center.Y, 14, 0.5f);
}
for (int num621 = 0; num621 < 5; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
Main.dust[num622].velocity *= 3f;
if (Main.rand.NextBool(2))
{
Main.dust[num622].scale = 0.5f;
Main.dust[num622].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
}
}
for (int num623 = 0; num623 < 10; num623++)
{
int num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 3f);
Main.dust[num624].noGravity = true;
Main.dust[num624].velocity *= 5f;
num624 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 244, 0f, 0f, 100, default, 2f);
Main.dust[num624].velocity *= 2f;
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 406 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 670 B

+95
View File
@@ -0,0 +1,95 @@
using System;
using Terraria;
using Terraria.ID;
using Microsoft.Xna.Framework;
using Terraria.ModLoader;
using CalamityMod.Projectiles.Typeless;
using CalamityMod.CalPlayer;
using CalamityMod.Buffs.DamageOverTime;
namespace CalamityMod.Projectiles.Rogue
{
public class HellsSunProj : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Hell's Sun");
}
public override void SetDefaults()
{
projectile.width = 15;
projectile.height = 15;
projectile.friendly = true;
projectile.Calamity().rogue = true;
projectile.tileCollide = false;
projectile.penetrate = 20;
projectile.timeLeft = 1200;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 30;
}
public override void AI()
{
projectile.ai[0] += 1f;
if (projectile.ai[0] >= 90f)
{
projectile.velocity.X *= 0.98f;
projectile.velocity.Y *= 0.98f;
projectile.localAI[1]++;
if (projectile.Calamity().stealthStrike == true)
{
if ((double) projectile.localAI[1] >= 15.0)
{
Vector2 velocity = projectile.velocity;
Vector2 vector2_1 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101));
vector2_1.Normalize();
Vector2 vector2_2 = vector2_1 * ((float) Main.rand.Next(10, 41) * 0.1f);
if (Main.rand.Next(3) == 0)
vector2_2 *= 2f;
Vector2 vector2_3 = velocity * 0.25f + vector2_2;
Vector2 vector2_5 = vector2_3 * 0.8f;
Projectile.NewProjectile(projectile.Center.X - vector2_5.X, projectile.Center.Y - vector2_5.Y, vector2_5.X, vector2_5.Y, ModContent.ProjectileType<ExplosiveSun>(), projectile.damage, projectile.knockBack, projectile.owner, Main.rand.Next(3), 0.0f);
projectile.localAI[1] = 0.0f;
}
}
else
{
if ((double) projectile.localAI[1] >= 30.0)
{
Vector2 velocity = projectile.velocity;
Vector2 vector2_1 = new Vector2((float) Main.rand.Next(-100, 101), (float) Main.rand.Next(-100, 101));
vector2_1.Normalize();
Vector2 vector2_2 = vector2_1 * ((float) Main.rand.Next(10, 41) * 0.1f);
if (Main.rand.Next(3) == 0)
vector2_2 *= 2f;
Vector2 vector2_3 = velocity * 0.25f + vector2_2;
Vector2 vector2_5 = vector2_3 * 0.8f;
Projectile.NewProjectile(projectile.Center.X - vector2_5.X, projectile.Center.Y - vector2_5.Y, vector2_5.X, vector2_5.Y, ModContent.ProjectileType<ExplosiveSun>(), projectile.damage, projectile.knockBack, projectile.owner, Main.rand.Next(3), 0.0f);
projectile.localAI[1] = 0.0f;
}
}
}
else
{
projectile.rotation += 0.3f * (float)projectile.direction;
}
Player player = Main.player[projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
if (modPlayer.killSpikyBalls == true)
{
projectile.active = false;
projectile.netUpdate = true;
}
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(ModContent.BuffType<HolyFlames>(), 300);
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 499 B