Skip to content

Commit

Permalink
v0.17.0.1, credits, fix dust placement
Browse files Browse the repository at this point in the history
  • Loading branch information
JavidPack committed Oct 8, 2021
1 parent 34c49b8 commit fafaf52
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
38 changes: 18 additions & 20 deletions Tools/Fishing/FishingTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ internal static int GetPoolStats(Vector2 startPosition, out bool lava, out bool
// Added code to visualize pool dimensions
if (poolSize < 1000) {
// 1000 is highest value vanilla checks
Dust dust = Dust.NewDustPerfect(new Vector2(x, y) * 16 + new Vector2(8), 6, Vector2.Zero, Scale: 1.5f);
dust.noGravity = true;
dust.noLight = true;
Dust.QuickDust(new Point(x, y - 1), Color.Orange);
}
}
}
Expand Down Expand Up @@ -198,30 +196,30 @@ internal static void CalculateCatches(Vector2 spawnPosition, int bobberType, out
poolSize = 0;
lava = false;
honey = false;
// Spawn bobber with downward starting velocity
int index = Projectile.NewProjectile(spawnPosition, Vector2.UnitY * 8, bobberType, 0, 0f, Main.myPlayer);
if (index >= Main.maxProjectiles) {
return;
}

Projectile bobber = Main.projectile[index];

Player player = Main.LocalPlayer;
Vector2 originalCenter = player.Center;
bool originalWet = player.wet;
bool originalHoneyWet = player.honeyWet;
bool originalLavaWet = player.lavaWet;
Projectile bobber = null;
try {
// Spawn bobber with downward starting velocity
int index = Projectile.NewProjectile(spawnPosition, Vector2.UnitY * 8, bobberType, 0, 0f, Main.myPlayer);
if (index >= Main.maxProjectiles) {
return;
}

// Debug: Visualize bobber spawn location
//for (int i = 0; i < 10; i++)
//{
// Dust.NewDust(bobber.position, 16, 16, DustID.Fire);
//}
bobber = Main.projectile[index];

catches.Clear();
// Debug: Visualize bobber spawn location
//for (int i = 0; i < 10; i++)
//{
// Dust.NewDust(bobber.position, 16, 16, DustID.Fire);
//}

currentlyTesting = true;
try {
catches.Clear();

currentlyTesting = true;
int failureCount = 0;

player.Center = spawnPosition - new Vector2(0f, bobber.height * 2); //Temporarily teleport player above the bobber + twice the bobbers height
Expand Down Expand Up @@ -257,9 +255,9 @@ internal static void CalculateCatches(Vector2 spawnPosition, int bobberType, out
player.honeyWet = originalHoneyWet;
player.lavaWet = originalLavaWet;
currentlyTesting = false;
bobber?.Kill();
}

bobber.Kill();

// Debug: Visualize bobber final location
//for (int i = 0; i < 10; i++)
Expand Down
2 changes: 1 addition & 1 deletion build.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
author = jopojelly
version = 0.17
version = 0.17.0.1
myVersionScheme = major when done, minor when new tool, build when new item within tool, revision for bug fix quick release
displayName = Modders Toolkit
homepage = https://forums.terraria.org/index.php?threads/modders-toolkit-a-mod-for-modders-doing-modding.55738/
Expand Down
2 changes: 1 addition & 1 deletion description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Current Tools
-Player layer viewer
-Interface layer viewer.
-NPC Spawn Calculator
-Fishing Result Calculator
-Fishing Result Calculator (Thanks direwolf420)
-Texture updating/editing tool
-Shader updating/editing tool (w/ Webmilio) (see wiki for usage instructions)
-UI Playground
Expand Down

0 comments on commit fafaf52

Please sign in to comment.