RuneHive-Game
Loading...
Searching...
No Matches
PuzzleType.java
Go to the documentation of this file.
1package com.runehive.content.puzzle;
2
3import com.runehive.content.bloodmoney.BloodMoneyChest;
4import com.runehive.game.world.entity.combat.hit.Hit;
5import com.runehive.game.world.entity.mob.player.Player;
6import com.runehive.util.Utility;
7
8/**
9 * The difference puzzle types.
10 *
11 * @author Daniel
12 */
13public enum PuzzleType implements PuzzleInterface<Player> {
15 @Override
16 public void onSuccess(Player player) {
17 int count = player.puzzle.successCount;
18
19 if (count >= 5) {
20 player.puzzle.successCount = 0;
22 return;
23 }
24
25 player.puzzle.open(BLOOD_MONEY);
26 player.message("Good job, " + (5 - count) + " puzzles remaining!");
27 }
28
29 @Override
30 public void onFailure(Player player) {
31 player.speak("Ouch!");
32 player.message("You failed to unlock the blood money chest!");
33 player.writeDamage(new Hit(Utility.random(5, 10)));
34 player.interfaceManager.close();
35 }
36 }
37}
static void finish(boolean unlocked)
Handles finishing the blood money chet.
void open(PuzzleType puzzleType)
Opens the puzzle interface.
A Hit object holds the damage amount and hitsplat data.
Definition Hit.java:10
void speak(String forceChat)
Sets the mob's forced chat.
Definition Mob.java:127
This class represents a character controlled by a player.
Definition Player.java:125
Handles miscellaneous methods.
Definition Utility.java:27
static int random(int bound)
Definition Utility.java:239
The difference puzzle types.