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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user