Implemented all Fist of Guthix glove effects

Fixed inaccurate salve amulets boost, bonus for enchanted version now implemented
Fixed inaccurate black/slayer mask + slayer cape interaction, now always gives the highest bonus when wearing mask + cape
This commit is contained in:
RiL
2023-04-17 00:59:54 +00:00
committed by Ryan
parent 2025949265
commit 957540c362
12 changed files with 249 additions and 122 deletions
@@ -10,6 +10,8 @@ import content.data.tables.HerbDropTable
import content.data.tables.GemDropTable
import content.data.tables.RareSeedDropTable
import content.data.tables.AllotmentSeedDropTable
import content.global.handlers.item.equipment.fistofguthixgloves.FOGGlovesManager
import core.api.inEquipment
import core.game.node.entity.Entity
import core.game.node.entity.player.Player
import core.game.node.item.Item
@@ -60,7 +62,26 @@ open class WeightBasedTable : ArrayList<WeightedItem>() {
SLOT_RDT -> RareDropTable.retrieve(receiver)
SLOT_CELEDT -> CELEMinorTable.retrieve()
SLOT_USDT -> UncommonSeedDropTable.retrieve()
SLOT_HDT -> HerbDropTable.retrieve()
SLOT_HDT -> {
if (RandomFunction.nextBool() && receiver is Player) {
if (inEquipment(receiver, Items.IRIT_GLOVES_12856)) {
FOGGlovesManager.updateCharges(receiver)
Item(Items.GRIMY_IRIT_209)
} else if (inEquipment(receiver, Items.AVANTOE_GLOVES_12857)) {
FOGGlovesManager.updateCharges(receiver)
Item(Items.GRIMY_AVANTOE_211)
} else if (inEquipment(receiver, Items.KWUARM_GLOVES_12858)) {
FOGGlovesManager.updateCharges(receiver)
Item(Items.GRIMY_KWUARM_213)
} else if (inEquipment(receiver, Items.CADANTINE_GLOVES_12859)) {
FOGGlovesManager.updateCharges(receiver)
Item(Items.GRIMY_CADANTINE_215)
} else
HerbDropTable.retrieve()
} else {
HerbDropTable.retrieve()
}
}
SLOT_GDT -> GemDropTable.retrieve()
SLOT_RSDT -> RareSeedDropTable.retrieve()
SLOT_ASDT -> AllotmentSeedDropTable.retrieve()
@@ -16,6 +16,7 @@ import core.game.node.entity.skill.Skills
import core.game.node.entity.state.EntityState
import core.game.world.map.path.Pathfinder
import core.tools.RandomFunction
import org.rs09.consts.Items
import kotlin.math.ceil
import kotlin.math.floor
@@ -140,17 +141,18 @@ open class MeleeSwingHandler
effectiveAttackLevel = floor(effectiveAttackLevel)
effectiveAttackLevel *= (entity.properties.bonuses[entity.properties.attackStyle.bonusType] + 64)
val amuletName = (if(entity is Player) getItemFromEquipment(entity, EquipmentSlot.AMULET)?.name ?: "null" else "null").toLowerCase()
val victimName = entity.properties.combatPulse.getVictim()?.name ?: "none"
if(entity is Player && getSlayerTask(entity)?.ids?.contains((entity.properties.combatPulse?.getVictim()?.id ?: 0)) == true)
effectiveAttackLevel *= SlayerEquipmentFlags.getDamAccBonus(entity) //Slayer Helm/ Black Mask/ Slayer cape
else if (entity is Player //Salve amulet
&& (amuletName.contains("salve"))
&& checkUndead(victimName)
) {
effectiveAttackLevel *= 1.2
// attack bonus for specialized equipments (salve amulets, slayer equips)
if (entity is Player) {
val amuletId = getItemFromEquipment(entity, EquipmentSlot.AMULET)?.id ?: 0
if ((amuletId == Items.SALVE_AMULET_4081 || amuletId == Items.SALVE_AMULETE_10588) && checkUndead(victimName)) {
effectiveAttackLevel *= if (amuletId == Items.SALVE_AMULET_4081) 1.15 else 1.2
} else if (getSlayerTask(entity)?.ids?.contains((entity.properties.combatPulse?.getVictim()?.id ?: 0)) == true) {
effectiveAttackLevel *= SlayerEquipmentFlags.getDamAccBonus(entity) //Slayer Helm/ Black Mask/ Slayer cape
if (getSlayerTask(entity)?.dragon == true && inEquipment(entity, Items.DRAGON_SLAYER_GLOVES_12862))
effectiveAttackLevel *= 1.1
}
}
return floor(effectiveAttackLevel).toInt()