37public final class DuelUtils {
43 public static boolean hasFunWeapon(
Player player, Item item) {
48 if (item.getName() ==
null) {
52 final String name = item.getName().toLowerCase();
54 return name.equals(
"fixed device") || name.contains(
"flowers") || name.equals(
"gnomeball") || name.equals(
"mouse toy") || name.equals(
"noose wand") || name.equals(
"pet rock") || name.equals(
"rat pole")
55 || name.equals(
"rubber chicken") || name.equals(
"scythe") || name.equals(
"snowball") || name.equals(
"trollweiss") || name.equals(
"undead chicken") || name.equals(
"large spade") || name.equals(
"stale baguette")
56 || name.equals(
"hunting knife") || name.equals(
"giant present") || name.equals(
"hand fan");
59 public static String getRuleText(
DuelRule rule) {
62 return "You can not switch items.";
64 return "You can not use ranged attacks.";
66 return "You can not use melee attacks.";
68 return "You can not use magic attacks.";
69 case NO_SPECIAL_ATTACK:
70 return "You can not use special attacks.";
71 case ONLY_FUN_WEAPONS:
72 return "You can only attack with `fun` weapons.";
74 return "You can not forfeit the duel.";
76 return "You can not use prayer.";
78 return "You can not use drinks.";
80 return "You can not use food.";
82 return "You can not move during the duel.";
84 return "There will be obsticals in the arena.";
86 return "You can only use whips and dragon daggers.";
88 return "You can not wear items on your head.";
90 return "You can not wear items on your back.";
92 return "You can not wear items on your neck.";
94 return "You can not wear items in your quiver.";
96 return "You can not wield weapons.";
98 return "You can not wear items on your chest.";
100 return "You can not use shields or 2h swords.";
102 return "You can not wear items on your legs.";
104 return "You can not wear items on your hands.";
106 return "You can not wear items on your feet.";
108 return "You can not wear items on your fingers.";
113 public static String getItemNames(Item[] items) {
114 final StringBuilder builder =
new StringBuilder();
115 for (
int i = 0; i < items.length; i++) {
116 Item item = items[i];
122 builder.append(
"<col=ff9040>").append(item.getName()).append(
"<col=ffffff>").append(
" x ").append(item.getAmount());
124 if (i < items.length - 1) {
125 builder.append(
"\\n");
129 final String result = builder.toString();
130 return result.isEmpty() ?
"<col=ff9040>Absolutely nothing!" : result;