Fletching now checks for inventory space before fletching darts, headless arrows, and arrows

This commit is contained in:
Bonesy 2024-03-03 05:44:25 +00:00 committed by Ryan
parent 9ca9f01ca3
commit 866372ad54
3 changed files with 18 additions and 0 deletions

View file

@ -7,6 +7,8 @@ import content.global.skill.fletching.Fletching;
import core.game.node.entity.player.Player;
import core.game.node.item.Item;
import static core.api.ContentAPIKt.*;
/**
* Represents the arrow head pulse to complete the headless arrow.
* @author 'Vexia
@ -53,6 +55,10 @@ public class ArrowHeadPulse extends SkillPulse<Item> {
player.getDialogueInterpreter().sendDialogue("You need a fletching level of " + arrow.level + " to do this.");
return false;
}
if (!hasSpaceFor(player, arrow.getFinished())) {
sendDialogue(player, "You do not have enough inventory space.");
return false;
}
return true;
}

View file

@ -6,6 +6,8 @@ import core.game.node.entity.skill.Skills;
import core.game.node.entity.player.Player;
import core.game.node.item.Item;
import static core.api.ContentAPIKt.*;
/**
* Represents the arrow pulse for creating unfinished arrows.
* @author 'Vexia
@ -75,6 +77,10 @@ public final class HeadlessArrowPulse extends SkillPulse<Item> {
} else {
useSets = false;
}
if (!hasSpaceFor(player, HEADLESS_ARROW.asItem())) {
sendDialogue(player, "You do not have enough inventory space.");
return false;
}
return true;
}

View file

@ -6,6 +6,8 @@ import content.global.skill.fletching.Fletching;
import core.game.node.entity.player.Player;
import core.game.node.item.Item;
import static core.api.ContentAPIKt.*;
/**
* Represents the dart pulse.
* @author ceikry
@ -48,6 +50,10 @@ public final class DartPulse extends SkillPulse<Item> {
player.getDialogueInterpreter().sendDialogue("You need to have completed Tourist Trap to fletch darts.");
return false;
}
if (!hasSpaceFor(player, dart.getFinished())) {
sendDialogue(player, "You do not have enough inventory space.");
return false;
}
return true;
}