mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-20 13:30:27 -07:00
Improve NPC usage of protection prayers.
- `NPC.hasProtectionPrayer` now accurately reflects protection prayers defined in `npc_configs.json`. - NPC protection prayers now block 100% of the damage when attacked by a player in `Entity.getFormattedHit` instead of only blocking 40%.
This commit is contained in:
parent
9882443afc
commit
1b4b1463c0
2 changed files with 3 additions and 3 deletions
|
|
@ -515,7 +515,7 @@ public abstract class Entity extends Node {
|
||||||
Entity victim = state.getVictim();
|
Entity victim = state.getVictim();
|
||||||
CombatStyle type = state.getStyle();
|
CombatStyle type = state.getStyle();
|
||||||
if (state.getArmourEffect() != ArmourSet.VERAC && !entity.isIgnoreProtection(type) && victim.hasProtectionPrayer(type)) {
|
if (state.getArmourEffect() != ArmourSet.VERAC && !entity.isIgnoreProtection(type) && victim.hasProtectionPrayer(type)) {
|
||||||
return hit *= entity instanceof Player ? 0.6 : 0;
|
return hit *= (entity instanceof Player && victim instanceof Player) ? 0.6 : 0;
|
||||||
}
|
}
|
||||||
return hit;
|
return hit;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -653,7 +653,7 @@ public class NPC extends Entity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasProtectionPrayer(CombatStyle style) {
|
public boolean hasProtectionPrayer(CombatStyle style) {
|
||||||
return false;
|
return getProperties().getProtectStyle() == style;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -995,4 +995,4 @@ public class NPC extends Entity {
|
||||||
this.neverWalks = neverWalks;
|
this.neverWalks = neverWalks;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue