Implemented Rick Turpentine and Drunken Dwarf random events

This commit is contained in:
Zerken
2023-10-12 23:34:25 +00:00
committed by Ryan
parent b308e488f9
commit 4e1ddaeec5
9 changed files with 164 additions and 4 deletions
@@ -1,5 +1,6 @@
package core.game.node.entity.combat
import content.global.ame.RandomEventNPC
import content.global.handlers.item.equipment.special.SalamanderSwingHandler
import core.game.container.impl.EquipmentContainer
import core.game.interaction.MovementPulse
@@ -132,7 +133,7 @@ class CombatPulse(
if (handler == null) {
handler = entity.getSwingHandler(true)
}
if (!v.isAttackable(entity, handler!!.type, true)) {
if (!v.isAttackable(entity, handler!!.type, true) && entity != getAttribute<RandomEventNPC?>(v, AntiMacro.EVENT_NPC, null)) {
return true
}
if (!swing(entity, victim, handler)) {
@@ -440,6 +441,8 @@ class CombatPulse(
if (DeathTask.isDead(victim) || DeathTask.isDead(entity)) {
return true
}
if (entity is NPC)
entity.asNpc().behavior.beforeAttackFinalized(entity, victim, state)
if (impact || getDelay() == 0) {
if (state.estimatedHit != 0 && victim is NPC && entity is Player) {
val n = victim.asNpc()