This commit is contained in:
mountaindrew10 committed 2023-12-16 18:12:04 -06:00
commit a57f1cd30f
27 files changed
+477 -98

No files matched your search

+5 -2
View File
@@ -162,6 +162,9 @@ namespace CalamityMod.Balancing
// 40% resist to Flying Dragon.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.6f, ProjectileID.DD2SquireSonicBoom))));
// 30% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.RavagerIDs, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType<AuroraFire>()))));
#endregion
#region Duke Fishron
@@ -192,8 +195,8 @@ namespace CalamityMod.Balancing
// 70% resist to the Stardust Dragon.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.3f, ProjectileID.StardustDragon1, ProjectileID.StardustDragon2, ProjectileID.StardustDragon3, ProjectileID.StardustDragon4))));
// 70% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.3f, ProjectileType<AuroraFire>()))));
// 60% resist to Aurora Blazer.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(new ProjectileResistBalancingRule(0.4f, ProjectileType<AuroraFire>()))));
// 50% resist to true melee.
NPCSpecificBalancingChanges.AddRange(Bundle(CalamityLists.AstrumDeusIDs, Do(ResistTrueMelee(0.5f))));
+1
View File
@@ -2052,6 +2052,7 @@ namespace CalamityMod
ProjectileID.PiercingStarlight,
ProjectileID.Terragrim,
ProjectileType<AcidicSaxBubble>(),
ProjectileType<AuroraFire>(),
ProjectileType<BallisticPoisonCloud>(),
ProjectileType<BlushieStaffProj>(),
ProjectileType<BonebreakerProjectile>(),
+1 -1
View File
@@ -14,7 +14,7 @@ namespace CalamityMod.Items.Ammo
public override void SetDefaults()
{
Item.damage = 20;
Item.damage = 18;
Item.DamageType = DamageClass.Ranged;
Item.width = 8;
Item.height = 8;
+11 -12
View File
@@ -30,24 +30,23 @@ namespace CalamityMod.Items.Weapons.Melee
public int CanLunge = 1;
#region stats
public static int BaseDamage = 47;
public static int BaseDamage = 38;
public static int DefaultAttunement_BaseDamage = 47;
public static int DefaultAttunement_BaseDamage = 38;
public static int EvilAttunement_BaseDamage = 63;
public static int EvilAttunement_BaseDamage = 50;
public static int EvilAttunement_Lifesteal = 2;
public static int EvilAttunement_BounceIFrames = 10;
public static int ColdAttunement_BaseDamage = 58;
public static float ColdAttunement_SecondSwingBoost = 1.14f;
public static float ColdAttunement_ThirdSwingBoost = 1.4f;
public static int ColdAttunement_BaseDamage = 40;
public static float ColdAttunement_ThirdSwingBoost = 1.15f;
public static int HotAttunement_BaseDamage = 70;
public static int HotAttunement_FullChargeDamage = 105;
public static int HotAttunement_ShredIFrames = 8;
public static int HotAttunement_LocalIFrames = 30; //Be warned its got one extra update so all the iframes should be divided in 2
public static int HotAttunement_LocalIFramesCharged = 16;
public static float HotAttunement_ShredDecayRate = 0.7f; //How much charge is lost per frame.
public static int HotAttunement_BaseDamage = 35;
public static int HotAttunement_FullChargeDamage = 60;
public static int HotAttunement_ShredIFrames = 6;
public static int HotAttunement_LocalIFrames = 40; //Be warned its got one extra update so all the iframes should be divided in 2
public static int HotAttunement_LocalIFramesCharged = 25;
public static float HotAttunement_ShredDecayRate = 1f; //How much charge is lost per frame.
public static int TropicalAttunement_BaseDamage = 65;
public static float TropicalAttunement_ChainDamageReduction = 0.6f;
+3 -3
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee
public class DevilsSunrise : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Weapons.Melee";
public static int BaseDamage = 480;
public static int BaseDamage = 420;
public override void SetDefaults()
{
@@ -42,8 +42,8 @@ namespace CalamityMod.Items.Weapons.Melee
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<DevilsSunriseProj>(), damage, knockback, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, ModContent.ProjectileType<DevilsSunriseCyclone>(), damage, knockback, player.whoAmI, 0f, 0f);
Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI);
Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType<DevilsSunriseCyclone>(), damage, knockback, player.whoAmI);
return false;
}
+5 -3
View File
@@ -22,6 +22,8 @@ namespace CalamityMod.Items.Weapons.Melee
public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(HeldDefense, (DisableDashDuration / 60D).ToString("N1"));
public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
public override void SetDefaults()
{
Item.width = 74;
@@ -30,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Melee
Item.noMelee = true;
Item.noUseGraphic = true;
Item.channel = true;
Item.damage = 250;
Item.damage = 180;
Item.DamageType = DamageClass.MeleeNoSpeed;
Item.useAnimation = Item.useTime = 40; // This is only for the "Very slow" tooltip. The real use time should be faster
Item.shoot = ModContent.ProjectileType<StygianShieldAttack>();
@@ -42,8 +44,8 @@ namespace CalamityMod.Items.Weapons.Melee
Item.UseSound = null;
}
// Can only throw a shield if none is active
public override bool AltFunctionUse(Player player) => player.ownedProjectileCounts[ThrownShieldID] <= 0;
// Can only throw a shield if there's two or less
public override bool AltFunctionUse(Player player) => player.ownedProjectileCounts[ThrownShieldID] <= 1;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0;
+131
View File
@@ -0,0 +1,131 @@
using CalamityMod.Items.Materials;
using CalamityMod.Particles;
using CalamityMod.Projectiles.Melee;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.Audio;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Melee
{
public class TheDarkMaster : ModItem, ILocalizedModType
{
public const float DamagePerHealth = 0.001f; // 0.1 damage per additional health. 100 health = 10% damage.
public new string LocalizationCategory => "Items.Weapons.Melee";
BloomRing ring;
public override void SetStaticDefaults()
{
Item.staff[Item.type] = true;
ItemID.Sets.ItemsThatAllowRepeatedRightClick[Item.type] = true;
}
public override void SetDefaults()
{
Item.width = 60;
Item.height = 60;
Item.damage = 60;
Item.DamageType = DamageClass.Melee;
Item.useAnimation = Item.useTime = 26;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.knockBack = 7f;
Item.autoReuse = true;
Item.value = CalamityGlobalItem.Rarity4BuyPrice;
Item.rare = ItemRarityID.LightRed;
Item.shoot = ModContent.ProjectileType<DarkMasterBeam>();
Item.shootSpeed = 16f;
Item.Calamity().donorItem = true;
}
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
{
if (player.altFunctionUse != 2)
{
// only fire beams at max health
if (player.statLife >= player.statLifeMax2)
{
SoundEngine.PlaySound(SoundID.Item71, player.position);
// increase the beam's damage by the player's additional health starting from the vanilla maximum amount with just life crystals
int baseMaxHealth = 400;
int bonusHealth = player.statLifeMax2 - baseMaxHealth;
float bonusDamage = DamagePerHealth * bonusHealth;
Projectile.NewProjectile(source, position.X, position.Y, velocity.X, velocity.Y, type, (int)(damage * (1 + bonusDamage)), knockback, player.whoAmI);
}
// still play the sound if the clones are out since they always fire beams
else if (player.ownedProjectileCounts[ModContent.ProjectileType<DarkMasterClone>()] > 0)
{
SoundEngine.PlaySound(SoundID.Item71, player.position);
}
}
else
{
if (player.ownedProjectileCounts[ModContent.ProjectileType<DarkMasterClone>()] <= 0)
{
// spawn a growing red ring
ring = new BloomRing(player.Center, Vector2.Zero, Color.Red, 0.4f, 10);
GeneralParticleHandler.SpawnParticle(ring);
// summon the clones. position is determined by ai[0]
for (int i = 0; i < 3; i++)
{
Projectile.NewProjectile(Item.GetSource_FromThis(), player.Center.X, player.Center.Y, 0, 0, ModContent.ProjectileType<DarkMasterClone>(), damage, knockback, player.whoAmI, i);
}
}
}
return false;
}
public override bool AltFunctionUse(Player player) => true;
public override bool CanUseItem(Player player)
{
// only allow right clicking if the player doesn't have clones out
if (player.altFunctionUse == 2)
{
if (player.ownedProjectileCounts[ModContent.ProjectileType<DarkMasterClone>()] <= 0)
{
Item.UseSound = SoundID.Item104;
Item.useStyle = ItemUseStyleID.Shoot;
Item.useTurn = false;
Item.noMelee = true;
}
else
{
return false;
}
}
else
{
Item.UseSound = SoundID.Item1;
Item.useStyle = ItemUseStyleID.Swing;
Item.useTurn = true;
Item.noMelee = false;
}
return base.CanUseItem(player);
}
// make the ring grow if it exists
public override void UpdateInventory(Player player)
{
if (ring != null)
{
ring.Scale *= 1.3f;
}
}
public override void AddRecipes()
{
CreateRecipe().
AddIngredient(ItemID.BeamSword).
AddIngredient(ItemID.LightsBane).
AddIngredient(ItemID.SoulofNight, 20).
AddIngredient<EssenceofHavoc>(3).
AddIngredient(ItemID.Ruby). // as long as you have enough...
AddTile(TileID.Anvils).
Register();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

+1 -1
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public new string LocalizationCategory => "Items.Weapons.Ranged";
public override void SetDefaults()
{
Item.damage = 71;
Item.damage = 74;
Item.DamageType = DamageClass.Ranged;
Item.useTime = 5;
Item.useAnimation = 30;
+7 -7
View File
@@ -12,12 +12,12 @@ namespace CalamityMod.Items.Weapons.Ranged
public new string LocalizationCategory => "Items.Weapons.Ranged";
public override void SetDefaults()
{
Item.damage = 36;
Item.damage = 53;
Item.DamageType = DamageClass.Ranged;
Item.width = 66;
Item.height = 26;
Item.useTime = 32;
Item.useAnimation = 32;
Item.useTime = 42;
Item.useAnimation = 42;
Item.useStyle = ItemUseStyleID.Shoot;
Item.noMelee = true;
Item.knockBack = 4.5f;
@@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Main.projectile[proj].extraUpdates += 2;
}
int maxTargets = 12;
int maxTargets = 7;
int[] targets = new int[maxTargets];
int targetArrayIndex = 0;
Rectangle rectangle = new Rectangle((int)player.Center.X - 960, (int)player.Center.Y - 540, 1920, 1080);
@@ -88,10 +88,10 @@ namespace CalamityMod.Items.Weapons.Ranged
targetPosition.X = (targetPosition.X + player.Center.X) / 2f + Main.rand.Next(-200, 201);
targetPosition.Y -= 100 * j;
Vector2 extraBulletVel = CalamityUtils.CalculatePredictiveAimToTarget(targetPosition, Main.npc[targets[j]], Item.shootSpeed);
Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[j]].Center - targetPosition) * Item.shootSpeed;
int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI);
Main.projectile[proj].extraUpdates += 2;
Main.projectile[proj].extraUpdates += 14;
Main.projectile[proj].tileCollide = false;
Main.projectile[proj].timeLeft /= 2;
}
@@ -111,7 +111,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[randomTarget]].Center - targetPosition) * Item.shootSpeed;
int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI);
Main.projectile[proj].extraUpdates += 2;
Main.projectile[proj].extraUpdates += 14;
Main.projectile[proj].tileCollide = false;
Main.projectile[proj].timeLeft /= 2;
}
+6 -6
View File
@@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Ranged
public new string LocalizationCategory => "Items.Weapons.Ranged";
public override void SetDefaults()
{
Item.damage = 48;
Item.damage = 58;
Item.DamageType = DamageClass.Ranged;
Item.width = 66;
Item.height = 24;
@@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Main.projectile[proj].extraUpdates += 2;
}
int maxTargets = 8;
int maxTargets = 7;
int[] targets = new int[maxTargets];
int targetArrayIndex = 0;
Rectangle rectangle = new Rectangle((int)player.Center.X - 960, (int)player.Center.Y - 540, 1920, 1080);
@@ -91,7 +91,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[j]].Center - targetPosition) * Item.shootSpeed;
int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI);
Main.projectile[proj].extraUpdates += 2;
Main.projectile[proj].extraUpdates += 14;
Main.projectile[proj].tileCollide = false;
Main.projectile[proj].timeLeft /= 2;
@@ -102,7 +102,7 @@ namespace CalamityMod.Items.Weapons.Ranged
extraBulletVel = Vector2.Normalize(Main.npc[targets[j]].Center - targetPosition) * Item.shootSpeed;
proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI);
Main.projectile[proj].extraUpdates += 2;
Main.projectile[proj].extraUpdates += 14;
Main.projectile[proj].tileCollide = false;
Main.projectile[proj].timeLeft /= 2;
}
@@ -122,7 +122,7 @@ namespace CalamityMod.Items.Weapons.Ranged
Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[randomTarget]].Center - targetPosition) * Item.shootSpeed;
int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI);
Main.projectile[proj].extraUpdates += 2;
Main.projectile[proj].extraUpdates += 14;
Main.projectile[proj].tileCollide = false;
Main.projectile[proj].timeLeft /= 2;
@@ -133,7 +133,7 @@ namespace CalamityMod.Items.Weapons.Ranged
extraBulletVel = Vector2.Normalize(Main.npc[targets[randomTarget]].Center - targetPosition) * Item.shootSpeed;
proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI);
Main.projectile[proj].extraUpdates += 2;
Main.projectile[proj].extraUpdates += 14;
Main.projectile[proj].tileCollide = false;
Main.projectile[proj].timeLeft /= 2;
}
@@ -44,8 +44,8 @@ BubonicRound: {
DisplayName: Bubonic Round
Tooltip:
'''
Bursts into virulent plague on contact
Ignores 25% of enemy defense
Spreads the plague on hit
Ignores 20% of enemy defense
'''
}
@@ -1191,6 +1191,20 @@ TheBurningSky: {
'''
}
TheDarkMaster: {
DisplayName: The Dark Master
Tooltip:
'''
Fires red echo slash projectiles at full health
Projectile damage increases for every point of HP above 400
Press <right> to spawn three shadow clones in a Delta formation
The clones will mirror your sword swings and release projectiles
The clones will always fire projectiles regardless of your own HP
The clones may only exist while holding this weapon
'The blade by which the shadows levy their foes with a terrible fate'
'''
}
TheEnforcer: {
DisplayName: The Enforcer
Tooltip: Spawns essence flames on hit
@@ -74,6 +74,8 @@ Cyclone.DisplayName: Cyclone
DarkBall.DisplayName: Dark Ball
DarkBeam.DisplayName: Dark Beam
DarkIceZero.DisplayName: Dark Ice
DarkMasterBeam.DisplayName: Dark Master Beam
DarkMasterClone.DisplayName: Dark Terrarian
DeathsAscensionProjectile.DisplayName: Ascended Scythe
DecaysRetort.DisplayName: Decay's Retort
DecaysRetortDash.DisplayName: Evisceration Lunge
@@ -119,7 +119,6 @@ namespace CalamityMod.Projectiles.Melee
case 1:
Projectile.width = Projectile.height = 140;
SoundEngine.PlaySound(SoundID.DD2_OgreSpit, Projectile.Center);
Projectile.damage = (int)(Projectile.damage * BrokenBiomeBlade.ColdAttunement_SecondSwingBoost);
break;
case 2:
Projectile.width = Projectile.height = 130;
+81
View File
@@ -0,0 +1,81 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Melee
{
public class DarkMasterBeam : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
private int tileCounter = 5; // assure that the beams don't instantly die due to their size
public override void SetStaticDefaults()
{
Main.projFrames[Projectile.type] = 6;
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 4;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
}
public override void SetDefaults()
{
Projectile.width = 32;
Projectile.height = 32;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.DamageType = DamageClass.Melee;
Projectile.timeLeft = 300;
Projectile.penetrate = 2;
Projectile.tileCollide = false;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 30;
}
public override void AI()
{
if (tileCounter > 0)
tileCounter--;
if (tileCounter <= 0 && Projectile.ai[1] == 0)
Projectile.tileCollide = true;
Projectile.velocity *= 1.03f;
Projectile.frameCounter++;
if (Projectile.frameCounter > 4)
{
Projectile.frame++;
Projectile.frameCounter = 0;
if (Projectile.frame > 5)
{
Projectile.frame = 0;
}
}
Lighting.AddLight(Projectile.Center, TorchID.Red); // til there's a torch id
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.Item10, Projectile.Center);
for (int i = 0; i < 30; i++)
{
float angle = MathHelper.TwoPi * Main.rand.NextFloat(0f, 1f);
Vector2 angleVec = angle.ToRotationVector2();
float distance = Main.rand.NextFloat(7f, 18f);
Vector2 off = angleVec * distance;
off.Y *= (float)Projectile.height / Projectile.width;
Vector2 pos = Projectile.Center + off;
Dust d = Dust.NewDustPerfect(pos, DustID.GemRuby, angleVec * Main.rand.NextFloat(2f, 4f));
d.customData = true;
}
}
public override bool PreDraw(ref Color lightColor)
{
CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Projectile.type], lightColor, 1);
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+153
View File
@@ -0,0 +1,153 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
using CalamityMod.Items.Weapons.Melee;
using CalamityMod.Particles;
using System;
using Microsoft.Xna.Framework.Graphics;
namespace CalamityMod.Projectiles.Melee
{
public class DarkMasterClone : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Melee";
public override string Texture => "CalamityMod/Projectiles/InvisibleProj";
public override void SetDefaults()
{
Projectile.width = 20;
Projectile.height = 42;
Projectile.friendly = true;
Projectile.ignoreWater = true;
Projectile.DamageType = DamageClass.Melee;
Projectile.timeLeft = 300;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
}
public override void AI()
{
// if the velocity is not zero, the visuals get offset weirdly
Projectile.velocity = Vector2.Zero;
Player owner = Main.player[Projectile.owner];
// how far the clone should move from the player
Vector2 moveTo = new Vector2(0, -160);
switch (Projectile.ai[0])
{
case 1:
moveTo = new Vector2(-180, 120);
break;
case 2:
moveTo = new Vector2(180, 120);
break;
default:
moveTo = new Vector2(0, -160);
break;
}
// if the player isn't holding the sword, DIE.
if (owner.HeldItem.type != ModContent.ItemType<TheDarkMaster>() || !owner.active || owner.CCed || owner == null)
{
Projectile.Kill();
}
// if all conditions above aren't met, the clone can stick around forever
Projectile.timeLeft = 30;
// move the clone to the desired position
Projectile.Center = Vector2.Lerp(Projectile.Center, owner.Center + moveTo, 0.4f);
// produce smoke during initial move
if (Projectile.Distance(owner.Center + moveTo) < 16)
{
Projectile.ai[2] = 1;
}
if (Projectile.ai[2] == 0)
{
float angle = MathHelper.TwoPi * Main.rand.NextFloat(0f, 1f);
Vector2 angleVec = angle.ToRotationVector2();
Particle smoke = new HeavySmokeParticle(Projectile.Center, angleVec * Main.rand.NextFloat(1f, 2f), Color.Black, 30, Main.rand.NextFloat(0.25f, 1f), 0.5f, 0.1f);
GeneralParticleHandler.SpawnParticle(smoke);
}
// shoot beams while the player is left clicking
if (owner.itemTime == owner.itemTimeMax && owner.altFunctionUse != 2 && owner.HeldItem.type == ModContent.ItemType<TheDarkMaster>())
{
Vector2 direction = Projectile.Center.DirectionTo(Main.MouseWorld);
Projectile.direction = Math.Sign(direction.X);
if (Projectile.owner == Main.myPlayer)
{
// ai[1] not being 0 determines if the projectile should always ignore tiles
Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center, direction * owner.HeldItem.shootSpeed, ModContent.ProjectileType<DarkMasterBeam>(), (int)(Projectile.damage * 0.3f), Projectile.knockBack, Projectile.owner, ai1: 1);
}
}
}
public override void OnKill(int timeLeft)
{
SoundEngine.PlaySound(SoundID.NPCDeath6, Projectile.Center);
for (int i = 0; i < 8; i++)
{
float angle = MathHelper.TwoPi * Main.rand.NextFloat(0f, 1f);
Vector2 angleVec = angle.ToRotationVector2();
Particle smoke = new HeavySmokeParticle(Projectile.Center, angleVec * Main.rand.NextFloat(2f, 4f), Color.Black, 60, Main.rand.NextFloat(0.45f, 1.22f), 0.6f, 0.1f);
GeneralParticleHandler.SpawnParticle(smoke);
}
}
public override bool PreDraw(ref Color lightColor)
{
// make a player visual clone. it inherits the player's hair type and clothes style and is otherwise all black with red pupils
Main.playerVisualClone[Projectile.owner] ??= new();
Player owner = Main.player[Projectile.owner];
Player player = Main.playerVisualClone[Projectile.owner];
player.CopyVisuals(Main.player[Projectile.owner]);
player.hair = owner.hair;
player.skinVariant = owner.skinVariant;
player.skinColor = Color.Black;
player.shirtColor = Color.Black;
player.underShirtColor = Color.Black;
player.pantsColor = Color.Black;
player.shoeColor = Color.Black;
player.hairColor = Color.Black;
player.eyeColor = Color.Red;
// become one with the shadows
for (int i = 0; i < player.dye.Length; i++)
{
if (player.dye[i].type != ItemID.ShadowDye)
{
player.dye[i].SetDefaults(ItemID.ShadowDye);
}
}
// update everything for our little dummy player
player.ResetEffects();
player.ResetVisibleAccessories();
player.DisplayDollUpdate();
player.UpdateSocialShadow();
player.UpdateDyes();
player.PlayerFrame();
// copy the player's arm movements while swinging, otherwise idle
if (owner.ItemAnimationActive && owner.altFunctionUse != 2)
player.bodyFrame = owner.bodyFrame;
else
player.bodyFrame.Y = 0;
// legs never jump or walk
player.legFrame.Y = 0;
// face towards the player's cursor
player.direction = Math.Sign(Projectile.DirectionTo(Main.MouseWorld).X);
Main.PlayerRenderer.DrawPlayer(Main.Camera, player, Projectile.position, 0f, player.fullRotationOrigin, 0f, 1f);
// draw the sword
if (owner.ItemAnimationActive && owner.altFunctionUse != 2)
{
Texture2D Sword = ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/TheDarkMaster").Value;
Vector2 distToPlayer = Projectile.position - owner.position;
Main.EntitySpriteDraw(Sword, (Vector2)owner.HandPosition + distToPlayer - Main.screenPosition, null, lightColor, owner.direction == player.direction ? owner.itemRotation : -owner.itemRotation, new Vector2(player.direction == 1 ? 0 : Sword.Width, Sword.Height), 1f, player.direction == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally);
}
return false;
}
public override bool? CanDamage()
{
return false;
}
}
}
+14 -17
View File
@@ -34,22 +34,19 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
if (Projectile.ai[1] < 510f && Projectile.ai[1] != -1f)
Projectile.ai[1] += 1f;
Player Owner = Main.player[Projectile.owner];
if (Projectile.ai[1] < 480f && Projectile.ai[1] != -1f)
Projectile.ai[1]++;
if (Main.myPlayer == Projectile.owner)
{
if (!Main.player[Projectile.owner].channel)
{
if (!Owner.channel)
Projectile.ai[1] = -1f;
Projectile.damage = Projectile.originalDamage;
}
}
if (Projectile.ai[1] >= 255f)
Projectile.damage = 2 * Projectile.originalDamage;
Projectile.damage = (int)(Owner.GetTotalDamage(Projectile.DamageType).ApplyTo(Projectile.originalDamage) * (1f + Utils.GetLerpValue(0f, 300f, Projectile.ai[1], true)));
red = 64 + (int)(Projectile.ai[1] * 0.75f);
red = 30 + (int)(Projectile.ai[1] * 0.75f);
if (red > 255)
red = 255;
@@ -58,8 +55,8 @@ namespace CalamityMod.Projectiles.Melee
Main.dust[dust].noGravity = true;
Vector2 projDirection = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f);
float x = Main.player[Projectile.owner].position.X + (float)(Main.player[Projectile.owner].width / 2) - projDirection.X;
float y = Main.player[Projectile.owner].position.Y + (float)(Main.player[Projectile.owner].height / 2) - projDirection.Y;
float x = Owner.position.X + (float)(Owner.width / 2) - projDirection.X;
float y = Owner.position.Y + (float)(Owner.height / 2) - projDirection.Y;
float distanceFromOwner = (float)Math.Sqrt((double)(x * x + y * y));
float speed = 25f;
@@ -68,7 +65,7 @@ namespace CalamityMod.Projectiles.Melee
if (speed < 2f)
speed = 2f;
if (speed <= 2f || Projectile.ai[1] >= 510f || Projectile.ai[1] == -1f)
if (speed <= 2f || Projectile.ai[1] >= 480f || Projectile.ai[1] == -1f)
{
float returnSpeedMax = 30f;
float returnSpeed = 6f;
@@ -104,20 +101,20 @@ namespace CalamityMod.Projectiles.Melee
if (Main.myPlayer == Projectile.owner)
{
Rectangle rectangle = new Rectangle((int)Projectile.position.X, (int)Projectile.position.Y, Projectile.width, Projectile.height);
Rectangle playerPos = new Rectangle((int)Main.player[Projectile.owner].position.X, (int)Main.player[Projectile.owner].position.Y, Main.player[Projectile.owner].width, Main.player[Projectile.owner].height);
Rectangle playerPos = new Rectangle((int)Owner.position.X, (int)Owner.position.Y, Owner.width, Owner.height);
if (rectangle.Intersects(playerPos))
Projectile.Kill();
}
}
else if (Main.myPlayer == Projectile.owner && Projectile.ai[0] <= 0f)
{
if (Main.player[Projectile.owner].channel)
if (Owner.channel)
{
Vector2 projTravel = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f);
float mouseDestX = (float)Main.mouseX + Main.screenPosition.X - projTravel.X;
float mouseDestY = (float)Main.mouseY + Main.screenPosition.Y - projTravel.Y;
if (Main.player[Projectile.owner].gravDir == -1f)
if (Owner.gravDir == -1f)
mouseDestY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - projTravel.Y;
if (Projectile.ai[0] < 0f)
@@ -162,13 +159,13 @@ namespace CalamityMod.Projectiles.Melee
float miceX = (float)Main.mouseX + Main.screenPosition.X - projDirect.X;
float miceY = (float)Main.mouseY + Main.screenPosition.Y - projDirect.Y;
if (Main.player[Projectile.owner].gravDir == -1f)
if (Owner.gravDir == -1f)
miceY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - projDirect.Y;
float miceDistancing = (float)Math.Sqrt((double)(miceX * miceX + miceY * miceY));
if (miceDistancing == 0f || Projectile.ai[0] < 0f)
{
projDirect = new Vector2(Main.player[Projectile.owner].position.X + (float)(Main.player[Projectile.owner].width / 2), Main.player[Projectile.owner].position.Y + (float)(Main.player[Projectile.owner].height / 2));
projDirect = new Vector2(Owner.position.X + (float)(Owner.width / 2), Owner.position.Y + (float)(Owner.height / 2));
miceX = Projectile.position.X + (float)Projectile.width * 0.5f - projDirect.X;
miceY = Projectile.position.Y + (float)Projectile.height * 0.5f - projDirect.Y;
miceDistancing = (float)Math.Sqrt((double)(miceX * miceX + miceY * miceY));
+22 -27
View File
@@ -36,23 +36,16 @@ namespace CalamityMod.Projectiles.Melee
public override void AI()
{
if (Projectile.ai[1] < 255f)
Projectile.ai[1] += 1f;
Player Owner = Main.player[Projectile.owner];
if (Projectile.ai[1] < 300f)
Projectile.ai[1]++;
Projectile.damage = (int)(Owner.GetTotalDamage(Projectile.DamageType).ApplyTo(Projectile.originalDamage) * (1f + Utils.GetLerpValue(0f, 300f, Projectile.ai[1], true)));
if (Projectile.ai[1] == 255f)
Projectile.damage = 2 * Projectile.originalDamage;
red = 64 + (int)(Projectile.ai[1] * 0.75f);
red = 30 + (int)(Projectile.ai[1] * 0.75f);
if (red > 255)
red = 255;
Player player = Main.player[Projectile.owner];
float pi = 0f;
Vector2 playerRotate = player.RotatedRelativePoint(player.MountedCenter, true);
if (Projectile.spriteDirection == -1)
pi = 3.14159274f;
if (++Projectile.frame >= Main.projFrames[Projectile.type])
Projectile.frame = 0;
@@ -65,17 +58,17 @@ namespace CalamityMod.Projectiles.Melee
if (Main.myPlayer == Projectile.owner)
{
if (player.channel && !player.noItems && !player.CCed)
if (Owner.channel && !Owner.noItems && !Owner.CCed)
{
float scaleFactor6 = 1f;
if (player.ActiveItem().shoot == Projectile.type)
scaleFactor6 = player.ActiveItem().shootSpeed * Projectile.scale;
if (Owner.ActiveItem().shoot == Projectile.type)
scaleFactor6 = Owner.ActiveItem().shootSpeed * Projectile.scale;
Vector2 slashDirection = Main.MouseWorld - playerRotate;
Vector2 slashDirection = Main.MouseWorld - Owner.RotatedRelativePoint(Owner.MountedCenter, true);
slashDirection.Normalize();
if (slashDirection.HasNaNs())
slashDirection = Vector2.UnitX * (float)player.direction;
slashDirection = Vector2.UnitX * (float)Owner.direction;
slashDirection *= scaleFactor6;
if (slashDirection.X != Projectile.velocity.X || slashDirection.Y != Projectile.velocity.Y)
@@ -88,24 +81,26 @@ namespace CalamityMod.Projectiles.Melee
}
Vector2 dustSpawn = Projectile.Center + Projectile.velocity * 3f;
Lighting.AddLight(dustSpawn, (float)((double)red * 0.001), 0.1f, 0.1f);
Lighting.AddLight(dustSpawn, red * 0.001f, 0.1f, 0.1f);
if (Main.rand.NextBool(3))
{
int dust = Dust.NewDust(dustSpawn - Projectile.Size / 2f, Projectile.width, Projectile.height, 66, Projectile.velocity.X, Projectile.velocity.Y, 100, new Color(red, greenAndBlue, greenAndBlue), 1f);
int dust = Dust.NewDust(dustSpawn - Projectile.Size * 0.5f, Projectile.width, Projectile.height, 66, Projectile.velocity.X, Projectile.velocity.Y, 100, new Color(red, greenAndBlue, greenAndBlue), 1f);
Main.dust[dust].noGravity = true;
Main.dust[dust].position -= Projectile.velocity;
}
Projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - Projectile.Size / 2f;
Projectile.rotation = Projectile.velocity.ToRotation() + pi;
Projectile.position = Owner.RotatedRelativePoint(Owner.MountedCenter, true) - Projectile.Size * 0.5f;
Projectile.rotation = Projectile.velocity.ToRotation();
if (Projectile.spriteDirection == -1)
Projectile.rotation += MathHelper.Pi;
Projectile.spriteDirection = Projectile.direction;
Projectile.timeLeft = 2;
player.ChangeDir(Projectile.direction);
player.heldProj = Projectile.whoAmI;
player.itemTime = 2;
player.itemAnimation = 2;
player.itemRotation = (float)Math.Atan2((double)(Projectile.velocity.Y * (float)Projectile.direction), (double)(Projectile.velocity.X * (float)Projectile.direction));
Owner.ChangeDir(Projectile.direction);
Owner.heldProj = Projectile.whoAmI;
Owner.itemTime = 2;
Owner.itemAnimation = 2;
Owner.itemRotation = (Projectile.velocity * Projectile.direction).ToRotation();
}
public override Color? GetAlpha(Color lightColor)
+4 -5
View File
@@ -19,12 +19,11 @@ namespace CalamityMod.Projectiles.Melee
// Bull Rush stats
public const float MinChargeTime = 15f;
public const float MaxChargeTime = 60f;
public const float MaxChargeDistance = 800f; // 50 blocks
public const float MaxChargeDamageMult = 4f;
public const float MaxChargeTime = 45f;
public const float MaxChargeDistance = 720f; // 45 blocks
public const float MaxChargeDamageMult = 6f;
public const float PiercingDamageMult = 0.6f;
public const float DashDuration = 21f;
public const float IFrameRatio = 0.35f; // Amount given = Ratio * Charge, rounded down
public Player Owner => Main.player[Projectile.owner];
public ref float Charge => ref Projectile.ai[0];
@@ -125,7 +124,7 @@ namespace CalamityMod.Projectiles.Melee
// Give immunity frames
Owner.immune = true;
Owner.immuneNoBlink = true;
Owner.immuneTime = (int)(IFrameRatio * Charge);
Owner.immuneTime = (int)DashDuration;
for (int k = 0; k < Owner.hurtCooldowns.Length; k++)
Owner.hurtCooldowns[k] = Owner.immuneTime;
+1 -1
View File
@@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Melee
Projectile.tileCollide = false;
// Swiftly move back towards the player
Projectile.velocity = Projectile.SafeDirectionTo(Owner.Center) * 15f;
Projectile.velocity = Projectile.SafeDirectionTo(Owner.Center) * 20f;
// Delete the projectile if it touches its owner or too far away.
if (Projectile.Hitbox.Intersects(Owner.Hitbox) || Vector2.Distance(Projectile.Center, Owner.Center) >= 3000f)
+4 -4
View File
@@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Ranged
public new string LocalizationCategory => "Projectiles.Ranged";
public override string Texture => "CalamityMod/Projectiles/Magic/RancorFog";
public static int Lifetime => 450;
public static int Fadetime => 420;
public static int Lifetime => 480;
public static int Fadetime => 450;
public ref float Time => ref Projectile.ai[0];
public ref float LightPower => ref Projectile.ai[1];
@@ -35,10 +35,10 @@ namespace CalamityMod.Projectiles.Ranged
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Ranged;
Projectile.penetrate = -1;
Projectile.MaxUpdates = 3;
Projectile.MaxUpdates = 4;
Projectile.timeLeft = Lifetime;
Projectile.usesIDStaticNPCImmunity = true;
Projectile.idStaticNPCHitCooldown = 7;
Projectile.idStaticNPCHitCooldown = 8;
}
public override void AI()
+5 -5
View File
@@ -66,12 +66,12 @@ namespace CalamityMod.Projectiles.Ranged
return new Color(1f, 1f, 1f, 0f);
}
// Ignores 25% of armor
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.ScalingArmorPenetration += 0.25f;
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => modifiers.ScalingArmorPenetration += 0.25f;
// Ignores 20% of armor
public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.ScalingArmorPenetration += 0.2f;
public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => modifiers.ScalingArmorPenetration += 0.2f;
// Inflicts Plague for 3 seconds
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Plague>(), 180);
// Inflicts Plague for 0.75 seconds
public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType<Plague>(), 45);
public override void OnKill(int timeLeft)
{
+1 -1
View File
@@ -78,7 +78,7 @@ namespace CalamityMod.Projectiles.Summon
for (int i = 0; i < beeCount; i++)
{
int beeType = Main.rand.NextBool(4) ? ModContent.ProjectileType<PlagueBeeSmall>() : Owner.beeType(); // 25% chance for plague bee, otherwise depends if Hive Pack or not
Projectile bee = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(0.25f, 0.25f), beeType, Projectile.damage, Owner.beeKB(0f), Projectile.owner);
Projectile bee = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(0.25f, 0.25f), beeType, Owner.beeDamage(Projectile.damage), Owner.beeKB(0f), Projectile.owner);
bee.usesLocalNPCImmunity = true;
bee.localNPCHitCooldown = 10;
bee.penetrate = 2;
@@ -15,6 +15,7 @@ namespace CalamityMod.Tiles.Furniture.DevPaintings
{
Main.tileFrameImportant[Type] = true;
Main.tileLavaDeath[Type] = true;
Main.tileSpelunker[Type] = true;
Main.tileWaterDeath[Type] = false;
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall);
TileObjectData.newTile.Width = 6;
+2
View File
@@ -1531,6 +1531,7 @@ namespace CalamityMod
Main.tileFrameImportant[mt.Type] = true;
Main.tileLavaDeath[mt.Type] = true;
Main.tileSpelunker[mt.Type] = true;
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall);
TileObjectData.addTile(mt.Type);
TileID.Sets.DisableSmartCursor[mt.Type] = true;
@@ -1578,6 +1579,7 @@ namespace CalamityMod
{
Main.tileFrameImportant[mt.Type] = true;
Main.tileLavaDeath[mt.Type] = !lavaImmune;
Main.tileSpelunker[mt.Type] = true;
Main.tileWaterDeath[mt.Type] = false;
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3Wall);
TileObjectData.newTile.Width = 6;