Sulph Sea Reformation 2.0 (Also see description)

Changed IL Editing changes to not use a constant index set, fixed the mechworm UUID implementation, added a wulfrum droid summon projectile clone, and added some items/chests alongside the new worldgen changes.
This commit is contained in:
DominicKarma42 committed 2020-04-12 03:13:32 -05:00
1 parent b333d832eb
commit eabfa51179
103 files changed
+3021 -557

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
using CalamityMod.CalPlayer;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Accessories
{
public class RustyMedallion : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Rusty Medallion");
Tooltip.SetDefault("Causes most ranged weapons to sometimes release acid droplets from the sky");
}
public override void SetDefaults()
{
item.width = 18;
item.height = 32;
item.rare = 1;
item.value = CalamityGlobalItem.Rarity1BuyPrice;
item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.rustyMedal = true;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 545 B

+31
View File
@@ -0,0 +1,31 @@
using CalamityMod.Projectiles.Typeless;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items
{
public class BrokenWaterFilter : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Broken Water Filter");
Tooltip.SetDefault("Releases a bunch of caustic tears\n" +
"More tears are released in the water");
}
public override void SetDefaults()
{
item.width = 14;
item.height = 28;
item.maxStack = 999;
item.consumable = true;
item.rare = 1;
item.value = CalamityGlobalItem.Rarity1BuyPrice;
item.useStyle = ItemUseStyleID.SwingThrow;
item.useAnimation = item.useTime = 25;
item.noUseGraphic = true;
item.shootSpeed = 7f;
item.UseSound = SoundID.Item1;
item.shoot = ModContent.ProjectileType<BrokenWaterFilterSpewer>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

@@ -0,0 +1,33 @@
using CalamityMod.Tiles.Furniture;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.Furniture
{
public class EffigyOfDecay : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Effigy of Decay");
Tooltip.SetDefault("When placed down nearby players have their damage can breath underwater\n" +
"This effect does not work in the abyss\n" +
"Nearby players are also immune to the sulphuric poisoning");
}
public override void SetDefaults()
{
item.width = 22;
item.height = 32;
item.maxStack = 99;
item.useTurn = true;
item.autoReuse = true;
item.useAnimation = 15;
item.useTime = 10;
item.useStyle = 1;
item.consumable = true;
item.value = Item.buyPrice(0, 9, 0, 0);
item.rare = 3;
item.createTile = ModContent.TileType<EffigyOfDecayPlaceable>();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 540 B

+37
View File
@@ -0,0 +1,37 @@
using CalamityMod.Items.Materials;
using CalamityMod.Tiles.Abyss;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables.Furniture
{
public class RustyChest : ModItem
{
public override void SetStaticDefaults()
{
}
public override void SetDefaults()
{
item.width = 26;
item.height = 22;
item.maxStack = 99;
item.useTurn = true;
item.autoReuse = true;
item.useAnimation = 15;
item.useTime = 10;
item.useStyle = 1;
item.consumable = true;
item.value = 500;
item.createTile = ModContent.TileType<RustyChestLocked>();
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Chest);
recipe.AddIngredient(ModContent.ItemType<SulfuricScale>(), 5);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

@@ -0,0 +1,36 @@
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Placeables
{
public class HardenedSulphurousSandstone : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Hardened Sulphurous Sandstone");
}
public override void SetDefaults()
{
item.createTile = ModContent.TileType<Tiles.Abyss.SulphurousSand>();
item.useStyle = ItemUseStyleID.SwingThrow;
item.useTurn = true;
item.useAnimation = 15;
item.useTime = 10;
item.autoReuse = true;
item.consumable = true;
item.width = 16;
item.height = 16;
item.maxStack = 999;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddTile(18);
recipe.AddIngredient(ModContent.ItemType<Walls.HardenedSulphurousSandstoneWall>(), 4);
recipe.SetResult(this);
recipe.AddRecipe();
base.AddRecipes();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 257 B

@@ -0,0 +1,36 @@
using Terraria.ModLoader;
using WallTiles = CalamityMod.Walls;
namespace CalamityMod.Items.Placeables.Walls
{
public class HardenedSulphurousSandstoneWall : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Hardened Sulphurous Sandstone Wall");
}
public override void SetDefaults()
{
item.createWall = ModContent.WallType<WallTiles.HardenedSulphurousSandstoneWall>();
item.useStyle = 1;
item.useTurn = true;
item.useAnimation = 15;
item.useTime = 10;
item.autoReuse = true;
item.consumable = true;
item.width = 16;
item.height = 16;
item.maxStack = 999;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddTile(18);
recipe.AddIngredient(ModContent.ItemType<HardenedSulphurousSandstone>());
recipe.SetResult(this, 4);
recipe.AddRecipe();
base.AddRecipes();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

+30
View File
@@ -0,0 +1,30 @@
using CalamityMod.Items.Materials;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items
{
public class RustyLockpick : ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("Opens locked rusty chests");
}
public override void SetDefaults()
{
item.width = 14;
item.height = 28;
item.maxStack = 99;
item.rare = 1;
item.value = CalamityGlobalItem.Rarity1BuyPrice;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<SulfuricScale>(), 15);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

@@ -0,0 +1,45 @@
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Weapons.Summon
{
public class RustyBeaconPrototype : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Rusty Beacon Prototype");
Tooltip.SetDefault("Summons a long-abandoned drone to support you\n" +
"Clicking on an enemy gives them a tiny prick, causing them to become aggravated\n" +
"The drone hovers above nearby enemies and gives them various debuffs");
}
public override void SetDefaults()
{
item.mana = 10;
item.width = 28;
item.height = 20;
item.useTime = item.useAnimation = 35;
item.useStyle = 4;
item.noMelee = true;
item.knockBack = 0.5f;
item.value = CalamityGlobalItem.Rarity1BuyPrice;
item.rare = 1;
item.UseSound = SoundID.Item15; // Phaseblade sound effect
item.autoReuse = true;
item.shoot = ModContent.ProjectileType<RustyDrone>();
item.shootSpeed = 10f;
item.summon = true;
}
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
if (player.altFunctionUse != 2)
{
Projectile.NewProjectile(Main.MouseWorld, Vector2.Zero, type, damage, knockBack, player.whoAmI, 0f, 1f);
}
return false;
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 513 B

+25 -75
View File
@@ -65,46 +65,19 @@ namespace CalamityMod.Items.Weapons.Summon
maxMinionScale = 10;
}
damage = (int)(damage * ((player.minionDamage * 5 / 3) + (player.minionDamage * 0.46f * (maxMinionScale - 1))));
int owner = player.whoAmI;
float num72 = item.shootSpeed;
player.itemTime = item.useTime;
Vector2 vector2 = player.RotatedRelativePoint(player.MountedCenter, true);
Vector2 value = Vector2.UnitX.RotatedBy((double)player.fullRotation, default);
Vector2 vector3 = Main.MouseWorld - vector2;
float velX = (float)Main.mouseX + Main.screenPosition.X - vector2.X;
float velY = (float)Main.mouseY + Main.screenPosition.Y - vector2.Y;
if (player.gravDir == -1f)
{
velY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - vector2.Y;
}
float dist = (float)Math.Sqrt((double)(velX * velX + velY * velY));
if ((float.IsNaN(velX) && float.IsNaN(velY)) || (velX == 0f && velY == 0f))
{
velX = (float)player.direction;
velY = 0f;
dist = num72;
}
else
{
dist = num72 / dist;
}
velX *= dist;
velY *= dist;
int head = -1;
int tail = -1;
int typeHead = ModContent.ProjectileType<MechwormHead>();
int typeTail = ModContent.ProjectileType<MechwormTail>();
for (int i = 0; i < Main.maxProjectiles; i++)
for (int num187 = 0; num187 < Main.projectile.Length; num187++)
{
if (Main.projectile[i].active && Main.projectile[i].owner == owner)
if (Main.projectile[num187].active && Main.projectile[num187].owner == Main.myPlayer)
{
if (head == -1 && Main.projectile[i].type == typeHead)
if (head == -1 && Main.projectile[num187].type == ModContent.ProjectileType<MechwormHead>())
{
head = i;
head = num187;
}
else if (tail == -1 && Main.projectile[i].type == typeTail)
if (tail == -1 && Main.projectile[num187].type == ModContent.ProjectileType<MechwormTail>())
{
tail = i;
tail = num187;
}
if (head != -1 && tail != -1)
{
@@ -114,53 +87,30 @@ namespace CalamityMod.Items.Weapons.Summon
}
if (head == -1 && tail == -1)
{
float num77 = Vector2.Dot(value, vector3);
if (num77 > 0f)
{
player.ChangeDir(1);
}
else
{
player.ChangeDir(-1);
}
velX = 0f;
velY = 0f;
vector2.X = (float)Main.mouseX + Main.screenPosition.X;
vector2.Y = (float)Main.mouseY + Main.screenPosition.Y;
int curr = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormHead>(), damage, knockBack, owner);
speedX = 0f;
speedY = 0f;
position.X = (float)Main.mouseX + Main.screenPosition.X;
position.Y = (float)Main.mouseY + Main.screenPosition.Y;
int curr = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, type, damage, knockBack, player.whoAmI, 0f, 0f);
curr = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<MechwormBody>(), damage, knockBack, player.whoAmI, curr, 0f);
int head2 = curr;
int prev = curr;
curr = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormBody>(), damage, knockBack, owner, (float)prev);
Main.projectile[curr].identity = head2;
prev = curr;
curr = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormBody2>(), damage, knockBack, owner, (float)prev);
Main.projectile[prev].localAI[1] = (float)curr;
Main.projectile[prev].netUpdate = true;
Main.projectile[curr].identity = head2;
prev = curr;
curr = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormTail>(), damage, knockBack, owner, (float)prev);
Main.projectile[prev].localAI[1] = (float)curr;
Main.projectile[prev].netUpdate = true;
curr = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<MechwormBody2>(), damage, knockBack, player.whoAmI, curr, 0f);
Main.projectile[head2].localAI[1] = curr;
head2 = curr;
curr = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<MechwormTail>(), damage, knockBack, player.whoAmI, curr, 0f);
Main.projectile[head2].localAI[1] = curr;
}
else if (head != -1 && tail != -1)
{
float uuid = (float)Projectile.GetByUUID(Main.myPlayer, Main.projectile[tail].ai[0]);
int body = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormBody>(), damage, knockBack, owner, uuid);
int back = Projectile.NewProjectile(vector2.X, vector2.Y, velX, velY, ModContent.ProjectileType<MechwormBody2>(), damage, knockBack, owner, (float)body);
Main.projectile[body].localAI[1] = (float)back;
Main.projectile[body].ai[1] = 1f;
int body = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<MechwormBody>(), damage, knockBack, player.whoAmI, Projectile.GetByUUID(Main.myPlayer, Main.projectile[tail].ai[0]), 0f);
int body2 = body;
body = Projectile.NewProjectile(position.X, position.Y, speedX, speedY, ModContent.ProjectileType<MechwormBody2>(), damage, knockBack, player.whoAmI, body, 0f);
Main.projectile[body2].localAI[1] = body;
Main.projectile[body2].netUpdate = true;
Main.projectile[body2].ai[1] = 1f;
Main.projectile[body].localAI[1] = tail;
Main.projectile[body].netUpdate = true;
Main.projectile[body].identity = head;
Main.projectile[back].localAI[1] = (float)tail;
Main.projectile[back].netUpdate = true;
Main.projectile[back].ai[1] = 1f;
Main.projectile[body].identity = head;
Main.projectile[body].ai[1] = 1f;
Main.projectile[tail].ai[0] = Main.projectile[body].projUUID;
Main.projectile[tail].netUpdate = true;
Main.projectile[tail].ai[1] = 1f;