Files
CalamityModPublic/Projectiles/Boss/SporeGasPlantera.cs
T
Andrew Marheine 778c089075 1 - Removed Bloodflare mana star drops.
2 - Increased Bloodflare heart drop timer from 3 to 5 seconds.
3 - Moved Revivify, Daedalus Absorb and Absorber healing to Hurt instead of PreHurt.
4 - Reduced various life steal/healing bonuses, made their caps more strict and increased their cooldowns.
5 - Changed Baleful Harvester to be true melee and increased skull velocity and changed the skull AI.
6 - Nerfed RE weapons but made their ammo sold by the Arms Dealer and not drop from bosses.
7 - Adjusted more OOA armors by moving stats from the armor pieces to the set bonuses.
8 - Buffed Relic of Convergence healing, because it wasn't good.
9 - Adjusted DoG phase 2 AI to transition phases at different HP intervals, teleport rift creates a fireball explosion when DoG teleports to it when he's below 60% HP.
10 - Hive Cyst, Perforator Cyst and ??? no longer spawn while the pillars are active.
11 - Nerfed some Malice Mode AIs again and buffed others.
12 - Added new Perforator Hive spore attack, it's scuffed as fuck atm because it's using a placeholder sprite and projectile lol.
13 - Polter movement changed when lining up a charge.
14 - Nerfed Event Horizon homing range and black hole duration.
15 - Nerfed several other projectile homing ranges.
16 - Reduced Venom Staff buff from 66% to 33%.
2021-05-09 19:19:47 -05:00

110 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;
projectile.Calamity().affectedByMaliceModeVelocityMultiplier = true;
}
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) => projectile.ai[1] <= 1800f && projectile.ai[1] > 120f;
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;
}
CalamityUtils.DrawAfterimagesCentered(projectile, ProjectileID.Sets.TrailingMode[projectile.type], lightColor, 1, texture);
return false;
}
public override void OnHitPlayer(Player target, int damage, bool crit)
{
if (projectile.ai[1] <= 1800f && projectile.ai[1] > 120f)
{
target.AddBuff(BuffID.Poisoned, 240);
target.AddBuff(BuffID.Venom, 120);
}
}
}
}