1package com.runehive.game.world.entity.mob.prayer;
4import java.util.function.Consumer;
104 List<Prayer> list = Arrays.asList(prayers);
105 Set<Prayer>
activate =
new HashSet<>(list);
152 Set<Prayer>
activate =
new HashSet<>();
196 int effect = 0, amount = 0;
197 int resistance = 60 + 2 * bonus;
200 effect +=
prayer.getDrainRate();
262 return "PrayerBook[active=" +
active.toString() +
"]";
A PrayerBook which stores prayers.
void onlyOrNone(Prayer... prayers)
Activates only the prayers provided.
void reset()
Iterates through the active prayers and disables them all.
final Set< Prayer > active
The set of prayers.
transient Consumer< Prayer > sendDeactivated
The method of sending the deactivated prayer config id to the client.
transient Consumer< Prayer > sendNoOverhead
The method of removing the overhead prayer from the client.
void deactivate(Prayer... prayers)
Sends the dectivate prayer packet to the client.
void only(Prayer... prayers)
Activates only the prayers provided.
transient Consumer< Prayer > sendActivated
The method of sending the activated prayer config id to the client.
void setAs(PrayerBook book)
Sets all prayers active from another prayer book.
boolean noneActive(Prayer... prayers)
Checks if none of the given prayers are active.
boolean isActive(Prayer... prayers)
Checks if all given prayers are active.
int drainAmount(int bonus)
Calculates the amount of prayer points to drain relative to the given game ticks.
void activate(Prayer... prayers)
Sends the activate prayer packet to the client.
void mutate(Set< Prayer > activate, Set< Prayer > deactivate)
Toggles prayers supplied in the activate and deactivate sets.
Set< Prayer > getEnabled()
transient Consumer< Prayer > sendOverhead
The method of sending the overhead prayer to the client.
void deactivateOverhead()
transient int drainCounter
The drain counter.
void setOnChange(Consumer< Prayer > sendActivated, Consumer< Prayer > sendDeactivated, Consumer< Prayer > sendOverhead, Consumer< Prayer > sendNoOverhead)
Sets the method of sending the prayer update to the client.
void toggle(Prayer... prayers)
Inverts a prayer's active state.
boolean anyActive(Prayer... prayers)
Checks if any given prayers are active.
static final Collection< Prayer > OVERHEAD