Merge branch 'master' of https://github.com/UncleDanny/CalamityMod
No files matched your search
@@ -1,3 +1,4 @@
|
||||
using Terraria;
|
||||
using Terraria.Graphics.Shaders;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -12,7 +13,10 @@ namespace CalamityMod.Items.Dyes
|
||||
}
|
||||
public sealed override void SetStaticDefaults()
|
||||
{
|
||||
GameShaders.Armor.BindShader(item.type, ShaderDataToBind);
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
GameShaders.Armor.BindShader(item.type, ShaderDataToBind);
|
||||
}
|
||||
SafeSetStaticDefaults();
|
||||
}
|
||||
public sealed override void SetDefaults()
|
||||
|
||||
|
Before Width: | Height: | Size: 525 B After Width: | Height: | Size: 522 B |
|
Before Width: | Height: | Size: 551 B After Width: | Height: | Size: 725 B |
@@ -38,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Magic
|
||||
|
||||
public override Vector2? HoldoutOrigin()
|
||||
{
|
||||
return new Vector2(15, 15);
|
||||
return new Vector2(10, 10);
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.World;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -10,7 +11,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Aurora Spirit");
|
||||
Main.npcFrameCount[npc.type] = 6;
|
||||
Main.npcFrameCount[npc.type] = 5;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
@@ -27,13 +28,40 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.lifeMax = 30000;
|
||||
}
|
||||
npc.knockBackResist = 0f;
|
||||
animationType = 472;
|
||||
npc.canGhostHeal = false;
|
||||
npc.HitSound = SoundID.NPCHit5;
|
||||
npc.DeathSound = SoundID.NPCDeath15;
|
||||
npc.coldDamage = true;
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
{
|
||||
int num1 = 1;
|
||||
if (!Main.dedServ)
|
||||
{
|
||||
if (!Main.NPCLoaded[npc.type] || Main.npcTexture[npc.type] == null)
|
||||
return;
|
||||
num1 = Main.npcTexture[npc.type].Height / Main.npcFrameCount[npc.type];
|
||||
}
|
||||
if (npc.velocity.X < 0f)
|
||||
npc.direction = -1;
|
||||
else
|
||||
npc.direction = 1;
|
||||
if (npc.direction == 1)
|
||||
npc.spriteDirection = 1;
|
||||
if (npc.direction == -1)
|
||||
npc.spriteDirection = -1;
|
||||
npc.rotation = (float)Math.Atan2((double)npc.velocity.Y * (double)npc.direction, (double)npc.velocity.X * (double)npc.direction);
|
||||
npc.frameCounter++;
|
||||
if (npc.frameCounter > 4)
|
||||
{
|
||||
npc.frame.Y += num1;
|
||||
npc.frameCounter = 0;
|
||||
}
|
||||
if (npc.frame.Y / num1 >= Main.npcFrameCount[npc.type])
|
||||
npc.frame.Y = 0;
|
||||
}
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.Frostburn, 90, true);
|
||||
|
||||
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
@@ -1,6 +1,7 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
@@ -9,12 +10,14 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Bolt");
|
||||
ProjectileID.Sets.TrailCacheLength[projectile.type] = 2;
|
||||
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 8;
|
||||
projectile.height = 8;
|
||||
projectile.width = 16;
|
||||
projectile.height = 16;
|
||||
projectile.friendly = true;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.penetrate = 1;
|
||||
@@ -24,27 +27,26 @@ namespace CalamityMod.Projectiles.Magic
|
||||
public override void AI()
|
||||
{
|
||||
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 0.25f / 255f, (255 - projectile.alpha) * 0.25f / 255f);
|
||||
for (int num151 = 0; num151 < 3; num151++)
|
||||
{
|
||||
int num154 = 14;
|
||||
int num155 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default, 1.5f);
|
||||
Main.dust[num155].noGravity = true;
|
||||
Main.dust[num155].velocity *= 0.1f;
|
||||
Main.dust[num155].velocity += projectile.velocity * 0.5f;
|
||||
}
|
||||
if (Main.rand.NextBool(8))
|
||||
int num154 = 14;
|
||||
int num155 = Dust.NewDust(projectile.Center, projectile.width - num154 * 2, projectile.height - num154 * 2, 68, 0f, 0f, 100, default, 1.5f);
|
||||
Main.dust[num155].noGravity = true;
|
||||
Main.dust[num155].velocity *= 0.1f;
|
||||
Main.dust[num155].velocity += projectile.velocity * 0.5f;
|
||||
if (Main.rand.NextBool(16))
|
||||
{
|
||||
int num156 = 16;
|
||||
int num157 = Dust.NewDust(new Vector2(projectile.position.X, projectile.position.Y), projectile.width - num156 * 2, projectile.height - num156 * 2, 68, 0f, 0f, 100, default, 1f);
|
||||
int num157 = Dust.NewDust(projectile.Center, projectile.width - num156 * 2, projectile.height - num156 * 2, 68, 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num157].velocity *= 0.25f;
|
||||
Main.dust[num157].velocity += projectile.velocity * 0.5f;
|
||||
}
|
||||
projectile.rotation += 0.3f * (float)projectile.direction;
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200);
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Texture2D tex = Main.projectileTexture[projectile.type];
|
||||
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
|
||||
CalamityGlobalProjectile.DrawCenteredAndAfterimage(projectile, lightColor, ProjectileID.Sets.TrailingMode[projectile.type], 1);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 306 B |
@@ -1,5 +1,8 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
@@ -12,8 +15,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
projectile.width = 2;
|
||||
projectile.height = 2;
|
||||
projectile.width = 10;
|
||||
projectile.height = 10;
|
||||
projectile.aiStyle = 45;
|
||||
projectile.friendly = true;
|
||||
projectile.penetrate = -1;
|
||||
@@ -23,17 +26,25 @@ namespace CalamityMod.Projectiles.Magic
|
||||
projectile.scale = 1.1f;
|
||||
projectile.magic = true;
|
||||
projectile.extraUpdates = 1;
|
||||
aiType = 239;
|
||||
aiType = ProjectileID.RainFriendly;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
Dust dust4 = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)];
|
||||
dust4.velocity = Vector2.Zero;
|
||||
dust4.position -= projectile.velocity / 5f;
|
||||
dust4.noGravity = true;
|
||||
dust4.scale = 0.8f;
|
||||
dust4.noLight = true;
|
||||
projectile.rotation = (float)Math.Atan2((double)projectile.velocity.Y, (double)projectile.velocity.X) - MathHelper.PiOver2;
|
||||
Dust dust = Main.dust[Dust.NewDust(projectile.position, projectile.width, projectile.height, 14, projectile.velocity.X, projectile.velocity.Y, 100, default, 1f)];
|
||||
dust.velocity = Vector2.Zero;
|
||||
dust.position -= projectile.velocity / 5f;
|
||||
dust.noGravity = true;
|
||||
dust.scale = 0.8f;
|
||||
dust.noLight = true;
|
||||
}
|
||||
|
||||
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
|
||||
{
|
||||
Texture2D tex = Main.projectileTexture[projectile.type];
|
||||
spriteBatch.Draw(tex, projectile.Center - Main.screenPosition, null, projectile.GetAlpha(lightColor), projectile.rotation, tex.Size() / 2f, projectile.scale, SpriteEffects.None, 0f);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 136 B After Width: | Height: | Size: 183 B |
@@ -147,14 +147,8 @@ namespace CalamityMod.Projectiles.Summon
|
||||
}
|
||||
}
|
||||
|
||||
public override Color? GetAlpha(Color lightColor)
|
||||
{
|
||||
return new Color(200, 200, 200, 200);
|
||||
}
|
||||
public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200);
|
||||
|
||||
public override bool CanDamage()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public override bool CanDamage() => false;
|
||||
}
|
||||
}
|
||||
@@ -968,17 +968,31 @@ namespace CalamityMod.World
|
||||
|
||||
if (rainingAcid)
|
||||
{
|
||||
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
|
||||
{
|
||||
if (Main.player[playerIndex].active)
|
||||
{
|
||||
if (Main.player[playerIndex].Calamity().ZoneSulphur)
|
||||
{
|
||||
startAcidicDownpour = true;
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!startAcidicDownpour)
|
||||
{
|
||||
int sulphSeaWidth = Abyss.BiomeWidth;
|
||||
for (int playerIndex = 0; playerIndex < Main.maxPlayers; playerIndex++)
|
||||
{
|
||||
// A variable named "player" already exists above, which retrieves the player who is closest to the map center.
|
||||
Player player2 = Main.player[playerIndex];
|
||||
if (player2.active)
|
||||
{
|
||||
// An artificial biome can be made, and therefore, the event could be started by an artificial biome.
|
||||
// While fighting the event in an artificial biome is not bad, having it be started by a patch of Sulphurous Sand
|
||||
// would definitely be strange.
|
||||
// Because of this, this code is executed based on if the player is in the sea (based on tile count) AND position relative to the naturally generated sea.
|
||||
if (((player2.Center.X <= (sulphSeaWidth + 60f) * 16f && abyssSide) ||
|
||||
(player2.Center.X >= (Main.maxTilesX - (sulphSeaWidth + 60f)) * 16f && !abyssSide)) &&
|
||||
player2.Calamity().ZoneSulphur)
|
||||
{
|
||||
startAcidicDownpour = true;
|
||||
CalamityMod.UpdateServerBoolean();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Makes rain pour at its maximum intensity (but only after an idiot meanders into the Sulphurous Sea)
|
||||
// You'll never catch me, Fabs, Not when I shift into MAXIMUM OVERDRIVE!!
|
||||
if (startAcidicDownpour || forcedDownpourWithTear)
|
||||
@@ -994,7 +1008,7 @@ namespace CalamityMod.World
|
||||
}
|
||||
|
||||
// Summon Old Duke tornado post-Polter as needed
|
||||
if (downedPolterghast && acidRainPoints == 2f)
|
||||
if (downedPolterghast && acidRainPoints == 2)
|
||||
{
|
||||
if (!NPC.AnyNPCs(ModContent.NPCType<OldDuke>()) &&
|
||||
CalamityUtils.CountProjectiles(ModContent.ProjectileType<OverlyDramaticDukeSummoner>()) <= 0)
|
||||
|
||||