RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
FiftyFive.java
1package com.osroyale.content.gambling.impl;
2
3import com.osroyale.content.gambling.Gamble;
4import com.osroyale.game.task.Task;
5import com.osroyale.game.world.World;
6import com.osroyale.game.world.entity.mob.player.Player;
7import com.osroyale.util.Utility;
8
30
31public class FiftyFive extends Gamble {
32
33 public FiftyFive(Player host, Player opponent) {
34 super(host, opponent);
35 }
36
37 @Override
38 public String toString() {
39 return "55x2";
40 }
41
42 @Override
43 public void gamble() {
44 World.schedule(new Task(1) {
45 int time = 0;
46 public int randomRoll = 1 + Utility.random(99);
47 int hostScore, opponentScore;
48
49 @Override
50 protected void execute() {
51 switch (time) {
52 case 2:
53 getHost().speak("I rolled " + randomRoll + " on the dice.");
54 getOpponent().speak("The host rolled " + randomRoll + " on the dice.");
55 break;
56 case 4:
57 if (randomRoll > 55) {
58 hostScore = 0;
59 opponentScore = 1;
60 } else if (randomRoll < 55) {
61 hostScore = 1;
62 opponentScore = 0;
63 } else {
64 hostScore = 0;
65 opponentScore = 0;
66 }
67 getHost().getGambling().finish(getHost(), getOpponent(), hostScore, opponentScore);
68 cancel();
69 break;
70 }
71 time++;
72 }
73 });
74 }
75
76}
static void schedule(Task task)
Definition World.java:284