Skip to content

Commit

Permalink
rename harvester, folders/namespace, add tell before bombing
Browse files Browse the repository at this point in the history
  • Loading branch information
direwolf420 committed Apr 17, 2022
1 parent 3e6298e commit 1ec3bea
Show file tree
Hide file tree
Showing 45 changed files with 131 additions and 65 deletions.
2 changes: 1 addition & 1 deletion AssWorld.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AssortedCrazyThings.NPCs;
using AssortedCrazyThings.NPCs.DungeonBird;
using AssortedCrazyThings.NPCs.Harvester;
using Microsoft.Xna.Framework;
using System.Collections.Generic;
using System.IO;
Expand Down
4 changes: 2 additions & 2 deletions AssortedCrazyThings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using AssortedCrazyThings.Effects;
using AssortedCrazyThings.Items.Pets.CuteSlimes;
using AssortedCrazyThings.Items.Weapons;
using AssortedCrazyThings.NPCs.DungeonBird;
using AssortedCrazyThings.NPCs.Harvester;
using AssortedCrazyThings.Projectiles.Pets;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
Expand Down Expand Up @@ -122,7 +122,7 @@ private void LoadHarvesterTypes()
return;
}

harvester = ModContent.NPCType<Harvester>();
harvester = ModContent.NPCType<HarvesterBoss>();
harvesterTalonLeft = ModContent.NPCType<HarvesterTalonLeft>();
harvesterTalonRight = ModContent.NPCType<HarvesterTalonRight>();
}
Expand Down
6 changes: 2 additions & 4 deletions Base/ModSupport/OtherModCalls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using AssortedCrazyThings.Items.Placeable;
using AssortedCrazyThings.Items.VanityArmor;
using AssortedCrazyThings.Items.Weapons;
using AssortedCrazyThings.NPCs.DungeonBird;
using AssortedCrazyThings.NPCs.Harvester;
using AssortedCrazyThings.Projectiles.Minions;
using AssortedCrazyThings.Projectiles.Minions.CompanionDungeonSouls;
using System;
Expand Down Expand Up @@ -36,8 +36,6 @@ public override void PostSetupContent()

int summonItem = ModContent.ItemType<IdolOfDecay>();

//TODO harvester, include 15 x ModContent.ItemType<CaughtDungeonSoulFreed>() in loot but dont spawn it

/*
* "AddBoss",
args[1] as Mod, // Mod
Expand All @@ -55,7 +53,7 @@ args[11] as Action<SpriteBatch, Rectangle, Color> // Custom Drawing
bossChecklist.Call(
"AddBoss",
Mod,
Harvester.name,
HarvesterBoss.name,
AssortedCrazyThings.harvester,
5.1f,
(Func<bool>)(() => AssWorld.downedHarvester),
Expand Down
8 changes: 4 additions & 4 deletions BossBars/HarvesterBossBar.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using AssortedCrazyThings.NPCs.DungeonBird;
using AssortedCrazyThings.NPCs.Harvester;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
Expand Down Expand Up @@ -35,7 +35,7 @@ public override Asset<Texture2D> GetIconTexture(ref Rectangle? iconFrame)
lifePercent = Utils.Clamp(npc.life / (float)npc.lifeMax, 0f, 1f);
shieldPercent = 0f;

if (npc.ModNPC is Harvester harvester)
if (npc.ModNPC is HarvesterBoss harvester)
{
if (!harvester.IsReviving)
{
Expand All @@ -45,8 +45,8 @@ public override Asset<Texture2D> GetIconTexture(ref Rectangle? iconFrame)
lifePercent = 0f;

var stats = harvester.GetAIStats();
shieldPercent = Utils.Clamp(harvester.ReviveProgress / Harvester.Revive_Duration, 0f, 1f);
shieldPercent = Utils.Remap(shieldPercent, 0f, 1f, Harvester.Revive_MinHP, stats.MaxHP);
shieldPercent = Utils.Clamp(harvester.ReviveProgress / HarvesterBoss.Revive_Duration, 0f, 1f);
shieldPercent = Utils.Remap(shieldPercent, 0f, 1f, HarvesterBoss.Revive_MinHP, stats.MaxHP);
}

return true;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using AssortedCrazyThings.Projectiles.NPCs.Bosses.DungeonBird;
using AssortedCrazyThings.Projectiles.NPCs.Bosses.Harvester;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
Expand All @@ -7,7 +7,7 @@
using Terraria.ID;
using Terraria.ModLoader;

namespace AssortedCrazyThings.Buffs.NPCs.Bosses.DungeonBird
namespace AssortedCrazyThings.Buffs.NPCs.Bosses.Harvester
{
[Content(ContentType.Bosses)]
public class BabyHarvesterBuff : AssBuff
Expand Down
6 changes: 3 additions & 3 deletions Items/CaughtDungeonSoul.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AssortedCrazyThings.NPCs.DungeonBird;
using AssortedCrazyThings.Projectiles.NPCs.Bosses.DungeonBird;
using AssortedCrazyThings.NPCs.Harvester;
using AssortedCrazyThings.Projectiles.NPCs.Bosses.Harvester;
using Microsoft.Xna.Framework;
using System.Collections.Generic;
using Terraria;
Expand All @@ -15,7 +15,7 @@ public override void SetStaticDefaults()
{
DisplayName.SetDefault("Loose Dungeon Soul");
Tooltip.SetDefault("'An inert soul caught by a net'"
+ "\nAwakened in your inventory when " + Harvester.name + " is defeated");
+ "\nAwakened in your inventory when " + HarvesterBoss.name + " is defeated");
// ticksperframe, frameCount
//Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 4));
//ItemID.Sets.AnimatesAsSoul[Item.type] = true;
Expand Down
4 changes: 2 additions & 2 deletions Items/CaughtDungeonSoulFreed.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using AssortedCrazyThings.NPCs.DungeonBird;
using AssortedCrazyThings.NPCs.Harvester;
using Terraria;
using Terraria.ID;

Expand All @@ -11,7 +11,7 @@ public class CaughtDungeonSoulFreed : CaughtDungeonSoulBase
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Freed Dungeon Soul");
Tooltip.SetDefault("Awakened by defeating the " + Harvester.name);
Tooltip.SetDefault("Awakened by defeating the " + HarvesterBoss.name);
ItemID.Sets.ItemIconPulse[Item.type] = true;
ItemID.Sets.ItemNoGravity[Item.type] = true;

Expand Down
6 changes: 3 additions & 3 deletions Items/IdolOfDecay.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using AssortedCrazyThings.NPCs.DungeonBird;
using AssortedCrazyThings.Projectiles.NPCs.Bosses.DungeonBird;
using AssortedCrazyThings.NPCs.Harvester;
using AssortedCrazyThings.Projectiles.NPCs.Bosses.Harvester;
using Terraria;
using Terraria.ID;

Expand All @@ -11,7 +11,7 @@ public class IdolOfDecay : AssItem
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Idol Of Decay");
Tooltip.SetDefault("Summons " + Harvester.name + "'s final form in the dungeon"
Tooltip.SetDefault("Summons " + HarvesterBoss.name + "'s final form in the dungeon"
+ "\nUnlimited uses!");

Terraria.GameContent.Creative.CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
Expand Down
Binary file removed NPCs/DungeonBird/HarvesterTalon.png
Binary file not shown.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Terraria.ID;
using Terraria.ModLoader;

namespace AssortedCrazyThings.NPCs.DungeonBird
namespace AssortedCrazyThings.NPCs.Harvester
{
//this class also contains the NPC classes at the very bottom
[Content(ContentType.Bosses)]
Expand Down
File renamed without changes
16 changes: 12 additions & 4 deletions NPCs/DungeonBird/Harvester.cs → NPCs/Harvester/HarvesterBoss.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using AssortedCrazyThings.Items.VanityArmor;
using AssortedCrazyThings.NPCs.DropConditions;
using AssortedCrazyThings.NPCs.DropRules;
using AssortedCrazyThings.Projectiles.NPCs.Bosses.DungeonBird;
using AssortedCrazyThings.Projectiles.NPCs.Bosses.Harvester;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
Expand All @@ -25,11 +25,12 @@
using Terraria.ModLoader;
using Terraria.ModLoader.IO;

namespace AssortedCrazyThings.NPCs.DungeonBird
namespace AssortedCrazyThings.NPCs.Harvester
{
[AutoloadBossHead]
[Content(ContentType.Bosses)]
public class Harvester : AssNPC
[LegacyName("Harvester")]
public class HarvesterBoss : AssNPC
{
public class AIStats
{
Expand Down Expand Up @@ -145,7 +146,7 @@ public override void SetStaticDefaults()

NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers(0)
{
CustomTexturePath = "AssortedCrazyThings/NPCs/DungeonBird/Harvester_Bestiary",
CustomTexturePath = "AssortedCrazyThings/NPCs/Harvester/Harvester_Bestiary",
Position = new Vector2(-9, 18), //Position on the icon
PortraitPositionXOverride = 0, //Position on the portrait when clicked on
PortraitPositionYOverride = 20,
Expand Down Expand Up @@ -1191,6 +1192,13 @@ private void HandleAI(Player target, List<HarvesterTalon> talons)
if (AI_Timer < 0)
{
AI_Timer--;

if (!keepSwooping)
{
//Last seek stage before bombing: put talons out
AI_Animation = Animation_Bombing;
}

float swoopPostTime = aiStats.SwoopWaitTime * lifeRatioClamped;
if (AI_Timer < -swoopPostTime)
{
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading

0 comments on commit 1ec3bea

Please sign in to comment.