Merge branch 'combat-farming-bugfixes' into 'master'

Bugfixes for combat and farming:

See merge request 2009scape/2009scape!269
This commit is contained in:
Ceikry
2021-09-23 17:02:25 +00:00
3 changed files with 11 additions and 3 deletions
@@ -129,7 +129,7 @@ class CombatPulse(
if (handler == null) {
handler = entity.getSwingHandler(true)
}
if (!entity.isAttackable(v, handler!!.type)) {
if (!v.isAttackable(entity, handler!!.type)) {
return true
}
if (!swing(entity, victim, handler)) {
@@ -17,7 +17,11 @@ class Patch(val player: Player, val patch: FarmingPatch, var plantable: Plantabl
var cropLives = 3
fun setNewHarvestAmount() {
val compostMod = if(compost == CompostType.SUPER) 2 else 1
val compostMod = when(compost) {
CompostType.NONE -> 0
CompostType.NORMAL -> 1
CompostType.SUPER -> 2
}
harvestAmt = when (plantable) {
Plantable.LIMPWURT_SEED, Plantable.WOAD_SEED -> 3
Plantable.MUSHROOM_SPORE -> 6
@@ -319,6 +319,10 @@ class PitfallNPC : AbstractNPC {
}
override fun isAttackable(entity: Entity, style: CombatStyle): Boolean {
return entity is Player
return false
}
override fun isIgnoreAttackRestrictions(victim: Entity): Boolean {
return victim is Player
}
}