Pet character display

This commit is contained in:
Mortis3 committed 2023-12-16 12:44:42 -05:00
1 parent 7e211216cf
commit 3f4b408d19
32 files changed
+87 -488

No files matched your search

-28
View File
@@ -1,28 +0,0 @@
using CalamityMod.Projectiles.Pets;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Pets
{
public class EidolonSnailBuff : ModBuff
{
public override void SetStaticDefaults()
{
Main.buffNoTimeDisplay[Type] = true;
Main.vanityPet[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.buffTime[buffIndex] = 18000;
player.Calamity().eidolonSnailPet = true;
bool PetProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<EidolonSnail>()] <= 0;
if (PetProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.GetSource_Buff(buffIndex), player.Center, Vector2.Zero, ModContent.ProjectileType<EidolonSnail>(), 0, 0f, player.whoAmI);
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 591 B

-41
View File
@@ -1,41 +0,0 @@
using CalamityMod.Buffs.Pets;
using CalamityMod.Projectiles.Pets;
using CalamityMod.Rarities;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Pets
{
public class AbyssShellFossil : ModItem, ILocalizedModType
{
public new string LocalizationCategory => "Items.Pets";
public override void SetDefaults()
{
Item.damage = 0;
Item.width = 42;
Item.height = 30;
Item.useAnimation = 20;
Item.useTime = 20;
Item.useStyle = ItemUseStyleID.Swing;
Item.noMelee = true;
Item.value = Item.sellPrice(platinum: 1);
Item.rare = ModContent.RarityType<DarkBlue>();
Item.Calamity().devItem = true;
Item.shoot = ModContent.ProjectileType<EidolonSnail>();
Item.buffType = ModContent.BuffType<EidolonSnailBuff>();
Item.UseSound = SoundID.Item2;
}
public override void UseStyle(Player player, Rectangle heldItemFrame)
{
if (player.whoAmI == Main.myPlayer && player.itemTime == 0)
{
player.AddBuff(Item.buffType, 15, true);
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 576 B

@@ -358,11 +358,6 @@ Dreamfog: {
Description: Xi believes in Yuu
}
EidolonSnailBuff: {
DisplayName: Escargidolon Snail
Description: What a silly little prehistoric snail
}
ElectricTroublemaker: {
DisplayName: Electric Troublemaker
Description: Lightning never strikes the same place twice
@@ -1,13 +1,3 @@
AbyssShellFossil: {
DisplayName: Abyss Shell Fossil
Tooltip:
'''
A fossil of a prehistoric creature, long forgotten in the deep abyss
Summons a pet Escargidolon Snail to follow you
Slightly reduces creatures' ability to detect you in the abyss while equipped
'''
}
BearsEye: {
DisplayName: Bear's Eye
Tooltip: Summons a pet guardian angel
@@ -8,7 +8,6 @@ ChibiiDoggo.DisplayName: Chibii Devourer
ChibiiDoggoFly.DisplayName: Chibii Devourer (Flying)
DaawnlightSpiritOriginMinion.DisplayName: Daawnlight
DannyDevitoPet.DisplayName: Danny Devito
EidolonSnail.DisplayName: Escargidolon Snail
FlakPet.DisplayName: Flak Hermit
FoxPet.DisplayName: Fox
GoldiePet.DisplayName: Goldie
+5
View File
@@ -1,6 +1,8 @@
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class Akato : ModProjectile, ILocalizedModType
@@ -10,6 +12,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 6;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6)
.WithOffset(-38f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+5
View File
@@ -1,7 +1,9 @@
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class Astrophage : ModProjectile, ILocalizedModType
@@ -13,6 +15,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 5;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6)
.WithOffset(-10f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+5
View File
@@ -2,7 +2,9 @@
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class Bear : ModProjectile, ILocalizedModType
@@ -18,6 +20,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 22;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 13, 6)
.WithOffset(-20f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+5
View File
@@ -3,7 +3,9 @@ using CalamityMod.Dusts;
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class BrimlingPet : ModProjectile, ILocalizedModType
@@ -13,6 +15,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 8;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 4, 5)
.WithOffset(-25f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+3
View File
@@ -24,6 +24,9 @@ namespace CalamityMod.Projectiles.Pets
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 10;
ProjectileID.Sets.TrailingMode[Projectile.type] = 2;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6)
.WithOffset(-7f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+5
View File
@@ -2,7 +2,9 @@
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class DannyDevitoPet : ModProjectile, ILocalizedModType
@@ -15,6 +17,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 8;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(2, 5, 5)
.WithOffset(-12f, 2f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
-328
View File
@@ -1,328 +0,0 @@
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ModLoader;
using System;
namespace CalamityMod.Projectiles.Pets
{
public class EidolonSnail : ModProjectile, ILocalizedModType
{
public new string LocalizationCategory => "Projectiles.Pets";
private int playerStill = 0;
private bool fly = false;
public override void SetStaticDefaults()
{
Main.projFrames[Projectile.type] = 8;
Main.projPet[Projectile.type] = true;
}
public override void SetDefaults()
{
Projectile.netImportant = true;
Projectile.width = 54;
Projectile.height = 38;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.timeLeft *= 5;
Projectile.tileCollide = true;
Projectile.ignoreWater = true;
}
public override bool PreDraw(ref Color lightColor)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Pets/EidolonSnail").Value;
int height = texture.Height / Main.projFrames[Projectile.type];
int frameHeight = height * Projectile.frame;
SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY + 2),
new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), lightColor,
Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, spriteEffects, 0);
return false;
}
public override void PostDraw(Color lightColor)
{
Texture2D texture = ModContent.Request<Texture2D>("CalamityMod/Projectiles/Pets/EidolonSnailGlow").Value;
int height = texture.Height / Main.projFrames[Projectile.type];
int frameHeight = height * Projectile.frame;
SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None;
Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY + 2),
new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, frameHeight, texture.Width, height)), Color.White,
Projectile.rotation, new Vector2(texture.Width / 2f, height / 2f), Projectile.scale, spriteEffects, 0);
}
public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac)
{
Player player = Main.player[Projectile.owner];
Vector2 projCenter = Projectile.Center;
Vector2 playerDirection = player.Center - projCenter;
float playerDistance = playerDirection.Length();
fallThrough = playerDistance > 200f;
return true;
}
public override void AI()
{
Player player = Main.player[Projectile.owner];
if (!player.active)
{
Projectile.active = false;
return;
}
CalamityPlayer modPlayer = player.Calamity();
if (player.dead)
{
modPlayer.eidolonSnailPet = false;
}
if (modPlayer.eidolonSnailPet)
{
Projectile.timeLeft = 2;
}
Vector2 projPos = Projectile.position;
if (!fly)
{
Projectile.rotation = 0;
Vector2 projCenter = Projectile.Center;
Vector2 playerDirection = player.Center - projCenter;
float playerDistance = playerDirection.Length();
if (Projectile.velocity.Y == 0 && ((HoleBelow() && playerDistance > 150f) || (playerDistance > 150f && Projectile.position.X == Projectile.oldPosition.X)))
{
Projectile.velocity.Y = -8f;
}
Projectile.velocity.Y += 0.35f;
if (Projectile.velocity.Y > 15f)
{
Projectile.velocity.Y = 15f;
}
if (playerDistance > 520f)
{
fly = true;
Projectile.velocity.X = 0f;
Projectile.velocity.Y = 0f;
}
if (playerDistance > 100f)
{
if (player.position.X - Projectile.position.X > 0f)
{
Projectile.velocity.X += 0.12f;
if (Projectile.velocity.X > 6f)
{
Projectile.velocity.X = 6f;
}
}
else
{
Projectile.velocity.X -= 0.12f;
if (Projectile.velocity.X < -6f)
{
Projectile.velocity.X = -6f;
}
}
}
if (playerDistance < 100f)
{
if (Projectile.velocity.X != 0f)
{
if (Projectile.velocity.X > 0.8f)
{
Projectile.velocity.X -= 0.25f;
}
else if (Projectile.velocity.X < -0.8f)
{
Projectile.velocity.X += 0.25f;
}
else if (Projectile.velocity.X < 0.8f && Projectile.velocity.X > -0.8f)
{
Projectile.velocity.X = 0f;
}
}
}
if (playerDistance < 70f)
{
Projectile.velocity.X *= 0.5f;
}
//set frames when idle
if (Projectile.position.X == Projectile.oldPosition.X && Projectile.position.Y == Projectile.oldPosition.Y && Projectile.velocity.X == 0)
{
Projectile.frame = 0;
Projectile.frameCounter = 0;
}
//falling frame
else if (Projectile.velocity.Y > 0.3f && Projectile.position.Y != Projectile.oldPosition.Y)
{
Projectile.frame = 4;
Projectile.frameCounter = 0;
}
else if (Projectile.velocity.X != 0)
{
//moving animation
Projectile.frameCounter++;
if (Projectile.frameCounter > 2)
{
Projectile.frame++;
Projectile.frameCounter = 0;
}
if (Projectile.frame > 4)
{
Projectile.frame = 1;
}
}
if (Projectile.velocity.X > 0.8f)
{
Projectile.spriteDirection = 1;
}
else if (Projectile.velocity.X < -0.8f)
{
Projectile.spriteDirection = -1;
}
}
else if (fly)
{
float flySpeed = 0.5f;
Projectile.tileCollide = false;
Vector2 flyDirection = new Vector2(Projectile.position.X + (float)Projectile.width * 0.5f, Projectile.position.Y + (float)Projectile.height * 0.5f);
float horiPos = Main.player[Projectile.owner].position.X + (float)(Main.player[Projectile.owner].width / 2) - flyDirection.X;
float vertiPos = Main.player[Projectile.owner].position.Y + (float)(Main.player[Projectile.owner].height / 2) - flyDirection.Y;
vertiPos += (float)Main.rand.Next(-10, 21);
horiPos += (float)Main.rand.Next(-10, 21);
horiPos += (float)(60 * -(float)player.direction);
vertiPos -= 60f;
float playerDistance = (float)Math.Sqrt((double)(horiPos * horiPos + vertiPos * vertiPos));
if (playerDistance > 1200f)
{
Projectile.position.X = player.Center.X - (float)(Projectile.width / 2);
Projectile.position.Y = player.Center.Y - (float)(Projectile.height / 2);
Projectile.netUpdate = true;
}
if (playerDistance < 100f)
{
flySpeed = 0.5f;
if (player.velocity.Y == 0f)
{
++playerStill;
}
else
{
playerStill = 0;
}
if (playerStill > 10 && !Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height))
{
fly = false;
Projectile.velocity *= 0.2f;
Projectile.tileCollide = true;
}
}
if (playerDistance < 50f)
{
if (Math.Abs(Projectile.velocity.X) > 2f || Math.Abs(Projectile.velocity.Y) > 2f)
{
Projectile.velocity *= 0.90f;
}
flySpeed = 0.02f;
}
else
{
if (playerDistance < 100f)
{
flySpeed = 0.35f;
}
if (playerDistance > 300f)
{
flySpeed = 1f;
}
playerDistance = 18f / playerDistance;
horiPos *= playerDistance;
vertiPos *= playerDistance;
}
if (Projectile.velocity.X <= horiPos)
{
Projectile.velocity.X = Projectile.velocity.X + flySpeed;
if (flySpeed > 0.05f && Projectile.velocity.X < 0f)
{
Projectile.velocity.X = Projectile.velocity.X + flySpeed;
}
}
if (Projectile.velocity.X > horiPos)
{
Projectile.velocity.X = Projectile.velocity.X - flySpeed;
if (flySpeed > 0.05f && Projectile.velocity.X > 0f)
{
Projectile.velocity.X = Projectile.velocity.X - flySpeed;
}
}
if (Projectile.velocity.Y <= vertiPos)
{
Projectile.velocity.Y = Projectile.velocity.Y + flySpeed;
if (flySpeed > 0.05f && Projectile.velocity.Y < 0f)
{
Projectile.velocity.Y = Projectile.velocity.Y + flySpeed * 2f;
}
}
if (Projectile.velocity.Y > vertiPos)
{
Projectile.velocity.Y = Projectile.velocity.Y - flySpeed;
if (flySpeed > 0.05f && Projectile.velocity.Y > 0f)
{
Projectile.velocity.Y = Projectile.velocity.Y - flySpeed * 2f;
}
}
Projectile.rotation += (Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y)) * 0.01f * (float)Projectile.direction;
if (Projectile.Center.X < Main.player[Projectile.owner].Center.X)
{
Projectile.spriteDirection = 1;
}
else if (Projectile.Center.X > Main.player[Projectile.owner].Center.X)
{
Projectile.spriteDirection = -1;
}
//funny flying animation
Projectile.frameCounter++;
if (Projectile.frameCounter > 3)
{
Projectile.frame++;
Projectile.frameCounter = 0;
}
if (Projectile.frame > 7)
{
Projectile.frame = 5;
}
}
}
private bool HoleBelow()
{
int tileWidth = 4;
int tileX = (int)(Projectile.Center.X / 16f) - tileWidth;
if (Projectile.velocity.X > 0)
{
tileX += tileWidth;
}
int tileY = (int)((Projectile.position.Y + Projectile.height) / 16f);
for (int y = tileY; y < tileY + 2; y++)
{
for (int x = tileX; x < tileX + tileWidth; x++)
{
if (Main.tile[x, y].HasTile && (Main.tile[x - 1, y].HasTile || Main.tile[x + 1, y].HasTile))
{
return false;
}
}
}
return true;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

+5
View File
@@ -2,7 +2,9 @@
using Microsoft.Xna.Framework;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class FlakPet : ModProjectile, ILocalizedModType
@@ -17,6 +19,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 7;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(2, 4, 6)
.WithOffset(-7f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+4
View File
@@ -2,6 +2,7 @@
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class FoxPet : ModProjectile, ILocalizedModType
@@ -11,6 +12,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 11;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 7, 6)
.WithOffset(-35f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+5
View File
@@ -3,8 +3,10 @@ using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using Terraria.Audio;
namespace CalamityMod.Projectiles.Pets
{
public class KendraPet : ModProjectile, ILocalizedModType
@@ -22,6 +24,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 31;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 13, 6)
.WithOffset(-30f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+3
View File
@@ -14,6 +14,9 @@ namespace CalamityMod.Projectiles.Pets
public override void SetStaticDefaults()
{
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 0, 1)
.WithOffset(-12f, -12f).WithSpriteDirection(-1);
}
public override void SetDefaults()
+5
View File
@@ -1,6 +1,8 @@
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class LeviPet : ModProjectile, ILocalizedModType
@@ -10,6 +12,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 5;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6)
.WithOffset(-18f, -12f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+3
View File
@@ -21,6 +21,9 @@ namespace CalamityMod.Projectiles.Pets
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.TrailCacheLength[Projectile.type] = 6;
ProjectileID.Sets.TrailingMode[Projectile.type] = 0;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6)
.WithOffset(-12f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+5
View File
@@ -2,7 +2,9 @@ using CalamityMod.Buffs.Pets;
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class PerforaMini : ModProjectile, ILocalizedModType
@@ -12,6 +14,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 8;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6)
.WithOffset(-8f, -20f).WithSpriteDirection(1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+5
View File
@@ -1,7 +1,9 @@
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class PineapplePetProj : ModProjectile, ILocalizedModType
@@ -11,6 +13,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 5;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6)
.WithOffset(-2f, -20f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+5
View File
@@ -1,6 +1,8 @@
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class PlaguebringerBab : ModProjectile, ILocalizedModType
@@ -10,6 +12,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 6;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 4, 6)
.WithOffset(-25f, -20f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+5
View File
@@ -2,7 +2,9 @@ using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class RotomPet : ModProjectile, ILocalizedModType
@@ -26,6 +28,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 4;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6)
.WithOffset(-10f, 0f).WithSpriteDirection(1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+5
View File
@@ -1,7 +1,9 @@
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class SCalPet : ModProjectile, ILocalizedModType
@@ -11,6 +13,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projFrames[Projectile.type] = 6;
Main.projPet[Projectile.type] = true;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, Main.projFrames[Projectile.type], 6)
.WithOffset(-12f, -18).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+3
View File
@@ -13,6 +13,9 @@ namespace CalamityMod.Projectiles.Pets
{
Main.projPet[Projectile.type] = true;
Main.projFrames[Projectile.type] = 7;
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 4, 6)
.WithOffset(-15f, -5f).WithSpriteDirection(1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
+6
View File
@@ -2,7 +2,9 @@
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class YharonSonPet : ModProjectile, ILocalizedModType
@@ -28,6 +30,10 @@ namespace CalamityMod.Projectiles.Pets
public override void SetStaticDefaults()
{
Main.projPet[Projectile.type] = true;
//im crying how do i even make this use the correct animation
ProjectileID.Sets.CharacterPreviewAnimations[Projectile.type] = ProjectileID.Sets.SimpleLoop(0, 0, 1)
.WithOffset(-25f, 0f).WithSpriteDirection(-1).WhenNotSelected(0, 0);
}
public override void SetDefaults()
-30
View File
@@ -1,30 +0,0 @@
using CalamityMod.Items.Pets;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.GameContent;
using Terraria.ModLoader;
using Terraria.ObjectData;
namespace CalamityMod.Tiles.Abyss
{
public class AbyssFossilTile : ModTile
{
public override void SetStaticDefaults()
{
Main.tileFrameImportant[Type] = true;
Main.tileLavaDeath[Type] = false;
Main.tileWaterDeath[Type] = false;
TileObjectData.newTile.CopyFrom(TileObjectData.Style3x2);
TileObjectData.addTile(Type);
AddMapEntry(new Color(29, 37, 58), CalamityUtils.GetItemName<AbyssShellFossil>());
DustType = 33;
RegisterItemDrop(ModContent.ItemType<AbyssShellFossil>());
FlexibleTileWand.RubblePlacementLarge.AddVariations(ModContent.ItemType<AbyssShellFossil>(), Type, 0);
}
public override void NumDust(int i, int j, bool fail, ref int num)
{
num = fail ? 1 : 3;
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 921 B

-45
View File
@@ -318,8 +318,6 @@ namespace CalamityMod.World
else if (y > 1500)
maxAbyssIslands = 16; //Medium World
PlaceSnailFossil(abyssChasmX, Main.remixWorld ? 145 : AbyssChasmBottom + 45);
//place a single abyss island under the terminus shrine
AbyssIsland(abyssChasmX, Main.remixWorld ? 105 : AbyssChasmBottom + 5, 65, 75, 40, 45, ModContent.TileType<Voidstone>(), false, false, false);
@@ -1117,49 +1115,6 @@ namespace CalamityMod.World
}
}
public static void PlaceSnailFossil(int i, int j)
{
//place an island
AbyssIsland(i, j + 2, 55, 75, 35, 45, ModContent.TileType<Voidstone>(), false, false, false);
//clear decently big circular area where the chest will be
for (int clearX = i - 2; clearX <= i + 2; clearX++)
{
for (int clearY = j - 8; clearY <= j - 1; clearY++)
{
//clear area for the chest to place
ShapeData circle = new ShapeData();
GenAction blotchMod = new Modifiers.Blotches(2, 0.4);
int radius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f));
WorldUtils.Gen(new Point(clearX, clearY), new Shapes.Circle(radius), Actions.Chain(new GenAction[]
{
blotchMod.Output(circle)
}));
WorldUtils.Gen(new Point(clearX, clearY), new ModShapes.All(circle), Actions.Chain(new GenAction[]
{
new Actions.ClearTile()
}));
}
}
//place cluster where chest will spawn
WorldGen.TileRunner(i, j + 4, 8, 5, ModContent.TileType<Voidstone>(), true, 0, 0, false, true);
//clear another small square exactly around where the chest will be so it has a flat area to place on
for (int clearX = i - 7; clearX <= i + 7; clearX++)
{
for (int clearY = j - 1; clearY <= j + 5; clearY++)
{
WorldGen.PlaceTile(clearX, clearY, ModContent.TileType<Voidstone>());
}
}
WorldGen.PlaceObject(i, j - 2, (ushort)ModContent.TileType<AbyssFossilTile>());
}
/// <summary>
/// Unlocks all abyss chests, automatically synced across the server.
/// Only run initally on the server.