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

Public Member Functions

 FiftyFive (Player host, Player opponent)
void gamble ()
String toString ()
Public Member Functions inherited from com.runehive.content.gambling.Gamble
 Gamble (Player host, Player opponent)
Player getHost ()
Player getOpponent ()

Additional Inherited Members

Public Attributes inherited from com.runehive.content.gambling.Gamble
int hostScore
 Score betwen the players inside the 'gamble'.
int opponentScore

Detailed Description

Definition at line 9 of file FiftyFive.java.

Constructor & Destructor Documentation

◆ FiftyFive()

com.runehive.content.gambling.impl.FiftyFive.FiftyFive ( Player host,
Player opponent )

Definition at line 11 of file FiftyFive.java.

11 {
12 super(host, opponent);
13 }

References com.runehive.content.gambling.Gamble.host, and com.runehive.content.gambling.Gamble.opponent.

Member Function Documentation

◆ gamble()

void com.runehive.content.gambling.impl.FiftyFive.gamble ( )

Reimplemented from com.runehive.content.gambling.Gamble.

Definition at line 21 of file FiftyFive.java.

21 {
22 World.schedule(new Task(1) {
23 int time = 0;
24 public int randomRoll = 1 + Utility.random(99);
25 int hostScore, opponentScore;
26
27 @Override
28 protected void execute() {
29 switch (time) {
30 case 2:
31 getHost().speak("I rolled " + randomRoll + " on the dice.");
32 getOpponent().speak("The host rolled " + randomRoll + " on the dice.");
33 break;
34 case 4:
35 if (randomRoll > 55) {
36 hostScore = 0;
37 opponentScore = 1;
38 } else if (randomRoll < 55) {
39 hostScore = 1;
40 opponentScore = 0;
41 } else {
42 hostScore = 0;
43 opponentScore = 0;
44 }
45 getHost().getGambling().finish(getHost(), getOpponent(), hostScore, opponentScore);
46 cancel();
47 break;
48 }
49 time++;
50 }
51 });
52 }

References com.runehive.content.gambling.GambleManager.finish(), com.runehive.game.world.entity.mob.player.Player.getGambling(), com.runehive.content.gambling.Gamble.getHost(), com.runehive.content.gambling.Gamble.getOpponent(), com.runehive.content.gambling.Gamble.hostScore, com.runehive.content.gambling.Gamble.opponentScore, com.runehive.util.Utility.random(), com.runehive.game.world.World.schedule(), and com.runehive.game.world.entity.mob.Mob.speak().

Here is the call graph for this function:

◆ toString()

String com.runehive.content.gambling.impl.FiftyFive.toString ( )

Definition at line 16 of file FiftyFive.java.

16 {
17 return "55x2";
18 }

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