Files
CalamityModPublic/Projectiles/Boss/SporeGasPlantera.cs
T
Andrew Marheine ce36dc7d32 1 - Added Malice Mode (there's no way to activate it yet) and adjusted all AIs a bit for it.
2 - IL Edited asphalt run speed and removed the multiplier given to player velocity while on asphalt.
3 - Removed Boss Rush Xeroc Curse.
4 - IL Edited Chlorophyte Bullets to have reduced dust and homing range and removed the damage nerf.
5 - Made Counter Scarf a rare variant of the Shield of Cthulhu and slightly increased the dash length.
6 - IL Edited to remove Aerial Bane's damage bonus against in-air enemies and removed the nerf it had.
7 - IL Edited to adjust the random damage variance for attacks both for and against the player from +-15% to +-5%.
8 - IL Edited to reduce Vortex Booster, Nebula Mantle and Betsy Wings horizontal hover speeds.
9 - Crown Jewel is now a legendary drop from King Slime.
10 - Teardrop Cleaver is now a legendary drop from Eye of Cthulhu.
11 - Changed Celestial Jewel recipe to use a Large Ruby and 5 teleportation potions.
12 - Bosses now drop rare variants and legendaries while in Malice Mode, adjusted damages and rarities/values for some that were moved to different tiers.
13 - Magic Mirror, Ice Mirror, Cell Phone and Recall Potions are now disabled while a boss is alive.
14 - Burden Breaker is now a legendary drop from Skeletron Prime.
15 - Rev+ Plantera spore gas no longer deals damage for 2 seconds after spawning in.
16 - Reduced the severity of the stat-changing properties of Nullification Pistol and Molecular Manipulator.
2021-03-30 02:38:07 -05:00

113 lines
3.5 KiB
C#

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System.IO;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Boss
{
public class SporeGasPlantera : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Spore Gas");
ProjectileID.Sets.TrailCacheLength[projectile.type] = 2;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
public override void SetDefaults()
{
projectile.Calamity().canBreakPlayerDefense = true;
projectile.width = 32;
projectile.height = 32;
projectile.hostile = true;
projectile.ignoreWater = true;
projectile.penetrate = -1;
projectile.tileCollide = false;
}
public override void SendExtraAI(BinaryWriter writer)
{
writer.Write(projectile.localAI[0]);
}
public override void ReceiveExtraAI(BinaryReader reader)
{
projectile.localAI[0] = reader.ReadSingle();
}
public override void AI()
{
projectile.ai[1] += 1f;
if (projectile.ai[1] > 1800f)
{
projectile.localAI[0] += 10f;
projectile.damage = 0;
}
if (projectile.localAI[0] > 255f)
{
projectile.Kill();
projectile.localAI[0] = 255f;
}
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0.16f / 255f, (255 - projectile.alpha) * 0.2f / 255f, (255 - projectile.alpha) * 0.04f / 255f);
projectile.alpha = (int)(100.0 + projectile.localAI[0] * 0.7);
projectile.rotation += projectile.velocity.X * 0.02f;
projectile.rotation += projectile.direction * 0.002f;
if (projectile.velocity.Length() > 0.5f)
projectile.velocity *= 0.98f;
}
public override bool CanHitPlayer(Player target)
{
if (projectile.ai[1] > 1800f || projectile.ai[1] < 120f)
{
return false;
}
return true;
}
public override Color? GetAlpha(Color lightColor)
{
if (projectile.ai[1] > 1800f)
{
byte b2 = (byte)((26f - (projectile.ai[1] - 1800f)) * 10f);
byte a2 = (byte)(projectile.alpha * (b2 / 255f));
return new Color(b2, b2, b2, a2);
}
return new Color(255, 255, 255, projectile.alpha);
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
//Changes the texture of the projectile
Texture2D texture = Main.projectileTexture[projectile.type];
switch ((int)projectile.ai[0])
{
case 0:
break;
case 1:
texture = ModContent.GetTexture("CalamityMod/Projectiles/Boss/SporeGasPlantera2");
break;
case 2:
texture = ModContent.GetTexture("CalamityMod/Projectiles/Boss/SporeGasPlantera3");
break;
default:
break;
}
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1, texture);
return false;
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
target.AddBuff(BuffID.Poisoned, 240);
target.AddBuff(BuffID.Venom, 120);
}
}
}