mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 08:39:17 +00:00
Fix nitpicks in Woodcutting plugin
This commit is contained in:
@@ -1,23 +1,28 @@
|
||||
package org.apollo.game.plugin.skills.woodcutting
|
||||
|
||||
import org.apollo.game.model.Animation;
|
||||
import org.apollo.game.model.Animation
|
||||
import org.apollo.game.model.entity.Player
|
||||
import org.apollo.game.plugin.api.woodcutting
|
||||
|
||||
//Animation IDs thanks to Deadly A G S at rune-server.ee
|
||||
enum class Axe(val id: Int, val level: Int, val animation: Animation, val pulses: Int) {
|
||||
RUNE(1359, 41, Animation(867), 3),
|
||||
ADAMANT(1357, 31, Animation(869), 4),
|
||||
MITHRIL(1355, 21, Animation(871), 5),
|
||||
BLACK(1361, 11, Animation(873), 6),
|
||||
STEEL(1353, 6, Animation(875), 6),
|
||||
IRON(1349, 1, Animation(877), 7),
|
||||
BRONZE(1351, 1, Animation(879), 8);
|
||||
enum class Axe(val id: Int, val level: Int, animation: Int, val pulses: Int) {
|
||||
BRONZE(id = 1351, level = 1, animation = 879, pulses = 8),
|
||||
IRON(id = 1349, level = 1, animation = 877, pulses = 7),
|
||||
STEEL(id = 1353, level = 6, animation = 875, pulses = 6),
|
||||
BLACK(id = 1361, level = 11, animation = 873, pulses = 6),
|
||||
MITHRIL(id = 1355, level = 21, animation = 871, pulses = 5),
|
||||
ADAMANT(id = 1357, level = 31, animation = 869, pulses = 4),
|
||||
RUNE(id = 1359, level = 41, animation = 867, pulses = 3);
|
||||
|
||||
val animation = Animation(animation)
|
||||
|
||||
companion object {
|
||||
private val AXES = Axe.values()
|
||||
fun getAxes(): Array<Axe> {
|
||||
return AXES
|
||||
private val AXES = Axe.values().sortedByDescending { it.level }
|
||||
|
||||
fun bestFor(player: Player): Axe? {
|
||||
return AXES.asSequence()
|
||||
.filter { it.level <= player.woodcutting.current }
|
||||
.filter { player.equipment.contains(it.id) || player.inventory.contains(it.id) }
|
||||
.firstOrNull()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user