- Actually shrunk Dragon Scales' tornado for real by fixing the logic to determine if the projectile comes from Dragon Scales or not, this learning experience will help on the venerated locket branch.
- Improved how the tornado spawns to make it more consistent with how The Wand works; makes it less frustrating to test - Fixed a bug were Dragon Scales were hitting way more than intended due to forgetting to set the Local Iframes bool to false, will need rebalancing.
This commit is contained in:
1 parent
ebf79e3545
commit
c81ef743b3
3 files changed
+30
-36
No files matched your search
@@ -777,43 +777,20 @@ namespace CalamityMod.CalPlayer
|
||||
var spawnSource = proj.GetSource_FromThis();
|
||||
if (modProj.stealthStrike && dragonScales && CalamityUtils.CountProjectiles(ProjectileType<InfernadoFriendly>()) < 1)
|
||||
{
|
||||
int projTileX = (int)(proj.Center.X / 16f);
|
||||
int projTileY = (int)(proj.Center.Y / 16f);
|
||||
int distance = 100;
|
||||
if (projTileX < 10)
|
||||
{
|
||||
projTileX = 10;
|
||||
}
|
||||
if (projTileX > Main.maxTilesX - 10)
|
||||
{
|
||||
projTileX = Main.maxTilesX - 10;
|
||||
}
|
||||
if (projTileY < 10)
|
||||
{
|
||||
projTileY = 10;
|
||||
}
|
||||
if (projTileY > Main.maxTilesY - distance - 10)
|
||||
{
|
||||
projTileY = Main.maxTilesY - distance - 10;
|
||||
}
|
||||
for (int x = projTileX; x < projTileX + distance; x++)
|
||||
{
|
||||
Tile tile = Main.tile[projTileX, projTileY];
|
||||
if (tile.HasTile && (Main.tileSolid[tile.TileType] || tile.LiquidAmount != 0))
|
||||
{
|
||||
projTileX = x;
|
||||
break;
|
||||
}
|
||||
}
|
||||
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(180);
|
||||
int projectileIndex = Projectile.NewProjectile(spawnSource, projTileX * 16 + 8, projTileY * 16 - 24, 0f, 0f, ProjectileType<InfernadoFriendly>(), damage, 15f, Main.myPlayer, 16f, 16f);
|
||||
|
||||
int damage = (int)Player.GetTotalDamage<RogueDamageClass>().ApplyTo(200);
|
||||
int projectileIndex = Projectile.NewProjectile(spawnSource, proj.Center.X, proj.Center.Y, 0f, 0f, ProjectileType<InfernadoFriendly>(), damage, 15f, Main.myPlayer, 16f, 8f); //First overload seems to deal with timing, second is segment amount
|
||||
if (projectileIndex.WithinBounds(Main.maxProjectiles))
|
||||
{
|
||||
Main.projectile[projectileIndex].DamageType = DamageClass.Generic;
|
||||
Main.projectile[projectileIndex].netUpdate = true;
|
||||
Main.projectile[projectileIndex].usesLocalNPCImmunity = false;
|
||||
Main.projectile[projectileIndex].usesIDStaticNPCImmunity = true;
|
||||
Main.projectile[projectileIndex].idStaticNPCHitCooldown = 30;
|
||||
Main.projectile[projectileIndex].scale = Main.projectile[projectileIndex].scale / 3;
|
||||
Main.projectile[projectileIndex].idStaticNPCHitCooldown = 20;
|
||||
Main.projectile[projectileIndex].width = 75;
|
||||
Main.projectile[projectileIndex].height = 14;
|
||||
Main.projectile[projectileIndex].timeLeft = 200;
|
||||
Main.projectile[projectileIndex].Calamity().DragonScalesInfernado=true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,6 +74,9 @@ namespace CalamityMod.Projectiles
|
||||
// If true, this projectile creates impact sparks upon hitting enemies
|
||||
public bool deepcoreBullet = false;
|
||||
|
||||
// Used to make DragonScales' tornado smaller
|
||||
public bool DragonScalesInfernado = false;
|
||||
|
||||
// Amount of extra updates that are set in SetDefaults.
|
||||
public int defExtraUpdates = -1;
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace CalamityMod.Projectiles.Magic
|
||||
{
|
||||
public class InfernadoFriendly : ModProjectile, ILocalizedModType
|
||||
{
|
||||
|
||||
public new string LocalizationCategory => "Projectiles.Magic";
|
||||
bool intersectingSomething = false;
|
||||
public override void SetStaticDefaults()
|
||||
@@ -36,10 +37,11 @@ namespace CalamityMod.Projectiles.Magic
|
||||
if (Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height))
|
||||
intersectingSomething = true;
|
||||
|
||||
float scaleBase = 44f;
|
||||
float scaleMult = 2.5f;
|
||||
float baseWidth = 320f;
|
||||
float baseHeight = 88f;
|
||||
//Check if the projectile is Wand's or Dragon Scales'
|
||||
float scaleBase = Main.projectile[Projectile.whoAmI].Calamity().DragonScalesInfernado ? 20f : 44f;
|
||||
float scaleMult = Main.projectile[Projectile.whoAmI].Calamity().DragonScalesInfernado ? 1.1f : 2.5f;
|
||||
float baseWidth = Main.projectile[Projectile.whoAmI].Calamity().DragonScalesInfernado ? 80f : 320f;
|
||||
float baseHeight = Main.projectile[Projectile.whoAmI].Calamity().DragonScalesInfernado ? 44f : 88f;
|
||||
|
||||
if (Main.rand.NextBool(25))
|
||||
{
|
||||
@@ -100,6 +102,8 @@ namespace CalamityMod.Projectiles.Magic
|
||||
float num618 = (scaleBase - Projectile.ai[1] + 1f) * scaleMult / scaleBase;
|
||||
center.Y -= baseHeight * num618 / 2f;
|
||||
center.Y += 2f;
|
||||
if (Main.projectile[Projectile.whoAmI].Calamity().DragonScalesInfernado == true) //More space between segments, due to how the calculations work it had to be painstaikingly adjusted
|
||||
center.Y -= 16f;
|
||||
Projectile segment = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), center, Projectile.velocity, Projectile.type, Projectile.damage, Projectile.knockBack, Projectile.owner, 10f, Projectile.ai[1] - 1f);
|
||||
|
||||
// The projectile defaults to magic, but each sub-segment copies the damage class of the previous.
|
||||
@@ -109,6 +113,16 @@ namespace CalamityMod.Projectiles.Magic
|
||||
segment.DamageType = Projectile.DamageType;
|
||||
segment.friendly = Projectile.friendly;
|
||||
segment.hostile = Projectile.hostile;
|
||||
|
||||
//Fuck Dragon Scales mkay
|
||||
if (Main.projectile[Projectile.whoAmI].Calamity().DragonScalesInfernado == true)
|
||||
{
|
||||
Main.projectile[segment.whoAmI].Calamity().DragonScalesInfernado = true;
|
||||
Main.projectile[segment.whoAmI].usesLocalNPCImmunity = false;
|
||||
Main.projectile[segment.whoAmI].usesIDStaticNPCImmunity = true;
|
||||
Main.projectile[segment.whoAmI].idStaticNPCHitCooldown = 20;
|
||||
Main.projectile[segment.whoAmI].timeLeft = 200;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Projectile.ai[0] <= 0f)
|
||||
|
||||
Reference in new issue
Block a user