1package com.runehive.game.world.entity.combat.ranged;
3import com.runehive.game.Animation;
4import com.runehive.game.Graphic;
5import com.runehive.game.Projectile;
6import com.runehive.game.UpdatePriority;
7import com.runehive.game.world.entity.combat.CombatImpact;
8import com.runehive.game.world.entity.combat.projectile.CombatProjectile;
9import com.runehive.game.world.entity.mob.Mob;
10import com.runehive.game.world.items.Item;
11import it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap;
12import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
14import java.util.Optional;
16import static com.runehive.game.world.entity.combat.projectile.CombatProjectile.getDefinition;
22 return getDefinition(
"Bronze javelin");
28 return getDefinition(
"Iron javelin");
34 return getDefinition(
"Steel javelin");
40 return getDefinition(
"Mithril javelin");
46 return getDefinition(
"Adamant javelin");
52 return getDefinition(
"Rune javelin");
58 return getDefinition(
"Dragon javelin");
65 return getDefinition(
"Bronze thrownaxe");
71 return getDefinition(
"Iron thrownaxe");
77 return getDefinition(
"Steel thrownaxe");
83 return getDefinition(
"Mithril thrownaxe");
89 return getDefinition(
"Adamant thrownaxe");
95 return getDefinition(
"Rune thrownaxe");
101 return getDefinition(
"Dragon thrownaxe");
108 return getDefinition(
"Bronze dart");
115 return getDefinition(
"Craw's bow");
122 return getDefinition(
"Hefin");
129 return getDefinition(
"Iorwerth");
136 return getDefinition(
"Traheaern");
143 return getDefinition(
"Cadarn");
150 return getDefinition(
"Crwys");
157 return getDefinition(
"Amlodd");
164 return getDefinition(
"Meilyr");
173 return getDefinition(
"Iron dart");
179 return getDefinition(
"Black dart");
185 return getDefinition(
"Steel dart");
191 return getDefinition(
"Mithril dart");
197 return getDefinition(
"Adamant dart");
203 return getDefinition(
"Rune dart");
209 return getDefinition(
"Dragon dart");
216 return getDefinition(
"Bronze knife");
222 return getDefinition(
"Iron knife");
228 return getDefinition(
"Black knife");
234 return getDefinition(
"Steel knife");
240 return getDefinition(
"Mithril knife");
246 return getDefinition(
"Adamant knife");
249 DRAGON_BOLTS(
true, 21932, 21934, 21936, 21938, 21940, 21942, 21944, 21946, 21948, 21950) {
252 return getDefinition(
"Dragon Bolts");
258 return getDefinition(
"Rune knife");
264 return getDefinition(
"Dragon knife");
271 return getDefinition(
"Bronze arrow");
277 return getDefinition(
"Iron arrow");
283 return getDefinition(
"Steel arrow");
289 return getDefinition(
"Mithril arrow");
295 return getDefinition(
"Adamant arrow");
301 return getDefinition(
"Rune arrow");
307 return getDefinition(
"Dragon arrow");
314 return getDefinition(
"Bronze arrow");
320 return getDefinition(
"Iron arrow");
326 return getDefinition(
"Steel arrow");
332 return getDefinition(
"Mithril arrow");
338 return getDefinition(
"Adamant arrow");
344 return getDefinition(
"Rune arrow");
350 return getDefinition(
"Dragon arrow");
357 return getDefinition(
"Bronze bolts");
363 return getDefinition(
"Blurite bolts");
369 return getDefinition(
"Iron bolts");
375 return getDefinition(
"Silver bolts");
381 return getDefinition(
"Steel bolts");
387 return getDefinition(
"Mithril bolts");
393 return getDefinition(
"Adamant bolts");
399 return getDefinition(
"Runite bolts");
406 return getDefinition(
"Bronze brutal");
412 return getDefinition(
"Iron brutal");
418 return getDefinition(
"Steel brutal");
424 return getDefinition(
"Black brutal");
430 return getDefinition(
"Mithril brutal");
436 return getDefinition(
"Adamant brutal");
442 return getDefinition(
"Rune brutal");
449 return getDefinition(
"Toktz-xil-ul");
455 return getDefinition(
"Bone bolts");
461 return getDefinition(
"Ogre arrow");
467 return getDefinition(
"Ice arrows");
474 return getDefinition(
"Training arrows");
480 return getDefinition(
"Bolt rack");
487 return getDefinition(
"Broad-tipped bolts");
493 return getDefinition(
"Broad arrow");
500 return getDefinition(
"Chinchompa");
506 return getDefinition(
"Red chinchompa");
513 return getDefinition(
"Kebbit bolts");
519 return getDefinition(
"Long kebbit bolts");
526 return getDefinition(
"Guam tar");
532 return getDefinition(
"Marrentill tar");
538 return getDefinition(
"Tarromin tar");
541 HARRALANDER_TAR(
false, 10145) {
544 return getDefinition(
"Harralander tar");
555 this.weapons =
new int[0];
566 private static final Int2ObjectMap<RangedAmmunition>
itemIdToType =
new Int2ObjectArrayMap<>(
values.length);
570 final int[]
ids = value.ids;
586 return new int[] { 11235, 12765, 12766, 12767, 12768 };
602 second.
send(attacker, defender);
619 return getDefinition(
new Item(
id).getName()).getStart();
651 if (item ==
null)
return null;
653 if (ammo.weapons.length > 0 &&
weapon !=
null) {
654 for (
int weaponId : ammo.weapons) {
655 if (weaponId ==
weapon.getId()) {
656 for (
int id : ammo.ids) {
657 if (
id == item.
getId()) {
664 for (
int id : ammo.ids) {
665 if (
id == item.
getId()) {
686 return getDefinition(
new Item(
id).getName()).getAnimation();
691 public Optional<Graphic>
getEnd(
int id) {
703 return getDefinition(
new Item(
id).getName()).getEnd();
720 return getDefinition(
new Item(
id).getName()).getEffect();
Represents a single graphic that can be used by entities.
void send(Mob source, Mob target)
void setDuration(int duration)
The container class that represents an item that can be interacted with.
final int getId()
Gets the identification of this item.
Represents different priorities for updating.
static final RangedAmmunition[] values
static RangedAmmunition find(Item weapon, Item item)
abstract CombatProjectile getProjectile()
void sendProjectile(Mob attacker, Mob defender)
RangedAmmunition(boolean droppable, int... ids)
Optional< Animation > getAnimation(int id)
Optional< Graphic > getEnd(int id)
RangedAmmunition(boolean droppable, int[] weapons, int... ids)
static RangedAmmunition forItemId(final int itemId)
Optional< CombatImpact > getEffect(int id)
static final Int2ObjectMap< RangedAmmunition > itemIdToType
Optional< Graphic > getStart(int id)