Browse Source

PlayerCombatStats use in combat

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

28
src/engine/gameManager/CombatManager.java

@ -483,6 +483,14 @@ 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));
@ -492,7 +500,7 @@ public enum CombatManager {
if (wepSpeed < 10) if (wepSpeed < 10)
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects. 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,7 +544,18 @@ public enum CombatManager {
if (target == null) if (target == null)
return; return;
if(ac.getObjectType().equals(GameObjectType.PlayerCharacter)){
PlayerCharacter pc = (PlayerCharacter) ac;
if (mainHand) {
atr = pc.combatStats.atrHandOne;
minDamage = pc.combatStats.minDamageHandOne;
maxDamage = pc.combatStats.maxDamageHandOne;
} else {
atr = pc.combatStats.atrHandTwo;
minDamage = pc.combatStats.minDamageHandTwo;
maxDamage = pc.combatStats.maxDamageHandTwo;
}
}else {
if (mainHand) { if (mainHand) {
atr = ac.getAtrHandOne(); atr = ac.getAtrHandOne();
minDamage = ac.getMinDamageHandOne(); minDamage = ac.getMinDamageHandOne();
@ -546,6 +565,7 @@ public enum CombatManager {
minDamage = ac.getMinDamageHandTwo(); minDamage = ac.getMinDamageHandTwo();
maxDamage = ac.getMaxDamageHandTwo(); 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;
if(tar.getObjectType().equals(GameObjectType.PlayerCharacter)){
defense = ((PlayerCharacter)tar).combatStats.defense;
}else {
defense = tar.getDefenseRating(); 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