StartRain added to utils, vigil nerf
This commit is contained in:
1 parent
a4e32191f8
commit
db7c53381b
11 files changed
+74
-227
No files matched your search
@@ -804,7 +804,7 @@ namespace CalamityMod.Items
|
||||
if (item.type == ModContent.ItemType<ProfanedSoulCrystal>())
|
||||
tt2.overrideColor = new Color(255 - Main.DiscoG < 80 ? 80 : Main.DiscoG < 50 ? 255 : 255 - Main.DiscoG, Main.DiscoG < 126 ? 126 : Main.DiscoG, 0); //alternates between emerald green and amber (BanditHueh)
|
||||
|
||||
// Uniquely colored legendary weapons and Yharim's Crystal
|
||||
// Uniquely colored legendary weapons and Yharim's Crystal
|
||||
if (item.type == ModContent.ItemType<AegisBlade>() || item.type == ModContent.ItemType<YharimsCrystal>())
|
||||
tt2.overrideColor = new Color(255, Main.DiscoG, 53);
|
||||
if (item.type == ModContent.ItemType<BlossomFlux>())
|
||||
|
||||
@@ -26,12 +26,12 @@ namespace CalamityMod.Items.Tools.ClimateChange
|
||||
item.consumable = true;
|
||||
}
|
||||
|
||||
// this is extremely ugly and has to be fully qualified because we add an item called Sandstorm
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
return CalamityWorld.downedDesertScourge;
|
||||
}
|
||||
|
||||
// this is extremely ugly and has to be fully qualified because we add an item called Sandstorm
|
||||
public override bool UseItem(Player player)
|
||||
{
|
||||
if (Terraria.GameContent.Events.Sandstorm.Happening)
|
||||
|
||||
@@ -39,53 +39,7 @@ namespace CalamityMod.Items.Tools.ClimateChange
|
||||
{
|
||||
if (!Main.raining)
|
||||
{
|
||||
int num = 86400;
|
||||
int num2 = num / 24;
|
||||
Main.rainTime = Main.rand.Next(num2 * 8, num);
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2);
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 2);
|
||||
}
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 2);
|
||||
}
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 3);
|
||||
}
|
||||
if (Main.rand.NextBool(7))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 4);
|
||||
}
|
||||
if (Main.rand.NextBool(8))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 5);
|
||||
}
|
||||
float num3 = 1f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
num3 += 0.05f;
|
||||
}
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
num3 += 0.1f;
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
num3 += 0.15f;
|
||||
}
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
num3 += 0.2f;
|
||||
}
|
||||
Main.rainTime = (int)((float)Main.rainTime * num3);
|
||||
AdjustRainSeverity(false);
|
||||
Main.raining = true;
|
||||
CalamityUtils.StartRain(true);
|
||||
}
|
||||
else if (CalamityWorld.death)
|
||||
{
|
||||
@@ -116,7 +70,7 @@ namespace CalamityMod.Items.Tools.ClimateChange
|
||||
return true;
|
||||
}
|
||||
|
||||
private void AdjustRainSeverity(bool maxSeverity)
|
||||
public static void AdjustRainSeverity(bool maxSeverity)
|
||||
{
|
||||
if (maxSeverity)
|
||||
{
|
||||
|
||||
+1
-52
@@ -164,7 +164,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
|
||||
if (!Main.raining && !CalamityWorld.bossRushActive)
|
||||
{
|
||||
RainStart();
|
||||
CalamityUtils.StartRain();
|
||||
}
|
||||
|
||||
if (!player.active || player.dead)
|
||||
@@ -1044,57 +1044,6 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
}
|
||||
|
||||
private void RainStart()
|
||||
{
|
||||
int num = 86400;
|
||||
int num2 = num / 24;
|
||||
Main.rainTime = Main.rand.Next(num2 * 8, num);
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2);
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 2);
|
||||
}
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 2);
|
||||
}
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 3);
|
||||
}
|
||||
if (Main.rand.NextBool(7))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 4);
|
||||
}
|
||||
if (Main.rand.NextBool(8))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 5);
|
||||
}
|
||||
float num3 = 1f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
num3 += 0.05f;
|
||||
}
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
num3 += 0.1f;
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
num3 += 0.15f;
|
||||
}
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
num3 += 0.2f;
|
||||
}
|
||||
Main.rainTime = (int)((float)Main.rainTime * num3);
|
||||
Main.raining = true;
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
}
|
||||
|
||||
public override void BossLoot(ref string name, ref int potionType)
|
||||
{
|
||||
potionType = ItemID.GreaterHealingPotion;
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
}
|
||||
if (!Main.raining && !CalamityWorld.bossRushActive && CalamityWorld.DoGSecondStageCountdown <= 0)
|
||||
{
|
||||
RainStart();
|
||||
CalamityUtils.StartRain();
|
||||
}
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.2f, 0.05f, 0.2f);
|
||||
if (npc.ai[3] > 0f)
|
||||
@@ -463,57 +463,6 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f;
|
||||
}
|
||||
|
||||
private void RainStart()
|
||||
{
|
||||
int num = 86400;
|
||||
int num2 = num / 24;
|
||||
Main.rainTime = Main.rand.Next(num2 * 8, num);
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2);
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 2);
|
||||
}
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 2);
|
||||
}
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 3);
|
||||
}
|
||||
if (Main.rand.NextBool(7))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 4);
|
||||
}
|
||||
if (Main.rand.NextBool(8))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 5);
|
||||
}
|
||||
float num3 = 1f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
num3 += 0.05f;
|
||||
}
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
num3 += 0.1f;
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
num3 += 0.15f;
|
||||
}
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
num3 += 0.2f;
|
||||
}
|
||||
Main.rainTime = (int)((float)Main.rainTime * num3);
|
||||
Main.raining = true;
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
}
|
||||
|
||||
public override bool CanHitPlayer(Player target, ref int cooldownSlot)
|
||||
{
|
||||
cooldownSlot = 1;
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
}
|
||||
if (!Main.raining && !CalamityWorld.bossRushActive && CalamityWorld.DoGSecondStageCountdown <= 0)
|
||||
{
|
||||
RainStart();
|
||||
CalamityUtils.StartRain();
|
||||
}
|
||||
double lifeRatio = (double)npc.life / (double)npc.lifeMax;
|
||||
int lifePercentage = (int)(100.0 * lifeRatio);
|
||||
@@ -441,57 +441,6 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
npc.rotation = (float)System.Math.Atan2((double)npc.velocity.Y, (double)npc.velocity.X) + 1.57f;
|
||||
}
|
||||
|
||||
private void RainStart()
|
||||
{
|
||||
int num = 86400;
|
||||
int num2 = num / 24;
|
||||
Main.rainTime = Main.rand.Next(num2 * 8, num);
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2);
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 2);
|
||||
}
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 2);
|
||||
}
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 3);
|
||||
}
|
||||
if (Main.rand.NextBool(7))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 4);
|
||||
}
|
||||
if (Main.rand.NextBool(8))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 5);
|
||||
}
|
||||
float num3 = 1f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
num3 += 0.05f;
|
||||
}
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
num3 += 0.1f;
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
num3 += 0.15f;
|
||||
}
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
num3 += 0.2f;
|
||||
}
|
||||
Main.rainTime = (int)((float)Main.rainTime * num3);
|
||||
Main.raining = true;
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
|
||||
{
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
projectile.ignoreWater = true;
|
||||
projectile.minion = true;
|
||||
projectile.minionSlots = 0f;
|
||||
projectile.penetrate = 2;
|
||||
projectile.penetrate = 1;
|
||||
projectile.extraUpdates = 3;
|
||||
projectile.timeLeft = 50;
|
||||
}
|
||||
@@ -79,7 +79,6 @@ namespace CalamityMod.Projectiles.Summon
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120);
|
||||
target.immune[projectile.owner] = 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -202,8 +202,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
}
|
||||
if (num651 > 2000f)
|
||||
{
|
||||
projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2);
|
||||
projectile.position.X = player.Center.X - (float)(projectile.width / 2);
|
||||
projectile.position.Y = player.Center.Y - (float)(projectile.height / 2);
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
if (num651 > 70f)
|
||||
@@ -240,7 +240,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
{
|
||||
projectile.ai[1] += (float)Main.rand.Next(1, 4);
|
||||
}
|
||||
if (projectile.ai[1] > 90f)
|
||||
if (projectile.ai[1] > 110f)
|
||||
{
|
||||
projectile.ai[1] = 0f;
|
||||
projectile.netUpdate = true;
|
||||
@@ -257,8 +257,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Vector2 value19 = vector46 - projectile.Center;
|
||||
value19.Normalize();
|
||||
value19 *= scaleFactor3;
|
||||
int num659 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projectile.damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[num659].timeLeft = 300;
|
||||
int num659 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projectile.damage, 0f, projectile.owner, 0f, 0f);
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -256,8 +256,7 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Vector2 value19 = vector46 - projectile.Center;
|
||||
value19.Normalize();
|
||||
value19 *= scaleFactor3;
|
||||
int num659 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projectile.damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
Main.projectile[num659].timeLeft = 50;
|
||||
int num659 = Projectile.NewProjectile(projectile.Center.X, projectile.Center.Y, value19.X, value19.Y, num658, projectile.damage, 0f, projectile.owner, 0f, 0f);
|
||||
projectile.netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -292,10 +292,5 @@ namespace CalamityMod.Projectiles.Summon
|
||||
Main.spriteBatch.Draw(texture2D13, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, num214)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)num214 / 2f), projectile.scale, spriteEffects, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.immune[projectile.owner] = 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.CalPlayer;
|
||||
using CalamityMod.Items;
|
||||
using CalamityMod.Items.Tools.ClimateChange;
|
||||
using CalamityMod.NPCs;
|
||||
using CalamityMod.Projectiles;
|
||||
using CalamityMod.Tiles;
|
||||
@@ -2080,18 +2081,18 @@ namespace CalamityMod
|
||||
Lighting.AddLight(projectile.Center, 0.4f, 0f, 0.4f);
|
||||
|
||||
Player player = Main.player[projectile.owner];
|
||||
if (projectile.bobber && Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].holdStyle > 0)
|
||||
if (projectile.bobber && player.inventory[player.selectedItem].holdStyle > 0)
|
||||
{
|
||||
float pPosX = player.MountedCenter.X;
|
||||
float pPosY = player.MountedCenter.Y;
|
||||
pPosY += Main.player[projectile.owner].gfxOffY;
|
||||
int type = Main.player[projectile.owner].inventory[Main.player[projectile.owner].selectedItem].type;
|
||||
float gravDir = Main.player[projectile.owner].gravDir;
|
||||
pPosY += player.gfxOffY;
|
||||
int type = player.inventory[player.selectedItem].type;
|
||||
float gravDir = player.gravDir;
|
||||
|
||||
if (type == fishingRodType)
|
||||
{
|
||||
pPosX += (float)(xPositionAdditive * Main.player[projectile.owner].direction);
|
||||
if (Main.player[projectile.owner].direction < 0)
|
||||
pPosX += (float)(xPositionAdditive * player.direction);
|
||||
if (player.direction < 0)
|
||||
{
|
||||
pPosX -= 13f;
|
||||
}
|
||||
@@ -2103,7 +2104,7 @@ namespace CalamityMod
|
||||
pPosY -= 12f;
|
||||
}
|
||||
Vector2 mountedCenter = new Vector2(pPosX, pPosY);
|
||||
mountedCenter = Main.player[projectile.owner].RotatedRelativePoint(mountedCenter + new Vector2(8f), true) - new Vector2(8f);
|
||||
mountedCenter = player.RotatedRelativePoint(mountedCenter + new Vector2(8f), true) - new Vector2(8f);
|
||||
float projPosX = projectile.position.X + (float)projectile.width * 0.5f - mountedCenter.X;
|
||||
float projPosY = projectile.position.Y + (float)projectile.height * 0.5f - mountedCenter.Y;
|
||||
Math.Sqrt((double)(projPosX * projPosX + projPosY * projPosY));
|
||||
@@ -2382,6 +2383,59 @@ namespace CalamityMod
|
||||
(sfx.Volume, sfx.Pan) = CalculateSoundStats(soundPos, ambient);
|
||||
}
|
||||
|
||||
public static void StartRain(bool torrentialTear = false)
|
||||
{
|
||||
int num = 86400;
|
||||
int num2 = num / 24;
|
||||
Main.rainTime = Main.rand.Next(num2 * 8, num);
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2);
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 2);
|
||||
}
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 2);
|
||||
}
|
||||
if (Main.rand.NextBool(6))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 3);
|
||||
}
|
||||
if (Main.rand.NextBool(7))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 4);
|
||||
}
|
||||
if (Main.rand.NextBool(8))
|
||||
{
|
||||
Main.rainTime += Main.rand.Next(0, num2 * 5);
|
||||
}
|
||||
float num3 = 1f;
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
num3 += 0.05f;
|
||||
}
|
||||
if (Main.rand.NextBool(3))
|
||||
{
|
||||
num3 += 0.1f;
|
||||
}
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
num3 += 0.15f;
|
||||
}
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
num3 += 0.2f;
|
||||
}
|
||||
Main.rainTime = (int)((float)Main.rainTime * num3);
|
||||
Main.raining = true;
|
||||
if (torrentialTear)
|
||||
TorrentialTear.AdjustRainSeverity(false);
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
}
|
||||
|
||||
public static void StartSandstorm()
|
||||
{
|
||||
typeof(Terraria.GameContent.Events.Sandstorm).GetMethod("StartSandstorm", BindingFlags.Static | BindingFlags.NonPublic).Invoke(null, null);
|
||||
|
||||
Reference in new issue
Block a user