This commit is contained in:
Done2222 committed 2023-09-05 20:44:40 +03:00
commit 90644dc327
24 files changed
+69 -85

No files matched your search

+9 -1
View File
@@ -1,6 +1,8 @@
using System;
using CalamityMod.Balancing;
using CalamityMod.Items.Accessories;
using CalamityMod.Items.Placeables.FurniturePlagued;
using CalamityMod.NPCs.DraedonLabThings;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using Terraria;
@@ -11,7 +13,7 @@ namespace CalamityMod.ILEditing
{
public partial class ILChanges
{
#region Rod of Harmony Changes
#region Shimmer Changes
private static bool AdjustShimmerRequirements(On_Item.orig_CanShimmer orig, Item item)
{
@@ -20,6 +22,12 @@ namespace CalamityMod.ILEditing
{
return DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs;
}
if (item.type == ModContent.ItemType<PlaguedContainmentBrick>())
{
return NPC.downedGolemBoss ? orig(item) : false;
}
return orig(item);
}
+1 -1
View File
@@ -625,7 +625,7 @@ namespace CalamityMod.Items
if (player.HasBuff(BuffID.ParryDamageBuff))
{
if (item.type != ItemID.DD2SquireDemonSword)
if (item.type != ItemID.DD2SquireDemonSword && item.type != ItemID.BouncingShield)
{
player.parryDamageBuff = false;
player.ClearBuff(BuffID.ParryDamageBuff);
-5
View File
@@ -28,11 +28,6 @@ namespace CalamityMod.Items.Placeables
AddIngredient<EutrophicSandWallSafe>(4).
AddTile(TileID.WorkBenches).
Register();
CreateRecipe().
AddIngredient<EutrophicSandWall>(4).
AddTile(TileID.WorkBenches).
Register();
}
}
}
-5
View File
@@ -35,11 +35,6 @@ namespace CalamityMod.Items.Placeables
AddTile(TileID.WorkBenches).
Register();
CreateRecipe().
AddIngredient<NavystoneWall>(4).
AddTile(TileID.WorkBenches).
Register();
CreateRecipe().
AddIngredient<EutrophicPlatform>(2).
AddTile<EutrophicShelf>().
+1 -5
View File
@@ -10,6 +10,7 @@ namespace CalamityMod.Items.Placeables.Walls
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 400;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<EutrophicSandWallSafe>();
}
public override void SetDefaults()
@@ -25,10 +26,5 @@ namespace CalamityMod.Items.Placeables.Walls
Item.consumable = true;
Item.createWall = ModContent.WallType<WallTiles.EutrophicSandWall>();
}
public override void AddRecipes()
{
CreateRecipe(4).AddIngredient(ModContent.ItemType<EutrophicSand>()).AddTile(TileID.WorkBenches).Register();
}
}
}
@@ -10,6 +10,7 @@ namespace CalamityMod.Items.Placeables.Walls
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 400;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<EutrophicSandWall>();
}
public override void SetDefaults()
+1 -5
View File
@@ -9,6 +9,7 @@ namespace CalamityMod.Items.Placeables.Walls
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 400;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<NavystoneWallSafe>();
}
public override void SetDefaults()
@@ -24,10 +25,5 @@ namespace CalamityMod.Items.Placeables.Walls
Item.consumable = true;
Item.createWall = ModContent.WallType<WallTiles.NavystoneWall>();
}
public override void AddRecipes()
{
CreateRecipe(4).AddIngredient(ModContent.ItemType<Navystone>()).AddTile(TileID.WorkBenches).Register();
}
}
}
@@ -9,6 +9,7 @@ namespace CalamityMod.Items.Placeables.Walls
public override void SetStaticDefaults()
{
Item.ResearchUnlockCount = 400;
ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType<NavystoneWall>();
}
public override void SetDefaults()
+1 -1
View File
@@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.useTime = 18;
Item.width = 44;
Item.height = 44;
Item.damage = 218;
Item.damage = 109;
Item.knockBack = 9f;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
+2 -2
View File
@@ -10,7 +10,7 @@ namespace CalamityMod.Items.Weapons.Melee
public new string LocalizationCategory => "Items.Weapons.Melee";
public override void SetDefaults()
{
Item.damage = 33;
Item.damage = 20;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.width = 44;
Item.height = 36;
@@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.autoReuse = true;
Item.channel = true;
Item.shoot = ModContent.ProjectileType<UrchinBall>();
Item.shootSpeed = 12f;
Item.shootSpeed = 16f;
}
}
}
+3 -3
View File
@@ -15,11 +15,11 @@ namespace CalamityMod.Items.Weapons.Ranged
}
public override void SetDefaults()
{
Item.damage = 60;
Item.damage = 51;
Item.DamageType = DamageClass.Ranged;
Item.width = 88;
Item.height = 28;
Item.useTime = Item.useAnimation = 8;
Item.useTime = Item.useAnimation = 11;
Item.useStyle = ItemUseStyleID.Shoot;
Item.useTurn = false;
Item.noMelee = true;
@@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
float angle = velocity.ToRotation() + MathHelper.PiOver2;
if (angle <= -MathHelper.PiOver4 || angle >= MathHelper.PiOver4)
if (angle <= -(MathHelper.Pi / 3) || angle >= (MathHelper.Pi / 3))
return false;
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<ToxicannonShot>(), damage, knockback, player.whoAmI);
+3 -3
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue
{
public class Penumbra : RogueWeapon
{
public static float ShootSpeed = 8f;
public static float ShootSpeed = 9f;
public override void SetDefaults()
{
Item.width = 46;
@@ -24,12 +24,12 @@ namespace CalamityMod.Items.Weapons.Rogue
Item.UseSound = SoundID.Item103;
Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice;
Item.damage = 1008;
Item.damage = 830;
Item.useAnimation = 40;
Item.useTime = 40;
Item.knockBack = 8f;
Item.shoot = ModContent.ProjectileType<PenumbraBomb>();
Item.shootSpeed = ShootSpeed;
Item.shootSpeed = 9f;
Item.rare = ModContent.RarityType<DarkBlue>();
Item.DamageType = RogueDamageClass.Instance;
@@ -471,7 +471,7 @@ FlakToxicannon: {
Tooltip:
'''
Fires angled shots in the direction of the cursor
Can only be shot in a cone direction above the player
Can only be shot in a wide cone above the player
'High IQ required'
'''
}
@@ -839,7 +839,7 @@ Penumbra: {
DisplayName: Penumbra
Tooltip:
'''
Throws a shadow bomb that explodes into homing souls
Throws a shadow bomb that explodes into homing souls and flames
Stealth strikes make the bomb manifest on the cursor and explode into more souls
'''
}
+4 -10
View File
@@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Melee
public bool initialized = false;
public float startingVelocityY = 0f;
public float randomAngleDelta = 0f;
public const float explosionDamageMultiplier = 1.8f;
public const float explosionDamageMultiplier = 1.5f;
public override void SetDefaults()
{
Projectile.width = 12;
@@ -47,7 +47,6 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[dustID].noGravity = true;
Main.dust[dustID].velocity *= 0f;
}
Projectile.velocity.Y *= 0.965f;
}
if (Projectile.localAI[0] % 30 == 0) // every 0.5 seconds
{
@@ -60,21 +59,16 @@ namespace CalamityMod.Projectiles.Melee
Vector2 idealVelocity = Projectile.SafeDirectionTo(target.Center, Vector2.UnitX) * homingSpeed;
Projectile.velocity = (Projectile.velocity * (inertia - 1f) + idealVelocity) / inertia;
}
else
{
Projectile.ai[0]++;
Projectile.velocity.Y = startingVelocityY + (float)(Math.Cos(Projectile.ai[0] / 12D + randomAngleDelta) * 7D);
}
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
// for spawning the side beams
for (int i = 0; i < 3; i++)
for (int i = 0; i < 2; i++)
{
int directionSign = Main.rand.NextBool(2).ToDirectionInt();
Vector2 spawnPos = new Vector2(target.Center.X + directionSign * 650, Projectile.Center.Y + Main.rand.Next(-500, 501));
Vector2 velocity = Vector2.Normalize(target.Center - spawnPos) * 30f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType<CosmicShivBlade>(), Projectile.damage, Projectile.knockBack * 0.1f, Projectile.owner);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos.X, spawnPos.Y, velocity.X, velocity.Y, ModContent.ProjectileType<CosmicShivBlade>(), (int)(Projectile.damage * 0.8f), Projectile.knockBack * 0.1f, Projectile.owner);
}
int starMax = Main.rand.Next(6, 11); // 6 to 10 stars
for (int i = -starMax / 2; i < starMax / 2; i++)
@@ -82,7 +76,7 @@ namespace CalamityMod.Projectiles.Melee
int ySpawnAdditive = Main.rand.Next(-40, 41);
Vector2 toSpawn = target.Center - new Vector2(0f, 800f + ySpawnAdditive).RotatedBy(MathHelper.ToRadians(i * 11f / starMax));
Vector2 toTarget = Vector2.Normalize(target.Center - toSpawn) * 35f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), toSpawn, toTarget, ModContent.ProjectileType<GalaxyStar>(), Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), toSpawn, toTarget, ModContent.ProjectileType<GalaxyStar>(), Projectile.damage, Projectile.knockBack * 0.5f, Projectile.owner);
}
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 60);
}
+3 -9
View File
@@ -22,6 +22,8 @@ namespace CalamityMod.Projectiles.Melee
Projectile.penetrate = penetrateMax;
Projectile.tileCollide = false;
Projectile.timeLeft = 290;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 5;
}
public override void AI()
{
@@ -58,16 +60,8 @@ namespace CalamityMod.Projectiles.Melee
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
if (Projectile.penetrate == penetrateMax)
{
Projectile.damage /= 15;
}
else
{
Projectile.scale += (maxScale - 1) / (float)penetrateMax;
}
Projectile.scale += (maxScale - 1) / (float)penetrateMax;
Projectile.ai[1] = 5 + Main.rand.Next(-2, 3);
target.immune[Projectile.owner] = 0; //so that all blades can hit the enemy
target.AddBuff(ModContent.BuffType<GodSlayerInferno>(), 120);
}
+1
View File
@@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.penetrate = 1;
Projectile.tileCollide = false;
Projectile.timeLeft = 160;
Projectile.extraUpdates = 2;
}
public override void AI()
{
+19 -20
View File
@@ -25,8 +25,8 @@ namespace CalamityMod.Projectiles.Melee
Projectile.DamageType = DamageClass.MeleeNoSpeed;
Projectile.alpha = 255;
Projectile.penetrate = 1;
Projectile.timeLeft = 300;
Projectile.extraUpdates = 3;
Projectile.timeLeft = 375;
Projectile.extraUpdates = 4;
}
public override bool? CanHitNPC(NPC target) => Projectile.timeLeft < 270 && target.CanBeChasedBy(Projectile);
@@ -53,12 +53,12 @@ namespace CalamityMod.Projectiles.Melee
for (int num369 = 0; num369 < 1; num369++)
{
int dustType = Main.rand.NextBool(3) ? 56 : 242;
float num370 = Projectile.velocity.X / 3f * num369;
float num371 = Projectile.velocity.Y / 3f * num369;
float dustX = Projectile.velocity.X / 3f * num369;
float dustY = Projectile.velocity.Y / 3f * num369;
int num372 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, 0f, 0f, 0, default, 1f);
Dust dust = Main.dust[num372];
dust.position.X = Projectile.Center.X - num370;
dust.position.Y = Projectile.Center.Y - num371;
dust.position.X = Projectile.Center.X - dustX;
dust.position.Y = Projectile.Center.Y - dustY;
dust.velocity *= 0f;
dust.scale = 0.5f;
}
@@ -68,41 +68,40 @@ namespace CalamityMod.Projectiles.Melee
float num373 = Projectile.position.X;
float num374 = Projectile.position.Y;
float num375 = 100000f;
bool flag10 = false;
bool isHoming = false;
Projectile.ai[0] += 1f;
if (Projectile.ai[0] > 30f)
{
Projectile.ai[0] = 30f;
for (int num376 = 0; num376 < Main.maxNPCs; num376++)
for (int enemy = 0; enemy < Main.maxNPCs; enemy++)
{
if (Main.npc[num376].CanBeChasedBy(Projectile, false))
if (Main.npc[enemy].CanBeChasedBy(Projectile, false))
{
float num377 = Main.npc[num376].position.X + Main.npc[num376].width / 2;
float num378 = Main.npc[num376].position.Y + Main.npc[num376].height / 2;
float num379 = Math.Abs(Projectile.position.X + Projectile.width / 2 - num377) + Math.Abs(Projectile.position.Y + Projectile.height / 2 - num378);
if (num379 < 800f && num379 < num375 && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[num376].position, Main.npc[num376].width, Main.npc[num376].height))
float enemyX = Main.npc[enemy].position.X + Main.npc[enemy].width / 2;
float enemyY = Main.npc[enemy].position.Y + Main.npc[enemy].height / 2;
float enemyDistance = Math.Abs(Projectile.position.X + Projectile.width / 2 - enemyX) + Math.Abs(Projectile.position.Y + Projectile.height / 2 - enemyY);
if (enemyDistance < 800f && enemyDistance < num375 && Collision.CanHit(Projectile.position, Projectile.width, Projectile.height, Main.npc[enemy].position, Main.npc[enemy].width, Main.npc[enemy].height))
{
num375 = num379;
num373 = num377;
num374 = num378;
flag10 = true;
num375 = enemyDistance;
num373 = enemyX;
num374 = enemyY;
isHoming = true;
}
}
}
}
if (!flag10)
if (!isHoming)
{
num373 = Projectile.position.X + Projectile.width / 2 + Projectile.velocity.X * 100f;
num374 = Projectile.position.Y + Projectile.height / 2 + Projectile.velocity.Y * 100f;
}
float num380 = 10f;
float num381 = 0.16f;
Vector2 vector30 = new Vector2(Projectile.position.X + Projectile.width * 0.5f, Projectile.position.Y + Projectile.height * 0.5f);
float num382 = num373 - vector30.X;
float num383 = num374 - vector30.Y;
float num384 = (float)Math.Sqrt(num382 * num382 + num383 * num383);
num384 = num380 / num384;
num384 = 10f / num384;
num382 *= num384;
num383 *= num384;
if (Projectile.velocity.X < num382)
+1 -1
View File
@@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Melee
float num629 = Main.rand.Next(-35, 36) * 0.02f;
num628 *= 10f;
num629 *= 10f;
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position.X, Projectile.position.Y, num628, num629, ModContent.ProjectileType<ScourgeoftheCosmosMini>(), (int)(Projectile.damage * 0.7), Projectile.knockBack * 0.35f, Main.myPlayer);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.position.X, Projectile.position.Y, num628, num629, ModContent.ProjectileType<ScourgeoftheCosmosMini>(), (int)(Projectile.damage * 0.75), Projectile.knockBack * 0.35f, Main.myPlayer);
num3 = num627;
}
}
@@ -30,7 +30,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
public override Action<Projectile> EffectBeforePullback => (proj) =>
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 14f, ModContent.ProjectileType<CosmicShivBall>(), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner, 0f, 0f);
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 14f, ModContent.ProjectileType<CosmicShivBall>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f);
};
public override void SetVisualOffsets()
+1 -1
View File
@@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.friendly = true;
Projectile.tileCollide = true;
Projectile.ignoreWater = false;
Projectile.timeLeft = 420;
Projectile.timeLeft = 300;
Projectile.DamageType = DamageClass.Ranged;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 17;
+5 -8
View File
@@ -71,16 +71,13 @@ namespace CalamityMod.Projectiles.Ranged
Main.dust[idx].scale = 3f;
Main.dust[idx].noGravity = true;
}
if (Main.rand.NextBool(3))
float count = Main.rand.Next(1, 2 + 1);
for (int i = 0; i < count; i++)
{
int count = Main.rand.Next(1, 3 + 1);
for (int i = 0; i < count; i++)
{
float angle = MathHelper.TwoPi * i / count;
angle += Main.rand.NextFloat(0.1f, 0.35f) * Main.rand.NextBool(2).ToDirectionInt();
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, angle.ToRotationVector2() * Main.rand.NextFloat(4f, 16f),
float angle = MathHelper.TwoPi * i / count;
angle += Main.rand.NextFloat(0.1f, 0.35f) * Main.rand.NextBool(2).ToDirectionInt();
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, angle.ToRotationVector2() * Main.rand.NextFloat(4f, 16f),
ModContent.ProjectileType<ToxicannonDrop>(), Projectile.damage, 2.5f, Projectile.owner);
}
}
}
+8 -1
View File
@@ -3,6 +3,8 @@ using Terraria.ID;
using Terraria.ModLoader;
using Microsoft.Xna.Framework;
using Terraria.Audio;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Buffs.DamageOverTime;
namespace CalamityMod.Projectiles.Rogue
{
@@ -23,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue
Projectile.height = 32;
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.timeLeft = 150;
Projectile.timeLeft = 300;
Projectile.extraUpdates = 2;
Projectile.DamageType = RogueDamageClass.Instance;
Projectile.ignoreWater = true;
@@ -72,6 +74,11 @@ namespace CalamityMod.Projectiles.Rogue
}
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone)
{
target.AddBuff(BuffID.Daybreak, 240);
target.AddBuff(ModContent.BuffType<Nightwither>(), 240);
}
public override void Kill(int timeLeft)
{
//Dark soul projectiles
+1 -1
View File
@@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.Rogue
private void HomingAI()
{
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, Penumbra.ShootSpeed * 1.5f, 35f);
CalamityUtils.HomeInOnNPC(Projectile, true, 200f, 12f, 35f);
}
public override bool PreDraw(ref Color lightColor)