Rewrote PrayerEffect into kotlin

Corrected calculation used for prayer restoring effects
This commit is contained in:
bushtail
2023-02-22 08:25:16 +00:00
committed by Ryan
parent 50a9580505
commit dcaa980822
3 changed files with 32 additions and 19 deletions
+12
View File
@@ -61,6 +61,7 @@ import core.game.system.config.ServerConfigParser
import core.game.world.GameWorld
import core.game.world.GameWorld.Pulser
import core.game.world.repository.Repository
import kotlin.math.absoluteValue
/**
* Gets a skilling tool which the player has the level to use and is in their inventory.
@@ -2260,4 +2261,15 @@ fun addDialogueAction(player: Player, action: core.game.dialogue.DialogueAction)
player.dialogueInterpreter.addAction(action)
}
/**
* Modifies prayer points by value
* @param player the player to modify prayer points
* @param amount the amount of points to modify by (positive for increment, negative for decrement)
*/
fun modPrayerPoints(player: Player, amount: Double) {
if(amount > 0) player.skills.incrementPrayerPoints(amount)
else if(amount < 0) player.skills.decrementPrayerPoints(amount.absoluteValue)
else return
}
private class ContentAPI