Skip to content

Commit

Permalink
brick fish painting obtainable now
Browse files Browse the repository at this point in the history
  • Loading branch information
UriBuilder committed Aug 8, 2024
1 parent 11b269b commit 2a02afb
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 31 deletions.
6 changes: 6 additions & 0 deletions Common/Fishing/AequusPlayer.FishRewards.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using Aequus.Content.Items.Accessories.Informational.AnglerBroadcaster;
using Aequus.Items.Misc.FishCatches.QuestFish;
using Aequus.Items.Misc.FishingBait;
using System.Collections.Generic;

namespace Aequus;
public partial class AequusPlayer : ModPlayer {
public override void AnglerQuestReward(float rareMultiplier, List<Item> rewardItems) {
int questFish = Main.anglerQuestItemNetIDs[Main.anglerQuest];
if (Main.rand.Next(8) <= (Player.anglerQuestsFinished / 4) || Player.anglerQuestsFinished <= 1) {
if (Main.rand.NextBool()) {
return;
Expand Down Expand Up @@ -41,6 +43,10 @@ public override void AnglerQuestReward(float rareMultiplier, List<Item> rewardIt

rewardItems.Add(item);
}

if (questFish == ModContent.ItemType<BrickFish>()) {
rewardItems.Add(new Item(BrickFish.CustomReward));
}
}

public void LegendaryFishRewards(NPC npc, Item item, int i) {
Expand Down
3 changes: 2 additions & 1 deletion Content/Tiles/Paintings/Paintings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ protected override void Register() {
Tooltip: SignatureNalyddd
).AddEntry(Sets.DesertPictures);

global::Aequus.Items.Misc.FishCatches.QuestFish.BrickFish.CustomReward =
New("BrickFish", AequusTextures.BrickFishPainting.FullPath,
W: 3, H: 3,
Rare: ItemRarityID.White,
Value: Item.sellPrice(silver: 10),
MapColor: Color.Orange,
CustomName: ALanguage.L_GetItemName<global::Aequus.Items.Misc.FishCatches.QuestFish.BrickFish>(),
Tooltip: SignatureNalyddd
).AddEntry(Sets.DesertPictures);
).AddEntry(Sets.DesertPictures).ItemType;

New("Rockman", AequusTextures.RockmanPainting.FullPath,
W: 2, H: 3,
Expand Down
57 changes: 27 additions & 30 deletions Items/Misc/FishCatches/QuestFish/BrickFish.cs
Original file line number Diff line number Diff line change
@@ -1,43 +1,40 @@
using Aequus.NPCs.Town.CarpenterNPC;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.DataStructures;
using Terraria.ID;
using Terraria.ModLoader;

namespace Aequus.Items.Misc.FishCatches.QuestFish {
public class BrickFish : ModItem {
public override void SetStaticDefaults() {
Item.ResearchUnlockCount = 2;
}
namespace Aequus.Items.Misc.FishCatches.QuestFish;
public class BrickFish : ModItem {
public static int CustomReward { get; internal set; }

public override void SetDefaults() {
Item.CloneDefaults(ItemID.Batfish);
}
public override void SetStaticDefaults() {
Item.ResearchUnlockCount = 2;
}

public override bool IsQuestFish() {
return true;
}
public override void SetDefaults() {
Item.CloneDefaults(ItemID.Batfish);
}

public override bool IsAnglerQuestAvailable() {
return NPC.AnyNPCs(ModContent.NPCType<Carpenter>());
}
public override bool IsQuestFish() {
return true;
}

public override void AnglerQuestChat(ref string description, ref string catchLocation) {
description = TextHelper.GetTextValue("AnglerQuest.BrickFish.Description");
catchLocation = TextHelper.GetTextValue("AnglerQuest.BrickFish.CatchLocation");
}
public override bool IsAnglerQuestAvailable() {
return NPC.AnyNPCs(ModContent.NPCType<Carpenter>());
}

public override void AnglerQuestChat(ref string description, ref string catchLocation) {
description = TextHelper.GetTextValue("AnglerQuest.BrickFish.Description");
catchLocation = TextHelper.GetTextValue("AnglerQuest.BrickFish.CatchLocation");
}

public static bool CheckVillagerBuildings(FishingAttempt attempt, Player player) {
var comparePoint = new Vector2(attempt.X * 16f + 8f, attempt.Y * 16f + 8f);
for (int i = 0; i < Main.maxNPCs; i++) {
if (Main.npc[i].friendly && Main.npc[i].townNPC && !Main.npc[i].homeless) {
if (Vector2.Distance(Main.npc[i].Home().ToWorldCoordinates(), comparePoint) < 1000f) {
return true;
}
public static bool CheckVillagerBuildings(FishingAttempt attempt, Player player) {
var comparePoint = new Vector2(attempt.X * 16f + 8f, attempt.Y * 16f + 8f);
for (int i = 0; i < Main.maxNPCs; i++) {
if (Main.npc[i].friendly && Main.npc[i].townNPC && !Main.npc[i].homeless) {
if (Vector2.Distance(Main.npc[i].Home().ToWorldCoordinates(), comparePoint) < 1000f) {
return true;
}
}
return false;
}
return false;
}
}

0 comments on commit 2a02afb

Please sign in to comment.