Bugfixes for combat and farming:

- Uncomposted patches no longer get lives incremented as if composted.
- Pitfall NPCs use the proper machinery for being not-attackable (so aviansies are no longer meleeable).
This commit is contained in:
Avi Weinstock 2021-09-23 12:42:14 -04:00
parent 02df79a4d3
commit 2d61f5a411
3 changed files with 11 additions and 3 deletions

View file

@ -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)) {

View file

@ -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

View file

@ -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
}
}