siren and levi resprites (except the bosses)

This commit is contained in:
termigator1359 committed 2020-06-28 18:06:40 -04:00
1 parent a956ab34e2
commit 973107486f
57 files changed
+167 -352

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 515 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 848 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 643 B

+22
View File
@@ -0,0 +1,22 @@
using Terraria.ModLoader;
namespace CalamityMod.Items.Armor.Vanity
{
[AutoloadEquip(EquipType.Head)]
public class AnahitaMask : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Anahita Mask");
}
public override void SetDefaults()
{
item.width = 28;
item.height = 20;
item.rare = 1;
item.vanity = true;
}
public override bool DrawHead() => false;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 484 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 B

After

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

After

Width:  |  Height:  |  Size: 555 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 309 B

@@ -0,0 +1,30 @@
using CalamityMod.Tiles.Furniture;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.Furniture.Trophies
{
public class AnahitaTrophy : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Anahita Trophy");
}
public override void SetDefaults()
{
item.width = 30;
item.height = 30;
item.maxStack = 99;
item.useTurn = true;
item.autoReuse = true;
item.useAnimation = 15;
item.useTime = 10;
item.useStyle = ItemUseStyleID.SwingThrow;
item.consumable = true;
item.value = 50000;
item.rare = 1;
item.createTile = ModContent.TileType<BossTrophy>();
item.placeStyle = 27;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 745 B

After

Width:  |  Height:  |  Size: 684 B

+2 -4
View File
@@ -33,10 +33,7 @@ namespace CalamityMod.Items.TreasureBags
item.expert = true;
}
public override bool CanRightClick()
{
return true;
}
public override bool CanRightClick() => true;
public override void PostUpdate() => CalamityUtils.ForceItemIntoWorld(item);
@@ -63,6 +60,7 @@ namespace CalamityMod.Items.TreasureBags
// Vanity
DropHelper.DropItemChance(player, ModContent.ItemType<LeviathanMask>(), 7);
DropHelper.DropItemChance(player, ModContent.ItemType<AnahitaMask>(), 7);
// Fishing
DropHelper.DropItemChance(player, ItemID.HotlineFishingHook, 10);
Binary file not shown.

Before

Width:  |  Height:  |  Size: 615 B

After

Width:  |  Height:  |  Size: 924 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

+2 -2
View File
@@ -19,8 +19,8 @@ namespace CalamityMod.Items.Weapons.Melee
{
item.damage = 95;
item.melee = true;
item.width = 60;
item.height = 60;
item.width = 62;
item.height = 62;
item.useTime = 24;
item.useAnimation = 24;
item.useTurn = true;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 991 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 664 B

+8 -4
View File
@@ -584,9 +584,10 @@ namespace CalamityMod.NPCs.Leviathan
Main.dust[num624].velocity *= 2f;
}
float randomSpread = (float)(Main.rand.Next(-200, 200) / 100);
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Leviathangib1"), 1f);
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Leviathangib2"), 1f);
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/Leviathangib3"), 1f);
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/LeviathanGores/LeviGore"), 1f);
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/LeviathanGores/LeviGore2"), 1f);
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/LeviathanGores/LeviGore3"), 1f);
Gore.NewGore(npc.position, npc.velocity * randomSpread, mod.GetGoreSlot("Gores/LeviathanGores/LeviGore4"), 1f);
}
}
@@ -598,6 +599,9 @@ namespace CalamityMod.NPCs.Leviathan
// The Leviathan runs the same loot code as Anahita, but only if she dies last.
public override void NPCLoot()
{
//Trophy dropped regardless of Anahita, precedent of Twins
DropHelper.DropItemChance(npc, ModContent.ItemType<LeviathanTrophy>(), 10);
if (!NPC.AnyNPCs(ModContent.NPCType<Siren>()))
DropSirenLeviLoot(npc);
}
@@ -607,7 +611,6 @@ namespace CalamityMod.NPCs.Leviathan
{
DropHelper.DropBags(npc);
DropHelper.DropItemChance(npc, ModContent.ItemType<LeviathanTrophy>(), 10);
DropHelper.DropItemCondition(npc, ModContent.ItemType<KnowledgeOcean>(), true, !CalamityWorld.downedLeviathan);
DropHelper.DropItemCondition(npc, ModContent.ItemType<KnowledgeLeviathanandSiren>(), true, !CalamityWorld.downedLeviathan);
DropHelper.DropResidentEvilAmmo(npc, CalamityWorld.downedLeviathan, 4, 2, 1);
@@ -628,6 +631,7 @@ namespace CalamityMod.NPCs.Leviathan
// Vanity
DropHelper.DropItemChance(npc, ModContent.ItemType<LeviathanMask>(), 7);
DropHelper.DropItemChance(npc, ModContent.ItemType<AnahitaMask>(), 7);
// Fishing
DropHelper.DropItemChance(npc, ItemID.HotlineFishingHook, 10);
+8 -10
View File
@@ -1,5 +1,6 @@
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Buffs.StatDebuffs;
using CalamityMod.Items.Placeables.Furniture.Trophies;
using CalamityMod.Items.TreasureBags;
using CalamityMod.Projectiles.Boss;
using CalamityMod.World;
@@ -703,12 +704,12 @@ namespace CalamityMod.NPCs.Leviathan
if (num22 != 0)
{
if (npc.ai[1] == 0f && num22 != npc.direction)
npc.rotation += 3.14159274f;
npc.rotation += MathHelper.Pi;
npc.direction = num22;
if (npc.spriteDirection != -npc.direction)
npc.rotation += 3.14159274f;
npc.rotation += MathHelper.Pi;
npc.spriteDirection = -npc.direction;
}
@@ -717,18 +718,12 @@ namespace CalamityMod.NPCs.Leviathan
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 3; k++)
Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f);
Dust.NewDust(npc.position, npc.width, npc.height, 187, hitDirection, -1f, 0, default, 1f);
if (npc.life <= 0)
{
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren"), 1f);
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren2"), 1f);
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren3"), 1f);
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren4"), 1f);
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/SirenGores/Siren5"), 1f);
for (int k = 0; k < 50; k++)
Dust.NewDust(npc.position, npc.width, npc.height, DustID.Blood, hitDirection, -1f, 0, default, 1f);
Dust.NewDust(npc.position, npc.width, npc.height, 187, hitDirection, -1f, 0, default, 1f);
}
}
@@ -844,6 +839,9 @@ namespace CalamityMod.NPCs.Leviathan
// Anahita runs the same loot code as the Leviathan, but only if she dies last.
public override void NPCLoot()
{
//Trophy dropped regardless of Levi, precedent of Twins
DropHelper.DropItemChance(npc, ModContent.ItemType<AnahitaTrophy>(), 10);
if (!NPC.AnyNPCs(ModContent.NPCType<Leviathan>()))
Leviathan.DropSirenLeviLoot(npc);
}
+2 -2
View File
@@ -13,7 +13,7 @@ namespace CalamityMod.Projectiles.Boss
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Frost Mist");
Main.projFrames[projectile.type] = 6;
Main.projFrames[projectile.type] = 8;
ProjectileID.Sets.TrailCacheLength[projectile.type] = 4;
ProjectileID.Sets.TrailingMode[projectile.type] = 0;
}
@@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame > 3)
if (projectile.frame >= Main.projFrames[projectile.type])
{
projectile.frame = 0;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

+1 -1
View File
@@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Boss
public override void SetDefaults()
{
projectile.width = 26;
projectile.width = 24;
projectile.height = 58;
projectile.hostile = true;
projectile.penetrate = -1;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

+81 -321
View File
@@ -11,11 +11,13 @@ namespace CalamityMod.Projectiles.Pets
public class SirenYoung : ModProjectile
{
private bool underwater = false;
private int sleepyTimer = 0;
private int lightLevel = 0;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Siren");
Main.projFrames[projectile.type] = 4;
Main.projFrames[projectile.type] = 17;
Main.projPet[projectile.type] = true;
ProjectileID.Sets.LightPet[projectile.type] = true;
}
@@ -23,12 +25,13 @@ namespace CalamityMod.Projectiles.Pets
public override void SetDefaults()
{
projectile.netImportant = true;
projectile.width = 30;
projectile.height = 30;
projectile.width = 38;
projectile.height = 58;
projectile.friendly = true;
projectile.penetrate = -1;
projectile.timeLeft *= 5;
projectile.ignoreWater = true;
projectile.tileCollide = false;
}
public override void AI()
@@ -48,325 +51,91 @@ namespace CalamityMod.Projectiles.Pets
{
projectile.timeLeft = 2;
}
projectile.frameCounter++;
if (projectile.frameCounter > 6)
{
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame > 3)
{
projectile.frame = 0;
}
underwater = Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) || modPlayer.leviathanAndSirenLore;
if (sleepyTimer < 180)
{
projectile.frameCounter++;
if (projectile.frameCounter > 6)
{
projectile.frame++;
projectile.frameCounter = 0;
}
}
if (underwater)
{
if (projectile.frame >= 8)
{
projectile.frame = 0;
}
}
else
{
if (projectile.frame >= 16)
{
projectile.frame = sleepyTimer >= 180 ? 16 : 8;
}
}
underwater = player.IsUnderwater() || modPlayer.leviathanAndSirenLore;
if (underwater)
{
projectile.width = 30;
projectile.height = 30;
if (projectile.frame == 16)
projectile.frame = 0;
if (sleepyTimer > 0)
sleepyTimer--;
if (projectile.localAI[0] == 0f)
{
Lighting.AddLight(projectile.Center, 2.5f, 2f, 0f); //4.5
lightLevel = 0;
}
else
{
Lighting.AddLight(projectile.Center, 1.65f, 1.32f, 0f); //3
lightLevel = 1;
}
}
else
{
projectile.width = 54;
projectile.height = 54;
Lighting.AddLight(projectile.Center, 0.825f, 0.66f, 0f); //1.5
Vector2 vector54 = player.Center;
vector54.X -= (float)((15 + player.width / 2) * player.direction);
vector54.X -= (float)(40 * player.direction);
if (projectile.ai[0] == 1f)
{
projectile.tileCollide = false;
float num663 = 0.2f;
float num664 = 10f;
int num665 = 200;
if (num664 < Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y))
{
num664 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y);
}
Vector2 vector58 = vector54 - projectile.Center;
float num666 = vector58.Length();
if (num666 > 2000f)
{
projectile.position = player.Center - new Vector2((float)projectile.width, (float)projectile.height) / 2f;
}
if (num666 < (float)num665 && player.velocity.Y == 0f && projectile.position.Y + (float)projectile.height <= player.position.Y + (float)player.height && !Collision.SolidCollision(projectile.position, projectile.width, projectile.height))
{
projectile.ai[0] = 0f;
projectile.netUpdate = true;
if (projectile.velocity.Y < -6f)
{
projectile.velocity.Y = -6f;
}
}
if (num666 >= 60f)
{
vector58.Normalize();
vector58 *= num664;
if (projectile.velocity.X < vector58.X)
{
projectile.velocity.X = projectile.velocity.X + num663;
if (projectile.velocity.X < 0f)
{
projectile.velocity.X = projectile.velocity.X + num663 * 1.5f;
}
}
if (projectile.velocity.X > vector58.X)
{
projectile.velocity.X = projectile.velocity.X - num663;
if (projectile.velocity.X > 0f)
{
projectile.velocity.X = projectile.velocity.X - num663 * 1.5f;
}
}
if (projectile.velocity.Y < vector58.Y)
{
projectile.velocity.Y = projectile.velocity.Y + num663;
if (projectile.velocity.Y < 0f)
{
projectile.velocity.Y = projectile.velocity.Y + num663 * 1.5f;
}
}
if (projectile.velocity.Y > vector58.Y)
{
projectile.velocity.Y = projectile.velocity.Y - num663;
if (projectile.velocity.Y > 0f)
{
projectile.velocity.Y = projectile.velocity.Y - num663 * 1.5f;
}
}
}
if (projectile.velocity.X != 0f)
{
projectile.spriteDirection = Math.Sign(projectile.velocity.X);
}
}
if (projectile.ai[0] == 2f)
{
projectile.friendly = true;
projectile.spriteDirection = projectile.direction;
projectile.velocity.Y = projectile.velocity.Y + 0.4f;
if (projectile.velocity.Y > 10f)
{
projectile.velocity.Y = 10f;
}
projectile.ai[1] -= 1f;
if (projectile.ai[1] <= 0f)
{
projectile.ai[1] = 0f;
projectile.ai[0] = 0f;
projectile.friendly = false;
projectile.netUpdate = true;
return;
}
}
if (projectile.ai[0] == 0f)
{
float num671 = 200f;
if (player.rocketDelay2 > 0)
{
projectile.ai[0] = 1f;
projectile.netUpdate = true;
}
Vector2 vector59 = vector54 - projectile.Center;
if (vector59.Length() > 2000f)
{
projectile.position = vector54 - new Vector2((float)projectile.width, (float)projectile.height) / 2f;
}
else if (vector59.Length() > num671 || Math.Abs(vector59.Y) > 300f)
{
projectile.ai[0] = 1f;
projectile.netUpdate = true;
if (projectile.velocity.Y > 0f && vector59.Y < 0f)
{
projectile.velocity.Y = 0f;
}
if (projectile.velocity.Y < 0f && vector59.Y > 0f)
{
projectile.velocity.Y = 0f;
}
}
projectile.tileCollide = true;
float num672 = 0.5f;
float num673 = 4f;
float num674 = 4f;
float num675 = 0.1f;
if (num674 < Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y))
{
num674 = Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y);
num672 = 0.7f;
}
int num676 = 0;
bool flag29 = false;
float num677 = vector54.X - projectile.Center.X;
if (Math.Abs(num677) > 5f)
{
if (num677 < 0f)
{
num676 = -1;
if (projectile.velocity.X > -num673)
{
projectile.velocity.X = projectile.velocity.X - num672;
}
else
{
projectile.velocity.X = projectile.velocity.X - num675;
}
}
else
{
num676 = 1;
if (projectile.velocity.X < num673)
{
projectile.velocity.X = projectile.velocity.X + num672;
}
else
{
projectile.velocity.X = projectile.velocity.X + num675;
}
}
flag29 = true;
}
else
{
projectile.velocity.X = projectile.velocity.X * 0.9f;
if (Math.Abs(projectile.velocity.X) < num672 * 2f)
{
projectile.velocity.X = 0f;
}
}
if (num676 != 0)
{
int num678 = (int)(projectile.position.X + (float)(projectile.width / 2)) / 16;
int num679 = (int)projectile.position.Y / 16;
num678 += num676;
num678 += (int)projectile.velocity.X;
int num3;
for (int num680 = num679; num680 < num679 + projectile.height / 16 + 1; num680 = num3 + 1)
{
if (WorldGen.SolidTile(num678, num680))
{
flag29 = true;
}
num3 = num680;
}
}
if (projectile.velocity.X != 0f)
{
flag29 = true;
}
Collision.StepUp(ref projectile.position, ref projectile.velocity, projectile.width, projectile.height, ref projectile.stepSpeed, ref projectile.gfxOffY, 1, false, 0);
if (projectile.velocity.Y == 0f && flag29)
{
int num3;
for (int num681 = 0; num681 < 3; num681 = num3 + 1)
{
int num682 = (int)(projectile.position.X + (float)(projectile.width / 2)) / 16;
if (num681 == 0)
{
num682 = (int)projectile.position.X / 16;
}
if (num681 == 2)
{
num682 = (int)(projectile.position.X + (float)projectile.width) / 16;
}
int num683 = (int)(projectile.position.Y + (float)projectile.height) / 16;
if (WorldGen.SolidTile(num682, num683) || Main.tile[num682, num683].halfBrick() || Main.tile[num682, num683].slope() > 0 || (TileID.Sets.Platforms[(int)Main.tile[num682, num683].type] && Main.tile[num682, num683].active() && !Main.tile[num682, num683].inActive()))
{
try
{
num682 = (int)(projectile.position.X + (float)(projectile.width / 2)) / 16;
num683 = (int)(projectile.position.Y + (float)(projectile.height / 2)) / 16;
num682 += num676;
num682 += (int)projectile.velocity.X;
if (!WorldGen.SolidTile(num682, num683 - 1) && !WorldGen.SolidTile(num682, num683 - 2))
{
projectile.velocity.Y = -5.1f;
}
else if (!WorldGen.SolidTile(num682, num683 - 2))
{
projectile.velocity.Y = -7.1f;
}
else if (WorldGen.SolidTile(num682, num683 - 5))
{
projectile.velocity.Y = -11.1f;
}
else if (WorldGen.SolidTile(num682, num683 - 4))
{
projectile.velocity.Y = -10.1f;
}
else
{
projectile.velocity.Y = -9.1f;
}
} catch
{
projectile.velocity.Y = -9.1f;
}
}
num3 = num681;
}
}
if (projectile.velocity.X > num674)
{
projectile.velocity.X = num674;
}
if (projectile.velocity.X < -num674)
{
projectile.velocity.X = -num674;
}
if (projectile.velocity.X < 0f)
{
projectile.direction = -1;
}
if (projectile.velocity.X > 0f)
{
projectile.direction = 1;
}
if (projectile.velocity.X > num672 && num676 == 1)
{
projectile.direction = 1;
}
if (projectile.velocity.X < -num672 && num676 == -1)
{
projectile.direction = -1;
}
projectile.spriteDirection = projectile.direction;
projectile.velocity.Y = projectile.velocity.Y + 0.4f;
if (projectile.velocity.Y > 10f)
{
projectile.velocity.Y = 10f;
}
}
return;
}
else
{
if (sleepyTimer < 180)
{
sleepyTimer++;
lightLevel = 1;
}
else
{
lightLevel = 2;
projectile.frame = 16;
}
}
switch (lightLevel)
{
case 0:
Lighting.AddLight(projectile.Center, 0f, 2f, 2.5f); //4.5
break;
case 1:
Lighting.AddLight(projectile.Center, 0f, 1.32f, 1.65f); //3
break;
case 2:
Lighting.AddLight(projectile.Center, 0f, 0.5f, 0.7f);
break;
}
float num23 = 0.2f;
float num24 = 5f;
projectile.tileCollide = false;
Vector2 vector4 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num25 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector4.X;
float num26 = Main.player[projectile.owner].position.Y + Main.player[projectile.owner].gfxOffY + (float)(Main.player[projectile.owner].height / 2) - vector4.Y;
if (Main.player[projectile.owner].controlLeft)
float num25 = player.position.X + (float)(player.width / 2) - vector4.X;
float num26 = player.position.Y + player.gfxOffY + (float)(player.height / 2) - vector4.Y;
if (player.controlLeft && sleepyTimer < 180)
{
num25 -= 120f;
}
else if (Main.player[projectile.owner].controlRight)
else if (player.controlRight && sleepyTimer < 180)
{
num25 += 120f;
}
if (Main.player[projectile.owner].controlDown)
if (player.controlDown && sleepyTimer < 180)
{
num26 += 120f;
}
else
{
if (Main.player[projectile.owner].controlUp)
if (player.controlUp && sleepyTimer < 180)
{
num26 -= 120f;
}
@@ -375,12 +144,12 @@ namespace CalamityMod.Projectiles.Pets
float num27 = (float)Math.Sqrt((double)(num25 * num25 + num26 * num26));
if (num27 > 1000f)
{
projectile.position.X = projectile.position.X + num25;
projectile.position.Y = projectile.position.Y + num26;
projectile.position.X += num25;
projectile.position.Y += num26;
}
if (projectile.localAI[0] == 1f)
{
if (num27 < 10f && Math.Abs(Main.player[projectile.owner].velocity.X) + Math.Abs(Main.player[projectile.owner].velocity.Y) < num24 && Main.player[projectile.owner].velocity.Y == 0f)
if (num27 < 10f && Math.Abs(player.velocity.X) + Math.Abs(player.velocity.Y) < num24 && player.velocity.Y == 0f)
{
projectile.localAI[0] = 0f;
}
@@ -396,11 +165,11 @@ namespace CalamityMod.Projectiles.Pets
projectile.velocity.X = num25 * num27;
projectile.velocity.Y = num26 * num27;
}
if ((double)projectile.velocity.X > 0.5)
if (projectile.velocity.X > 0.5f)
{
projectile.direction = -1;
}
else if ((double)projectile.velocity.X < -0.5)
else if (projectile.velocity.X < -0.5f)
{
projectile.direction = 1;
}
@@ -412,11 +181,11 @@ namespace CalamityMod.Projectiles.Pets
{
projectile.localAI[0] = 1f;
}
if ((double)projectile.velocity.X > 0.5)
if (projectile.velocity.X > 0.5f)
{
projectile.direction = -1;
}
else if ((double)projectile.velocity.X < -0.5)
else if (projectile.velocity.X < -0.5f)
{
projectile.direction = 1;
}
@@ -432,14 +201,14 @@ namespace CalamityMod.Projectiles.Pets
projectile.velocity *= 0f;
num23 = 0f;
}
projectile.direction = -Main.player[projectile.owner].direction;
projectile.direction = -player.direction;
}
num27 = num24 / num27;
num25 *= num27;
num26 *= num27;
if (projectile.velocity.X < num25)
{
projectile.velocity.X = projectile.velocity.X + num23;
projectile.velocity.X += num23;
if (projectile.velocity.X < 0f)
{
projectile.velocity.X = projectile.velocity.X * 0.99f;
@@ -447,7 +216,7 @@ namespace CalamityMod.Projectiles.Pets
}
if (projectile.velocity.X > num25)
{
projectile.velocity.X = projectile.velocity.X - num23;
projectile.velocity.X -= num23;
if (projectile.velocity.X > 0f)
{
projectile.velocity.X = projectile.velocity.X * 0.99f;
@@ -455,7 +224,7 @@ namespace CalamityMod.Projectiles.Pets
}
if (projectile.velocity.Y < num26)
{
projectile.velocity.Y = projectile.velocity.Y + num23;
projectile.velocity.Y += num23;
if (projectile.velocity.Y < 0f)
{
projectile.velocity.Y = projectile.velocity.Y * 0.99f;
@@ -463,7 +232,7 @@ namespace CalamityMod.Projectiles.Pets
}
if (projectile.velocity.Y > num26)
{
projectile.velocity.Y = projectile.velocity.Y - num23;
projectile.velocity.Y -= num23;
if (projectile.velocity.Y > 0f)
{
projectile.velocity.Y = projectile.velocity.Y * 0.99f;
@@ -473,15 +242,6 @@ namespace CalamityMod.Projectiles.Pets
{
projectile.rotation = projectile.velocity.X * 0.05f;
}
}
public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
{
Texture2D texture = underwater ? Main.projectileTexture[projectile.type] : ModContent.GetTexture("CalamityMod/Projectiles/Pets/SirenFlopping");
int height = (underwater ? Main.projectileTexture[projectile.type].Height : 256) / Main.projFrames[projectile.type];
int frameHeight = height * projectile.frame;
Main.spriteBatch.Draw(texture, projectile.Center - Main.screenPosition + new Vector2(0f, projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), projectile.GetAlpha(lightColor), projectile.rotation, new Vector2((float)texture.Width / 2f, (float)height / 2f), projectile.scale, SpriteEffects.None, 0f);
return false;
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 664 B

+2 -2
View File
@@ -11,7 +11,7 @@ namespace CalamityMod.Projectiles.Summon
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mist");
Main.projFrames[projectile.type] = 6;
Main.projFrames[projectile.type] = 8;
ProjectileID.Sets.MinionShot[projectile.type] = true;
}
@@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame > 3)
if (projectile.frame >= Main.projFrames[projectile.type])
{
projectile.frame = 0;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

+4 -4
View File
@@ -75,12 +75,12 @@ namespace CalamityMod.Projectiles.Summon
projectile.damage = damage2;
}
Lighting.AddLight(projectile.Center, (255 - projectile.alpha) * 0f / 255f, (255 - projectile.alpha) * 1f / 255f, (255 - projectile.alpha) * 0f / 255f);
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) + Main.player[projectile.owner].gfxOffY - 60f;
if (Main.player[projectile.owner].gravDir == -1f)
projectile.position.X = player.Center.X - (float)(projectile.width / 2);
projectile.position.Y = player.Center.Y - (float)(projectile.height / 2) + player.gfxOffY - 60f;
if (player.gravDir == -1f)
{
projectile.position.Y = projectile.position.Y + 120f;
projectile.rotation = 3.14f;
projectile.rotation = MathHelper.Pi;
}
else
{
+1 -1
View File
@@ -93,7 +93,7 @@ namespace CalamityMod.Projectiles.Summon
{
projectile.frame = 0;
}
if ((double)Math.Abs(projectile.velocity.X) > 0.2)
if (Math.Abs(projectile.velocity.X) > 0.2f)
{
projectile.spriteDirection = -projectile.direction;
}
+1 -1
View File
@@ -82,7 +82,7 @@ namespace CalamityMod.Projectiles.Summon
player.MinionDamage());
projectile.damage = damage2;
}
if ((double)Math.Abs(projectile.velocity.X) > 0.2)
if (Math.Abs(projectile.velocity.X) > 0.2f)
{
projectile.spriteDirection = -projectile.direction;
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 711 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 B

After

Width:  |  Height:  |  Size: 591 B

+3
View File
@@ -110,6 +110,9 @@ namespace CalamityMod.Tiles.Furniture
break;
case 26:
item = ModContent.ItemType<SupremeCalamitasTrophy>();
break;
case 27:
item = ModContent.ItemType<AnahitaTrophy>();
break;
}
if (item > 0)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 32 KiB