forked from MagicBane/Server
Refactored isShield and removed equipflag.
This commit is contained in:
@@ -4088,19 +4088,29 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
* @ Calculates Defense for shield
|
||||
*/
|
||||
private float getShieldDefense(Item shield) {
|
||||
|
||||
if (shield == null)
|
||||
return 0;
|
||||
ItemBase ab = shield.getItemBase();
|
||||
if (ab == null || !ab.isShield())
|
||||
|
||||
if (ItemTemplate.isShield(shield) == false)
|
||||
return 0;
|
||||
|
||||
ItemBase ab = shield.getItemBase();
|
||||
|
||||
if (ab == null)
|
||||
return 0;
|
||||
|
||||
CharacterSkill blockSkill = this.skills.get("Block");
|
||||
|
||||
float skillMod;
|
||||
|
||||
if (blockSkill == null) {
|
||||
skillMod = 0;
|
||||
} else
|
||||
skillMod = blockSkill.getModifiedAmount();
|
||||
|
||||
float def = ab.getDefense();
|
||||
|
||||
//apply item defense bonuses
|
||||
if (shield != null) {
|
||||
def += shield.getBonus(ModType.DR, SourceType.NONE);
|
||||
@@ -4127,7 +4137,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
//set block if block found
|
||||
this.bonuses.setBool(ModType.Block, SourceType.NONE, false);
|
||||
if (this.baseClass != null && (this.baseClass.getObjectUUID() == 2500 || this.baseClass.getObjectUUID() == 2501))
|
||||
if (off != null && off.getItemBase() != null && off.getItemBase().isShield())
|
||||
if (off != null && off.getItemBase() != null && ItemTemplate.isShield(off))
|
||||
this.bonuses.setBool(ModType.Block, SourceType.NONE, true);
|
||||
|
||||
//set dodge if rogue
|
||||
@@ -4194,7 +4204,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
boolean unarmed = false;
|
||||
if (weapon == null) {
|
||||
weapon = equipped.get(EquipSlotType.LHELD);
|
||||
if (weapon == null || weapon.getItemBase().isShield())
|
||||
if (weapon == null || ItemTemplate.isShield(weapon))
|
||||
unarmed = true;
|
||||
else
|
||||
wb = weapon.getItemBase();
|
||||
|
||||
Reference in New Issue
Block a user