RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
JailActivity.java
1package com.osroyale.content.activity.impl;
2
3import com.osroyale.Config;
4import com.osroyale.content.activity.Activity;
5import com.osroyale.content.activity.ActivityType;
6import com.osroyale.game.world.entity.mob.Mob;
7import com.osroyale.game.world.entity.mob.player.Player;
8
37
38public class JailActivity extends Activity {
39 private final Player player;
40
41 private JailActivity(Player player) {
42 super(30, Mob.DEFAULT_INSTANCE);
43 this.player = player;
44 }
45
46 public static JailActivity create(Player player) {
47 JailActivity activity = new JailActivity(player);
48 player.move(Config.JAIL_ZONE);
49 activity.add(player);
50 activity.resetCooldown();
51 player.setVisible(true);
52 return activity;
53 }
54
55 @Override
56 protected void start() {
57 if (!player.punishment.isJailed()) {
58 finish();
59 }
60 }
61
62 @Override
63 public void onDeath(Mob mob) {
64 player.move(Config.JAIL_ZONE);
65 player.message("BAM! YOU'RE BACK!");
66 }
67
68 @Override
69 public boolean canTeleport(Player player) {
70 player.message("You are jailed you douche!");
71 return false;
72 }
73
74 @Override
75 public void onRegionChange(Player player) {
76 player.move(Config.JAIL_ZONE);
77 }
78
79 @Override
80 public void finish() {
81 remove(player);
82 player.move(Config.DEFAULT_POSITION);
83 player.message("Time's up! You are free to go.");
84 }
85
86 @Override
87 public void cleanup() {
88
89 }
90
91 @Override
92 public ActivityType getType() {
93 return ActivityType.JAIL;
94 }
95}
static final Position JAIL_ZONE
Definition Config.java:245
static final Position DEFAULT_POSITION
Definition Config.java:235
Activity(int cooldown, int instance)
Definition Activity.java:92