mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2026-08-01 14:39:13 -06:00
Fixed revenant level check
Fixed ice smash
This commit is contained in:
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue