Fixed revenant level check

Fixed ice smash
This commit is contained in:
dam
2026-04-04 16:03:36 +03:00
committed by Ryan
parent d1af9c212e
commit 082017b260
2 changed files with 10 additions and 8 deletions
@@ -113,10 +113,8 @@ open class NPCBehavior(vararg val ids: Int = intArrayOf()) : ContentInterface {
* @param shouldSendMessage whether the core combat code believes you should send a message e.g. "You can't attack this NPC with that weapon"
* @return whether the attacker should be able to attack this NPC.
*/
open fun canBeAttackedBy(self: NPC, attacker: Entity, style: CombatStyle, shouldSendMessage: Boolean) : Boolean {
if (attacker is Player && !self.definition.hasAction("attack"))
return false
return true
open fun canBeAttackedBy(self: NPC, attacker: Entity, style: CombatStyle, shouldSendMessage: Boolean): Boolean {
return !(attacker is Player && !self.definition.hasAction("attack") && !self.definition.hasAction("smash-ice"))
}
/**
@@ -770,10 +770,14 @@ public class Player extends Entity {
@Override
public boolean continueAttack(Entity target, CombatStyle style, boolean message) {
if (target instanceof NPC
&& !((NPC) target).getDefinition().hasAction("attack")
&& !((NPC) target).isIgnoreAttackRestrictions(this)) {
return false;
if (target instanceof NPC) {
NPC npc = (NPC) target;
NPC shown = npc.getShownNPC(this);
boolean canAttack = shown.getDefinition().hasAction("attack")
|| shown.getDefinition().hasAction("smash-ice");
if (!canAttack && !npc.isIgnoreAttackRestrictions(this)) {
return false;
}
}
if (target instanceof Player) {
Player p = (Player) target;