RuneHive-Game
Loading...
Searching...
No Matches
DailyEffect.java
Go to the documentation of this file.
1package com.runehive.content.dailyeffect;
2
3import com.runehive.game.world.entity.mob.player.Player;
4import com.runehive.util.Utility;
5
6public abstract class DailyEffect {
7
8 private int uses;
9 private int dayUsed;
10
11 public void use() {
12 if (uses == 0) {
14 }
15 uses++;
16 }
17
18 public boolean canUse(Player player) {
19 if (dayUsed == Utility.getCurrentDay()) {
20 if (uses >= maxUses(player)) {
21 player.dialogueFactory.sendStatement("You must wait until tomorrow before you can use this option again.").execute();
22 return false;
23 }
24 } else {
25 uses = 0;
26 }
27 return true;
28 }
29
30 public int remainingUses(Player player) {
31 return (maxUses(player) - uses);
32 }
33
34 public abstract int maxUses(Player player);
35}
abstract int maxUses(Player player)
final DialogueFactory execute()
Retrieves the next dialogue in the chain and executes it.
final DialogueFactory sendStatement(String... lines)
Appends a StatementDialogue to the current dialogue chain.
This class represents a character controlled by a player.
Definition Player.java:125
Handles miscellaneous methods.
Definition Utility.java:27
static int getCurrentDay()
Definition Utility.java:891