Slower melee weapons now do a minimum damage on successful hits to compensate for the lower dps.

The minimum damage is 10% of the max hit for each tick below scimitar speeds (rounded down). This leads to a maximum dps increase of 10% for 5 tick weapons, 22% for 6 tick, and 40% for 7 tick. Usually less though, due to the rounding.
Also added the formula to the ::calcmaxhit command so players can see the minimum hit in game.
This commit is contained in:
randy 2025-08-18 08:29:34 -06:00
parent 2ecdde1011
commit e046f46ed2
2 changed files with 18 additions and 1 deletions

View file

@ -73,7 +73,14 @@ open class MeleeSwingHandler (vararg flags: SwingHandlerFlag)
if (entity is NPC && state.armourEffect == ArmourSet.VERAC && victim.hasProtectionPrayer(CombatStyle.MELEE)) max = max * 2 / 3
}
state.maximumHit = max
hit = RandomFunction.random(max + 1)
// Snowscape: Give slower weapons a minimum damage on hit to compensate for their lower DPS
// While the exact math varies due to enemy defence, this brings the average time to kill for slow weapons closer to the scimitar
// This formula is copied to MiscCommandSet.kt for the ::calcmaxhit command.
var speedMod = (entity.getProperties().getAttackSpeed() - 4)
var min = floor(speedMod * 0.1 * max).toInt()
hit = RandomFunction.random(min, max + 1)
}
state.estimatedHit = hit
if(victim != null) {

View file

@ -35,6 +35,9 @@ import java.awt.HeadlessException
import java.awt.Toolkit
import java.awt.datatransfer.StringSelection
import core.game.node.entity.combat.CombatStyle
import kotlin.math.floor
@Initializable
class MiscCommandSet : CommandSet(Privilege.ADMIN){
override fun defineCommands() {
@ -126,6 +129,13 @@ class MiscCommandSet : CommandSet(Privilege.ADMIN){
val swingHandler = player.getSwingHandler(false)
val hit = swingHandler.calculateHit(player, player, 1.0)
notify(player, "max hit: ${hit} (${(swingHandler as Object).getClass().getName()})")
// Snowescape: calculate the min damage on hit for melee attacks (see MeleeSwingHandler.swing() for the custom minimum damage).
if (swingHandler.type == CombatStyle.MELEE) {
val speedMod = (player.getProperties().getAttackSpeed() - 4)
val min = floor(speedMod * 0.1 * hit).toInt()
notify(player, "min hit: ${min} (on successful hits)")
}
}
/**