read ability

This commit is contained in:
Tooze 2026-03-18 14:44:50 -04:00
parent e2c117f5be
commit 7f4c9e6462
2 changed files with 9 additions and 4 deletions

View file

@ -40,9 +40,12 @@ class PenanceFighterNPC : NPCBehavior(*PENANCE_FIGHTER_IDS.toIntArray()) {
override fun getXpMultiplier(self: NPC, attacker: Entity): Double {
return 0.0
}
override fun beforeDamageReceived( self: NPC, attacker: Entity, state: BattleState) {
attacker as Player
if(!attacker.isArtificial) {state.estimatedHit = BarbAssaultCombat.applyAttackValidation( self, attacker, state )}
override fun beforeDamageReceived(self: NPC, attacker: Entity, state: BattleState) {
val player = attacker as? Player ?: return
if (!player.isArtificial) {
state.estimatedHit = BarbAssaultCombat.applyAttackValidation(self, player, state)
}
}
override fun onCreation (self: NPC) {

View file

@ -38,7 +38,9 @@ class PenanceRangerNPC : NPCBehavior(*PENANCE_RANGER_IDS.toIntArray()) {
}
override fun beforeDamageReceived( self: NPC, attacker: Entity, state: BattleState) {
attacker as Player
if(!attacker.isArtificial) {state.estimatedHit = BarbAssaultCombat.applyAttackValidation( self, attacker, state )}
if(!attacker.isArtificial) {
state.estimatedHit = BarbAssaultCombat.applyAttackValidation( self, attacker, state )
}
}
override fun getXpMultiplier(self: NPC, attacker: Entity): Double {