Fixed revenant level check
Fixed ice smash
This commit is contained in:
@@ -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"
|
* @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.
|
* @return whether the attacker should be able to attack this NPC.
|
||||||
*/
|
*/
|
||||||
open fun canBeAttackedBy(self: NPC, attacker: Entity, style: CombatStyle, shouldSendMessage: Boolean) : Boolean {
|
open fun canBeAttackedBy(self: NPC, attacker: Entity, style: CombatStyle, shouldSendMessage: Boolean): Boolean {
|
||||||
if (attacker is Player && !self.definition.hasAction("attack"))
|
return !(attacker is Player && !self.definition.hasAction("attack") && !self.definition.hasAction("smash-ice"))
|
||||||
return false
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -770,11 +770,15 @@ public class Player extends Entity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean continueAttack(Entity target, CombatStyle style, boolean message) {
|
public boolean continueAttack(Entity target, CombatStyle style, boolean message) {
|
||||||
if (target instanceof NPC
|
if (target instanceof NPC) {
|
||||||
&& !((NPC) target).getDefinition().hasAction("attack")
|
NPC npc = (NPC) target;
|
||||||
&& !((NPC) target).isIgnoreAttackRestrictions(this)) {
|
NPC shown = npc.getShownNPC(this);
|
||||||
|
boolean canAttack = shown.getDefinition().hasAction("attack")
|
||||||
|
|| shown.getDefinition().hasAction("smash-ice");
|
||||||
|
if (!canAttack && !npc.isIgnoreAttackRestrictions(this)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (target instanceof Player) {
|
if (target instanceof Player) {
|
||||||
Player p = (Player) target;
|
Player p = (Player) target;
|
||||||
if (p.getSkullManager().isWilderness() && skullManager.isWilderness()) {
|
if (p.getSkullManager().isWilderness() && skullManager.isWilderness()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user