RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
DuelUtils.java
1package com.osroyale.content.activity.impl.duelarena;
2
3import com.osroyale.game.world.entity.mob.player.Player;
4import com.osroyale.game.world.items.Item;
5
36
37public final class DuelUtils {
38
39 private DuelUtils() {
40
41 }
42
43 public static boolean hasFunWeapon(Player player, Item item) {
44 if (item == null) {
45 return false;
46 }
47
48 if (item.getName() == null) {
49 return false;
50 }
51
52 final String name = item.getName().toLowerCase();
53
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");
57 }
58
59 public static String getRuleText(DuelRule rule) {
60 switch(rule) {
61 case LOCK_ITEMS:
62 return "You can not switch items.";
63 case NO_RANGED:
64 return "You can not use ranged attacks.";
65 case NO_MELEE:
66 return "You can not use melee attacks.";
67 case NO_MAGIC:
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.";
73 case NO_FORFEIT:
74 return "You can not forfeit the duel.";
75 case NO_PRAYER:
76 return "You can not use prayer.";
77 case NO_DRINKS:
78 return "You can not use drinks.";
79 case NO_FOOD:
80 return "You can not use food.";
81 case NO_MOVEMENT:
82 return "You can not move during the duel.";
83 case OBSTACLES:
84 return "There will be obsticals in the arena.";
85 case ONLY_WHIP_DDS:
86 return "You can only use whips and dragon daggers.";
87 case NO_HEAD:
88 return "You can not wear items on your head.";
89 case NO_CAPE:
90 return "You can not wear items on your back.";
91 case NO_NECKLACE:
92 return "You can not wear items on your neck.";
93 case NO_AMMO:
94 return "You can not wear items in your quiver.";
95 case NO_WEAPON:
96 return "You can not wield weapons.";
97 case NO_BODY:
98 return "You can not wear items on your chest.";
99 case NO_SHIELD:
100 return "You can not use shields or 2h swords.";
101 case NO_LEGS:
102 return "You can not wear items on your legs.";
103 case NO_GLOVES:
104 return "You can not wear items on your hands.";
105 case NO_BOOTS:
106 return "You can not wear items on your feet.";
107 case NO_RINGS:
108 return "You can not wear items on your fingers.";
109 }
110 return "";
111 }
112
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];
117
118 if (item == null) {
119 continue;
120 }
121
122 builder.append("<col=ff9040>").append(item.getName()).append("<col=ffffff>").append(" x ").append(item.getAmount());
123
124 if (i < items.length - 1) {
125 builder.append("\\n");
126 }
127
128 }
129 final String result = builder.toString();
130 return result.isEmpty() ? "<col=ff9040>Absolutely nothing!" : result;
131 }
132
133}