Yaks now have their unique usewith interaction

This commit is contained in:
ceikry
2021-07-10 14:28:37 -05:00
parent 812bc1834f
commit fb114c4315
5 changed files with 57 additions and 0 deletions
@@ -112,6 +112,8 @@ public abstract class MapZone implements Zone {
return false;
}
public boolean handleUseWith(Player player, Item used, Node with){return false;}
/**
* Handles an reward button.
* @param player The player.
@@ -7,6 +7,7 @@ import core.game.node.entity.combat.CombatStyle;
import core.game.node.entity.player.Player;
import core.game.node.entity.player.link.music.MusicZone;
import core.game.node.entity.player.link.request.RequestType;
import core.game.node.item.Item;
import core.game.world.map.Location;
import java.util.ArrayList;
@@ -149,6 +150,18 @@ public final class ZoneMonitor {
return false;
}
/**
* Checks if a zone handles a useWith interaction
*/
public boolean useWith(Item used, Node with){
for (RegionZone z : zones) {
if (z.getZone().handleUseWith(entity.asPlayer(), used,with)) {
return true;
}
}
return false;
}
/**
* Checks if the player handled the reward button using a map zone.
* @param interfaceId The interface id.