Fletching now checks for inventory space before fletching darts, headless arrows, and arrows
This commit is contained in:
@@ -7,6 +7,8 @@ import content.global.skill.fletching.Fletching;
|
|||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.node.item.Item;
|
import core.game.node.item.Item;
|
||||||
|
|
||||||
|
import static core.api.ContentAPIKt.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the arrow head pulse to complete the headless arrow.
|
* Represents the arrow head pulse to complete the headless arrow.
|
||||||
* @author 'Vexia
|
* @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.");
|
player.getDialogueInterpreter().sendDialogue("You need a fletching level of " + arrow.level + " to do this.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!hasSpaceFor(player, arrow.getFinished())) {
|
||||||
|
sendDialogue(player, "You do not have enough inventory space.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import core.game.node.entity.skill.Skills;
|
|||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.node.item.Item;
|
import core.game.node.item.Item;
|
||||||
|
|
||||||
|
import static core.api.ContentAPIKt.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the arrow pulse for creating unfinished arrows.
|
* Represents the arrow pulse for creating unfinished arrows.
|
||||||
* @author 'Vexia
|
* @author 'Vexia
|
||||||
@@ -75,6 +77,10 @@ public final class HeadlessArrowPulse extends SkillPulse<Item> {
|
|||||||
} else {
|
} else {
|
||||||
useSets = false;
|
useSets = false;
|
||||||
}
|
}
|
||||||
|
if (!hasSpaceFor(player, HEADLESS_ARROW.asItem())) {
|
||||||
|
sendDialogue(player, "You do not have enough inventory space.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import content.global.skill.fletching.Fletching;
|
|||||||
import core.game.node.entity.player.Player;
|
import core.game.node.entity.player.Player;
|
||||||
import core.game.node.item.Item;
|
import core.game.node.item.Item;
|
||||||
|
|
||||||
|
import static core.api.ContentAPIKt.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the dart pulse.
|
* Represents the dart pulse.
|
||||||
* @author ceikry
|
* @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.");
|
player.getDialogueInterpreter().sendDialogue("You need to have completed Tourist Trap to fletch darts.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!hasSpaceFor(player, dart.getFinished())) {
|
||||||
|
sendDialogue(player, "You do not have enough inventory space.");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user