RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.activity.impl.JailActivity Class Reference
Inheritance diagram for com.runehive.content.activity.impl.JailActivity:
Collaboration diagram for com.runehive.content.activity.impl.JailActivity:

Public Member Functions

boolean canTeleport (Player player)
 Called when the player attempts to teleport.
void cleanup ()
 Cleans up the activity when finished.
void finish ()
 Finishes the activity.
ActivityType getType ()
void onDeath (Mob mob)
 Called when the player die.
void onRegionChange (Player player)
 Called when the player changes region.
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 canUsePrayer (Player player)
boolean canUseSpecial (Player player)
void cooldown (int cooldown)
 Applies a cooldown.
ActivityDeathType deathType ()
int getInstance ()
 Gets this activity's instance level.
Optional< Activity_PanelgetPanel ()
 Gets an optional of the activity panel.
int getTicks ()
 Gets the current ticks.
boolean onEvent (Player player, InteractionEvent interactionEvent)
void onLogout (Player player)
 Called when the player logs out.
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.

Static Public Member Functions

static JailActivity create (Player player)
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)

Protected Member Functions

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)

Private Member Functions

 JailActivity (Player player)

Private Attributes

final Player player

Additional Inherited Members

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.

Detailed Description

Definition at line 9 of file JailActivity.java.

Constructor & Destructor Documentation

◆ JailActivity()

com.runehive.content.activity.impl.JailActivity.JailActivity ( Player player)
private

Definition at line 12 of file JailActivity.java.

12 {
13 super(30, Mob.DEFAULT_INSTANCE);
14 this.player = player;
15 }

References com.runehive.game.world.entity.Entity.DEFAULT_INSTANCE, and player.

Referenced by create().

Here is the caller graph for this function:

Member Function Documentation

◆ canTeleport()

boolean com.runehive.content.activity.impl.JailActivity.canTeleport ( Player player)

Called when the player attempts to teleport.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 40 of file JailActivity.java.

40 {
41 player.message("You are jailed you douche!");
42 return false;
43 }

References player.

◆ cleanup()

void com.runehive.content.activity.impl.JailActivity.cleanup ( )

Cleans up the activity when finished.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 58 of file JailActivity.java.

58 {
59
60 }

◆ create()

JailActivity com.runehive.content.activity.impl.JailActivity.create ( Player player)
static

Definition at line 17 of file JailActivity.java.

17 {
18 JailActivity activity = new JailActivity(player);
19 player.move(Config.JAIL_ZONE);
20 activity.add(player);
21 activity.resetCooldown();
22 player.setVisible(true);
23 return activity;
24 }

References com.runehive.Config.JAIL_ZONE, JailActivity(), and player.

Referenced by com.runehive.game.world.entity.mob.player.requests.PlayerPunishment.jail(), and com.runehive.game.world.entity.mob.player.PlayerAssistant.setActivity().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ finish()

void com.runehive.content.activity.impl.JailActivity.finish ( )

Finishes the activity.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 51 of file JailActivity.java.

51 {
52 remove(player);
53 player.move(Config.DEFAULT_POSITION);
54 player.message("Time's up! You are free to go.");
55 }

References com.runehive.Config.DEFAULT_POSITION, and player.

Referenced by start().

Here is the caller graph for this function:

◆ getType()

ActivityType com.runehive.content.activity.impl.JailActivity.getType ( )

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 63 of file JailActivity.java.

63 {
64 return ActivityType.JAIL;
65 }

References com.runehive.content.activity.ActivityType.JAIL.

◆ onDeath()

void com.runehive.content.activity.impl.JailActivity.onDeath ( Mob mob)

Called when the player die.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 34 of file JailActivity.java.

34 {
35 player.move(Config.JAIL_ZONE);
36 player.message("BAM! YOU'RE BACK!");
37 }

References com.runehive.Config.JAIL_ZONE, and player.

◆ onRegionChange()

void com.runehive.content.activity.impl.JailActivity.onRegionChange ( Player player)

Called when the player changes region.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 46 of file JailActivity.java.

46 {
47 player.move(Config.JAIL_ZONE);
48 }

References com.runehive.Config.JAIL_ZONE, and player.

◆ start()

void com.runehive.content.activity.impl.JailActivity.start ( )
protected

Starts the next activity stage.

Reimplemented from com.runehive.content.activity.Activity.

Definition at line 27 of file JailActivity.java.

27 {
28 if (!player.punishment.isJailed()) {
29 finish();
30 }
31 }

References finish(), and player.

Here is the call graph for this function:

Member Data Documentation

◆ player

final Player com.runehive.content.activity.impl.JailActivity.player
private

Definition at line 10 of file JailActivity.java.

Referenced by canTeleport(), create(), finish(), JailActivity(), onDeath(), onRegionChange(), and start().


The documentation for this class was generated from the following file: