Move the +6 boost of the attack cape perk before all modifiers/bonuses are applied

This commit is contained in:
vk 2021-11-20 20:44:53 +00:00 committed by Ceikry
parent a9a2adb531
commit db528d1211
4 changed files with 22 additions and 6 deletions

View file

@ -54,4 +54,5 @@
- Void set effects now work more uniformly.
- Summoning familiars now grant combat xp when attacking
- Canoe travel interface now animates correctly
- Fix how the attack skill cape perk is calculated. It should now have a much more noticeable effect
- Properly track leaf-bladed sword drops in ::stats command

View file

@ -146,6 +146,9 @@ open class MeleeSwingHandler
if(entity.properties.attackStyle.style == WeaponInterface.STYLE_ACCURATE) effectiveAttackLevel += 3
else if(entity.properties.attackStyle.style == WeaponInterface.STYLE_CONTROLLED) effectiveAttackLevel += 1
effectiveAttackLevel += 8
if(entity is Player && SkillcapePerks.isActive(SkillcapePerks.PRECISION_STRIKES, entity)){ //Attack skillcape perk
effectiveAttackLevel += 6
}
effectiveAttackLevel *= getSetMultiplier(entity, Skills.ATTACK);
effectiveAttackLevel = floor(effectiveAttackLevel)
effectiveAttackLevel *= (entity.properties.bonuses[entity.properties.attackStyle.bonusType] + 64)
@ -153,10 +156,6 @@ open class MeleeSwingHandler
val amuletName = (if(entity is Player) ContentAPI.getItemFromEquipment(entity, EquipmentSlot.AMULET)?.name ?: "null" else "null").toLowerCase()
val victimName = entity.properties.combatPulse.getVictim()?.name ?: "none"
if(entity is Player && SkillcapePerks.isActive(SkillcapePerks.PRECISION_STRIKES, entity)){ //Attack skillcape perk
effectiveAttackLevel += 6
}
if(entity is Player && entity.slayer.task?.ids?.contains((entity.properties.combatPulse?.getVictim()?.id ?: 0)) == true)
effectiveAttackLevel *= SlayerEquipmentFlags.getDamAccBonus(entity) //Slayer Helm/ Black Mask/ Slayer cape

View file

@ -8,11 +8,12 @@ import core.cache.def.impl.SceneryDefinition
import core.cache.def.impl.VarbitDefinition
import core.game.component.Component
import core.game.ge.OfferState
import core.game.node.scenery.Scenery
import core.game.node.entity.npc.NPC
import core.game.node.entity.player.Player
import core.game.node.entity.player.info.Rights
import core.game.node.entity.skill.Skills
import core.game.node.item.Item
import core.game.node.scenery.Scenery
import core.game.system.communication.CommunicationInfo
import core.game.world.map.RegionManager
import core.game.world.map.build.DynamicRegion
@ -34,7 +35,6 @@ import rs09.tools.stringtools.colorize
import java.awt.Toolkit
import java.awt.datatransfer.StringSelection
import java.util.*
import kotlin.collections.ArrayList
@Initializable
class MiscCommandSet : CommandSet(Command.Privilege.ADMIN){
@ -47,6 +47,21 @@ class MiscCommandSet : CommandSet(Command.Privilege.ADMIN){
player.toggleDebug()
}
define("calc_accuracy", Command.Privilege.STANDARD){ player, args ->
val handler = player.getSwingHandler(false)
player.sendMessage("handler type: ${handler.type}")
player.sendMessage("calculateAccuracy: ${handler.calculateAccuracy(player)}")
if (args.size > 1)
{
val npcId: Int = args[1].toInt()
val npc = NPC(npcId)
npc.initConfig()
player.sendMessage("npc: ${npc.name}. npc defence: ${npc.skills.getLevel(Skills.DEFENCE)}")
player.sendMessage("calculateDefence: ${handler.calculateDefence(npc, player)}")
}
}
/**
* Prints player's current location
*/

View file

@ -18,6 +18,7 @@
"allow_token_purchase": true,
"max_adv_bots": "0",
"message_of_the_week_identifier": "0",
"skillcape_perks": false,
"message_of_the_week_text": "Welcome to 2009Scape! <br><col=11ff00>N</col><col=ecff00>o</col><col=ff8300>w</col <col=ff0000>i</col><col=ff00d4>n</col> <col=6100ff>T</col><col=000fff>e</col><col=00f0ff>c</col><col=00ff59>h</col><col=93ff00>n</col><col=ff9e00>i</col><col=ff0000>c</col><col=ff00d1>o</col><col=2700ff>l</col><col=00f7ff>o</col><col=00ff0c>r</col><col=ff0000>!</col>"
},