Initial refactor of damagetype

This commit is contained in:
2024-04-01 09:19:37 -04:00
parent adfbf87056
commit a29269e335
32 changed files with 447 additions and 380 deletions
+10 -10
View File
@@ -38,7 +38,7 @@ public enum CombatManager {
case PlayerCharacter:
case Mob:
PlayerBonuses bonuses = ((AbstractCharacter) target).getBonuses();
if (bonuses != null && bonuses.getBool(Enum.ModType.ImmuneToAttack, Enum.SourceType.NONE))
if (bonuses != null && bonuses.getBool(Enum.ModType.ImmuneToAttack, Enum.SourceType.None))
return;
break;
case NPC:
@@ -90,7 +90,7 @@ public enum CombatManager {
if (weapon != null) {
if (bonus != null)
rangeMod += bonus.getFloatPercentAll(Enum.ModType.WeaponRange, Enum.SourceType.NONE);
rangeMod += bonus.getFloatPercentAll(Enum.ModType.WeaponRange, Enum.SourceType.None);
attackRange = weapon.template.item_weapon_max_range * rangeMod;
}
@@ -210,15 +210,15 @@ public enum CombatManager {
//get the damage type
Enum.SourceType damageType;
Enum.DamageType damageType;
if (attacker.charItemManager.getEquipped().get(slot) == null) {
damageType = Enum.SourceType.CRUSHING;
damageType = Enum.DamageType.Crush;
if (attacker.getObjectType().equals(Enum.GameObjectType.Mob))
if (((Mob) attacker).isSiege())
damageType = Enum.SourceType.SIEGE;
damageType = Enum.DamageType.Siege;
} else {
damageType = (Enum.SourceType) attacker.charItemManager.getEquipped().get(slot).template.item_weapon_damage.keySet().toArray()[0];
damageType = (Enum.DamageType) attacker.charItemManager.getEquipped().get(slot).template.item_weapon_damage.keySet().toArray()[0];
}
//get resists
@@ -318,11 +318,11 @@ public enum CombatManager {
int wepSpeed = (int) (weapon.template.item_weapon_wepspeed);
if (weapon.getBonusPercent(Enum.ModType.WeaponSpeed, Enum.SourceType.NONE) != 0f) //add weapon speed bonus
wepSpeed *= (1 + weapon.getBonus(Enum.ModType.WeaponSpeed, Enum.SourceType.NONE));
if (weapon.getBonusPercent(Enum.ModType.WeaponSpeed, Enum.SourceType.None) != 0f) //add weapon speed bonus
wepSpeed *= (1 + weapon.getBonus(Enum.ModType.WeaponSpeed, Enum.SourceType.None));
if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(Enum.ModType.AttackDelay, Enum.SourceType.NONE) != 0f) //add effects speed bonus
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(Enum.ModType.AttackDelay, Enum.SourceType.NONE));
if (attacker.getBonuses() != null && attacker.getBonuses().getFloatPercentAll(Enum.ModType.AttackDelay, Enum.SourceType.None) != 0f) //add effects speed bonus
wepSpeed *= (1 + attacker.getBonuses().getFloatPercentAll(Enum.ModType.AttackDelay, Enum.SourceType.None));
if (wepSpeed < 10)
wepSpeed = 10; //Old was 10, but it can be reached lower with legit buffs,effects.