|
RuneHive-Game
|
The random event handler. More...
Public Member Functions | |
| void | cleanup () |
| Cleans up the activity when finished. | |
| ActivityDeathType | deathType () |
| void | finish () |
| Finishes the activity. | |
| ActivityType | getType () |
| void | onLogout (Player player) |
| Called when the player logs out. | |
| void | onRegionChange (Player player) |
| Called when the player changes region. | |
| RandomEvent (Player player, int cooldown) | |
Constructs a new RandomEvent. | |
| Public Member Functions inherited from com.runehive.content.activity.Activity | |
| Activity (int cooldown, int instance) | |
Constructs a new SequencedMinigame object. | |
| void | add (Mob mob) |
| Adds a mob to the activity. | |
| boolean | canDrinkPotions (Player player) |
| boolean | canEat (Player player, FoodData foodType) |
| boolean | canEquipItem (Player player, Item item, EquipmentType type) |
| boolean | canLogout (Player player) |
| boolean | canSpellCast (Player player) |
| boolean | canTeleport (Player player) |
| Called when the player attempts to teleport. | |
| boolean | canUsePrayer (Player player) |
| boolean | canUseSpecial (Player player) |
| void | cooldown (int cooldown) |
| Applies a cooldown. | |
| int | getInstance () |
| Gets this activity's instance level. | |
| Optional< Activity_Panel > | getPanel () |
| Gets an optional of the activity panel. | |
| int | getTicks () |
| Gets the current ticks. | |
| void | onDeath (Mob mob) |
| Called when the player die. | |
| boolean | onEvent (Player player, InteractionEvent interactionEvent) |
| boolean | onStep (Mob mob) |
| void | remove (Mob mob) |
| Removes a mob from the activity. | |
| void | removeAll (Mob... mobs) |
| Removes all mobs from the activity. | |
| void | sequence () |
| Sequences the activity. | |
| void | setInstance (int instance) |
| void | setPanel (Activity_Panel panel) |
| Sets the activity panel. | |
| void | setPause (boolean pause) |
| Sets the pause state of the activity. | |
| void | update () |
| The update method. | |
Public Attributes | |
| Player | player |
| The player instance. | |
Protected Member Functions | |
| abstract int | eventNpcIdentification () |
| The event npc identification. | |
| abstract String[] | eventNpcShout () |
| The event npc shout messages. | |
| void | start () |
| Starts the next activity stage. | |
| Protected Member Functions inherited from com.runehive.content.activity.Activity | |
| boolean | clickButton (Player player, ClickButtonInteractionEvent event) |
| boolean | clickItem (Player player, ItemInteractionEvent event) |
| boolean | clickNpc (Player player, NpcInteractionEvent event) |
| boolean | clickObject (Player player, ObjectInteractionEvent event) |
| final void | finishCooldown () |
Sets the cooldown flag to FINISH. | |
| Optional<? extends ActivityListener<? extends Activity > > | getListener () |
Gets an Optional of the ActivityListener for this activity. | |
| final boolean | isPaused () |
| Checks if the cooldown is paused. | |
| boolean | itemContainerAction (Player player, ItemContainerInteractionEvent event) |
| final void | pause () |
Sets the cooldown flag to PAUSE. | |
| boolean | pickupItem (Player player, PickupItemInteractionEvent event) |
| final void | resetCooldown () |
| Resets the remaining ticks to the cached cooldown ticks. | |
| void | restart (int delay, Runnable runnable) |
| boolean | useItem (Player player, ItemOnItemInteractionEvent event) |
| boolean | useItem (Player player, ItemOnObjectInteractionEvent event) |
Protected Attributes | |
| boolean | angered |
| Flag if the event is angered. | |
| Npc | eventNpc |
| The event npc. | |
Private Attributes | |
| int | count |
| Th message count. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from com.runehive.content.activity.Activity | |
| static boolean | evaluate (Mob mob, Predicate< Activity > predicate) |
| static void | forActivity (Mob mob, Consumer< Activity > consumer) |
| static< T extends Activity > Optional< T > | search (Player player, Class< T > clazz) |
| Static Protected Attributes inherited from com.runehive.content.activity.Activity | |
| static final int | FINISH = -1 |
| The 'finish' cooldown id. | |
| static final int | PAUSE = -2 |
| The 'pause' cooldown id. | |
| static final int | START = 0 |
| The 'start' cooldown id. | |
The random event handler.
Definition at line 20 of file RandomEvent.java.
| com.runehive.content.activity.randomevent.RandomEvent.RandomEvent | ( | Player | player, |
| int | cooldown ) |
Constructs a new RandomEvent.
Definition at line 35 of file RandomEvent.java.
References com.runehive.content.activity.Activity.cooldown, and player.
| void com.runehive.content.activity.randomevent.RandomEvent.cleanup | ( | ) |
Cleans up the activity when finished.
Reimplemented from com.runehive.content.activity.Activity.
Definition at line 99 of file RandomEvent.java.
References eventNpc.
Referenced by finish().
| ActivityDeathType com.runehive.content.activity.randomevent.RandomEvent.deathType | ( | ) |
Reimplemented from com.runehive.content.activity.Activity.
Definition at line 104 of file RandomEvent.java.
References com.runehive.content.activity.ActivityDeathType.NORMAL.
|
abstractprotected |
The event npc identification.
Reimplemented in com.runehive.content.activity.randomevent.impl.DrillDemonEvent, com.runehive.content.activity.randomevent.impl.GenieEvent, and com.runehive.content.activity.randomevent.impl.MimeEvent.
Referenced by start().
|
abstractprotected |
The event npc shout messages.
Reimplemented in com.runehive.content.activity.randomevent.impl.DrillDemonEvent, com.runehive.content.activity.randomevent.impl.GenieEvent, and com.runehive.content.activity.randomevent.impl.MimeEvent.
Referenced by start().
| void com.runehive.content.activity.randomevent.RandomEvent.finish | ( | ) |
Finishes the activity.
Reimplemented from com.runehive.content.activity.Activity.
Definition at line 81 of file RandomEvent.java.
References cleanup(), and player.
Referenced by onLogout(), and start().
| ActivityType com.runehive.content.activity.randomevent.RandomEvent.getType | ( | ) |
Reimplemented from com.runehive.content.activity.Activity.
Definition at line 109 of file RandomEvent.java.
References com.runehive.content.activity.ActivityType.RANDOM_EVENT.
| void com.runehive.content.activity.randomevent.RandomEvent.onLogout | ( | Player | player | ) |
Called when the player logs out.
Reimplemented from com.runehive.content.activity.Activity.
Definition at line 94 of file RandomEvent.java.
References finish(), and player.
| void com.runehive.content.activity.randomevent.RandomEvent.onRegionChange | ( | Player | player | ) |
Called when the player changes region.
Reimplemented from com.runehive.content.activity.Activity.
Definition at line 87 of file RandomEvent.java.
References eventNpc, com.runehive.content.activity.Activity.finishCooldown(), and player.
|
protected |
Starts the next activity stage.
Reimplemented from com.runehive.content.activity.Activity.
Definition at line 48 of file RandomEvent.java.
References com.runehive.content.activity.Activity.add(), angered, com.runehive.content.activity.Activity.cooldown, count, com.runehive.Config.DEFAULT_POSITION, eventNpc, eventNpcIdentification(), eventNpcShout(), finish(), player, and com.runehive.content.activity.Activity.resetCooldown().
|
protected |
Flag if the event is angered.
Definition at line 32 of file RandomEvent.java.
Referenced by com.runehive.content.activity.randomevent.impl.DrillDemonEvent.clickNpc(), com.runehive.content.activity.randomevent.impl.GenieEvent.clickNpc(), com.runehive.content.activity.randomevent.impl.MimeEvent.clickNpc(), and start().
|
private |
|
protected |
The event npc.
Definition at line 26 of file RandomEvent.java.
Referenced by cleanup(), com.runehive.content.activity.randomevent.impl.DrillDemonEvent.clickNpc(), com.runehive.content.activity.randomevent.impl.GenieEvent.clickNpc(), com.runehive.content.activity.randomevent.impl.MimeEvent.clickNpc(), onRegionChange(), and start().
| Player com.runehive.content.activity.randomevent.RandomEvent.player |
The player instance.
Definition at line 23 of file RandomEvent.java.
Referenced by com.runehive.content.activity.randomevent.impl.DrillDemonEvent.clickNpc(), com.runehive.content.activity.randomevent.impl.GenieEvent.clickNpc(), com.runehive.content.activity.randomevent.impl.MimeEvent.clickNpc(), com.runehive.content.activity.randomevent.impl.DrillDemonEvent.create(), com.runehive.content.activity.randomevent.impl.GenieEvent.create(), com.runehive.content.activity.randomevent.impl.MimeEvent.create(), com.runehive.content.activity.randomevent.impl.DrillDemonEvent.DrillDemonEvent(), com.runehive.content.activity.randomevent.impl.MimeEvent.eventNpcShout(), finish(), com.runehive.content.activity.randomevent.impl.GenieEvent.GenieEvent(), com.runehive.content.activity.randomevent.impl.MimeEvent.MimeEvent(), onLogout(), onRegionChange(), RandomEvent(), and start().