Scourge of the Seas rework and Abyss no water death message

This commit is contained in:
termigator1359 committed 2019-10-21 22:26:06 -04:00
1 parent ce6c217801
commit 2e32f60d01
18 files changed
+103 -252

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.DamageOverTime
{
public class MaxVenom : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Vile Toxins");
Description.SetDefault("The illness has spread"); //nope, not an AHiT reference, definitely not
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
longerExpertDebuff = false;
}
public override void Update(NPC npc, ref int buffIndex)
{
npc.Calamity().maxVenom = true;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

+4
View File
@@ -5179,6 +5179,10 @@ namespace CalamityMod.CalPlayer
{
damageSource = PlayerDeathReason.ByCustomReason(player.name + " was charred by the brimstone inferno.");
}
if (!Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) && ZoneAbyss && damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8)
{
damageSource = PlayerDeathReason.ByCustomReason("Oxygen couldn't reach " + player.name + " from the depths of the Abyss.");
}
if (alcoholPoisonLevel > 3 && damage == 10.0 && hitDirection == 0 && damageSource.SourceOtherIndex == 8)
{
if (Main.rand.Next(2) == 0)
+7 -9
View File
@@ -1,4 +1,5 @@
using CalamityMod.Projectiles.Rogue;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -11,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue
{
DisplayName.SetDefault("Scourge of the Seas");
Tooltip.SetDefault("Snaps apart into a venomous cloud upon striking an enemy\n" +
"Stealth strikes stick to enemies and apply a powerful venom");
"Stealth strikes are coated with vile toxins, afflicting enemies with a powerful debuff");
}
public override void SafeSetDefaults()
@@ -36,16 +37,13 @@ namespace CalamityMod.Items.Weapons.Rogue
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)
{
if (player.Calamity().StealthStrikeAvailable())
if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike
{
int p = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<ScourgeoftheSeasStealth>(), damage, knockBack, player.whoAmI, 0f, 0f);
Main.projectile[p].Calamity().stealthStrike = true;
int stealth = Projectile.NewProjectile(position, new Vector2(speedX, speedY), ModContent.ProjectileType<ScourgeoftheSeasProjectile>(), damage, knockBack, player.whoAmI, 0f, 1f);
Main.projectile[stealth].Calamity().stealthStrike = true;
return false;
}
else
{
Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
}
return false;
return true;
}
}
}
+1
View File
@@ -62,6 +62,7 @@ namespace CalamityMod.NPCs.AstrumAureus
npc.buffImmune[ModContent.BuffType<Shred>()] = false;
npc.buffImmune[ModContent.BuffType<WhisperingDeath>()] = false;
npc.buffImmune[ModContent.BuffType<SilvaStun>()] = false;
npc.buffImmune[ModContent.BuffType<MaxVenom>()] = false;
npc.boss = true;
npc.DeathSound = SoundID.NPCDeath14;
Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic");
@@ -68,6 +68,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
npc.buffImmune[ModContent.BuffType<Shred>()] = false;
npc.buffImmune[ModContent.BuffType<WhisperingDeath>()] = false;
npc.buffImmune[ModContent.BuffType<SilvaStun>()] = false;
npc.buffImmune[ModContent.BuffType<MaxVenom>()] = false;
npc.boss = true;
npc.noGravity = true;
npc.noTileCollide = true;
+1
View File
@@ -61,6 +61,7 @@ namespace CalamityMod.NPCs.Calamitas
npc.buffImmune[ModContent.BuffType<Shred>()] = false;
npc.buffImmune[ModContent.BuffType<WhisperingDeath>()] = false;
npc.buffImmune[ModContent.BuffType<SilvaStun>()] = false;
npc.buffImmune[ModContent.BuffType<MaxVenom>()] = false;
npc.boss = true;
npc.noGravity = true;
npc.noTileCollide = true;
+1
View File
@@ -64,6 +64,7 @@ namespace CalamityMod.NPCs.Calamitas
npc.buffImmune[ModContent.BuffType<Shred>()] = false;
npc.buffImmune[ModContent.BuffType<WhisperingDeath>()] = false;
npc.buffImmune[ModContent.BuffType<SilvaStun>()] = false;
npc.buffImmune[ModContent.BuffType<MaxVenom>()] = false;
npc.noGravity = true;
npc.noTileCollide = true;
npc.HitSound = SoundID.NPCHit4;
+1
View File
@@ -66,6 +66,7 @@ namespace CalamityMod.NPCs.Calamitas
npc.buffImmune[ModContent.BuffType<Shred>()] = false;
npc.buffImmune[ModContent.BuffType<WhisperingDeath>()] = false;
npc.buffImmune[ModContent.BuffType<SilvaStun>()] = false;
npc.buffImmune[ModContent.BuffType<MaxVenom>()] = false;
npc.HitSound = SoundID.NPCHit4;
npc.DeathSound = SoundID.NPCDeath14;
Mod calamityModMusic = ModLoader.GetMod("CalamityModMusic");
+1
View File
@@ -77,6 +77,7 @@ namespace CalamityMod.NPCs.Calamitas
npc.buffImmune[ModContent.BuffType<Shred>()] = false;
npc.buffImmune[ModContent.BuffType<WhisperingDeath>()] = false;
npc.buffImmune[ModContent.BuffType<SilvaStun>()] = false;
npc.buffImmune[ModContent.BuffType<MaxVenom>()] = false;
npc.boss = true;
npc.noGravity = true;
npc.noTileCollide = true;
+24 -10
View File
@@ -112,6 +112,7 @@ namespace CalamityMod.NPCs
public bool pearlAura = false;
public bool shellfishVore = false;
public bool clamDebuff = false;
public bool maxVenom = false;
// whoAmI Variables
public static int bobbitWormBottom = -1;
@@ -314,6 +315,7 @@ namespace CalamityMod.NPCs
pearlAura = false;
shellfishVore = false;
clamDebuff = false;
maxVenom = false;
}
#endregion
@@ -379,15 +381,6 @@ namespace CalamityMod.NPCs
projectileCount++;
}
}
for (int j = 0; j < 1000; j++)
{
if (Main.projectile[j].active &&
(Main.projectile[j].type == ModContent.ProjectileType<ScourgeoftheSeasStealth>()) &&
Main.projectile[j].ai[0] == 1f && Main.projectile[j].ai[1] == npc.whoAmI)
{
projectileCount += 6;
}
}
if (projectileCount > 0)
{
@@ -520,6 +513,7 @@ namespace CalamityMod.NPCs
ApplyDPSDebuff(nightwither, 200, 40, ref npc.lifeRegen, ref damage);
ApplyDPSDebuff(dFlames, 2500, 500, ref npc.lifeRegen, ref damage);
ApplyDPSDebuff(bBlood, 50, 10, ref npc.lifeRegen, ref damage);
ApplyDPSDebuff(maxVenom, 180, 36, ref npc.lifeRegen, ref damage);
}
public void ApplyDPSDebuff(bool debuff, int lifeRegenValue, int damageValue, ref int lifeRegen, ref int damage)
@@ -605,6 +599,11 @@ namespace CalamityMod.NPCs
}
}
}
if (npc.buffImmune[BuffID.Venom] == false)
{
npc.buffImmune[ModContent.BuffType<MaxVenom>()] = false;
}
npc.buffImmune[ModContent.BuffType<Enraged>()] = false;
@@ -2940,13 +2939,28 @@ namespace CalamityMod.NPCs
}
Lighting.AddLight(npc.position, 0.1f, 0f, 0.135f);
}
if (maxVenom)
{
if (Main.rand.Next(5) < 4)
{
int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, 171, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 100, default, 1.5f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 1.1f;
Main.dust[dust].velocity.Y += 0.25f;
if (Main.rand.NextBool(2))
{
Main.dust[dust].noGravity = false;
Main.dust[dust].scale *= 0.5f;
}
}
}
if (gState || eFreeze)
{
drawColor = Color.Cyan;
}
if (marked)
if (marked || maxVenom)
{
drawColor = Color.Fuchsia;
}
+1
View File
@@ -73,6 +73,7 @@ namespace CalamityMod.NPCs.Cryogen
npc.buffImmune[ModContent.BuffType<Shred>()] = false;
npc.buffImmune[ModContent.BuffType<WhisperingDeath>()] = false;
npc.buffImmune[ModContent.BuffType<SilvaStun>()] = false;
npc.buffImmune[ModContent.BuffType<MaxVenom>()] = false;
npc.boss = true;
npc.noGravity = true;
npc.noTileCollide = true;
+1
View File
@@ -64,6 +64,7 @@ namespace CalamityMod.NPCs.Leviathan
npc.buffImmune[ModContent.BuffType<Shred>()] = false;
npc.buffImmune[ModContent.BuffType<WhisperingDeath>()] = false;
npc.buffImmune[ModContent.BuffType<SilvaStun>()] = false;
npc.buffImmune[ModContent.BuffType<MaxVenom>()] = false;
npc.HitSound = SoundID.NPCHit56;
npc.DeathSound = SoundID.NPCDeath60;
npc.noTileCollide = true;
+1
View File
@@ -60,6 +60,7 @@ namespace CalamityMod.NPCs.Leviathan
npc.buffImmune[ModContent.BuffType<Shred>()] = false;
npc.buffImmune[ModContent.BuffType<WhisperingDeath>()] = false;
npc.buffImmune[ModContent.BuffType<SilvaStun>()] = false;
npc.buffImmune[ModContent.BuffType<MaxVenom>()] = false;
npc.noGravity = true;
npc.noTileCollide = true;
npc.HitSound = SoundID.NPCHit1;
+5
View File
@@ -1,6 +1,7 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Buffs.DamageOverTime;
namespace CalamityMod.Projectiles.Rogue
{
@@ -69,6 +70,10 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.Venom, 240);
if (projectile.ai[1] == 1f && projectile.owner == Main.myPlayer) //stealth strike attack
{
target.AddBuff(ModContent.BuffType<MaxVenom>(), 240);
}
}
}
}
+31 -10
View File
@@ -4,6 +4,7 @@ using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using CalamityMod.Buffs.DamageOverTime;
namespace CalamityMod.Projectiles.Rogue
{
@@ -51,6 +52,10 @@ namespace CalamityMod.Projectiles.Rogue
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
target.AddBuff(BuffID.Venom, 600);
if (projectile.Calamity().stealthStrike == true) //stealth strike attack
{
target.AddBuff(ModContent.BuffType<MaxVenom>(), 600);
}
}
public override void Kill(int timeLeft)
@@ -63,16 +68,32 @@ namespace CalamityMod.Projectiles.Rogue
}
if (projectile.owner == Main.myPlayer)
{
int num320 = Main.rand.Next(2, 6);
int num3;
for (int num321 = 0; num321 < num320; num321 = num3 + 1)
{
Vector2 vector15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
vector15.Normalize();
vector15 *= (float)Main.rand.Next(10, 201) * 0.01f;
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType<ScourgeVenomCloud>(), (int)((double)projectile.damage * 0.25), 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1));
num3 = num321;
}
if (projectile.Calamity().stealthStrike == true)
{
int num320 = Main.rand.Next(2, 6);
int num3;
for (int num321 = 0; num321 < num320; num321 = num3 + 1)
{
Vector2 vector15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
vector15.Normalize();
vector15 *= (float)Main.rand.Next(10, 201) * 0.01f;
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType<ScourgeVenomCloud>(), (int)((double)projectile.damage * 0.25), 1f, projectile.owner, 0f, 1f);
num3 = num321;
}
}
else
{
int num320 = Main.rand.Next(2, 6);
int num3;
for (int num321 = 0; num321 < num320; num321 = num3 + 1)
{
Vector2 vector15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
vector15.Normalize();
vector15 *= (float)Main.rand.Next(10, 201) * 0.01f;
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType<ScourgeVenomCloud>(), (int)((double)projectile.damage * 0.25), 1f, projectile.owner, 0f, 0f);
num3 = num321;
}
}
}
}
@@ -1,223 +0,0 @@
using CalamityMod.NPCs.Abyss;
using CalamityMod.NPCs.BrimstoneElemental;
using CalamityMod.NPCs.Cryogen;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Rogue
{
public class ScourgeoftheSeasStealth : ModProjectile
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Stealthy Scourge");
ProjectileID.Sets.TrailCacheLength[projectile.type] = 6;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
public override void SetDefaults()
{
projectile.width = 26;
projectile.height = 26;
projectile.friendly = true;
projectile.aiStyle = 113;
aiType = 598;
projectile.penetrate = -1;
projectile.extraUpdates = 1;
projectile.timeLeft = 1200;
projectile.Calamity().rogue = true;
projectile.usesLocalNPCImmunity = true;
projectile.localNPCHitCooldown = 60;
}
public override void AI()
{
if (Main.rand.Next(5) == 0 && projectile.ai[0] != 1f)
{
Dust.NewDust(projectile.position + projectile.velocity, projectile.width, projectile.height, 85, projectile.velocity.X * 0.5f, projectile.velocity.Y * 0.5f);
}
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) + 0.785f;
if (projectile.ai[0] != 1f)
{
projectile.velocity.X *= 1.015f;
projectile.velocity.Y *= 1.015f;
}
if (projectile.velocity.X > 16f)
{
projectile.velocity.X = 16f;
}
if (projectile.velocity.Y > 16f)
{
projectile.velocity.Y = 16f;
}
if (projectile.ai[0] == 1f)
{
projectile.tileCollide = false;
int num988 = 15;
bool flag54 = false;
bool flag55 = false;
float[] var_2_2CB4E_cp_0 = projectile.localAI;
int var_2_2CB4E_cp_1 = 0;
float num73 = var_2_2CB4E_cp_0[var_2_2CB4E_cp_1];
var_2_2CB4E_cp_0[var_2_2CB4E_cp_1] = num73 + 1f;
if (projectile.localAI[0] % 30f == 0f)
{
flag55 = true;
}
int num989 = (int)projectile.ai[1];
if (projectile.localAI[0] >= (float)(60 * num988))
{
flag54 = true;
}
else if (num989 < 0 || num989 >= 200)
{
flag54 = true;
}
else if (Main.npc[num989].active && !Main.npc[num989].dontTakeDamage)
{
projectile.Center = Main.npc[num989].Center - projectile.velocity * 2f;
projectile.gfxOffY = Main.npc[num989].gfxOffY;
if (flag55)
{
Main.npc[num989].HitEffect(0, 1.0);
}
}
else
{
flag54 = true;
}
if (flag54)
{
projectile.Kill();
}
}
}
public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
{
Rectangle myRect = new Rectangle((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height);
if (projectile.owner == Main.myPlayer)
{
for (int i = 0; i < 200; i++)
{
if (Main.npc[i].active && !Main.npc[i].dontTakeDamage &&
((projectile.friendly && (!Main.npc[i].friendly || projectile.type == 318 || (Main.npc[i].type == 22 && projectile.owner < 255 && Main.player[projectile.owner].killGuide) || (Main.npc[i].type == 54 && projectile.owner < 255 && Main.player[projectile.owner].killClothier))) ||
(projectile.hostile && Main.npc[i].friendly && !Main.npc[i].dontTakeDamageFromHostiles)) && (projectile.owner < 0 || Main.npc[i].immune[projectile.owner] == 0 || projectile.maxPenetrate == 1))
{
if (Main.npc[i].noTileCollide || !projectile.ownerHitCheck || projectile.CanHit(Main.npc[i]))
{
bool flag3;
if (Main.npc[i].type == 414)
{
Rectangle rect = Main.npc[i].getRect();
int num5 = 8;
rect.X -= num5;
rect.Y -= num5;
rect.Width += num5 * 2;
rect.Height += num5 * 2;
flag3 = projectile.Colliding(myRect, rect);
}
else
{
flag3 = projectile.Colliding(myRect, Main.npc[i].getRect());
}
if (flag3)
{
if (Main.npc[i].reflectingProjectiles && projectile.CanReflect())
{
Main.npc[i].ReflectProjectile(projectile.whoAmI);
return;
}
projectile.ai[0] = 1f;
projectile.ai[1] = (float)i;
projectile.velocity = (Main.npc[i].Center - projectile.Center) * 0.75f;
projectile.netUpdate = true;
projectile.StatusNPC(i);
int num28 = 1;
Point[] array2 = new Point[num28];
int num29 = 0;
for (int l = 0; l < 1000; l++)
{
if (l != projectile.whoAmI && Main.projectile[l].active && Main.projectile[l].owner == Main.myPlayer && Main.projectile[l].type == projectile.type && Main.projectile[l].ai[0] == 1f && Main.projectile[l].ai[1] == (float)i)
{
array2[num29++] = new Point(l, Main.projectile[l].timeLeft);
if (num29 >= array2.Length)
{
break;
}
}
}
if (num29 >= array2.Length)
{
int num30 = 0;
for (int m = 1; m < array2.Length; m++)
{
if (array2[m].Y < array2[num30].Y)
{
num30 = m;
}
}
Main.projectile[array2[num30].X].Kill();
}
}
}
}
}
}
}
public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox)
{
if (targetHitbox.Width > 8 && targetHitbox.Height > 8)
{
targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8);
}
return null;
}
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
{
if (target.type == ModContent.NPCType<Cryogen>() || target.type == ModContent.NPCType<BrimstoneElemental>() || target.type == NPCID.SkeletronPrime)
{
target.buffImmune[BuffID.Venom] = false;
}
else if (target.buffImmune[BuffID.Venom] && !target.boss && target.aiStyle != 6 && target.type != ModContent.NPCType<EidolonWyrmHeadHuge>())
{
target.buffImmune[BuffID.Venom] = false;
}
target.AddBuff(BuffID.Venom, 600);
}
public override void Kill(int timeLeft)
{
Main.PlaySound(2, (int)projectile.position.X, (int)projectile.position.Y, 14);
for (int num621 = 0; num621 < 8; num621++)
{
int num622 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width, projectile.height, 85, 0f, 0f, 100, default, 1f);
Main.dust[num622].velocity *= 1f;
}
if (projectile.owner == Main.myPlayer)
{
int num320 = Main.rand.Next(2, 6);
int num3;
for (int num321 = 0; num321 < num320; num321 = num3 + 1)
{
Vector2 vector15 = new Vector2((float)Main.rand.Next(-100, 101), (float)Main.rand.Next(-100, 101));
vector15.Normalize();
vector15 *= (float)Main.rand.Next(10, 201) * 0.01f;
Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, vector15.X, vector15.Y, ModContent.ProjectileType<ScourgeVenomCloud>(), (int)((double)projectile.damage * 0.50), 1f, projectile.owner, 0f, (float)Main.rand.Next(-45, 1));
num3 = num321;
}
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
return false;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB