Browse Source

PlayerCombatStats use in combat

lakebane-dex-penalty
FatBoy-DOTC 6 days ago
parent
commit
becd3cbf65
  1. 58
      src/engine/gameManager/CombatManager.java

58
src/engine/gameManager/CombatManager.java

@ -483,16 +483,24 @@ public enum CombatManager {
createTimer(abstractCharacter, slot, 20, true); //2 second for no weapon createTimer(abstractCharacter, slot, 20, true); //2 second for no weapon
else { else {
int wepSpeed = (int) (wb.getSpeed()); int wepSpeed = (int) (wb.getSpeed());
if(abstractCharacter.getObjectType().equals(GameObjectType.PlayerCharacter)){
PlayerCharacter pc = (PlayerCharacter)abstractCharacter;
if(slot == 1){
wepSpeed = (int) pc.combatStats.attackSpeedHandOne;
}else{
wepSpeed = (int) pc.combatStats.attackSpeedHandTwo;
}
}else {
if (weapon != null && weapon.getBonusPercent(ModType.WeaponSpeed, SourceType.None) != 0f) //add weapon speed bonus if (weapon != null && weapon.getBonusPercent(ModType.WeaponSpeed, SourceType.None) != 0f) //add weapon speed bonus
wepSpeed *= (1 + weapon.getBonus(ModType.WeaponSpeed, SourceType.None)); wepSpeed *= (1 + weapon.getBonus(ModType.WeaponSpeed, SourceType.None));
if (abstractCharacter.getBonuses() != null && abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, SourceType.None) != 0f) //add effects speed bonus
wepSpeed *= (1 + abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, SourceType.None));
if (wepSpeed < 10) if (abstractCharacter.getBonuses() != null && abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, SourceType.None) != 0f) //add effects speed bonus
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects. wepSpeed *= (1 + abstractCharacter.getBonuses().getFloatPercentAll(ModType.AttackDelay, SourceType.None));
if (wepSpeed < 10)
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.
}
createTimer(abstractCharacter, slot, wepSpeed, true); createTimer(abstractCharacter, slot, wepSpeed, true);
} }
@ -536,15 +544,27 @@ public enum CombatManager {
if (target == null) if (target == null)
return; return;
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
if (mainHand) { PlayerCharacter pc = (PlayerCharacter) ac;
atr = ac.getAtrHandOne(); if (mainHand) {
minDamage = ac.getMinDamageHandOne(); atr = pc.combatStats.atrHandOne;
maxDamage = ac.getMaxDamageHandOne(); minDamage = pc.combatStats.minDamageHandOne;
} else { maxDamage = pc.combatStats.maxDamageHandOne;
atr = ac.getAtrHandTwo(); } else {
minDamage = ac.getMinDamageHandTwo(); atr = pc.combatStats.atrHandTwo;
maxDamage = ac.getMaxDamageHandTwo(); minDamage = pc.combatStats.minDamageHandTwo;
maxDamage = pc.combatStats.maxDamageHandTwo;
}
}else {
if (mainHand) {
atr = ac.getAtrHandOne();
minDamage = ac.getMinDamageHandOne();
maxDamage = ac.getMaxDamageHandOne();
} else {
atr = ac.getAtrHandTwo();
minDamage = ac.getMinDamageHandTwo();
maxDamage = ac.getMaxDamageHandTwo();
}
} }
boolean tarIsRat = false; boolean tarIsRat = false;
@ -638,7 +658,11 @@ public enum CombatManager {
} }
} else { } else {
AbstractCharacter tar = (AbstractCharacter) target; AbstractCharacter tar = (AbstractCharacter) target;
defense = tar.getDefenseRating(); if(tar.getObjectType().equals(GameObjectType.PlayerCharacter)){
defense = ((PlayerCharacter)tar).combatStats.defense;
}else {
defense = tar.getDefenseRating();
}
handleRetaliate(tar, ac); //Handle target attacking back if in combat and has no other target handleRetaliate(tar, ac); //Handle target attacking back if in combat and has no other target
} }

Loading…
Cancel
Save