RuneHive-Game
Loading...
Searching...
No Matches
com.runehive.content.dailyeffect.DailyEffect Class Referenceabstract
Inheritance diagram for com.runehive.content.dailyeffect.DailyEffect:

Public Member Functions

boolean canUse (Player player)
abstract int maxUses (Player player)
int remainingUses (Player player)
void use ()

Private Attributes

int dayUsed
int uses

Detailed Description

Definition at line 6 of file DailyEffect.java.

Member Function Documentation

◆ canUse()

boolean com.runehive.content.dailyeffect.DailyEffect.canUse ( Player player)

Definition at line 18 of file DailyEffect.java.

18 {
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 }

References dayUsed, com.runehive.game.world.entity.mob.player.Player.dialogueFactory, com.runehive.content.dialogue.DialogueFactory.execute(), com.runehive.util.Utility.getCurrentDay(), maxUses(), com.runehive.content.dialogue.DialogueFactory.sendStatement(), and uses.

Here is the call graph for this function:

◆ maxUses()

abstract int com.runehive.content.dailyeffect.DailyEffect.maxUses ( Player player)
abstract

Reimplemented in com.runehive.content.dailyeffect.impl.DailySlayerTaskSkip, com.runehive.content.dailyeffect.impl.DailySlayerTaskTeleport, and com.runehive.content.dailyeffect.impl.DailySpellBookSwap.

Referenced by canUse(), and remainingUses().

Here is the caller graph for this function:

◆ remainingUses()

int com.runehive.content.dailyeffect.DailyEffect.remainingUses ( Player player)

Definition at line 30 of file DailyEffect.java.

30 {
31 return (maxUses(player) - uses);
32 }

References maxUses(), and uses.

Here is the call graph for this function:

◆ use()

void com.runehive.content.dailyeffect.DailyEffect.use ( )

Definition at line 11 of file DailyEffect.java.

11 {
12 if (uses == 0) {
13 dayUsed = Utility.getCurrentDay();
14 }
15 uses++;
16 }

References dayUsed, com.runehive.util.Utility.getCurrentDay(), and uses.

Here is the call graph for this function:

Member Data Documentation

◆ dayUsed

int com.runehive.content.dailyeffect.DailyEffect.dayUsed
private

Definition at line 9 of file DailyEffect.java.

Referenced by canUse(), and use().

◆ uses

int com.runehive.content.dailyeffect.DailyEffect.uses
private

Definition at line 8 of file DailyEffect.java.

Referenced by canUse(), remainingUses(), and use().


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