RuneHive-Tarnish
Neural OSRS Enhancement Framework
Loading...
Searching...
No Matches
DailyEffect.java
1package com.osroyale.content.dailyeffect;
2
3import com.osroyale.game.world.entity.mob.player.Player;
4import com.osroyale.util.Utility;
5
29
30public abstract class DailyEffect {
31
32 private int uses;
33 private int dayUsed;
34
35 public void use() {
36 if (uses == 0) {
37 dayUsed = Utility.getCurrentDay();
38 }
39 uses++;
40 }
41
42 public boolean canUse(Player player) {
43 if (dayUsed == Utility.getCurrentDay()) {
44 if (uses >= maxUses(player)) {
45 player.dialogueFactory.sendStatement("You must wait until tomorrow before you can use this option again.").execute();
46 return false;
47 }
48 } else {
49 uses = 0;
50 }
51 return true;
52 }
53
54 public int remainingUses(Player player) {
55 return (maxUses(player) - uses);
56 }
57
58 public abstract int maxUses(Player player);
59}
final DialogueFactory sendStatement(String... lines)