54 public static final int GNOME_FLAGS = 0b0111_1111;
55 public static final int BARBARIAN_FLAGS = 0b0111_1111;
56 public static final int WILDERNESS_FLAGS = 0b0001_1111;
57 public static final int SEERS_FLAGS = 0b0011_1111;
58 public static final int ARDOUGNE_FLAGS = 0b0111_1111;
59 public static final HashMap<Position, Obstacle> obstacles =
new HashMap<>();
61 public static void declare() {
63 Obstacle[] loaded =
new Gson().fromJson(
new BufferedReader(
new FileReader(
"./data/content/skills/agility.json")),
Obstacle[].
class);
65 if (obstacle.getObjectPosition() ==
null) {
66 obstacle.setObjectPosition(obstacle.getStart());
68 if (obstacle.getType() ==
null) {
69 System.out.println(obstacle +
" No object type found. FIX MUST FIX");
71 obstacles.put(obstacle.getObjectPosition(), obstacle);
73 }
catch (JsonSyntaxException | JsonIOException | FileNotFoundException e) {
80 public static boolean clickButton(
Player player,
int button) {
82 Consumer<Player> onClick =
null;
87 onClick = p -> p.skills.addExperience(
Skill.
AGILITY, TICKET_EXPERIENCE * 1);
91 onClick = p -> p.skills.addExperience(
Skill.
AGILITY, TICKET_EXPERIENCE * 10);
95 onClick = p -> p.skills.addExperience(
Skill.
AGILITY, TICKET_EXPERIENCE * 25);
99 onClick = p -> p.skills.addExperience(
Skill.
AGILITY, TICKET_EXPERIENCE * 100);
103 onClick = p -> p.skills.addExperience(
Skill.
AGILITY, TICKET_EXPERIENCE * 1000);
107 onClick = p -> p.inventory.addOrDrop(
new Item(3049, 1));
111 onClick = p -> p.inventory.addOrDrop(
new Item(3051, 1));
115 onClick = p -> p.inventory.addOrDrop(
new Item(2997, 1));
119 if (player.inventory.
contains(2996, amount)) {
120 player.inventory.
remove(2996, amount);
121 onClick.accept(player);
122 player.interfaceManager.close();
125 player.message(
"You do not have enough agility tickets to purchase that.");
132 public static void main(String[] args) {
142 try (FileWriter writer =
new FileWriter(
new File(
"./data/def/skills/agility1.json"))) {
143 Gson builder =
new GsonBuilder().setPrettyPrinting().create();
145 writer.write(builder.toJson(obstacles.values()).replaceAll(
"\\{\n \"x\"",
"\\{ \"x\"").replaceAll(
",\n \"y\"",
", \"y\"").replaceAll(
",\n \"z\"",
", \"z\"").replaceAll(
"\n \\},",
" \\},"));
146 }
catch (Exception e) {