Browse Source

mobs to load equipment resists

feature-workorder
FatBoy-DOTC 1 year ago
parent
commit
0ab5827ee5
  1. 15
      src/engine/objects/Mob.java

15
src/engine/objects/Mob.java

@ -1664,7 +1664,8 @@ public class Mob extends AbstractIntelligenceAgent { @@ -1664,7 +1664,8 @@ public class Mob extends AbstractIntelligenceAgent {
this.enemy.addAll(this.getMobBase().enemy);
}
this.applyMobbaseEffects();
recalculateStats();
this.applyEquipmentResists();
this.recalculateStats();
this.setHealth(this.healthMax);
// Set bounds for this mobile
@ -1682,6 +1683,18 @@ public class Mob extends AbstractIntelligenceAgent { @@ -1682,6 +1683,18 @@ public class Mob extends AbstractIntelligenceAgent {
}
public void applyEquipmentResists(){
if(this.equip != null){
for(MobEquipment equipped : this.equip.values()){
ItemBase itemBase = equipped.getItemBase();
if(itemBase.isHeavyArmor() || itemBase.isLightArmor() || itemBase.isMediumArmor()){
this.resists.setResist(DamageType.Crush, this.resists.getResist(DamageType.Crush,0) + itemBase.getCrushResist());
this.resists.setResist(DamageType.Slash, this.resists.getResist(DamageType.Slash,0) + itemBase.getCrushResist());
this.resists.setResist(DamageType.Pierce, this.resists.getResist(DamageType.Pierce,0) + itemBase.getCrushResist());
}
}
}
}
@Override
protected ConcurrentHashMap<Integer, CharacterPower> initializePowers() {
return new ConcurrentHashMap<>(MBServerStatics.CHM_INIT_CAP, MBServerStatics.CHM_LOAD, MBServerStatics.CHM_THREAD_LOW);

Loading…
Cancel
Save