Browse Source

finished modifications for guards

combat-2
FatBoy-DOTC 1 year ago
parent
commit
4edf740179
  1. 23
      src/engine/gameManager/NPCManager.java
  2. 17
      src/engine/objects/ItemBase.java

23
src/engine/gameManager/NPCManager.java

@ -342,12 +342,28 @@ public enum NPCManager { @@ -342,12 +342,28 @@ public enum NPCManager {
}
}
}
public static void setDefenseForGuard(Mob guard){
public static void setDefenseForGuard(Mob guard){
int dexterity = guard.getStatDexCurrent();
if(dexterity < 1)
dexterity = 1;
int baseDef = guard.mobBase.getDefenseRating();
int armorDefense = 0;
for(MobEquipment equipped : guard.equip.values())
if(equipped.getItemBase().isArmor() || equipped.getItemBase().isShield())
armorDefense += equipped.getItemBase().getDefense();
guard.defenseRating = dexterity + baseDef + armorDefense;
}
public static void setAttackRatingForGuard(Mob guard){
public static void setAttackRatingForGuard(Mob guard) {
int strength = guard.getStatStrCurrent();
int baseAtr = guard.mobBase.getAttackRating();
if (guard.equip.get(1) != null)
guard.atrHandOne = baseAtr + (int) ((strength * 0.5f) + (guard.equip.get(1).getItemBase().getPercentRequired() * 4) + (guard.equip.get(1).getItemBase().getPercentRequired() * 3));
else if (guard.equip.get(2) != null && !guard.equip.get(2).getItemBase().isShield())
guard.atrHandTwo = baseAtr + (int) ((strength * 0.5f) + (guard.equip.get(2).getItemBase().getPercentRequired() * 4) + (guard.equip.get(2).getItemBase().getPercentRequired() * 3));
else
guard.atrHandOne = baseAtr;
}
public static void setMaxHealthForGuard(Mob guard){
@ -376,6 +392,7 @@ public enum NPCManager { @@ -376,6 +392,7 @@ public enum NPCManager {
break;
}
}
public static void applyMobbaseEffects(Mob mob) {
EffectsBase effectsBase;
for (MobBaseEffects mbe : mob.mobBase.effectsList) {

17
src/engine/objects/ItemBase.java

@ -914,4 +914,21 @@ public class ItemBase { @@ -914,4 +914,21 @@ public class ItemBase {
public void setAutoID(boolean autoID) {
this.autoID = autoID;
}
public boolean isArmor(){
if(this.isHeavyArmor())
return true;
if(this.isMediumArmor())
return true;
if(this.isLightArmor())
return true;
if(this.isClothArmor())
return true;
return false;
}
}

Loading…
Cancel
Save